Skip to content

ci: run hourly PR repair through NVIDIA NIM OpenCode - #778

Closed
seonghobae wants to merge 20 commits into
fix/trusted-uv-lock-coverage-cleanfrom
fix/hourly-nvidia-nim-autofix
Closed

ci: run hourly PR repair through NVIDIA NIM OpenCode#778
seonghobae wants to merge 20 commits into
fix/trusted-uv-lock-coverage-cleanfrom
fix/hourly-nvidia-nim-autofix

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Add a central, reusable hourly PR-maintenance path that keeps independent review and merge gates unchanged while moving scheduled review repair inference to OpenCode backed exclusively by NVIDIA_NIM_API_KEY.

Changes

  • add nvidia-nim-pr-maintenance.yml with an hourly 23 * * * * cadence, one dispatch per run, one-hour same-head retry floor, and immutable reusable-workflow source resolution from GitHub OIDC workflow-SHA claims;
  • add nvidia-nim-pr-review-autofix.yml, a file-scoped OpenCode repair worker using the NVIDIA OpenAI-compatible endpoint and no Copilot/GitHub Models inference credential;
  • add a thin wrapper around the existing scheduler so its proven queue/review logic dispatches the dedicated NIM worker without altering the existing review-agent workflow or keys;
  • require same-repository heads, live exact-head revalidation, allowlisted edit paths, shell-denied OpenCode permissions, pinned Actions/OpenCode binary, and fail-closed behavior for missing secrets or moved heads;
  • add static workflow contracts, wrapper unit coverage, central CHANGELOG, and APA 7th doctoring.

Security boundaries

  • NVIDIA_NIM_API_KEY is bound only to process variable NVIDIA_API_KEY for model inference.
  • COPILOT_GITHUB_TOKEN, GitHub Models inference, and STRIX_GITHUB_MODELS_TOKEN are absent from the new worker.
  • Existing OpenCode/Noema review agents and their credential chain are not modified.
  • The repair worker cannot approve, merge, release, execute shell commands through the model, access the web, or edit paths outside current file-scoped review evidence.
  • Every repair creates a new head that must pass normal exact-head checks and independent review.

Prerequisite stack

This PR now targets fix/trusted-uv-lock-coverage-clean from #743. The protected main branch still contains vulnerable Strix dependency snapshots (aiohttp==3.14.1 and cryptography==49.0.0), which caused Python Security run 30991910227 to report known vulnerabilities before the run was cancelled. #743 carries the reviewed secure floor (aiohttp==3.14.3, cryptography==50.0.0, and compatible PyOpenSSL) together with the trusted-uv materialization prerequisite.

Required order:

  1. fix(coverage): materialize trusted uv lock dependencies #743 receives exact-head automated review and a qualifying independent APPROVED review, then merges without bypass.
  2. This PR is retargeted from the prerequisite branch to the resulting protected main.
  3. Every check, Strix/OpenCode/Noema review, unresolved-thread gate, and independent approval reruns on the resulting exact head and base.
  4. Only then may the hourly NVIDIA NIM maintenance workflow merge and become active.

No predecessor-head, cancelled dependency audit, status-only review, or prerequisite-branch result is reused as final merge evidence after retargeting.

Verification

Required current-head evidence:

  • repository Python tests and production coverage/docstring gates;
  • actionlint and workflow syntax checks;
  • CodeQL, Semgrep, security, secret, dependency, SBOM, and Scorecard workflows;
  • exact-head dry-run scheduler execution;
  • exact-head Strix/OpenCode/Noema review and qualifying independent approval before merge.

Standards and research

The doctoring note records GitHub reusable-workflow/OIDC source identity, OpenCode custom OpenAI-compatible providers, NVIDIA NIM endpoints, and bounded orchestration implications from Conductor, TRINITY, and Fugu in APA 7th format.

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b685f2ba-437d-4b30-9421-794980975159

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

@seonghobae
seonghobae changed the base branch from main to fix/trusted-uv-lock-coverage-clean August 5, 2026 09:13

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

OpenCode cannot approve yet because required coverage evidence did not pass.

Review outcome

1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence

  • Problem: The required coverage-evidence job result was failure, so OpenCode cannot establish approval sufficiency for this head.

  • Root cause: Automated approval is only valid when the same-head coverage-evidence job proves supported repository test suites passed and configured docstring gates passed or were advisory, or reports not applicable because no supported source files or package manifests exist. Missing, failed, skipped, unavailable, or unsupported-tooling test evidence is a blocker.

  • Fix: Install or configure the repository test/docstring evidence tooling when source files or package manifests exist, rerun the current-head coverage-evidence job, and approve only after it reports success with required evidence or explicit no-source not-applicable evidence.

  • Regression test: Keep the approval branch checking needs.coverage-evidence.result == success before posting APPROVE, and publish REQUEST_CHANGES when coverage-evidence blocker states such as cancelled, skipped, failed, unsupported-tooling, or below-100 evidence are present.

  • Result: REQUEST_CHANGES

  • Reason: coverage-evidence result was failure, so required test/docstring evidence was not proven for current head 2ebda8063d3c541e2552dc474c3c8601ddc986f8.

  • Head SHA: 2ebda8063d3c541e2552dc474c3c8601ddc986f8

  • Workflow run: 30992373031

  • Workflow attempt: 1

