Skip to content

Fix defaultReviewer rig/role tiers + resolve-before-commit ordering (crn-9qlxu) - #127

Merged
quad341 merged 3 commits into
mainfrom
deploy/crn-9qlxu-gate
Aug 20, 2026
Merged

quad341 merged 3 commits into
mainfrom
deploy/crn-9qlxu-gate

Conversation

@quad341

@quad341 quad341 commented Aug 20, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes cmd/reviewer.go so a reviewer-resolution failure can never leave a
review-branch commit that nobody was ever told about. resolveReviewer now
runs before the commit/eviction/promotion-mark step at all 4 call sites
(requestReview, commitForBatchReview, requestCullReview,
requestPromotionReview) — true fail-closed instead of committed-but-
unnotified.

Also fixes defaultReviewer's rig-tier case: it now resolves from the
entry's own declared rig value (cairn.ResolvedTier's value) instead of
$GC_RIG. This fixes a silent-stuck-state bug flagged by deep-investigator
this session — city-scope agents with no $GC_RIG set previously got a
hard-to-diagnose failure on rig-tier resolution, even though the entry
itself already declared which rig it belonged to. role tier is deliberately
left $GC_RIG-based (role-tier storage carries no rig at all, so which
rig's role-holder should review is genuinely underspecified without it).

  • Deploy bead: crn-9qlxu
  • Review bead: crn-rott9.1 (epic: crn-rott9), verdict: PASS
  • crn-rott9 is the delegated implementation of part of architect's design
    decision on crn-ry4zu (recall-vs-review-gate visibility problem); this fix
    is the reviewer-notification-ordering half of that decision, not a
    standalone change.

Gate result

PASS (7/7) — see release-gates/crn-9qlxu-gate.md
for full per-criterion evidence. Independently re-verified on the deployer
side in a fresh isolated scratch worktree (not inherited from the
reviewer's claimed results): go build/go vet/gofmt/golangci-lint
(isolated cache) all clean, go test ./... -race -count=1 — all 7 packages
PASS, 0 FAIL, including direct -v re-runs of all 5 new/changed regression
tests (TestDefaultReviewerRigTierIgnoresGCRig,
TestDefaultReviewerRigTierRequiresNonEmptyValue,
TestRememberBatchReviewerResolutionFailureCommitsNothing,
TestCullEvictReviewerResolutionFailureCommitsNothing,
TestPromoteMarkReviewerResolutionFailureCommitsNothing). The bead's
security claim (reusing the rig value for a mail-recipient string is not a
new trust extension, since the same value already flows into scopeDir's
filesystem path join) was independently checked against
internal/cairn/remember.go and confirmed accurate.

Diff scope independently confirmed single-themed: 7 files, all under
cmd/ — the fix itself (reviewer.go), its direct regression tests
(reviewer_test.go, remember_batch_test.go, remember_test.go,
cull_test.go, promote_test.go), and one necessary downstream fixture
fix (branches_test.go — an existing test could no longer force rig-tier
resolution to fail via $GC_RIG, so its fixture switched to role: to
keep testing the same failure path). Cleanly divergent from main
(assert_deploy_ancestry_scope against crn-rott9.1 — clean, no foreign
commits); one file-level overlap on cmd/remember_test.go against main's
intervening changes, confirmed via git merge-tree (clean tree, exit 0)
plus manual hunk-range inspection to be genuinely disjoint edits, not a
lucky non-conflict.

Merge authority

quad341/cairn — standing self-merge authorization applies (mayor ruling
gm-wisp-2yhv7u, 2026-08-19). This bead's own description already states
the 4 standing conditions explicitly and carries no stale mayor-routing
boilerplate. Deployer will merge directly (gh pr merge --squash, plain,
once CI is green) rather than routing to mayor.

Test plan

  • go build ./...
  • go vet ./...
  • gofmt -l .
  • golangci-lint run ./... (isolated cache)
  • go test ./... -race -count=1 (all 7 packages)
  • 5 named new/changed regression tests re-run individually with -v
  • CI (build-test, lint) — to be confirmed green post-open

🤖 Opened by cairn/deployer on a green release gate.

cairn-reviewer-scratch added 3 commits August 19, 2026 17:46
…IG (refs crn-rott9.1)

Reorder requestReview, commitForBatchReview, requestCullReview, and
requestPromotionReview to call resolveReviewer before their respective
commit-to-review-branch step, so a resolution failure leaves nothing
committed anywhere -- true fail-closed instead of
committed-but-unnotified.

Fix defaultReviewer's rig-tier case to resolve from the entry's own
declared rig value (from cairn.ResolvedTier) instead of $GC_RIG: an
entry stored under rig:<value> is unambiguous about which rig's
reviewer should see it, regardless of which rig the writing agent
happens to be running in. role tier is deliberately left
$GC_RIG-based -- role-tier storage carries no rig of its own, so
$GC_RIG remains the only available signal there.

Also relax TestRememberSharedTierReviewerResolutionFailureCommitsNothing's
stdout assertion: remember.go always echoes the new entry's ID right
after the loose file write, before the tier branch is even decided --
unconditional and orthogonal to this fix. The test now checks for the
absence of "review branch:"/"mailed reviewer:" lines instead of total
silence.
Deploy bead crn-9qlxu at b1320d7, source review crn-rott9.1: reviewer
resolves before commit at all 4 call sites; rig-tier default reviewer
now uses the entry's own scope value instead of $GC_RIG.
@quad341
quad341 merged commit c144fdc into main Aug 20, 2026
2 checks passed
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