fix(test): state the mirrored-verb set instead of reading this repo's ward.yaml #1682

Merged
coilyco-ops merged 1 commit from fix/pr-repair-verb-lookup into main 2026-08-25 08:38:39 +00:00
Owner

Closes #1681. Unblocks #1680, which is a two-line docs change that has been sitting on this failure.

What was actually wrong

TestClassifyForgejoPRRepairBuckets never had a verb fixture. classifyForgejoPRRepair asks repoHasWardExecVerb whether the failing workflow has a local mirror, that reads this repo's own .ward/ward.yaml through loadDefault(), and the test passed only because the repo happened to declare a test verb.

6c167db (dev verbs move to the justfile) stripped the nineteen commands: entries. So test stopped looking mirrored, and main-red, merge-queue-churn and pr-regression all fell into ci-parity-gap — the first branch that no longer had a way out. That is why exactly three of four subtests failed and the fourth, which wants ci-parity-gap, kept passing.

The commit message for 6c167db says it reverted the mechanical sweep in two places it knew about. This was a third coupling it could not see, because nothing in the diff mentions the test.

The fix

The product behavior is correct and unchanged: an adopter still declares verbs in .ward/ward.yaml, which is what the classifier asks about. What was wrong is a unit test silently reading whatever configuration sat on disk beside it. So the lookup is indirected and the test states the verb set it means.

The ci-parity-gap case keeps its unmirrored workflow name, so all four branches stay exercised rather than the fix flattening the test into agreement.

Three hooks cleared alongside

code-comments walks the whole tree, so these blocked any commit here, not just mine:

  • two comment blocks over the two-line cap, plus one this change introduced
  • docs/ward-agent-dispatch.md, referenced twice from agent.go. I checked history with --diff-filter=ADR: it was never written, not moved. A pointer to a doc nobody wrote reads as "documentation exists", so the comments now name the code that is the contract
  • docs/documentation-bands.md, an agentic-os doc the local resolver cannot reach. Reworded to name it without a repo-local path

One correction to #1681

The issue says no doc in docs/ mentions autonomy at all. docs/agent-lifecycle.md:39 does, but only as "mode ceiling" in a list of error cases, so the conclusion holds: the autonomy-ceiling contract is undocumented. I did not write that doc. It is a security gate and I would have been reverse-engineering it, which is the same call the issue author made. Worth its own issue if you want it closed.

Verification

  • the four subtests pass, ci_parity_gap included
  • go build ./..., go vet ./cmd/ward clean
  • go test ./cmd/ward passes (122s locally, no docker)
  • pre-commit run --all-files fully green
  • ./scripts hangs locally in release_contract_test.go on a syscall, pre-existing and environment-only. CI runs it in 3.8s. My diff is cmd/ward only
Closes #1681. Unblocks #1680, which is a two-line docs change that has been sitting on this failure. ## What was actually wrong `TestClassifyForgejoPRRepairBuckets` never had a verb fixture. `classifyForgejoPRRepair` asks `repoHasWardExecVerb` whether the failing workflow has a local mirror, that reads **this repo's own `.ward/ward.yaml`** through `loadDefault()`, and the test passed only because the repo happened to declare a `test` verb. `6c167db` (dev verbs move to the justfile) stripped the nineteen `commands:` entries. So `test` stopped looking mirrored, and `main-red`, `merge-queue-churn` and `pr-regression` all fell into `ci-parity-gap` — the first branch that no longer had a way out. That is why exactly three of four subtests failed and the fourth, which wants `ci-parity-gap`, kept passing. The commit message for `6c167db` says it reverted the mechanical sweep in two places it knew about. This was a third coupling it could not see, because nothing in the diff mentions the test. ## The fix The product behavior is correct and unchanged: an adopter still declares verbs in `.ward/ward.yaml`, which is what the classifier asks about. What was wrong is a unit test silently reading whatever configuration sat on disk beside it. So the lookup is indirected and the test states the verb set it means. The `ci-parity-gap` case keeps its unmirrored workflow name, so all four branches stay exercised rather than the fix flattening the test into agreement. ## Three hooks cleared alongside `code-comments` walks the whole tree, so these blocked any commit here, not just mine: - two comment blocks over the two-line cap, plus one this change introduced - `docs/ward-agent-dispatch.md`, referenced twice from `agent.go`. I checked history with `--diff-filter=ADR`: it was **never written**, not moved. A pointer to a doc nobody wrote reads as "documentation exists", so the comments now name the code that is the contract - `docs/documentation-bands.md`, an agentic-os doc the local resolver cannot reach. Reworded to name it without a repo-local path ## One correction to #1681 The issue says no doc in `docs/` mentions autonomy at all. `docs/agent-lifecycle.md:39` does, but only as "mode ceiling" in a list of error cases, so the conclusion holds: **the autonomy-ceiling contract is undocumented.** I did not write that doc. It is a security gate and I would have been reverse-engineering it, which is the same call the issue author made. Worth its own issue if you want it closed. ## Verification - the four subtests pass, `ci_parity_gap` included - `go build ./...`, `go vet ./cmd/ward` clean - `go test ./cmd/ward` passes (122s locally, no docker) - `pre-commit run --all-files` fully green - `./scripts` hangs locally in `release_contract_test.go` on a syscall, pre-existing and environment-only. CI runs it in 3.8s. My diff is `cmd/ward` only
fix(test): state the mirrored-verb set instead of reading this repo's ward.yaml
All checks were successful
test / test (pull_request) Successful in 51s
12d096a088
main has been red since 2026-08-17 and nothing has promoted or released since,
so every PR inherits the failure on its first run.

TestClassifyForgejoPRRepairBuckets never had a verb fixture. classifyForgejoPRRepair
asks repoHasWardExecVerb whether the failing workflow has a local mirror, that
reads the repo's own .ward/ward.yaml through loadDefault, and the test passed
only because this repo happened to declare a `test` verb. Moving the nineteen
dev verbs to the justfile took the declaration away, so `test` stopped looking
mirrored and main-red, merge-queue-churn and pr-regression all classified as
ci-parity-gap: the first branch that no longer had a way out.

The product behavior is right and unchanged. An adopter still declares verbs in
.ward/ward.yaml, which is what the classifier asks about. What was wrong is a
unit test silently reading whatever configuration sat on disk beside it, so the
lookup is indirected and the test now states the verb set it means. The
ci-parity-gap case keeps its unmirrored workflow, so all four branches stay
exercised.

Also clears the three hooks that were failing on clean main alongside it, since
code-comments walks the whole tree and blocks any commit here:

* two comment blocks over the two-line cap, plus one this change introduced
* docs/ward-agent-dispatch.md, referenced twice from agent.go and never written
  in this repo's history. A pointer to a doc nobody wrote reads as "documentation
  exists" and is worse than none, so the comments now name the code that is the
  contract. The autonomy ceiling is still undocumented, which stays on #1681
  rather than being papered over here
* docs/documentation-bands.md, an agentic-os doc the local resolver cannot
  reach. Reworded to name it without a repo-local path

Closes #1681

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-authored-by: Kai Siren <coilysiren@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
Agent-Role: platform
Commenting is not possible because the repository is archived.
No reviewers
No milestone
No project
No assignees
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
coilyco-flight-deck/ward!1682
No description provided.