@cassiomc1/forgeloop 1.13.0 → 2.0.0-rc.2

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 (395) hide show
  1. package/AGENT_COMPATIBILITY.md +8 -0
  2. package/CONTRIBUTING.md +11 -7
  3. package/DOCS_INDEX.md +37 -4
  4. package/ENG/c-development-eng.md +2 -2
  5. package/ENG/cpp-development-eng.md +2 -2
  6. package/ENG/dotnet-aspnetcore-development-eng.md +7 -1
  7. package/ENG/flutter-development-eng.md +4 -2
  8. package/ENG/go-development-eng.md +2 -2
  9. package/ENG/java-development-eng.md +3 -3
  10. package/ENG/nodejs-backend-development-eng.md +10 -6
  11. package/ENG/php-development-eng.md +3 -3
  12. package/ENG/python-development-eng.md +205 -0
  13. package/ENG/rust-development-eng.md +42 -1
  14. package/ENG/sec-code-eng.md +7 -7
  15. package/ENG/sql-development-eng.md +4 -4
  16. package/ENG/swift-development-eng.md +5 -4
  17. package/ENG/test-code-eng.md +1 -1
  18. package/ENG/typescript-development-eng.md +4 -4
  19. package/EXECUTION_STATE.md +12 -0
  20. package/GUIDE_ROUTER.md +6 -0
  21. package/LICENSE +133 -21
  22. package/LOOP_ENGINEERING.md +28 -2
  23. package/LOOP_SYSTEM_DESIGN.md +10 -10
  24. package/ORCHESTRATOR_INTEGRATION.md +9 -5
  25. package/PROTOCOL_INTEGRATION.md +55 -2
  26. package/README.md +63 -59
  27. package/TERMINOLOGY.md +2 -0
  28. package/THIRD_PARTY_NOTICES.md +3 -4
  29. package/THREAT_MODEL.md +140 -1
  30. package/completions/_forgeloop +29 -3
  31. package/completions/forgeloop.bash +55 -3
  32. package/completions/forgeloop.fish +183 -1
  33. package/docs/ADVISORY_CONTEXT.md +25 -0
  34. package/docs/AGENT_BROWSER_ADAPTER.md +81 -0
  35. package/docs/AGENT_BROWSER_VERIFICATION.md +6 -0
  36. package/docs/AGENT_PROTOCOL_SUMMARY.md +74 -39
  37. package/docs/AGENT_SKILL.md +66 -0
  38. package/docs/ARTIFACT_REFERENCE.md +171 -35
  39. package/docs/AUDIT_UX.md +46 -0
  40. package/docs/BROWSER_VERIFICATION.md +136 -0
  41. package/docs/CLI_REFERENCE.md +512 -8
  42. package/docs/CODE_ATTESTATION.md +2 -2
  43. package/docs/DOCUMENTATION_GUIDE.md +34 -11
  44. package/docs/GETTING_STARTED.md +3 -3
  45. package/docs/JEV_BENCHMARKS.md +31 -0
  46. package/docs/MODEL_ROUTING.md +37 -0
  47. package/docs/OPENSRC_ADAPTER.md +241 -0
  48. package/docs/PACKAGE_CONTENTS.md +46 -18
  49. package/docs/PROVIDERS.md +126 -0
  50. package/docs/PROVIDER_ARCHITECTURE.md +199 -0
  51. package/docs/RECIPES.md +9 -0
  52. package/docs/RELEASE_CHECKLIST.md +116 -12
  53. package/docs/SECURITY_REVIEW.md +71 -0
  54. package/docs/SELF_HOSTED_TESTS.md +121 -0
  55. package/docs/SEMANTIC_DECISION_PLANE.md +71 -0
  56. package/docs/TEST_INTELLIGENCE.md +29 -0
  57. package/docs/TEST_PRUNING.md +14 -0
  58. package/docs/TROUBLESHOOTING.md +198 -1
  59. package/docs/UNIVERSAL_INTEGRATION.md +31 -0
  60. package/docs/assets/diagrams/forgeloop-code-attestation-flow.html +2 -2
  61. package/docs/assets/diagrams/forgeloop-code-attestation-flow.receipt.json +5 -5
  62. package/docs/assets/diagrams/forgeloop-code-attestation-flow.svg +1 -1
  63. package/docs/assets/diagrams/forgeloop-engineering-flow.html +39 -26
  64. package/docs/assets/diagrams/forgeloop-engineering-flow.receipt.json +6 -6
  65. package/docs/assets/diagrams/forgeloop-engineering-flow.svg +26 -26
  66. package/docs/assets/diagrams/forgeloop-verification-trust-flow.html +2 -1
  67. package/docs/assets/diagrams/forgeloop-verification-trust-flow.receipt.json +5 -5
  68. package/docs/assets/diagrams/forgeloop-verification-trust-flow.svg +1 -1
  69. package/docs/diagrams/README.md +13 -9
  70. package/docs/diagrams/forgeloop-code-attestation-flow.workflow.json +1 -1
  71. package/docs/diagrams/forgeloop-engineering-flow.workflow.json +24 -19
  72. package/docs/diagrams/forgeloop-verification-trust-flow.workflow.json +1 -0
  73. package/docs/diagrams/reviews/forgeloop-code-attestation-flow.review.json +4 -4
  74. package/docs/diagrams/reviews/forgeloop-engineering-flow.review.json +4 -4
  75. package/docs/diagrams/reviews/forgeloop-verification-trust-flow.review.json +4 -4
  76. package/docs/documentation-manifest.json +774 -16
  77. package/docs/protocol-requirements.json +24 -0
  78. package/package.json +43 -11
  79. package/schemas/config.schema.json +14 -0
  80. package/schemas/context-plan.schema.json +18 -0
  81. package/schemas/semantic-decision.schema.json +46 -0
  82. package/schemas/task-bundle.schema.json +7 -2
  83. package/schemas/test-utility.schema.json +44 -0
  84. package/scripts/CI_VALIDATORS.md +6 -6
  85. package/scripts/benchmark-jev.mjs +5 -0
  86. package/scripts/benchmark-test-intelligence.mjs +4 -0
  87. package/scripts/generate-agent-protocol-summary.mjs +6 -3
  88. package/scripts/generate-forgeloop-skill.mjs +133 -0
  89. package/scripts/jev-smoke.mjs +19 -0
  90. package/scripts/run-mcp-clean-tests.mjs +30 -0
  91. package/skills/forgeloop/README.md +9 -0
  92. package/skills/forgeloop/SKILL.md +77 -0
  93. package/skills/forgeloop/references/lifecycle.md +9 -0
  94. package/skills/forgeloop/references/recovery.md +7 -0
  95. package/skills/forgeloop/references/verification.md +7 -0
  96. package/src/adapters/agent-browser/assertions.js +47 -0
  97. package/src/adapters/agent-browser/commands.js +54 -0
  98. package/src/adapters/agent-browser/index.js +3 -0
  99. package/src/adapters/agent-browser/locator.js +40 -0
  100. package/src/adapters/agent-browser/process.js +215 -0
  101. package/src/adapters/agent-browser/provider.js +316 -0
  102. package/src/adapters/emulated-services/constants.js +24 -0
  103. package/src/adapters/emulated-services/index.js +7 -0
  104. package/src/adapters/emulated-services/process.js +162 -0
  105. package/src/adapters/emulated-services/provider.js +289 -0
  106. package/src/adapters/opensrc/normalize.js +90 -0
  107. package/src/adapters/opensrc/process.js +248 -0
  108. package/src/adapters/opensrc/provider.js +338 -0
  109. package/src/adapters/opensrc/search.js +264 -0
  110. package/src/adapters/temporary-paths.js +18 -0
  111. package/src/adapters/typesafe/client.js +28 -0
  112. package/src/adapters/typesafe/engine.js +63 -0
  113. package/src/adapters/typesafe/normalize.js +41 -0
  114. package/src/cli.js +218 -174
  115. package/src/commands/action-show.js +5 -2
  116. package/src/commands/advance.js +5 -1
  117. package/src/commands/baseline.js +13 -11
  118. package/src/commands/checkpoint-revalidate.js +192 -0
  119. package/src/commands/complete.js +19 -3
  120. package/src/commands/context-plan.js +38 -0
  121. package/src/commands/contract-create.js +266 -0
  122. package/src/commands/contract-revise.js +236 -0
  123. package/src/commands/decision-show.js +14 -0
  124. package/src/commands/decision-status.js +22 -0
  125. package/src/commands/discover.js +41 -0
  126. package/src/commands/doctor.js +51 -13
  127. package/src/commands/gate-record.js +194 -0
  128. package/src/commands/gate-revalidate.js +135 -0
  129. package/src/commands/handoff-list.js +6 -1
  130. package/src/commands/handoff-show.js +6 -1
  131. package/src/commands/migrate-protocol.js +2 -2
  132. package/src/commands/model-route.js +40 -0
  133. package/src/commands/next.js +7 -1
  134. package/src/commands/policy-diff.js +25 -4
  135. package/src/commands/progress.js +17 -11
  136. package/src/commands/record-diagnosis.js +3 -0
  137. package/src/commands/route.js +146 -18
  138. package/src/commands/semantic-plan.js +41 -0
  139. package/src/commands/status.js +6 -1
  140. package/src/commands/storage-backup.js +15 -0
  141. package/src/commands/storage-migrate.js +5 -0
  142. package/src/commands/storage-migration-resume.js +5 -0
  143. package/src/commands/storage-migration-status.js +44 -0
  144. package/src/commands/storage-restore-resume.js +7 -0
  145. package/src/commands/storage-restore.js +8 -0
  146. package/src/commands/task-abandon.js +224 -0
  147. package/src/commands/task-list.js +8 -43
  148. package/src/commands/task-migrate-contract-bootstrap-repair.js +288 -0
  149. package/src/commands/task-migrate.js +3 -3
  150. package/src/commands/task-recover.js +10 -2
  151. package/src/commands/task-repair-contract-bootstrap.js +263 -0
  152. package/src/commands/task-scope.js +18 -2
  153. package/src/commands/task-show.js +16 -2
  154. package/src/commands/test-inventory.js +5 -0
  155. package/src/commands/test-prune-plan.js +5 -0
  156. package/src/commands/test-prune-probe.js +5 -0
  157. package/src/commands/test-utility.js +5 -0
  158. package/src/commands/validate-protocol.js +39 -15
  159. package/src/commands/validate-receipt.js +8 -1
  160. package/src/config/guides.json +4 -0
  161. package/src/core/action-ledger-projection.js +10 -3
  162. package/src/core/actions.js +38 -75
  163. package/src/core/activation.js +11 -3
  164. package/src/core/approvals.js +17 -51
  165. package/src/core/artifact-registry.js +83 -2
  166. package/src/core/artifacts.js +81 -27
  167. package/src/core/attachment-paths.js +45 -0
  168. package/src/core/attestation-coverage.js +6 -1
  169. package/src/core/attestation-verifier.js +21 -2
  170. package/src/core/attestation.js +17 -6
  171. package/src/core/audit-ux.js +514 -0
  172. package/src/core/audit.js +6 -1
  173. package/src/core/browser-verification/constants.js +149 -0
  174. package/src/core/browser-verification/normalize.js +254 -0
  175. package/src/core/browser-verification/provider.js +519 -0
  176. package/src/core/browser-verification/service.js +115 -0
  177. package/src/core/bundles.js +160 -66
  178. package/src/core/checkpoint-revalidation.js +321 -0
  179. package/src/core/cli-command-definitions.js +350 -7
  180. package/src/core/code-manifest.js +9 -3
  181. package/src/core/command-executors.js +274 -108
  182. package/src/core/command-input.js +136 -44
  183. package/src/core/completion-artifacts.js +85 -34
  184. package/src/core/completion-ownership.js +19 -8
  185. package/src/core/completion-recovery-rebind.js +11 -1
  186. package/src/core/completion.js +64 -15
  187. package/src/core/config.js +3 -0
  188. package/src/core/conformance.js +2 -1
  189. package/src/core/context-compiler/budget.js +9 -0
  190. package/src/core/context-compiler/candidates.js +39 -0
  191. package/src/core/context-compiler/compiler.js +63 -0
  192. package/src/core/context-compiler/fingerprint.js +11 -0
  193. package/src/core/context-compiler/policy.js +13 -0
  194. package/src/core/context-compiler/result.js +23 -0
  195. package/src/core/continuity-lint.js +13 -2
  196. package/src/core/continuity-reconciliation.js +16 -3
  197. package/src/core/continuity.js +16 -8
  198. package/src/core/contract-bootstrap-recovery.js +656 -0
  199. package/src/core/contract-revision.js +209 -0
  200. package/src/core/decision/artifact.js +70 -0
  201. package/src/core/decision/benchmarks.js +103 -0
  202. package/src/core/decision/cache.js +27 -0
  203. package/src/core/decision/constants.js +58 -0
  204. package/src/core/decision/cutover.js +34 -0
  205. package/src/core/decision/engine.js +22 -0
  206. package/src/core/decision/errors.js +68 -0
  207. package/src/core/decision/events.js +104 -0
  208. package/src/core/decision/freshness.js +19 -0
  209. package/src/core/decision/normalizers/index.js +115 -0
  210. package/src/core/decision/policy.js +18 -0
  211. package/src/core/decision/projection.js +16 -0
  212. package/src/core/decision/question-registry.js +201 -0
  213. package/src/core/decision/request.js +26 -0
  214. package/src/core/decision/resolver.js +138 -0
  215. package/src/core/decision/result.js +58 -0
  216. package/src/core/decision/service.js +181 -0
  217. package/src/core/decision/state-builder.js +65 -0
  218. package/src/core/decision/task-bindings.js +35 -0
  219. package/src/core/decision/test-provider.js +32 -0
  220. package/src/core/decision/thresholds.js +15 -0
  221. package/src/core/diagnosis-model.js +11 -0
  222. package/src/core/diagnosis.js +10 -1
  223. package/src/core/diagnostic-projection.js +29 -12
  224. package/src/core/diagnostic-record.js +28 -3
  225. package/src/core/efficiency.js +6 -1
  226. package/src/core/error-codes.js +278 -0
  227. package/src/core/events.js +535 -147
  228. package/src/core/evidence-readiness.js +9 -0
  229. package/src/core/execution-prerequisites.js +36 -13
  230. package/src/core/execution-profile.js +63 -38
  231. package/src/core/execution.js +26 -40
  232. package/src/core/filesystem.js +11 -0
  233. package/src/core/gate-artifact.js +105 -19
  234. package/src/core/gate-provenance.js +125 -0
  235. package/src/core/handoff.js +26 -14
  236. package/src/core/history.js +39 -35
  237. package/src/core/hypothesis-projection.js +32 -0
  238. package/src/core/information-gain-projection.js +104 -100
  239. package/src/core/inspect.js +12 -3
  240. package/src/core/integration-invocation-policy.js +37 -4
  241. package/src/core/integration-resources.js +119 -87
  242. package/src/core/ledger-event-collection.js +189 -0
  243. package/src/core/ledger-relations.js +23 -0
  244. package/src/core/model-router/constants.js +10 -0
  245. package/src/core/model-router/policy.js +103 -0
  246. package/src/core/model-router/router.js +37 -0
  247. package/src/core/native-storage.js +12 -0
  248. package/src/core/next-action-continuity.js +31 -9
  249. package/src/core/next-action-model.js +58 -0
  250. package/src/core/next-action-phases.js +131 -43
  251. package/src/core/next-action-refresh.js +43 -9
  252. package/src/core/next-action-review-phase.js +9 -4
  253. package/src/core/next-action-verification-phase.js +2 -1
  254. package/src/core/next-action.js +56 -9
  255. package/src/core/phase.js +266 -103
  256. package/src/core/policy-engine.js +12 -13
  257. package/src/core/preflight-consistency.js +89 -62
  258. package/src/core/preflight-loaders.js +48 -9
  259. package/src/core/preflight-model.js +6 -1
  260. package/src/core/preflight.js +29 -12
  261. package/src/core/progress.js +21 -10
  262. package/src/core/protocol-info.js +68 -0
  263. package/src/core/protocol-migration.js +7 -6
  264. package/src/core/protocol.js +20 -0
  265. package/src/core/reconcile-closure.js +281 -67
  266. package/src/core/recovery-history.js +67 -47
  267. package/src/core/reflection.js +72 -77
  268. package/src/core/responsibility.js +25 -13
  269. package/src/core/resumability.js +154 -44
  270. package/src/core/route-artifact.js +28 -4
  271. package/src/core/router.js +67 -1
  272. package/src/core/runtime-context.js +123 -61
  273. package/src/core/schema-validation.js +11 -3
  274. package/src/core/security-review/constants.js +64 -0
  275. package/src/core/security-review/normalize.js +245 -0
  276. package/src/core/security-review/provider.js +204 -0
  277. package/src/core/security-review/service.js +134 -0
  278. package/src/core/semantic-planning/constants.js +19 -0
  279. package/src/core/semantic-planning/projection.js +94 -0
  280. package/src/core/semantic-planning/service.js +15 -0
  281. package/src/core/settlement.js +12 -1
  282. package/src/core/signing/bundle-file.js +53 -0
  283. package/src/core/signing/bundle-reference.js +15 -0
  284. package/src/core/signing/sigstore.js +60 -33
  285. package/src/core/signing/statement-file.js +27 -0
  286. package/src/core/sources.js +37 -0
  287. package/src/core/storage-runtime-registry.js +41 -0
  288. package/src/core/structural-quality/artifacts.js +20 -14
  289. package/src/core/structural-quality/service.js +81 -56
  290. package/src/core/target-layout.js +1 -1
  291. package/src/core/task-claim-state.js +249 -15
  292. package/src/core/task-command.js +21 -1
  293. package/src/core/task-conflict-inspection.js +133 -102
  294. package/src/core/task-descriptor.js +29 -22
  295. package/src/core/task-discovery.js +288 -90
  296. package/src/core/task-lock.js +66 -306
  297. package/src/core/task-migration-validation.js +5 -5
  298. package/src/core/task-migration.js +17 -287
  299. package/src/core/task-paths.js +13 -0
  300. package/src/core/task-recovery.js +1 -0
  301. package/src/core/task-snapshot.js +51 -8
  302. package/src/core/task-storage-migration.js +18 -0
  303. package/src/core/templates.js +23 -8
  304. package/src/core/test-intelligence/benchmarks.js +68 -0
  305. package/src/core/test-intelligence/inventory.js +73 -0
  306. package/src/core/test-intelligence/prune.js +94 -0
  307. package/src/core/test-intelligence/semantic-state.js +15 -0
  308. package/src/core/test-intelligence/service.js +40 -0
  309. package/src/core/test-intelligence/utility.js +50 -0
  310. package/src/core/trace.js +164 -105
  311. package/src/core/trajectory-evaluation.js +15 -3
  312. package/src/core/trajectory-metrics.js +47 -32
  313. package/src/core/transaction.js +16 -287
  314. package/src/core/verification-scope.js +20 -12
  315. package/src/core/work-state.js +100 -59
  316. package/src/integration.d.ts +492 -0
  317. package/src/integration.js +54 -0
  318. package/src/providers/README.md +47 -0
  319. package/src/providers/capabilities.js +46 -0
  320. package/src/providers/errors.js +15 -0
  321. package/src/providers/index.js +29 -0
  322. package/src/providers/json-snapshot.js +105 -0
  323. package/src/providers/registry.js +152 -0
  324. package/src/repository-index/binary-manager.js +7 -5
  325. package/src/storage/artifact-bytes.js +22 -0
  326. package/src/storage/attachment-binding.js +11 -0
  327. package/src/storage/attachment-files.js +82 -0
  328. package/src/storage/attachment-references.js +36 -0
  329. package/src/storage/backup.js +53 -0
  330. package/src/storage/capabilities.js +31 -0
  331. package/src/storage/connection-owner.js +119 -0
  332. package/src/storage/connection.js +376 -0
  333. package/src/storage/existing-project-scope.js +45 -0
  334. package/src/storage/export-destination.js +44 -0
  335. package/src/storage/exporter.js +284 -0
  336. package/src/storage/file-durability.js +46 -0
  337. package/src/storage/importer.js +461 -0
  338. package/src/storage/index.js +74 -0
  339. package/src/storage/leases.js +63 -0
  340. package/src/storage/ledger-event-snapshot.js +150 -0
  341. package/src/storage/ledger-relations.js +220 -0
  342. package/src/storage/legacy-maintenance-boundary.js +18 -0
  343. package/src/storage/legacy-signature.js +115 -0
  344. package/src/storage/maintenance-handoff.js +129 -0
  345. package/src/storage/maintenance-owner.js +42 -0
  346. package/src/storage/maintenance.js +310 -0
  347. package/src/storage/metadata-json.js +35 -0
  348. package/src/storage/migration-activate.js +59 -0
  349. package/src/storage/migration-archive.js +57 -0
  350. package/src/storage/migration-attachment-root.js +61 -0
  351. package/src/storage/migration-candidate.js +398 -0
  352. package/src/storage/migration-publication.js +143 -0
  353. package/src/storage/migration-rollback-admission.js +54 -0
  354. package/src/storage/migration-rollback-preparation.js +132 -0
  355. package/src/storage/migration-rollback-publication.js +183 -0
  356. package/src/storage/migration-rollback-release.js +66 -0
  357. package/src/storage/migration-rollback-source-stage.js +103 -0
  358. package/src/storage/migration-rollback.js +43 -0
  359. package/src/storage/migration-source-partition.js +56 -0
  360. package/src/storage/migration-source.js +255 -0
  361. package/src/storage/migration-terminal.js +39 -0
  362. package/src/storage/migration-validation.js +75 -0
  363. package/src/storage/migration.js +43 -0
  364. package/src/storage/operational-attachments.js +49 -0
  365. package/src/storage/operational-context.js +50 -0
  366. package/src/storage/project-backup.js +98 -0
  367. package/src/storage/project-bootstrap.js +24 -0
  368. package/src/storage/project-boundary.js +79 -0
  369. package/src/storage/project-read-snapshot.js +18 -0
  370. package/src/storage/project-replacement.js +137 -0
  371. package/src/storage/project-restore.js +203 -0
  372. package/src/storage/record-definitions.js +45 -0
  373. package/src/storage/repository.js +507 -0
  374. package/src/storage/restore-journal.js +62 -0
  375. package/src/storage/restore-layout.js +30 -0
  376. package/src/storage/restore-preparation.js +84 -0
  377. package/src/storage/restore-replacement-archive.js +162 -0
  378. package/src/storage/restore-replacement-owner.js +31 -0
  379. package/src/storage/restore-replacement-preparation.js +128 -0
  380. package/src/storage/restore-replacement.js +142 -0
  381. package/src/storage/restore-terminal.js +32 -0
  382. package/src/storage/runtime.js +31 -0
  383. package/src/storage/schema.js +214 -0
  384. package/src/storage/singleton-import.js +84 -0
  385. package/src/storage/snapshot-continuity.js +16 -0
  386. package/src/storage/snapshot.js +36 -0
  387. package/src/storage/storage-marker.js +79 -0
  388. package/src/storage/task-guards.js +107 -0
  389. package/src/storage/topology.js +42 -0
  390. package/src/storage/transaction.js +179 -0
  391. package/src/storage/unit-of-work.js +663 -0
  392. package/src/storage/windows-process-incarnation.js +206 -0
  393. package/.forgeloop/forgeloop.gitignore +0 -4
  394. package/LICENSE-DOCS.md +0 -13
  395. package/src/core/transaction-maintenance.js +0 -70
