@cassiomc1/forgeloop 1.0.0 → 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 (95) hide show
  1. package/.cursor/rules/project-loop.mdc +3 -2
  2. package/.github/copilot-instructions.md +1 -0
  3. package/AGENTS.md +2 -1
  4. package/CLAUDE.md +1 -0
  5. package/DOCS_INDEX.md +36 -0
  6. package/ENG/design-code-eng.md +31 -0
  7. package/ENG/documentation-quality-eng.md +400 -0
  8. package/EXECUTION_STATE.md +23 -13
  9. package/GUIDE_ROUTER.md +23 -8
  10. package/LOOP_ENGINEERING.md +77 -12
  11. package/PROTOCOL_INTEGRATION.md +9 -6
  12. package/README.md +82 -39
  13. package/docs/ARTIFACT_REFERENCE.md +442 -0
  14. package/docs/CLI_REFERENCE.md +892 -0
  15. package/docs/CROSS_HARNESS_CONTINUITY.md +198 -0
  16. package/docs/DOCUMENTATION_GUIDE.md +161 -0
  17. package/docs/GETTING_STARTED.md +348 -0
  18. package/docs/RECIPES.md +250 -0
  19. package/docs/TROUBLESHOOTING.md +345 -0
  20. package/docs/assets/forgeloop-flow.svg +1 -1
  21. package/docs/forgeloop-flow.mmd +1 -1
  22. package/package.json +13 -2
  23. package/schemas/task-descriptor.schema.json +56 -0
  24. package/schemas/work-state.schema.json +18 -1
  25. package/scripts/CI_VALIDATORS.md +7 -0
  26. package/src/cli.js +280 -388
  27. package/src/commands/advance.js +5 -2
  28. package/src/commands/audit.js +11 -1
  29. package/src/commands/clear-continuity.js +5 -2
  30. package/src/commands/clear-state.js +5 -2
  31. package/src/commands/complete.js +9 -1
  32. package/src/commands/continuity.js +5 -2
  33. package/src/commands/inspect.js +10 -2
  34. package/src/commands/next.js +5 -2
  35. package/src/commands/preflight.js +9 -1
  36. package/src/commands/prepare-completion.js +5 -2
  37. package/src/commands/reconcile-continuity.js +5 -2
  38. package/src/commands/record-check.js +7 -1
  39. package/src/commands/record-continuity.js +21 -14
  40. package/src/commands/record-terminal-result.js +7 -1
  41. package/src/commands/route.js +22 -18
  42. package/src/commands/run-check.js +52 -44
  43. package/src/commands/status.js +18 -12
  44. package/src/commands/task-create.js +94 -0
  45. package/src/commands/task-list.js +48 -0
  46. package/src/commands/task-migrate.js +34 -0
  47. package/src/commands/task-scope.js +75 -0
  48. package/src/commands/task-show.js +81 -0
  49. package/src/commands/task-unlock.js +35 -0
  50. package/src/commands/validate-protocol.js +37 -20
  51. package/src/commands/validate-state.js +24 -18
  52. package/src/config/guides.json +42 -0
  53. package/src/core/activation.js +8 -4
  54. package/src/core/artifact-registry.js +166 -0
  55. package/src/core/audit.js +65 -12
  56. package/src/core/bundles.js +76 -50
  57. package/src/core/cli-command-definitions.js +611 -0
  58. package/src/core/cli-metadata.js +23 -0
  59. package/src/core/completion-artifacts.js +161 -74
  60. package/src/core/completion.js +134 -76
  61. package/src/core/continuity.js +20 -13
  62. package/src/core/contract.js +6 -3
  63. package/src/core/error-codes.js +197 -0
  64. package/src/core/events.js +19 -14
  65. package/src/core/execution.js +38 -6
  66. package/src/core/gate-artifact.js +12 -9
  67. package/src/core/gates.js +4 -2
  68. package/src/core/guide-metadata.js +7 -11
  69. package/src/core/guide-registry.js +29 -0
  70. package/src/core/inspect.js +7 -4
  71. package/src/core/native-adapters.js +6 -0
  72. package/src/core/phase.js +85 -33
  73. package/src/core/preflight-consistency.js +24 -14
  74. package/src/core/preflight-loaders.js +16 -11
  75. package/src/core/preflight.js +44 -25
  76. package/src/core/protocol.js +2 -11
  77. package/src/core/receipt.js +1 -1
  78. package/src/core/report.js +2 -2
  79. package/src/core/repository.js +46 -12
  80. package/src/core/resumability.js +6 -4
  81. package/src/core/route-artifact.js +9 -5
  82. package/src/core/router.js +11 -7
  83. package/src/core/schema-validation.js +1 -0
  84. package/src/core/task-command.js +41 -0
  85. package/src/core/task-context.js +126 -0
  86. package/src/core/task-descriptor.js +81 -0
  87. package/src/core/task-discovery.js +116 -0
  88. package/src/core/task-identity.js +76 -0
  89. package/src/core/task-lock.js +209 -0
  90. package/src/core/task-migration-validation.js +140 -0
  91. package/src/core/task-migration.js +361 -0
  92. package/src/core/task-paths.js +96 -0
  93. package/src/core/task-scope.js +179 -0
  94. package/src/core/templates.js +3 -9
  95. package/src/core/work-state.js +24 -13
@@ -0,0 +1,348 @@
1
+ # Getting Started with ForgeLoop
2
+
3
+ This guide walks through your first complete task with ForgeLoop from initialization to validator-backed completion.
4
+
5
+ ---
6
+
7
+ ## 1. What is ForgeLoop?
8
+
9
+ ForgeLoop is a portable, vendor-neutral engineering protocol for AI-assisted coding and automated workflows. It turns a task outcome into:
10
+
11
+ - **A structured contract** (`.forgeloop/task-state/<taskKey>/contract.json`);
12
+ - **Deterministic guide routing** based on declared work type, surfaces, and risks;
13
+ - **Resumable work state** across different tools, IDEs, and AI harnesses;
14
+ - **Observed verification evidence** linked to ForgeLoop-attested command execution;
15
+ - **Diagnostic recovery loops** when tests or checks fail;
16
+ - **Validator-backed completion** validated by protocol algorithms rather than agent claims.
17
+
18
+ ForgeLoop is **not** an LLM runtime, agent framework, or graph orchestrator. It is a deterministic protocol and CLI that guides execution environments safely.
19
+
20
+ Core mental model:
21
+
22
+ - `work-state = lifecycle truth`
23
+ - `continuity = operational handoff context`
24
+ - `checkout = implementation truth`
25
+ - `execution artifacts = process provenance`
26
+ - `checks = verification truth`
27
+ - `receipt = completion/publication record`
28
+
29
+ ---
30
+
31
+ ## 2. Prerequisites
32
+
33
+ - **Node.js**: version 20 or higher (`node -v`)
34
+ - **npm**: standard npm toolchain
35
+
36
+ ---
37
+
38
+ ## 3. Installation & Initialization
39
+
40
+ In your project repository:
41
+
42
+ ```bash
43
+ # Initialize ForgeLoop kit and discovery shims
44
+ npx @cassiomc1/forgeloop init
45
+
46
+ # Check target project health
47
+ npx @cassiomc1/forgeloop doctor
48
+ ```
49
+
50
+ What `init` does:
51
+
52
+ - Installs the canonical instruction kit under `.forgeloop/kit/`;
53
+ - Places native discovery shims at the project root (`AGENTS.md`, `CLAUDE.md`, `.cursor/rules/`, `.github/copilot-instructions.md`);
54
+ - Creates `.forgeloop/` for project configuration and `.forgeloop/task-state/` for isolated task execution.
55
+
56
+ ---
57
+
58
+ ## 4. End-to-End Walkthrough
59
+
60
+ Here is a typical end-to-end task: *"Implement a contact form with input validation and tests."*
61
+
62
+ ```text
63
+ User Request
64
+
65
+
66
+ Create Task Namespace
67
+
68
+
69
+ Define Task Contract
70
+
71
+
72
+ Route Guides
73
+
74
+
75
+ Preflight & Gate Validation
76
+
77
+
78
+ Plan & Implement
79
+
80
+
81
+ Execute & Verify Checks ─── failure ───► Diagnose & Correct
82
+ │ │
83
+ ▼ ▼
84
+ Review Evidence ◄──────────────────────────────┘
85
+
86
+
87
+ Complete Validation (VALID)
88
+ ```
89
+
90
+ ---
91
+
92
+ ### Step 1 — Create the Task Namespace and Contract
93
+
94
+ First, create the task namespace with explicit write claims covering the files this task will touch:
95
+
96
+ ```bash
97
+ forgeloop task-create \
98
+ --task task-contact-form-001 \
99
+ --claim src/components \
100
+ --claim tests \
101
+ --json
102
+ ```
103
+
104
+ Discover the deterministic task state path using `task-show`:
105
+
106
+ ```bash
107
+ forgeloop task-show --task task-contact-form-001 --json
108
+ ```
109
+
110
+ Then write the task contract to `.forgeloop/task-state/<taskKey>/contract.json`:
111
+
112
+ ```json
113
+ {
114
+ "schemaVersion": 1,
115
+ "protocolVersion": 1,
116
+ "taskId": "task-contact-form-001",
117
+ "objective": "Add a validated contact form with unit and visual tests",
118
+ "assumptions": [
119
+ {
120
+ "value": "Form submits via fetch POST to /api/contact",
121
+ "reason": "Backend endpoint already supports JSON payload",
122
+ "scope": "contact-form",
123
+ "reversible": true,
124
+ "source": "agent-default"
125
+ }
126
+ ],
127
+ "deliverables": [
128
+ "src/components/ContactForm.jsx",
129
+ "tests/contact-form.test.js"
130
+ ],
131
+ "constraints": [
132
+ "No external form libraries",
133
+ "WCAG AA contrast compliant"
134
+ ],
135
+ "risks": [
136
+ "untrusted-input"
137
+ ],
138
+ "verification": [
139
+ { "id": "unit-tests", "text": "npm test passes for contact form", "type": "VERIFICATION" },
140
+ { "id": "lint", "text": "npm run lint passes", "type": "VERIFICATION" }
141
+ ],
142
+ "successCriteria": [
143
+ "Form validates required fields client-side",
144
+ "All unit tests pass"
145
+ ],
146
+ "stopConditions": [
147
+ "Unresolved API specification change required"
148
+ ],
149
+ "unresolvedDecisions": [],
150
+ "sourceRefs": []
151
+ }
152
+ ```
153
+
154
+ ---
155
+
156
+ ### Step 2 — Route Guides Deterministically
157
+
158
+ Ask ForgeLoop which engineering guides apply to your work:
159
+
160
+ ```bash
161
+ forgeloop route \
162
+ --task task-contact-form-001 \
163
+ --work complete-website \
164
+ --surface ui \
165
+ --surface forms \
166
+ --risk untrusted-input \
167
+ --json
168
+ ```
169
+
170
+ This writes `.forgeloop/task-state/<taskKey>/routing-result.json` referencing selected guides (e.g. `clean`, `test`, `security`, `design`, `accessibility`).
171
+
172
+ ---
173
+
174
+ ### Step 3 — Run Preflight
175
+
176
+ Before writing code, validate readiness and establish the canonical resumable work state:
177
+
178
+ ```bash
179
+ forgeloop preflight --task task-contact-form-001 --json
180
+ ```
181
+
182
+ Output:
183
+
184
+ ```json
185
+ {
186
+ "status": "READY",
187
+ "taskId": "task-contact-form-001",
188
+ "errors": []
189
+ }
190
+ ```
191
+
192
+ When preflight returns `READY`, ForgeLoop synchronizes resumable work state (`.forgeloop/task-state/<taskKey>/work-state.json`) and preflight status (`.forgeloop/task-state/<taskKey>/preflight.json`). If preflight reports `BLOCKED`, inspect the required gates in the output and satisfy them first.
193
+
194
+ ---
195
+
196
+ ### Step 4 — Activate Session and Plan
197
+
198
+ Create a session activation marker and transition to `PLANNED`:
199
+
200
+ ```bash
201
+ forgeloop activate --task task-contact-form-001
202
+ forgeloop advance --task task-contact-form-001 --to PLANNED
203
+ ```
204
+
205
+ ---
206
+
207
+ ### Step 5 — Implement
208
+
209
+ Advance to `EXECUTING` and make your code changes:
210
+
211
+ ```bash
212
+ forgeloop advance --task task-contact-form-001 --to EXECUTING
213
+ ```
214
+
215
+ Implement your components, styles, and test files according to the activated guides.
216
+
217
+ ---
218
+
219
+ ### Step 6 — Verify with Observed Evidence
220
+
221
+ Advance to `VERIFYING` and prepare completion receipt:
222
+
223
+ ```bash
224
+ forgeloop advance --task task-contact-form-001 --to VERIFYING
225
+ forgeloop prepare-completion --task task-contact-form-001 --json
226
+ ```
227
+
228
+ Execute your verification checks through ForgeLoop so provenance is recorded:
229
+
230
+ ```bash
231
+ # Run unit tests and record evidence
232
+ forgeloop run-check --task task-contact-form-001 --id unit-tests --requirement "npm test passes for contact form" -- npm test
233
+
234
+ # Run linter and record evidence
235
+ forgeloop run-check --task task-contact-form-001 --id lint --requirement "npm run lint passes" -- npm run lint
236
+ ```
237
+
238
+ If a check fails:
239
+
240
+ 1. Do not repeat the failed check blindly.
241
+ 2. Formulate a diagnostic hypothesis.
242
+ 3. Apply the correction.
243
+ 4. Re-run `forgeloop run-check`.
244
+
245
+ ---
246
+
247
+ ### Step 7 — Review Evidence
248
+
249
+ Advance to `REVIEWING` and perform a read-only audit:
250
+
251
+ ```bash
252
+ forgeloop advance --task task-contact-form-001 --to REVIEWING
253
+ forgeloop audit --task task-contact-form-001 --json
254
+ ```
255
+
256
+ Output checks contract coverage, ledger integrity, and fingerprint freshness.
257
+
258
+ ---
259
+
260
+ ### Step 8 — Validate Completion
261
+
262
+ Run `forgeloop complete` to validate completion:
263
+
264
+ ```bash
265
+ forgeloop complete --task task-contact-form-001 --json
266
+ ```
267
+
268
+ Output:
269
+
270
+ ```json
271
+ {
272
+ "status": "VALID",
273
+ "taskStatus": "COMPLETE",
274
+ "verificationStatus": "valid"
275
+ }
276
+ ```
277
+
278
+ Finally, query ForgeLoop for the next action:
279
+
280
+ ```bash
281
+ forgeloop next --task task-contact-form-001 --json
282
+ ```
283
+
284
+ When `terminal: true` and `nextAction: "NONE"` are returned, your task is protocol-verified as complete.
285
+
286
+ ---
287
+
288
+ ## 5. Multi-Task Concurrency
289
+
290
+ ForgeLoop supports multiple parallel tasks in the same project without collision:
291
+
292
+ ```bash
293
+ # Create an isolated task with explicit write claims
294
+ forgeloop task-create --task auth-feature --claim src/auth --claim tests/auth --json
295
+
296
+ # Run all commands against that specific task
297
+ forgeloop route --task auth-feature --work clean-code --surface backend
298
+ forgeloop preflight --task auth-feature --json
299
+ forgeloop advance --task auth-feature --to EXECUTING
300
+ forgeloop complete --task auth-feature --json
301
+
302
+ # Inspect active tasks
303
+ forgeloop task-list --json
304
+ ```
305
+
306
+ ---
307
+
308
+ ## 6. What ForgeLoop Creates
309
+
310
+ Under `.forgeloop/task-state/<taskKey>/`:
311
+
312
+ - `task.json`: task descriptor and write claims;
313
+ - `contract.json`: task intent, deliverables, and success criteria;
314
+ - `routing-result.json`: deterministic guide selections;
315
+ - `preflight.json`: pre-implementation authorization checkpoint;
316
+ - `work-state.json`: lifecycle phase and resumption checkpoint;
317
+ - `events.ndjson`: hash-chained append-only event ledger;
318
+ - `executions/*.json`: provenance records for executed verification commands;
319
+ - `execution-receipt.json`: completion evidence and coverage mapping.
320
+
321
+ Shared repository artifacts (`sources.json`, `config.json`) remain at `.forgeloop/`.
322
+
323
+ ---
324
+
325
+ ## 7. Migrating ForgeLoop 1.0 Singleton State
326
+
327
+ <!-- BEGIN FORGELOOP LEGACY LAYOUT EXAMPLE -->
328
+
329
+ Legacy ForgeLoop 1.0 releases stored task artifacts directly under `.forgeloop/`, including `.forgeloop/current-contract.json`, `.forgeloop/work-state.json`, `.forgeloop/routing-result.json`, `.forgeloop/preflight.json`, `.forgeloop/execution-receipt.json`, `.forgeloop/events.ndjson`, `.forgeloop/gates/`, and `.forgeloop/executions/`.
330
+
331
+ <!-- END FORGELOOP LEGACY LAYOUT EXAMPLE -->
332
+
333
+ To safely migrate legacy singleton state into the modern namespaced layout:
334
+
335
+ ```bash
336
+ forgeloop task-migrate --dry-run --json
337
+ forgeloop task-migrate --json
338
+ ```
339
+
340
+ ---
341
+
342
+ ## 8. Next Steps
343
+
344
+ - Continue a task across different AI harnesses: [`docs/CROSS_HARNESS_CONTINUITY.md`](./CROSS_HARNESS_CONTINUITY.md)
345
+ - Complete command reference: [`docs/CLI_REFERENCE.md`](./CLI_REFERENCE.md)
346
+ - Artifact and schema reference: [`docs/ARTIFACT_REFERENCE.md`](./ARTIFACT_REFERENCE.md)
347
+ - Common symptoms and recovery: [`docs/TROUBLESHOOTING.md`](./TROUBLESHOOTING.md)
348
+ - Real-world operational recipes: [`docs/RECIPES.md`](./RECIPES.md)
@@ -0,0 +1,250 @@
1
+ # ForgeLoop Operational Recipes
2
+
3
+ Concise, copy-paste friendly recipes for common ForgeLoop tasks.
4
+
5
+ ---
6
+
7
+ ## Recipe Index
8
+
9
+ 1. [Start a New Task](#recipe-1--start-a-new-task)
10
+ 2. [Resume an Active Task in a New Session](#recipe-2--resume-an-active-task-in-a-new-session)
11
+ 3. [Switch to Another AI Harness or IDE](#recipe-3--switch-to-another-ai-harness-or-ide)
12
+ 4. [Recover and Continue After a Failed Test](#recipe-4--recover-and-continue-after-a-failed-test)
13
+ 5. [Record Manual Review Evidence](#recipe-5--record-manual-review-evidence)
14
+ 6. [Run Automated Checks with Attested Provenance](#recipe-6--run-automated-checks-with-attested-provenance)
15
+ 7. [Fix Stale State or Stale Receipt](#recipe-7--fix-stale-state-or-stale-receipt)
16
+ 8. [Inspect Why Completion is Blocked](#recipe-8--inspect-why-completion-is-blocked)
17
+ 9. [Export a Portable Task Bundle](#recipe-9--export-a-portable-task-bundle)
18
+ 10. [Final Verification Before Pull Request](#recipe-10--final-verification-before-pull-request)
19
+ 11. [Run Multi-Task Workflows Concurrently](#recipe-11--run-multi-task-workflows-concurrently)
20
+ 12. [Migrate Legacy 1.0 Single-Task Layout](#recipe-12--migrate-legacy-10-single-task-layout)
21
+
22
+ ---
23
+
24
+ ### Recipe 1 — Start a New Task
25
+
26
+ ```bash
27
+ # 1. Create a task with explicit claims
28
+ forgeloop task-create --task task-001 --claim src --claim tests --json
29
+
30
+ # 2. Discover task state path and author contract under .forgeloop/task-state/<taskKey>/contract.json
31
+ forgeloop task-show --task task-001 --json
32
+
33
+ # 3. Route engineering guides
34
+ forgeloop route --task task-001 --work code --surface api --risk untrusted-input --json
35
+
36
+ # 4. Verify preflight
37
+ forgeloop preflight --task task-001 --json
38
+
39
+ # 5. Activate session and plan
40
+ forgeloop activate --task task-001
41
+ forgeloop advance --task task-001 --to PLANNED
42
+ forgeloop advance --task task-001 --to EXECUTING
43
+ ```
44
+
45
+ ---
46
+
47
+ ### Recipe 2 — Resume an Active Task in a New Session
48
+
49
+ ```bash
50
+ export FORGELOOP_TASK="task-001"
51
+
52
+ # 1. Discover task state
53
+ forgeloop status --json
54
+
55
+ # 2. Reconcile continuity notes
56
+ forgeloop reconcile-continuity --json
57
+
58
+ # 3. Check modified files
59
+ forgeloop inspect --json
60
+
61
+ # 4. Get next action from ForgeLoop
62
+ forgeloop next --json
63
+ ```
64
+
65
+ ---
66
+
67
+ ### Recipe 3 — Switch to Another AI Harness or IDE
68
+
69
+ In Harness A (before stopping):
70
+
71
+ ```bash
72
+ forgeloop record-continuity \
73
+ --task task-001 \
74
+ --focus-id api-endpoints \
75
+ --focus-summary "Finished GET /users, working on POST /users" \
76
+ --remaining "tests:Add validation test for POST /users" \
77
+ --inspect-first src/api/users.js \
78
+ --resume-note "Endpoint logic is in src/api/users.js. Next step is validation."
79
+ ```
80
+
81
+ In Harness B (after starting):
82
+
83
+ ```bash
84
+ forgeloop status --task task-001 --json
85
+ forgeloop continuity --task task-001 --json
86
+ forgeloop reconcile-continuity --task task-001 --json
87
+ forgeloop next --task task-001 --json
88
+ ```
89
+
90
+ ---
91
+
92
+ ### Recipe 4 — Recover and Continue After a Failed Test
93
+
94
+ ```bash
95
+ export FORGELOOP_TASK="task-001"
96
+
97
+ # 1. Test failed in run-check
98
+ forgeloop run-check --id unit-tests --requirement "All tests pass" -- npm test
99
+ # Output: status = failed
100
+
101
+ # 2. Query next action (directs to DIAGNOSE)
102
+ forgeloop next --json
103
+
104
+ # 3. Formulate diagnosis and apply code fix in checkout
105
+
106
+ # 4. Re-run verification check
107
+ forgeloop run-check --id unit-tests --requirement "All tests pass" -- npm test
108
+
109
+ # 5. Check audit
110
+ forgeloop audit --json
111
+ ```
112
+
113
+ ---
114
+
115
+ ### Recipe 5 — Record Manual Review Evidence
116
+
117
+ ```bash
118
+ # For non-automated criteria (design review, UX inspection, security review)
119
+ forgeloop record-check \
120
+ --task task-001 \
121
+ --id manual-contrast-review \
122
+ --requirement "WCAG AA contrast compliant" \
123
+ --status passed \
124
+ --kind manual-review \
125
+ --evidence-kind OBSERVED \
126
+ --result "Manually tested light and dark modes; text contrast >= 4.5:1."
127
+ ```
128
+
129
+ ---
130
+
131
+ ### Recipe 6 — Run Automated Checks with Attested Provenance
132
+
133
+ ```bash
134
+ export FORGELOOP_TASK="task-001"
135
+
136
+ # Prepare receipt slots in VERIFYING phase
137
+ forgeloop advance --to VERIFYING
138
+ forgeloop prepare-completion --json
139
+
140
+ # Run checks via forgeloop to record cryptographic execution provenance
141
+ forgeloop run-check --id unit-tests --requirement "Unit tests" -- npm test
142
+ forgeloop run-check --id linter --requirement "Linting" -- npm run lint
143
+ forgeloop run-check --id typecheck --requirement "Typecheck" -- npm run typecheck
144
+ ```
145
+
146
+ ---
147
+
148
+ ### Recipe 7 — Fix Stale State or Stale Receipt
149
+
150
+ ```bash
151
+ export FORGELOOP_TASK="task-001"
152
+
153
+ # If contract or files were modified out of band:
154
+ forgeloop route --work clean-code --json
155
+ forgeloop preflight --json
156
+ forgeloop prepare-completion --json
157
+ forgeloop validate-protocol --json
158
+ ```
159
+
160
+ ---
161
+
162
+ ### Recipe 8 — Inspect Why Completion is Blocked
163
+
164
+ ```bash
165
+ # Run read-only audit to inspect unsatisfied coverage
166
+ forgeloop audit --task task-001 --json
167
+
168
+ # Inspect protocol next guidance
169
+ forgeloop next --task task-001 --json
170
+ ```
171
+
172
+ ---
173
+
174
+ ### Recipe 9 — Export a Portable Task Bundle
175
+
176
+ ```bash
177
+ # Bundles contract, route, state, receipt, executions, and ledger into a single archive
178
+ forgeloop bundle --task task-001 --json
179
+ ```
180
+
181
+ ---
182
+
183
+ ### Recipe 10 — Final Verification Before Pull Request
184
+
185
+ ```bash
186
+ export FORGELOOP_TASK="task-001"
187
+
188
+ # 1. Ensure all checks passed in VERIFYING
189
+ # 2. Advance to REVIEWING
190
+ forgeloop advance --to REVIEWING
191
+
192
+ # 3. Run audit
193
+ forgeloop audit --json
194
+
195
+ # 4. Authorize completion
196
+ forgeloop complete --json
197
+
198
+ # 5. Confirm terminal state
199
+ forgeloop next --json
200
+ # Expected: "terminal": true, "nextAction": "NONE"
201
+ ```
202
+
203
+ ---
204
+
205
+ ### Recipe 11 — Run Multi-Task Workflows Concurrently
206
+
207
+ ```bash
208
+ # 1. Create task-1 claiming auth directory
209
+ forgeloop task-create --task auth-feature --claim src/auth --claim tests/auth --json
210
+
211
+ # 2. Create task-2 claiming billing directory
212
+ forgeloop task-create --task billing-feature --claim src/billing --claim tests/billing --json
213
+
214
+ # 3. List active tasks
215
+ forgeloop task-list --json
216
+
217
+ # 4. Work on task-1
218
+ forgeloop route --task auth-feature --work clean-code --surface backend
219
+ forgeloop preflight --task auth-feature --json
220
+ forgeloop advance --task auth-feature --to EXECUTING
221
+ forgeloop advance --task auth-feature --to VERIFYING
222
+ forgeloop run-check --task auth-feature --id auth-tests --requirement tests -- npm test -- tests/auth
223
+ forgeloop advance --task auth-feature --to REVIEWING
224
+ forgeloop complete --task auth-feature --json
225
+
226
+ # 5. Release any dead locks if needed
227
+ forgeloop task-unlock --task auth-feature --force --json
228
+ ```
229
+
230
+ ---
231
+
232
+ ### Recipe 12 — Migrate Legacy 1.0 Single-Task Layout
233
+
234
+ <!-- BEGIN FORGELOOP LEGACY LAYOUT EXAMPLE -->
235
+
236
+ Legacy ForgeLoop 1.0 projects stored mutable artifacts directly under `.forgeloop/` (e.g. `.forgeloop/current-contract.json`, `.forgeloop/work-state.json`, `.forgeloop/gates/`, `.forgeloop/executions/`).
237
+
238
+ <!-- END FORGELOOP LEGACY LAYOUT EXAMPLE -->
239
+
240
+ ```bash
241
+ # 1. Perform dry-run migration check
242
+ forgeloop task-migrate --dry-run --json
243
+
244
+ # 2. Execute migration to .forgeloop/task-state/<taskKey>/
245
+ forgeloop task-migrate --json
246
+
247
+ # 3. Verify migrated task state
248
+ forgeloop task-list --json
249
+ forgeloop status --json
250
+ ```