Skip to content

refactor(premerge): three-lens simplify pass over the #768 stack - #781

Merged
TheFJK merged 1 commit into
chore/stack-20260824-094351-aa3e54cd6c37b8e8from
refactor/simplify-stack-768
Aug 24, 2026
Merged

TheFJK merged 1 commit into
chore/stack-20260824-094351-aa3e54cd6c37b8e8from
refactor/simplify-stack-768

Conversation

@TheFJK

@TheFJK TheFJK commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

Stacked on #768. The base is the stack branch, so this diff is polish only.

Ran the /premerge Phase 4 three-lens pass (Reuse, Quality, Efficiency) as a standalone branch, because #768 stopped on STOP_EXHAUSTED and Phase 4 is gated behind a green clean gate — polishing a stack with live blockers buries them in refactor noise.

41 findings. Only the behaviour-preserving ones are applied here. Everything that would change what the code does is filed instead (see below).

Five guards that were vacuous — each demonstrated, not argued

Guard Proof it was dead
C11 dual-channel stanza stripping StructuredOutput from all eight card bodies still passed — #763 had put that literal into the tools: frontmatter, which satisfied the whole-file grep
#749 tools-declaration emptying a live card's tools: value left the suite at PASS (383 checks) — the exact state the guard exists to red on
ci-shard-diagnose dump reported MATCH match=12 miss=0 — a clean bill of health — for a shard that reds 11/12
PREMERGE_MAX_BLOCKED_ON lock name-grep only; passed at any value. Five mutations now red it
unpinned sort/comm twin sort) and end-of-line invocations invisible; landed with a bare-terminator mutant so the widening is itself tested

Prose that contradicted the code it documents

_growth_ratio excludes carried rows from both sides and _growth_round_counts requires a third eligibility term (blockers >= previous_blockers). Five surfaces still described the pre-narrowing behaviour.

Executed against one document with 1 reviewer blocker + 2 carried rows: the prose denominator gives 3, the code gives 1 — 0.33 vs 1.00, straddling CONVERGE_GROWTH_CEILING (0.50). The two copies disagreed about whether the loop stops.

SKILL.md, commands/premerge.md and references/common-mistakes.md corrected. RFC 0021 gets a new A6 amendment rather than an edit — git chronology confirms A5 was accurate when it landed (a83deaed), and the narrowings came after it in 9a7bb510 / b1d5ef15 / 1b5e00cf. Editing A5 would erase the record of a decision that was correct when made.

Also

  • the fix-commit push captures git's stderr the way the five SKILL.md fences do — driven against a real bare remote with a hostile 17-line pre-receive hook
  • an unreachable fallback deleted, after 50 executions with an anti-vacuity control that fires 22/25 on a mutant
  • the S10 loop runs its extractor 3 times instead of 17 (1.60s → 1.09s wall per run, byte-identical output)
  • the CR-refusal hint retargeted from dump (measured: zero plan bytes under that condition) to packer-bytes (the only verb whose output flips), and quoted — on this repo's spaced path the old hint printed bash: /Volumes/FJK: No such file or directory
  • several comments that named dead consumers now name the live ones

Deliberately not applied

Behaviour-changing, so filed rather than polished: the workflow.js unquoted rate-state directory, closing the goal-state.sh fail-open, the review-consolidate.sh non-ASCII encoding mismatch, agent prompt-text consolidation, and the premerge-findings.test.sh jq scaffolding swap (~2.8s of 12.55s, but the assertions compare Python repr spellings).

Two agents declined work rather than half-do it: the goal.test.sh extractor move is cross-file, and importing code_fixer_contract.beneath would turn a stdlib-only module into a 3-module chain and convert a contracted exit 74 into an import traceback.

Verification

20 suites green, all at or above baseline: premerge 261, premerge-findings 208, review-pr 471, docs-accuracy 309, ci-shard 52, ci-wiring 30, epipe-guard 93, findings-to-issues 202, review-pr-consolidate 86, vendor-provenance 63, plus 10 more.

The premerge-findings.py refactor was diffed end to end against HEAD's copy through the full pipeline — all 17 run artifacts and both streams byte-identical, plus a 144-pair differential with zero disagreements.

…he stack

Three code-simplifier lenses over #768's diff returned 41 findings. Only the
behaviour-preserving ones are applied here; everything that would change what
the code does is filed instead.

Guards that were vacuous, each demonstrated before the fix:

  * C11 greps a whole card for `StructuredOutput` to prove the body documents
    the dual-channel return. #763 put that literal into the `tools:`
    frontmatter of all eight cards, so the frontmatter satisfied it. Stripping
    the stanza from all eight bodies still passed; now scoped to `## Output`
    and it reds.
  * model-routing keyed "declares tools:" on bare key presence, so a key with
    an empty value counted as a declaration. Emptying one on a live card left
    the suite at PASS (383 checks) - the exact state #749 exists to red on. Now
    matches testers-agent-contract's semantics.
  * ci-shard-diagnose transcribed the harness's membership rule instead of
    running it. On a plan naming a fixture no invocation offers it reported
    `MATCH match=12 miss=0` for a shard that reds 11/12. It now carves the
    job's own run_one out of the live workflow and executes it.
  * The premerge Constants cap had a name-grep where its two siblings had
    value locks; it passed at any value. Five mutations now red it.
  * The unpinned sort/comm detector's narrow twin, plus a bare-terminator
    mutant row so the widening is itself tested.

Prose that contradicted the code it documents. `_growth_ratio` excludes
carried rows from both sides and `_growth_round_counts` adds a third
eligibility term, but five surfaces still described the pre-narrowing
behaviour. Executed against one document with 1 reviewer blocker + 2 carried
rows, the prose denominator gives 3 and the code gives 1 - 0.33 vs 1.00,
straddling the 0.50 ceiling, i.e. the two copies disagreed about whether the
loop stops. SKILL.md, commands/premerge.md and common-mistakes.md corrected;
RFC 0021 gets a new A6 amendment rather than an edit, because A5 was accurate
when it landed and the narrowings came after it.

Also: the fix-commit push now captures git's stderr the way the five SKILL.md
fences do (driven against a hostile pre-receive hook), an unreachable fallback
deleted after 50 executions with a live anti-vacuity control, the S10 loop
re-runs its extractor 3 times instead of 17, and several comments that named
dead consumers now name the live ones.

Verified: 20 suites green, all at or above baseline. Artifact bytes unchanged
where it matters - the premerge-findings refactor was diffed end to end and
all 17 run artifacts plus both streams are byte-identical to HEAD's copy.
@coderabbitai

coderabbitai Bot commented Aug 24, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 6c6148d4-0004-4533-abf5-9bb259491653

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

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