@moretea-labs/forge 1.7.2 → 1.8.1

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 (900) hide show
  1. package/AGENTS.md +121 -62
  2. package/CHANGELOG.md +40 -0
  3. package/CLAUDE.md +57 -62
  4. package/CONTRIBUTING.md +3 -2
  5. package/README.md +2 -2
  6. package/SKILL.md +0 -1
  7. package/THIRD_PARTY_NOTICES.md +5 -2
  8. package/adapters/browser/index.ts +2 -0
  9. package/adapters/chatgpt/browser-delivery-host.ts +77 -0
  10. package/adapters/chatgpt/browser-delivery-runtime.ts +1256 -0
  11. package/adapters/chatgpt/controller-binding-store.ts +134 -0
  12. package/adapters/chatgpt/controller-round-host.ts +68 -0
  13. package/adapters/chatgpt/controller-round-settlement-store.ts +99 -0
  14. package/adapters/chatgpt/provider-delivery.ts +340 -0
  15. package/adapters/chatgpt/work-conversation-binding-store.ts +218 -0
  16. package/adapters/chatgpt/wsl-bridge-delivery-host.ts +63 -0
  17. package/adapters/computer/chatgpt-extension-target.ts +463 -0
  18. package/adapters/computer/chatgpt-target-router.ts +103 -0
  19. package/adapters/computer/chrome-extension/background.js +385 -0
  20. package/adapters/computer/chrome-extension/content.js +378 -0
  21. package/adapters/computer/chrome-extension/core.js +24 -0
  22. package/adapters/computer/chrome-extension/manifest.json +30 -0
  23. package/adapters/computer/desktop-operator-contract.ts +7 -0
  24. package/adapters/computer/desktop-operator-discovery.ts +181 -0
  25. package/adapters/computer/desktop-operator-negotiation.ts +174 -0
  26. package/adapters/computer/desktop-operator-provider.ts +312 -0
  27. package/adapters/computer/index.ts +1 -0
  28. package/adapters/computer/interaction-target-authority.ts +1068 -0
  29. package/adapters/controller-process/binding-store.ts +34 -0
  30. package/adapters/controller-process/controller-host.ts +26 -0
  31. package/adapters/mcp/access-mode.ts +132 -0
  32. package/adapters/mcp/audit.ts +32 -0
  33. package/adapters/mcp/auth.ts +406 -0
  34. package/adapters/mcp/instructions.ts +37 -0
  35. package/adapters/mcp/legacy-context.ts +18 -0
  36. package/adapters/mcp/multi-repository.ts +421 -0
  37. package/adapters/mcp/oauth.ts +464 -0
  38. package/adapters/mcp/paths.ts +143 -0
  39. package/adapters/mcp/policy.ts +232 -0
  40. package/adapters/mcp/proxy-env.ts +62 -0
  41. package/adapters/mcp/readiness-projection.ts +24 -0
  42. package/adapters/mcp/redaction.ts +21 -0
  43. package/adapters/mcp/repo.ts +24 -0
  44. package/adapters/mcp/runtime-gateway/artifact-adapter.ts +52 -0
  45. package/adapters/mcp/runtime-gateway/automation-receipt-adapter.ts +87 -0
  46. package/adapters/mcp/runtime-gateway/bounded-result-runtime.ts +62 -0
  47. package/adapters/mcp/runtime-gateway/cognition-settlement.ts +201 -0
  48. package/adapters/mcp/runtime-gateway/context-adapter.ts +1167 -0
  49. package/adapters/mcp/runtime-gateway/context-pack-sidecar.ts +91 -0
  50. package/adapters/mcp/runtime-gateway/controller-authority-adapter.ts +206 -0
  51. package/adapters/mcp/runtime-gateway/core-capability-adapter.ts +258 -0
  52. package/adapters/mcp/runtime-gateway/engineering-preconditions.ts +130 -0
  53. package/adapters/mcp/runtime-gateway/engineering-tool-contract.ts +15 -0
  54. package/adapters/mcp/runtime-gateway/execution-control-adapter.ts +28 -0
  55. package/adapters/mcp/runtime-gateway/execution-tools.ts +173 -0
  56. package/adapters/mcp/runtime-gateway/filesystem-adapter.ts +38 -0
  57. package/adapters/mcp/runtime-gateway/gateway-execution-adapter.ts +412 -0
  58. package/adapters/mcp/runtime-gateway/legacy-ios-tool-adapter.ts +105 -0
  59. package/adapters/mcp/runtime-gateway/maintenance-adapter.ts +44 -0
  60. package/adapters/mcp/runtime-gateway/model-adapter.ts +63 -0
  61. package/adapters/mcp/runtime-gateway/persisted-check-process.ts +3 -0
  62. package/adapters/mcp/runtime-gateway/plugin-adapter.ts +380 -0
  63. package/adapters/mcp/runtime-gateway/process-tools.ts +457 -0
  64. package/adapters/mcp/runtime-gateway/protected-computer-adapter.ts +88 -0
  65. package/adapters/mcp/runtime-gateway/recovery-adapter.ts +285 -0
  66. package/adapters/mcp/runtime-gateway/recovery-client-adapter.ts +70 -0
  67. package/adapters/mcp/runtime-gateway/recovery-tool-contract.ts +99 -0
  68. package/adapters/mcp/runtime-gateway/repository-compat-adapter.ts +79 -0
  69. package/adapters/mcp/runtime-gateway/result-adapter.ts +114 -0
  70. package/adapters/mcp/runtime-gateway/router.ts +242 -0
  71. package/adapters/mcp/runtime-gateway/routing-policy.ts +499 -0
  72. package/adapters/mcp/runtime-gateway/runtime-observation-adapter.ts +1200 -0
  73. package/adapters/mcp/runtime-gateway/runtime-readiness-observation.ts +218 -0
  74. package/adapters/mcp/runtime-gateway/runtime-tool-definitions.ts +574 -0
  75. package/adapters/mcp/runtime-gateway/runtime-tool-shared.ts +27 -0
  76. package/adapters/mcp/runtime-gateway/runtime-tools.ts +78 -0
  77. package/adapters/mcp/runtime-gateway/scheduler-adapter.ts +187 -0
  78. package/adapters/mcp/runtime-gateway/shared-adapter.ts +45 -0
  79. package/adapters/mcp/runtime-gateway/status-inbox-adapter.ts +962 -0
  80. package/adapters/mcp/runtime-gateway/typescript-navigation-sidecar.ts +136 -0
  81. package/adapters/mcp/runtime-gateway/work-adapter.ts +325 -0
  82. package/adapters/mcp/runtime-gateway/work-controller-operations.ts +257 -0
  83. package/adapters/mcp/runtime-gateway/work-detail-projection.ts +60 -0
  84. package/adapters/mcp/runtime-gateway/work-input-wire-migration.ts +246 -0
  85. package/adapters/mcp/runtime-gateway/work-learning-operations.ts +145 -0
  86. package/adapters/mcp/runtime-gateway/work-list-projection.ts +38 -0
  87. package/adapters/mcp/runtime-gateway/work-plan-operations.ts +382 -0
  88. package/adapters/mcp/runtime-gateway/work-repair-adapter.ts +308 -0
  89. package/adapters/mcp/runtime-gateway/work-requirement-operations.ts +148 -0
  90. package/adapters/mcp/runtime-gateway/work-semantic-operations.ts +263 -0
  91. package/adapters/mcp/runtime-gateway/work-validation-reconciler.ts +1 -0
  92. package/adapters/mcp/runtime-gateway/work-workflow-operations.ts +113 -0
  93. package/adapters/mcp/runtime-gateway/workflow-supervisor-adapter.ts +156 -0
  94. package/adapters/mcp/server.ts +1092 -0
  95. package/adapters/mcp/setup.ts +789 -0
  96. package/adapters/mcp/tool-capability-cache.ts +87 -0
  97. package/adapters/mcp/tool-mapping/access-tools.ts +387 -0
  98. package/adapters/mcp/tool-mapping/legacy-tool-service.ts +5139 -0
  99. package/adapters/mcp/tool-mapping/post-finalize-work-attribution.ts +145 -0
  100. package/adapters/mcp/tool-mapping/repository-tools.ts +1682 -0
  101. package/adapters/mcp/tool-mapping/tools.ts +9 -0
  102. package/adapters/mcp/tool-mapping/umbrella-tools.ts +117 -0
  103. package/adapters/mcp/toolset-names.ts +79 -0
  104. package/adapters/mcp/toolset-selection.ts +41 -0
  105. package/adapters/mcp/toolset.ts +337 -0
  106. package/adapters/mcp/transports/http-observation.ts +365 -0
  107. package/adapters/mcp/transports/http.ts +933 -0
  108. package/adapters/mcp/transports/oauth-http.ts +322 -0
  109. package/adapters/mcp/transports/session-registry.ts +519 -0
  110. package/adapters/mcp/transports/stdio.ts +8 -0
  111. package/adapters/mcp/tunnels/openai-secure-tunnel.ts +223 -0
  112. package/adapters/mcp/types.ts +41 -0
  113. package/assets/AGENTS.md +2 -16
  114. package/assets/CLAUDE.md +2 -16
  115. package/assets/hooks/AGENTS.md +3 -14
  116. package/assets/hooks/CLAUDE.md +3 -14
  117. package/assets/hooks/hook-input.sh +9 -2
  118. package/assets/hooks/lib/workflow-state.sh +28 -10
  119. package/assets/hooks/prompt-guard.sh +63 -37
  120. package/assets/hooks/security-sentinel.sh +2 -1
  121. package/assets/hooks/session-start-context.sh +7 -5
  122. package/assets/hooks/stop-orchestrator.sh +13 -3
  123. package/assets/initializer-question-pack.v4.json +11 -7
  124. package/assets/partials/05-workflow.partial.md +18 -73
  125. package/assets/partials/07-footer.partial.md +1 -1
  126. package/assets/partials-agents/02-operating-mode.partial.md +1 -2
  127. package/assets/partials-agents/04-task-protocol.partial.md +14 -59
  128. package/assets/partials-agents/06-quality-safety.partial.md +11 -16
  129. package/assets/partials-agents/08-deep-docs.partial.md +1 -2
  130. package/assets/plan-map.json +11 -11
  131. package/assets/plugin-registry.v1.json +11 -3
  132. package/assets/plugin-trust-policy.v1.json +6 -0
  133. package/assets/recovery/ForgeRecovery.ps1 +100 -0
  134. package/assets/recovery/forge-wsl-rescue +271 -0
  135. package/assets/reference-configs/agentic-development-flow.md +25 -0
  136. package/assets/reference-configs/development-protocol.md +11 -15
  137. package/assets/reference-configs/document-generation.md +1 -1
  138. package/assets/reference-configs/global-working-rules.md +28 -1
  139. package/assets/reference-configs/harness-overview.md +22 -112
  140. package/assets/reference-configs/hook-operations.md +1 -1
  141. package/assets/reference-configs/sprint-contracts.md +2 -2
  142. package/assets/skill-version.json +2 -2
  143. package/assets/templates/helpers/architecture-event.ts +3 -34
  144. package/assets/templates/helpers/architecture-queue.sh +61 -10
  145. package/assets/templates/helpers/archive-workflow.sh +90 -180
  146. package/assets/templates/helpers/capability-config.ts +8 -11
  147. package/assets/templates/helpers/capability-resolver.ts +37 -19
  148. package/assets/templates/helpers/capture-plan.sh +2 -2
  149. package/assets/templates/helpers/check-architecture-sync.sh +1 -9
  150. package/assets/templates/helpers/check-task-sync.sh +82 -11
  151. package/assets/templates/helpers/check-task-workflow.sh +1 -3
  152. package/assets/templates/helpers/context-contract-sync.sh +1 -12
  153. package/assets/templates/helpers/contract-worktree.sh +26 -24
  154. package/assets/templates/helpers/ensure-task-workflow.sh +6 -8
  155. package/assets/templates/helpers/inspect-project-state.ts +1 -1
  156. package/assets/templates/helpers/migrate-project-template.sh +1 -1
  157. package/assets/templates/helpers/migrate-workflow-docs.ts +53 -239
  158. package/assets/templates/helpers/new-plan.sh +2 -2
  159. package/assets/templates/helpers/plan-to-todo.sh +3 -31
  160. package/assets/templates/helpers/sprint-backlog.sh +1 -1
  161. package/assets/templates/helpers/switch-plan.sh +1 -1
  162. package/assets/templates/helpers/workflow-contract.ts +1 -0
  163. package/assets/workflow-contract.v1.json +63 -171
  164. package/assets/workflows/xiaohongshu/xiaohongshu.collect-metrics.v1.draft.json +118 -0
  165. package/assets/workflows/xiaohongshu/xiaohongshu.publish-image-note.v1.draft.json +316 -0
  166. package/assets/workflows/xiaohongshu/xiaohongshu.publish-long-text.v1.draft.json +324 -0
  167. package/docs/architecture/CURRENT.md +233 -28
  168. package/docs/architecture/EVOLUTION.md +13 -0
  169. package/docs/architecture/decisions/20260801-controller-home-sqlite-state.md +2 -1
  170. package/docs/architecture/decisions/20260803-release-identity-binding-and-exit-policy.md +14 -5
  171. package/docs/architecture/decisions/20260823-immediate-controller-relay.md +6 -3
  172. package/docs/architecture/decisions/20260831-independent-windows-wsl-host-rescue.md +59 -0
  173. package/docs/architecture/decisions/20260904-ios-device-migration-baseline.md +120 -0
  174. package/docs/architecture/decisions/20260904-repository-runtime-data-boundary.md +42 -0
  175. package/docs/architecture/decisions/20260907-assistant-learning-loop.md +37 -0
  176. package/docs/architecture/decisions/20260907-controller-round-transition-policy.md +311 -0
  177. package/docs/architecture/decisions/20260907-maintenance-diagnosis-bounded-read.md +39 -0
  178. package/docs/architecture/decisions/20260916-workflow-supervisor-authority.md +249 -0
  179. package/docs/architecture/decisions/20260917-cognitive-memory-foundation.md +82 -0
  180. package/docs/architecture/decisions/20260918-stable-candidate-release-lifecycle.md +221 -0
  181. package/docs/architecture/decisions/20260919-autonomous-work-liveness.md +62 -0
  182. package/docs/architecture/decisions/20260924-thin-semantic-working-context.md +72 -0
  183. package/docs/architecture/decisions/20261001-supervisor-turn-authority.md +237 -0
  184. package/docs/architecture/decisions/20261005-forge-v3-desktop-client-boundary.md +77 -0
  185. package/docs/architecture/domains/verification.md +8 -0
  186. package/docs/architecture/domains/workflow-engine.md +7 -1
  187. package/docs/architecture/index.md +3 -3
  188. package/docs/architecture/modules/controller-runtime/transport-lifecycle.md +19 -8
  189. package/docs/architecture/requests/2026-09-04-computer-plugin-workflow-taxonomy.md +124 -0
  190. package/docs/forge-chatgpt-mcp-setup.md +5 -3
  191. package/docs/forge-plugin-management.md +20 -4
  192. package/docs/forge-runtime-self-healing-loop.md +2 -0
  193. package/docs/operations/benchmark-cross-version-freeze.md +38 -0
  194. package/docs/operations/controller-browser-plugin.md +3 -1
  195. package/docs/operations/controller-performance-and-502.md +17 -0
  196. package/docs/operations/controller-reliability-runbook.md +2 -2
  197. package/docs/operations/features.md +1 -1
  198. package/docs/operations/features.zh-CN.md +1 -1
  199. package/docs/operations/homebrew.md +2 -2
  200. package/docs/operations/mcp-tool-exposure.md +2 -0
  201. package/docs/operations/platform-support.md +16 -8
  202. package/docs/operations/platform-support.zh-CN.md +2 -2
  203. package/docs/operations/releasing.md +2 -0
  204. package/docs/operations/standalone-disaster-recovery.md +38 -5
  205. package/docs/operations/uu-remote-rescue.md +41 -0
  206. package/docs/operations/windows-wsl-host-rescue.md +133 -0
  207. package/docs/public-usage-guide.md +1 -1
  208. package/docs/public-usage-guide.zh-CN.md +1 -1
  209. package/docs/tutorials/01-install-and-start.md +1 -1
  210. package/docs/tutorials/01-install-and-start.zh-CN.md +1 -1
  211. package/docs/tutorials/02-connect-chatgpt.md +4 -4
  212. package/docs/tutorials/02-connect-chatgpt.zh-CN.md +4 -4
  213. package/docs/wiki/Implementation.md +1 -1
  214. package/package.json +46 -26
  215. package/packages/kernel/cognition/api/index.ts +6 -0
  216. package/packages/kernel/cognition/application/activation-service.ts +451 -0
  217. package/packages/kernel/cognition/application/consolidation-service.ts +185 -0
  218. package/packages/kernel/cognition/application/legacy-experience-adapter.ts +38 -0
  219. package/packages/kernel/cognition/application/memory-service.ts +64 -0
  220. package/packages/kernel/cognition/domain/learning.ts +106 -0
  221. package/packages/kernel/cognition/domain/memory.ts +254 -0
  222. package/packages/kernel/controller/api/index.ts +3 -0
  223. package/packages/kernel/controller/application/continuation-service.ts +281 -0
  224. package/packages/kernel/controller/application/controller-round-service.ts +41 -0
  225. package/packages/kernel/controller/application/controller-service.ts +30 -0
  226. package/packages/kernel/controller/domain/controller-round-transition-policy.ts +529 -0
  227. package/packages/kernel/controller/domain/controller-round.ts +110 -0
  228. package/packages/kernel/controller/domain/execution-quality.ts +135 -0
  229. package/packages/kernel/controller/domain/types.ts +56 -0
  230. package/packages/kernel/controller/index.ts +1 -0
  231. package/packages/kernel/controller/infrastructure/controller-binding-store.ts +84 -0
  232. package/packages/kernel/controller/infrastructure/controller-round-store.ts +1970 -0
  233. package/packages/kernel/controller/infrastructure/controller-session-store.ts +804 -0
  234. package/packages/kernel/controller/ports/controller-host.ts +18 -0
  235. package/packages/kernel/goal/api/index.ts +1 -0
  236. package/packages/kernel/goal/domain/types.ts +40 -0
  237. package/packages/kernel/goal/index.ts +1 -0
  238. package/packages/kernel/identity/api/index.ts +15 -0
  239. package/packages/kernel/identity/application/identity-service.ts +67 -0
  240. package/packages/kernel/identity/domain/activity-projection.ts +43 -0
  241. package/packages/kernel/identity/domain/capability-broker.ts +60 -0
  242. package/packages/kernel/identity/domain/grant.ts +72 -0
  243. package/packages/kernel/identity/domain/owned-resource.ts +116 -0
  244. package/packages/kernel/identity/domain/scope.ts +63 -0
  245. package/packages/kernel/identity/domain/semantic-sync.ts +81 -0
  246. package/packages/kernel/identity/domain/types.ts +44 -0
  247. package/packages/kernel/identity/domain/user-request.ts +93 -0
  248. package/packages/kernel/identity/domain/workspace.ts +56 -0
  249. package/packages/kernel/identity/index.ts +1 -0
  250. package/packages/kernel/identity/infrastructure/activity-projection-store.ts +77 -0
  251. package/packages/kernel/identity/infrastructure/capability-broker.ts +81 -0
  252. package/packages/kernel/identity/infrastructure/grant-store.ts +284 -0
  253. package/packages/kernel/identity/infrastructure/identity-store.ts +75 -0
  254. package/packages/kernel/identity/infrastructure/owned-resource-store.ts +259 -0
  255. package/packages/kernel/identity/infrastructure/user-request-store.ts +182 -0
  256. package/packages/kernel/memory/api/index.ts +5 -0
  257. package/packages/kernel/memory/application/experience-service.ts +118 -0
  258. package/packages/kernel/memory/application/outcome-service.ts +77 -0
  259. package/packages/kernel/memory/domain/experience.ts +103 -0
  260. package/packages/kernel/memory/domain/operational-prior.ts +92 -0
  261. package/packages/kernel/memory/index.ts +1 -0
  262. package/packages/kernel/scheduler/api/index.ts +4 -0
  263. package/packages/kernel/scheduler/application/eligibility.ts +252 -0
  264. package/packages/kernel/scheduler/application/schedule-service.ts +27 -0
  265. package/packages/kernel/scheduler/application/settlement.ts +182 -0
  266. package/packages/kernel/scheduler/domain/schedule.ts +236 -0
  267. package/packages/kernel/scheduler/index.ts +1 -0
  268. package/packages/kernel/scheduler/infrastructure/schedule-store.ts +805 -0
  269. package/packages/kernel/work/api/index.ts +16 -0
  270. package/packages/kernel/work/application/work-service.ts +123 -0
  271. package/packages/kernel/work/domain/check-receipt.ts +43 -0
  272. package/packages/kernel/work/domain/context-closure-receipt.ts +32 -0
  273. package/packages/kernel/work/domain/current-task-lineage.ts +104 -0
  274. package/packages/kernel/work/domain/engineering-contracts.ts +157 -0
  275. package/packages/kernel/work/domain/engineering-design.ts +286 -0
  276. package/packages/kernel/work/domain/engineering-profile.ts +238 -0
  277. package/packages/kernel/work/domain/evaluation-promotion-receipt.ts +186 -0
  278. package/packages/kernel/work/domain/execution-concurrency.ts +247 -0
  279. package/packages/kernel/work/domain/execution-snapshot.ts +2 -0
  280. package/packages/kernel/work/domain/implementation-review.ts +193 -0
  281. package/packages/kernel/work/domain/objective-graph.ts +119 -0
  282. package/packages/kernel/work/domain/project-engineering-contract.ts +224 -0
  283. package/packages/kernel/work/domain/repository-completion-receipt.ts +73 -0
  284. package/{src/runtime/control-plane/facade/work-state-machine.ts → packages/kernel/work/domain/state-machine.ts} +37 -66
  285. package/packages/kernel/work/domain/types.ts +534 -0
  286. package/packages/kernel/work/index.ts +1 -0
  287. package/packages/kernel/work/infrastructure/work-contract-store.ts +1967 -0
  288. package/packages/kernel/work/ports/work-contract-store.ts +21 -0
  289. package/packages/plugin-runtime/browser/index.ts +3 -0
  290. package/packages/plugin-runtime/browser/provider-registry.ts +110 -0
  291. package/packages/plugin-runtime/browser/runtime-contract.ts +150 -0
  292. package/packages/plugin-runtime/browser/session-authority.ts +62 -0
  293. package/packages/plugin-runtime/computer/chatgpt-identity.ts +24 -0
  294. package/packages/plugin-runtime/computer/conversation-target.ts +143 -0
  295. package/packages/plugin-runtime/computer/index.ts +8 -0
  296. package/packages/plugin-runtime/computer/provider-error.ts +26 -0
  297. package/packages/plugin-runtime/computer/provider-registration.ts +52 -0
  298. package/packages/plugin-runtime/computer/provider-registry.ts +63 -0
  299. package/packages/plugin-runtime/computer/provider.ts +19 -0
  300. package/packages/plugin-runtime/computer/target-authority.ts +215 -0
  301. package/packages/plugin-runtime/computer/target-persistence.ts +54 -0
  302. package/packages/plugin-runtime/external/index.ts +1 -0
  303. package/packages/plugin-runtime/external/unix-jsonl-transport.ts +581 -0
  304. package/packages/plugin-runtime/index.ts +3 -0
  305. package/packages/protocols/browser/index.ts +1 -0
  306. package/packages/protocols/browser/session.ts +98 -0
  307. package/packages/protocols/computer/contract.ts +225 -0
  308. package/packages/protocols/computer/index.ts +1 -0
  309. package/packages/protocols/failure/contract.ts +158 -0
  310. package/packages/protocols/failure/index.ts +1 -0
  311. package/packages/protocols/handoff/index.ts +1 -0
  312. package/packages/protocols/handoff/status.ts +22 -0
  313. package/packages/protocols/mcp/execution-context.ts +11 -0
  314. package/packages/protocols/mcp/index.ts +2 -0
  315. package/packages/protocols/mcp/tool-contract.ts +42 -0
  316. package/packages/workflow-runtime/api/index.ts +2 -0
  317. package/packages/workflow-runtime/application/interpreter.ts +342 -0
  318. package/packages/workflow-runtime/domain/workflow-asset.ts +223 -0
  319. package/packages/workflow-runtime/index.ts +1 -0
  320. package/scripts/activate-source-baseline.ts +7 -9
  321. package/scripts/assemble-template.ts +1 -1
  322. package/scripts/bootstrap-runtime-maintenance-recovery.sh +4 -1
  323. package/scripts/canary-chatgpt-provider-delivery.ts +97 -0
  324. package/scripts/canary-controller-semantic-wait.ts +183 -0
  325. package/scripts/canary-global-hook.sh +2 -2
  326. package/scripts/check-mcp-compatibility.ts +85 -7
  327. package/scripts/check-platform-support.mjs +28 -2
  328. package/scripts/check-public-docs.sh +1 -1
  329. package/scripts/check-repository-hygiene.mjs +92 -0
  330. package/scripts/check-runtime-architecture.mjs +1643 -127
  331. package/scripts/check-source-duplication.mjs +9 -1
  332. package/scripts/controller-ngrok-rotation.sh +5 -4
  333. package/scripts/create-project-dirs.sh +10 -74
  334. package/scripts/forge-local-recovery-helper.mjs +282 -0
  335. package/scripts/forge-uu-remote-rescue-helper.d.mts +31 -0
  336. package/scripts/forge-uu-remote-rescue-helper.mjs +409 -0
  337. package/scripts/forge-windows-host-recovery-helper.mjs +136 -0
  338. package/scripts/hook-shim.sh +2 -2
  339. package/scripts/init-project.sh +12 -70
  340. package/scripts/install-desktop-operator-registration.ts +4 -2
  341. package/scripts/install-independent-windows-wsl-recovery.ts +125 -0
  342. package/scripts/install-standalone-recovery.ts +122 -10
  343. package/scripts/install-uu-remote-rescue-registration.ts +74 -0
  344. package/scripts/install-windows-host-recovery-registration.ts +22 -0
  345. package/scripts/lib/controller-home-env.sh +6 -3
  346. package/scripts/lib/project-init-lib.sh +42 -582
  347. package/scripts/migrate-chatgpt-automation-schedules.ts +2 -2
  348. package/scripts/migrate-windows-wsl-controller-home.ts +306 -0
  349. package/scripts/open-source-audit-allowlist.txt +11 -1
  350. package/scripts/portability-bindings.mjs +70 -0
  351. package/scripts/run-bounded-command.mjs +60 -0
  352. package/scripts/run-bun-test-file.ts +22 -6
  353. package/scripts/run-governed-gate.ts +4 -2
  354. package/scripts/run-mobile-monitor-bridge.ts +0 -1
  355. package/scripts/smoke-control-plane-failure-domain.ts +94 -0
  356. package/scripts/smoke-mcp-http-runtime.ts +6 -1
  357. package/scripts/smoke-runtime-recovery.ts +13 -11
  358. package/scripts/smoke-schedule-engine.ts +24 -16
  359. package/scripts/smoke-unattended-transport-recovery.ts +223 -0
  360. package/scripts/smoke-user-request-continuation-restart.ts +232 -0
  361. package/scripts/smoke-workflow-supervisor-chrome-adapter.ts +92 -0
  362. package/scripts/smoke-workflow-supervisor-process-restart.ts +276 -0
  363. package/scripts/smoke-workflow-supervisor-restart-recovery.ts +150 -0
  364. package/scripts/smoke-workflow-supervisor.ts +103 -0
  365. package/scripts/test-governance.ts +51 -2
  366. package/scripts/verify-forge-runtime.sh +2 -1
  367. package/src/cli/agent-jobs/executor-health.ts +11 -34
  368. package/src/cli/agent-jobs/integration.ts +18 -49
  369. package/src/cli/agent-jobs/job-manager.ts +17 -4
  370. package/src/cli/chatgpt-browser/bind-server.ts +2 -1
  371. package/src/cli/chatgpt-browser/binding.ts +20 -10
  372. package/src/cli/chatgpt-browser/bridge-extension.ts +75 -0
  373. package/src/cli/chatgpt-browser/bridge-provider.ts +376 -11
  374. package/src/cli/chatgpt-browser/engine.ts +10 -11
  375. package/src/cli/chatgpt-browser/native-provider.ts +24 -83
  376. package/src/cli/chatgpt-browser/oracle-provider.ts +5 -3
  377. package/src/cli/chatgpt-browser/types.ts +1 -0
  378. package/src/cli/commands/bootstrap-control.ts +334 -0
  379. package/src/cli/commands/brain-assistant.ts +52 -0
  380. package/src/cli/commands/brain.ts +191 -40
  381. package/src/cli/commands/chatgpt.ts +32 -67
  382. package/src/cli/commands/computer.ts +437 -0
  383. package/src/cli/commands/doctor.ts +18 -1
  384. package/src/cli/commands/init-hook.ts +71 -61
  385. package/src/cli/commands/init.ts +3 -1
  386. package/src/cli/commands/mcp.ts +16 -10
  387. package/src/cli/commands/plugin.ts +38 -12
  388. package/src/cli/commands/recovery.ts +507 -80
  389. package/src/cli/commands/runtime.ts +12 -7
  390. package/src/cli/commands/setup-profile.ts +97 -39
  391. package/src/cli/commands/status.ts +2 -1
  392. package/src/cli/controller/check-runner.ts +500 -100
  393. package/src/cli/controller/completion-backlog.ts +3 -3
  394. package/src/cli/controller/completion-orchestrator.ts +4 -43
  395. package/src/cli/controller/completion-target.ts +3 -72
  396. package/src/cli/controller/context/source-materializer.ts +81 -100
  397. package/src/cli/controller/context/types.ts +7 -1
  398. package/src/cli/controller/context-pack.ts +28 -6
  399. package/src/cli/controller/execution-completion.ts +4 -7
  400. package/src/cli/controller/execution-policy.ts +36 -153
  401. package/src/cli/controller/governance.ts +2 -3
  402. package/src/cli/controller/issue-store.ts +4 -99
  403. package/src/cli/controller/launch-agents.ts +59 -18
  404. package/src/cli/controller/operational-plan.ts +24 -51
  405. package/src/cli/controller/runtime-config.ts +5 -1
  406. package/src/cli/controller/stuck-state-migration.ts +2 -3
  407. package/src/cli/controller/systemd-user.ts +148 -0
  408. package/src/cli/controller/types.ts +10 -70
  409. package/src/cli/controller/worklog.ts +67 -13
  410. package/src/cli/editing/edit-operation-contract.ts +92 -0
  411. package/src/cli/editing/edit-session.ts +290 -20
  412. package/src/cli/github/plugin.ts +17 -12
  413. package/src/cli/hook/route-registry.ts +3 -5
  414. package/src/cli/hook/runtime.ts +49 -3
  415. package/src/cli/index.ts +3 -0
  416. package/src/cli/local-bridge/connector-freshness.ts +2 -2
  417. package/src/cli/local-bridge/console-automations.ts +20 -15
  418. package/src/cli/local-bridge/console-view-models.ts +3 -12
  419. package/src/cli/local-bridge/facade-api.ts +105 -205
  420. package/src/cli/local-bridge/job-store.ts +1 -1
  421. package/src/cli/local-bridge/server.ts +48 -174
  422. package/src/cli/local-bridge/types.ts +0 -1
  423. package/src/cli/mcp/access-mode.ts +2 -132
  424. package/src/cli/mcp/access-tools.ts +2 -387
  425. package/src/cli/mcp/audit.ts +2 -32
  426. package/src/cli/mcp/auth.ts +2 -404
  427. package/src/cli/mcp/instructions.ts +2 -34
  428. package/src/cli/mcp/legacy-context.ts +2 -16
  429. package/src/cli/mcp/legacy-tool-service.ts +2 -5308
  430. package/src/cli/mcp/multi-repository.ts +2 -436
  431. package/src/cli/mcp/oauth-client-retirement.ts +74 -0
  432. package/src/cli/mcp/oauth.ts +2 -375
  433. package/src/cli/mcp/openai-secure-tunnel.ts +2 -0
  434. package/src/cli/mcp/paths.ts +2 -140
  435. package/src/cli/mcp/policy.ts +2 -232
  436. package/src/cli/mcp/post-finalize-work-attribution.ts +2 -150
  437. package/src/cli/mcp/proxy-env.ts +2 -62
  438. package/src/cli/mcp/readiness-projection.ts +2 -24
  439. package/src/cli/mcp/redaction.ts +2 -21
  440. package/src/cli/mcp/repo.ts +2 -24
  441. package/src/cli/mcp/repository-tools.ts +2 -1613
  442. package/src/cli/mcp/server.ts +2 -951
  443. package/src/cli/mcp/setup.ts +2 -737
  444. package/src/cli/mcp/tool-capability-cache.ts +2 -87
  445. package/src/cli/mcp/tool-contract.ts +2 -14
  446. package/src/cli/mcp/tools.ts +2 -9
  447. package/src/cli/mcp/toolset-names.ts +2 -70
  448. package/src/cli/mcp/toolset-selection.ts +2 -41
  449. package/src/cli/mcp/toolset.ts +2 -336
  450. package/src/cli/mcp/transports/AGENTS.md +1 -10
  451. package/src/cli/mcp/transports/CLAUDE.md +1 -10
  452. package/src/cli/mcp/transports/http.ts +2 -1414
  453. package/src/cli/mcp/transports/session-registry.ts +2 -490
  454. package/src/cli/mcp/transports/stdio.ts +2 -8
  455. package/src/cli/mcp/types.ts +2 -41
  456. package/src/cli/mcp/umbrella-tools.ts +2 -117
  457. package/src/cli/repositories/command-executor.ts +91 -39
  458. package/src/cli/repositories/command-scope.ts +139 -4
  459. package/src/cli/repositories/controller-home.ts +167 -1
  460. package/src/cli/repositories/ephemeral-workspace.ts +20 -30
  461. package/src/cli/repositories/git-command-executor.ts +2 -2
  462. package/src/cli/repositories/identity.ts +13 -0
  463. package/src/cli/repositories/registry.ts +145 -60
  464. package/src/cli/repositories/repository-snapshot.ts +53 -7
  465. package/src/cli/repositories/runtime-storage.ts +27 -2
  466. package/src/cli/repositories/safe-patch.ts +34 -38
  467. package/src/cli/repositories/selected-path-actions.ts +22 -2
  468. package/src/cli/repositories/structured-git.ts +167 -27
  469. package/src/cli/repository/session-cache.ts +92 -6
  470. package/src/cli/runtime/helper-runner.ts +7 -0
  471. package/src/cli/runtime-invocation.ts +8 -1
  472. package/src/cli/tools/codegraph.ts +44 -25
  473. package/src/core/adoption/manifest-templates.ts +1 -1
  474. package/src/core/adoption/plan.ts +3 -26
  475. package/src/core/adoption/workflow-contract-plan.ts +17 -9
  476. package/src/effects/process-runner.ts +8 -14
  477. package/src/runtime/context/assistant-context.ts +167 -0
  478. package/src/runtime/context/assistant-work-context.ts +209 -0
  479. package/src/runtime/context/automatic-learning.ts +565 -0
  480. package/src/runtime/context/codegraph-cache-boundary.ts +255 -0
  481. package/src/runtime/context/codegraph-read-provider.ts +55 -22
  482. package/src/runtime/context/codegraph-sidecar.cjs +8 -1
  483. package/src/runtime/context/cognitive-attention.ts +173 -0
  484. package/src/runtime/context/cognitive-skill-canary.ts +158 -0
  485. package/src/runtime/context/context-closure.ts +305 -0
  486. package/src/runtime/context/context-pack-process.ts +103 -0
  487. package/src/runtime/context/context-plane.ts +203 -0
  488. package/src/runtime/context/direct-controller-learning.ts +298 -0
  489. package/src/runtime/context/project-engineering-contract.ts +60 -0
  490. package/src/runtime/context/semantic-navigation-contract.ts +9 -0
  491. package/src/runtime/context/semantic-navigation.ts +6 -34
  492. package/src/runtime/context/typescript-navigation-process.ts +145 -0
  493. package/src/runtime/context/typescript-navigation.ts +89 -3
  494. package/src/runtime/control-plane/bootstrap/capability-provider.ts +74 -0
  495. package/src/runtime/control-plane/bootstrap/control-api.ts +57 -0
  496. package/src/runtime/control-plane/bootstrap/index.ts +5 -0
  497. package/src/runtime/control-plane/bootstrap/state-machine.ts +141 -0
  498. package/src/runtime/control-plane/bootstrap/store.ts +21 -0
  499. package/src/runtime/control-plane/bootstrap/types.ts +87 -0
  500. package/src/runtime/control-plane/cleanup-artifact-retention.ts +531 -0
  501. package/src/runtime/control-plane/codegraph-cache-retention.ts +164 -0
  502. package/src/runtime/control-plane/concurrency/work-execution-concurrency.ts +282 -0
  503. package/src/runtime/control-plane/execution/controller-authority-recovery.ts +380 -0
  504. package/src/runtime/control-plane/execution/edit-validation-coordinator.ts +113 -16
  505. package/src/runtime/control-plane/execution/execution-identity.ts +23 -3
  506. package/src/runtime/control-plane/execution/implementation-review-content.ts +95 -0
  507. package/src/runtime/control-plane/execution/repository-work-attribution.ts +7 -30
  508. package/src/runtime/control-plane/execution/retained-work-resume.ts +439 -102
  509. package/src/runtime/control-plane/execution/session-store.ts +31 -1
  510. package/src/runtime/control-plane/execution/validation.ts +34 -11
  511. package/src/runtime/control-plane/execution/work-authority-reconciler.ts +87 -0
  512. package/src/runtime/control-plane/execution/work-check-evidence.ts +137 -0
  513. package/src/runtime/control-plane/execution/work-completion-authority.ts +31 -44
  514. package/src/runtime/control-plane/execution/work-delivery-service.ts +497 -0
  515. package/src/runtime/control-plane/execution/work-evidence-policy.ts +46 -53
  516. package/src/runtime/control-plane/execution/work-execution-support.ts +85 -164
  517. package/src/runtime/control-plane/execution/work-handle-authority.ts +349 -73
  518. package/src/runtime/control-plane/execution/work-handle-store.ts +55 -2
  519. package/src/runtime/control-plane/execution/work-head-settlement.ts +108 -0
  520. package/src/runtime/control-plane/execution/work-lifecycle-audit.ts +173 -28
  521. package/src/runtime/control-plane/execution/work-operation-service.ts +92 -40
  522. package/src/runtime/control-plane/execution/work-preparation-service.ts +145 -269
  523. package/src/runtime/control-plane/execution/work-remote-delivery.ts +2 -3
  524. package/src/runtime/control-plane/execution/work-revision-diff.ts +39 -0
  525. package/src/runtime/control-plane/execution/work-terminal-cleanup.ts +543 -225
  526. package/src/runtime/control-plane/execution/work-validation-reconciler.ts +59 -45
  527. package/src/runtime/control-plane/execution/work-verification-context.ts +1 -1
  528. package/src/runtime/control-plane/execution/work-verification-service.ts +662 -52
  529. package/src/runtime/control-plane/execution/work-verification-snapshot.ts +205 -16
  530. package/src/runtime/control-plane/facade/capability-registry.ts +380 -44
  531. package/src/runtime/control-plane/facade/check-normalization.ts +3 -9
  532. package/src/runtime/control-plane/facade/codex-delegation.ts +10 -11
  533. package/src/runtime/control-plane/facade/controller-connection.ts +135 -0
  534. package/src/runtime/control-plane/facade/controller-session-store.ts +2 -488
  535. package/src/runtime/control-plane/facade/goal-workloop-access.ts +6 -22
  536. package/src/runtime/control-plane/facade/goal-workloop.ts +565 -1202
  537. package/src/runtime/control-plane/facade/handoff-inbox-application.ts +145 -0
  538. package/src/runtime/control-plane/facade/handoff-inbox-store.ts +266 -52
  539. package/src/runtime/control-plane/facade/index.ts +4 -3
  540. package/src/runtime/control-plane/facade/operation-digest.ts +34 -73
  541. package/src/runtime/control-plane/facade/plan-contract-store.ts +671 -245
  542. package/src/runtime/control-plane/facade/policy-gate.ts +0 -23
  543. package/src/runtime/control-plane/facade/repository-work-admission.ts +31 -23
  544. package/src/runtime/control-plane/facade/requirement-authority.ts +121 -0
  545. package/src/runtime/control-plane/facade/requirement-board.ts +9 -4
  546. package/src/runtime/control-plane/facade/rh-work-operation-contract.ts +85 -0
  547. package/src/runtime/control-plane/facade/self-healing-loop.ts +18 -53
  548. package/src/runtime/control-plane/facade/semantic-admission.ts +8 -16
  549. package/src/runtime/control-plane/facade/suggested-actions.ts +15 -15
  550. package/src/runtime/control-plane/facade/types.ts +218 -620
  551. package/src/runtime/control-plane/facade/work-continuation.ts +8 -8
  552. package/src/runtime/control-plane/facade/work-contract-store.ts +2 -1043
  553. package/src/runtime/control-plane/generated-cache-retention.ts +336 -19
  554. package/src/runtime/control-plane/global-scheduler/autonomous-continuation.ts +248 -0
  555. package/src/runtime/control-plane/global-scheduler/durable-admission.ts +13 -2
  556. package/src/runtime/control-plane/global-scheduler/maintenance.ts +274 -84
  557. package/src/runtime/control-plane/global-scheduler/periodic-cleanup-entry.ts +55 -0
  558. package/src/runtime/control-plane/global-scheduler/periodic-cleanup-process.ts +98 -0
  559. package/src/runtime/control-plane/global-scheduler/reconciliation.ts +3 -2
  560. package/src/runtime/control-plane/global-scheduler/scheduler-worker-entry.ts +10 -0
  561. package/src/runtime/control-plane/global-scheduler/scheduler.ts +227 -109
  562. package/src/runtime/control-plane/global-scheduler/wake-signal.ts +42 -2
  563. package/src/runtime/control-plane/global-scheduler/worker-launch.ts +18 -6
  564. package/src/runtime/control-plane/governance/access-policy.ts +19 -2
  565. package/src/runtime/control-plane/governance/authorization.ts +20 -3
  566. package/src/runtime/control-plane/launcher/chatgpt-round-continuation.ts +160 -0
  567. package/src/runtime/control-plane/launcher/chatgpt-work-binding-store.ts +2 -177
  568. package/src/runtime/control-plane/launcher/chatgpt-work-continuation.ts +139 -670
  569. package/src/runtime/control-plane/launcher/local-conversation-controller.ts +238 -0
  570. package/src/runtime/control-plane/launcher/provider-mcp-bootstrap.ts +25 -6
  571. package/src/runtime/control-plane/launcher/thin-launcher.ts +96 -194
  572. package/src/runtime/control-plane/lifecycle-retention-metrics.ts +60 -0
  573. package/src/runtime/control-plane/persistence/cognition-store.ts +820 -0
  574. package/src/runtime/control-plane/persistence/experience-store.ts +302 -0
  575. package/src/runtime/control-plane/persistence/operational-prior-store.ts +348 -0
  576. package/src/runtime/control-plane/persistence/requirement-store.ts +230 -80
  577. package/src/runtime/control-plane/persistence/sqlite-store.ts +654 -78
  578. package/src/runtime/control-plane/persistence/workflow-content-store.ts +98 -0
  579. package/src/runtime/control-plane/persistence/workflow-registry-store.ts +186 -0
  580. package/src/runtime/control-plane/persistence/workflow-run-store.ts +123 -0
  581. package/src/runtime/control-plane/release-retention.ts +154 -26
  582. package/src/runtime/control-plane/repository-namespace-retention.ts +208 -0
  583. package/src/runtime/control-plane/runtime-cleanup.ts +844 -38
  584. package/src/runtime/control-plane/runtime-generation.ts +6 -0
  585. package/src/runtime/control-plane/workspace/project-onboarding.ts +80 -0
  586. package/src/runtime/control-plane/workspace/semantic-sync-service.ts +479 -0
  587. package/src/runtime/control-plane/workspace/workspace-store.ts +249 -0
  588. package/src/runtime/diagnostics/incident-repair.ts +573 -0
  589. package/src/runtime/diagnostics/mcp-timing.ts +239 -6
  590. package/src/runtime/diagnostics/performance.ts +6 -14
  591. package/src/runtime/diagnostics/read-only-tool.ts +1 -1
  592. package/src/runtime/evidence/artifact-store.ts +216 -35
  593. package/src/runtime/evidence/evidence-store.ts +112 -8
  594. package/src/runtime/evidence/operational-shadow.ts +38 -0
  595. package/src/runtime/evidence/output-handle-index.ts +225 -0
  596. package/src/runtime/evidence/process-check-receipt.ts +5 -43
  597. package/src/runtime/evidence/result-store.ts +158 -44
  598. package/src/runtime/evidence/sensitive-output.ts +4 -4
  599. package/src/runtime/execution/jobs/receipt-recovery.ts +1 -1
  600. package/src/runtime/execution/jobs/store.ts +124 -6
  601. package/src/runtime/execution/managed-workspace.ts +112 -5
  602. package/src/runtime/execution/process-runtime/canary.ts +19 -5
  603. package/src/runtime/execution/process-runtime/check-classification.ts +48 -0
  604. package/src/runtime/execution/process-runtime/check-facade.ts +24 -10
  605. package/src/runtime/execution/process-runtime/check-receipt.ts +1 -1
  606. package/src/runtime/execution/process-runtime/check-result-retention.ts +132 -0
  607. package/src/runtime/execution/process-runtime/check-result.ts +177 -2
  608. package/src/runtime/execution/process-runtime/check-runner-sidecar.ts +58 -9
  609. package/src/runtime/execution/process-runtime/check-storage.ts +187 -0
  610. package/src/runtime/execution/process-runtime/command-facade.ts +117 -114
  611. package/src/runtime/execution/process-runtime/gc.ts +15 -2
  612. package/src/runtime/execution/process-runtime/handle-index.ts +176 -0
  613. package/src/runtime/execution/process-runtime/host-command-lane.ts +139 -0
  614. package/src/runtime/execution/process-runtime/index.ts +4 -0
  615. package/src/runtime/execution/process-runtime/interactive-admission.ts +2 -1
  616. package/src/runtime/execution/process-runtime/lightweight-managed.ts +283 -73
  617. package/src/runtime/execution/process-runtime/persisted-check.ts +130 -23
  618. package/src/runtime/execution/process-runtime/process-runner-entry.ts +47 -5
  619. package/src/runtime/execution/process-runtime/process-scope.ts +160 -0
  620. package/src/runtime/execution/process-runtime/resource-claims.ts +125 -64
  621. package/src/runtime/execution/process-runtime/runtime.ts +167 -17
  622. package/src/runtime/execution/process-runtime/store.ts +30 -2
  623. package/src/runtime/execution/process-runtime/types.ts +27 -0
  624. package/src/runtime/execution/workers/executor.ts +18 -19
  625. package/src/runtime/execution/workers/worker-entry.ts +1 -1
  626. package/src/runtime/gateway/mcp/execution-tools.ts +2 -207
  627. package/src/runtime/gateway/mcp/legacy-ios-tool-adapter.ts +2 -61
  628. package/src/runtime/gateway/mcp/persisted-check-process.ts +2 -3
  629. package/src/runtime/gateway/mcp/process-tools.ts +2 -289
  630. package/src/runtime/gateway/mcp/router.ts +2 -1125
  631. package/src/runtime/gateway/mcp/runtime-tool-definitions.ts +2 -565
  632. package/src/runtime/gateway/mcp/runtime-tools.ts +2 -6655
  633. package/src/runtime/gateway/mcp/work-validation-reconciler.ts +2 -1
  634. package/src/runtime/maintenance/cleanup.ts +38 -24
  635. package/src/runtime/platform/browser-product-discovery.ts +174 -0
  636. package/src/runtime/platform/computer-platform.ts +14 -0
  637. package/src/runtime/platform/executable-discovery.ts +54 -0
  638. package/src/runtime/platform/fetch-http-server.ts +90 -0
  639. package/src/runtime/platform/service-inventory.ts +130 -0
  640. package/src/runtime/platform/service-manager.ts +146 -0
  641. package/src/runtime/platform/windows-host-discovery.ts +118 -0
  642. package/src/runtime/platform/windows-recovery-deployment.ts +67 -0
  643. package/src/runtime/plugins/action-application.ts +192 -0
  644. package/src/runtime/plugins/app-store-connect-adapter.ts +47 -35
  645. package/src/runtime/plugins/browser-adapter.ts +898 -135
  646. package/src/runtime/plugins/browser-automation-service.ts +33 -34
  647. package/src/runtime/plugins/browser-macos-bridge.ts +386 -46
  648. package/src/runtime/plugins/browser-manifest-surface.ts +75 -17
  649. package/src/runtime/plugins/browser-native-session-service.ts +64 -14
  650. package/src/runtime/plugins/browser-provider-registry.ts +2 -109
  651. package/src/runtime/plugins/browser-registration.ts +32 -0
  652. package/src/runtime/plugins/browser-runtime-contract.ts +2 -154
  653. package/src/runtime/plugins/browser-runtime.ts +55 -10
  654. package/src/runtime/plugins/browser-session-authority.ts +101 -291
  655. package/src/runtime/plugins/browser-session-legacy-migration.ts +203 -0
  656. package/src/runtime/plugins/browser-session-store.ts +243 -80
  657. package/src/runtime/plugins/browser-session-types.ts +2 -98
  658. package/src/runtime/plugins/capability-authorization-grants.ts +272 -59
  659. package/src/runtime/plugins/catalog-trust.ts +82 -0
  660. package/src/runtime/plugins/computer-chatgpt-browser-adapter-installer.ts +219 -0
  661. package/src/runtime/plugins/computer-chatgpt-macos-target.ts +891 -0
  662. package/src/runtime/plugins/computer-registration.ts +1050 -0
  663. package/src/runtime/plugins/config-store.ts +119 -0
  664. package/src/runtime/plugins/desktop-operator-external-policy.ts +964 -0
  665. package/src/runtime/plugins/desktop-operator-registration.ts +123 -12
  666. package/src/runtime/plugins/errors.ts +8 -1
  667. package/src/runtime/plugins/external-adapter.ts +82 -323
  668. package/src/runtime/plugins/external-provider-policy.ts +48 -0
  669. package/src/runtime/plugins/external-registration.ts +30 -2
  670. package/src/runtime/plugins/external-unix-socket-probe.cjs +9 -3
  671. package/src/runtime/plugins/external-unix-socket.ts +64 -193
  672. package/src/runtime/plugins/first-party-external-registration.ts +163 -0
  673. package/src/runtime/plugins/first-party-registry.ts +3 -1
  674. package/src/runtime/plugins/github-adapter.ts +1 -2
  675. package/src/runtime/plugins/gmail-adapter.ts +29 -8
  676. package/src/runtime/plugins/google-calendar-adapter.ts +8 -8
  677. package/src/runtime/plugins/google-shared.ts +45 -53
  678. package/src/runtime/plugins/google-tasks-adapter.ts +8 -8
  679. package/src/runtime/plugins/ios-adapter.ts +2 -3
  680. package/src/runtime/plugins/lightweight-action.ts +208 -2
  681. package/src/runtime/plugins/local-system-adapter.ts +192 -2
  682. package/src/runtime/plugins/macos-capability-broker.ts +15 -105
  683. package/src/runtime/plugins/managed-process-adapter.ts +12 -5
  684. package/src/runtime/plugins/plugin-action-sidecar.ts +17 -13
  685. package/src/runtime/plugins/plugin-management-adapter.ts +1 -1
  686. package/src/runtime/plugins/resend-adapter.ts +15 -24
  687. package/src/runtime/plugins/store.ts +1003 -387
  688. package/src/runtime/plugins/types.ts +28 -1
  689. package/src/runtime/plugins/uu-remote-rescue-registration.ts +155 -0
  690. package/src/runtime/plugins/windows-host-recovery-install.ts +68 -0
  691. package/src/runtime/plugins/windows-host-recovery-registration.ts +85 -0
  692. package/src/runtime/plugins/xiaohongshu-publish.ts +102 -430
  693. package/src/runtime/projections/controller-context.ts +12 -6
  694. package/src/runtime/projections/git-status-sampler.ts +73 -22
  695. package/src/runtime/projections/invalidation.ts +7 -3
  696. package/src/runtime/projections/materialized-view.ts +93 -43
  697. package/src/runtime/recovery/actions.ts +3 -3
  698. package/src/runtime/recovery/capability-action-application.ts +229 -0
  699. package/src/runtime/recovery/index.ts +3 -0
  700. package/src/runtime/recovery/lifecycle-inventory.ts +338 -0
  701. package/src/runtime/recovery/local-jobs-repair.ts +14 -14
  702. package/src/runtime/recovery/maintenance-executor.ts +701 -168
  703. package/src/runtime/recovery/quarantine-retention.ts +256 -0
  704. package/src/runtime/recovery/store.ts +29 -11
  705. package/src/runtime/release/identity.ts +6 -0
  706. package/src/runtime/release/release-coordinator.ts +296 -0
  707. package/src/runtime/release/release-session.ts +716 -0
  708. package/src/runtime/release/release-state-migration.ts +25 -0
  709. package/src/runtime/resources/leases/store.ts +56 -25
  710. package/src/runtime/root/active-execution-power-assertion.ts +139 -0
  711. package/src/runtime/root/assistant-learning-loop.ts +45 -0
  712. package/src/runtime/root/browser-session-composition.ts +59 -0
  713. package/src/runtime/root/computer-composition.ts +376 -0
  714. package/src/runtime/root/computer-target-composition.ts +16 -0
  715. package/src/runtime/root/computer-target-persistence.ts +39 -0
  716. package/src/runtime/root/controller-progression-composition.ts +192 -0
  717. package/src/runtime/root/controller-round-composition.ts +126 -0
  718. package/src/runtime/root/controller-services.ts +2 -0
  719. package/src/runtime/root/deployment-topology.ts +106 -0
  720. package/src/runtime/root/entry.ts +8 -6
  721. package/src/runtime/root/gateway-adapter.ts +3 -3
  722. package/src/runtime/root/known-good-recovery.ts +184 -0
  723. package/src/runtime/root/local-bridge.ts +5 -3
  724. package/src/runtime/root/mcp-transport.ts +116 -23
  725. package/src/runtime/root/ownership.ts +261 -9
  726. package/src/runtime/root/package-connector-service.ts +212 -74
  727. package/src/runtime/root/package-runtime-release.ts +199 -33
  728. package/src/runtime/root/package-runtime-service.ts +77 -108
  729. package/src/runtime/root/release-execution-canary.ts +103 -0
  730. package/src/runtime/root/release-loader.ts +150 -0
  731. package/src/runtime/root/release-manifest.ts +185 -7
  732. package/src/runtime/root/release-materialize.ts +474 -31
  733. package/src/runtime/root/release-store.ts +425 -37
  734. package/src/runtime/root/runtime-lane.ts +191 -0
  735. package/src/runtime/root/runtime.ts +379 -32
  736. package/src/runtime/root/scheduled-controller-composition.ts +76 -0
  737. package/src/runtime/root/scheduler.ts +12 -4
  738. package/src/runtime/root/service-runner.ts +3 -3
  739. package/src/runtime/root/service.ts +73 -45
  740. package/src/runtime/root/status.ts +49 -0
  741. package/src/runtime/root/types.ts +55 -3
  742. package/src/runtime/root/workflow-supervisor-composition.ts +493 -0
  743. package/src/runtime/root/workflow-supervisor-runtime.ts +209 -0
  744. package/src/runtime/root/write-fence.ts +50 -2
  745. package/src/runtime/safe-tooling/google-credential-store.ts +76 -21
  746. package/src/runtime/safe-tooling/google-oauth-broker.ts +25 -7
  747. package/src/runtime/safe-tooling/workspace-auth.ts +1 -1
  748. package/src/runtime/shared/bounded-child-supervisor.ts +9 -1
  749. package/src/runtime/shared/local-bridge-surface.ts +1 -1
  750. package/src/runtime/shared/process-environment.ts +36 -10
  751. package/src/runtime/shared/response-budget.ts +1 -3
  752. package/src/runtime/shared/storage-capacity.ts +68 -0
  753. package/src/runtime/standalone-recovery/controller-home-migration.ts +1108 -0
  754. package/src/runtime/standalone-recovery/core.ts +4609 -495
  755. package/src/runtime/standalone-recovery/entry.ts +642 -81
  756. package/src/runtime/standalone-recovery/independent-host-rescue.ts +172 -0
  757. package/src/runtime/standalone-recovery/installer.ts +399 -177
  758. package/src/runtime/standalone-recovery/mcp-server.ts +79 -0
  759. package/src/runtime/standalone-recovery/mutation-identity-contract.ts +21 -0
  760. package/src/runtime/standalone-recovery/operation-lock.ts +160 -0
  761. package/src/runtime/standalone-recovery/performance.ts +173 -0
  762. package/src/runtime/standalone-recovery/release.ts +58 -5
  763. package/src/runtime/standalone-recovery/service-labels.ts +5 -2
  764. package/src/runtime/standalone-recovery/watchdog-heartbeat.ts +5 -2
  765. package/src/runtime/watchdog/workflow-watchdog.ts +1 -1
  766. package/src/runtime/workflow/schedules/browser-probe.ts +17 -6
  767. package/src/runtime/workflow/schedules/chatgpt-automation-migration.ts +11 -4
  768. package/src/runtime/workflow/schedules/engine.ts +298 -484
  769. package/src/runtime/workflow/schedules/pending-activation.ts +1 -1
  770. package/src/runtime/workflow/schedules/settlement.ts +2 -191
  771. package/src/runtime/workflow/schedules/store.ts +2 -607
  772. package/src/runtime/workflow/schedules/types.ts +2 -127
  773. package/src/runtime/workflow/schedules/work-continuation.ts +220 -16
  774. package/src/runtime/workflows/first-party/xiaohongshu.ts +122 -0
  775. package/src/runtime/workflows/runtime.ts +482 -0
  776. package/src/testing/test-governance.ts +95 -30
  777. package/supervisor/chatgpt-conversation.ts +23 -0
  778. package/supervisor/client.ts +201 -0
  779. package/supervisor/control-plane.ts +868 -0
  780. package/supervisor/entry.ts +15 -0
  781. package/supervisor/forge-validators.ts +80 -0
  782. package/supervisor/index.ts +5 -0
  783. package/supervisor/native-browser-adapter.ts +786 -0
  784. package/supervisor/native-messaging/host.ts +39 -0
  785. package/supervisor/native-messaging/manifest.ts +26 -0
  786. package/supervisor/native-messaging/protocol.ts +27 -0
  787. package/supervisor/paths.ts +18 -0
  788. package/supervisor/protocol.ts +202 -0
  789. package/supervisor/server.ts +404 -0
  790. package/supervisor/store.ts +1451 -0
  791. package/supervisor/tsconfig.json +8 -0
  792. package/supervisor/types.ts +255 -0
  793. package/assets/templates/helpers/archive-architecture-request.sh +0 -244
  794. package/docs/architecture/history/README.md +0 -7
  795. package/docs/architecture/history/chatgpt-handoff-facade.md +0 -397
  796. package/docs/architecture/history/global-hook-runtime.md +0 -166
  797. package/docs/architecture/history/ios-semantic-automation-provider-v2.md +0 -170
  798. package/docs/architecture/requests/archive/2026/20260528-154740-ai-hooks-ai-hooks-hook-input-sh.md +0 -59
  799. package/docs/architecture/requests/archive/2026/20260528-154816-assets-hooks-assets-hooks-hook-input-sh.md +0 -59
  800. package/docs/architecture/requests/archive/2026/20260528-161851-ai-harness-workflow-contract-json-ai-harness-workflow-contract-json.md +0 -59
  801. package/docs/architecture/requests/archive/2026/20260528-161853-scripts-check-task-workflow-sh-scripts-check-task-workflow-sh.md +0 -59
  802. package/docs/architecture/requests/archive/2026/20260528-161911-assets-workflow-contract-v1-json-assets-workflow-contract-v1-json.md +0 -59
  803. package/docs/architecture/requests/archive/2026/20260528-222416-ai-hooks-ai-hooks-hook-input-sh.md +0 -59
  804. package/docs/architecture/requests/archive/2026/20260528-222444-ai-hooks-ai-hooks-pre-edit-guard-sh.md +0 -59
  805. package/docs/architecture/requests/archive/2026/20260528-222457-ai-hooks-ai-hooks-pre-edit-guard-sh.md +0 -59
  806. package/docs/architecture/requests/archive/2026/20260528-222648-ai-hooks-ai-hooks-pre-edit-guard-sh.md +0 -59
  807. package/docs/architecture/requests/archive/2026/20260528-222705-ai-hooks-ai-hooks-worktree-guard-sh.md +0 -59
  808. package/docs/architecture/requests/archive/2026/20260528-222726-ai-hooks-ai-hooks-prompt-guard-sh.md +0 -59
  809. package/docs/architecture/requests/archive/2026/20260528-222727-ai-hooks-ai-hooks-prompt-guard-sh.md +0 -59
  810. package/docs/architecture/requests/archive/2026/20260528-224736-ai-hooks-ai-hooks-hook-input-sh.md +0 -59
  811. package/docs/architecture/requests/archive/2026/20260528-233259-ai-hooks-ai-hooks-prompt-guard-sh.md +0 -59
  812. package/docs/architecture/requests/archive/2026/20260528-233335-assets-hooks-assets-hooks-prompt-guard-sh.md +0 -59
  813. package/docs/architecture/requests/archive/2026/20260528-233456-ai-hooks-ai-hooks-prompt-guard-sh.md +0 -59
  814. package/docs/architecture/requests/archive/2026/20260528-233457-assets-hooks-assets-hooks-prompt-guard-sh.md +0 -59
  815. package/docs/architecture/requests/archive/2026/20260528-233637-ai-hooks-ai-hooks-prompt-guard-sh.md +0 -59
  816. package/docs/architecture/requests/archive/2026/20260528-233638-assets-hooks-assets-hooks-prompt-guard-sh.md +0 -59
  817. package/docs/architecture/requests/archive/2026/20260529-000322-root-package-json.md +0 -59
  818. package/docs/architecture/requests/archive/2026/20260529-004238-ai-hooks-ai-hooks-lib-workflow-state-sh.md +0 -59
  819. package/docs/architecture/requests/archive/2026/20260529-020654-ai-harness-policy-json-ai-harness-policy-json.md +0 -63
  820. package/docs/architecture/requests/archive/2026/20260529-094236-ai-hooks-ai-hooks-prompt-guard-sh.md +0 -60
  821. package/docs/architecture/requests/archive/2026/20260529-094323-assets-hooks-assets-hooks-prompt-guard-sh.md +0 -60
  822. package/docs/architecture/requests/archive/2026/20260529-094331-ai-hooks-ai-hooks-prompt-guard-sh.md +0 -60
  823. package/docs/architecture/requests/archive/2026/20260529-094339-assets-hooks-assets-hooks-prompt-guard-sh.md +0 -60
  824. package/docs/architecture/requests/archive/2026/20260529-094430-assets-hooks-assets-hooks-session-start-context-sh.md +0 -60
  825. package/docs/architecture/requests/archive/2026/20260529-094446-ai-hooks-ai-hooks-session-start-context-sh.md +0 -60
  826. package/docs/architecture/requests/archive/2026/20260613-002040-runtime-harness-hook-adapters.md +0 -68
  827. package/docs/architecture/requests/archive/2026/root.md +0 -68
  828. package/docs/architecture/requests/archive/2026/runtime-harness-hook-adapters.md +0 -76
  829. package/docs/architecture/requests/archive/2026/verification-evals-checks.md +0 -68
  830. package/docs/architecture/requests/archive/2026/workflow-engine-contract-assets.md +0 -69
  831. package/scripts/archive-architecture-request.sh +0 -4
  832. package/scripts/benchmark-background-check-overlap.ts +0 -228
  833. package/scripts/benchmark-controller-hotpath.ts +0 -212
  834. package/scripts/benchmark-controller-round2.ts +0 -139
  835. package/scripts/benchmark-ios-agent-device.ts +0 -514
  836. package/scripts/benchmark-mcp-host.sh +0 -117
  837. package/scripts/benchmark-mcp-transport.ts +0 -170
  838. package/scripts/benchmark-quality-harness.ts +0 -146
  839. package/scripts/benchmark-route-session-concurrency.ts +0 -915
  840. package/scripts/benchmark-thin-harness-gateway-ab.ts +0 -632
  841. package/scripts/benchmark-thin-harness-mcp-e2e.ts +0 -498
  842. package/scripts/benchmark-thin-harness.ts +0 -251
  843. package/scripts/benchmark-typescript-navigation.ts +0 -186
  844. package/scripts/benchmark-work-efficiency.ts +0 -334
  845. package/scripts/build-controller-ui.ts +0 -28
  846. package/scripts/check-npm-release.sh +0 -32
  847. package/scripts/check-public-release-surface.sh +0 -19
  848. package/scripts/check-release-published.sh +0 -57
  849. package/scripts/check-release-readiness.sh +0 -37
  850. package/scripts/check-release-version.mjs +0 -74
  851. package/scripts/check-tarball-install-smoke.sh +0 -67
  852. package/scripts/package-source-archive.sh +0 -147
  853. package/scripts/public-release-files.txt +0 -39
  854. package/scripts/public-release.ts +0 -174
  855. package/scripts/publish-release-tarball.sh +0 -27
  856. package/scripts/route-nl-vs-ts-eval.ts +0 -679
  857. package/scripts/run-skill-evals.ts +0 -1022
  858. package/scripts/stage-runtime-release.ts +0 -39
  859. package/src/cli/controller/progress.ts +0 -656
  860. package/src/cli/controller/work-mode.ts +0 -181
  861. package/src/cli/local-bridge/console-assets.ts +0 -17
  862. package/src/cli/local-bridge/dashboard.ts +0 -17
  863. package/src/cli/local-bridge/frontend/src/App.tsx +0 -10
  864. package/src/cli/local-bridge/frontend/src/components/Button.tsx +0 -1
  865. package/src/cli/local-bridge/frontend/src/components/DetailPane.tsx +0 -3
  866. package/src/cli/local-bridge/frontend/src/components/SearchField.tsx +0 -1
  867. package/src/cli/local-bridge/frontend/src/components/SectionHeader.tsx +0 -1
  868. package/src/cli/local-bridge/frontend/src/components/Segmented.tsx +0 -1
  869. package/src/cli/local-bridge/frontend/src/components/StatusText.tsx +0 -3
  870. package/src/cli/local-bridge/frontend/src/design/icons.tsx +0 -11
  871. package/src/cli/local-bridge/frontend/src/design/tokens.css +0 -8
  872. package/src/cli/local-bridge/frontend/src/features/automations/AutomationsView.tsx +0 -153
  873. package/src/cli/local-bridge/frontend/src/features/capabilities/CapabilitiesView.tsx +0 -37
  874. package/src/cli/local-bridge/frontend/src/features/overview/OverviewView.tsx +0 -183
  875. package/src/cli/local-bridge/frontend/src/features/repositories/RepositoriesView.tsx +0 -2
  876. package/src/cli/local-bridge/frontend/src/features/system/SystemView.tsx +0 -2
  877. package/src/cli/local-bridge/frontend/src/features/work/WorkView.tsx +0 -4
  878. package/src/cli/local-bridge/frontend/src/lib/api.ts +0 -30
  879. package/src/cli/local-bridge/frontend/src/lib/format.ts +0 -4
  880. package/src/cli/local-bridge/frontend/src/lib/routes.ts +0 -7
  881. package/src/cli/local-bridge/frontend/src/main.tsx +0 -1
  882. package/src/cli/local-bridge/frontend/src/shell/AppShell.tsx +0 -1
  883. package/src/cli/local-bridge/frontend/src/shell/CommandBar.tsx +0 -2
  884. package/src/cli/local-bridge/frontend/src/shell/Sidebar.tsx +0 -4
  885. package/src/cli/local-bridge/frontend/src/styles.css +0 -28
  886. package/src/cli/local-bridge/frontend/src/types.ts +0 -15
  887. package/src/cli/local-bridge/frontend/src/vite-env.d.ts +0 -1
  888. package/src/cli/local-bridge/frontend/vite.config.ts +0 -27
  889. package/src/cli/local-bridge/ui-dist/app.css +0 -1
  890. package/src/cli/local-bridge/ui-dist/app.js +0 -11228
  891. package/src/runtime/control-plane/execution/direct-edit-work-completion.ts +0 -385
  892. package/src/runtime/control-plane/execution/work-finalization-service.ts +0 -1913
  893. package/src/runtime/control-plane/execution/work-path-scope.ts +0 -37
  894. package/src/runtime/control-plane/execution/work-task-receipt.ts +0 -449
  895. package/src/runtime/control-plane/facade/controller-round-relay.ts +0 -1118
  896. package/src/runtime/control-plane/facade/work-admission-policy.ts +0 -93
  897. package/src/runtime/control-plane/facade/work-task-projection.ts +0 -66
  898. package/src/runtime/control-plane/routing/index.ts +0 -1
  899. package/src/runtime/control-plane/routing/route-policy.ts +0 -382
  900. package/src/runtime/control-plane/routing/workspace-admission.ts +0 -70
