## Summary Add `cortex answer "question"` as a v1.1 feature for single-pass retrieval + synthesis with citations. ## Scope - New package: `internal/answer/` - New CLI command: `cortex answer` - New MCP tool: `cortex_answer` ## Functional constraints 1. Single-pass only: search -> top results -> synthesize -> cite -> done 2. No recursion, no memory writes 3. LLM call used when available (`--model` override, sensible config-resolved default) 4. Output: 4-8 sentence answer + numbered citations `[n]` 5. `--json` output machine-parseable 6. Graceful degrade if no LLM configured: return top search results (no hard fail) ## Security / quality guards - Citation integrity gate: citations must map to retrieved result IDs or degrade fallback - Prompt-injection stripping on retrieved chunks before synthesis - In verbose mode, log stripped content to stderr for auditability - Context budget controls (`maxContextChars`, per-result truncation) ## MCP parameters - `query`, `mode`, `limit`, `project`, `agent_id`, `source`, `source_boosts` - plus `model`, `maxSentences`, `maxContextChars` ## Acceptance - `go test ./...` passes - Command and MCP tool both available - Degrade mode works offline without failure
Activity
feat(answer): single-pass cortex answer with citation integrity and p…