Skip to content

fix(prepare-pr): a third question, a retrospective instead of a stall, and rounds read from the PR - #8840

Merged
bolichen97 merged 1 commit into
mainfrom
feat/prepare-pr-round-notes
Sep 6, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
feat/prepare-pr-round-notes

Conversation

@iamwhatever

@iamwhatever iamwhatever commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

The prepare-pr loop has no memory between rounds. Each round sees this round's findings and fixes them. It never sees that the code the finding sits in was itself added two rounds ago, to fix an earlier finding.

Four PRs show what that does. #8501 ran 15 pushes and grew from 2776 to 5182 added lines. #8530 ran 11 pushes and grew from 1094 to 2894. #7518 ran 22 pushes and grew from 387 to 2635. #7362 ran 24 pushes and grew from 3328 to 10143, then deleted 2802 of them. In every one, the author's own disposition comments say the same thing: "this was my own regression", "introduced by the previous round's fix". One span on #7362 drew a finding in eight rounds. It closed when the guard was deleted, not patched a ninth time.

Two smaller defects sit under that one. The skill says the "disproportional" answer never applies to a security-class finding, so the agent fixes every one of them, even one whose trigger needs 2001 concurrent artifacts. And the dispositions the agent writes never reach the remote reviewer: the GPT lane's ledger keeps only the marker line, > lines, and - **title** bullets from each comment, and the dispositions on #8530 had zero > lines.

Why it matters

A PR that should take two rounds takes twenty. The maintainer babysits it for days. The code that lands is 2x to 6x the size the change needed, and most of the extra is machinery the loop grew to answer its own earlier fixes. The rebuttal rate on those four PRs was between 4.5% and 18%.

What changed (motivation → approach → change)

The loop needs to look back. The record it needs is already on the PR: every writer-authored disposition names the head it judged, the finding's span=, the ruling, and its reasoning. So pr_findings.py --rounds rebuilds the rounds from those comments — one round per judged head, the spans each round disposed, how many were in self-added code, the mechanisms each round declared, span recurrence, and growth — and exits 30 when the loop's own rules call for a retrospective (a span at ×3, or the 3rd/6th/9th round). Nothing is stored locally. The PR thread is the record, and it stays after merge for anyone to study later. Two optional plain lines in a disposition feed the view: self-added: yes|no and mechanism: <one line>, placed outside the > block so the reviewer's ledger never sees them. The intent is a comment too, posted once.

An earlier revision of this PR kept that memory in a file on disk (round_notes.py, 360 lines, its own directory). Two retrospectives on this PR found first that two of its mechanisms served no part of the intent, then that the file itself did not: everything it held was already in the thread. It is gone.

With that memory, SKILL.md changes in these places:

  1. The two questions per finding become three. The new one asks whether the finding lands in code this PR added earlier, and if so, writes down both "repair the mechanism" and "remove the mechanism" before choosing.
  2. The security hard limits ("never applies to a reachable Critical/High", "never deferrable") are gone. The three questions apply at every severity; a real hole still fails question 1. The dispositions table now describes the server-side asymmetry instead: the GPT lane does not accept a deferral as a ruling on a security-class finding.
  3. "Escalate at 3 stalled rounds" becomes a retrospective every 3rd round or on a span at ×3: one Opus sub-agent gets the rounds view, the intent, the diff, and the whole-design review bodies, answers which mechanisms the intent does not need, and the round subtracts before it fixes.
  4. The 10-iteration backstop becomes max_cycles=80 on the monitor_start loop, and the loop does not raise it. When spent, the agent stops and hands the user the rounds view and the open findings; the user decides on another eighty.
  5. A new section tells the agent how to write a disposition the remote reviewer can read: rationale in > lines, written at class level so convergence rule 1 covers the next variant, and a pre-drafted /ai-review override sentence when a security-class finding is honestly disproportional.
  6. The Phase 0 decision gate keeps its ~1k-line trigger, now stated precisely: whole-PR diff, design sign-off before opening, not a refusal.
  7. Whole-design lanes (Design, First Principles, UX) outrank line-level lanes (GPT, Opus) in triage order: read the shape verdicts first, settle the shape, then fix lines against it. pr_status.py binds the First Principles lane and prints each whole-design lane's verdict= on its marker line, so an unanswered CONCERNS is visible in the loop's own output.
  8. Phase 0 posts the intent comment; Phase 1 starts with --rounds and branches on its exit code; Phase 3 dispositions carry the two optional lines. Four new Common Mistakes entries.