@@ -1,23 +1,56 @@
1
1
  # Forge Current Architecture
2
2
 
3
+ ### Technical design baseline
4
+
5
+ This authority applies one default design rule across new architecture and refactors: **Forge is thin but capable — stateless in coordination, stateful in facts, optimistic in concurrency, and explicit in effects.** The model/controller owns reasoning, workflow policy, validation strategy and semantic completion; Forge owns durable facts, execution capabilities, mechanical correctness and recoverable effects. Cognitive learning follows the same split: the model authors reusable semantic deltas and usage judgments, while the shared MCP transport may settle that bounded advisory metadata after any successful meaningful ordinary tool outcome; routine micro-steps do not create a learning lifecycle.
6
+
7
+ - **One fact, one authority.** Do not repair ambiguity with mirrored status, a compatibility owner, a second lifecycle, or another orchestration store. Composition services should remain stateless over existing authorities whenever practical.
8
+ - **Classify state explicitly.** Durable semantic facts survive restart; runtime handles/connections are ephemeral; summaries, indexes and status views are rebuildable projections. Transport or execution identity must never become semantic identity.
9
+ - **Prefer optimistic concurrency.** Use expected-revision/CAS for semantic aggregates; serialize only the narrow aggregate or physical resource that truly conflicts, while unrelated aggregates remain parallel. Leases and fences protect liveness/physical mutation, not semantic truth.
10
+ - **Effects are explicit.** Reserve stable effect/request identity before replay-sensitive external mutation. Reads may retry when provider semantics allow it; idempotent mutations reuse the same key; ambiguous non-idempotent outcomes become `outcome_unknown` and must be observed/reconciled before any replay.
11
+ - **Events trigger; state decides.** Duplicate wakes/recovery demand coalesce around canonical occurrence/effect identity. Contention is a scheduling condition rather than semantic failure when the operation can run later.
12
+ - **Keep failure domains isolated.** Browser, MCP, plugin, provider or UI transport failure degrades that adapter/capability; it does not redefine Work/Scheduler semantics. Recovery reconstructs bindings from durable truth and reconciles effects; it does not invent a fallback authority.
13
+ - **Keep workflow policy above the Kernel.** Verification/review/merge ordering is user/model/project policy, not a reason to add durable `validating`, `reviewing`, `awaiting_acceptance`, `finalizing`, or similar Work states.
14
+ - **Stay a modular monolith.** Kernel/domain modules expose small ports; adapters translate provider/transport semantics once; composition roots wire dependencies and do not own domain policy. Use distributed-systems correctness disciplines without distributed deployment machinery unless deployment actually requires it.
15
+ - **Self-host through a stable control plane.** Stable Runtime evaluates candidate source/runtime; candidate validation either promotes atomically or leaves Stable authority intact.
16
+ - **Before adding state/store/service/daemon/queue/lock/retry paths, prove the missing fact or physical resource cannot be represented by the existing authority plus CAS, a narrow resource claim, or the existing effect ledger.**
17
+
3
18
  Status: **Runtime Authority**
