@abelxiaoxing/cadence 1.0.13 → 1.1.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 (46) hide show
  1. package/README.md +29 -13
  2. package/agents/contract-reviewer.md +2 -2
  3. package/agents/design-explorer.md +1 -1
  4. package/agents/diagnosis-worker.md +6 -3
  5. package/agents/implementation-worker.md +14 -9
  6. package/config/.env.example +5 -17
  7. package/config/routes.example.json +42 -0
  8. package/package.json +3 -3
  9. package/prompts/abel-design.md +150 -228
  10. package/prompts/abel-diagnose.md +37 -18
  11. package/prompts/abel-implement.md +111 -178
  12. package/prompts/abel-init.md +36 -33
  13. package/skills/abel-workflow/SKILL.md +156 -168
  14. package/src/apply-transaction.ts +1427 -0
  15. package/src/artifact-store.ts +204 -0
  16. package/src/child-session.ts +136 -17
  17. package/src/contracts.ts +105 -696
  18. package/src/control-contracts.ts +259 -0
  19. package/src/delivery-compiler.ts +1088 -0
  20. package/src/file-snapshot.ts +5 -0
  21. package/src/implement-graph.ts +11 -4
  22. package/src/index.ts +1465 -133
  23. package/src/isolation-backend.ts +269 -0
  24. package/src/packet-runtime.ts +533 -0
  25. package/src/parent-provider.ts +23 -4
  26. package/src/route-policy.ts +483 -0
  27. package/src/run-state.ts +393 -0
  28. package/src/run-store.ts +918 -0
  29. package/src/safe-path.ts +11 -0
  30. package/src/scoped-tools.ts +36 -0
  31. package/src/state-root.ts +215 -0
  32. package/src/subagent-activity.ts +526 -27
  33. package/src/submit-tool.ts +274 -0
  34. package/src/task-ledger.ts +1380 -0
  35. package/src/verification-capability.ts +529 -42
  36. package/src/worker-broker.ts +703 -0
  37. package/src/workflow-engine.ts +7391 -0
  38. package/src/workspace-store.ts +544 -0
  39. package/src/candidate-preflight.ts +0 -1618
  40. package/src/drain.ts +0 -20
  41. package/src/patch.ts +0 -505
  42. package/src/result-store.ts +0 -312
  43. package/src/runtime.ts +0 -2436
  44. package/src/scheduler.ts +0 -384
  45. package/src/subagent-endpoint.ts +0 -158
  46. package/src/worker.ts +0 -204
@@ -1,178 +1,166 @@
1
1
  ---
2
2
  name: abel-workflow
3
- description: Shared contract for the Abel Init, Design, Implement, and Diagnose workflow stages
3
+ description: Shared contract loaded only after an explicit /abel-init, /abel-design, /abel-implement, or /abel-diagnose invocation; never activate it for ordinary engineering work
4
4
  ---
5
5
 
6
6
  # Abel workflow
7
7
 
8
- This Skill is the authoritative shared contract for `/abel-init`, `/abel-design`, `/abel-implement`, and `/abel-diagnose`.
9
- Load it before executing any stage; the package remains usable when no user-global `AGENTS.md` contains Abel-specific instructions.
10
- Stage prompts own their input contract and stage-specific procedure, while rules shared across stages live here.
8
+ This Skill applies only after the user explicitly invokes `/abel-init`, `/abel-design`, `/abel-implement`, or `/abel-diagnose`.
9
+ Merely finding these files, an OpenSpec change, an AGENTS index entry, or the word “Abel” does not activate a workflow.
10
+ Load this Skill only for the invoked stage and do not carry stage authority into an ordinary engineering request.
11
+
12
+ Stage prompts own their input and procedure.
13
+ This file owns the cross-stage integrity, recovery, verification, and authority rules.
11
14
 
12
15
  ## Gates and trusted delivery
13
16
 
14
- Gate A approves the complete product behavior contract.
17
+ Gate A approves the complete observable behavior contract.
15
18
  Gate B separately approves the complete technical implementation contract.
