Skip to content

feat(advisor): review repository terminology - #8029

Merged
cv merged 9 commits into
mainfrom
codex/advisor-terminology-review
Aug 2, 2026
Merged

feat(advisor): review repository terminology#8029
cv merged 9 commits into
mainfrom
codex/advisor-terminology-review

Conversation

@cv

@cv cv commented Aug 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

PR Review Advisor now asks each model lane to select and evaluate terminology introduced or changed by a PR. Trusted tooling verifies each decision against repository evidence, while publication compares normalized lane results without changing the primary recommendation.

Changes

  • Add a semantic terminology stage, trusted tracing tools, and a canonical terminology receipt that records evidence for each decision.
  • Promote terminology ambiguity to an ordinary finding only when it has a concrete behavioral, security, evidence, test, or release impact, or an impact on a supported surface.
  • Compare normalized primary and evaluation-lane decisions without letting the evaluation lane change the primary assessment or E2E gate.
  • Replace relative PR revision jargon in existing guidance and add focused workflow, publisher, schema, security-boundary, and writing-guide coverage.
  • Simplify established terminology in nine docs pages by deleting redundant modifiers and stating lifecycle and endpoint requirements directly.

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:
  • Sensitive paths changed (security, policy, credentials, preflight, onboarding, inference, runner, sandbox, or messaging)
  • Sensitive-path review completed or maintainer-approved waiver recorded — reviewer/approval link/justification: Codex Desktop reviewed immutable SHA resolution, argv-only Git commands, stage-scoped tools, evidence bounds, receipt validation, and fail-closed behavior; focused security-boundary tests passed.
  • Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue:

Documentation Writer Review

  • Documentation writer subagent reviewed the completed changes
  • Result: docs-updated
  • Evidence: all 35 changed files at 04bd4214e5b3530d7057736535f242dfd4e00acd; the independent review found no actionable documentation issues after its clarity advisory was applied. The remaining revision terms describe real commit-binding or comparison contracts.
  • Agent: Codex Desktop

DGX Station Hardware Evidence

  • Tested on DGX Station
  • Tested commit:
  • Station profile/scenario:
  • Result:
  • Supporting evidence:

Verification

  • PR description includes a Signed-off-by: line and every commit appears as Verified in GitHub
  • Normal pre-commit, commit-msg, and pre-push hooks passed, or npm run validate:pr passed after refreshing origin/main when hooks were skipped or unavailable
  • Targeted behavior tests pass for the current change set, or tests are marked not applicable above — command/result or justification: complete PR Review Advisor suite passed 190/190 across 14 files; affected Hermes and merge-gate guidance tests passed 16/16. npm run typecheck:cli, Biome, npm run checks:repository, npm run docs, and git diff --check passed. The unchanged MCP status test passed 5/5 locally after the known CI shard timeout.
  • Applicable broad gate passed — npm test for broad runtime/test-harness changes; npm run check for repo-wide validation/coverage changes — command/result: npm test was attempted with the contributor SSH agent, but unrelated gateway-host tests require an active OpenShell gateway on this host. GitHub CI remains authoritative.
  • 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) — 0 errors and 2 existing Fern 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

Summary by CodeRabbit

  • New Features

    • Added semantic terminology review to the PR Review Advisor, including controlled-word tracing, decisions, recommendations, and review receipts.
    • Added terminology-aware comparisons between review lanes while preserving the primary assessment and E2E guidance.
    • Added validation and recovery handling for terminology review results.
  • Documentation

    • Updated advisor documentation, security guidance, changelog, and contributor workflows to describe terminology review and validation.
  • Tests

    • Expanded coverage for terminology analysis, receipts, validation, workflow integration, and writing-guide policies.

cv added 2 commits July 31, 2026 17:06
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
@cv cv self-assigned this Aug 1, 2026
@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • ✅ Review completed - (🔄 Check again to review again)
📝 Walkthrough

Walkthrough

The PR adds semantic terminology review to the PR Review Advisor. It introduces Git-backed tracing, validated terminology receipts, workflow integration, lane comparison, and output rendering. It also updates Hermes and security documentation to use PR SHA terminology instead of exact-head wording.

