[READ-ONLY] Mirror of https://github.com/Aquaticat/Monochromatic. TypeScript and Rust monorepo: Claude Code and Pi coding-agent plugins, a m
Monochromatic doc troubleshooting open-code-review-github-issue-routing.md

OpenCodeReview 1.9.4 cannot create GitHub Issues from non-security review findings #

Symptom #

The installed ocr command can emit categorized findings and publish them as pull request review comments, but it has no option that creates regular GitHub Issues.

The similarly named route_categories and route_severity_below GitHub Action inputs do not provide this behavior. They only move findings from inline pull request comments into the pull request summary.

This repository is public. Its security policy requires suspected vulnerabilities to use private vulnerability reporting and says: "Do not open a public issue." A publisher therefore cannot safely interpret category != "security" as permission to create a public issue. Category is model-generated metadata, and a security finding can be missing or misclassified.

Root cause #

OCR exposes findings as integration data #

OpenCodeReview 1.9.4 already exposes the fields needed by a downstream adapter. internal/model/review.go:6-20 defines each JSON comment:

// LlmComment represents a code review comment generated by the LLM.
type LlmComment struct {
    Path           string `json:"path"`
    Content        string `json:"content"`
    SuggestionCode string `json:"suggestion_code,omitempty"`
    ExistingCode   string `json:"existing_code,omitempty"`
    StartLine      int    `json:"start_line"`
    EndLine        int    `json:"end_line"`
    Thinking       string `json:"thinking,omitempty"`
    // Category classifies the finding. One of:
    // bug, security, performance, maintainability, test, style, documentation, other.
    Category string `json:"category,omitempty"`
    // Severity indicates the importance of the finding. One of:
    // critical, high, medium, low.
    Severity string `json:"severity,omitempty"`
}

cmd/opencodereview/output.go:283-300 places those comments in the machine-readable result:

type jsonOutput struct {
    Status         string               `json:"status"`
    LLM            *jsonLLMIdentity     `json:"llm,omitempty"`
    TraceID        string               `json:"trace_id,omitempty"`
    Message        string               `json:"message,omitempty"`
    Summary        *jsonSummary         `json:"summary,omitempty"`
    ToolCalls      *jsonToolCalls       `json:"tool_calls"`
    Comments       []model.LlmComment   `json:"comments"`
    Warnings       []agent.AgentWarning `json:"warnings,omitempty"`
    ProjectSummary string               `json:"project_summary,omitempty"`
    Resume         *agent.ResumeInfo    `json:"resume,omitempty"`
    SessionID      string               `json:"session_id,omitempty"`
    Manifest       *session.RunManifest `json:"manifest,omitempty"`
    RetryReport *llm.RetryReport `json:"retry_report,omitempty"`
}

This is a producer contract. It does not prescribe a destination such as GitHub Issues.

The official GitHub Action publishes pull request feedback #

The Action's publisher calls the pull request review API for inline findings. scripts/github-actions/post-review-comments.js:385-394 shows that call:

const batchRes = await github.rest.pulls.createReview({
  owner,
  repo,
  pull_number: prNumber,
  commit_id: commitSha,
  body: reviewBody,
  event: "COMMENT",
  comments: chunk.map(({ reviewComment }) => reviewComment),
});

The summary uses the issue-comment API because GitHub models each pull request as an issue. It still adds a comment to the existing pull request number. It does not create a new tracker issue. scripts/github-actions/post-review-comments.js:802-822 shows the distinction:

