Skip to content

release(pr-review): re-review feature v0.8.0#20

Merged
orioltf merged 37 commits intomainfrom
develop
May 6, 2026
Merged

release(pr-review): re-review feature v0.8.0#20
orioltf merged 37 commits intomainfrom
develop

Conversation

@orioltf
Copy link
Copy Markdown
Member

@orioltf orioltf commented May 6, 2026

Summary

Release PR: developmain for the pr-review re-review feature.

  • Merges #19 — re-review feature (specs 00–09, v0.1.x → v0.8.0) and doc context enrichment planning
  • Post-review fixes: null-line guard, max iterationId selection, missing tests, MARKER_FOUND guard, partial-run timing, Step 11.5 guard, dedup parseSignature

Once merged, the release workflow will detect that pr-review@0.8.0 has no tag and create it automatically.

Test plan

  • CI passes on all three OSes × Node 22 and 24
  • pnpm --filter pr-review verify:changelog passes
  • pnpm --filter pr-review test — 25 tests, 0 failures

🤖 Generated with Claude Code

orioltf and others added 30 commits May 4, 2026 22:47
process.exit(existsSync(p) ? 0 : 1) caused the Bash tool to report
"Error: Exit code 1" on every normal capture (no collision). Swap to
? 1 : 0 so the happy path exits 0 and collision exits 1.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Introduces two new domain terms for the doc context enrichment feature:
- Doc Context: aggregated summaries of work items and Confluence pages
  injected as a preamble into every Review Aspect agent's prompt
- Doc Context Sub-agent: short-lived agent that fetches and summarises
  a single source in a diff-aware way

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
ADR-0010: Confluence fetch logic lives as an inline .mjs script in
pr-review/ rather than depending on unic-confluence or extracting a
shared package — no runtime package resolution for installed plugins
without a bundler; credential lookup mirrors unic-confluence convention
(env vars → ~/.unic-confluence.json) for the shared Unic audience.

ADR-0011: New work item and doc sources are added as additive parallel
paths, not a plugin registry — one source each does not justify the
abstraction overhead. Condition to revisit: when a third distinct source
type is introduced.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… Confluence

Adds a Doc Context gathering phase (step 4a) that runs before review
agents and injects structured, diff-aware summaries of linked ADO work
items and any Confluence pages referenced in their descriptions. Context
is internal to agents only — no new PR comments are posted.

Key design decisions captured in the spec:
- Always-on; degrades gracefully at every tier (no work items, no creds,
  fetch errors) with console warnings where actionable
- Two levels of parallel Doc Context Sub-agents: per work item and per
  Confluence page
- Summaries are diff-aware and structured with source provenance labels
- Step 4a runs in parallel with steps 5–7; step 8 waits for it

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… scenarios

- extend-pr-review-to-check-docs: original idea (PR description, ADO
  work items, Confluence pages as reviewer context)
- alternative-work-item-sources-for-doc-context: Jira, GitHub Issues,
  etc. as future linked work item sources
- alternative-doc-sources-for-doc-context: GitHub Wiki, Notion, etc.
  as future doc link destinations; flags auto-detect vs. config-file
  design question for future grilling

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… range

Remove hardcoded 0.2.0 target from spec 10 — the correct version depends
on what the re-review feature ships at and must be determined at bump time.

Extend the PROMPT.md spec scan range from the hardcoded "00 → 09" to
"in order" so Ralph picks up spec 10 without manual edits.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…d apply triage

Publishes the full issue set for the doc context enrichment feature:

- PRD.md: parent document (status: closed)
- 01: Confluence page client + node:test suite (ready-for-agent)
- 02: Work item Doc Context enrichment — step 4a (ready-for-agent)
- 03: Confluence page Doc Context enrichment (ready-for-agent, blocked by 01+02)
- 04: Version bump + CHANGELOG + docs (ready-for-human)

Issues 01–03 include agent briefs. Issue 04 includes a note explaining
why it cannot be delegated to an agent (version depends on re-review
shipping first; prose authorship benefits from human judgment).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…suffix

