Skip to content

feat(memory): wire ctx into unified DSH memory pull - #121

Closed
kvnloo wants to merge 18 commits into
integrate/wiring-20261003from
feat/ctx-dsh-unified-memory-116
Closed

kvnloo wants to merge 18 commits into
integrate/wiring-20261003from
feat/ctx-dsh-unified-memory-116

Conversation

@kvnloo

@kvnloo kvnloo commented Oct 4, 2026

Copy link
Copy Markdown
Owner

Goal

Finish the ctx × z0intelligence integration from #116 on top of the current unified-memory wiring branch, and make it usable from DSH without putting ctx on the latency-critical push path.

Supersedes the isolated integration direction in #117; this PR ports that read-only adapter into the full memory surface.

What changes

  • port CtxHistoryCapability from feat(memory): add read-only ctx history capability #117, preserving --refresh off, Core generation identity, exact event/session locators, zero-write env guards and semantic opt-in;
  • add caller-neutral --include-current-session and keyword --term alternatives to address the feat(memory): add read-only ctx history capability #117 bakeoff findings;
  • add ctx as the fourth pull layer of the unified z0 memory surface;
  • derive project scope from ctx cwd; unknown scope fails closed instead of becoming user-global;
  • preserve the ctx Core generation in the memory snapshot;
  • bypass the brief cache when ctx participates so a stale Core generation cannot be served;
  • add exact ctx:event:<id> hydration to inspect;
  • expose ctx through the read-only z0-memory MCP profile used by DSH;
  • keep the automatic agent/pre-step push path on temporal + AgentsView + TencentDB only (ctx remains outside the 300 ms budget);
  • add one combined DSH patch: harness-adapters/dsh-z0intelligence/z0-dsh.cordis.yml.

DSH run

export Z0INT_PYTHON="${Z0INT_PYTHON:-$HOME/.z0int/bin/python}"
dsh web --patch "$PWD/harness-adapters/dsh-z0intelligence/z0-dsh.cordis.yml"

This starts the existing capture/shadow seam and the read-only z0-memory stdio MCP. The model can use memory_search and exact inspect hydration; ctx failure remains an explicit layer miss and AgentsView/EventLog/TencentDB continue independently.

Current local-ingest context

The current ctx import is expanding Claude Code/Hermes roots. DSH's native session.v3 zstd store is currently reported empty by ctx and OpenCode still has mixed-format rejects. This PR deliberately does not depend on those imports: incomplete ctx coverage degrades to the existing z0 memory layers.

Invariants

evidence != claim/state != authority != action != outcome

No ctx import/index/setup/write command is added. No AODL authority changes. No direct memory DB replacement.

Verification

Deterministic tests cover the ported ctx protocol adapter, scope filtering, Core-generation snapshot changes, exact hydration, missing-ctx behavior, MCP pull-layer selection, and the DSH pull-vs-push boundary.

Closes the DSH integration slice of #116; keep #116 open for the real-history acceptance matrix and ctx provider/Blame parity.

kvnloo commented Oct 4, 2026

Copy link
Copy Markdown
Owner Author

Linked DSH-side dogfood arm: kvnloo/deepseek-harness#5

I’m keeping the ownership split explicit:

That lets the acceptance matrix compare pull vs native automatic injection without prematurely putting ctx inside the 300 ms push budget. Promotion still requires the real-history matrix + verified answer/token/latency evidence.

kvnloo commented Oct 5, 2026

Copy link
Copy Markdown
Owner Author

Memory issues are now reconciled under #22; #116 names this PR as the current ctx/DSH pull integration, superseding #117's isolated direction. Keep the pull-versus-push boundary, read-only/semantic opt-ins and existing scoped snapshot/receipt contracts. This remains branch-only at audited head 158931b1a6429bfc70fd1c87d80d6e8ee8ebb966; neither #122's setup receipt nor the old bakeoff proves the real-history handoff here. The remaining gate is source-backed model-visible use plus correction/staleness/duplicate/scope negative controls, using the shared evaluation rather than a new benchmark.

@kvnloo

kvnloo commented Oct 11, 2026

Copy link
Copy Markdown
Owner Author

Parked under the salvage plan (2026-10-11) until the branch it is based on, integrate/wiring-20261003, has been tested (unit H6). Branch kept.

@kvnloo kvnloo closed this Oct 11, 2026
@kvnloo kvnloo added the parked Closed under the salvage plan; branch kept; reopen when something that runs needs it label Oct 11, 2026
@kvnloo
kvnloo deleted the feat/ctx-dsh-unified-memory-116 branch October 29, 2026 03:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:docs Documentation area:verify Tests, mutation, evidence parked Closed under the salvage plan; branch kept; reopen when something that runs needs it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant