Re-Review: Merge hook false negative bug (#216)

review-585-2026-03-28-v2 Review

review ready

Verdict: APPROVED

Re-review after refinement. Previous review (review-585-2026-03-28) returned NEEDS_REFINEMENT with 5 body fixes. All 5 have been verified as applied correctly.

Refinement Verification

  • [x] Fix 1: Type header changed from "Feature" to "Bug" -- confirmed, now matches board label type:bug and title prefix
  • [x] Fix 2: Primary file target corrected from hooks/post-mcp-merge-rebase.sh to hooks/forgejo-helper.sh (lines 333-380, _parse_merged_status function) -- confirmed. Also notes that hook scripts calling it need no changes.
  • [x] Fix 3: Test file target tests/test_parse_merged_status.sh added -- confirmed. Issue now lists both file targets correctly.
  • [x] Fix 4: Root cause added to Context -- confirmed. Describes double-stringified shape: tool_response (string) -> parse -> {"result": "..."} -> parse result -> {"merged": true}. References "Shape 4+2" and /tmp/hook-debug-merge.json.
  • [x] Fix 5: AC1 clarified -- confirmed. Now specifies "the double-stringified shape (tool_response string -> parse -> result string -> parse -> merged boolean)" instead of vague "tool output".

Template Completeness

  • [x] Type -- "Bug" (matches board label)
  • [x] Lineage -- present, includes board, story, arch, and discovery context
  • [x] Repo -- forgejo_admin/claude-custom
  • [x] User Story -- clear who/what/why for PM merge detection
  • [x] Context -- detailed session context with root cause analysis
  • [x] File Targets -- 2 targets, both verified against codebase
  • [x] Acceptance Criteria -- 3 criteria, specific and testable
  • [x] Test Expectations -- 3 test expectations aligned with AC
  • [x] Constraints -- clear boundaries (fix only _parse_merged_status, don't break shapes 1-5)
  • [x] Checklist -- 4 items covering implementation through PR
  • [x] Related -- links predecessor #189, sibling #161, and session context

Traceability

  • [x] story:pm-scope -- PM scope management story
  • [x] arch:hooks -- hooks architecture component
  • [x] Forgejo issue -- forgejo_admin/claude-custom#216, open

File Targets

  • [x] hooks/forgejo-helper.sh (lines 333-380) -- verified: _parse_merged_status function exists at lines 333-380 with 5 parsing shapes. None handle the double-stringified tool_response shape.
  • [x] tests/test_parse_merged_status.sh -- verified: exists with 13 test assertions covering shapes 1-5 plus edge cases. Ready for a new Shape 6 test case.

Repo Placement

OK. Issue filed on claude-custom, both fix targets are in claude-custom. Single-repo scope.

Dependencies

  • Predecessor #189 (board item #505, "post-merge hook false alarm on squash merge") -- done. Introduced _parse_merged_status with 5 shapes. Current bug is an unhandled 6th shape.
  • No blocking items in in_progress or next_up columns.

Acceptance Criteria

3 criteria, all verifiable by an agent:
  • AC1: _parse_merged_status detects merged: true in the double-stringified shape -- testable via unit test with exact payload structure
  • AC2: Existing 13 test cases continue to pass -- testable via bash tests/test_parse_merged_status.sh
  • AC3: New test case for double-stringified shape passes -- testable via same test runner

Blast Radius

Three hooks share _parse_merged_status via forgejo-helper.sh: remind-update-docs.sh, post-mcp-merge-rebase.sh, board-item-on-merge.sh. Fixing the shared function fixes all three. No other consumers found.

Decomposition Assessment

1 file to change + 1 test file to update. 3 acceptance criteria. Well under three-thing limit and five-minute rule. No decomposition needed.

Recommendation

No action needed. All 5 refinement items from the previous review have been addressed. Scope is solid, file targets verified, traceability complete, fits in a single agent pass.