LearnNewsExamplesServices
Frontmatter
id13956
titleBound Sandman handoff bloat and restore brief
stateClosed
labels
bugaimodel-experience
assigneesneo-gpt
createdAtJun 24, 2026, 5:12 PM
updatedAtJun 24, 2026, 5:33 PM
githubUrlhttps://github.com/neomjs/neo/issues/13956
authorneo-gpt
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtJun 24, 2026, 5:33 PM

Bound Sandman handoff bloat and restore brief

Closed v13.1.0/archive-v13-1-0-chunk-6 bugaimodel-experience
neo-gpt
neo-gpt commented on Jun 24, 2026, 5:12 PM

Context

The current generated resources/content/sandman_handoff.md has grown to roughly 400 lines and is being loaded into agent context as a broad handoff surface. The immediate operator report points to four high-noise areas: uncapped-looking Recent Open PR rendering, a redundant PRs-by-author expansion, an unbounded topological conflict alert list, and the missing Strategic Interpretation brief under the Computed Golden Path.

Live latest-open sweep: checked latest 20 open issues at 2026-06-24T15:10Z; no equivalent Sandman handoff bloat / Strategic Interpretation repair ticket found. A2A in-flight sweep: checked latest 30 all-state messages at 2026-06-24T15:10Z; no competing lane-claim found. Local/KB sweep found closed predecessors #12655, #10219, #11177, and #9952, but no open ticket covering this regression cluster.

Release classification: boardless follow-up hardening. This improves agent context quality but does not block the current deployment path.

The Problem

The handoff is supposed to be a compact, high-signal overview for the swarm. Instead, it now contains low-signal expansion that competes with the actual routing surface:

  • Recent Open PRs does not render an (x / y) count like the bounded gap lists, and the configured default is still 5 while the requested current cap is 10.
  • The additional per-author PR expansion duplicates the recent PR list while adding lane/cycle/reviewer/status/SHA detail that is better obtained from live PR state when needed.
  • Topological conflict alerts are inserted as standalone markdown lines and can grow without bound across REM cycles.
  • Strategic Interpretation is present only on successful LLM JSON extraction; provider failures or invalid output silently remove the summary instead of keeping a compact fallback explanation.

The Architectural Reality

ai/services/graph/GoldenPathSynthesizer.mjs owns the centralized handoff render pass and writes aiConfig.handoffFilePath. Its renderRecentOpenPrSummary() owns the Recent Open PR list, and synthesizeGoldenPath() currently renders both that list and a larger per-author Active PR Cycle State expansion.

ai/services/graph/TopologyInferenceEngine.mjs owns topological conflict extraction and currently inserts - **[TYPE]** ... (Source Session: ...) entries directly before ## Computed Golden Path without a render cap.

learn/agentos/DreamPipeline.md documents sandman_handoff.md as the advisory Golden Path handoff. The Strategic Interpretation brief is documented as the compact LLM-generated explanation for the computed route, so its silent disappearance is a context-quality regression.

The Fix

  • Render Recent Open PRs as a bounded section with a count, capped at 10 by default.
  • Remove the per-author PR expansion from Active PR Cycle State; keep only the compact recent list.
  • Centralize topological conflict alert rendering so the handoff keeps at most 5 alerts and does not grow indefinitely.
  • Preserve the LLM-generated Strategic Interpretation path, but render a deterministic compact fallback when provider generation or JSON extraction fails.
  • Update focused unit coverage for the PR cap/count, removed author expansion, conflict-alert cap, and Strategic Interpretation fallback.

Contract Ledger Matrix

Target Surface Source of Authority Proposed Behavior Fallback Docs Evidence
resources/content/sandman_handoff.md Recent Open PRs GoldenPathSynthesizer.renderRecentOpenPrSummary() Max 10 rows, header shows rendered count and total count Empty string when no PRs exist learn/agentos/DreamPipeline.md Unit test
resources/content/sandman_handoff.md Active PR Cycle State GoldenPathSynthesizer.synthesizeGoldenPath() No per-author PR expansion Live GitHub PR state remains the detail source learn/agentos/DreamPipeline.md Unit test
Topological conflict alerts TopologyInferenceEngine.extractTopology() At most 5 rendered alerts in the handoff No write when there are no conflicts learn/agentos/DreamPipeline.md Unit test
Strategic Interpretation GoldenPathSynthesizer.synthesizeGoldenPath() LLM brief when valid; deterministic fallback when invalid/offline Compact fallback text learn/agentos/DreamPipeline.md Unit test

Decision Record impact

None. This aligns the existing Dream Pipeline handoff with its documented compact advisory role.

Acceptance Criteria

  • Recent Open PRs renders no more than 10 PRs and includes an (x / y) count.
  • The generated handoff no longer contains PRs grouped by author under ### @neo-* subsections.
  • Topological conflict alerts are capped at 5 and repeated extraction cannot grow the handoff indefinitely.
  • The Computed Golden Path includes Strategic Interpretation when LLM generation succeeds and a compact deterministic fallback when it fails or returns invalid JSON.
  • Focused unit tests cover the changed render contracts.

Out of Scope

  • Reworking Golden Path scoring or candidate selection.
  • Changing AgentOrchestrator parsing behavior.
  • Manually editing the generated resources/content/sandman_handoff.md as the fix.
  • Changing the gap-section caps beyond the already bounded shape.

Related

#12655, #10219, #11177, #9952, #13750, #13849

Origin Session ID: cd4ef6e5-e52d-475f-a8b1-a9b781c5c91d

Handoff Retrieval Hint: sandman_handoff bloat Strategic Interpretation Recent Open PRs topological conflict alerts cap

tobiu referenced in commit 99686bf - "fix(ai): bound Sandman handoff output (#13956) (#13957)" on Jun 24, 2026, 5:33 PM
tobiu closed this issue on Jun 24, 2026, 5:33 PM