forgeos 0.1.0-alpha.7 → 0.1.0-alpha.71

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