@@ -1,6 +1,6 @@
1
1
  # ForgeLoop Artifact Reference
2
2
 
3
- This reference documents the canonical artifacts persisted in the `.forgeloop/` directory.
3
+ This reference distinguishes each artifact's logical identity, canonical storage and portable export path. Operational task and session records are stored in `.forgeloop/state.sqlite`; project configuration, policy inputs and immutable attachment bytes remain files.
4
4
 
5
5
  All artifact schemas are defined in `schemas/*.schema.json`. Persisted artifact shapes are strictly bound to these schemas and validated during protocol transitions.
6
6
 
@@ -8,42 +8,57 @@ All artifact schemas are defined in `schemas/*.schema.json`. Persisted artifact
8
8
 
9
9
  ## 1. Artifact Registry Summary
10
10
 
11
+ Historical path strings remain logical identities so existing hashed evidence
12
+ can be resolved without rewriting its history. A logical task path does not
13
+ promise that a live JSON or NDJSON file exists. Read operational payloads through
14
+ the canonical CLI, integration API or MCP resources; portable files are produced
15
+ by explicit exports.
16
+
17
+ The registry retains `path` as the logical alias and adds `logicalPath`,
18
+ `canonicalStorage` and `exportPath`. Project files have no database export path
19
+ and are copied separately. Signature bundles use immutable content-addressed
20
+ files bound by SQLite references; their portable bindings are in
21
+ `export-index.json#attachments`. A historical signature path is emitted only
22
+ when its verified legacy alias is bound to the exported statement.
23
+
11
24
  <!-- BEGIN FORGELOOP GENERATED: artifact-registry -->
