Problem
DataSource (Schema/Models/DataSource.cs) stores a RelativeFilePath File and a ClassName, and nothing in the solution ever opens that file. It is a metadata shell — the second of the two the roadmap calls out (Phase 4).
The immediate blocker is that RelativeFilePath has no anchor. Nothing in the codebase or docs defines what the path is relative to, so a data source path cannot be resolved even in principle. Schema itself has no notion of where it was loaded from — SchemaFile.TryLoad (SchemaEditor) knows the path but doesn't hand it to the model.
Scope
1. Path resolution (prerequisite)
- Define resolution relative to the
.schema.json file's own location and document it in the format docs.
- Give the core library a way to know that location — e.g. a source-path property populated by the loader, or a resolution API that takes the schema file path as a parameter. Keep
SchemaSerializer filesystem-free if that separation is intended; the anchor can be passed in.
- Validation can then report a data source whose file does not exist.
2. Data loading and validation
Load the JSON a DataSource points at and validate it against the referenced class: required members present, values conform to member types, enum values are members of the referenced enum, container shapes match (vector → array, map → object keyed by the array's Key member). This is the foundation the migration work is checked against.
3. Generated data editors
Extend the Phase 3 generator architecture so a generator can consume a DataSource (class + file binding) and emit a typed editor for that data.
4. Generated migrations
Detect schema changes affecting bound data files — renamed, removed, or retyped members, enum value changes — and generate migration code or scripts that upgrade the data in place. Depends on the .schema.json format version field and on a schema-diff capability.
Items 3 and 4 are substantial in their own right and should become separate issues once 1 and 2 land; this issue tracks the phase and its sequencing.
Acceptance criteria
Problem
DataSource(Schema/Models/DataSource.cs) stores aRelativeFilePath Fileand aClassName, and nothing in the solution ever opens that file. It is a metadata shell — the second of the two the roadmap calls out (Phase 4).The immediate blocker is that
RelativeFilePathhas no anchor. Nothing in the codebase or docs defines what the path is relative to, so a data source path cannot be resolved even in principle.Schemaitself has no notion of where it was loaded from —SchemaFile.TryLoad(SchemaEditor) knows the path but doesn't hand it to the model.Scope
1. Path resolution (prerequisite)
.schema.jsonfile's own location and document it in the format docs.SchemaSerializerfilesystem-free if that separation is intended; the anchor can be passed in.2. Data loading and validation
Load the JSON a
DataSourcepoints at and validate it against the referenced class: required members present, values conform to member types, enum values are members of the referenced enum, container shapes match (vector→ array,map→ object keyed by the array'sKeymember). This is the foundation the migration work is checked against.3. Generated data editors
Extend the Phase 3 generator architecture so a generator can consume a
DataSource(class + file binding) and emit a typed editor for that data.4. Generated migrations
Detect schema changes affecting bound data files — renamed, removed, or retyped members, enum value changes — and generate migration code or scripts that upgrade the data in place. Depends on the
.schema.jsonformat version field and on a schema-diff capability.Items 3 and 4 are substantial in their own right and should become separate issues once 1 and 2 land; this issue tracks the phase and its sequencing.
Acceptance criteria
RelativeFilePathresolution for data sources is documented and implemented.Validate()reports a data source pointing at a nonexistent file.