Skip to content

fix(skills): the false-green fix was itself a false green — gh returns "", not null - #709

Merged
athvin merged 1 commit into
mainfrom
fix/land-pr-conclusion-predicate
Nov 6, 2026
Merged

athvin merged 1 commit into
mainfrom
fix/land-pr-conclusion-predicate

Conversation

@athvin

@athvin athvin commented Nov 6, 2026

Copy link
Copy Markdown
Owner

Follow-up to #705, which I caught on that PR's own merge commit.

#705 replaced land-pr's status-list poll with select(.conclusion == null). That predicate never matches. gh run list and gh run view both serialise an unfinished run's conclusion as the empty string, not null — so the new form reported the same "nothing outstanding" over a pending run as the form it replaced. It shipped the defect it was written to remove, into the skill whose job is preventing exactly this.

Measured against the live pending rust run on #705's merge commit:

predicate outstanding
select(.conclusion == null) 0 merged in #705, broken
select(.status=="queued" or .status=="in_progress") 0 what #705 replaced
select((.conclusion // "") == "") 1 correct

Raw evidence:

[{"conclusion":"","status":"pending","workflowName":"rust"},
 {"conclusion":"success","status":"completed","workflowName":"frontend"},
 {"conclusion":"success","status":"completed","workflowName":"infra"}]

Why #705's test passed anyway

Its unit test was a hand-written fixture containing "conclusion": null. It asserted the assumption under test rather than gh's actual output, so it could only ever pass — a fixture built from the real command would have failed on the first run. This repo already has the lesson recorded as "mutation-test the scenario too": a check whose precondition is authored to match the belief is decoration.

Verification here is the inverse

The predicate is extracted verbatim from the skill text and executed against a real SHA carrying a pending run, rather than against a fixture I wrote:

PRED=$(grep -o 'select((.conclusion // "") == "")' .claude/skills/land-pr/references/polling.md | head -1)
gh run list --commit <sha> --json workflowName,status,conclusion --jq "[.[]|$PRED]|length"   # -> 1

// "" normalises null, empty and absent, so one form is correct for both gh run list and gh run view.

make skills-check green. Markdown under .claude/ only.

🤖 Generated with Claude Code

…s "", not null

#705 replaced land-pr's status-list poll with `select(.conclusion == null)`.
That predicate never matches: `gh run list` and `gh run view` both serialise an
unfinished run's conclusion as the **empty string**, so the new form reported
the same "nothing outstanding" over a `pending` run as the old one. It shipped
the defect it was written to remove.

Caught on the merge commit of #705 itself: `rust` sat `pending` while the
predicate counted 0 outstanding.

Measured against that live run:

    select(.conclusion == null)                 -> 0   (merged, broken)
    select(.status=="queued" or "in_progress")  -> 0   (what #705 replaced)
    select((.conclusion // "") == "")           -> 1   (correct)

**Why the test in #705 did not catch it.** Its unit test was a hand-written
fixture containing `"conclusion": null` — it asserted the assumption under test
instead of `gh`'s actual output, so it could only ever pass. A fixture built
from the real command would have failed immediately. The repo already has a
memory for this shape ("mutation-test the scenario too"): a check whose
precondition is authored to match the belief is decoration.

The verification here is the inverse: the predicate is extracted verbatim out
of the skill text and executed against a real SHA carrying a pending run.

`// ""` normalises null, empty and absent, so one form is right for both
subcommands.

Gate: `make skills-check`.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@athvin
athvin merged commit 8ca3788 into main Nov 6, 2026
33 checks passed
@athvin
athvin deleted the fix/land-pr-conclusion-predicate branch November 6, 2026 06:19
athvin pushed a commit that referenced this pull request Nov 6, 2026
…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 added a commit that referenced this pull request Nov 6, 2026
… unseen (#711)

* docs: two design-doc claims the frontend never actually implemented

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]>

* fix(api): the schema-coverage gate was a count, so the gap grew to 15 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]>

* docs(skills): polling.md's intro still counted six false greens, and 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]>

---------

Co-authored-by: bmoore813 <[email protected]>
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
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