12
25
 
13
- | Artifact File | Schema | Ownership | Mutability | Trust Role |
14
- | --- | --- | --- | --- | --- |
15
- | `task-state/<task-key>/task.json` | `task-descriptor` | Protocol Managed | Mutable Before Execution | Task Descriptor |
16
- | `task-state/<task-key>/contract.json` | `current-contract` | Agent Authored | Mutable Before Execution | Operational Specification |
17
- | `task-state/<task-key>/routing-result.json` | `routing-result` | Protocol Generated | Mutable On Reroute | Guide Routing Specification |
18
- | `task-state/<task-key>/preflight.json` | `preflight` | Protocol Generated | Overwritten On Preflight | Readiness Attestation |
19
- | `sources.json` | `source-registry` | Operator Or Agent | Mutable On Discovery | Source Attestation |
20
- | `task-state/<task-key>/events.ndjson` | `event` | Protocol Appended | Append Only | Audit Ledger |
21
- | `sessions/<session-id>.json` | `activation` | Protocol Generated | Overwritten On Activate | Session Marker |
22
- | `config.json` | `config` | Operator Or Agent | Mutable Configuration | Project Configuration |
23
- | `task-state/<task-key>/gates/<gate>.json` | `gate` | Agent Authored Or Reviewer | Overwritten On Gate Satisfaction | Gate Approval Attestation |
24
- | `task-state/<task-key>/work-state.json` | `work-state` | Protocol Managed | Atomic State Transitions | Canonical Lifecycle State |
25
- | `task-state/<task-key>/continuity.json` | `continuity` | Agent Or Harness | Mutable Handoff Notes | Non Evidence Handoff |
26
- | `task-state/<task-key>/execution-receipt.json` | `execution-receipt` | Protocol Compiled | Atomic Compilation | Evidence Compilation |
27
- | `task-state/<task-key>/executions/exec-<id>.json` | `execution` | Protocol Executed | Immutable Once Written | Execution Provenance |
28
- | `policy/rules.json` | `policy-rules` | Operator Or Agent | Mutable Configuration | Policy Specification |
29
- | `policy/discovery.json` | `policy-discovery` | Protocol Generated | Mutable On Discovery | Discovered Policy Specification |
30
- | `policy/baseline.json` | `policy-baseline` | Protocol Generated Or Operator | Monotonic Ratchet Down | Brownfield Baseline |
31
- | `policy/policy.lock` | `policy-lock` | Protocol Generated | Atomic Digest Compilation | Policy Integrity Lock |
32
- | `task-state/<task-key>/policy-snapshot.json` | `policy-snapshot` | Protocol Generated | Mutable Before Execution | Task Policy Attestation |
33
- | `task-state/<task-key>/recovery.json` | `task-recovery` | Protocol Generated | Recovery State Transitions | Task Recovery State |
34
- | `task-state/<task-key>/actions/action-<id>.json` | `action` | Protocol Managed | State Machine Transitions | External Action Provenance |
35
- | `task-state/<task-key>/approvals/approval-<id>.json` | `approval` | Protocol Managed | Append Decision Once | Action Approval Attestation |
36
- | `policy/capabilities.json` | `capability-policy` | Operator Or Agent | Mutable Configuration | Capability Policy Specification |
37
- | `task-state/<task-key>/evaluations/eval-<id>.json` | `trajectory-evaluation` | Protocol Compiled | Immutable Once Written | Trajectory Evaluation |
38
- | `task-state/<task-key>/structural-quality/baseline.json` | `structural-quality` | Protocol Compiled | Baseline Immutable After Execution | Structural Quality Evidence |
39
- | `task-state/<task-key>/usage.json` | `usage` | Actor Or Trusted Host | Overwritten On Usage Record | Informational Usage Telemetry |
40
- | `task-state/<task-key>/workspace-binding.json` | `workspace-binding` | Protocol Generated | Immutable After Bind | Workspace Identity Binding |
41
- | `task-state/<task-key>/handoffs/handoff-<id>.json` | `handoff-envelope` | Protocol Compiled | Immutable Once Written | Canonical Handoff Snapshot |
42
- | `task-state/<task-key>/responsibility.json` | `responsibility` | Agent Or Harness Constrained | Immutable During Pass | Responsibility Constraint |
43
- | `task-state/<task-key>/verification-scope.json` | `verification-scope` | Protocol Compiled | Recomputed On Scope Change | Verification Scope Plan |
44
- | `task-state/<task-key>/attestations/code-manifest.json` | `code-manifest` | Protocol Generated | Immutable Once Written | Content Integrity Snapshot |
45
- | `task-state/<task-key>/attestations/statement.json` | `in-toto-statement` | Protocol Compiled | Immutable Once Written | Code Attestation Statement |
46
- | `task-state/<task-key>/attestations/statement.sigstore.json` | `null` | External Signing Provider | External Immutable | External Signature Bundle |
26
+ | Logical Identity | Canonical Storage | Export Path | Schema | Ownership | Mutability | Trust Role |
27
+ | --- | --- | --- | --- | --- | --- | --- |
28
+ | `.forgeloop/task-state/<task-key>/task.json` | `.forgeloop/state.sqlite :: tasks.descriptor_json` | `.forgeloop/task-state/<task-key>/task.json` | `task-descriptor` | Protocol Managed | Mutable Before Execution | Task Descriptor |
29
+ | `.forgeloop/task-state/<task-key>/contract.json` | `.forgeloop/state.sqlite :: task_artifacts (contract)` | `.forgeloop/task-state/<task-key>/contract.json` | `current-contract` | Agent Authored | Mutable Before Execution | Operational Specification |
30
+ | `.forgeloop/task-state/<task-key>/routing-result.json` | `.forgeloop/state.sqlite :: task_artifacts (route)` | `.forgeloop/task-state/<task-key>/routing-result.json` | `routing-result` | Protocol Generated | Mutable On Reroute | Guide Routing Specification |
31
+ | `.forgeloop/task-state/<task-key>/preflight.json` | `.forgeloop/state.sqlite :: task_artifacts (preflight)` | `.forgeloop/task-state/<task-key>/preflight.json` | `preflight` | Protocol Generated | Overwritten On Preflight | Readiness Attestation |
32
+ | `.forgeloop/sources.json` | `.forgeloop/sources.json` | `Copied separately` | `source-registry` | Operator Or Agent | Mutable On Discovery | Source Attestation |
33
+ | `.forgeloop/task-state/<task-key>/events.ndjson` | `.forgeloop/state.sqlite :: events` | `.forgeloop/task-state/<task-key>/events.ndjson` | `event` | Protocol Appended | Append Only | Audit Ledger |
34
+ | `.forgeloop/sessions/<session-id>.json` | `.forgeloop/state.sqlite :: sessions` | `.forgeloop/sessions/<session-id>.json` | `activation` | Protocol Generated | Overwritten On Activate | Session Marker |
35
+ | `.forgeloop/config.json` | `.forgeloop/config.json` | `Copied separately` | `config` | Operator Or Agent | Mutable Configuration | Project Configuration |
36
+ | `.forgeloop/task-state/<task-key>/gates/<gate>.json` | `.forgeloop/state.sqlite :: task_artifacts (gate)` | `.forgeloop/task-state/<task-key>/gates/<gate>.json` | `gate` | Agent Authored Or Reviewer | Overwritten On Gate Satisfaction | Gate Approval Attestation |
37
+ | `.forgeloop/task-state/<task-key>/work-state.json` | `.forgeloop/state.sqlite :: tasks.state_json` | `.forgeloop/task-state/<task-key>/work-state.json` | `work-state` | Protocol Managed | Atomic State Transitions | Canonical Lifecycle State |
38
+ | `.forgeloop/task-state/<task-key>/continuity.json` | `.forgeloop/state.sqlite :: task_artifacts (continuity)` | `.forgeloop/task-state/<task-key>/continuity.json` | `continuity` | Agent Or Harness | Mutable Handoff Notes | Non Evidence Handoff |
39
+ | `.forgeloop/task-state/<task-key>/execution-receipt.json` | `.forgeloop/state.sqlite :: task_artifacts (receipt)` | `.forgeloop/task-state/<task-key>/execution-receipt.json` | `execution-receipt` | Protocol Compiled | Atomic Compilation | Evidence Compilation |
40
+ | `.forgeloop/task-state/<task-key>/executions/exec-<id>.json` | `.forgeloop/state.sqlite :: executions` | `.forgeloop/task-state/<task-key>/executions/exec-<id>.json` | `execution` | Protocol Executed | Immutable Once Written | Execution Provenance |
41
+ | `.forgeloop/policy/rules.json` | `.forgeloop/policy/rules.json` | `Copied separately` | `policy-rules` | Operator Or Agent | Mutable Configuration | Policy Specification |
42
+ | `.forgeloop/policy/discovery.json` | `.forgeloop/policy/discovery.json` | `Copied separately` | `policy-discovery` | Protocol Generated | Mutable On Discovery | Discovered Policy Specification |
43
+ | `.forgeloop/policy/baseline.json` | `.forgeloop/policy/baseline.json` | `Copied separately` | `policy-baseline` | Protocol Generated Or Operator | Monotonic Ratchet Down | Brownfield Baseline |
44
+ | `.forgeloop/policy/policy.lock` | `.forgeloop/policy/policy.lock` | `Copied separately` | `policy-lock` | Protocol Generated | Atomic Digest Compilation | Policy Integrity Lock |
45
+ | `.forgeloop/task-state/<task-key>/policy-snapshot.json` | `.forgeloop/state.sqlite :: task_artifacts (policySnapshot)` | `.forgeloop/task-state/<task-key>/policy-snapshot.json` | `policy-snapshot` | Protocol Generated | Mutable Before Execution | Task Policy Attestation |
46
+ | `.forgeloop/task-state/<task-key>/recovery.json` | `.forgeloop/state.sqlite :: task_artifacts (recovery)` | `.forgeloop/task-state/<task-key>/recovery.json` | `task-recovery` | Protocol Generated | Recovery State Transitions | Task Recovery State |
47
+ | `.forgeloop/task-state/<task-key>/actions/action-<id>.json` | `.forgeloop/state.sqlite :: actions` | `.forgeloop/task-state/<task-key>/actions/action-<id>.json` | `action` | Protocol Managed | State Machine Transitions | External Action Provenance |
48
+ | `.forgeloop/task-state/<task-key>/approvals/approval-<id>.json` | `.forgeloop/state.sqlite :: approvals` | `.forgeloop/task-state/<task-key>/approvals/approval-<id>.json` | `approval` | Protocol Managed | Append Decision Once | Action Approval Attestation |
49
+ | `.forgeloop/policy/capabilities.json` | `.forgeloop/policy/capabilities.json` | `Copied separately` | `capability-policy` | Operator Or Agent | Mutable Configuration | Capability Policy Specification |
50
+ | `.forgeloop/task-state/<task-key>/evaluations/eval-<id>.json` | `.forgeloop/state.sqlite :: task_artifacts (evaluation)` | `.forgeloop/task-state/<task-key>/evaluations/eval-<id>.json` | `trajectory-evaluation` | Protocol Compiled | Immutable Once Written | Trajectory Evaluation |
51
+ | `.forgeloop/task-state/<task-key>/structural-quality/baseline.json` | `.forgeloop/state.sqlite :: task_artifacts (structuralQuality)` | `.forgeloop/task-state/<task-key>/structural-quality/baseline.json` | `structural-quality` | Protocol Compiled | Baseline Immutable After Execution | Structural Quality Evidence |
52
+ | `.forgeloop/task-state/<task-key>/usage.json` | `.forgeloop/state.sqlite :: task_artifacts (usage)` | `.forgeloop/task-state/<task-key>/usage.json` | `usage` | Actor Or Trusted Host | Overwritten On Usage Record | Informational Usage Telemetry |
53
+ | `.forgeloop/task-state/<task-key>/workspace-binding.json` | `.forgeloop/state.sqlite :: task_artifacts (workspaceBinding)` | `.forgeloop/task-state/<task-key>/workspace-binding.json` | `workspace-binding` | Protocol Generated | Immutable After Bind | Workspace Identity Binding |
54
+ | `.forgeloop/task-state/<task-key>/handoffs/handoff-<id>.json` | `.forgeloop/state.sqlite :: task_artifacts (handoff)` | `.forgeloop/task-state/<task-key>/handoffs/handoff-<id>.json` | `handoff-envelope` | Protocol Compiled | Immutable Once Written | Canonical Handoff Snapshot |
55
+ | `.forgeloop/task-state/<task-key>/responsibility.json` | `.forgeloop/state.sqlite :: task_artifacts (responsibility)` | `.forgeloop/task-state/<task-key>/responsibility.json` | `responsibility` | Agent Or Harness Constrained | Immutable During Pass | Responsibility Constraint |
56
+ | `.forgeloop/task-state/<task-key>/verification-scope.json` | `.forgeloop/state.sqlite :: task_artifacts (verificationScope)` | `.forgeloop/task-state/<task-key>/verification-scope.json` | `verification-scope` | Protocol Compiled | Recomputed On Scope Change | Verification Scope Plan |
57
+ | `.forgeloop/task-state/<task-key>/attestations/code-manifest.json` | `.forgeloop/state.sqlite :: task_artifacts (attestation)` | `.forgeloop/task-state/<task-key>/attestations/code-manifest.json` | `code-manifest` | Protocol Generated | Immutable Once Written | Content Integrity Snapshot |
58
+ | `.forgeloop/task-state/<task-key>/attestations/statement.json` | `.forgeloop/state.sqlite :: task_artifacts (attestation)` | `.forgeloop/task-state/<task-key>/attestations/statement.json` | `in-toto-statement` | Protocol Compiled | Immutable Once Written | Code Attestation Statement |
59
+ | `.forgeloop/task-state/<task-key>/attestations/statement.sigstore.json` | `.forgeloop/state.sqlite :: attachment_references` | `.forgeloop/attachments/objects/<sha256>` | `null` | External Signing Provider | External Immutable | External Signature Bundle |
60
+ | `.forgeloop/task-state/<task-key>/decisions/<decision-id>.json` | `.forgeloop/state.sqlite :: task_artifacts (decision)` | `.forgeloop/task-state/<task-key>/decisions/<decision-id>.json` | `semantic-decision` | Protocol Compiled | Immutable Once Written | Semantic Decision |
61
+ | `.forgeloop/task-state/<task-key>/test-utility.json` | `.forgeloop/state.sqlite :: task_artifacts (testUtility)` | `.forgeloop/task-state/<task-key>/test-utility.json` | `test-utility` | Protocol Compiled | Overwritten On Analysis | Non Evidence Test Analysis |
47
62
 
