LearnNewsExamplesServices
Frontmatter
id13830
titleExtract GoldenPathSynthesizer issue-focus builders
stateClosed
labels
enhancementairefactoringarchitecturemodel-experience
assigneesneo-gpt
createdAtJun 22, 2026, 12:31 AM
updatedAtJun 22, 2026, 2:10 AM
githubUrlhttps://github.com/neomjs/neo/issues/13830
authorneo-gpt
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtJun 22, 2026, 2:10 AM

Extract GoldenPathSynthesizer issue-focus builders

Closed v13.1.0/archive-v13-1-0-chunk-5 enhancementairefactoringarchitecturemodel-experience
neo-gpt
neo-gpt commented on Jun 22, 2026, 12:31 AM

Context

This ticket comes from a same-turn tech-debt-radar pass after PR #13829 was routed for review. The operator and peer memory already identified ai/services/graph/GoldenPathSynthesizer.mjs as a high-value architectural debt pocket: the class is now 1737 lines, marked singleton:true, has 26 static methods, and also exports 3 standalone helper functions.

The first safe split is not the Chroma/SQLite scoring core. It is the repo-synced issue visibility surface: Current Release / Incident Focus, Stale Assignment Candidates, and Silent Threads. Those helpers parse local issue markdown and render handoff sections; they are mostly pure filesystem/frontmatter logic and already have focused unit coverage inside test/playwright/unit/ai/services/graph/GoldenPathSynthesizer.spec.mjs.

Release classification: post-release / radar follow-up. This is maintainability hardening for the Golden Path surface, not a release-blocking fix for #13750.

The Problem

GoldenPathSynthesizer.mjs mixes at least four responsibilities in one singleton class:

  • embedding dimension helpers;
  • issue-sync section builders/renderers;
  • PR/review-family summarization helpers;
  • Chroma + SQLite computed-routing synthesis and final handoff writing.

The issue-sync section builders are a clear extraction seam because they are not the graph-ranking core and do not need singleton state. Keeping them inside the main synthesizer increases review risk on every Golden Path patch: small visibility-section fixes require loading and modifying the same file as the routing algorithm.

Memory Core prior-art sweep found a same-day peer note from @neo-opus-ada recording the operator example: GoldenPathSynthesizer.mjs as a 1500+ line singleton/static-method anti-pattern and a candidate for multiple split tickets. KB sweep found no existing decomposition ticket; it only surfaced the feature tickets that added the sections (#13758, #10275) and older steering discussions.

The Architectural Reality

Evidence from current dev:

  • ai/services/graph/GoldenPathSynthesizer.mjs is 1737 lines.
  • It has singleton:true but 26 static methods, so a large share of behavior is utility-style logic rather than singleton state.
  • The issue-focus seam spans functions such as collectIssueMarkdownFiles, extractIssueCommentBlocks, findLastQualifyingAssignmentActivity, buildStaleAssignmentCandidates, renderStaleAssignmentCandidatesSection, findLatestIssueActivity, buildSilentThreadCandidates, renderSilentThreadCandidatesSection, scoreCurrentFocusIssue, buildCurrentFocusCandidates, and renderCurrentFocusCandidatesSection.
  • Existing sibling pure-helper modules already live in ai/services/graph/, including providerDispatch.mjs, providerReadinessHelper.mjs, and sessionChunker.mjs.

Pre-Flight (structural fast-path): future authoring ai/services/graph/issueFocusSections.mjs matches sibling pure-helper modules in ai/services/graph/; sibling-file-lift applies; no novel directory choice. Map-maintenance: not needed, because ai/services/graph/ already covers graph-service helpers and this is another same-role helper module.

The Fix

Extract the issue-sync visibility-section helpers from GoldenPathSynthesizer.mjs into a focused pure helper module, tentatively ai/services/graph/issueFocusSections.mjs.

Keep the public behavior and rendered markdown stable. GoldenPathSynthesizer should import and call the extracted helpers, while the unit tests should continue to cover the same section behavior. This is an SRP split only: no scoring formula changes, no Chroma query changes, no SQLite graph-routing changes, and no new scheduler behavior.

Contract Ledger Matrix

Target Surface Source of Authority Proposed Behavior Fallback Docs Evidence
GoldenPathSynthesizer.synthesizeGoldenPath() handoff sections Existing GoldenPathSynthesizer.mjs behavior and Golden Path unit spec Renders Current Focus, Stale Assignment, and Silent Threads via extracted helpers with identical output Import failure should fail tests; no runtime fallback needed Existing handoff format comments remain in code Focused unit spec for GoldenPathSynthesizer section output
New issueFocusSections.mjs helper exports Sibling pure-helper pattern in ai/services/graph/ Own issue markdown parsing, candidate scoring, and section rendering helpers None; helpers are deterministic and testable JSDoc @summary on each exported function Unit tests exercise helpers through synthesizer and/or direct helper tests

Decision Record impact

None. This is aligned with existing ai/services/graph/ pure-helper extraction patterns and does not change ADR-governed graph steering semantics.

Acceptance Criteria

  • Extract Current Release / Incident Focus helper logic from GoldenPathSynthesizer.mjs into a focused graph helper module.
  • Extract Stale Assignment helper logic into the same module or a clearly justified sibling module.
  • Extract Silent Threads helper logic into the same module or a clearly justified sibling module.
  • GoldenPathSynthesizer.synthesizeGoldenPath() keeps the same rendered section order and markdown content for existing covered cases.
  • Existing GoldenPathSynthesizer unit coverage remains green, with focused assertions proving the extracted helpers preserve behavior.
  • No changes to computed Golden Path scoring, Chroma candidate selection, SQLite structural scoring, or frontier -> GUIDES writes.

Out of Scope

  • Splitting the computed-routing / Chroma + SQLite scoring core.
  • Changing the Golden Path ranking formula, candidate pool, or Hebbian graph behavior.
  • Changing Sandman scheduling, heavy-maintenance leases, or manual Sandman execution.
  • Closing #13750.

Avoided Traps

  • Do not file a vague “decompose the large class” epic here. This is one concrete extraction seam.
  • Do not move routing semantics while extracting helpers. Visibility-only issue sections are the low-blast split; routing changes require their own proof path.
  • Do not introduce a new directory. ai/services/graph/ already hosts sibling helper modules for graph-service behavior.

Related

Related: #13750 Related: #13822 Related: #13828 Related: #13758 Related: #10275

Live latest-open sweep: checked latest 20 open issues at 2026-06-21T22:30:56Z; no equivalent extraction/decomposition ticket found. A2A in-flight sweep: checked latest 30 messages at 2026-06-21T22:30:56Z; no competing claim for GoldenPathSynthesizer issue-focus helper extraction found. KB duplicate sweep: GoldenPathSynthesizer issue focus section builders extraction duplicate ticket surfaced feature provenance (#13758, #10275) but no extraction ticket. GitHub exact sweep: GoldenPathSynthesizer decomposition, Golden Path current focus extract, and GoldenPathSynthesizer current focus returned no equivalent ticket.

Origin Session ID: 019ee5c2-82ba-7b73-8812-df59106ff61a

Retrieval Hint: query_raw_memories("GoldenPathSynthesizer huge singleton static methods SRP decomposition tech debt radar issue focus sections")

tobiu referenced in commit fdd2913 - "refactor(ai): extract Golden Path issue-focus helpers (#13830) (#13831)" on Jun 22, 2026, 2:10 AM
tobiu closed this issue on Jun 22, 2026, 2:10 AM