LearnNewsExamplesServices
Frontmatter
titlefix(ai): chunk REM topology inference by turn (#13965)
authorneo-gpt
stateMerged
createdAtJun 24, 2026, 9:00 PM
updatedAtJun 24, 2026, 9:27 PM
closedAtJun 24, 2026, 9:27 PM
mergedAtJun 24, 2026, 9:27 PM
branchesdevcodex/12073-rem-topology-turn-chunks
urlhttps://github.com/neomjs/neo/pull/13966
contentTrust
projected
quarantined0
signals[]
Merged
neo-gpt
neo-gpt commented on Jun 24, 2026, 9:00 PM

Resolves #13965

Related: #12073

Threads complete raw memory-turn documents from DreamService into topology inference, then makes TopologyInferenceEngine chunk by memory-turn boundary before each graph-provider call. Each topology chunk now goes through the ConsumerFriction guardrail, uses graph-provider structured output/no-think options, and reports chunk totals into REM state. This keeps the broader #12073 Tri-Vector map/reduce lane open while removing the proven topology-side over-cap burn.

Evidence: L2 focused unit/static evidence landed; L3 live REM validation remains required after merge/restart because the over-cap symptom only appears during real local-model REM runs. Residual: full Tri-Vector map/reduce remains #12073.

Deltas from ticket

The implementation uses the existing sessionChunker primitive and subtracts the topology prompt envelope before chunking so “safe” chunks do not become unsafe after instructions are added. It adds no new deployment config leaf; required AiConfig.localModels.chat.* leaves are read at the topology use site and fail loud when stale or malformed.

Test Evidence

  • npm run agent-preflight -- ai/daemons/orchestrator/services/DreamService.mjs ai/services/graph/TopologyInferenceEngine.mjs test/playwright/unit/ai/daemons/orchestrator/services/DreamService.spec.mjs
  • npm run test-unit -- test/playwright/unit/ai/daemons/orchestrator/services/DreamService.spec.mjs → 33/33 passed
  • git diff --check

Post-Merge Validation

  • Restart orchestrator and confirm the next REM topology phase reports chunk totals in run state.
  • Confirm live local-model token growth stays within expected topology chunk bounds on a large memory-mining session.
  • Confirm #12073 remains open for full Tri-Vector map/reduce work.

Commit

  • 51116b608afix(ai): chunk REM topology inference by turn (#12073)

Authored by Euclid (GPT-5, Codex Desktop). Session 019ef378-527d-7393-bc74-ec3a1d3f2ddf.

tobiu
tobiu APPROVED reviewed on Jun 24, 2026, 9:27 PM

No review body provided.