Skip to content

fix(advisor): make ledger commits atomic - #6566

Merged
cv merged 9 commits into
mainfrom
codex/advisor-protocol-repair
Jul 9, 2026
Merged

fix(advisor): make ledger commits atomic#6566
cv merged 9 commits into
mainfrom
codex/advisor-protocol-repair

Conversation

@cv

@cv cv commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

Make the PR Review Advisor's six analysis stages observable and its ledger writes atomic. This follows a census of every advisor run after #6547: useful findings were being hidden by protocol failures, especially when models omitted, retried, or mixed prose with ledger calls.

Related Issue

Follow-up to #6547 and #6446.

Changes

  • Split every stage into a visible analysis turn and a strict tool-only commit turn, with one bounded repair attempt when no ledger mutation settles.
  • Add a reusable turn-protocol abstraction so stage ordering, validation, and repair behavior are defined once.
  • Preserve valid committed findings when a later stage fails, require explicit source-of-truth finding IDs, and remove prose-derived synthetic findings.
  • Recognize multi-issue Refs/References/Follow-up to relations and provide rg from a trusted runner binary or an exact package pin.
  • Add regression coverage for omitted, failed, retried, malformed, empty, and late-failure model behavior; update the advisor maintainer documentation.

Type of Change

  • Code change (feature, bug fix, or refactor)
  • Code change with doc updates
  • Doc only (prose changes, no code sample modifications)
  • Doc only (includes code sample changes)

Quality Gates

  • Tests added or updated for changed behavior
  • Existing tests cover changed behavior — justification:
  • Tests not applicable — justification:
  • Docs updated for user-facing behavior changes
  • Docs not applicable — justification: this changes internal PR-review automation; the two maintainer READMEs were updated, with no end-user behavior change.
  • Sensitive paths changed (security, policy, credentials, preflight, onboarding, inference, runner, sandbox, or messaging)
  • Sensitive-path review completed or maintainer-approved waiver recorded — GPT advisor review identified the package provenance gap; the runner/package are now pinned and enforced by a semantic workflow-boundary mutation test.
  • Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue:

Verification

  • PR description includes the DCO sign-off declaration and every commit appears as Verified in GitHub
  • Normal pre-commit, commit-msg, and pre-push hooks passed, or npm run check:diff passed when hooks were skipped or unavailable
  • Targeted behavior tests pass for the current change set, or tests are marked not applicable above — 131/131 focused advisor tests passed; the final workflow boundary suite passed 8/8.
  • Applicable broad gate passed — the clean-checkout CI matrix and aggregate checks gate passed. The earlier local npm test run completed with 15,432 passed, 39 skipped, 1 todo, and 27 environment-only failures caused by the borrowed dependency symlink and ambient local umask/SSH_AUTH_SOCK; all advisor tests passed.
  • Quality Gates section completed with required justifications or waivers
  • No secrets, API keys, or credentials committed
  • npm run docs builds without warnings (doc changes only) — completed with zero errors and only pre-existing warnings.
  • Doc pages follow the style guide (doc changes only)
  • New doc pages include SPDX header and frontmatter (new pages only)

Signed-off-by: Carlos Villela cvillela@nvidia.com

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
@cv cv added the v0.0.79 label Jul 9, 2026
@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

This PR adds atomic terminal-tool turn handling and repair flow for advisor sessions, and updates PR review advisor schema, prompting, normalization, and tests to require sourceOfTruthReview.findingId and split stage prompts into analysis and commit turns.

Changes

Advisor atomic turn protocol and session integration

