You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 9ea004c
Browse filesBrowse the repository at this point in the historyBrowse files
authored
The tool-contract guard sees a gitlink rollback, with the cells tested (refresh of #1090) (#2497)
* fix(ci): the tool-contract guard sees a gitlink rollback, with the cells tested
Refresh of #1090, which was re-reviewed clean in August and never merged.
The direction check is theirs; the tests are what they said they could
not write, and two of their coupled assumptions needed re-scoping.
Measured on main 9ac61bd through the suite's own injected-exec seam: a
pin that is a strict ancestor of the merge base's pin returns
`contained`. Containment cannot catch a rollback — a rollback is by
definition to a commit the branch already had — so #1089's exact shape
passes today. A human caught that one by reading the diff.
#1090's "Not verified" section named two gaps. Both are closed here: the
forward-bump cell is exercised rather than argued, and the guard now has
unit coverage, because a suite with an injected exec exists now and did
not in August.
TWO PINNED ASSERTIONS CHANGED, both because the direction probe adds one
superproject git call on every path:
- "reports contained without ancestry when the pin is the branch tip"
asserted no `merge-base` call anywhere. Its own comment says it means
the ancestry walk, so it is now scoped to submodule calls. It still
fails if containment ever walks ancestry on the tip path.
- "caps the first fetch at depth 1" simulated a missing ref with
`mockImplementationOnce`, i.e. positionally on the first exec call.
The direction probe is now first, so the mock landed on the wrong call
and the ref-absence case silently stopped being tested. It targets the
ref probe by shape instead.
Honest about the new tests: the revert mutation reds 2 of the 4 new
cells. The other two assert `contained`, which main also answers, so they
are future-regression guards on the check's narrowness rather than
evidence about this change — labelled as such in the file.
Fixes#2496
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: nova <WyJub3ZhIiwiZGVmYXVsdCJd@agents.commonly.invalid>
Agent-Model: claude/claude-opus-5/high
* fix(ci): make the pin-direction check actually run in CI, and say so when it cannot
@otto's gate on #2497 found the defect: the direction probe was correct and
dead. `tests.yml`'s tool-tests job checks out with `submodules: recursive` and
no `fetch-depth`, so `origin/main` does not exist on a pull_request, no merge
base resolves, the probe returned `undetermined` — and the caller dropped that
verdict on the floor. The check never fired on a single PR, and a test cell
pinned the fall-through as a pass.
Three repairs, one invariant:
- `checkPinDirection` is its own exported function, not a closure inside
`checkPinReachable`. Containment asks "is the pin on the branch"; direction
asks "did it move backward"; a rollback answers YES to the first. Split, a
containment harness cannot answer for direction, and the direction verdict
reaches `main()` on its own — exit 1 for a rollback, exit 2 for undetermined.
- An unresolvable base is LOUD: `undetermined`, naming `fetch-depth: 0` as the
repair. The probe does not fetch to paper over it — that would hide a
misconfigured job and pay the 11.4s/314M cost this file measures.
- The tool-tests job checks out with `fetch-depth: 0`, which is what lets it
answer. Pinned by a test that reads the workflow, scoped to the job that
runs the guard.
`GITHUB_BASE_REF` now takes precedence over `main`, not the other way round:
at depth 0 both refs resolve, so a fallback would be dead code and every
stacked PR would be judged against main — a base behind the real one, holding
a pin the PR never touched, i.e. a false rollback.
Measured with real git, both topologies: `origin/main` present → ok;
the ref removed → undetermined. Each of the three repairs reverted in turn reds
exactly one cell, the one that claims it. 60/60 in the suite, and green again
under `GITHUB_BASE_REF=nova/some-parent`, the stacked-PR environment that would
otherwise have red this suite in CI only.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: nova <WyJub3ZhIiwiZGVmYXVsdCJd@agents.commonly.invalid>
Agent-Model: claude/claude-opus-5/high
* fix(ci): say which base the direction check used, on the pass path too
A check that prints nothing when it is happy is indistinguishable from a check
that is not running — which is exactly how this one stayed dead for two months
while its probe returned `undetermined` on every pull request. The verdict now
names the ref it compared against, so the CI log distinguishes "compared
against origin/main, no rollback" from silence.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: nova <WyJub3ZhIiwiZGVmYXVsdCJd@agents.commonly.invalid>
Agent-Model: claude/claude-opus-5/high
---------
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: nova <WyJub3ZhIiwiZGVmYXVsdCJd@agents.commonly.invalid>
0 commit comments