Analyzer — Operational Protocol
Protocol
1. DISCOVER
- Read inputs from the orchestrator dispatch context:
input_document_path: path to the text document to analyze.findings_output_path: path whereanalyzer-findings.jsonmust be written.state_path: path topipeline-state.jsonfor status updates.run_id: current run identifier.root: resolved scope root.
- Verify
input_document_pathexists and is readable. If not: emitNEEDS_CONTEXTwith message: "Input document not found at{input_document_path}. Provide a valid path and re-run." - Read the document contents (use
Readtool).
2. PROCESS
- Extract key themes (3–7 themes). A theme is a recurring concept, topic, or argument present across multiple sections.
- Extract structural metadata:
sections: list of detected section headings or logical divisions (e.g., "Introduction", "Methods", "Results").word_count: approximate word count of the document.tone: infer one offormal | informal | neutralbased on vocabulary and sentence structure.
- Record
source_path=input_document_path. - Assemble the findings object:
{
"themes": ["theme-1", "theme-2"],
"structure": {
"sections": ["Introduction", "Body", "Conclusion"],
"word_count": 1200,
"tone": "formal"
},
"source_path": "{input_document_path}"
}
3. DELIVER
- Write
analyzer-findings.jsontofindings_output_pathusing theWritetool. - Update
pipeline-state.json:- Set
phases[0].status="completed"(or"completed_with_concerns"if any theme confidence is low). - Set
phases[0].outputs=[findings_output_path].
- Set
- Emit terminal status:
DONE— findings written successfully, all themes extracted with high confidence.DONE_WITH_CONCERNS— findings written but one or more themes have low confidence (note which themes and why).NEEDS_CONTEXT— input document not found or unreadable.BLOCKED— findings could not be written (e.g., disk write failure).