Coverage evidence

Coverage evidence job did not run or did not publish coverage evidence.

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Workflow (2 files)"]
  S1 --> I1["GitHub Actions review job"]
  I1 --> Conflict["Merge conflict blocks this path"]
  Conflict --> V1["actionlint plus required checks"]
  Evidence --> S2["Changed file: CHANGELOG.md"]
  S2 --> I2["repository behavior"]
  I2 --> Conflict["Merge conflict blocks this path"]
  Conflict --> V2["required checks"]
  Evidence --> S3["Docs: nvidia-nim-hourly-pr-maintenance.md"]
  S3 --> I3["operator or user guidance"]
  I3 --> Conflict["Merge conflict blocks this path"]
  Conflict --> V3["docs review"]
  Evidence --> S4["CI script: pr_review_fix_scheduler_nim.py"]
  S4 --> I4["review and security gate shell path"]
  I4 --> Conflict["Merge conflict blocks this path"]
  Conflict --> V4["bash -n plus Strix self-test"]
  Evidence --> S5["Test (2 files)"]
  S5 --> I5["regression suite"]
  I5 --> Conflict["Merge conflict blocks this path"]
  Conflict --> V5["targeted test run"]
Loading

@opencode-agent

opencode-agent Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

OpenCode Review Overview

  • Head SHA: 517a1de5dc493ec638821d8ea55c1f449a05e23d
  • Workflow run: 30994827813
  • Workflow attempt: 1
  • Gate result: REQUEST_CHANGES (approval step)

Pull request overview

OpenCode cannot approve yet because required coverage evidence did not pass.

Review outcome

1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence

  • Problem: The required coverage-evidence job result was failure, so OpenCode cannot establish approval sufficiency for this head.

  • Root cause: Automated approval is only valid when the same-head coverage-evidence job proves supported repository test suites passed and configured docstring gates passed or were advisory, or reports not applicable because no supported source files or package manifests exist. Missing, failed, skipped, unavailable, or unsupported-tooling test evidence is a blocker.

  • Fix: Install or configure the repository test/docstring evidence tooling when source files or package manifests exist, rerun the current-head coverage-evidence job, and approve only after it reports success with required evidence or explicit no-source not-applicable evidence.

  • Regression test: Keep the approval branch checking needs.coverage-evidence.result == success before posting APPROVE, and publish REQUEST_CHANGES when coverage-evidence blocker states such as cancelled, skipped, failed, unsupported-tooling, or below-100 evidence are present.

  • Result: REQUEST_CHANGES

  • Reason: coverage-evidence result was failure, so required test/docstring evidence was not proven for current head 517a1de5dc493ec638821d8ea55c1f449a05e23d.

  • Head SHA: 517a1de5dc493ec638821d8ea55c1f449a05e23d

  • Workflow run: 30994827813

  • Workflow attempt: 1

Coverage evidence

Coverage Decision

  • Result: FAIL
  • Test evidence: not proven passing
  • Docstring evidence: not proven passing when configured
  • Failure count: 1

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Workflow (3 files)"]
  S1 --> I1["GitHub Actions review job"]
  I1 --> R1["Review risk: Workflow (3 files)"]
  R1 --> V1["actionlint plus required checks"]
  Evidence --> S2["Changed file: CHANGELOG.md"]
  S2 --> I2["repository behavior"]
  I2 --> R2["Review risk: Changed file: CHANGELOG.md"]
  R2 --> V2["required checks"]
  Evidence --> S3["Docs: nvidia-nim-hourly-pr-maintenance.md"]
  S3 --> I3["operator or user guidance"]
  I3 --> R3["Review risk: Docs: nvidia-nim-hourly-pr-maintenance.md"]
  R3 --> V3["docs review"]
  Evidence --> S4["CI script: pr_review_fix_scheduler_nim.py"]
  S4 --> I4["review and security gate shell path"]
  I4 --> R4["Review risk: CI script: pr_review_fix_scheduler_nim.py"]
  R4 --> V4["bash -n plus Strix self-test"]
  Evidence --> S5["Test (3 files)"]
  S5 --> I5["regression suite"]
  I5 --> R5["Review risk: Test (3 files)"]
  R5 --> V5["targeted test run"]