4
19
 
5
20
  This file is the sole maintained architecture authority for the current Forge runtime. Executable code and persisted schemas are authoritative for implementation facts; this document defines the architecture contracts they are expected to preserve. Do not hard-code a source commit here: release-specific snapshots belong in [`versions/`](versions/).
6
21
 
7
22
  ## Product model
8
23
 
9
- Forge is an executable AI harness for a semantic controller. The controller owns requirement interpretation, repository understanding, implementation decisions, review, and the decision to keep exploring. Forge supplies fast context retrieval, deterministic local execution, provider actions, bounded verification, evidence, and optional durable continuity. Forge verification and evidence are factual inputs, not semantic acceptance rules: only the semantic Controller decides whether acceptance criteria are satisfied, whether another round is needed, or whether a Goal is complete.
24
+ Forge is an executable AI harness for a semantic controller. The controller owns requirement interpretation, repository understanding, implementation decisions and review. Forge supplies fast context retrieval, deterministic local execution, provider actions, bounded verification, evidence, and durable lower-layer continuity. Forge verification and evidence are factual inputs, not semantic acceptance rules.
25
+
26
+ Long-running autonomous operation adds one higher lifecycle authority: **Workflow Supervisor** owns cross-assistant-turn scheduling for an original Goal after the current ChatGPT/MCP call stack has ended. The stable outer-turn identity is the exact logical conversation, not a Requirement, Work, MCP request, Browser tab, or provider session. ChatGPT still owns semantic reasoning and submits a bounded `CONTINUE | DONE | NEEDS_USER` decision through the canonical Forge automation receipt; Supervisor derives the exact task, conversation and applied source effect locally. Legacy assistant-text receipts remain causal read compatibility for already-durable conversations. `DONE` and `NEEDS_USER` become terminal only after the configured completion/blocker contracts validate authoritative evidence. Work, ControllerRound, Scheduler and MCP/session recovery remain lower-layer authorities and must not impersonate this outer turn scheduler. See [Workflow Supervisor authority](decisions/20260916-workflow-supervisor-authority.md). V1 persists this authority only in `${ControllerHome}/supervisor/supervisor.sqlite`; `control-plane.sqlite` and the declarative `workflow_run` namespace are lower-layer authorities and are not Supervisor storage.
27
+
28
+ After explicit enrollment, the Supervisor task/effect/completion journal alone owns the prompt chain. For an already-enrolled standalone Supervisor, the fifteenth **committed** `CONTINUE` receipt since the most recent conversation migration atomically changes the successor to a fresh enrollment and records the one canonical conversation move in the same Supervisor transaction. The fresh bootstrap must be a new `/c/<id>` and cannot rebind its source conversation. Only genuinely current provider UI (not message history) may report a terminal conversation-length limit and initiate a bounded CAS-fenced migration; the duplicate-migration guard counts moves without a subsequent successful completion rather than imposing a lifetime cap. A causal `CONTINUE` atomically reserves its fixed successor; it never requires a lower Work to remain present, a ControllerRound budget to reopen, or a manufactured ControllerSession claim/release. Lower round preparation remains initial admission/direct-effect bookkeeping, and authenticated repository mutations keep their own scope, ownership and resource fences. An explicit conversation rebind denies new sends to the previous conversation while already-started effects remain eligible for read-only reconciliation. Scheduler uses canonical Work lookup for relay-referenced semantic Work instead of treating a repository projection omission as deletion. See [Supervisor turn authority](decisions/20261001-supervisor-turn-authority.md).
10
29
 
