Repository navigation
feat(pr-management): wire live session feed, action toggling, and review-flow integration (part 3 of #1887) - #1992
Conversation
…iew-flow integration (part 3 of apache#1887) Complete PR-3 for the interactive review findings pane Claude Code mod (closing apache#1887, part of apache#1497). - Feed live session review findings via `tool.call` on Bash, intercepting code-review Step 6 (`disposition --findings <file>`) in a fail-open contract - Reset `reviewFindingsState` atom to `null` when a review findings file carries no findings - Provide zero-token `/magpie-findings` slash command for terminal-first findings inspection and curation (`status`, `all`, `none`, `keep`, `drop`, `edit`) - Implement pure state mutators for deterministic finding action cycling (`accept` -> `skip` -> `edit` -> `accept`), selection navigation, and bulk updates - Connect edited finding notes to `serializeFindingsForRender`, ensuring maintainer edits override stale raw explanations in `render --findings` - Support interactive `Button` elements with direct clicks, keyboard hotkeys (`1`–`9`, `a`, `n`, `k`, `j`), and `ui.press` event handling, with fallback to clean `Text` rows - Disambiguate 1-based indexing so inline actions map to anchored findings without key collisions against general observations - Integrate the mod into `review-flow.md` Step 7a while upholding strict vendor neutrality for Codex, Antigravity, Cursor, and headless CI - Add unit, integration, and full lifecycle simulation tests (60 pass, 0 fail)
|
up fo review :) |
potiuk
left a comment
There was a problem hiding this comment.
The state handling is careful and well tested, but the pane's choices never reach render, so a comment skipped or edited in the pane is still posted unchanged, and that needs fixing before this lands.
Curated actions reach render (plugins/magpie-pr-management/skills/code-review/review-flow.md:326)
The curated actions deterministically translate to the
--keepargument passed torender.
The curated actions deterministically translate to the `--keep` argument passed to `render`.
Nothing connects the pane to render. serializeFindingsForRender is called only from tests, the mod never writes a file, and formatKeepAnswer only appears in the text /magpie-findings prints, which is described as zero-token, so the agent never sees it. Step 7b runs render --findings <file> on the original file with the --keep the agent got from the text picker. So a maintainer who skips a comment in the pane still sees it posted, and an edit is lost. That is worse than having no pane, because the maintainer believes the review was curated. Please close the loop: for example, write the serialized findings and keep answer to a file beside the findings file, and have Step 7a and 7b read it when present. If that belongs in a later PR, this PR should say the pane is display-only for now and drop this sentence.
Flagged by both the primary and adversarial reviewers.
Smaller observations
general— The two new paragraphs inreview-flow.mdhold several sentences per line.- See inline comments on
plugins/magpie-pr-management/hooks/review-findings.ts:985,plugins/magpie-pr-management/hooks/review-findings.ts:1140,plugins/magpie-pr-management/hooks/review-findings.ts:660,plugins/magpie-pr-management/hooks/review-findings.ts:813.
This review was drafted by an AI-assisted tool and
confirmed by an Apache Magpie maintainer. After you've
addressed the points above and pushed an update, an Apache Magpie
maintainer — a real person — will take the next look
at the PR. The findings cite the project's review criteria;
if you think one of them is mis-applied, please reply on the
PR and a maintainer will weigh in.More on how Apache Magpie handles maintainer review:
Contributing guide.
… and indexing Address maintainer review feedback on PR apache#1992: - Drop keep translation claim and hotkeys from review-flow.md; clarify display-only visual overview during review triage with one sentence per line. - Delete base.suggestion when action is edit in serializeFindingsForRender. - In resolveFindingIndex, return -1 for out-of-range inline comments, add g1..gM numbering for general observations, and update status display. - In handleBashToolCall, reset state to null on read failure or empty findings content.
d5c1d78 to
bd765eb
Compare
…sted Only the answer typed at the picker reaches render, so a note from /magpie-findings edit has to be entered again there. Generated-by: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01NyQq9RhAeBonGTieer5Lu4
potiuk
left a comment
There was a problem hiding this comment.
Thanks, this addresses the review: the stale-state reset, the g1..gM numbering, the removed hotkey references and the dropped render sentence all hold up in the code.
I pushed one small commit rather than asking for another round, so please pull before pushing again.
ed049d6 adds a sentence to review-flow.md Step 7a. The pane and /magpie-findings do not change what is posted, because only the answer typed at the picker reaches render, so a note from /magpie-findings edit has to be entered again there with E <n>.
Three things can follow in a later PR:
serializeFindingsForRenderstill has no caller outside the tests, so an edit does not reachrenderyet. Connecting it, for example with a file beside the findings file that Step 7b reads, would make the pane a real curation step.- Skipping a general finding in the pane changes nothing, because the keep answer only covers inline comments.
register's doc comment now sits abovehandleUiPress, about 360 lines from the function.
This review was drafted by an AI-assisted tool and
confirmed by an Apache Magpie maintainer. The maintainer
approving this PR has read the findings and signed off. If
something feels off, please reply on the PR and a maintainer
will follow up.More on how Apache Magpie handles maintainer review:
Contributing guide.
Summary
This is PR-3 (Part 3 of 3) completing Issue #1887 (and part of #1497) for the
magpie-pr-managementClaude Code mod. Building on the data models in PR-1 (#1920) and the presentational Pane component in PR-2 (#1954), this PR wires the live session feed, interactive action toggling, and vendor-neutral skill flow integration:pr-management code-review disposition --findings <file>viatool.callon Bash. Reads and parses the live drafted findings intoreviewFindingsState. Unconditionally invokesnext(e)so tool execution is never blocked or gated. When findings are empty ([]), or when reading the findings file fails, resets the state atom tonullto avoid stale findings sticking across sessions./magpie-findingsslash command for inspecting and curating review findings directly from the prompt (status,all,none,keep <indices>,drop <indices>,edit <idx> <note>). Shows both inline comments (1..N) and general observations (g1..M).serializeFindingsForRenderremovesbase.suggestionand setsbase.explanation = f.bodyfor an edited finding. Nothing outside the tests calls it yet, so the pane does not change what is posted.ui.pressevent handling (toggle-<N>,toggle-general-<N>,accept-all,skip-all,prev-finding,next-finding). Disambiguates 1-based indexing so inline actions map strictly to anchored findings (1..anchored.length), returns-1on out-of-range indices without arbitrary whole-list fallbacks, and supportsg<N>/G<N>for general observations.review-flow.mdStep 7a as an interactive visual overview during review triage, with semantic line breaks (one sentence per line) while upholding strict vendor neutrality: Codex, Antigravity, Cursor, and headless CI continue using the standard sequential text picker prompt.Type of change
.claude/skills/<name>/) — eval fixtures updated belowtools/<system>/*.md)tools/*/withpyproject.toml)docs/,README.md,CONTRIBUTING.md)projects/_template/)plugins/magpie-pr-management/hooks/)Test plan
claude plugin test plugins/magpie-pr-managementpasses all 61 unit, integration, and E2E simulation tests (0 failures).claude plugin validate --strict plugins/magpie-pr-managementpasses static analysis with 0 errors and 0 warnings.pytest tools/pr-management/tests/code_reviewpasses all 211 Python code-review tests./magpie-findings editfinding curation ->formatKeepAnswerkeep string generation -> clean PR atom reset.CRLF: 0) across all touched files.RFC-AI-0004 compliance
/magpie-findingscommand purely curate drafted findings for the maintainer; posting still requires explicit confirmation in Step 7b and Step 8.tool.callinterceptor is fail-open and operates exclusively on local session paths via$.fs.read.review-flow.mdStep 7a.render./magpie-findingsslash command.Linked issues
Closes #1887
Part of #1497
Notes for reviewers (optional)
Directly addresses review feedback from maintainer
@potiukon PR #1992:review-flow.mdthat the pane serves as an interactive visual overview during review triage, and dropped the claim regarding automated keep translation torender.1–9,a,n,k,j) across docs and docstrings.handleBashToolCallto reset state tonullon failed read or empty file content, preventing stale findings leakage.resolveFindingIndexto return-1on out-of-range inline indices without whole-list fallbacks, addedg1..gMnumbering for general observations, and updated/magpie-findings statusto list both inline and general observations.serializeFindingsForRender, deletedbase.suggestionwhenaction === 'edit'.review-flow.mdwith semantic line breaks (one sentence per line).