Layer / File(s) Summary
Turn protocol module: types, tool resolution, event validation, repair logic
tools/advisors/turn-protocol.mts
Adds turn and tool-configuration types, validation helpers, atomic repair checks, and tool-name normalization/sanitization.
Session.mts wiring to turn protocol and repair execution flow
tools/advisors/session.mts, tools/advisors/README.md
Re-exports protocol helpers, changes active-tool selection for atomic turns, adds repair prompting/execution, adjusts error handling, and updates the README description.
Atomic mutation tool tests for session context tools
test/advisor-session-context-tools.test.ts
Updates mutation-tool expectations and adds atomic commit validation and flow acceptance coverage.
Session runner mock and repair simulation tests
test/advisor-session-runner.test.ts
Extends the mock SDK session to simulate terminal outcomes and adds repair and prose/analysis behavior tests.
CI ripgrep preflight and workflow boundary test
.github/workflows/pr-review-advisor.yaml, test/pr-review-advisor-workflow-boundary.test.ts
Adds conditional ripgrep installation to the workflow and verifies it with a boundary test.

Ledger findingId consistency and stage-turn restructuring

Layer / File(s) Summary
findingId schema and type additions
tools/pr-review-advisor/schema.json, tools/pr-review-advisor/analyze.mts
Adds findingId to the source-of-truth review schema and corresponding result type.
Ledger consistency checks and canonical retry/failure handling
tools/pr-review-advisor/analyze.mts
Adds findingId-based consistency checks, canonical retry fallback, partial failure artifact writing, and result sanitization changes.
Stage prompt restructuring into analysis/commit turns
tools/pr-review-advisor/analyze.mts
Splits stage prompting into analysis-only and commit turns, updates synthesis rules, and expands issue-reference parsing.
PR review advisor test updates for stage contract and findingId
test/pr-review-advisor.test.ts
Updates fixtures and contract tests for the new stage flow and findingId mapping rules, and removes obsolete cases.
Ledger tools test coverage for findingId and canonical fallback
test/pr-review-advisor-ledger-tools.test.ts
Adds deterministic ledger metadata helpers and tests for findingId validation and partial canonical preservation.
Advisor and PR review advisor README updates
tools/advisors/README.md, tools/pr-review-advisor/README.md
Updates workflow, output contract, and turn-count documentation to match the new protocol.

Estimated code review effort: 4 (Complex) | ~75 minutes

Possibly related PRs

  • NVIDIA/NemoClaw#5170: Touches tools/pr-review-advisor/analyze.mts, including the PR review advisor system-prompt contract and related tests.
  • NVIDIA/NemoClaw#5126: Related to tools/pr-review-advisor/analyze.mts normalization and ledger-validation behavior changes.

Suggested labels: chore

Suggested reviewers: jyaunches

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: making advisor ledger commits atomic.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/advisor-protocol-repair

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

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

E2E Advisor Recommendation

Required E2E: None
Optional E2E: None

Workflow run

Full advisor summary

E2E Recommendation Advisor

Base: origin/main
Head: HEAD
Confidence: high

Required E2E

  • None. No NemoClaw product E2E is recommended. The deterministic risk plan has no required jobs, and the changed files are limited to PR review advisor CI tooling, workflow-boundary validation, schema/analysis logic, docs, and targeted tests. They do not affect installer/onboarding, sandbox lifecycle, product credentials, network policy, inference routing, deployment, or real assistant user flows.

Optional E2E

  • None.

New E2E recommendations

  • None.

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

E2E Target Recommendation

Required E2E targets: None
Optional E2E targets: None

Workflow run

Full E2E target advisor summary

E2E Target Advisor

Base: origin/main
Head: HEAD
Confidence: high

Required E2E targets

  • None. No E2E target dispatch is required: the PR changes PR review advisor workflows/tools and non-E2E unit tests, with no changes under test/e2e/, .github/workflows/e2e.yaml, target registry/runtime support, shared E2E fixtures, or target-relevant runtime paths.

Optional E2E targets

  • None.

Relevant changed files

  • None.

@github-code-quality

github-code-quality Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall coverage remains at 96%, unchanged from the main branch.

TypeScript / code-coverage/cli

The overall coverage in the codex/advisor-protoc... branch remains at 77%, unchanged from the main branch.

