LearnNewsExamplesServices
Frontmatter
id12105
titleStage 3: orchestrator codemod — delete 16 delegation getters
stateClosed
labels
enhancementairefactoring
assigneesneo-opus-ada
createdAtMay 27, 2026, 10:14 PM
updatedAtJun 7, 2026, 7:16 PM
githubUrlhttps://github.com/neomjs/neo/issues/12105
authorneo-opus-ada
commentsCount2
parentIssue12101
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtMay 30, 2026, 1:24 AM

Stage 3: orchestrator codemod — delete 16 delegation getters

Closed v13.0.0/archive-v13-0-0-chunk-14 enhancementairefactoring
neo-opus-ada
neo-opus-ada commented on May 27, 2026, 10:14 PM

Context

Stage 3 of Epic #12101 (Greenfield aiConfig). Sub-class C from the Discussion #12100 consumer ledger: pure delegation getters of the form get X() { return AiConfig.X.Y }, introduced in PR #12098. Discussion #12100 universal-bans them — "getter is pure indirection; consumer should read aiConfig.X.Y at point of use" — as part of retiring ~900–1200 LOC of getter/validator/duplication boilerplate.

A fresh inventory (2026-05-30) finds 19 such getters in ai/daemons/orchestrator/Orchestrator.mjs — up from the 16 the title cites; the tenantRepoSync.* + lms/mlx getters landed after #12100's count. The original title figure is therefore stale; the ledger below is authoritative.

Migration shape: delete the getter, inline its AiConfig.<path> read at each call site. Behaviour-preserving.

Contract Ledger

  • Before (uniform): this.<getter> read inside Orchestrator.mjs.
  • After: the inline AiConfig.<path> expression at point of use (see table).
  • Source of authority: AiConfig (the Tier-1 realm root Neo.ai.Config).
  • Consumers: internal only — ~25 this.<getter> reads in Orchestrator.mjs (task-definition options ~478–486, scheduling configs, chroma reaper 637/655/695, poll loop 918, start-log 556, swarm-heartbeat wiring 545–546). No external consumers — the ai/daemons/kb-*/Kb*Service.mjs this.pollIntervalMs fields are independent (set from their own config), and the TaskDefinitions.mjs / scheduling/*.mjs matches are @param docs for the passed options, not the getters. Verified by grep 2026-05-30.
  • Tests: test/playwright/unit/ai/daemons/orchestrator/Orchestrator.invariants.spec.mjs + Orchestrator.spec.mjs — confirm none assert via a deleted getter; update any that do.
# Getter surface (deleted) After — inline read
1 pollIntervalMs AiConfig.orchestrator.intervals.pollMs
2 summarySweepIntervalMs AiConfig.orchestrator.intervals.summarySweepMs
3 kbSyncIntervalMs AiConfig.orchestrator.intervals.kbSyncMs
4 backupIntervalMs AiConfig.orchestrator.intervals.backupMs
5 primaryDevSyncIntervalMs AiConfig.orchestrator.intervals.primaryDevSyncMs
6 tenantRepoSyncIntervalMs AiConfig.orchestrator.intervals.tenantRepoSyncMs
7 tenantRepoSyncSweepCadenceMs AiConfig.orchestrator.tenantRepoSync.sweepCadenceMs
8 tenantRepoSyncJitterRatio AiConfig.orchestrator.tenantRepoSync.jitterRatio
9 dreamIntervalMs AiConfig.orchestrator.intervals.dreamMs
10 goldenPathIntervalMs AiConfig.orchestrator.intervals.goldenPathMs
11 swarmHeartbeatIntervalMs AiConfig.orchestrator.intervals.swarmHeartbeatMs
12 swarmHeartbeatTargetSource AiConfig.orchestrator.swarmHeartbeat?.targetSource ?? null
13 chromaPort AiConfig.engines.chroma?.port
14 chromaMaxRuntimeMs AiConfig.orchestrator.chroma?.maxRuntimeMs
15 mlxModel AiConfig.orchestrator.mlx?.model
16 mlxPort AiConfig.orchestrator.mlx?.port
17 lmsModel AiConfig.orchestrator.lms?.model
18 lmsPort AiConfig.orchestrator.lms?.port
19 lmsHost AiConfig.openAiCompatible?.host

Acceptance Criteria

  • AC-Stage3-1: Delete all 19 pure-delegation getters (body matches return AiConfig…) from Orchestrator.mjs.
  • AC-Stage3-2: Replace every internal this.<getter> read with the inline AiConfig.<path> read from the ledger. Behaviour unchanged (same values, read at point of use).
  • AC-Stage3-3: No external consumer touched (verified none); the Kb*Service / TaskDefinitions matches are unrelated and stay as-is.
  • AC-Stage3-4: Orchestrator unit + invariant specs green; add/adjust coverage if any asserted through a now-deleted getter.

Out of Scope

  • Logic-bearing gettersmlxEnabled / lmsEnabled (!! coercion), the *Enabled getters (delegate to resolveDeploymentEnabled / resolveCloudOnlyEnabled), swarmHeartbeatIdentity (Env.parseString), and the multi-line swarmHeartbeatExplicitTargets / lmsModels blocks. These are NOT pure delegation; any seam decision is separate.
  • Sub-class E (hidden-default-fallback) — #12100 folds it into the Stage-3+ sweep, but it is a distinct ban; track separately if hits surface here.
  • Stage 4 services + MCP-server codemod (#12106).
  • The thin-child overlay (the reframed #12102).

Related

  • Parent Epic: #12101 (Stage 3). Source: Discussion #12100 (sub-class C; §"Stage 3 codemod-sweep prep" — "16 sites … mechanical delete-getter + replace-with-inline-read"). Sibling: #12106 (Stage 4).
  • Anti-pattern origin: PR #12098.
tobiu closed this issue on May 30, 2026, 1:24 AM
tobiu referenced in commit 0917b35 - "refactor(ai): inline Orchestrator's 19 delegation getters as direct AiConfig reads (#12105) (#12183) on May 30, 2026, 1:24 AM