Skip to content

fix(core): main-red — align audit FAIL/WARN cache-put pins with cycle-1594's declared-content contract - #519

Merged
mickeyyaya merged 1 commit into
mainfrom
fix/main-red-cacheput-control-declared-content
Sep 1, 2026
Merged

fix(core): main-red — align audit FAIL/WARN cache-put pins with cycle-1594's declared-content contract#519
mickeyyaya merged 1 commit into
mainfrom
fix/main-red-cacheput-control-declared-content

Conversation

@mickeyyaya

Copy link
Copy Markdown
Owner

Summary

Main's go workflow has been red since 20e839e (cycle-1594's autonomous ship). That ship deliberately changed worktreeContentSHA from git add -A to git add -u (declared-content contract: untracked-unstaged files are residue, never adopted into the audit-bound tree). Two integration-tagged pins in phase_bindings_fail_verdict_test.go still seeded their delta as an untracked file — residue keeps base identity, so the ADR-0048 fresh-base guard refused the cache Put and the WARN control red both platforms. The lane gate never runs -tags integration, so the lane shipped it green.

The production change is correct and stays (5 pins + eval gitignore-staging-sweep.md); the stale tests are the defect. Both now modify the tracked f.txt committed by initBindingRepo, with comments pinning why the delta must be a tracked modification.

Verification

  • go-reviewer: APPROVE, zero findings — independently reproduced the red by stashing the fix, confirmed the discriminator is the verdict guard (not the fresh-base guard), swept the repo for other untracked-adoption dependence (only acs/cycle1495, safe — pre-stages via its own add -A)
  • code-simplifier: NO CHANGES
  • go test -count=1 ./... exit=0; go test -race -count=1 -tags integration ./... exit=0 (full module, both tiers)
  • gofmt clean, go vet ./... exit=0
  • aadab95's TestRunPool_BackfillsReplacementWhileSiblingLaneStillRunning red classified as flake (5/5 local -race PASS); the deterministic red entered at 20e839e

Follow-up class (queued, not absorbed)

lane-gate-misses-integration-tags inbox item filed (P1, 0.9): the lane gate must cover -tags integration for touched packages — second inherited-red burn (#518 inherited this pair).

🤖 Generated with Claude Code

https://claude.ai/code/session_01BgEQLTgfon8RSVN9bQHBtU

…ycle-1594's declared-content contract

Main's go workflow has been red since 20e839e (cycle-1594's autonomous
ship). That ship deliberately changed worktreeContentSHA from `git add -A`
to `git add -u`: untracked-unstaged files are residue, never adopted into
the audit-bound tree or the verdict-cache key (5 pins in
phase_bindings_staging_scope_test.go + eval gitignore-staging-sweep). The
change is judged CORRECT and is kept — it closes the "binding certified
content no auditor reviewed" class from cycles 1572/1574.

What broke: the lane's gate does not run `-tags integration`, so it missed
phase_bindings_fail_verdict_test.go, whose two pins seeded worktree
dirtiness as an UNTRACKED changed.txt. Under the new contract that delta is
residue → the tree keeps base identity → the ADR-0048 fresh-base guard
refuses the verdict-cache Put:

