Repository navigation
fix(api): the schema-coverage gate was a count, so the gap grew to 15 unseen - #711
Merged
Merged
Conversation
Found doing a consistency sweep after #688, which asserted the opposite of what these two documents say. Both describe intent in the present tense, so a reader hitting the skill and the design doc could not tell which was current. **`entity-framework-design.md` has the control lane typed through `openapi-fetch` and `schema.d.ts`.** It is not: nothing under `frontend/src` imports `schema.d.ts`, `openapi-fetch` has no call sites, and the document carries no `paths` — `schema.d.ts` opens with `export type paths = Record<string, never>`, so there is nothing for a typed client to type a route against. The types that reach components come from `bindings/<Entity>.ts`. Marked as design-not-state at the load-bearing paragraph rather than rewritten, because the design is still the intent; the narrative passages later in the document are left alone deliberately. **`batch-orchestration-design.md` cited a schema count twice**, as "12 → 13", against a document that carried 14 before this branch — the stale-count failure the entity-framework skill was itself fixed for. Both now name the condition (`TaskInstance` declares `wire: [json]`, so a schema is required) instead of a number that moves whenever anyone registers one. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
… unseen `every_generated_entity_schema_is_registered` asserted `schemas.len() == 14` against `ApiDoc`'s own hand-written registration list. That cannot see an entity arriving unregistered, because the count does not change — so the test's name promised a gate that did not exist. #688 documented the defect; this fixes it. The invariant was already declared and already derivable. `Wire::Json`'s own doc comment said "the OpenAPI component schema is emitted", and `generate.wire` in each `entity.yaml` says which entities cross the JSON wire. Deriving that set from the catalog and subtracting the registered schemas shows **15 entities declare `wire: [json]` with no component schema**: candidate_key, column_profile, entity_link, ingest_batch, matching_model, metric_snapshot, metric_snapshot_source, pair_label, profile_finding, profile_run, record_quality, s3_ingest_cursor, tag, tagging, webhook_delivery. The drift the count could not see had already happened 15 times. So the replacement is a set difference pinned to that list: - `every_json_wire_entity_has_a_schema_or_a_declared_gap` — a new `wire: [json]` entity fails until it is registered or named in `JSON_WIRE_WITHOUT_SCHEMA`, and a **stale** entry fails too, so the list cannot accumulate names and hide the next real gap. - `no_schema_is_registered_for_an_entity_that_is_not_on_the_json_wire` — the other direction, which holds today and would otherwise rot silently. Registering the 15 is deliberately **not** done here. Each becomes a documented schema that `er-openapi-check` then tracks for breaking changes, which is a public-API decision rather than a formality; the gate's job is to force the decision at the point an entity is added, not to make it. Two supporting changes, each the smallest version of itself. `er-entity-gen`'s `casing` module becomes public so the test maps an entity name to its struct name with the generator's own function rather than a second copy that could disagree — the mapping is the one thing a hand-rolled duplicate would get wrong. And `Wire::Json`'s doc comment now says it declares rather than emits, because asserting the invariant was how the gap stayed invisible. Both new tests guard their own derivation (a catalog that came back empty, or a json-wire set that came back small, fails loudly) — a vacuous gate is the exact failure being replaced. The `api-contract` skill is updated in the same commit: it documented the old test by name, and in two places promised that nothing would catch a forgotten registration. Leaving that would recreate the drift #688 existed to remove. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…there are seven #705 added a seventh case and #709 added the warning not to reason from the list's length, but the intro paragraph above both still said "the six ways the obvious reading is wrong". Drops the number, which is the fix the standard prescribes and the one that cannot go stale again. This is all that survives of a larger change this branch originally carried. #709 landed the same `conclusion` correction first and better — it normalises with `(.conclusion // "") == ""` rather than testing two branches, and it also fixed the main assertion block and `post-merge.md`, neither of which this branch had touched. The zero-job disambiguation is dropped too: `action_required` and the starved `steps: []` case are each already documented in their own sections, and a third paragraph tying them together would be the duplication an audit should flag rather than add. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
athvin
force-pushed
the
fix/openapi-schema-coverage-gate
branch
from
November 6, 2026 06:20
e3ec815 to
85089b3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The follow-ups flagged at the end of #688, done — one commit each, plus the consistency sweep that turned up two more.
1. The schema-coverage gate is now a set difference (
e3ec815b)every_generated_entity_schema_is_registeredassertedschemas.len() == 14againstApiDoc's own hand-written list. A count cannot see an entity arriving unregistered, because the count doesn't change — the test's name promised a gate that didn't exist.I deferred this in #688 thinking it needed a design call on which entities belong on the control lane. It doesn't: the signal is already declared. Each
entity.yamlhasgenerate.wire, andWire::Json's own doc comment said "the OpenAPI component schema is emitted". Deriving that set from the catalog and subtracting the registered schemas shows 15 entities declarewire: [json]with no component schema — so the drift the count couldn't see had already happened 15 times.every_json_wire_entity_has_a_schema_or_a_declared_gapwire: [json]entity fails until registered or named inJSON_WIRE_WITHOUT_SCHEMA; a stale entry fails too, so the list can't accumulate names and hide the next gapno_schema_is_registered_for_an_entity_that_is_not_on_the_json_wireRegistering the 15 is deliberately not done here. Each becomes a documented schema that
er-openapi-checkthen tracks for breaking changes — a public-API decision. The gate's job is to force that decision when an entity is added, not to make it.Supporting changes, each the smallest version of itself:
er-entity-gen'scasingmodule becomes public so the test uses the generator's own entity-name → struct-name mapping instead of a duplicate that could disagree, andWire::Json's doc comment now says it declares rather than emits, since asserting the invariant is how the gap stayed invisible. Both tests guard their own derivation — an empty catalog fails loudly, because a vacuous gate is the failure being replaced.2.
rust.yml's concurrency group — skipped, and I disagree with my own flagI flagged the merge-burst cancellation as worth fixing. Having looked properly:
cancel-in-progressis correctlyfalsefor pushes, and the run that survives a burst tests the accumulated tree, which is exactly what a post-merge gate is for. Dropping the group or keying it per-SHA would multiply full Rust runs during precisely the bursts where they're most redundant, and this repo's CI cost tracks run count. What's actually lost is per-commit attribution, recoverable by bisection, and the merge bus already covers proving a combination. No workflow change.3. The polling traps (
3b7e32fb)What actually cost the time was misreading those runs, not the cancellation — so that's the half worth fixing. #705 landed the same finding first and better, so this branch's duplicate
SKILL.mdbullet is dropped entirely. But #705 prescribes "pollconclusion == null", andgh run list --json conclusionreports an unresolved run as the empty string, nevernull. Verified against four live unresolved runs, one apendingrust run onmain:is_null: false, is_empty: truefor every one. So that predicate matches nothing and reproduces the bug #705 was closing. Corrected, with the predicate pair that works and the zero-job disambiguation (pending vs starved vs held-bot — three causes, one symptom).4. Consistency sweep (
bb6fa72c)Two documents assert, in the present tense, things #688 established are false:
entity-framework-design.mdhas the control lane typed throughopenapi-fetchandschema.d.ts. Nothing underfrontend/srcimportsschema.d.ts,openapi-fetchhas no call sites, andschema.d.tsopens withexport type paths = Record<string, never>— there is no route for a typed client to type against. Marked design-not-state at the load-bearing paragraph; the later narrative passages left alone deliberately.batch-orchestration-design.mdcited the schema count twice as "12 → 13" against a document carrying 14 — the stale-count failure the entity-framework skill was itself fixed for. Both now name the condition instead of a number.Also fixed in commit 1: the
api-contractskill documented the old test by name and promised in two places that nothing would catch a forgotten registration. Both are now false, and leaving them would recreate the exact drift #688 existed to remove.Verification
bash scripts/skills-check.sh all— green, with the command last so the exit code is its own.cargo check -p er-entity-gen -p er-entity-spec --all-targets— clean.cargo test -p er-server --lib openapi— running locally; CI'stestjob is the authoritative run and gates this PR.gh/gitcommands added topolling.mdwere executed against this repo, not written from memory.Message-only history rewrite after the rebase;
HEAD^{tree}verified byte-identical before and after.🤖 Generated with Claude Code