Skip to content

feat(spec-11): fix doc context spawn reliability (v0.9.1)#23

Merged
orioltf merged 18 commits into
developfrom
feature/pr-review-doc-context-spawn-reliability
May 8, 2026
Merged

feat(spec-11): fix doc context spawn reliability (v0.9.1)#23
orioltf merged 18 commits into
developfrom
feature/pr-review-doc-context-spawn-reliability

Conversation

@orioltf
Copy link
Copy Markdown
Member

@orioltf orioltf commented May 8, 2026

Summary

  • Extract the Doc Context gathering phase into a dedicated doc-context-orchestrator plugin agent to prevent it from being silently skipped
  • Add doc-context-synthesizer agent to merge work item + Confluence summaries into a flat ## Business context for this PR narrative
  • Add ADR-0012 recording the plain-markdown return decision (no JSON wrapper)
  • Rewrite step 4a in review-pr.md: initialise DOC_CONTEXT='', resolve CONFLUENCE_CLIENT_PATH from ${CLAUDE_PLUGIN_ROOT}, and spawn the orchestrator via an explicit Agent() call
  • Close all three issues in the pr-review-doc-context-spawn-reliability triage group

Why

Three defects caused the Doc Context phase to be silently skipped on every run: no DOC_CONTEXT='' initialisation, no explicit Agent() spawn (intent was satisfied inline), and a relative path to confluence-client.mjs that failed when the working directory was the reviewed project root.

Test plan

  • PR with ≥1 linked non-Bug work item and no Confluence links: review agents receive a non-empty ## Business context preamble
  • PR with no linked work items: step 4a exits silently, DOC_CONTEXT='', prompts unchanged
  • PR with a work item linking to a Confluence page and valid credentials: review agents receive work item summary + Confluence page summary with provenance label
  • Missing Confluence credentials: warning printed to console, review proceeds without doc context
  • No new PR threads or comments produced by the Doc Context phase

🤖 Generated with Claude Code

orioltf and others added 12 commits May 6, 2026 15:40
…ents

Pre-commit to get a clean working tree before pnpm bump.
Contains the spec-11 implementation: orchestrator agent, synthesizer agent,
step 4a rewrite in review-pr.md, ADR-0012, .prettierignore scratchpad exclusion,
and the CHANGELOG entry under [Unreleased].

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

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Three defects caused the Doc Context phase to be silently skipped on every
run: step 4a lacked an explicit Agent() spawn, confluence-client.mjs was
called with a relative path, and DOC_CONTEXT was never initialised.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
All three issues verified resolved; PRD closed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR (spec 11, v0.9.1) aims to make the Doc Context phase in the pr-review plugin run reliably by explicitly spawning a dedicated doc-context orchestrator agent, initializing DOC_CONTEXT, and resolving the Confluence client path from ${CLAUDE_PLUGIN_ROOT}.

Changes:

  • Adds new plugin agents: doc-context-orchestrator (gathering) and doc-context-synthesizer (flattened narrative output).
  • Rewrites commands/review-pr.md step 4a to initialize DOC_CONTEXT and delegate doc-context gathering via an explicit Agent() spawn.
  • Adds ADR-0012 documenting the plain-markdown (non-JSON) return contract; bumps plugin version to 0.9.1 with changelog updates.

Reviewed changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
docs/issues/pr-review-doc-context-spawn-reliability/PRD.md Adds PRD detailing the doc-context spawn reliability problem and intended solution.
docs/issues/pr-review-doc-context-spawn-reliability/01-adr-and-synthesizer-agent.md Tracks work for ADR-0012 + synthesizer agent.
docs/issues/pr-review-doc-context-spawn-reliability/02-orchestrator-agent.md Tracks work for the orchestrator agent requirements.
docs/issues/pr-review-doc-context-spawn-reliability/03-wire-up-and-housekeeping.md Tracks wiring step 4a + README/CHANGELOG housekeeping.
docs/inbox/pr-review-supress-thanks-comments-on-addressed-threads.md Adds an inbox note about suppressing “thanks” replies on addressed threads.
docs/inbox/pr-review-request-user-confirmation-before.md Adds an inbox note/request about user confirmation before branch checkout.
docs/inbox/plugin-naming-conventions-add-unic-prefix.md Adds an inbox note on adding a unic- prefix to plugin names.
docs/inbox/extend-pr-review-to-check-docs.md Removes an older inbox note (superseded by doc-context work).
apps/claude-code/pr-review/package.json Bumps plugin package version to 0.9.1.
apps/claude-code/pr-review/.claude-plugin/plugin.json Bumps plugin manifest version to 0.9.1.
apps/claude-code/pr-review/.claude-plugin/marketplace.json Bumps marketplace version to 0.9.1.
apps/claude-code/pr-review/docs/plans/README.md Adds spec 11 row to the plans status table.
apps/claude-code/pr-review/docs/plans/11-doc-context-spawn-reliability.md Adds spec 11 plan describing the reliability fixes and contracts.
apps/claude-code/pr-review/docs/adr/0012-plain-text-doc-context-agent-return.md Adds ADR-0012 for plain-text (markdown) agent return contract.
apps/claude-code/pr-review/CONTEXT.md Updates domain language definitions around Doc Context + Synthesizer.
apps/claude-code/pr-review/commands/review-pr.md Rewrites step 4a to initialize DOC_CONTEXT, resolve Confluence client path, and spawn orchestrator agent.
apps/claude-code/pr-review/CHANGELOG.md Adds 0.9.1 release notes describing the doc-context reliability fix.
apps/claude-code/pr-review/.agents/doc-context-synthesizer.md Adds the synthesizer agent prompt (flat ## Business context for this PR output).
apps/claude-code/pr-review/.agents/doc-context-orchestrator.md Adds the orchestrator agent prompt (work items + Confluence + synthesis orchestration).
.prettierignore Ignores .agents/scratchpad/ paths.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread apps/claude-code/pr-review/commands/review-pr.md Outdated
Comment thread apps/claude-code/pr-review/.agents/doc-context-orchestrator.md Outdated
Comment thread apps/claude-code/pr-review/.agents/doc-context-orchestrator.md Outdated
Comment thread apps/claude-code/pr-review/docs/adr/0012-plain-text-doc-context-agent-return.md Outdated
Comment thread docs/inbox/pr-review-supress-thanks-comments-on-addressed-threads.md Outdated
orioltf and others added 6 commits May 8, 2026 19:25
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…em IDs in step 4a

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…eholder mismatch in synthesizer delegation

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

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…guard, fix step numbering wording

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@orioltf orioltf merged commit 63585ea into develop May 8, 2026
4 checks passed
@orioltf orioltf deleted the feature/pr-review-doc-context-spawn-reliability branch May 8, 2026 18:06
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.

2 participants