- TestEmitPhaseBindings_AuditWARN_CachePut_Control FAILed on both
  platforms — the vacuity control doing exactly its documented job ("if
  this control ever reds, the FAIL pin's no-cache assertion is vacuous").
- The FAIL sibling's no-cache-put assertion had indeed gone vacuous: the
  fresh-base guard, not the verdict guard, was doing the skipping.

Fix: both tests now modify the TRACKED committed f.txt (an unstaged
tracked modification — explicitly pinned as captured content by
TestWorktreeContentSHA_CapturesUnstagedTrackedModification), restoring the
verdict guard as the ONLY discriminator between the FAIL and WARN pins.
Production code untouched. Swept initBindingRepo consumers: no other test
still relies on untracked-file adoption.

Triage of the OTHER main-red sightings, so nobody chases them again:
- "--- FAIL: TestPersonaStopCriterionDedupe_CombinedLineCountReduced" in CI
  logs has NO duration — it is stderr echo of stubSelfCheckRunner fixture
  text from build_persona_budget_check_test.go, not a real failure.
- aadab95's red was TestRunPool_BackfillsReplacementWhileSiblingLaneStillRunning
  (internal/fleet, 0.00s) — not reproducible in 5 local -race runs and green
  on the next main run; classified flake (first sighting of this class).

Follow-up class (queued, not absorbed): lane test gate misses
integration-tagged tests, so a lane can ship a semantics change that reds
main CI only. This is the second inherited-red burn (#518 inherited this
one).

Bar by EXIT CODE: gofmt clean, vet exit=0, go test -count=1 ./... exit=0,
-race -tags integration ./... exit=0.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BgEQLTgfon8RSVN9bQHBtU

---
## Actual diff (v8.34.0+)

Files modified (1):
- M	go/internal/core/phase_bindings_fail_verdict_test.go

 1 file changed, 7 insertions(+), 2 deletions(-)

Reviewed-by: code-simplifier
Reviewed-by: go-reviewer
@mickeyyaya
mickeyyaya merged commit 53934f3 into main Sep 1, 2026
4 checks passed
@mickeyyaya
mickeyyaya deleted the fix/main-red-cacheput-control-declared-content branch September 1, 2026 07:41
mickeyyaya added a commit that referenced this pull request Sep 1, 2026
…hip rejoin the lane gate; the retake is the contention answer (#523)

Root cause of the cycle-1594 red-main class (inbox
lane-gate-misses-integration-tags, 0.9): internal/core, cmd/evolve and
internal/phases/ship were put on integrationTierEnvExclusive on 2026-07-19
(8e2afef — contention false-REDs, cycles 930/931/932), and the serialized
retake-on-red that properly cures that exact contention landed ONE DAY LATER
(3c5ed71, 2026-07-20). The list was never revisited, and a green test
(TestEnvExclusive_ExistingEntriesUnchanged, "must stay env-exclusive") pinned
the fossil — a test that copies the config it guards detects an edit, never
an error. Cost realized on cycle-1594: a lane changed internal/core, its
stale integration-tagged pins ran NOWHERE lane-side, CI caught it only
post-merge, and main stayed red 2.5 days (20e839e; #519 fixed the tests;
#518 inherited the red).

The list shrinks to internal/bridge alone — the only entry with a REAL
residual reason: its requireTmux tests boot tmux sessions that time out under
a live wave AND skip in CI (no tmux on runners, #483), so neither the retake
nor CI can vouch for it; its honest backstop stays a quiet-host run. For the
three returning packages the flow is: red -> serialized retake under the
cross-lane exclusive lock -> red-then-green absorbed as a visible WARN,
red-twice a real offender FAIL.

TDD red-first: TestIntegrationTierScope_CoversCoreCmdShip_Cycle1594 FAILed
with the fossil's own skip message before the change. Fossil pins inverted
(TestEnvExclusive_OnlyBridge); the skip-semantics test repointed to bridge;
the backstop-note helper's CI-affirmative branch stays pinned via a
hypothetical entry. code-simplifier caught and fixed a stale preceding
comment paragraph that still asserted the old membership — the same
duplicated-belief class, in prose.

Architecture review BLOCKed the first cut of this very fix — for spreading
the disease it cures: the replacement belief was prose-restated in six
places and three copies were already stale inside the diff. Remedy applied:
envExclusiveEntry{pkg, why, backstop} is the single record; the emitted
WARN, the lane-log note, and the whole-suite filter all PROJECT from it; the
quiet-host-only map and suffix helper dissolved; the selection criterion
("excluded only when the retake cannot vouch AND CI has no backstop") is
pinned as a RULE over the table (TestEnvExclusive_EntriesDeclareNoCIBackstop,
anti-vacuity floor included) with the Cycle1594 test kept as the labeled
instance regression; a serialized-retake deadline kill now degrades to the
fail-open WARN instead of masquerading as red-twice offenders (quiet-host
tier measured ~127s vs a fixed 15m budget and a 3.6x-7.7x contention
multiplier); and the false cmd/evolve premise (fleet-soak is in-process
fakes, not real tmux) is corrected in the record's doc.

The re-review BLOCKed the remedy itself — the retake's governing prose
still forbade the deadline-WARN the new code performs (the same
duplicated-belief class, introduced by the prior CRITICAL's own fix) — and
found the deadline path discarding flushed offenders plus untestable behind a
const budget. All applied: the governing trade-off block now splits
exec-failure (attempt-1 offenders, never laundered) from deadline-kill
(evidence outranks the budget — offenderMarkerLine/hasOffenderMarker is the
one home of the marker belief, fallback-free, so flushed verdicts in a
truncated retake still FAIL and only a marker-free truncation degrades to
WARN); integrationTierTimeout became a var (apicoverTimeout's stated
rationale) with a deadline orchestration test PAIR beside the existing
three; the WARN now carries each entry's why; the "NOT covered by CI"
criterion phrase is a hoisted const referenced by data and rule test alike;
ghost literals are annotated as reintroduction guards. go-reviewer
separately APPROVEd, independently proving the CI-backstop premise from
go.yml and re-timing the three suites (119/81/62s loaded) against the
per-attempt budgets.

Bar by EXIT CODE: gofmt clean, vet exit=0, internal/phases/audit full suite
-count=1 ok.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BgEQLTgfon8RSVN9bQHBtU

---
## Actual diff (v8.34.0+)

Files modified (5):
- M	go/internal/phases/audit/ciparity.go
- M	go/internal/phases/audit/ciparity_integration_test.go
- M	go/internal/phases/audit/ciparity_unit_test.go
- M	go/internal/phases/audit/envexclusive_bridge_test.go
- M	go/internal/phases/audit/integration_tier_orchestration_test.go

 5 files changed, 283 insertions(+), 157 deletions(-)

Reviewed-by: code-simplifier
Reviewed-by: go-reviewer
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