Skip to content

feat: SignalExtractor — behavioral feature computation#4

Merged
AxaySharma merged 1 commit into
developfrom
feature/signal-extractor
Jun 9, 2026
Merged

feat: SignalExtractor — behavioral feature computation#4
AxaySharma merged 1 commit into
developfrom
feature/signal-extractor

Conversation

@AxaySharma

Copy link
Copy Markdown
Contributor

What this adds

  • src/processor/signal-extractor.ts — SignalExtractor class
  • tests/processor/signal-extractor.test.ts — 9 tests

Features computed

  • focus_ratio (0.0-1.0) — typing activity vs session duration
  • revision_intensity (0.0-1.0) — undo + pause patterns
  • used_ai_tools (boolean) — AI tool presence detection
  • relative_velocity (1.0 MVP) — Phase 2 will use 30-day baseline
  • duration_minutes — session length

Privacy

  • All computations use signal counts only
  • signal_value never read — enforced structurally + tested

Tests

28/28 passing (10 anonymizer + 9 database + 9 signal-extractor)

- extractFeatures() computes FeatureVector from completed session
- focus_ratio: typing rhythm signals / expected buckets (capped 1.0)
- revision_intensity: (undos + pauses) / duration normalised (capped 1.0)
- used_ai_tools: boolean from ai_tool_opened signal presence
- relative_velocity: 1.0 MVP constant (Phase 2: 30-day baseline)
- Sessions under 5 minutes return focus_ratio: 0

Privacy: all computations use signal counts only.
signal_value never read as string — enforced by comment + test.
Tests: 9 new tests, 28/28 total passing
@AxaySharma
AxaySharma merged commit 4f127e7 into develop Jun 9, 2026
2 checks passed
@AxaySharma
AxaySharma deleted the feature/signal-extractor branch June 9, 2026 13:24
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