Changes

PR Review Advisor terminology review

Layer / File(s) Summary
Terminology contracts and Git tracing
tools/pr-review-advisor/terminology.mts, tools/pr-review-advisor/schema.json, tools/pr-review-advisor/review-ledger.mts
Adds terminology models, schemas, ledger validation, stage-gated tools, Git tracing, variant matching, and changed-location detection.
Advisor workflow and canonical receipts
tools/pr-review-advisor/analyze.mts, tools/pr-review-advisor/run-analysis.mts, tools/pr-review-advisor/README.md
Adds terminology stages, canonical receipt handling, prompt rules, fallback preservation, result normalization, rendering, and workflow documentation.
Lane validation and terminology publication
tools/pr-review-advisor/comment.mts, test/pr-review-advisor-comment-cli.test.ts
Validates terminology decisions, includes them in fingerprints, renders primary decisions, and reports secondary-lane terminology differences.
Terminology workflow regression coverage
test/pr-review-advisor*.test.ts, test/pr-review-advisor-writing*.test.ts
Tests tracing, SHA binding, decision validation, receipt persistence, clear outcomes, stage contracts, guide loading, and failure handling.

PR-SHA validation guidance

Layer / File(s) Summary
PR-SHA guidance and documentation
.agents/skills/..., docs/changelog/2026-07-24.mdx, docs/security/..., test/hermes-upgrade-skill.test.ts, test/skills/check-gates-fork-evidence.test.ts
Replaces exact-head wording with PR SHA wording across Hermes completion guidance, merge gates, security checks, changelog text, and related tests.

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

Sequence Diagram(s)

sequenceDiagram
  participant PRReviewAdvisor
  participant traceTerminology
  participant TerminologyLedger
  participant CorrectnessAnalysis
  participant SecurityAnalysis
  participant CommentPublisher
  PRReviewAdvisor->>traceTerminology: Trace selected terms against base and head
  traceTerminology-->>PRReviewAdvisor: Return terminology evidence
  PRReviewAdvisor->>TerminologyLedger: Commit validated terminology decisions
  TerminologyLedger-->>PRReviewAdvisor: Return canonical receipt
  PRReviewAdvisor->>CorrectnessAnalysis: Provide terminology receipt
  PRReviewAdvisor->>SecurityAnalysis: Provide terminology receipt
  CorrectnessAnalysis-->>PRReviewAdvisor: Return analysis
  SecurityAnalysis-->>PRReviewAdvisor: Return analysis
  PRReviewAdvisor->>CommentPublisher: Publish normalized terminology results
Loading

Possibly related PRs

Suggested labels: feature, area: docs

Suggested reviewers: apurvvkumaria, miyoungc

🚥 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 and concisely describes the main change: adding repository terminology review to the PR Review Advisor.
✨ Finishing Touches 💡 1
📝 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-terminology-review

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

@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

@github-code-quality

github-code-quality Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall coverage in commit 04bd421 in the codex/advisor-termin... branch remains at 96%, unchanged from commit 5cd29cc in the main branch.

TypeScript / code-coverage/cli

The overall coverage in commit 04bd421 in the codex/advisor-termin... branch remains at 81%, unchanged from commit d47ffe5 in the main branch.

Show a code coverage summary of the most impacted files.
File main d47ffe5 codex/advisor-termin... 04bd421 +/-
src/lib/onboard...load/rebuild.ts 0% 84% +84%
src/lib/onboard...build/commit.ts 0% 85% +85%
src/lib/onboard...rebuild/plan.ts 0% 86% +86%
src/lib/state/r...ld-authority.ts 0% 88% +88%
src/lib/onboard...ad/authority.ts 0% 88% +88%
src/lib/onboard...d/validation.ts 0% 91% +91%
src/lib/core/immutable.ts 0% 97% +97%
src/lib/onboard.../transaction.ts 0% 98% +98%
src/lib/onboard...ild/rollback.ts 0% 100% +100%
src/lib/onboard...ild/contract.ts 0% 100% +100%

Updated August 01, 2026 18:48 UTC

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

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
tools/pr-review-advisor/comment.mts (1)

