Repository navigation
Description
Summary
Four pieces of the automations program were designed to land alongside or after the walker work, because each needs the durable walker or the engine protocol to change. None is on main. They are independent of each other except where noted. #4936 has the larger picture.
Anchors are at main da3b98b730 (2026-10-13). What the designs say is marked as design pass (2026-10-08 to 2026-10-09).
1. Test stand-ins in durable runs, and what the protocol needs for it
Today. The stand-ins a test names for the calls it replaces (a connector action, a model call, an agent node) are honoured by the in-process walker only (services/platform/lib/engine/core/execute/bench.ts). The durable stepper has none: the word bench does not occur in services/platform/backend/core/automations/stepper.ts. A run's mode is 'mock' | 'live' (services/platform/backend/domains/automations/store.ts:2737, :3181, :3282).
What it would give (design pass): a try or a test run that goes through the same durable machinery as a live run (queued, recorded, survives a restart, can pass a long step) and appears in the Runs list the same way.
Why the protocol is involved. A run that carries stand-ins must not be stepped by an engine that ignores them, because that engine would make the real calls. The protocol stamp is how an engine refuses a run it cannot read (services/platform/lib/engine/core/protocol.ts:1-10: "an engine refuses a run stamped above its own"). Raising the constant today renames every automation queue (services/platform/backend/jobs/tasks.ts:25) and trips the writer guard that expects '2' (services/platform/backend/db/migrations/0163_automation_legacy_protocol.sql:94).
Options for the protocol (no choice made here):
- Split the constant: what an engine reads moves to 3; what it steps (queue names, writer marker) stays 2. This is what the design pass proposed.
- Raise it and rename the queues with a drain window, accepting a release in which old and new workers do not share queues.
- Avoid a stamp by keeping stand-ins in the in-process walker, as today.
2. Preview mode
The owner said yes on 2026-10-08. A preview runs a saved version with real connector reads and real model calls (billed, budgets apply), holds writes back as "would have sent", simulates agent nodes, never starts from a trigger, and is for people who may author the automation. It would add a mode between mock and live, and a way to try a single model step with the real model. Like a test run it may name any saved version, which touches AUTO-R5 (a live run and every trigger run the deployed version; a test run is the exception, services/platform/backend/domains/automations/spec.md:98).
Today there are two modes (see 1). Whether a preview needs item 1 first: the design pass put both in the same engine area; not examined whether they can be separated.
3. A wait step
Not on main: a node is transform, llm, agent, subautomation or a registered capability (services/platform/lib/engine/core/types.ts:43-53), and none waits.
Design pass: type: wait with for: 2d or until: <time>, between one second and 30 days; the walker stores a timer in the cursor and parks the run, so a waiting run holds no lease; mocks and tests complete at once and say what they would have waited for; cancelling is today's cancel. A new node type is a protocol change by the file's own definition (protocol.ts:1-10, "which node types exist"), which is why the design put it after item 1.
Open: the cap (30 days, or 7), and whether a wait inside a forEach is a warning or an error once items run at the same time.
4. The run record says when a write was allowed without approval
Automation approval allowances are on main (#4763) and can be read and changed over MCP (#4894). The gate's decision knows who allowed it (services/platform/backend/core/approvals/policy.ts:50, by: 'rule' | 'allowance' | 'platform'), but the gate answers { decision: 'allow' } alone (services/platform/backend/domains/approvals/gate.ts:81), so a step an allowance let through is recorded like any other. The design pass wanted the run page's step to say that the write ran without approval and who granted that, and the approval record's metadata to name the grant. Nothing named allowedBy exists on main.
Not examined: where the run record would carry it without touching the walker; whether the Steps view or only the step's detail should say it.
Order
Items 1 and 3 share the protocol question. Items 2 and 4 are independent of each other. All four read more cleanly after #4927.
Activity
yannickmonney commentedon Nov 14, 2026
Decision
This issue becomes six PR-sized units. All of them are features, so they land on the feature line (feature-train, then release/0.6).
The rule for the protocol: split the constant.
ENGINE_READER_PROTOCOL): the highest run stamp this engine can step. Only the claim's deferral compares against it.AUTOMATION_WRITER_PROTOCOL): stays2. It names theautomation.v2.*queues, the writer marker, the 0163 guard and the Dockerfile's build check.A run's stamp says what the run needs, not who touched it last. It is set at insert to the reader version the run's features need; a plain run stays at 2. The stepper raises it only when the run brings in something new, for example when a subautomation's version is pinned mid-run. The claim no longer raises it to the engine's own number; otherwise every plain run touched by a new worker would lock out old workers during a rolling deploy. Each feature that an older engine would misread (stand-ins, preview, wait) raises the reader constant by one in its own PR. The queues and the writer guard never move.
Answers
WAIT_UNDER_ITERATION), because a child version deployed later can escape the save check.Rationale
The split leaves the writer contract (queues, fencing guard) untouched and still lets an engine refuse a run it cannot read. Raising the shared constant would force a release with a queue drain. Avoiding a stamp would rule out durable tests, preview and the wait step.
Stand-ins are refused on live runs in three places: the API, a DB CHECK and the stepper. Preview holds every action that is not a declared read and never reaches the approval gate. So no mix of engine versions can send a real write. Real model calls happen only in the stepper, so every billed call goes through the budget and appears in the run's record. The approval line is a snapshot taken at the step, because an allowance can be revoked later; it stores a user id, so erasure keeps working. The wait step reuses the existing park and sweep paths rather than adding a second timer mechanism.
Units (in order)
benchcolumn with a CHECK that refuses it on live runs, raises the reader constant, and shows the test verdict on the run. The deploy gate keeps its in-process suite.previewmode. Reads and model calls are real and budgeted. Writes and actions of unknown effect are held as "would have sent". Agent steps are simulated, a trigger cannot start a preview, and only the AUTO-R1 roles may start one. Raises the reader constant.fororuntil, from 1 second to 30 days. A live run parks with no lease through the existing park path, woken by a delayed job plus the existing sweeper. Mock, test and preview runs finish at once and say what they would have waited for. Under forEach or repeatUntil it is an error at save and at runtime. A subautomation pin that brings in a wait raises the run's stamp. Raises the reader constant.Related: #4936, #4927, #4928, #4943, #5258.
Cross-issue amendments (decisions taken together with #4928, #4936, #4936, #5331):