feat: VSCodeCollector — first real behavioral collector#6
Merged
Conversation
- onKeystroke(): timing rhythm in 100ms buckets, never key content - onPause(): detects thinking pauses > 10s, records duration - onFileSwitch(): debounced at 500ms, counts switches not filenames - onAIToolSwitch(): boolean presence detection only - onUndo(): counts revision events, ignores what was undone - onBuildRun(): counts build attempts, ignores command content ICollector interface added to types/index.ts Collector errors caught and logged — never crash the app All public methods return silently when not running Privacy: keystroke characters structurally isolated from signal pipeline. Content never reaches SessionManager. Debounce prevents timing attacks via rapid file switches. Tests: 17 new, 59/59 total passing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this adds
src/collectors/vscode.ts— VSCodeCollector classsrc/types/index.ts— ICollector interfacetests/collectors/vscode.test.ts— 17 behavioural testsHow it works
Receives IPC events from VS Code Extension:
onKeystroke() → typing_rhythm_bucket (interval in 100ms buckets)
onPause() → pause_event (duration in seconds, min 10s)
onFileSwitch() → file_switch (debounced, count only)
onUndo() → undo_event (count only)
onAIToolSwitch() → ai_tool_opened (boolean)
onBuildRun() → build_run (count only)
Privacy
Tests
59/59 passing (10 + 9 + 9 + 14 + 17)