Skip to content

feat: VSCodeCollector — first real behavioral collector#6

Merged
AxaySharma merged 1 commit into
developfrom
feature/vscode-collector
Jun 9, 2026
Merged

feat: VSCodeCollector — first real behavioral collector#6
AxaySharma merged 1 commit into
developfrom
feature/vscode-collector

Conversation

@AxaySharma

Copy link
Copy Markdown
Contributor

What this adds

  • src/collectors/vscode.ts — VSCodeCollector class
  • src/types/index.ts — ICollector interface
  • tests/collectors/vscode.test.ts — 17 behavioural tests

How 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

  • Keystroke characters never enter the signal pipeline
  • File names never recorded — switch count only
  • Debouncing prevents rapid-switch timing attacks
  • Collector errors never propagate up to crash the app

Tests

59/59 passing (10 + 9 + 9 + 14 + 17)

- 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
@AxaySharma
AxaySharma merged commit f1e2b10 into develop Jun 9, 2026
2 checks passed
@AxaySharma
AxaySharma deleted the feature/vscode-collector branch June 9, 2026 13:35
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