Tests

test/test_prepare_pr_rounds_view.py (4 tests): rounds are grouped by judged head in first-disposed order across lanes, with per-round spans, self-added counts, declared mechanisms, and growth; a span= inside a > line is evidence, not a claim; exit 30 fires on the 3rd round and on a span disposed in three rounds (twice in one round counts once), and not on a 5th round with no recurrence; the view fails closed when comments or writer verdicts cannot be read; SKILL.md names the view, the intent comment, and the two lines.

test/test_prepare_pr_ledger_contract.py (3 tests) pins the server-side facts the disposition guidance leans on: the ledger's jq filter selects exactly marker / > / title-bullet lines with the per-record cap SKILL.md restates; convergence rule 1's class coverage and rule 5's no-deferral-for-security are present; SKILL.md states each dependency.

test/test_fix_loop_discipline.py now asserts the skill states how the server treats a deferred security-class finding, instead of the removed "never deferrable" sentence.

All existing test_prepare_pr_* tests pass unchanged.

Manual verification

This PR was driven by the skill it changes, from the worktree. Local round: GPT raised three blockers; one was answered by removing an option, two by one-line fixes. Server round 1: one security-fenced blocker rebutted at class level in > lines; it did not recur. Server round 2: one new fenced blocker, FLAGged by the adjudicator with a complete override rationale. Server round 3: Design and First Principles CONCERNS answered per item; the size trigger and the hard cap they asked for came back. Server round 4: the memory file had drawn GPT findings four rounds running, so a retrospective ran and removed two mechanisms the intent never required. A second retrospective then asked whether the file itself was needed and found it was not. pr_findings.py --rounds on this PR reconstructs rounds 0–2 from the comments already posted, with no local state. The PR is +518 lines against +887 one push earlier. The one item left open is a policy question for the maintainer: whether security-class findings may be ruled disproportional with a pre-drafted override.

Related Issues

no linked issue: the evidence is the four PRs named above, not a filed issue.

Pattern harvest

Rule candidate: review-prompt
Pattern: "a finding on code the previous review round added is answered by a patch to that code, never by asking whether the code should exist" — the third question in SKILL.md is the local form; the GPT lane's prompt could ask the same of itself before reporting.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (SKILL.md is the documentation)
  • No secrets, credentials, or internal references in the diff

@iamwhatever
iamwhatever requested review from a team and smeyffret September 5, 2026 23:13
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Sep 5, 2026
@github-actions

github-actions Bot commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Fable 5) — 🟡 CONCERNS

Design-level review of 773ce8f3b9f1f4d15bed32a5665a1c69cc4ffed6 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: CONCERNS

Sound memory-from-the-thread design, but it quietly rewrites security-finding policy — a maintainer ruling the author themselves says is still open.

Watch

  • Dropping the two hard limits ("never applies to a reachable Critical/High", "never deferrable") converts a local absolute into "server rule 5 + a pre-drafted /ai-review override sentence". The mechanism: the skill now coaches the agent to hand the maintainer ready-to-paste override text for security-class findings, which lowers the friction on exactly the class the old rule made frictionless to fix. The description concedes this is "a policy question for the maintainer" — that ruling should be made explicitly at merge, not implicitly by merging a loop-efficiency PR.
  • A "round" exists only when a head received writer dispositions, so pushes that fixed CI reds or conflicts without disposing anything are invisible to the cadence — the 3rd-round retrospective can fire on the 5th or 6th real push on exactly the thrashing PRs this targets. Degradation is late-not-never, but worth knowing.

