Document Processing Analyst — P0 Pre-Wave Subagent
New subagent that processes client-uploaded documents before research planning begins. Extracts text, analyzes content, identifies critical issues, and maps documents to specialist domains.
Full spec: docs/pending-updates/document-extractor-agent.md
Key Facts
- Scope: ~1,500 new lines across 12 files (6 new, 6 modified)
- Risk: HIGH (65-75%) without 3 mandatory mitigations → 0% with mitigations applied
- Dependencies: None (fully additive)
- Feature flag: Document-conditional — only activates when
documents.length > 0
Implementation Phases
- Frontend upload UI (file input, drag-and-drop, FormData transport)
- Session initialization (
sessionInitializer.js, multer middleware, 3 mandatory mitigations)
- Subagent definition (
legalSubagents.js, PARALLEL_EXECUTION_GROUPS)
- SDK hooks & SSE bridge updates
- Prompt updates (
roles.md, completion.md, waves-execution.md, state-file-schemas.md)
- Orchestrator integration (manifest reading, P0 invocation, enhanced research plan)
- Specialist updates (document citation format, fact registry schema)
- Testing (backward compat for query-only sessions is critical)
Mandatory Mitigations (spec §Breaking Risk Assessment)
- Add
'initial-query-docs', 'documents' to KNOWN_SUBDIRS
- All manifest reads use
existsSync() + null-check
initializeSession() only called when documents.length > 0
Document Processing Analyst — P0 Pre-Wave Subagent
New subagent that processes client-uploaded documents before research planning begins. Extracts text, analyzes content, identifies critical issues, and maps documents to specialist domains.
Full spec:
docs/pending-updates/document-extractor-agent.mdKey Facts
documents.length > 0Implementation Phases
sessionInitializer.js, multer middleware, 3 mandatory mitigations)legalSubagents.js,PARALLEL_EXECUTION_GROUPS)roles.md,completion.md,waves-execution.md,state-file-schemas.md)Mandatory Mitigations (spec §Breaking Risk Assessment)
'initial-query-docs','documents'toKNOWN_SUBDIRSexistsSync()+ null-checkinitializeSession()only called whendocuments.length > 0