Skip to content

[unic-pr-review] Intent gathering via Atlassian (Pre-PR pasted URLs) #147

@orioltf

Description

@orioltf

Parent

docs/issues/unic-pr-review/PRD.md

What to build

Wire the Intent Brief into the Pre-PR path. In Pre-PR mode the orchestrator prompts the reviewer for optional Work Item / Confluence URLs (comma-separated; Enter to skip). The Intent Checker sub-agent routes each URL by path (/browse/ → Jira, /wiki/ → Confluence), invokes scripts/atlassian-fetch.mjs to retrieve content, branches Work Items by type (Story → description + ACs; Bug → repro + expected/actual), self-deduplicates across sources, and emits a structured intentCheck block that the summary renderer surfaces at the top of the preview with per-AC verdicts.

Per ADR-0004 (hard-stop) and US 30 (empty intent OK):

  • A link that promises intent but is unreachable → hard-stop with a clear message pointing at the relevant setup wizard.
  • No links pasted → preview proceeds with the Intent Check block omitted (legitimate state).

Motto: the Intent Checker is a single LLM agent trusted to deduplicate and consolidate across sources — no orchestrator → sub-agents → synthesizer pipeline.

Acceptance criteria

  • scripts/atlassian-fetch.mjs exists, uses Node's built-in global fetch (Node 22+), reads credentials via scripts/lib/credentials.mjs (file + env-var override), routes by URL path, fetches Jira issues + Confluence pages via their REST APIs, parses Story vs Bug structure, extracts Confluence page text + linked Confluence URLs from issue bodies.
  • agents/intent-checker.md exists with distinct name + colour, receives [{ id, type, url, raw }] plus pasted URLs, calls atlassian-fetch.mjs via Bash, emits a structured Intent Brief plus per-AC verdicts (addressed / partially addressed / unaddressed) — no Bot Signature footer.
  • Orchestrator in Pre-PR mode prompts: "Optional Work Item URLs (Jira/ADO Boards) and Confluence URLs, comma-separated. Press Enter to skip." Enter → skip cleanly (US 20).
  • Intent Brief is broadcast verbatim as a preamble to every aspect agent in the fan-out batch.
  • review-summary-renderer.mjs accepts an optional intentCheck field and renders it between the Notices block and the Severity sections per PRD §10.
  • Empty intent: Intent Check section omitted; review otherwise unchanged.
  • Hard-stop: when a fetched Work Item promises a Confluence page and the page is unreachable (network or 4xx), the orchestrator aborts with a message naming the URL and the setup command to run. No partial preview emitted.
  • tests/atlassian-fetch.test.mjs covers URL routing (Jira vs Confluence), credential resolution (file vs env vars), Story-vs-Bug response parsing, AC extraction, Confluence excerpt extraction, with fetch stubbed.
  • Cross-platform CI green.

Blocked by

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew capabilityfeature/unic-pr-reviewIssues from the unic-pr-review featureready-for-agentFully specified, ready for an AFK agent

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions