feat(deployment): default to managed NATS workers

Autonomous workflows now always hand a complete task to a scoped archie-agent container. Embedded NATS is the default and external NATS changes only broker placement; legacy agent and containers.enabled inputs decode for migration but cannot select an execution path. The daemon flushes task-event subscriptions before a worker can publish, and runtime updates snapshot and restore the configured worker image.
This commit is contained in:
sam committed 2026-08-24 14:56:57 +10:00
1 parent 5d00ec7b0c
commit 972fb5b8e1
38 files changed
+497 -232

No files matched your search

+3 -3
View File
@@ -149,21 +149,21 @@ existing structure combines different owners.
| `DiffCapLines` | root `Config` | Agent-change policy value. |
| `MaxSteps`, `WallClock`, `GateMaxFailures` | `Budgets` | Workflow-execution policy, with units and zero/unlimited semantics made explicit. |
| `Class`, `APIKeyEnv`, `BaseURL` | `Provider` | Provider instance settings. Secret lookup becomes a `SecretRef`, not an environment variable name leaking into the provider domain. |
| `Mode`, `Command`, `Env` | `Agent` | Agent-execution infrastructure settings. Arbitrary environment injection is explicitly trust-sensitive. |
| `Mode`, `Command`, `Env` | `LegacyAgent` | Decode-only compatibility input for the removed executor selector. Delete after the config migration window; it has no runtime settings owner. |
| `Type`, `Host`, `Token` / `TokenEnv` (older form) | `Forge` | Forge adapter settings. The older `TokenEnv` input is accepted only at the loader boundary. |
| `Trigger`, `AckReaction`, label names | `Dispatch` | Work-intake and forge presentation policy. Label vocabulary is configurable per forge/identity association. |
| `Provider`, `ProviderConfig`, `SessionTTL` | `MemoryConfig` | Memory capability settings. Provider-specific data remains owned and validated by that provider. |
| `Name`, `Transport`, `Command`, `Args`, `WorkDir`, `URL` | `MCPServer` | One typed MCP server instance specification. Transport-specific variants must reject fields belonging to other variants. |
| `MaxResultChars`, `ParallelExecution` | `ToolPolicy` | Tool-execution policy values, not generic daemon configuration. |
| `URL`, `TokenEnv` | `NATSConfig` | NATS transport settings with a secret reference replacing the environment-name field. |
| `Enabled`, `Image`, `MaxConcurrency`, `MaxUptime`, `VolumeTTL`, `PullPolicy`, `Network` | `ContainerConfig` | Container-execution infrastructure settings and resource policy. |
| `Image`, `MaxConcurrency`, `MaxUptime`, `VolumeTTL`, `PullPolicy`, `Network` | `ContainerConfig` | Mandatory managed-worker infrastructure settings and resource policy. The legacy `enabled` input is decode-only. |
| model mappings, email, webhook, Telegram | `ChatConfig` | Separate channel instance settings plus channel-routing associations; there is no chat-wide settings owner. |
| `AllowedUserIDs`, `TokenEnv`, update commands | Telegram config | Telegram adapter settings and access policy. Secret and policy fields are distinct. |
| listen/relay addresses | email config | Email adapter instance settings. |
| webhook target | `Notify` | Notification adapter instance settings. |
| web listen address | `Web` | Web transport settings. |
| index directory and database path | `Indexing` | Index infrastructure settings, derived from storage settings unless explicitly overridden. |
| forge, dispatch, models, providers, agent, containers, memory, tools, indexing and repositories | `IdentityConfig` | Existing composite duplicates unrelated settings. Replace it with associations from an `IdentityID` to independently owned configured instances. |
| forge, dispatch, models, providers, containers, memory, tools, indexing and repositories | `IdentityConfig` | Existing composite duplicates unrelated settings. Replace it with associations from an `IdentityID` to independently owned configured instances. |
| owner, name, base, gate, protection, ecosystem, preflight, storage, retry and concurrency | `Repo` | Split across work intake, workspace, workflow execution, policy, gate, and scheduling as described in Repository settings. |
| `TaskConfig`, `TaskForge` | worker snapshot | Replace with the minimum immutable, versioned WorkflowExecution input assembled by the application. It is not a second configuration model. |
| `Extra` and arbitrary maps | root/provider config | Allowed only at an extension boundary whose owning plugin/provider supplies schema and validation. Core configuration never consumes an untyped catch-all. |
+4 -4
View File
@@ -1,6 +1,6 @@
# Embedded NATS execution -- decision
**Status:** Amended; implementation in progress
**Status:** Implemented
**Date:** 2026-08-24
@@ -31,9 +31,9 @@ NATS has two supported deployment shapes:
Both shapes have identical task semantics: one container and one full-task
request per workflow. Broker placement must not select a different executor.
The legacy `nats.mode = "off"`, `agent.mode = "inprocess"`, per-stage NATS, and
subprocess execution paths are migration inputs only and will be removed rather
than retained as production fallbacks.
The legacy `agent` section and `containers.enabled` key remain decode-only
migration inputs. `nats.mode = "off"`, per-stage NATS, in-process execution,
and subprocess execution are not production choices.
SQLite remains authoritative for task state. NATS is the sole autonomous work
handoff. SQLite recovery may identify work that needs republishing, but it must
+9 -10
View File
@@ -1,6 +1,6 @@
# Event capture storage -- decision
**Status:** Decided, not yet implemented
**Status:** Implemented
**Date:** 2026-08-22
**Beads issue:** `archie-core-t2db.1`
@@ -20,15 +20,14 @@ stream is introduced for capture.
### Why
**NATS is not unconditionally available today.** `config.NATSConfig.URL`
empty means no NATS client is constructed (`bootstrap.go`); embedded NATS
(`7d5u.2`) that would remove this gap is still open. `t2db.1`'s own
acceptance criteria require single-process behaviour to be a *deliberate*
decision, not an accident -- making capture NATS-only today would silently
regress the `local-ollama-standalone.toml` deployment profile, which this
epic's own precondition line ("capture is the precondition for everything
else") argues against. SQLite is the one store guaranteed present in every
deployment shape, because it already backs task state unconditionally.
**NATS availability does not make capture a broker concern.** NATS is now
unconditional for autonomous workflow handoff, including embedded mode, but
capture is also used by deployments with no repository workflow configured.
SQLite is already guaranteed present because it backs daemon state, and keeps
capture inspection independent of broker retention and consumer lifecycle.
The original version of this decision cited optional NATS as an additional
reason; that premise was superseded by `archie-core-q15y`, while the storage
fit and independence arguments remain.
**Capture's access pattern doesn't need what JetStream is for.** JetStream
earns its complexity for reaction delivery (`7d5u.2`) because multiple