2.7 KiB
2.7 KiB
Current Context
Implementing Phase B: Shadow Extraction for the Signet memory pipeline. The focus is building the extraction and decision intelligence layer in shadow mode to validate quality/reliability without destructive consequences.
Active Projects
Phase B: Shadow Extraction Implementation
- Location:
packages/daemon/src/ - Status: Planning complete, awaiting implementation
- Dependencies: Phase A infrastructure (schema migrations, DB accessor, feature flags) now in
c1e43b6 - Next Steps:
- Create
src/extract/module withextractFactsAndEntities(input): ExtractionResult - Build
src/decision/module for shadow candidate retrieval - Implement
src/worker.tswith job queue processing (reads frommemory_jobs, writes tomemory_history) - Add contract validation and warning persistence
- Create
- Key Constraints:
- Extract from daemon.ts recall logic and hooks.ts extraction
- Keep semantics non-mutating
- All logs go to
memory_historytable only - New files needed (daemon.ts is 4511 LOC)
Recent Work
Phase A: Infrastructure Hardening (completed in c1e43b6)
- Schema migrations 001+002 for job queue/history tables
- Singleton DB accessor with WAL mode and read pool
- Transaction boundaries keeping provider calls outside write locks
- Content-hash dedup implementation
- Feature flags with kill switches (
PipelineV2Config) - Entity graph schema with proper entity types
- 102 tests passing
Team Structure Established
- Parallel agent delegation used successfully
- Schema-agent, db-accessor-agent, config-test-agent working in sequence
- Integration pass handling remaining wiring
Technical Notes
Database Schema:
memory_jobstable: stores job queue entriesmemory_historytable: stores shadow extraction logs/proposals- Feature flags:
PIPELINE_FLAGSinmemory-config.ts
Key Interfaces:
ExtractionResult: structured facts + entities outputDecisionEngine: retrieve top-K candidates, confidence scoringSignetLifecycleconnectors pattern maintained
Tooling:
- Database access via singleton accessor
- Transaction wrappers for write operations
- Content hashing for deduplication
- Vector search integration for candidate retrieval
Code Standards:
- Self-explanatory code with "why" comments
- Max 700 LOC per file, max 3 indentation levels
- Test in browser (not lazy)
Rules & Warnings
- Never delegate UI work to subagents (handle personally as Opus)
- Prefer Sonnet/Haiku delegation when operating as Opus
- Keep journal entries in memory database regularly
- Signet agent profile at
~/.agents/ - Phase B work must be in new files (daemon.ts too large at 4511 LOC)
- Test in browser, don't be lazy
- Non-mutating semantics for shadow extraction phase