Skip to content

fix(skills): give root-cause and sensitive-state checks one stage-neutral owner - #8575

Open
laitingsheng wants to merge 8 commits into
mainfrom
fix/stage-neutral-change-checks
Open

fix(skills): give root-cause and sensitive-state checks one stage-neutral owner#8575
laitingsheng wants to merge 8 commits into
mainfrom
fix/stage-neutral-change-checks

Conversation

@laitingsheng

@laitingsheng laitingsheng commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Summary

.agents/skills/_shared/pr-follow-up.md was the only stage owner of the root-cause sibling-path record and the sensitive-workflow state matrix, so planning and implementation could complete without either check. A stage-neutral resource, .agents/skills/_shared/root-cause-and-state-checks.md, now states both checks for plan-issue, implement-issue, and pr-follow-up. PR follow-up keeps its stage-specific mechanics. .agents/skills/_shared/documentation-writing-review.md keeps a separate review-scope statement of adjacent-path inspection and sensitive-boundary dimensions, and this PR does not change it.

Related Issue

Fixes #8555
Parent epic: #8240

Changes

  • Added .agents/skills/_shared/root-cause-and-state-checks.md as the stage-neutral owner that plan-issue, implement-issue, and pr-follow-up all consume. The matrix rows, columns, and cells move verbatim; its Authority section keeps path, command, selector, test, and architecture details in the checkout rather than in the resource. It delegates the authentication and authorization category to the Security Rubric and requires that rubric's positive and negative evidence for a public or external write, rather than restating an authorization check in the matrix.
  • _shared/pr-follow-up.md consumes the shared resource instead of stating either check, and keeps review collection, pagination, head stability, finding grouping and disposition, evidence cleanup, and the push gate. Classification now precedes the shared checks in the review cycle, because the checks act on the valid groups that classification produces, and each group records the operation and failure class it belongs to.
  • nemoclaw-contributor-plan-issue names the operation and failure class during discovery and records the sibling paths checked and the applicable sensitive-workflow states in its plan report. The report requires a separate result and action per phase, plus each credential's location, access, lifetime, and removal.
  • nemoclaw-contributor-implement-issue names the operation and failure class before editing, re-checks it with the sibling paths and state outcomes against the completed diff during self-review, reports each sibling path that still needs the same change, and carries the same credential and result/action evidence in its handoff.
  • Tests prove the same meanings at all three stages without copying the guidance: an owner test covers the resource's content, a length budget, and the no-inventory guard, and asserts that each consumer links the resource, carries the operation and failure class, and restates neither the matrix nor the inspection rule.
  • Merged origin/main to keep the branch current. The merge was clean; main touched only .agents/skills/nemoclaw-maintainer-day/scripts/check-gates.ts and .agents/skills/nemoclaw-maintainer-e2e/SKILL.md, neither of which this PR changes.

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: no user-visible surface changes. The change is contributor agent guidance under .agents/skills/, which is absent from the files list in package.json and outside the sparse checkout that docs/resources/agent-skills.mdx documents; that recipe covers nemoclaw-user-guide only.
  • 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:
  • 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: no-docs-needed
  • Evidence: reviewed against WRITING.md and the controlled word list across six heads. No documentation update is required: the change is confined to .agents/skills/** and test/**, and .agents/ is absent from the files list in package.json, so the shared resource ships in no published package; docs/resources/agent-skills.mdx sparse-checks out only /.agents/skills/nemoclaw-user-guide/** plus /.claude/**, whose sole entry is the skills symlink resolving back into that same sparse set; no page under docs/ or fern/ references the moved checks, and no dangling reference to the removed pr-follow-up.md heading remains. No command, configuration, default, workflow, or other user-visible surface changed. The relocated authorization sentence was verified against the Security Rubric's own ownership statement and its authentication and authorization category, and now claims only what that rubric claims for itself. Five blocking findings raised across the review rounds were all applied before this head, the last being the single-ownership wording in this description; no blocking finding remains. Reconciling the overlapping adjacent-path and sensitive-boundary text in _shared/documentation-writing-review.md, which predates this branch, is left to a focused follow-up.
  • Agent: Claude Code

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: npx vitest run --project integration test/skills-frontmatter.test.ts test/maintainer-skills-policy.test.ts test/code-change-considerations.test.ts — 3 files, 64 passed. npm run checks:repository passed, including the test title style and test registration boundary checks. npx markdownlint-cli2 reported 0 errors on the changed Markdown.
  • Applicable broad gate passed — npm test for broad runtime/test-harness changes; npm run check for repo-wide validation/coverage changes — command/result:
  • 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)
  • Doc pages follow the style guide (doc changes only)
  • New doc pages include SPDX header and frontmatter (new pages only)

Signed-off-by: Tinson Lai tinsonl@nvidia.com

Summary by CodeRabbit

  • Process Improvements

    • Improved planning, implementation, and review workflows with clearer root-cause analysis and sensitive-operation checks.
    • Added structured reporting for failure classification, sibling paths, authorization, and workflow state outcomes.
    • Review and CI follow-up processes now apply consistent checks before grouped fixes.
  • Tests

    • Expanded validation to ensure workflow guidance, frontmatter, and required reporting remain consistent.
    • Added coverage for pending, cancelled, and skipped workflow checks.

Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
… routing

Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
…ment

Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The PR adds shared root-cause and sensitive-workflow state checks. Planning, implementation, and PR follow-up workflows now use this guidance. Policy tests validate references, reporting fields, sibling-path checks, state coverage, and evidence handling.

Changes

Workflow check alignment

Layer / File(s) Summary
Shared root-cause and state guidance
.agents/skills/_shared/root-cause-and-state-checks.md
Defines operation and failure-class analysis, sibling-path inspection, sensitive-workflow states, credential handling, evidence recording, and rollback, retry, or stop decisions.
Lifecycle workflow integration
.agents/skills/_shared/pr-follow-up.md, .agents/skills/nemoclaw-contributor-plan-issue/SKILL.md, .agents/skills/nemoclaw-contributor-implement-issue/SKILL.md
Planning, implementation, and PR follow-up reference the shared checks and record paths, states, findings, and outcomes.
Policy contract validation
test/maintainer-skills-policy.test.ts, test/skills-frontmatter.test.ts
Tests validate the shared document, workflow references, required reporting fields, sibling-path tracking, state coverage, and evidence handling.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant PlanningSkill
  participant ImplementationSkill
  participant PRFollowUp
  participant SharedChecks
  PlanningSkill->>SharedChecks: Apply root-cause and sensitive-workflow checks
  PlanningSkill->>ImplementationSkill: Pass operation, failure class, paths, and states
  ImplementationSkill->>SharedChecks: Re-check paths and workflow states
  ImplementationSkill->>PRFollowUp: Provide completed-diff outcomes
  PRFollowUp->>SharedChecks: Apply checks before grouped fixes
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: centralizing root-cause and sensitive-state checks in one stage-neutral resource.
Linked Issues check ✅ Passed The changes satisfy the linked issue by centralizing shared checks, updating planning and implementation workflows, preserving review mechanics, and adding coverage tests.
Out of Scope Changes check ✅ Passed All changed guidance and tests directly support the linked issue objectives and do not introduce unrelated scope.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ 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 fix/stage-neutral-change-checks

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

@github-code-quality

github-code-quality Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall coverage in commit 14cb50e in the fix/stage-neutral-ch... branch remains at 96%, unchanged from commit 7d1c24e in the main branch.

TypeScript / code-coverage/cli

The overall coverage in commit 14cb50e in the fix/stage-neutral-ch... branch remains at 81%, unchanged from commit 7d1c24e in the main branch.

Show a code coverage summary of the most impacted files.
File main 7d1c24e fix/stage-neutral-ch... 14cb50e +/-
src/lib/onboard...an-lifecycle.ts 95% 79% -16%
src/lib/actions...ateway-state.ts 79% 75% -4%
src/lib/agent/base-image.ts 86% 82% -4%
src/lib/onboard...cker-journal.ts 70% 75% +5%
src/lib/onboard...file-builder.ts 83% 89% +6%
src/lib/onboard...ne-authority.ts 84% 91% +7%
src/lib/onboard...strap/docker.ts 64% 72% +8%
src/lib/onboard.../docker-spec.ts 65% 74% +9%
src/lib/onboard...shared-state.ts 73% 90% +17%
src/lib/policy/...ateway-state.ts 56% 73% +17%

Updated August 09, 2026 07:33 UTC

@laitingsheng laitingsheng added bug-fix PR fixes a bug or regression area: skills Skills, agent behaviors, prompts, or skill packaging labels Aug 7, 2026

@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

🤖 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 @.agents/skills/_shared/root-cause-and-state-checks.md:
- Around line 22-39: Update the Sensitive-Workflow State Matrix guidance to
require an explicit authorization-boundary check for public or external writes.
Either add the check and required evidence to this matrix, or explicitly
delegate it to the Security Rubric and require that evidence there.

In @.agents/skills/nemoclaw-contributor-implement-issue/SKILL.md:
- Around line 80-83: Update
.agents/skills/nemoclaw-contributor-implement-issue/SKILL.md lines 80-83 to
require recording the explicit operation and failure class before editing,
alongside sibling paths and sensitive-workflow outcomes. Update lines 108-111 to
require rechecking and reporting both fields during self-review. Update
.agents/skills/_shared/pr-follow-up.md lines 93-97 to require recording the
operation and failure class for each finding group before applying fixes.

In @.agents/skills/nemoclaw-contributor-plan-issue/SKILL.md:
- Around line 130-132: Expand the sensitive-workflow evidence requirements in
the plan report fields at
.agents/skills/nemoclaw-contributor-plan-issue/SKILL.md:130-132 to capture
credential location, access, lifetime, removal, and separate result/action
classifications for every failure cell. Apply the same evidence requirements to
the implementation handoff fields at
.agents/skills/nemoclaw-contributor-implement-issue/SKILL.md:135-139, preserving
the shared lifecycle-report contract.
🪄 Autofix

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: 52fa9ea5-82a7-47f5-9000-eff6294dd98a

📥 Commits

Reviewing files that changed from the base of the PR and between 272cc64 and 373e073.

📒 Files selected for processing (6)
  • .agents/skills/_shared/pr-follow-up.md
  • .agents/skills/_shared/root-cause-and-state-checks.md
  • .agents/skills/nemoclaw-contributor-implement-issue/SKILL.md
  • .agents/skills/nemoclaw-contributor-plan-issue/SKILL.md
  • test/maintainer-skills-policy.test.ts
  • test/skills-frontmatter.test.ts

Comment thread .agents/skills/_shared/root-cause-and-state-checks.md
Comment thread .agents/skills/nemoclaw-contributor-implement-issue/SKILL.md Outdated
Comment thread .agents/skills/nemoclaw-contributor-plan-issue/SKILL.md Outdated
@github-actions

github-actions Bot commented Aug 7, 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 terminology decisions differ; normalized E2E selections match; severity counts match.
3 terminology differences from the second opinion

Advisory only. These are normalized differences from the primary terminology receipt.

  • sibling paths at .agents/skills/_shared/root-cause-and-state-checks.md:15: selected only by the second-opinion lane as established.
  • stage-neutral at test/skills-frontmatter.test.ts:116: selected only by the second-opinion lane as established.
  • credential location at .agents/skills/nemoclaw-contributor-implement-issue/SKILL.md:139: selected only by the second-opinion lane as established.

Second-opinion terminology and E2E selections are advisory. Live E2E does not run automatically for pull requests.

3 semantic terminology decisions

Terminology decisions are advisory. They affect the assessment only when a separate finding identifies concrete semantic impact.

  • established — sensitive-workflow state matrix at .agents/skills/_shared/root-cause-and-state-checks.md:22: Retain the established term and its existing matrix meaning.
  • define — operation and failure class at .agents/skills/_shared/root-cause-and-state-checks.md:17: Keep the surrounding definition that requires authors to name the operation and failure class.
  • established — sibling paths at .agents/skills/_shared/root-cause-and-state-checks.md:19: Retain the established term and require the checked sibling paths to be recorded.

E2E guidance

Advisory only. A maintainer can dispatch the default E2E suite against this exact revision.

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.

@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@laitingsheng laitingsheng added the v0.0.106 Release target label Aug 9, 2026
@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@cv cv left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

.agents/skills/nemoclaw-contributor-plan-issue/SKILL.md:143 and .agents/skills/nemoclaw-contributor-implement-issue/SKILL.md:139 require separate results and actions only for applicable phases, while the shared contract requires them for each failure cell. An agent can therefore collapse command failure, transport ambiguity, and verification failure into one phase-level result and omit security or recovery actions. Require a separate result and action for every applicable failure cell in both report templates. Update test/skills-frontmatter.test.ts to assert that exact contract; its current generic separate result and action assertion does not prevent this regression.

@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: 1

🤖 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 `@test/skills-frontmatter.test.ts`:
- Line 143: Expand the assertion in the checks test to reject all prohibited
command forms, including npm test, pnpm test, and npx vitest, alongside the
existing npm run, src/test paths, and workflow references. Keep the no-inventory
guard case-insensitive and anchored to command boundaries so unrelated text is
not rejected.
🪄 Autofix

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: d6ee3624-13ca-48cd-abff-2db5c7e4530e

📥 Commits

Reviewing files that changed from the base of the PR and between 7d1c24e and 14cb50e.

📒 Files selected for processing (6)
  • .agents/skills/_shared/pr-follow-up.md
  • .agents/skills/_shared/root-cause-and-state-checks.md
  • .agents/skills/nemoclaw-contributor-implement-issue/SKILL.md
  • .agents/skills/nemoclaw-contributor-plan-issue/SKILL.md
  • test/maintainer-skills-policy.test.ts
  • test/skills-frontmatter.test.ts
🚧 Files skipped from review as they are similar to previous changes (5)
  • test/maintainer-skills-policy.test.ts
  • .agents/skills/_shared/root-cause-and-state-checks.md
  • .agents/skills/nemoclaw-contributor-implement-issue/SKILL.md
  • .agents/skills/nemoclaw-contributor-plan-issue/SKILL.md
  • .agents/skills/_shared/pr-follow-up.md

expect(checks).toContain("Assume a possible write and re-read external state");
expect(checks).toContain("owns the authentication and authorization category");
expect(checks).toContain("security-rubric.md");
expect(checks).not.toMatch(/\bsrc\/|\btest\/|npm run|\.github\/workflows/u);

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.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Expand the no-inventory guard for all command forms.

Line 143 rejects npm run only. Content such as npm test, pnpm test, or npx vitest passes this test even though the PR objective prohibits current commands in shared guidance. Add checks for the command forms that the shared document must exclude.

🤖 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/skills-frontmatter.test.ts` at line 143, Expand the assertion in the
checks test to reject all prohibited command forms, including npm test, pnpm
test, and npx vitest, alongside the existing npm run, src/test paths, and
workflow references. Keep the no-inventory guard case-insensitive and anchored
to command boundaries so unrelated text is not rejected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: skills Skills, agent behaviors, prompts, or skill packaging bug-fix PR fixes a bug or regression v0.0.106 Release target

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move PR review completeness checks into planning and implementation

2 participants