48
63
  <!-- END FORGELOOP GENERATED: artifact-registry -->
49
64
 
@@ -51,6 +66,99 @@ All artifact schemas are defined in `schemas/*.schema.json`. Persisted artifact
51
66
 
52
67
  ## 2. Canonical Artifact Specifications
53
68
 
69
+ ### 2.0 `semantic-decision`
70
+
71
+ <!-- forgeloop-doc: schema=semantic-decision artifact=.forgeloop/task-state/<task-key>/decisions/<decision-id>.json -->
72
+
73
+ Semantic decisions are advisory, fingerprint-bound projections. They do not
74
+ authorize lifecycle transitions, evidence, ownership, installation, or
75
+ completion.
76
+
77
+ <!-- BEGIN FORGELOOP GENERATED: schema:semantic-decision -->
78
+
79
+ - `schemaVersion` *(number, required, const: 1)*
80
+ - `protocolVersion` *(number, required, const: 1)*
81
+ - `taskId` *(string, required, minLength: 1)*
82
+ - `decisionId` *(string, required, pattern: `^[A-Za-z0-9][A-Za-z0-9_-]{0,127}$`)*
83
+ - `decisionKind` *(string, required, minLength: 1)*
84
+ - `engine` *(string, required, const: `typesafe-jev`)*
85
+ - `model` *(string, required, const: `jev-1.13.0`)*
86
+ - `questionSetId` *(string, required, minLength: 1)*
87
+ - `questionSetVersion` *(integer, required, minimum: 1)*
88
+ - `questionSetFingerprint` *(string, required, pattern: `^[a-f0-9]{64}$`)*
89
+ - `questionSet` *(object, optional)*
90
+ - `id` *(string, required, minLength: 1)*
91
+ - `version` *(integer, required, minimum: 1)*
92
+ - `decisionKind` *(string, required, minLength: 1)*
93
+ - `questions` *(object, required)*
94
+ - `fingerprint` *(string, required, pattern: `^[a-f0-9]{64}$`)*
95
+ - `candidateIds` *(array<string>, optional)*
96
+ - `metadata` *(object, optional)*
97
+ - `policyVersion` *(number, required, const: 1)*
98
+ - `stateFingerprint` *(string, required, pattern: `^[a-f0-9]{64}$`)*
99
+ - `taskStateFingerprint` *(string or null, optional)*
100
+ - `semanticStateFingerprint` *(string or null, optional)*
101
+ - `policyFingerprint` *(string, required, pattern: `^[a-f0-9]{64}$`)*
102
+ - `repositoryFingerprint` *(string or object or null, optional)*
103
+ - `contractFingerprint` *(string or null, optional)*
104
+ - `routeFingerprint` *(string or null, optional)*
105
+ - `verificationCycle` *(integer or null, optional)*
106
+ - `candidateSetFingerprint` *(string or null, optional)*
107
+ - `answers` *(object, required)*
108
+ - `confidence` *(object, required)*
109
+ - `decision` *(object, required)*
110
+ - `usage` *(object, required)*
111
+ - `inputTokens` *(integer or null, required)*
112
+ - `outputTokens` *(integer or null, required)*
113
+ - `reportedBy` *(string, required, enum: `PROVIDER`, `HOST`, `UNKNOWN`)*
114
+ - `latencyMs` *(integer or null, optional)*
115
+ - `authority` *(string, required, const: `SEMANTIC_DECISION`)*
116
+ - `evidenceAuthority` *(string, required, const: `NONE`)*
117
+ - `lifecycleAuthority` *(boolean, required, const: false)*
118
+ - `completionAuthority` *(boolean, required, const: false)*
119
+ - `ownershipAuthority` *(boolean, required, const: false)*
120
+ - `installationAuthority` *(boolean, required, const: false)*
121
+ - `recordedAt` *(string, required, minLength: 1)*
122
+
123
+ <!-- END FORGELOOP GENERATED: schema:semantic-decision -->
124
+
125
+ ### 2.0.1 `test-utility`
126
+
127
+ <!-- forgeloop-doc: schema=test-utility artifact=.forgeloop/task-state/<task-key>/test-utility.json -->
128
+
129
+ Non-evidence test inventory and utility analysis. It never authorizes deletion
130
+ or completion.
131
+
132
+ <!-- BEGIN FORGELOOP GENERATED: schema:test-utility -->
133
+
134
+ - `schemaVersion` *(number, required, const: 1)*
135
+ - `protocolVersion` *(number, required, const: 1)*
136
+ - `taskId` *(string, required, minLength: 1)*
137
+ - `generatedAt` *(string, required, minLength: 1)*
138
+ - `inventoryFingerprint` *(string, required, pattern: `^[a-f0-9]{64}$`)*
139
+ - `semanticStatus` *(string, required, enum: `PROVIDER_REPORTED`, `UNAVAILABLE`, `NOT_REQUESTED`)*
140
+ - `decisionId` *(string, optional, pattern: `^[A-Za-z0-9][A-Za-z0-9_-]{0,127}$`)*
141
+ - `semanticDecisionFingerprint` *(string, optional, pattern: `^[a-f0-9]{64}$`)*
142
+ - `decisionIds` *(array<string>, optional)*
143
+ - `semanticDecisionFingerprints` *(array<string>, optional)*
144
+ - `tests` *(array<object>, required)*
145
+ - `testId` *(string, required, pattern: `^test-[a-f0-9]{24}$`)*
146
+ - `file` *(string, required, minLength: 1)*
147
+ - `framework` *(string, required, minLength: 1)*
148
+ - `suite` *(string, optional)*
149
+ - `name` *(string, required, minLength: 1)*
150
+ - `line` *(integer, optional, minimum: 1)*
151
+ - `sourceSummary` *(string, optional)*
152
+ - `targets` *(array<string>, optional)*
153
+ - `runtimeMs` *(number,null, optional, minimum: 0)*
154
+ - `uniqueBranches` *(integer,null, optional, minimum: 0)*
155
+ - `classification` *(string, required, enum: `KEEP_REQUIRED`, `KEEP_UNIQUE`, `KEEP_RISK_GUARD`, `KEEP_AUTHORITY_BOUNDARY`, `KEEP_RECOVERY_INVARIANT`, `KEEP_RELEASE_SMOKE`, `KEEP_MIGRATION_COMPATIBILITY`, `KEEP_PLATFORM_BEHAVIOR`, `KEEP_DOCUMENTATION_VALUE`, `KEEP_INTEGRATION_GUARD`, `OBSOLETE_CANDIDATE`, `FLAKY_LOW_SIGNAL`, `EXPENSIVE_LOW_SIGNAL`, `UNKNOWN`, `REDUNDANT_CANDIDATE`)*
156
+ - `recommendation` *(string, required, enum: `KEEP`, `REWRITE`, `PROBE_REMOVAL`, `BLOCKED`, `REVIEW`)*
157
+ - `protected` *(boolean, required)*
158
+ - `signals` *(object, optional)*
159
+
160
+ <!-- END FORGELOOP GENERATED: schema:test-utility -->
161
+
54
162
  ### 2.1 `task-state/<taskKey>/contract.json`
55
163
 
56
164
  <!-- forgeloop-doc: schema=current-contract artifact=.forgeloop/task-state/<task-key>/contract.json -->
@@ -178,6 +286,11 @@ Readiness attestation evaluated prior to implementation.
178
286
 
179
287
  Discovered repository facts, platforms, runtimes, and dependencies.
180
288
 
289
+ Built-in `contract-preset:documentation`, `contract-preset:bug`,
290
+ `contract-preset:feature`, and `contract-preset:release` references are
291
+ ForgeLoop-owned provenance and do not require an entry in this registry. Every
292
+ other contract source reference still requires a valid registry entry.
293
+
181
294
  #### Canonical Fields
182
295
 
183
296
  <!-- BEGIN FORGELOOP GENERATED: schema:source-registry -->
@@ -252,6 +365,14 @@ Local ForgeLoop configuration settings and policy bindings.
252
365
  - `policy` *(string, optional, minLength: 1)*
253
366
  - `requiredGates` *(array<string>, optional)*
254
367
  - `requiredEvidence` *(array<string>, optional)*
368
+ - `decisionEngine` *(object, optional)*
369
+ - `required` *(boolean, required, const: true)*
370
+ - `provider` *(string, required, const: `typesafe-jev`)*
371
+ - `model` *(string, required, const: `jev-1.13.0`)*
372
+ - `policyVersion` *(number, required, const: 1)*
373
+ - `requestTimeoutMs` *(integer, required, minimum: 500, maximum: 60000)*
374
+ - `maxRetries` *(integer, required, minimum: 0, maximum: 3)*
375
+ - `cache` *(boolean, required)*
255
376
  - `structuralQuality` *(object, optional)*
256
377
  - `mode` *(string, optional, enum: `off`, `observe`, `gate`)*
257
378
  - `provider` *(string, optional, pattern: `^[a-z][a-z0-9-]{0,63}$`)*
@@ -304,6 +425,21 @@ Local ForgeLoop configuration settings and policy bindings.
304
425
 
305
426
  Pre-implementation gate approval artifact recording decisions, bound artifact hashes, and evidence.
306
427
 
428
+ Use `node src/cli.js gate-record` to create or replace this artifact. The
429
+ command computes SHA-256 values from project-relative regular files; callers
430
+ must not provide digests or edit gate JSON manually. Preflight checks these
431
+ hashes for staleness, and gate mutation is available only before execution.
432
+ Caller-recorded evidence is descriptive local input, not host attestation,
433
+ ForgeLoop execution evidence, or remote authority.
434
+
435
+ `requiredBy` records only the provenance that actually requires the gate:
436
+ guides whose metadata declares it, plus the stable `config.requiredGates`
437
+ marker when `config.requiredGates` requires it. Programmatic gate-record
438
+ inputs are bounded (32 repeatable entries, 2000-character strings, 4 MiB
439
+ per bound artifact, 64 KiB per evidence file) and refuse stale routes when
440
+ the persisted route, work state, or current contract fingerprints no longer
441
+ agree, before any gate is written.
442
+
307
443
  #### Canonical Fields
