From 9168bb829457480135a5ce905b6d50de1722a2fa Mon Sep 17 00:00:00 2001 From: Tinson Lai Date: Fri, 7 Aug 2026 16:08:43 +0000 Subject: [PATCH 1/7] fix(skills): run root-cause and sensitive-state checks before a PR opens Signed-off-by: Tinson Lai --- .agents/skills/_shared/pr-follow-up.md | 15 +------ .../_shared/root-cause-and-state-checks.md | 38 ++++++++++++++++++ .../SKILL.md | 18 +++++++-- .../nemoclaw-contributor-plan-issue/SKILL.md | 10 +++-- test/maintainer-skills-policy.test.ts | 5 +-- test/skills-frontmatter.test.ts | 40 +++++++++++++++++++ 6 files changed, 102 insertions(+), 24 deletions(-) create mode 100644 .agents/skills/_shared/root-cause-and-state-checks.md diff --git a/.agents/skills/_shared/pr-follow-up.md b/.agents/skills/_shared/pr-follow-up.md index 5a544258131..37b6db75e8b 100644 --- a/.agents/skills/_shared/pr-follow-up.md +++ b/.agents/skills/_shared/pr-follow-up.md @@ -90,24 +90,11 @@ Before editing, collect and classify all review signals in the latest completed 1. Re-read `headRefOid`. Collect current required-check failures, issue comments, submitted reviews, inline threads with resolution state, advisor findings, and required independent-review findings. Record each source commit when GitHub provides it; otherwise record the collected head SHA. 2. Re-evaluate findings created for an older head against the current head. Exclude a finding only when the changed code is gone or evidence shows that the defect is resolved. Record the disposition before editing. 3. Group findings by root cause. Name the behavior contract and acceptance evidence for each group. -4. Inspect adjacent paths that implement the same operation or failure class. Record which sibling paths were checked. +4. Apply the shared [Root Cause and Sensitive State Checks](root-cause-and-state-checks.md) to the change set that the valid groups imply. Record the sibling paths checked and the sensitive-workflow state outcomes. 5. Decide which groups are valid, false positives, design-changing, or blocked before changing files. Do not create a separate commit or push for each finding. Apply all findings in the same root-cause group as one coherent change set. Classify every finding in the latest completed head-stable collection before beginning that change set. If the user tells you to stop, remove retained collection evidence by its exact artifact path or identifier and verify its absence. If the host retained no artifact, record `retained evidence: none`. Then stop without further edits, commits, or pushes. The user may explicitly defer a non-blocking suggestion or allow work to proceed without an optional pending review. Record that decision before editing. Do not proceed without a required review. Deferral does not authorize a push with an unresolved blocking, correctness, security, data safety, supported-contract, required-review, or required-check finding. -### Sensitive-Workflow State Matrix - -Create a sensitive-workflow state matrix before editing a flow that handles credentials, remote execution, billable resources, destructive cleanup, security policy, or public writes. Use only the rows and columns required to cover the changed contract. Classify these outcomes when they apply: - -| Phase | Success | Command Failure | Transport Ambiguity | Verification Failure | -|---|---|---|---|---| -| Input or credential acquisition | Result and custody | Removal or rollback | Assume possible remote effect | Rejected input | -| Execution | Expected state | Failure classification | Confirmation requirement | Acceptance criteria not met | -| Cleanup | Confirmed removal | Recovery action | Ownership and absence check | Retention and rotation | -| External write | Accepted write set | Partial-write report | Assume a possible write and re-read external state | Report a partial or inconclusive result | - -For each credential, name its location, access, lifetime, and removal. For each failure cell, record the result and required action separately. Classify the result as an infrastructure failure or inconclusive verification when applicable. Classify the action as rollback, retry, or stop. Ask the user before choosing a behavior that changes security, data safety, cost, or a supported contract. - ## Handle results - Follow the shared [Documentation Writing and Review](documentation-writing-review.md) contract diff --git a/.agents/skills/_shared/root-cause-and-state-checks.md b/.agents/skills/_shared/root-cause-and-state-checks.md new file mode 100644 index 00000000000..fec6c39e9d5 --- /dev/null +++ b/.agents/skills/_shared/root-cause-and-state-checks.md @@ -0,0 +1,38 @@ + + + +# Root Cause and Sensitive State Checks + +Apply these checks while planning, implementing, and reviewing a change. Record the results in the +output that the current workflow already owns; do not produce a separate report. State why a check +does not apply when the omission could hide risk. + +## Authority + +Current code, tests, workflows, and active `AGENTS.md` files own implementation details. Derive the +operations, sibling paths, and states from the current checkout rather than recording them here. + +## Root-Cause Sibling Paths + +Name the operation and failure class that the change belongs to. +Inspect adjacent paths that implement the same operation or failure class. +Record which sibling paths were checked and whether each one needs the same change. +A change that repairs one path and leaves a sibling path unchanged keeps the same defect reachable. + +## Sensitive-Workflow State Matrix + +Model the sensitive-workflow state for a flow that handles credentials, remote execution, billable +resources, destructive cleanup, security policy, or public writes. Use only the rows and columns +required to cover the changed contract. Classify these outcomes when they apply: + +| Phase | Success | Command Failure | Transport Ambiguity | Verification Failure | +|---|---|---|---|---| +| Input or credential acquisition | Result and custody | Removal or rollback | Assume possible remote effect | Rejected input | +| Execution | Expected state | Failure classification | Confirmation requirement | Acceptance criteria not met | +| Cleanup | Confirmed removal | Recovery action | Ownership and absence check | Retention and rotation | +| External write | Accepted write set | Partial-write report | Assume a possible write and re-read external state | Report a partial or inconclusive result | + +For each credential, name its location, access, lifetime, and removal. For each failure cell, record +the result and required action separately. Classify the result as an infrastructure failure or +inconclusive verification when applicable. Classify the action as rollback, retry, or stop. Ask the +user before choosing a behavior that changes security, data safety, cost, or a supported contract. diff --git a/.agents/skills/nemoclaw-contributor-implement-issue/SKILL.md b/.agents/skills/nemoclaw-contributor-implement-issue/SKILL.md index 4fa8a986841..fa060269c97 100644 --- a/.agents/skills/nemoclaw-contributor-implement-issue/SKILL.md +++ b/.agents/skills/nemoclaw-contributor-implement-issue/SKILL.md @@ -60,6 +60,7 @@ Stop and request user remediation for any Git or GitHub access error. Do not att remote, protocol, or permission bypass. Then follow [Discover the Current Implementation](../_shared/implementation-discovery.md). Apply the shared [Code Change Considerations](../_shared/code-change-considerations.md), +[Root Cause and Sensitive State Checks](../_shared/root-cause-and-state-checks.md), [Security Rubric](../_shared/security-rubric.md), and [Documentation Writing and Review](../_shared/documentation-writing-review.md) contract. @@ -76,8 +77,10 @@ review, or maintainer workflows to replace routine implementation work. ## Implement and validate the slice Before editing, map each success criterion and applicable security control to its shortest stable -evidence. Then make the direct change in the current behavior owner. Do not add speculative -abstractions, configuration, compatibility, migration, or fallback behavior. +evidence. Record the sibling paths checked for the same operation or failure class and the +sensitive-workflow state outcomes the change must hold. Then make the direct change in the current +behavior owner. Do not add speculative abstractions, configuration, compatibility, migration, or +fallback behavior. Add focused evidence as applicable: @@ -102,8 +105,10 @@ security control and focused negative evidence that proves forbidden behavior re security control changed, state why and cite the reviewed trust boundaries. Confirm that allowed, denied, error, and boundary behavior remains coherent across failure, retry, -cleanup, cached, resumed, and compatibility paths that apply. Separate completed local evidence from -CI, live E2E, hardware, publication, and other external gates. +cleanup, cached, resumed, and compatibility paths that apply. Re-check the recorded sibling paths and +sensitive-workflow state outcomes against the completed diff, and report a sibling path that still +needs the same change. Separate completed local evidence from CI, live E2E, hardware, publication, +and other external gates. ## Report the implementation handoff @@ -127,6 +132,11 @@ Use this structure: - Error or recovery: - Boundary or ambiguous state: +## Root cause and sensitive state +- Operation and failure class: +- Sibling paths checked: +- Sensitive-workflow states: + ## Security considerations - Applicable categories and trust boundaries: - Controls changed: diff --git a/.agents/skills/nemoclaw-contributor-plan-issue/SKILL.md b/.agents/skills/nemoclaw-contributor-plan-issue/SKILL.md index 40787ed6911..635e903914d 100644 --- a/.agents/skills/nemoclaw-contributor-plan-issue/SKILL.md +++ b/.agents/skills/nemoclaw-contributor-plan-issue/SKILL.md @@ -47,7 +47,7 @@ related work. Do not assign an owner through GitHub unless the user authorizes t ## Discover the current implementation -Before running any `git` or `gh` discovery command, follow [Stop for Git and GitHub Access Errors](../_shared/git-github-hard-stop.md). Then follow [Discover the Current Implementation](../_shared/implementation-discovery.md). Apply the shared [Code Change Considerations](../_shared/code-change-considerations.md) and [Security Rubric](../_shared/security-rubric.md) at the planning stage. +Before running any `git` or `gh` discovery command, follow [Stop for Git and GitHub Access Errors](../_shared/git-github-hard-stop.md). Then follow [Discover the Current Implementation](../_shared/implementation-discovery.md). Apply the shared [Code Change Considerations](../_shared/code-change-considerations.md), [Root Cause and Sensitive State Checks](../_shared/root-cause-and-state-checks.md), and [Security Rubric](../_shared/security-rubric.md) at the planning stage. Read before proposing work: @@ -57,8 +57,10 @@ Read before proposing work: - documentation only to locate claims and rationale, not as behavior authority. Identify the existing structure to extend. Report duplicate ownership, conflicting work, delivery -order constraints, unresolved decisions, and trust boundaries. Stop discovery when the smallest -coherent delivery plan is supported by current evidence. +order constraints, unresolved decisions, and trust boundaries. Name the operation and failure class +that the work belongs to, record the sibling paths checked, and record the sensitive-workflow state +outcomes the plan must hold. Stop discovery when the smallest coherent delivery plan is supported by +current evidence. ## Define observable acceptance @@ -125,6 +127,8 @@ Use this structure: ## Current state and decisions - Existing structure to extend: - Unresolved product decisions: +- Operation and failure class: +- Sensitive-workflow states: - Security boundaries: ## Observable acceptance examples diff --git a/test/maintainer-skills-policy.test.ts b/test/maintainer-skills-policy.test.ts index f0ab0c92929..e17d9c3fd6a 100644 --- a/test/maintainer-skills-policy.test.ts +++ b/test/maintainer-skills-policy.test.ts @@ -652,14 +652,13 @@ describe("maintainer skills follow canonical workflow policy", () => { expect(followUp).toContain("Collect One Complete Review Cycle"); expect(followUp).toContain("Group findings by root cause"); expect(followUp).toContain("Do not create a separate commit or push for each finding"); - expect(followUp).toContain("Sensitive-Workflow State Matrix"); - expect(followUp).toContain("location, access, lifetime, and removal"); + expect(followUp).toContain("root-cause-and-state-checks.md"); + expect(followUp).toContain("Record the sibling paths checked"); expect(followUp).toContain("Bind every read to `NVIDIA/NemoClaw`"); expect(followUp).toContain("Record each page count and terminal pagination signal"); expect(followUp).toContain("including pending, cancelled, and skipped results"); expect(followUp).toContain("retained evidence: none"); - expect(followUp).toContain("Assume a possible write and re-read external state"); expect(followUp).toContain("stop without further edits, commits, or pushes"); expect(createPr).toContain("Apply one coherent change set"); }); diff --git a/test/skills-frontmatter.test.ts b/test/skills-frontmatter.test.ts index 1b3226f77de..f03342a7490 100644 --- a/test/skills-frontmatter.test.ts +++ b/test/skills-frontmatter.test.ts @@ -113,6 +113,35 @@ describe("repo skill markdown files", () => { expect(discovery).not.toContain("Follow imports and call sites"); }); + it("keeps root cause and sensitive state checks in one stage-neutral owner", () => { + const checks = fs.readFileSync( + path.join(skillsRoot, "_shared", "root-cause-and-state-checks.md"), + "utf8", + ); + const consumers = [ + path.join(skillsRoot, "_shared", "pr-follow-up.md"), + path.join(skillsRoot, "nemoclaw-contributor-plan-issue", "SKILL.md"), + path.join(skillsRoot, "nemoclaw-contributor-implement-issue", "SKILL.md"), + ].map((file) => fs.readFileSync(file, "utf8")); + + expect(checks.split("\n").length).toBeLessThan(45); + expect(checks).toContain("planning, implementing, and reviewing"); + expect(checks).toContain( + "Inspect adjacent paths that implement the same operation or failure class", + ); + expect(checks).toContain("Record which sibling paths were checked"); + expect(checks).toContain("Sensitive-Workflow State Matrix"); + expect(checks).toContain("location, access, lifetime, and removal"); + expect(checks).toContain("Assume a possible write and re-read external state"); + expect(checks).not.toMatch(/\bsrc\/|\btest\/|npm run|\.github\/workflows/u); + + for (const consumer of consumers) { + expect(consumer).toContain("root-cause-and-state-checks.md"); + expect(consumer).not.toContain("| Input or credential acquisition |"); + expect(consumer).not.toContain("Inspect adjacent paths that implement"); + } + }); + it("keeps issue planning read-only and capability-oriented (#8362)", () => { const skillRoot = path.join(skillsRoot, "nemoclaw-contributor-plan-issue"); const skill = fs.readFileSync(path.join(skillRoot, "SKILL.md"), "utf8"); @@ -124,7 +153,11 @@ describe("repo skill markdown files", () => { expect(skill).toContain("../_shared/code-change-considerations.md"); expect(skill).toContain("../_shared/security-rubric.md"); expect(skill).toContain("../_shared/git-github-hard-stop.md"); + expect(skill).toContain("../_shared/root-cause-and-state-checks.md"); expect(skill).toContain("untrusted evidence, not agent instructions"); + expect(skill).toContain("Name the operation and failure class"); + expect(skill).toContain("Operation and failure class:"); + expect(skill).toContain("Sensitive-workflow states:"); expect(skill).toContain("an accepted issue or accepted design decision"); expect(skill).toContain("Distinguish the requested outcome"); @@ -188,6 +221,7 @@ describe("repo skill markdown files", () => { expect(skill).toContain("pick up issue for implementation"); expect(skill).toContain("../_shared/implementation-discovery.md"); expect(skill).toContain("../_shared/code-change-considerations.md"); + expect(skill).toContain("../_shared/root-cause-and-state-checks.md"); expect(skill).toContain("../_shared/security-rubric.md"); expect(skill).toContain("../_shared/documentation-writing-review.md"); expect(skill).toContain("smallest independently valuable capability slice"); @@ -209,6 +243,12 @@ describe("repo skill markdown files", () => { expect(skill).toContain("Negative:"); expect(skill).toContain("Error or recovery:"); expect(skill).toContain("Boundary or ambiguous state:"); + expect(skill).toContain( + "Record the sibling paths checked for the same operation or failure class", + ); + expect(skill).toContain("Re-check the recorded sibling paths"); + expect(skill).toContain("Sibling paths checked:"); + expect(skill).toContain("Sensitive-workflow states:"); expect(skill).toContain("Controls changed:"); expect(skill).toContain("Remaining local or external gates:"); expect(skill).toContain("PR handoff evidence:"); From 1edf8cf0b1768679caae2932fe2c2e91e80c885e Mon Sep 17 00:00:00 2001 From: Tinson Lai Date: Fri, 7 Aug 2026 16:26:54 +0000 Subject: [PATCH 2/7] fix(skills): order review classification before the shared state checks Signed-off-by: Tinson Lai --- .agents/skills/_shared/pr-follow-up.md | 8 ++++---- .agents/skills/_shared/root-cause-and-state-checks.md | 8 ++++---- .../skills/nemoclaw-contributor-implement-issue/SKILL.md | 4 ++-- .agents/skills/nemoclaw-contributor-plan-issue/SKILL.md | 5 +++-- test/skills-frontmatter.test.ts | 3 ++- 5 files changed, 15 insertions(+), 13 deletions(-) diff --git a/.agents/skills/_shared/pr-follow-up.md b/.agents/skills/_shared/pr-follow-up.md index 37b6db75e8b..35b1798cde5 100644 --- a/.agents/skills/_shared/pr-follow-up.md +++ b/.agents/skills/_shared/pr-follow-up.md @@ -90,8 +90,8 @@ Before editing, collect and classify all review signals in the latest completed 1. Re-read `headRefOid`. Collect current required-check failures, issue comments, submitted reviews, inline threads with resolution state, advisor findings, and required independent-review findings. Record each source commit when GitHub provides it; otherwise record the collected head SHA. 2. Re-evaluate findings created for an older head against the current head. Exclude a finding only when the changed code is gone or evidence shows that the defect is resolved. Record the disposition before editing. 3. Group findings by root cause. Name the behavior contract and acceptance evidence for each group. -4. Apply the shared [Root Cause and Sensitive State Checks](root-cause-and-state-checks.md) to the change set that the valid groups imply. Record the sibling paths checked and the sensitive-workflow state outcomes. -5. Decide which groups are valid, false positives, design-changing, or blocked before changing files. +4. Decide which groups are valid, false positives, design-changing, or blocked before changing files. +5. Apply the shared [Root-Cause and Sensitive-Workflow State Checks](root-cause-and-state-checks.md) to the change set that the valid groups imply. Record the sibling paths checked and the sensitive-workflow state outcomes. Do not create a separate commit or push for each finding. Apply all findings in the same root-cause group as one coherent change set. Classify every finding in the latest completed head-stable collection before beginning that change set. If the user tells you to stop, remove retained collection evidence by its exact artifact path or identifier and verify its absence. If the host retained no artifact, record `retained evidence: none`. Then stop without further edits, commits, or pushes. The user may explicitly defer a non-blocking suggestion or allow work to proceed without an optional pending review. Record that decision before editing. Do not proceed without a required review. Deferral does not authorize a push with an unresolved blocking, correctness, security, data safety, supported-contract, required-review, or required-check finding. @@ -109,8 +109,8 @@ Do not create a separate commit or push for each finding. Apply all findings in - A supported contract. - Unnecessary complexity in changed code. - Ambiguity in changed text that can change behavior, security, data safety, test meaning, or release meaning. -- **CI failure:** Add the failure to the current review cycle. Inspect other checks and paths with the same root cause. Apply the complete fix group, then run the related local checks. -- **Valid CodeRabbit or PR Review Advisor finding:** Add the finding to its root-cause group. Inspect adjacent correctness, security, and test paths before editing. Apply the group as one change set. +- **CI failure:** Add the failure to the current review cycle. Apply the shared root-cause and sensitive-workflow state checks to the failing paths. Apply the complete fix group, then run the related local checks. +- **Valid CodeRabbit or PR Review Advisor finding:** Add the finding to its root-cause group. Apply the shared root-cause and sensitive-workflow state checks before editing. Apply the group as one change set. - **Style comment or false positive:** Avoid unnecessary changes. Explain your decision in the final report. Comment on the PR when reviewers need the explanation. - **Ambiguous, risky, broad, or design-changing feedback:** Stop and ask the user before you change code. diff --git a/.agents/skills/_shared/root-cause-and-state-checks.md b/.agents/skills/_shared/root-cause-and-state-checks.md index fec6c39e9d5..52e052be8c1 100644 --- a/.agents/skills/_shared/root-cause-and-state-checks.md +++ b/.agents/skills/_shared/root-cause-and-state-checks.md @@ -1,7 +1,7 @@ -# Root Cause and Sensitive State Checks +# Root-Cause and Sensitive-Workflow State Checks Apply these checks while planning, implementing, and reviewing a change. Record the results in the output that the current workflow already owns; do not produce a separate report. State why a check @@ -21,9 +21,9 @@ A change that repairs one path and leaves a sibling path unchanged keeps the sam ## Sensitive-Workflow State Matrix -Model the sensitive-workflow state for a flow that handles credentials, remote execution, billable -resources, destructive cleanup, security policy, or public writes. Use only the rows and columns -required to cover the changed contract. Classify these outcomes when they apply: +Build a sensitive-workflow state matrix for a flow that handles credentials, remote execution, +billable resources, destructive cleanup, security policy, or public writes. Use only the rows and +columns required to cover the changed contract. Classify these outcomes when they apply: | Phase | Success | Command Failure | Transport Ambiguity | Verification Failure | |---|---|---|---|---| diff --git a/.agents/skills/nemoclaw-contributor-implement-issue/SKILL.md b/.agents/skills/nemoclaw-contributor-implement-issue/SKILL.md index fa060269c97..e1eebd64e9b 100644 --- a/.agents/skills/nemoclaw-contributor-implement-issue/SKILL.md +++ b/.agents/skills/nemoclaw-contributor-implement-issue/SKILL.md @@ -60,7 +60,7 @@ Stop and request user remediation for any Git or GitHub access error. Do not att remote, protocol, or permission bypass. Then follow [Discover the Current Implementation](../_shared/implementation-discovery.md). Apply the shared [Code Change Considerations](../_shared/code-change-considerations.md), -[Root Cause and Sensitive State Checks](../_shared/root-cause-and-state-checks.md), +[Root-Cause and Sensitive-Workflow State Checks](../_shared/root-cause-and-state-checks.md), [Security Rubric](../_shared/security-rubric.md), and [Documentation Writing and Review](../_shared/documentation-writing-review.md) contract. @@ -132,7 +132,7 @@ Use this structure: - Error or recovery: - Boundary or ambiguous state: -## Root cause and sensitive state +## Root cause and sensitive-workflow state - Operation and failure class: - Sibling paths checked: - Sensitive-workflow states: diff --git a/.agents/skills/nemoclaw-contributor-plan-issue/SKILL.md b/.agents/skills/nemoclaw-contributor-plan-issue/SKILL.md index 635e903914d..8dc47ca214d 100644 --- a/.agents/skills/nemoclaw-contributor-plan-issue/SKILL.md +++ b/.agents/skills/nemoclaw-contributor-plan-issue/SKILL.md @@ -47,7 +47,7 @@ related work. Do not assign an owner through GitHub unless the user authorizes t ## Discover the current implementation -Before running any `git` or `gh` discovery command, follow [Stop for Git and GitHub Access Errors](../_shared/git-github-hard-stop.md). Then follow [Discover the Current Implementation](../_shared/implementation-discovery.md). Apply the shared [Code Change Considerations](../_shared/code-change-considerations.md), [Root Cause and Sensitive State Checks](../_shared/root-cause-and-state-checks.md), and [Security Rubric](../_shared/security-rubric.md) at the planning stage. +Before running any `git` or `gh` discovery command, follow [Stop for Git and GitHub Access Errors](../_shared/git-github-hard-stop.md). Then follow [Discover the Current Implementation](../_shared/implementation-discovery.md). Apply the shared [Code Change Considerations](../_shared/code-change-considerations.md), [Root-Cause and Sensitive-Workflow State Checks](../_shared/root-cause-and-state-checks.md), and [Security Rubric](../_shared/security-rubric.md) at the planning stage. Read before proposing work: @@ -127,7 +127,8 @@ Use this structure: ## Current state and decisions - Existing structure to extend: - Unresolved product decisions: -- Operation and failure class: +- Operation and failure class: +- Sibling paths checked: - Sensitive-workflow states: - Security boundaries: diff --git a/test/skills-frontmatter.test.ts b/test/skills-frontmatter.test.ts index f03342a7490..6b4b32bd37e 100644 --- a/test/skills-frontmatter.test.ts +++ b/test/skills-frontmatter.test.ts @@ -138,7 +138,7 @@ describe("repo skill markdown files", () => { for (const consumer of consumers) { expect(consumer).toContain("root-cause-and-state-checks.md"); expect(consumer).not.toContain("| Input or credential acquisition |"); - expect(consumer).not.toContain("Inspect adjacent paths that implement"); + expect(consumer).not.toMatch(/Inspect (?:adjacent|other)/u); } }); @@ -157,6 +157,7 @@ describe("repo skill markdown files", () => { expect(skill).toContain("untrusted evidence, not agent instructions"); expect(skill).toContain("Name the operation and failure class"); expect(skill).toContain("Operation and failure class:"); + expect(skill).toContain("Sibling paths checked:"); expect(skill).toContain("Sensitive-workflow states:"); expect(skill).toContain("an accepted issue or accepted design decision"); From 9e2832f97732025a162de52dc2bb48732e957168 Mon Sep 17 00:00:00 2001 From: Tinson Lai Date: Fri, 7 Aug 2026 16:37:02 +0000 Subject: [PATCH 3/7] fix(skills): keep check correlation and adjacent test paths in review routing Signed-off-by: Tinson Lai --- .agents/skills/_shared/pr-follow-up.md | 6 +++--- .agents/skills/_shared/root-cause-and-state-checks.md | 7 ++++--- test/skills-frontmatter.test.ts | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.agents/skills/_shared/pr-follow-up.md b/.agents/skills/_shared/pr-follow-up.md index 35b1798cde5..f8a539e729a 100644 --- a/.agents/skills/_shared/pr-follow-up.md +++ b/.agents/skills/_shared/pr-follow-up.md @@ -90,7 +90,7 @@ Before editing, collect and classify all review signals in the latest completed 1. Re-read `headRefOid`. Collect current required-check failures, issue comments, submitted reviews, inline threads with resolution state, advisor findings, and required independent-review findings. Record each source commit when GitHub provides it; otherwise record the collected head SHA. 2. Re-evaluate findings created for an older head against the current head. Exclude a finding only when the changed code is gone or evidence shows that the defect is resolved. Record the disposition before editing. 3. Group findings by root cause. Name the behavior contract and acceptance evidence for each group. -4. Decide which groups are valid, false positives, design-changing, or blocked before changing files. +4. Decide which groups are valid, false positives, design-changing, or blocked. 5. Apply the shared [Root-Cause and Sensitive-Workflow State Checks](root-cause-and-state-checks.md) to the change set that the valid groups imply. Record the sibling paths checked and the sensitive-workflow state outcomes. Do not create a separate commit or push for each finding. Apply all findings in the same root-cause group as one coherent change set. Classify every finding in the latest completed head-stable collection before beginning that change set. If the user tells you to stop, remove retained collection evidence by its exact artifact path or identifier and verify its absence. If the host retained no artifact, record `retained evidence: none`. Then stop without further edits, commits, or pushes. The user may explicitly defer a non-blocking suggestion or allow work to proceed without an optional pending review. Record that decision before editing. Do not proceed without a required review. Deferral does not authorize a push with an unresolved blocking, correctness, security, data safety, supported-contract, required-review, or required-check finding. @@ -109,8 +109,8 @@ Do not create a separate commit or push for each finding. Apply all findings in - A supported contract. - Unnecessary complexity in changed code. - Ambiguity in changed text that can change behavior, security, data safety, test meaning, or release meaning. -- **CI failure:** Add the failure to the current review cycle. Apply the shared root-cause and sensitive-workflow state checks to the failing paths. Apply the complete fix group, then run the related local checks. -- **Valid CodeRabbit or PR Review Advisor finding:** Add the finding to its root-cause group. Apply the shared root-cause and sensitive-workflow state checks before editing. Apply the group as one change set. +- **CI failure:** Add the failure to the current review cycle. Apply the shared [Root-Cause and Sensitive-Workflow State Checks](root-cause-and-state-checks.md), starting from the failing paths. Correlate the same root cause across the other required checks, including pending, cancelled, and skipped results. Apply the complete fix group, then run the related local checks. +- **Valid CodeRabbit or PR Review Advisor finding:** Add the finding to its root-cause group. Apply the shared [Root-Cause and Sensitive-Workflow State Checks](root-cause-and-state-checks.md) before editing, including the correctness, security, and test paths adjacent to the finding. Apply the group as one change set. - **Style comment or false positive:** Avoid unnecessary changes. Explain your decision in the final report. Comment on the PR when reviewers need the explanation. - **Ambiguous, risky, broad, or design-changing feedback:** Stop and ask the user before you change code. diff --git a/.agents/skills/_shared/root-cause-and-state-checks.md b/.agents/skills/_shared/root-cause-and-state-checks.md index 52e052be8c1..430ee1acaf5 100644 --- a/.agents/skills/_shared/root-cause-and-state-checks.md +++ b/.agents/skills/_shared/root-cause-and-state-checks.md @@ -21,9 +21,10 @@ A change that repairs one path and leaves a sibling path unchanged keeps the sam ## Sensitive-Workflow State Matrix -Build a sensitive-workflow state matrix for a flow that handles credentials, remote execution, -billable resources, destructive cleanup, security policy, or public writes. Use only the rows and -columns required to cover the changed contract. Classify these outcomes when they apply: +Build a sensitive-workflow state matrix as working analysis for a flow that handles credentials, +remote execution, billable resources, destructive cleanup, security policy, or public writes. Use +only the rows and columns required to cover the changed contract. Classify these outcomes when they +apply: | Phase | Success | Command Failure | Transport Ambiguity | Verification Failure | |---|---|---|---|---| diff --git a/test/skills-frontmatter.test.ts b/test/skills-frontmatter.test.ts index 6b4b32bd37e..827d0f240b0 100644 --- a/test/skills-frontmatter.test.ts +++ b/test/skills-frontmatter.test.ts @@ -113,7 +113,7 @@ describe("repo skill markdown files", () => { expect(discovery).not.toContain("Follow imports and call sites"); }); - it("keeps root cause and sensitive state checks in one stage-neutral owner", () => { + it("keeps root-cause and sensitive-workflow state checks in one stage-neutral owner", () => { const checks = fs.readFileSync( path.join(skillsRoot, "_shared", "root-cause-and-state-checks.md"), "utf8", From 373e07324e5a7e6601d8df366bc61b8d360912ef Mon Sep 17 00:00:00 2001 From: Tinson Lai Date: Fri, 7 Aug 2026 16:45:43 +0000 Subject: [PATCH 4/7] fix(skills): anchor the check-collection assertion to its own requirement Signed-off-by: Tinson Lai --- .agents/skills/_shared/pr-follow-up.md | 2 +- test/maintainer-skills-policy.test.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.agents/skills/_shared/pr-follow-up.md b/.agents/skills/_shared/pr-follow-up.md index f8a539e729a..2b097772c6f 100644 --- a/.agents/skills/_shared/pr-follow-up.md +++ b/.agents/skills/_shared/pr-follow-up.md @@ -91,7 +91,7 @@ Before editing, collect and classify all review signals in the latest completed 2. Re-evaluate findings created for an older head against the current head. Exclude a finding only when the changed code is gone or evidence shows that the defect is resolved. Record the disposition before editing. 3. Group findings by root cause. Name the behavior contract and acceptance evidence for each group. 4. Decide which groups are valid, false positives, design-changing, or blocked. -5. Apply the shared [Root-Cause and Sensitive-Workflow State Checks](root-cause-and-state-checks.md) to the change set that the valid groups imply. Record the sibling paths checked and the sensitive-workflow state outcomes. +5. Apply the shared [Root-Cause and Sensitive-Workflow State Checks](root-cause-and-state-checks.md), starting from the change set that the valid groups imply. Record the sibling paths checked and the sensitive-workflow state outcomes. Do not create a separate commit or push for each finding. Apply all findings in the same root-cause group as one coherent change set. Classify every finding in the latest completed head-stable collection before beginning that change set. If the user tells you to stop, remove retained collection evidence by its exact artifact path or identifier and verify its absence. If the host retained no artifact, record `retained evidence: none`. Then stop without further edits, commits, or pushes. The user may explicitly defer a non-blocking suggestion or allow work to proceed without an optional pending review. Record that decision before editing. Do not proceed without a required review. Deferral does not authorize a push with an unresolved blocking, correctness, security, data safety, supported-contract, required-review, or required-check finding. diff --git a/test/maintainer-skills-policy.test.ts b/test/maintainer-skills-policy.test.ts index e17d9c3fd6a..258f7629d21 100644 --- a/test/maintainer-skills-policy.test.ts +++ b/test/maintainer-skills-policy.test.ts @@ -657,7 +657,9 @@ describe("maintainer skills follow canonical workflow policy", () => { expect(followUp).toContain("Bind every read to `NVIDIA/NemoClaw`"); expect(followUp).toContain("Record each page count and terminal pagination signal"); - expect(followUp).toContain("including pending, cancelled, and skipped results"); + expect(followUp).toContain( + "every required check, including pending, cancelled, and skipped results", + ); expect(followUp).toContain("retained evidence: none"); expect(followUp).toContain("stop without further edits, commits, or pushes"); expect(createPr).toContain("Apply one coherent change set"); From 756979d5b7ebe00ecd2fe0240b100671350b6a60 Mon Sep 17 00:00:00 2001 From: Tinson Lai Date: Sat, 8 Aug 2026 03:08:09 +0000 Subject: [PATCH 5/7] fix(skills): complete the shared root-cause and state-check contract Signed-off-by: Tinson Lai --- .agents/skills/_shared/pr-follow-up.md | 2 +- .../_shared/root-cause-and-state-checks.md | 3 +++ .../SKILL.md | 19 +++++++------- .../nemoclaw-contributor-plan-issue/SKILL.md | 2 +- test/skills-frontmatter.test.ts | 26 ++++++++++++++----- 5 files changed, 34 insertions(+), 18 deletions(-) diff --git a/.agents/skills/_shared/pr-follow-up.md b/.agents/skills/_shared/pr-follow-up.md index 2b097772c6f..7d6a2278f52 100644 --- a/.agents/skills/_shared/pr-follow-up.md +++ b/.agents/skills/_shared/pr-follow-up.md @@ -91,7 +91,7 @@ Before editing, collect and classify all review signals in the latest completed 2. Re-evaluate findings created for an older head against the current head. Exclude a finding only when the changed code is gone or evidence shows that the defect is resolved. Record the disposition before editing. 3. Group findings by root cause. Name the behavior contract and acceptance evidence for each group. 4. Decide which groups are valid, false positives, design-changing, or blocked. -5. Apply the shared [Root-Cause and Sensitive-Workflow State Checks](root-cause-and-state-checks.md), starting from the change set that the valid groups imply. Record the sibling paths checked and the sensitive-workflow state outcomes. +5. Apply the shared [Root-Cause and Sensitive-Workflow State Checks](root-cause-and-state-checks.md), starting from the change set that the valid groups imply. Record the sibling paths checked, the operation and failure class each group belongs to, and the sensitive-workflow state outcomes. Do not create a separate commit or push for each finding. Apply all findings in the same root-cause group as one coherent change set. Classify every finding in the latest completed head-stable collection before beginning that change set. If the user tells you to stop, remove retained collection evidence by its exact artifact path or identifier and verify its absence. If the host retained no artifact, record `retained evidence: none`. Then stop without further edits, commits, or pushes. The user may explicitly defer a non-blocking suggestion or allow work to proceed without an optional pending review. Record that decision before editing. Do not proceed without a required review. Deferral does not authorize a push with an unresolved blocking, correctness, security, data safety, supported-contract, required-review, or required-check finding. diff --git a/.agents/skills/_shared/root-cause-and-state-checks.md b/.agents/skills/_shared/root-cause-and-state-checks.md index 430ee1acaf5..761fc1d8d64 100644 --- a/.agents/skills/_shared/root-cause-and-state-checks.md +++ b/.agents/skills/_shared/root-cause-and-state-checks.md @@ -37,3 +37,6 @@ For each credential, name its location, access, lifetime, and removal. For each the result and required action separately. Classify the result as an infrastructure failure or inconclusive verification when applicable. Classify the action as rollback, retry, or stop. Ask the user before choosing a behavior that changes security, data safety, cost, or a supported contract. + +The [Security Rubric](security-rubric.md) owns the authorization boundary. For a public or external +write, record its evidence that authorization is enforced for the exact resource and action. diff --git a/.agents/skills/nemoclaw-contributor-implement-issue/SKILL.md b/.agents/skills/nemoclaw-contributor-implement-issue/SKILL.md index e1eebd64e9b..75b13cbeb0c 100644 --- a/.agents/skills/nemoclaw-contributor-implement-issue/SKILL.md +++ b/.agents/skills/nemoclaw-contributor-implement-issue/SKILL.md @@ -77,10 +77,10 @@ review, or maintainer workflows to replace routine implementation work. ## Implement and validate the slice Before editing, map each success criterion and applicable security control to its shortest stable -evidence. Record the sibling paths checked for the same operation or failure class and the -sensitive-workflow state outcomes the change must hold. Then make the direct change in the current -behavior owner. Do not add speculative abstractions, configuration, compatibility, migration, or -fallback behavior. +evidence. Name the operation and failure class the change belongs to. Record the sibling paths +checked for that operation or failure class and the sensitive-workflow state outcomes the change must +hold. Then make the direct change in the current behavior owner. Do not add speculative abstractions, +configuration, compatibility, migration, or fallback behavior. Add focused evidence as applicable: @@ -105,10 +105,11 @@ security control and focused negative evidence that proves forbidden behavior re security control changed, state why and cite the reviewed trust boundaries. Confirm that allowed, denied, error, and boundary behavior remains coherent across failure, retry, -cleanup, cached, resumed, and compatibility paths that apply. Re-check the recorded sibling paths and -sensitive-workflow state outcomes against the completed diff, and report a sibling path that still -needs the same change. Separate completed local evidence from CI, live E2E, hardware, publication, -and other external gates. +cleanup, cached, resumed, and compatibility paths that apply. +Re-check the recorded operation and failure class, sibling paths, and sensitive-workflow state +outcomes against the completed diff, and report a sibling path that still needs the same change. +Separate completed local evidence from CI, live E2E, hardware, publication, and other external +gates. ## Report the implementation handoff @@ -135,7 +136,7 @@ Use this structure: ## Root cause and sensitive-workflow state - Operation and failure class: - Sibling paths checked: -- Sensitive-workflow states: +- Sensitive-workflow states: ## Security considerations - Applicable categories and trust boundaries: diff --git a/.agents/skills/nemoclaw-contributor-plan-issue/SKILL.md b/.agents/skills/nemoclaw-contributor-plan-issue/SKILL.md index 8dc47ca214d..14763209e51 100644 --- a/.agents/skills/nemoclaw-contributor-plan-issue/SKILL.md +++ b/.agents/skills/nemoclaw-contributor-plan-issue/SKILL.md @@ -129,7 +129,7 @@ Use this structure: - Unresolved product decisions: - Operation and failure class: - Sibling paths checked: -- Sensitive-workflow states: +- Sensitive-workflow states: - Security boundaries: ## Observable acceptance examples diff --git a/test/skills-frontmatter.test.ts b/test/skills-frontmatter.test.ts index 827d0f240b0..2307c6c650c 100644 --- a/test/skills-frontmatter.test.ts +++ b/test/skills-frontmatter.test.ts @@ -118,11 +118,16 @@ describe("repo skill markdown files", () => { path.join(skillsRoot, "_shared", "root-cause-and-state-checks.md"), "utf8", ); - const consumers = [ - path.join(skillsRoot, "_shared", "pr-follow-up.md"), + const followUp = fs.readFileSync(path.join(skillsRoot, "_shared", "pr-follow-up.md"), "utf8"); + const planIssue = fs.readFileSync( path.join(skillsRoot, "nemoclaw-contributor-plan-issue", "SKILL.md"), + "utf8", + ); + const implementIssue = fs.readFileSync( path.join(skillsRoot, "nemoclaw-contributor-implement-issue", "SKILL.md"), - ].map((file) => fs.readFileSync(file, "utf8")); + "utf8", + ); + const consumers = [followUp, planIssue, implementIssue]; expect(checks.split("\n").length).toBeLessThan(45); expect(checks).toContain("planning, implementing, and reviewing"); @@ -133,13 +138,21 @@ describe("repo skill markdown files", () => { expect(checks).toContain("Sensitive-Workflow State Matrix"); expect(checks).toContain("location, access, lifetime, and removal"); expect(checks).toContain("Assume a possible write and re-read external state"); + expect(checks).toContain("owns the authorization boundary"); + expect(checks).toContain("security-rubric.md"); expect(checks).not.toMatch(/\bsrc\/|\btest\/|npm run|\.github\/workflows/u); for (const consumer of consumers) { expect(consumer).toContain("root-cause-and-state-checks.md"); + expect(consumer).toMatch(/operation and failure class/iu); expect(consumer).not.toContain("| Input or credential acquisition |"); expect(consumer).not.toMatch(/Inspect (?:adjacent|other)/u); } + + for (const report of [planIssue, implementIssue]) { + expect(report).toContain("each credential location, access, lifetime, and removal"); + expect(report).toContain("separate result and action"); + } }); it("keeps issue planning read-only and capability-oriented (#8362)", () => { @@ -244,10 +257,9 @@ describe("repo skill markdown files", () => { expect(skill).toContain("Negative:"); expect(skill).toContain("Error or recovery:"); expect(skill).toContain("Boundary or ambiguous state:"); - expect(skill).toContain( - "Record the sibling paths checked for the same operation or failure class", - ); - expect(skill).toContain("Re-check the recorded sibling paths"); + expect(skill).toContain("Name the operation and failure class the change belongs to"); + expect(skill).toContain("Record the sibling paths"); + expect(skill).toContain("Re-check the recorded operation and failure class"); expect(skill).toContain("Sibling paths checked:"); expect(skill).toContain("Sensitive-workflow states:"); expect(skill).toContain("Controls changed:"); From f2fc9074cccaecb83fb5130843c4a3184491e421 Mon Sep 17 00:00:00 2001 From: Tinson Lai Date: Sat, 8 Aug 2026 03:18:49 +0000 Subject: [PATCH 6/7] fix(skills): state the security rubric's authorization ownership exactly Signed-off-by: Tinson Lai --- .agents/skills/_shared/root-cause-and-state-checks.md | 5 +++-- .agents/skills/nemoclaw-contributor-implement-issue/SKILL.md | 2 +- test/skills-frontmatter.test.ts | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.agents/skills/_shared/root-cause-and-state-checks.md b/.agents/skills/_shared/root-cause-and-state-checks.md index 761fc1d8d64..d4ac3b1d911 100644 --- a/.agents/skills/_shared/root-cause-and-state-checks.md +++ b/.agents/skills/_shared/root-cause-and-state-checks.md @@ -38,5 +38,6 @@ the result and required action separately. Classify the result as an infrastruct inconclusive verification when applicable. Classify the action as rollback, retry, or stop. Ask the user before choosing a behavior that changes security, data safety, cost, or a supported contract. -The [Security Rubric](security-rubric.md) owns the authorization boundary. For a public or external -write, record its evidence that authorization is enforced for the exact resource and action. +The [Security Rubric](security-rubric.md) owns the authentication and authorization category and its +evidence expectations. For a public or external write, record the positive and negative evidence that +authorization is enforced for the exact resource and action. diff --git a/.agents/skills/nemoclaw-contributor-implement-issue/SKILL.md b/.agents/skills/nemoclaw-contributor-implement-issue/SKILL.md index 75b13cbeb0c..16880f37edb 100644 --- a/.agents/skills/nemoclaw-contributor-implement-issue/SKILL.md +++ b/.agents/skills/nemoclaw-contributor-implement-issue/SKILL.md @@ -107,7 +107,7 @@ security control changed, state why and cite the reviewed trust boundaries. Confirm that allowed, denied, error, and boundary behavior remains coherent across failure, retry, cleanup, cached, resumed, and compatibility paths that apply. Re-check the recorded operation and failure class, sibling paths, and sensitive-workflow state -outcomes against the completed diff, and report a sibling path that still needs the same change. +outcomes against the completed diff, and report each sibling path that still needs the same change. Separate completed local evidence from CI, live E2E, hardware, publication, and other external gates. diff --git a/test/skills-frontmatter.test.ts b/test/skills-frontmatter.test.ts index 2307c6c650c..22e3f104c49 100644 --- a/test/skills-frontmatter.test.ts +++ b/test/skills-frontmatter.test.ts @@ -138,7 +138,7 @@ describe("repo skill markdown files", () => { expect(checks).toContain("Sensitive-Workflow State Matrix"); expect(checks).toContain("location, access, lifetime, and removal"); expect(checks).toContain("Assume a possible write and re-read external state"); - expect(checks).toContain("owns the authorization boundary"); + 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); From 432c1c47e9d87484f9a2d23d250bdfc362687a23 Mon Sep 17 00:00:00 2001 From: Apurv Kumaria Date: Mon, 10 Aug 2026 16:07:54 -0700 Subject: [PATCH 7/7] fix(skills): preserve per-failure state evidence Signed-off-by: Apurv Kumaria --- .../nemoclaw-contributor-implement-issue/SKILL.md | 2 +- .../skills/nemoclaw-contributor-plan-issue/SKILL.md | 2 +- test/skills-frontmatter.test.ts | 10 +++++++--- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.agents/skills/nemoclaw-contributor-implement-issue/SKILL.md b/.agents/skills/nemoclaw-contributor-implement-issue/SKILL.md index 16880f37edb..fa373abdd95 100644 --- a/.agents/skills/nemoclaw-contributor-implement-issue/SKILL.md +++ b/.agents/skills/nemoclaw-contributor-implement-issue/SKILL.md @@ -136,7 +136,7 @@ Use this structure: ## Root cause and sensitive-workflow state - Operation and failure class: - Sibling paths checked: -- Sensitive-workflow states: +- Sensitive-workflow states: ## Security considerations - Applicable categories and trust boundaries: diff --git a/.agents/skills/nemoclaw-contributor-plan-issue/SKILL.md b/.agents/skills/nemoclaw-contributor-plan-issue/SKILL.md index 6f28009b4cc..3e996812de0 100644 --- a/.agents/skills/nemoclaw-contributor-plan-issue/SKILL.md +++ b/.agents/skills/nemoclaw-contributor-plan-issue/SKILL.md @@ -140,7 +140,7 @@ the planning result reliably: - Unresolved product decisions: - Operation and failure class: - Sibling paths checked: -- Sensitive-workflow states: +- Sensitive-workflow states: - Security boundaries: ## Observable acceptance examples diff --git a/test/skills-frontmatter.test.ts b/test/skills-frontmatter.test.ts index 37b4b352961..ebc4f9d1978 100644 --- a/test/skills-frontmatter.test.ts +++ b/test/skills-frontmatter.test.ts @@ -113,7 +113,7 @@ describe("repo skill markdown files", () => { expect(discovery).not.toContain("Follow imports and call sites"); }); - it("keeps root-cause and sensitive-workflow state checks in one stage-neutral owner", () => { + it("keeps root-cause and sensitive-workflow state checks in one stage-neutral owner (#8555)", () => { const checks = fs.readFileSync( path.join(skillsRoot, "_shared", "root-cause-and-state-checks.md"), "utf8", @@ -140,7 +140,9 @@ describe("repo skill markdown files", () => { 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); + expect(checks).not.toMatch( + /\b(?:npm\s+(?:run|test)|pnpm\s+test|npx\s+vitest)\b|\bsrc\/|\btest\/|\.github\/workflows/iu, + ); for (const consumer of consumers) { expect(consumer).toContain("root-cause-and-state-checks.md"); @@ -151,7 +153,9 @@ describe("repo skill markdown files", () => { for (const report of [planIssue, implementIssue]) { expect(report).toContain("each credential location, access, lifetime, and removal"); - expect(report).toContain("separate result and action"); + expect(report).toContain( + "each applicable failure cell with a separate result and required action", + ); } });