Graduated from Discussion #12062: Orchestrator-as-SSOT for the REM (Sandman) Pipeline. The trigger was the operator-surfaced 2026-05-27 npm run ai:run-sandman failure where Sandman reached DreamService but graph extraction tried modelProvider: gemini and aborted before useful REM ingestion. The incident exposed a larger choreography split: runSandman.mjs, Orchestrator#dream, DreamService, Golden Path refresh, decay, and provider readiness each own partial REM semantics.
This epic makes Orchestrator the single source of truth for REM-cycle choreography while keeping DreamService as the execution service for memory/session graph digestion. It also preserves standalone Golden Path refresh UX and adds post-graduation benchmarking for gemma-4 context-window creation/reuse.
The Problem
Current REM recovery has multiple independent failure surfaces:
runSandman.mjs performs manual lifecycle/provider warmup, calls DreamService.processUndigestedSessions(), runs Golden Path, and runs decay.
Orchestrator#dream only invokes DreamService.processUndigestedSessions() and records task-level outcome.
DreamService.processUndigestedSessions() gates completion through a narrow graphDigested boolean and does not expose a full per-phase run state.
Some downstream stages catch or swallow provider failures, making failures visible in logs but not in durable run state.
Chroma/session counts, SQLite graph node counts, and REM projection counts diverged after graph restore; GPT measured 1069 summaries, 14455 memory rows, 52958 graph nodes, but only 14 SESSION and 132 MEMORY graph projection nodes at the Step-Back review point.
Graph prune/restore can break active wake delivery if active control-plane cursor state is not explicitly verified after restore.
The immediate companion fixes are already split out:
Related issue #12059 / PR #12061: Sandman graph provider routing must never send graph extraction through gemini.
Related issue #12063 / PR #12064: raise OpenAiCompatible contextLimitTokens to gemma-4 native 256K and explicit 200K safe band.
The Architectural Reality
Key source anchors verified during the Discussion:
ai/daemons/orchestrator/Orchestrator.mjs dream task currently calls this.dreamService.processUndigestedSessions() directly.
ai/scripts/runners/runSandman.mjs performs a fuller manual REM wrapper: lifecycle readiness, provider warmup, DreamService run, Golden Path synthesis, and topology decay.
ai/daemons/orchestrator/services/DreamService.mjs#processUndigestedSessions() owns session ingestion, Tri-Vector extraction, topology inference, gap inference, concept gap inference, and graph maintenance.
ai/services/graph/SemanticGraphExtractor.mjs consumes graph-provider dispatch and guardrail results.
ai/services/graph/TopologyInferenceEngine.mjs currently catches/logs provider failures without returning a durable phase failure to DreamService.
ai/daemons/orchestrator/services/GraphMaintenanceService.mjs and graph restore/prune paths must not affect active control-plane nodes or wake cursor semantics.
ADR impact: aligned with ADR 0014 cloud deployment topology and scheduler task taxonomy, ADR 0009 cross-daemon lease inheritance, and ADR 0015 graph-store backend posture. No ADR is superseded by this epic; implementation tickets must apply ADR successor-risk audit if they discover a conflict.
The Fix
Create an orchestrator-owned REM-cycle surface, tentatively:
The method coordinates readiness, DreamService execution, Golden Path, decay, and durable run/stage telemetry. runSandman.mjs delegates to this method instead of duplicating choreography. Standalone Golden Path refresh remains first-class through refreshGoldenPath() and a CLI/script mode.
Child Work Plan
Sub
Scope
Resolves / carries
Order
Sub 1
Silent-failure root-cause investigation across all 13 hypotheses from Discussion #12062
OQ9
first
Sub 2
5-axis observability primitive plus REM run/stage state model
OQ10, section 2.11
parallel with Sub 1
Sub 3
Unified executeRemCycle() orchestrator method
OQ1, active-control-plane AC, stage model AC
after Sub 1 and Sub 2
Sub 4
runSandman.mjs delegation refactor with CLI mode selector
OQ6
after Sub 3
Sub 5
Standalone refreshGoldenPath() orchestrator method and script
OQ2
after Sub 3
Sub 6
Provider-readiness substrate placement and rich diagnostics
OQ3, OQ4
after Sub 3
Sub 7
Hierarchical summarization with deterministic chunking
OQ12
after Sub 3
Sub 8
gemma-4 benchmarking: context-window creation cost and reusable context-window/cache strategy
operator post-graduation directive 2026-05-27
after Sub 1/2 establish telemetry; can prototype in parallel if non-invasive
A2A MESSAGE:0f7f716f-81fe-4314-bea4-51624dfb63ec; Discussion body section 6.1 says author signal pending
expected follow-up before closing Discussion
Gemini
@neo-gemini-pro
no signal
participationStatus: operator_benched per ai/graph/identityRoots.mjs
covered by Unresolved Liveness
Unresolved Dissent
None after GPT re-poll at body-sha fdf5db7889f80d150bb035e6785bffc09517cda1bebe6c875027d209fe91be67. Previous GPT STEP_BACK blockers were addressed in Discussion #12062 sections 2.10, 2.11, 4, and 6.2.
Unresolved Liveness
Gemini is operator-benched. Tier-2 revalidation trigger: when Gemini maintainer participation reactivates, run the Tier-2 revalidation sweep mechanism from Sub #11803 against this epic and its merged PRs, then request a retrospective Gemini signal at the then-current epic body SHA.
Discussion Criteria Mapping
G1 peer review: GPT posted STEP_BACK at discussion comment 17069393 and approval at discussion comment 17069572.
G2 signal ledger: GPT non-author approval is present; Claude author signal is pending as a closeout follow-up; Gemini liveness is explicitly archived.
G3 OQs: OQ2, OQ9, OQ10, OQ11, and OQ12 are resolved or graduated. OQ7/OQ8 are carried as explicit liveness/deferred surfaces.
G4 decomposition: 7 original subs plus operator-added Sub 8 benchmarking/reuse lane are captured above.
G5 Tier-2: Unresolved Liveness and revalidation trigger are included.
G6 Step-Back: GPT Step-Back ran the 8-point cross-substrate sweep before this graduation.
Acceptance Criteria
AC1: Identify which of the 13 silent-failure hypotheses are currently active and document the root-cause chain with falsifying evidence.
AC2: Implement 5-axis REM observability that distinguishes Chroma summaries/memories, graph SESSION/MEMORY projection, GraphLog, and per-run REM state.
AC3: Add durable REM run/stage state with per-session phase outcomes, payload metrics, failure phase/reason, and last successful phase.
AC4: Add orchestrator-owned executeRemCycle() and route scheduled dream execution through it.
AC5: Refactor runSandman.mjs into a thin delegator with explicit mode selector; remove duplicate choreography.
AC6: Preserve standalone Golden Path refresh through refreshGoldenPath() and an operator-runnable command.
AC7: Add provider-readiness diagnostics that make warmup/provider failures durable and queryable.
AC9: Enforce active-control-plane safety for every sub touching decay, prune, GC, restore, wake routing, task state, lease state, or mailbox routing.
AC10: After related PRs #12061 and #12064 merge, run live Sandman validation and confirm at least one formerly blocked session progresses past provider dispatch and size guardrail.
AC11: Benchmark gemma-4 context-window creation cost; evaluate whether provider/runtime APIs allow reusable created context windows, prefix/cache reuse, or equivalent warm-context amortization. Document cold vs reused throughput, VRAM/memory behavior, and correctness constraints.
AC12: Backfill native sub-issue relationships once child tickets are created; do not rely on markdown checkbox lists as the only tracking substrate.
AC13: Claude author signal and Discussion #12062 closeout are linked back here before the epic is considered fully graduated administratively.
Context
Graduated from Discussion #12062: Orchestrator-as-SSOT for the REM (Sandman) Pipeline. The trigger was the operator-surfaced 2026-05-27
npm run ai:run-sandmanfailure where Sandman reached DreamService but graph extraction triedmodelProvider: geminiand aborted before useful REM ingestion. The incident exposed a larger choreography split:runSandman.mjs,Orchestrator#dream, DreamService, Golden Path refresh, decay, and provider readiness each own partial REM semantics.This epic makes Orchestrator the single source of truth for REM-cycle choreography while keeping DreamService as the execution service for memory/session graph digestion. It also preserves standalone Golden Path refresh UX and adds post-graduation benchmarking for gemma-4 context-window creation/reuse.
The Problem
Current REM recovery has multiple independent failure surfaces:
runSandman.mjsperforms manual lifecycle/provider warmup, callsDreamService.processUndigestedSessions(), runs Golden Path, and runs decay.Orchestrator#dreamonly invokesDreamService.processUndigestedSessions()and records task-level outcome.DreamService.processUndigestedSessions()gates completion through a narrowgraphDigestedboolean and does not expose a full per-phase run state.The immediate companion fixes are already split out:
gemini.contextLimitTokensto gemma-4 native 256K and explicit 200K safe band.The Architectural Reality
Key source anchors verified during the Discussion:
ai/daemons/orchestrator/Orchestrator.mjsdream task currently callsthis.dreamService.processUndigestedSessions()directly.ai/scripts/runners/runSandman.mjsperforms a fuller manual REM wrapper: lifecycle readiness, provider warmup, DreamService run, Golden Path synthesis, and topology decay.ai/daemons/orchestrator/services/DreamService.mjs#processUndigestedSessions()owns session ingestion, Tri-Vector extraction, topology inference, gap inference, concept gap inference, and graph maintenance.ai/services/graph/SemanticGraphExtractor.mjsconsumes graph-provider dispatch and guardrail results.ai/services/graph/TopologyInferenceEngine.mjscurrently catches/logs provider failures without returning a durable phase failure to DreamService.ai/services/memory-core/helpers/ConsumerFrictionHelper.mjsenforces context-size guardrails.ai/daemons/orchestrator/services/GraphMaintenanceService.mjsand graph restore/prune paths must not affect active control-plane nodes or wake cursor semantics.ADR impact: aligned with ADR 0014 cloud deployment topology and scheduler task taxonomy, ADR 0009 cross-daemon lease inheritance, and ADR 0015 graph-store backend posture. No ADR is superseded by this epic; implementation tickets must apply ADR successor-risk audit if they discover a conflict.
The Fix
Create an orchestrator-owned REM-cycle surface, tentatively:
executeRemCycle({ reason, mode, includeGoldenPath, includeDecay, dryRun })The method coordinates readiness, DreamService execution, Golden Path, decay, and durable run/stage telemetry.
runSandman.mjsdelegates to this method instead of duplicating choreography. Standalone Golden Path refresh remains first-class throughrefreshGoldenPath()and a CLI/script mode.Child Work Plan
executeRemCycle()orchestrator methodrunSandman.mjsdelegation refactor with CLI mode selectorrefreshGoldenPath()orchestrator method and scriptContract Ledger Matrix
Orchestrator.executeRemCycle()@summary; PR body AC mappingrunSandman.mjsnpm run ai:run-sandmansmoke after #12059/#12063 mergeSignal Ledger
[GRADUATION_APPROVED]fdf5db7889f80d150bb035e6785bffc09517cda1bebe6c875027d209fe91be67, discussion comment https://github.com/neomjs/neo/discussions/12062#discussioncomment-17069572participationStatus: operator_benchedperai/graph/identityRoots.mjsUnresolved Dissent
None after GPT re-poll at body-sha
fdf5db7889f80d150bb035e6785bffc09517cda1bebe6c875027d209fe91be67. Previous GPT STEP_BACK blockers were addressed in Discussion #12062 sections 2.10, 2.11, 4, and 6.2.Unresolved Liveness
Gemini is operator-benched. Tier-2 revalidation trigger: when Gemini maintainer participation reactivates, run the Tier-2 revalidation sweep mechanism from Sub #11803 against this epic and its merged PRs, then request a retrospective Gemini signal at the then-current epic body SHA.
Discussion Criteria Mapping
Acceptance Criteria
executeRemCycle()and route scheduled dream execution through it.runSandman.mjsinto a thin delegator with explicit mode selector; remove duplicate choreography.refreshGoldenPath()and an operator-runnable command.<sessionId>:chunk:<N>, turn-aligned boundaries, deterministic reduce order, threshold activation, entity dedup, and chunk-failure semantics.Out of Scope
gh pr merge; merge execution remains human-only.Related
Origin Session ID: 6ca1b510-51c3-4fac-aa39-a0fd6941318c
Handoff Retrieval Hints
query_raw_memories("Discussion #12062 Orchestrator SSOT REM Sandman")query_raw_memories("gemma4 context window creation reuse benchmark Sandman")query_summaries("Sandman graph provider routing contextLimitTokens 256K")