Commit 8b9a28a
authored
test(security): stabilize credential filter coverage (#9279)
<!-- markdownlint-disable MD041 -->
## Summary
Consolidates the two direct credential-filter test owners into one file
and adds a direct fail-closed array-root YAML case so the sharded
coverage aggregate retains enough enforcing-wrapper evidence for its
per-file ratchet. All 47 credential-filter tests remain, and the retired
`credential-sanitization` selector targets the surviving owner.
Current-main CI run `31993820682`, aggregate job `95283713874`, first
exposed the per-file coverage failure after merging all 12 successful
shard artifacts. PR run `31997263660`, aggregate job `95292643956`,
proved that consolidation alone was insufficient. Its immutable
`cli-vitest-results` artifact is `9277434192` with SHA-256
`3f5eb163e00746f102da4dbd589fc94e0ff368146d462ca1498b5581bbe3b272`.
## Changes
- Move every secret-pattern classification and redaction case into
`credential-filter.test.ts` and remove the second direct module owner.
- Add direct coverage that the Hermes YAML sanitizer rejects an array at
the document root.
- Keep the retired `credential-sanitization` E2E selector and its
exact-command fixture bound to the surviving test file.
- Preserve all production code and credential-filter behavior unchanged.
## Type of Change
- [x] 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
- [x] Tests added or updated for changed behavior
- [ ] Existing tests cover changed behavior — justification:
- [ ] Tests not applicable — justification:
- [ ] Docs updated for user-facing behavior changes
- [x] Docs not applicable — justification: This changes test ownership,
direct sanitizer coverage, and an internal retired-selector
compatibility map only; production behavior and supported user surfaces
are unchanged.
- [x] Sensitive paths changed (security, policy, credentials, preflight,
onboarding, inference, runner, sandbox, or messaging)
- [x] Sensitive-path review completed or maintainer-approved waiver
recorded — reviewer/approval link/justification: Independent
nine-category security review passed with no findings for latest PR
commit `bdc34d93e`.
- [ ] Non-success, skipped, or missing CI check accepted by maintainer —
check name, approval link, and follow-up issue:
## Documentation Writer Review
- [x] Documentation writer subagent reviewed the completed changes
- Result: `no-docs-needed`
- Evidence: The PR consolidates credential-filter tests and adds
coverage that the Hermes YAML sanitizer rejects an array at the document
root. It changes no production implementation, public behavior,
configuration, workflow, or supported product surface.
- Agent: Codex Desktop
<!-- docs-review-head-sha: bdc34d9 -->
<!-- docs-review-agents-blob-sha: b9fb6a9 -->
## DGX Station Hardware Evidence
- [ ] Tested on DGX Station
- Tested commit:
- Station profile/scenario:
- Result:
- Supporting evidence:
## Verification
- [x] PR description includes a `Signed-off-by:` line and every commit
appears as `Verified` in GitHub
- [x] 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
- [x] Targeted behavior tests pass for the current change set, or tests
are marked not applicable above — `credential-filter.test.ts`: 47/47;
retired-selector compatibility: 5/5. Isolated credential-filter
coverage: 91% statements, 87.09% branches, 100% functions, 98.79% lines;
the exact ratchet passed.
- [ ] Applicable broad gate passed — Automatic Linux CI is running for
latest PR commit `bdc34d93e`.
- [x] Quality Gates section completed with required justifications or
waivers
- [x] No secrets, API keys, or credentials committed
- [ ] `npm run docs` builds without warnings (doc changes only)
- [ ] Doc pages follow the [style
guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md)
(doc changes only)
- [ ] New doc pages include SPDX header and frontmatter (new pages only)
---
Signed-off-by: Senthil Ravichandran <senthilr@nvidia.com>
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Tests**
* Expanded credential-filtering coverage for authentication headers,
environment variables, channel credentials, command arguments, nested
configurations, and JWTs.
* Added verification that safe values, placeholders, and public keys
remain unchanged.
* Consolidated credential-sanitization tests into a single suite.
* Updated compatibility checks to reference the consolidated test suite.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Signed-off-by: Senthil Ravichandran <senthilr@nvidia.com>1 parent 97761a4 commit 8b9a28a
4 files changed
Lines changed: 310 additions & 302 deletions
File tree
- src/lib/security
- test/e2e/support
- tools/e2e
Lines changed: 0 additions & 299 deletions
This file was deleted.
0 commit comments