Skip to content

[unic-pr-review] Optional non-authoritative ADO Fetcher debug dump #254

Description

@orioltf

Summary

Add an optional, non-authoritative debug dump of the full ADO Fetcher output, gated behind an env var, so a maintainer (or an agent) can inspect exactly what the Fetcher produced when troubleshooting a review.

Spun out of #252. While diagnosing that bug, the runtime artifact the Fetcher had improvised (/tmp/pr_meta_full.json) had already vanished, so there was nothing to inspect after the fact. A defined debug dump would have made the root cause immediately visible.

Constraints (these keep it from re-introducing #252's bug)

  • Non-authoritative: nothing in the pipeline ever reads the dump. The Fetcher's single inline JSON return remains the only authoritative channel (the rule established in [unic-pr-review] Linked Work Items silently dropped on large PRs — Intent Check skipped with no warning #252). The dump is a side-effect for humans/agents only.
  • Opt-in: written only when a debug env var is set (e.g. UNIC_PR_REVIEW_DEBUG_DUMP=1). Off by default.
  • Cross-platform path: use node:os tmpdir via the existing scripts/lib/temp-paths.mjs convention (add a fetcher-output kind, keyed by PR_KEY) — never a bare /tmp literal.
  • Cleanup policy: decide whether the dump is left in place for inspection (likely yes, since it is opt-in) or cleaned up like other temp artifacts.

This is NOT fetch caching / resumability

Caching the Fetcher output to resume cut reviews is explicitly out of scope (parked). The read side is intentionally never cached — Mode detection (first-review / re-review / write-retry) keys on live ADO state. This issue is debugging-only, with no read-back path.

Likely touch-points

  • agents/ado-fetcher.md — document the opt-in dump and its defined location.
  • scripts/lib/temp-paths.mjs — add a fetcher-output kind.

Acceptance criteria (draft)

  • [CI] temp-paths.mjs exposes a deterministic, os.tmpdir()-based path for the Fetcher dump kind, keyed by PR_KEY (unit-tested).
  • [doc-review] ado-fetcher.md documents the dump as opt-in (env-gated), non-authoritative, and never read back by the pipeline.

Metadata

Metadata

Assignees

No one assigned

    Labels

    app:unic-pr-reviewArea: apps/claude-code/unic-pr-reviewfeatureNew capabilityneeds-specsEnough info from reporter; ready to write a spec

    Type

    No type

    Fields

    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