forgeos 0.1.0-alpha.7 → 0.1.0-alpha.70

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 (582) hide show
  1. package/.agents/skills/forge-agent-fabric/SKILL.md +169 -0
  2. package/.agents/skills/forge-agent-fabric/references/managed-workflows.md +95 -0
  3. package/.agents/skills/forge-agent-fabric/references/repository-analysis.md +102 -0
  4. package/.agents/skills/forge-agent-fabric/scripts/fabric.mjs +46 -0
  5. package/.agents/skills/forge-agent-fabric/scripts/repository.mjs +44 -0
  6. package/.npmignore +10 -0
  7. package/AGENTS.md +142 -90
  8. package/CHANGELOG.md +864 -9
  9. package/LICENSE +21 -0
  10. package/README.md +121 -6
  11. package/adapters/go/README.md +23 -0
  12. package/adapters/go/go.mod +3 -0
  13. package/adapters/go/http.go +149 -0
  14. package/adapters/go/registry.go +234 -0
  15. package/adapters/go/types.go +136 -0
  16. package/adapters/java/README.md +68 -0
  17. package/adapters/java/pom.xml +47 -0
  18. package/adapters/java/src/main/java/dev/forgeos/adapter/Auth.java +20 -0
  19. package/adapters/java/src/main/java/dev/forgeos/adapter/Diagnostic.java +16 -0
  20. package/adapters/java/src/main/java/dev/forgeos/adapter/Entry.java +38 -0
  21. package/adapters/java/src/main/java/dev/forgeos/adapter/EntryKind.java +16 -0
  22. package/adapters/java/src/main/java/dev/forgeos/adapter/ErrorInfo.java +4 -0
  23. package/adapters/java/src/main/java/dev/forgeos/adapter/Forge.java +94 -0
  24. package/adapters/java/src/main/java/dev/forgeos/adapter/ForgeCall.java +12 -0
  25. package/adapters/java/src/main/java/dev/forgeos/adapter/ForgeContext.java +11 -0
  26. package/adapters/java/src/main/java/dev/forgeos/adapter/ForgeHandler.java +8 -0
  27. package/adapters/java/src/main/java/dev/forgeos/adapter/ForgeHttpHandler.java +179 -0
  28. package/adapters/java/src/main/java/dev/forgeos/adapter/ForgeRegistry.java +121 -0
  29. package/adapters/java/src/main/java/dev/forgeos/adapter/Json.java +14 -0
  30. package/adapters/java/src/main/java/dev/forgeos/adapter/Manifest.java +14 -0
  31. package/adapters/java/src/main/java/dev/forgeos/adapter/RequestEnvelope.java +6 -0
  32. package/adapters/java/src/main/java/dev/forgeos/adapter/ResponseEnvelope.java +25 -0
  33. package/adapters/java/src/main/java/dev/forgeos/adapter/Risk.java +18 -0
  34. package/adapters/java/src/main/java/dev/forgeos/adapter/Schemas.java +36 -0
  35. package/adapters/java/src/main/java/dev/forgeos/adapter/Service.java +65 -0
  36. package/adapters/java/src/main/java/dev/forgeos/adapter/TransactionMode.java +18 -0
  37. package/adapters/java/src/main/java/dev/forgeos/adapter/TypedForgeHandler.java +6 -0
  38. package/adapters/java-spring-boot-starter/README.md +32 -0
  39. package/adapters/java-spring-boot-starter/pom.xml +49 -0
  40. package/adapters/java-spring-boot-starter/src/main/java/dev/forgeos/adapter/spring/ForgeCommand.java +22 -0
  41. package/adapters/java-spring-boot-starter/src/main/java/dev/forgeos/adapter/spring/ForgeExternalService.java +15 -0
  42. package/adapters/java-spring-boot-starter/src/main/java/dev/forgeos/adapter/spring/ForgeQuery.java +16 -0
  43. package/adapters/java-spring-boot-starter/src/main/java/dev/forgeos/adapter/spring/ForgeServiceBeanCondition.java +18 -0
  44. package/adapters/java-spring-boot-starter/src/main/java/dev/forgeos/adapter/spring/ForgeSpringAutoConfiguration.java +16 -0
  45. package/adapters/java-spring-boot-starter/src/main/java/dev/forgeos/adapter/spring/ForgeSpringRuntime.java +104 -0
  46. package/adapters/java-spring-boot-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports +1 -0
  47. package/bin/forge.mjs +18 -0
  48. package/docs/agent-fabric-programs.md +168 -0
  49. package/docs/agent-fabric.md +584 -0
  50. package/docs/architecture/agent-fabric/PORTABLE_PROJECTS_PLAN.md +136 -0
  51. package/docs/architecture/agent-fabric/README.md +180 -0
  52. package/docs/architecture/agent-fabric/REPOSITORY_MANIFEST_PLAN.md +284 -0
  53. package/docs/architecture/agent-fabric/WORKFLOW_PROGRAM_V2_ADR.md +41 -0
  54. package/docs/architecture/agent-fabric/WORKFLOW_PROGRAM_V2_EVIDENCE.md +109 -0
  55. package/docs/architecture/agent-fabric/WORKFLOW_PROGRAM_V2_PLAN.md +550 -0
  56. package/docs/cair-protocol.md +103 -0
  57. package/docs/changelog.md +1070 -0
  58. package/docs/forge-protocol.md +189 -0
  59. package/docs/repository-agent-benchmark.md +179 -0
  60. package/docs/repository-analysis.md +139 -0
  61. package/docs/repository-context-quality.md +179 -0
  62. package/docs/repository-runtime-observation.md +82 -0
  63. package/examples/agent-fabric-v2/README.md +54 -0
  64. package/examples/agent-fabric-v2/make-request.mjs +4 -0
  65. package/examples/agent-fabric-v2/migrate.workflow.ts +35 -0
  66. package/examples/agent-fabric-v2/registry.example.json +256 -0
  67. package/examples/agent-fabric-v2/workers/check.mjs +2 -0
  68. package/examples/agent-fabric-v2/workers/common.mjs +7 -0
  69. package/examples/agent-fabric-v2/workers/discover.mjs +2 -0
  70. package/examples/agent-fabric-v2/workers/migrate.mjs +4 -0
  71. package/examples/agent-fabric-v2/workers/review.mjs +3 -0
  72. package/examples/go-billing/go.mod +7 -0
  73. package/examples/go-billing/main.go +120 -0
  74. package/examples/java-billing/pom.xml +60 -0
  75. package/examples/java-billing/src/main/java/dev/forgeos/examples/billing/CreateInvoiceInput.java +4 -0
  76. package/examples/java-billing/src/main/java/dev/forgeos/examples/billing/Invoice.java +11 -0
  77. package/examples/java-billing/src/main/java/dev/forgeos/examples/billing/Main.java +127 -0
  78. package/package.json +58 -5
  79. package/schemas/agent-fabric/v0.1/control-event.schema.json +281 -0
  80. package/schemas/forge-manifest.schema.json +389 -0
  81. package/scripts/field-test-forgeos.mjs +1021 -0
  82. package/scripts/install-agent-fabric-skill.mjs +105 -0
  83. package/src/forge/_generated/releaseManifest.json +1 -2
  84. package/src/forge/_generated/releaseManifest.ts +3 -3
  85. package/src/forge/agent-adapters/index.ts +1592 -125
  86. package/src/forge/agent-adapters/types.ts +225 -1
  87. package/src/forge/agent-fabric/adapter.ts +131 -0
  88. package/src/forge/agent-fabric/attached-snapshot.ts +55 -0
  89. package/src/forge/agent-fabric/attached-task-contract.ts +105 -0
  90. package/src/forge/agent-fabric/attached-task-service.ts +127 -0
  91. package/src/forge/agent-fabric/attached-task-store.ts +109 -0
  92. package/src/forge/agent-fabric/authority.ts +298 -0
  93. package/src/forge/agent-fabric/canonical.ts +135 -0
  94. package/src/forge/agent-fabric/codex-adversarial-review.ts +229 -0
  95. package/src/forge/agent-fabric/codex-sdk-worker.ts +201 -0
  96. package/src/forge/agent-fabric/conductor.ts +754 -0
  97. package/src/forge/agent-fabric/dictionary.ts +12 -0
  98. package/src/forge/agent-fabric/errors.ts +32 -0
  99. package/src/forge/agent-fabric/hardened-conductor.ts +485 -0
  100. package/src/forge/agent-fabric/hardened-reducer.ts +211 -0
  101. package/src/forge/agent-fabric/index.ts +48 -0
  102. package/src/forge/agent-fabric/journal.ts +116 -0
  103. package/src/forge/agent-fabric/local-adaptive-digest-worker.mjs +26 -0
  104. package/src/forge/agent-fabric/local-adaptive-harness.ts +343 -0
  105. package/src/forge/agent-fabric/local-adaptive-service.ts +398 -0
  106. package/src/forge/agent-fabric/local-adaptive-worker.ts +146 -0
  107. package/src/forge/agent-fabric/local-approval-window.ts +211 -0
  108. package/src/forge/agent-fabric/local-change-review-service.ts +374 -0
  109. package/src/forge/agent-fabric/local-coding-worker.ts +285 -0
  110. package/src/forge/agent-fabric/local-control-store.ts +239 -0
  111. package/src/forge/agent-fabric/local-effect-broker.ts +348 -0
  112. package/src/forge/agent-fabric/local-evolution-approval.ts +81 -0
  113. package/src/forge/agent-fabric/local-evolution-profile.ts +87 -0
  114. package/src/forge/agent-fabric/local-evolution-registry.ts +427 -0
  115. package/src/forge/agent-fabric/local-evolution-service.ts +200 -0
  116. package/src/forge/agent-fabric/local-intelligence.ts +281 -0
  117. package/src/forge/agent-fabric/local-paths.ts +18 -0
  118. package/src/forge/agent-fabric/local-task-contract.ts +203 -0
  119. package/src/forge/agent-fabric/local-task-inbox.ts +543 -0
  120. package/src/forge/agent-fabric/local-task-server.ts +374 -0
  121. package/src/forge/agent-fabric/local-task-service.ts +982 -0
  122. package/src/forge/agent-fabric/local-verification.ts +551 -0
  123. package/src/forge/agent-fabric/managed-environment.ts +205 -0
  124. package/src/forge/agent-fabric/managed-run-contract.ts +103 -0
  125. package/src/forge/agent-fabric/managed-run-service.ts +401 -0
  126. package/src/forge/agent-fabric/managed-run-store.ts +165 -0
  127. package/src/forge/agent-fabric/managed-workspace.ts +253 -0
  128. package/src/forge/agent-fabric/p0a.ts +104 -0
  129. package/src/forge/agent-fabric/p0b-model-adapter.ts +434 -0
  130. package/src/forge/agent-fabric/planning.ts +155 -0
  131. package/src/forge/agent-fabric/program-contract.ts +229 -0
  132. package/src/forge/agent-fabric/program-dsl.ts +112 -0
  133. package/src/forge/agent-fabric/program-service.ts +619 -0
  134. package/src/forge/agent-fabric/program-store.ts +117 -0
  135. package/src/forge/agent-fabric/program-types.ts +98 -0
  136. package/src/forge/agent-fabric/program-worker.ts +91 -0
  137. package/src/forge/agent-fabric/project-profile.ts +50 -0
  138. package/src/forge/agent-fabric/project-registry.ts +120 -0
  139. package/src/forge/agent-fabric/project-runtime.ts +85 -0
  140. package/src/forge/agent-fabric/readiness.ts +26 -0
  141. package/src/forge/agent-fabric/reducer.ts +863 -0
  142. package/src/forge/agent-fabric/repository-context.ts +83 -0
  143. package/src/forge/agent-fabric/resource-ledger.ts +266 -0
  144. package/src/forge/agent-fabric/serialized-local-adapter.ts +60 -0
  145. package/src/forge/agent-fabric/types.ts +424 -0
  146. package/src/forge/agent-fabric/validation.ts +500 -0
  147. package/src/forge/agent-fabric/workflow-engine.ts +218 -0
  148. package/src/forge/agent-fabric/workflow-task-actions.ts +104 -0
  149. package/src/forge/agent-fabric/workflow-templates.ts +11 -0
  150. package/src/forge/agent-memory/bridge.ts +1728 -0
  151. package/src/forge/agent-memory/context-pack.ts +284 -0
  152. package/src/forge/agent-memory/hook-runner.ts +331 -0
  153. package/src/forge/agent-memory/mcp.ts +597 -0
  154. package/src/forge/agent-memory/normalize.ts +498 -0
  155. package/src/forge/agent-memory/redaction.ts +103 -0
  156. package/src/forge/agent-memory/sources/claude-code.ts +51 -0
  157. package/src/forge/agent-memory/sources/codex-hook-runner.mjs +343 -0
  158. package/src/forge/agent-memory/sources/codex.ts +161 -0
  159. package/src/forge/agent-memory/sources/cursor.ts +35 -0
  160. package/src/forge/agent-memory/types.ts +215 -0
  161. package/src/forge/bench.ts +248 -0
  162. package/src/forge/brownfield-import/index.ts +896 -0
  163. package/src/forge/brownfield-import/types.ts +127 -0
  164. package/src/forge/cair/action-journal.ts +61 -0
  165. package/src/forge/cair/action-parser.ts +314 -0
  166. package/src/forge/cair/action-validator.ts +40 -0
  167. package/src/forge/cair/actions.ts +1818 -0
  168. package/src/forge/cair/format.ts +77 -0
  169. package/src/forge/cair/index.ts +118 -0
  170. package/src/forge/cair/query.ts +478 -0
  171. package/src/forge/cair/snapshot.ts +315 -0
  172. package/src/forge/cair/types.ts +255 -0
  173. package/src/forge/cli/adaptive.ts +51 -0
  174. package/src/forge/cli/ai.ts +16 -1
  175. package/src/forge/cli/auth.ts +459 -15
  176. package/src/forge/cli/authmd.ts +441 -0
  177. package/src/forge/cli/baseline.ts +112 -0
  178. package/src/forge/cli/build.ts +20 -4
  179. package/src/forge/cli/changed.ts +418 -0
  180. package/src/forge/cli/codex-app-server.ts +877 -0
  181. package/src/forge/cli/commands.ts +1859 -20
  182. package/src/forge/cli/db.ts +209 -2
  183. package/src/forge/cli/deploy.ts +1339 -0
  184. package/src/forge/cli/deps.ts +150 -23
  185. package/src/forge/cli/dev.ts +1137 -53
  186. package/src/forge/cli/docs.ts +265 -0
  187. package/src/forge/cli/doctor.ts +297 -0
  188. package/src/forge/cli/env-placeholders.ts +62 -0
  189. package/src/forge/cli/evolution.ts +40 -0
  190. package/src/forge/cli/fabric.ts +253 -0
  191. package/src/forge/cli/field-test.ts +568 -0
  192. package/src/forge/cli/golden-path.ts +487 -0
  193. package/src/forge/cli/handoff.ts +336 -0
  194. package/src/forge/cli/index.ts +1 -0
  195. package/src/forge/cli/last-run.ts +84 -0
  196. package/src/forge/cli/main.ts +194 -3
  197. package/src/forge/cli/new.ts +169 -17
  198. package/src/forge/cli/next-actions.ts +23 -0
  199. package/src/forge/cli/output.ts +398 -6
  200. package/src/forge/cli/parse.ts +1377 -38
  201. package/src/forge/cli/progress.ts +51 -0
  202. package/src/forge/cli/query.ts +32 -0
  203. package/src/forge/cli/release.ts +35 -11
  204. package/src/forge/cli/repository.ts +151 -0
  205. package/src/forge/cli/run.ts +42 -0
  206. package/src/forge/cli/secrets.ts +137 -1
  207. package/src/forge/cli/seed.ts +581 -0
  208. package/src/forge/cli/self-host.ts +56 -14
  209. package/src/forge/cli/studio.ts +2282 -0
  210. package/src/forge/cli/verify.ts +1458 -32
  211. package/src/forge/cli/windows.ts +23 -0
  212. package/src/forge/cli/workos.ts +3509 -0
  213. package/src/forge/compiler/agent-contract/build.ts +728 -64
  214. package/src/forge/compiler/agent-contract/types.ts +45 -2
  215. package/src/forge/compiler/ai-registry/parse.ts +71 -2
  216. package/src/forge/compiler/api-surface/build.ts +47 -0
  217. package/src/forge/compiler/app-graph/build.ts +112 -9
  218. package/src/forge/compiler/app-graph/extract.ts +107 -0
  219. package/src/forge/compiler/app-graph/module-graph.ts +73 -78
  220. package/src/forge/compiler/app-graph/parser.ts +24 -24
  221. package/src/forge/compiler/app-graph/profile.ts +26 -0
  222. package/src/forge/compiler/app-graph/tsconfig-hash.ts +41 -4
  223. package/src/forge/compiler/app-graph/versions.ts +1 -1
  224. package/src/forge/compiler/classifier/capabilities.ts +3 -2
  225. package/src/forge/compiler/classifier/classify.ts +32 -8
  226. package/src/forge/compiler/classifier/secrets.ts +3 -2
  227. package/src/forge/compiler/classifier/signals.ts +91 -1
  228. package/src/forge/compiler/client-sdk/build-manifest.ts +59 -0
  229. package/src/forge/compiler/client-sdk/render-client.ts +295 -13
  230. package/src/forge/compiler/data-graph/build.ts +29 -1
  231. package/src/forge/compiler/data-graph/parse.ts +20 -4
  232. package/src/forge/compiler/data-graph/sql/ddl.ts +144 -31
  233. package/src/forge/compiler/data-graph/sql/serialize.ts +4 -0
  234. package/src/forge/compiler/data-graph/sql/types.ts +1 -0
  235. package/src/forge/compiler/diagnostics/codes.ts +38 -0
  236. package/src/forge/compiler/diagnostics/create.ts +28 -2
  237. package/src/forge/compiler/diagnostics/index.ts +2 -0
  238. package/src/forge/compiler/emitter/barrel.ts +3 -0
  239. package/src/forge/compiler/emitter/render.ts +9 -0
  240. package/src/forge/compiler/external-manifest/registry.ts +217 -0
  241. package/src/forge/compiler/external-manifest/types.ts +91 -0
  242. package/src/forge/compiler/external-manifest/validate.ts +373 -0
  243. package/src/forge/compiler/frontend-graph/build.ts +142 -14
  244. package/src/forge/compiler/integration/add.ts +991 -33
  245. package/src/forge/compiler/integration/plan.ts +43 -12
  246. package/src/forge/compiler/integration/render.ts +29 -0
  247. package/src/forge/compiler/integration/snapshot.ts +2 -0
  248. package/src/forge/compiler/integration/templates/convex.ts +70 -0
  249. package/src/forge/compiler/integration/templates/index.ts +1 -0
  250. package/src/forge/compiler/integration/templates/render.ts +38 -0
  251. package/src/forge/compiler/integration/templates/types.ts +3 -0
  252. package/src/forge/compiler/integration/templates/workos.ts +1439 -0
  253. package/src/forge/compiler/make-registry/build.ts +8 -9
  254. package/src/forge/compiler/orchestrator/fast-check.ts +4 -0
  255. package/src/forge/compiler/orchestrator/generate-lock.ts +14 -3
  256. package/src/forge/compiler/orchestrator/manifest.ts +1 -1
  257. package/src/forge/compiler/orchestrator/plan-profile.ts +23 -0
  258. package/src/forge/compiler/orchestrator/plan.ts +249 -10
  259. package/src/forge/compiler/orchestrator/profile.ts +65 -0
  260. package/src/forge/compiler/orchestrator/run.ts +101 -33
  261. package/src/forge/compiler/orchestrator/serialize.ts +33 -8
  262. package/src/forge/compiler/orchestrator/types.ts +1 -1
  263. package/src/forge/compiler/package-graph/compiler.ts +3 -1
  264. package/src/forge/compiler/package-graph/constants.ts +1 -1
  265. package/src/forge/compiler/package-graph/dts-extractor.ts +14 -1
  266. package/src/forge/compiler/package-manager/adapter.ts +4 -1
  267. package/src/forge/compiler/package-manager/commands.ts +4 -0
  268. package/src/forge/compiler/package-manager/executor.ts +30 -1
  269. package/src/forge/compiler/package-manager/version.ts +36 -12
  270. package/src/forge/compiler/package-upgrades/planner.ts +155 -18
  271. package/src/forge/compiler/package-upgrades/types.ts +2 -0
  272. package/src/forge/compiler/policy-registry/build.ts +47 -2
  273. package/src/forge/compiler/policy-registry/parse.ts +32 -2
  274. package/src/forge/compiler/recipes/definitions.ts +63 -0
  275. package/src/forge/compiler/recipes/index.ts +2 -0
  276. package/src/forge/compiler/recipes/profiles.ts +81 -0
  277. package/src/forge/compiler/recipes/registry.ts +6 -0
  278. package/src/forge/compiler/test-graph/build.ts +11 -3
  279. package/src/forge/compiler/types/app-graph.ts +8 -2
  280. package/src/forge/compiler/types/cli.ts +76 -1
  281. package/src/forge/compiler/types/dev-manifest.ts +4 -0
  282. package/src/forge/compiler/types/emit.ts +2 -0
  283. package/src/forge/compiler/types/frontend-graph.ts +2 -2
  284. package/src/forge/compiler/types/integration.ts +1 -0
  285. package/src/forge/compiler/types/package-graph.ts +6 -0
  286. package/src/forge/compiler/types/policy-registry.ts +3 -1
  287. package/src/forge/delta/broker-runner.mjs +5 -0
  288. package/src/forge/delta/broker.ts +429 -0
  289. package/src/forge/delta/classifier.ts +52 -0
  290. package/src/forge/delta/explain.ts +238 -0
  291. package/src/forge/delta/git-observer.ts +67 -0
  292. package/src/forge/delta/ids.ts +44 -0
  293. package/src/forge/delta/index.ts +25 -0
  294. package/src/forge/delta/process-identity.ts +37 -0
  295. package/src/forge/delta/queue-status.ts +190 -0
  296. package/src/forge/delta/recorder.ts +540 -0
  297. package/src/forge/delta/redaction.ts +50 -0
  298. package/src/forge/delta/schema.ts +240 -0
  299. package/src/forge/delta/session.ts +142 -0
  300. package/src/forge/delta/status.ts +1139 -0
  301. package/src/forge/delta/store.ts +3329 -0
  302. package/src/forge/delta/timeline.ts +178 -0
  303. package/src/forge/dev/server.ts +1061 -22
  304. package/src/forge/dev/types.ts +15 -1
  305. package/src/forge/dev/watch.ts +17 -7
  306. package/src/forge/dev-console/cycle.ts +285 -33
  307. package/src/forge/dev-console/types.ts +47 -1
  308. package/src/forge/impact/index.ts +222 -30
  309. package/src/forge/impact/types.ts +33 -1
  310. package/src/forge/intent/index.ts +35 -16
  311. package/src/forge/make/fields.ts +26 -0
  312. package/src/forge/make/index.ts +42 -6
  313. package/src/forge/make/templates.ts +211 -4
  314. package/src/forge/make/types.ts +2 -1
  315. package/src/forge/policy.ts +1 -1
  316. package/src/forge/react/index.ts +160 -2
  317. package/src/forge/refactor/index.ts +1 -0
  318. package/src/forge/repair/rules/index.ts +2 -2
  319. package/src/forge/repository-analysis/adapters/common.ts +72 -0
  320. package/src/forge/repository-analysis/adapters/docker.ts +185 -0
  321. package/src/forge/repository-analysis/adapters/java.ts +133 -0
  322. package/src/forge/repository-analysis/adapters/typescript.ts +350 -0
  323. package/src/forge/repository-analysis/adapters/vue.ts +71 -0
  324. package/src/forge/repository-analysis/analyze.ts +434 -0
  325. package/src/forge/repository-analysis/benchmark.ts +336 -0
  326. package/src/forge/repository-analysis/cache-gc.ts +154 -0
  327. package/src/forge/repository-analysis/check-selection.ts +123 -0
  328. package/src/forge/repository-analysis/context-node.ts +17 -0
  329. package/src/forge/repository-analysis/context.ts +456 -0
  330. package/src/forge/repository-analysis/http-resolution.ts +135 -0
  331. package/src/forge/repository-analysis/identity.ts +45 -0
  332. package/src/forge/repository-analysis/index.ts +18 -0
  333. package/src/forge/repository-analysis/nuxt-resolution.ts +188 -0
  334. package/src/forge/repository-analysis/quality.ts +60 -0
  335. package/src/forge/repository-analysis/retrieval.ts +309 -0
  336. package/src/forge/repository-analysis/runtime-artifacts.ts +195 -0
  337. package/src/forge/repository-analysis/runtime-observation.ts +325 -0
  338. package/src/forge/repository-analysis/scanner.ts +174 -0
  339. package/src/forge/repository-analysis/storage.ts +193 -0
  340. package/src/forge/repository-analysis/test-associations.ts +59 -0
  341. package/src/forge/repository-analysis/types.ts +99 -0
  342. package/src/forge/repository-manifest/index.ts +178 -0
  343. package/src/forge/repository-manifest/types.ts +63 -0
  344. package/src/forge/review/index.ts +162 -12
  345. package/src/forge/review/types.ts +15 -0
  346. package/src/forge/runtime/ai/providers.ts +19 -4
  347. package/src/forge/runtime/auth/config.ts +17 -0
  348. package/src/forge/runtime/auth/evaluate.ts +15 -2
  349. package/src/forge/runtime/auth/resolve.ts +61 -6
  350. package/src/forge/runtime/auth/types.ts +1 -0
  351. package/src/forge/runtime/db/factory.ts +1 -3
  352. package/src/forge/runtime/db/generated-client.ts +13 -2
  353. package/src/forge/runtime/db/memory-adapter.ts +139 -32
  354. package/src/forge/runtime/db/pglite-adapter.ts +285 -2
  355. package/src/forge/runtime/executor.ts +129 -16
  356. package/src/forge/runtime/external/bridge.ts +663 -0
  357. package/src/forge/runtime/runner/run-entry.ts +16 -7
  358. package/src/forge/runtime/telemetry/buffer.ts +4 -1
  359. package/src/forge/runtime/telemetry/scrubber.ts +35 -5
  360. package/src/forge/runtime/webhooks/security.ts +12 -7
  361. package/src/forge/server.ts +71 -7
  362. package/src/forge/ui/index.ts +831 -19
  363. package/src/forge/ui/types.ts +3 -1
  364. package/src/forge/version.ts +1 -1
  365. package/src/forge/vue/index.ts +422 -0
  366. package/src/forge/workspace/baseline.ts +112 -0
  367. package/src/forge/workspace/change-summary.ts +292 -0
  368. package/src/forge/workspace/forge-cli.ts +42 -0
  369. package/src/forge/workspace/git-summary.ts +393 -0
  370. package/templates/agent-workroom/AGENTS.md +29 -0
  371. package/templates/agent-workroom/README.md +34 -0
  372. package/templates/agent-workroom/forge.config.ts +3 -0
  373. package/templates/agent-workroom/package.json +34 -0
  374. package/templates/agent-workroom/pnpm-workspace.yaml +2 -0
  375. package/templates/agent-workroom/src/actions/indexAgentSignal.ts +10 -0
  376. package/templates/agent-workroom/src/commands/openWorkroom.ts +61 -0
  377. package/templates/agent-workroom/src/commands/recordAgentSignal.ts +119 -0
  378. package/templates/agent-workroom/src/commands/recordCheckRun.ts +52 -0
  379. package/templates/agent-workroom/src/forge/schema.ts +54 -0
  380. package/templates/agent-workroom/src/policies.ts +6 -0
  381. package/templates/agent-workroom/src/queries/listWorkrooms.ts +11 -0
  382. package/templates/agent-workroom/src/queries/liveWorkroom.ts +63 -0
  383. package/templates/agent-workroom/tsconfig.json +16 -0
  384. package/templates/agent-workroom/web/index.html +13 -0
  385. package/templates/agent-workroom/web/package.json +21 -0
  386. package/templates/agent-workroom/web/src/App.tsx +345 -0
  387. package/templates/agent-workroom/web/src/lib/forge.ts +20 -0
  388. package/templates/agent-workroom/web/src/main.tsx +13 -0
  389. package/templates/agent-workroom/web/src/styles.css +545 -0
  390. package/templates/agent-workroom/web/tsconfig.json +27 -0
  391. package/templates/agent-workroom/web/vite.config.ts +36 -0
  392. package/templates/b2b-support-web/package.json +2 -0
  393. package/templates/b2b-support-web/pnpm-workspace.yaml +2 -0
  394. package/templates/b2b-support-web/web/app/page.tsx +2 -2
  395. package/templates/b2b-support-web/web/lib/forge.ts +9 -2
  396. package/templates/b2b-support-web/web/next.config.ts +24 -0
  397. package/templates/b2b-support-web/web/package.json +1 -1
  398. package/templates/minimal-web/package.json +2 -1
  399. package/templates/minimal-web/pnpm-workspace.yaml +2 -0
  400. package/templates/minimal-web/web/index.html +1 -0
  401. package/templates/minimal-web/web/src/App.tsx +12 -6
  402. package/templates/minimal-web/web/src/lib/forge.ts +9 -2
  403. package/templates/minimal-web/web/src/styles.css +34 -0
  404. package/templates/minimal-web/web/vite.config.ts +36 -0
  405. package/templates/nuxt-web/.vscode/settings.json +14 -0
  406. package/templates/nuxt-web/.yarnrc.yml +1 -0
  407. package/templates/nuxt-web/README.md +30 -0
  408. package/templates/nuxt-web/forge.config.ts +3 -0
  409. package/templates/nuxt-web/package.json +37 -0
  410. package/templates/nuxt-web/pnpm-workspace.yaml +2 -0
  411. package/templates/nuxt-web/src/actions/logNoteCreated.ts +11 -0
  412. package/templates/nuxt-web/src/commands/createNote.ts +26 -0
  413. package/templates/nuxt-web/src/forge/schema.ts +12 -0
  414. package/templates/nuxt-web/src/policies.ts +6 -0
  415. package/templates/nuxt-web/src/queries/listNotes.ts +8 -0
  416. package/templates/nuxt-web/src/queries/liveNotes.ts +8 -0
  417. package/templates/nuxt-web/tsconfig.json +17 -0
  418. package/templates/nuxt-web/web/app.vue +67 -0
  419. package/templates/nuxt-web/web/components/LiveNotes.vue +89 -0
  420. package/templates/nuxt-web/web/components/NoteComposer.vue +100 -0
  421. package/templates/nuxt-web/web/composables/forge.ts +13 -0
  422. package/templates/nuxt-web/web/composables/useNotes.ts +24 -0
  423. package/templates/nuxt-web/web/nuxt.config.ts +11 -0
  424. package/templates/nuxt-web/web/package.json +22 -0
  425. package/templates/nuxt-web/web/plugins/forge.client.ts +10 -0
  426. package/templates/nuxt-web/web/plugins/forge.server.ts +10 -0
  427. package/templates/nuxt-web/web/server/api/forge-health.get.ts +7 -0
  428. package/templates/nuxt-web/web/tsconfig.json +6 -0
  429. package/templates/vendor-access/.vscode/settings.json +14 -0
  430. package/templates/vendor-access/README.md +30 -0
  431. package/templates/vendor-access/forge.config.ts +3 -0
  432. package/templates/vendor-access/package.json +35 -0
  433. package/templates/vendor-access/pnpm-workspace.yaml +2 -0
  434. package/templates/vendor-access/src/commands/addEvidence.ts +42 -0
  435. package/templates/vendor-access/src/commands/approveAccessRequest.ts +43 -0
  436. package/templates/vendor-access/src/commands/createAccessRequest.ts +49 -0
  437. package/templates/vendor-access/src/commands/seedVendorAccessDemo.ts +200 -0
  438. package/templates/vendor-access/src/forge/schema.ts +74 -0
  439. package/templates/vendor-access/src/policies.ts +11 -0
  440. package/templates/vendor-access/src/queries/listVendorAccessDashboard.ts +24 -0
  441. package/templates/vendor-access/src/queries/liveVendorAccessDashboard.ts +24 -0
  442. package/templates/vendor-access/tsconfig.json +17 -0
  443. package/templates/vendor-access/web/index.html +13 -0
  444. package/templates/vendor-access/web/package.json +21 -0
  445. package/templates/vendor-access/web/src/App.tsx +573 -0
  446. package/templates/vendor-access/web/src/lib/forge.ts +20 -0
  447. package/templates/vendor-access/web/src/main.tsx +205 -0
  448. package/templates/vendor-access/web/src/styles.css +682 -0
  449. package/templates/vendor-access/web/tsconfig.json +18 -0
  450. package/templates/vendor-access/web/vite.config.ts +36 -0
  451. package/src/forge/_generated/actionSubscriptions.json +0 -2
  452. package/src/forge/_generated/actionSubscriptions.ts +0 -10
  453. package/src/forge/_generated/agentAdapterManifest.json +0 -2
  454. package/src/forge/_generated/agentAdapterManifest.ts +0 -73
  455. package/src/forge/_generated/agentContract.json +0 -2
  456. package/src/forge/_generated/agentContract.ts +0 -7829
  457. package/src/forge/_generated/agentQuickstart.md +0 -34
  458. package/src/forge/_generated/agentTools.json +0 -2
  459. package/src/forge/_generated/agentTools.md +0 -16
  460. package/src/forge/_generated/agentTools.ts +0 -12
  461. package/src/forge/_generated/aiContext.ts +0 -125
  462. package/src/forge/_generated/aiModels.json +0 -2
  463. package/src/forge/_generated/aiModels.ts +0 -51
  464. package/src/forge/_generated/aiProviders.json +0 -2
  465. package/src/forge/_generated/aiProviders.ts +0 -23
  466. package/src/forge/_generated/aiRegistry.json +0 -2
  467. package/src/forge/_generated/aiRegistry.ts +0 -31
  468. package/src/forge/_generated/api.json +0 -2
  469. package/src/forge/_generated/api.ts +0 -8
  470. package/src/forge/_generated/appGraph.json +0 -2
  471. package/src/forge/_generated/appGraph.ts +0 -14937
  472. package/src/forge/_generated/appMap.md +0 -55
  473. package/src/forge/_generated/artifactManifest.json +0 -2
  474. package/src/forge/_generated/artifactManifest.ts +0 -7
  475. package/src/forge/_generated/authClaims.json +0 -2
  476. package/src/forge/_generated/authClaims.ts +0 -13
  477. package/src/forge/_generated/authConfig.json +0 -2
  478. package/src/forge/_generated/authConfig.ts +0 -17
  479. package/src/forge/_generated/authContext.ts +0 -23
  480. package/src/forge/_generated/authRegistry.json +0 -2
  481. package/src/forge/_generated/authRegistry.ts +0 -25
  482. package/src/forge/_generated/buildInfo.json +0 -2
  483. package/src/forge/_generated/buildInfo.ts +0 -9
  484. package/src/forge/_generated/capabilityMap.json +0 -2
  485. package/src/forge/_generated/capabilityMap.md +0 -15
  486. package/src/forge/_generated/capabilityMap.ts +0 -17
  487. package/src/forge/_generated/client.ts +0 -282
  488. package/src/forge/_generated/clientApi.ts +0 -9
  489. package/src/forge/_generated/clientManifest.json +0 -2
  490. package/src/forge/_generated/clientManifest.ts +0 -39
  491. package/src/forge/_generated/clientTypes.ts +0 -78
  492. package/src/forge/_generated/configRegistry.json +0 -2
  493. package/src/forge/_generated/configRegistry.ts +0 -4
  494. package/src/forge/_generated/dataGraph.json +0 -2
  495. package/src/forge/_generated/dataGraph.ts +0 -8
  496. package/src/forge/_generated/db.json +0 -2
  497. package/src/forge/_generated/db.ts +0 -2
  498. package/src/forge/_generated/dbSecurityManifest.json +0 -2
  499. package/src/forge/_generated/dbSecurityManifest.ts +0 -15
  500. package/src/forge/_generated/dbSessionContext.json +0 -2
  501. package/src/forge/_generated/dbSessionContext.ts +0 -39
  502. package/src/forge/_generated/deployManifest.json +0 -2
  503. package/src/forge/_generated/deployManifest.ts +0 -14
  504. package/src/forge/_generated/devManifest.json +0 -2
  505. package/src/forge/_generated/devManifest.ts +0 -62
  506. package/src/forge/_generated/envSchema.json +0 -2
  507. package/src/forge/_generated/envSchema.ts +0 -59
  508. package/src/forge/_generated/frontendGraph.json +0 -2
  509. package/src/forge/_generated/frontendGraph.ts +0 -27
  510. package/src/forge/_generated/importGuards.json +0 -2
  511. package/src/forge/_generated/importGuards.ts +0 -686
  512. package/src/forge/_generated/index.ts +0 -68
  513. package/src/forge/_generated/liveProductionManifest.json +0 -2
  514. package/src/forge/_generated/liveProductionManifest.ts +0 -23
  515. package/src/forge/_generated/liveProtocol.json +0 -2
  516. package/src/forge/_generated/liveProtocol.ts +0 -21
  517. package/src/forge/_generated/liveQueryRegistry.json +0 -2
  518. package/src/forge/_generated/liveQueryRegistry.ts +0 -9
  519. package/src/forge/_generated/liveTransportConfig.json +0 -2
  520. package/src/forge/_generated/liveTransportConfig.ts +0 -19
  521. package/src/forge/_generated/makeRegistry.json +0 -2
  522. package/src/forge/_generated/makeRegistry.ts +0 -177
  523. package/src/forge/_generated/makeTemplates.json +0 -2
  524. package/src/forge/_generated/makeTemplates.ts +0 -66
  525. package/src/forge/_generated/mockMap.json +0 -2
  526. package/src/forge/_generated/mockMap.ts +0 -7
  527. package/src/forge/_generated/operationPlaybooks.md +0 -167
  528. package/src/forge/_generated/packageGraph.json +0 -2
  529. package/src/forge/_generated/packageGraph.ts +0 -249334
  530. package/src/forge/_generated/packageUpgradeRegistry.json +0 -2
  531. package/src/forge/_generated/packageUpgradeRegistry.ts +0 -15
  532. package/src/forge/_generated/permissionMatrix.json +0 -2
  533. package/src/forge/_generated/permissionMatrix.ts +0 -7
  534. package/src/forge/_generated/policyRegistry.json +0 -2
  535. package/src/forge/_generated/policyRegistry.ts +0 -11
  536. package/src/forge/_generated/queryRegistry.json +0 -2
  537. package/src/forge/_generated/queryRegistry.ts +0 -9
  538. package/src/forge/_generated/react.d.ts +0 -22
  539. package/src/forge/_generated/react.ts +0 -29
  540. package/src/forge/_generated/reactManifest.json +0 -2
  541. package/src/forge/_generated/reactManifest.ts +0 -19
  542. package/src/forge/_generated/rlsPolicies.json +0 -2
  543. package/src/forge/_generated/rlsPolicies.sql +0 -34
  544. package/src/forge/_generated/rlsPolicies.ts +0 -6
  545. package/src/forge/_generated/runtimeGraph.json +0 -2
  546. package/src/forge/_generated/runtimeGraph.ts +0 -8
  547. package/src/forge/_generated/runtimeMatrix.json +0 -2
  548. package/src/forge/_generated/runtimeMatrix.ts +0 -334130
  549. package/src/forge/_generated/runtimeRegistry.ts +0 -2
  550. package/src/forge/_generated/runtimeRules.md +0 -91
  551. package/src/forge/_generated/secretRegistry.json +0 -2
  552. package/src/forge/_generated/secretRegistry.ts +0 -50
  553. package/src/forge/_generated/secretsContext.ts +0 -11
  554. package/src/forge/_generated/serverApi.ts +0 -10
  555. package/src/forge/_generated/sourceMapManifest.json +0 -2
  556. package/src/forge/_generated/sourceMapManifest.ts +0 -7
  557. package/src/forge/_generated/sqlPlan.json +0 -2
  558. package/src/forge/_generated/sqlPlan.ts +0 -88
  559. package/src/forge/_generated/subscriptionManifest.json +0 -2
  560. package/src/forge/_generated/subscriptionManifest.ts +0 -7
  561. package/src/forge/_generated/symbolicationManifest.json +0 -2
  562. package/src/forge/_generated/symbolicationManifest.ts +0 -17
  563. package/src/forge/_generated/telemetryRegistry.json +0 -2
  564. package/src/forge/_generated/telemetryRegistry.ts +0 -9
  565. package/src/forge/_generated/telemetrySinks.json +0 -2
  566. package/src/forge/_generated/telemetrySinks.ts +0 -11
  567. package/src/forge/_generated/tenantScope.json +0 -2
  568. package/src/forge/_generated/tenantScope.ts +0 -8
  569. package/src/forge/_generated/testGraph.json +0 -2
  570. package/src/forge/_generated/testGraph.ts +0 -3452
  571. package/src/forge/_generated/testPlanRegistry.json +0 -2
  572. package/src/forge/_generated/testPlanRegistry.ts +0 -33
  573. package/src/forge/_generated/uiRoutes.json +0 -2
  574. package/src/forge/_generated/uiRoutes.ts +0 -16
  575. package/src/forge/_generated/uiScenarios.json +0 -2
  576. package/src/forge/_generated/uiScenarios.ts +0 -30
  577. package/src/forge/_generated/uiTestManifest.json +0 -2
  578. package/src/forge/_generated/uiTestManifest.ts +0 -27
  579. package/src/forge/_generated/workflowRegistry.json +0 -2
  580. package/src/forge/_generated/workflowRegistry.ts +0 -9
  581. package/src/forge/_generated/workflowSubscriptions.json +0 -2
  582. package/src/forge/_generated/workflowSubscriptions.ts +0 -10
