@sabaiway/agent-workflow-engine 1.14.1 → 1.16.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/CHANGELOG.md CHANGED
@@ -4,6 +4,40 @@ All notable changes to the methodology engine. Versions are this **package's** n
4
4
  they are distinct from the **deployment-lineage** stamp written into a project's `docs/ai/`
5
5
  (which tracks the shared `agent-workflow` lineage, head `2.0.0`).
6
6
 
7
+ ## 1.16.0 — Prompt-economy canon: the cost lanes learn autonomy-preserving dispatch (REC-UX-REWORK D7, AD-053)
8
+
9
+ A **feature** release (ships with kit 1.46.0 / memory 2.2.0). The cost-lanes canon
10
+ (`references/orchestration.md` §5) gains the **prompt-economy clause**: (a) read-only fan-out
11
+ (research / sweeps / extraction) runs ONLY on restricted-tool vehicles — a full-tool subagent for
12
+ read-only work is a forbidden lane downgrade (an invisible prompt-flood plus blast radius, not just
13
+ tokens), and a subagent is never instructed to shell out for facts obtainable read-only; (b) the
14
+ orchestrator's own shell form is ONE plain pipeline per call (a `;`/`&&` chain or env-prefixed
15
+ invocation never matches a prefix allow rule); (c) a fan-out LAUNCHER that gates per call yields to
16
+ the agent-spawn lane — **capability-gated**: without restricted-tool vehicles (a host offering only
17
+ full-tool agents included), read-only research stays in the orchestrator's own context, never a
18
+ vehicle mandate a host cannot satisfy.
19
+ The quality/speed guard rides in canon (the clause narrows TOOLS for read-only work only —
20
+ judgment, code, synthesis stay at the frontier lane) with the honest limit stated (no deterministic
21
+ gate classifies a dispatch — enforcement is canon at the point of use + placed vehicles + the retro
22
+ loop). The `agent-rules-lens.md` cost-lanes line carries the same clause (the outgoing body is
23
+ appended to the append-only prior store, so unmodified in-the-wild deployments converge on first
24
+ touch); one distinctive token per invariant is drift-guarded on all three surfaces (canon · the kit
25
+ advisor render · the lens).
26
+
27
+ ## 1.15.0 — Canon autonomy prose + the sandbox cost-lane (AD-044 Plan 4)
28
+
29
+ A **feature** release (ships with kit 1.45.0 / memory 2.1.0). This publish delivers the Plan-3
30
+ `autonomy-slot.md` fragment to the install base — the third AGENTS.md `workflow:autonomy` slot
31
+ finally fills everywhere, so the kit's `ENGINE_FRAGMENT_CAVEATS` soft-skip residual retires on
32
+ refresh. Canon additions, appended without renumbering: orchestration.md trailing **§7
33
+ Checkpoint-bounded autonomy** (sandbox-as-floor, red-lines always-ask, informational for delegated
34
+ backends — enforcement stays the OS sandbox + the orchestrator); planning.md trailing **§10**
35
+ (autonomy at plan/execution checkpoints); procedures.md gains the read-at-start clause beside its
36
+ preamble. orchestration.md §5 gains the sandbox cost-lane token (sandbox-safe L0 surfaces ·
37
+ genuinely-unsandboxed bridge wrappers · command-shape-dependent npm-cache commands; move only the
38
+ failing command out of the sandbox, batch consecutive unsandboxed calls) — parity-pinned on both
39
+ the engine and kit sides.
40
+
7
41
  ## 1.14.1 — npm 12 tarball-guard compat + the lineage-head preamble correction
8
42
 