Show a code coverage summary of the most impacted files.
File main 1f05438 codex/advisor-protoc... d8de12e +/-
src/lib/actions...light-guards.ts 88% 71% -17%
src/lib/actions...confirmation.ts 81% 69% -12%
src/lib/actions...de-preflight.ts 60% 51% -9%
src/lib/actions...estore-phase.ts 93% 87% -6%
src/lib/actions...-add-restart.ts 19% 14% -5%
src/lib/credentials/store.ts 59% 61% +2%
src/lib/messagi.../persistence.ts 92% 95% +3%
src/lib/actions...lution-probe.ts 88% 94% +6%
src/lib/actions...e-validation.ts 81% 90% +9%
src/lib/actions...x/mcp-bridge.ts 35% 44% +9%

Updated July 09, 2026 15:38 UTC
Code Coverage is in Public Preview. Learn more and provide us with your feedback.

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor (Nemotron Ultra) — Informational

Merge posture: Informational / low confidence
Primary next action: Resolve or justify PRA-1: PR review advisor unavailable.
Open items: 0 required · 1 warning · 0 suggestions · 1 test follow-up
Top item: PR review advisor unavailable

Action checklist

  • PRA-1 Resolve or justify: PR review advisor unavailable
  • PRA-T1 Add or justify test follow-up: Runtime validation

Findings index

ID Severity Category Location Required action
PRA-1 Resolve/justify correctness Re-run the PR Review Advisor or perform a manual review.
Review findings by urgency: 0 required fixes, 1 item to resolve/justify, 0 in-scope improvements

⚠️ Resolve or justify before merge

Investigate these in the current review; either fix them, explain why they are not applicable, or document the accepted risk.

PRA-1 Resolve/justify — PR review advisor unavailable

  • Location: not file-specific
  • Category: correctness
  • Problem: The automated advisor could not complete: PR review advisor SDK execution failed: session: scope-risk-map must call pr_review_update_ledger exactly once (observed 2 starts); scope-risk-map must finish pr_review_update_ledger successfully exactly once (observed 1 successful of 2 total completions); scope-risk-map emitted text after pr_review_update_ledger; turn: scope-risk-map: scope-risk-map must call pr_review_update_ledger exactly once (observed 2 starts); scope-risk-map must finish pr_review_update_ledger successfully exactly once (observed 1 successful of 2 total completions); scope-risk-map emitted text after pr_review_update_ledger
  • Impact: Automated review evidence is incomplete, so human review must cover the changed code manually.
  • Recommended action: Re-run the PR Review Advisor or perform a manual review.
  • Expected follow-up: Resolve in this PR or explain why the risk is acceptable.
  • Verification: Inspect the workflow logs and raw advisor artifact for the execution failure.
  • Missing regression test: No regression test recommendation is available because the advisor did not complete.
  • Done when: The risk is fixed or explicitly justified in the PR. Verification: Inspect the workflow logs and raw advisor artifact for the execution failure.
  • Evidence: PR review advisor SDK execution failed: session: scope-risk-map must call pr_review_update_ledger exactly once (observed 2 starts); scope-risk-map must finish pr_review_update_ledger successfully exactly once (observed 1 successful of 2 total completions); scope-risk-map emitted text after pr_review_update_ledger; turn: scope-risk-map: scope-risk-map must call pr_review_update_ledger exactly once (observed 2 starts); scope-risk-map must finish pr_review_update_ledger successfully exactly once (observed 1 successful of 2 total completions); scope-risk-map emitted text after pr_review_update_ledger

💡 In-scope improvements

These are lower-risk, not throwaway. Prefer fixing them in this PR when they are local to changed code; defer only with rationale or a linked follow-up.

  • None.
Test follow-ups to resolve or justify

