fix: require structured kapi-agent revision comments#125
Conversation
|
@kapi-agent review Revision explanation for current head What changed:
Why this closes the prior feedback:
Verification:
|
There was a problem hiding this comment.
kapi-agent review
Verdict: REQUEST_CHANGES
Blocking issues
src/cli/kapi-review-cli.ts:17-24does not enforce the documented “non-approving review” case unless the prior review is on an older head. The new docs say that after any stale or non-approvingkapi-agentreview, re-review must include same-comment revision evidence, but the gate is currently:previousReviewOnOlderHead && !hasRevisionExplanation(...)- This means a prior
REQUEST_CHANGESorCOMMENTon the current head can be followed by an approval-shaped body with no revision explanation and still pass therevision_explanationgate. - That weakens the workflow contract this PR is trying to document/enforce. Please make the required condition match the docs, e.g. require revision explanation when the prior review is stale or when the latest prior state is non-approving, and add a regression test for same-head
REQUEST_CHANGES/COMMENTwithout a revision explanation.
Warnings / risks
docs/kapi-agent-approval-gate.md:47sets a stricter contract than the current implementation. Until the code and tests match that sentence, future maintainers may believe the gate protects same-head non-approving re-review requests when it does not.
Suggestions
- Add explicit tests for:
- prior
REQUEST_CHANGESon the sameheadShawith no revision explanation => fail; - prior
COMMENTon the sameheadShawith no revision explanation => fail; - prior
APPROVEon the sameheadSha=> no revision explanation required, if that is intended.
- prior
Looks good
- The structured revision comment parser is substantially stronger than the previous keyword heuristic.
- Requiring the trigger, current head SHA, named sections, bullets, non-speculative verification, and no bot-verdict impersonation is directionally sound.
- The docs and README updates clearly explain the intended author workflow.
Verification notes
- Verifier gate status: PASS — provided evidence says
npm ci && npm run verifyexited 0. - Size gate status: PASS — 101 changed lines, under the 200-line limit.
- Revision-explanation status: not required for this first kapi-agent review; found evidence is present.
- Local inspection covered
src/cli/kapi-review-cli.ts,test/kapi-review-cli.test.ts,docs/kapi-agent-approval-gate.md, and the README diff.
Engine: pi
4dc95d2 to
053eecb
Compare
|
@kapi-agent review Revision explanation for current head What changed:
Why this closes the prior feedback:
Verification:
|
There was a problem hiding this comment.
kapi-agent review
Verdict: REQUEST_CHANGES
Blocking issues
- Revision explanation gate failed. This PR was updated after a prior kapi-agent
REQUEST_CHANGESreview, but there is no valid author explanation for the current head SHA explaining what changed and why. The existing author comment references an older head, so it is stale. Please add a new same-comment re-review request for the current head with:@kapi-agent reviewRevision explanation for current head <current SHA>What changedWhy this closes the prior feedbackVerification
Warnings / risks
- No additional code-level blocker found in the inspected changes. The current implementation appears to address the prior same-head non-approving review gap, but the workflow contract requires current-head revision evidence before approval can be considered.
Suggestions
- Consider keeping the revision comment template in the PR body or latest author comment whenever pushing follow-up commits, since this PR is specifically enforcing that workflow.
Looks good
src/cli/kapi-review-cli.tsnow requires revision evidence when a prior review is stale or when the prior kapi-agent review state is non-approving (REQUEST_CHANGES/COMMENT).- The revision explanation parser now checks for same-comment trigger, matching head SHA, required structured sections, bullets, bot-verdict impersonation, and speculative verification language.
test/kapi-review-cli.test.tsincludes regression coverage for stale reviews and same-head non-approving reviews without revision evidence.
Verification notes
- Verification gate status: FAIL overall because the revision explanation gate failed.
- Size gate status: PASS — 114 changed lines, under the 200-line limit.
- Revision-explanation status: FAIL — required now, not found for the current head.
- CI/local evidence from provided verifier:
npm ci && npm run verifyexited 0.
Engine: pi
There was a problem hiding this comment.
kapi-agent review
Verdict: REQUEST_CHANGES
Blocking issues
- Revision explanation gate failed. This PR was updated after a prior kapi-agent
REQUEST_CHANGESreview, but there is no author revision explanation for the current head053eecb30ba252dc9f68cf7ad29be73f46c5ebec. Please add a same-comment re-review request explaining what changed and why for this exact head before re-review.
Warnings / risks
- The previous revision explanation references old head
7395d7979bc0236484d6d3a7a9b2c087f4b24b67, so it cannot establish what changed in the current synchronized revision.
Suggestions
- Use the documented template from
docs/kapi-agent-approval-gate.md:@kapi-agent reviewRevision explanation for current head \053eecb`:`What changedWhy this closes the prior feedbackVerification
Looks good
- The implementation appears to address the prior substantive blocker:
src/cli/kapi-review-cli.tsnow requires revision evidence for stale prior reviews and same-head non-approving prior reviews. - The new tests in
test/kapi-review-cli.test.tscover stale approval/comment cases, same-headREQUEST_CHANGES/COMMENT, head SHA mismatch, missing trigger, malformed headings, speculative verification, and bot-verdict impersonation. - The documentation additions in
README.mdanddocs/kapi-agent-approval-gate.mdmatch the intended same-comment revision-evidence workflow.
Verification notes
- Verification gate status: FAIL, because the revision explanation gate failed.
- Size gate status: PASS — 114 changed lines, under the 200-line limit.
- Revision-explanation status: FAIL — required now, not found for current head.
- Local verifier evidence: PASS —
npm ci && npm run verifyexited 0. - Inspected files:
src/cli/kapi-review-cli.ts,test/kapi-review-cli.test.ts,README.md, anddocs/kapi-agent-approval-gate.md.
Engine: pi
|
@kapi-agent review Revision explanation for current head What changed:
Why this closes the prior feedback:
Verification:
|
|
@kapi-agent review Revision explanation for current head What changed:
Why this closes the prior feedback:
Verification:
|
053eecb to
78a2f5f
Compare
kapi-agent reviewVerdict: APPROVE Final approval summaryReview journey
What changed
Why this is correct
Evidence
Remaining risks and approval rationale
Blocking issues
Warnings / risks
Suggestions
Looks good
Verification notes
Engine: kapi-agent request lifecycle:
|
There was a problem hiding this comment.
kapi-agent review
Verdict: APPROVE
Final approval summary
Review journey
- Original goal: enforce structured current-head revision evidence before kapi-agent can approve after stale or non-approving prior reviews.
- The semantic scope is limited to the review CLI gate, regression tests, and documentation for revision-comment rules.
- Prior kapi-agent reviews requested changes because same-head
REQUEST_CHANGES/COMMENTreviews could be followed by approval without revision evidence, and later because the current head lacked a detected revision explanation. - The current revision includes a valid author explanation for head
78a2f5f9179549aff28ca45240afdd4cac1ef326.
What changed
src/cli/kapi-review-cli.tsnow requires revision explanation when the prior review is stale or when the latest prior kapi-agent state isREQUEST_CHANGESorCOMMENT.- Revision evidence must include same-comment
@kapi-agent review, matching current head SHA, required headings, bullets, non-speculative verification, and no bot-verdict impersonation. test/kapi-review-cli.test.tsadds regression coverage for stale reviews, same-head non-approving reviews, malformed explanations, and CLI persistence.README.mdanddocs/kapi-agent-approval-gate.mddocument the required re-review template.
Why this is correct
- The implementation now matches the documented workflow contract: stale approvals/comments and same-head non-approving reviews cannot be converted into approval unless the author provides structured current-head evidence.
- The added tests cover the previously blocking gap for same-head
REQUEST_CHANGES/COMMENTwithout revision evidence. - The explanation format rejects stale SHA references, split trigger/explanation comments, approval-shaped author comments, missing required sections, and speculative verification wording.
Evidence
- Verifier gate: PASS —
npm ci && npm run verifyexited 0. - Size gate: PASS — 114 changed lines, below the 200-line limit.
- Revision-explanation status: PASS — valid current-head explanation found.
- Inspected files:
src/cli/kapi-review-cli.ts,test/kapi-review-cli.test.ts,README.md, anddocs/kapi-agent-approval-gate.md.
Remaining risks and approval rationale
- Remaining risks: low; the gate depends on the caller passing the correct latest prior review state/head and the correct same-comment body as
revisionExplanation. - Approval is justified because all gates pass, the PR is small and scoped, the prior blocking feedback is addressed, and no blocking correctness, safety, or workflow-contract issue remains.
Blocking issues
- none.
Warnings / risks
- The revision gate is only as reliable as the surrounding GitHub integration that selects the latest prior kapi-agent review and passes the correct author comment body into
--revision-explanation-file.
Suggestions
- Consider adding an integration-level test or fixture around comment selection if that logic lives outside this CLI, so the “same-comment” guarantee is verified end-to-end.
Looks good
- The new
revisionExplanationRequiredcondition closes the same-head non-approving review gap. - The structured revision parser checks current head SHA, required headings, section bullets, bot-verdict impersonation, and speculative verification.
- The documentation now clearly tells authors how to request re-review after stale or non-approving kapi-agent feedback.
Verification notes
- Verifier gate: PASS —
npm ci && npm run verifyexited 0. - Size gate: PASS — 114 changed lines < 200.
- Revision-explanation status: PASS — required and found for current head.
- Local inspection found the implementation and tests aligned with the prior review feedback.
Engine: pi
Summary
@kapi-agent reviewplus current-head revision evidencekapi-reviewVerification
npm run verifypassedgit diff --checkpassed via the verification sequenceNotes