11
30
  ```text
12
- Semantic Controller
13
- -> Context Engine
14
- -> Thin Execution Harness
31
+ Original Goal / exact logical conversation
32
+ -> Workflow Supervisor (cross-turn durable authority; conversation-stable task)
33
+ -> active Requirement/Work scope
34
+ -> Semantic Controller / ChatGPT turn
35
+ -> Context + Thin Execution Harness / Forge Work
15
36
  -> Verification / Evidence
16
- -> Optional Durable Workflow / External Effect boundary
37
+ -> Provider / External Effect boundary
17
38
  ```
18
39
 
40
+ Project/browser discovery is a projection into that one authority, not another scheduler. A ChatGPT Project adapter may discover exact `/c/<id>` conversation identities for a repository-derived project scope and persist bounded discovery metadata. All Work-bound ChatGPT progression enters one stateless Runtime composition: launcher, Schedule and Scheduler liveness may prepare or reuse the same ControllerSession/ControllerBinding/ControllerRound mechanical facts, but none may submit a provider turn. `launcher_start` validates the request, optionally binds an explicit/current conversation, establishes retained controller identity when needed, invokes the canonical progression composition and returns without creating a Browser session or synchronously waiting for provider delivery. The composition derives/reuses the exact ControllerRound occurrence and provider-effect identity, then reserves the corresponding Workflow Supervisor task/effect. For a fresh Work with no canonical `/c/<id>`, Supervisor registers a bootstrap task against the ChatGPT root; only after that effect is durably reserved may the provider-neutral Computer ChatGPT target port ensure a target and dispatch the provider mutation. The Computer-owned Chromium extension is the primary semantic provider and Apple Events remains a compatibility provider; neither provider owns or directly consumes the Supervisor effect ledger. After the first confirmed submission exposes ChatGPT's canonical conversation URL, Supervisor atomically adopts that exact conversation as the durable task identity. For an already-bound conversation, the same registration RPC returns the existing conversation-stable task, including across explicit predecessor/successor Work turnover. Workflow Supervisor's effect ledger is the sole Work-bound ChatGPT send/retry/outcome-unknown replay authority; each applied turn settles through its existing task-scoped Forge automation receipt, with recovery/correction causality carried only as bounded model-facing advisory context; an idle provider response lacking a receipt remains an observable applied obligation and must not automatically trigger another provider send as though generation had hung; ControllerRound retains the lower mechanical occurrence/effect identity but is not a second provider replay owner. Browser/session/Supervisor unavailability before provider submission therefore remains lower-layer availability evidence and must not consume a provider-dispatch failure budget. Explicit `bound` transport without an existing binding or explicit URL is rejected rather than guessing from the foreground browser. Repeated discovery converges on the same conversation-stable Supervisor task. A mutable project title may select a discovery scope but never becomes conversation, Goal, Requirement, Work, or terminalization authority. Browser tabs, DOM, Accessibility, Native Messaging and project pages remain replaceable transports. Computer Surface stable identities are immutable during active ownership. A terminal Surface releases its physical tab binding index while retaining stable/alias identity for explicit reactivation; legacy terminal binding indexes may be reclaimed, but an active owner cannot be displaced. ChatGPT provider mutation is one bounded external-resource lane per active authenticated Controller Browser/bridge identity: concurrent continuation/standalone sends serialize in the active Runtime, and Workflow Supervisor outer-turn delivery shares that Runtime's provider-pressure scope; explicit 429, timeout, stream-unavailable, or outcome-unknown evidence creates shared transient provider backpressure with bounded exponential delay and `Retry-After` preference; pre-submit rate limiting never becomes an ambiguous send; post-submit rate limiting remains outcome-unknown and is reconciled rather than replayed. Provider-failure classification uses dedicated live error/status UI and typed network diagnostics where available, never ordinary conversation text; while 429 backpressure is active, Workflow Supervisor may continue bounded local observation but must neither mint a rate-limit recovery effect nor submit a recovery prompt. Only an explicitly enrolled unattended-continuation task receives generation liveness recovery: if the exact conversation continues to advertise generation but its assistant/provider activity digest is unchanged for the bounded grace window, Supervisor treats that turn as stale and reserves the existing exactly-once same-conversation recovery effect; ordinary non-enrolled chats are never adopted, and the already-applied source effect is never replayed. A bound `/c/<id>` is transport identity, so navigation failure fails closed instead of falling back to the ChatGPT root or inventing a replacement conversation. Provider pressure/session state is mechanical and process-local, never Requirement/Plan/Work lifecycle authority; ControllerRound effect identity remains the durable replay fence across Runtime rotation. A canonical Runtime rotation may mechanically rebind an exact live same-principal ControllerRound to the successor Runtime, but it must preserve that round's durable authority id rather than requiring chat-driven rekey; explicit stale or foreign authority remains fail-closed. Canonical Runtime projects one package-owned Computer Chromium extension and its Native Messaging bridge into supported Chromium-family browsers, including Chrome and Vivaldi on macOS. The bridge exposes only typed Computer target commands plus bounded discovery; it does not expose Supervisor effect RPCs or create browser-specific workflow authority. Unattended Supervisor sends request highest available reasoning through the same typed Computer target; the Chromium extension first performs a read-only exact-tab content-script capability preflight (so stale pre-upgrade scripts cannot silently ignore the request), then verifies the actual provider control before prompt mutation and records the verified level in existing effect evidence. An unavailable or unverified control rejects before sending, and compatibility providers never silently claim Extra High. Direct Computer sends without a reasoning requirement preserve the user's current preference. Normal Browser sessions default to Forge-managed persistent Browser resources with native attach disabled; the macOS native browser automation bridge remains an explicit compatibility provider only. Screen unlock/frontmost requirements belong only to explicit physical-input or visible-capture capabilities that mechanically need the foreground desktop; ordinary Browser DOM delivery and Supervisor continuation do not depend on them. Ephemeral Forge-owned ChatGPT tabs are settled through the existing Browser ownership boundary and record durable per-round settlement evidence so restart/periodic reconciliation closes them at most once; user-owned tabs are preserved and a recorded preservation is likewise terminal for cleanup.
41
+
42
+ Computer-owned ChatGPT delivery accepts an optional requested reasoning effort on the existing exact-target dispatch command. Unattended Workflow Supervisor prefers `xhigh`; the primary Chromium extension must select and verify the available composer level before mutation and report the **actual** verified effort (`xhigh`, `high`, or `medium`). A missing/disabled/unverified extension reasoning control fails closed. Only when the primary extension was proved unavailable **before mutation** may the existing target router select the Apple Events compatibility provider; it omits that optional effort preference, retains the exact effect and recovery mode, and never claims that `xhigh` was verified. A direct Apple Events request with an explicit reasoning requirement still fails closed. **Every Supervisor effect**, on either provider, must bind and verify the exact structured main-Forge App chip together with the complete effect payload before Send; a literal `@forge` text prefix is not a plugin invocation. An ambiguous app, invalid composer, or unavailable picker is a pre-send failure, never a text-only completion. Transport ambiguity **after** provider submission remains `outcome_unknown` under the same Supervisor effect identity, with no cross-provider retry. This is one provider capability/transport contract, not a second Work, Scheduler, completion, or reasoning authority.
43
+
19
44
  Quality is prioritized over interactive performance; performance is prioritized over durability machinery that does not materially improve ordinary coding.
