Skip to content

Record each review round, and stop review loops that don't converge - #8

Merged
catalan-adobe merged 66 commits into
mainfrom
review-records-loop-check
Nov 27, 2026
Merged

catalan-adobe merged 66 commits into
mainfrom
review-records-loop-check

Conversation

@catalan-adobe

@catalan-adobe catalan-adobe commented Nov 26, 2026 •

Copy link
Copy Markdown
Owner

What this does

The first part of review tracking: every round of gh pr-review on a PR leaves a record, and a check before each round stops review loops that are not converging. Design: docs/superpowers/specs/2026-11-26-review-tracking-design.md.

1. Each round leaves a record

  • A posted review gets a second hidden marker right below <!-- gh-pr-review generated -->: the round number, the commits reviewed, the approach and "Ready to merge?" verdicts, and the findings (severity, file:line, a short title, an ID such as F4). The same record is saved as round.json in the session.
  • It never holds the --instructions text or the prompts, and it publishes a title or file only when the posted review shows it. Every -- in the JSON is written -\u002d, so the HTML comment stays valid. The marker is sized on the exact posted body: past 60,000 characters it drops titles, then locations, then the Later list, then the findings (findings_dropped); counts and last_ids stay. As a last resort it posts a minimal marker that only says the findings list is gone.
  • A review is a round only when its first line is the generated header, and its record is read only from the line right below, after validation.
  • The code review prompt asks for one extra json findings block at the end. The script cuts it before posting, so the posted Markdown is the same as before. Without a usable block, it parses the Markdown (source: parsed).
  • Reviews posted before the markers existed are read back from their Markdown (source: backfill): verdicts and counts per severity.
  • Rounds posted by the repo's owners, members or collaborators (GitHub's author_association), or by the account running the tool, count for everyone, so the history is the same on every machine. Anyone else's generated review is listed as ignored and can't stop a run.

2. gh pr-review rounds <PR-URL | PR-number> [--json]

One row per round: date, commit, commits since the previous round, approach, ready, open findings by severity, label and source. The last line says what the next round would do. --json prints the records and the decision.

3. A loop check before each round

  • Each round gets a label from its blocking findings (Critical and Important): early (first 3 rounds), converging, ready, nit-loop or churning; unknown when a round's blocking count can't be read (never ready, never bad).
  • One Nit loop or Churning round: a warning, and the posted review starts with a **Loop:** … line.
  • Two in a row: the round stops before any clone or model call. In a terminal it asks first; with -y it exits with code 3. The suggested move comes from the history: settle the approach, split the PR, or approve and file the rest as follow-ups.
  • No new commits since the last round: in a terminal it asks "Run round K anyway?"; with -y it exits with code 5. After a Rethink-only round, a --skip-approach run on the same commit runs (the code was never reviewed).
  • A stop lifts when an identified person other than the PR author reviews or comments after the last round. Bots, deleted accounts and the author's own replies don't count, so a fix agent posting as the author can't lift its own stop.
  • Just before posting, the rounds are read again. If someone posted one meanwhile, nothing is posted and the run exits with code 6; if the history can't be read, nothing is posted either (exit 1). Round numbers follow GitHub's submission order, and simultaneous rounds get their new IDs renumbered on read.
  • The review is posted with commit_id set to the reviewed commit. If the PR head moved during the review, it's never an approval, and the review says which commit it covers.
  • --force-round runs anyway. --check [--json] runs only the check, for scripts and agents.

4. Shared code in lib/, and subcommands