9
43
  A **patch** release (no canon content change; co-released with memory 2.0.0 + kit 1.42.0 — the
package/README.md CHANGED
@@ -51,6 +51,10 @@ the canonical methodology reference on disk:
51
51
  - [`references/orchestration-slot.md`](references/orchestration-slot.md) — the **bounded** one-line
52
52
  orchestration fragment the composition root injects into a deployed `AGENTS.md`, routing to the
53
53
  in-project recipes surface.
54
+ - [`references/autonomy-slot.md`](references/autonomy-slot.md) — the **bounded** one-line autonomy
55
+ fragment the composition root injects into a deployed `AGENTS.md`: the cross-agent read contract
56
+ for `docs/ai/autonomy.json` (read at session start; the canonical default floor when absent; STOP
57
+ on malformed), routing to the in-project `set-autonomy` / `autonomy-doctor` surfaces.
54
58
  - [`references/procedures.md`](references/procedures.md) — the canonical **activity-procedures** canon:
55
59
  the named activities (`plan-authoring`, `plan-execution`) as ordered steps with typed recipe slots,
56
60
  read live and rendered by the read-only `/agent-workflow-kit procedures <activity>`.
package/SKILL.md CHANGED
@@ -3,7 +3,7 @@ name: agent-workflow-engine
3
3
  description: Canonical home of the agent-workflow planning methodology — the Plan→Phase→Step→Substep vocabulary, plan lifecycle, queue.md series index, mandatory Cleanup phase, the bounded methodology slot fragment, the orchestration-recipe vocabulary (Solo / Reviewed / Council / Delegated), and the activity-procedures canon (plan-authoring / plan-execution, with typed recipe slots). A published, installable npm package (available:true) that *provides* the methodology text; it mutates nothing. The composition root (agent-workflow-kit) reads this canon LIVE from the installed engine and injects the bounded slots from it — one source of truth, no bundled mirror; `npx @sabaiway/agent-workflow-kit@latest init` installs the engine.
4
4
  disable-model-invocation: true
5
5
  metadata:
6
- version: '1.14.1'
6
+ version: '1.16.0'
7
7
  ---
8
8
 
9
9
  # agent-workflow-engine
@@ -34,6 +34,14 @@ slot fill is needed but the engine is absent, the kit's reconcile **fails loudly
34
34
  orchestration fragment the composition root injects into a deployed `AGENTS.md`, between the
35
35
  `<!-- workflow:orchestration:start -->` / `<!-- workflow:orchestration:end -->` markers. It names the
36
36
  four recipes and routes to `/agent-workflow-kit recipes`, never to this engine-internal reference.
37
+ - [`references/autonomy-slot.md`](references/autonomy-slot.md) — the **bounded** one-line autonomy
38
+ fragment the composition root injects into a deployed `AGENTS.md`, between the
39
+ `<!-- workflow:autonomy:start -->` / `<!-- workflow:autonomy:end -->` markers. It carries the
40
+ cross-agent READ CONTRACT for the per-project autonomy policy (`docs/ai/autonomy.json`): read at
41
+ session start, the canonical default floor when the file is absent, STOP on malformed — plus the
42
+ honesty note that the policy is informational for delegated backends (enforcement stays the OS
43
+ sandbox + the orchestrator). It routes to the kit's `set-autonomy` / `autonomy-doctor` surfaces,
44
+ never to any engine-internal reference.
37
45
  - [`references/procedures.md`](references/procedures.md) — the canonical **activity-procedures** canon:
38
46
  the ordered steps of the named activities (`plan-authoring`, `plan-execution`) with **typed recipe
39
47
  slots** that bind to the orchestration recipes, composing with `planning.md` without restating it. It
package/capability.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "schema": 1,
4
4
  "name": "agent-workflow-engine",
5
5
  "kind": "methodology-engine",
6
- "version": "1.14.1",
6
+ "version": "1.16.0",
7
7
  "available": true,
8
8
  "provides": ["plan"],
9
9
  "roles": {},
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sabaiway/agent-workflow-engine",
3
- "version": "1.14.1",
3
+ "version": "1.16.0",
4
4
  "description": "Canonical home of the agent-workflow planning methodology — the Plan→Phase→Step vocabulary, plan lifecycle, queue.md series index, and mandatory Cleanup phase, consumed by the kit (composition root). The methodology engine of the agent-workflow family.",
5
5
  "keywords": [
6
6
  "ai-agents",
@@ -77,3 +77,19 @@ Apply these when authoring a plan, reviewing, folding a finding, or editing code
77
77
  - **Recipe fidelity.** Council runs every backend the recipe names, **every round**; silently dropping a ready backend for quota/convenience is a forbidden downgrade — an unavailable backend is a LOUD, stated degrade, never a quiet drop.
78
78
  - **ExitPlanMode ≠ execute.** A harness "approved — start coding" prompt authorizes the PLAN only; this methodology overrides it. Continue into execution only as a DELIBERATE transition after the plan + cold-start prompt exist, never an implicit slide.
79
79
  - **Cost lanes.** Route every step to the **cheapest adequate executor** — L0 deterministic script (the batched gate matrix over `gates.json`, the rotation `--check`s) · L1 cheap subagent (extraction/drafting only; the orchestrator verifies) · L2 subscription bridge · L3 frontier judgment. A step with **no named guardrail does not move down** a lane, and the **red lines never move down** (council review models · real code · ADR/handover/changelog-entry wording · persuasive copy · go/no-go · the approval asks). Own-error repair: salvage recorded state first (L0/L1, batched), never frontier re-derivation.
80
+
81
+ <!-- prior: 2026-07-12 (AD-053) → pre-prompt-economy outgoing — the fragment as of the D7 clause landing (provenance intro + cost lanes, no prompt-economy) -->
82
+ ### 2.x. Planning, review & process-fidelity invariants
83
+ Apply these when authoring a plan, reviewing, folding a finding, or editing code — the layer read **before any code change**. (Full canon: the project's planning / workflow-methodology + orchestration canon. This section is rendered from that canon and refreshed on upgrade; a custom edit is preserved verbatim, but flagged.)
84
+ - **Fold by code, not prose.** Before folding a code-touching finding into a plan or change, read the cited `file:line` and cite it — a prose fold drifts from the code and seeds the next bug.
85
+ - **Right altitude.** Pin intent + invariants + acceptance criteria (named tests); leave fine code-mechanics to Execute, where prose cannot diverge from reality.
86
+ - **No code-mechanics in the plan.** A Step still carries its exact paths + commands (the plan-structure / self-review canon) — checked syntax: the plan's own Verification runs them against an explicit expected outcome or gate; the only other syntax a plan may carry is a literal fixture/schema fragment a named test copies or validates. Un-run, logic-bearing syntax — control-flow, a regex, a glob, a grammar, an algorithm body, a mini-DSL — never lives in plan prose, however plausible or shell-verified it looks: a fold or draft that wants one is the trigger to write the test instead.
87
+ - **Test-as-spec.** Fold a code-touching finding into a red→green TEST, not a prose paragraph — the gate is the only deterministic checker; a paragraph cannot self-check.
88
+ - **Characterize-first.** Before editing UNCOVERED code, pin its current behavior in a green test, then edit — any unintended change goes red. Never edit what has no checker; first give it one. Keep edits atomic/reversible; prefer SUBTRACTIVE folds.
89
+ - **Fold minimally — prose has no checker.** An ephemeral, gitignored plan is prose with no executable checker; fold **minimally, in ONE place** and run a **self-consistency** read across the plan before every re-review — a fold that drifts several prose spots is what turns a 2-round review into churn.
90
+ - **Heavy review at the diff.** Plan-review settles architecture only (≤2 rounds, stop at the pre-existing→fold-induced crossover); the exhaustive per-Step review runs against real compiling code + the full suite, where a regression fails a gate immediately. **Backend divergence** (one backend grounded-ships while another keeps revising mechanics) IS that crossover — resolve at altitude, don't exhaust the strictest backend; route an all-mechanics/CI or prose-only artifact to a **thin plan + diff-review**.
91
+ - **Convergence bar.** A review loop is CLEAN only when one round returns **0 blockers + 0 majors** from EVERY backend the recipe names (nits + a ship verdict is the stop). Folding ≠ convergence — re-review after folding.
92
+ - **Per-round emission.** Every review round emits **{round N · finding-origin tally · per-backend verdict}** so the crossover is a computed, visible signal, not a remembered rule.
93
+ - **Recipe fidelity.** Council runs every backend the recipe names, **every round**; silently dropping a ready backend for quota/convenience is a forbidden downgrade — an unavailable backend is a LOUD, stated degrade, never a quiet drop.
94
+ - **ExitPlanMode ≠ execute.** A harness "approved — start coding" prompt authorizes the PLAN only; this methodology overrides it. Continue into execution only as a DELIBERATE transition after the plan + cold-start prompt exist, never an implicit slide.
95
+ - **Cost lanes.** Route every step to the **cheapest adequate executor** — L0 deterministic script (the batched gate matrix over `gates.json`, the rotation `--check`s) · L1 cheap subagent (extraction/drafting only; the orchestrator verifies) · L2 subscription bridge · L3 frontier judgment. A step with **no named guardrail does not move down** a lane, and the **red lines never move down** (council review models · real code · ADR/handover/changelog-entry wording · persuasive copy · go/no-go · the approval asks). Own-error repair: salvage recorded state first (L0/L1, batched), never frontier re-derivation.
@@ -11,4 +11,4 @@ Apply these when authoring a plan, reviewing, folding a finding, or editing code
11
11
  - **Per-round emission.** Every review round emits **{round N · finding-origin tally · per-backend verdict}** so the crossover is a computed, visible signal, not a remembered rule.
12
12
  - **Recipe fidelity.** Council runs every backend the recipe names, **every round**; silently dropping a ready backend for quota/convenience is a forbidden downgrade — an unavailable backend is a LOUD, stated degrade, never a quiet drop.
13
13
  - **ExitPlanMode ≠ execute.** A harness "approved — start coding" prompt authorizes the PLAN only; this methodology overrides it. Continue into execution only as a DELIBERATE transition after the plan + cold-start prompt exist, never an implicit slide.
14
- - **Cost lanes.** Route every step to the **cheapest adequate executor** — L0 deterministic script (the batched gate matrix over `gates.json`, the rotation `--check`s) · L1 cheap subagent (extraction/drafting only; the orchestrator verifies) · L2 subscription bridge · L3 frontier judgment. A step with **no named guardrail does not move down** a lane, and the **red lines never move down** (council review models · real code · ADR/handover/changelog-entry wording · persuasive copy · go/no-go · the approval asks). Own-error repair: salvage recorded state first (L0/L1, batched), never frontier re-derivation.
14
+ - **Cost lanes.** Route every step to the **cheapest adequate executor** — L0 deterministic script (the batched gate matrix over `gates.json`, the rotation `--check`s) · L1 cheap subagent (extraction/drafting only; the orchestrator verifies) · L2 subscription bridge · L3 frontier judgment. A step with **no named guardrail does not move down** a lane, and the **red lines never move down** (council review models · real code · ADR/handover/changelog-entry wording · persuasive copy · go/no-go · the approval asks). Own-error repair: salvage recorded state first (L0/L1, batched), never frontier re-derivation. **Prompt economy:** read-only fan-out (research/sweeps/extraction) runs ONLY on restricted-tool vehicles — a full-tool subagent for read-only work is a forbidden lane downgrade (invisible prompt-flood + blast radius), and a subagent is never told to shell out for facts obtainable read-only; the orchestrator's own shell form is ONE plain pipeline per call (a `;`/`&&` chain or env-prefixed invocation never matches a prefix allow rule); a fan-out launcher that gates per call yields to the agent-spawn lane — capability-gated: without restricted-tool vehicles (generic full-tool spawning does not count), read-only research stays in the orchestrator's own context, never a vehicle mandate a host cannot satisfy. Judgment, code, synthesis stay at the frontier lane (a task that genuinely runs/writes keeps a full-tool subagent); honest limit: no deterministic gate classifies a dispatch — canon at the point of use + placed vehicles + the retro loop.
@@ -0,0 +1 @@
1
+ > **Autonomy policy** — checkpoint-bounded autonomy, declared per project in `docs/ai/autonomy.json` (red-lines + a per-activity level: `sandbox` or `prompt`). Read it at session start. File absent → the computed defaults ARE the policy: commit/push/publish `ask`; network/credentials/fs-outside-repo `deny`; an absent activity floors at `prompt`. Malformed → STOP loudly, never guess. Set it with `/agent-workflow-kit set-autonomy` (previews first; hand-edit stays supported); provision the OS sandbox with `/agent-workflow-kit autonomy-doctor` (consent-gated). For delegated backends this policy is informational — enforcement stays the OS sandbox + the orchestrator process.
@@ -131,6 +131,32 @@ approval asks (commit / push / publish — cost tiering never touches approval g
131
131
  **Asymmetric pairing** is the default composition: the cheap lane drafts, a deterministic tool or
132
132
  the frontier verifies and signs — never the reverse.
133
133
 
134
+ **Prompt economy (autonomy-preserving dispatch).** Under a zero-prompt autonomy bar the lanes also
135
+ bound the TOOLS a dispatch may carry: **(a)** read-only fan-out — research, sweeps, extraction —
136
+ runs ONLY on **restricted-tool vehicles** (read-only tools, no shell); handing a full-tool
137
+ subagent to read-only work is a **forbidden lane downgrade** — an invisible prompt-flood plus
138
+ blast radius, not just tokens — and a subagent is never instructed to run a shell command for
139
+ facts obtainable read-only. **(b)** The orchestrator's own shell form: ONE plain pipeline per call
140
+ — a `;`/`&&` chain or an env-prefixed invocation never matches a prefix allow rule, so each such
141
+ call is a prompt. **(c)** A fan-out LAUNCHER tool may itself gate per call — under a
142
+ zero-prompt bar prefer the agent-spawn lane with placed vehicles. This clause is
143
+ **capability-gated** (route by what the host HAS): on a harness with restricted-tool subagent
144
+ vehicles, use them; WITHOUT restricted-tool vehicles — whether or not generic full-tool spawning
145
+ exists — read-only research stays in the orchestrator's own context —
146
+ never a vehicle mandate a host cannot satisfy. The clause narrows
147
+ TOOLS for read-only work only — judgment, code, and synthesis stay at the frontier lane, and a
148
+ task that genuinely needs to run or write keeps a full-tool subagent. **Honest limit:**
149
+ no deterministic gate classifies a dispatch — enforcement is this canon at the point of use,
150
+ the placed vehicles, and the retro loop.
151
+
152
+ **Sandbox lanes.** Under an OS sandbox the lanes split once more by **surface class**: the L0
153
+ surfaces are **sandbox-safe** (gate/ledger/state/fold checks, git reads, plain no-network tests);
154
+ the bridge wrappers are **genuinely unsandboxed** (they need network); npm-cache-touching commands
155
+ are **COMMAND-SHAPE dependent** — first try the sandbox-safe shape (cache under `$TMPDIR`,
156
+ offline/notifier off) before moving anything out. Two driving rules: **move ONLY the failing
157
+ command out of the sandbox, never its class**, and **BATCH consecutive unsandboxed calls** — a
158
+ blanket unsandbox after one failure is the canonical over-reaction.
159
+
134
160
  **Incident repair (your own error) defaults down-lane:** salvage recorded state first (journals,
135
161
  transcripts, git), replay it deterministically (L0), hand the leftovers to L1 in one batch —
136
162
  frontier re-derivation of recoverable state is the expensive failure mode, and the maintainer
@@ -156,3 +182,20 @@ default; it **never executes** a recipe and **never runs a subscription CLI**. T
156
182
  executes the chosen recipe through the bridge skills, accepts or rejects every edit, runs the
157
183
  verification gate, and makes the **one** commit — exactly as the plan lifecycle (`planning.md`)
158
184
  requires.
185
+
186
+ ## 7. Checkpoint-bounded autonomy (the policy every recipe runs under)
187
+
188
+ Autonomy is **checkpoint-bounded**: between human checkpoints the orchestrator runs as autonomously
189
+ as the project declares, and the checkpoints themselves never move. The policy is declared per
190
+ project in `docs/ai/autonomy.json` — **red-lines** (always in force: `commit`/`push`/`publish` ask;
191
+ `network`/`credentials`/`fs_outside_repo` deny) plus a **per-activity autonomy level**: `sandbox`
192
+ (the OS sandbox confines and auto-allows confined commands — work runs to the next checkpoint
193
+ without per-command prompts) or `prompt` (every non-allowlisted command prompts; the sandbox, where
194
+ enabled, still confines). **Read it at session start.** An **absent** file means the computed
195
+ defaults ARE the policy (every activity floors at `prompt`); a **malformed** file is a loud STOP —
196
+ never guess around it. The **sandbox is the floor, not the permission**: red-line commands keep
197
+ their asks at every level, and cost tiering (§5) never touches an approval gate. For **delegated
198
+ backends the policy is informational** — enforcement stays the OS sandbox plus the orchestrator
199
+ process (a backend never gains autonomy the orchestrator itself does not have). Declare and edit
200
+ the policy with `/agent-workflow-kit set-autonomy` (previews first; hand-editing stays supported);
201
+ render it into the harness settings with the kit's velocity `--autonomy` mode.
@@ -134,3 +134,18 @@ These disciplines keep a plan converging instead of churning, and keep a fold or
134
134
  **Convergence heuristic.** When a review round keeps finding code-mechanism issues on a stable architecture, STOP refining prose — either raise the spec to invariant + acceptance altitude, or hand the mechanics to Execute. Do not re-litigate code mechanics in the plan.
135
135
 
136
136
  **Computed instrument (plan-execution).** The **review-ledger** computes the crossover-stop for the plan-execution (code) loop: each round and each triage classification — **fixable-bug** (a fold pinned by a red→green test) / **inherent-layer-residual** (raised to an acceptance criterion) / **escalate** (a maintainer decision) — is recorded, and the stop decision is READ from the ledger, never remembered; its `--check` is the loop's gate (the exit contract lives in the tool's own header — point, don't restate). The same per-round tally + classification discipline governs plan-authoring review; the ledger itself is plan-execution-scoped.
137
+
138
+ ## 10. Autonomy at the plan checkpoints
139
+
140
+ The plan lifecycle's human checkpoints — plan **approval** (plan-authoring ends there), each
141
+ **gated commit** (plan-execution commits per Step), and any push/publish ask — are **fixed points
142
+ the autonomy policy never moves** (`orchestration.md` §7). What the per-activity level changes is
143
+ the texture *between* them: under `sandbox` autonomy the executor runs a whole working stretch —
144
+ edits, tests, gates, review dispatches — to the next checkpoint without per-command prompts (the
145
+ OS sandbox confines the blast radius); under `prompt` it asks along the way. **Read the policy at
146
+ session start** (`docs/ai/autonomy.json`; absent → the computed defaults ARE the policy; malformed
147
+ → STOP loudly) alongside the standing recipe preference, and state the effective level in the
148
+ session's opening summary so the human knows which texture to expect. A plan itself never needs to
149
+ restate the policy — it is per-project configuration, not plan content; a plan names an autonomy
150
+ requirement only when a Step genuinely departs from the declared level (e.g. a consent-gated
151
+ privileged install), and that departure is always an explicit ask, never a silent widening.
@@ -28,6 +28,11 @@ single project's stages.
28
28
  project's standing recipe preference in `docs/ai/orchestration.json` (set it in plain language with
29
29
  `/agent-workflow-kit set-recipe` — it previews then writes; hand-editing the file stays supported); the
30
30
  kit resolves it against backend readiness. Do not re-ask each session what is already configured there.
31
+ Read the **autonomy policy** the same way and at the same moment: `docs/ai/autonomy.json` declares the
32
+ red-lines and the per-activity autonomy level (absent → the computed defaults ARE the policy; malformed
33
+ → STOP loudly, never guess; set it with `/agent-workflow-kit set-autonomy`) — the per-activity
34
+ procedures below run UNDER that policy (`orchestration.md` §7), and the kit's `procedures` advisor
35
+ prints the resolved level beside each activity's recipes.
31
36
 
32
37
  **Communication contract.** Every user-facing message delivers the artifact **inline** — the plan, the
33
38
  next-session prompt, the diff, the value asked for — never a bare pointer ("see §X / open the file") as a