20
45
 
46
+ ## Runtime performance acceptance
47
+
48
+ Recovery runaway acceptance is `runaway-cpu-v4`. Functional verification plus a fresh, process/release-bound CPU observation (10 seconds warmup, twenty 2.5-second windows, one core = 100%) still gate known-good, but runaway is decided by *sustained* consumption: a sample is rejected only when the mean exceeds the 25% ceiling or when at least half of the observed windows reach the 50% per-window ceiling. Nearest-rank p95 remains in the evidence for audit and is no longer the decision rule, because a tail-only estimator cannot separate bounded scheduled maintenance from runaway: the Canonical Runtime's release-fenced maintenance pass lasts several seconds and recurs about once per minute, so it always occupies the second-highest window of a 50-second observation (live rollbacks: mean 11-13% with p95 ~65% on a functionally healthy Runtime). The `runaway-cpu-v3` tail estimator described in the following paragraph is superseded by this rule; the same 25%/50% ceilings, the same 60-second budget and the separate Release Evaluation/Benchmark <=10% regression contract are unchanged.
49
+
50
+ Work candidate JSON filters use a Work-defined, SQLite-maintained partial index initialized during Runtime database startup; Work JSON and CAS remain authority. Read paths perform no DDL. Recovery known-good is explicit release acceptance, requiring functional verification and fresh process/release-bound CPU runaway evidence: 10 seconds warmup plus twenty 2.5-second windows, with a safety ceiling of mean <=25% and p95 <=50% (one core = 100%). The `runaway-cpu-v3` tail estimator therefore treats p95 as the second-highest of twenty windows rather than the single maximum, so one transient 2.5-second burst cannot by itself become terminal runaway evidence while repeated high-tail windows still fail the unchanged ceiling. This is deliberately a catastrophic/runaway guardrail, not comparative performance acceptance: the governed Release Evaluation/Benchmark authority owns the <=10% candidate-vs-baseline CPU regression contract. A soaking ReleaseSession may consume an already-durable, exactly matching recoverable known-good attestation for the same active release instead of repeating CPU observation; it still fences exact live Runtime/release identity before terminalizing the session. Public MCP semantic acceptance is the authenticated MCP end-to-end session (initialize, initialized notification, tools/list, read-only tools/call, session close); the separate unauthenticated external MCP probe remains diagnostic and drives dedicated external/tunnel repair, but cannot alone veto full stable verification when that stronger MCP E2E succeeds. The bounded read-only observation does not hold the exclusive Recovery mutation lock: production CPU sampling runs in one short-lived supervised child of the exact immutable `forge-recovery` release, so the persistent single Recovery daemon can keep serving Gateway/watchdog work without delaying the sampler's monotonic windows. The child is read-only execution, not another Recovery owner or writer; every sample is fenced to exact Runtime/release identity, the parent fences Recovery-release and Runtime identity again after observation, and final verification plus known-good persistence reacquire the short mutation lock. Watchdog health does not grant this acceptance or trigger CPU-based recovery. Explicit rollback cannot be vetoed by an active known-good designation; stopped-owner and whole-release/backup safety checks remain mandatory. Historical functional attestations remain rollback evidence without being reclassified as performance evidence. See [design and evidence](../researches/runtime-cpu-work-candidate-recovery-acceptance.md).
51
+
52
+ ReleaseSession Candidate B storage follows the same single-authority lifecycle. The ReleaseSession domain is the only durable semantic owner of normal Runtime release progression and rollback transaction semantics, and at most one non-terminal ReleaseSession may exist per Forge instance. ReleaseSession keeps wire `schemaVersion=1` so the immediately previous Recovery release can still inventory records after rollback, while `semanticEpoch=2` is the only current internal model; migration upgrades legacy epoch-1/epoch-less records once. RuntimeReleaseAuthority is a schema-v2 physical pointer/store only: active/previous immutable release identity plus the previous SQLite backup, with no ReleaseSession activation transaction state. A stateless ReleaseCoordinator always re-derives the next action from that durable phase and never creates a Work or coordinator-local state per release phase. Explicit/manual run-to-boundary calls may drain immediately executable phases within the existing fixed safety budget, but Runtime cutover itself has one caller-independent Connector quiet fence: automatic, explicit, and plugin-driven ReleaseSession progression all defer while MCP POST/stream/initialize activity is live or while remaining sessions have not satisfied the bounded quiet window. Cutover transport safety is therefore an invariant of the provider boundary, not a request-id policy. Unattended release progression is narrower: the single persistent Standalone Recovery daemon hosts one serial trigger loop, and each reconciliation launches one short-lived supervised child of the exact immutable `forge-recovery` release that invokes exactly one `advanceConfiguredRuntimeReleaseStep`. The trigger runs only while a non-terminal ReleaseSession exists or, with no active session, when configured source HEAD differs from the active Runtime manifest `sourceCommit`; equal source identity is a strict no-op and unknown source identity fails closed. The child owns no durable state or release intent, and the next trigger always re-derives work from persisted ReleaseSession state after success, crash, timeout, cutover, or Runtime restart. Standalone Recovery implements the release-facing provider boundary for physical candidate preparation, Runtime activation, verification and rollback. Normal Runtime release reuses the installed Recovery release and never upgrades Recovery merely because Runtime source changed; Recovery upgrades remain an explicit independent operation when its own artifact/contract changes. The Recovery process runs the health/watchdog policy in-process and owns health-driven restart/recovery only, never release intent. An interrupted `source_frozen` preparation resumes the same session when source and Stable A identity still match rather than creating another authority. The current `recovery/state/release-sessions` path is a storage location, not semantic ownership. Canonical Runtime maintenance is physical retention only: on the existing `releases` cleanup phase it may remove a path-fenced Candidate Home only when durable ReleaseSession phase proves Candidate B retired (`soaking`, `known_good`, `rolled_back`, or `failed`) and no live Candidate Runtime owner remains. Resumable phases and directories without readable ReleaseSession authority are retained and surfaced as bounded diagnostics; age alone never authorizes Candidate deletion. Ordinary repository Work completes at source-delivery acceptance and never waits for staging, cutover, soak or known-good. Release-level gates run once for the frozen ReleaseSession candidate, not once per contributing Work. No second cleanup daemon, ReleaseSession writer, runtime-switch Work state, or fallback authority is permitted.
53
+
21
54
  ## Controller efficiency contract
22
55
 
23
56
  - The optimization unit is a **semantic checkpoint**, not a single low-level operation. GPT may issue one intent that mechanically fans into several bounded reads/searches or one coherent edit-plus-validation transaction when the implied steps require no new semantic judgement.
@@ -33,14 +66,60 @@ Quality is prioritized over interactive performance; performance is prioritized
33
66
  - The first request may perform one broad parallel discovery fan-in; natural-language lexical terms are heuristic hints, not completeness obligations. Broad lexical discovery stops after sufficient distinct candidate evidence across multiple hints and reports the remaining coverage gap instead of scanning toward a quota for every guessed term; exact known-file and compiler-semantic retrieval remain strict.
34
67
  - Once credible paths or symbols are discovered, the semantic controller derives the next retrieval from returned source and prefers exact known paths, compiler-backed symbol navigation, or structural relationships over repeating the same broad lexical scan. Follow-up requests reuse in-process/session caches.
35
68
  - Exact known paths reserve retrieval budget and current raw source is authoritative.
36
- - Complete small files and complete matched symbols are preferred over arbitrary line windows.
69
+ - Complete small files and complete matched symbols are preferred over arbitrary line windows. Bounded source materialization never character-cuts a declared source range while reporting the original line bounds: oversized symbols are split into contiguous whole-line snippets, and if the file snippet budget is exhausted the final returned chunk is explicitly marked `truncated` with its actual end line. Partial source therefore degrades readiness instead of masquerading as complete code.
37
70
  - CodeGraph is discovery/relationship evidence, not semantic-completeness authority. Stale structural evidence must be labeled and current changed files remain raw-source authoritative.
38
71
  - TypeScript Language Service navigation provides compiler-backed definition/reference/implementation lookup for TypeScript symbols through `rh_context`. Swift uses the same bounded `semantic_navigation` route with SourceKit-LSP, but only on explicit symbol requests and only when SwiftPM, BSP (`buildServer.json`), or compilation-database build settings are already available; Forge never performs an implicit build/index just to answer context. Xcode projects use `xcode-build-server` as the build-settings bridge. Because a present BSP can still return generic inferred flags instead of target settings, explicit Swift navigation verifies xcode-build-server compiler-option quality before starting SourceKit; obviously fallback options are rejected as incomplete. Manual `.compile` data produced from real `xcodebuild` output is validated locally, while automatic xcode-build-server mode uses a short cached BSP probe. SourceKit sessions are started lazily, serialized per repo/workspace, kept for a short two-minute idle TTL, and resynchronize changed open files; the first explicit Xcode semantic request has a bounded cold-start budget while warm requests retain the tighter interactive budget. Ordinary `rh_context` calls do not start either the BSP probe or SourceKit. Missing/stale/fallback build settings degrade explicitly to lexical/CodeGraph evidence rather than returning a false complete closure.
39
- - The default 19-tool MCP schemas are a deployment ABI because approved ChatGPT apps may retain a frozen action/input snapshot. Core quality capabilities therefore need a path through already-stable facade fields. `rh_context` supports precise `@tsnav` and `@swiftnav` directives in `query` as compatibility paths; refreshed clients may use the existing structured `semantic_navigation` field.
72
+ - The default 19-tool MCP schemas are a deployment ABI because approved ChatGPT apps may retain a frozen action/input snapshot. Core quality capabilities therefore need a path through already-stable facade fields. `rh_context` supports precise `@tsnav` and `@swiftnav` directives in `query` as compatibility paths; refreshed clients may use the existing structured `semantic_navigation` field. For a newer semantic facade operation or newly required semantic field that an old `rh_work` schema cannot express, `operation=repair` plus `capability_id=semantic.v1:<bounded-payload>` is the generic transport-only compatibility envelope. The server owns an explicit per-operation allowlist and exact payload schema. The current allowlist admits `requirement_create` and `plan_create`: Requirement creation keeps `requirement_id` explicit outside the envelope, while frozen Plan creation transports only the missing bounded `obligation_dispositions`; Plan id, Requirement id, scope, source revision, steps and relation remain native stable arguments. Unknown operations/fields and conflicting native inputs fail closed, and both paths dispatch into the same canonical Requirement/Plan admission and Plan obligation-continuity authorities. Existing one-off field carrier `plan.obligations.v1` remains bounded migration debt for already deployed frozen clients, not a second Plan authority. No compatibility decoder owns semantic decisions or persistence. The generic envelope is removed once supported clients provide guaranteed schema/version negotiation rather than per-conversation frozen snapshots; until then new schema gaps must extend the allowlisted generic transport instead of minting one bespoke lifecycle/persistence path per field.
40
73
  - Exact lexical search remains necessary for dynamic registrations, manifests, string capability IDs, persisted aliases, and unrelated same-name implementations, but it is a discovery/fallback mechanism rather than the proof of static symbol completeness.
41
74
 
75
+ ## Cognitive Plane
76
+
77
+ - Forge has one domain-independent Cognitive Plane for long-term learning and associative recall. It follows **learn early, trust gradually**, but semantic admission, abstraction and scope are model decisions: Forge must not convert repetition counts, kinds, keywords, confidence thresholds, failures or execution codes into a rule for what deserves learning or when knowledge becomes cross-project.
78
+ - `MemoryUnit` / `MemoryEdge` / `LearningSignal` are advisory knowledge contracts, never Work/Controller/Scheduler authority. `LearningSignal.kind` is open descriptive vocabulary. A model may emit no learning or many semantic deltas; per-call item/byte limits are transport/resource envelopes and larger semantic deltas are recorded in additional batches. Forge derives provenance and persists through `CognitiveWriteAuthorityPort`; Cognition cannot terminalize Work, weaken safety or create a parallel lifecycle.
79
+ - Canonical cognition metadata/relations/evidence share the Controller SQLite authority. Large immutable payloads may use SHA-256 content-addressed storage. Derived lexical/concept/vector/graph/usage projections are rebuildable accelerators and cannot become competing durable truths.
80
+ - Existing `ExperienceRecord` remains a migration-compatible canonical record and is projected transiently into cognition during recall rather than durably duplicated. New generic memories use the cognition application service. When a deterministic `forge-incident-repair:*` Work closes a ControllerRound with current passed verification receipts, the same round-close learning composition records one evidence-backed `OutcomeObservation`, one durable repair `ExperienceRecord`, and one Cognitive `MemoryUnit` with exact source Work/Round provenance. This projection describes the verified repair candidate only; it is advisory and cannot change Work acceptance, mandatory checks, approval, ReleaseSession, Runtime cutover, or known-good authority.
81
+ - Every meaningful task start/resumption uses one bounded advisory resolver: ordinary `rh_context` work, ControllerRound composition, Workflow Supervisor turns, and Codex/Claude thin-launcher prompts share the same activation semantics. Work/Requirement/Project/Workspace candidates compete in one relevance ranking; narrower scope is a modest prior, never a Workspace starvation rule. Exact concepts expose rebuildable lexical parts, so multi-cue natural language can qualify a long memory without lowering the global cue floor. Optional semantic expansion exists only when a provider is configured; Forge does not claim vector semantics otherwise. Consolidated memory and retained `derived_from` sources consume one ordinary recall slot, while conflict/supersession views remain visible. The returned `ActivationPack` is an initial working set, not semantic completeness.
82
+ - Every Controller MCP tool shares one optional bounded cognition-settlement transport field, so ordinary repository/edit/process outcomes can learn too; the model emits it only at a meaningful successful outcome boundary, not on routine micro-steps. Forge settles it after the primary operation succeeds, derives repository/session/time and optional selected Work/Requirement provenance, validates reachable scope/evidence, and invokes the existing Cognitive writer/usage writer. A settlement defect is visible advisory metadata/warning and cannot convert an already-applied primary effect into retry authority. `rh_work learning_record` remains a compatibility surface over the same writer. This adds no Reflection/Memory lifecycle, per-tool reflection ritual, or second durable authority.
83
+ - Consolidation may mechanically coalesce related traceable memories while retaining source provenance, but it does not author a more abstract lesson or promote scope. Project-to-Workspace generalization is explicit model-authored semantics: the model may use repeated independent evidence as justification, but Forge has no fixed corroboration count or source-category gate. Workspace writes require explicit portable intent and remain advisory; they never create policy authority.
84
+ - `assistant_context_usage` remains canonical ControllerRound evidence. Used/rejected feedback affects retrieval applicability, not truth confidence; stale/contradicted rejection adds explainable conflict pressure without silently deleting memory. `rh_context search` exposes bounded read-only `knowledge_*` audit over reachable Project/Workspace/Work scopes, including provenance, relations, usage and activation reasons, but audit never contributes to source mutation readiness.
85
+ - Hot/warm/cold are retrieval/retention hints, not independent stores. Machine-native encodings remain internal implementation details; MCP/ChatGPT projection is semantic typed JSON/text. See [`decisions/20260917-cognitive-memory-foundation.md`](decisions/20260917-cognitive-memory-foundation.md).
86
+
42
87
  ## Execution lanes
43
88
 
89
+ ### Semantic classification authority
90
+
91
+ Execution placement, lifecycle, retry, authorization, and acceptance decisions consume typed domain contracts after ingress normalization. Human-readable ids, descriptions, prompts, log text, and error messages are evidence or presentation, not machine authority. When a legacy transport can provide only strings, one bounded compatibility ingress may normalize an explicitly constrained code/token into typed state with provenance; downstream routers and domain services must consume that typed state rather than repeat regex or substring inference. Compatibility decoders never become persistence or semantic owners.
92
+
93
+ ### Failure contract authority
94
+
95
+ Machine-visible failures have a stable code plus an explicit class and retry disposition; transport projections such as HTTP status derive from that contract. Free-form messages exist for diagnostics and user presentation. A producer-specific adapter may translate a native SDK/OS error into the failure contract once, but retry policy must not be inferred from words such as `temporary`, `worker`, or `network`, and authorization must not be inferred from arbitrary prose. Ambiguous non-idempotent outcomes use an explicit reconciliation-before-retry disposition rather than generic transient retry.
96
+
97
+ ### Persistent service identity authority
98
+
99
+ Forge core persistent service ownership is machine-enumerable in `src/runtime/platform/service-inventory.ts`. The inventory owns exact current Runtime/Connector/Recovery identities and an explicit exact retired set; platform service managers own only launchd/systemd mechanics. Standalone Recovery is one fault-domain-independent persistent service: its HTTP/MCP provider surface and watchdog policy share one process/lifecycle owner, while launchd/systemd supervises process death. Bounded read-only helper children, such as the known-good CPU sampler, may execute from the same immutable Recovery release but never become persistent service, mutation, or lifecycle authority. Historical Recovery Gateway/Watchdog service labels are retired migration identities, not current owners. Upgrade reconciliation may retire only exact entries from the retired Forge-core set and must verify service plus installed artifact absence. Broad `com.moretea.*` / `com.moretea.forge.*` prefix retirement is forbidden. Provider-owned services such as Desktop Operator and user-configured tunnel services remain outside Forge core retirement authority even when their labels share Forge naming.
100
+
101
+ ### Tool Contract ABI authority
102
+
103
+ The published tool contract is a transport ABI, not a second semantic authority. Current and frozen clients must enter the same canonical typed handlers. The stable `rh_work` operation registry is one ABI authority shared by MCP schema generation and server-side `SuggestedNextAction` admission, so lifecycle projection cannot invent an operation the published contract does not expose or reject an operation the schema already owns. New frozen `rh_work` compatibility travels through the versioned `semantic.v1` envelope; older ad-hoc `capability_id` prefixes are shrinking migration debt and new prefixes are rejected by the runtime architecture gate.
104
+
105
+ A bridge may derive only required machine identity or CAS expectations that the target authority itself exposes through a typed status contract. Explicit caller expectations are never overwritten, partial caller-owned machine identity is rejected rather than mixed with server-derived identity, and an upgraded tool whose required fields cannot be represented fails before mutation with `RECOVERY_TOOL_SCHEMA_UNREPRESENTABLE`. Tool-surface or installed-runtime skew must remain an explicit stale/coherence condition; it must not masquerade as a missing plugin, missing user input, or authorization decision.
106
+
107
+ ### Root-cause repair workflow
108
+
109
+ Repeated defects in routing, lifecycle, retry, authorization, schema compatibility, state projection, or placement are treated as architecture signals rather than isolated bug tickets. The required repair sequence is:
110
+
111
+ 1. Reproduce the smallest failing behavior and name the exact machine decision that was wrong. Do not start by adding a special case for the observed string, tool name, check id, error message, or status.
112
+ 2. Identify the current semantic owner and all inputs that influence that decision. Human-readable text, legacy status projections, transport session identity, and adapter-local inference are suspect whenever typed domain state already exists.
113
+ 3. Search the repository for the same semantic decision and equivalent heuristics. Same-root symptoms are consolidated under one repair Work/issue; they are not fixed as independent patches merely because they surfaced through different tools.
114
+ 4. Establish or select one typed owner for the decision. Adapters may normalize bounded legacy transport data once with provenance, but they do not own lifecycle, persistence, routing, retry, or acceptance semantics. Compatibility code must re-enter the canonical owner rather than create a parallel path.
115
+ 5. Migrate the highest-risk consumers first, preserving only bounded ingress compatibility that cannot yet be removed. Any compatibility debt must be visible and mechanically enumerable.
116
+ 6. Add focused behavioral regression for the old failure mode and an architecture guardrail when the defect class can recur mechanically. The regression must prove that the former heuristic no longer gains authority, not merely that the current example happens to pass.
117
+ 7. Run one representative end-to-end journey before closing the root issue family. Related issues close only after the canonical owner is in use, dominant consumers have migrated, the guardrail passes, and any tracked compatibility debt has shrunk or has an explicit remaining owner.
118
+
119
+ Recurring infrastructure failures use one incident-repair authority. MCP failures and Scheduler progression/release/maintenance observations are normalized to a stable root code, recorded only as bounded evidence in the existing audit/event ledgers, and promoted after the existing recurrence threshold into one request-id-deduplicated system repair Work. Repeated observations append evidence to that Work; unrelated root codes remain separate; a terminal repair may create only the next generation for the same root. The repair Work still enters normal Work admission, approval, verification, Controller, ReleaseSession, and Runtime fencing. Event ledgers are evidence, never a second failure or Work state machine. Provider authorization, user-action waits, and outcome-unknown effects are excluded from automatic repair promotion.
120
+
121
+ The runtime architecture gate maintains an AST-derived semantic-string debt ledger for authority-critical code. New human-readable string matching in machine-decision branches must not be normalized by casually extending that ledger; ledger additions are architecture exceptions requiring explicit review and a migration rationale. Ordinary repair work may only remove entries. This guardrail intentionally does not ban parsers, regexes, or string matching globally: discovery, presentation, input validation, and bounded compatibility ingress remain valid when they do not become downstream semantic authority.
122
+
44
123
  ### Ephemeral Direct — default