async function postSummary({ github, owner, repo, prNumber, body, sticky, log }) {
  const fullBody = body;
  if (sticky) {
    const existing = await findExistingSummaryComment({ github, owner, repo, prNumber, log });
    if (existing) {
      const { data: updated } = await github.rest.issues.updateComment({
        owner,
        repo,
        comment_id: existing.id,
        body: fullBody,
      });
      return { id: updated.id, url: updated.html_url, updated: true };
    }
  }
  const { data: created } = await github.rest.issues.createComment({
    owner,
    repo,
    issue_number: prNumber,
    body: fullBody,
  });

A source-wide search at the 1.9.4 tag found issues.createComment and pulls.createReview, but no issues.create or gh issue create production path.

Native routing changes placement, not destination #

action.yml:99-119 describes the two routing controls:

route_severity_below:
  description: >-
    Optional severity threshold that routes findings at-or-below it from
    inline comments to the PR summary (fail-open: never drops a finding).
route_categories:
  description: >-
    Optional comma-separated list of categories routed from inline comments
    to the PR summary (fail-open: never drops a finding).

Both destinations are on the pull request. Neither is the repository's issue tracker.

The metadata boundary must fail closed for public publication #

OCR normalizes an unknown category to other and an unknown severity to low. Missing fields remain empty. internal/tool/code_comment.go:128-141 implements that behavior:

func normalizeCodeCommentCategory(category string) string {
    normalized := strings.ToLower(category)
    if _, ok := validCodeCommentCategories[normalized]; ok {
        return normalized
    }
    return codeCommentCategoryOther
}

func normalizeCodeCommentSeverity(severity string) string {
    normalized := strings.ToLower(severity)
    if _, ok := validCodeCommentSeverities[normalized]; ok {
        return normalized
    }
    return codeCommentSeverityLow
}

Consequently, other, low, and missing metadata are not evidence that a finding is safe to disclose. A public publisher must quarantine them rather than defaulting to publication.

Verification #

Version and source #

The installed binary reported:

open-code-review v1.9.4 (f7344e79) linux/amd64
built at: 2026-08-15T04:43:47Z

The source audit used release tag v1.9.4, commit f7344e798a1ff08939c977fe117c374b51214a91, from https://github.com/alibaba/open-code-review.git.

A disposable empty Git repository exercised the installed binary without sending source to an LLM:

ocr review --repo "$fixture" --format json --audience agent

The command returned exit code 0, status: "skipped", and comments: []. This confirms the wrapper-facing JSON envelope from the installed artifact. The source trace establishes the per-comment fields for nonempty results.

Supported behavior catalog #

  • ocr review --format json --audience agent emits a JSON envelope containing comments.
  • Each current finding can carry category and severity.
  • ocr session comments can filter saved comments by category or severity.
  • The official Action can post inline pull request comments and a pull request summary.
  • route_categories and route_severity_below can route findings into that summary.
  • ocr review --format sarif can produce GitHub Code Scanning input.

Unsupported behavior catalog #

  • No CLI flag creates a regular GitHub Issue.
  • No Action input changes the destination from pull request feedback to repository issues.
  • No Action output exposes a stable finding identifier for issue upserts.
  • Native routing does not privately quarantine security findings.
  • MCP configuration does not add a deterministic post-review issue-routing stage.

Verified workarounds #

Local adapter with private quarantine #

Use a separate command, not an alias that shadows ocr. The adapter owns this pipeline:

  1. Run pinned OpenCodeReview with --format json --audience agent.
  2. Parse the complete JSON result before making any GitHub mutation.
  3. Accept only explicit categories bug, performance, maintainability, test, style, or documentation.
  4. Quarantine security, other, missing metadata, critical findings, and findings whose content or code contains a security or secret signal.
  5. Default to a dry run.
  6. After human confirmation, upsert accepted findings through gh with an explicit --repo value.
  7. Label every generated issue needs-triage and retain a dedicated automation label. Do not mark model output ready-for-agent before human triage.
  8. Never publish thinking. Avoid publishing existing_code or suggestion_code unless a reviewer confirms that they contain no secret or exploit detail.

A disposable Node prototype verified the classification boundary against a synthetic OCR result. It sent a medium bug to public-issue-candidate and sent these cases to private-triage:

  • explicit security category;
  • bug content containing a token signal;
  • other category;
  • critical severity.

The security-signal check is defense in depth, not proof that a finding is safe. Human confirmation remains necessary before publishing directly to this public repository.

After confirmation, GitHub documents this authenticated issue-creation shape:

GH_TOKEN="$token" gh issue create \
  --repo Aquaticat/Monochromatic \
  --title "$title" \
  --body-file "$body_file" \
  --label needs-triage \
  --label ocr-generated

The GitHub Actions GITHUB_TOKEN tutorial uses the same gh issue create operation and requires issues: write.

Tradeoffs:

  • The confirmation step prevents fully unattended publication to the public tracker.
  • Classification still produces false positives, so needs-triage is mandatory.
  • A local command depends on the operator running it.
  • The adapter must pin OCR rather than inherit the current latest mise alias.

Fully automatic private intake #

If unattended operation is required, create or select a private intake repository and let the adapter create every candidate there. A maintainer can then create a sanitized public issue after triage.

The private intake receives:

  • explicit public candidates;
  • security and unknown candidates;
  • the full local evidence needed to decide whether a private advisory is required.

Do not copy a security candidate into the public repository merely by changing its label. Create a new sanitized public issue only after the candidate is confirmed non-security.

Tradeoffs:

  • This adds a second repository and a promotion step.
  • It is the only unattended design here that does not make model classification the public-disclosure boundary.
  • Access controls and retention for the private repository become part of the system.

Later GitHub Actions adapter #

A GitHub Actions post-processor can implement the same adapter after the local flow has a labeled corpus and stable behavior. Run it from a default-branch push or schedule, not from an untrusted fork pull request. Grant only contents: read and issues: write. Pin both the OpenCodeReview Action commit and ocr_version.

For deduplication, embed an exact marker such as:

<!-- ocr-finding/v1:<sha256> -->

List automation-created issues through the GitHub API and compare markers exactly. Do not rely on issue titles or LLM prose, which vary across runs. OpenCodeReview's own SARIF implementation uses stable code when available because prose varies. cmd/opencodereview/sarif.go:280-296 hashes path, category, and existing code, falling back to start line when code is absent. An issue adapter can use the same starting point, while recording that the line fallback can duplicate a finding after code moves.

Do not auto-close an issue only because a later OCR run omitted the finding. A partial run, model variation, or changed line placement can cause a temporary absence.

Tradeoffs:

  • Actions provide unattended runs and centralized credentials.
  • They add a write-capable automation path to a public repository.
  • Per-pull-request issue creation produces noise for findings fixed before merge.
  • The official Action's /tmp/ocr-result.json path is an implementation detail rather than an Action output, so a durable adapter should own the OCR invocation or require an upstream output-path contract.

What does not work #

Setting route_categories #

This routes matching findings to the pull request summary. It does not create tracker issues, and the summary remains a public pull request surface.

Giving the OCR agent a write-capable GitHub MCP tool #

OCR documents MCP as context for issue lookup, documentation, and custom analysis. pages/src/content/docs/en/mcp.md:14-25 does not define a deterministic publication phase. Exposing issue creation to the reviewing model would also let repository content influence a write side effect before the adapter validates category, security signals, or deduplication.

Uploading SARIF #

SARIF creates Code Scanning alerts, not regular GitHub Issues. It is useful if alerts are an acceptable destination, but it does not satisfy this repository's issue-tracker workflow.

Publishing every finding whose category is not security #

This fails closed-publication requirements because unknown categories normalize to other, and model classification can be wrong. A bug finding can still describe an authentication bypass, a secret, or another vulnerability.

Filing one aggregate audit issue #

Upstream OpenCodeReview issue #149 aggregated 28 model findings, including public security claims. A maintainer closed it after identifying a "significant number of false positives" and explicitly cited alert fatigue. That incident supports one independently triageable candidate per confirmed finding, not an unreviewed bulk issue.

Upstream filing decision #

No .out-of-scope/ entry matches OpenCodeReview issue routing. Open and closed upstream issues and pull requests were searched for:

  • create GitHub issues from findings;
  • findings to issues;
  • issue routing;
  • sync findings issues;
  • non-security issues.

No matching request for regular GitHub Issue creation was found. Issue #478 covers only fail-open placement between inline comments and the pull request summary.

The filing constraints resolve as follows:

  1. Is it really upstream's fault? No. OCR emits structured JSON and provides pull request publication. Project-specific conversion into long-lived tracker issues is a consumer workflow.
  2. Can upstream fix it? Yes in principle, but a generic issue creator would need product-specific lifecycle, labeling, deduplication, and disclosure policy.
  3. Are they supporting this use case? No evidence was found. Current documentation supports pull request comments, GitLab merge request comments, and Code Scanning output.
  4. Would the repository welcome a contribution? Probably. CONTRIBUTING.md welcomes feature requests and external contributions, and no AI-assistance ban was found. This does not overcome constraints 1 and 3.
  5. Will they likely fix it? Unknown. No duplicate or maintainer commitment was found.
  6. Was a minimal upstream fix prototyped? No. Constraints 1 and 3 fail, and the safe solution belongs at this repository's consumer boundary.

Upstream filing artifact #

Nothing to file upstream. A generic OpenCodeReview feature request would move repository-specific policy into the producer and would not eliminate the required security gate.