Skip to content

Read partial markers from the Markdown, and severity sections only in the Issues section - #10

Merged
catalan-adobe merged 23 commits into
mainfrom
simplify-record-recovery
Nov 27, 2026
Merged

catalan-adobe merged 23 commits into
mainfrom
simplify-record-recovery

Conversation

@catalan-adobe

Copy link
Copy Markdown
Owner

Follow-up to #8. It closes the items its last review round left open (see the round-7 reply). lib/ gets smaller: 72 lines added, 133 deleted.

1. Severity sections only in the Issues section

Before, any heading that mentioned Critical, Important or Minor started a severity section, so #### Important context in the approach read as Important findings. That affected every review read from its Markdown (backfill, source: parsed).

  • Severity headings now count only from a heading titled Issues to the next heading of the same or a higher level. A body without an Issues heading is read whole, as before.
  • Lines in a <details> block (the folded Fixed and Later lists of later rounds) are in no section.
  • One helper (_lines) tags each line once; parse_findings, the empty-section check, the block checks and backfill all use it.
  • * and + list items now count as findings, like - and numbered items.

2. One rule for partial markers

A code-review marker is complete when its counts have numbers for open_blocking, critical, important and minor, and open_blocking equals critical + important. That's what marker_line writes at every compaction step.

  • A complete marker is read as is.
  • Any other marker is read like a review without a marker: counts and findings come from the Markdown (source: backfill, findings_dropped: true). Its ID floor is the max of the marker's last_ids and the IDs its list held, so the floor never goes down.
  • Replaced: the recovery code added during Record each review round, and stop review loops that don't converge #8's review: with_counts with its sum branch, markdown_counts, _drop_findings, record_findings, record_counts, record_covers_markdown, record_respects_empty and _counts.
  • Closes: F23, F29, F31 and F32 from Record each review round, and stop review loops that don't converge #8's last round.
  • By design: a partial marker's fixed and declined history is not kept.

3. No severity section → unknown

A code review read from its Markdown with no severity section at all gets null counts (label unknown), never 0, whatever the marker size. This is L1 from #8's round 6.

Tests

  • New fixture: an approach section with #### Important context. It gives 0 blockers with a partial marker and with none.
  • One table of partial markers, including the round-7 F23 (* bullet) and F29 (minor: 1) cases.
  • A two-runs-claim-round-1 case, so the next round still numbers from F3.
  • Round 5's real review taken through every marker shape marker_line emits: full, without titles, without locations, without Later, without findings, minimal. Each one gives the same counts, ID floor and next decision as the full marker.

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

Real histories are unchanged: rounds gives the same output on main and on this branch for #8 (7 rounds), adobe/skills#813 (14), #823 (5), #831 (1), #763 (3) and #764 (3).

@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: Reads open findings from the code review’s Issues section when present, excluding folded Fixed and Later lists. Incomplete markers use the existing Markdown backfill; finding IDs stay reserved, and no severity section means unknown, not zero.

Fit with the repo: lib/records.jq now gives findings parsing and empty-section checks one definition of a severity section. lib/rounds.sh chooses between marker and backfill for every history reader. Neither rounds nor the loop policy needs a special case.

Strongest case for the approach as built: The writer keeps the severity counts together until it drops them all. As the #8 discussion put it, the partial-count recovery path was added “for a hypothetical case.” The PR’s six compaction cases exercise what the writer actually emits.

Alternatives: Keep #8’s recovery logic to salvage fixed and declined statuses from damaged markers. That would be worth its maintenance cost if a released writer routinely emitted partial counts alongside reliable finding statuses.

Questions for the author: None.
Missing context: None material.

Approach: Sound

Strengths

  • lib/records.jq:197 makes the complete-marker rule explicit, and lib/rounds.sh:42 applies it before the history reaches the loop policy. That separation makes the recovery decision easier to verify.
  • tests/rounds.sh:262 exercises the actual marker writer at the 60,000-character boundary rather than testing only hand-built marker shapes. I ran all eight test scripts; they passed.

Issues

🚨 Critical (Must Fix Before Merge)

(none found)

⚠️ Important (Should Fix)

  • [lib/records.jq:300] — The no-severity rule applies to backfill but not to a newly parsed review. I ran the flow stub with just “Looks fine” and **Ready to merge?** Yes with fixes, without a findings block. gh-pr-review:905 selected source: parsed, wrote open_blocking: 0, and the full marker read back as ready. The same body without the marker reads as unknown.

    • Apply the section-presence check when writing a source: parsed record too. Add a producer-to-reader test that expects unknown with both the full and minimal markers.
  • [lib/rounds.sh:56] — Backfill allocates a new ID for every visible finding before taking the maximum with the marker’s floor. With round 4’s floor set to F27, I replayed the round-5 fixture: the full marker yielded F30, but the minimal marker with last_ids.F: 30 yielded F32. Two of the five visible findings were carried over, not new. The test at tests/rounds.sh:217 masks this by giving the preceding rounds no IDs.

    • Preserve the surviving marker floor for an in-sequence round rather than treating every open Markdown bullet as a new allocation. Keep collision recovery for overlapping rounds, and test both cases. Otherwise the next finding gets F33 instead of F31, and an already-posted F31 can be renumbered on read.
  • [lib/records.jq:372] — A mistyped count discards independently valid IDs before the partial-marker path runs. With counts: {"minor":"1"}, last_ids: {"F":7}, and an empty Critical section, fetch_round_records returned floor 0 and no findings_dropped flag. The next round can reuse F1.

    • Keep strict validation for reading a marker as is, but let an otherwise valid schema-1 marker with malformed counts contribute its validated IDs to backfill. Test a nonnumeric count alongside a populated floor.
  • [lib/records.jq:63] — Inside <details>, tag counting takes precedence over code fences and inline code. A fenced HTML example containing a literal opening <details> increments the depth; the real closing tag then leaves the parser inside the fold. I verified that a visible Critical bullet immediately after that fold disappears. Conversely, a fixed-item title quoting </details> in backticks exposes the remaining fixed bullets as open.

    • Track fenced-code state inside folds and count structural tags, not tag text in code. Cover both a hidden fixed bullet and a visible blocker after the real closing tag.
  • [lib/records.jq:69] — A valid indented Issues heading does not establish the section boundary. Indenting just ### Issues by two spaces makes GitHub render the same heading, but _lines falls back to scanning the whole body and counts #### Important context bullets again. An indented closing heading likewise fails to end the section.

    • Allow zero to three leading spaces in both heading detection and level capture. Add an indented opening and closing heading to the scope tests.

💡 Minor (Nice to Have)

(none found)

Recommendations

Use the same review body and a populated prior history across producer-to-reader tests, varying only the marker shape. Assert the resulting label and the next allocated ID; blocker totals alone did not expose the round-5 discrepancy.

Assessment

Ready to merge? No

Reasoning: The simpler marker rule is sound, but reproducible cases still make readiness and finding IDs depend on marker shape. The section parser can also hide a visible blocker or count findings outside Issues.


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 1. All five items are fixed in 5 commits on top of 4b5ce13, and each new test fails on 4b5ce13. lib/ plus gh-pr-review is still smaller than on main (103 lines added, 141 deleted).

  • F1 — a parsed review with no severity section (446614f)
    • build_record has one rule for the writer (source: parsed) and for backfill: with no severity section, the counts are null.
    • "Looks fine" plus "Yes with fixes", with no findings block, now reads back unknown with the full marker, the minimal marker and no marker.
    • Also: an automatic approve now needs a known blocker count. A bare "Yes" with no severity section posts as comment. An approve chosen at the prompt still approves, and the README's --decision row says so. The flow fixtures that approved on a bare "Yes" now use a review with an empty Critical section.
  • F2 — a minimal marker over-allocated IDs (5203275)
    • When a marker is in its own position and carries a numeric last_ids.F, that floor is the writer's own and stays authoritative, never below the history's. Its counts.new is kept.
    • Any other case keeps the old path: every visible bullet reserves an ID, then reconcile_record handles overlaps.
    • With rounds 1–4 carrying IDs up to F27, every marker shape gives floor 30 and next ID F31. Round 5 posted twice still reserves F31–F35 for the second copy, and the next ID is F36.
  • F3 — malformed counts discarded valid IDs (1959462) — a code-review marker that fails validation only because of its counts drops the counts and keeps the rest. It's read from the Markdown, and its validated last_ids and IDs count toward the floor. Your case gives floor 7, findings_dropped: true, next F8. Strict validation still applies to everything else.
  • F4 — <details> and code (fb61181) — fence state is tracked inside folds too. Only a line starting with <details or </details (after 0–3 spaces) and outside a fence opens or closes a fold. Your two cases are tests: a fenced example inside a fold no longer hides the Critical after it, and a quoted `</details>` no longer exposes fixed bullets.
  • F5 — indented headings (ac96184) — headings with 0–3 leading spaces count, for both detection and level. An indented ### Issues and an indented closing heading now bound the section, and a 4-space line is not a heading.

Recommendation: the round-5 fixture with a populated history (floor F27) goes through every marker shape marker_line emits. Each shape is checked for its label, its floor and the next allocated ID.

605 checks pass on macOS (bash 5 and 3.2) and Ubuntu 24.04, and shellcheck and shfmt are clean. rounds output (table and --json) is unchanged for gh-pr-review#8 and adobe/skills#813, #823, #831, #763 and #764.

@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 2 · since round 1

4 fixed · 1 still open · 6 new (6 in the new commits) · open blocking: 6 (was 5) · loop: early

Approach

Unchanged since round 1: lib/records.jq now treats missing severity sections as unknown on both write and backfill, the approval path uses that result, and lib/rounds.sh still handles ID recovery for all history readers.

Approach: Sound

Strengths

  • tests/rounds.sh:295 now checks the next ID the writer actually allocates. Starting the round-5 fixture at F27 exposes the over-allocation that the original empty history masked.
  • lib/records.jq:385–391 recovers IDs from a marker with malformed counts without relaxing validation of the remaining fields. The reported minor: "1" case now preserves F7 and allocates F8 next.
  • I ran all eight test scripts on the reviewed checkout; they passed. The cases below are outside their assertions.

Issues

🚨 Critical (Must Fix Before Merge)

(none found)

⚠️ Important (Should Fix)

  • F4 · [lib/records.jq:67] — Fence state inside a fold is still a boolean. The two round-1 examples pass, but a four-backtick Markdown example can itself contain triple-backtick fences. The first inner fence switches parsing back on, so a literal <details> inside the example increments the fold depth. I verified that parse_findings then drops a visible Critical bullet after the real </details>.

    • Remember the opening fence’s character and length; close it only on a valid matching delimiter.
  • [gh-pr-review:908] — A newly written unknown review can read back as ready from its own full marker. I ran the flow stub with #### Important context and one prose sentence in the approach, then Looks fine and a bare Yes in the code review, with no findings block. The writer inspected only review-body.md, recorded open_blocking: null, and posted a comment. On readback, lib/records.jq:303 inspected the combined body, found the approach heading, and returned open_blocking: 0, label ready.

    • Make the writer and backfill inspect the same code-review portion. Add this two-pass case to the round-trip test; a heading in the approach should not change the recorded readiness after posting.
  • [lib/rounds.sh:61] — Matching the submission position does not prove that the marker’s IDs are collision-free. With round 1 at F3 and a round-2 marker containing a new F2, the complete marker reconciles the collision to F4. Removing only .counts leaves the new F2 in the input, but this branch drops the list, sets .counts.new to null, and leaves the floor at F3. The next finding becomes F4 instead of F5.

    • Check the surviving IDs against the earlier floor before discarding the list. Preserve the writer’s floor for the ordinary F27→F30 case, but reserve IDs for demonstrably colliding new findings even when the round number matches.
  • [gh-pr-review:1025] — The automatic-approval check fails open if jq cannot evaluate it. Making only this invocation return an error caused the flow stub to submit APPROVE with source: parsed and open_blocking: null. The final record check verifies that .counts is an object, so it does not catch this.

    • Require a successful positive check for a numeric blocker count before automatic approval. Treat both an unknown count and a failed read as grounds to comment; leave an explicitly chosen approval alone.
  • [lib/records.jq:64] — The new closing-tag rule misses structural </details> tags that follow other HTML on the same line. A fold ending with <p>Fixed.</p></details>, followed by a blank line and a Critical bullet, renders with the bullet outside the fold. Round 1 parsed that bullet; the current parser returns [].

    • Recognize closing tags after real markup without treating quoted or fenced tag text as structural. Test the visible bullet after the fold, not just the hidden bullets inside it.
  • [lib/records.jq:72] — An indented heading inside a list item now ends the enclosing severity section. Under #### Important, I put ### Why it matters inside the first finding, followed by a second top-level finding. GitHub-flavored Markdown renders the heading inside the first <li> and the second finding as its sibling. Round 1 counted both; the current parser counts only the first.

    • Distinguish a heading nested in a list item from a top-level heading indented by up to three spaces. Keep the new tests for genuinely indented Issues boundaries.

