@abelxiaoxing/cadence 1.0.14 → 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.
- package/README.md +29 -13
- package/agents/contract-reviewer.md +2 -2
- package/agents/design-explorer.md +1 -1
- package/agents/diagnosis-worker.md +6 -3
- package/agents/implementation-worker.md +14 -9
- package/config/.env.example +5 -17
- package/config/routes.example.json +42 -0
- package/package.json +3 -3
- package/prompts/abel-design.md +150 -228
- package/prompts/abel-diagnose.md +37 -18
- package/prompts/abel-implement.md +111 -178
- package/prompts/abel-init.md +36 -33
- package/skills/abel-workflow/SKILL.md +156 -168
- package/src/apply-transaction.ts +1427 -0
- package/src/artifact-store.ts +204 -0
- package/src/child-session.ts +136 -17
- package/src/contracts.ts +105 -696
- package/src/control-contracts.ts +259 -0
- package/src/delivery-compiler.ts +1088 -0
- package/src/file-snapshot.ts +5 -0
- package/src/implement-graph.ts +11 -4
- package/src/index.ts +1465 -133
- package/src/isolation-backend.ts +269 -0
- package/src/packet-runtime.ts +533 -0
- package/src/parent-provider.ts +23 -4
- package/src/route-policy.ts +483 -0
- package/src/run-state.ts +393 -0
- package/src/run-store.ts +918 -0
- package/src/safe-path.ts +11 -0
- package/src/scoped-tools.ts +36 -0
- package/src/state-root.ts +215 -0
- package/src/subagent-activity.ts +526 -27
- package/src/submit-tool.ts +274 -0
- package/src/task-ledger.ts +1380 -0
- package/src/verification-capability.ts +529 -42
- package/src/worker-broker.ts +703 -0
- package/src/workflow-engine.ts +7391 -0
- package/src/workspace-store.ts +544 -0
- package/src/candidate-preflight.ts +0 -1618
- package/src/drain.ts +0 -20
- package/src/patch.ts +0 -505
- package/src/result-store.ts +0 -312
- package/src/runtime.ts +0 -2436
- package/src/scheduler.ts +0 -384
- package/src/subagent-endpoint.ts +0 -158
- package/src/worker.ts +0 -204
|
@@ -1,178 +1,166 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: abel-workflow
|
|
3
|
-
description: Shared contract
|
|
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
|
|
9
|
-
|
|
10
|
-
|
|
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
|
|
17
|
+
Gate A approves the complete observable behavior contract.
|
|
15
18
|
Gate B separately approves the complete technical implementation contract.
|
|
16
|
-
Neither Gate
|
|
17
|
-
|
|
18
|
-
Design and Implement may run in
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
A
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
-
|
|
57
|
-
|
|
58
|
-
-
|
|
59
|
-
|
|
60
|
-
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
A
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
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.
|