@jr2/orchestrator 0.5.1 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/agents-block.md +2 -2
- package/docs/concepts/agents-and-turns.md +56 -20
- package/docs/concepts/architecture.md +30 -17
- package/docs/concepts/charts.md +6 -3
- package/docs/concepts/converge.md +3 -0
- package/docs/concepts/effects.md +86 -31
- package/docs/concepts/machines-and-workflows.md +9 -0
- package/docs/concepts/pools-and-sources.md +6 -6
- package/docs/concepts/secrets-and-trust.md +126 -42
- package/docs/concepts/the-menu.md +3 -0
- package/docs/concepts/workspaces.md +129 -51
- package/docs/get-started/an-agent-in-a-sandbox.md +21 -19
- package/docs/get-started/have-your-assistant-write-a-machine.md +111 -40
- package/docs/get-started/install.md +4 -0
- package/docs/guides/add-tools-to-the-sandbox.md +17 -4
- package/docs/guides/bind-open-parts.md +5 -4
- package/docs/guides/cut-a-worktree.md +560 -0
- package/docs/guides/fix-a-failed-converge.md +1 -1
- package/docs/guides/let-an-agent-write-a-chart.md +5 -1
- package/docs/guides/look-inside-a-sandbox.md +18 -15
- package/docs/guides/move-from-kind-to-a-shared-cluster.md +16 -0
- package/docs/guides/push-and-sign-a-branch.md +67 -21
- package/docs/guides/run-a-command-or-call-a-url.md +84 -41
- package/docs/guides/run-one-worker-per-item.md +19 -18
- package/docs/guides/set-an-agents-access-and-dials.md +67 -22
- package/docs/guides/size-a-workspace.md +19 -6
- package/docs/guides/use-a-hosted-provider.md +6 -0
- package/docs/guides/watch-a-run.md +47 -24
- package/docs/guides/write-a-workflow.md +1 -1
- package/docs/llms.txt +33 -12
- package/docs/reference/authoring-surface/agent.md +34 -11
- package/docs/reference/authoring-surface/answer.md +19 -3
- package/docs/reference/authoring-surface/arg.md +27 -5
- package/docs/reference/authoring-surface/branchname.md +15 -0
- package/docs/reference/authoring-surface/command.md +36 -21
- package/docs/reference/authoring-surface/fail.md +17 -4
- package/docs/reference/authoring-surface/file.md +36 -16
- package/docs/reference/authoring-surface/http.md +108 -8
- package/docs/reference/authoring-surface/isready.md +14 -0
- package/docs/reference/authoring-surface/jr2setup.md +1 -1
- package/docs/reference/authoring-surface/open.md +36 -5
- package/docs/reference/authoring-surface/paramsof.md +22 -4
- package/docs/reference/authoring-surface/pool.md +4 -4
- package/docs/reference/authoring-surface/push.md +30 -12
- package/docs/reference/authoring-surface/readyof.md +21 -0
- package/docs/reference/authoring-surface/secret.md +25 -4
- package/docs/reference/authoring-surface/source.md +3 -3
- package/docs/reference/authoring-surface/type-agentdefinition.md +2 -2
- package/docs/reference/authoring-surface/type-agentslots.md +4 -1
- package/docs/reference/authoring-surface/type-anyframepath.md +14 -0
- package/docs/reference/authoring-surface/type-anyworktreepath.md +15 -0
- package/docs/reference/authoring-surface/type-bindactors.md +14 -0
- package/docs/reference/authoring-surface/type-binding.md +5 -6
- package/docs/reference/authoring-surface/type-commandinput.md +4 -3
- package/docs/reference/authoring-surface/type-commandoptions.md +0 -22
- package/docs/reference/authoring-surface/type-commandoutput.md +22 -4
- package/docs/reference/authoring-surface/type-customize.md +4 -2
- package/docs/reference/authoring-surface/type-dispatchoutput.md +8 -1
- package/docs/reference/authoring-surface/type-doorlessinput.md +19 -0
- package/docs/reference/authoring-surface/type-filebody.md +4 -8
- package/docs/reference/authoring-surface/type-framepath.md +14 -0
- package/docs/reference/authoring-surface/type-hostinjectedinput.md +2 -4
- package/docs/reference/authoring-surface/type-httpdefinition.md +6 -3
- package/docs/reference/authoring-surface/type-httpfileinput.md +20 -0
- package/docs/reference/authoring-surface/type-httpoutput.md +7 -1
- package/docs/reference/authoring-surface/type-lateroutcome.md +21 -0
- package/docs/reference/authoring-surface/type-namestart.md +77 -0
- package/docs/reference/authoring-surface/type-noslotworkspaceoptions.md +1 -6
- package/docs/reference/authoring-surface/type-notworktreekeys.md +12 -0
- package/docs/reference/authoring-surface/type-opencommandinput.md +7 -2
- package/docs/reference/authoring-surface/type-permissivenoslotworkspaceoptions.md +1 -6
- package/docs/reference/authoring-surface/type-permissiveworkspaceoptions.md +5 -10
- package/docs/reference/authoring-surface/type-poolnextinput.md +22 -0
- package/docs/reference/authoring-surface/type-poolspec.md +2 -2
- package/docs/reference/authoring-surface/type-pushinput.md +22 -3
- package/docs/reference/authoring-surface/type-pushoutput.md +32 -7
- package/docs/reference/authoring-surface/type-reposlot.md +5 -5
- package/docs/reference/authoring-surface/type-sandboxoptions.md +11 -4
- package/docs/reference/authoring-surface/type-slothandles.md +5 -13
- package/docs/reference/authoring-surface/type-sourcespec.md +10 -10
- package/docs/reference/authoring-surface/type-workspaced.md +29 -8
- package/docs/reference/authoring-surface/type-workspacehandles.md +5 -6
- package/docs/reference/authoring-surface/type-workspaceoptions.md +1 -13
- package/docs/reference/authoring-surface/type-worktreefound.md +16 -0
- package/docs/reference/authoring-surface/type-worktreeinput.md +56 -0
- package/docs/reference/authoring-surface/type-worktreekey.md +14 -0
- package/docs/reference/authoring-surface/type-worktreeoptions.md +29 -0
- package/docs/reference/authoring-surface/type-worktreeoutput.md +45 -0
- package/docs/reference/authoring-surface/type-worktreepath.md +16 -0
- package/docs/reference/authoring-surface/type-worktreeready.md +37 -0
- package/docs/reference/authoring-surface/type-worktreerefused.md +21 -0
- package/docs/reference/authoring-surface/workspace.md +65 -37
- package/docs/reference/authoring-surface/worktree.md +71 -0
- package/docs/reference/authoring-surface.md +30 -10
- package/docs/reference/cli.md +1 -1
- package/docs/reference/config.md +13 -4
- package/docs/reference/decisions/0001-operator-owned-generic-sandbox.md +10 -9
- package/docs/reference/decisions/0002-duplex-streaming-actor.md +17 -10
- package/docs/reference/decisions/0004-worktree-provisioning-model.md +27 -21
- package/docs/reference/decisions/0005-sandbox-pod-composition.md +29 -19
- package/docs/reference/decisions/0006-agent-control-surface.md +6 -3
- package/docs/reference/decisions/0012-workspace-wrapper-machine.md +30 -30
- package/docs/reference/decisions/0013-the-agent-reaches-its-machine-through-a-container-it-cannot-read.md +35 -17
- package/docs/reference/decisions/0015-authoring-surface-absorbs-the-mechanism.md +8 -2
- package/docs/reference/decisions/0016-agent-turn-mechanics-are-internal.md +9 -7
- package/docs/reference/decisions/0017-pool-over-a-source-port.md +6 -4
- package/docs/reference/decisions/0019-one-converging-command-against-the-current-context.md +21 -9
- package/docs/reference/decisions/0021-workspace-continuity-is-a-lease-that-answers-back.md +2 -1
- package/docs/reference/decisions/0023-the-harness-prints-the-conversation.md +8 -9
- package/docs/reference/decisions/0024-an-agents-turn-ends-with-the-state-that-asked-for-it.md +62 -65
- package/docs/reference/decisions/0027-the-harness-is-jr2s-own-server-flue-retires-the-wire-stays.md +9 -1
- package/docs/reference/decisions/0028-what-an-agent-may-do-to-the-workspace-is-part-of-its-definition.md +13 -12
- package/docs/reference/decisions/0031-menu-only-agents-run-on-the-instance-harness.md +4 -1
- package/docs/reference/decisions/0033-a-machine-declares-the-input-that-starts-it.md +18 -19
- package/docs/reference/decisions/0037-an-instance-builds-its-sandbox-images-jr2-injects-the-harness.md +8 -8
- package/docs/reference/decisions/0049-a-machine-carries-its-parts-and-composes-by-invoke.md +4 -4
- package/docs/reference/decisions/0051-a-repo-is-a-slot-on-the-workspace-and-a-cache-on-the-node.md +57 -46
- package/docs/reference/decisions/0052-a-sandbox-lands-where-an-ordinary-pod-lands-and-the-cache-follows-it.md +5 -0
- package/docs/reference/decisions/0053-a-fetch-inside-the-pod-asks-the-node-cache-and-the-cache-asks-the-remote.md +20 -8
- package/docs/reference/decisions/0057-a-turn-is-its-frame-its-dials-and-whether-it-continues.md +24 -24
- package/docs/reference/decisions/0058-a-harness-answers-the-orchestrator-alone.md +5 -3
- package/docs/reference/decisions/0059-a-harness-holds-stand-ins-and-the-custodian-holds-the-keys.md +110 -67
- package/docs/reference/decisions/0062-jr2-briefs-the-agent-on-its-seat-never-on-its-task.md +101 -74
- package/docs/reference/decisions/0063-the-orchestrator-watches-the-cluster.md +5 -6
- package/docs/reference/decisions/0066-a-model-tier-runs-a-real-model-and-a-change-to-what-it-reads-runs-the-tier.md +2 -0
- package/docs/reference/decisions/0067-an-effect-is-an-actor-slot-and-runs-at-most-once-unless-marked-idempotent.md +181 -153
- package/docs/reference/decisions/0068-an-effector-holds-an-effects-secrets-and-signs-its-wire.md +74 -63
- package/docs/reference/decisions/0070-a-machine-lends-its-parts-to-a-chart.md +31 -20
- package/docs/reference/decisions/0073-a-machine-fails-a-run-with-fail-and-an-uncaught-failure-ends-it-failed.md +1 -1
- package/docs/reference/decisions/0075-a-machine-cuts-a-worktree-and-the-workspace-only-clones.md +295 -0
- package/docs/reference/decisions/0076-an-agents-control-credential-lives-only-where-no-workspace-code-runs.md +320 -0
- package/docs/reference/decisions/0077-jr2-requires-landlock-on-every-sandbox-node.md +79 -0
- package/docs/reference/decisions.md +3 -0
- package/docs/reference/glossary.md +51 -12
- package/docs/reference/http-api.md +45 -7
- package/docs/reference/machines.md +0 -1
- package/docs/why.md +5 -4
- package/package.json +3 -3
- package/src/actor.ts +161 -35
- package/src/agent.ts +6 -6
- package/src/ambient.ts +3 -5
- package/src/chart.ts +186 -19
- package/src/charts.ts +9 -2
- package/src/config.ts +16 -6
- package/src/custodian.lua +17 -5
- package/src/custodian.ts +251 -77
- package/src/customize.ts +11 -3
- package/src/effect-checks.ts +50 -3
- package/src/effect.ts +343 -127
- package/src/effector-wire.ts +6 -3
- package/src/fail.ts +17 -4
- package/src/harness-client.ts +74 -31
- package/src/harness-env.ts +33 -0
- package/src/held-secrets.ts +125 -16
- package/src/holds.ts +3 -0
- package/src/http-effect.ts +88 -32
- package/src/http.ts +56 -17
- package/src/index.ts +15 -1
- package/src/internal.ts +1 -0
- package/src/kube-client.ts +6 -3
- package/src/machine-doc.ts +3 -4
- package/src/model-keys.ts +24 -0
- package/src/names.ts +19 -6
- package/src/notices.ts +443 -54
- package/src/open-body.ts +85 -19
- package/src/open.ts +36 -5
- package/src/parts.ts +40 -28
- package/src/party.ts +33 -0
- package/src/pick.ts +41 -7
- package/src/pool.ts +44 -23
- package/src/registration.ts +53 -11
- package/src/repo-identity.ts +7 -3
- package/src/repos.ts +20 -2
- package/src/run-host.ts +106 -20
- package/src/sandbox-effect.ts +217 -66
- package/src/sandbox-kube.ts +63 -16
- package/src/secret-placement.ts +9 -2
- package/src/setup.ts +86 -6
- package/src/tokens.ts +107 -32
- package/src/vocabulary.ts +23 -4
- package/src/wire.ts +10 -10
- package/src/workspace.ts +264 -253
- package/src/worktree.ts +249 -0
- package/docs/reference/authoring-surface/type-noslotspec.md +0 -26
- package/docs/reference/authoring-surface/type-workspacespec.md +0 -37
|
@@ -52,10 +52,9 @@ Decisions since then need pod facts at once: the scheduler's reason for a Pendin
|
|
|
52
52
|
merge patch per Workspace every 5 minutes, ±20% jitter so Leases never renew in lockstep after a restart. It no longer
|
|
53
53
|
carries detection.
|
|
54
54
|
- **The attach is a Harness call, not an exec.** The Harness runs the attach — ACL stamp, `git clone --shared` from the
|
|
55
|
-
node cache, remotes
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
Substrate need.
|
|
55
|
+
node cache, remotes — on `POST /attach { slots }`, authenticated like every Harness call (ADR-0058). No stream per
|
|
56
|
+
Workspace crosses the API server, and **`pods/exec` leaves the Orchestrator's RBAC**. It also binds work late: a pod
|
|
57
|
+
already running receives its Repos, the shape standby Sandboxes and Agent Substrate need.
|
|
59
58
|
|
|
60
59
|
## Considered options
|
|
61
60
|
|
|
@@ -70,8 +69,8 @@ Decisions since then need pod facts at once: the scheduler's reason for a Pendin
|
|
|
70
69
|
- **A jr2 WebSocket API.** Nothing to add: a Kubernetes watch is already a pushed stream of events.
|
|
71
70
|
- **Keep the attach as exec through the new client.** The exec protocol is the hardest part of any Kubernetes client, it
|
|
72
71
|
keeps one stream per Workspace through the API server, and it keeps `pods/exec`.
|
|
73
|
-
- **Attach from an init container.** Declarative, but it fixes the Repos
|
|
74
|
-
|
|
72
|
+
- **Attach from an init container.** Declarative, but it fixes the Repos at pod creation, which rules out late binding,
|
|
73
|
+
and it must wait on a cache that exists only after scheduling.
|
|
75
74
|
|
|
76
75
|
## Consequences
|
|
77
76
|
|
|
@@ -147,6 +147,8 @@ recover, finish — are exercised only one scripted tool call at a time.
|
|
|
147
147
|
the container before the guard takes the hog, and that trial is void. A claim whose setup the step must race (a Gate
|
|
148
148
|
answered while the model works, a mode moved while it composes) voids the trials whose setup lost the race; voids are
|
|
149
149
|
bounded, and a void past the bound counts against the floor and prints as a void in the failure list, never as a miss.
|
|
150
|
+
A trial whose own prompt, the one that carries its marker, is not in its kept conversation is void too: the follow
|
|
151
|
+
lost it, and the calls after another prompt are not the trial's, so they are never read as its miss or its pass.
|
|
150
152
|
- **Scenarios run `workers` at once, set per profile.** Each scenario has its own namespace, so scenarios are
|
|
151
153
|
independent, as `@kind`'s are. The profile's `workers` is how many run at once: `just e2e-model` passes it to cucumber
|
|
152
154
|
as `--parallel` when it is above 1. It is in the profile and not in `cucumber.json`, because its limits are the
|
|
@@ -3,9 +3,11 @@
|
|
|
3
3
|
An Effect is work a Machine does outside itself. A Machine already runs Agents and Gates as actors (ADR-0049); work such
|
|
4
4
|
as running the tests had no place of its own, so an author either asked an Agent to do it (and trusted its word) or
|
|
5
5
|
wrote a raw xstate promise that a restart ran again. jr2 builds four kinds: `command`, run a program in the Workspace;
|
|
6
|
-
`http`, call a URL — with a JSON or text body, or a Worktree file as its body; `push`, push
|
|
7
|
-
|
|
8
|
-
([ADR-0071](0071-a-run-starts-a-run-through-a-dispatch-effect.md)).
|
|
6
|
+
`http`, call a URL — with a JSON or text body, or a Worktree file as its body; `push`, push a Worktree's branch to its
|
|
7
|
+
Repo Slot's Binding; and `dispatch`, start a run of a registered Workflow, on this Orchestrator or another's
|
|
8
|
+
([ADR-0071](0071-a-run-starts-a-run-through-a-dispatch-effect.md)). A fifth, `worktree()`, is a kit Effect on the
|
|
9
|
+
`command` machinery that cuts a Worktree ([ADR-0075](0075-a-machine-cuts-a-worktree-and-the-workspace-only-clones.md)).
|
|
10
|
+
An Effect that holds a secret runs in an Effector
|
|
9
11
|
([ADR-0068](0068-an-effector-holds-an-effects-secrets-and-signs-its-wire.md)). A `command` whose env names a secret —
|
|
10
12
|
the credentialed `command` — runs there too, its child confined (below). A `dispatch` with no target runs in the
|
|
11
13
|
Orchestrator's own process, the one Effect that does: it starts the run through the run host and holds no secret.
|
|
@@ -15,20 +17,20 @@ Orchestrator's own process, the one Effect that does: it starts the run through
|
|
|
15
17
|
- **An Effect is an actor slot beside `agent()`.** `actors: { tests: command(["pnpm", "test"]) }`, invoked as
|
|
16
18
|
`src: "tests"`, with an `onDone` that routes on its output. xstate gives the rest: the Effect stops when its state
|
|
17
19
|
exits, its input persists with the snapshot, a `src` typo is a compile error, and `.provide()` is the unit-test seam.
|
|
18
|
-
The slot carries its parts as plain data — kind, placement, timeout; a `command`'s argv
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
running anything. A packaged Machine may leave an `http` url (whatever its body) or a
|
|
22
|
-
its place), and the name of one secret its auth, a header or a command's env names
|
|
23
|
-
|
|
24
|
-
one object with both keys for an
|
|
25
|
-
([ADR-0054](0054-the-kit-ships-machines-and-a-shipped-machine-leaves-its-parts-open.md));
|
|
26
|
-
Effect built again with the bound parts, and an Effect still Open runs nothing: its state's
|
|
27
|
-
written inline (`invoke: { src: http({...}) }`) is refused at build and at load, with the slot
|
|
28
|
-
xstate gives it a generated key that moves when a state is renamed, so the ledger, the report and
|
|
29
|
-
would name it by a number, and `customize()` — `provide`, keyed on `actors` — could not reach it. The
|
|
30
|
-
for `agent()` and `workspace()` (ADR-0049): a Part is a key of `actors`, and every Effect kind is one
|
|
31
|
-
`isEffect` reads).
|
|
20
|
+
The slot carries its parts as plain data — kind, placement, timeout; a `command`'s argv and the secrets its env names;
|
|
21
|
+
an `http` Effect's method, fixed host, the names of the secrets it names and whether its body is a Worktree file; a
|
|
22
|
+
`push`'s `pin`, `sign`, `squash`, `force` and `slot`; a cut's `expect` — which `jr2 up` prints and the Machine doc
|
|
23
|
+
carries, read without running anything. A packaged Machine may leave an `http` url (whatever its body) or a
|
|
24
|
+
`command`'s argv Open (`open` in its place), and the name of one secret its auth, a header or a command's env names
|
|
25
|
+
(`secret(open)`; never in a url), for the composer to bind once with
|
|
26
|
+
`customize(machine, { effects: { <slot>: { url } | { argv } | { secret } } })` — one object with both keys for an
|
|
27
|
+
Effect with two Open parts ([ADR-0054](0054-the-kit-ships-machines-and-a-shipped-machine-leaves-its-parts-open.md));
|
|
28
|
+
the slot then carries the Effect built again with the bound parts, and an Effect still Open runs nothing: its state's
|
|
29
|
+
`onError`. An Effect written inline (`invoke: { src: http({...}) }`) is refused at build and at load, with the slot
|
|
30
|
+
form in the message: xstate gives it a generated key that moves when a state is renamed, so the ledger, the report and
|
|
31
|
+
the Machine doc would name it by a number, and `customize()` — `provide`, keyed on `actors` — could not reach it. The
|
|
32
|
+
same rule holds for `agent()` and `workspace()` (ADR-0049): a Part is a key of `actors`, and every Effect kind is one
|
|
33
|
+
(the brand `isEffect` reads).
|
|
32
34
|
- **Between a pick and its work: `fromPick`, `paramsOf`, `answer`.** All optional; a plain mapper is legal.
|
|
33
35
|
`fromPick(def, fill)` is the `input` of a state a pick enters: the pick's params flow into the Effect's input by name,
|
|
34
36
|
`fill` returns only what the Machine adds, and the sum is checked against the Effect's input type — the security
|
|
@@ -51,7 +53,7 @@ Orchestrator's own process, the one Effect that does: it starts the run through
|
|
|
51
53
|
is written below (on a state's entry or exit, or on a transition of a state, at or below that Agent's state). On a
|
|
52
54
|
transition below no Agent's state it shapes the pick of the Agent whose event took the transition — the sender of a
|
|
53
55
|
pick, or the Agent whose pick started the child whose done or error event it is — and the other Agent's pick keeps its
|
|
54
|
-
default answer; when one Agent slot is invoked
|
|
56
|
+
default answer; when one Agent slot is invoked by two states, it shapes the pick at the same invoke as the pick that
|
|
55
57
|
sent the event or started the child, and none when that pick is not being answered; an event that names no Agent
|
|
56
58
|
shapes the pick in its own send, and outside one shapes no pick while two Agents' states are active; on an entry or an
|
|
57
59
|
exit below no Agent's state it sets nothing. One action object written in several places runs from each by that
|
|
@@ -80,24 +82,35 @@ Orchestrator's own process, the one Effect that does: it starts the run through
|
|
|
80
82
|
([ADR-0071](0071-a-run-starts-a-run-through-a-dispatch-effect.md)). There is no `placement:` key and no kind per
|
|
81
83
|
placement: naming a secret places a command, the body places an `http`, and the target places a `dispatch` — one name
|
|
82
84
|
per thing, so there is no `upload` kind beside it (ADR-0068).
|
|
83
|
-
- **A `command` that names no secret runs in the Harness container of its Workspace's Sandbox**, as a child of
|
|
84
|
-
Harness process
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
85
|
+
- **A `command` that names no secret runs in the Harness container of its Workspace's Sandbox**, as a confined child of
|
|
86
|
+
the Harness process ([ADR-0076](0076-an-agents-control-credential-lives-only-where-no-workspace-code-runs.md)): the
|
|
87
|
+
Agent's user, the Sandbox Image's tools, the same confined env and Stand-ins as the Agent's `bash` (ADR-0059), and no
|
|
88
|
+
credential of its own. The Harness serves it on `/exec/:id`, behind the same bearer as every Harness route (ADR-0058);
|
|
89
|
+
the Instance Harness holds no Workspace and refuses it (ADR-0031). Outside a `workspace()` a command is refused at
|
|
90
|
+
invoke. Its cwd is the Worktree its input names (`worktree`), which is required under Repo Slots, because a Workspace
|
|
91
|
+
that only clones has no Worktree for a default to name (ADR-0075). In a Workspace with no Repo Slot its cwd is
|
|
92
|
+
`/work`, which the Workspace's steps share — named in the start, never left to the Harness, whose own cwd is the
|
|
93
|
+
Sandbox Image's `WORKDIR`.
|
|
94
|
+
- **`worktree()` runs on the `command` machinery.** `actors: { cut: worktree({ expect? }) }`, with the input
|
|
95
|
+
`{ path, branch, from? }` or `{ path, detach }`: a kit program in the Harness container, its git confined (ADR-0076),
|
|
96
|
+
no new wire kind, marked idempotent. Its outcomes are `ready | refused | unknown`, and its output is the contract in
|
|
97
|
+
ADR-0075. Each thing that an Agent's word can cause settles `refused`, with nothing changed, and never goes to
|
|
98
|
+
`onError`. A settled `ready` row in the ledger holds the cut's Repo Slot, path and branch, and it is the one thing a
|
|
99
|
+
`push`, a credentialed `command` and an `http` file body read for their target.
|
|
90
100
|
- **Every outcome is output**: `exited | timeout | killed | unknown` for a `command` (`killed` with the signal that
|
|
91
101
|
ended it; a stopped credentialed command's is `exited` with the stop's signal, D1);
|
|
92
102
|
`response | unreachable | refused | unknown` for an `http` Effect; `pushed | rejected | diverged | unknown` for a
|
|
93
|
-
`push`. A command not found is `exited` 127
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
103
|
+
`push`. A command not found is `exited` 127, and a bad Worktree adds no outcome: a `command` settles `exited` 127 with
|
|
104
|
+
the reason in its tail, and an `http` file body settles `refused`. Every union here is open: `worktree()`, `push`,
|
|
105
|
+
`command` and `http` each hold a stand-in member, so that no author can write an exhaustive check and a later outcome
|
|
106
|
+
is no break. A start over the bytes an Effector reads (ADR-0068) is sent nowhere and settles as its kind's own outcome
|
|
107
|
+
— an `http` `refused`, a `push` `rejected` at stage `start` (nothing pushed), a credentialed `command` `exited` 127
|
|
108
|
+
with the reason in its tail, the Effector's own form for a command that could not start — since an Agent's param (a
|
|
109
|
+
squash message, an argv part) can reach the bound; a path segment that is `.`, `..` or empty, and a file body's path
|
|
110
|
+
that is a symlink, leaves the Worktree, is absolute, is a FIFO or has more than one link, are `refused` with nothing
|
|
111
|
+
sent — an Agent's param can cause each. `onError` is only a jr2 or config defect: no Workspace, a `command` with no
|
|
112
|
+
`worktree` under Repo Slots, an argv slot with no value, an input that misses the definition's schema, no Effector to
|
|
113
|
+
send to, an Open part nobody bound.
|
|
101
114
|
- **An `http` Effect is a definition plus one function.**
|
|
102
115
|
`http({ method, url, headers?, auth?, input?, request?, body?, timeout?, maxBody?, idempotent? })`. The url's scheme
|
|
103
116
|
and host are literal — a secret, named with `secret("name")`, may sit only in its path, through the `text` template,
|
|
@@ -108,13 +121,13 @@ Orchestrator's own process, the one Effect that does: it starts the run through
|
|
|
108
121
|
the url is refused. `request(input)` returns the run's part alone: `path` segments and a JSON or text body. So an
|
|
109
122
|
Agent's param reaches a path segment or a body, never the host, a header or a secret. It runs in the Instance
|
|
110
123
|
Effector, which builds the request and holds the secrets (ADR-0068); the Orchestrator signs the call and holds none.
|
|
111
|
-
Its body may instead be a Worktree file, `body: file(path, {
|
|
112
|
-
|
|
113
|
-
with no Repo Slot (ADR-0051), the folder its steps share — and the url's path segments — each a value or a
|
|
114
|
-
the input; no `request` is written beside it, since `file()` carries the run's part. Such an `http` is
|
|
115
|
-
Sandbox Effector of the Workspace whose body invokes it, and `jr2 up` refuses one that no `workspace()`
|
|
116
|
-
no Worktree exists to read. It is sent with `PUT`, `POST` or `PATCH`. The Sandbox Effector opens the
|
|
117
|
-
`openat2` beneath the work root — `RESOLVE_BENEATH`, `RESOLVE_NO_SYMLINKS`, `RESOLVE_NO_MAGICLINKS`,
|
|
124
|
+
Its body may instead be a Worktree file, `body: file(path, { segments?, contentType? })`: the file's path relative to
|
|
125
|
+
the Worktree its input names (`worktree`), which needs a cut's settled row, as a `push` does — or to `/work` itself in
|
|
126
|
+
a Workspace with no Repo Slot (ADR-0051), the folder its steps share — and the url's path segments — each a value or a
|
|
127
|
+
function of the input; no `request` is written beside it, since `file()` carries the run's part. Such an `http` is
|
|
128
|
+
placed in the Sandbox Effector of the Workspace whose body invokes it, and `jr2 up` refuses one that no `workspace()`
|
|
129
|
+
invokes, where no Worktree exists to read. It is sent with `PUT`, `POST` or `PATCH`. The Sandbox Effector opens the
|
|
130
|
+
file with `openat2` beneath the work root — `RESOLVE_BENEATH`, `RESOLVE_NO_SYMLINKS`, `RESOLVE_NO_MAGICLINKS`,
|
|
118
131
|
`RESOLVE_NO_XDEV`, non-blocking — then `fstat`: a symlink at any component (one that stays inside included), `..`, an
|
|
119
132
|
absolute path, a FIFO, a directory and a file with more than one link are refused, in words, as output. The content
|
|
120
133
|
type is `file()`'s `contentType` or a `content-type` header of the definition's, not both: a definition with both is
|
|
@@ -129,7 +142,9 @@ Orchestrator's own process, the one Effect that does: it starts the run through
|
|
|
129
142
|
run the image's system paths, read and write its own scratch (its `HOME` and its `TMPDIR`; never `/tmp`, which every
|
|
130
143
|
child would share), and read the secret files it names — nothing else. A node whose kernel cannot confine it runs
|
|
131
144
|
none: the Effector of a Workspace that holds one does not become ready there, and the provision fails naming the node
|
|
132
|
-
(ADR-0068).
|
|
145
|
+
(ADR-0068). Its input names its Worktree (`worktree`), and that path needs a cut's settled row with a branch, as a
|
|
146
|
+
`push` does: a path alone does not name the target of a credential. With none it settles `exited` 127, and nothing
|
|
147
|
+
runs. It runs against one commit: the tip of that row's branch when it starts, or — with `pin` — the commit the
|
|
133
148
|
Effect's input names (`{ sha }`, one a Gate approved). That commit is checked out into a fresh scratch of the Effect's
|
|
134
149
|
own by the push's import procedure (below), so the Agent's uncommitted edits are never seen; the answer carries
|
|
135
150
|
`dirty: true` beside the output when the Worktree held some (a status in jr2's clean repository over a copy of the
|
|
@@ -148,35 +163,41 @@ Orchestrator's own process, the one Effect that does: it starts the run through
|
|
|
148
163
|
Workspace with no Repo Slot has no commit to run it against, so there it is refused — by `jr2 up` and at invoke, with
|
|
149
164
|
the fix: declare a slot, or name no secret, and it runs in `/work` beside the Agent (ADR-0051). A run of the live
|
|
150
165
|
files under a credential is the claim this kind exists not to make.
|
|
151
|
-
- **A `push` pushes
|
|
152
|
-
`push({ pin?, sign?, squash?, force?, slot?, timeout? })
|
|
153
|
-
`
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
166
|
+
- **A `push` pushes a Worktree's branch to its Repo Slot's Binding**, from the Sandbox Effector:
|
|
167
|
+
`push({ pin?, sign?, squash?, force?, slot?, timeout? })`, with `worktree` in its input and no `to` and no `branch`.
|
|
168
|
+
`slot` stays static: a Machine with one slot leaves it out, and a Machine with two names it. The Orchestrator finds
|
|
169
|
+
the cut's settled row in the run's ledger, by the path and this Sandbox, and tells the Effector which branch to
|
|
170
|
+
publish. An Agent can change all of git in the pod, and it cannot change that row. With a read of HEAD,
|
|
171
|
+
`git switch main` would publish `main`. With an input key, a Chart could aim at any remote branch. A push with no row,
|
|
172
|
+
a row of another slot, or a detached Worktree is `rejected` at stage `start`. The ledger key is (slot, branch). The
|
|
173
|
+
local name equals the remote name, so an Agent, a Gate and a person in the pod all see the real branch. Its credential
|
|
174
|
+
is the push credential of the `git.credentials` entry the Repo Slot's url falls under (ADR-0051): the provision
|
|
175
|
+
matches the url the run binds — static, per-run or `customize()`-bound, one path — and names that entry's push Secret
|
|
176
|
+
on the Sandbox, and the Effector, which holds only the entries named there, matches the push's url as the fence does.
|
|
177
|
+
git never runs with the Agent's repository as its repository: each call makes a new bare repository in the Effector's
|
|
178
|
+
scratch, configured by jr2 under a cleared environment; it reads that branch as data (a loose ref or `packed-refs`,
|
|
179
|
+
opened beneath with no symlink, bounded); it imports the Agent's objects as data — one `pack-objects` over the Agent's
|
|
180
|
+
object store with a deadline (a FIFO in place of an object blocks an open forever), `index-pack --strict`, and a
|
|
181
|
+
connectivity check — borrowing only from the node's Repo cache; and it pushes `<commit>:refs/heads/<branch>` to the
|
|
182
|
+
Binding url, never to a remote of the Agent's config, and never to a local path (git's local transport runs that
|
|
183
|
+
repository's config and hooks, and a path in the pod can be the Agent's own repository; only the binary's tests can
|
|
184
|
+
allow one). So no config, hook, attribute or program of the Agent's runs; a test plants each in the Agent's repository
|
|
185
|
+
and proves none ran. A token goes Basic over https through a credential helper only — an `http://` url with a token is
|
|
186
|
+
`rejected` with nothing sent — and the helper is the Effector binary (`effector git-credential`), which reads the
|
|
187
|
+
token's file when git asks for the Binding's own host over https and answers nothing for any other; the clean
|
|
188
|
+
repository follows no redirect, so neither the push nor the token reaches an origin outside the entry; an ssh key is
|
|
189
|
+
copied into the call's directory (a Secret mount's mode is one ssh refuses), with `known_hosts` checked strictly. The
|
|
190
|
+
commit is pinned when the push starts: the tip of that branch, never HEAD, or with `pin` the commit the input names
|
|
191
|
+
(`{ sha }`); the Effector's first answer names it, and it is written to the intent row. A pinned commit the Agent
|
|
192
|
+
pruned fails the import and is never substituted. `squash` makes one commit with the input's `{ message }`, on the
|
|
193
|
+
published base: the Agent's tree, its author line and date, the Machine's message. It is a new commit, so it needs a
|
|
194
|
+
committer. With `sign`, the signer is the committer, as for every signed copy. Without it (signing is optional, and
|
|
195
|
+
`squash` is an option of its own), the matching `git.credentials` entry's `committer: { name, email }` commits it, at
|
|
196
|
+
the Effector's clock — or, when the entry names no committer, its `sign` field's name and email. `jr2 up` refuses
|
|
197
|
+
`squash` without `sign` only when the matched entry has neither `sign` nor `committer`, naming both fixes (a
|
|
198
|
+
`committer`, or a signed push and its `sign` field), and the provision refuses it the same way for a slot the run or a
|
|
199
|
+
`customize()` binds. `force` replaces what the remote holds. A Workspace with no Repo Slot has no branch to push, so a
|
|
200
|
+
`push` there is refused, by `jr2 up` and at invoke (ADR-0051).
|
|
180
201
|
- **`sign`: nothing unsigned leaves.** The Effector re-creates the Agent's commits, each signed with the entry's `sign`
|
|
181
202
|
key — ssh (`ssh-keygen -Y sign`) by default, GPG allowed; a GPG key with a passphrase is refused, by name. The author
|
|
182
203
|
line, its date included, stays the Agent's; the committer is the entry's name and email at the Effector's clock. The
|
|
@@ -199,7 +220,7 @@ Orchestrator's own process, the one Effect that does: it starts the run through
|
|
|
199
220
|
push and before anything is signed, the same map runs over the new commits, oldest first, and a commit that has a
|
|
200
221
|
published twin is replaced by that twin in the rewritten history; only the unmapped commits are signed. The twin is a
|
|
201
222
|
ledger pair, taken as it is — each names the one exact commit a push published for its source, a signed copy or a
|
|
202
|
-
squashed commit; the pairs of every push of the
|
|
223
|
+
squashed commit; the pairs of every push of the (slot, branch) are read, each only while the remote still holds its
|
|
203
224
|
published commit, the newest push's when two name one source — or else a published commit after the commit's merge
|
|
204
225
|
base with the remote's tip, each taken once, that has the commit's cherry key, read with the commit's parents as
|
|
205
226
|
mapped so far (a merge of the Agent's own side branch keys on the published copies of its non-first parents), and is a
|
|
@@ -217,68 +238,69 @@ Orchestrator's own process, the one Effect that does: it starts the run through
|
|
|
217
238
|
hold). A push that publishes nothing new carries one too: when `pair` or `cherry` maps the published tip itself (a
|
|
218
239
|
restore that sends a pinned push again, a push after a sync that did not finish), or the published tip is this
|
|
219
240
|
squash's own (a restore that sends a squash push again), the Agent's branch still holds its own commits. The bundle
|
|
220
|
-
never reaches the Machine. A push sends every pair the ledger holds for its Workspace and
|
|
221
|
-
one remote — oldest push first (`pairs`, omitted when there is none): each push that published, with its
|
|
222
|
-
commit, its source and its `squashed`; the Effector stays stateless. The pair stands for the published tip
|
|
223
|
-
the remote still holds that push: a remote that moved past it (another writer) is paired by `cherry` or is
|
|
224
|
-
never grafted onto. The Agent is never told to rebase: a rebase repair loses a reworded message and
|
|
225
|
-
commits and merges. A published commit is never signed twice, for every signer and key type: a side
|
|
226
|
-
made before the push and merges later carries the unsigned original of a commit the remote holds
|
|
227
|
-
ancestry calls new, and the map replaces it by its twin — a merge the Agent made before the first push
|
|
228
|
-
through the ledger's pairs, a side branch made before a squash and merged by any later push, whose
|
|
229
|
-
squashed commit stands for: the squash's pair maps its source to the squashed commit however many pushes
|
|
230
|
-
it, so a side branch merged by one push and a branch made on it merged by the next publish only what is
|
|
231
|
-
maps a squash's SOURCE only, and that is a named limit: a side branch made at an earlier commit of the
|
|
232
|
-
publishes the commits it descends from as signed copies beside the squashed commit. Those commits were
|
|
233
|
-
published, none is signed twice, and the trees are the Agent's; such a commit has no faithful twin, and mapped
|
|
234
|
-
squashed commit the push would publish a false diff. The committer date stays the Effector's clock; a
|
|
235
|
-
re-sign (the Agent's committer date) was rejected, since it rests on one key type's property, not GPG's
|
|
236
|
-
key alone does not pair: a commit the Agent reverts and applies again with cherry-pick has the key of
|
|
237
|
-
and the first one's published copy has older parents, so paired with it the push would offer that older
|
|
238
|
-
new tip — `rejected` as non-fast-forward without `force`, a rewind of the remote with it. The faithful
|
|
239
|
-
rule; the cherry fallback keeps its own, that the last paired commit holds the published tip's tree. The
|
|
240
|
-
bounded by the push's size.
|
|
241
|
+
never reaches the Machine. A push sends every pair the ledger holds for its Workspace and its (slot, branch) — one
|
|
242
|
+
branch on one remote — oldest push first (`pairs`, omitted when there is none): each push that published, with its
|
|
243
|
+
published commit, its source and its `squashed`; the Effector stays stateless. The pair stands for the published tip
|
|
244
|
+
only while the remote still holds that push: a remote that moved past it (another writer) is paired by `cherry` or is
|
|
245
|
+
`diverged`, never grafted onto. The Agent is never told to rebase: a rebase repair loses a reworded message and
|
|
246
|
+
duplicates empty commits and merges. A published commit is never signed twice, for every signer and key type: a side
|
|
247
|
+
branch the Agent made before the push and merges later carries the unsigned original of a commit the remote holds
|
|
248
|
+
signed, which ancestry calls new, and the map replaces it by its twin — a merge the Agent made before the first push
|
|
249
|
+
included, and, through the ledger's pairs, a side branch made before a squash and merged by any later push, whose
|
|
250
|
+
commits the squashed commit stands for: the squash's pair maps its source to the squashed commit however many pushes
|
|
251
|
+
came after it, so a side branch merged by one push and a branch made on it merged by the next publish only what is
|
|
252
|
+
new. The pair maps a squash's SOURCE only, and that is a named limit: a side branch made at an earlier commit of the
|
|
253
|
+
squashed range publishes the commits it descends from as signed copies beside the squashed commit. Those commits were
|
|
254
|
+
never published, none is signed twice, and the trees are the Agent's; such a commit has no faithful twin, and mapped
|
|
255
|
+
to the squashed commit the push would publish a false diff. The committer date stays the Effector's clock; a
|
|
256
|
+
deterministic re-sign (the Agent's committer date) was rejected, since it rests on one key type's property, not GPG's
|
|
257
|
+
or ECDSA's. A key alone does not pair: a commit the Agent reverts and applies again with cherry-pick has the key of
|
|
258
|
+
the first one, and the first one's published copy has older parents, so paired with it the push would offer that older
|
|
259
|
+
copy as the new tip — `rejected` as non-fast-forward without `force`, a rewind of the remote with it. The faithful
|
|
260
|
+
image is the rule; the cherry fallback keeps its own, that the last paired commit holds the published tip's tree. The
|
|
261
|
+
map's cost is bounded by the push's size.
|
|
241
262
|
- **The sync: after every push whose published commit is not the Agent's own, the Agent's branch moves to it** — signed
|
|
242
263
|
copies, or one squashed commit, signed or not; the decision keys on `published` ≠ `source`, never on `sign` — in the
|
|
243
264
|
Harness container (`POST /sync`, behind the Harness bearer, ADR-0058), from the bundle the Effector wrote, which the
|
|
244
265
|
Orchestrator relays — never a shared volume: the Worktree stays read-only on the credentialed side. Under a cleared
|
|
245
|
-
environment and a config that names no hook, no fsmonitor, no alternate-refs command and no maintenance
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
the
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
`
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
266
|
+
environment and a config that names no hook, no fsmonitor, no alternate-refs command and no maintenance — and with its
|
|
267
|
+
git confined, as every process it starts in `/work` (ADR-0076), because a filter or a textconv in the shared
|
|
268
|
+
`.git/config` runs in git's process — the Harness verifies and unbundles the bundle (objects only), checks that the
|
|
269
|
+
published tip is a commit with the source's tree (it reads no signature), answers `busy` when a rebase of the branch,
|
|
270
|
+
or a merge, cherry-pick, revert or sequence in a worktree whose HEAD is the branch, is in progress, and otherwise
|
|
271
|
+
copies each commit the Agent made after the source as its raw object with only its parents changed, then moves the
|
|
272
|
+
branch with one `git update-ref <new> <old>` — a compare-and-swap, tried again from the new tip at most 3 times — so
|
|
273
|
+
files, index, HEAD and stash do not change. Its answer is a field of the push's output beside the outcome:
|
|
274
|
+
`sync: synced | already | skipped | busy | not-synced`, with `syncReason` when it moved nothing (a push that published
|
|
275
|
+
the Agent's own commit is `skipped`, with no call and no bundle; every other push is synced, one that published
|
|
276
|
+
nothing new included, so a plain push of the slot after a squash is a fast-forward of the squashed commit). A Harness
|
|
277
|
+
that cannot be reached answers `not-synced`; the push stays `pushed`. When the last push of a (slot, branch) answered
|
|
278
|
+
`busy` or `not-synced`, jr2 runs its sync again before the next push of that key, in the Worktree of that push and
|
|
279
|
+
with its bundle, which its row keeps until a sync finished or a newer push of that key published. The push never
|
|
280
|
+
trusts the sync's answer: the Agent owns its repository and can move the branch at any time, so the next push derives
|
|
281
|
+
everything again from the remote and the Agent's objects. After such a push the Agent reads, beside the output, what
|
|
282
|
+
moved — signed copies of its commits with new ids, or its commits squashed into one commit, named "signed" only when
|
|
283
|
+
it is — and that jr2 moved its branch to it, or did not and why; that its files, index and stash did not change; and
|
|
284
|
+
that amending, rebasing or resetting the pushed commits makes the next push `diverged`. The Harness keys that
|
|
285
|
+
paragraph on a synced push whose published commit is not the Agent's, and its words on `squashed`. A push in which jr2
|
|
286
|
+
counted no new commit (`newCommits: 0`) is still `pushed`, because the push ran and the remote's branch may have moved
|
|
287
|
+
(a new branch at a commit the remote held on another branch). But `pushed` alone does not tell the Agent that its work
|
|
288
|
+
did not go out: in a real Haiku 5.5 run, the model sent a `git commit` that failed and the push in one answer, the
|
|
289
|
+
push published the branch at a commit the remote already held, and the model read `pushed` as its work published. So
|
|
290
|
+
beside the output the Agent reads that jr2 counted no new commit in this push, that it found the published commit
|
|
291
|
+
already on the remote or in jr2's copy of the remote, and that a change it did not commit before the push is not in
|
|
292
|
+
this push. The words name where jr2 looked because the count reads the Repo cache, which fetches without pruning: a
|
|
293
|
+
commit the remote dropped can stay there, and then a count of 0 is not a fact about the remote, which is why the first
|
|
294
|
+
clause names what jr2 counted. No @model claim reaches `newCommits: 0`, so no measurement has read these words. When
|
|
295
|
+
the signed-copies or squash paragraph above also applies, it names "an earlier push" as the one that signed or
|
|
296
|
+
squashed, so the two do not contradict. The Harness keys the sentence on `newCommits: 0` alone, and says nothing with
|
|
297
|
+
no count. The count is optional on the wire: a live Sandbox keeps the runtime it started with (ADR-0037), so after
|
|
298
|
+
`jr2 up` its older Effector answers `pushed` with no `newCommits`, and a required field would fault a push that
|
|
299
|
+
reached the remote. The count's input to `git rev-list --stdin` is revisions only (`^<sha>` for each tip the remote
|
|
300
|
+
held), never `--not`: git takes an option there only from 2.42, and the Sandbox Effector runs its image's git — the
|
|
301
|
+
Sandbox Image's, unless the `workspace()` names one — which can be older (Debian bookworm's is 2.39). A distinct
|
|
302
|
+
outcome (`unchanged`, `up-to-date`) was rejected: every consumer of a push keys on `pushed` (the ledger's pairs, the
|
|
303
|
+
sync, the Machines' guards), and a push that made a new branch did change the remote.
|
|
282
304
|
- **The process group ends with the exec.** Each exec leads its own group; its timeout, a kill, and its top process's
|
|
283
305
|
exit each SIGKILL the group, so nothing that stays in the group outlives it. In the Harness container a descendant
|
|
284
306
|
that leaves the group (`setsid`) is not killed; it holds no credential. A credentialed command's descendant cannot
|
|
@@ -292,30 +314,33 @@ Orchestrator's own process, the one Effect that does: it starts the run through
|
|
|
292
314
|
carries that transition, so a restart that loses the transition's save still delivers the output and runs nothing. On
|
|
293
315
|
restore: settled → the output is delivered; no row → nothing was sent, so it starts; intent → per kind. A `command`
|
|
294
316
|
that names no secret re-attaches to the exec by id, or settles `unknown` when the Harness no longer knows it (it
|
|
295
|
-
restarted); it is never run again by jr2: it runs the Agent's code, which may spend a Stand-in. A
|
|
296
|
-
|
|
297
|
-
the id
|
|
298
|
-
|
|
299
|
-
with
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
`
|
|
318
|
-
|
|
317
|
+
restarted); it is never run again by jr2: it runs the Agent's code, which may spend a Stand-in. A cut is the
|
|
318
|
+
exception: it runs the kit's program and is marked idempotent, so a restore or a Harness restart sends it again with
|
|
319
|
+
the same id. A `push` intent row names its Sandbox and, once the Effector's first answer names it, the pinned commit:
|
|
320
|
+
a restore asks the Effector for the id and follows it, and when the Effector no longer holds it the push is sent again
|
|
321
|
+
with only that commit — never the Agent's tip now — because its run is a function of the commit and its credential,
|
|
322
|
+
what the intent row records; with no commit recorded it settles `unknown`. A credentialed command follows the push's
|
|
323
|
+
rule: its intent row names its Sandbox and, once the first answer names it, the pinned commit, and one the Effector
|
|
324
|
+
lost is sent again with only that commit, since its run is a function of (commit, argv, secrets). An `http` intent row
|
|
325
|
+
names its placement — the Instance Effector, or the Sandbox of a file-body `http` — and no replica: the Effect asks
|
|
326
|
+
every replica of that Effector for its id and follows the one that holds it; when none does, it is sent again only
|
|
327
|
+
when the author marked it `idempotent`, and any other settles `unknown`. Retry is the author's choice — a route back
|
|
328
|
+
into the state, or `idempotent` for a call that carries its own idempotency key or only reads. No row is dropped: each
|
|
329
|
+
settled or aborted row keeps the Effect's id, kind and outcome for the run's life, the record of what the run's
|
|
330
|
+
Effects did. A settled row's output tail is dropped once the save that carries its transition is on disk; the full
|
|
331
|
+
stream is on the feed. An `http` response's body and headers are its tail: the row keeps the outcome, the status, the
|
|
332
|
+
content type and the size, and the settled line on the feed carries the whole response. A `push` row keeps its Repo
|
|
333
|
+
Slot, its branch, its published commit, its source, its `squashed` and its sync's answer whole — every later push of
|
|
334
|
+
its Workspace and (slot, branch) sends them as one of its pairs, and the newest push's sync, when it did not finish,
|
|
335
|
+
runs again — and drops git's words; it drops its bundle once its sync answered `synced`, `already` or `skipped`, and
|
|
336
|
+
keeps it while the sync is `busy` or `not-synced` only as long as it is the newest push of its (slot, branch) that
|
|
337
|
+
published, because the sync that runs again moves the branch from it and only the newest push's sync runs again. Once
|
|
338
|
+
a newer push of that key published, the older row's bundle goes at the next save: one bundle per (slot, branch) at
|
|
339
|
+
most. A cut's `ready` row keeps its Repo Slot, its path and its branch whole, because a later Effect reads them. So an
|
|
340
|
+
Effect in a loop grows the ledger by one short row per pass, never by its tails. One exception, bounded by one pick:
|
|
341
|
+
while a pick is outstanding, its hold keeps the `chain` whole, tails included, because an `answer` action may read it
|
|
342
|
+
after a restore; a loop below the Agent's state then grows the hold by one tail per pass. The hold drops its chain
|
|
343
|
+
when the pick is answered.
|
|
319
344
|
- **A start is sent once where it may have arrived.** A Harness runs one id once only within its own process; a
|
|
320
345
|
restarted Harness knows no id. So the Orchestrator sends a start again only when it certainly never left (the
|
|
321
346
|
connection was refused, the name did not resolve). Any other failure — a reset, a 5xx, no answer — may follow a start
|
|
@@ -374,6 +399,9 @@ Orchestrator's own process, the one Effect that does: it starts the run through
|
|
|
374
399
|
binds the argv, refuses there a param the bound argv does not read, and gives the bound Machine the warnings the walk
|
|
375
400
|
gives for that argv (ADR-0054).
|
|
376
401
|
|
|
402
|
+
- **The load walk refuses an Effect's `onDone` with no unguarded last arm.** A type cannot see a missing arm, and with
|
|
403
|
+
no match a run stays in that state and shows no fault.
|
|
404
|
+
|
|
377
405
|
## Considered options
|
|
378
406
|
|
|
379
407
|
- **Run every command in the Sandbox Effector.** Rejected: a command that names no secret runs the Workspace's own code
|