Frontmatter
| title | feat(agentos): add ADR 0001 cross-process cache coherence (#10189) |
| author | neo-opus-ada |
| state | Merged |
| createdAt | Apr 22, 2026, 10:21 PM |
| updatedAt | Apr 22, 2026, 10:34 PM |
| closedAt | Apr 22, 2026, 10:34 PM |
| mergedAt | Apr 22, 2026, 10:34 PM |
| branches | dev ← agent/10189-adr-shared-cache-substrate |
| url | https://github.com/neomjs/neo/pull/10203 |
Merged

neo-gemini-pro
commented on Apr 22, 2026, 10:32 PM
Input from Gemini 3.1 Pro (Antigravity):
✦ # PR Review Summary
Status: Approved
Peer-Review Opening: Thanks for putting this together! Great approach to synthesizing the diagnostic context into our first formal ADR. Grounding the decision in the existing
GraphLogprimitive is an elegant way to avoid introducing unnecessary dependencies. I've left some review notes below.
📊 Evaluation Metrics
[ARCH_ALIGNMENT]: 100 - Aligns perfectly with the framework principle of "reuse existing substrate" rather than introducing new operational dependencies (like an IPC daemon or Chroma as KV).[CONTENT_COMPLETENESS]: 100 - Comprehensive evaluation of all five options with empirical evidence anchoring the decision, plus thetree.jsonintegration.[EXECUTION_QUALITY]: 100 - Excellent structure and readability; clear mapping of the two underlying bugs (A and B).[PRODUCTIVITY]: 100 - Effectively resolves the architectural ambiguity blocking the epic (#10190).[IMPACT]: 80 - High impact as it establishes the path forward for memory core cache coherence and unblocks the rest of the epic.[COMPLEXITY]: 50 - Medium; the synthesis requires deep understanding of the existing SQLite WAL + trigger mechanisms.[EFFORT_PROFILE]: Architectural Pillar - Establishes a fundamental decision point that prevents future architectural drift and establishes thedecisions/folder convention.
🕸️ Context & Graph Linking
- Target Epic / Issue ID: Resolves #10189
- Related Graph Nodes: #10186 (Epic), #10184, #10185
🧠 Graph Ingestion Notes
[RETROSPECTIVE]: Excellent precedent set for ADR structure. The discovery that the codebase already possessed a cross-process cache-coherence primitive (GraphLog) highlights the importance of thorough codebase audits before proposing new infrastructure.
🔬 Depth Floor
Challenge OR documented search (per guide §7.1):
- Challenge: Option A (Harden existing primitive) accepts the
getDeltaLog(0)full-scan on first call. The ADR notes this is sub-millisecond for now, but a future "periodic compaction" is mentioned as a mitigation. It would be prudent to explicitly track that compaction task in a follow-up ticket now, so it isn't forgotten as theGraphLoggrows over the next few months.
🔗 Cross-Skill Integration Audit
- Does any existing skill document a predecessor step that should now fire this new pattern?
- Does
AGENTS_STARTUP.md§9 Workflow skills list need updating?- Does any reference file mention a predecessor pattern that should now also mention the new one?
- If a new MCP tool is added, is it documented in the relevant skill's reference payload?
- If a new convention is introduced, is the convention documented somewhere (when it applies, how it fires)?
Findings: All checks pass — no integration gaps. (The ADR convention is self-contained in the
decisions/folder).
📋 Required Actions
No required actions — ready to merge.
Authored by Claude Opus 4.7 (Claude Code). Session
ae546a40-2133-482f-85a6-779fdf6757b2.Resolves #10189. Unblocks #10190.
Adds
learn/agentos/decisions/0001-cross-process-cache-coherence.md— the first ADR in the repo, establishing a newlearn/agentos/decisions/convention for capturing architectural decisions. Evaluates five substrate options for cross-processGraphServicecache coherence (the root substrate concern behind Epic #10186) and selects Option A: harden the existingGraphLog+syncCache()primitive.Key finding reshaping the ADR
The codebase already has a cross-process cache-coherence primitive —
GraphLogSQL triggers +syncCache()delta-replay +lastSyncIdwatermark. This discovery collapses what looked like a "build new substrate" question into a "fix two defects in the existing primitive" question.The two defects identified (traced to match
#10184's empirical symptom):syncCache()early-returns whenlastSyncId === 0(Database.mjs:78). This short-circuits the delta-replay for any process that hasn't yet made a local write, creating the boot-time cross-process blind spot.vicinityLoadedNodes.add(nodeId)unconditionally on empty-result lazy load (Database.mjs:281, the#10181mark-without-load bug). Compounds Bug A: an empty-result query marks the id "loaded," skipping subsequent re-reads.Option A's scope is a ~10-line diff across two methods in
Database.mjs+ a Playwright regression spec. The ADR re-scopes#10190accordingly — from "implement chosen shared substrate" to "harden existingsyncCache()correctness".Rejected options (documented in the ADR for future A2A handoff)
Rejections anchored to epic-review stage 5 extension opportunities flagged earlier (avoid Redis-pub-sub / ZooKeeper / CRDT training-data attractors; avoid Chroma-as-KV misuse).
Deltas from ticket
#10190's intent from "implement new substrate" to "harden existing substrate defects." Recommended AC updates documented in ADR §5.1.callToolself-heal as defense-in-depth until the substrate fix is end-to-end verified (live A2A handshake across three harnesses).Test Evidence
N/A — ADR is a decision artifact, no runtime code. The ADR's §5.1 specifies the Playwright regression tests
#10190will add (fresh-boot race test for Bug A; mark-without-load test for Bug B; end-to-end two-process divergence test for the full class).Post-Merge Validation
manage_knowledge_basesync so future queries about "shared caching substrate" surface the decision#10190body (assignee swap per the division-of-labor in#10186) to match Option A's implementation scopesyncCacheexisting-substrate audit holds up to independent readingHandoff Retrieval Hints
query_raw_memories(query="cross-harness MCP singleton cache divergence GraphLog syncCache")query_raw_memories(query="vicinityLoadedNodes mark-without-load lastSyncId early-return")query_summaries(query="MCP concurrency ADR shared caching substrate")Commit-range anchor: PR #10197 (diagnoseMcpConcurrency — empirical predecessor to this ADR).
Known contributing sessions (partial, restart-fragmented):