Loading

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

OpenCode cannot approve yet because required coverage evidence did not pass.

Review outcome

1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence

  • Problem: The required coverage-evidence job result was failure, so OpenCode cannot establish approval sufficiency for this head.

  • Root cause: Automated approval is only valid when the same-head coverage-evidence job proves supported repository test suites passed and configured docstring gates passed or were advisory, or reports not applicable because no supported source files or package manifests exist. Missing, failed, skipped, unavailable, or unsupported-tooling test evidence is a blocker.

  • Fix: Install or configure the repository test/docstring evidence tooling when source files or package manifests exist, rerun the current-head coverage-evidence job, and approve only after it reports success with required evidence or explicit no-source not-applicable evidence.

  • Regression test: Keep the approval branch checking needs.coverage-evidence.result == success before posting APPROVE, and publish REQUEST_CHANGES when coverage-evidence blocker states such as cancelled, skipped, failed, unsupported-tooling, or below-100 evidence are present.

  • Result: REQUEST_CHANGES

  • Reason: coverage-evidence result was failure, so required test/docstring evidence was not proven for current head 2ebda8063d3c541e2552dc474c3c8601ddc986f8.

  • Head SHA: 2ebda8063d3c541e2552dc474c3c8601ddc986f8

  • Workflow run: 30992396659

  • Workflow attempt: 1

Coverage evidence

Coverage evidence job did not run or did not publish coverage evidence.

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Workflow (2 files)"]
  S1 --> I1["GitHub Actions review job"]
  I1 --> Conflict["Merge conflict blocks this path"]
  Conflict --> V1["actionlint plus required checks"]
  Evidence --> S2["Changed file: CHANGELOG.md"]
  S2 --> I2["repository behavior"]
  I2 --> Conflict["Merge conflict blocks this path"]
  Conflict --> V2["required checks"]
  Evidence --> S3["Docs: nvidia-nim-hourly-pr-maintenance.md"]
  S3 --> I3["operator or user guidance"]
  I3 --> Conflict["Merge conflict blocks this path"]
  Conflict --> V3["docs review"]
  Evidence --> S4["CI script: pr_review_fix_scheduler_nim.py"]
  S4 --> I4["review and security gate shell path"]
  I4 --> Conflict["Merge conflict blocks this path"]
  Conflict --> V4["bash -n plus Strix self-test"]
  Evidence --> S5["Test (2 files)"]
  S5 --> I5["regression suite"]
  I5 --> Conflict["Merge conflict blocks this path"]
  Conflict --> V5["targeted test run"]
Loading

Copy link
Copy Markdown
Contributor Author

Superseded by clean stacked PR #781. Retargeting this branch after its long divergence left GitHub's generated merge ref and Python Security audit on the stale vulnerable main tree (aiohttp==3.14.1, cryptography==49.0.0). PR #781 is built directly on exact prerequisite head 91f0e3616897f47a40029ae5ca5846f0b84a75e9, is zero commits behind, preserves the prerequisite CHANGELOG, and contains only the seven intended NVIDIA NIM scheduler files. Continue review and integration on #781.

@seonghobae seonghobae closed this Aug 5, 2026
@seonghobae seonghobae reopened this Aug 5, 2026

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

OpenCode cannot approve yet because required coverage evidence did not pass.

Review outcome

1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence

  • Problem: The required coverage-evidence job result was failure, so OpenCode cannot establish approval sufficiency for this head.

  • Root cause: Automated approval is only valid when the same-head coverage-evidence job proves supported repository test suites passed and configured docstring gates passed or were advisory, or reports not applicable because no supported source files or package manifests exist. Missing, failed, skipped, unavailable, or unsupported-tooling test evidence is a blocker.

  • Fix: Install or configure the repository test/docstring evidence tooling when source files or package manifests exist, rerun the current-head coverage-evidence job, and approve only after it reports success with required evidence or explicit no-source not-applicable evidence.

  • Regression test: Keep the approval branch checking needs.coverage-evidence.result == success before posting APPROVE, and publish REQUEST_CHANGES when coverage-evidence blocker states such as cancelled, skipped, failed, unsupported-tooling, or below-100 evidence are present.

  • Result: REQUEST_CHANGES

  • Reason: coverage-evidence result was failure, so required test/docstring evidence was not proven for current head 517a1de5dc493ec638821d8ea55c1f449a05e23d.

  • Head SHA: 517a1de5dc493ec638821d8ea55c1f449a05e23d

  • Workflow run: 30994797088

  • Workflow attempt: 1

Coverage evidence