💡 Minor (Nice to Have)

  • [README.md:61] — The new --decision description says a code review without a severity section posts as a comment. A bare Yes with a valid empty findings block still posts as APPROVE: the block supplies a known zero. Describe the condition as unknown blocker count, with a heading-free Markdown fallback as the example.
Fixed since the last round (4)
  • F1 — The writer now gives a parsed, heading-free code review null counts rather than zero. The separate combined-body readback discrepancy is reported above.
  • F2 — The in-sequence round-5 marker retaining F30 no longer allocates fresh IDs for carried findings; the next finding is F31.
  • F3 — Malformed counts no longer discard independently valid IDs.
  • F5 — Top-level opening and closing Issues boundaries now accept zero to three leading spaces.

Recommendations

Keep the same posted body and prior history when varying marker shape. Include the final compaction step at lib/records.jq:352, where even last_ids is dropped: that case needs an explicit conservative-floor expectation, distinct from the F31 guarantee when the floor survives.

Assessment

Ready to merge? No

Reasoning: The reported writer and ID-floor examples are fixed, but a posted review can still change from unknown to ready on readback, and valid Markdown can hide open blockers. The automatic-approval guard also needs to fail closed.


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 2. Three items are fixed, the Markdown reader's scope is now documented, and four items are declined for that reason. Five commits on top of 446614f.

Fixed

  • Writer and reader read different text (f760c78)
    • New code_review_part returns the text after the approach verdict line (**Approach:** Sound|Questionable|Rethink), or the whole text without one.
    • Backfill, the shell parse_findings, and the writer's parsed path, block checks and no-section check all read through it. The writer now reads the posted body, not review-body.md.
    • Your round trip (#### Important context in the approach, "Looks fine" and a bare Yes) is written unknown and reads back unknown with the full marker, the minimal marker and no marker.
  • Automatic approval fails open on a jq error (3c17934) — an automatic approve needs a successful jq -e check that counts.open_blocking is a number, both at the verdict and right before posting. A false result, an unknown count or a failed check posts as comment. A jq stub failing only that check now gives COMMENT. An approve chosen at the prompt is left alone.
  • README --decision (d9a1b20) — the condition is now "unknown blocker count", with a heading-free Markdown fallback as the example. A valid empty findings block is a known zero and approves.

Recommendation (6bffbcf): the every-marker-shape test now includes the last compaction step, where last_ids is dropped too. Its counts and label match the full marker's. Its floor is conservative: every visible finding reserves an ID, giving F32, above the writer's F30, never below.

Declined: the Markdown reader's scope (58d4b02, in the README and above _lines)

  • The Markdown is read only as a fallback: when the findings block is unusable, or a review has no usable marker. In normal rounds the model's findings block is the source.
  • The reader follows the format gh-pr-review asks the model for: an ### Issues section with severity headings, list-item findings, and the folded Fixed and Later lists with each tag on its own line. It's best effort for other Markdown.
  • That covers these four, which stay as they are:
    • F4: fences nested in longer fences.
    • </details> after other HTML on the same line.
    • Headings nested inside a list item. The 0–3-space top-level case from round 1 stays.
    • The in-position ID collision: it needs a marker whose counts were removed by hand, and the tool doesn't write one.

Each Markdown edge case fixed in round 1 led to the next one in round 2. Matching full CommonMark in jq isn't worth it for a fallback path.

618 checks pass on macOS (bash 5 and 3.2) and Ubuntu 24.04, and shellcheck and shfmt are clean. rounds output (table and --json) is unchanged for gh-pr-review#8 and #10, and adobe/skills#813, #823, #831, #763 and #764.

@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 3 · since round 2

3 fixed · 1 still open · 1 regressed · 6 new (5 in the new commits) · 3 declined · open blocking: 5 (was 6) · loop: churning
Next: Look at what keeps coming back, and decide it with the author before the next round

Approach

Unchanged since round 2: the writer and backfill now use lib/records.jq to read the same code-review text in the tool’s documented format, and automatic approval requires a known blocker count.

Approach: Sound

Strengths

  • tests/flow.sh:796 checks the original F6 case through posting and readback. With a plain **Approach:** Sound verdict, the heading-free code review stays unknown with a full marker, a minimal marker, and no marker.
  • gh-pr-review:1036 and gh-pr-review:1129 now require a successful blocker-count check before sending an automatic approval. An explicitly chosen approval remains separate.
  • tests/rounds.sh:294 exercises the writer’s smallest marker at the actual size boundary and checks the next allocated ID, not just the recovered count. I ran all eight test scripts; all 618 checks passed.

Issues

🚨 Critical (Must Fix Before Merge)

(none found)

⚠️ Important (Should Fix)

  • F7 · [lib/rounds.sh:61] — An in-position minimal marker can still lose an ID reservation. The decline assumed someone had to remove counts by hand. I reproduced this with two unedited reviews produced by the PR base: round 1 had a * finding and was long enough to omit its marker. The base did not count that bullet, so it assigned F1 to a different finding in round 2. This branch now assigns F1 to round 1 on backfill. With a full round-2 marker it reconciles the second finding to F2 and allocates F3 next; with the base writer’s actual minimal marker it leaves the floor at F1 and allocates F2 next.

    • Add this upgrade history to the tests. When the reconstructed floor already reaches the marker’s floor, account for visible findings that are demonstrably not carryovers rather than treating the matching round number as sufficient. Keep the existing F27→F30 carryover case.
  • F1 · [gh-pr-review:913] — Reading the assembled body reintroduces automatic approval for a parsed code review with no severity section. I changed only **Approach:** Sound to **Approach:** _Sound_ in the F6 flow scenario. The approach pass still recorded sound, but the \b at lib/records.jq:63 did not match before the closing underscore. The writer counted #### Important context from the approach, recorded zero instead of null, and sent APPROVE instead of COMMENT. An omitted verdict produced the same result. Round 2’s writer did not have this failure because it inspected the code-review text directly.

    • Use the known pass boundary when writing, and make readback recognize the same verdict markup as last_verdict. If the boundary cannot be established, an approach heading should not turn an unknown count into zero.
  • [lib/records.jq:62] — A quoted verdict inside a code review can discard a visible blocker. With --skip-approach, I used a Critical finding quoting > **Approach:** Sound, followed by empty Important and Minor sections and an empty JSON block. The writer discarded everything through the quote, accepted the contradictory block, and recorded source: model, open_blocking: 0. There was no approach pass to strip.

    • Restrict verdict detection to the approach portion, not the first matching line anywhere in the body. Add a code-only case asserting that the empty block is rejected and the Critical is retained.
  • [gh-pr-review:1129] — The final approval check can change the GitHub event without changing the posted record. I made only the check against round.json.posted fail. GitHub’s request correctly contained COMMENT, but both the hidden marker and the saved round.json said decision: "approve", preview: false. The posted record had already been serialized at gh-pr-review:1113.

    • Finalize the decision before serializing it, or update and validate the posted record after a downgrade. Test the event, marker, and local record together when only the second check fails.

💡 Minor (Nice to Have)

  • [gh-pr-review:904] — The generated footer now participates in the empty-section check. For a review ending in #### Critical and *(none found)*, followed by a contradictory Critical in the findings block, round 2 returned parsed, 0; this head returns model, 1. The appended separator and attribution make the section look nonempty. Exclude the tool’s footer before validation so the last-section behavior tested at tests/records.sh:216 holds in the writer too.
  • [tests/rounds.sh:311] — Adding without last_ids as the last table row silently changed the input to the overlap test at line 316. That test reuses posted5.md, so it no longer exercises the case where a second round-5 marker retains a stale F30 floor. Save the minimal fixture by name, or run the overlap assertion for both shapes.
  • [README.md:169] — “The Markdown is read only as a fallback” misses its role in validating the model’s block. gh-pr-review:899–904 parses the Markdown before accepting even a well-formed block. Describe it as the cross-check for model findings and the source used when the block is rejected.
Fixed since the last round (6)
  • F4 — declined: “Matching full CommonMark in jq isn't worth it for a fallback path.” Longer nested fences are now an explicit limitation.
  • F6 — The reported two-pass case now stays unknown on both write and readback; F1 above concerns an incorrect count already present at write time.
  • F8 — A failed blocker-count check now sends COMMENT, not APPROVE. The separate record inconsistency is reported above.
  • F9 — declined: the supported format has “the folded Fixed and Later lists with each tag on its own line.”
  • F10 — declined: “Matching full CommonMark in jq isn't worth it for a fallback path.” The README explicitly excludes headings nested in list items.
  • F11 — README.md:61 now distinguishes an unknown blocker count from a known zero supplied by a valid empty block.
Later (1)
  • [lib/records.sh:95] — One pre-existing backfill check still inspects _sections on the whole body. A markerless, approach-only Rethink with #### Important context came back as code_review: true; --skip-approach --check on the same head then returned nothing-new even though the code was never reviewed. This classification predates the round-3 delta and can be fixed separately by checking only the code-review portion.

Recommendations

Use two regression fixtures at the boundaries where these failures occurred: a history emitted by the previous writer and read by the new one, and a posting run that compares the GitHub event with both persisted copies of the decision. Neither invariant is covered by checking the current writer’s happy path alone.

Assessment

Ready to merge? No

Reasoning: The original plain-verdict round trip and fail-closed posting behavior are fixed. However, the writer can still approve an unknown review or omit a visible Critical, and a real upgrade history produces different next IDs depending on marker size.


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 3. As the loop check suggested ("decide it with the author before the next round"), we decided what keeps coming back before fixing anything. F1, F12 and F14 all came from my round-2 change, which guessed the code review's start from the **Approach:** verdict line. That guess is gone. Five commits on top of 6bffbcf.

An explicit boundary instead of the verdict line (8e786b6; F1, F12, the footer item)

  • Writer: write_round_record reads the code review from the text it already has separately (review-body.md). The footer is never part of it.
  • Posted body: the code review is preceded by an invisible <!-- gh-pr-review:code-review --> line, also with --skip-approach. A Rethink-only review gets none. The header and the marker stay on lines 1 and 2, and the marker is sized with the boundary included.
  • Reader: code_review_part reads after that line, without the tool's footer. A body without the boundary (every review posted before this change) is read whole, as before Read partial markers from the Markdown, and severity sections only in the Issues section #10, minus the footer. The verdict-line regex is gone.
  • Tests:
    • _Sound_ and an omitted verdict in the F6 scenario are written unknown, post as COMMENT, and read back unknown with the full marker, the minimal marker and no marker.
    • Your --skip-approach case quoting > **Approach:** Sound keeps its Critical: the block is rejected, and the round is parsed, 1 when written and read back.
    • The empty last section followed by a contradictory block gives parsed, 0, the same on readback.

The final downgrade reaches the posted record (d51649d) — building the posted record is now one function. When the pre-post check turns an automatic approve into a comment, the record is rebuilt with comment before the marker is made. With only that check failing, the event, the marker and round.json all say comment.

Minor

  • Overlap test (7dff1b5) — both minimal shapes are saved by name, and the round-5-posted-twice assertion runs on each (next F36).
  • README (7e40fca) — the Markdown is described as the cross-check for the findings block and as the source when the block is rejected or there's no usable marker. The code comments say the same.

F7: declined, documented (3ed98c6). The case needs a review over 60,000 characters written by an older version that counted its findings differently. A README paragraph now says later finding IDs can shift then. rounds output is unchanged on the seven real histories below.

Later (lib/records.sh:95): left for a separate fix, as you suggested.

641 checks pass on macOS (bash 5 and 3.2) and Ubuntu 24.04, and shellcheck and shfmt are clean. rounds output (table and --json) is unchanged for gh-pr-review#8 and #10, and adobe/skills#813, #823, #831, #763 and #764.

@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 4 · since round 3

6 fixed · 1 still open · 1 regressed · 3 new (3 in the new commits) · 1 declined · open blocking: 3 (was 5) · loop: converging

Approach

Unchanged since round 3: the writer already has the code review separately, and an explicit boundary lets lib/records.jq recover that same text from new posts without guessing from the approach verdict.

Approach: Sound

Strengths

  • gh-pr-review:900–915 now checks the findings block against review-body.md directly. Neither approach prose nor the generated footer can change the writer’s blocker count.
  • tests/flow.sh:865 checks the GitHub event, posted marker, and local round.json together when only the final approval check fails. tests/rounds.sh:318 independently checks the next allocated ID for both minimal marker shapes.
  • I ran all eight test scripts on this checkout. All 641 checks passed.

Issues

🚨 Critical (Must Fix Before Merge)

(none found)

⚠️ Important (Should Fix)

  • F6 · [lib/records.jq:66] — A boundary shown in a fenced example in the approach is mistaken for the boundary the writer inserted. I reproduced the original unknown → ready discrepancy: the approach illustrated the new post format with the boundary line and an empty Important section; the actual code review said “Looks fine” and a bare Yes. The writer correctly posted COMMENT with open_blocking: null. The reader returned 0, ready with the full marker, the minimal marker, and no marker.

    • Make the inserted boundary distinguishable from model-authored lines—for example, escape an exact delimiter line in the approach during assembly. Add this example to the round-trip test; switching from the first match to the last would just move the ambiguity into the code review.
  • [lib/records.jq:71] — Footer removal discards everything after the attribution, not just the footer. I backfilled a markerless review amended with a second ### Issues section after its original footer. The Markdown parser found the appended Critical; code_review_part removed it, and the round read as 0 blockers, ready.

    • Strip the generated footer only when it is the terminal suffix, or remove just its two lines. Preserve subsequent review text and test an amended markerless post.

💡 Minor (Nice to Have)

  • [tests/records.sh:485] — The new code-only fixture expects approach: "sound" from a verdict quoted inside a finding. No approach pass ran, so the expected value is skipped. Changing the quote to Rethink also lets this code-only round contribute to a false approach-stuck flag. For a body with a boundary, read the approach verdict only from its prefix and assert skipped here.
  • [README.md:180] — A minimal marker does not mean the posted review is over 60,000 characters. The cap applies to the assembled body including the marker; the minimal shape is chosen when the larger marker would exceed it. Describe that condition so readers can recognize affected histories.
Fixed since the last round (7)
  • F1 — The writer checks the separate code review, so an underscored or omitted approach verdict no longer turns an unknown count into an automatic approval.
  • F7 — Declined: “The case needs a review over 60,000 characters written by an older version that counted its findings differently.” I accept the documented upgrade limitation; the size wording is a separate documentation correction above.
  • F12 — A quoted approach verdict no longer cuts a Critical out of the writer’s block check.
  • F13 — A final downgrade rebuilds the posted record with comment before the marker is generated.
  • F14 — The footer is no longer part of the writer’s last-section check.
  • F15 — The overlap test saves both minimal shapes by name and verifies F36 for each.
  • F16 — The README now describes Markdown as both the block cross-check and the fallback source.
Later (1)
  • F17 · [lib/records.sh:94] — The unchanged whole-body check still treats a markerless, approach-only Rethink containing #### Important context as a code review. I confirmed that --skip-approach --check then returns nothing-new on the same head. This remains the agreed follow-up. Include the converse there too: a boundary followed by a prose-only code review is positive evidence that the code pass ran, even without a severity heading or verdict.

Recommendations

Alongside the count and label assertions, compare the code-review text recovered from an assembled, unedited post with review-body.md, ignoring trailing newlines. That directly tests the boundary contract when either pass contains an example of the tool’s own output.

Assessment

Ready to merge? No

Reasoning: The writer and final posting decision now behave correctly in the reported cases. The reader can still turn an unknown review into ready or discard a visible blocker, so the history is not yet reliable enough to drive the loop check.


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 4: converging, 6 fixed, the F7 decline accepted, and blocking down from 5 to 3. We're merging #10 here. What's left needs an unusual review: a fenced example of the boundary line in the approach, text added after the footer of an edited review, or a verdict quoted inside a code-only round. Those items, the README wording and F17 (the agreed "Later") are tracked in #11, with your suggested fixes and the round-trip test you recommended.

@catalan-adobe
catalan-adobe merged commit ae69ffa into main Nov 27, 2026
1 check passed
catalan-adobe added a commit that referenced this pull request Nov 27, 2026
#10 reads a posted round in one way: a complete marker (numeric
open_blocking, critical, important and minor, open_blocking = critical +
important; or a Rethink) as it is, and any other marker from the
Markdown after the code-review boundary line, with findings_dropped and
#10's ID floor. Its decisions win where the two branches overlap.

