feat: add authoritative incremental decision memory - #2001
Conversation
090ec6d to
fa7661d
Compare
fa7661d to
45655d5
Compare
0851bac to
68ad517
Compare
|
Thanks for this contribution, and apologies for the slow turnaround.
If you'd rather not pick it back up, no problem at all — just say so and I'll close it out, and thanks either way for taking the time to send it. |
68ad517 to
ffe96d3
Compare
Expose optional authority provenance and verification on retrieved memories so agents can distinguish current, stale, and unverified evidence. Cache local-file verification during each search and deduplicate ranked hits without changing legacy retrieval defaults.
ffe96d3 to
25b46c0
Compare
Accept backend-owned changed/deleted manifests so project updates avoid a full filesystem scan. Keep path containment, tombstones, gitignore cleanup, and wing-scoped reindexing explicit to preserve the existing corpus safely.
Let callers replace a decision through an exact decision key and predecessor ID while retaining the original verbatim drawer as queryable history. Similarity never performs implicit replacement, and normal search excludes superseded entries by default.
Route mutating MCP operations through one durable daemon writer instead of process-lifetime peer locks. Add leased, coalesced jobs with bounded wait responses and safe status diagnostics so concurrent clients can submit writes without exposing queued payloads.
25b46c0 to
fb83ba3
Compare
Hi @igorls |
What this adds
This PR gives long-running coding agents a safer way to use project memory: they can tell whether a recalled item is still backed by its source, update only files that changed, replace an obsolete decision without erasing history, and send concurrent writes through one durable writer.
The problem
Semantic similarity alone cannot answer whether an old memory is still authoritative. Full project re-mines are expensive for small edits, and implicit "replacement" risks silently discarding verbatim history. At the same time, independent MCP clients can contend for the local write path.
Implementation, by reviewable commit
1. Memory freshness from authoritative sources —
6854769Why: callers need to distinguish current evidence from memory whose backing source changed or disappeared.
How: adds optional
authority_uri,authority_version, andmemory_kindmetadata; opt-in local-file verification reportscurrent,stale, orunverified. Verification is cached within a search and duplicate ranked hits are removed.Result: legacy memories remain compatible and unverified by default; agents can opt into freshness checks before relying on recalled context.
2. Incremental project updates from a changed set —
9d91aa3Why: a producer that already knows which files changed should not have to trigger a full filesystem walk.
How: introduces a validated, project-relative
{changed, deleted}manifest; preserves containment checks and tombstones; cleans up newly ignored files; and scopes re-indexing to the affected wing.Result: small edits can update the correct memory slice without weakening source safety or reprocessing an entire project.
3. Explicit, reversible decision replacement —
cf7546eWhy: replacing a decision must be deliberate and must not delete the verbatim rationale it supersedes.
How: requires an exact non-empty
decision_keyplus predecessor ID. The old drawer remains stored assupersededhistory; ordinary search hides it unless history is requested.Result: agents retrieve the current decision by default while audits can follow the full decision trail. Semantic similarity never supersedes a record implicitly.
4. One durable writer for concurrent MCP clients —
0851bacWhy: process-lifetime peer locks make concurrent write behavior fragile and provide poor diagnostics when a job stalls.
How: routes mutating MCP calls through the daemon, with leased and heartbeated jobs, recovery of expired leases, coalescing of file events, bounded synchronous waits, and sanitized job-status endpoints.
Result: concurrent clients submit work safely through one write lane, while callers can inspect progress without receiving queued write payloads.
Compatibility and safety
unverifieduntil verification is requested.Validation
uv run ruff format --check .✅uv run ruff check .✅Scope
This is a cohesive incremental-memory foundation, not a final schema or a hosted sync feature. Remote authority adapters and an idempotency key for daemon submissions remain future work.