LearnNewsExamplesServices
Frontmatter
id12071
titleSub 5: Standalone refreshGoldenPath() orchestrator method + npm script
stateClosed
labels
enhancementaiarchitecturemodel-experience
assignees[]
createdAtMay 27, 2026, 3:43 AM
updatedAtMay 27, 2026, 3:59 AM
githubUrlhttps://github.com/neomjs/neo/issues/12071
authorneo-opus-4-7
commentsCount1
parentIssue12065
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtMay 27, 2026, 3:59 AM

Sub 5: Standalone refreshGoldenPath() orchestrator method + npm script

Closedenhancementaiarchitecturemodel-experience
neo-opus-4-7
neo-opus-4-7 commented on May 27, 2026, 3:43 AM

Parent Epic

#12065 — Sub 5 of 9. Depends on Sub 3 (orchestrator method substrate).

Premise

Per Discussion #12062 §2.9 (operator-direct workflow): operator reads sandman_handoff.md → sees top-5 weighted items → does 5 PRs → wants cheap refresh of the strategic brief without paying the full REM cycle cost. Full REM = MINUTES × N gemma calls; refresh = ~10s-1min (graph-walk + 1 interpretive LLM call). 10-60× cost asymmetry.

Currently the orchestrator's 'golden-path' cadence task bundles with the dream task via dependencies: ['dream'] — it only fires WITHIN the cadence cycle. There's no operator-invocable refresh-only path.

Prescription

New method on Orchestrator.mjs:

async refreshGoldenPath({reason}) {
    // No gemma extraction; just Hybrid GraphRAG over current graph state + 1 interpretive call
    return withHeavyMaintenanceLease(async () => {
        const remRun = this.openRemRun({runId: crypto.randomUUID(), reason, mode: 'refresh'});
        try {
            await GoldenPathSynthesizer.synthesizeGoldenPath({
                repoEnrichmentEnabled: this.goldenPathRepoEnrichmentEnabled
            });
            this.closeRemRun(remRun, 'completed');
        } catch (e) {
            this.closeRemRun(remRun, 'failed', {error: e});
            throw e;
        }
    }, {owner: 'orchestrator-golden-path-refresh', reason});
}

Add npm script ai:refresh-golden-path invoking runSandman.mjs refresh (Sub 4's mode-selector).

Acceptance Criteria

  • AC1: Orchestrator.refreshGoldenPath() method shipped
  • AC2: Method runs ONLY GoldenPathSynthesizer (no gemma extraction; no decay; no apoptosis)
  • AC3: Method records REM run/stage state via Sub 2's substrate (mode: 'refresh' distinguishes from full cycle)
  • AC4: Method honors heavy-maintenance-lease semantics (defers if another heavy task holds lease)
  • AC5: npm script ai:refresh-golden-path lands (preferred operator UX; not just ai:run-sandman refresh)
  • AC6: Unit + integration tests covering: refresh-only mode, refresh-during-active-dream-task (defer behavior), refresh-failure-recovery
  • AC7: Documentation update at learn/agentos/ describing the cheap-refresh UX + when to use it (post-PR-merge refresh use case)

Avoided Traps

  • ❌ Trigger any gemma extraction in refresh path — defeats the 10-60× cost asymmetry
  • ❌ Skip lease semantics — risks concurrent graph mutation during heavy work
  • ❌ Hide behind executeRemCycle({mode: 'refresh-only'}) — separate method is clearer + matches Discussion §2.9 design

Related

  • Epic #12065
  • Discussion #12062 §2.9 (cheap-refresh UX argument; split-and-recompose principle) + OQ2 [RESOLVED_TO_AC]
  • Sub 3 (executeRemCycle peer method on same orchestrator)
tobiu referenced in commit 394c531 - "feat(ai): gemma4 REM-pipeline benchmark harness + keep_alive probe (#12074) (#12076) on May 27, 2026, 2:14 PM
tobiu referenced in commit 93c6a91 - "refactor(ai): delete dead ai/scripts/runners/runGoldenPath.mjs (#12078) (#12079) on May 27, 2026, 2:15 PM