Suggestions

  • test_prepare_pr_ledger_contract.py pins the server jq filter by regex; a comment in codex-review.yml pointing back at that test would stop a well-meaning ledger edit from discovering the coupling only via a failing skill test.

[DESIGN-REVIEWED] 773ce8f

@github-actions

github-actions Bot commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

Opus 4.8 Review — ✅ no blocking findings

Reviewed 773ce8f3b9f1f4d15bed32a5665a1c69cc4ffed6 — this comment is updated in place on each push.

Review details

The candidate's own (a) — a concrete input occurring in practice — is unconfirmed and structurally so: head= is written by the skill from REVIEWED_SHA=$(git rev-parse HEAD), always a full 40-char SHA, and [:12] truncates any two full SHAs of the same head to the identical key. A split only occurs if a human hand-authors a <12-char head= for a head that also appears full — an "if a caller were to" the candidate admits it could not confirm, and which the skill's normal path never produces. The consequence, moreover, is a mis-timed advisory retrospective, not a crash, data loss, or security boundary. It fails the Step 1 bar and dies under falsification.

No new grounded findings surfaced in the diff; the changes are additive and covered by their tests.

No findings.

[OPUS-REVIEWED] 773ce8f

Verdict parsed from the review's SHA-scoped output markers for commit 773ce8f3b9f1f4d15bed32a5665a1c69cc4ffed6.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 773ce8f3b9f1f4d15bed32a5665a1c69cc4ffed6: <one-sentence reason>

@github-actions

github-actions Bot commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

GPT 5.6 Review — ✅ no blocking findings

GPT 5.6 completed its review of 773ce8f3b9f1f4d15bed32a5665a1c69cc4ffed6 and found no blocking issues.

This comment is updated in place on each push.

Review details

FINDING -- src/kiro_crew/builtin_skills/kirocrew-dev/prepare-pr/scripts/pr_status.py:1065 -- Standard --reviewers gpt,opus excludes whole-design comments before VERDICT_LINE_RE.search(body), so promised verdict=CONCERNS cues never print -> Fix: collect fresh whole-design verdicts independently of the reviewer filter.
[GPT-REVIEWED] 773ce8f

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 773ce8f3b9f1f4d15bed32a5665a1c69cc4ffed6: <one-sentence reason>

@github-actions

github-actions Bot commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Fable 5) — 🟡 CONCERNS

Premise-level review of 773ce8f3b9f1f4d15bed32a5665a1c69cc4ffed6 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

All server-side facts the skill's new guidance leans on are verified real: the ledger jq filter at codex-review.yml:436 keeps exactly marker/> /title-bullet lines, convergence rules 1 and 5 exist verbatim in gpt-round-convergence.md, all five whole-design workflows emit <Lane>-Verdict: lines, and rounds_view reuses the pre-existing fetch_disposition_comments/writer_disposition_records helpers in pr_findings.py rather than duplicating parsing. The one premise risk: the description itself calls the security-relaxation an open maintainer question while the diff ships the relaxed policy.

First-Principles-Verdict: CONCERNS

The local "never applies to Critical/High" limits are deleted while the description itself calls that an open maintainer policy question.

What this change ships

Intent: stop the prepare-pr loop from patching its own round-grown code for twenty rounds — a FIX (of a measured, four-PR defect) delivered as process machinery.

  1. A third per-finding question: "is this in code the PR added earlier?", with remove-the-mechanism written down — justified, cause-level
  2. pr_findings.py --rounds rebuilds rounds from PR dispositions; exit 30 — justified; reuses existing parsers (pr_findings.py:364,376)
  3. Retrospective sub-agent every 3rd round or span ×3, replacing "escalate at 3 stalled rounds" — justified
  4. Security findings may now be ruled disproportional locally; both hard limits deleted — declared, but presumes an unruled policy answer
  5. Two optional disposition lines self-added: / mechanism: — justified; squash destroys round provenance, the thread is the only record
  6. Immutable intent comment at Phase 0 — justified; the PR body is reconciled every round, so mutable
  7. Rationale-in-> -lines, class-level, pre-drafted override guidance — derived; verified against codex-review.yml:436 and convergence rules 1/5
  8. First-Principles lane bound by default; verdict= printed per whole-design lane — justified; deletes the documented --marker-bindings workaround
  9. Whole-design lanes outrank line-level in triage — justified
  10. 10-iteration backstop → hard max_cycles=80, human renews — justified

Watch

  • The description says "The one item left open is a policy question for the maintainer: whether security-class findings may be ruled disproportional with a pre-drafted override" — yet the diff already deletes "It never applies to a reachable Critical/High" and ships the pre-drafted-override guidance. Server rule 5 plus the human override still gate each instance, so nothing lands unilaterally, but if the maintainer's answer is "no", the reversal is: restore the two deleted limit sentences and drop the pre-drafted-override paragraph plus its two test_prepare_pr_ledger_contract.py assertions.

[FIRST-PRINCIPLES-REVIEWED] 773ce8f

@iamwhatever
iamwhatever force-pushed the feat/prepare-pr-round-notes branch from 124a285 to ee48375 Compare September 6, 2026 00:25
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 6, 2026
@iamwhatever
iamwhatever force-pushed the feat/prepare-pr-round-notes branch from ee48375 to b80b598 Compare September 6, 2026 01:55
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 6, 2026
@iamwhatever
iamwhatever force-pushed the feat/prepare-pr-round-notes branch from b80b598 to 28c10e6 Compare September 6, 2026 06:50
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Sep 6, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor Author

rebutted — span=67f250492cae

  • Untrusted finding titles are interpolated into shell commands

Not a defect: the only caller of round_notes.py add is the agent composing the command on its own machine, where it already executes arbitrary shell; a label it writes into its own note adds no capability the caller lacks.
The <label> field is the agent's own few-word tag, not the reviewer's title. SKILL.md at 28c10e6aa now says so in the add step: "never the reviewer's title pasted in: reviewer text is PR-influenced and does not belong on your own command line."
This ruling covers every finding whose chain is "PR-influenced text reaches a round_notes.py argument": the note is author-side bookkeeping written by the process that would be the attacker, and structured stdin for a two-word label is machinery the skill exists to refuse.

Override, if the fence still holds on the new head:
/ai-review override gpt 28c10e6aa: the only caller of round_notes.py add is the agent on its own machine, where it already runs arbitrary shell; the label is agent-authored, not reviewer text, and structured input for a two-word tag is exactly the mechanism this PR argues against.

@iamwhatever

Copy link
Copy Markdown
Contributor Author

fixed — span=677a9f6493d3

  • relative KIROCREW_HOME resolves from the worktree and can dirty the branch

Legitimate. notes_root() now returns root.resolve() / "prepare-pr" (round_notes.py, 28c10e6aa), so a relative KIROCREW_HOME is anchored before the notes directory is appended and the note can never land inside the checkout.

@iamwhatever

Copy link
Copy Markdown
Contributor Author

fixed — span=677a9f6493d3

  • duplicate same-span findings in one round make rounds reach three and trigger a false retrospective

Legitimate. summarise() appends a round number to a span once per round (if rno not in entry["rounds"], round_notes.py, 28c10e6aa); two findings on one span in one round count as one hit. Pinned by the extra same-round --finding in test_add_records_rounds_deltas_spans_and_mechanisms, which still expects rounds == [0, 1, 2].

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Sep 6, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor Author

rebutted — span=682fb57e2fa4

  • Concurrent loops overwrite round history

Not a defect in this design: one prepare-pr loop owns one PR branch (SKILL.md "Which mechanism drives the loop": one monitor_start per session, one session per PR). Two loops on one branch is the failure the file-overlap gate at Phase 0 exists to stop, not a state the note is asked to survive.
The casualty, if it ever happened, is one entry in an author-side advisory log (round_notes.py:25: "recommends nothing and never gates anything") — never code, never the PR, never the ledger CI reads. The next add re-derives nothing from it; the agent re-enters the lost round from the PR comment thread, which is the durable record.
This ruling covers every finding whose chain is "concurrent writers to the per-branch note": the note has one writer by construction, and a cross-process lock portable across three OSes is ~30 lines of machinery guarding a two-line bookkeeping write — the exact shape this PR argues the loop must learn to refuse.