@@ -0,0 +1,584 @@
1
+ # Forge Agent Fabric
2
+
3
+ Existing repositories can attach optional [runtime observations](repository-runtime-observation.md)
4
+ to their maps. Worker preparation reads compatible saved evidence without executing
5
+ exporters; changes composed into a clone invalidate reuse. A runtime observation does
6
+ not satisfy verification gates or extend worker write scope.
7
+
8
+ Forge Agent Fabric is an experimental protocol-oriented execution layer for dynamically materialized agents and workflows. It extends Forge's existing compiler, outbox, actions, workflows, policy, and agent runtime rather than replacing them.
9
+
10
+ ## Implementation status
11
+
12
+ Status checked against local source `c8dfdf0c0c3cd6610bab68b4872ab9dcf8d4214c` on
13
+ 2026-10-07. The [current status summary](./architecture/agent-fabric/CODEX_DYNAMIC_WORKFLOWS.md#estado-atual-verificado-em-2026-10-07)
14
+ distinguishes implemented accompanied/managed modes, recorded pilot evidence and
15
+ remaining acceptance work. Historical plans and their original checklists are not
16
+ the current capability inventory. This refresh did not rerun the SDK pilot or establish
17
+ publication of the inspected revision.
18
+
19
+ The Codex-accompanied task mode now records acceptance criteria, scoped source snapshots,
20
+ independent review and checks in a persistent local task. Its dynamic workflow scheduler
21
+ supports dependencies, decisions, joins, bounded retries, replanning and crash reconciliation.
22
+ Codex executes the steps with its native tools; the scheduler does not start models or
23
+ continue execution when the host is closed. The
24
+ [detailed implementation and operation plan](./architecture/agent-fabric/CODEX_DYNAMIC_WORKFLOWS.md)
25
+ documents both contracts, evidence provenance and the remaining acceptance work.
26
+ The portable skill is `.agents/skills/forge-agent-fabric/SKILL.md`. Install it once
27
+ with `forge fabric install-skill --json` (or `node bin/forge.mjs fabric install-skill --json`
28
+ in the framework checkout). It then operates in other Git repositories through a shared
29
+ runtime, with one owner per repository and no Forge application dependency.
30
+ Use `fabric doctor`, `fabric ensure-owner`, and optionally `fabric project-register`
31
+ for explicit MCP routing by projectId. Hooks are optional. A project may declare
32
+ environment/concurrency defaults and suggested checks in `.forge/fabric.json`.
33
+ The [portable project plan](./architecture/agent-fabric/PORTABLE_PROJECTS_PLAN.md)
34
+ describes isolation, installation, recovery and validation.
35
+
36
+ ```bash
37
+ node bin/forge.mjs fabric capabilities --json
38
+ node bin/forge.mjs fabric serve --json
39
+ node bin/forge.mjs fabric attached-context --task-id <task-id> --json
40
+ ```
41
+
42
+ Accompanied CLI and MCP operations share the running owner. Successful workflow results
43
+ name the source snapshot actually observed; old evidence cannot complete a changed task.
44
+ The older protocol kernel and local Ollama pilot retain their separate contracts below.
45
+
46
+ ### Managed Codex SDK execution
47
+
48
+ Managed runs are now implemented separately from accompanied tasks. The native Codex
49
+ chat remains the user interface: prepare JSON and call the source CLI, or use the
50
+ `fabric_run_*` tools if this MCP is already registered. This delivery does not register
51
+ MCP or change global settings. `run-start` starts processes and can consume configured
52
+ Codex credits; it is more than a proposal. Capabilities distinguish these effects by mode.
53
+
54
+ ```bash
55
+ node bin/forge.mjs fabric run-start --file run.json --json
56
+ node bin/forge.mjs fabric run-status --run-id <run-id> --json
57
+ node bin/forge.mjs fabric run-wait --file wait.json --json
58
+ node bin/forge.mjs fabric run-pause --file pause.json --json
59
+ ```
60
+
61
+ The [complete request example and operating plan](./architecture/agent-fabric/CODEX_DYNAMIC_WORKFLOWS.md)
62
+ includes a command-only smoke and a coding DAG. Start requires requestId, goal, scope,
63
+ workflow nodes and one executor per node. Executors are `codex` or `command`; Codex roles
64
+ are implementer, reviewer, investigator and decision. Implementers declare writeScope.
65
+ The owner persists attempts before dispatch and runs workers in isolated Git clones,
66
+ composing dependency artifacts. Clones do not copy the root's node_modules. Automatic
67
+ environment preparation installs from the clone's manifest and lockfile or copies a
68
+ verified cache. Scripts are ignored by default; dependencies are isolated, not shared
69
+ through a mutable folder. The optional environment object accepts mode auto/none,
70
+ ignoreScripts, timeoutMs (100..1800000) and an HTTPS registry without credentials, query
71
+ or fragment. Reviewers and commands are read-only after environment preparation.
72
+
73
+ Tracked assets larger than 16 MiB outside the task's editable and captured configuration
74
+ scope remain in Git clones as read-only inputs. Inventories record their SHA-256 by
75
+ streaming 256 KiB blocks, without embedding asset bytes in worker metadata. Fingerprints
76
+ include asset sizes; baseline and out-of-scope changes are still rejected. These assets
77
+ are bounded to 512 MiB each and 1 GiB in aggregate. Editable snapshots retain their
78
+ 16 MiB per-file / 128 MiB aggregate limits, and changed artifacts retain the 8 MiB
79
+ per-file limit. Declaring a large asset as editable does not bypass those bounds.
80
+
81
+ Controls are run-steer/pause/resume/cancel/reconcile. Mutations require
82
+ `{runId,requestId,expectedVersion}` and complete `--file` bodies. Reuse requestId only for
83
+ the identical body; after a version conflict read status and choose a new requestId.
84
+ Status reads use `--run-id`; wait uses `{runId,cursor?,waitMs?}`, with at most 30000 ms.
85
+ Responses expose events and cursorExpired so clients can recover a missed event window.
86
+ MCP status accepts `{runId}`; all other managed tools accept `{request: BODY}`.
87
+
88
+ Steer queues an instruction and pauses future dispatch; active workers may finish.
89
+ Resume can replan with expectedRevision, nodes, executors, reason and evidenceRefs.
90
+ Cancel requests interruption, but unknown effects require explicit reconciliation.
91
+ Interrupted attempts accept only resolution `failed` with attemptId and reason;
92
+ caller-fabricated success is rejected. A fresh isolated attempt may resume its saved SDK
93
+ thread. Uncertain publication accepts `publication: "confirm"` only when the owner observes
94
+ the expected root files.
95
+ Publication retry requires the observed complete original baseline, clears the intent,
96
+ pauses the run and requires explicit resume; partial divergent writes remain blocked.
97
+ State provenance is executor_observed; model report contents
98
+ remain agent_reported. Required evidence labels accept only `executor-observed`.
99
+
100
+ When implementers exist and publish is not false, local publication requires a required
101
+ Codex review and command check downstream of every writer, approved review, successful
102
+ checks and completed workflow. Publication applies scoped diffs to a compatible root;
103
+ it does not commit, push or deploy. publish false retains isolated artifacts instead.
104
+ Use only the user's existing authorization for effects and cost.
105
+
106
+ Both managed and accompanied operations require one live owner and have no direct-store
107
+ fallback. There is no automatic wakeup, installed background service or promise of
108
+ running after the App closes. Restarted active attempts become uncertain. Implemented
109
+ transport and real command tests alone do not establish the real SDK pilot; the separate
110
+ real pilot is recorded in section 14 of the detailed plan. The accompanied validation results below are historical and do
111
+ not certify subsequently added managed code. Interactive App Server integration, native
112
+ hook acceptance and an EasyGrow pilot remain separate proposed work.
113
+
114
+ ### Faster CI, unchanged publication gates
115
+
116
+ The main CI classifies changed paths before optional template, package and runtime smokes.
117
+ Package smoke runs as an independent parallel job instead of extending the compiler
118
+ verification job. Unrelated agent modules skip template setup; Nuxt smoke excludes agent
119
+ modules too. Missing Git history conservatively runs every optional check. New pushes
120
+ cancel obsolete CI runs. Security Assurance uses its aggregate proof for guardrails,
121
+ auth, secrets and RLS instead of repeating those commands, while retaining the broader
122
+ security test suite and evidence artifacts. Publication keeps its complete release gates.
123
+ The previous observed CI was about 170 seconds, including a 64-second final package smoke;
124
+ the parallel design shortens that critical path, but the next hosted run must measure
125
+ the actual improvement.
126
+
127
+ The deterministic P0a protocol kernel and the bounded P0b-A model adapter are implemented.
128
+ P0b-A invokes one real model through the existing P0a permit and result boundary. Its
129
+ accepted scope and exact adoption evidence are recorded in
130
+ [`P0B_A_ADOPTION_RECORD.md`](./architecture/agent-fabric/P0B_A_ADOPTION_RECORD.md).
131
+
132
+ The local coding pilot has bounded proposal validation, a single-process PGlite
133
+ control journal, browser-based owner review, an isolated Ollama coding worker,
134
+ and MCP proposal/status tools backed by a local owner process. It does not make
135
+ a production persistence or security claim. Its scope and remaining gates are
136
+ in [`P0B_B_LOCAL_CODING_SCOPE.md`](./architecture/agent-fabric/P0B_B_LOCAL_CODING_SCOPE.md).
137
+ The [single-owner acceptance matrix](./architecture/agent-fabric/LOCAL_SINGLE_OWNER_ACCEPTANCE.md)
138
+ separates the current local implementation from its remaining release and human
139
+ acceptance gates.
140
+ Owner-selected local memory, fixed two-process data workers, and a standalone
141
+ Evolution Registry have separate narrow workflows below. These do not grant
142
+ the Ollama coding worker new tools or executable extensions.
143
+
144
+ `LocalAdaptiveHarness.run()` is a fixed local demonstration of two permitted
145
+ Node processes (`inventory` and `constraints`) followed by an authoritative
146
+ join. Each child receives only bounded text on stdin, an empty environment,
147
+ and a one second wall limit. The coordinator validates each digest against its
148
+ own input before committing the P0a result; cancellation, timeout, or an
149
+ invalid report leaves the join blocked. This trusted data worker is not an
150
+ arbitrary coding agent or an OS security sandbox.
151
+
152
+ The single-PC CLI wraps that harness with a local owner decision and durable
153
+ readback. From the repository root, create a JSON file with exactly two fields,
154
+ for example `{"inventory":"src/a.ts","constraints":"read only"}`. Each field
155
+ is data of at most 256 UTF-8 bytes. Then run:
156
+
157
+ ```bash
158
+ node bin/forge.mjs fabric adaptive-propose --file input.json --json
159
+ node bin/forge.mjs fabric adaptive-review <run-id> --json
160
+ node bin/forge.mjs fabric adaptive-run <run-id> --json
161
+ node bin/forge.mjs fabric adaptive-status <run-id> --json
162
+ ```
163
+
164
+ To narrow the two data fields through an owner-selected Evolution profile,
165
+ pass `--channel canary` or `--channel stable` to `adaptive-propose` after that
166
+ channel has a selected `local-adaptive-input-profile` version. The proposal
167
+ binds the immutable version ID before review. The owner window displays it,
168
+ and `adaptive-run` checks that the same version remains selected and loadable
169
+ before issuing permits. A changed or revoked selection blocks the run. The
170
+ profile validates labels and lengths only; it does not provide code, tools,
171
+ instructions, or worker behavior.
172
+ Profile decisions and an adaptive run share a local process lock, so a
173
+ promotion or revocation cannot race between profile readback and worker dispatch.
174
+
175
+ `adaptive-review` opens a loopback browser window showing both exact inputs,
176
+ the bound profile version when present, and their proposal digest. The approval
177
+ expires after five minutes and permits one run. The
178
+ CLI commits the owner authorization, fixed plan, child grants, and both P0a
179
+ permits to a separate local PGlite journal before starting either process.
180
+ The result record and authoritative join can be read after closing and
181
+ reopening the CLI. If the process dies after committing the join but before
182
+ saving the result record, status still reports the authoritative join but may
183
+ omit process IDs and child details. A run cannot be repeated; a crash after
184
+ dispatch is shown as uncertain unless the durable journal contains the join.
185
+ Cancellation, failed workers, or missing results never authorize a join.
186
+ Local records and the owner verifier key live under `.forge/local/agent-fabric`.
187
+ The local owner lock prevents concurrent mutating CLI invocations; after a
188
+ crash, inspect `adaptive-status` before any manual lock recovery. This is a
189
+ single-PC workflow, not a production security or multi-host claim.
190
+
191
+ The following remain explicitly deferred and must not be inferred from architecture notes, historical handoffs, or local experiments:
192
+
193
+ - model-selected tools, plugins or child delegation (the local data workers use
194
+ fixed code-owned child permits only);
195
+ - PGlite-backed production persistence/outbox integration for Agent Fabric;
196
+ - general consequential-effect brokers and arbitrary external-system effects
197
+ (the local pilot has fixed patch and Docker verification receipts only);
198
+ - recovery epochs and integrity-unknown recovery;
199
+ - adaptive model routing and general harness compilation beyond the fixed
200
+ two-process data workflow;
201
+ - executable plugin promotion, shared production memory, and autonomous self-evolution;
202
+ - production deployment or production security claims.
203
+
204
+ ## P0a scope
205
+
206
+ The first vertical implements a deterministic control kernel with:
207
+
208
+ - explicit `OwnerAuthorization`, `GoalContract`, `RunPlanRevision`, `PlanDelta`, `AgentSpec`, `HarnessSpec`, `ExecutionProfile`, and `EffectiveRunSpec` contracts;
209
+ - an immutable-by-copy control journal with sequence, predecessor, digest chain, and deterministic reducer;
210
+ - owner authorization ingress through an injected verifier, with content-bound verification evidence recorded in the journal and revalidated during replay;
211
+ - root grants bound to an explicit verified owner authorization;
212
+ - exact binding between a permit's grant/root authorization and the `GoalContract.authorityInvocationId` of its active plan;
213
+ - child grants with monotonic attenuation and transitive revocation;
214
+ - resource reservation plus child-grant registration as one in-memory transactional operation;
215
+ - a Conductor-owned internal `ResourceLedger`, seeded from constructor definitions and hydrated from authoritative replay on resume;
216
+ - replay-side reconstruction of consumable, capacity, and counter accounting from trusted resource definitions and journaled reservation transitions;
217
+ - globally unique attempt identities, one claim lineage per attempt, and at most one execution permit per attempt;
218
+ - durable dispatch intent, non-authoritative offers, atomic claims, leases, fencing, and attempt-bound permits;
219
+ - deterministic adapter protocol behavior;
220
+ - worker result reports bound to permit, intent, plan revision, `EffectiveRunSpec`, and fencing generation;
221
+ - replay-side recomputation of the canonical `WorkerResultReport` digest from the persisted outcome fields;
222
+ - authoritative `succeeded | failed` outcome commit that preserves result-report provenance and rejects stale or revoked ancestry;
223
+ - late `AttemptUncertaintyObservation` evidence that does **not** become a terminal authoritative outcome and therefore does not by itself block retry;
224
+ - plan revisions that preserve `GoalContract` and workflow program identity and are exactly derivable from a registered `PlanDelta`;
225
+ - runtime event validation and a closed JSON Schema envelope/payload model;
226
+ - crash/replay reconstruction without re-running a planner.
227
+
228
+ P0a intentionally does not implement external effects, persistent memory, model routing, plugin promotion, or production deployment.
229
+
230
+ ## Live transition rule: replay-valid before append
231
+
232
+ The public P0a `ForgeAgentConductor` wraps the underlying journal with replay prevalidation. Before a new authoritative event is appended, the candidate prefix is reconstructed with the same sequence/predecessor/digest rules and must be accepted by the hardened replay semantics.
233
+
234
+ ```text
235
+ current trusted journal prefix
236
+ + candidate event
237
+ ↓
238
+ hardened replay validation
239
+ ↓
240
+ accept → append with journal CAS
241
+ reject → no append
242
+ ```
243
+
244
+ This closes the class of bugs where a public Conductor method returns success but leaves an append-only journal that the same P0a implementation cannot replay.
245
+
246
+ The Conductor also pins its clock once per synchronous state transition so payload timestamps and the enclosing authoritative event timestamp are derived from the same clock observation when equality is part of the protocol invariant.
247
+
248
+ ## Authority model
249
+
250
+ A workflow may choose how to work, but it may not create authority. The reference Conductor requires an `OwnerAuthorizationVerifier` before it can admit an `OwnerAuthorization`. The verification result is content-bound to the authorization digest and the replay path requires a trust-bound verifier to validate the recorded evidence again.
251
+
252
+ Root grants must remain within that authorization. Child grants must be strict subsets of their parent and remain invalid if:
253
+
254
+ - any ancestor is revoked or expired;
255
+ - the root authorization is revoked or expired;
256
+ - the child reservation is missing or has been released.
257
+
258
+ A grant is not sufficient merely because its capabilities/sources/targets fit an intent. Before permit issuance and during replay, P0a resolves:
259
+
260
+ ```text
261
+ permit
262
+ → dispatch intent
263
+ → active RunPlanRevision
264
+ → GoalContract
265
+ → GoalContract.authorityInvocationId
266
+ → exact OwnerAuthorization
267
+ ```
268
+
269
+ The grant's `rootAuthorizationId` must equal that goal authority invocation, the authorization must include the goal, and authorization/plan/intent must belong to the same root execution.
270
+
271
+ ```text
272
+ authenticated owner authorization
273
+ -> trusted ingress verification
274
+ -> root execution grant
275
+ -> derived child grant + resource reservation
276
+ -> dispatch intent
277
+ -> dispatch offer (not authority)
278
+ -> scheduling claim + lease + fencing
279
+ -> attempt execution permit
280
+ -> executor startup report
281
+ -> worker result report
282
+ -> conditional authoritative succeeded|failed outcome commit
283
+ ```
284
+
285
+ The concrete production identity provider, signature/trust-root mechanism, and credential lifecycle are deliberately outside P0a; the kernel only requires a verifier contract with deterministic/offline verification of recorded admission evidence.
286
+
287
+ ## Attempt identity and result binding
288
+
289
+ `attemptId` is a stream-global identity, not merely a caller convenience. A second claim may not reuse an existing attempt ID, even for another intent, and an attempt may receive only one execution permit. Hardened replay independently checks the one-per-attempt permit invariant so a fabricated journal cannot bypass the live Conductor check.
290
+
291
+ A `WorkerResultReport` is explicitly bound to:
292
+
293
+ - `attemptId`;
294
+ - `permitId`;
295
+ - `intentId`;
296
+ - `planRevisionId`;
297
+ - `effectiveRunSpecDigest`;
298
+ - `fencingToken`.
299
+
300
+ The report digest covers those fields as well as status, result digest, evidence digests and report time. `commitOutcome()` runtime-validates the report and compares it against the persisted permit/claim/intent lineage before it can become authoritative. Hardened replay reconstructs the report representation from the persisted outcome fields and recomputes the digest; a journal cannot claim an unrelated `reportDigest` while keeping different report fields.
301
+
302
+ ## Resource atomicity and replay
303
+
304
+ P0a uses `ResourceLedger.transaction()` to make reservation and child-grant journal registration atomic within the in-memory reference implementation. If journal registration fails, the ledger snapshot is restored, including consumable, capacity, and counter state.
305
+
306
+ The public Conductor does **not** retain caller-owned mutable ledger state as authority. When resource definitions are supplied at construction, it clones those definitions into a Conductor-owned internal ledger. On resume from an existing journal, the internal ledger is hydrated from the authoritative replay projection before new resource transitions are allowed. An empty constructor seed therefore cannot erase prior usage, and later out-of-band mutations of the caller's seed cannot change authority state. A conflicting non-empty seed fails closed.
307
+
308
+ The replay path does not accept a reservation merely because its shape matches a child grant. Resource definitions and limits are supplied through the replay trust context; reservation transitions are reapplied to reconstructed global/owner accounting. Duplicate resources, unknown resources, invalid transitions, or aggregate global overcommit fail closed.
309
+
310
+ Reservation `consume` and `release` operations have journaled transitions when performed through the Conductor. Releasing the reservation backing a derived grant makes that grant lineage non-current for future permits/startups/outcomes.
311
+
312
+ This remains an in-memory protocol proof. A later persistence slice must implement the same atomicity and journal coupling with a real transactional store/outbox.
313
+
314
+ ## Uncertainty is not an authoritative outcome
315
+
316
+ P0a deliberately separates:
317
+
318
+ ```text
319
+ AttemptUncertaintyObservation
320
+ !=
321
+ AuthoritativeOutcomeCommit
322
+ ```
323
+
324
+ A late worker/adapter observation may say that startup or completion is uncertain even after a lease, permit, plan or grant has become stale. The observation is retained as evidence, but it does not make the intent terminal and cannot by itself block a later scheduling claim.
325
+
326
+ `executeP0aActivity()` preserves uncertainty not only when an adapter throws or explicitly returns `unknown`, but also when a positive startup/result report arrives too late or otherwise fails authoritative admission. The stale positive report does not regain authority; the control plane stores only a non-terminal uncertainty observation describing the rejected report path.
327
+
328
+ Only a currently authorized control path may commit a terminal P0a outcome, and P0a terminal outcomes are limited to `succeeded | failed`.
329
+
330
+ ## Replay model and trust boundary
331
+
332
+ `MemoryControlJournal` stores cloned/frozen events and returns clones to callers. Every committed envelope carries:
333
+
334
+ - monotonic sequence;
335
+ - predecessor event ID;
336
+ - predecessor event digest;
337
+ - event digest;
338
+ - monotonic authoritative timestamp.
339
+
340
+ The public `replayControlState()` adds hardened protocol checks over the deterministic reducer and revalidates:
341
+
342
+ - a single `rootExecutionId` for the control stream;
343
+ - the digest chain and event shape;
344
+ - trusted owner-authorization evidence;
345
+ - exact GoalContract ↔ grant/root-authorization binding for execution permits;
346
+ - grant ancestry, reservation currentness and revocation;
347
+ - resource accounting against trust-bound definitions;
348
+ - global attempt/resource budgets;
349
+ - stream-unique event/idempotency/result identities;
350
+ - globally unique attempt identity;
351
+ - at most one permit per attempt;
352
+ - exact plan-delta lineage;
353
+ - claims, permits, startup and authoritative outcome bindings;
354
+ - canonical `WorkerResultReport` digest consistency.
355
+
356
+ Malformed replay input is normalized to `AgentFabricError(AF_INVALID_EVENT)` rather than leaking implementation-level exceptions such as `TypeError`.
357
+
358
+ The event hash chain is an **integrity mechanism, not a signature or proof of storage origin**. P0a assumes the journal prefix supplied for authoritative replay comes from the trusted journal/storage boundary. The reducer determines whether that prefix is semantically admissible; production durable storage/authentication of journal bytes is intentionally deferred to the persistence slice.
359
+
360
+ This distinction is important: arbitrary attacker-created bytes do not become authoritative merely because they form a self-consistent hash chain.
361
+
362
+ ## Canonicalization scope
363
+
364
+ P0a currently uses `forge-canonical-json/v0.1`, a deterministic TypeScript/JavaScript reference profile with SHA-256. Canonicalization is defined over the JSON data model, not arbitrary JavaScript object behavior: objects must be plain or null-prototype data objects with own enumerable data properties, arrays must be dense and cannot carry extra/symbol properties, accessors are rejected, and an own property named `__proto__` is preserved as ordinary data and therefore participates in the canonical bytes and digest. This prevents different admitted in-memory values from collapsing to the same canonical representation through JavaScript prototype semantics.
365
+
366
+ The profile is **not** claimed to be the final cross-language canonicalization standard. A future protocol revision must adopt a cross-language profile (for example RFC 8785/JCS or an equivalently specified profile) with shared test vectors before Java/Python/Rust implementations are expected to produce identical digests.
367
+
368
+ ## Public API
369
+
370
+ The experimental package API is exported only through:
371
+
372
+ ```ts
373
+ import {
374
+ ForgeAgentConductor,
375
+ MemoryControlJournal,
376
+ ResourceLedger,
377
+ DeterministicTestAdapter,
378
+ replayControlState,
379
+ } from "forgeos/agent-fabric";
380
+ ```
381
+
382
+ That public entry point exposes the hardened Conductor and hardened replay functions. The lower-level implementation modules remain internal implementation detail of the experimental P0a package surface.
383
+
384
+ ## Local coding pilot (experimental)
385
+
386
+ The framework checkout also exposes a bounded single-owner CLI path. Run these commands
387
+ from the root of a trusted Git repository with Ollama running and `qwen2.5-coder:3b`
388
+ installed. This pilot uses no hosted API key or Codex model turn.
389
+
390
+ ```text
391
+ node bin/forge.mjs fabric capabilities --json
392
+ node bin/forge.mjs fabric propose --file task.json --json
393
+ node bin/forge.mjs fabric memory-add --file note.json --json
394
+ node bin/forge.mjs fabric memory-list --file paths.json --json
395
+ node bin/forge.mjs fabric memory-delete <memory-id> --json
396
+ node bin/forge.mjs fabric status <task-id> --json
397
+ node bin/forge.mjs fabric evidence <task-id> --json
398
+ node bin/forge.mjs fabric review <task-id> --json
399
+ node bin/forge.mjs fabric run <task-id> --json
400
+ node bin/forge.mjs fabric cancel <task-id> --json
401
+ node bin/forge.mjs fabric reconcile <task-id> --json
402
+ node bin/forge.mjs fabric verify <task-id> --json
403
+ node bin/forge.mjs fabric review-result <task-id> --json
404
+ node bin/forge.mjs fabric serve --json
405
+ ```
406
+
407
+ `task.json` is an untrusted proposal. Its required fields are `schemaVersion: 1`,
408
+ `repositoryId`, the full `baseCommit`, `goal`, `acceptanceCriteria`, `nonObjectives`,
409
+ `sourcePaths`, `writablePaths`, `requestedModelTargetId: "target:ollama:local"`,
410
+ `requestedModelId: "qwen2.5-coder:3b"`, and
411
+ `limits` with `maximumAttempts`, `maximumWallClockMs`, `maximumOutputTokens`,
412
+ `maximumContextBytes`, `maximumPatchBytes`, and a Unix millisecond `expiresAt`.
413
+ `review` opens a local browser window showing the exact proposal and digest; `run`
414
+ consumes one approved model attempt and writes a diff in an isolated Git worktree.
415
+ The model ID is part of that digest and appears in the owner review. Existing
416
+ tasks approved before model pinning cannot start a new model call; submit a fresh
417
+ proposal. Their saved outcomes and patches remain available for readback, while
418
+ the exact model for a legacy outcome is reported as unknown.
419
+ The service captures the allowlisted tracked source files at the exact current
420
+ HEAD when proposing and rechecks them before spending the approved model
421
+ attempt. Changed source content or HEAD blocks a stale attempt.
422
+ `cancel` revokes an unused owner approval so `run` cannot start it, including after
423
+ the owner restarts. During an active model call, it requests abort from the
424
+ local adapter. The returned `model_uncertain` state does not prove the provider
425
+ stopped; a dispatched attempt cannot be retried. Cancellation does not stop
426
+ patch materialization or Docker verification that has already started. Start
427
+ `fabric serve` before `run` when you need a second CLI process to cancel an
428
+ in-flight call; a one-shot `run` has no cross-process abort endpoint.
429
+ `review-result` shows the recorded diff for a separate owner decision. Acceptance
430
+ records a decision only; it does not alter the original checkout or merge code.
431
+
432
+ Private memory is opt in and local to this checkout. `memory-add` reads a JSON
433
+ file such as `{ "sourcePaths": ["src/example.ts"], "text": "Owner note",
434
+ "retentionMs": 86400000 }`; `memory-list` reads a JSON file containing only
435
+ `sourcePaths`. Both require an unchanged tracked source snapshot. Notes are
436
+ bounded to 2 KiB, retained for at most 30 days, and stored under
437
+ `.forge/local/agent-fabric`. `memory-delete` removes a note by its returned ID.
438
+ To select notes for a coding task, add `"memoryIds": ["memory:<id>"]` to
439
+ `task.json` using returned full IDs. The proposal digest binds those IDs; the
440
+ owner review displays their text and provenance. Missing, expired, deleted, or
441
+ source-stale notes block approval or execution. Selected notes consume the
442
+ existing context byte budget and are labeled `untrusted_memory` in the model
443
+ context. MCP task tools cannot add, list, or delete private memory.
444
+
445
+ An optional `verification` field binds an immutable local Docker image ID and
446
+ two to four bounded command descriptors into the proposal digest. The first
447
+ descriptor is `{ "kind": "git-diff-check", "timeoutMs": 5000 }`; the remaining
448
+ descriptors are `{ "kind": "node-test-file", "path": "pass.test.mjs",
449
+ "timeoutMs": 20000 }`. The owner sees these exact commands and image in the
450
+ approval window. The image ID must match the locally installed `node:22`
451
+ image with a `node@sha256` registry digest; the service rejects a proposal
452
+ pointing to another local image and rechecks the tag before execution.
453
+ Each Node test file must exist in the pinned commit and be outside the task's
454
+ writable paths, so the model cannot replace the test that judges its patch.
455
+ After `run` produces a patch, `verify` checks deterministic test paths,
456
+ mount encoding, Docker context, and the pinned image before recording a durable
457
+ intent. A dispatch barrier is recorded before container execution. The owner
458
+ can clear only an intent that has no dispatch barrier; a potentially started
459
+ container cannot be retried automatically. `git diff --check` runs with external
460
+ diff and filesystem monitor helpers disabled on the host; Node tests run inside
461
+ Docker Desktop without network, with an
462
+ immutable already-installed image, read-only checkout, nonroot user and resource
463
+ limits. Accepting a patch with an approved verification profile requires all
464
+ checks to pass; a failed or uncertain result can still be rejected by the owner.
465
+
466
+ The local store lives under `.forge/local/agent-fabric` and has one PGlite process
467
+ owner. Start `forge fabric serve` to keep that owner running while separate CLI
468
+ and MCP clients connect through a loopback endpoint. The endpoint token stays in
469
+ the local repository store and is not printed. The MCP tools `fabric_propose`,
470
+ `fabric_status`, and `fabric_evidence` use that same owner; they cannot approve,
471
+ run, or accept a task. `fabric_evidence` returns a digest-bound provenance summary
472
+ without raw model text or diff content.
473
+ Without a running owner, CLI commands open the store for a single operation and
474
+ MCP task tools report that the owner is unavailable. A crashed model attempt with
475
+ a committed permit and no outcome remains
476
+ uncertain; a repeated `run` does not spend another attempt. A committed model result
477
+ can be materialized after restart if no patch-effect intent was issued. Patch
478
+ materialization records a durable intent before creating the isolated checkout.
479
+ A crash after that intent reports `patch_uncertain`; `run` will not reapply it.
480
+ `fabric reconcile` reads the checkout and diff artifact against the committed
481
+ model result and records a receipt only when they match exactly. It never
482
+ creates or rewrites the patch. The existing MCP server reports the boundary
483
+ through `fabric_capabilities`. The popup is
484
+ a cooperative same-account interaction, so it is not a security boundary against
485
+ an agent with unrestricted shell or UI control. The model receives only approved
486
+ source files and cannot run shell commands. The Git worktree confines patch
487
+ materialization; optional Node verification is container isolated. This pilot
488
+ does not yet broker arbitrary consequential effects or attest to sandbox escape
489
+ resistance against a hostile local administrator.
490
+
491
+ Maintainers can run `bun scripts/agent-fabric-local-smoke.ts` for an opt-in real
492
+ Ollama fixture. That script injects a synthetic test approval and confirms a diff;
493
+ it does not prove the human popup flow or coding quality on real projects.
494
+ `FORGE_FABRIC_DOCKER_SMOKE=1 bun test tests/agent-fabric/local-task-service.test.ts`
495
+ exercises the service, approved verification, Docker Desktop, durable readback,
496
+ and acceptance with a synthetic approval callback.
497
+
498
+ ### Codex App implementation with adversarial review (local preview)
499
+
500
+ The Codex App may implement a change in the current checkout. Register the work
501
+ before editing with a JSON request such as
502
+ `{"objective":"Change the parser","acceptanceCriteria":["The new case is handled"],"implementer":"codex-app"}`.
503
+ Place the request under the ignored `.forge/local/` directory, then use:
504
+
505
+ ```bash
506
+ node bin/forge.mjs fabric change-propose --file .forge/local/change-request.json --json
507
+ node bin/forge.mjs fabric change-status --task-id <change-id> --json
508
+ node bin/forge.mjs fabric change-review --task-id <change-id> --json
509
+ node bin/forge.mjs fabric change-evidence --task-id <change-id> --json
510
+ ```
511
+
512
+ `change-review` is an explicit owner CLI action that starts a **new Codex CLI
513
+ review turn** using the machine's existing Codex login. That turn may consume
514
+ Codex usage. The MCP tools `fabric_change_propose`, `fabric_change_status`, and
515
+ `fabric_change_evidence` can register and inspect a change but cannot start a
516
+ review or mark it accepted. The request pins the base commit; review later
517
+ captures staged, unstaged, and non-ignored new files without modifying the
518
+ user's Git index. Local Forge state under `.forge/local` and `.forge/delta` is
519
+ excluded. A review is limited to 1 MiB, 100 paths, and eight rounds; binary
520
+ patches, symlinks, and submodules are rejected.
521
+
522
+ Each round records an immutable diff and request digest before dispatch. The
523
+ reviewer runs against a separate checkout of that exact diff in read-only
524
+ sandbox mode. A valid structured report bound to the request digest is required;
525
+ process exit zero alone is insufficient. `canAccept` becomes true only for a
526
+ passing report on the **current** diff. Editing the checkout after a pass makes
527
+ it `needs_review`, and the next review creates a new round. An interrupted
528
+ review remains uncertain and will not automatically spend another turn. An
529
+ inconclusive completed review may be retried explicitly. For an interrupted
530
+ review, inspect its evidence and create a fresh change request if another paid
531
+ turn is warranted; the uncertain intent remains in the original record.
532
+ `canAccept` is evidence for the human workflow; this preview does not intercept
533
+ Git merges or edits made outside the CLI. Same-account shell access can alter
534
+ the local ledger and is outside the pilot's security boundary. The Codex CLI
535
+ review protocol has fake-process tests but no paid, real-model smoke yet.
536
+
537
+ ### Local Evolution Registry (single owner)
538
+
539
+ The local extension workflow pins a candidate's bytes before evaluation. A
540
+ manifest is a repository file with exactly these fields:
541
+
542
+ ```json
543
+ {"schemaVersion":1,"extensionKey":"sample","artifactPath":"extensions/sample.js"}
544
+ ```
545
+
546
+ The artifact and manifest must be regular files inside the repository. The
547
+ artifact is limited to 1 MiB and the manifest to 16 KiB. Forge copies both to
548
+ content addressed files under `.forge/local/agent-fabric/evolution/`; edits to
549
+ the source files after registration do not change the registered version.
550
+
551
+ ```bash
552
+ node bin/forge.mjs evolution register --manifest extensions/sample.json --json
553
+ node bin/forge.mjs evolution evaluate extension:sha256:<digest> --json
554
+ node bin/forge.mjs evolution status extension:sha256:<digest> --json
555
+ node bin/forge.mjs evolution review canary extension:sha256:<digest> --json
556
+ node bin/forge.mjs evolution review promote extension:sha256:<digest> --json
557
+ node bin/forge.mjs evolution load sample --channel stable --json
558
+ node bin/forge.mjs evolution review rollback extension:sha256:<older-digest> --json
559
+ node bin/forge.mjs evolution review revoke extension:sha256:<digest> --json
560
+ ```
561
+
562
+ Evaluation is a fixed local suite that checks stored artifact integrity,
563
+ stored manifest integrity, and the manifest contract. It does not execute the
564
+ candidate. Each version evaluates once; a failed or interrupted evaluation
565
+ requires a new candidate version. Canary, promotion, rollback, and revocation
566
+ open a loopback owner review window. Rejection or timeout leaves selection
567
+ unchanged. Rollback can select only a previously stable version that still has
568
+ a passing evaluation. Revocation clears selections and blocks future loading.
569
+
570
+ The `load` command reports verified metadata. Local runtime callers can use
571
+ `LocalEvolutionService.loadSelected` to obtain bytes after the same channel,
572
+ evaluation, revocation, and digest checks. This registry does not import or
573
+ execute those bytes or grant them side effects. Its review window is a
574
+ cooperative human checkpoint; same-account shell or browser automation is
575
+ outside its protection boundary. No hosted model or API key is used.
576
+
577
+ ## Opt-in program workflows v2 (alpha.70)
578
+
579
+ For finite TypeScript/JSON program workflows, read
580
+ [the executable v2 contract](agent-fabric-programs.md) and the shipped
581
+ `examples/agent-fabric-v2/` example. This adds durable typed operators, repair,
582
+ owner coverage/acceptance and reconciled local application alongside v1 runs.
583
+ Fenced replan currently uses a global scheduling barrier; full product acceptance
584
+ and an actual Claude benchmark are recorded separately in the architecture evidence.