@sabaiway/agent-workflow-engine 1.5.0 → 1.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.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,36 @@ 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 `1.3.0`).
6
6
 
7
+ ## 1.7.0 — Harden the planning canon: process-fidelity + regression-free editing
8
+
9
+ A **feature** release. The methodology canon gains **seven invariants** that close recurring
10
+ process-fidelity slips and fold-induced churn — each pinned in its natural home and guarded by the engine
11
+ canon tests (+ the kit's extended cross-package `lens-mirror.test.mjs`):
12
+
13
+ - **`references/planning.md` §6 — *ExitPlanMode ≠ execute*.** A harness "approved — start coding" prompt
14
+ authorizes the PLAN only; "continue in-session" is a DELIBERATE transition into `plan-execution` after
15
+ the plan + cold-start prompt exist, never an implicit slide (disambiguates §6 vs the Definition of Done).
16
+ - **`references/planning.md` §9 — regression-free editing + the convergence bar.** *No code-mechanics in
17
+ the plan*, *test-as-spec* (fold a code-touching finding into a red→green test, not prose),
18
+ *characterize-first* (pin uncovered behavior before editing), *heavy review at the diff*, and a CLEAN
19
+ loop defined as **0 blockers + 0 majors from every named backend** (folding ≠ convergence).
20
+ - **`references/orchestration.md` §4/§5 — *recipe fidelity*.** Council runs every ready backend **every
21
+ round**; quietly dropping a ready backend is a forbidden silent downgrade (the converse of the
22
+ unavailable-backend degrade), and the §5 quota guard is explicitly not a licence to drop one.
23
+ - **`references/procedures.md`** — terse pointers weave all of the above into both activity steps.
24
+
25
+ The deployment-lineage head stays **`1.3.0`** (no `docs/ai` structural change, no migration); the npm
26
+ package version is a separate axis.
27
+
28
+ ## 1.6.0 — Loosen the agy Issue-001 caveat (grounded review is sound)
29
+
30
+ A **feature** release. `references/orchestration.md` §5 reframes the `agy` health advisory: the grounded
31
+ `agy-review` contract removes agy's stale-model / partial-diff **false positives**, so `agy` is a **sound**
32
+ second opinion now — no longer something to merely avoid. The real **service-stall** caveat (Issue-001) is
33
+ kept — it is a separate risk that grounding does not remove — as is the codex-before-agy tie-break for
34
+ large / latency-sensitive substantive reviews and the `--add-dir` escalation path. The deployment-lineage
35
+ head stays **`1.3.0`** (no `docs/ai` structural change).
36
+
7
37
  ## 1.5.0 — Right-altitude & code-grounded folds in the canon
8
38
 
9
39
  A **feature** release. The planning canon (`references/planning.md`, read **live** by the composition
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.5.0'
6
+ version: '1.7.0'
7
7
  ---
8
8
 
9
9
  # agent-workflow-engine
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.5.0",
6
+ "version": "1.7.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.5.0",
3
+ "version": "1.7.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",
@@ -22,8 +22,8 @@ Each backend declares what it can do in its `capability.json` `provides` / `role
22
22
  - **`codex-cli-bridge`** (`codex`) — `provides: ["execute", "review"]`. It can run a bounded
23
23
  execution sub-task (`codex-exec`, output: a diff) and give an advisory review (`codex-review`,
24
24
  modes `plan` / `code`).
25
- - **`antigravity-cli-bridge`** (`agy`) — `provides: ["review", "probe"]`. It can give an advisory
26
- review and answer a bounded probe (both via `agy-run`).
25
+ - **`antigravity-cli-bridge`** (`agy`) — `provides: ["review", "probe"]`. It gives an advisory,
26
+ grounded review via `agy-review` (modes `code` / `plan` / `diff`) and answers a bounded probe via `agy-run`.
27
27
 
28
28
  Both are **subscription** backends with a **finite quota** — spend deliberately.
29
29
 
@@ -69,18 +69,38 @@ always reported, never silently dropped:
69
69
  - **Delegated → Solo.** No backend provides `execute` and is `ready` → Solo, with the reason.
70
70
  - **Reviewed → Solo.** No backend provides `review` and is `ready` → Solo, with the reason.
71
71
 
72
+ **Recipe fidelity — the converse: every ready backend, every round.** Degradation is the *only*
73
+ licence to run fewer backends than the recipe names. When the resolved recipe is `council` and BOTH
74
+ reviewers are `ready`, EVERY review round runs BOTH — skipping a ready backend for quota, convenience,
75
+ or "the other one already shipped" is a **SILENT downgrade of Council → Reviewed, and is forbidden**.
76
+ The distinction is strict: an *unavailable* backend is a LOUD, stated degrade (the lattice above); a
77
+ *ready* backend you quietly drop is a fidelity breach, not a degrade. The same holds for any recipe
78
+ that names ≥2 backends. Folding a finding and re-reviewing (the convergence bar, [`planning.md`](planning.md)
79
+ §9) re-runs **every named backend each round** — convergence is reached only when one round comes back
80
+ clean from all of them.
81
+
72
82
  ## 5. Quota & health guard (advisory)
73
83
 
74
84
  Backends are **subscription** services with **finite** quota. The orchestrator should: prefer the
75
85
  cheapest model that fits the task; not reach for a top-tier model by reflex; and remember that
76
86
  **Council spends two backends' quota** for one decision.
77
87
 
88
+ This guides *which recipe to choose up front* and *which model to run within a backend* — it is
89
+ **never a licence to drop a ready backend mid-Council** (that is the §4 fidelity breach, not a quota
90
+ saving). Once `council` is the resolved recipe and both backends are `ready`, the two-backend cost is
91
+ already accepted: run both, every round, until a round comes back clean.
92
+
78
93
  A **standing health advisory** applies to `agy`: the Antigravity service can **stall on substantive
79
94
  prompts** (a long hang that returns nothing — an external service issue, not a setup problem;
80
95
  tracked as **Issue-001** in the kit's known issues). It is **invisible to file-presence detection**,
81
- so it is *not* a readiness signal — it is a static caveat attached whenever a recipe would use `agy`. While it lasts, **prefer `codex`** for substantive
82
- reviews (this is the Reviewed tie-break in §3). The recipe machinery **never runs a subscription
83
- CLI** to checkdetection stays read-only.
96
+ so it is *not* a readiness signal — only a standing caveat. The **grounded** `agy-review` contract
97
+ makes `agy` a **sound** second opinion it removes the stale-model / partial-diff **false positives**
98
+ that the old ungrounded, `--add-dir`-roaming reviews produced so `agy` is no longer something to
99
+ merely avoid. But the *service* stall is a **separate, real** risk that grounding does **not** remove,
100
+ so keep reviews **focused** (the inherited hard timeout is the guard) and **prefer `codex`** for large
101
+ or latency-sensitive substantive reviews and for the `--add-dir` escalation path (the deterministic
102
+ Reviewed tie-break in §3). The recipe machinery **never runs a subscription CLI** to check — detection
103
+ stays read-only.
84
104
 
85
105
  ## 6. The orchestrator always commits
86
106
 
@@ -78,6 +78,10 @@ The volume trigger above (files / LoC / tokens) is necessary but not sufficient.
78
78
  - **Continue** in the current session when ALL hold: (1) exploration was *targeted-deep* — you read the exact files to be created/modified/copied, so execution would just re-read them; (2) no new heavy exploration is needed to execute; (3) the context budget is healthy (far from the window limit / Lost-in-the-Middle).
79
79
  - When continuing, each Phase's Verification block is a natural checkpoint. If different Phases need different cold context, continue only through the warm Phases, then split.
80
80
 
81
+ ### ExitPlanMode authorizes the plan, not execution
82
+
83
+ A harness "approved — you can now start coding" prompt (e.g. Claude Code's **ExitPlanMode**) authorizes the **PLAN only** — this methodology overrides that generic prompt. A planning session is not done until the plan is landed in `docs/plans/` **and** the cold-start execution prompt is emitted (the plan-authoring Definition of Done). So **"Continue in-session" above is a DELIBERATE transition into `plan-execution`, taken *after* both of those exist** — never an implicit slide from plan-approval straight into editing tracked files. Plan-approval is not a licence to execute the plan in the same breath; the boundary holds whether you split or continue.
84
+
81
85
  ## 7. Plan-document structure
82
86
 
83
87
  ```
@@ -107,10 +111,20 @@ The volume trigger above (files / LoC / tokens) is necessary but not sufficient.
107
111
 
108
112
  ## 9. Right-altitude & code-grounded folds
109
113
 
110
- Two disciplines keep a plan converging instead of churning. They govern authoring, every review round, and execution.
114
+ These disciplines keep a plan converging instead of churning, and keep a fold or edit from shipping a new bug. They govern authoring, every review round, and execution. The honest premise: prose has no checker, so the only guarantee that a fold/edit ships no regression is a deterministic, non-vacuous, auto-run gate — hence test-as-spec + characterize-first below.
111
115
 
112
116
  **Right altitude.** A plan pins *intent + architecture + invariants + acceptance criteria* — the named tests that must stay green and the new tests that must pass. It does NOT spell out fine code-mechanics in prose: those are resolved in code at Execute (against the real files + the per-Step review + the gates), where prose cannot diverge from reality. Most "blockers" that resurface across review rounds are code-level details that never belonged in a prose plan.
113
117
 
118
+ **No code-mechanics in the plan.** A Step still carries its exact paths + commands (§7, §8); the ceiling is on *fold-bred* detail — a review fold must not push fine code-mechanics (`cd`, an env default, a flag) into prose, where they diverge from reality. A fold that needs a mechanic is the trigger to write the test (test-as-spec) instead.
119
+
114
120
  **Fold by code, not prose.** Before folding any code-touching finding into the plan, READ the cited `file:line`; the fold cites it. A fold grounded in prose alone drifts from the code and seeds the next bug.
115
121
 
122
+ **Test-as-spec.** Fold a code-touching review finding into a red→green TEST, not a prose paragraph — the gate is the only deterministic checker, and a paragraph cannot self-check. A bug may still be written, but the test catches a fold-/edit-induced regression before it ships.
123
+
124
+ **Characterize-first.** Before editing UNCOVERED code, first write a test pinning its current behavior (green), then edit — any unintended change goes red. Never edit what has no checker; first give it one. Keep edits atomic/reversible (one logical change = one gated commit), and prefer SUBTRACTIVE folds.
125
+
126
+ **Heavy review at the diff, not the plan.** 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. The plan is the wrong place for an exhaustive line-by-line review.
127
+
128
+ **Convergence bar.** A review loop is CLEAN only when one round returns **0 blockers + 0 majors** from EVERY named backend the recipe runs (nits / non-blocking + a ship verdict is the stop). FOLDING a finding is NOT convergence — re-review after folding. This §9 governs the ALTITUDE at which you reach clean (fix the major, or raise it to an explicit acceptance invariant Execute must meet) — it NEVER lowers the bar to "majors folded".
129
+
116
130
  **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.
@@ -53,8 +53,18 @@ Produce a self-contained, cold-readable plan, reviewed to the configured depth b
53
53
  4. **review {recipe}** — review the draft at the depth the resolved `review` recipe selects: Solo
54
54
  (self-review only), Reviewed (one backend reviews), or Council (both backends review, you
55
55
  synthesize). The kit resolves the effective recipe from `docs/ai/orchestration.json` + readiness.
56
- 5. **Fold + loop** — fold every finding back into the draft and re-review until the review is clean.
57
- 6. **Present for approval** surface the finished plan to the user; do not begin execution here.
56
+ 5. **Fold + loop** — fold every finding back into the draft and re-review. A loop is CLEAN only at
57
+ **0 blockers + 0 majors** from every backend the recipe names (the convergence bar,
58
+ [`planning.md`](planning.md) §9); folding ≠ convergence — re-review after folding. Fold a
59
+ code-touching finding **test-as-spec** (a named acceptance test, not a prose paragraph); a fold must
60
+ add **no code-mechanics** to the plan — a Step still carries its own exact paths + commands, but a
61
+ fold needing a mechanic is the trigger to name the test instead. Council runs every named backend
62
+ **every round** (recipe fidelity,
63
+ [`orchestration.md`](orchestration.md) §4) — never quietly drop a ready backend.
64
+ 6. **Present for approval** — surface the finished plan to the user; do not begin execution here. A
65
+ harness "approved — start coding" prompt (**ExitPlanMode**) authorizes the PLAN only
66
+ ([`planning.md`](planning.md) §6); continuing into `plan-execution` is a deliberate transition taken
67
+ after the plan + its cold-start prompt exist, never an implicit slide.
58
68
 
59
69
  **Required output (Definition of Done):** a planning session produces a self-contained plan in
60
70
  `docs/plans/` **and** a cold-start execution prompt to begin the next session — **both produced without
@@ -78,9 +88,14 @@ Execute an approved plan Step by Step; each Step is one logical commit.
78
88
  following the project's reuse + clean-code rules.
79
89
  4. **Self-review** — run the [`planning.md`](planning.md) §8 self-review on the change, applying the
80
90
  [`planning.md`](planning.md) §9 lens — fold by code (read and cite the `file:line`), and hold the
81
- right altitude.
91
+ right altitude. Edit-time corollary: **characterize-first** — before editing uncovered code, pin its
92
+ current behavior in a green test, then edit (any unintended change goes red); fold each finding
93
+ **test-as-spec** (red→green), and keep edits atomic/reversible.
82
94
  5. **review {recipe}** — review the result at the resolved `review` depth (Solo / Reviewed / Council),
83
- exactly as in plan-authoring.
95
+ exactly as in plan-authoring. This is the **heavy review at the diff** — real compiling code + the
96
+ full suite, where a regression fails a gate immediately ([`planning.md`](planning.md) §9). Council
97
+ runs every named backend **every round** (recipe fidelity, [`orchestration.md`](orchestration.md) §4);
98
+ loop to **0 blockers + 0 majors** from every backend before the gate.
84
99
  6. **Gates** — run the project's verification gate (tests + checks) to green before committing.
85
100
  7. **Commit boundary** — the orchestrator makes the single commit for the Step; a backend never
86
101
  commits. The project's commit-approval policy (e.g. ask first) lives in the project's own rules.