308
444
 
309
445
  <!-- BEGIN FORGELOOP GENERATED: schema:gate -->
@@ -0,0 +1,46 @@
1
+ # Audit UX read model
2
+
3
+ `task/audit-view` is a bounded, read-only Integration API resource for audit
4
+ and operator interfaces. It composes canonical ForgeLoop projections; it does
5
+ not become a second lifecycle, evidence, ownership, or completion authority.
6
+
7
+ ```js
8
+ import { readForgeLoopIntegrationResource } from "@cassiomc1/forgeloop/integration";
9
+
10
+ const view = await readForgeLoopIntegrationResource("task/audit-view", {
11
+ taskId: "task-1",
12
+ limit: 50,
13
+ categories: ["LIFECYCLE", "CHECK", "DIAGNOSTIC"],
14
+ });
15
+ ```
16
+
17
+ The projection includes lifecycle and health; a deterministic sequence-backed
18
+ timeline with explicit `null` timestamps when the ledger has no authoritative
19
+ timestamp; bounded checks, attempts, diagnostics, approvals, durable-action
20
+ summaries, recovery history, completion status, and canonical ownership; and
21
+ integrity and reason-code summaries that remain fail-closed when source
22
+ projections are inconsistent.
23
+
24
+ Timeline pagination accepts `limit`, `beforeSequence`, `afterSequence`, and a
25
+ bounded category allowlist. Without a cursor, the latest bounded page is
26
+ returned. `beforeSequence` performs backward pagination and returns the
27
+ nearest earlier matching events; its `nextBeforeSequence` cursor is the first
28
+ returned sequence when another page exists. `afterSequence` performs forward
29
+ pagination and returns the earliest later matching events; its
30
+ `nextAfterSequence` cursor is the last returned sequence when another page
31
+ exists. Pages never skip matching sequence numbers within the filtered event
32
+ stream, and combining the two cursors is rejected.
33
+
34
+ The projection redacts general POSIX (including single-segment), Windows, UNC,
35
+ and local `file://` absolute paths; environment assignments; common credential
36
+ assignments; authorization headers; complete `Cookie` and `Set-Cookie` header
37
+ values; and URL userinfo credentials. It does not return raw event payloads,
38
+ commands, or provider output. These are presentation-boundary redactions, not a
39
+ replacement for secret-handling controls at the source. The resource never
40
+ invokes a provider, executes a command, writes an artifact, changes lifecycle
41
+ state, or releases claims.
42
+
43
+ `auditUx` is advertised during capability discovery with version `1` and
44
+ `readOnly: true`. Hosts must use the canonical CLI/API lifecycle commands for
45
+ all mutations and must treat this view as presentation and diagnostic context
46
+ only.
@@ -0,0 +1,136 @@
1
+ # Browser Verification
2
+
3
+ ## Status
4
+
5
+ Browser verification is a provider-neutral, host-injected v1 observation
6
+ contract. It is experimental and explicit. ForgeLoop does not select a browser
7
+ vendor, install a browser, or invoke verification from lifecycle commands.
8
+
9
+ ## Purpose and Architecture
10
+
11
+ `runBrowserVerification` validates a bounded request, resolves one registered
12
+ provider, and turns its untrusted observation into an immutable result. Core
13
+ does not perform browser I/O. The runtime registry is inert at context
14
+ construction; factories are lazy and are invoked only by the explicit API call.
15
+
16
+ ## Invocation
17
+
18
+ Provide an explicit task, target, requirement, and verification identity along
19
+ with `runtimeContext.browserVerificationProviders`:
20
+
21
+ ```js
22
+ const result = await runBrowserVerification({
23
+ taskId: "task-123",
24
+ target: "/workspace/project",
25
+ providerName: "playwright",
26
+ verificationId: "checkout",
27
+ requirement: "Checkout is usable",
28
+ startUrl: "https://app.example.test/checkout",
29
+ allowedOrigins: ["https://app.example.test"],
30
+ steps: [{ id: "open", kind: "NAVIGATE", url: "https://app.example.test/checkout" }],
31
+ assertions: [{ id: "title", kind: "TITLE_EQUALS", expected: "Checkout" }],
32
+ runtimeContext: { browserVerificationProviders: { playwright: provider } },
33
+ });
34
+ ```
35
+
36
+ Providers are registered by ID and must expose `verify(input)`. Factories are
37
+ lazy and are resolved only when the explicit invocation runs. Provider input
38
+ contains the normalized request, `signal`, and remaining `timeoutMs`. The
39
+ `AbortSignal` is an invocation control, not protocol state.
40
+
41
+ ## Request Model
42
+
43
+ Requests require `taskId`, `target` (or `projectPath`), `verificationId`,
44
+ `requirement`, `startUrl`, `allowedOrigins`, at least one bounded step, and at
45
+ least one bounded assertion. Optional viewport, screenshot capture policy, and
46
+ timeout values are bounded. Unknown request, step, locator, assertion, capture,
47
+ or viewport fields are rejected. Arbitrary scripts, headers, cookies, uploads,
48
+ downloads, shell commands, and executable paths are not part of this contract.
49
+
50
+ Supported steps are `NAVIGATE`, `CLICK`, `FILL`, `PRESS`, and `WAIT_FOR`.
51
+ Supported assertions include visibility, text, value, attribute, URL, title,
52
+ and their documented bounded variants. Assertion results must match the
53
+ requested IDs, kinds, cardinality, and order exactly.
54
+
55
+ `WAIT_FOR` is strict: visibility, hidden-state, and text waits require a
56
+ locator; text and URL waits require an expected value, and URL wait values must
57
+ also be in the exact origin allowlist.
58
+
59
+ ## Origins and Navigation
60
+
61
+ Authored URLs and provider-reported `finalUrl` and `navigations` must use
62
+ `http:` or `https:`, contain no credentials, and have an exact origin in
63
+ `allowedOrigins`. Hostnames are case-normalized and trailing-dot hostnames are
64
+ rejected. `localhost` and IPv4 origins are supported; bracketed IPv6 literals
65
+ are intentionally excluded in v1. The allowlist is an observation policy, not
66
+ a network sandbox: providers remain responsible for browser network access.
67
+
68
+ ## Result Model
69
+
70
+ The normalized result contains task and requirement binding, provider identity,
71
+ assertions, final navigation state, diagnostics, optional accessibility
72
+ snapshots, and structured screenshot metadata. Raw image bytes are never
73
+ returned. Artifact references are portable, bounded, credential-free metadata
74
+ with a lowercase SHA-256 digest.
75
+
76
+ ForgeLoop derives overall status: any `FAIL` assertion yields `FAIL`, otherwise
77
+ any `BLOCKED` yields `BLOCKED`, otherwise all assertions yield `PASS`. A raw
78
+ provider status is optional and, when present, must match that derived value.
79
+ Provider output cannot choose lifecycle state, evidence, completion, claims, or
80
+ next actions. Unknown top-level fields and authority-bearing fields fail closed.
81
+
82
+ Snapshots are optional explicit `ACCESSIBILITY` observations with bounded
83
+ portable text. They are never assertion status or authority.
84
+
85
+ ## Timeout and Cancellation
86
+
87
+ Factory resolution, provider validation, provider verification, and result
88
+ normalization share one ForgeLoop-owned deadline. On expiry ForgeLoop aborts
89
+ the shared signal, allows only bounded cooperative cleanup, and returns
90
+ `E_BROWSER_VERIFICATION_TIMEOUT`. Late provider resolution cannot change the
91
+ returned result. Providers must observe the signal and clean up resources they
92
+ own; synchronous JavaScript cannot be forcibly preempted.
93
+
94
+ ## Trust Boundary and Credentials
95
+
96
+ Provider output is untrusted and normalized under strict size limits. Results
97
+ are stamped with `authority: "OBSERVATION"`, `evidenceAuthority: "NONE"`,
98
+ `actionability: "NON_EXECUTABLE"`, `lifecycleAuthority: false`, and
99
+ `completionAuthority: false`. Provider output cannot substitute for ForgeLoop
100
+ validation or lifecycle evidence.
101
+
102
+ Provider errors are mapped to generic, secret-safe public errors. Raw causes,
103
+ stacks, stderr, cookies, tokens, signed URLs, and local paths are not public
104
+ metadata. Credentials must not be placed in requests, URLs, artifacts,
105
+ diagnostics, or snapshots.
106
+
107
+ ## Evidence Boundary
108
+
109
+ Results are observation-only: `persisted: false`, `evidenceAuthority: "NONE"`,
110
+ `completionAuthority: false`, and `evidenceRequiresForgeLoopValidation: true`.
111
+ Running this API does not mutate tasks, claims, routes, contracts, events,
112
+ receipts, checks, evidence, recovery, or actions.
113
+
114
+ ## Network and Session Semantics
115
+
116
+ The origin allowlist does not provide browser isolation or prevent provider
117
+ network access. Providers own browser sessions and must not reuse credentials
118
+ or session state across unrelated invocations. No automatic browser install,
119
+ executable discovery, browser adapter, or auto-invocation is provided.
120
+
121
+ ## Future Adapters and Troubleshooting
122
+
123
+ The optional Agent Browser adapter implements this provider contract through
124
+ `createAgentBrowserVerificationProvider`. It requires a host-supplied absolute
125
+ executable and never installs Agent Browser or Chrome. No vendor is canonical,
126
+ and no lifecycle command invokes the adapter. See
127
+ [`AGENT_BROWSER_ADAPTER.md`](./AGENT_BROWSER_ADAPTER.md) for its process,
128
+ session, screenshot, and troubleshooting boundaries. For malformed requests,
129
+ invalid results, origin escapes, provider failures, and timeouts, use the
130
+ stable error codes in `docs/TROUBLESHOOTING.md`.
131
+
132
+ ## Compatibility
133
+
134
+ The canonical public operation is `runBrowserVerification`. The runtime
135
+ registration key remains `browserVerificationProviders`, and the provider kind
136
+ remains `BROWSER_VERIFICATION`.