Skip to content

V_delta: schema_version moves from base field to document_class key#55

Merged
stevevanhooser merged 1 commit into
mainfrom
claude/move-schema-version-to-document-class
May 22, 2026
Merged

V_delta: schema_version moves from base field to document_class key#55
stevevanhooser merged 1 commit into
mainfrom
claude/move-schema-version-to-document-class

Conversation

@stevevanhooser
Copy link
Copy Markdown
Contributor

Summary

schema_version names the overarching schema set under which a document is interpreted — it's metadata about the schema generation, not a payload field belonging to any particular class. V_delta previously declared it as a field on base.json, which made the migrator stamp body.base.schema_version and broke NDI-matlab's legacy base validator (declares only session_id/id/name/datestamp under base; the unknown 5th field tripped DID:Database:ValidationFields once #53 + did-matlab #140's superclass fix let validation get past the chain check on NDI-matlab #803).

This PR moves schema_version to document_class.schema_version — a sibling of class_name, class_version, superclasses — and rewords the spec/conversion docs accordingly. The enumerated values continue to live in schemas/V_delta/index.json (schema_version_value, legacy_schema_version_values).

Changes

  • schemas/V_delta/stable/base.json — drop the schema_version declaration from the fields array.
  • V_delta_SPEC.md § 4 — rewrite to describe document_class.schema_version as a structural key on document_class, not a class-scoped field.
  • V_delta_notes.md — update the summary bullet and turn the resolved follow-up into a "resolved differently" note pointing at the new placement.
  • _universal_renames.md § 10body.base.schema_versionbody.document_class.schema_version; describe the dispatcher short-circuit reading from there.
  • _TEMPLATE.md + per-class conversion docs (probe_location, orientation_direction_tuning, contrast_tuning, speed_tuning, spatial_frequency_tuning, temporal_frequency_tuning, treatment) — point at document_class.schema_version instead of "inherited from base".

Merge order

  1. this PR (did-schema #N+1)
  2. did-matlab V2 follow-up: universalRenames writes document_class.schema_version, dispatcher short-circuit reads from there, fixture tests assert document_class.schema_version
  3. NDI-matlab #803 re-run picks both up via the dependency fetch and clears the remaining 16 DID:Database:ValidationFields errors

Test plan

  • did-schema CI green on this PR
  • No remaining base.schema_version references in schemas/ (verified locally — only resolved-history notes remain)
  • After the did-matlab follow-up lands on V2 and NDI #803 re-runs, the structural failure cluster (~16 errors, all same pattern) should clear

Generated by Claude Code


Generated by Claude Code

Previously V_delta declared schema_version inside base.json's fields
array, so the migrator stamped body.base.schema_version. That made
schema_version look like a payload field belonging to every concrete
class, which collided with NDI-matlab's legacy base validator
(src/ndi/ndi_common/schema_documents/base_schema.json declares only
session_id/id/name/datestamp under base; the unknown 5th field tripped
DID:Database:ValidationFields once #140's superclass fix let
validation get past the chain check).

schema_version names the overarching schema set, not a property of
any one class, so it belongs alongside class-level metadata
(class_name, class_version, superclasses). Move it to
document_class.schema_version. The validator treats it as a
structural key on document_class; enumerated values stay in
schemas/V_delta/index.json (schema_version_value,
legacy_schema_version_values).

Changes:
- schemas/V_delta/stable/base.json: drop the schema_version field
  declaration from the fields array.
- V_delta_SPEC.md § 4, _universal_renames.md § 10, V_delta_notes.md,
  _TEMPLATE.md, and the per-class conversion notes that mentioned
  the planned/inherited base field: rewrite to point at
  document_class.schema_version.

Follow-ups in did-matlab (next PR) will:
- have universalRenames write document_class.schema_version (not
  body.base.schema_version);
- update the dispatcher's short-circuit gate to read from there;
- update tests asserting doc.get('base.schema_version').
@stevevanhooser stevevanhooser merged commit 6790dce into main May 22, 2026
4 checks passed
@stevevanhooser stevevanhooser deleted the claude/move-schema-version-to-document-class branch May 22, 2026 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants