@sabaiway/agent-workflow-engine 4.3.0 → 4.4.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,22 @@ 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 `3.0.0`).
6
6
 
7
+ ## 4.4.0 — the plan cap counts rows, the readers sweep opens self-review, the consult order and the round render are canon (AD-125)
8
+
9
+ `references/planning.md`: the cap is 100 lines AND ≤25 ledger rows, 200 UTF-8 bytes per row counted
10
+ without the path and anchor fields (the 8000-byte cap is deleted); an extension phase rides only
11
+ before Cleanup; the two checker commands (`plan-shape-cli.mjs --check` before the first review,
12
+ `--verify` at Cleanup) are named at the point of use. `references/procedures.md`: `plan-authoring`
13
+ carries `Slots: author, fold, review`; step 3 opens with the readers sweep (one literal search per
14
+ changed key, symbol, receipt field or canon sentence — every reader becomes a row, a non-goal or a
15
+ pinned "unchanged"); step 5 of BOTH activities carries the consult-before-fold order (ASK the review
16
+ member that raised the finding, WAIT, READ, fold only as accepted or corrected; a self-review finding
17
+ folds directly); plan-authoring's step 5 additionally names the round render as the source of the
18
+ per-round emission's verdict half — the crossover stop is a computed signal, the origin tally the
19
+ orchestrator's judgment. The canon tests
20
+ pin every sentence (spec `plan-review-loop` S13, S18); the procedures-to-planning size pin is a 1.2
21
+ ratio, declared.
22
+
7
23
  ## 4.3.0 — the fifth recipe, the third activity, and a carrier that is never the one who commits (AD-124)
8
24
 
9
25
  `references/orchestration.md` admits the CARRIER wherever it said backend: the orchestrator, a bridge
package/SKILL.md CHANGED
@@ -3,7 +3,7 @@ name: agent-workflow-engine
3
3
  description: Canonical home of the agent-workflow planning methodology — the capped plan shape (goal and boundary, module ledger, verification), plan lifecycle, queue.md series index, mandatory Cleanup phase, the feature-spec canon (the durable per-feature contract layer with its frozen schema and Out-of-scope discipline), the bounded methodology slot fragment, the orchestration-recipe vocabulary (Solo / Reviewed / Council / Delegated / Subagent), and the activity-procedures canon (plan-authoring / plan-execution / routine, 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: '4.3.0'
6
+ version: '4.4.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": "4.3.0",
6
+ "version": "4.4.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": "4.3.0",
3
+ "version": "4.4.0",
4
4
  "description": "Canonical home of the agent-workflow planning methodology — the capped plan shape (goal and boundary, module ledger, verification), 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",
@@ -8,8 +8,9 @@ plan tells it which files to open, what each one may become, and how the result
8
8
 
9
9
  ## Shape
10
10
 
11
- The whole file is capped at **100 lines and 8000 bytes** both, because a line cap alone is paid off
12
- with longer lines. The headings are LITERAL, copied bare: tooling extracts sections by exact match.
11
+ The whole file is capped at **100 lines and at most 25 ledger rows**. Before its first review and
12
+ after every authoring fold, run `node <kit>/tools/plan-shape-cli.mjs --check <plan>`. The headings are
13
+ LITERAL, copied bare: tooling extracts sections by exact match.
13
14
 
14
15
  ```
15
16
  # Plan: <title>
@@ -20,6 +21,9 @@ with longer lines. The headings are LITERAL, copied bare: tooling extracts secti
20
21
  ## Next steps
21
22
  ```
22
23
 
24
+ A project-declared `## Phase: <name>` may ride between Verification and Cleanup; it is bounded by
25
+ the whole-file line cap and may not reuse the Cleanup name.
26
+
23
27
  A plan that does not fit is not under-described. Either the TASK is too big — split it along
24
28
  independently verifiable boundaries, never by document size — or it is a SWEEP (below).
25
29
 
@@ -34,7 +38,8 @@ independently verifiable boundaries, never by document size — or it is a SWEEP
34
38
 
35
39
  ## Module ledger
36
40
 
37
- One row per path, 200 bytes per row, six fields:
41
+ One row per path, six fields. A row is capped at **200 UTF-8 bytes counted without its path and
42
+ anchor**: id, verb, responsibility and budget after trimming, including their three ` | ` separators.
38
43
 
39
44
  ```
40
45
  <check-id> | create|modify|delete | <path> | <responsibility, one sentence> | <max lines | n/a> | <anchor>
@@ -71,9 +76,9 @@ the sweep, and breaks the intermediate states.
71
76
  ## Verification
72
77
 
73
78
  Exact existing commands plus the acceptance check for the goal. The ledger is validated by ONE
74
- command over its `check-id`s — existence and budget for create/modify, absence for delete, the count
75
- for a sweep, and the total line. Per-row assertions in prose are the repetition this section exists
76
- to avoid.
79
+ command: `node <kit>/tools/plan-shape-cli.mjs --verify <plan>` — existence and budget for
80
+ create/modify, absence for delete, the count for a sweep, and the total line. Per-row assertions in
81
+ prose are the repetition this section exists to avoid.
77
82
 
78
83
  **The acceptance criteria ARE the `- ` bullets.** Every top-level `- ` bullet in this section is one
79
84
  acceptance criterion, and they are the whole list — nothing outside a bullet is one. That makes the
@@ -6,7 +6,7 @@ The ordered steps of each named activity, with **typed recipe slots** bound to t
6
6
  live and parses only each section's `Slots:` line.
7
7
 
8
8
  A **recipe slot**: `review` accepts `solo | reviewed | council`; `execute` accepts
9
- `solo | delegated | subagent`; a carrier slot (`author`, `carrier`) accepts `solo | subagent`;
9
+ `solo | delegated | subagent`; a carrier slot (`author`, `fold`, `carrier`) accepts `solo | subagent`;
10
10
  `parallel` is a switch (`on | off`), not a recipe. The per-project default lives in
11
11
  `docs/ai/orchestration.json`.
12
12
 
@@ -30,7 +30,7 @@ inline plus the link.
30
30
 
31
31
  ## plan-authoring
32
32
 
33
- Slots: author, review
33
+ Slots: author, fold, review
34
34
 
35
35
  1. **Research** — the exact files, contracts and constraints touched.
36
36
  2. **Draft** — write to the shape [`planning.md`](planning.md) fixes; its *Module ledger* decides
@@ -41,21 +41,35 @@ Slots: author, review
41
41
  Subagent: the orchestrator writes a BRIEF (goal, governing specs, ledger
42
42
  constraints, files) and the subagent drafts the plan and any `create` / `modify`
43
43
  spec row from it, and the orchestrator reviews the draft as its own before step 3.
44
- 3. **Self-review** — apply *What gets cut*; fold by code (read and cite the `file:line`); update
45
- `queue.md` for a series, to the shape *The queue* fixes.
44
+ 3. **Self-review** — run the **readers sweep before the first review**: for every config key,
45
+ registry entry, exported constant, receipt field or canon sentence the plan changes, use one
46
+ literal repository search to list its readers (validators, renders, seeds, docs and the tests
47
+ that pin the text). Every reader becomes a ledger row, a stated non-goal, or unchanged with
48
+ the test or fixture that proves it. Then apply *What gets cut*; fold by code
49
+ (read and cite the `file:line`); update `queue.md` for a series, to the shape *The queue* fixes.
46
50
  4. **review {recipe}** — Solo (self-review only) / Reviewed (one backend) / Council (both; you
47
51
  synthesize), as the resolved `review` recipe selects.
48
- 5. **Fold + loop** — fold every finding and re-review; CLEAN is **0 blockers + 0 majors** from every
49
- backend the recipe names folding convergence. Fold a code-touching finding **test-as-spec**,
50
- with **no code-mechanics** in the plan: only **checked syntax** its Verification runs; un-run,
52
+ 5. **Fold + loop** — before folding a finding raised by a **review member**, **ASK** that member whether the
53
+ proposed fold solves it without a new problem; **WAIT**, **READ**, then hand the accepted or
54
+ corrected fold to the resolved `fold` carrier. Self-review findings, or findings with no review
55
+ member, are folded directly. Forms: `agy-review --continue --decided @f` for agy, a
56
+ fresh `codex-review plan <consult-brief>` for
57
+ codex, or a fresh re-dispatch of the same lens vehicle for a lens member; write the finding and
58
+ fold before the tree changes. Solo: orchestrator edits. Subagent: the round's findings with their
59
+ dispositions are the slice; it edits the plan or contract and returns; orchestrator runs the
60
+ self-consistency read.
61
+ Fold and re-review every finding; CLEAN is **0 blockers + 0 majors** from each named backend;
62
+ folding ≠ convergence. Fold code findings **test-as-spec**, with **no code-mechanics** in the
63
+ plan: only **checked syntax** its Verification runs; un-run,
51
64
  **logic-bearing** syntax never enters prose (*Un-run syntax never ships in prose*). Council runs
52
65
  every named backend **every round** (recipe fidelity, `orchestration.md` §4). Cap architecture
53
66
  review at **≤2 rounds**; **backend divergence** (one ships, one keeps revising mechanics) IS the
54
- **crossover** — resolve the surviving major at altitude, never by exhausting the strictest
55
- backend; a **self-consistency** read precedes each re-review; an all-mechanics or prose-only
56
- artifact takes a thin plan + **diff-review** (*The plan must read cold*). Each round MUST emit
57
- **{round N · finding-origin tally · per-backend verdict}**. At the cap, classify each surviving
58
- blocker or major: **fixable-bug** (fold ONCE as a red→green test, re-review) /
67
+ **crossover** — resolve the major at altitude, not by exhausting that backend.
68
+ A **self-consistency** read precedes each re-review; all-mechanics or prose-only takes a thin plan
69
+ + **diff-review** (*The plan must read cold*). Each round MUST emit
70
+ **{round N · finding-origin tally · per-backend verdict}**: READ its verdict half from the round
71
+ render (`review-rounds`, the kit's table over the review receipts); append the orchestrator's finding-origin tally
72
+ judgment. At the cap, classify surviving blockers/majors: **fixable-bug** (fold ONCE as a red→green test, re-review) /
59
73
  **inherent-layer-residual** (raise to an acceptance criterion) / **escalate**.
60
74
  6. **Present for approval** — never execute here: a harness "approved — start coding" prompt
61
75
  (**ExitPlanMode**) authorizes the PLAN only; `plan-execution` is a deliberate transition once
@@ -83,14 +97,24 @@ Each ledger row is one logical commit.
83
97
  Verification, under the project's reuse and clean-code rules; fold by code (cite the
84
98
  `file:line`); **characterize-first**: pin uncovered code's behaviour in a green test before
85
99
  editing it; fold each finding test-as-spec (red→green); atomic, reversible edits.
86
- 5. **review {recipe}** — the **heavy review at the diff** (*The plan must read cold*): real code and
87
- the full suite. The plan-authoring loop applies unchanged every named backend every round,
88
- **0 blockers + 0 majors**, the **{round N · finding-origin tally · per-backend verdict}**
89
- emission, **fixable-bug / inherent-layer-residual / escalate** at the cap. Its instruments:
100
+ 5. **review {recipe}** — the **heavy review at the diff** (*The plan must read cold*): real code +
101
+ full suite. Authoring loop applies unchanged: every named backend every round; a finding raised
102
+ by a **review member**: **ASK**, **WAIT**, **READ**, fold only as accepted or corrected; a
103
+ self-review finding is folded directly (forms: its step 5). CLEAN:
104
+ **0 blockers + 0 majors**; the **{round N · finding-origin tally · per-backend verdict}**
105
+ emission; **fixable-bug / inherent-layer-residual / escalate** at the cap. Its instruments:
90
106
  `core-evidence red-proof` declares each bugfix red BEFORE the fix; `core-evidence
91
107
  degrade` records an unavailable backend; reviews run on the STAGED tree; `run-gates --final`
92
108
  mints the ONE receipt `commit-guard --check` gates the commit against.
93
109
 
110
+ On an **ARMED flow**, a **bridge-raised** finding uses this order: the round is open; dispatch
111
+ its consult with a nonce; WAIT and READ; accept or correct the fold; run
112
+ `flow-writer consult-attestation <planId> --backend <id> --nonce <n> --proposed-fix-digest
113
+ <the-sha256-of-the-fold-text>`; then edit. The attestation records the manifest and fold digest,
114
+ never the run or answer. A **lens-raised** finding instead re-dispatches the lens without a nonce
115
+ (WAIT and READ, edit as accepted or corrected); it mints no manifest and no attestation; only its
116
+ per-round participation rides `internal-attestation`.
117
+
94
118
  **Finding scope** — every finding NAMES the invariant its fix enforces, BEFORE the edit, every
95
119
  round. Already an acceptance criterion (*Verification*'s `- ` bullets) → **fold here**. It would
96
120
  have to be ADDED → the **narrow fix** for the found site ships now (red first) and ONLY the