811-847: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Absent terminology fields weaken the PR-SHA binding in the publisher. Both sites treat a missing value as acceptable, so a lane artifact without PR-SHA-bound terminology evidence still reaches the published comment.

  • tools/pr-review-advisor/comment.mts#L811-L847: reject a missing terminologyReview in trustedLaneStructure, or name the rollout consumer that needs the tolerance; also add terminology?: TrustedLaneTerminologyDecision[] to the declared return type so the fingerprint and lane data stay typed.
  • tools/pr-review-advisor/comment.mts#L632-L643: require typeof result?.headSha === "string" in renderTerminologyDetails before you compare it with decision.source.headSha, so an undefined-to-undefined match cannot pass.
🤖 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/comment.mts` around lines 811 - 847, Strengthen
terminology PR-SHA validation in tools/pr-review-advisor/comment.mts#L811-L847
by making trustedLaneStructure reject absent terminologyReview and adding the
optional terminology field to its declared return type. In
tools/pr-review-advisor/comment.mts#L632-L643, update renderTerminologyDetails
to require result?.headSha to be a string before comparing it with
decision.source.headSha, preventing undefined values from matching.
🧹 Nitpick comments (6)
test/pr-review-advisor-terminology.test.ts (1)

101-182: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Consider adding stage-gating negative-path coverage.

This test drives the trace, update, and read tools through their correct stage sequence and verifies the concrete-contrast rejection path. The controller in terminology.mts also throws when TERMINOLOGY_TRACE_TOOL runs outside "terminology-review-analysis" or TERMINOLOGY_UPDATE_TOOL runs outside "terminology-review". Add a small negative test that calls these tools before setStage reaches the expected value, to confirm the stage guard actually rejects the call through the public execute() boundary.

Based on path instructions for **/*.test.{ts,js,mts,mjs,cts,cjs}: "Prefer observable outcomes through the public boundary over source-text, private-shape, or mock-call assertions."

🤖 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-terminology.test.ts` around lines 101 - 182, The
terminology tool tests currently cover only valid stage sequencing; add
negative-path coverage for the public execute() boundary. In the test using
createTerminologyToolController, invoke TERMINOLOGY_TRACE_TOOL before setting
"terminology-review-analysis" and TERMINOLOGY_UPDATE_TOOL before setting
"terminology-review", asserting each call rejects with the stage-guard error
while preserving the existing valid-flow assertions.

Source: Path instructions

test/pr-review-advisor-writing-guides.test.ts (1)

13-82: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Split this test into smaller, purpose-named cases.

This single it block asserts roughly 70 unrelated claims about buildSystemPrompt(): guide loading, terminology-review wording, obsolete-text removal, finding-eligibility rules, severity mapping, and the multi-turn conversation contract. When one substring check fails, the single title does not indicate which concern broke, and unrelated wording edits elsewhere in the prompt can fail this test even though the specific behavior a reader cares about still works.

Group the assertions into a few smaller it blocks, each with a title naming the specific behavior it verifies (for example, "removes obsolete sandbox-escape wording", "includes terminology-review guidance", "documents finding severity mapping"). This keeps each test's public-boundary assertions but gives clearer failure attribution.

As per coding guidelines: "Write behavior-oriented test titles and put local issue references in a final (#1234) suffix."

🤖 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-writing-guides.test.ts` around lines 13 - 82, Split
the single test around readTrustedSecurityReviewSkill, readTrustedWritingGuide,
readTrustedControlledWords, and buildSystemPrompt into a few behavior-focused it
blocks, grouping related assertions for guide loading, terminology and review
policy, obsolete wording, finding rules and mappings, and conversation behavior.
Give each test a specific behavior-oriented title and append the applicable
local issue reference as a final (`#1234`) suffix, while preserving the existing
boundary assertions.

Source: Coding guidelines

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

161-178: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Import the terminology enums instead of redeclaring them.

