Skip to content

feat(unic-pr-review): content-aware comment gate + diff-to-analyser plumbing #213

@orioltf

Description

@orioltf

What to build

Make the changed-file analyser content-aware so comment-analyzer spawns whenever the diff adds or removes comment lines, not only when a doc file (.md/.mdx/docs/) changes. This is the tracer-bullet slice: it establishes the diff → analyser plumbing that the errors and types gates reuse.

End-to-end behaviour: the orchestrator passes diff content (alongside the changed-files list) into the analyser; the comment gate inspects added/removed (+/-) lines for comment tokens (//, /* … */, #, <!-- -->, JSDoc *), excluding the SPDX/license header so boilerplate doesn't trip it. Per ADR-0008 (amended, #212), bias toward spawning on ambiguity — a false-positive spawn is a cheap empty result block; a false-negative is the PR #5612 miss this fixes. The existing doc-file trigger stays (a Markdown/doc change still spawns it unconditionally).

Acceptance criteria

  • A code-only diff that adds/removes inline comments spawns comment-analyzer (the PR #5612 case: a comment change in a .tsx now spawns it).
  • A diff with no comment changes and no doc files does NOT spawn comment-analyzer.
  • Doc-file changes (.md/.mdx/docs/) still spawn it unconditionally.
  • The comment gate is a pure function over diff hunks with node:test fixtures: added comment, removed comment, no-comment source edit, doc-file, SPDX-header-only.
  • The analyser↔orchestrator contract carries diff content; existing path-based gates are unaffected and their tests still pass.

Blocked by

Metadata

Metadata

Assignees

No one assigned

    Labels

    app:unic-pr-reviewArea: apps/claude-code/unic-pr-reviewfeatureNew capabilityready-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