The adjudicator reached the same conclusion and FLAGged it; its own rationale is the override:
/ai-review override gpt 28c10e6aa2f879a3235fd9b47fcea49476280779: requires two concurrent prepare-pr loops on the same PR branch (contradicting the single-owner-per-PR design) colliding in a once-per-round sub-millisecond read-modify-write window, and the only casualty is one entry in a deliberately non-gating advisory log, never code, the PR, or user data.

@iamwhatever

Copy link
Copy Markdown
Contributor Author

/ai-review override gpt 28c10e6: Requires two concurrent prepare-pr loops on the same PR branch (contradicting the single-owner-per-PR design) colliding in a once-per-round sub-millisecond read-modify-write window, and the only casualty is one entry in a deliberately non-gating advisory log (line 25), never code, the PR, or user data.

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Human judgment recorded

@iamwhatever marked the gpt AI finding as false positive, not applicable, or explicitly accepted for 28c10e6aa2f879a3235fd9b47fcea49476280779.

Requires two concurrent prepare-pr loops on the same PR branch (contradicting the single-owner-per-PR design) colliding in a once-per-round sub-millisecond read-modify-write window, and the only casualty is one entry in a deliberately non-gating advisory log (line 25), never code, the PR, or user data.

This decision applies only to this commit. A new push requires a new judgment.

@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Sep 6, 2026
@iamwhatever
iamwhatever force-pushed the feat/prepare-pr-round-notes branch from d2c7ded to 3f3d3be Compare September 6, 2026 17:15
@iamwhatever

Copy link
Copy Markdown
Contributor Author

needs-a-decision — Watch: security-class findings can now be ruled disproportional with a pre-drafted override

Correctly stated, and this is the one trade in the PR that is a policy choice rather than a defect: the local "never applies to a reachable Critical/High" rule is gone; a real security hole still fails question 1, the server's convergence rule 5 still re-raises a deferred one every round (pinned by test_prepare_pr_ledger_contract.py), and the pre-drafted override sentence lowers the friction on the human paste.
The evidence for the trade is on this very PR: three security-fenced GPT blockers in four rounds (label-in-shell, note-file lock, 14-day prune), each with a complete not-a-defect argument, one of which the adjudicator itself FLAGged with the override text. Without the pre-drafted sentence each costs a maintainer a from-scratch investigation.
@bolichen97 — this needs your explicit yes or no as maintainer, not a PR-description sentence: keep the pre-drafted override path, or restore the local hard limit and route every fenced finding to a from-scratch human decision.

@iamwhatever

Copy link
Copy Markdown
Contributor Author

fixed — Suggestion: make the retrospective trigger an exit code, not prose

Legitimate, and the sharpest point on this PR: "decisions come from exit codes" was the skill's own rule, and the trigger it most needed was prose. At 3f3d3bef5 round_notes.py show exits 30 when a retrospective is due (a span at ×3, or the 3rd/6th/9th round), and SKILL.md's Phase 1 step 0 branches on 0 / 20 / 30. Pinned by test_show_exits_30_when_a_retrospective_is_due.

@iamwhatever

Copy link
Copy Markdown
Contributor Author

rebutted — Watch: show --json described but absent; items 7 and 9 undeclared

Stale input: the body this review read predates the rewrite pushed alongside 5cd2a015e0bc36d179412c88e9e54a293051ccf6. The current body has no --json, and enumerates the max_cycles wall (item 4) and the decision-gate rewording (item 6) as their own numbered changes. Nothing to change in the diff; re-run reads the current body.

@iamwhatever

Copy link
Copy Markdown
Contributor Author

rebutted — Subtraction: drop --repo/--branch, 0 non-test consumers

