Authored by Claude Opus 4.7 (Claude Code). Session 5572d9a5-558d-4bea-b416-e31496c289c4.
FAIR-band: in-band [verify @ merge-gate]
Resolves #11835
Summary
Sub 3 of Epic #11831. Deletes two parser surfaces whose sole runtime consumer (Orchestrator) was rewired in Sub 1 (#11833) to use Neo.util.Env from Sub 6 (#11832). Both functions had zero remaining non-test consumers per grep — pure dead code removal.
Surfaces removed
| Surface |
Before |
After (Orchestrator) |
Justification |
CadenceEngine.parseInterval(value, fallback) |
parseInt + clamp + fallback |
Env.parseNumber(process.env.X, 'X') ?? AiConfig.X lazy getter |
Substrate-utility-tier Neo.util.Env covers env-var parsing; AiConfig holds the canonical default |
PrimaryRepoSyncService.parseEnabledFlag(value, fallback) |
hardcoded ['0','false','no','off'] blocklist |
Env.parseBool(process.env.X, 'X') ?? resolveDeploymentEnabled('X') lazy getter |
Env.parseBool preserves all 4 legacy false tokens per Sub 6 (#11832) AC9 boolean compatibility |
No behavior change
Env.parseBool token semantics (Sub 6 AC9):
- true:
'true', 'yes', 'on', '1' (case-insensitive after trim)
- false:
'false', 'no', 'off', '0'
- other: warn + undefined
Strictly a superset of parseEnabledFlag's ['0','false','no','off'] false-token set. Any caller that previously got false from parseEnabledFlag continues to get false from Env.parseBool.
Env.parseNumber semantics: returns undefined for absent input (vs parseInterval's fallback). The consumer pattern Env.parseNumber(...) ?? AiConfig.X recovers the fallback at the call-site (the operator-mandated 2-value chain). Math.max(0, n) clamp deferred to caller — Orchestrator does not need it (intervals already validated by AiConfig schema).
Deltas from ticket
- Sub 3 AC4 (SwarmHeartbeatService:37 LOCAL drift) + AC5 (KbAlertRuleEngine:56 DEFAULT_COOLDOWN_MS) deferred to Sub 4 #11836 (sibling-daemon propagation) because their full removal requires consumer rewires that are Sub-1-style daemon refactors, not pure deletions. This PR scopes to the dead-code surfaces.
- #11827 closure deferred to post-merge
gh issue close #11827 --reason 'superseded by Epic #11831 Sub 3 #11835' — the ticket was an audit-record absorbed by this Epic.
Evidence: L1 (49/49 unit tests pass post-deletion) → L1 required (pure dead-code removal; behavioral parity proven by Sub 6 AC9 + Sub 1 #11833's already-merged consumer rewire).
Test Evidence
npm run test-unit -- test/playwright/unit/ai/daemons/services/CadenceEngine.spec.mjs test/playwright/unit/ai/daemons/services/PrimaryRepoSyncService.spec.mjs test/playwright/unit/ai/daemons/Orchestrator.spec.mjs → 49/49 pass (1.3s)
Test surface migration:
CadenceEngine.spec.mjs — 3 parseInterval tests removed (covered by test/playwright/unit/util/Env.spec.mjs parseNumber test suite)
PrimaryRepoSyncService.spec.mjs — parseEnabledFlag import + 4 inline assertions removed (covered by test/playwright/unit/util/Env.spec.mjs "preserves PrimaryRepoSyncService.parseEnabledFlag legacy false tokens" test)
Orchestrator.spec.mjs — already migrated by Sub 1 (#11833) merged
File-size delta: -42 lines net across 4 files (-59 deletions / +17 insertions).
Post-Merge Validation
Authored by Claude Opus 4.7 (Claude Code). Session 5572d9a5-558d-4bea-b416-e31496c289c4.
FAIR-band: in-band [verify @ merge-gate]
Resolves #11835
Summary
Sub 3 of Epic #11831. Deletes two parser surfaces whose sole runtime consumer (Orchestrator) was rewired in Sub 1 (#11833) to use
Neo.util.Envfrom Sub 6 (#11832). Both functions had zero remaining non-test consumers per grep — pure dead code removal.Surfaces removed
CadenceEngine.parseInterval(value, fallback)Env.parseNumber(process.env.X, 'X') ?? AiConfig.Xlazy getterNeo.util.Envcovers env-var parsing; AiConfig holds the canonical defaultPrimaryRepoSyncService.parseEnabledFlag(value, fallback)['0','false','no','off']blocklistEnv.parseBool(process.env.X, 'X') ?? resolveDeploymentEnabled('X')lazy getterEnv.parseBoolpreserves all 4 legacy false tokens per Sub 6 (#11832) AC9 boolean compatibilityNo behavior change
Env.parseBooltoken semantics (Sub 6 AC9):'true','yes','on','1'(case-insensitive after trim)'false','no','off','0'Strictly a superset of
parseEnabledFlag's['0','false','no','off']false-token set. Any caller that previously gotfalsefromparseEnabledFlagcontinues to getfalsefromEnv.parseBool.Env.parseNumbersemantics: returnsundefinedfor absent input (vsparseInterval's fallback). The consumer patternEnv.parseNumber(...) ?? AiConfig.Xrecovers the fallback at the call-site (the operator-mandated 2-value chain).Math.max(0, n)clamp deferred to caller — Orchestrator does not need it (intervals already validated by AiConfig schema).Deltas from ticket
gh issue close #11827 --reason 'superseded by Epic #11831 Sub 3 #11835'— the ticket was an audit-record absorbed by this Epic.Evidence: L1 (49/49 unit tests pass post-deletion) → L1 required (pure dead-code removal; behavioral parity proven by Sub 6 AC9 + Sub 1 #11833's already-merged consumer rewire).
Test Evidence
npm run test-unit -- test/playwright/unit/ai/daemons/services/CadenceEngine.spec.mjs test/playwright/unit/ai/daemons/services/PrimaryRepoSyncService.spec.mjs test/playwright/unit/ai/daemons/Orchestrator.spec.mjs→ 49/49 pass (1.3s)Test surface migration:
CadenceEngine.spec.mjs— 3parseIntervaltests removed (covered bytest/playwright/unit/util/Env.spec.mjsparseNumbertest suite)PrimaryRepoSyncService.spec.mjs—parseEnabledFlagimport + 4 inline assertions removed (covered bytest/playwright/unit/util/Env.spec.mjs"preserves PrimaryRepoSyncService.parseEnabledFlag legacy false tokens" test)Orchestrator.spec.mjs— already migrated by Sub 1 (#11833) mergedFile-size delta: -42 lines net across 4 files (-59 deletions / +17 insertions).
Post-Merge Validation
gh issue close 11827 --reason 'superseded by Epic #11831 Sub 3 #11835'