Context
Parent #13852 tracks the full native-Ollama lifecycle gap, including live heavy-session evidence. The current Orchestrator implementation slice is narrower: it wires an orchestrator-owned local-dev ollama serve task and reuses the already-delivered native Ollama readiness helper (#13865) for model residency/context convergence. This child exists so the PR can close the delivered L2 wiring without auto-closing #13852 while its live-evidence AC remains open.
Release classification: boardless (close-target split for an already implemented L2 wiring slice; not a release-blocking scope expansion).
Live latest-open sweep: checked latest 20 open issues on 2026-06-22; #13852 is the parent, #13865 is the readiness-only sibling, #13862 is compose-only, and no existing narrow ollama serve Orchestrator task leaf exists. A2A recency sweep: latest 30 messages checked; only @neo-gpt's own #13852/#13865/#13863 claims overlap this scope.
The Problem
lint-pr-body requires a truthful Resolves #N target. Closing #13852 from the L2 wiring PR would overstate delivery because #13852 still asks for live evidence: with provider set to native Ollama, a heavy session digests after orchestrator boot. The code slice is valuable and testable, but it should close a narrower leaf while #13852 remains the live-validation parent.
The Architectural Reality
ai/daemons/orchestrator/taskDefinitions.mjs owns pure child-process task descriptors. It must not read env vars or re-resolve AiConfig directly.
ai/daemons/orchestrator/Orchestrator.mjs is the entrypoint that reads AiConfig and forwards concrete values into buildTaskDefinitions().
ai/services/graph/providerReadinessHelper.mjs#buildOllamaReadinessConfig is the native-Ollama role-selector source of truth.
ai/services/graph/providerReadinessHelper.mjs#ensureOllamaModelsReady owns native Ollama warm-up and loaded-context verification. This ticket consumes that helper; it does not fork readiness logic.
- ADR 0019 applies: AiConfig is read at the use-site entrypoint and passed as concrete values into pure helpers.
The Fix
Add the local-dev native Ollama lifecycle lane:
- Add
orchestrator.ollama.enabled to the tracked Tier-1 config template.
- Have
Orchestrator build native Ollama readiness config from AiConfig and forward concrete host, roles, keep-alive, and resident-model requirements into task definitions.
- Add an
ollama continuous task that starts ollama serve only when roles select provider ollama.
- Derive
OLLAMA_HOST, OLLAMA_KEEP_ALIVE, OLLAMA_CONTEXT_LENGTH, and OLLAMA_MAX_LOADED_MODELS for the spawned server from canonical config values.
- Use the existing
ensureOllamaModelsReady() helper in liveness/preload paths so an already-running Ollama server converges residency/context without spawn churn.
- Cover config defaults, pure task construction, Orchestrator getters, and continuous-task scheduling with focused unit tests.
Contract Ledger Matrix
| Target Surface |
Source of Authority |
Proposed Behavior |
Fallback |
Docs |
Evidence |
orchestrator.ollama.enabled |
ai/config.template.mjs |
Enables orchestrator-owned native Ollama lifecycle only when provider roles target ollama |
Task omitted when no native Ollama roles exist |
JSDoc in config template |
config.template.spec.mjs |
tasks.ollama |
taskDefinitions.mjs |
Starts ollama serve, defers duplicate listener reaping, and uses provider liveness instead of PID-only churn |
No task when disabled or no roles |
Task JSDoc + tests |
daemon.spec.mjs, Orchestrator.spec.mjs |
| Ollama preload/context convergence |
providerReadinessHelper.mjs |
Reuses ensureOllamaModelsReady() for num_ctx and residency checks |
Parent #13852 retains live heavy-session proof |
Helper JSDoc from #13865 |
daemon.spec.mjs, Orchestrator.invariants.spec.mjs |
Decision Record impact
Aligned with ADR 0019 (AiConfig reactive Provider SSOT). No ADR amendment required.
Acceptance Criteria
Out of Scope
- Live heavy-session digestion evidence for the parent #13852.
- Compose-local-model serving caps (#13862 / PR #13863).
- Native Ollama loaded-context enforcement helper internals (#13865 / PR #13866).
- Model-name / JSON-schema provider parity (#13853/#13854).
Related
Parent: #13852. Siblings: #13862, #13865, #13851. Epic/root context: #13624, #13750.
Handoff Retrieval Hints: search Memory Core/A2A for #13852 local-dev native Ollama serve lifecycle, buildOllamaReadinessConfig, ensureOllamaModelsReady, and commit d11cee1c7f.
Context
Parent #13852 tracks the full native-Ollama lifecycle gap, including live heavy-session evidence. The current Orchestrator implementation slice is narrower: it wires an orchestrator-owned local-dev
ollama servetask and reuses the already-delivered native Ollama readiness helper (#13865) for model residency/context convergence. This child exists so the PR can close the delivered L2 wiring without auto-closing #13852 while its live-evidence AC remains open.Release classification: boardless (close-target split for an already implemented L2 wiring slice; not a release-blocking scope expansion).
Live latest-open sweep: checked latest 20 open issues on 2026-06-22; #13852 is the parent, #13865 is the readiness-only sibling, #13862 is compose-only, and no existing narrow
ollama serveOrchestrator task leaf exists. A2A recency sweep: latest 30 messages checked; only @neo-gpt's own #13852/#13865/#13863 claims overlap this scope.The Problem
lint-pr-bodyrequires a truthfulResolves #Ntarget. Closing #13852 from the L2 wiring PR would overstate delivery because #13852 still asks for live evidence: with provider set to native Ollama, a heavy session digests after orchestrator boot. The code slice is valuable and testable, but it should close a narrower leaf while #13852 remains the live-validation parent.The Architectural Reality
ai/daemons/orchestrator/taskDefinitions.mjsowns pure child-process task descriptors. It must not read env vars or re-resolve AiConfig directly.ai/daemons/orchestrator/Orchestrator.mjsis the entrypoint that readsAiConfigand forwards concrete values intobuildTaskDefinitions().ai/services/graph/providerReadinessHelper.mjs#buildOllamaReadinessConfigis the native-Ollama role-selector source of truth.ai/services/graph/providerReadinessHelper.mjs#ensureOllamaModelsReadyowns native Ollama warm-up and loaded-context verification. This ticket consumes that helper; it does not fork readiness logic.The Fix
Add the local-dev native Ollama lifecycle lane:
orchestrator.ollama.enabledto the tracked Tier-1 config template.Orchestratorbuild native Ollama readiness config fromAiConfigand forward concrete host, roles, keep-alive, and resident-model requirements into task definitions.ollamacontinuous task that startsollama serveonly when roles select providerollama.OLLAMA_HOST,OLLAMA_KEEP_ALIVE,OLLAMA_CONTEXT_LENGTH, andOLLAMA_MAX_LOADED_MODELSfor the spawned server from canonical config values.ensureOllamaModelsReady()helper in liveness/preload paths so an already-running Ollama server converges residency/context without spawn churn.Contract Ledger Matrix
orchestrator.ollama.enabledai/config.template.mjsollamaconfig.template.spec.mjstasks.ollamataskDefinitions.mjsollama serve, defers duplicate listener reaping, and uses provider liveness instead of PID-only churndaemon.spec.mjs,Orchestrator.spec.mjsproviderReadinessHelper.mjsensureOllamaModelsReady()fornum_ctxand residency checksdaemon.spec.mjs,Orchestrator.invariants.spec.mjsDecision Record impact
Aligned with ADR 0019 (AiConfig reactive Provider SSOT). No ADR amendment required.
Acceptance Criteria
orchestrator.ollama.enabledwith env override.buildTaskDefinitions()without duplicating role-selection logic.buildTaskDefinitions()creates noollamatask unless the lane is enabled and at least one role targets native Ollama.tasks.ollamastartsollama servewith environment derived from canonical provider/local-model config.Out of Scope
Related
Parent: #13852. Siblings: #13862, #13865, #13851. Epic/root context: #13624, #13750.
Handoff Retrieval Hints: search Memory Core/A2A for
#13852 local-dev native Ollama serve lifecycle,buildOllamaReadinessConfig,ensureOllamaModelsReady, and commitd11cee1c7f.