Skip to content

fix(app-spec): seed arrays/objects are column values, not nested rows - #48

Merged
NorOldBurden merged 2 commits into
mainfrom
fix/app-spec-seed-value
Nov 6, 2026
Merged

NorOldBurden merged 2 commits into
mainfrom
fix/app-spec-seed-value

Conversation

@NorOldBurden

@NorOldBurden NorOldBurden commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

What

seedValue allows arrays and objects because JSON and array columns take them (the agent fixture seeds parts: []). The ambiguity was that the contract never said so, and a model read the permissive value as a nested related row, which the seed step does not create.

  • Keep the scalar, array and object forms.
  • Add the missing description: a column value, or a "@<table>[<index>]" foreign-key reference; an array or object is a JSON/array column value, not a nested row.

No type change: the earlier tightening broke parts: []. The desktop's seed error now names the FK column when an object lands on a missing column.

Test

The existing food-bank fixture and the desktop's blueprint-seed fixture (parts: []) stay valid. No behavior change in the template.

The desktop harness vendors this contract; its PR runs pnpm sync:app-spec after this merges.

Refs constructive-io/constructive-planning#2432

The schema advertised array and object seed values while the validator
only accepts values for declared columns and "@<table>[<index>]" references.
A model following the schema sent a nested row and got "has no column" from
the seed checks.

seedValue now points at the scalar definition; the FK reference is a string,
and the seed description keeps naming it. The added test accepts the reference
and refuses a nested row at the value's path.
@luxor-code-review

luxor-code-review Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Review complete. No issues found.


This change aligns the app-spec JSON schema with the validator's actual behavior: seed values must be scalars or "@<table>[<index>]" references, not arrays or objects, fixing the "has no column" error a schema-following model hit during seeding.

Files Change
shared/gen/app-spec.schema.json Repoints seedValue from array/object alternatives to the scalar definition and documents the string FK-reference form.
shared/gen/__tests__/app-spec-schema.test.ts Adds test cases asserting an FK reference validates and a nested row is rejected at the value's path.

Two low-confidence issues below the review threshold were noted (side-effect narrowing of field.default for json-typed fields, and the FK-reference string having no pattern constraint) but neither met the confidence bar for inclusion as findings.

Reviewed commit: 76fcd11

An earlier pass removed array and object seed values, but they are valid for
JSON and array columns (the agent fixture seeds parts: []). Restore them and
say what they mean: a column value, or a "@<table>[<index>]" foreign-key
reference. An array or object is a JSON/array column value, not a nested
related row.
@NorOldBurden NorOldBurden changed the title fix(app-spec): seed values are scalars, not arrays or objects fix(app-spec): seed arrays/objects are column values, not nested rows Nov 6, 2026
@NorOldBurden
NorOldBurden merged commit 098334b into main Nov 6, 2026
3 checks passed
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.

1 participant