Repository navigation
Integrate Claude harness metadata sanitization - #79
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
WalkthroughThe PR adds harness metadata detection and sanitization, then threads the sanitized harness payload into ChangesHarness metadata flow
Sequence Diagram(s)sequenceDiagram
participant session_start_js as session_start.js
participant detectHarness
participant sanitizeEventData
participant stderr
session_start_js->>detectHarness: detectHarness(ctx.cwd, options)
detectHarness-->>session_start_js: harness metadata
session_start_js->>sanitizeEventData: sanitizeEventData(harness)
sanitizeEventData-->>session_start_js: sanitized harness + redaction counts
session_start_js->>stderr: write redaction counts when tiers match
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 OpenGrep (1.23.0)OpenGrep fatal error (exit code 2): �[32m✔�[39m �[1mOpengrep OSS�[0m �[1m Loading rules from local config...�[0m Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (1)
skillmeter/test/harness.test.js (1)
31-49: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueConsider tearing down the temp dirs created per test.
tmpDir/makeProject/makeHomecreate directories underos.tmpdir()on nearly every test but nothing removes them, so each run leaks several trees. At.after(...)cleanup (or tracking created roots andfs.rmSync(..., { recursive: true, force: true })) keeps the suite hermetic.🤖 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 `@skillmeter/test/harness.test.js` around lines 31 - 49, The test helpers tmpDir, makeProject, and makeHome create temporary directories under os.tmpdir() without cleanup, causing leaked trees across runs. Add teardown in the harness test file by tracking each created root and removing them with fs.rmSync(..., { recursive: true, force: true }) in a t.after hook (or equivalent per-test cleanup), and make sure any callers that use makeProject/makeHome are covered so the suite stays hermetic.
🤖 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 `@skillmeter/README.md`:
- Line 117: The SessionStart documentation row is out of sync with the payload
emitted by the handler and runHook. Update the SessionStart entry in README to
include the missing `model` and `agent_type` fields alongside `session_id`,
`permission_mode`, `source`, and `harness`, using the same naming as returned by
the SessionStart handler and added in runHook.
In `@skillmeter/scripts/lib/sanitize.js`:
- Around line 65-66: The repeated-character shortcut in sanitize.js is too
permissive because it returns arbitrary placeholders like 11111111 or aaaaaaaa
unchanged. Update the repeated single-character handling near the
trim/sanitization logic so only explicit mask-style placeholders such as xxxxx
or ***** are preserved, and do not treat any repeated character sequence as
safe; use the existing sanitize flow in sanitize() to route non-mask repeats
through masking/redaction instead of returning them verbatim.
- Around line 171-184: Update redactDeep in sanitize.js so object field names
are used as context when redacting nested values: when iterating Object.entries,
detect secret-labeled keys such as api_key, token, password, or similar, and
force Tier 1 redaction on their string values instead of only relying on
redactString scanning the leaf text. Keep the recursive handling for arrays and
objects, but pass the key context through the redactDeep path so
sanitizeEventData catches sensitive values even when the string itself has no
obvious secret pattern.
---
Nitpick comments:
In `@skillmeter/test/harness.test.js`:
- Around line 31-49: The test helpers tmpDir, makeProject, and makeHome create
temporary directories under os.tmpdir() without cleanup, causing leaked trees
across runs. Add teardown in the harness test file by tracking each created root
and removing them with fs.rmSync(..., { recursive: true, force: true }) in a
t.after hook (or equivalent per-test cleanup), and make sure any callers that
use makeProject/makeHome are covered so the suite stays hermetic.
🪄 Autofix (Beta)
✅ Autofix completed
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 4e93542a-5263-40de-bdd8-e98b792b4acc
📒 Files selected for processing (5)
skillmeter/README.mdskillmeter/scripts/harness.jsskillmeter/scripts/lib/sanitize.jsskillmeter/scripts/session_start.jsskillmeter/test/harness.test.js
|
Note Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it. Fixes Applied SuccessfullyFixed 2 file(s) based on 3 unresolved review comments. Files modified:
Commit: The changes have been pushed to the Time taken: |
Fixed 2 file(s) based on 3 unresolved review comments. Co-authored-by: CodeRabbit <noreply@coderabbit.ai>
Summary
Test plan
node --test skillmeter/test/harness.test.jsnode --check skillmeter/scripts/session_start.jsSummary by CodeRabbit
Summary by CodeRabbit
New Features
SessionStartevent payloads, including structured presence/shape details.Bug Fixes
Documentation
Tests