Skip to content

W21: a field the schema does not declare - #16

Merged
inhuman merged 1 commit into
mainfrom
field-of-a-declared-schema
Aug 18, 2026
Merged

W21: a field the schema does not declare#16
inhuman merged 1 commit into
mainfrom
field-of-a-declared-schema

Conversation

@inhuman

@inhuman inhuman commented Aug 18, 2026

Copy link
Copy Markdown
Owner

W14 stops one level short. It asks whether a NAME exists, and a name that
exists satisfies it — so pick.name passes while the step saving pick
declares only index. The engine resolves a missing field to an empty string
exactly as it does a missing name, so a condition on it is never true and the
branch is quietly never taken.

Found on a live catalogue: a bail-out branch keyed on pick.name had not run
once since it was written, while its author believed the behaviour was in
effect and had committed it as the important one of that change.

Scope, and what it deliberately does not do

Only variables with a declared schema are checked, and only the first level
of the path. A tool's result has no shape this package can know, and inventing
one would produce findings about fields that are really there — the fastest way
to teach an author to skip the report. The engine's own suffixes (mem,
skipped, failed) are legitimate on any variable and are not fields of the
answer.

Verified against a live catalogue

Zero findings on a clean catalogue, and — reintroducing the original defect for
one run — the rule fires with the difference spelled out:

[error] W21: step `#11` reads `pick.name`, but the schema of `pick` declares
no field `name` … Declared: index

Carries a fixture (schema-field.yaml) so it cannot stop firing unnoticed.

🤖 Generated with Claude Code

W14 stops one level short. It asks whether a NAME exists, and a name that
exists satisfies it — so `pick.name` passes while the step saving `pick`
declares only `index`. The engine resolves a missing field to an empty
string exactly as it does a missing name, so a condition on it is never
true and the branch is quietly never taken.

Found on a live catalogue: a bail-out branch keyed on `pick.name` had not
run once since it was written, while its author believed the behaviour
was in effect and had committed it as the important one of that change.

Only variables with a DECLARED schema are checked, and only the first
level of the path. A tool's result has no shape this package can know,
and inventing one would produce findings about fields that are really
there — the fastest way to teach an author to skip the report. The
engine's own suffixes (`mem`, `skipped`, `failed`) are legitimate on any
variable and are not fields of the answer.
@inhuman
inhuman merged commit 0f5c253 into main Aug 18, 2026
1 check passed
@inhuman
inhuman deleted the field-of-a-declared-schema branch August 18, 2026 21:17
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