@cassiomc1/forgeloop 1.6.3 → 1.6.4

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 (127) hide show
  1. package/DOCS_INDEX.md +26 -4
  2. package/EXECUTION_STATE.md +7 -0
  3. package/LOOP_ENGINEERING.md +58 -0
  4. package/LOOP_SYSTEM_DESIGN.md +54 -0
  5. package/ORCHESTRATOR_INTEGRATION.md +23 -0
  6. package/PROTOCOL_INTEGRATION.md +36 -0
  7. package/QUALITY_SCORECARD.md +21 -0
  8. package/README.md +55 -0
  9. package/TERMINOLOGY.md +11 -0
  10. package/THREAT_MODEL.md +7 -0
  11. package/completions/_forgeloop +85 -0
  12. package/completions/forgeloop.bash +173 -0
  13. package/completions/forgeloop.fish +544 -0
  14. package/docs/AGENT_PROTOCOL_SUMMARY.md +281 -0
  15. package/docs/ARTIFACT_REFERENCE.md +226 -0
  16. package/docs/CLI_REFERENCE.md +308 -2
  17. package/docs/CODE_ATTESTATION.md +141 -0
  18. package/docs/CROSS_HARNESS_CONTINUITY.md +22 -2
  19. package/docs/DOCUMENTATION_GUIDE.md +13 -11
  20. package/docs/GETTING_STARTED.md +98 -1
  21. package/docs/MCP.md +8 -0
  22. package/docs/PLATFORM_ADAPTERS.md +69 -0
  23. package/docs/RECIPES.md +138 -0
  24. package/docs/RELEASE_CHECKLIST.md +54 -0
  25. package/docs/REVISION_PROVIDERS.md +136 -0
  26. package/docs/SIGNING_PROVIDERS.md +83 -0
  27. package/docs/TROUBLESHOOTING.md +184 -0
  28. package/docs/UNIVERSAL_INTEGRATION.md +11 -0
  29. package/docs/assets/diagrams/forgeloop-code-attestation-flow.html +13841 -0
  30. package/docs/assets/diagrams/forgeloop-code-attestation-flow.receipt.json +37 -0
  31. package/docs/assets/diagrams/forgeloop-code-attestation-flow.svg +5046 -0
  32. package/docs/assets/diagrams/forgeloop-engineering-flow.html +46 -43
  33. package/docs/assets/diagrams/forgeloop-engineering-flow.receipt.json +6 -6
  34. package/docs/assets/diagrams/forgeloop-engineering-flow.svg +41 -41
  35. package/docs/assets/diagrams/forgeloop-verification-trust-flow.html +13783 -0
  36. package/docs/assets/diagrams/forgeloop-verification-trust-flow.receipt.json +37 -0
  37. package/docs/assets/diagrams/forgeloop-verification-trust-flow.svg +4988 -0
  38. package/docs/diagrams/README.md +30 -22
  39. package/docs/diagrams/forgeloop-code-attestation-flow.workflow.json +125 -0
  40. package/docs/diagrams/forgeloop-engineering-flow.workflow.json +11 -8
  41. package/docs/diagrams/forgeloop-verification-trust-flow.workflow.json +116 -0
  42. package/docs/diagrams/manifest.json +42 -0
  43. package/docs/diagrams/reviews/forgeloop-code-attestation-flow.review.json +20 -0
  44. package/docs/diagrams/reviews/forgeloop-engineering-flow.review.json +3 -3
  45. package/docs/diagrams/reviews/forgeloop-verification-trust-flow.review.json +20 -0
  46. package/integrations/generic-ci/verify.sh +14 -0
  47. package/package.json +31 -9
  48. package/schemas/attestation-verification-result.schema.json +34 -0
  49. package/schemas/code-attestation.schema.json +61 -0
  50. package/schemas/code-manifest.schema.json +57 -0
  51. package/schemas/config.schema.json +57 -1
  52. package/schemas/handoff-envelope.schema.json +57 -0
  53. package/schemas/in-toto-statement.schema.json +32 -0
  54. package/schemas/responsibility.schema.json +37 -0
  55. package/schemas/verification-scope.schema.json +26 -0
  56. package/schemas/workspace-binding.schema.json +20 -0
  57. package/scripts/CI_VALIDATORS.md +3 -0
  58. package/scripts/benchmark-cli-startup.mjs +60 -0
  59. package/scripts/check-changelog-freshness.mjs +88 -0
  60. package/scripts/check-critical-coverage.mjs +58 -0
  61. package/scripts/generate-agent-protocol-summary.mjs +141 -0
  62. package/scripts/generate-shell-completions.mjs +132 -0
  63. package/scripts/write-forgeloop-attestation-summary.mjs +93 -0
  64. package/src/cli.js +114 -6
  65. package/src/commands/attestation-create.js +30 -0
  66. package/src/commands/attestation-status.js +12 -0
  67. package/src/commands/attestation-verify-range.js +32 -0
  68. package/src/commands/attestation-verify.js +23 -0
  69. package/src/commands/handoff-create.js +9 -0
  70. package/src/commands/handoff-list.js +12 -0
  71. package/src/commands/handoff-show.js +10 -0
  72. package/src/commands/responsibility-set.js +20 -0
  73. package/src/commands/responsibility-status.js +12 -0
  74. package/src/commands/run-check.js +43 -3
  75. package/src/commands/task-repair-legacy-recovery.js +1 -2
  76. package/src/commands/verify-scope.js +9 -0
  77. package/src/commands/workspace-bind.js +17 -0
  78. package/src/commands/workspace-status.js +19 -0
  79. package/src/core/artifact-registry.js +84 -0
  80. package/src/core/attestation-coverage.js +134 -0
  81. package/src/core/attestation-verifier.js +227 -0
  82. package/src/core/attestation.js +263 -0
  83. package/src/core/audit.js +67 -1
  84. package/src/core/bundles.js +210 -9
  85. package/src/core/cli-command-definitions.js +196 -0
  86. package/src/core/code-manifest.js +293 -0
  87. package/src/core/command-executors.js +79 -0
  88. package/src/core/command-input.js +69 -18
  89. package/src/core/command-runtime.js +2 -1
  90. package/src/core/completion.js +170 -8
  91. package/src/core/config.js +60 -2
  92. package/src/core/continuity-cli-options.js +9 -3
  93. package/src/core/continuity-reconciliation.js +20 -0
  94. package/src/core/diagnostic-projection.js +3 -1
  95. package/src/core/error-codes.js +146 -0
  96. package/src/core/events.js +109 -13
  97. package/src/core/exit-codes.js +22 -0
  98. package/src/core/handoff.js +208 -0
  99. package/src/core/information-gain-projection.js +3 -3
  100. package/src/core/integration-invocation-policy.js +40 -0
  101. package/src/core/integration-resources.js +54 -0
  102. package/src/core/next-action-phases.js +968 -0
  103. package/src/core/next-action.js +32 -951
  104. package/src/core/phase.js +29 -1
  105. package/src/core/protocol-info.js +41 -1
  106. package/src/core/repository.js +256 -11
  107. package/src/core/responsibility.js +265 -0
  108. package/src/core/revision/git.js +207 -0
  109. package/src/core/revision/provider.js +90 -0
  110. package/src/core/revision/registry.js +5 -0
  111. package/src/core/route-artifact.js +1 -1
  112. package/src/core/schema-validation.js +8 -0
  113. package/src/core/signing/none.js +23 -0
  114. package/src/core/signing/provider.js +21 -0
  115. package/src/core/signing/registry.js +7 -0
  116. package/src/core/signing/sigstore.js +158 -0
  117. package/src/core/task-command.js +9 -1
  118. package/src/core/task-paths.js +72 -0
  119. package/src/core/templates.js +8 -0
  120. package/src/core/verification-scope-capability.js +179 -0
  121. package/src/core/verification-scope.js +271 -0
  122. package/src/core/workspace-binding.js +211 -0
  123. package/src/integration.d.ts +91 -0
  124. package/AGENT_COMPATIBILITY.md +0 -11
  125. package/docs/RELEASE_CHECKLIST_1_4.md +0 -38
  126. package/docs/RELEASE_CHECKLIST_1_5_MCP.md +0 -78
  127. package/docs/RELEASE_CHECKLIST_1_6_1.md +0 -121
@@ -42,10 +42,13 @@ ForgeLoop uses a definition-driven command-line parser:
42
42
  | **Inspection & Diagnostics** | [`protocol-info`](#protocol-info), [`doctor`](#doctor), [`metrics`](#metrics), [`eval`](#eval), [`history`](#history), [`trace`](#trace), [`reflect`](#reflect), [`progress`](#progress), [`profile-interview`](#profile-interview), [`inspect`](#inspect), [`status`](#status), [`validate-state`](#validate-state), [`validate-protocol`](#validate-protocol) |
43
43
  | **Setup & Maintenance** | [`init`](#init), [`update`](#update), [`task-migrate`](#task-migrate), [`migrate-protocol`](#migrate-protocol), [`task-unlock`](#task-unlock), [`task-recover`](#task-recover), [`task-repair-legacy-recovery`](#task-repair-legacy-recovery), [`task-resume`](#task-resume) |
44
44
  | **Lifecycle & State** | [`activate`](#activate), [`route`](#route), [`preflight`](#preflight), [`advance`](#advance), [`next`](#next), [`record-diagnosis`](#record-diagnosis), [`record-intervention`](#record-intervention), [`record-hypothesis-disposition`](#record-hypothesis-disposition), [`record-decision-criterion`](#record-decision-criterion), [`complete`](#complete), [`clear-state`](#clear-state), [`reconcile-closure`](#reconcile-closure), [`task-create`](#task-create), [`task-list`](#task-list), [`task-show`](#task-show), [`task-lock-status`](#task-lock-status), [`task-scope`](#task-scope) |
45
- | **Cross-Harness Continuity** | [`continuity`](#continuity), [`record-continuity`](#record-continuity), [`reconcile-continuity`](#reconcile-continuity), [`clear-continuity`](#clear-continuity) |
46
- | **Verification & Completion** | [`prepare-completion`](#prepare-completion), [`run-check`](#run-check), [`record-check`](#record-check), [`record-terminal-result`](#record-terminal-result), [`audit`](#audit), [`report`](#report), [`validate-receipt`](#validate-receipt) |
45
+ | **Cross-Harness Continuity** | [`continuity`](#continuity), [`record-continuity`](#record-continuity), [`reconcile-continuity`](#reconcile-continuity), [`clear-continuity`](#clear-continuity), [`handoff-create`](#handoff-create), [`handoff-list`](#handoff-list), [`handoff-show`](#handoff-show) |
46
+ | **Verification & Completion** | [`prepare-completion`](#prepare-completion), [`run-check`](#run-check), [`record-check`](#record-check), [`record-terminal-result`](#record-terminal-result), [`audit`](#audit), [`report`](#report), [`validate-receipt`](#validate-receipt), [`verify-scope`](#verify-scope) |
47
47
  | **Durable Actions & Approvals** | [`run-action`](#run-action), [`action-propose`](#action-propose), [`action-record`](#action-record), [`action-show`](#action-show), [`action-reconcile`](#action-reconcile), [`action-verify`](#action-verify), [`action-authorize`](#action-authorize), [`approval-request`](#approval-request), [`approval-resolve`](#approval-resolve) |
48
48
  | **Policy & Auditing** | [`policy`](#policy), [`policy-discover`](#policy-discover), [`policy-status`](#policy-status), [`policy-diff`](#policy-diff), [`rule-verify`](#rule-verify), [`baseline`](#baseline), [`bundle`](#bundle) |
49
+ | **workspace** | [`workspace-bind`](#workspace-bind), [`workspace-status`](#workspace-status) |
50
+ | **scope** | [`responsibility-set`](#responsibility-set), [`responsibility-status`](#responsibility-status) |
51
+ | **attestation** | [`attestation-create`](#attestation-create), [`attestation-verify`](#attestation-verify), [`attestation-status`](#attestation-status), [`attestation-verify-range`](#attestation-verify-range) |
49
52
 
50
53
  <!-- END FORGELOOP GENERATED: cli-command-index -->
51
54
 
@@ -53,6 +56,308 @@ ForgeLoop uses a definition-driven command-line parser:
53
56
 
54
57
  ## 1. Setup & Maintenance
55
58
 
59
+ ## Workspace, Handoff, Responsibility, Scope, and Attestation
60
+
61
+ These commands add optional, task-scoped protocol artifacts. They do not turn
62
+ ForgeLoop into an agent runtime, scheduler, delegation service, SCM authority,
63
+ or signing authority.
64
+
65
+ ### `workspace-bind`
66
+
67
+ Binds the selected task to the current Git worktree identity. Rebinding is
68
+ never implicit.
69
+
70
+ - **Purpose**: Persist an immutable repository/worktree identity binding for the task.
71
+ - **Mutation**: Writes the workspace binding and appends a `WORKSPACE_BOUND` event.
72
+ - **Options**:
73
+
74
+ <!-- BEGIN FORGELOOP GENERATED: cli:workspace-bind:options -->
75
+
76
+ - `--path <directory>`: target project directory (default: current directory)
77
+ - `--task <id>`: task ID to operate on (when omitted, resolved from context or single active task)
78
+ - `--json`: emit binding result as JSON
79
+
80
+ <!-- END FORGELOOP GENERATED: cli:workspace-bind:options -->
81
+
82
+ - **Example**:
83
+
84
+ ```bash
85
+ forgeloop workspace-bind --task task-001 --json
86
+ ```
87
+
88
+ ### `workspace-status`
89
+
90
+ Reports whether the current Git worktree matches the selected task binding.
91
+
92
+ - **Purpose**: Inspect workspace binding status without changing task state.
93
+ - **Mutation**: Read-only.
94
+ - **Options**:
95
+
96
+ <!-- BEGIN FORGELOOP GENERATED: cli:workspace-status:options -->
97
+
98
+ - `--path <directory>`: target project directory (default: current directory)
99
+ - `--task <id>`: task ID to operate on (when omitted, resolved from context or single active task)
100
+ - `--json`: emit workspace status as JSON
101
+
102
+ <!-- END FORGELOOP GENERATED: cli:workspace-status:options -->
103
+
104
+ - **Example**:
105
+
106
+ ```bash
107
+ forgeloop workspace-status --task task-001 --json
108
+ ```
109
+
110
+ ### `handoff-create`
111
+
112
+ Creates an immutable snapshot of current task state for cross-harness
113
+ continuity. It does not delegate work or create a review assignment.
114
+
115
+ - **Purpose**: Capture protocol-derived state, evidence, paths, and continuity with optional recipient intent.
116
+ - **Mutation**: Writes an immutable handoff artifact and appends a `HANDOFF_CREATED` event.
117
+ - **Options**:
118
+
119
+ <!-- BEGIN FORGELOOP GENERATED: cli:handoff-create:options -->
120
+
121
+ - `--path <directory>`: target project directory (default: current directory)
122
+ - `--task <id>`: task ID to operate on (when omitted, resolved from context or single active task)
123
+ - `--recipient <hint>`: non-authoritative recipient hint
124
+ - `--note <text>`: non-authoritative handoff note
125
+ - `--json`: emit handoff as JSON
126
+
127
+ <!-- END FORGELOOP GENERATED: cli:handoff-create:options -->
128
+
129
+ - **Example**:
130
+
131
+ ```bash
132
+ forgeloop handoff-create --task task-001 --recipient next-harness --note "Continue verification" --json
133
+ ```
134
+
135
+ ### `handoff-list`
136
+
137
+ Lists immutable handoff snapshots for a task.
138
+
139
+ - **Purpose**: Inspect existing handoff snapshots without changing them.
140
+ - **Mutation**: Read-only.
141
+ - **Options**:
142
+
143
+ <!-- BEGIN FORGELOOP GENERATED: cli:handoff-list:options -->
144
+
145
+ - `--path <directory>`: target project directory (default: current directory)
146
+ - `--task <id>`: task ID to operate on (when omitted, resolved from context or single active task)
147
+ - `--json`: emit handoff list as JSON
148
+
149
+ <!-- END FORGELOOP GENERATED: cli:handoff-list:options -->
150
+
151
+ - **Example**:
152
+
153
+ ```bash
154
+ forgeloop handoff-list --task task-001 --json
155
+ ```
156
+
157
+ ### `handoff-show`
158
+
159
+ Reads and verifies one immutable handoff snapshot.
160
+
161
+ - **Purpose**: Inspect one handoff by ID and validate its digest and bindings.
162
+ - **Mutation**: Read-only.
163
+ - **Options**:
164
+
165
+ <!-- BEGIN FORGELOOP GENERATED: cli:handoff-show:options -->
166
+
167
+ - `--path <directory>`: target project directory (default: current directory)
168
+ - `--task <id>`: task ID to operate on (when omitted, resolved from context or single active task)
169
+ - `--id <id>`: handoff identifier
170
+ - `--json`: emit handoff as JSON
171
+
172
+ <!-- END FORGELOOP GENERATED: cli:handoff-show:options -->
173
+
174
+ - **Example**:
175
+
176
+ ```bash
177
+ forgeloop handoff-show --task task-001 --id handoff-001 --json
178
+ ```
179
+
180
+ ### `responsibility-set`
181
+
182
+ Creates immutable constraints for the current task pass.
183
+
184
+ - **Purpose**: Freeze allowed paths, read-only paths, input fingerprints, and required checks.
185
+ - **Mutation**: Writes responsibility constraints and appends a `RESPONSIBILITY_SET` event.
186
+ - **Options**:
187
+
188
+ <!-- BEGIN FORGELOOP GENERATED: cli:responsibility-set:options -->
189
+
190
+ - `--path <directory>`: target project directory (default: current directory)
191
+ - `--task <id>`: task ID to operate on (when omitted, resolved from context or single active task)
192
+ - `--label <label>`: descriptive pass label; not an identity or role
193
+ - `--allowed-path <path>`: path prefix allowed during this pass (repeatable)
194
+ - `--read-only-path <path>`: path prefix that must not change during this pass (repeatable)
195
+ - `--required-check <id>`: current-cycle check required by this pass (repeatable)
196
+ - `--freeze-contract`: freeze the current contract fingerprint
197
+ - `--freeze-route`: freeze the current route fingerprint
198
+ - `--freeze-claims`: freeze the current effective claims fingerprint
199
+ - `--json`: emit responsibility result as JSON
200
+
201
+ <!-- END FORGELOOP GENERATED: cli:responsibility-set:options -->
202
+
203
+ - **Example**:
204
+
205
+ ```bash
206
+ forgeloop responsibility-set --task task-001 --label implementation --allowed-path src --required-check unit-tests --json
207
+ ```
208
+
209
+ ### `responsibility-status`
210
+
211
+ Validates active responsibility constraints against current paths, inputs, and
212
+ checks.
213
+
214
+ - **Purpose**: Inspect whether the current task pass remains within its immutable responsibility boundary.
215
+ - **Mutation**: Read-only.
216
+ - **Options**:
217
+
218
+ <!-- BEGIN FORGELOOP GENERATED: cli:responsibility-status:options -->
219
+
220
+ - `--path <directory>`: target project directory (default: current directory)
221
+ - `--task <id>`: task ID to operate on (when omitted, resolved from context or single active task)
222
+ - `--json`: emit responsibility status as JSON
223
+
224
+ <!-- END FORGELOOP GENERATED: cli:responsibility-status:options -->
225
+
226
+ - **Example**:
227
+
228
+ ```bash
229
+ forgeloop responsibility-status --task task-001 --json
230
+ ```
231
+
232
+ ### `verify-scope`
233
+
234
+ Resolves a provable verification boundary without launching checks.
235
+
236
+ - **Purpose**: Persist exact changed, claimed, or full verification scope for the current cycle.
237
+ - **Mutation**: Writes a verification-scope artifact and appends a `VERIFICATION_SCOPE_CAPTURED` event.
238
+ - **Options**:
239
+
240
+ <!-- BEGIN FORGELOOP GENERATED: cli:verify-scope:options -->
241
+
242
+ - `--path <directory>`: target project directory (default: current directory)
243
+ - `--task <id>`: task ID to operate on (when omitted, resolved from context or single active task)
244
+ - `--mode <mode>`: requested deterministic verification boundary (default: AUTO)
245
+ - `--json`: emit verification scope as JSON
246
+
247
+ <!-- END FORGELOOP GENERATED: cli:verify-scope:options -->
248
+
249
+ - **Example**:
250
+
251
+ ```bash
252
+ forgeloop verify-scope --task task-001 --mode AUTO --json
253
+ ```
254
+
255
+ ### `attestation-create`
256
+
257
+ Creates a deterministic in-toto Statement after completion and manifest
258
+ validation.
259
+
260
+ - **Purpose**: Bind the final source-content manifest to valid completion and audit evidence.
261
+ - **Mutation**: Writes the immutable attestation statement and appends an `ATTESTATION_STATEMENT_CREATED` event.
262
+ - **Options**:
263
+
264
+ <!-- BEGIN FORGELOOP GENERATED: cli:attestation-create:options -->
265
+
266
+ - `--path <directory>`: target project directory (default: current directory)
267
+ - `--task <id>`: task ID to operate on (when omitted, resolved from context or single active task)
268
+ - `--json`: emit attestation statement result as JSON
269
+
270
+ <!-- END FORGELOOP GENERATED: cli:attestation-create:options -->
271
+
272
+ - **Example**:
273
+
274
+ ```bash
275
+ forgeloop attestation-create --task task-001 --json
276
+ ```
277
+
278
+ ### `attestation-verify`
279
+
280
+ Verifies a task attestation and current revision without mutating task state.
281
+
282
+ - **Purpose**: Check statement, manifest, evidence bindings, source bytes, and optional signing-provider policy.
283
+ - **Mutation**: Read-only.
284
+ - **Options**:
285
+
286
+ <!-- BEGIN FORGELOOP GENERATED: cli:attestation-verify:options -->
287
+
288
+ - `--path <directory>`: target project directory (default: current directory)
289
+ - `--task <id>`: task ID to operate on (when omitted, resolved from context or single active task)
290
+ - `--ref <revision>`: target revision to compare with the manifest
291
+ - `--bundle <path>`: optional external signature bundle
292
+ - `--identity <identity>`: optional exact signer identity policy
293
+ - `--issuer <issuer>`: optional exact signer issuer policy
294
+ - `--revision-provider <provider>`: revision provider (default: git)
295
+ - `--signing-provider <provider>`: signing provider (default: none)
296
+ - `--trusted-root <path>`: trusted signing root path
297
+ - `--require-signature`: require a valid external signature
298
+ - `--json`: emit verification result as JSON
299
+
300
+ <!-- END FORGELOOP GENERATED: cli:attestation-verify:options -->
301
+
302
+ - **Example**:
303
+
304
+ ```bash
305
+ forgeloop attestation-verify --task task-001 --json
306
+ ```
307
+
308
+ ### `attestation-status`
309
+
310
+ Reports local attestation status and trust level without network access.
311
+
312
+ - **Purpose**: Summarize the locally available manifest, statement, content, evidence, and signature state.
313
+ - **Mutation**: Read-only.
314
+ - **Options**:
315
+
316
+ <!-- BEGIN FORGELOOP GENERATED: cli:attestation-status:options -->
317
+
318
+ - `--path <directory>`: target project directory (default: current directory)
319
+ - `--task <id>`: task ID to operate on (when omitted, resolved from context or single active task)
320
+ - `--json`: emit attestation status as JSON
321
+
322
+ <!-- END FORGELOOP GENERATED: cli:attestation-status:options -->
323
+
324
+ - **Example**:
325
+
326
+ ```bash
327
+ forgeloop attestation-status --task task-001 --json
328
+ ```
329
+
330
+ ### `attestation-verify-range`
331
+
332
+ Verifies attestation coverage for an opaque revision range through the
333
+ provider-neutral revision contract.
334
+
335
+ - **Purpose**: Detect uncovered changed paths, conflicting attestations, stale content, and required signature failures.
336
+ - **Mutation**: Read-only.
337
+ - **Options**:
338
+
339
+ <!-- BEGIN FORGELOOP GENERATED: cli:attestation-verify-range:options -->
340
+
341
+ - `--path <directory>`: target project directory (default: current directory)
342
+ - `--revision-provider <provider>`: revision provider (default: git)
343
+ - `--base <revision>`: opaque base revision
344
+ - `--head <revision>`: opaque head revision
345
+ - `--require-complete-coverage`: fail when any changed source path lacks a valid attestation
346
+ - `--require-signature`: require a valid external signature for covered attestations
347
+ - `--signing-provider <provider>`: signing provider (default: none)
348
+ - `--identity <identity>`: optional exact signer identity policy
349
+ - `--issuer <issuer>`: optional exact signer issuer policy
350
+ - `--trusted-root <path>`: trusted signing root path
351
+ - `--json`: emit range verification result as JSON
352
+
353
+ <!-- END FORGELOOP GENERATED: cli:attestation-verify-range:options -->
354
+
355
+ - **Example**:
356
+
357
+ ```bash
358
+ forgeloop attestation-verify-range --base base-ref --head head-ref --require-complete-coverage --json
359
+ ```
360
+
56
361
  ## Durable Actions, Approvals, and Trajectory
57
362
 
58
363
  ForgeLoop is still a protocol/evidence layer, not an agent runtime. Use
@@ -590,6 +895,7 @@ Executes a verification command with ForgeLoop-attested provenance.
590
895
  - `--requirement <id>`: completion requirement covered by the check
591
896
  - `--details <json>`: additional structured check details
592
897
  - `--timeout-ms <number>`: maximum command duration before termination
898
+ - `--scope-ref <path>`: current verification-scope.json to bind to execution evidence
593
899
  - `-- <argv...>`: exact command argv to classify, execute, and attest
594
900
  - `--json`: emit structured output as JSON
595
901
 
@@ -0,0 +1,141 @@
1
+ # ForgeLoop Code Attestation
2
+
3
+ ForgeLoop code attestation binds an exact source-content snapshot to a valid
4
+ ForgeLoop completion and its referenced evidence chain. It does not claim who
5
+ authored the code, whether the code was generated by AI, or that the code is
6
+ bug-free or secure.
7
+
8
+ ## Trust levels
9
+
10
+ | Level | Meaning |
11
+ | --- | --- |
12
+ | `PROCESSED` | Protocol artifacts exist but verification is not complete. |
13
+ | `VERIFIED` | Completion, evidence bindings, manifest, and current content validate. |
14
+ | `ATTESTED` | `VERIFIED` plus a cryptographically valid signature and trusted signer policy. |
15
+
16
+ `PROCESSED` is an existence/parsing result, not a trust claim. A manifest or
17
+ statement that merely exists never becomes `ATTESTED`; the signature must be
18
+ verified against the configured signer identity, issuer, and trust policy.
19
+ Attestation binds bounded source/evidence relationships. It does not prove
20
+ authorship, AI or human origin, bug-free behavior, absolute security, or the
21
+ absence of defects outside the captured subject.
22
+
23
+ `code-manifest.json` is the ForgeLoop-generated source snapshot. It contains
24
+ one SHA-256 digest per changed source entry and a deterministic aggregate
25
+ `contentDigest`. Protocol metadata under `.forgeloop/**` is excluded from the
26
+ source subject and is bound separately through canonical ForgeLoop fingerprints.
27
+
28
+ The deterministic in-toto Statement v1 is written to `statement.json`:
29
+
30
+ ```text
31
+ .forgeloop/task-state/<taskKey>/attestations/
32
+ code-manifest.json
33
+ statement.json
34
+ statement.sigstore.json # optional external signature bundle
35
+ ```
36
+
37
+ The source subject excludes ForgeLoop protocol metadata under `.forgeloop/**`.
38
+ That metadata is bound separately through the task, receipt, route, contract,
39
+ state, and ledger fingerprints. Configured coverage exclusions must be
40
+ explicit and are still reported; an excluded path is not silently represented
41
+ as covered source content.
42
+
43
+ The [Code Attestation Chain](./assets/diagrams/forgeloop-code-attestation-flow.html)
44
+ is the interactive visual fallback for this sequence, with a
45
+ [self-contained SVG](./assets/diagrams/forgeloop-code-attestation-flow.svg).
46
+ It also shows why verification scope and attestation coverage are separate
47
+ questions.
48
+
49
+ Its canonical source is `docs/diagrams/forgeloop-code-attestation-flow.workflow.json`.
50
+
51
+ ## Completion flow
52
+
53
+ Configure attestation in `.forgeloop/config.json` when a project needs it:
54
+
55
+ ```json
56
+ {
57
+ "schemaVersion": 1,
58
+ "protocolVersion": 1,
59
+ "complianceMode": "standard",
60
+ "attestation": {
61
+ "mode": "required",
62
+ "revisionProvider": "git",
63
+ "requireCompleteCoverage": true,
64
+ "coverage": { "exclude": [] },
65
+ "signing": {
66
+ "provider": "none",
67
+ "required": false,
68
+ "policy": { "identities": [], "requireTransparencyLog": true }
69
+ }
70
+ }
71
+ }
72
+ ```
73
+
74
+ With `mode = required`, completion captures the manifest in the same task
75
+ transaction as final state, receipt, and the `COMPLETION_VALIDATED` event.
76
+ `CODE_MANIFEST_CAPTURED` is appended only after the manifest is persisted. If
77
+ capture fails, the transaction is aborted. `optional` reports unavailability;
78
+ `off` preserves the legacy behavior.
79
+
80
+ Create and inspect a statement without network access:
81
+
82
+ ```bash
83
+ forgeloop attestation-create --task <taskId> --json
84
+ forgeloop attestation-status --task <taskId> --json
85
+ forgeloop attestation-verify --task <taskId> --ref HEAD --json
86
+ ```
87
+
88
+ `attestation-verify` and `attestation-verify-range` are read-only. They never
89
+ write verification records or append ledger events.
90
+
91
+ ## What the chain proves
92
+
93
+ The chain proves a bounded relationship among a valid completion, its receipt
94
+ and ledger checkpoint, the exact bytes represented by the code manifest, and
95
+ the deterministic in-toto statement. The `RevisionProvider` supplies opaque
96
+ revision identity and exact content. The optional `SigningProvider` can add a
97
+ cryptographic signature, but neither provider changes the ForgeLoop evidence
98
+ semantics.
99
+
100
+ Revision-range coverage is a separate multi-task evaluation: a provider
101
+ enumerates changed paths between a base and head, then the verifier computes a
102
+ union of valid task attestations. Uncovered paths and conflicting digests fail
103
+ closed. A `CHANGED` or `CLAIMED` verification scope only describes which paths
104
+ one checker may execute before completion; it is not complete revision-range
105
+ coverage.
106
+
107
+ ## Signature boundary
108
+
109
+ ForgeLoop does not persist private keys, OIDC tokens, access tokens, or other
110
+ credentials. The `sigstore` provider invokes an external Cosign-compatible
111
+ binary with bounded output, an explicit timeout, and no shell interpolation.
112
+ Signature existence is not signature validity. Only successful verification
113
+ under the configured identity, issuer, and trusted-root policy produces
114
+ `ATTESTED`.
115
+
116
+ ## Revision-range coverage
117
+
118
+ Use the provider-neutral command in local or CI environments:
119
+
120
+ ```bash
121
+ forgeloop attestation-verify-range \
122
+ --revision-provider git \
123
+ --base origin/main \
124
+ --head HEAD \
125
+ --require-complete-coverage \
126
+ --json
127
+ ```
128
+
129
+ The result reports exact changed, covered, uncovered, and overlapping paths.
130
+ An uncovered source path or conflicting overlapping digest returns an invalid
131
+ verification result. Invocation, configuration, and provider failures are
132
+ distinguished from invalid attestations by the stable exit-code contract:
133
+
134
+ ```text
135
+ 0 = VALID
136
+ 1 = INVALID, stale, uncovered, or untrusted
137
+ 2 = invocation, environment, configuration, or provider error
138
+ ```
139
+
140
+ See [`REVISION_PROVIDERS.md`](./REVISION_PROVIDERS.md) and
141
+ [`SIGNING_PROVIDERS.md`](./SIGNING_PROVIDERS.md) for extension boundaries.
@@ -46,6 +46,20 @@ Key continuity invariants:
46
46
  - **Task identity survives harness changes**: Work state remains the single source of lifecycle truth.
47
47
  - **Stale continuity cannot authorize transitions**: Forward lifecycle progression requires valid work-state checkpoints.
48
48
 
49
+ These three surfaces must remain distinct:
50
+
51
+ | Concept | Mutable? | Evidence? | Purpose |
52
+ | --- | --- | --- | --- |
53
+ | `continuity.json` | Yes | No | Mutable operational resume notes (`NON_EVIDENCE_HANDOFF`) |
54
+ | Handoff envelope | No | No | Immutable protocol-derived state snapshot; not authority or independent review evidence |
55
+ | Execution/completion evidence | Controlled by protocol | Yes when valid | Exact process provenance, observed checks, receipt, and validated ledger proof |
56
+
57
+ The handoff envelope may carry an actor note or recipient hint, but it never
58
+ delegates work, establishes identity, grants authority, or proves completion.
59
+ The [Verification Trust Flow](./REVISION_PROVIDERS.md#differential-verification-scope)
60
+ and [Code Attestation Chain](./CODE_ATTESTATION.md#completion-flow) diagrams
61
+ show the evidence boundaries that continuity and handoff cannot replace.
62
+
49
63
  ---
50
64
 
51
65
  ## 2. Source-of-Truth Hierarchy
@@ -89,11 +103,17 @@ HARNESS B (Starting / Taking Over)
89
103
  ├── 4. Reconciles continuity: `forgeloop reconcile-continuity --task <id> --json`
90
104
  ├── 5. Inspects modified files: `forgeloop inspect --task <id> --json`
91
105
  └── 6. Asks for next action: `forgeloop next --task <id> --json`
92
-
93
-
106
+
107
+
94
108
  Continues execution without duplicating planning
95
109
  ```
96
110
 
111
+ Harness B must trust the canonical task state and checkout over prose: inspect
112
+ the task, read and reconcile continuity, inspect the latest handoff when one
113
+ exists, compare the current checkout, and only then follow `forgeloop next`.
114
+ Handoff notes can focus inspection, but only valid execution evidence,
115
+ completion receipts, and the append-only ledger can satisfy verification.
116
+
97
117
  ---
98
118
 
99
119
  ## 4. Harness A — Recording Handoff Context
@@ -14,7 +14,7 @@ ForgeLoop strictly separates normative protocol definitions from operational doc
14
14
  | **Operational & Reference** | `docs/` (`GETTING_STARTED.md`, `CROSS_HARNESS_CONTINUITY.md`, `CLI_REFERENCE.md`, `ARTIFACT_REFERENCE.md`, `TROUBLESHOOTING.md`, `RECIPES.md`) | Tutorials, command reference, handoff workflows, and troubleshooting | Explains how to operate the system. Links to normative sources for formal specifications. |
15
15
  | **Domain Engineering** | `ENG/` (`clean-code-eng.md`, `design-code-eng.md`, `test-code-eng.md`, etc.) | Domain-specific implementation and quality standards | Frontmatter must adhere to `validate_loop_system.py` standards. |
16
16
  | **Consumer Documentation Quality** | [`ENG/documentation-quality-eng.md`](../ENG/documentation-quality-eng.md) | Quality standards for documentation work in projects using ForgeLoop | Governs client/consumer project documentation tasks via guide routing. |
17
- | **Visual Architecture** | `docs/diagrams/manifest.json` + `docs/diagrams/forgeloop-engineering-flow.workflow.json` | Governance metadata and canonical typed Archify workflow source | Animated HTML explorer, animated SVG fallback, deterministic receipt, and source-bound human review are committed under `docs/assets/diagrams/` and `docs/diagrams/reviews/`. |
17
+ | **Visual Architecture** | `docs/diagrams/manifest.json` + the three typed workflow sources under `docs/diagrams/` | Governance metadata and canonical typed Archify workflow sources | Animated HTML explorers, animated SVG fallbacks, deterministic receipts, and source-bound human reviews are committed under `docs/assets/diagrams/` and `docs/diagrams/reviews/`. |
18
18
  | **Documentation Index** | `DOCS_INDEX.md` | Single repository index and ownership map | Updated whenever documentation structure changes. |
19
19
 
20
20
  ---
@@ -84,7 +84,7 @@ cross-platform CI (.github/workflows/docs-quality.yml)
84
84
  | **CLI Command Options** | `CLI_COMMAND_DEFINITIONS` (`src/core/cli-command-definitions.js`) | `docs/CLI_REFERENCE.md` | `<!-- BEGIN FORGELOOP GENERATED: cli:<command>:options -->` |
85
85
  | **Work-State Transitions** | `WORK_PHASES` / `WORK_TRANSITIONS` (`src/core/protocol.js`) | `ORCHESTRATOR_INTEGRATION.md` | `<!-- BEGIN FORGELOOP GENERATED: work-transitions -->` |
86
86
  | **Public Error Codes** | `PUBLIC_ERROR_CODES` (`src/core/error-codes.js`) | `docs/TROUBLESHOOTING.md` | `<!-- BEGIN FORGELOOP GENERATED: public-error-codes -->` |
87
- | **Architecture Flow** | `docs/diagrams/manifest.json` + `docs/diagrams/forgeloop-engineering-flow.workflow.json` | `docs/assets/diagrams/forgeloop-engineering-flow.{html,svg,receipt.json}` + `docs/diagrams/reviews/forgeloop-engineering-flow.review.json` | Verified via pinned Archify renderer, trace-animation markers, source/SVG fingerprints, artifact hashes, persistent review, and composition checks |
87
+ | **Architecture and trust diagrams** | `docs/diagrams/manifest.json` + typed workflow sources | Generated HTML/SVG/receipt/review files for Engineering Flow, Verification Trust Flow, and Code Attestation Chain | Verified via the pinned Archify renderer, trace-animation and reduced-motion markers, source/SVG fingerprints, artifact hashes, persistent review, and composition checks |
88
88
 
89
89
  ### Maintenance Workflow
90
90
 
@@ -122,7 +122,7 @@ conformance checks detect omissions.
122
122
  | **Discovery resume rules** | `DISCOVERY_SURFACES` & `nativeShim` | `scripts/validate_documentation_conformance.mjs` |
123
123
  | **Task-layout path freshness** | `TASK_LAYOUT_DOCUMENTS` & `task-paths.js` | `scripts/validate_documentation_conformance.mjs` |
124
124
  | **Package-shipped docs** | `package.json` (`files`) | `tests/package.test.js` |
125
- | **Architecture diagram** | `docs/diagrams/forgeloop-engineering-flow.workflow.json` | `scripts/check-documentation-diagrams.mjs` and `scripts/documentation-diagram-inventory.mjs` |
125
+ | **Architecture and trust diagrams** | `docs/diagrams/manifest.json` plus each typed workflow source | `scripts/check-documentation-diagrams.mjs` and `scripts/documentation-diagram-inventory.mjs` |
126
126
 
127
127
  ---
128
128
 
@@ -179,18 +179,19 @@ migration, or security-sensitive require `npm run docs:check` before merge.
179
179
 
180
180
  ## 7. Archify Diagrams and Animated SVG Generation
181
181
 
182
- 1. **Typed source is canonical**: The architecture flow is authored in Archify workflow IR at `docs/diagrams/forgeloop-engineering-flow.workflow.json`. Never modify generated HTML or SVG files directly.
182
+ 1. **Typed source is canonical**: The Engineering Flow, Verification Trust Flow, and Code Attestation Chain are authored in Archify workflow IR under `docs/diagrams/`; the high-level source is `docs/diagrams/forgeloop-engineering-flow.workflow.json`. Never modify generated HTML, SVG, or receipt files directly.
183
183
  2. **Pinned local renderer**: Generation uses only the vendored Archify v2.15.0 source at the reviewed commit recorded in `docs/diagrams/manifest.json` and `vendor/archify/v2.15.0/PIN.json`.
184
- 3. **Animated committed outputs**: The source uses `meta.animation: "trace"`. The interactive HTML is the primary animated explorer, and the self-contained SVG fallback carries trace-capable edge/node animation while remaining usable in repository previews. The deterministic receipt is committed under `docs/assets/diagrams/`.
184
+ 3. **Animated committed outputs**: Every active source uses `meta.animation: "trace"`. Each interactive HTML is the primary animated explorer, and each self-contained SVG fallback carries trace-capable edge/node animation while remaining usable in repository previews. Deterministic receipts are committed under `docs/assets/diagrams/`.
185
185
  4. **GitHub-safe SVG**: The SVG must not embed `<script>` or `<foreignObject>`, must expose accessible title/description metadata, and must remain visible through standard Markdown image syntax.
186
186
  5. **Fingerprint and review verification**: The generated SVG embeds a `data-forgeloop-source-sha256` attribute, the outputs expose trace markers, and the receipt binds the source, HTML, and SVG hashes. The human-owned review at `docs/diagrams/reviews/` binds the current source and SVG hashes and is never generated or overwritten. Run `npm run docs:diagrams:check` before review.
187
187
  6. **Scoped wrapper**: The ForgeLoop Archify wrapper is intentionally documentation-scoped. It reads canonical inputs only from `docs/diagrams/` and permits deliver outputs only under `docs/assets/diagrams/`.
188
188
 
189
189
  ForgeLoop governs five documentation-diagram categories: workflow,
190
- architecture, sequence, dataflow, and lifecycle. The current repository has
191
- one canonical workflow diagram. Governance support does not imply renderer
192
- support: a type requires an explicit renderer mapping before it can be added as
193
- an active diagram.
190
+ architecture, sequence, dataflow, and lifecycle. The active repository set has
191
+ three canonical workflow diagrams: the Engineering Flow, Verification Trust
192
+ Flow, and Code Attestation Chain. The pinned wrapper currently maps only
193
+ `workflow`; governance support does not imply renderer support, so a new type
194
+ requires an explicit mapping and tests before activation.
194
195
 
195
196
  ---
196
197
 
@@ -215,8 +216,9 @@ The README hero is intentionally GitHub-repository-only:
215
216
  `tests/package.test.js`.
216
217
 
217
218
  Never edit or delete a generated diagram output independently of its source;
218
- regenerate `docs/assets/diagrams/` from the typed workflow and keep the receipt
219
- in sync.
219
+ regenerate all declared outputs from the typed workflow sources and keep each
220
+ receipt and human-owned review binding in sync. Every diagram must also have a
221
+ concise text fallback in the canonical document named by its manifest.
220
222
 
221
223
  ---
222
224