Skip to content

Add transcript sanitizer to hash cwd - #29

Merged
minarc merged 1 commit into
mainfrom
dev
Mar 11, 2026
Merged

minarc merged 1 commit into
mainfrom
dev

Conversation

@minarc

@minarc minarc commented Mar 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Add sanitizer.js module that hashes the cwd field in transcript JSONL lines using HMAC-SHA256 (12 chars)
  • Wire sanitizer into transferTranscript() in logger.js so transcripts are sanitized before gzip + POST
  • Falls back to raw read if no hash salt is available

Test plan

  • Verified on real transcripts: 6ms for 500KB, 45ms for 5.8MB
  • No circular dependency (sanitizer has its own hashHmac)
  • Confirmed cwd is hashed to 12-char hex string

🤖 Generated with Claude Code

Summary by CodeRabbit

Release Notes

  • New Features
    • Transcripts now support automatic sanitization with optional hash transformation during transfer and storage.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@minarc
minarc merged commit c9e7b94 into main Mar 11, 2026
1 check was pending
@coderabbitai

coderabbitai Bot commented Mar 11, 2026 •

Copy link
Copy Markdown
Contributor

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 21debe25-0e73-4781-8718-fb104d3ddc29

📥 Commits

Reviewing files that changed from the base of the PR and between a39d7c4 and af73261.

📒 Files selected for processing (2)
  • skillmeter/scripts/logger.js
  • skillmeter/scripts/sanitizer.js

Disabled knowledge base sources:

  • Linear integration is disabled

You can enable these sources in your CodeRabbit configuration.


Walkthrough

Introduces transcript sanitization functionality by creating a new sanitizer utility that hashes the cwd field in JSONL transcript lines, and integrates it into the logger's transferTranscript function to conditionally apply sanitization when a hash salt is available.

Changes

Cohort / File(s) Summary
Transcript Sanitization Utility
skillmeter/scripts/sanitizer.js
New module providing HMAC-SHA256 hashing and JSONL transcript sanitization; exports sanitizeTranscript and sanitizeLine functions that replace cwd fields with hashed values.
Logger Integration
skillmeter/scripts/logger.js
Modified transferTranscript function to import and conditionally apply sanitizeTranscript based on hash salt availability; updates transcript data transformation path before compression and upload.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~23 minutes

Possibly related PRs

  • dev #8 — Modifies hash-salt handling and HMAC computation in logger.js for transcript processing.
  • dev #5 — Implements hash-salt management and HMAC-SHA256 hashing utilities used in transcript sanitization.
  • dev #10 — Adds hook scripts for salt generation/consumption and calls to processTranscript, directly consuming the sanitization logic.

Suggested reviewers

  • jhunlee-dev

Poem

🐰 A rabbit hops through JSONL fields so wide,
With HMAC magic turning paths to hide,
The cwd's replaced by hashes clean,
A sanitized transcript has never been seen! ✨
Salt and streams dance in perfect stride.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dev

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

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant