Skip to content

test: assert review fabric routing by behaviour, not by detector source - #13800

Closed
teamleaderleo wants to merge 1 commit into
mainfrom
fix/review-fabric-routing-contract
Closed

teamleaderleo wants to merge 1 commit into
mainfrom
fix/review-fabric-routing-contract

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Sep 22, 2026 •

Copy link
Copy Markdown
Collaborator

main is red on this guard right now

python3 tests/test_review_fabric.py fails on a clean checkout of origin/main at 5a848ea:

AssertionError: '".github/review-fabric-policy.json"' not found in '#!/usr/bin/env python3
"""Route Linux guards; unknown inputs and non-PR events run every guard."""
...

test_ci_executes_review_fabric_contracts read scripts/ci/detect_linux_guard_changes.py and asserted each review fabric contract path appeared in it as a literal string. #13775 (5c07ba3) derived the Linux guard route inputs from ci-guards.yml instead of listing them, so those literals are gone.

It went unreported because main's most recent ci.yml run is at f3d204a46, which predates #13775. It is not harmless, though: it surfaces on any pull request whose diff routes to the preflight group, which includes anything touching a workflow, script or test.

The routing is fine — the assertion was not

#13775 made routing narrower, not broken. Each contract path reaches exactly the one group that runs these tests:

path linux_guard_tests groups reached
.github/review-fabric-policy.json true preflight
.github/review-fabric.md true preflight
.github/scripts/review_fabric.py true preflight
tests/test_review_fabric.py true preflight, +1

So the test now asserts that: for each contract path, the router selects the guard job and selects a group that runs this file. The owning group is read out of ci-guards.yml via direct_path_owners rather than hardcoded, so a step moving between groups keeps the test honest instead of breaking it — the failure mode this PR is fixing.

Verification

  • Fails on origin/main, passes here.
  • The assertion still bites. Repointing the policy path at another group in PATH_OWNERS fails with:
    AssertionError: frozenset() is not true : .github/review-fabric-policy.json reaches ['release-ios'], none of which runs the review fabric tests
    (perturbation reverted; the diff is one file).
  • Full guard sweep, 119 commands: the only remaining failures are test_check_ghostty_zig_workflows.py (no bashlex installed locally) and test_ghostty_zig_version_sync.sh (ghostty submodule not checked out), both of which fail identically on clean origin/main.

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.


Summary by cubic

Fixes test_ci_executes_review_fabric_contracts, which failed on main once the Linux guard router started deriving its inputs from ci-guards.yml instead of listing each contract path as a literal in the detector source.

  • The test now asserts that each review fabric contract reaches the guard job and the group that runs the test file, instead of grepping the router source for path strings.
  • The owning group is read from ci-guards.yml, so moving a step between groups updates the contract instead of breaking the test.
  • Verified the assertion still fails when a contract is routed to a group that doesn't run the review fabric tests.

Written for commit 1f2ea4c. Summary will update on new commits.

Review in cubic

`test_ci_executes_review_fabric_contracts` grepped
scripts/ci/detect_linux_guard_changes.py for each review fabric contract
path as a literal string. #13775 derived the Linux guard route inputs from
ci-guards.yml instead of listing them, so the literals went away and the
test has failed on main ever since. main's last ci.yml run predates that
merge, so nothing reported it; it surfaces on any pull request whose diff
routes to the preflight group.

The routing itself is correct, and narrower than before: each of the four
contract paths reaches exactly the preflight group, which is the group that
runs this file. Assert that instead, and read the owning group out of
ci-guards.yml rather than naming it, so a step moving between groups keeps
the test honest instead of breaking it.

Verified the assertion still bites: pointing the policy path at another
group fails with "reaches ['release-ios'], none of which runs the review
fabric tests".

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 22, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 16 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Repository: manaflow-ai/cmux/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 1b3b3321-df77-4de9-a26e-e7deae4107b3

📥 Commits

Reviewing files that changed from the base of the PR and between d7f6648 and 1f2ea4c.

📒 Files selected for processing (1)
  • tests/test_review_fabric.py

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Superseded by #13788, which landed the same fix — routing the assertion through the router instead of grepping the detector's source text. Verified python3 tests/test_review_fabric.py passes on origin/main at e89a9d5. Closing; no need for two.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

This is the third PR on test_ci_executes_review_fabric_contracts in about two hours — #13788 (merged), #13801, and this one. #13800 and #13801 were opened in the same minute by two sessions that could not see each other. Flagging before a fourth appears.

The group-derivation idea here is right and matches #13801. The difference is what the assertion is made against, and it costs a regression.

classify_test_groups() falls open to every group for a path the manifest does not know. So when the review-fabric entries are dropped from PATH_OWNERS, this returns all groups, the intersection with owners is non-empty, and the test passes — the exact failure mode #13788's own comment warned about.

Measured on base 95e843a26, swapping only tests/test_review_fabric.py:

Scenario #13800 #13801
baseline PASS PASS
drop the review-fabric PATH_OWNERS entries PASS — regression missed FAIL — caught
replace the run: python3 tests/test_review_fabric.py line FAIL — caught FAIL — caught
reroute a path to the wrong group FAIL — caught FAIL — caught

Dropping ownership is the regression this test exists to catch, so that first row is the whole job.

#13801 asserts against groups_for_path(), which returns None for an unowned path instead of falling open, then requires contract_groups & set(routed) — same derived-owner idea, without the open door. It also keeps #13788's subTest loop and its classify() lane assertion, and is already rebased onto main (this PR is CONFLICTING against it).

Suggest closing this in favour of #13801. The comment here — "Assert what the router does, not how it is written" — is better than what #13801 carries, and worth lifting across.

teamleaderleo added a commit that referenced this pull request Sep 23, 2026
* docs: tell agent sessions how not to duplicate each other

Several agent sessions work this repo at once and cannot see each other.
Nothing in CLAUDE.md says so, and the resulting waste is now measurable.

On 2026-09-22 a shared observable -- main going red on
test_ci_executes_review_fabric_contracts -- reached every session at once.
Each diagnosed it independently and opened a PR: #13785, #13788, #13800,
#13801 and #13802, five PRs on one test function in twenty-one minutes, two
of them five seconds apart. One landed. The reviewer attention spent on the
other four is the cost this section exists to avoid.

Two failures showed up repeatedly and are written down here because neither
is guessable:

Sessions share one GitHub account, so `author` and `mergedBy` name the
account and never the actor. Three separate claims about which session did
what were made from those fields today, all wrong, and two were relayed to
the user before being retracted.

GitHub keeps serving `mergeable` and `mergeStateStatus` on closed and merged
pull requests, where they are stale. Reading CONFLICTING off an already
merged PR sent a session to resolve a conflict that did not exist, twice.

The last paragraph guards the opposite error. #13754 and #13797 changed
exactly the same two files, fixed different bugs, and both merged, so an
overlap scan keyed on file paths would have proposed closing a good PR.
Composing them locally and running the shared test is what distinguishes
the cases.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* docs: give sessions a callsign to sign their work with

The section above tells sessions how not to collide. It does not give them a
way to say who they were, and that gap produced its own failures today: three
claims about which session opened, merged or reviewed something, every one of
them read off `author` or `mergedBy`, every one wrong, two relayed to the user
before being retracted.

Those fields name the shared push account. Nothing in the repository answers
"which session did this", so sessions inferred it from timing and were wrong.
A callsign in a commit trailer answers it directly.

Stated as attribution and not authority, deliberately. The Stensibly product
model is explicit that callsigns, names, branches and prior activity never
substitute for current authority evidence, and a self-assigned name two
sessions can pick independently is exactly the kind of identity that must not
gate an action. It records who acted. It grants nothing.

This commit signs itself, which is the whole convention.

Callsign: Teakettle 🫖
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* docs: correct the callsign section against the live registry

The previous commit invented a convention. There is already a working one, and
checking it showed the invented version wrong in three ways.

`teamleaderleo/stensibly` #454 is a live registrar: a `github-actions[bot]`
workflow that accepts `/callsign reserve`, answers in seconds with a
`callsign-receipt/v0` carrying an accepted generation and a 24h lease, and
releases on request. Its worker quickstart is
`docs/callsign-registry-dogfood.md` in that repo. This section now points there
instead of describing a parallel scheme.

I reserved through it rather than trusting the document, and each correction
below is something the receipt disproved:

The sigil is derived from the callsign by the registrar, not chosen by the
worker. Reserving `Teakettle` returned `💾`, not the emoji the previous commit
had picked for itself and put in its own trailer.

Names are leased. Collision keys are compared without case or separators, so
`Rook`, `rook` and `r-o_o k` are one name. The previous commit said collisions
were expected and tolerable, which is true of the derived sigil and false of
the name.

A generation may be shown only from an accepted receipt, with `pending` or
`unregistered` as the honest fallback. The previous commit had no notion of a
generation at all.

The sign-off format follows the registry's: `— <Callsign> g<generation>
<sigil>`, not a bare name and emoji.

Attribution and not authority is unchanged and now cites its owner:
`teamleaderleo/quarry` #1103 tracks the defect that a callsign in comment text
is marker text rather than an authenticated principal.

Callsign: Teakettle g1 💾
Run: run_cmux_ci_delineation_20260922_01
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* docs: check local worktrees and recent remote branches

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
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