owenloop 0.5.0 → 0.5.1
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/CHANGELOG.md +45 -0
- package/README.md +137 -35
- package/bin/owenloop.mjs +49 -1
- package/dist/packages/work/src/agent/brief.d.ts +8 -4
- package/dist/packages/work/src/agent/brief.js +7 -3
- package/dist/packages/work/src/agent/loop.d.ts +13 -7
- package/dist/packages/work/src/agent/loop.js +136 -9
- package/dist/packages/work/src/agent/model-policy.d.ts +49 -0
- package/dist/packages/work/src/agent/model-policy.js +138 -0
- package/dist/packages/work/src/bundle/cache.d.ts +7 -5
- package/dist/packages/work/src/bundle/cache.js +20 -6
- package/dist/packages/work/src/bundle/fetch.d.ts +7 -5
- package/dist/packages/work/src/bundle/fetch.js +27 -7
- package/dist/packages/work/src/bundle/types.d.ts +8 -4
- package/dist/packages/work/src/consumed-verifier.d.ts +45 -0
- package/dist/packages/work/src/consumed-verifier.js +205 -0
- package/dist/packages/work/src/exec/instructions.d.ts +99 -0
- package/dist/packages/work/src/exec/instructions.js +323 -0
- package/dist/packages/work/src/exec/loop.d.ts +12 -1
- package/dist/packages/work/src/exec/loop.js +137 -20
- package/dist/packages/work/src/exec/payload.d.ts +29 -0
- package/dist/packages/work/src/exec/payload.js +54 -0
- package/dist/packages/work/src/exec/receipt.d.ts +9 -6
- package/dist/packages/work/src/exec/receipt.js +12 -1
- package/dist/packages/work/src/exec/runner.d.ts +7 -1
- package/dist/packages/work/src/exec/runner.js +74 -3
- package/dist/packages/work/src/harness/child-env.js +7 -0
- package/dist/packages/work/src/harness/claude.d.ts +20 -8
- package/dist/packages/work/src/harness/claude.js +260 -58
- package/dist/packages/work/src/harness/codex.d.ts +5 -4
- package/dist/packages/work/src/harness/codex.js +169 -41
- package/dist/packages/work/src/harness/contract.d.ts +36 -11
- package/dist/packages/work/src/harness/fake.js +1 -0
- package/dist/packages/work/src/harness/jsonrpc-stdio.js +7 -0
- package/dist/packages/work/src/harness/permissions.d.ts +16 -3
- package/dist/packages/work/src/harness/permissions.js +102 -13
- package/dist/packages/work/src/harness/session-store.d.ts +27 -9
- package/dist/packages/work/src/harness/session-store.js +271 -67
- package/dist/packages/work/src/hold/mcp.d.ts +25 -5
- package/dist/packages/work/src/hold/mcp.js +126 -11
- package/dist/packages/work/src/hub/client.d.ts +2 -1
- package/dist/packages/work/src/hub/client.js +14 -1
- package/dist/packages/work/src/hub/types.d.ts +69 -33
- package/dist/packages/work/src/hub/types.js +8 -10
- package/dist/packages/work/src/mcp/server.js +1 -1
- package/dist/packages/work/src/owenloop-bin.d.ts +1 -0
- package/dist/packages/work/src/owenloop-bin.js +18 -0
- package/dist/packages/work/src/roles/agent-run.d.ts +12 -6
- package/dist/packages/work/src/roles/agent-run.js +116 -34
- package/dist/packages/work/src/roles/exec.d.ts +8 -0
- package/dist/packages/work/src/roles/exec.js +27 -2
- package/dist/packages/work/src/roles/hold.d.ts +4 -0
- package/dist/packages/work/src/roles/hold.js +44 -5
- package/dist/packages/work/src/roles/lint.d.ts +3 -4
- package/dist/packages/work/src/roles/lint.js +41 -7
- package/dist/packages/work/src/roles/settings.js +5 -0
- package/dist/packages/work/src/roles/shift.d.ts +1 -0
- package/dist/packages/work/src/roles/shift.js +23 -1
- package/dist/packages/work/src/settings/settings.d.ts +17 -1
- package/dist/packages/work/src/settings/settings.js +39 -0
- package/dist/packages/work/src/shift/loop.d.ts +14 -3
- package/dist/packages/work/src/shift/loop.js +447 -164
- package/dist/packages/work/src/shift/protocol.d.ts +4 -0
- package/dist/packages/work/src/shift/runtime.d.ts +2 -0
- package/dist/packages/work/src/shift/runtime.js +66 -3
- package/dist/packages/work/src/shift/spawn.d.ts +41 -18
- package/dist/packages/work/src/shift/spawn.js +89 -31
- package/dist/packages/work/src/shift/state.d.ts +53 -51
- package/dist/packages/work/src/shift/state.js +325 -102
- package/dist/packages/work/src/submit-proof.d.ts +36 -0
- package/dist/packages/work/src/submit-proof.js +93 -0
- package/dist/src/add.d.ts +64 -259
- package/dist/src/add.js +81 -615
- package/dist/src/archive.d.ts +97 -0
- package/dist/src/archive.js +591 -0
- package/dist/src/bundle/index.d.ts +64 -0
- package/dist/src/bundle/index.js +508 -0
- package/dist/src/bundle/manifest.d.ts +50 -0
- package/dist/src/bundle/manifest.js +435 -0
- package/dist/src/bundle/runtime.d.ts +26 -0
- package/dist/src/bundle/runtime.js +64 -0
- package/dist/src/bundle/tar.d.ts +62 -0
- package/dist/src/bundle/tar.js +238 -0
- package/dist/src/bundle/types.d.ts +105 -0
- package/dist/src/bundle/types.js +21 -0
- package/dist/src/cli.d.ts +90 -20
- package/dist/src/cli.js +2407 -365
- package/dist/src/credentials.d.ts +4 -3
- package/dist/src/credentials.js +21 -19
- package/dist/src/crypto/allowed-signers.d.ts +68 -0
- package/dist/src/crypto/allowed-signers.js +307 -0
- package/dist/src/crypto/canonical.d.ts +8 -0
- package/dist/src/crypto/canonical.js +92 -0
- package/dist/src/crypto/chain.d.ts +65 -0
- package/dist/src/crypto/chain.js +377 -0
- package/dist/src/crypto/dsse.d.ts +209 -0
- package/dist/src/crypto/dsse.js +282 -0
- package/dist/src/crypto/enrollment.d.ts +78 -0
- package/dist/src/crypto/enrollment.js +186 -0
- package/dist/src/crypto/index.d.ts +48 -0
- package/dist/src/crypto/index.js +44 -0
- package/dist/src/crypto/keys.d.ts +258 -0
- package/dist/src/crypto/keys.js +908 -0
- package/dist/src/crypto/org-root.d.ts +33 -0
- package/dist/src/crypto/org-root.js +78 -0
- package/dist/src/crypto/origin-rules.d.ts +56 -0
- package/dist/src/crypto/origin-rules.js +143 -0
- package/dist/src/crypto/policy-floor.d.ts +98 -0
- package/dist/src/crypto/policy-floor.js +353 -0
- package/dist/src/crypto/records.d.ts +316 -0
- package/dist/src/crypto/records.js +157 -0
- package/dist/src/crypto/scope.d.ts +49 -0
- package/dist/src/crypto/scope.js +83 -0
- package/dist/src/crypto/ssh.d.ts +171 -0
- package/dist/src/crypto/ssh.js +396 -0
- package/dist/src/crypto/submission.d.ts +33 -0
- package/dist/src/crypto/submission.js +47 -0
- package/dist/src/crypto/trust-roots.d.ts +29 -0
- package/dist/src/crypto/trust-roots.js +39 -0
- package/dist/src/crypto/verify-consumed.d.ts +67 -0
- package/dist/src/crypto/verify-consumed.js +259 -0
- package/dist/src/crypto/verify-origin.d.ts +50 -0
- package/dist/src/crypto/verify-origin.js +151 -0
- package/dist/src/crypto/verify-publication.d.ts +60 -0
- package/dist/src/crypto/verify-publication.js +150 -0
- package/dist/src/defs.d.ts +24 -1
- package/dist/src/defs.js +145 -25
- package/dist/src/engine.d.ts +99 -3
- package/dist/src/engine.js +238 -34
- package/dist/src/factory.d.ts +16 -0
- package/dist/src/factory.js +16 -4
- package/dist/src/global-config.d.ts +59 -0
- package/dist/src/global-config.js +84 -0
- package/dist/src/hub.d.ts +75 -21
- package/dist/src/hub.js +123 -40
- package/dist/src/index.d.ts +17 -2
- package/dist/src/index.js +20 -2
- package/dist/src/install.d.ts +538 -0
- package/dist/src/install.js +1981 -0
- package/dist/src/lock.d.ts +15 -57
- package/dist/src/lock.js +251 -143
- package/dist/src/mcp/serve.d.ts +46 -22
- package/dist/src/mcp/serve.js +167 -44
- package/dist/src/mcp/server.js +12 -1
- package/dist/src/model.d.ts +15 -0
- package/dist/src/model.js +111 -1
- package/dist/src/order-resolver.d.ts +184 -0
- package/dist/src/order-resolver.js +252 -0
- package/dist/src/package-version.d.ts +10 -0
- package/dist/src/package-version.js +42 -0
- package/dist/src/paths.d.ts +14 -1
- package/dist/src/paths.js +18 -0
- package/dist/src/schemas/enrollment-grant.v1.schema.json +90 -0
- package/dist/src/schemas/index.d.ts +1416 -0
- package/dist/src/schemas/index.js +31 -0
- package/dist/src/schemas/order.v1.schema.json +106 -0
- package/dist/src/schemas/origin.v1.schema.json +68 -0
- package/dist/src/schemas/policy-floor.v1.schema.json +29 -0
- package/dist/src/schemas/publication.v1.schema.json +31 -0
- package/dist/src/schemas/revocation.v1.schema.json +39 -0
- package/dist/src/schemas/submission.v1.schema.json +61 -0
- package/dist/src/store/def-source.d.ts +52 -0
- package/dist/src/store/def-source.js +335 -0
- package/dist/src/store/index-file.d.ts +69 -0
- package/dist/src/store/index-file.js +151 -0
- package/dist/src/store/index.d.ts +27 -0
- package/dist/src/store/index.js +22 -0
- package/dist/src/store/ingestor.d.ts +43 -0
- package/dist/src/store/ingestor.js +211 -0
- package/dist/src/store/install.d.ts +228 -0
- package/dist/src/store/install.js +555 -0
- package/dist/src/store/instruction-source.d.ts +49 -0
- package/dist/src/store/instruction-source.js +298 -0
- package/dist/src/store/origin-evidence.d.ts +21 -0
- package/dist/src/store/origin-evidence.js +66 -0
- package/dist/src/store/pre-commit-verifier.d.ts +68 -0
- package/dist/src/store/pre-commit-verifier.js +418 -0
- package/dist/src/store/resolve.d.ts +138 -0
- package/dist/src/store/resolve.js +363 -0
- package/dist/src/store/types.d.ts +288 -0
- package/dist/src/store/types.js +356 -0
- package/dist/src/types.d.ts +45 -11
- package/dist/src/untar.d.ts +8 -23
- package/dist/src/untar.js +10 -136
- package/docs/agent-runner.md +86 -0
- package/docs/authoring.md +57 -6
- package/docs/bundles.md +250 -0
- package/docs/cli.md +1171 -97
- package/docs/crypto.md +816 -0
- package/docs/design.md +342 -20
- package/docs/embedding.md +132 -25
- package/docs/wire-contracts.md +380 -0
- package/package.json +6 -1
- package/plugins/claude-code/.claude-plugin/marketplace.json +14 -0
- package/plugins/claude-code/plugin/.claude-plugin/plugin.json +8 -0
- package/plugins/claude-code/plugin/.mcp.json +14 -0
- package/plugins/claude-code/plugin/hooks/hooks.json +26 -0
- package/plugins/claude-code/plugin/hooks/session-end.sh +40 -0
- package/plugins/claude-code/plugin/hooks/session-start.sh +52 -0
- package/plugins/claude-code/plugin/skills/author/SKILL.md +181 -0
- package/plugins/claude-code/plugin/skills/conduct/SKILL.md +106 -0
- package/plugins/claude-code/plugin/skills/shift/SKILL.md +105 -0
- package/plugins/codex/.agents/plugins/marketplace.json +21 -0
- package/plugins/codex/plugins/owenloop/.codex-plugin/plugin.json +7 -0
- package/plugins/codex/plugins/owenloop/.mcp.json +20 -0
- package/plugins/codex/plugins/owenloop/hooks/hooks.json +26 -0
- package/plugins/codex/plugins/owenloop/hooks/session-end.sh +40 -0
- package/plugins/codex/plugins/owenloop/hooks/session-start.sh +52 -0
- package/plugins/codex/plugins/owenloop/skills/author/SKILL.md +181 -0
- package/plugins/codex/plugins/owenloop/skills/conduct/SKILL.md +106 -0
- package/plugins/codex/plugins/owenloop/skills/shift/SKILL.md +105 -0
package/docs/design.md
CHANGED
|
@@ -240,7 +240,16 @@ order-independent — re-running `settle()` on a healthy graph yields no ops.
|
|
|
240
240
|
**born-rejected** (a structural reject with a `born-rejected` reason) instead of
|
|
241
241
|
landing a green that already rests on stale inputs. This makes concurrent
|
|
242
242
|
advancement safe without locking the graph: two workers can race, and at most
|
|
243
|
-
one lands green; the loser is re-armed with an honest reason.
|
|
243
|
+
one lands green; the loser is re-armed with an honest reason. The same
|
|
244
|
+
target reference-order contract exports the same claim-time map as optional
|
|
245
|
+
`consumedFingerprint`. When a version-aware submit protocol lets a producer
|
|
246
|
+
sign `submission.v1`, the signed statement binds both the produced value and
|
|
247
|
+
the exact input versions the producer claimed. Across steps, those bindings
|
|
248
|
+
can provide the edges a later verifier needs to reconstruct a verifiable
|
|
249
|
+
submission DAG. The deployed hub does not yet preserve the complete proof and
|
|
250
|
+
version protocol, so current producer submits remain unsigned rather than
|
|
251
|
+
inferring version authority; a future compatible hub stores and relays the
|
|
252
|
+
statements but is not the verifier.
|
|
244
253
|
- **§12.3 Daily-budget windows are host-local** — `maxRunsPerDay` gates
|
|
245
254
|
against a window starting at host-local midnight (`localMidnightMs` in
|
|
246
255
|
util.ts), not UTC midnight. Two consequences worth knowing: (1) the day
|
|
@@ -537,7 +546,7 @@ inputs:
|
|
|
537
546
|
|
|
538
547
|
steps:
|
|
539
548
|
- name: deliver
|
|
540
|
-
calls: delivery #
|
|
549
|
+
calls: delivery # local name, or <package>/<workflow> for a CAS workflow
|
|
541
550
|
inputs: # optional: child input name → parent artifact name
|
|
542
551
|
proposal: proposal
|
|
543
552
|
produces: [delivered] # exactly one parent artifact (the outcome artifact)
|
|
@@ -551,7 +560,7 @@ steps:
|
|
|
551
560
|
```
|
|
552
561
|
|
|
553
562
|
Shape rules:
|
|
554
|
-
- `calls:`
|
|
563
|
+
- `calls:` may use a bare workflow name or an explicit qualified name. A bare name uses the ordinary flat resolver for filesystem and `owenloop add` definitions; for a CAS-loaded definition, the resolver first searches that definition's bundle for a sibling with the same name. A qualified `<package>/<workflow>` name resolves only that exact key and never falls back to a bare name.
|
|
555
564
|
- `inputs:` keys must be declared inputs of the child workflow; values must be parent artifact names (inputs or step produces).
|
|
556
565
|
- `produces:` must declare exactly one artifact (the parent artifact the child outcome feeds).
|
|
557
566
|
- A `calls:` step must NOT have a `body:` (it is machine-handled).
|
|
@@ -574,7 +583,7 @@ When the engine spawns a child instance, it passes `producedBy: { parentWf, pare
|
|
|
574
583
|
|
|
575
584
|
### §23.4 Cross-def calls-cycle check
|
|
576
585
|
|
|
577
|
-
At `loadDefs` time, after all defs are expanded and per-def validated, `detectCallsCycles(defs)` performs a DFS over the `calls:` edge graph and throws `DefError: calls cycle: a -> b -> a` if a cycle exists.
|
|
586
|
+
At `loadDefs` time, after all defs are expanded and per-def validated, `detectCallsCycles(defs)` performs a DFS over the `calls:` edge graph and throws `DefError: calls cycle: a -> b -> a` if a cycle exists. The DFS follows the same scope-aware resolution as runtime spawning and keys each edge by the resolved definition, not by the bare text alone; two bundles may therefore each contain a workflow named `build` without being collapsed into one node.
|
|
578
587
|
|
|
579
588
|
This check is **separate** from the include-cycle guard in `expandIncludes` (§22.5) — they walk different edge kinds (`calls:` vs `include:`). An include cycle and a calls cycle can coexist independently and are reported with different messages (`calls cycle:` vs `include cycle:`).
|
|
580
589
|
|
|
@@ -593,6 +602,10 @@ Called at the top of every parent `tick` (outside any transaction), after `provi
|
|
|
593
602
|
1. **Gate check**: `gateStems = Object.values(callsInputs)` (parent artifact names wired to child inputs). Gate is ready when every gate stem is green.
|
|
594
603
|
2. **Re-attach guard**: `findChildByParent(parentWf, callsPath)` — spawn only when no child exists (`undefined`). This re-attaches (rather than re-spawns) across crashes and sequential re-ticks; it does NOT by itself stop *concurrent* ticks in separate processes, which can each read `undefined` here before either inserts — that race is closed by the atomic spawn (§23.6.9). A second guard sits alongside it (§23.6.7 F2): if no child exists AND the parent calls artifact is already `rejected` on a schema refusal, skip the spawn attempt entirely while the gate stems' fingerprint is unchanged from the one stamped at refusal time — a moved gate is the only thing worth retrying against.
|
|
595
604
|
3. **Provision**: if gate is ready, `provisionCallsChild(parentWf, step, callsStem, gateStems)` — a single `BEGIN IMMEDIATE` (§23.6.9) that re-reads the parent snapshot inside the write lock, then finds-or-creates the child AND syncs every mapped `callsInputs` value from that same fresh snapshot. It absorbs both the old spawn and the old re-provide (step 5) into one atomic read-verify-write, so a child is never seeded or re-provided from a snapshot older than its committing tx. The pre-reads above (gate, `findChildByParent`, F2 fingerprint, depth) are OPTIMISTIC — they decide only *whether* to attempt; the helper re-verifies in-tx and aborts silently (returns `null`, nothing written) if the gate re-armed or an F2 debt landed since. Instance/`settled` events fire only when this call created the child; a `commit`/`provide` fires for each input it re-wrote. The parent calls: artifact stays `owed`. §23.6.7 (F2): a child input-schema refusal here (seed or re-provide) is caught narrowly at the call site (`SchemaRefusalError` only — a genuine bug still throws) and recorded as a debt on the parent calls artifact instead of crashing the tick.
|
|
605
|
+
3a. **Spawn pin check**: when step 3 creates a child, the engine resolves `calls:` in the parent's pinned definition scope. For a bare target from a CAS bundle, the child must be a sibling carrying the parent's same bundle digest. For an explicit versioned target, the parent's bundle `lock` entry must equal the resolved child's canonical bundle digest. The v2 format has no per-workflow instruction-digest pin, so the check compares bundle digests, not `defInstructionDigest`.
|
|
606
|
+
|
|
607
|
+
A mismatch rolls back the child creation and input sync, then records the parent `calls:` artifact as `rejected` with a structural reason naming the expected and resolved digests. The engine does not throw or run the mismatched child. The current gate fingerprint prevents the same refusal from being retried on every tick. An already-existing child is read through its own §28 snapshot and is not re-checked by this spawn-only guard.
|
|
608
|
+
|
|
596
609
|
4. **Outcome read**: read the child's declared `outputs:` artifact (exactly one, validated at load time). If it is green, machine-green the parent's calls: artifact.
|
|
597
610
|
5. **Re-provide**: folded into step 3's atomic provision — `provisionCallsChild` syncs every changed `callsInputs` mapping (deep-equal check) inside the same tx that finds-or-creates the child, so the re-provide can no longer race a concurrent parent advance across a separate `provideInput` cascade. The child re-runs internally on each changed input. §23.6.7 (F2): same narrow schema-refusal handling as spawn — a child-illegal re-provided value becomes a debt on the parent calls artifact, not a thrown cascade.
|
|
598
611
|
6. **Machine-green**: set parent calls: artifact to `acceptance: 'green'`, `version + 1`, `value = child outcome value`, `fingerprint = computeFingerprint(parentArts, gateStems) plus the child-outcome version pin` (§23.6.8, F4) — but only when the child outcome's version has moved past whatever version is currently pinned on the parent artifact. Then `settle(parentWf)` so downstream (teardown) fires. Do NOT set `terminal` — the calls: artifact must be re-armable if gate inputs move.
|
|
@@ -660,7 +673,7 @@ The `M2B-REARM` branch (§23.6.1 step 7 — child un-greened while parent stays
|
|
|
660
673
|
|
|
661
674
|
- **Descent condition.** The parent descends into a child step only when all three hold: (1) the step's **gate is green** (same readiness `maintainCalls` uses to spawn/mirror — see `callsGateReady`), (2) a **child instance exists** (`findChildByParent`), and (3) the parent's `calls:` artifact for that step is specifically **`owed`** — an outstanding producer debt, not merely non-green. `owed` is the sole live debt: it covers the fresh spawn, the F4 propagated-reject reopen (§23.6.8), and a gate-move re-arm. A `skipped`/`rejected`/`retracted` mirror is a dead or refused branch and is **not** descended (issuing child work for it would resurrect a settled decision); a re-armed gate with a still-green mirror, or a step whose child was never spawned, is likewise skipped — descent chases only real, outstanding child work. `callsDescendTargets(parentWf, def)` computes this set.
|
|
662
675
|
- **Own-tx-per-frame.** Descent runs *outside* the parent's transaction (`store.tx` is non-re-entrant — `BEGIN IMMEDIATE` would deadlock on itself). Each child frame opens its own tx via its own `tickInternal` call. The descent condition above is an OPTIMISTIC pre-read (computed outside any tx); the child frame carries the `calls:` edge (`parentEdge`) and, inside its own claim tx, re-verifies the parent gate + child-input consistency — the same predicate `publishCallsGreen` uses — before issuing any order, so a concurrent parent advance that superseded the parent value between the pre-read and the claim issues nothing and skips the subtree. This is the descent-path twin of the in-tx read-verify-write invariant §23.6.6 establishes for the publish/provision paths. The recursion carries a `visited` set so a diamond (two parents reaching the same child) or an accidental cycle ticks each instance at most once.
|
|
663
|
-
- **Aggregation.** Child orders are concatenated onto the parent's; `reaped` sums; `dueAt` takes the minimum across the tree so the caller's next-wake is the earliest across all levels. Each folded `DeferredFiring` carries a `workflow` field naming the instance it belongs to — **absent means the ticked root, present means a descendant** — so a caller can still tell which instance a deferral came from. The single `now` is threaded through the whole descent, so a reap TTL that trips at the parent's clock trips consistently for children in the same sweep.
|
|
676
|
+
- **Aggregation.** Child orders are concatenated onto the parent's; `reaped` sums; `dueAt` takes the minimum across the tree so the caller's next-wake is the earliest across all levels. Each folded `DeferredFiring` carries a `workflow` field naming the instance it belongs to — **absent means the ticked root, present means a descendant** — so a caller can still tell which instance a deferral came from. The single `now` is threaded through the whole descent, so a reap TTL that trips at the parent's clock trips consistently for children in the same sweep. Because the folded order list can contain child orders, a driver must commit and close each order against `order.workflow`, not the root id passed to `tick`. The `{ deep: false }` opt-out is the only case where every order is guaranteed to belong to the requested root.
|
|
664
677
|
- **Opt-out.** `tick(parentWf, { deep: false })` (CLI `--shallow`) ticks only that one instance — no descent, orders all carry the root's `workflow`. Use it to drive a single instance deliberately (tests, targeted retries); the default deep tick is what production drivers want.
|
|
665
678
|
|
|
666
679
|
**Status child-summary.** `status(parentWf)` enriches each `calls:`-debt entry with a `child: ChildStatusSummary` (`{ workflow, def, done, stalled, debts }`) when a child has been spawned for that step. `stalled` is true when the child (or, recursively, a grandchild on an unpaid `calls:` path) has any stalled debt — a worker that hit `maxAttempts` with no green outcome. This lets a Shift see, from the parent alone, that a `calls:` debt is blocked on a stuck child without separately walking into the child's own `status`. Like `failedRuns`/`attempts`, the field is engine-populated cross-instance state; `model.ts`'s pure single-instance `workflowStatus` never sets it.
|
|
@@ -718,9 +731,18 @@ named `${producerStep}.${producedStem}.judges.${judgeName}`. Each judge step:
|
|
|
718
731
|
- `judges: <judgedStem>` — the marker field that makes it a judge (mirrors
|
|
719
732
|
`calls:`'s marker-field pattern), read by both layers:
|
|
720
733
|
`eligibleFirings`/`applyOutcome` (model.ts) and `green()` (engine.ts).
|
|
734
|
+
- The producer step's complete parsed `x:` extension carrier is deep-cloned
|
|
735
|
+
onto every synthesized judge. Judge entries do not author their own `x:`;
|
|
736
|
+
inheritance happens after the producer has been fully parsed. Every judge
|
|
737
|
+
receives a separate clone, and an absent producer `x:` remains absent rather
|
|
738
|
+
than becoming an empty map. `buildOrder()` therefore carries the inherited
|
|
739
|
+
carrier as the judge's `Order.x` through the normal generated and persisted
|
|
740
|
+
order path.
|
|
721
741
|
- Everything else — throttles (`cadence`, `maxRunsPerDay`), retry/timeout,
|
|
722
742
|
prompt surface (`body`/`bodyFile`/`model`), observability — is inherited
|
|
723
|
-
from the ordinary `StepDef` shape, not respecified. A judge
|
|
743
|
+
from the ordinary `StepDef` shape, not respecified. A judge entry's
|
|
744
|
+
first-class `model` remains separate from inherited extension data and keeps
|
|
745
|
+
the existing runtime precedence over `x.harness.model`. A judge is not a
|
|
724
746
|
special-cased mini-pipeline; it is a step.
|
|
725
747
|
|
|
726
748
|
**Wiring decision**: judges flow through the *normal* step-firing pipeline
|
|
@@ -930,6 +952,27 @@ Step Agents:**
|
|
|
930
952
|
itself. A TTL sized to the judge's real worst-case latency, rather than
|
|
931
953
|
the platform default, keeps `parallel: 1` actually sufficient in practice.
|
|
932
954
|
|
|
955
|
+
## §24.10 Worker verdict transport
|
|
956
|
+
|
|
957
|
+
Reference-mode judge orders carry `order.judge`, the explicit judged artifact stem;
|
|
958
|
+
workers do not derive judge status from the synthesized step name. A command
|
|
959
|
+
worker approves a judge order by submitting a receipt only when the command exits
|
|
960
|
+
with code `0`. A nonzero exit sends the worker's `reject` request for
|
|
961
|
+
`order.judge` and submits no receipt. A signal or machinery failure has no
|
|
962
|
+
verdict, so the worker issues neither verb and the reap path re-offers the order.
|
|
963
|
+
|
|
964
|
+
Command receipts may also carry a bounded JSON payload emitted by a stdout line
|
|
965
|
+
beginning with `##owenloop:payload##`. The last marker line wins, and the 64 KiB
|
|
966
|
+
JSON-text cap protects the runner because the runner does not buffer full stdout.
|
|
967
|
+
A valid plain-step payload reject is delivered only after every owed receipt has
|
|
968
|
+
been submitted. The reject request contains `workflow`, `run`, `path`, and `text`;
|
|
969
|
+
the hub derives the rejecting actor and the client cannot provide `by`.
|
|
970
|
+
|
|
971
|
+
This worker transport does not change `assertAuthority`: the engine continues to
|
|
972
|
+
enforce consume-edge and judge-scoped authority. The hub-side reference-order
|
|
973
|
+
projection and `/api/reject` handler are delivered by the separate follow-on
|
|
974
|
+
instance.
|
|
975
|
+
|
|
933
976
|
## §25 The model checker (`owenloop check`) — scope
|
|
934
977
|
|
|
935
978
|
`owenloop check <def>` (see `cli.ts` usage) runs a bounded reachability
|
|
@@ -1308,14 +1351,21 @@ Scope notes: `x:` is a key on the two *authored, engine-fired* shapes
|
|
|
1308
1351
|
(`RAW_DEF_KEYS`, `RAW_STEP_KEYS`). It is **not** in the smaller
|
|
1309
1352
|
`calls:`/`include:` directive shapes (same shape-routing rule as §27.2 —
|
|
1310
1353
|
those are machine-handled entries with no order for a runner to configure)
|
|
1311
|
-
and not on produce/group/judge/input entries.
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1354
|
+
and not on produce/group/judge/input entries. A native judge entry therefore
|
|
1355
|
+
cannot author a separate `x:` map. `synthesizeJudgeSteps()` instead gives each
|
|
1356
|
+
compiled judge `StepDef` an independent deep clone of the fully parsed producer
|
|
1357
|
+
step's complete `x:` map; no producer map means no judge map. Core still does
|
|
1358
|
+
not interpret any nested vocabulary, including `x.harness`.
|
|
1359
|
+
|
|
1360
|
+
Because `x:` rides inside the def, it participates in §28 pinning like every
|
|
1361
|
+
other field: an instance sees the `x:` snapshotted at `createInstance` time,
|
|
1362
|
+
and `hashDef` treats an `x:` edit as real drift — which is correct, since the
|
|
1363
|
+
runner's behavior for that instance depends on it. The reference-mode
|
|
1364
|
+
instruction digest also includes every compiled step's `x:`, including the
|
|
1365
|
+
inherited judge clones, and instruction sources retain private deep snapshots.
|
|
1366
|
+
`expandIncludes` carries a child step's `x:` through prefixing untouched (there
|
|
1367
|
+
are no stems inside `x:` to rewrite — it's opaque); a child definition's own
|
|
1368
|
+
top-level `x:` stays on the child def and is not merged into the parent's.
|
|
1319
1369
|
|
|
1320
1370
|
### §27.4 `executor:`/`command:`/`spec:` — declaring the executor
|
|
1321
1371
|
|
|
@@ -1374,11 +1424,18 @@ get a free pass around it. A def with no `executors:` key accepts any executor
|
|
|
1374
1424
|
string; there is no engine-wide registry of valid executor types to check
|
|
1375
1425
|
against.
|
|
1376
1426
|
|
|
1377
|
-
**Pass-through.**
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1427
|
+
**Pass-through — reference mode (§29).** The three fields split at the order
|
|
1428
|
+
boundary. `spec` rides `buildOrder` onto the emitted `Order` untouched
|
|
1429
|
+
(`Order.spec`), the same reference-side pass-through contract as
|
|
1430
|
+
`Order.model` and `Order.x`. The authored `executor:` maps onto the order as
|
|
1431
|
+
`Order.worker` (verbatim string, absent when the step never set it) — the
|
|
1432
|
+
order names *which kind of worker* it is for, without carrying the
|
|
1433
|
+
instruction text. `command:` (and the `body:` prompt) do **not** ride the
|
|
1434
|
+
order at all: they are static authored content, resolved at the worker by the
|
|
1435
|
+
§29 `(defDigest, step, key)` boundary. A step that never sets any of the three emits an order with `worker` and
|
|
1436
|
+
`spec` absent and its instructions resolving to an empty result (no prompt,
|
|
1437
|
+
no command, nothing fabricated) — the executor feature adds no fields for it
|
|
1438
|
+
beyond §29's required `defDigest`.
|
|
1382
1439
|
|
|
1383
1440
|
**Judges get the same fields, for free.** §24's `synthesizeJudgeSteps` turns
|
|
1384
1441
|
each `judges:` entry into an ordinary `StepDef` — so a judge entry accepting
|
|
@@ -1452,7 +1509,9 @@ instance yet to pin against) and `adopt` (§28.4, which deliberately wants the
|
|
|
1452
1509
|
def) and `triggerParentIfChild` (resolving a parent's def when re-triggering
|
|
1453
1510
|
it) — goes through `defFor`, so a pinned child or parent instance is
|
|
1454
1511
|
respected during Mode 1/Mode 2 cascades too, not just on its own direct
|
|
1455
|
-
`tick`.
|
|
1512
|
+
`tick`. A CAS snapshot also carries the bundle provenance used for scoped
|
|
1513
|
+
bare `calls:` resolution, so installing a newer bundle version does not
|
|
1514
|
+
retarget an already-running parent's sibling call.
|
|
1456
1515
|
|
|
1457
1516
|
### §28.3 `defDrift` — informational, never a refusal
|
|
1458
1517
|
|
|
@@ -1506,3 +1565,266 @@ step output, it is exactly what `adopt` knows how to materialize.
|
|
|
1506
1565
|
|
|
1507
1566
|
`adopt` returns `{ workflow, defHash, previousHash? }` (`previousHash` is
|
|
1508
1567
|
omitted for a legacy pre-pinning row that had no prior hash to report).
|
|
1568
|
+
|
|
1569
|
+
## §29 Reference-mode orders — static instructions resolve by digest
|
|
1570
|
+
|
|
1571
|
+
Every section up to here describes *what* an engine asks a worker to do as a
|
|
1572
|
+
unit of text authored in the definition (`body:`, `command:`). Before this
|
|
1573
|
+
change, that text was copied onto every emitted `Order` (`Order.prompt`,
|
|
1574
|
+
`Order.command`) and persisted into every run row — so the authored
|
|
1575
|
+
instructions traveled with the wire packet, appeared in every CLI output, and
|
|
1576
|
+
sat duplicated in the store once per firing. The wire contract now splits
|
|
1577
|
+
the order's contents by their nature:
|
|
1578
|
+
|
|
1579
|
+
- **Static, authored content** — the step's `body:` prompt, its `command:`
|
|
1580
|
+
text, any judge's authored body — lives in exactly one place: the
|
|
1581
|
+
definition (its pinned snapshot, §28). Orders carry a *reference* to it,
|
|
1582
|
+
never the text itself.
|
|
1583
|
+
- **Dynamic, per-run data** — the run coordinates (`run`, `workflow`,
|
|
1584
|
+
`step`, `key`, `index`), the captured input values (`consumes`), the owed
|
|
1585
|
+
outputs with their accumulated reason threads (`owes[]`), the routing hints
|
|
1586
|
+
(`model`, `spec`, `worker`, `x`), the firing `cause` — exists only for
|
|
1587
|
+
this firing and stays on the order, exactly as before.
|
|
1588
|
+
|
|
1589
|
+
An order is therefore a **reference packet**. Every newly emitted and
|
|
1590
|
+
persisted order carries a required `defDigest`; no order carries `prompt`,
|
|
1591
|
+
`command`, or `owes[].acceptance`. `owes[]` keeps `path`,
|
|
1592
|
+
`judgmentRejects`, `schemaRejects`, and `reasons` (the rejection thread is
|
|
1593
|
+
dynamic feedback, so it stays); the acceptance lifecycle state it used to
|
|
1594
|
+
duplicate is read from the artifact row, which is where it lives anyway
|
|
1595
|
+
(§5, §24.1). The claim-time invariant is unchanged: the order is built and
|
|
1596
|
+
the run row is inserted in the same transaction, and the persisted
|
|
1597
|
+
`RunData.order` is byte-identical to the packet `tick` handed out.
|
|
1598
|
+
|
|
1599
|
+
### §29.1 `defDigest` — instruction-content identity
|
|
1600
|
+
|
|
1601
|
+
`defDigest` identifies the definition snapshot an order was emitted against,
|
|
1602
|
+
at the granularity that matters for instructions: the sha256 of a canonical
|
|
1603
|
+
JSON projection of the definition's instruction-bearing fields (the
|
|
1604
|
+
top-level routing fields — `name`, `engine`, `inputs`, `outputs`,
|
|
1605
|
+
`invariants`, `x`, `executors` — plus each step's `consumes`, `produces`, and
|
|
1606
|
+
`generates` **raw path strings** and its authored `model`, `executor`,
|
|
1607
|
+
`command`, `spec`, `workdir`, `workdirFrom`, effect/on/idle/reap/capabilities/calls/judges
|
|
1608
|
+
configuration and `body`). This shipped fallback projection intentionally
|
|
1609
|
+
reduces each produce pattern to `p.raw`, so a produce-level schema,
|
|
1610
|
+
`maxAttempts`, or `maxSchemaFailures` change does not change the fallback
|
|
1611
|
+
digest. The fallback identity is therefore weaker than a full compiled-
|
|
1612
|
+
definition identity; a store-backed source can match this projection against
|
|
1613
|
+
verified bundle objects through the same resolver seam. Two fields are deliberately excluded: `dir` (where
|
|
1614
|
+
the YAML was loaded from — source-location metadata, not content) and
|
|
1615
|
+
`_includes` (expansion bookkeeping, cleared post-expansion). Identical
|
|
1616
|
+
content loaded from two different directories digests identically; a change
|
|
1617
|
+
to a step's prompt, command, or included routing field digests differently.
|
|
1618
|
+
|
|
1619
|
+
`defDigest` is **not** `hashDef` (§28.1's drift hash — the 16-hex prefix of
|
|
1620
|
+
the full `JSON.stringify(def)`): `hashDef` sees every field including `dir`
|
|
1621
|
+
and serves the informational `defDrift` comparison, while `defDigest` sees
|
|
1622
|
+
the fallback projection described above and serves resolution identity. Both
|
|
1623
|
+
are content hashes of the same `WorkflowDef` object but answer different
|
|
1624
|
+
questions, and neither is a truncation of the other.
|
|
1625
|
+
|
|
1626
|
+
### §29.2 The resolver boundary — `(defDigest, step, key)`
|
|
1627
|
+
|
|
1628
|
+
Resolution is one seam, shared by every consumer of orders (the CLI, the
|
|
1629
|
+
embedded engine, and anything built on top):
|
|
1630
|
+
|
|
1631
|
+
```
|
|
1632
|
+
interface OrderInstructionSource {
|
|
1633
|
+
digestOf(def: WorkflowDef): string; // identity + registration
|
|
1634
|
+
lookup(ref: OrderInstructionRef): OrderInstructionLookup;
|
|
1635
|
+
}
|
|
1636
|
+
|
|
1637
|
+
interface OrderInstructionRef { defDigest: string; step: string; key: string; }
|
|
1638
|
+
interface ResolvedInstructions { prompt?: string; command?: string; acceptance?: string; }
|
|
1639
|
+
interface ResolvedInstructionRecord extends ResolvedInstructions {
|
|
1640
|
+
maxAttempts: number; // materialization metadata
|
|
1641
|
+
}
|
|
1642
|
+
type OrderInstructionLookup =
|
|
1643
|
+
| { status: 'resolved'; instructions: ResolvedInstructionRecord }
|
|
1644
|
+
| { status: 'unknown-digest' }
|
|
1645
|
+
| { status: 'unknown-step' };
|
|
1646
|
+
```
|
|
1647
|
+
|
|
1648
|
+
`createDefInstructionSource(defs?)` is the shipped adapter: it indexes
|
|
1649
|
+
private deep snapshots of loaded definitions by digest and serves the exact
|
|
1650
|
+
authored values — byte-for-byte, whitespace preserved, nothing trimmed,
|
|
1651
|
+
nothing fabricated (an authored empty `body:` resolves to `prompt: ''`; a
|
|
1652
|
+
step with no `command:` resolves to no command). The typed lookup result keeps
|
|
1653
|
+
an unknown digest distinct from a missing step inside a known digest. The
|
|
1654
|
+
resolved record also carries the step's `maxAttempts` default, so an injected
|
|
1655
|
+
source cannot silently erase `${MAX_ATTEMPTS}` during materialization. The
|
|
1656
|
+
seam is an injectable interface because the digest-keyed lookup is precisely
|
|
1657
|
+
the shape the store-backed source uses: an embedder or driver can prime
|
|
1658
|
+
verified bundle objects and then hand the engine's resolver the synchronous
|
|
1659
|
+
lookup seam. The engine ships no network fetch and does not wire the store source
|
|
1660
|
+
by default — "verified local source" means the local object the deployer trusts,
|
|
1661
|
+
addressed by digest.
|
|
1662
|
+
|
|
1663
|
+
`OrderResolver` sits on top of a source: `resolve(ref)` returns the source's
|
|
1664
|
+
record or throws the named refusal; `resolveOrder(order)` builds the
|
|
1665
|
+
`{defDigest, step, key}` ref from an order and additionally materializes the
|
|
1666
|
+
runtime placeholders in the resolved prompt — the same substitution
|
|
1667
|
+
`${WORKFLOW}`/`${RUN}`/`${STEP}`/`${KEY}`/`${INDEX}`/`${MAX_ATTEMPTS}` that
|
|
1668
|
+
`buildOrder` used to inline, moved whole to resolution time (unknown
|
|
1669
|
+
placeholders stay untouched; `MAX_ATTEMPTS` renders the `maxAttempts` metadata
|
|
1670
|
+
from the resolved instruction record). Substitution
|
|
1671
|
+
moved because the packet no longer contains materialized text: the authored
|
|
1672
|
+
body is served as authored, and the per-run values join it at resolve time.
|
|
1673
|
+
`Engine` exposes the resolver as `engine.resolver` (and `createEngine`
|
|
1674
|
+
returns it alongside the engine), so an embedder's loop is
|
|
1675
|
+
`tick → resolve → execute → green/close`; the commit and close use the
|
|
1676
|
+
order's own `workflow` because the default deep tick can return child orders.
|
|
1677
|
+
|
|
1678
|
+
### §29.3 Unknown digest — a named refusal, never a fallback
|
|
1679
|
+
|
|
1680
|
+
If `lookup` returns `{ status: 'unknown-digest' }` — the definition was never
|
|
1681
|
+
delivered to this worker, or the delivered bytes differ from what emitted
|
|
1682
|
+
the order — resolution throws `UnknownDefDigestError`. The error names the
|
|
1683
|
+
digest (`err.defDigest`, and in its message) and nothing else is attempted:
|
|
1684
|
+
there is no fall back to name-based resolution, no "closest matching def",
|
|
1685
|
+
no empty-instructions degradation. If the digest is known but `step` is not
|
|
1686
|
+
present, resolution throws `UnknownInstructionError` and identifies the
|
|
1687
|
+
`defDigest`, `step`, and `key`; that malformed reference must not claim the
|
|
1688
|
+
verified digest is unknown. Digest identity is the point — a worker that
|
|
1689
|
+
cannot resolve the exact digest and instruction reference it was handed must
|
|
1690
|
+
refuse the job, because executing instructions it cannot vouch for would
|
|
1691
|
+
reintroduce, through the back door, the very channel this contract removes.
|
|
1692
|
+
|
|
1693
|
+
### §29.4 Interaction with pinning (§28)
|
|
1694
|
+
|
|
1695
|
+
`buildOrder` computes the digest of the definition it is actually emitting
|
|
1696
|
+
against — for a pinned instance (§28.2), the exact `defSnapshot` — and
|
|
1697
|
+
`digestOf` registers that snapshot as a side effect. So an order's digest
|
|
1698
|
+
always resolves to the snapshot that emitted it, even when the live
|
|
1699
|
+
definition has since drifted (§28.3) or been deleted entirely: the pinned
|
|
1700
|
+
bytes are in the source because the engine put them there at emission time.
|
|
1701
|
+
`adopt` (§28.4) re-pins; the next order an adopted instance emits carries
|
|
1702
|
+
the new snapshot's digest and resolves to the new instructions. Pre-pinning
|
|
1703
|
+
rows resolving by name get their digest from the live def the same way —
|
|
1704
|
+
the reference-mode contract applies uniformly; there is no legacy order
|
|
1705
|
+
shape and no verify-mode branch anywhere in the path.
|
|
1706
|
+
|
|
1707
|
+
### §29.5 Consume-side dynamic evidence
|
|
1708
|
+
|
|
1709
|
+
The target wire shape defines two signed-evidence channels for dynamic data:
|
|
1710
|
+
`consumesProof` is a JSON-serialized map from consumed artifact path to a
|
|
1711
|
+
serialized DSSE `submission.v1` envelope, and `owes[].proof` is a serialized
|
|
1712
|
+
DSSE envelope for the complete rejection-reason thread on one owed artifact. A
|
|
1713
|
+
compatible hub stores and relays these strings but does not verify, repair, or
|
|
1714
|
+
authorize them. The production hub deployed as of 2026-08-10 omits these fields
|
|
1715
|
+
and drops submit proofs, so these channels are not yet end-to-end production
|
|
1716
|
+
capabilities.
|
|
1717
|
+
|
|
1718
|
+
A consuming driver gates the complete order before the order reaches a prompt,
|
|
1719
|
+
MCP model context, or command. For each consumed value, the gate verifies the
|
|
1720
|
+
DSSE envelope first, validates the signed submission record, cross-checks the
|
|
1721
|
+
authenticated signer key with `producerKeyId`, checks the path, canonical value
|
|
1722
|
+
digest, and supplied claim-time version, then validates the local enrollment
|
|
1723
|
+
chain, revocations, and any supplied demand's scope. For an `owes[].proof`
|
|
1724
|
+
envelope, the signed produced value is the complete `owes[].reasons` array;
|
|
1725
|
+
the gate runs before replay truncation so the verified bytes are the full
|
|
1726
|
+
thread.
|
|
1727
|
+
|
|
1728
|
+
The built-in production `exec`, `agent-run`, and `hold` roles currently pass no
|
|
1729
|
+
pool, label, or namespace demand. `OrderPacket` has no demand field from which
|
|
1730
|
+
to derive one, so production gates enforce chain termination, per-link
|
|
1731
|
+
signatures, attenuation, and revocation, while the demand-dependent
|
|
1732
|
+
`scopePermits` check is vacuous. The verifier seam can receive a demand and
|
|
1733
|
+
apply the full scope check; this limitation is a named follow-up.
|
|
1734
|
+
|
|
1735
|
+
The gate returns `verified`, `absent`, `unverifiable`, or `invalid`. The
|
|
1736
|
+
configured `artifactPolicy` maps `absent` and `unverifiable` to refusal,
|
|
1737
|
+
warning, or admission for `enforce`, `warn`, and `off`; `invalid` always
|
|
1738
|
+
refuses. A command worker has an unconditional stronger rule: all absent,
|
|
1739
|
+
unverifiable, and invalid consumed evidence refuses before policy lookup or
|
|
1740
|
+
shell execution. An order is refused as a whole; the gate never drops only one
|
|
1741
|
+
unverified value and proceeds with a partial packet.
|
|
1742
|
+
|
|
1743
|
+
**Decision B — consumer-owned revocation time.** The consumer supplies the
|
|
1744
|
+
validation clock. Revocations whose `effectiveFrom <= at` invalidate the key at
|
|
1745
|
+
consume time; a producer-signed timestamp cannot move that boundary. The
|
|
1746
|
+
consumer samples the clock once per gate invocation. Revocation cuts forward: a
|
|
1747
|
+
prior successful decision is not rewritten, but a later consumption is checked
|
|
1748
|
+
against the cut.
|
|
1749
|
+
|
|
1750
|
+
**Decision A — version cross-check without fingerprint recomputation.** D3
|
|
1751
|
+
checks the versions present in `consumedFingerprint` against the signed
|
|
1752
|
+
`produced[].version`, but does not recompute the producer's complete map because
|
|
1753
|
+
the reduced packet lacks independently authenticated upstream evidence. A
|
|
1754
|
+
hostile hub can weaken a producer's declared lineage with an explicit empty or
|
|
1755
|
+
partial map. That lineage limitation remains a named follow-up.
|
|
1756
|
+
|
|
1757
|
+
## §30 Store-backed execution resolution
|
|
1758
|
+
|
|
1759
|
+
Reference-mode packets remove authored instruction text from the transport, but
|
|
1760
|
+
that removal is only useful if the worker refuses to execute text supplied by the
|
|
1761
|
+
transport. The execution-side source is therefore backed by the local
|
|
1762
|
+
content-addressed workflow store.
|
|
1763
|
+
|
|
1764
|
+
### §30.1 Prime, then look up
|
|
1765
|
+
|
|
1766
|
+
`createStoreInstructionSource({ projectRoot, globalRoot, verifier })` has an
|
|
1767
|
+
asynchronous `prime(defDigest)` operation and the synchronous `lookup(ref)`
|
|
1768
|
+
operation required by `OrderResolver`:
|
|
1769
|
+
|
|
1770
|
+
1. `prime` reads the project and global store indexes and enumerates their
|
|
1771
|
+
indexed bundle objects.
|
|
1772
|
+
2. Each candidate is resolved through the store's digest resolver. The resolver
|
|
1773
|
+
re-checks the installed object's manifest integrity map before the workflow
|
|
1774
|
+
is loaded. A project object that exists but is corrupt is an integrity
|
|
1775
|
+
refusal; it is not hidden by a valid global copy.
|
|
1776
|
+
3. The source reads the verified object's `bundle.yaml`, loads every workflow
|
|
1777
|
+
path listed in the `workflows` map, finalizes all definitions together, and
|
|
1778
|
+
computes each instruction projection digest. The source caches the matching
|
|
1779
|
+
definition when one projection digest equals the order's `defDigest`.
|
|
1780
|
+
4. `lookup` then serves the cached step's authored body and command bytes. A
|
|
1781
|
+
cache miss is `unknown-digest`; a known digest with no matching step is
|
|
1782
|
+
`unknown-step`.
|
|
1783
|
+
|
|
1784
|
+
The two digest spaces are deliberate. Store object directories use the bundle's
|
|
1785
|
+
canonical archive digest, while orders use the instruction projection digest.
|
|
1786
|
+
The source bridges those spaces by deriving the projection digest from verified
|
|
1787
|
+
local objects; no remote text and no second persisted mapping is needed. Because
|
|
1788
|
+
filesystem verification is asynchronous but the engine's resolver seam is
|
|
1789
|
+
synchronous, the worker primes first and resolves second. A source cache is not
|
|
1790
|
+
a permission to resolve an unprimed digest.
|
|
1791
|
+
|
|
1792
|
+
### §30.2 Refuse before execution
|
|
1793
|
+
|
|
1794
|
+
An unknown or empty `defDigest`, an unknown step, a missing command on a command
|
|
1795
|
+
order, a failed object-integrity check, or an origin-policy failure is a named
|
|
1796
|
+
refusal. Origin-policy failures include invalid retained origin evidence,
|
|
1797
|
+
insufficient provenance for a recovered namespace, the same digest indexed
|
|
1798
|
+
under namespaces with different selected origin requirements, and an unknown
|
|
1799
|
+
namespace when the effective origin mode is
|
|
1800
|
+
`enforce`. The worker does not fall back to a workflow name, a remotely
|
|
1801
|
+
supplied prompt or command, a closest digest, or an empty command. A
|
|
1802
|
+
`worker: command` order is never passed to the process runner unless the exact
|
|
1803
|
+
command bytes came from the verified local store and the publication hard rule
|
|
1804
|
+
has passed. Runtime placeholder substitution applies to prompts only; command
|
|
1805
|
+
bytes are returned exactly as authored.
|
|
1806
|
+
|
|
1807
|
+
The same rule applies to agent workers. The prepare cache may retain routing and
|
|
1808
|
+
dispatch metadata, but the agent brief is rebuilt from the verified store
|
|
1809
|
+
step. The brief therefore does not originate from a transport-populated cache or
|
|
1810
|
+
a transport round trip.
|
|
1811
|
+
|
|
1812
|
+
### §30.3 Harness carriers fail closed
|
|
1813
|
+
|
|
1814
|
+
Before an agent harness starts, the worker parses the verified step's harness
|
|
1815
|
+
carrier and normalizes its permissions. A malformed carrier is a refusal, not
|
|
1816
|
+
an empty permission set. For example, a non-map `x.harness`, a non-string
|
|
1817
|
+
`x.harness.id`, or a legacy carrier key refuses before the harness starts; a
|
|
1818
|
+
hand-written `x` block cannot silently drop fields such as `disallowedTools`.
|
|
1819
|
+
Well-formed but unknown permission fields remain data for the selected harness,
|
|
1820
|
+
while malformed carrier structure remains an error.
|
|
1821
|
+
|
|
1822
|
+
### §30.4 Bundle installation adapter
|
|
1823
|
+
|
|
1824
|
+
The default CLI binds the real `.wnlp` bundle ingestor. Real bundles are staged
|
|
1825
|
+
through every workflow path listed in their `bundle.yaml` manifest, rather than
|
|
1826
|
+
scanning the manifest as if `bundle.yaml` were a workflow definition. The install
|
|
1827
|
+
path still requires a pre-commit verifier and remains fail-closed when that
|
|
1828
|
+
adapter is not provided. The ingestor and verifier are separate concerns:
|
|
1829
|
+
ingestion makes the bundle's verified object available, while the verifier
|
|
1830
|
+
decides whether the install may commit it.
|