Helpers move to lib/*.sh (sourced through symlinks, as gh extension install . links the script). A known first word dispatches to a cmd_* function. status, show, shepherd, dash and gc are reserved and say "not yet available".

Docs

  • The design for review tracking, and the plans of the three PRs (records + loop check, incremental rounds, local worktrees).
  • The design of a terminal dashboard (Rust and Ratatui, standalone). It isn't built in this PR.
  • docs/superpowers/specs/2026-11-26-review-tracking-results.md: the checks on real PRs below.

Tests

  • New: tests/records.sh (74 checks, with synthetic review fixtures), tests/loop.sh (123, including the 12 calibration histories of the spec), tests/rounds.sh (9).
  • tests/flow.sh (71) covers the findings block (asked for, cut before posting), the marker, round.json, previews, every loop-check outcome, the lifting rules, --check --json on stdout alone, and a failed comment fetch.
  • The whole suite passes on macOS and in an Ubuntu 24.04 container with mawk, jq 1.7 and no column. That run caught one bug: column mangled the – placeholder outside a UTF-8 locale, so rounds now pads its table in jq.
  • On real PRs: rounds on the 12 PRs of the spec's calibration table gives the same blocking series and labels. --check on three open PRs gives the expected decisions. A forced preview round on fix(stardust): deploy-batch fails a page when a request gets no answer adobe/skills#831 wrote the findings block, cut it, and numbered the new finding after the backfilled round. Nothing was posted.

Limits

  • The record says which findings a round found, not which were fixed: statuses across rounds come in the next PR.
  • Backfill reads counts from old Markdown, so a review in an unusual format may count low.

@catalan-adobe catalan-adobe left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Approach

What it does: Records posted reviews as rounds, exposes their history through gh pr-review rounds, and checks whether to run again before cloning or calling the model.

Fit with the repo: The record belongs beside the existing GitHub review marker, and lib/loop.jq gives rounds, --check, and the review command one set of rules. The concern is narrower: the PR says “rounds count by anyone,” but an unchanged commit does not mean the requested review already happened. If one reviewer posts a Rethink, another reviewer’s --skip-approach run exits 5 even though nobody reviewed the code. The base docs/superpowers/specs/2026-11-23-owner-approach-pass-design.md explicitly recommends that retry after a false Rethink.

Strongest case for the approach as built: GitHub-backed history works across machines without a new service. The reported 14-round history on adobe/skills#813 makes a concrete case for stopping unattended loops before another paid call.

Alternatives: Reuse the existing “run anyway?” prompt for unchanged heads in a terminal; keep exit 5 for unattended runs and --check. That costs one confirmation and no new state. As-is, an intentional second reviewer must know to add --force-round.

Questions for the author: Is suppressing an explicitly requested review by a different reviewer a requirement? If so, I’d keep the PR-wide stop.

Missing context: The calibration results don’t distinguish accidental repeats from independent reviews on the same commit.

Approach: Questionable

Strengths

  • lib/loop.jq:20 and lib/loop.jq:66 give rounds, --check, and the review command one decision algorithm. The calibration cases in tests/loop.sh:90 exercise whole histories, including a Rethink between code reviews.
  • gh-pr-review:379 handles check-only runs before session creation, cloning, or model calls. tests/flow.sh:242 also checks the script-facing contract: JSON alone on stdout and exit 3 for a stop.
  • The marker round-trip tests cover actual Markdown hazards—--, <!--, and --> inside findings—not just simple ASCII titles. I ran all eight test scripts on this checkout; all 336 checks passed.

Issues

🚨 Critical (Must Fix Before Merge)

(none found)

⚠️ Important (Should Fix)

  • lib/rounds.sh:9 and lib/records.jq:143–146 — Quoted markers can become review history. A human review that merely mentions <!-- gh-pr-review generated --> is counted as a round. I checked this with a one-review fixture: --check returned nothing-new for a head the tool had never reviewed. A marker example later in a genuine review can likewise override the real record. Match the generated marker as the first line, read the record only from the line immediately below it, and validate its schema before using it. Use the same header check when excluding generated reviews from human activity.

  • gh-pr-review:862–866 and lib/records.jq:61–65 — An unusable findings array can erase visible blockers. The check accepts any array, then normalization silently drops invalid entries. With a Critical finding in Markdown and level instead of severity in the block, the record has zero findings and source: model; a “Yes with fixes” verdict then labels that round ready. Validate the entries before choosing the model source. If an entry would be discarded, fall back to the Markdown for the whole round.

  • lib/records.jq:64 and gh-pr-review:944–946 — The hidden marker can publish text the reviewer never saw. Model-supplied titles and file strings go into the marker without checking that they appear in the displayed review. If the model echoes private --instructions only in a structured title, even a user who reads the entire confirmation preview will not see what is about to be posted. Derive public text fields from the visible findings, or omit fields that cannot be matched to them. Test with private text present only in the findings block.

  • lib/records.jq:69–77 — Finding IDs restart after an empty round. A round containing F1, followed by a Rethink, followed by a new finding produces F1, no IDs, then F1 again. The same reset occurs after marker compaction removes .findings. Persist the highest assigned finding number independently of the list and retain it in compacted and Rethink records.

  • gh-pr-review:377–378 and gh-pr-review:942–948 — Overlapping runs can publish the same round number. Two reviewers can read the same history before their model calls, then both post round K with IDs allocated from the same predecessor. rounds subsequently displays duplicate K rows while the decision uses the array length. Recheck the predecessor before posting and handle a stale run explicitly; make GitHub submission order or review IDs authoritative when reconciling simultaneous posts.

  • gh-pr-review:942–943 and lib/rounds.sh:47–50 — A stop can lift without an identified person acting after the round. The cutoff is the posting machine’s clock, not GitHub’s submitted_at: a slow clock makes an earlier comment look new. Separately, a REST comment with user: null passes the different-login and non-bot tests; I verified that lifted_since returns true for it. Use GitHub’s submission timestamp on read and require a nonempty, identifiable non-bot login before lifting.

  • lib/records.jq:137–140 — Marker compaction can still make an otherwise valid review unpostable. After dropping findings, the function emits the remaining marker without a final size check. A 65,200-character review fits with the old generated header; even a 547-character counts-only marker pushes it above GitHub’s 65,536-character limit. Check the exact assembled body, including both headers and newlines. If even the minimal marker cannot fit, preserve the local record and post the legacy-format body with a warning.

  • lib/rounds.sh:110 — rounds --json passes the entire history as one process argument. On a typical Linux system, a history over 128 KiB fails with “Argument list too long,” even though the same records already passed through loop_decide_json successfully on stdin. Feed the records to jq on stdin here too, passing only the small decision separately.

💡 Minor (Nice to Have)

  • lib/rounds.sh:10 — Backfill loses the GitHub review action. The REST projection drops state before backfill_record reads it. An APPROVED fixture consequently returns decision: null through the real fetch path, although the isolated builder test passes. Include state in the projection and assert the decision in tests/rounds.sh.
  • lib/loop.jq:54–61 — Flag precedence changes the prescribed Nit-loop advice. A Nit loop on a PR over 800 lines recommends splitting it; the design table reserves that suggestion for Churning and recommends follow-ups for a Nit loop. Handle nit-loop before the Churning flags, or update the table if the different behavior is intentional.

Recommendations

Add one producer-to-consumer test: post to the stub, return those exact posted bodies through the REST stub, then run rounds --json and --check. That would test the contract between commands that currently pass in isolation with hand-built records.

Assessment

Ready to merge? No

Reasoning: The loop algorithm is well tested, but the records feeding it can suppress a review that never happened, hide visible blockers, or reuse finding IDs. Those errors should be fixed before scripts rely on the new decisions and exit codes.


Review generated by gh pr-review · model: azure-openai-direct/gpt-6.2-astra

catalan-adobe added a commit that referenced this pull request Nov 26, 2026
Integration on top of the conflict resolutions:
- New finding IDs start after both the history's ID floor (#8) and the last code review's numbers (#9's statuses).
- write_round_record keeps #9's baseline and this round's loop label, with #8's step checks and record validation.
- The body is assembled again when a round is renumbered before posting, so the progress line names the new round.
- round_body finds generated reviews with the same first-line test as fetch_round_records.
- findings_block_ok lets an entry with an earlier ID give only its status; the rest comes from the last record.
@catalan-adobe

Copy link
Copy Markdown
Owner Author

Thanks for the review. All items are addressed in the commits pushed since; each fix has a test.

Approach (unchanged head): an unchanged head no longer blocks an interactive run. In a terminal, "no new commits since round K" now asks "Run round K+1 anyway?", as the stop does. -y and --check still exit 5. A round that only judged the approach (Rethink) leaves the code unreviewed, so a --skip-approach run on that commit runs.

Important

  • Quoted markers: a review is a round only when its first line is the generated header. The record is read only from the line right below it, and validated (schema, types) before use; otherwise the review is backfilled. One check (is_generated_review) is used for rounds, lifting and the round bodies.
  • Unusable findings block: every entry must have a known severity, a string title, a file string or null and a line number or null. One bad entry and the whole round is parsed from the Markdown (source: parsed).
  • Hidden text in the marker: the posted marker keeps a title or file only when the posted review shows it. round.json keeps everything.
  • IDs restarting: new IDs start after the highest ID anywhere in the history (id_floor). Every record keeps last_ids, Rethink records and compacted markers included; older markers seed the floor from their IDs.
  • Overlapping runs: the rounds are read again just before posting. If one landed meanwhile, the run says who; a terminal asks "Post anyway as round N?", and -y posts nothing and exits 6. Round numbers follow GitHub's submission order.
  • Clock and lifting: posted_at and the head come from GitHub's submitted_at and commit_id on read. A stop lifts only for a non-empty login that is neither a bot nor the author.
  • Body size: the marker is sized on the exact posted body. It drops titles, then locations, then later, then the findings (findings_dropped: true); counts and last_ids stay. With no room at all, the review posts without a marker and the local round.json keeps everything.
  • rounds --json argument size: the history goes to jq on stdin.

Minor

  • Backfill keeps the review state as the decision, tested through the real fetch path.
  • A Nit loop always suggests follow-ups; "split" is for Churning only. The spec's table doesn't cover a Nit loop with approach-stuck: that case also gives follow-ups.

Also from the PR #9 review, since the code is here: write_round_record checks every step and validates the record before use, and without a valid record an automatic approve posts as a comment.

Recommendation: tests/flow.sh now posts a round to the stub, returns that exact body through the REST stub, and checks that rounds --json and --check read it back.

catalan-adobe added a commit that referenced this pull request Nov 27, 2026
The findings-block check takes both sides: exactly one array, empty
Markdown sections are authoritative (#8), and status-only entries for
the last code review's IDs take its severity (#9).
@catalan-adobe

Copy link
Copy Markdown
Owner Author

Thanks for round 4. No Critical; the four Important and three Minor items are addressed in the 10 commits on top of 505c56d, each with a test that fails on 505c56d.

Your question to the author: no, that delegation was not intended. A generated review now counts as a round only when GitHub reports its author as OWNER, MEMBER or COLLABORATOR, or when the account running the tool posted it (9fff993, 0f749ef). Peers on the same repos still share one history. Anyone else's generated review is listed by rounds as ignored, and can't stop a run, cause "nothing new", or look like an overlapping round. --force-round still overrides a stop. The README notes that GitHub can report a private org member as CONTRIBUTOR to a token that can't see the membership.

Also fixed, from the last round (5e22d1e): the one-to-one blocker check required an exact file:line, so this round's correct block was rejected. The block had gh-pr-review line 976 and the Markdown had 974–977, so the record was rebuilt from the Markdown (source: parsed). A Markdown range now matches any line inside it, en dash or hyphen. This round's real output is now a test fixture and gives source: model.

Important

  • A different review can confirm a failed POST (b0f6b0b) — the time window is gone. After a failed POST, the run looks for exactly one review whose ID wasn't in the final re-read, by this account, on the reviewed commit, in the event's state, with the posted body (CRLF and trailing spaces normalised). It finds zero, several, or the read fails: the preview is kept, the run says it could not confirm, and it exits 1. Tests: another body from the same account on the same SHA, the wrong state, two matches, and a match that was already a round. All are unconfirmed, and their dates are "now", so the old check would have accepted them.
  • The overlap check compares counts (2066493) — each record keeps its GitHub review ID, and the run compares the ordered ID list from the loop check with the final re-read. Any difference exits 6 and keeps the preview. Your case (ID 10 loses its header, ID 11 arrives) now exits 6. So does a round that disappears.
  • A partial marker can turn a Critical into ready (4e650ed) — a code-review marker without counts gets them rebuilt: from its findings when they cover the Markdown's blockers, otherwise from the Markdown. loop_blocking no longer reads a missing count as 0. When nothing gives a count, the round's label is the new unknown: never ready, never bad, and not used as B(K−2). Your case gives series [1], label early.
  • Blockers in a section the review says is empty (ef5ea3b) — an explicitly empty section (*(none found)*, or a heading followed directly by the next one) is authoritative. If the block has an open finding of that severity, the record comes from the Markdown. Your case gives 0 blockers, so no churn.

Minor

  • Several JSON values in the fence (e99d758) — the block is slurped and must be exactly one array. Otherwise the record comes from the Markdown, and the review still posts with a record and a marker.
  • +COMMITS (e56add1) — kept as a date window, with no extra API calls. The README and rounds -h now say it counts commits dated between two reviews, so a push during a review can count toward that review.
  • Privacy wording (032de48) — the README says the visibility filter applies to the marker posted on GitHub. round.json keeps everything the model returned, so inspect it before sharing it.

Recommendation: both negative cases are in tests/flow.sh, checking the remote action and whether the local record was finalized: another review by the same account on the same SHA, and a history that changed while its count stayed the same.

519 checks pass on macOS (bash 5 and 3.2) and Ubuntu 24.04, and shellcheck and shfmt are clean. The next round will run incremental (on the #9 code), so it re-checks F21–F27 by ID.

@catalan-adobe catalan-adobe left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Round 5 · since round 4

5 fixed · 2 still open · 3 new (3 in the new commits) · open blocking: 3 (was 4) · loop: nit loop
Next: Approve, and file the remaining findings as follow-ups

Approach

What it does: Records posted reviews as rounds and checks that history before cloning the PR or calling the model again.

Fit with the repo: Round 4’s concern is resolved. The author clarified that “that delegation was not intended.” lib/rounds.sh now counts only the operator’s own reviews and those GitHub attributes to an owner, member, or collaborator. rounds, --check, and the pre-post check all use that same history. An outsider’s generated header alone can no longer stop a maintainer’s run.

Strongest case for the approach as built: Trusted reviewers can share prior work through the existing GitHub review marker, without a new store or credential. The 14 rounds recorded for adobe/skills#813 show why checking before another paid call is worthwhile.

Alternatives: Keep the shared gate. Counting only the operator’s reviews would repeat work across maintainers. I’d revisit the trust rule if hidden organization membership routinely excluded legitimate rounds; README.md documents that limit.

Questions for the author: None.
Missing context: None that changes the verdict.

Approach: Sound

Strengths

  • gh-pr-review:1051–1052 compares ordered GitHub review IDs before posting. The regression test at tests/flow.sh:509 checks the important case: one round disappears and another arrives, so the count stays the same but the post must stop.
  • gh-pr-review:989–996 checks the attempted body, commit, account and review state before confirming a failed POST. tests/flow.sh:746–752 verifies that a different body, a different state, and two matching reviews all leave the outcome unconfirmed.
  • I ran all eight test scripts against an archive of the reviewed commit. All 519 checks passed. The cases below are outside those assertions.

Issues

🚨 Critical (Must Fix Before Merge)

(none found)

⚠️ Important (Should Fix)

  • F23 · lib/records.jq:269–275 — Rebuilding a missing total can still erase a known Critical. The original bold-bullet case is fixed. With counts: {"critical":1,"important":0} but no open_blocking, and a plain - bullet under Critical, I got critical: 0 and the label ready. The total was available without parsing Markdown. There is also a separate path at lib/rounds.sh:43–50: with no severity headings, the same review text gave unknown with an ordinary count-less marker but ready with a minimal marker.

    • Use the sum when both severity counts are usable. When neither the record nor the Markdown establishes a count, preserve null on the minimal-marker path too.
  • F24 · lib/records.jq:90 — The empty-section check and the record builder disagree about which entries count. The check exempts fixed, declined and later entries, but lib/records.jq:191–192 converts all accepted entries to new. With “none found” under every heading and four Critical entries marked fixed in the block, the flow stub submitted APPROVE and saved source: model with four open blockers.

    • Validate the entries as this version will store them, or reject unsupported status and Later fields and fall back to Markdown. This does not require implementing cross-round statuses in this PR.
  • gh-pr-review:373–376 — A failed account lookup silently removes the operator’s own contributor rounds from the gate. With one such review on the current head, I got exit 5 normally. Making only gh api user fail changed --check to exit 0, named the operator’s review as ignored, and proposed round 1. The final re-read uses the same unresolved ROUNDS_ME, so it cannot catch the mistake before posting. lib/rounds.sh:172 has the same fallback.

    • Resolve and validate the account before deciding which rounds count. Retry a failed lookup, then report that the history cannot be verified rather than starting a paid round from incomplete history.

💡 Minor (Nice to Have)

  • lib/records.jq:275 — When Markdown supplies replacement counts, the record keeps the findings list that failed validation. In the case at tests/rounds.sh:140, rounds --json reports one Critical alongside findings: [], without findings_dropped. Rebuild the list from the parsed findings or mark it unavailable, so consumers can distinguish “no findings” from “no reliable list.”
  • README.md:143 — “The history is the same for everyone with the same access” is not true of two contributors with identical access: each counts their own rounds and ignores the other’s. Clarify that owner, member and collaborator rounds are shared, while the own-account exception can give contributors different round numbers.
Fixed since the last round (5)
  • F21 — Failed-POST recovery now requires exactly one matching review and excludes IDs from the final round snapshot.
  • F22 — The overlap check compares ordered review IDs rather than counts.
  • F25 — The findings fence must contain exactly one JSON array; multiple values fall back to Markdown.
  • F26 — The README and rounds --help explain that +COMMITS is a date window, not a comparison of reviewed SHAs.
  • F27 — The README distinguishes the filtered GitHub marker from the local round.json and warns users to inspect it before sharing.

Recommendations

Extend the existing round-trip tests to assert both the persisted findings and the next decision. In particular, changing only marker compaction should not turn unknown into ready, and an entry excluded during validation should not reappear as an open blocker after posting.

Assessment

Ready to merge? No

Reasoning: The overlap and failed-POST fixes address their reported failure cases. The remaining issues affect the gate itself: it can skip the operator’s history, report a known blocker as zero, or stop on blockers the visible review says do not exist.


Review generated by gh pr-review · model: azure-openai-direct/gpt-6.2-astra

A marker with critical and important but no open_blocking gets their sum. The Markdown count includes plain bullets under a severity heading, and a minimal marker whose review has no severity heading stays unknown, as a marker without counts does.
The list did not show the review's blockers, so the record says findings_dropped instead of keeping it.
stored_findings and stored_status decide each entry's status in one place, for the record builder, the block checks and the counts of a marker's findings. Every entry is stored as new, so a fixed, declined or later entry is no longer exempt from the checks.
Its own rounds count, so without its login the history can't be checked. The review, --check and rounds read it with one retry, then exit 1 before the loop check, with no clone and no model call.
@catalan-adobe

Copy link
Copy Markdown
Owner Author

Thanks for round 5. The incremental round did what it should: F21, F22 and F25–F27 fixed, F23 and F24 still open, three new, and the approach is back to Sound. The loop reads a nit loop. The remaining items are small and all in the gate itself, so they're fixed here rather than filed as follow-ups. That's 6 commits on top of 0f749ef, and each new test fails on 0f749ef.

Important

  • F23 — a known Critical erased (cdac987)
    • A marker with critical and important but no open_blocking now gets their sum. The Markdown is used only when that isn't possible.
    • markdown_counts was missing plain bullets, which is why your case gave 0. It now counts top-level - and numbered items, bold or plain, but not indented sub-points or a - None. line.
    • The minimal-marker path goes through the same with_counts, so a review with no severity heading gives null counts and unknown there too.
    • Your cases now give critical 1 and open blocking 1 with label early. With no heading, they give unknown for both a count-less marker and a minimal one.
  • F24 — the empty-section check and the builder disagree (131a1ad)
    • New stored_status and stored_findings are now the one place that decides an entry's status. In this PR that status is always new.
    • The builder, block_respects_empty, block_covers_markdown and the marker-findings counts all use them, so they can't disagree.
    • Your case (*(none found)* everywhere, four fixed Criticals) now gives source: parsed with 0 open blocking.
  • The account lookup (2c695da) — operator_login reads the login with one retry. If both reads fail, the review command and --check stop before the loop check with exit 1, with no clone and no model call. rounds fails the same way. The error says the round history can't be checked. Your case, where the lookup fails once and then succeeds, now exits 5 (nothing new).

Minor

  • A findings list that failed validation (c42f55c) — when counts come from the Markdown, the record drops findings and sets findings_dropped: true. Consumers can now tell "no findings" from "no reliable list".
  • README (e2cd944) — owner, member and collaborator rounds are shared. Two contributors who are neither each count only their own rounds, so their round numbers can differ. Nothing runs if the account can't be read.

Recommendation (a053ef0, and part of 131a1ad): round-trip tests now check both the stored findings and the next decision:

  • A review long enough to get the minimal marker keeps its Critical in round.json. Read back, it's unknown, never ready.
  • The F24 round, once posted, reads back as ready [0] with findings: []. The excluded entries don't come back as open blockers.

541 checks pass on macOS (bash 5 and 3.2) and Ubuntu 24.04, and shellcheck and shfmt are clean.

catalan-adobe added a commit that referenced this pull request Nov 27, 2026
#8's stored_status/stored_findings made one function decide the status a
findings-block entry is stored with, for the builder and the block checks.
Here the builder is _track, so its per-entry decision moves into
entry_outcome($known; $later_files), used by _track and by
stored_findings($base; $later_files). write_round_record judges the block
with stored_findings before block_covers_markdown and block_respects_empty:
a declined entry without a reason or an unhonoured Later is open, one stored
fixed, declined or Later is not. Carried findings take no part.
with_base_severity is gone (entry_outcome takes the base severity), and the
block checks and _findings_counts read a stored list as it is.

parse_findings keeps #9's IDs and <details> sections and counts #8's plain
bullets. A minimal marker on a later round keeps the backfill counts from
its progress line instead of recounting the Markdown, which leaves out
carried findings.

@catalan-adobe catalan-adobe left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Round 6 · since round 5

2 fixed · 3 still open · 3 new (3 in the new commits) · 1 for later · open blocking: 3 (was 3) · loop: nit loop
Next: Approve, and file the remaining findings as follow-ups

Approach

Unchanged since round 5: rounds, --check, and the review command still use the same trusted GitHub review history, and now stop rather than silently ignore the operator’s own rounds when the account lookup fails.

Approach: Sound

Strengths

  • gh-pr-review:374 and lib/rounds.sh:193 now use the same account lookup. tests/flow.sh:545–558 verifies the important failure contract: when the retry fails, --check, rounds, and the review command exit 1 without starting a review.
  • tests/flow.sh:714–753 checks both sides of posting: what the local record contains and what the next run learns from GitHub’s copy. That catches errors a record-builder test alone cannot.
  • I ran all eight test scripts against an archive of a053ef0; all 541 checks passed. The cases below are outside those assertions.

Issues

🚨 Critical (Must Fix Before Merge)

(none found)

⚠️ Important (Should Fix)

  • F23 · lib/records.jq:285–286 — A partial marker can still turn a visible Critical into ready. The reported case with critical: 1, important: 0 is fixed. The new sum branch, however, also trusts critical: 0, important: 0 when both the marker’s F1 and the Markdown identify a Critical at a.go:7. With only open_blocking missing and a “Yes with fixes” verdict, round 5’s code reconstructed 1; this commit reconstructs 0 and labels it ready. Use the sum when it is consistent with the visible blockers; otherwise use the matching findings or Markdown.

  • F24 · lib/records.jq:86 — - None. means “no finding” to the parser but not to the empty-section check. The fix works for *(none found)*. With - None. as the sole Critical bullet, I got parse_findings: [], yet a block containing four Criticals marked fixed passed validation and produced four open blockers. Strip the optional list prefix in the shared empty-line check so both callers interpret the same Markdown the same way.

  • lib/records.jq:260 — Rebuilding counts reopens findings that a posted marker already marked fixed. I removed only counts from this PR’s actual round 5 marker and read it against its posted Markdown. The previous code recovered 3 blockers and 5 fixed; this version reports 5 blockers and 0 fixed, while still returning F21 and F22 as status: "fixed". That changes the round’s label from nit-loop to churning. Assigning new is appropriate when writing a PR 1 record from model output; when reading an existing record, validate and count its stored statuses instead.

💡 Minor (Nice to Have)

  • F29 · lib/records.jq:286 — The Markdown fallback now drops an unreliable findings list, but the new sum branch leaves the same contradiction in rounds --json. The fixture at tests/rounds.sh:153–158 supplies findings: [] and one Critical, and explicitly expects no findings_dropped flag. Keep the known count, but mark the list unavailable when it cannot account for that count.
  • lib/records.jq:294 — Dropping a list can also drop its ID history. With an older marker containing F1 but no last_ids, rejecting the list against an explicitly empty Critical section reduced the ID floor from 1 to 0; the next finding was F1 again. Save the highest observed IDs before deleting the list. Reserving an ID does not require trusting the finding.
  • lib/rounds.sh:65–68 — A minimal Rethink marker now loses the counts object entirely. The merge deletes the backfilled null-valued counts, then with_counts skips the record because code_review is false. Preserve the backfilled counts for Rethink so JSON consumers get the same shape regardless of marker size.
Fixed since the last round (2)
  • F28 — The operator lookup retries once and then fails closed before any clone or model call.
  • F30 — README.md:143–148 now distinguishes shared collaborator rounds from contributor-specific history and explains why round numbers can differ.
Later (1)
  • lib/records.sh:99 — The unchanged markerless backfill still turns an unreadable count into zero. With the same heading-free review and “Yes with fixes” verdict, increasing only its padding took the readback from [1] with counts, to [null] with a minimal marker, to [0] and ready with no marker. This can wait as a backfill follow-up: the remaining transition requires a review too long for even the minimal marker.

Recommendations

Keep model-input normalization separate from posted-record recovery. Add regression assertions on the recovered record and its label: a visible blocker must not become zero, a stored fixed finding must not become open, and discarding a list must not lower the ID floor.

Assessment

Ready to merge? No

Reasoning: The account-lookup fix is complete. The remaining count-recovery paths can still report a visible Critical as zero or count resolved findings as open, changing the decisions that rounds and --check expose to automation.


Review generated by gh pr-review · model: azure-openai-direct/gpt-6.2-astra

@catalan-adobe

Copy link
Copy Markdown
Owner Author

Thanks for round 6. All six items are fixed in 7 commits on top of a053ef0, following your main recommendation: writing a record from the model's output and reading a posted record back are now separate paths. L1 stays a follow-up, as you suggested. On a053ef0, 16 of the new or changed checks fail.

The read/write split (lib/records.jq)

  • Writing (the model's findings block): stored_status (new in this PR), stored_findings, block_covers_markdown, block_respects_empty, findings_block_ok. Only build_record and the review command use them.
  • Reading (a posted record): record_findings keeps each entry's own status. record_counts, record_covers_markdown and record_respects_empty build on it. Only with_counts uses them, and it calls no write-side helper.
  • Shared: both sides run the same checks on a list that has statuses (_open, _counts, _covers_markdown, _respects_empty).

Important

  • Reading reopened fixed findings (75c8695) — with_counts counts the record's stored statuses. Round 5's posted marker is now a fixture. With only counts removed, it reads back as 3 blockers and 5 fixed, with F21/F22 fixed and label nit-loop (on a053ef0: 5, 0, churning).
  • F23 (8baaeba) — the critical + important sum is used only when each severity's count is at least the Markdown's and at least the record's own open findings of that severity. Otherwise the counts come from the findings when they cover the Markdown's blockers, else from the Markdown. Your a.go:7 case gives 1 blocker, label early.
  • F24 (ab70d2c) — the none-line check strips an optional - , * , + or 1. prefix, and parse_findings now calls the same function. - None. with four fixed Criticals in the block gives source: parsed and 0 blockers.

Minor

  • F29 (cfb05f7) — when the sum is kept but the list's open Critical and Important counts don't match it, the list is dropped (findings_dropped: true). The fixture now expects that.
  • ID floor (5bea1fe) — before a list is dropped, its highest IDs go into last_ids, taking the max with any existing ones. Your case (an older F1 with no last_ids, an empty Critical section) reserves F2 next.
  • Minimal Rethink marker (3dcacf0) — it keeps its null-valued counts, so rounds --json has the same shape whatever the marker size.

Recommendation (fc51044): five damaged versions of round 5's real marker, each checked on the recovered record and its label. Whatever part is missing, the round never shows fewer than its 3 visible blockers, F21/F22 stay fixed, and the ID floor stays at 30.

560 checks pass on macOS (bash 5 and 3.2) and Ubuntu 24.04, and shellcheck and shfmt are clean. Round 7 will run with --force-round, since two nit-loop rounds in a row stop the next one.

catalan-adobe added a commit that referenced this pull request Nov 27, 2026
#8 splits writing a record from the model's block from reading a posted
one. Here the write side stays entry_outcome and stored_findings($base;
$later_files); block_covers_markdown and block_respects_empty take
($base; $later_files) and judge the block as stored_findings stores it,
built on #8's shared _open, _covers_markdown and _respects_empty.
findings_block_ok keeps #9's $ids. The read side is #8's record_findings,
record_counts, record_covers_markdown and record_respects_empty. Only
with_counts uses them. _findings_counts and _stored_open are gone.

For #9's later rounds: record_findings keeps the unverified flag, and
record_respects_empty skips unverified findings. The Markdown leaves
carried findings out, so its "none found" says nothing about them, yet
they still count. with_counts takes the progress line's open blocking
count (progress_blocking, shared with backfill_record) as a visible
blocker count. The critical + important sum, and a kept list's open
blockers, must reach it, and the Markdown fallback uses it.
markdown_counts now counts the parsed statuses (_counts): an ID shown
in the Fixed section is fixed or declined, not new. So round 5's
damaged-marker case with F28 set to fixed reads 5 fixed, as its
progress line says, not 0. A minimal marker keeps its backfill counts
on a later round (#9) and its null counts on a Rethink (#8).

@catalan-adobe catalan-adobe left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Round 7 · since round 6

2 fixed · 4 still open · 1 new (1 in the new commits) · open blocking: 3 (was 3) · loop: nit loop
Next: Approve, and file the remaining findings as follow-ups

Approach

Unchanged since round 6: lib/records.jq now distinguishes new model findings from findings recovered from a posted review, so fixed findings stay fixed while rounds, --check, and the review command continue to use the same trusted GitHub history.

Approach: Sound

Strengths

  • lib/records.jq:193–201 separates reading posted statuses from assigning new to model output. The real round-5 fixture at tests/rounds.sh:218–223 now recovers 3 blockers and 5 fixed findings when only counts is removed.
  • tests/flow.sh:727–734 checks F24 through the posting path: four model-supplied Criticals next to - None. produce a parsed record with zero blockers.
  • I ran all eight test scripts against an archive of fc51044. All 560 checks passed. The cases below are additional recovery checks; none requires changing the checkout.

Issues

🚨 Critical (Must Fix Before Merge)

(none found)

⚠️ Important (Should Fix)

  • F23 · lib/records.jq:340–347 — A disagreement about Important findings can still erase an independently confirmed Critical. I tested a partial marker with critical: 1, important: 0, a Critical F1 at a.go:7, and a stale Important F2. The Markdown shows F1 as a * bullet and says - None. under Important. The reader rejects the sum because of F2, rejects the list because Important is empty, then falls back to a parser that does not count * bullets. Round 6 returned 1 blocker; this head returns 0 and ready. Recover each severity independently so rejecting F2 does not discard two agreeing sources for F1.

  • F31 · lib/records.jq:341–347 — Fixed findings stay fixed with the full marker, but not after the supported location-compaction step. I padded the round-5 fixture until marker_line removed locations but retained all ten IDs and statuses, then removed only counts. The location check rejected the list, and the Markdown fallback counted the five bullets under “Fixed since the last round” as Minor findings. The result was 7 Minor, 10 new, 0 fixed, instead of 2 Minor, 3 new, 5 fixed. The blocking label stayed correct, but the status history did not. Distinguish absent locations from conflicting locations, and exclude folded Fixed and Later sections from open-finding counts.

  • lib/records.jq:329 — Recovery counts bullets from the approach pass that the record writer never counted as code findings. I used a Sound approach with four bullets under #### Important context, followed by a code review explicitly reporting no findings. Removing only open_blocking from the otherwise accurate record changed recovery from 0 on round 6 to 4 Important on this head. After three four-blocker rounds, that changes the next decision from run to stop. Apply the Markdown checks to the code-review Issues section, as opposed to the entire assembled review.

💡 Minor (Nice to Have)

  • F29 · lib/records.jq:338 — The reported Critical mismatch is fixed, but the list check omits Minor counts. With findings: [], counts: {critical: 0, important: 0, minor: 1}, and one visible Minor bullet, recovery still returns the empty list alongside minor: 1, without findings_dropped. Check every available open-severity count before advertising the list as reliable.
  • F32 · lib/records.jq:313–314 — Saving the highest raw ID fixes sequential rounds, but not overlapping ones. With two submissions both claiming round 1 and a new F1, I made the second list too short for its retained severity counts, with counts.new absent. Dropping that list before reconciliation leaves the floor at 1; the next round starts at F2, rather than F3 as it did on round 6. Reserve the observed new IDs against the canonical predecessor before discarding the list.
Fixed since the last round (2)
  • F24 — The parser and empty-section check now agree that a list item containing only None. is not a finding.
  • F33 — lib/rounds.sh:65–67 preserves the backfilled null-valued counts object for a minimal Rethink marker.

Recommendations

Extend the round-5 fixture test across the marker shapes that marker_line actually emits. Assert the whole recovered record—not just open_blocking—and the next decision. That distinguishes a correct loop label from correct finding history.

Assessment

Ready to merge? No

Reasoning: The ordinary record path and two earlier findings are fixed. Partial-marker recovery can still turn a visible Critical into ready, stop a run on approach prose, or report resolved findings as new.


Review generated by gh pr-review · model: azure-openai-direct/gpt-6.2-astra

@catalan-adobe

Copy link
Copy Markdown
Owner Author

Thanks for round 7: F24 and F33 are fixed. This PR now stops here, as its own loop check suggests: rounds 5, 6 and 7 were nit loops, open blocking stayed at 3, and the PR is flagged too big. The remaining items move to one small follow-up PR, which gets its own review:

  • The parser counts severity headings outside the Issues section (your approach-pass case). This one is real beyond damaged markers. Any heading that mentions Critical, Important or Minor starts a severity section, so #### Important context in the approach reads as Important findings. That affects reviews read from their Markdown (backfill, or source: parsed). None of this PR's recorded rounds is affected. Fix: count severity sections only inside the code review's ### Issues section.
  • F23, F29, F31 and F32: recovery from partial markers. Each case needs a code-review marker missing all or part of its counts. marker_line never writes one: every compaction step keeps the counts, and the minimal marker has no findings list. All generated markers on this PR and on feat(stardust): replica --extend / --extend-next adds pages to a delivered site adobe/skills#823 carry full counts. This recovery path was added in round 4 for a hypothetical case, and each round since has found the next inconsistency in it. The follow-up replaces it with one rule: a code-review marker without the full counts the tool writes is read from the review's Markdown, like a review without a marker, keeping the IDs it held as the ID floor.
  • L1 (from round 6): with that rule, a review with no severity section gives unknown counts, never 0.

Merging with a merge commit, so the stacked #9 keeps its history.

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