45
124
 
46
125
  Ordinary local reads, Git inspection, edits, local scripts, builds, and short checks should execute with minimal controller overhead. No persistent Work is created merely because the task is complex or investigative.
@@ -57,56 +136,154 @@ Persistent Work/Process state is reserved for actual continuity requirements: sc
57
136
 
58
137
  Remote or non-idempotent effects are explicit boundaries. Ambiguous outcomes are reported as `outcome_unknown`; Forge must not silently replay a non-idempotent remote operation.
59
138
  The low-level repository command facade classifies these operations as `durable` but does not dispatch them: it returns `not_started` with `never_auto_retry`. A typed provider action or explicitly owned Durable Workflow must perform the effect and reconcile remote state before any retry after an ambiguous result.
139
+ Effectful plugin/provider actions follow the same continuity rule. Before provider dispatch, Forge binds the stable `request_id` to one durable Process identity; the MCP/ChatGPT stream is only an observation channel. Read-only actions and explicitly `direct_non_persistent` actions may remain direct, but every other effectful plugin action executes through the managed Process sidecar. Interactive timeout, stream interruption, MCP session replacement, or Runtime rotation must reattach to the same Process/receipt and must never reacquire the provider resource for a duplicate dispatch. `apply_mode=async` requests zero interactive wait and returns the durable Process/result reference immediately. A terminal sidecar writes the authoritative plugin receipt, after which repeating the same `request_id` deterministically reads/binds that receipt without replay.
60
140
 
61
141
  ## Work and Plan
62
142
 
63
- Work is a continuity/orchestration mechanism, not a coding-quality mechanism. File count, changed-line count, protected paths, dirty workspace state, review intent, or investigation alone must not create Work. Complex implementation quality is achieved through better repository understanding and fresh review, not heavier lifecycle state.
143
+ Current-task semantics are a pure projection of the exact Work objective and explicit Work/Requirement/Plan lineage. Requirement and Plan identifiers may define broader Goal scope, but membership alone never pulls sibling Work into the current task, Controller mechanical fingerprint, continuation decision, or exact Work context. Repository-wide active Work remains repository inventory used only for typed ownership, conflict and release-admission observations; recency never establishes current-task authority. No current-task persistence store or second writer exists.
144
+
145
+ Objective decomposition is represented only by optional `semanticParentWorkId` plus bounded `dependsOnWorkIds` on primary semantic Work. `semanticParentWorkId` is a decomposition edge and is distinct from execution-child `parentWorkId`; `dependsOnWorkIds` is explicit ordering only and is never inferred from Plan items. Both relations use the same semantic Work CAS/revision history, require existing primary Work in the same canonical Work scope, reject self/cyclic edges, and project current/history graphs on read without a graph database or projection writer. Continuation/replacement remains `predecessorWorkId`/`supersedes`/`supersededBy`, so decomposition, dependency, execution ownership and continuation are four separate meanings.
146
+
147
+ Work is a continuity/orchestration mechanism, not a coding-quality mechanism. File count, changed-line count, protected paths, dirty workspace state, review intent, or investigation alone must not create Work. Complex implementation quality is achieved through better repository understanding and fresh review, not heavier lifecycle state. `work_complete` records the Controller's semantic completion decision rather than a Forge acceptance verdict, but semantic terminality is monotonic: `completed` and `cancelled` never reopen in place. If later evidence shows the same root cause remains incomplete, the model creates an explicit successor Work and preserves the prior terminal audit record. Terminal semantic state also starts reconciliation of Forge-owned execution resources by the existing `work_finalizer`; a repository completion receipt is delivery evidence, not a second cleanup authorization. The finalizer still independently proves exact OwnedResource identity, preserves dirty bytes and unique committed source, settles live process ownership, and honors explicit `retained_by_request` disposition before any physical removal; its cleanup receipt is durable progress/result evidence rather than lifecycle authority. Placement is a separate concern from Work creation. For mutating durable repository Work, the stable legacy/default `auto` placement is a mechanical alias for an isolated checkout with the Work start revision frozen; explicit `current` is the Controller/model choice to reuse the selected registered checkout. Admission does not infer or rewrite topology from dirty paths, task risk, parallel relations, or lifecycle state. Physical checkout isolation remains an execution fact: a shared-checkout Work and a disjoint isolated-checkout Work do not conflict merely because they share a repository id, while concrete WorkHandle, Lease, Git identity, and overlapping resource conflicts remain authoritative at mutation time. Once a mutating Work starts, its source/base is frozen until the final delivery boundary; target integration is not an implementation-time baseline update.
148
+
149
+ Plan is optional intent/coordination state. Initial likely paths are evidence, not a frozen semantic scope. The controller may discover and edit additional policy-allowed files without creating a second lifecycle solely because understanding improved. Durable semantic ownership is layered as `Requirement -> semantic scope -> stable Plan -> PlanRevision audit -> Work`: Requirement is portfolio/outcome authority, not a conflict domain; `scopeKey` identifies the bounded Plan slice; one current Plan identity owns that scope; ordinary replanning advances the same Plan through a staged durable revision; historical revision records are immutable audit evidence and never own active scope, Work, scheduling, or admission authority. `supersede` is reserved for true semantic Plan replacement, not normal iteration.
150
+
151
+ Same-Requirement sibling Plans with distinct scope may coexist without `parallel` ceremony, and Requirement membership alone never makes sibling Work a semantic continuation candidate. Existing Work is selected only through explicit Work relation or an exact Plan/step binding. Placement/resource conflicts remain separate execution-safety authorities, so narrowing semantic admission does not weaken single-writer or isolation fences. Older clients may still send `plan_create + plan_relation=extend + related_plan_id + a new plan_id`; that is transport compatibility only: Forge revises the related stable Plan in place and records the requested id only as bounded revision audit metadata instead of minting another active Plan.
152
+
153
+
154
+ ### Engineering Workloop authority
155
+
156
+ Engineering quality evidence is versioned Work-domain state, not a second Work/Plan lifecycle. The source-controlled `ProjectEngineeringContract` remains project fact authority; Work stores only its exact revision/digest receipt. `rh_context` produces a bounded exact-revision `ContextClosureReceipt` from current source, applicable guidance, project facts, Skill routing and semantic-tool readiness. The current Runtime generation keeps a bounded issued-receipt provenance registry: content hashes prove integrity, while Runtime issuance proves the exact receipt actually came from `rh_context`; a Runtime restart intentionally requires fresh Context Closure evidence. Legacy receipt-id strings remain audit compatibility only and cannot authorize high/critical mutation.
64
157
 
65
- Plan is optional intent/coordination state. Initial likely paths are evidence, not a frozen semantic scope. The controller may discover and edit additional policy-allowed files without creating a second lifecycle solely because understanding improved.
158
+ For material high/critical mutation, Runtime composition accepts semantic precondition content and mints source-bound `ProductDoDReceipt`, `DesignDecisionContractReceipt` and `IndependentCritiqueReceipt`; raw MCP arguments never carry the trusted evidence object into Kernel. Product DoD records user outcome, completion conditions, non-regression, material performance expectations and non-goals. Design records semantic scope keys and mutation class plus ownership/single-writer, transaction, lifecycle, concurrency, persistence, failure, projection/cache, time, performance and compatibility decisions. Its complexity budget makes added writers, durable mechanisms, projection paths, global invalidations, lifecycle hooks and synchronous critical-path work explicit before mutation. File paths are discovery/policy evidence, never semantic-scope authority.
66
159
 
67
- ### Persistent autonomous continuation
160
+ Independent critique is bound to the fresh Requirement digest, current-source Context Closure, Project Contract digest, Product DoD and exact Design receipt and only an `approved` critique satisfies high/critical admission. A same-root-cause blocker that invalidates an existing design persists `return_to_design`; when the Work already has a formal Design receipt, it marks that design `revisit_required` and mutation cannot resume until a new design explicitly supersedes the prior receipt and receives an independently `approved` critique. Progressive discovery inside the already selected architecture authority is instead classified explicitly as `same_root_cause_scope_extension`: it persists `extend_candidate`, keeps the exact Work/candidate, and continues through the same call without Design re-entry or sibling Work. Observe-only low/normal Work with no prior Design receipt keeps the conservative `same_root_cause` behavior unless the Controller explicitly classifies a bounded scope extension. An unrelated blocker deterministically creates or reuses one parallel investigation Work, persists its exact `linkedWorkId` in the `linked_work` disposition, and does not widen the current Work semantic scope. These receipts live inside existing Work authority; they do not create another persistence writer, lease, scheduler or lifecycle.
68
161
 
69
- A scheduled unattended workflow is one durable **Work + ChatGPT conversation lineage**, not one browser tab and not one schedule occurrence. The existing authorities compose into one lifecycle:
162
+ ### ControllerRound continuation and Workflow Supervisor boundary
70
163
 
71
- 1. A Schedule occurrence mechanically selects its already-bound active Work and requests `external_controller_wake`; it never invents semantic work.
72
- 2. The ChatGPT launcher resolves the Work's durable conversation binding, opens or reattaches only the execution tab/session needed for this round, submits the continuation prompt, and records dispatch evidence. Dispatch is transport evidence only; it is not a Controller claim or semantic completion.
73
- 3. The launched ChatGPT Controller claims the exact Work and independently reconstructs current Plan/Work/Schedule/Handoff/source/runtime evidence before deciding what to do. Chat history is useful transport context but is never the durable source of truth.
74
- 4. ChatGPT performs semantic reasoning while Forge performs deterministic context, edit, process, provider, verification, and finalize operations. Forge may automatically execute checks or lifecycle mechanics that ChatGPT explicitly requests, but it never infers that acceptance is satisfied.
75
- 5. Before a Controller round ends, ChatGPT records exactly one semantic disposition: `continue_immediately`, `wait`, `wait_for_user` with an active Handoff, or `goal_complete`. The exact Controller claim/release lineage fences this transition.
76
- 6. Round-owned automation resources are cleaned only after the round reaches its settlement boundary. User-owned browser tabs are preserved; a Forge-owned ephemeral ChatGPT tab may be closed while the Work's conversation id/url binding remains durable for the next wake.
77
- 7. `wait` keeps a persistent Work active and schedulable. A later Schedule wake must recover the same Work and same conversation lineage without requiring the user to restate the remaining task. `goal_complete` is the semantic terminal path and terminal Work automatically stops its continuation schedule.
164
+ This section describes the durable **Requirement/Plan/Step/Work/ControllerRound execution lineage** and its boundary with the upper cross-assistant-turn Workflow Supervisor. Provider conversations, browser tabs, ControllerSession transport ids, and Schedule occurrences are delivery or trigger facts; none is allowed to become a second continuation lifecycle.
78
165
 
79
- Machine-observable continuation health is derived from existing records rather than a new database: Schedule occurrence, WorkContract, ChatGPT conversation binding, ControllerSession/round relay, verification/finalization receipts, and browser cleanup evidence. Health reporting must distinguish `wake requested`, `prompt dispatched`, `Controller claimed`, `semantic disposition recorded`, `lease released`, `verification/finalize outcome`, `tab cleanup`, and `waiting/next eligible`; none of those states may be substituted for another.
166
+ 1. Scheduler owns only time/event/condition triggering. A Schedule occurrence contributes its exact occurrence identity and may request a ControllerRound action, but Scheduler does not persist continuation status, provider attempt state, provider receipts, semantic wait state, or replay authority. The retired `ScheduledContinuationDispatch` / `scheduler_continuation_dispatch` state machine must not be recreated.
167
+ 2. `ControllerRound` is the sole lower-layer continuation authority. It owns semantic disposition, exact occurrence binding, semantic fingerprint suppression, provider effect identity, dispatch start/attempt, receipt, `provider_dispatch_outcome_unknown`, `wait_for_user`, recovery fencing, and the currently open semantic round.
168
+ 3. Immediate lower-layer continuation does not require a Schedule. `continue_immediately` may close/release the current round and prepare the successor ControllerRound directly. A Schedule is used only when a real time/event/condition trigger is needed.
169
+ 4. `wait` keeps the lower semantic lane quiescent. The ControllerRound semantic fingerprint is derived from stable Requirement/Work/Handoff facts, excluding persistence timestamps and record ordering. An unchanged occurrence returns `semantic_wait` before provider dispatch; a meaningful semantic change may admit one successor round.
170
+ 5. `ControllerHost` is the provider-neutral delivery port. Provider/browser adapters may navigate, submit, observe, and reconcile external effects, but they never own Work or ControllerRound semantics. Before any non-idempotent provider submit, ControllerRound atomically records the provider effect id and dispatch start/attempt. A confirmed result records the receipt on that same round. An ambiguous submit records `provider_dispatch_outcome_unknown` and forbids blind replay.
171
+ 6. A launched Controller claims the exact Work/ControllerRound and reconstructs bounded current Requirement/Plan/Step/Work/Handoff/source/runtime evidence. For relay-bound claims, relay claimability and authoritative ControllerSession ownership are revalidated under the canonical relay→session lock order, then committed through one control-plane SQLite transaction; a direct Work relay acknowledgement commits in that same transaction, while an inherited Requirement-scope relay is fenced but never rewritten for a sibling Work. Chat history and MCP/provider sessions are transport context, not durable semantic truth.
172
+ 7. Before a Controller round ends, the Controller records exactly one disposition: `continue_immediately`, `wait`, `wait_for_user` with an active Handoff, or `goal_complete`. `goal_complete` closes the lower Controller lane only; outer Goal completion still requires Workflow Supervisor `DONE` validation against canonical Requirement evidence.
173
+ 8. Once a Requirement-backed Work has an exact ChatGPT conversation binding, the Workflow Supervisor owns the next **outer assistant-turn submit** for that Goal. Scheduler, stalled-round maintenance, and `continue_immediately` may prepare or preserve the lower ControllerRound, but they must not send another outer ChatGPT message. Autonomous liveness must prepare the canonical lower ControllerRound before Supervisor enrollment; if the Requirement scope still points at a failed/cancelled, ownerless prior Work, canonical ControllerRound terminal reconciliation retires that stale relay before the current Work round is prepared. No Requirement-membership-only authority inheritance is permitted. The next assistant turn may claim the prepared `dispatching` ControllerRound through normal Controller authority.
174
+ 9. Supervisor enrollment is idempotent and Requirement/Goal-scoped, not per-Work. Task identity is repository-namespaced; successor Works in the same Requirement inherit the exact conversation binding. Lower layers derive the Supervisor boundary from canonical Work + conversation facts instead of copying an `owned` status into Scheduler or ControllerRound.
175
+ 10. Workflow Supervisor is co-hosted inside the existing Canonical Forge Runtime process. It owns a separate `supervisor.sqlite` and Unix socket under the exact configured Controller Home and is the only opener/writer of that Supervisor database. This preserves an independent authority namespace without adding a second launchd/systemd service or process lifecycle.
80
176
 
81
- Transient Runtime, connector, or browser-provider unavailability may delay a wake through bounded backoff/re-arm, but must not silently terminalize the Work or permanently freeze a healthy persistent schedule. Repeated-state fencing remains a protection against semantic self-spin; recovery requires new durable evidence or a valid new Controller claim rather than blind retries.
177
+ A provider authentication, consent, capability-grant, or permission blocker is `wait_for_user`, not rejection. Resolving the exact Handoff creates new durable evidence that may re-admit continuation; conversation/session replacement during recovery is normal delivery-state turnover and must preserve the same Requirement/Work/ControllerRound lineage. A known non-ambiguous provider failure is retried within the same ControllerRound authority, occurrence and failure budget; it never creates a successor semantic round merely to retry delivery. Scheduler may mechanically reconstruct a missing Work-scoped ControllerBinding from the retained ControllerSession and existing conversation/predecessor projection, but it may not mint browser authorization or clear an outcome-unknown fence.
82
178
 
83
- Explicit **Scale** is the opt-in coordination form of this existing model, not a separate runtime tier. `rh_work mode=scale` requires a bound approved Plan step, routes through durable bounded Work with an isolated checkout, and lets the semantic controller decompose independent deliverables across multiple Plan steps. Independent Scale Work may proceed concurrently when existing Process/resource claims permit; conflicting claims still serialize or reject through the same Lease authority. Generic `requires_parallelism` alone does not imply Scale, Plan, Work, or isolation. Scale does not introduce an agent swarm, second scheduler, or second project lifecycle.
179
+ Machine-observable continuation health is derived from canonical Requirement/Plan/Step, optional Schedule occurrence, semantic WorkContract, provider-effect/receipt facts, Supervisor task/effect journal, and real repository/process safety evidence. Persistent scheduled Work is ordinary pending intent, not a stuck Work or Runtime blocker. Health reporting distinguishes trigger, provider dispatch start/confirmed/outcome-unknown, outer-turn effect reservation/application, real execution outcome, and genuine waiting state; none may be substituted for another.
180
+
181
+ Transient Runtime, connector, browser-provider, or Supervisor-adapter unavailability may delay progress, but it does not authorize a lower layer to seize outer-turn ownership. Once the exact conversation boundary exists, failure to enroll or reach Supervisor remains quiescent/retriable infrastructure state rather than a fallback permission for Scheduler or maintenance to double-send.
182
+
183
+ **Model owns reasoning and engineering policy. Forge owns capabilities, durable facts, execution mechanics and receipts.** Forge carries no route/mode vocabulary that selects Direct Control, durable Work, handoff, a worker/provider, verification, review, or completion on the model's behalf. Invoking `rh_work` is itself the explicit decision to use durable Work; `work_kind` is the explicit declaration of the technical evidence shape. Parallel delivery across independent Plan steps is expressed through explicit Work/Plan lineage plus existing Process/resource claims, which serialize or reject conflicts through the same Lease authority; no Forge-side task-size, complexity, or parallelism heuristic promotes a task into a lifecycle tier. There is no separate runtime tier, agent swarm, second scheduler, or second project lifecycle.
84
184
 
85
185
  ## State ownership
86
186
 
87
- - Git/worktree owns repository source truth.
187
+ - Git/worktree owns repository source truth. Direct commit scope is the exact staged Git index at the commit boundary; a WorkContract may further constrain that scope through its durable allowed/forbidden path authority. Caller-supplied commit pathspecs are an explicit narrowing input, not a second source of scope truth.
88
188
  - Edit Session owns one deterministic local patch transaction and reviewable diff evidence.