16
- Neither Gate authorizes a tool permission; they do not grant permission authorization, identity signing, or approval to bypass repository controls.
17
-
18
- Design and Implement may run in different contexts.
19
- A handoff is trusted only when versioned Gate receipts bind the same change and schema, every covered artifact's normalized relative path and SHA-256 hash is valid, the Gate A receipt hash is valid, OpenSpec strict validation passes, and the artifact graph is complete.
20
- Normalize only the tracked task file's completed Markdown checkboxes before hashing; reject absolute paths, `..`, path escapes, and symbolic-link escapes.
21
- A missing receipt, invalid hash, or inconsistent artifact is a `delivery-invalid` stage blocker before Implement registers a task.
22
- The current `ready.yaml` receipt embeds one canonical `implementGraph`, its `implementGraphHash`, and the graph closure result; it has no alternate task-readiness summary.
23
-
24
- Every approved behavior must retain a stable trace from Requirement to Scenario to Verification to Task.
25
- Every task must state exactly one executable verification type, its Red command and expected target failure, Green behavior, affected suite, target files, approved dependency changes, impact-closure evidence, and structured AGENTS impact.
26
-
27
- ### Graph-proven structured verification
28
-
29
- Design emits exactly one immutable `ImplementGraphBoundary` for the change.
30
- It contains every task, each task's explicit `dependsOn`, each phase's `verificationInputs`, and every generated output as an id, safe relative path, producer task and phase, and `regular-file` postcondition.
31
- A write set grants permission only; it never proves that an output exists.
32
-
33
- Every direct verification input binds exactly once to either an existing workspace path or a graph output id.
34
- A workspace binding must already be a safe regular file at Gate B. An output binding must resolve to one unique producer whose path is in that producer phase's write set.
35
- A cross-task consumer must have the producer as a transitive DAG dependency.
36
- Suggested waves, conflicts, resources, and verification locks do not create a dependency edge.
37
- A phase may consume an output created by its own candidate or an earlier applied phase, but never one produced only by a later phase.
38
-
39
- Design and Implement share `src/implement-graph.ts::assessImplementGraphReadiness`.
40
- The same core receives the canonical graph, consumer root, current completed and blocked task facts, applied phases, and an optional candidate overlay.
41
- Gate B and receipt creation require an executable static closure with no diagnostics; current dependency waiting is a dynamic readiness fact and does not invalidate that closure.
42
- `ready.yaml` stores the exact `implementGraph`, `hashImplementGraphBoundary(implementGraph)` as `implementGraphHash`, and `verificationClosure: { executable: true, diagnostics: [] }`.
43
-
44
- Runtime admits that same graph once, recomputes readiness before a task launch, checks declared outputs in the isolated candidate before verification, checks them again after main-workspace application and before phase or task completion, and publishes a cross-task output only after its producer task completes.
45
- A blocked producer keeps its consumers `dependency-blocked`; a completed producer with an absent or unsafe output is `producer-output-unavailable`.
46
-
47
- Fresh Implement reconstructs availability only from the receipt-bound graph and hash, parent-owned completed task facts, current in-process blocked facts, and a fresh safe scan of the workspace.
48
- It never infers phase completion merely because a file exists and never persists Runtime state, retry budgets, sessions, or model output.
49
- All path observations reject absolute or noncanonical paths, `..`, NUL, root escape, a symbolic link in any existing component, a non-directory parent, and a non-regular final input or output.
50
-
51
- Design emits only the structured Runtime kinds `kind: "vitest"`, `kind: "package-script"`, `kind: "static-check"`, and `kind: "steps"`:
52
-
53
- - `vitest` declares its runner, safe relative `testFiles`, explicit `args`, and `minTests`.
54
- It uses a consumer-installed local Vitest.
55
- Runtime alone injects the JSON reporter and checks assertion identity for Red.
56
- - `package-script` pins the package manager, script name, exact Gate-B-approved `package.json` command, and argument array.
57
- The script and runner must already exist in the consumer repository.
58
- - `static-check` declares a local binary, `npx` with `noInstall: true`, or a safe relative Node script.
59
- It covers static, typecheck, build, schema, and parent-only AGENTS checkpoint verification without Vitest arguments.
60
- - `steps` is an ordered list of atomic contracts.
61
- Every precheck is an explicit expected-green step and only the final step carries the phase classification.
62
- A compound command must not use `&&` or another shell operator.
63
-
64
- No kind admits an arbitrary shell command.
65
- Tokens are passed without a shell; shell operators, path escapes, absolute paths, unsafe executable names, unapproved commands, and implicit download runners are rejected.
66
- `npx` is compiled with `--no-install` and still requires its executable in the approved local `node_modules`.
67
- Bun, npm, pnpm, and Yarn package scripts are allowed only when the named package manager and exact pinned script capability validate.
68
-
69
- Runtime never invents `bun run check`, `bun run test:target`, or another consumer script.
70
- A precheck or affected verification runs only as an explicit approved contract or ordered step.
71
- Argv-only verification contracts are invalid; there is no legacy normalizer or parallel verification schema.
72
-
73
- An unsupported shape is `design-readiness/verification-contract-unsupported`.
74
- A missing approved script is `verification-adapter/script-missing`; other missing or drifted consumer capabilities use their closed `verification-adapter` code.
75
- Only an unavailable Bubblewrap launch, Bun resolution, dependency path, or sandbox runtime is an `environment` failure.
76
-
77
- ## Verification discipline
78
-
79
- Before writes, record target, affected-suite, and full-suite baselines with commands, exit codes, and normalized failure identities.
80
- A pre-existing baseline failure is separate evidence and never satisfies a target Red.
81
-
82
- Use Red-Green-Refactor for code, tests, and executable static contracts:
83
-
84
- 1. **Red:** add only the approved failing verification and run the exact command; it must fail for the specified target defect.
85
- 2. **Green:** implement the minimum approved change and run the target verification after every code or test edit.
86
- 3. **Refactor:** improve only in-scope structure or readability while target verification stays green; then run the affected suite.
87
-
88
- Syntax, import/load, no-test, malformed-diff, and wrong-Red-identity failures are generated implementation-artifact rejection.
89
- A wrong-Red result uses the same bounded artifact-correction path.
90
- Every artifact rejection receives a finite correction budget shared with the phase's mechanical redispatch budget.
91
- When the artifact correction budget is exhausted, terminally block the current Implement task as `attempts-exhausted`.
92
- A Red candidate that passes is `{ kind: "artifact", code: "red-not-witnessed" }`; Runtime returns a bounded `{ kind: "retry", scope: "worker", cause: "artifact", remainingAttempts: 1 }`, and candidate success alone does not prove a Design defect.
93
- If separate evidence proves that the approved command cannot witness the approved behavior without changing behavior, policy, dependency, architecture, scope, write-set, or verification contract, terminally block the current task as `verification-contract-insufficient` without consuming the artifact correction budget.
94
-
95
- ### Implement graph and fixed task boundary
96
-
97
- This boundary applies only to Implement.
98
- The parent submits the receipt-bound graph once with `admit-graph`.
99
- A ready task's first Red `task-attempt` opens one process-local task record from the graph; every later Green, Refactor, correction, or stale refresh is another `task-attempt` with only change/task/request/phase identity and a fresh dynamic snapshot.
100
- The immutable task entry includes all phase-local exact read/write paths, verification input bindings, target and affected verification, scheduling declarations, explicit dependencies, approved dependency changes, impact closure, and AGENTS impact.
101
- Runtime never expands it.
102
- Keep each command, exit code, normalized failure identity, reproducibility result, attribution, and root-cause evidence in context and the final report, not in a state file.
103
- Every reproducible pre-existing affected failure remains separate from task Red and may be repaired only when its paths and behavior are already inside the approved boundary.
104
- Classify later affected failures as `pre-existing`, `introduced`, or `unresolved`; make the minimum in-boundary repair, repair or revert an introduced failure, and block the current task when attribution is unresolved.
105
- Environmental, transient, external-service-dependent, or non-reproducible failures terminally block the current task with typed evidence and never authorize speculative edits.
106
- A full-suite-only baseline failure outside the affected commands remains baseline evidence and outside task scope.
107
- Finish only when all target and affected verifications are green and the full suite has no new failure relative to baseline.
108
- Do not archive, publish, or commit implicitly.
109
-
110
- ### Impact closure
111
-
112
- A task changing route authorization, page state, API response, or public HTML structure must search existing code and tests by all relevant URLs, route names, handlers, and templates.
113
- Classify every related existing E2E, theme/layout, authorization, HTML/template, and API contract test as current-task, explicit regression-task, or unaffected with cited evidence.
114
- The affected suite must contain existing-test evidence and must not cover only a new test file.
115
- Changes such as `/videos` and `/api/videos` require all five test surfaces to be checked.
116
- This is a task-contract evidence check, not a business-specific source scanner.
117
-
118
- ## AGENTS indexes: stage-scoped authority
119
-
120
- In the Design stage, every repository `AGENTS.md` is read-only.
121
- Design may only audit stale routes and record `none | update-existing | create-index | remove-index`, an exact target, evidence, and `agentsManagedOnly: true` in the task contract; Design must not edit an index.
122
- This Design read-only rule is not inherited by and does not apply to Implement.
123
-
124
- In Implement, the parent applies the approved contract at a stable task checkpoint:
125
-
126
- - `none`: no AGENTS target or write is allowed.
127
- - `update-existing`: update the approved existing AGENTS path.
128
- - `create-index`: create the approved AGENTS path.
129
- - `remove-index`: remove the approved managed block, deleting the file only when no human content remains.
130
-
131
- Treat indexes as verified routers, not architecture documents or session ledgers.
132
- The parent must preserve all human-authored text and edit only the managed region delimited by `<!-- ABEL:AGENTS-INDEX:START -->` and `<!-- ABEL:AGENTS-INDEX:END -->`.
133
- An approved AGENTS checkpoint is normal Implement work and must not become a boundary failure or stage-routing instruction.
134
- A subagent must never receive an AGENTS write path or edit any index.
135
-
136
- Before a parent index write, inspect the complete task diff and mechanically compare actual impact with the approved target and impact.
137
- An unapproved behavior/architecture diff or required task/AGENTS contract change terminally blocks the current task with the matching `approval-boundary` code.
138
- Validate paths, commands, removed references, marker uniqueness, and root-to-nested routes after every index update.
139
- Never persist runtime user/session state, dirty-state ledgers, timestamps, or approval status in an index.
140
-
141
- ## Implement typed blockers
142
-
143
- Implement reports facts about only the current task.
144
- It does not select a user recovery action, recommend another workflow, or claim control over the parent-owned DAG.
145
-
146
- - Generated artifact defects are closed typed failures: malformed diff, syntax/import/load, no-test or wrong command, wrong Red identity, duplicate/invalid structured result, and `red-not-witnessed`.
147
- - Artifact, stale-snapshot, and transport failures share two non-cancelled launches per phase; exhaustion is `{ kind: "attempts-exhausted", cause, attemptsUsed: 2, lastFailure: { code, stage, details? } }` and cancellation is budget-neutral.
148
- - `lastFailure` always preserves the final closed code and stage for artifact, stale, and transport exhaustion.
149
- Optional details are limited to final submission category, a bounded submit-attempt count, schema state, mismatched identity dimension names, and a validated verification id.
150
- - Public outcomes never contain a prompt, diff, model output, excerpt, consumer file content, command or argv, endpoint, credential, environment value, or actual/expected identity value.
151
- - Bubblewrap, dependency-path, sandbox, or external runtime failure is `{ kind: "environment", code: <closed-environment-code> }` and terminally blocks the current task.
152
- - Unsupported verification contracts close Design readiness; missing scripts,
153
- runners, local executables, or inputs are closed `verification-adapter` failures
154
- and must not be reported as Bubblewrap or dependency environment failures.
155
- - Any required path, dependency, behavior, policy, architecture, conflict, resource, verification, or AGENTS expansion is the matching closed `approval-boundary` failure and never expands the boundary at runtime.
156
- - Oversized output is `{ kind: "result-limit", limitBytes }`, terminal, and never yields a partial diff.
157
-
158
- Expected Red failure, artifact defects, stale snapshots, environment failures, approved AGENTS checkpoints, approved docs/tests, and in-boundary compatibility repairs never produce stage-routing metadata.
159
-
160
- ## Parent and subagent authority
161
-
162
- The parent agent owns Gate handling, patches, repository writes, AGENTS index updates, and task completion state.
163
- A subagent receives bounded relevant index context and may perform only the delegated read-only exploration or review.
164
- A subagent must not approve a Gate, apply a patch, edit an index, or advance a task checkbox.
165
-
166
- ## External browser E2E
167
-
168
- `dev-browser` is external and is required only when an approved task verification contract explicitly names browser E2E.
169
- Its absence does not block another task or workflow stage whose approved contract has no browser E2E step.
170
- When an approved browser-E2E task requires `dev-browser` and it is missing or unavailable, stop that task, report the missing capability and an executable remediation, and do not report the verification as passing.
171
-
172
- ## Stage responsibilities
173
-
174
- - **Init:** initialize or safely repair OpenSpec and verified AGENTS routes without destructive overwrite.
175
- - **Design:** resolve blocking decisions, obtain Gate A and Gate B, write only OpenSpec change artifacts after Gate A, and deliver a strictly validated traceable change.
176
- - **Implement:** validate the trusted delivery in a fresh context, execute task contracts in tracked order through Red-Green-Refactor, and maintain indexes at stable checkpoints.
177
- - **Diagnose:** reproduce existing bugs, falsify candidate causes, establish a failing regression, and make the minimum repair.
178
- This regression-first algorithm is independent of Implement blockers; new behavior or substantive architecture is outside Diagnose scope.
19
+ Neither Gate grants tool permission, repository permission, identity, or authority outside its recorded scope.
20
+
21
+ Design and Implement may run in fresh contexts.
22
+ Trusted delivery requires:
23
+
24
+ - canonical Gate A and Gate B receipts for the same change/schema;
25
+ - safe relative artifact paths and exact raw SHA-256 bindings;
26
+ - a canonical `implement-plan.json` with schema version, raw hash, and canonical hash;
27
+ - OpenSpec strict validity and planning completeness;
28
+ - Requirement → Scenario → Verification → Task traceability exactly once;
29
+ - executable verification closure and complete output/path/dependency/AGENTS contracts.
30
+
31
+ The loader aggregates all safe delivery diagnostics as `delivery-invalid` before a Worker starts.
32
+ Only tracked task checkbox markers for sealed task ids may normalize `[x]`/`[X]` to `[ ]`; every other byte remains hash-bound.
33
+
34
+ A fresh context validates existing approvals and never asks the user to approve unchanged decisions.
35
+ A new receipt revision is needed only when approved authority changes.
36
+
37
+ ## Stage separation
38
+
39
+ - **Init** is deterministic local setup/repair.
40
+ It uses no Subagent dispatch, preserves dirty/human content and nested repositories, and is idempotent.
41
+ - **Design** is evidence and delivery compilation only.
42
+ Product code, tests, implementation candidates, and AGENTS files are read-only.
43
+ Design may use bounded read-only `design-explorer` packets.
44
+ - **Implement** uses only the durable change command surface.
45
+ It executes the sealed plan in private immutable revisions and applies the complete change once.
46
+ - **Diagnose** independently follows reproduce → falsify → failing regression → minimum repair.
47
+ It does not inherit Implement state, retry policy, or approval classification.
48
+
49
+ Design and Diagnose bounded packets use `action: "run"` with their own stage.
50
+ Implement never uses that packet protocol.
51
+ Cross-stage calls fail closed.
52
+
53
+ ## Canonical ImplementPlan
54
+
55
+ `ImplementPlan` is the only machine source for implementation mechanics.
56
+ It seals:
57
+
58
+ - exact task ids, dependencies, objectives, context, paths, deletes, conflicts, resources, and locks;
59
+ - structured Red, Green, optional Refactor verification plus verification inputs;
60
+ - unique regular-file outputs and their producer task/phase;
61
+ - task-affected and repair verification;
62
+ - target/affected/full-suite baselines and normalized failure identity;
63
+ - change affected/full-suite/post-apply verification;
64
+ - an explicit `artifactCorrection.maxAttempts` of 2-3 total candidate launches per task phase and operation, including the initial launch;
65
+ - bounded repair policy with `pre-existing | introduced | unresolved | environment` attribution;
66
+ - parent-owned Markdown checkbox tracking;
67
+ - approved managed-only AGENTS operations and verification.
68
+
69
+ The compiler, not prose parsing or the caller, canonicalizes and validates the plan.
70
+ A write set grants authority only; it never proves output existence.
71
+ An absent input must resolve to one declared output from a transitive dependency.
72
+ Unsafe paths, symlink components, missing local capability, cycles, conflicts without ordering, unsupported verification, and unbound outputs close readiness before Gate B.
73
+
74
+ Impact closure must cover existing compatibility evidence, not only newly added tests.
75
+ For public UI or API changes it seals the relevant route authorization, page state, API response and contract, public HTML/template/theme behavior, and approved browser E2E checks.
76
+
77
+ Verification supports only shell-free `vitest`, `package-script`, `static-check`, and ordered `steps` contracts.
78
+ Local runners/scripts, exact command bindings, args, classifications, verification inputs, `minTests`, and `noInstall` semantics are sealed.
79
+ Arbitrary shell, `&&`, path escape, and implicit downloads are forbidden.
80
+
81
+ ## Durable control
82
+
83
+ Implement accepts only `start`, `status`, `resume`, `rebind`, `cancel`, and `discard` with protocol version 2, stage, change, and operation identity where required.
84
+
85
+ - `start` is idempotent for one change run.
86
+ - `status` is local and requires no Worker endpoint.
87
+ - `resume` continues from durable facts; with a new approved `deliveryRevision` and `receiptHash`, it revalidates retained work and invalidates only incompatible tasks.
88
+ - `rebind` selects another route already allowed by policy; it does not change the task contract.
89
+ - `cancel` stops the active operation and preserves accepted progress.
90
+ It is budget-neutral.
91
+ - `discard` is the only explicit destructive terminal command.
92
+ During apply it waits for safe recovery before cleanup.
93
+
94
+ Repeated operation ids replay their committed outcomes.
95
+ Private state retains run journals, plan bindings, normalized task evidence, artifacts, revisions, retry classification, and apply recovery facts; it never stores credentials, environment values, raw prompts, hidden reasoning, transcripts, or raw model output.
96
+ Completed/discarded runs clean private change content after safe settlement.
97
+
98
+ ## Red-Green-Refactor and attribution
99
+
100
+ Before the first candidate, record target-contract, task-affected, and full-suite baselines.
101
+ Pre-existing failures remain separate and never satisfy Red.
102
+
103
+ 1. **Red:** the approved target must fail with its exact witness identity.
104
+ Syntax/setup/no-test/wrong-identity failures are artifact defects.
105
+ 2. **Green:** apply the minimum approved candidate in a disposable child revision and require target plus task-affected verification.
106
+ 3. **Refactor:** optional in-boundary improvement with behavior and verification unchanged.
107
+
108
+ The parent control plane alone applies accepted candidate bytes to the private cumulative revision, records `phase-verified`/`repair-verified`, advances one task checkbox, verifies outputs, and schedules dependents.
109
+ A Worker only proposes one complete diff within the declared path set.
110
+
111
+ After all tasks, re-run every affected contract, compare the full suite with baseline, apply and verify sealed AGENTS operations, verify output postconditions, then prepare one currentness-checked journaled transaction and post-apply verification.
112
+ The main workspace remains unchanged before final application eligibility.
113
+
114
+ Attribution behavior:
115
+
116
+ - `pre-existing`: baseline evidence; do not blame or speculatively edit.
117
+ - `introduced`: reopen the owning task as `repairable` and perform bounded minimum repair inside its sealed boundary.
118
+ - `unresolved`: pause with normalized identities and retained cumulative state until ownership evidence is available.
119
+ - `environment`: pause before speculative edits and resume after capability restoration.
120
+
121
+ A full-suite-only baseline failure outside affected contracts does not block completion unless the change introduces or worsens it.
122
+
123
+ ## Recovery versus approval
124
+
125
+ Artifact defects, wrong Red, stale revisions, transport errors, environment/adapter failures, capacity, conflicts, cancellation, process interruption, baseline failures, and introduced in-boundary repairs are recoverable Implement facts.
126
+ They never select a workflow stage and never erase compatible progress.
127
+
128
+ Automatic attempts are finite.
129
+ Artifact correction uses the sealed `artifactCorrection.maxAttempts` independently for each task phase and operation; only typed artifact rejection consumes its 2-3 total-launch budget.
130
+ Exhaustion pauses with the final safe code, scope, and last committed revision.
131
+ A later `resume` starts a new operation budget while reusing durable baseline and phase facts.
132
+ Oversized output becomes `needs-task-split`; partial diffs are never accepted.
133
+
134
+ Use `approval-needed` only when continuing requires new authority: observable behavior, architecture/policy, dependency, undeclared path, conflict/resource permission, verification contract, AGENTS target/impact/content, or another irreversible scope decision.
135
+ Report the exact missing authority.
136
+ After the user approves a new canonical delivery revision, resume the same run and preserve compatible work.
137
+
138
+ Do not label an approved AGENTS checkpoint, documentation/test edit, endpoint outage, artifact error, stale snapshot, environment problem, baseline failure, or in-boundary repair as approval-needed.
139
+
140
+ ## AGENTS indexes
141
+
142
+ Design audits AGENTS read-only.
143
+ Gate B seals `none | update-existing | create-index | remove-index`, exact target, owner task ids, complete managed block, and verification.
144
+
145
+ Implement applies the sealed operation code-first in the private cumulative revision.
146
+ It preserves every byte outside `<!-- ABEL:AGENTS-INDEX:START -->` and `<!-- ABEL:AGENTS-INDEX:END -->`; `remove-index` deletes the file only when no human content remains.
147
+ A Worker never receives an AGENTS write path.
148
+ Runtime/session ids, timestamps, credentials, approval state, and dirty-state ledgers never enter an index.
149
+
150
+ ## Parent and Worker authority
151
+
152
+ The parent owns user decisions, Gates, delivery compilation, candidate acceptance, verification classification, cumulative revisions, tracking, AGENTS, final apply, recovery, and truthful status.
153
+
154
+ Evidence/diagnosis/implementation Agents receive only bounded context and scoped tools.
155
+ They cannot approve a Gate, expand a boundary, apply a patch, edit AGENTS, advance a checkbox, choose a user recovery action, or report completion.
156
+
157
+ `dev-browser` is required only by an explicitly approved browser-E2E contract.
158
+ Its absence pauses that verification only and does not block unrelated tasks or stages.
159
+
160
+ ## Truthful finish
161
+
162
+ `queued`, `connecting`, `waiting-first-response`, `running`, `validating`, `retrying`, `verifying`, `paused`, `approval-needed`, `applying`, and `recovering` are nonterminal activity states.
163
+ `operation-cancelled` ends only the current operation; `discarded` and `rejected` are non-success terminal run states.
164
+ Tool settlement is not completion.
165
+ Only durable `completed` after cumulative apply and postconditions receives success.
166
+ Never archive, publish, release, stage, or commit implicitly.