Complete the Project Context MCP MVP with the second read-only tool,
search_project_knowledge, so an agent can go from an issue's requirement
to the project documents that explain it, with citable evidence.
Retrieval reuses what Cowork already owns instead of adding a vector DB,
an embedding pipeline, or a new RAG framework:
- core/projects.py already defines a project's knowledge as the files at
its workspace root, so that folder is the entire corpus. Isolation is
structural, not a filter applied after the fact.
- core/doc_extract.py already extracts docx/pptx/xlsx/pdf/text, so the
provider inherits format support and duplicates none of it.
Security properties:
- Read-only. The workspace root resolves from the identity, never from
the request; project_id only verifies scope and is never routing
authority. Symlinks escaping the workspace are dropped.
- Policy runs before provider resolution; target and access resolution
are separate seams so a pilot local root can become an on-behalf-of
served backend without changing the tool or the provider.
- Bounded output per detail mode with cursor pagination; no unlimited
mode. Backend failures map to safe errors that leak no internals.
score is honest term coverage, not a fabricated similarity; the upgrade
path is documented on _score_chunk.
Adds tests/test_project_context_knowledge.py (40 tests) and
tests/test_project_context_e2e.py, which proves the two tools compose:
issue -> requirement -> related knowledge -> evidence.
- Share cursor decoding in foundation.decode_offset_cursor so both tools
reject an invalid cursor identically, before any upstream call.
- Add regression coverage that a malformed repo slug (owner/repo/extra,
missing owner, empty segment) is refused before any network call.
- Add evidence that BOTH project context tools inherit the shared MCP
client audit record and untrusted-content fence, instead of each tool
shipping its own. No audit subsystem is duplicated.
Copy of sections VI-IX from Feature_Architecture_Proposal.md
(roadmap, team assignment/KPI, anti-patterns, function migration map).
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>