89
189
  - Lightweight process handles own only current-runtime attach state.
90
190
  - Validation results own check evidence for the exact inputs they verified.
91
- - Work owns durable continuity only when continuity is actually required.
191
+ - Requirement, Plan, and optional Work are the only cross-domain model-authored semantic working-context records. Each has one stable identity and monotonic semantic revision with expected-revision CAS; append-only semantic revision records are history evidence, not second mutable authorities. Plan source/Requirement basis revisions are provenance and advisory staleness only, never execution gates. Legacy PlanContract lifecycle/steps remain migration execution data and cannot rewrite `semanticContext` once it exists.
192
+ - Work owns an independently resumable semantic objective only when durable continuity is useful. Its semantic state is `open|completed|cancelled` and is independent from mechanical running/blocked/verification/review/delivery/cleanup/provider/recovery state. Model-selected Work result refs stay separate from mechanical completion/check receipts. Pre-semantic legacy Work may infer its initial semantic state once; new Work materializes semantic state at creation.
193
+ - When creating a Work with explicit Plan/Requirement identity, Forge resolves their existing current semantic heads and records the adopted `planRevision`/`requirementRevision` in Work's own CAS/history; an explicitly chosen existing historical revision is also valid. A selected Plan may supply its already-authored Requirement identity when Work has no stronger explicit/predecessor binding, but Requirement membership never guesses a Plan or successor. Mismatching Plan/Requirement links and nonexistent revisions fail before Work creation or revision. Later upstream head changes are not silently adopted during manual or autonomous continuation: `rh_work get` projects the current head alongside Work's adopted basis and, for detail reads, both semantic snapshots when available. A model/user explicitly changes either basis through `rh_work revise` and Work `expected_revision` CAS, preserving the old basis in immutable Work revision history; terminal Work cannot switch its basis in place. Version drift is advisory context for model judgment, not a verification, execution or acceptance gate.
194
+ - ResumeContext is assembled on demand from current Requirement/Plan/Work semantic views plus fresh source/resource facts, unresolved human requests, active durable handles, and pertinent receipts; it is not persisted as another aggregate. ControllerRound currently remains a lower-layer continuation/effect fence during migration, but its claim/lease mechanics do not own Requirement/Plan/Work semantic identity or revision authority.
195
+ - Scheduler owns trigger/time/event/condition occurrence authority only; it does not own continuation lifecycle or provider-dispatch truth.
196
+ - Workflow Supervisor owns committed assistant-turn and Goal-level `CONTINUE`/validated `DONE`/validated `NEEDS_USER` plus next outer assistant-turn startup. Its durable browser task identity is conversation-stable so one ChatGPT Project conversation survives explicit predecessor/successor Work turnover and Requirement takeover. Work-derived task ids are bootstrap reservation identities only; after exact conversation binding, the registered conversation task is canonical while the active semantic scope remains the exact Requirement/Work reported and validated for the current turn. Discovery observations may be durable, but only `WorkflowSupervisorControlPlane -> WorkflowSupervisorStore` may persist them; server/native-browser transports only normalize and submit typed observations. The dedicated database/socket remain co-hosted by the Canonical Runtime process under Controller Home.
92
197
  - Durable Process owns persisted command/check lifecycle only when the selected lane is durable.
93
- - Runtime release/recovery state owns Forge service availability and immutable release activation; it is separate from ordinary command recovery. The canonical OS service executes an atomic byte-identical mirror of the selected signed Runtime entrypoint from the fixed physical `runtime/service/active-forge-runtime` path, while release resources and identity remain manifest-bound. The stable physical path prevents macOS TCC from treating every immutable release directory as a new responsible-process principal.
198
+ - MCP transport owns only bounded request/session delivery, not semantic execution authority. Modern and legacy POSTs participate in the same active-request admission/health accounting. During Canonical Runtime shutdown or release cutover, the listener stops new admission first and already-admitted requests receive one bounded drain window; any still-unsettled request must be surfaced as explicit `outcome_unknown` / `reconcile` before session/socket teardown. A cutover ambiguity never authorizes blind replay: only an operation whose canonical idempotency authority already proves replay-safe may reconnect and replay. Transport completion/health therefore cannot infer Work, ControllerRound, or provider-effect completion, and a newly healthy Runtime does not retroactively prove an interrupted request completed.
199
+ - Workflow Supervisor retry or provider-resume exhaustion remains a derived projection of the existing task/effect journal, not a new task state. Exhaustion is projected through Direct Activity so operators can see that automatic mutation has stopped; clearing the canonical stall closes that same projection. Outcome-unknown effects remain reconcile-only and late receipt observation stays read-only.
200
+ - Runtime release/recovery state owns Forge service availability and immutable release activation; it is separate from ordinary command recovery. The canonical OS service executes an atomic byte-identical mirror of the selected signed Runtime launcher from the fixed physical `runtime/service/active-forge-runtime` path, while release resources and identity remain manifest-bound. That compiled launcher is deliberately narrow: it validates the manifest-attested Runtime bundle and release-owned Bun interpreter, supervises exactly one interpreter child, forwards lifecycle and diagnostic signals, and mirrors the child terminal outcome; it never loads the long-lived Runtime bundle into its own compiled JSC VM. The stable physical launcher path remains the macOS TCC responsible-process boundary for its Runtime descendants across releases. Heavy TypeScript compiler/LanguageService/AST work is not part of the canonical Runtime residency boundary: semantic navigation and TypeScript/JavaScript declaration indexing execute in the manifest-attested short-lived `forge-typescript-navigation` sidecar, preserve the caller's MCP read policy, and return only bounded plain-data results. The parent Runtime may cache those plain declaration ranges by content identity, but it must not retain TypeScript compiler modules, `LanguageService`, `Program`, `SourceFile`, or other compiler-owned object graphs across requests. The same residency rule applies to allocator-heavy Context Plane retrieval: `rh_context` and compatibility `controller_context` execute Context Pack search, source materialization, and structural/CodeGraph fan-in inside the manifest-attested short-lived `forge-context-pack` sidecar, with the exact serialized MCP read policy and repository/session identity. The canonical Runtime remains the request/closure authority and may combine the returned bounded plain-data projection with semantic/readiness evidence, but it must not execute the Context Pack implementation in-process or preserve its transient JSC allocator lifetime. Compiler-intensive verification gates that measure TypeScript latency or run the TypeScript compiler share the existing repository `heavy-check` serialization fence, so acceptance latency is measured without same-repository compiler/JSC contention; this is scheduling metadata only and does not create a second execution authority.
201
+ - Independent Windows/WSL host rescue is an emergency availability boundary outside both the source checkout and Controller Home. It owns one configuration/lock root and may start or restart only the exact canonical Runtime, loopback-only Secure-Tunnel Connector, its own WSL watchdog unit, and one configured OpenAI Secure Tunnel alias. That connector runs without local MCP auth because OpenAI Secure Tunnel is the external authorization boundary; it must never be reused as a public ingress. The rescue boundary never owns a Runtime release, Controller database, schedule, work execution, secret value, compatibility fallback, or arbitrary shell RPC. Windows is a cold-start client only; the WSL rescue lock serializes every rescue mutation.
94
202
  - Historical Issue/Task/Local Job and compatibility projections must not become second mutable authorities.
95
- - Work lifecycle policy is separated from persistence: `work-state-machine.ts` owns legal phase/dispatch/evidence/completion transitions, while `work-contract-store.ts` owns locked persistence and applies that policy. Work completion projection is centralized in `work-completion-authority.ts`, and Work verification execution/evidence is centralized in `work-verification-service.ts`. Transports may submit requests and encode results but must not reimplement these rules.
96
- - Work delivery/finalization is also an application service: `work-finalization-service.ts` owns the commit/merge/cleanup/receipt transaction and `work-execution-support.ts` owns shared exact identity/cleanup primitives. MCP `execution-tools.ts` and `rh_work` compatibility glue may prepare arguments or reconcile legacy handles, but they must enter that same finalization authority rather than perform Git delivery themselves.
203
+ - Cognitive Plane owns advisory learned memory inside the existing Controller SQLite authority. Normal repository/Work admission establishes the semantic Project/Workspace binding when portable identity is available: an authored `.forge/project-engineering.json` `projectId` is preferred, canonical Git remote supplies a stable source fingerprint and only supplies the Project id when no authored id exists, and ProjectPlacement remains ForgeInstance-local. Repository registration alone never creates semantic Project authority. Existing Project identity/workspace is preserved, while contract/remote aliases or repository-placement conflicts block instead of silently rebinding. Learning scope is authored by the model: Project is the default home for project-specific observations; Workspace is valid only when the model explicitly chooses `workspace` plus portable intent for a genuinely cross-project abstraction. Forge does not auto-promote from repetition, category, score or execution outcome and does not auto-materialize Requirement candidates from learned patterns. Cognitive memory cannot mutate Project contracts, lifecycle, authorization, acceptance or verification authority; any durable product/architecture change still enters the normal Requirement/Plan/Work path explicitly.
204
+ - Work lifecycle is a semantic CAS record: `open`, `completed`, or `cancelled`. `work-contract-store.ts` owns locked persistence and one-time legacy normalization; `work_complete` never admits or blocks Git, verification, review, or delivery. Repository execution and recovery own their own real safety conditions. Transports may submit requests and encode results but must not reimplement these rules.
205
+ - Work delivery/finalization is also an application service: `work-finalization-service.ts` owns the commit/merge/cleanup/receipt transaction and `work-execution-support.ts` owns shared exact identity/cleanup primitives. MCP `execution-tools.ts` and `rh_work` compatibility glue may prepare arguments or reconcile legacy handles, but they must enter that same finalization authority rather than perform Git delivery themselves. Finalizer-owned validation may use one bounded Process attach window to settle freshly launched short checks inside the same delivery transaction; the budget is bounded and shared across that validation call, never becomes polling/re-execution authority, and a still-running check remains an explicit Process dependency. Finalization never derives cleanup authority from `skipped` stage projections: `cleanup=false` is represented by the durable terminal resource disposition, and a later cleanup request may re-arm retained managed resources only from that canonical provenance. Implementation-review authority is bound to the exact Work candidate rather than a moving target-branch ancestor. If the target advances after review, delivery may preserve review authority only when the integrated revision proves identical Work content, identical changed-path identity, unchanged architecture evidence, and exact transferable verification authority; otherwise delivery returns to a fresh exact review without broadening the original Work scope.
97
206
  - Work preparation/adoption is an application service as well: `work-preparation-service.ts` owns managed-workspace selection, WorkContract admission/reuse, exact successor-HEAD adoption and Controller ownership binding. MCP `execution-tools.ts` only decodes `work_prepare` / repository-bind requests and delegates; it must not recreate workspace admission or WorkHandle/WorkContract preparation transitions.
98
207
  - Work command execution and validation live in `work-operation-service.ts`. Both MCP Gateway and Durable Worker call this application service directly; Workers must never dynamic-import MCP transport to obtain Work semantics. The architecture gate also forbids any `runtime/control-plane` source from depending back on `runtime/gateway`.
99
- - Production Browser session persistence is Controller-home SQLite `BrowserSessionAuthority`. Compatibility JSON may be imported or used only when no Controller authority is available; handoff sidecars return interaction results and never write BrowserSession state directly.
208
+ - `rh_work` remains a thin semantic-context and transport compatibility boundary. Controller identity, claim/disposition/release, and provider orchestration are internal recovery mechanics delegated to `work-controller-operations.ts`; ordinary model-facing operations never require their authority fields. Requirement and Plan APIs persist optional semantic context only: Plan approval, acceptance, dependencies, and steps do not select or authorize Work execution. Frozen-client compatibility decoding stays at the outer `work-adapter.ts` boundary and enters the same canonical Requirement/Plan/Work primitives without restoring lifecycle gates.
209
+ - Direct Work ownership is durable across replaceable MCP request/transport and canonical Runtime bindings. A modern sessionless request may mechanically rebind an exact direct Work only when controller id/type, authenticated principal, exact Work identity, and the positively current canonical Runtime all still match, no ControllerRound relay owns the round, and the caller did not present a conflicting opaque capability. This rebind preserves the existing Work-bound capability digest; a Runtime epoch change advances the claim-generation fence. Relay-bound ControllerRounds, cross-principal/controller recovery, stale Runtime instances, and explicitly wrong capabilities remain hard-fenced and require their existing exact authority/recovery contracts.
210
+ - Production Browser session identity is owned only by Controller-home SQLite `ComputerSurfaceTarget` authority. Legacy Browser session JSON is import-only migration input and is never a steady-state fallback when Controller execution context is absent; handoff sidecars return interaction results and never write Browser session state directly.
211
+
212
+ ## Kernel V2 module and migration contract
213
+
214
+ Kernel V2 converges Forge toward a domain-first modular monolith. Directory placement is not cosmetic: it encodes dependency direction and semantic ownership.
215
+
216
+ ```text
217
+ apps / composition roots
218
+ |
219
+ v
220
+ adapters / providers --------> protocols
221
+ | ^
222
+ v |
223
+ packages/kernel/* ----------> public ports/contracts
224
+ packages/plugin-runtime/* --> neutral plugin/provider contracts
225
+ ```
226
+
227
+ - `packages/kernel/<domain>` owns durable domain semantics such as Work, Controller, Scheduler, Resources, Identity, and Execution. Each domain exposes one intentional public API; sibling modules do not deep-import its infrastructure or persistence internals.
228
+ - Kernel Identity defines portable `ScopeRef` separately from node-local `ExecutionPlacement`. Requirement/Plan/Work identity may survive repository registration, checkout, host, or ForgeInstance changes; `repoId`/`checkoutId` are migration-era placement fields and must not define semantic Work identity. New Work records persist both forms, while legacy Work records are deterministically projected without deriving semantic scope from a local repository id. Repository mutation binds a concrete checkout through WorkHandle/resource fences at execution time; when a Thin semantic Work has no legacy checkout placement, Forge uses the actual repository target for that mutation and does not write the mechanical checkout back into semantic Work state.
229
+ - `ExecutionPlacement.forgeInstanceId` is the canonical node target for Work execution. Repository admission and managed-worktree materialization preserve it alongside repository/checkout placement. ChatGPT continuation may select Browser vs WSL bridge only after the target Forge instance matches the currently installed Forge identity; a mismatch is a typed placement blocker and never falls back to the dispatcher host. Cross-instance selection belongs to the ChatGPT Connector boundary, not a second scheduler or provider-session identity.
230
+ - ChatGPT MCP connector discovery names are instance-derived (`forge-<stable-instance-token>`) by default. The old shared `forge` name is migration-only; endpoint/tunnel/session rotation must not change the semantic `forgeInstanceId`, while rerunning setup migrates legacy shared connector names without changing the instance identity.
231
+ - Syncable semantic records use bounded revision/provenance metadata with optimistic-concurrency preconditions. The current Controller SQLite revision/audit mechanism is the local persistence implementation; SQLite files, leases, sessions, and runtime ownership are not portable semantic state.
232
+ - `packages/protocols` owns wire/provider-neutral contracts that must be usable without importing Runtime, MCP, CLI, UI, or concrete provider implementations.
233
+ - `packages/plugin-runtime` owns provider-neutral plugin dispatch, resource, receipt, and provider-selection semantics. It may depend on neutral protocols/ports, never on concrete adapters or Runtime implementation modules.
234
+ - `adapters/*` implement outward-facing mechanisms and may depend inward on Kernel/plugin/protocol contracts. Concrete provider identity, filesystem discovery, OAuth/tunnel details, Browser/ChatGPT host mechanics, and SQLite implementations belong here when they are mechanism rather than domain authority.
235
+ - `apps/*` and Runtime composition roots wire concrete implementations. Composition may know both sides of a port; business semantics must not leak upward into the composition root.
236
+ - Legacy `src/cli/*` and `src/runtime/*` code is migrated by owner, not mechanically by path. A legacy file that still owns current semantics must be moved/split into its target module; a retained legacy path may only be a thin compatibility facade delegating to the new owner.
237
+
238
+ ### Single-authority rule
239
+
240
+ For each durable fact or lifecycle transition there is exactly one mutable authority. A projection, cache, transport session, compatibility record, provider live handle, UI model, or diagnostic snapshot may derive from that authority but must not independently decide or persist competing state. When two implementations appear to own the same semantic transition, Kernel V2 resolves the duplication by choosing one owner and deleting/merging the other rather than synchronizing two authorities.
241
+
242
+ ### Migration-debt lifecycle
243
+
244
+ Compatibility exists to move consumers to the new owner, not to preserve old architecture indefinitely. Every retained compatibility shim, legacy import allowlist, translation layer, or migration-only assertion must identify: the replacement owner, the bounded legacy consumers, and a machine-observable removal condition. New production consumers of a deprecated owner are forbidden. Once the final consumer is gone or the removal condition is met, the compatibility code and its gate/allowlist entry are removed in the same coherent slice.
245
+
246
+ A fallback must never become a second semantic authority. Capability negotiation may select an explicitly supported provider/version, and safety boundaries may refuse unsafe or ambiguous execution, but missing architecture capability is repaired at the owning general layer rather than hidden behind silent fallback, duplicate persistence, or an alternate lifecycle path.
247
+
248
+ ### Architecture enforcement hierarchy
249
+
250
+ Architecture checks should prove the invariant at the highest semantic level available:
251
+
252
+ 1. compiler/type contracts and package/public-API visibility;
253
+ 2. AST/import/dependency-graph direction and cycle checks;
254
+ 3. focused semantic contract tests for behavior that static structure cannot express;
255
+ 4. path existence/removal checks for finite migrations;
256
+ 5. raw source-text/regex assertions only as temporary migration fences when no stronger representation exists.
257
+
258
+ Source-line-count limits are review heuristics, not architecture truth, and must not be permanent merge gates. Text assertions that merely require a spelling or forbid a provider name should be replaced by typed contracts or structural dependency checks as the migrated owner stabilizes. Architecture debt checks are shrinking ledgers: a retired dependency causes its allowlist/assertion to be deleted, never preserved for historical symmetry.
259
+
260
+ ### Kernel V2 delivery cadence
261
+
262
+ Within one migration slice, gather facts in batches, decide ownership once, implement a coherent patch, then review the whole slice for authority/dependency drift before running focused checks. Repeated full-suite validation after each small move is discouraged because it slows structural work without increasing semantic confidence. Milestone/candidate boundaries receive broader cross-module review, multi-review where useful, and whole-candidate validation. Runtime baseline activation is deliberately later than source integration: a locally passing partial slice does not become the active baseline until the integrated candidate satisfies the Kernel V2 architecture contract.
263
+
264
+ Validation scheduling is derived from each check's concrete resource effects, not from a blanket assumption that every analysis gate writes the workspace or shared build cache. Proven source-read-only/no-emit checks declare reads (plus only the Git/temp/host resources they actually use) so resource-compatible gates may share one validation wave; missing or unknown effect metadata remains conservative. This projection never weakens the underlying lease conflict rules or creates a second scheduling authority.
100
265
 
101
266
  ## Runtime and MCP boundary
102
267
 
103
268
  - Canonical Runtime is activated as one immutable whole release with a previous release retained for rollback.
269
+ - A compiled `standalone-binary` release has a closed manifest-owned execution surface: the long-lived Runtime bundle, its exact release-owned Bun interpreter, Process Runner, Check Runner, Scheduler Worker, and periodic cleanup are immutable artifacts with identities and release canaries. The signed compiled `forge-runtime` entrypoint is a supervision/identity boundary, not the long-lived JS VM. Runtime execution never resolves Bun from Homebrew, `~/.bun`, PATH, an ambient checkout, or Bun virtual `import.meta.url`; scheduler/cleanup source entrypoints remain development/source-backed mechanisms only.
270
+ - Canonical Scheduler idle execution is event/deadline driven, not a generic control-plane poll loop. Execution-job/lease/policy mutations and terminal Check Process persistence advance the existing `wake-signal.json` notification revision and wake immediately; lifecycle truth remains in the existing Job, Process, and Work stores, and sibling scheduler health-state writes are not wake events. With no active execution, the loop does not run a full control-plane tick merely to satisfy the five-second reconciliation cadence; it waits for an authoritative mutation notification or the 30-second schedule-admission deadline, while coarse wake polling exists only as lost-filesystem-event protection. Five-second reconciliation still runs whenever active/event-driven ticks occur. Heartbeat persistence remains health/readiness evidence and must not become scheduler work-admission authority.
104
271
  - Runtime availability/recovery keeps Forge itself healthy; it does not imply exactly-once crash recovery for every local shell command.
