Skip to content

dev - #7

Merged
minarc merged 4 commits into
mainfrom
dev
Mar 3, 2026
Merged

dev#7
minarc merged 4 commits into
mainfrom
dev

Conversation

@minarc

@minarc minarc commented Mar 3, 2026 •

Copy link
Copy Markdown
Contributor
  • ✨(logger): add tool_result to filtered content
  • ✨ implement salted hmac-sha256 hashing
  • ✨(skillmeter): implement keychain license token
  • ✨(skillmeter): add transfer status logging
  • ♻️(skillmeter): improve chat transfer reliability

Summary by CodeRabbit

  • New Features

    • Added enhanced secure storage integration with improved fallback mechanisms for sensitive data.
    • Implemented token-based authentication for improved security.
  • Improvements

    • Upgraded hashing mechanism with salt-based approach for better data privacy.
    • Expanded message content filtering to support additional AI-generated content types.

@minarc
minarc requested a review from jhunlee-dev March 3, 2026 08:27
@minarc
minarc merged commit 176d2cf into main Mar 3, 2026
@coderabbitai

coderabbitai Bot commented Mar 3, 2026 •

Copy link
Copy Markdown
Contributor

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 068dc0d and 7aff525.

📒 Files selected for processing (6)
  • skillmeter/scripts/logger.js
  • skillmeter/scripts/post_tool_use.js
  • skillmeter/scripts/session_end.js
  • skillmeter/scripts/transfer_conversation.js
  • skillmeter/scripts/transfer_event.js
  • skillmeter/scripts/user_prompt_submit.js

Walkthrough

The changes introduce cryptographic and security enhancements to the logging system: HMAC-SHA256 hashing with per-run salt (retrieved from macOS Keychain with local fallback), license token retrieval from Keychain, and integration of these credentials across transcript processing and transfer scripts. The hashing strategy shifts from plain SHA256 to salted HMAC, and message filtering is expanded to retain "tool_result" types.

Changes

Cohort / File(s) Summary
Core Logger Module
skillmeter/scripts/logger.js
Added constants HASH_SALT_SERVICE and LICENSE_SERVICE; introduced functions getOrCreateHashSalt() (Keychain retrieval with local fallback), getFallbackHashSalt(), getLicenseToken(), and hashHmac(str, salt) for HMAC-SHA256 hashing. Renamed hashSha256() to hashForFilename() and updated getOffsetFilePath() to use it. Expanded filterMessageContent() to include "tool_result" type. Updated module exports accordingly.
Transcript Hashing Scripts
skillmeter/scripts/post_tool_use.js, skillmeter/scripts/user_prompt_submit.js
Replaced hashSha256 import with hashHmac and getOrCreateHashSalt. Added salt retrieval prior to hashing file paths and transcripts using hashHmac(path, salt) instead of plain SHA256.
Transfer Authorization Scripts
skillmeter/scripts/transfer_conversation.js, skillmeter/scripts/transfer_event.js
Replaced API_KEY environment variable with license token obtained via getLicenseToken(). Token is included in Authorization header as Bearer <token> when present; header omitted if unavailable.
Session Management
skillmeter/scripts/session_end.js
Added license token retrieval via getLicenseToken() and conditional logging when transfer script exists. Logs "SkillMeter: No chat data to transfer" when conversation data is absent; includes token-dependent messaging when data exists.

Sequence Diagram

sequenceDiagram
    participant Script as Script (post_tool_use/<br/>user_prompt_submit)
    participant Logger as Logger Module
    participant Keychain as Keychain/<br/>Local Storage
    participant Hash as Hash Computation
    
    Script->>Logger: getOrCreateHashSalt()
    Logger->>Keychain: Attempt Keychain retrieval
    alt Keychain Available
        Keychain-->>Logger: Return existing salt
    else Keychain Unavailable
        Logger->>Keychain: Store salt locally
        Keychain-->>Logger: Return new salt
    end
    Logger-->>Script: Return salt
    
    Script->>Hash: hashHmac(file_path, salt)
    Hash-->>Script: Return 12-char HMAC hash
    Script->>Script: Include hash in transcript/logging
Loading
sequenceDiagram
    participant Transfer as Transfer Script
    participant Logger as Logger Module
    participant Keychain as Keychain
    participant API as Transfer Service
    
    Transfer->>Logger: getLicenseToken()
    Logger->>Keychain: Retrieve JWT token
    Keychain-->>Logger: Return token (or null)
    Logger-->>Transfer: Return token
    
    alt Token Available
        Transfer->>API: POST request with<br/>Authorization: Bearer {token}
        API-->>Transfer: Response
    else Token Unavailable
        Transfer->>API: POST request without<br/>Authorization header
        API-->>Transfer: Response (may fail)
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~70 minutes

Possibly related PRs

Poem

🐰 A rabbit's ode to safer secrets...

With Keychain's vault and salted hashes bright,
Where HMAC guards each file from prying sight,
And tokens dance through transfer's sacred gate,
The burrow's data now encryption-weighted! ✨

✨ 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.

This was referenced Mar 6, 2026
Merged
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