If these cover changed behavior, prefer adding them in this PR; otherwise state why existing coverage is enough or link the follow-up.

  • PRA-T1 Runtime validation — Add or identify targeted runtime/integration validation for the changed behavior; do not report external E2E job pass/fail here.. Runtime/sandbox/infrastructure paths need behavioral runtime validation: .github/workflows/pr-review-advisor.yaml, tools/advisors/README.md, tools/advisors/session.mts, tools/advisors/turn-protocol.mts, tools/pr-review-advisor/README.md, tools/pr-review-advisor/analyze.mts, tools/pr-review-advisor/schema.json, tools/pr-review-advisor/workflow-boundary.mts.

Workflow run details

This is an automated, non-binding review; it still expects maintainers and agents to respond to each required or warning item. Treat suggestions as current-PR improvements when they touch changed code; defer only with maintainer rationale or a linked follow-up. A human maintainer must make the final merge decision.

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Comment thread test/pr-review-advisor.test.ts Fixed
Comment thread test/pr-review-advisor.test.ts Fixed
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor — Informational

Merge posture: Informational / low confidence
Primary next action: Resolve or justify PRA-1: PR review advisor unavailable.
Open items: 0 required · 1 warning · 0 suggestions · 1 test follow-up
Top item: PR review advisor unavailable

Action checklist

  • PRA-1 Resolve or justify: PR review advisor unavailable
  • PRA-T1 Add or justify test follow-up: Runtime validation

Findings index

ID Severity Category Location Required action
PRA-1 Resolve/justify correctness Re-run the PR Review Advisor or perform a manual review.
Review findings by urgency: 0 required fixes, 1 item to resolve/justify, 0 in-scope improvements

⚠️ Resolve or justify before merge

Investigate these in the current review; either fix them, explain why they are not applicable, or document the accepted risk.

PRA-1 Resolve/justify — PR review advisor unavailable

  • Location: not file-specific
  • Category: correctness
  • Problem: The automated advisor could not complete: PR review advisor SDK execution failed: session: reconcile-findings called pr_review_update_ledger before analysis; turn: reconcile-findings: reconcile-findings called pr_review_update_ledger before analysis
  • Impact: Automated review evidence is incomplete, so human review must cover the changed code manually.
  • Recommended action: Re-run the PR Review Advisor or perform a manual review.
  • Expected follow-up: Resolve in this PR or explain why the risk is acceptable.
  • Verification: Inspect the workflow logs and raw advisor artifact for the execution failure.
  • Missing regression test: No regression test recommendation is available because the advisor did not complete.
  • Done when: The risk is fixed or explicitly justified in the PR. Verification: Inspect the workflow logs and raw advisor artifact for the execution failure.
  • Evidence: PR review advisor SDK execution failed: session: reconcile-findings called pr_review_update_ledger before analysis; turn: reconcile-findings: reconcile-findings called pr_review_update_ledger before analysis

💡 In-scope improvements

These are lower-risk, not throwaway. Prefer fixing them in this PR when they are local to changed code; defer only with rationale or a linked follow-up.

  • None.
Test follow-ups to resolve or justify

If these cover changed behavior, prefer adding them in this PR; otherwise state why existing coverage is enough or link the follow-up.

  • PRA-T1 Runtime validation — Add or identify targeted runtime/integration validation for the changed behavior; do not report external E2E job pass/fail here.. Runtime/sandbox/infrastructure paths need behavioral runtime validation: .github/workflows/pr-review-advisor.yaml, tools/advisors/README.md, tools/advisors/session.mts, tools/advisors/turn-protocol.mts, tools/pr-review-advisor/README.md, tools/pr-review-advisor/analyze.mts, tools/pr-review-advisor/schema.json, tools/pr-review-advisor/workflow-boundary.mts.

Workflow run details

This is an automated, non-binding review; it still expects maintainers and agents to respond to each required or warning item. Treat suggestions as current-PR improvements when they touch changed code; defer only with maintainer rationale or a linked follow-up. A human maintainer must make the final merge decision.