105
272
  - The default Controller MCP schema is the stable **19-tool** surface.
106
273
  - `core` and `advanced` expose that same stable surface.
107
274
  - `toolset=full` is an explicit compatibility profile and may contain historical definitions; current default schema construction must not depend on those legacy definitions.
108
275
  - Current schemas/handlers should live with their owning module. Legacy compatibility may delegate but must not independently own current business rules. Shared transport contracts and tool definitions belong in neutral contract/definition modules so the dependency direction remains transport -> application/domain authority rather than transport implementations importing one another.
109
- - Work-attributed verification is an application service, not an MCP/Local Bridge implementation detail: all Work verification resolves the Work checkout/check registry, runs through Process Runtime, validates terminal receipt identity, and records Work evidence through the same `work-verification-service.ts`.
276
+ - MCP tool schemas may remain frozen for the lifetime of an already-open host conversation even when Runtime reconnects onto a newer release. A versioned frozen-session wire decoder may therefore translate only explicitly bounded historical carriers into the current semantic/controller API; it owns no lifecycle or persistence, may not restore retired verify/review/finalize/ControllerRound operations, and must preserve current CAS/authority checks. The pre-Thin `semantic.v1` and current-conversation enrollment carriers are such a migration decoder. Retire that decoder only after the minimum supported MCP client contract no longer advertises those carriers and release reconnect canaries prove no supported frozen-session consumer remains.
277
+ - Work-attributed verification is an application service, not an MCP/Local Bridge implementation detail: all Work verification resolves the Work checkout/check registry, first reuses an exact-current authoritative pass/fail receipt or reconciles an already-terminal Work-bound Process with the same verification fingerprint, and only then runs a new Process when no current authority exists. Terminal receipt identity and Work evidence remain centralized in `work-verification-service.ts`; repeated verify calls for an unchanged candidate do not re-execute the check.
278
+ - First-party external providers have one desired-contract reconciliation boundary: Controller plugin registry/manifest sync reconstructs the current Forge-owned permissions/capabilities/actions from source while preserving installed provider identity, transport target, lifecycle identity, provider/protocol version and enabled state. The canonical external-registration store remains the only fingerprint/revision persistence authority; manifest reads/execution never create a second registration authority or silently mutate durable state.
279
+ - Product bootstrap has one instance-level desired/observed lifecycle authority behind the Bootstrap Control API. CLI setup, Local Bridge readiness, packaged Runtime install/upgrade/repair projection, and doctor observation consume that same authority rather than persisting parallel setup state. Browser/tunnel/provider implementations remain adapters beneath this API.
280
+ - WSL ChatGPT browser bootstrap may create only a dedicated Forge-controlled Chromium profile when the runtime explicitly supports unpacked-extension startup. Ordinary user Chrome profiles are observational/existing-capability surfaces only; unsupported automatic extension loading must fail closed with a resumable user action.
281
+ - Workspace and Project are portable semantic identities, not aliases for Repository or checkout placement. Cross-node sync may transfer only bounded revisioned semantic projections for Workspace/Project/Requirement/Plan/Work; destination nodes persist imported facts as semantic replicas and never acquire source-node SQLite state, leases, controller/browser sessions, check receipts, raw logs, secrets, or execution placement. Import uses optimistic revision checks and fails atomically on local semantic-authority conflict.
282
+ - The structured Context Plane is advisory runtime state, not Kernel authority. Typed preference/policy/procedure/capability-intent/credential-reference records are scoped, provenance-bearing and budgeted; resolver output may influence deterministic provider preference only where the current request did not specify one. AGENTS.md remains the stable repository constitution, dynamic context is rendered on demand, raw credential material is forbidden, and loss/corruption of Context records must degrade to default routing without mutating Requirement/Plan/Work/approval authority.
283
+ - Host/platform discovery is an adapter concern, never product identity. User/profile roots, executable locations, browser products, drive mounts, service-manager availability, and Recovery deployment locations are discovered or explicitly bound; static known paths are bounded fallbacks only and may not encode a developer username, one WSL mount root, or one browser installation as semantic authority.
284
+ - Runtime and Connector persistence consume a typed platform `ServiceManagerHost`. `launchd`, `systemd-user`, and portable-session mechanics live behind that host boundary; Runtime composition does not import OS service implementations to decide product semantics.
285
+ - A materialized package Runtime is Controller-Home/release scoped and does not require a fake repository root. Repository overlay remains optional and is required only for development/repository-scoped surfaces that actually need repository semantics. Controller-scoped Browser/plugin execution likewise uses controller scope directly rather than manufacturing a repository record.
286
+ - The documented Node package runtime is a first-class product path. Normal package/bootstrap/Browser execution may not depend on unguarded Bun-only runtime APIs; executable prerequisites resolve through typed discovery with explicit missing/unsupported recovery. Plugin catalog trust is policy data: first-party allowlists are packaged/configurable policy and non-first-party providers require explicit Controller-Home trust rather than source edits.
110
287
 
111
288
  ### Controller facade and handoff boundary
112
289
 
@@ -118,10 +295,32 @@ Explicit **Scale** is the opt-in coordination form of this existing model, not a
118
295
 
119
296
  Host hook files are integration surfaces, not lifecycle or architecture authorities. Forge-managed entries are identified so install/uninstall can change only Forge-owned entries while preserving sibling user hooks; legacy adapter entries are migration input rather than a second current identity. The hot host path converges on the minimal `forge-hook` entrypoint and current hook runtime, and CLI absence fails safely instead of turning a host hook into a repository failure. Setup/readiness flows may inspect and report host gaps but must not silently treat user-owned host configuration as current architecture state.
120
297
 
298
+ ## Engineering Workloop boundary
299
+
300
+ Engineering evidence is optional model/project context layered over semantic Requirement/Plan/Work records; it is not a lifecycle or admission plane. Forge owns durable facts, execution capabilities, resource fencing, source identity, verification facts, receipts, and recovery mechanics. The model owns requirement interpretation, product/architecture decisions, root-cause judgment, verification/review strategy, semantic acceptance, and whether another action is required.
301
+
302
+ `EngineeringWorkProfile` is Kernel-owned generic method/risk policy and must not contain project-domain facts. `.forge/project-engineering.json` is the default source-controlled `ProjectEngineeringContract`: it may name project authority files, UX/performance/non-regression constraints, named checks and journeys, platform/tooling requirements, Skill references, explicit Skill-to-kind bindings, and project exceptions. The Controller MCP policy treats this exact source-controlled contract path as writable while keeping sibling `.forge/**` controller/config/secret paths denied. Controller state stores only a source-bound receipt containing the repository-relative path, project/contract identity, contract version, exact source revision, SHA-256 content digest and repository provenance time; it never persists a mutable copy that could become a second project authority. Skills own reusable professional methods such as iOS/Swift engineering, debugging and review technique. Semantic tools such as SourceKit-LSP, other language servers, compilers and CodeGraph provide factual source/build/navigation evidence but never own product intent. AGENTS/CLAUDE guidance remains thin repository/directory routing and local-guidance evidence; its wording is not proof that a Skill or semantic tool actually participated.
303
+
304
+ Context Closure is a derived `rh_context` evidence layer, not another context database or lifecycle. It binds the exact source revision to current source/test paths, dirty/Work context, applicable repository guidance, ProjectEngineeringContract provenance, detected language/platform, project-declared Skill references/bindings, semantic-provider evidence and bounded recent related changes. Explicit Skill bindings own kind coverage when present; legacy `skillRefs` retain name-based compatibility matching. Skill/tool absence is explicit degraded evidence. Cross-file ownership/protocol/architecture claims require matching semantic navigation evidence or an explicit compiler/build fallback; a registered provider alone is not proof.
305
+
306
+ `engineering-work-profile-v1` maps Work risk into `low | normal | high | critical` solely to organize optional evidence and project guidance. Product DoD, Context Closure, design decisions, critique, semantic-tool output, validation, review, and journey evidence never admit or deny a repository mutation, delivery, or semantic Work completion. The model and project policy decide when they are useful. Capability admission remains limited to security/access, destructive authorization, secrets, dirty ownership, resource fencing, source CAS, concurrency, Git consistency, and external-effect idempotency.
307
+
308
+ Every created Work may persist an `EngineeringContextReceipt` containing profile version, source identity, structured receipt ids, conditional semantic-tool/journey flags and bounded missing-evidence lists. The Controller-facing `rh_work start` surface may expose this context but does not accept caller-supplied receipt ids as safety authority. Provenance validation protects the integrity of recorded evidence; it does not turn absence, staleness, or a project-methodology disagreement into a Forge mutation gate. Stage7B/C may automate context, skill, tool, Product DoD, design, or critique evidence production only as optional assistance.
309
+
121
310
  ## Provider boundary
122
311
 
123
312
  Typed provider/plugin actions should use Forge capability/resource semantics directly instead of hiding host/browser/device operations inside arbitrary repository shell commands. Built-in providers may remain inside Forge when they are tightly coupled to Controller policy and lifecycle; independent products/providers retain independent release boundaries and integrate through the Plugin Protocol.
124
313
 
314
+ ### Computer and macOS provider boundary
315
+
316
+ `Computer` is the user-facing interaction product boundary. Browser and Desktop remain distinct semantic subdomains inside that product: Browser owns DOM/tab/navigation/session/transaction semantics, while Desktop owns generic application observation, input, capture, and native-platform interaction. Browser may consume provider-native support through `computer.browser_automation.v1`, but neither the internal `browser` adapter identity nor concrete provider identity such as `desktop_operator` is a second user product or routing/session authority. Internal adapters remain exactly addressable only for trusted composition and migration.
317
+
318
+ On macOS, Forge Desktop Operator is the independently released native Computer provider. Its Git repository, app bundle identity, user LaunchAgent, socket endpoint, live native handles, and TCC permissions remain provider-owned and release-independent. Its trusted registration is explicitly provider-only: normal plugin discovery exposes `computer`, while diagnostics and lifecycle composition may still address `desktop_operator` exactly. Forge owns trusted catalog selection, registration, capability/action policy, authorization, provider selection, and the `forge computer setup|status|doctor|update|uninstall` product facade. The stable Desktop Operator bundle/LaunchAgent identity must not be renamed merely to match product wording because TCC identity and provider lifecycle are intentionally independent from Forge Runtime releases. Durable application interaction-target authority is Forge-owned in Controller SQLite. Public Computer actions use a stable `target_id`; provider session/handle identities are live bindings only. Rebind, target use, and retirement serialize on the same target-scoped authority lease, and a provider restart may rebuild a binding only after the stable application identity is re-verified. Rebinding occurs before semantic dispatch; once a non-idempotent provider mutation is dispatched, an unknown transport outcome is never automatically replayed. A host application or browser discovery result is not a Computer capability proof: a capability is supported only when the current platform has a compatible provider, and it is ready only when that provider is registered, enabled, declares the capability, and has recorded healthy evidence. On an unsupported platform, status and setup fail before probing a foreign provider; Runtime must not create a legacy provider binding or retry a foreign transport.
319
+
320
+ `computer.console.unlock.v1` is a protected Computer capability, not a widening of `computer.input.v1`. Forge owns its provider-neutral contract, provider selection/negotiation, and explicit single-use authorization boundary; Desktop Operator owns macOS lock-state observation, exact `loginwindow` binding, bounded physical input, attempt limiting, and authoritative locked-to-unlocked postcondition verification. Raw macOS credentials never enter ChatGPT, MCP arguments, or Forge Runtime. The frozen 19-tool ChatGPT deployment ABI does not grow dedicated console-unlock tools: refreshed clients invoke typed `computer/console_unlock_prepare` and `computer/console_unlock` actions through the existing stable `plugin_action_execute` dispatcher. Those actions use the explicitly restricted `direct_non_persistent` lane: manifest/schema validation and per-invocation authorization still apply, but Work attribution is forbidden and the invocation bypasses plugin request indexes, receipts, Process/ExecutionJob state, evidence, and replay. While the console is unlocked, prepare asks Desktop Operator to collect the credential in a provider-local secure field and returns only a short-lived opaque single-use handle; unlock later consumes that handle while the console is locked. The old atomic `computer_console_unlock_prepare` / `computer_console_unlock` handlers remain registered only on the explicit full compatibility surface and enter the same canonical protected execution functions without becoming part of the stable connector schema. Results are allowlisted projections and cannot echo credential material. Ordinary `desktop_key`, `desktop_type_text`, batch, pointer, screenshot, application activation, shell, and compatibility paths cannot target the lock screen through this capability.
321
+
322
+ Trusted `ExternalPluginRegistration` is the endpoint/lifecycle authority for an installed Computer provider. A release-independent Desktop Operator install receipt may refresh only installed release metadata when it proves the same already-trusted socket, verified LaunchAgent, exact trusted executable binding, bundle identity, and provider manifest; the receipt's own program-name hint is only self-consistency evidence, never lifecycle authority. The receipt is evidence, never a second endpoint/lifecycle authority, and contradictory matching evidence fails explicitly. Its local JSONL transport uses a platform-local endpoint (a Unix-domain socket on Unix or a Windows named pipe on Windows), not a browser-discovery proxy or a second readiness authority. A Computer provider must resolve only from a trusted `ExternalPluginRegistration`; Runtime no longer binds an unregistered Desktop Operator socket as a compatibility provider. Provider protocol negotiation prefers provider-neutral `computer_execute`; legacy `macos_browser_automation` is compatibility-only and cannot become Browser authority. Forge uninstall must complete the provider-owned native uninstall lifecycle before forgetting a registered provider, so package/registration cleanup cannot orphan a running native service.
323
+
125
324
  ### iOS physical-device boundary
126
325
 
127
326
  - `ios-device` is the single physical-device resource domain. Backend/engine details may vary, but they must not create independent mutation authority or concurrent ownership for the same phone.
@@ -176,3 +375,9 @@ Research notes, tasks, reviews, archived architecture pages, plans and Git histo
176
375
  - CodeGraph may be structurally stale between index refreshes; current raw source and changed-file overlays remain authoritative.
177
376
 
178
377
  These items belong on the roadmap, not in parallel current-architecture documents.
378
+
379
+ ChatGPT Supervisor browser submission requires a positive read-back of the exact ProseMirror composer payload after Browser `fill` and before Send/Enter. A transport-level successful `fill`/keyboard receipt alone is not completion; a missing/mismatched composer observation fails closed without submitting the existing effect. Payload retention alone is insufficient: the provider must select the installed, connected **forge** app (not the distinct Plugin Creator development package) from ChatGPT's @-mention UI and confirm the non-editable ProseMirror `app-mention-name="forge"` and exact `app://asdk_app_6ac09022b26081918f20ff868c773824` path before Send/Enter. The payload plus a trailing standalone `@` paragraph must be inserted in a single ProseMirror transaction before typing `forge`; adding ` @forge` after the fact loses the separator and fails to open autocomplete. The legacy `@forge` text prefix is removed from the provider payload; only the exact structured app chip activates Forge. A literal `@forge`, unavailable picker, missing app or similar-named Forge Recovery app is never accepted as binding; fail without sending or replaying the Supervisor effect. Outcome-unknown Send reconciliation likewise retains the exact bound chip as part of its precondition. Both before preparing a prompt and after plugin selection, the Browser delivery owner read-attests the live native-tab URL and session identity against the target conversation/project, so a stale saved session cannot silently direct a Supervisor effect to another conversation. Selection logic is implemented in the existing Browser delivery owner; availability in the target account/conversation and a real live completion receipt remain independent acceptance requirements.
380
+
381
+ Workflow Supervisor's Computer delivery now has one two-phase boundary: `ComputerChatgptConversationTarget.prepare` may prepare the local composer, select reasoning and bind the exact Forge App chip, but must **never** click Send. Only a verified `ready` allows Supervisor's existing effect authority to append `effect_dispatch_started`; `dispatch` then rechecks the prepared editor and performs the one permitted Send. Failed preparation records `effect_preflight_rejected` in the **same Supervisor effect event log**, with zero provider generations consumed. The ledger permits at most one preparation attempt for the same effect and active Runtime release, and at most three distinct failed release identities in total. An unchanged broken Runtime cannot retry indefinitely after a process restart; a later verified Runtime revision can get a bounded opportunity without minting another effect. Uncertain post-Send outcomes remain in the established read-only reconciliation path and may never be re-sent merely because local preparation later succeeds. Browser transport preparation failures and provider send attempts are not interchangeable budget units.
382
+
383
+ Supervisor fresh-conversation bootstrap uses one provider-owned Chrome tab per distinct Supervisor task. A ChatGPT Project URL is a scope only and **never** proves a tab belongs to a given bootstrap identity: the Chrome Extension may reuse only the task-keyed ephemeral tab mapping or the exact provider/tab/window binding already persisted by Controller's Computer target authority. On a service-worker restart the Controller binding is passed as an attachment hint and verified against the project before reuse. An absent or mismatched pinned tab fails closed without creating a second possibly duplicate conversation. New unbound bootstrap identities create dedicated background tabs; iOS and Android tasks sharing one Project must never claim each other's surface binding index. The enrollment prompt is a complete structured Supervisor effect with exact goal, immutable effect marker and end marker; Computer must read back the complete text and bound Forge app chip before the first Send.
@@ -40,3 +40,16 @@ Earlier V4–V8 Controller, Local Bridge, Supervisor, Issue/Task/Job and recover
40
40
  - Made provider-wide native tab inventory optional for compatibility with the stable Desktop Operator broker: absence of inventory may reduce cross-tab reuse, but must never permit guessing or adopting an unrelated user tab.
41
41
  - Kept foreground/physical input explicit. Browser background actions never silently activate a tab; Desktop Operator foreground/physical actions remain a separate verified capability boundary.
42
42
  - Added current-source live acceptance coverage for Chrome/Vivaldi native lifecycle, background foreground-preservation, URL drift/rebind, replacement postconditions, internal resources, cleanup, and attributable latency reporting. Environment-owned browser permission gaps remain typed external blockers rather than reasons to weaken the runtime contract.
43
+
44
+ ## 2026-08-31 — Independent Windows/WSL host rescue
45
+
46
+ - Added an emergency host-rescue boundary outside the Forge checkout and Controller Home so a broken Runtime, Connector, or existing Recovery deployment can still be reached from Windows through WSL.
47
+ - Restricted the host-facing surface to a fixed set of status/start/restart/verification actions, with one WSL-side lock for every mutation; no arbitrary shell RPC, source mutation, release selection, or Controller-database ownership was added.
48
+ - Kept the Windows scheduled task as a cold-start trigger and the WSL rescue service as the sole long-lived reconciliation owner. Tunnel credentials remain in tunnel-client's separately permissioned store rather than rescue configuration.
49
+
50
+ ## 2026-09-02 — Kernel V2 governance moves from textual fences to structural authority
51
+
52
+ - Defined Kernel V2 as a domain/authority migration toward a modular monolith with explicit Kernel, protocol, plugin-runtime, adapter, and composition-root dependency direction.
53
+ - Made compatibility a shrinking migration debt with a replacement owner, bounded consumers, and an objective removal condition rather than a permanent parallel layer.
54
+ - Established an architecture-enforcement hierarchy that prefers compiler/type/package and AST/dependency-graph proofs over raw string/regex assertions or source-line-count gates.
55
+ - Changed the migration cadence to batch facts, implement coherent slices, review architecture centrally, run focused checks at slice boundaries, and reserve broad multi-review/validation plus Runtime baseline activation for integrated candidate boundaries.
@@ -18,7 +18,8 @@ an ORM or a premature table per product concept:
18
18
  - `control_plane_records` has a namespace, scope, record key, schema version,
19
19
  monotonic revision, JSON payload, and timestamps;
20
20
  - its primary key gives one atomic identity per durable fact;
21
- - `control_plane_audit` records each authoritative write or legacy import;
21
+ - `control_plane_audit` records each authoritative row mutation or legacy import; aggregate compatibility writers must not advance revision or audit history for unchanged sibling rows;
22
+ - hot-path candidate reads may prefilter authoritative JSON rows in SQLite to avoid materializing known-irrelevant records, but the domain layer must still validate every returned candidate and the filter never becomes lifecycle authority;
22
23
  - SQLite WAL, foreign-key enforcement, a busy timeout, and `BEGIN IMMEDIATE`
23
24
  make cross-process writes serializable; and
24
25
  - `control_plane_schema` records schema migrations independently from payload