Kept, relabelled. Their one job is test hermeticity: the tests run the script without a git checkout. The help text at 3f3d3bef5 now says "(tests only; the skill auto-detects)" so nobody reads them as a supported surface. Removing them would move the same 8 lines into a git fixture in every test, which is more code for the same effect.

@iamwhatever

Copy link
Copy Markdown
Contributor Author

fixed — span=682fb57e2fa4

  • Active PR notes are deleted after 14 idle days

Legitimate, and answered by subtraction, not a guard: the 3rd-round retrospective (Opus, note + diff + review bodies) found prune is the one subcommand the round-0 intent never required — cross-round memory needs no time-based GC, and rm at Phase 4 is the only deletion the intent names. prune is gone at 3f3d3bef5; there is no age-based unlink anywhere in the script.
This ruling covers every finding whose chain is "an idle note is deleted": there is no code path that deletes a note except the explicit rm the loop runs when the PR is finished.

@iamwhatever

Copy link
Copy Markdown
Contributor Author

fixed — span=682fb57e2fa4

  • Retrying add corrupts round counts

Legitimate — the intent needs the write, the bug was the missing guard. At 3f3d3bef5 cmd_add compares --head against the last recorded round and returns 0 without writing when they match. Pinned by test_add_retry_for_the_same_head_is_a_no_op.

@iamwhatever

Copy link
Copy Markdown
Contributor Author

fixed — span=682fb57e2fa4

  • Renames are misclassified as self-added code

Legitimate, and answered by removing the derivation rather than teaching it about renames. The path-absence inference was added in the previous round at Design's suggestion; the retrospective found it is convenience the intent never asked for and the sole source of this finding and the path:line advisory. At 3f3d3bef5 self-added: is a required field the caller states, as it was in rounds 0–2. Both findings close with the code that caused them.
This ruling covers every finding about inferring code provenance from git: the script no longer infers it.

@iamwhatever

Copy link
Copy Markdown
Contributor Author

fixed — span=677a9f6493d3

  • A documented omitted self-added with a few-word label fails the path:line regex

Closed with the derivation it belonged to (see the rename disposition): the field is required again, so there is no omitted case and no regex.

@iamwhatever

Copy link
Copy Markdown
Contributor Author

fixed — span=677a9f6493d3

  • The documented <owner>-<repo>/<branch>.md path does not exist

Legitimate doc bug. The docstring and the SKILL.md scripts table at 3f3d3bef5 name the real shape: <KIROCREW_HOME>/prepare-pr/<repo-slug>-<digest>/<branch-slug>-<digest>.md, and say why the digests are there.

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

GPT 5.6 Review — ⚠️ review incomplete

GPT 5.6 did not produce a complete verdict for 3f3d3bef52584e47b2b9d703fcfe11deb470df5c; inspect the workflow logs and re-run it.

This comment is updated in place on each push.

See the GPT 5.6 Review job logs; this commit has no completed GPT verdict.

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 3f3d3bef52584e47b2b9d703fcfe11deb470df5c: <one-sentence reason>

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Sep 6, 2026
…, and rounds read from the PR

The loop had no memory between rounds, so a finding in code the PR added
two rounds ago read as a fresh bug and got a fresh patch. Four PRs grew
2-6x under review that way.

- pr_findings.py --rounds: the loop's cross-round memory, rebuilt from the
  writer dispositions already on the PR (one round per judged head, spans,
  self-added count, declared mechanisms, recurrence, growth). Exit 30 when
  a retrospective is due. Nothing is stored locally; the PR thread is the
  record.
- SKILL.md: third question per finding (repair vs remove, both written
  down); security hard limits removed; every-3rd-round retrospective
  replaces "escalate at 3 stalled rounds"; whole-design lanes (Design,
  First Principles, UX) triaged before line-level lanes; dispositions
  written for the reviewer's ledger (`> ` lines, class-level);
  max_cycles=80 is a cap the loop does not raise.
- pr_status.py binds the First Principles lane and prints each
  whole-design lane's verdict.