Coverage Decision

  • Result: FAIL
  • Test evidence: not proven passing
  • Docstring evidence: not proven passing when configured
  • Failure count: 1

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Workflow (3 files)"]
  S1 --> I1["GitHub Actions review job"]
  I1 --> R1["Review risk: Workflow (3 files)"]
  R1 --> V1["actionlint plus required checks"]
  Evidence --> S2["Changed file: CHANGELOG.md"]
  S2 --> I2["repository behavior"]
  I2 --> R2["Review risk: Changed file: CHANGELOG.md"]
  R2 --> V2["required checks"]
  Evidence --> S3["Docs: nvidia-nim-hourly-pr-maintenance.md"]
  S3 --> I3["operator or user guidance"]
  I3 --> R3["Review risk: Docs: nvidia-nim-hourly-pr-maintenance.md"]
  R3 --> V3["docs review"]
  Evidence --> S4["CI script: pr_review_fix_scheduler_nim.py"]
  S4 --> I4["review and security gate shell path"]
  I4 --> R4["Review risk: CI script: pr_review_fix_scheduler_nim.py"]
  R4 --> V4["bash -n plus Strix self-test"]
  Evidence --> S5["Test (3 files)"]
  S5 --> I5["regression suite"]
  I5 --> R5["Review risk: Test (3 files)"]
  R5 --> V5["targeted test run"]
Loading

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

OpenCode cannot approve yet because required coverage evidence did not pass.

Review outcome

1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence

  • Problem: The required coverage-evidence job result was failure, so OpenCode cannot establish approval sufficiency for this head.

  • Root cause: Automated approval is only valid when the same-head coverage-evidence job proves supported repository test suites passed and configured docstring gates passed or were advisory, or reports not applicable because no supported source files or package manifests exist. Missing, failed, skipped, unavailable, or unsupported-tooling test evidence is a blocker.

  • Fix: Install or configure the repository test/docstring evidence tooling when source files or package manifests exist, rerun the current-head coverage-evidence job, and approve only after it reports success with required evidence or explicit no-source not-applicable evidence.

  • Regression test: Keep the approval branch checking needs.coverage-evidence.result == success before posting APPROVE, and publish REQUEST_CHANGES when coverage-evidence blocker states such as cancelled, skipped, failed, unsupported-tooling, or below-100 evidence are present.

  • Result: REQUEST_CHANGES

  • Reason: coverage-evidence result was failure, so required test/docstring evidence was not proven for current head 517a1de5dc493ec638821d8ea55c1f449a05e23d.

  • Head SHA: 517a1de5dc493ec638821d8ea55c1f449a05e23d

  • Workflow run: 30994827813

  • Workflow attempt: 1

Coverage evidence

Coverage Decision

  • Result: FAIL
  • Test evidence: not proven passing
  • Docstring evidence: not proven passing when configured
  • Failure count: 1

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Workflow (3 files)"]
  S1 --> I1["GitHub Actions review job"]
  I1 --> R1["Review risk: Workflow (3 files)"]
  R1 --> V1["actionlint plus required checks"]
  Evidence --> S2["Changed file: CHANGELOG.md"]
  S2 --> I2["repository behavior"]
  I2 --> R2["Review risk: Changed file: CHANGELOG.md"]
  R2 --> V2["required checks"]
  Evidence --> S3["Docs: nvidia-nim-hourly-pr-maintenance.md"]
  S3 --> I3["operator or user guidance"]
  I3 --> R3["Review risk: Docs: nvidia-nim-hourly-pr-maintenance.md"]
  R3 --> V3["docs review"]
  Evidence --> S4["CI script: pr_review_fix_scheduler_nim.py"]
  S4 --> I4["review and security gate shell path"]
  I4 --> R4["Review risk: CI script: pr_review_fix_scheduler_nim.py"]
  R4 --> V4["bash -n plus Strix self-test"]
  Evidence --> S5["Test (3 files)"]
  S5 --> I5["regression suite"]
  I5 --> R5["Review risk: Test (3 files)"]
  R5 --> V5["targeted test run"]
Loading

Copy link
Copy Markdown
Contributor Author

Closing as superseded by #779. Both PRs implement the same hourly NVIDIA NIM/OpenCode review-repair outcome, but #779 is the surviving bounded implementation: it preserves the existing independent reviewer workflow byte-for-byte, strips GitHub/OIDC credentials from model child processes, pins scheduler source identity, has exact-head TDD and full workflow evidence, and contains no branch-local one-shot repair workflow. This branch still includes .github/workflows/one-shot-fix-nim-conflict-staging.yml, which is transient write-capable automation and must not remain in a final tree. No unique production requirement should be merged from this duplicate branch; any still-valid idea must be reconciled into #779 through normal reviewed changes.

@seonghobae seonghobae closed this Aug 5, 2026
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.

1 participant