Interim commit before version bump — part of spec-01.
All emitted signatures now use asterisk italics and include the
— Iteration {LATEST_ITERATION_ID} suffix. Detection prefix documented
in Comment signature and Notes sections.
…ead fetch

Inserts Step 3.5 between the PR metadata fetch and file listing steps.
Paginates ADO pullRequestThreads, scans all comments for the bot signature
prefix, and exports IS_REREVIEW, PRIOR_THREADS_FILE, SUMMARY_THREAD_ID,
and PRIOR_ITERATION_ID for use by downstream re-review steps.
Step 3.5 unconditionally fetches all ADO PR threads via paginated API,
scans every comment for the bot signature prefix, and exports four
variables (IS_REREVIEW, PRIOR_THREADS_FILE, SUMMARY_THREAD_ID,
PRIOR_ITERATION_ID) for downstream re-review specs to consume.
…(v0.2.1)

Two prior summaries caused isSummaryThread=true on both entries.
Post-process the array to mark only the max-threadId candidate, and
use last() instead of first() when reading SUMMARY_THREAD_ID.
…th LATEST_ITERATION_ID

- Add Step 3.6 to fetch pullRequestIterations and resolve LATEST_ITERATION_ID
  and LATEST_COMMIT_ID via jq max_by(.id)
- Add PRIOR_COMMIT_ID resolution for IS_REREVIEW=true (direct lookup +
  timestamp fallback for legacy comments without the — Iteration N suffix)
- Replace hardcoded iterationId=1 in Step 4 with $LATEST_ITERATION_ID
- Update Notes section and CLAUDE.md rule
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Branch Step 5 on IS_REREVIEW for incremental vs full diff
- Early exit when PRIOR_COMMIT_ID == LATEST_COMMIT_ID (no new commits)
- Fallback warnings with both commit IDs on git fetch failure
- Export DIFF_HUNKS_FILE (JSON) for spec 05 thread classification
- Mark spec 04 done
…s checks

README row for spec 04 was left as pending after the implementation commit,
which would cause the loop to re-target and re-implement it. Also removed
the dead numeric comparisons (.status == 1 / .status == 6) from the Path C
jq filter — ADO returns thread status as strings, making these unreachable.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
orioltf and others added 7 commits May 6, 2026 05:29
…dules

- Extract parseSignature, classifyThread, matchFinding, detectPriorReview into scripts/re-review/
- Add 11 fixture JSON files under tests/fixtures/ covering all classification scenarios
- Write 25 tests across 4 test files (node:test); all pass
- Wire modules into commands/review-pr.md; fix printf vs echo for zsh JSON safety

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… guard Step 11.5, dedup parseSignature

- Move partial-prior-run check from Step 10 Path B to end of Step 3.5 so
  the entire pipeline (diff range, agent analysis, posting) runs in a
  consistent mode from the start
- Guard Step 11.5 completion-marker post with `if [ -n "$SUMMARY_THREAD_ID" ]`
  to avoid a failed API call when no summary thread was detected
- Reuse `parseSignature` in `detect-prior-review.mjs` instead of duplicating
  the `/Iteration ([0-9]+)/` regex; eliminates dead-code risk for parse-signature.mjs

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… missing tests, MARKER_FOUND guard

- match-finding.mjs: skip threads where start/end is null instead of
  defaulting to line 0, which caused false positive matches near top of file
- detect-prior-review.mjs: use max() over all parsed iteration IDs instead of
  last-seen; thread insertion order no longer affects priorIterationId
- review-pr.md (Step 3.5): add exit-code guard and value validation for
  MARKER_FOUND to prevent silent wrong-direction fallback on node failure
- tests: add 6 new cases (31 total) covering null-end classifyThread,
  deleted-file [0,0] hunks, numeric ADO status 2/5, null-start/end matchFinding,
  and priorIterationId max-ordering in detectPriorReview

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…hment

feat(pr-review): re-review feature v0.8.0 + doc context enrichment planning
@orioltf orioltf merged commit 2c2e548 into main May 6, 2026
29 checks passed
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