TERMINOLOGY_CHANGES, TERMINOLOGY_DISPOSITIONS, and TERMINOLOGY_IMPACTS duplicate CHANGES, DISPOSITIONS, and SEMANTIC_IMPACTS in tools/pr-review-advisor/terminology.mts (Lines 14-24). The same lists also appear in tools/pr-review-advisor/schema.json and in trustedLaneTerminology in tools/pr-review-advisor/comment.mts (Lines 880-893). A new disposition added in one place can silently drift from the others: the ledger would accept a value that sanitizeTerminologyReview maps back to "define".

analyze.mts already imports from ./terminology.mts, so export the tuples and reuse them here. Keep the publisher copy in comment.mts if the trusted-publisher boundary requires an independent list, and document that requirement.

As per path instructions: "Derive inventories and limits from a canonical source where possible; flag duplicated lists that can silently drift."

♻️ Proposed change

In tools/pr-review-advisor/terminology.mts, export the existing tuples:

-const CHANGES = ["introduced", "expanded", "redefined"] as const;
-const DISPOSITIONS = ["established", "justified", "define", "replace", "conflict"] as const;
-const SEMANTIC_IMPACTS = [
+export const CHANGES = ["introduced", "expanded", "redefined"] as const;
+export const DISPOSITIONS = ["established", "justified", "define", "replace", "conflict"] as const;
+export const SEMANTIC_IMPACTS = [

Then in this file:

-const TERMINOLOGY_STATUSES = ["clear", "candidates", "limited"] as const;
-const TERMINOLOGY_CHANGES = ["introduced", "expanded", "redefined"] as const;
-const TERMINOLOGY_DISPOSITIONS = [
-  "established",
-  "justified",
-  "define",
-  "replace",
-  "conflict",
-] as const;
-const TERMINOLOGY_IMPACTS = [
-  "none",
-  "behavior",
-  "security",
-  "support",
-  "evidence",
-  "test",
-  "release",
-] as const;
+const TERMINOLOGY_STATUSES = ["clear", "candidates", "limited"] as const;
+const TERMINOLOGY_CHANGES = CHANGES;
+const TERMINOLOGY_DISPOSITIONS = DISPOSITIONS;
+const TERMINOLOGY_IMPACTS = SEMANTIC_IMPACTS;
🤖 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 161 - 178, Export the
canonical CHANGES, DISPOSITIONS, and SEMANTIC_IMPACTS tuples from
terminology.mts, then update analyze.mts to import and reuse them instead of
declaring TERMINOLOGY_CHANGES, TERMINOLOGY_DISPOSITIONS, and TERMINOLOGY_IMPACTS
locally. Leave trustedLaneTerminology in comment.mts independent only if
required by the trusted-publisher boundary, and document that requirement.

Source: Path instructions

test/pr-review-advisor-comment-cli.test.ts (1)

264-289: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add a case for an absent terminologyReview and for a duplicate decision ID.

This test proves that a wrong head SHA makes the lane unavailable. Two validation branches in trustedLaneTerminology remain uncovered:

  • An artifact that omits terminologyReview entirely. trustedLaneStructure accepts it and fingerprints an empty list, so the publisher reports matching terminology decisions. See my comment on tools/pr-review-advisor/comment.mts Lines 811-847.
  • A repeated T- ID or more than 20 decisions.

Add one assertion for each branch so the intended behavior is pinned.

As per path instructions: "Require focused tests for both detection and false-positive behavior."

🤖 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-comment-cli.test.ts` around lines 264 - 289, Add
focused assertions in the test covering normalizeAdvisorLaneReport for both
trustedLaneTerminology validation branches: an artifact with terminologyReview
omitted entirely, and an artifact containing duplicate T- decision IDs or more
than 20 decisions. Assert the expected unavailable result for invalid inputs and
include a valid control case where appropriate to pin detection without false
positives.

Source: Path instructions

test/pr-review-advisor.test.ts (1)

490-517: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Assert guide content in the advisor prompt.

Add assertions that buildSystemPrompt() contains distinctive content from both writingGuide and skill. The current test checks loaded values and section labels, but not actual guide embedding.

🤖 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.test.ts` around lines 490 - 517, Update the
buildSystemPrompt() test to assert that the generated advisor prompt contains
distinctive text from both writingGuide and skill, using representative values
already loaded by the test. Keep the existing assertions for loaded values and
section labels, and add coverage for the actual embedded guide content.

Source: Path instructions

tools/pr-review-advisor/schema.json (1)

288-302: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Add single-line and SHA constraints to terminology fields.

renderSummary interpolates term, recommendation, and noChangesReason directly into Markdown. Newlines can create extra lines. Add ^[^\\r\\n]*$ to the terminology text fields and noChangesReason. Add ^[0-9a-f]{40}$ to source.headSha.

🤖 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/schema.json` around lines 288 - 302, Update the
schema fields used by renderSummary to reject newline characters by adding the
^[^\\r\\n]*$ pattern to term, recommendation, and noChangesReason while
preserving their existing constraints; also constrain source.headSha with
^[0-9a-f]{40}$. Locate the corresponding property definitions in the schema
rather than changing unrelated fields.
🤖 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.

Inline comments:
In `@tools/pr-review-advisor/analyze.mts`:
- Around line 1690-1699: Update the entrypoint flow around
readTrustedControlledWords() and readTrustedWritingGuide() so failures occurring
before writeFailure initialization still produce the required failure or
unavailable artifact. Ensure the caught error is passed through the existing
artifact-writing mechanism before logging and exiting, while preserving the
current error details and normal success path.
- Around line 777-809: Update canonicalRetryFallback to run
reviewLedgerConsistencyIssues and terminologyReviewConsistencyIssues against the
original draft result before applying withCanonicalReviewLedgerFindings and
withCanonicalTerminologyReview, while preserving sourceOfTruthReview validation.
Replace JSON.stringify comparison in terminologyReviewConsistencyIssues with a
stable key-order-independent comparison for same-session receipts. Add coverage
for draft finding drift and equivalent terminologyReview objects with reordered
keys.

In `@tools/pr-review-advisor/terminology.mts`:
- Around line 353-365: Update grepRef to bound git grep output so frequent
variants cannot exceed git()'s 4 MiB buffer, and handle the resulting
buffer-overflow failure as truncated evidence rather than propagating an error.
Preserve the existing deduplication and sorting, and ensure the traceTerminology
flow around the allowFailure handling can continue when output is truncated; use
separate count logic only if exact baseOccurrences and headOccurrences are
required.

---

Outside diff comments:
In `@tools/pr-review-advisor/comment.mts`:
- Around line 811-847: Strengthen terminology PR-SHA validation in
tools/pr-review-advisor/comment.mts#L811-L847 by making trustedLaneStructure
reject absent terminologyReview and adding the optional terminology field to its
declared return type. In tools/pr-review-advisor/comment.mts#L632-L643, update
renderTerminologyDetails to require result?.headSha to be a string before
comparing it with decision.source.headSha, preventing undefined values from
matching.

---

Nitpick comments:
In `@test/pr-review-advisor-comment-cli.test.ts`:
- Around line 264-289: Add focused assertions in the test covering
normalizeAdvisorLaneReport for both trustedLaneTerminology validation branches:
an artifact with terminologyReview omitted entirely, and an artifact containing
duplicate T- decision IDs or more than 20 decisions. Assert the expected
unavailable result for invalid inputs and include a valid control case where
appropriate to pin detection without false positives.

In `@test/pr-review-advisor-terminology.test.ts`:
- Around line 101-182: The terminology tool tests currently cover only valid
stage sequencing; add negative-path coverage for the public execute() boundary.
In the test using createTerminologyToolController, invoke TERMINOLOGY_TRACE_TOOL
before setting "terminology-review-analysis" and TERMINOLOGY_UPDATE_TOOL before
setting "terminology-review", asserting each call rejects with the stage-guard
error while preserving the existing valid-flow assertions.

In `@test/pr-review-advisor-writing-guides.test.ts`:
- Around line 13-82: Split the single test around
readTrustedSecurityReviewSkill, readTrustedWritingGuide,
readTrustedControlledWords, and buildSystemPrompt into a few behavior-focused it
blocks, grouping related assertions for guide loading, terminology and review
policy, obsolete wording, finding rules and mappings, and conversation behavior.
Give each test a specific behavior-oriented title and append the applicable
local issue reference as a final (`#1234`) suffix, while preserving the existing
boundary assertions.

In `@test/pr-review-advisor.test.ts`:
- Around line 490-517: Update the buildSystemPrompt() test to assert that the
generated advisor prompt contains distinctive text from both writingGuide and
skill, using representative values already loaded by the test. Keep the existing
assertions for loaded values and section labels, and add coverage for the actual
embedded guide content.

In `@tools/pr-review-advisor/analyze.mts`:
- Around line 161-178: Export the canonical CHANGES, DISPOSITIONS, and
SEMANTIC_IMPACTS tuples from terminology.mts, then update analyze.mts to import
and reuse them instead of declaring TERMINOLOGY_CHANGES,
TERMINOLOGY_DISPOSITIONS, and TERMINOLOGY_IMPACTS locally. Leave
trustedLaneTerminology in comment.mts independent only if required by the
trusted-publisher boundary, and document that requirement.

In `@tools/pr-review-advisor/schema.json`:
- Around line 288-302: Update the schema fields used by renderSummary to reject
newline characters by adding the ^[^\\r\\n]*$ pattern to term, recommendation,
and noChangesReason while preserving their existing constraints; also constrain
source.headSha with ^[0-9a-f]{40}$. Locate the corresponding property
definitions in the schema rather than changing unrelated fields.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 58cef949-c6e9-4a95-9374-c84f21d1a02b

📥 Commits

Reviewing files that changed from the base of the PR and between ffc1ae6 and ba0c6d5.

📒 Files selected for processing (23)
  • .agents/skills/_shared/controlled-words.md
  • .agents/skills/nemoclaw-contributor-update-hermes/SKILL.md
  • .agents/skills/nemoclaw-contributor-update-hermes/references/hermes-contract-map.md
  • .agents/skills/nemoclaw-maintainer-day/MERGE-GATE.md
  • .agents/skills/nemoclaw-skills-guide/SKILL.md
  • docs/changelog/2026-07-24.mdx
  • docs/security/fern-5.80.1-dependency-review.md
  • docs/security/hermes-0.19.0-dependency-review.md
  • test/hermes-upgrade-skill.test.ts
  • test/pr-review-advisor-comment-cli.test.ts
  • test/pr-review-advisor-terminology.test.ts
  • test/pr-review-advisor-test-depth.test.ts
  • test/pr-review-advisor-workflow-boundary.test.ts
  • test/pr-review-advisor-writing-guides.test.ts
  • test/pr-review-advisor.test.ts
  • test/skills/check-gates-fork-evidence.test.ts
  • tools/pr-review-advisor/README.md
  • tools/pr-review-advisor/analyze.mts
  • tools/pr-review-advisor/comment.mts
  • tools/pr-review-advisor/review-ledger.mts
  • tools/pr-review-advisor/run-analysis.mts
  • tools/pr-review-advisor/schema.json
  • tools/pr-review-advisor/terminology.mts

Comment thread tools/pr-review-advisor/analyze.mts
Comment thread tools/pr-review-advisor/analyze.mts
Comment thread tools/pr-review-advisor/terminology.mts Outdated
@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor — No blocking findings reported

Advisor assessment: No blocking advisor findings reported
Next action: No advisor follow-up needed.
Findings: 0 blockers · 0 warnings · 0 suggestions

Model lanes

  • GPT-5.6 Terra (primary): Completed · high confidence · 0 blockers · 0 warnings · 0 suggestions
  • Nemotron 3 Ultra (second opinion): Completed · high confidence · 0 blockers · 0 warnings · 0 suggestions
  • Model comparison: normalized findings match; normalized E2E selections match; severity counts match.

Second-opinion E2E selections are advisory. They do not change the primary assessment or E2E / PR Gate.

E2E guidance

Advisory only. E2E / PR Gate selects and runs jobs independently.

Recommended E2E: None

Workflow run details

This automated review informs maintainers. Warnings and suggestions do not require a response. A maintainer decides whether to merge.

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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
tools/pr-review-advisor/terminology.mts (1)

313-358: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Handle ENOBUFS in changedTermLocations.

git() limits output to 4 MiB, but an overflow raises ENOBUFS with no numeric status, so allowFailure does not catch it. A large diff can still make traceTerminology fail. Truncate the diff or handle ENOBUFS explicitly.

🤖 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/terminology.mts` around lines 313 - 358, Update
changedTermLocations, used by traceTerminology, to handle git output exceeding
the 4 MiB buffer: either truncate the diff before processing or explicitly catch
ENOBUFS and return the existing truncated-result behavior. Ensure large diffs do
not cause traceTerminology to fail when the error has no numeric status.
🧹 Nitpick comments (1)
test/pr-review-advisor-writing-guide.test.ts (1)

53-58: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Scope the readFileSync mock to the writing-guide path instead of call order.

The mock chains two mockImplementationOnce calls on fs.readFileSync without a path check: the first call returns securitySkill, and the second throws to simulate the missing writing guide. This binds the test to the internal call order and count of fs.readFileSync inside preparePromptArtifacts. If an unrelated internal change adds, removes, or reorders a readFileSync call, the test can fail, or pass while exercising the wrong scenario, without the writing guide actually becoming unavailable.

Make the mock conditional on the file path being read (for example, throwing only when the path contains WRITING.md, matching the pattern in the "stops when the trusted guide is unavailable" test) so the test verifies "the writing guide is unavailable" rather than "the second readFileSync call fails".

As per path instructions for **/*.test.{ts,js,mts,mjs,cts,cjs}: "Flag copied production algorithms, broad mocks that bypass the behavior under test, and conditionals that make a test pass without exercising its claim."

♻️ Proposed path-scoped mock
-    const readSpy = vi
-      .spyOn(fs, "readFileSync")
-      .mockImplementationOnce(() => securitySkill)
-      .mockImplementationOnce(() => {
-        throw new Error("missing guide fixture");
-      });
+    const readSpy = vi.spyOn(fs, "readFileSync").mockImplementation((file, ...rest) => {
+      if (String(file).includes("WRITING.md")) {
+        throw new Error("missing guide fixture");
+      }
+      return fs.readFileSync.wrappedMethod?.(file, ...rest) ?? securitySkill;
+    });
🤖 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-writing-guide.test.ts` around lines 53 - 58, Update
the readFileSync mock in the preparePromptArtifacts test to inspect the
requested path instead of chaining mockImplementationOnce calls. Throw only when
the path identifies WRITING.md, and return securitySkill for other reads, so the
test specifically simulates an unavailable writing guide without depending on
internal call order.

Source: Path instructions

🤖 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.

Outside diff comments:
In `@tools/pr-review-advisor/terminology.mts`:
- Around line 313-358: Update changedTermLocations, used by traceTerminology, to
handle git output exceeding the 4 MiB buffer: either truncate the diff before
processing or explicitly catch ENOBUFS and return the existing truncated-result
behavior. Ensure large diffs do not cause traceTerminology to fail when the
error has no numeric status.

---

Nitpick comments:
In `@test/pr-review-advisor-writing-guide.test.ts`:
- Around line 53-58: Update the readFileSync mock in the preparePromptArtifacts
test to inspect the requested path instead of chaining mockImplementationOnce
calls. Throw only when the path identifies WRITING.md, and return securitySkill
for other reads, so the test specifically simulates an unavailable writing guide
without depending on internal call order.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: c6ff67bb-68ed-47de-a907-d06f8ee21277

📥 Commits

Reviewing files that changed from the base of the PR and between ba0c6d5 and 27e3dc8.

📒 Files selected for processing (11)
  • test/pr-review-advisor-comment-cli.test.ts
  • test/pr-review-advisor-ledger-tools.test.ts
  • test/pr-review-advisor-terminology.test.ts
  • test/pr-review-advisor-writing-guide.test.ts
  • test/pr-review-advisor-writing-guides.test.ts
  • test/pr-review-advisor.test.ts
  • tools/pr-review-advisor/README.md
  • tools/pr-review-advisor/analyze.mts
  • tools/pr-review-advisor/comment.mts
  • tools/pr-review-advisor/schema.json
  • tools/pr-review-advisor/terminology.mts
🚧 Files skipped from review as they are similar to previous changes (6)
  • test/pr-review-advisor-writing-guides.test.ts
  • tools/pr-review-advisor/README.md
  • tools/pr-review-advisor/schema.json
  • tools/pr-review-advisor/comment.mts
  • test/pr-review-advisor.test.ts
  • tools/pr-review-advisor/analyze.mts

cv added 3 commits July 31, 2026 18:22
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
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.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
tools/pr-review-advisor/terminology.mts (1)

314-359: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Make firstCommitSha case-insensitive and variant-aware.

With Git 2.50.1, --regexp-ignore-case does not affect fixed-string -S${normalized} searches. Add --pickaxe-regex and search escaped variants; otherwise history for differently cased or hyphen/space variants can remain null.

🤖 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/terminology.mts` around lines 314 - 359, Update the
firstCommitSha git log query in traceTerminology to use the complete variants
collection instead of only normalized, and enable regex pickaxe matching with
--pickaxe-regex while preserving case-insensitive search. Escape each variant
before constructing the search expression so punctuation in hyphen/space
variants is matched literally.
🧹 Nitpick comments (1)
tools/pr-review-advisor/terminology.mts (1)

239-312: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Define the terminology stage names from a canonical source.

"terminology-review" is duplicated in tools/pr-review-advisor/terminology.mts and tools/pr-review-advisor/analyze.mts. Export the stage constants and use them in both modules.

🤖 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/terminology.mts` around lines 239 - 312, Define and
export canonical constants for the terminology stages in terminology.mts,
including the values currently used by the trace and update stage checks.
Replace the inline "terminology-review-analysis" and "terminology-review"
comparisons in createTerminologyToolController with those constants, then import
and use the same constants in analyze.mts instead of duplicating the string
literals.

Source: Path instructions

🤖 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.

Inline comments:
In `@tools/pr-review-advisor/terminology.mts`:
- Around line 428-476: Update changedTermLocations so failure of both merge-base
and direct diff evidence is surfaced instead of returning an empty locations
array. Normalize command failures, including rejected streamChangedTermLocations
calls, using the existing git() error-handling convention, while preserving []
only when a diff succeeds with no relevant changes.
- Around line 428-446: Update both Git argument arrays in changedTermLocations
to pass -c core.quotePath=false before the diff subcommand and add
--default-prefix, ensuring non-ASCII paths are parsed correctly while preserving
the existing merge-base fallback behavior.

---

Outside diff comments:
In `@tools/pr-review-advisor/terminology.mts`:
- Around line 314-359: Update the firstCommitSha git log query in
traceTerminology to use the complete variants collection instead of only
normalized, and enable regex pickaxe matching with --pickaxe-regex while
preserving case-insensitive search. Escape each variant before constructing the
search expression so punctuation in hyphen/space variants is matched literally.

---

Nitpick comments:
In `@tools/pr-review-advisor/terminology.mts`:
- Around line 239-312: Define and export canonical constants for the terminology
stages in terminology.mts, including the values currently used by the trace and
update stage checks. Replace the inline "terminology-review-analysis" and
"terminology-review" comparisons in createTerminologyToolController with those
constants, then import and use the same constants in analyze.mts instead of
duplicating the string literals.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 8780fee1-fed6-4491-8a81-8330b7a5eef8

📥 Commits

Reviewing files that changed from the base of the PR and between d3f810d and 6027607.

📒 Files selected for processing (3)
  • test/pr-review-advisor-terminology.test.ts
  • tools/pr-review-advisor/README.md
  • tools/pr-review-advisor/terminology.mts
🚧 Files skipped from review as they are similar to previous changes (1)
  • tools/pr-review-advisor/README.md

Comment thread tools/pr-review-advisor/terminology.mts
Comment thread tools/pr-review-advisor/terminology.mts
cv added 3 commits July 31, 2026 19:25
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
@cv
cv merged commit 44cae3d into main Aug 2, 2026
73 of 77 checks passed
@cv
cv deleted the codex/advisor-terminology-review branch August 2, 2026 02:05
@github-actions github-actions Bot added the v0.0.101 Release target label Aug 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v0.0.101 Release target

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant