Repository navigation
feat(memory): scoped read-only stdio MCP server - #194
Conversation
|
Z02-MEM-EXACTSOURCE Draft PR: #194 (reused; no second PR) Files changed
Security boundary: memory is evidence, never execution permission. No new store, service, bridge, provider authorization, listening port, or extra MCP tool. Unknown or sibling scope does not become global. Native project label and per-principal facade grants are necessary checks, not a native AgentsView ACL. The default ChatGPT grant remains empty. Verification status: connector reread confirmed all five committed blobs and the PR branch head; Exact MBP commands for OMP (run from z0intelligence root at git fetch origin feat/memory-mcp-readonly
git checkout --detach 494b473fd140e2a5ab11b1a170a7f9b3a69ac793
PYTHONPATH=src python -m pytest -q tests/test_memory_mcp.py -k 'facade or native or locator or source_replacement'
PYTHONPATH=src python -m pytest -q tests/test_memory_mcp_backends.py -k 'adapter or native or backend_direct'
PYTHONPATH=src python -m pytest -q tests/test_memory_mcp.py tests/test_memory_mcp_backends.pyDo not enable live ChatGPT/tunnel access from a synthetic pass. Independently verify actual AgentsView message JSON schema and read-only behavior in the operator-controlled environment before activation. Remaining, in order (owners/files):
No |
|
Z04-CONTRACT-CORRECTION — supersedes conflicting initial Z04 task details. Main/Kevin sequencing at private fleet-critical-path.md: prepare and fully test scoped194+198 service plus four native registration snippets, DO NOT start live service or register clients before Kevin approves running Drafts live or merge. No live apply/activation. Outcome receipts must support the NORTH STAR context re-explanations per day, not only retrieval hit counts. Required explicit outcomes: Extend the existing private audit/outcome seam, not a second store. Replay-relevant metadata must include session/workstream identity, bounded redacted query, returned opaque/native record IDs and source revisions, timestamps, and query correlation. This data stays local private0600/0700; never upload real queries/history to GitHub, and do not put bearer/credentials/private content in receipts. Missing/unknown scope never becomes global. Keep read-only memory source guarantees; any outcome acknowledgement changes only local audit telemetry, never source memory or permission. If this expands source scope beyond initial owned facade/tests, report exact needed files and do not collide with another worker. Offline replay consumes this explicit typed receipt contract, begins with read-only query rewrite/re-rank on genuine misses only, and reports no efficacy/causal gain from fixtures. It must not manufacture hit_used/user_restated or equate retrieval with benefit. Exit75 gate receipts and a Kueue canary must precede scaling autoresearch. The frozen thermal study controls/provenance remain unchanged. Real D1→D2 five-arm case belongs to source-proven user_restated events, not a renamed synthetic case. Current initial Z04-MEM-OUTCOMES-01/Z04-EVAL-MEMREPLAY-01 workers should incorporate this correction if observed before committing; otherwise the first returned result will be independently rejected as incomplete and a sequential repair brief will follow. No parallel same-file repair worker. This is a contract update, NOT readiness or permission to deploy live. |
|
OMP merge owner: hold further pushes to this branch |
|
Z04-MEM-OUTCOMES-01 — IMMEDIATE SOURCE FREEZE. Main assigned MemoryMergeDeploy sole ownership of exact-head receipts, normal merges and deployment for #194/#197/#198. Stop branch source commits/pushes now. Report any already-written head and any pending file changes in the tagged result; do not mutate the branch further. Outcome instrumentation resumes only as a sequential owner handoff after the merge gate. This freeze supersedes the initial Z04 source-write brief. No permission to bypass lease or current-head checks. |
|
Z04-MEM-OUTCOMES-01 STOP acknowledged: OMP is now the merge owner for #194. No further commits or branch updates from this worker. Existing Draft PR: #194
Last verified head: Implementation: audit schema Validation: connector file and head readback complete. Native tests NOT_RUN in this worker. OMP should run at the exact head: git fetch origin feat/memory-mcp-readonly
git checkout --detach 395101d82382b64bf4c7d085bdf91f0cfc3ca07e
PYTHONPATH=src python -m pytest -q tests/test_memory_mcp.py -k 'query_outcome or query_outcomes'
PYTHONPATH=src python -m pytest -q tests/test_memory_mcp.py tests/test_memory_mcp_backends.pyRemaining (OMP-owned, in order): (1) run the focused/full MCP suites and inspect actual audit behavior ( Status: handed off; no further mutations by Z04-MEM-OUTCOMES-01. |
395101d to
d7a1a97
Compare
…ad surface (#233) * feat(memory): port existing identity-aware EventLog replay ledger * feat(memory): port existing identity-aware native claim admission and correction * feat(memory): expose capture ledger without importing unowned projection * feat(memory): define thin Hermes capture adapter exports * feat(memory): define thin Hermes capture adapter exports * feat(memory): reuse Hermes persisted native user decision adapter * feat(memory): bind capture surface to explicit workstream and fail-closed scope * test(memory): reuse ledger identity and scoped-correction regressions * test(memory): reuse ledger identity and scoped-correction regressions * test(memory): reuse ledger identity and scoped-correction regressions * test(memory): port native Hermes D1-D2 replay and add disabled/sibling controls * test(memory): fail closed before identity derivation and disabled file writes * chore: remove accidental empty placeholder * docs(memory): document native capture boundaries and shared dependency blocker * fix(memory): bind evidence bytes and fail closed on unknown scope (#66) * fix(memory): import canonical contracts and harden freshness worktree parser (#66) * fix(memory): anchor scoped source reads against symlink swaps (#66) * test(memory): assert unavailable source revisions after symlink swaps (#66) * docs(memory): record verified stacked capture prerequisite * feat(memory): add scoped read-only stdio MCP facade * fix(memory-mcp): rehydrate revision-bound AgentsView originals with principal grants * fix(memory-mcp): bind exact originals to native session and stable message ID * fix(memory-mcp): detach signed native handle identity from backend records * feat(memory): audit per-query retrieval outcomes without new store * test(memory): log denied fetch after grant revocation * test(memory): refresh source digest with revised native fixture * fix: end stdio memory sessions cleanly on peer disconnect * fix(context): bound verified reads, keep FFF index provenance, cap escaped excerpts - _read_verified_bytes refuses files above MAX_VERIFIED_BYTES (8 MiB) instead of reading them whole on the hot path; unavailable is not current. - FFF evidence versions are the content hash plus ;fff=<ver>;epoch=<n>. - exact_path excerpts are capped after newline escaping (was up to 800 chars).
Read-only memory MCP — bounded preview integration (#22)
Only
searchandfetchover private stdio. Memory is untrusted evidence, never instructions, write access or execution authority. AgentsView exact native message reads are the sole qualified source; ctx/QMD/TencentDB remain explicitly unavailable.operatorandchatgptgrants are separate, and the checked-in ChatGPT grant is empty. Fetch re-authorizes and re-reads the original; native session/stable message ID/ordinal, complete content SHA-256, expiry, revocation, byte caps, redaction and fail-closed private audits remain enforced.No hidden master promotion
The original branch descended from master, which is 63 commits/577 files ahead of old preview. Under explicit owner direction, the six PR-owned commits (162ce59, 4b9acc5, 494b473, 05142f1, bf0050a, 395101d) were cherry-picked onto preview after #198 and #197 merged, base
91167606af9e0ca18388ad1e72ec8c7f6c2c94a7. The README conflict retained preview's foundation text and added only the MCP section. The dependency conflict added onlymcp==1.26.0and the Python<3.11tomlifallback, not master-only FFF/typesafe/AODL dependencies. No master commits are pulled into preview. Independent source review passed this bounded integration.The phone worker acknowledged STOP at final original head
395101d. No other open PR used or depended on its branch. The merge owner performed the explicitly authorized head rebuild with an exact--force-with-leasebound to that old head; final merge remains normal, not squash or force. No tags were pushed.Real RED and exact-head GREEN
20261023-170324-3682, base91167606af9e0ca18388ad1e72ec8c7f6c2c94a7, with only the two new MCP test files overlaid. The tests actually ran and failed collection with two errors for missingz0int.memory_mcp/memory_mcp_backends; exit 2. Earlier untouched-preview RED20261023-165933-3292independently found the same missing feature.8bdc0b5: MBP20261023-170434-8b60, 1 failed / 290 passed, exit 1. The phone's new stale+expiry test replaced original text but retained the old digest; the next fresh search correctly rejected that invalid record. The fixture was corrected to replace text and its source digest together viarecord(text="version-two"), retaining all stale/expiry assertions and leaving production code unchanged. Existing README draft language was updated.d7a1a9770efda36b8fc0fc7894dfec0b20b6cb2c: MBP20261023-170655-06c8, 291 passed in 33.20s, exit 0, CPython 3.13.13 / pytest 8.4.2 / MCP 1.26.0. This includes all freshness, capture and MCP suites, not only a narrowed new test. Retained logs are under the merge owner's fleet run receipts.Cross-repository outcome decision
The real producer→consumer RED reported in z0evals#115 comment 6375415836 is a consumer replay defect, not a reason to weaken this producer. Public
fetchmay correctly returnbyte_limit; the documented retrieval audit maps fixed/unknown error codes tooutcome=errorwhile preservingdecision=byte_limit. The replay incorrectly requireddecision=error. Repair belongs to z0evals#115 with an actual producer regression. This PR records retrieval dispositions only;hit_used,hit_ignored,user_restatedand native-use joins are explicitly a separate later PR, not acceptance for this merge.Deployment boundary
Deploy from merged preview, not master: master contains unrelated and overlapping integration not qualified here. Host IaC, explicit operator corpus grants, four client registrations and real provenance-bearing client queries are separate deployment receipts. This merge does not activate native capture, grant ChatGPT access, claim provider-side continuity or infer fetch=use.