Reading: #10's complete_marker path replaces #9's minimal-marker and
with_counts recovery. Gone with #10's deletions: with_counts,
markdown_counts, _drop_findings, record_findings, record_counts,
record_covers_markdown, record_respects_empty and _counts, with #9's
additions to them (the progress-line clauses, the unverified filter,
the status-aware markdown_counts). #9's later-round rule stays in
backfill_record: a later round's open blocking count is its progress
line's (progress_blocking), read on the whole body since the progress
line comes before the boundary. Findings and sections come from
code_review_part. The L floor is #10's (marker and backfill); backfill
now reserves one L ID per item of a later round's folded Later list, so
a marker without last_ids keeps its Later IDs as #10 keeps F IDs.

Writing: #9's entry_outcome, stored_findings($base; $later_files) and
block checks, fed from review-body.md, with #10's no_sections (null
counts in build_record), known_blockers (fail-closed automatic approve,
kept after #9's ready_overridden check) and posted_record (rebuilt after
the final downgrade). progress_line now prints "open blocking: unknown"
for null counts, so a parsed later round with no severity section never
reads back as 0.

Parser: #10's _lines (Issues scope, <details> folds with fence tracking,
indented headings, * and + items). _lines also tags a fold's own lines
with its kind (f: fixed/later/other, same Issues rule), and
parse_findings reads the Fixed fold from those lines: IDs as fixed, or
declined with the quoted reason. "**F1 · …" items keep their ID as open;
the Later fold stays out. A heading inside an unclosed <details> no
longer ends the fold (#10's rule).

Posted body: #10's assemble_review <head> <approach> <code review> with
the boundary; assemble_body passes the progress lines (+ **Next:**) or
the loop line as the head. The moved-head note still goes right after
REVIEW_HEAD, marker_line sizes the exact body, and round_body keeps the
trust filter and drops every '<!-- gh-pr-review' line, the boundary
included.

Tests: #9 tests of removed functions dropped or moved to #10's rule
(later-round marker shapes: full as written; every partial shape reads
the Markdown, 3 blockers via the progress line, findings dropped, F5/L1
floor kept). New: a producer-to-reader flow for a later round (fixed,
declined, carried, new and Later) read back with the full and both
minimal markers, and progress_line with unknown counts. Not fixed here:
issue #11.
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