- test_prepare_pr_ledger_contract.py pins the server-side facts the
  disposition guidance relies on.
@iamwhatever
iamwhatever force-pushed the feat/prepare-pr-round-notes branch from 3f3d3be to 773ce8f Compare September 6, 2026 18:00
@github-actions github-actions Bot removed the readiness: action required A blocking check or review needs attention label Sep 6, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor Author

Intent: Give the prepare-pr loop memory across rounds, so a finding in code the loop itself added is answered by weighing repair against removal, a retrospective every 3rd round subtracts what the intent does not need, and dispositions are written in the shape the remote reviewer's ledger actually reads.
Not a goal: new gates, new stop conditions, changes to CI, or any state that lives outside the PR thread.

@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Sep 6, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor Author

fixed — span=682fb57e2fa4
mechanism: removed — round_notes.py (360 lines, 4 subcommands, a directory under KIROCREW_HOME) replaced by pr_findings.py --rounds (+118 lines) reading the dispositions already on the PR

  • round_notes.py as a whole — a second retrospective, on the retrospective's own output

A retrospective ran on 3f3d3bef5 and asked the intent's question of the file that had drawn every GPT finding for four rounds: does the loop need a note on disk at all? It does not. Every fact the note held is already in this thread — each disposition carries head=, span=, the ruling and its > reasoning; the intent is a comment; growth is on the PR. The two facts that were note-only (self-added, mechanism) are now two optional plain lines in a disposition, outside the > block, where the next round and any later reader can see them.
pr_findings.py --rounds rebuilds the rounds from the writer dispositions — one round per judged head — and exits 30 when a retrospective is due. On this PR it reconstructs rounds 0–2 from the comments above with no local state. Nothing is deleted at Phase 4 because nothing is stored; the record outlives the loop, which is the point.
This ruling covers every finding on round_notes.py: the file is gone, along with the prune, the path digests, the retry guard and the self-added derivation it had accumulated to answer four rounds of review. The PR is +518 lines against +887 one push ago.

@iamwhatever iamwhatever changed the title fix(prepare-pr): round notes, a third question, and a retrospective instead of a stall fix(prepare-pr): a third question, a retrospective instead of a stall, and rounds read from the PR Sep 6, 2026
@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Sep 6, 2026

@bolichen97 bolichen97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved. Both prior blockers are resolved on this head: the ~1k-line decision-gate trigger is restored (and clarified to measure the whole-PR diff), and Design Review plus First Principles Review now each carry per-finding disposition comments. PR Readiness is green.

@bolichen97
bolichen97 merged commit ca4fb3e into main Sep 6, 2026
70 of 76 checks passed
@bolichen97
bolichen97 deleted the feat/prepare-pr-round-notes branch September 6, 2026 20:07
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Sep 6, 2026
amadsalmon pushed a commit to amadsalmon/KiroCrew that referenced this pull request Sep 22, 2026
…, and rounds read from the PR (kirodotdev#8840)

The loop had no memory between rounds, so a finding in code the PR added
two rounds ago read as a fresh bug and got a fresh patch. Four PRs grew
2-6x under review that way.

- pr_findings.py --rounds: the loop's cross-round memory, rebuilt from the
  writer dispositions already on the PR (one round per judged head, spans,
  self-added count, declared mechanisms, recurrence, growth). Exit 30 when
  a retrospective is due. Nothing is stored locally; the PR thread is the
  record.
- SKILL.md: third question per finding (repair vs remove, both written
  down); security hard limits removed; every-3rd-round retrospective
  replaces "escalate at 3 stalled rounds"; whole-design lanes (Design,
  First Principles, UX) triaged before line-level lanes; dispositions
  written for the reviewer's ledger (`> ` lines, class-level);
  max_cycles=80 is a cap the loop does not raise.
- pr_status.py binds the First Principles lane and prints each
  whole-design lane's verdict.
- test_prepare_pr_ledger_contract.py pins the server-side facts the
  disposition guidance relies on.

Co-authored-by: Joe Guo <zejiangg@amazon.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.

2 participants