@coderabbitai coderabbitai 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.

🧹 Nitpick comments (1)
tools/pr-review-advisor/analyze.mts (1)

673-714: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Consider extracting the sourceOfTruthReview validation loop.

The added per-item validation block (lines 697-712) pushes reviewLedgerConsistencyIssues well past a simple aggregation into a function juggling findings-count checks, per-index diffing, and now a 3-branch sourceOfTruthReview check. Extracting the new loop into a small sourceOfTruthReviewLedgerIssues(review, index, openFindingIds) helper would keep this function's complexity manageable.

As per coding guidelines, **/*.{js,ts}: "Keep function complexity low in JavaScript and TypeScript code."

♻️ Suggested extraction
+function sourceOfTruthReviewLedgerIssues(
+  review: SourceOfTruthReview,
+  index: number,
+  openFindingIds: ReadonlySet<string>,
+): string[] {
+  const unresolved = review.status === "missing" || review.status === "needs_followup";
+  if (unresolved && !review.findingId) {
+    return [`sourceOfTruthReview[${index + 1}] ${review.surface} must reference an open ledger finding`];
+  }
+  if (unresolved && !openFindingIds.has(review.findingId!)) {
+    return [`sourceOfTruthReview[${index + 1}] ${review.surface} references non-open ledger finding ${review.findingId}`];
+  }
+  if (!unresolved && review.findingId) {
+    return [`sourceOfTruthReview[${index + 1}] ${review.surface} must use findingId=null for status=${review.status}`];
+  }
+  return [];
+}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tools/pr-review-advisor/analyze.mts` around lines 673 - 714, The
reviewLedgerConsistencyIssues function is becoming too complex because the new
sourceOfTruthReview per-item validation is mixed in with the existing findings
checks. Extract the loop logic into a small helper such as
sourceOfTruthReviewLedgerIssues(review, index, openFindingIds) and have
reviewLedgerConsistencyIssues aggregate its results, keeping the existing
behavior for open-finding validation and status/findingId rules intact.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@tools/pr-review-advisor/analyze.mts`:
- Around line 673-714: The reviewLedgerConsistencyIssues function is becoming
too complex because the new sourceOfTruthReview per-item validation is mixed in
with the existing findings checks. Extract the loop logic into a small helper
such as sourceOfTruthReviewLedgerIssues(review, index, openFindingIds) and have
reviewLedgerConsistencyIssues aggregate its results, keeping the existing
behavior for open-finding validation and status/findingId rules intact.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 3aa3cecb-49b4-4fc0-8be7-a78a1fdffc93

📥 Commits

Reviewing files that changed from the base of the PR and between 7215882 and 56acf56.

📒 Files selected for processing (12)
  • .github/workflows/pr-review-advisor.yaml
  • test/advisor-session-context-tools.test.ts
  • test/advisor-session-runner.test.ts
  • test/pr-review-advisor-ledger-tools.test.ts
  • test/pr-review-advisor-workflow-boundary.test.ts
  • test/pr-review-advisor.test.ts
  • tools/advisors/README.md
  • tools/advisors/session.mts
  • tools/advisors/turn-protocol.mts
  • tools/pr-review-advisor/README.md
  • tools/pr-review-advisor/analyze.mts
  • tools/pr-review-advisor/schema.json

cv added 2 commits July 9, 2026 03:21
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>

@coderabbitai coderabbitai 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.

🧹 Nitpick comments (1)
test/pr-review-advisor-workflow-boundary.test.ts (1)

134-136: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider asserting install is defined before non-null dereference.

install!.run!.replace(...) will throw a raw TypeError (rather than a clear test failure message) if the step is ever renamed and install is undefined. A expect(install).toBeDefined() before the mutation would make failures more diagnosable.

🧪 Optional diagnostic assertion
     const install = workflow.jobs.review.steps.find((step) => step.name === "Install Pi SDK");
+    expect(install).toBeDefined();
     install!.run = install!.run!.replace('"ripgrep=${RIPGREP_VERSION}"', "ripgrep");
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/pr-review-advisor-workflow-boundary.test.ts` around lines 134 - 136, The
test mutates the “Install Pi SDK” step via install!.run!.replace(...), but it
should first assert that the step lookup succeeded so a rename fails clearly. In
test/pr-review-advisor-workflow-boundary.test.ts, add an explicit expectation
that install is defined before dereferencing it, then keep the existing run
replacement and workflow write logic unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@test/pr-review-advisor-workflow-boundary.test.ts`:
- Around line 134-136: The test mutates the “Install Pi SDK” step via
install!.run!.replace(...), but it should first assert that the step lookup
succeeded so a rename fails clearly. In
test/pr-review-advisor-workflow-boundary.test.ts, add an explicit expectation
that install is defined before dereferencing it, then keep the existing run
replacement and workflow write logic unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 0113fa26-0c1a-4f60-9ae4-cb4324153456

📥 Commits

Reviewing files that changed from the base of the PR and between c998ada and 75257de.

📒 Files selected for processing (6)
  • .github/workflows/pr-review-advisor.yaml
  • test/pr-review-advisor-workflow-boundary.test.ts
  • test/pr-review-advisor.test.ts
  • tools/pr-review-advisor/README.md
  • tools/pr-review-advisor/analyze.mts
  • tools/pr-review-advisor/workflow-boundary.mts
🚧 Files skipped from review as they are similar to previous changes (4)
  • .github/workflows/pr-review-advisor.yaml
  • tools/pr-review-advisor/README.md
  • test/pr-review-advisor.test.ts
  • tools/pr-review-advisor/analyze.mts

@cv

cv commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator Author

Automated-review and CI follow-up:

  • Nemotron's reported duplicate/early ledger mutation came from the trusted main advisor implementation that runs before this PR's code can take effect. It is rollout evidence for this fix, not a defect in the current head; the new turn protocol and regression tests cover that exact failure mode.
  • GPT-5.5 now recommends merge_as_is with no required fixes or warnings. Its two duplicate follow-up suggestions ask for a provider-free real Pi SDK dispatch test. test/advisor-repo-read-only-tools.test.ts already invokes the real tool definitions end to end, while test/advisor-session-runner.test.ts exercises active session dispatch and atomic commits with a controlled SDK mock. A fully real agent session would require provider/model calls, so I am not adding that nondeterministic dependency to this PR.
  • CLI shard 4 initially hit an unrelated 5-second timeout in mcp-bridge-status-resolution.test.ts. The isolated rerun passed in 6m15s, and both the cli-tests aggregate and final checks gate are green.

@cv

cv commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator Author

Exact-head maintainer follow-up at 75257de1a254ffad9a79a03e46763bfa895af9a9 is complete:

  • The three valid prior findings are fixed: list-form issue references are fully extracted, the unused import is gone, and the trusted workflow uses a pinned Ubuntu runner plus an exact ripgrep fallback package guarded by boundary tests.
  • Focused advisor coverage passes 97/97; the conditional scan, Biome, and whitespace checks pass.
  • The sole ordinary-CI failure was the unchanged mcp-bridge-status-resolution.test.ts hitting the shared 5-second timeout at the same time on another PR. Its one-time retry passed, followed by green cli-tests and aggregate checks.
  • CodeRabbit and both CodeQL lanes are green with no current inline findings.
  • Trusted GPT-5.5 review is merge_as_is with 0 required findings, 0 warnings, and 0 suggestions.
  • All four commits are GitHub Verified and DCO-compliant; the PR is content-mergeable.

GitHub's rollup still displays superseded cancelled duplicates from rapid consecutive head updates, but later successful runs exist for those same commit-lint, DCO, and maintainer-edit contexts. The only remaining merge gate is independent review; I am not self-approving a cv-authored PR.

@cv
cv merged commit 4970809 into main Jul 9, 2026
43 checks passed
@cv
cv deleted the codex/advisor-protocol-repair branch July 9, 2026 15:41
Hadar301 pushed a commit to Hadar301/NemoClaw-OpenShift that referenced this pull request Jul 12, 2026
<!-- markdownlint-disable MD041 -->
## Summary

Make the PR Review Advisor's six analysis stages observable and its
ledger writes atomic. This follows a census of every advisor run after
NVIDIA#6547: useful findings were being hidden by protocol failures,
especially when models omitted, retried, or mixed prose with ledger
calls.

## Related Issue

Follow-up to NVIDIA#6547 and NVIDIA#6446.

## Changes

- Split every stage into a visible analysis turn and a strict tool-only
commit turn, with one bounded repair attempt when no ledger mutation
settles.
- Add a reusable turn-protocol abstraction so stage ordering,
validation, and repair behavior are defined once.
- Preserve valid committed findings when a later stage fails, require
explicit source-of-truth finding IDs, and remove prose-derived synthetic
findings.
- Recognize multi-issue `Refs`/`References`/`Follow-up to` relations and
provide `rg` from a trusted runner binary or an exact package pin.
- Add regression coverage for omitted, failed, retried, malformed,
empty, and late-failure model behavior; update the advisor maintainer
documentation.

## Type of Change

- [ ] Code change (feature, bug fix, or refactor)
- [x] Code change with doc updates
- [ ] Doc only (prose changes, no code sample modifications)
- [ ] Doc only (includes code sample changes)

## Quality Gates

- [x] Tests added or updated for changed behavior
- [ ] Existing tests cover changed behavior — justification:
- [ ] Tests not applicable — justification:
- [ ] Docs updated for user-facing behavior changes
- [x] Docs not applicable — justification: this changes internal
PR-review automation; the two maintainer READMEs were updated, with no
end-user behavior change.
- [x] Sensitive paths changed (security, policy, credentials, preflight,
onboarding, inference, runner, sandbox, or messaging)
- [x] Sensitive-path review completed or maintainer-approved waiver
recorded — [GPT advisor
review](NVIDIA#6566 (comment))
identified the package provenance gap; the runner/package are now pinned
and enforced by a semantic workflow-boundary mutation test.
- [ ] Non-success, skipped, or missing CI check accepted by maintainer —
check name, approval link, and follow-up issue:

## Verification

- [x] PR description includes the DCO sign-off declaration and every
commit appears as `Verified` in GitHub
- [x] Normal `pre-commit`, `commit-msg`, and `pre-push` hooks passed, or
`npm run check:diff` passed when hooks were skipped or unavailable
- [x] Targeted behavior tests pass for the current change set, or tests
are marked not applicable above — 131/131 focused advisor tests passed;
the final workflow boundary suite passed 8/8.
- [x] Applicable broad gate passed — the clean-checkout CI matrix and
aggregate `checks` gate passed. The earlier local `npm test` run
completed with 15,432 passed, 39 skipped, 1 todo, and 27
environment-only failures caused by the borrowed dependency symlink and
ambient local `umask`/`SSH_AUTH_SOCK`; all advisor tests passed.
- [x] Quality Gates section completed with required justifications or
waivers
- [x] No secrets, API keys, or credentials committed
- [ ] `npm run docs` builds without warnings (doc changes only) —
completed with zero errors and only pre-existing warnings.
- [ ] Doc pages follow the [style
guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md)
(doc changes only)
- [ ] New doc pages include SPDX header and frontmatter (new pages only)

---
Signed-off-by: Carlos Villela <cvillela@nvidia.com>

---------

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Co-authored-by: J. Yaunches <jyaunches@nvidia.com>
@wscurran wscurran added the bug-fix PR fixes a bug or regression label Aug 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug-fix PR fixes a bug or regression

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants