@archmax-ai/harness 0.6.0 → 0.7.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.
Files changed (53) hide show
  1. package/README.md +2 -2
  2. package/dist/assembly/compose.js +0 -1
  3. package/dist/assembly/compose.js.map +1 -1
  4. package/dist/authoring-skill/archmax-harness/references/backend-integration.md +6 -0
  5. package/dist/authoring-skill/archmax-harness/references/hook-and-test-scripts.md +23 -4
  6. package/dist/authoring-skill/archmax-harness/references/workflow-schema.md +51 -21
  7. package/dist/authoring-skill/archmax-harness/references/workflow-yaml.md +11 -7
  8. package/dist/core/frontmatter.d.ts +11 -0
  9. package/dist/core/frontmatter.js +29 -3
  10. package/dist/core/frontmatter.js.map +1 -1
  11. package/dist/kernel/kernel.d.ts +9 -6
  12. package/dist/kernel/kernel.js +80 -14
  13. package/dist/kernel/kernel.js.map +1 -1
  14. package/dist/lifecycle/runner.d.ts +6 -0
  15. package/dist/lifecycle/runner.js +1 -0
  16. package/dist/lifecycle/runner.js.map +1 -1
  17. package/dist/machine/machine.d.ts +22 -0
  18. package/dist/machine/machine.js +42 -5
  19. package/dist/machine/machine.js.map +1 -1
  20. package/dist/sandbox/executor.d.ts +5 -0
  21. package/dist/sandbox/executor.js +1 -1
  22. package/dist/sandbox/executor.js.map +1 -1
  23. package/dist/sandbox/runtime.d.ts +15 -2
  24. package/dist/sandbox/runtime.js +180 -23
  25. package/dist/sandbox/runtime.js.map +1 -1
  26. package/dist/sandbox/tools.js +3 -0
  27. package/dist/sandbox/tools.js.map +1 -1
  28. package/dist/workflow/file-values.d.ts +8 -10
  29. package/dist/workflow/file-values.js +4 -5
  30. package/dist/workflow/file-values.js.map +1 -1
  31. package/dist/workflow/governance.d.ts +1 -1
  32. package/dist/workflow/governance.js +3 -2
  33. package/dist/workflow/governance.js.map +1 -1
  34. package/dist/workflow/middleware.js +1 -2
  35. package/dist/workflow/middleware.js.map +1 -1
  36. package/dist/workflow/parks.js +6 -2
  37. package/dist/workflow/parks.js.map +1 -1
  38. package/dist/workflow/render-prompt.js +12 -4
  39. package/dist/workflow/render-prompt.js.map +1 -1
  40. package/dist/workflow/sub-workflow.js +8 -7
  41. package/dist/workflow/sub-workflow.js.map +1 -1
  42. package/dist/workflow/tool-service.d.ts +1 -1
  43. package/dist/workflow/tool-service.js +7 -1
  44. package/dist/workflow/tool-service.js.map +1 -1
  45. package/dist/workflow/turn-boundary.js +22 -6
  46. package/dist/workflow/turn-boundary.js.map +1 -1
  47. package/dist/workflow/workflow-tools.js +1 -1
  48. package/dist/workflow/workflow-tools.js.map +1 -1
  49. package/package.json +1 -1
  50. package/skills/archmax-harness/references/backend-integration.md +6 -0
  51. package/skills/archmax-harness/references/hook-and-test-scripts.md +23 -4
  52. package/skills/archmax-harness/references/workflow-schema.md +51 -21
  53. package/skills/archmax-harness/references/workflow-yaml.md +11 -7
package/README.md CHANGED
@@ -124,8 +124,8 @@ states:
124
124
 
125
125
  A start whose `due` is not a real `YYYY-MM-DD` day is refused before any model call, and a session
126
126
  that finishes with `total` not a number is rejected. One that finishes with `total` unset is
127
- rejected too, unless it runs as a sub-workflow: then its caller gets the returns it did set, plus a
128
- `note` naming the rest. `signatureJsonSchema` on
127
+ rejected too, unless it runs as a sub-workflow: then its caller gets `total` empty (`null`), plus a
128
+ `note` naming it. A return is owed only when the session finishes, and a seed of one lands unlocked. `signatureJsonSchema` on
129
129
  `@archmax-ai/harness/spec` turns the same signature into a JSON Schema. See
130
130
  [triggers](https://harness.archmax.ai/guides/triggers/#typing-a-signature).
131
131
 
@@ -336,7 +336,6 @@ export async function composeGoverned(ctx, input) {
336
336
  // `file` return copied back: across sessions, each bound in turn.
337
337
  const callerFiles = fileGovernance({
338
338
  machine: target,
339
- workflow: input.workflow,
340
339
  policyRules: governanceRules,
341
340
  mountPrefixes: ctx.mountPrefixes,
342
341
  skills: ctx.skillTable,
@@ -1 +1 @@
1
- {"version":3,"file":"compose.js","sourceRoot":"","sources":["../../src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AQ,EACd,aAAa,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,YAAY,EAC1C,cAAc,gBAAgB,CAAC,IAAI,CAAC,UAAU,MAAM,EAAE,CACvD,CAAC;QACJ,CAAC;IACH,CAAC;IACD,OAAO,UAAU,CAAC;AACpB,CAAC;AAED;;;;GAIG;AACH,SAAS,mBAAmB,CAAC,UAAgC;IAC3D,MAAM,QAAQ,GAA8B,EAAE,CAAC;IAC/C,KAAK,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,IAAI,UAAU,EAAE,CAAC;QAC3C,MAAM,KAAK,GAAG,CAAC,SAAS,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC;QAClF,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC;YAAE,QAAQ,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,GAAG,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;IAC1H,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,0FAA0F;AAC1F,MAAM,UAAU,gBAAgB,CAAC,GAAoB,EAAE,IAAqB;IAC1E,OAAO,eAAe,CAAC,IAAI,EAAE,GAAG,CAAC,YAAY,CAAC,CAAC;AACjD,CAAC"}
@@ -157,6 +157,12 @@ try {
157
157
  }
158
158
  ```
159
159
 
160
+ To cancel a turn, pass an `AbortSignal` as `signal` in the same config (or in
161
+ `agent.workflow.send(sessionId, input, { signal })`) and abort it. The turn's
162
+ scripts stop with it, in the session and its child sessions: a pending `tools.*`
163
+ call fails and later ones are refused. The `dispose` in the `finally` is safe even
164
+ while a cancelled script's call is still pending.
165
+
160
166
  Use `agent.stream(...)` instead of `invoke` when you want to record a
161
167
  trajectory or push incremental updates.
162
168
 
@@ -198,7 +198,7 @@ Every `tools.*` call is checked by the decision kernel at the moment it runs —
198
198
  the same kernel, with the same rules, that governs a tool call the model makes
199
199
  directly. What differs is only _whose authority_ the script runs on:
200
200
 
201
- | Script kind | The state's own governance (`tools.allow`, `tools.forbid`, `skills.*`) | Safety rules, workflow-wide `forbid_always`, consumer rules |
201
+ | Script kind | The state's own governance (`tools.allow`, `tools.forbid`, `skills.*`, `mounts.*`) | Safety rules, workflow-wide `forbid_always`, the workflow's mount grants, consumer rules |
202
202
  | ----------------------------------------------- | ---------------------------------------------------------------------- | ----------------------------------------------------------- |
203
203
  | Lifecycle hook (`before:`/`after:`) | **Not applied** — a gate must read evidence the state never grants, and a state's denial does not reach it either | Applied |
204
204
  | `archmax_run` script (the model chose to run it) | **Applied** — it runs on the model's authority | Applied |
@@ -208,9 +208,22 @@ A hook runs on **runtime authority**: outside the active state's tool surface in
208
208
  `await tools.readFile({ file_path: "skills/order-data/assets/orders.json" })`
209
209
  even in a state whose `allow` list never mentions `read_file`, one that enables
210
210
  no skill at all, and one whose `tools.forbid` names the very tool it calls — while
211
- the workflow's `tools.forbid_always` and `skills.forbid_always` bind it like
212
- anything else, and no script of either kind may write into the read-only authored
213
- zone.
211
+ the workflow's `tools.forbid_always`, `skills.forbid_always` and
212
+ `mounts.forbid_always` bind it like anything else, and no script of either kind
213
+ may write into the read-only authored zone.
214
+
215
+ Mounts are held to the **workflow's** grants, taken across every state. A hook
216
+ reads a governed mount that `mounts.allow_always` or any state's `mounts.allow`
217
+ names, even in a state that enables none, and writes one only where a grant of
218
+ the workflow asks `access: read_write`. A governed mount no grant of the workflow
219
+ names is refused (`mount.not-allowed`). That includes a mount in the table only
220
+ because a child workflow grants it. So grant a mount the hook needs:
221
+
222
+ ```js
223
+ // workflow.yaml: states.review.mounts.allow: [contracts]
224
+ // A before hook on any state of this workflow may then read it:
225
+ const policy = await tools.readFile({ file_path: "contracts/policy.md" });
226
+ ```
214
227
 
215
228
  Neither kind may **read** the authoring plane at all. A `tools.*` call naming
216
229
  `workflows/**` is blocked (`zone.governance-plane`) with a
@@ -327,6 +340,12 @@ can act on what worked — `Promise.allSettled` is the honest shape when partial
327
340
  meaningful. Each sub-run is its own session with its own `scratchpad/`, so concurrent sub-runs
328
341
  never collide on a path; a `file` return comes back as a copy under a name no other file holds.
329
342
 
343
+ A script lives as long as its turn. When the host cancels the turn, a call still in flight fails
344
+ with `Tool '<name>' failed: the turn was aborted`, and every call the script makes after that is
345
+ refused the same way before it reaches the tool. A retry in a `catch` therefore dispatches nothing
346
+ more, so there is no need to tell a cancel apart from an ordinary failure. Hook scripts stop the
347
+ same way.
348
+
330
349
  ### Worked example: a `before` gate
331
350
 
332
351
  The tenancy half of the bundled example's entry gate
@@ -206,7 +206,8 @@ mounts?:
206
206
  # validate ERRORS on a name the table does not mount.
207
207
  forbid_always?: string[] # MOUNT NAMES out of reach of EVERY state, governed or
208
208
  # not, whatever any list grants. Deny beats allow.
209
- # Inherited by every sub-workflow, naming the workflow
209
+ # Binds this workflow's own HOOKS too, and is
210
+ # inherited by every sub-workflow, naming the workflow
210
211
  # that declared it. A NAME only — a denial is total, so
211
212
  # there is no `access` to qualify. (A root `mounts.allow`
212
213
  # is a load error: one mounts model.)
@@ -391,7 +392,11 @@ states:
391
392
  # volatile prompt block, and filtered out of every
392
393
  # ls/glob/grep result, the WORKSPACE ROOT LISTING
393
394
  # included. Lifecycle HOOKS are exempt from this key
394
- # (runtime authority), but not from `forbid_always`.
395
+ # (runtime authority), but not from `forbid_always`
396
+ # nor from the WORKFLOW's grants: a hook reaches a
397
+ # governed mount only if allow_always or SOME state's
398
+ # allow names it, in any state, and writes it only
399
+ # where a grant of the workflow asks `read_write`.
395
400
 
396
401
  model?: string # MODEL ID ONLY — this state's turns run on it (and the
397
402
  # handoff message of a park it holds). Most specific of
@@ -542,12 +547,18 @@ states:
542
547
  - `requires:` / `returns:` are the run's **signature**, and both are enforced. A
543
548
  firing that does not supply every `requires` name does not start. `returns`
544
549
  is checked once as the run finishes, and **nothing is handed back**: a
545
- sub-workflow child with a name unset **completes**, and its caller gets the
546
- returns it set plus `note: "Not all return variables were set by the
547
- sub-workflow: '<name>' was not set."`; a top-level run with a name unset is
548
- **rejected**; a typed one mistyped rejects either way. A run that *parks* is
549
- not checked — it has not finished. `note` is reserved: a `returns` list may
550
- not declare it. Want the model to try again? Check the returns in a terminal
550
+ sub-workflow child with a name unset **completes**, and its caller gets
551
+ every declared return, the unset ones `null`, plus `note: "Not all return
552
+ variables were set by the sub-workflow: '<name>' was not set."`; a top-level
553
+ run with a name unset is **rejected**; a typed one mistyped rejects either
554
+ way. A run that *parks* is not checked — it has not finished. A return is
555
+ owed **only at the finish**: `archmax_advance` checks a state's own
556
+ `requires:`, never the returns, a later write replaces an unlocked earlier
557
+ one, and a seed of one (a name in both lists) lands **unlocked** and does not
558
+ overwrite a value the session already holds. So do not list a return in a
559
+ state's `requires:` unless that state must settle it, and do not tell the
560
+ agent to lock one before its value is final. `note` is reserved: a `returns`
561
+ list may not declare it. Want the model to try again? Check the returns in a terminal
551
562
  `after` hook, which can `correct`. Each entry is a bare
552
563
  run-variable name (**untyped**: any value, `null` included) or a strict object
553
564
  `{ name, type?, description? }` naming one; the spellings mix in one list and
@@ -577,8 +588,10 @@ states:
577
588
  completion and at a delegation call the runtime also requires a **file** (not a
578
589
  folder) at the path that the session may read **on runtime authority** — the
579
590
  rules a hook is bound by: zone rules (`checkpoints/`, `artifacts/`, `_specs/`
580
- never) and every workflow-wide `forbid_always`, inherited ones included; the
581
- state's allow list and mount/skill grants do not narrow it. So tell the agent to
591
+ never), the workflow's mount grants taken across all its states (a governed
592
+ mount no state is granted is out of reach), and every workflow-wide
593
+ `forbid_always`, inherited ones included; the state's allow list and its own
594
+ mount/skill grants do not narrow it. So tell the agent to
582
595
  write the file *before* it sets a `file` return: `archmax_set_variables` refuses
583
596
  a path with nothing there. A host hands a file in with `TurnInput.files` (CLI:
584
597
  `archmax run … --file invoice=./invoice.pdf`), which places it under
@@ -774,7 +787,8 @@ workflow's grant, the state's own `allow` and the always-on surface alike.
774
787
  **Deny beats allow, and no narrower level widens a denial.** A forbid entry may
775
788
  name the tool `*` (every tool); `*` in an allow list is a load error. A lifecycle
776
789
  hook is exempt from the state's `allow` **and** its `forbid` — runtime authority,
777
- outside that surface both ways — but never from `forbid_always`.
790
+ outside that surface both ways — but never from `forbid_always` (the workflow's
791
+ own `tools.`, `skills.` and `mounts.forbid_always`, and every ancestor's).
778
792
 
779
793
  Precedence (highest first):
780
794
 
@@ -873,7 +887,8 @@ capability workflow-wide.
873
887
  Hooks are **exempt**: a `before`/`after` script reads authored data on runtime
874
888
  authority, so a state may enable nothing and still be gated by a hook that reads
875
889
  the very bundle the model cannot. That is the shape to reach for when a capability
876
- should *enforce* something without being *usable*.
890
+ should *enforce* something without being *usable*. A bundle the workflow's
891
+ `skills.forbid_always` denies is refused to its hooks too.
877
892
 
878
893
  **`tools.forbid` on a state denies there**, and `tools.forbid_always` at the
879
894
  root denies everywhere. Both beat every grant. Migrating a workflow off the
@@ -1015,7 +1030,18 @@ so `AGENTS.md.bak` is not captured.
1015
1030
 
1016
1031
  Hooks and rubric graders are bound by `mounts.forbid_always` and **not** by a
1017
1032
  state's `forbid` or its enabled set: they run on runtime authority, exactly as for
1018
- tools, so a `before` hook can read a mount the model in that state cannot.
1033
+ tools, so a `before` hook can read a mount the model in that state cannot. A hook
1034
+ is still held to its **workflow's** grants, taken across every state:
1035
+
1036
+ - it reads a governed mount only if `allow_always` or some state's `allow` names
1037
+ it, else `mount.not-allowed`. The table serves every child too, so it can hold a
1038
+ mount only a child grants, and the caller's hooks cannot reach that;
1039
+ - it writes one only where a grant of the workflow asks `access: read_write`, and an
1040
+ `access: read` in `allow_always` narrows any mount for it (`mount.read-only`).
1041
+
1042
+ So when a hook needs a mount no state's model should see, grant it in a state the
1043
+ hook's workflow has anyway, or in `allow_always` with the model's states
1044
+ forbidding it.
1019
1045
 
1020
1046
  ## Session variables in guards
1021
1047
 
@@ -1083,7 +1109,8 @@ scalar.
1083
1109
  **Authoring rules that matter:**
1084
1110
 
1085
1111
  - **Lock anything a guard reads.** Host seeds are locked automatically (`title`
1086
- excepted, which is never locked); for an agent-established fact pass `lock: true`. An unlocked variable can be
1112
+ and a seed of a trigger's `returns` excepted, which land unlocked); for an
1113
+ agent-established fact pass `lock: true` — on a return, only once it is final. An unlocked variable can be
1087
1114
  overwritten by any later state — that rewrite is permitted, being one writer
1088
1115
  twice, and the later value simply wins — so a guard bound to an unlocked name is
1089
1116
  a weak guard. A lock is the only thing that makes a fact settled.
@@ -1358,7 +1385,7 @@ enrich:
1358
1385
  (`unresolved-param`) and **disabled-target** refusals are blocked calls —
1359
1386
  nothing ran, so correct the call and retry. A child whose returns are
1360
1387
  mistyped (`invalid-return`) is a failure: it ran. One that left returns unset
1361
- is not: the call answers with what it set and a `note`.
1388
+ is not: the call answers with them `null` and a `note`.
1362
1389
  - **A whole-argument reference keeps its type.** `{ quantity: "${{count}}" }`
1363
1390
  seeds the child with the number `count` holds, so it satisfies an `integer`
1364
1391
  parameter; `{ note: "order ${{order_id}}" }` is substituted as text.
@@ -1396,16 +1423,18 @@ enrich:
1396
1423
 
1397
1424
  A dispatch missing a `requires` name is **refused before the child is
1398
1425
  composed**; a child that completes without every `returns` name set
1399
- **completes anyway**, and the call answers with the returns it set plus a
1400
- `note` naming the rest — no second attempt is spent, and the caller decides
1426
+ **completes anyway**, and the call answers with every declared return, the
1427
+ unset ones `null`, plus a `note` naming them — no second attempt is spent, and
1428
+ the caller decides
1401
1429
  (a child that *parks* is not checked — it has not finished; a child that
1402
1430
  raises fails the call `raised`). A typed entry is held to its type at both
1403
1431
  ends: a mistyped argument is refused `invalid-param` before the child runs, and
1404
1432
  a mistyped return fails the call `invalid-return`. What the child must *do* to
1405
1433
  produce a variable belongs in the state `instructions` that set it. The names,
1406
1434
  with type and description where declared, are rendered into the child's prompt
1407
- under its entry state, so it is told what to produce before it can be failed
1408
- for omitting it.
1435
+ in every state, so it is told what to produce before it can be failed for
1436
+ omitting it — and to set each once its final value is known, locking one only
1437
+ when it is final.
1409
1438
  - **The call answers with the returns, by name.** A signed target answers
1410
1439
  `{ message, returns: { enrichment_file, delayed } }`; one declaring no
1411
1440
  `returns:` answers with the closing message alone. The message keeps its own
@@ -1416,7 +1445,7 @@ enrich:
1416
1445
  - **Mocks are held to the same contract.** An `archmax_workflow_<slug>` mock for a
1417
1446
  signed target supplies `returns:`. One that supplies a mistyped typed one
1418
1447
  (`invalid-return`) fails the mocked dispatch, and one that omits a declared
1419
- name answers like a real child that left it unset: what it supplied, plus a
1448
+ name answers like a real child that left it unset: that name `null`, plus a
1420
1449
  `note` — a mock stands in for the sub-run, never for its agreement.
1421
1450
  - **No prose crosses the boundary.** A sub-run gets no instruction from its
1422
1451
  caller — it works from its own state `instructions` (system prompt) plus the
@@ -1499,7 +1528,8 @@ triggers:
1499
1528
  repeated or parallel calls never overwrite each other or the caller's files. A
1500
1529
  return whose file is gone at completion fails the call `invalid-return`.
1501
1530
  - **No laundering.** A `file` value must name a file the session may read on
1502
- runtime authority, and a child inherits every ancestor's `forbid_always`. So a
1531
+ runtime authority (its own workflow's mount grants and `forbid_always`), and a
1532
+ child inherits every ancestor's `forbid_always`. So a
1503
1533
  child cannot hand back a file its caller's workflow denies: its agent's write
1504
1534
  is refused, and a script's write is rejected at completion.
1505
1535
  - **Instructions to write.** Tell the child to write the file *first* and then set
@@ -170,9 +170,9 @@ states:
170
170
  the agent back with the reason, bounded per hook by `max_iterations`
171
171
  (default 0 → a correct is a hard veto). A list runs in order and stops at
172
172
  the first non-ok. Errors and missing files veto (fail-closed). Hooks run
173
- on runtime authority: the state's `allow`/`forbid`/`skills` do not bind
174
- them; `forbid_always` and safety rules do. Human states may not declare
175
- hooks.
173
+ on runtime authority: the state's `allow`/`forbid`/`skills`/`mounts` do not
174
+ bind them; `forbid_always`, safety rules and the workflow's mount grants
175
+ (any state's) do. Human states may not declare hooks.
176
176
  - **Budgets and `on_error`.** `budget.maxTurns`/`timeoutMs`/`maxParks` bound
177
177
  a state's segment. A terminal failure (hook execution error, exhausted
178
178
  corrections, exhausted budget, exhausted parks) routes to `on_error`
@@ -188,8 +188,11 @@ states:
188
188
  mistyped argument is refused `invalid-param`, and `"${{count}}"` alone
189
189
  passes the value with its own type), its `returns` the result
190
190
  (`{ message, returns }`; a child finishing with some unset completes, and
191
- `returns` holds what it set plus a `note` naming the rest; a mistyped typed
192
- return fails `invalid-return`). Each failed call is the
191
+ `returns` holds every declared one, the unset ones `null`, plus a `note`
192
+ naming them; a mistyped typed return fails `invalid-return`). Returns are
193
+ owed only at the finish: no state needs them to be left, a later write
194
+ replaces an unlocked earlier one, and a seed of one lands unlocked; lock one
195
+ only once it is final. Each failed call is the
193
196
  calling state's failure, recorded with its arguments and routed through
194
197
  `on_error` when the agent finishes unless a later successful call of the
195
198
  same workflow from the same state recovers it first. One success recovers
@@ -276,5 +279,6 @@ Closed by default; **deny beats allow, and no narrower level widens a denial.**
276
279
  A state enabling no skill can run no script at all.
277
280
  - **Scripts' `tools.*` calls** are governed per call: an `archmax_run` script
278
281
  is bound like the model (grant every tool it calls); a hook is exempt from
279
- the state's lists. Neither may read `workflows/**` or write a mount. A
280
- refused call throws inside the script.
282
+ the state's lists but held to its workflow's mount grants. Neither may read
283
+ `workflows/**` or write a read-only mount. A refused call throws inside the
284
+ script.
@@ -1,3 +1,14 @@
1
+ export declare const ENGINES: {
2
+ yaml: (input: string) => object;
3
+ js: {
4
+ parse: () => never;
5
+ stringify: () => never;
6
+ };
7
+ javascript: {
8
+ parse: () => never;
9
+ stringify: () => never;
10
+ };
11
+ };
1
12
  export interface ParsedFrontmatter {
2
13
  /** Parsed YAML frontmatter block (whatever shape the caller expects). */
3
14
  data: unknown;
@@ -7,9 +7,33 @@ import { parse as parseYaml } from "yaml";
7
7
  * block over with CRLF line endings intact, and a trailing `\r` would otherwise
8
8
  * end up inside parsed string values, so normalize before parsing.
9
9
  */
10
- const YAML_ENGINE = {
11
- yaml: (input) => (parseYaml(input.replace(/\r(?=\n|$)/g, "")) ?? {}),
10
+ const yamlEngine = (input) => (parseYaml(input.replace(/\r(?=\n|$)/g, "")) ?? {});
11
+ /**
12
+ * gray-matter picks a parser from the language tag on the opening fence, so
13
+ * `---js` would hand the block to its bundled `javascript` engine, which runs
14
+ * the block through `eval` in the host process. We parse only YAML, so refuse
15
+ * any fence that names a language, and point the `js`/`javascript` engines at a
16
+ * thrower in case a tag ever reaches gray-matter.
17
+ */
18
+ const throwEngine = {
19
+ parse: () => {
20
+ throw new Error("frontmatter: only a plain `---` YAML fence is supported");
21
+ },
22
+ stringify: () => {
23
+ throw new Error("frontmatter: only a plain `---` YAML fence is supported");
24
+ },
12
25
  };
26
+ export const ENGINES = { yaml: yamlEngine, js: throwEngine, javascript: throwEngine };
27
+ /**
28
+ * Whether the opening `---` fence carries a language tag (e.g. `---js` or
29
+ * `--- javascript`). `matter.test` has already confirmed the input opens with
30
+ * `---`, so the tag is whatever follows on that first line.
31
+ */
32
+ function hasLanguageTag(raw) {
33
+ const newline = raw.search(/\r?\n/);
34
+ const firstLine = newline === -1 ? raw : raw.slice(0, newline);
35
+ return firstLine.replace(/^-+/, "").trim().length > 0;
36
+ }
13
37
  /**
14
38
  * Parse a `---`-delimited YAML frontmatter block followed by a Markdown body,
15
39
  * the convention shared by `SUBAGENT.md` and `WORKFLOW.md`. Returns `null` when
@@ -21,8 +45,10 @@ const YAML_ENGINE = {
21
45
  export function parseFrontmatter(raw) {
22
46
  if (!matter.test(raw))
23
47
  return null;
48
+ if (hasLanguageTag(raw))
49
+ return null;
24
50
  try {
25
- const parsed = matter(raw, { engines: YAML_ENGINE });
51
+ const parsed = matter(raw, { engines: ENGINES, language: "yaml" });
26
52
  return { data: parsed.data, body: parsed.content };
27
53
  }
28
54
  catch {
@@ -1 +1 @@
1
- {"version":3,"file":"frontmatter.js","sourceRoot":"","sources":["../../src/core/frontmatter.ts"],"names":[],"m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I,KAAK,CAAC,yDAAyD,CAAC,CAAC;IAC7E,CAAC;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW,EAAE,CAAC;AAEtF;;;;GAIG;AACH,SAAS,cAAc,CAAC,GAAW;IACjC,MAAM,OAAO,GAAG,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACpC,MAAM,SAAS,GAAG,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;IAC/D,OAAO,SAAS,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;AACxD,CAAC;AASD;;;;;;;GAOG;AACH,MAAM,UAAU,gBAAgB,CAAC,GAAW;IAC1C,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC;QAAE,OAAO,IAAI,CAAC;IACnC,IAAI,cAAc,CAAC,GAAG,CAAC;QAAE,OAAO,IAAI,CAAC;IAErC,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;QACnE,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC;IACrD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
@@ -54,8 +54,10 @@ export interface HookFact extends LifecycleDecision {
54
54
  * Who initiated a tool call. `agent` (the default) is a call the model made
55
55
  * directly; `script` is a programmatic call from a sandbox script, governed
56
56
  * identically to an agent call in the same state; `lifecycle` is a programmatic
57
- * call from a lifecycle hook, which runs on harness authority and skips the
58
- * per-state allow list and nothing else.
57
+ * call from a lifecycle hook (and the runtime's own `file` value check), which
58
+ * runs on runtime authority: outside the active state's surface — its allow and
59
+ * forbid lists, its skill and mount grants — but held to its workflow's mount
60
+ * grants, its workflow-wide denials and every safety rule.
59
61
  */
60
62
  export type ToolCallOrigin = "agent" | "script" | "lifecycle";
61
63
  export type ProposedAction = {
@@ -143,8 +145,8 @@ export declare function reduceHookFact(fact: HookFact, opts: {
143
145
  * a rule — any path under one of those mounts is refused, whatever the child
144
146
  * granted itself, and the refusal names the workflow that denied it.
145
147
  *
146
- * A workflow-wide denial binds a hook and a rubric grader too, so this rule —
147
- * unlike {@link mountRule} — does not exempt the `lifecycle` origin.
148
+ * A workflow-wide denial binds a hook and a rubric grader too, so this rule
149
+ * binds the `lifecycle` origin as well.
148
150
  */
149
151
  export declare function compileForbiddenMountRules(names: readonly string[], source: string): GovernanceRule[];
150
152
  /**
@@ -152,8 +154,9 @@ export declare function compileForbiddenMountRules(names: readonly string[], sou
152
154
  * `tools.forbid_always`, `skills.forbid_always` and `mounts.forbid_always`,
153
155
  * named with the workflow that declared them. A per-state `forbid` is not
154
156
  * inherited — it governs that state's turns, not a child session — and neither
155
- * is any grant. Compiled as rules, they bind the `lifecycle` origin too, which
156
- * is how the runtime's own reads on a session's behalf are held to them.
157
+ * is any grant. Compiled as rules, they bind the `lifecycle` origin too, so a
158
+ * descendant's hooks and the runtime's reads on a child's behalf are held to
159
+ * them. A workflow's own lists bind its own hooks through the kernel's rules.
157
160
  */
158
161
  export declare function workflowDenials(machine: WorkflowMachine, source: string): GovernanceRule[];
159
162
  /**
@@ -259,22 +259,42 @@ const runtimeManagedRule = (action, api) => {
259
259
  * Non-overridable: evaluated with the safety rules, ahead of `policy`, consumer
260
260
  * rules, and the per-state `allow` default, so no declaration can reach into a
261
261
  * capability the state was not given; a `tools.allow` entry may only narrow
262
- * *within* the enabled set. `lifecycle` origin is exempt (harness authority, as
263
- * for the state allow list); `script` origin is not (model authority).
262
+ * *within* the enabled set. `script` origin is bound (model authority); a
263
+ * `lifecycle`-origin call runs on runtime authority, outside the enabled set,
264
+ * and is held only to its workflow's own `skills.forbid_always`
265
+ * ({@link runtimeSkillVerdict}).
264
266
  */
265
267
  const skillRule = (action, api) => {
266
- if (action.kind !== "tool-call" || action.origin === "lifecycle")
268
+ if (action.kind !== "tool-call")
267
269
  return null;
268
270
  const skills = api.skills ?? NO_SKILLS;
269
271
  if (skills.length === 0)
270
272
  return null;
273
+ const verdictOf = action.origin === "lifecycle" ? runtimeSkillVerdict : skillVerdict;
271
274
  for (const path of pathsOf(action, api)) {
272
- const verdict = skillVerdict(action, path, api, skills);
275
+ const verdict = verdictOf(action, path, api, skills);
273
276
  if (verdict)
274
277
  return verdict;
275
278
  }
276
279
  return null;
277
280
  };
281
+ /**
282
+ * {@link skillRule} for one path of a call on runtime authority: a hook reads any
283
+ * bundle whatever the enabled set, except one its workflow's `skills.forbid_always`
284
+ * denies. A state's `skills.forbid` does not bind it.
285
+ */
286
+ function runtimeSkillVerdict(action, path, api, skills) {
287
+ const slug = skillOfPath(path.path, skills);
288
+ if (slug == null || !api.machine.workflowForbiddenSkills().includes(slug))
289
+ return null;
290
+ return {
291
+ decision: "block",
292
+ ruleId: "skill.forbidden",
293
+ reason: `[workflow] BLOCKED: ${subject(action, path, api)} belongs to the skill '${slug}', which ` +
294
+ `'skills.forbid_always' denies in every state. A denial beats every grant.`,
295
+ warn: true,
296
+ };
297
+ }
278
298
  /** {@link skillRule} for one of a call's paths. */
279
299
  function skillVerdict(action, path, api, skills) {
280
300
  const { state } = action;
@@ -332,21 +352,66 @@ function skillVerdict(action, path, api, skills) {
332
352
  *
333
353
  * Evaluated after the zone rules, so a *write* into a hidden read-only mount is
334
354
  * refused as read-only — the more useful reason — whether or not the state has
335
- * the mount. Non-overridable, and `lifecycle` origin is exempt: a hook and a
336
- * rubric grader run on runtime authority, bound by `mounts.forbid_always` (which
337
- * travels as an inherited rule, see {@link compileForbiddenMountRules}) and not
338
- * by the state's own surface.
355
+ * the mount. Non-overridable. A `lifecycle`-origin call runs on runtime
356
+ * authority, so it is decided on its **workflow**'s grants instead of the
357
+ * state's ({@link runtimeMountVerdict}): outside the state's surface, never
358
+ * outside the workflow's.
339
359
  */
340
360
  const mountRule = (action, api) => {
341
- if (action.kind !== "tool-call" || action.origin === "lifecycle")
361
+ if (action.kind !== "tool-call")
342
362
  return null;
363
+ const verdictOf = action.origin === "lifecycle" ? runtimeMountVerdict : mountVerdict;
343
364
  for (const path of pathsOf(action, api)) {
344
- const verdict = mountVerdict(action, path, api);
365
+ const verdict = verdictOf(action, path, api);
345
366
  if (verdict)
346
367
  return verdict;
347
368
  }
348
369
  return null;
349
370
  };
371
+ /**
372
+ * {@link mountRule} for one path of a call on runtime authority. One table serves
373
+ * a session and every child it dispatches, so it holds mounts other workflows in
374
+ * the tree grant: a hook reaches a governed mount only where some grant of its
375
+ * own workflow names it, in any state, and writes it only where the workflow
376
+ * asks to. The workflow's own `mounts.forbid_always` binds it; a state's
377
+ * `mounts.allow`, `mounts.forbid` and `access: read` do not.
378
+ */
379
+ function runtimeMountVerdict(action, path, api) {
380
+ const mounts = api.mountPrefixes ?? NO_MOUNTS;
381
+ const on = subject(action, path, api);
382
+ const name = mountNameOf(normalizeZonePath(path.path), mounts);
383
+ if (name == null)
384
+ return null;
385
+ if (api.machine.workflowForbiddenMounts().includes(name)) {
386
+ return {
387
+ decision: "block",
388
+ ruleId: "mount.forbidden",
389
+ reason: `[workflow] BLOCKED: ${on} is under the mount '${name}', which ` +
390
+ `'mounts.forbid_always' denies in every state. A denial beats every grant.`,
391
+ warn: true,
392
+ };
393
+ }
394
+ if (mounts.governed.includes(name) && !api.machine.workflowGrantedMounts(mounts.governed).includes(name)) {
395
+ return {
396
+ decision: "block",
397
+ ruleId: "mount.not-allowed",
398
+ reason: `[workflow] BLOCKED: ${on} is under the mount '${name}', which no grant of this ` +
399
+ `workflow names. A hook reaches a governed mount only where its workflow grants it, ` +
400
+ `in 'mounts.allow_always' or a state's 'mounts.allow'.`,
401
+ warn: true,
402
+ };
403
+ }
404
+ if (!MUTATING_ACCESSES.has(path.access) || api.machine.workflowMountWritable(name, mounts))
405
+ return null;
406
+ return {
407
+ decision: "block",
408
+ ruleId: "mount.read-only",
409
+ reason: `[workflow] BLOCKED: ${on} targets the mount '${name}', which this workflow may read ` +
410
+ `but not write (no grant of it asks for 'access: read_write', or 'mounts.allow_always' ` +
411
+ `narrows it to 'access: read').`,
412
+ warn: true,
413
+ };
414
+ }
350
415
  /** {@link mountRule} for one of a call's paths. */
351
416
  function mountVerdict(action, path, api) {
352
417
  const mounts = api.mountPrefixes ?? NO_MOUNTS;
@@ -408,8 +473,8 @@ function mountVerdict(action, path, api) {
408
473
  * a rule — any path under one of those mounts is refused, whatever the child
409
474
  * granted itself, and the refusal names the workflow that denied it.
410
475
  *
411
- * A workflow-wide denial binds a hook and a rubric grader too, so this rule —
412
- * unlike {@link mountRule} — does not exempt the `lifecycle` origin.
476
+ * A workflow-wide denial binds a hook and a rubric grader too, so this rule
477
+ * binds the `lifecycle` origin as well.
413
478
  */
414
479
  export function compileForbiddenMountRules(names, source) {
415
480
  if (names.length === 0)
@@ -443,8 +508,9 @@ export function compileForbiddenMountRules(names, source) {
443
508
  * `tools.forbid_always`, `skills.forbid_always` and `mounts.forbid_always`,
444
509
  * named with the workflow that declared them. A per-state `forbid` is not
445
510
  * inherited — it governs that state's turns, not a child session — and neither
446
- * is any grant. Compiled as rules, they bind the `lifecycle` origin too, which
447
- * is how the runtime's own reads on a session's behalf are held to them.
511
+ * is any grant. Compiled as rules, they bind the `lifecycle` origin too, so a
512
+ * descendant's hooks and the runtime's reads on a child's behalf are held to
513
+ * them. A workflow's own lists bind its own hooks through the kernel's rules.
448
514
  */
449
515
  export function workflowDenials(machine, source) {
450
516
  return [