@moretea-labs/forge 1.5.1 → 1.6.0

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 (124) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/DESIGN.md +7 -2
  3. package/README.md +4 -4
  4. package/README.zh-CN.md +2 -2
  5. package/THIRD_PARTY_NOTICES.md +1 -1
  6. package/assets/hooks/pre-edit-guard.sh +8 -39
  7. package/assets/hooks/prompt-guard.sh +2 -2
  8. package/assets/plugin-registry.v1.json +54 -3
  9. package/assets/reference-configs/hook-operations.md +1 -1
  10. package/assets/reference-configs/sprint-contracts.md +2 -2
  11. package/assets/skill-version.json +2 -2
  12. package/assets/templates/helpers/ensure-task-workflow.sh +2 -2
  13. package/assets/templates/helpers/sprint-backlog.sh +6 -6
  14. package/docs/architecture/current/automation-and-schedule-engine.md +9 -3
  15. package/docs/architecture/current/codegraph-context-provider.md +15 -3
  16. package/docs/architecture/current/dispatch-and-agent-strategy.md +32 -13
  17. package/docs/architecture/current/entity-model.md +20 -0
  18. package/docs/architecture/current/external-plugin-governance.md +3 -3
  19. package/docs/architecture/current/system-overview.md +26 -1
  20. package/docs/architecture/current/thin-harness-v1.md +10 -0
  21. package/docs/operations/chatgpt-personal-assistant-runtime.md +12 -2
  22. package/docs/operations/controller-browser-plugin.md +12 -16
  23. package/docs/operations/features.md +1 -1
  24. package/docs/operations/homebrew.md +2 -2
  25. package/docs/tutorials/01-install-and-start.md +1 -1
  26. package/docs/tutorials/01-install-and-start.zh-CN.md +1 -1
  27. package/docs/wiki/Installation.md +1 -1
  28. package/docs/wiki/Quick-Start.md +1 -1
  29. package/package.json +1 -1
  30. package/scripts/check-public-docs.sh +14 -1
  31. package/scripts/migrate-chatgpt-automation-schedules.ts +64 -0
  32. package/scripts/sprint-backlog.sh +1 -1
  33. package/src/cli/commands/chatgpt.ts +31 -2
  34. package/src/cli/commands/plugin.ts +36 -9
  35. package/src/cli/controller/context-pack.ts +158 -6
  36. package/src/cli/hook/prompt-guard-decision.ts +17 -18
  37. package/src/cli/hook/prompt-intents.ts +1 -1
  38. package/src/cli/local-bridge/console-automations.ts +205 -23
  39. package/src/cli/local-bridge/console-view-models.ts +2 -0
  40. package/src/cli/local-bridge/facade-api.ts +2 -0
  41. package/src/cli/local-bridge/frontend/src/App.tsx +1 -1
  42. package/src/cli/local-bridge/frontend/src/features/automations/AutomationsView.tsx +143 -3
  43. package/src/cli/local-bridge/frontend/src/features/capabilities/CapabilitiesView.tsx +1 -1
  44. package/src/cli/local-bridge/frontend/src/features/overview/OverviewView.tsx +181 -3
  45. package/src/cli/local-bridge/frontend/src/features/repositories/RepositoriesView.tsx +1 -1
  46. package/src/cli/local-bridge/frontend/src/features/work/WorkView.tsx +4 -3
  47. package/src/cli/local-bridge/frontend/src/lib/api.ts +18 -6
  48. package/src/cli/local-bridge/frontend/src/shell/CommandBar.tsx +1 -1
  49. package/src/cli/local-bridge/frontend/src/shell/Sidebar.tsx +2 -1
  50. package/src/cli/local-bridge/frontend/src/styles.css +27 -11
  51. package/src/cli/local-bridge/frontend/src/types.ts +6 -2
  52. package/src/cli/local-bridge/server.ts +29 -19
  53. package/src/cli/local-bridge/ui-dist/app.css +1 -1
  54. package/src/cli/local-bridge/ui-dist/app.js +5003 -4815
  55. package/src/cli/mcp/paths.ts +8 -2
  56. package/src/cli/mcp/repository-tools.ts +124 -9
  57. package/src/cli/mcp/server.ts +164 -19
  58. package/src/cli/mcp/transports/http.ts +25 -2
  59. package/src/cli/mcp/transports/session-registry.ts +24 -0
  60. package/src/cli/repositories/command-classifier.ts +113 -0
  61. package/src/cli/repositories/safe-patch.ts +6 -4
  62. package/src/cli/repositories/structured-git.ts +49 -7
  63. package/src/cli/repository/inspector.ts +16 -3
  64. package/src/runtime/assistant/intent.ts +3 -3
  65. package/src/runtime/control-plane/execution/direct-edit-work-completion.ts +157 -2
  66. package/src/runtime/control-plane/execution/execution-identity.ts +65 -14
  67. package/src/runtime/control-plane/execution/validation.ts +15 -2
  68. package/src/runtime/control-plane/execution/work-terminal-cleanup.ts +32 -0
  69. package/src/runtime/control-plane/execution/work-validation-reconciler.ts +6 -7
  70. package/src/runtime/control-plane/execution/work-verification-snapshot.ts +2 -1
  71. package/src/runtime/control-plane/facade/capability-registry.ts +1 -1
  72. package/src/runtime/control-plane/facade/controller-session-store.ts +12 -13
  73. package/src/runtime/control-plane/facade/goal-workloop-access.ts +7 -2
  74. package/src/runtime/control-plane/facade/goal-workloop.ts +231 -8
  75. package/src/runtime/control-plane/facade/plan-contract-store.ts +32 -12
  76. package/src/runtime/control-plane/facade/requirement-board.ts +24 -8
  77. package/src/runtime/control-plane/facade/types.ts +33 -6
  78. package/src/runtime/control-plane/facade/work-contract-store.ts +31 -2
  79. package/src/runtime/control-plane/launcher/chatgpt-work-continuation.ts +375 -23
  80. package/src/runtime/control-plane/persistence/requirement-store.ts +15 -11
  81. package/src/runtime/diagnostics/mcp-timing.ts +6 -0
  82. package/src/runtime/execution/process-runtime/check-facade.ts +1 -10
  83. package/src/runtime/execution/process-runtime/check-result.ts +10 -2
  84. package/src/runtime/execution/process-runtime/command-facade.ts +1 -0
  85. package/src/runtime/execution/process-runtime/gc.ts +64 -10
  86. package/src/runtime/execution/process-runtime/persisted-check.ts +10 -2
  87. package/src/runtime/execution/process-runtime/resource-claims.ts +87 -2
  88. package/src/runtime/execution/process-runtime/runtime.ts +16 -1
  89. package/src/runtime/execution/process-runtime/store.ts +6 -0
  90. package/src/runtime/gateway/mcp/execution-tools.ts +27 -12
  91. package/src/runtime/gateway/mcp/router.ts +1 -1
  92. package/src/runtime/gateway/mcp/runtime-tools.ts +482 -178
  93. package/src/runtime/model-clients/deepseek-adapter.ts +0 -32
  94. package/src/runtime/plugins/browser-adapter.ts +19 -72
  95. package/src/runtime/plugins/browser-handoff-host.ts +6 -31
  96. package/src/runtime/plugins/browser-handoff.ts +0 -3
  97. package/src/runtime/plugins/browser-macos-bridge.ts +8 -0
  98. package/src/runtime/plugins/desktop-operator-registration.ts +8 -11
  99. package/src/runtime/plugins/external-registration.ts +84 -5
  100. package/src/runtime/plugins/first-party-registry.ts +2 -2
  101. package/src/runtime/plugins/gmail-adapter.ts +28 -2
  102. package/src/runtime/plugins/local-system-adapter.ts +2 -2
  103. package/src/runtime/plugins/plugin-management-adapter.ts +140 -0
  104. package/src/runtime/plugins/store.ts +107 -5
  105. package/src/runtime/plugins/types.ts +4 -0
  106. package/src/runtime/recovery/actions.ts +0 -10
  107. package/src/runtime/recovery/classifier.ts +0 -9
  108. package/src/runtime/recovery/maintenance-executor.ts +43 -11
  109. package/src/runtime/recovery/probe.ts +0 -1
  110. package/src/runtime/recovery/types.ts +0 -1
  111. package/src/runtime/root/release-materialize.ts +143 -19
  112. package/src/runtime/root/service.ts +6 -4
  113. package/src/runtime/safe-tooling/index.ts +0 -1
  114. package/src/runtime/safe-tooling/types.ts +0 -30
  115. package/src/runtime/standalone-recovery/core.ts +2 -2
  116. package/src/runtime/workflow/schedules/browser-probe.ts +180 -0
  117. package/src/runtime/workflow/schedules/chatgpt-automation-migration.ts +40 -0
  118. package/src/runtime/workflow/schedules/engine.ts +357 -64
  119. package/src/runtime/workflow/schedules/types.ts +5 -0
  120. package/src/runtime/workflow/schedules/work-continuation.ts +100 -27
  121. package/bin/forge-desktop-helper.mjs +0 -204
  122. package/docs/operations/controller-desktop-plugin.md +0 -112
  123. package/src/runtime/plugins/desktop-adapter.ts +0 -374
  124. package/src/runtime/safe-tooling/browser-safe.ts +0 -133
package/CHANGELOG.md CHANGED
@@ -4,6 +4,26 @@ All notable public Forge changes are recorded here. Release entries are tied to
4
4
 
5
5
  ## Unreleased
6
6
 
7
+ ## 1.6.0 - 2026-08-16
8
+
9
+ ### Architecture V2 and execution governance
10
+
11
+ - Complete the V2 Direct / bounded Work / Plan execution model, including isolated Work materialization, authoritative finalization, dead-Plan recovery, duplicate-writer prevention, and safer Work validation.
12
+ - Decouple durable Work ownership from transient MCP transport sessions so scheduled and interactive ChatGPT execution can resume against stable controller leases and checkout identity.
13
+ - Add bounded impact context and CodeGraph-aware retrieval while keeping routing, semantic context, and repository authority converged on one deterministic control path.
14
+
15
+ ### Performance and Runtime
16
+
17
+ - Reduce controller hot-path overhead with canonical repository-root reuse, exact-file retrieval fast paths, Runtime proxy session reuse, batched Process identity probes, narrower service claims, and read-only SQLite diagnostics.
18
+ - Preserve resumable Process/check execution while improving persisted-check retry idempotency, stale-process handling, worktree reconciliation, and release/runtime identity safety.
19
+ - Keep the stable 19-tool ChatGPT surface while moving more domain behavior behind typed capability and plugin contracts.
20
+
21
+ ### Automation and plugins
22
+
23
+ - Add Forge-native ChatGPT workflows, schedules, Work-bound browser watchers, cross-session workflow attribution, and more reliable ChatGPT mode/reasoning selection.
24
+ - Add trusted external-plugin registration lifecycle support and official Forge Figma Bridge catalog installation; retire the bundled desktop helper in favor of the external provider boundary.
25
+ - Improve plugin scope/compatibility handling, browser URL behavior, image artifact delivery, Gmail Unicode subjects, and automation history/configuration surfaces.
26
+
7
27
  ## 1.5.1 - 2026-08-13
8
28
 
9
29
  ### ChatGPT Secure Tunnel and package setup
package/DESIGN.md CHANGED
@@ -218,9 +218,14 @@ Dark, persistent and quiet. It contains Forge identity, grouped navigation, and
218
218
  ### Command bar
219
219
  Each route owns a compact command bar: eyebrow, title, one-line purpose, refreshed time and route actions. `Open ChatGPT` remains globally available but visually secondary.
220
220
 
221
+ ## Page composition rules
222
+ Each workspace has **one dominant information region** and at most one contextual secondary region. Pages are not collections of cards; layout, typography, aligned columns, whitespace and hairlines establish hierarchy before enclosure.
223
+
224
+ Collections use rows or tables. A selected entity uses one contextual detail pane. Configuration uses titled sections with field rows. Metrics stay inline or in compact definition rows unless direct metric comparison is the task. Normal state is visually neutral; semantic color is reserved for exceptions, attention and explicit interaction.
225
+
221
226
  ## Core component grammar
222
227
  ### Metric strip
223
- Overview may show at most four coarse operational facts in one horizontal strip. Metrics share one surface and divider rhythm; they are not separate cards.
228
+ Metric strips are exceptional. Use them only when comparing coarse operational facts is itself useful; never make equal metric cards the default page composition.
224
229
 
225
230
  ### Data list
226
231
  Primary scanning surface for Work, Capabilities and Repositories. Rows use hairline separators and bounded one-line context.
@@ -236,7 +241,7 @@ Use a 7px dot plus short text. Filled badges are exceptional.
236
241
 
237
242
  ## Page grammar
238
243
  ### Overview
239
- Command bar, one four-column metric strip, a deduplicated attention list capped to actionable groups, and a compact persistent-goals summary. No prompt composer, run timeline or grid of equal cards.
244
+ Overview is a **cross-workspace status and attention surface**, not a collection manager. Keep it single-column and lightweight: first surface a bounded, deduplicated Needs attention list across Work, Automations, Capabilities, Repositories and System; then show one compact Workspace summary row for each owning workspace. Overview does not enumerate ordinary Work, group content by repository, expose collection filters or open a detail pane. It routes the user to the owning workspace for management. Healthy state stays compact and neutral. Activity feeds require authoritative event semantics and must never be inferred from `updatedAt` or other incidental timestamps. No prompt composer, run timeline, repository portfolio, equal metric grid or decorative posture hero.
240
245
 
241
246
  ### Automations
242
247
  Use a configuration-first table with Name, Schedule, Scope, Delivery, Status, Last and Next; filters Enabled / Paused / Attention / All; selected detail pane with exact source and Run/Pause/Resume. Never duplicate report body.
package/README.md CHANGED
@@ -48,7 +48,7 @@ Setup persists progress and guides the selected path through the user-level Pack
48
48
 
49
49
  Then follow [Install and start](docs/tutorials/01-install-and-start.md) and [Connect ChatGPT](docs/tutorials/02-connect-chatgpt.md). A repository is optional during initial setup; add one later with `forge adopt --repo /path/to/your-project`. Upgrade an existing install with `npm install -g @moretea-labs/forge@latest`, verify with `forge --version`, then run `forge setup next` to reconcile newer Runtime/connector setup contracts.
50
50
 
51
- For a reviewed source checkout: `git clone https://github.com/moretea-labs/forge.git && cd forge && npm ci --ignore-scripts --no-audit --no-fund && npm install -g . --omit=optional --no-audit --no-fund`.
51
+ For a reviewed source checkout: `git clone https://github.com/moretea-labs/forge.git && cd forge && bun install --frozen-lockfile && npm install -g . --omit=optional --no-audit --no-fund`.
52
52
 
53
53
  ## Built in, and extensible
54
54
 
@@ -58,7 +58,7 @@ Forge ships typed local/browser/desktop/iOS/GitHub/Gmail/Calendar/Tasks/App Stor
58
58
 
59
59
  Local read/write grants are explicit and expiring; remote or destructive effects are distinguished from ordinary local work; high-impact actions require stronger confirmation. Full Access reduces repetitive prompts for normal work without removing the hard boundaries around secrets, destructive actions, and outside-workspace access. See [Security](SECURITY.md) and the [Security Model](docs/wiki/Security-Model.md).
60
60
 
61
- **Docs:** [Wiki](docs/wiki/Home.md) · [Support](SUPPORT.md) · [Contributing](CONTRIBUTING.md) · [Changelog](CHANGELOG.md). Current stable release: `1.5.1`; stable installs use npm `latest`.
61
+ **Docs:** [Wiki](docs/wiki/Home.md) · [Support](SUPPORT.md) · [Contributing](CONTRIBUTING.md) · [Changelog](CHANGELOG.md). Current stable release: `1.6.0`; stable installs use npm `latest`.
62
62
 
63
63
  ---
64
64
  <a id="zh-cn"></a>
@@ -103,10 +103,10 @@ forge setup next # 按每次显示的 Next 动作继续
103
103
 
104
104
  远程主控的 setup 会继续引导 Package Runtime、远程连接、主控配置和连接验证;对 ChatGPT,`--tunnel auto` 现在明确表示 **优先 OpenAI Secure MCP Tunnel**。Forge 保持 Canonical Runtime 私有,并安装一个仅监听 loopback 的 OAuth Gateway,再由官方 `tunnel-client` 出站连接 OpenAI。只有 Secure Tunnel 不可用时才显式选择 Cloudflare Tunnel、Tailscale Funnel、已有 HTTPS `/mcp` 或暂缓远程连接。本地 Codex/Claude 主控不需要 tunnel。ChatGPT App/connector 是应用身份,Secure Tunnel 只是网络传输层,因此切换网络不会产生另一套 Forge 工具 schema。
105
105
 
106
- 继续阅读[安装与启动](docs/tutorials/01-install-and-start.zh-CN.md)和[连接 ChatGPT](docs/tutorials/02-connect-chatgpt.zh-CN.md)。仓库不是首次 setup 的前置条件,需要开发能力时再运行 `forge adopt --repo /path/to/your-project`。已安装用户升级:`npm install -g @moretea-labs/forge@latest`,确认 `forge --version` 后运行 `forge setup next` 让新版 setup 自动补齐 Runtime/connector 配置。源码安装:`git clone https://github.com/moretea-labs/forge.git && cd forge && npm ci --ignore-scripts --no-audit --no-fund && npm install -g . --omit=optional --no-audit --no-fund`。
106
+ 继续阅读[安装与启动](docs/tutorials/01-install-and-start.zh-CN.md)和[连接 ChatGPT](docs/tutorials/02-connect-chatgpt.zh-CN.md)。仓库不是首次 setup 的前置条件,需要开发能力时再运行 `forge adopt --repo /path/to/your-project`。已安装用户升级:`npm install -g @moretea-labs/forge@latest`,确认 `forge --version` 后运行 `forge setup next` 让新版 setup 自动补齐 Runtime/connector 配置。源码安装:`git clone https://github.com/moretea-labs/forge.git && cd forge && bun install --frozen-lockfile && npm install -g . --omit=optional --no-audit --no-fund`。
107
107
 
108
108
  Forge 内置本机、Browser、Desktop、iOS、GitHub、Gmail、Calendar、Tasks、App Store Connect、Resend 等类型化能力;公开 Provider 目录还有 **Forge Desktop Operator / Forge Design / Personal Knowledge Assistant**。详见[功能清单](docs/operations/features.zh-CN.md)与[插件管理](docs/forge-plugin-management.md)。
109
109
 
110
110
  安全上,普通本地修改、远程影响、破坏性操作、密钥和工作区外访问是不同边界;Full Access 不会取消高风险确认。详见[安全说明](SECURITY.md)和[安全模型](docs/wiki/Security-Model.md)。
111
111
 
112
- **文档:** [Wiki](docs/wiki/Home.md) · [支持](SUPPORT.md) · [贡献](CONTRIBUTING.md) · [更新日志](CHANGELOG.md)。当前稳定版为 `1.5.1`,稳定安装使用 npm `latest`。
112
+ **文档:** [Wiki](docs/wiki/Home.md) · [支持](SUPPORT.md) · [贡献](CONTRIBUTING.md) · [更新日志](CHANGELOG.md)。当前稳定版为 `1.6.0`,稳定安装使用 npm `latest`。
package/README.zh-CN.md CHANGED
@@ -62,7 +62,7 @@ forge setup next # 按每次显示的 Next 动作继续
62
62
 
63
63
  ```bash
64
64
  git clone https://github.com/moretea-labs/forge.git && cd forge
65
- npm ci --ignore-scripts --no-audit --no-fund
65
+ bun install --frozen-lockfile
66
66
  npm install -g . --omit=optional --no-audit --no-fund
67
67
  ```
68
68
 
@@ -78,4 +78,4 @@ Forge 把读取、普通本地写入、远程操作、破坏性操作、工作
78
78
 
79
79
  [中文文档中心](docs/README.zh-CN.md) · [Wiki](docs/wiki/Home.md) · [SUPPORT.md](SUPPORT.md) · [CONTRIBUTING.md](CONTRIBUTING.md) · [CHANGELOG.md](CHANGELOG.md)
80
80
 
81
- 当前稳定版本是 `1.5.1`,稳定安装使用 npm `latest`。
81
+ 当前稳定版本是 `1.6.0`,稳定安装使用 npm `latest`。
@@ -1,6 +1,6 @@
1
1
  # Third-party notices
2
2
 
3
- This inventory covers the direct runtime and development dependencies declared by `@moretea-labs/forge@1.5.1`.
3
+ This inventory covers the direct runtime and development dependencies declared by `@moretea-labs/forge@1.6.0`.
4
4
 
5
5
  License values come from `package-lock.json` where available. For lock entries without a license field, the declared license was verified from package metadata during release preparation. This file is informational and does not replace the license text distributed by each dependency.
6
6
 
@@ -79,17 +79,13 @@ is_workflow_surface_path() {
79
79
 
80
80
  edit_plan_gate_mode() {
81
81
  local mode="${FORGE_EDIT_PLAN_GATE:-}"
82
- if [[ -z "$mode" ]]; then
83
- mode="$(workflow_policy_get '.guards.edit_plan_gate' 'advice')"
84
- fi
85
- printf '%s' "$mode"
82
+ [[ -z "$mode" ]] && mode="$(workflow_policy_get '.guards.edit_plan_gate' 'advice')"
83
+ [[ "$mode" == "off" ]] && printf 'off' || printf 'advice'
86
84
  }
87
85
 
88
- # Edit-layer plan gate: the deterministic enforcement point for "no
89
- # implementation edits without an approved plan". The prompt layer only
90
- # advises (natural-language intent guessing is unreliable); this gate keys
91
- # off path + plan state. Modes: advice (default) | enforce | off, via
92
- # FORGE_EDIT_PLAN_GATE or policy .guards.edit_plan_gate.
86
+ # Plan/spec lifecycle is Controller context, never write authorization. This
87
+ # compatibility hook may advise; real enforcement remains path/private-surface,
88
+ # authorization, lease and fencing boundaries.
93
89
  run_edit_plan_gate() {
94
90
  local mode gate_plan gate_status
95
91
  mode="$(edit_plan_gate_mode)"
@@ -99,31 +95,13 @@ run_edit_plan_gate() {
99
95
 
100
96
  if [[ ! -f "docs/spec.md" ]]; then
101
97
  echo "[SpecGuard] Implementation edit without docs/spec.md: $FILE_PATH"
102
- if [[ "$mode" == "advice" ]]; then
103
- echo "[SpecGuard] Advisory: run bash scripts/new-spec.sh and capture stable product intent."
104
- else
105
- hook_structured_error \
106
- "SpecGuard" \
107
- "Implementation edit to $FILE_PATH without docs/spec.md." \
108
- "Run bash scripts/new-spec.sh and capture stable product intent before implementing." \
109
- "missing_artifact"
110
- exit 2
111
- fi
98
+ echo "[SpecGuard] Advisory: capture stable product intent when it materially helps this change."
112
99
  fi
113
100
 
114
101
  gate_plan="$(get_active_plan || true)"
115
102
  if [[ -z "$gate_plan" || ! -f "$gate_plan" ]]; then
116
103
  echo "[PlanStatusGuard] No active plan covers implementation edit: $FILE_PATH"
117
- if [[ "$mode" == "advice" ]]; then
118
- echo "[PlanStatusGuard] Advisory: capture the approved plan with bash scripts/capture-plan.sh --slug <slug> --title <title> --status Approved --execute"
119
- else
120
- hook_structured_error \
121
- "PlanStatusGuard" \
122
- "Implementation edit to $FILE_PATH without an active plan." \
123
- "Capture the approved planning output with bash scripts/capture-plan.sh --slug <slug> --title <title> --status Approved --execute, or set policy .guards.edit_plan_gate to advice/off for this repo." \
124
- "missing_artifact"
125
- exit 2
126
- fi
104
+ echo "[PlanStatusGuard] Advisory: use a Plan only when ChatGPT has chosen staged/dependency coordination."
127
105
  return 0
128
106
  fi
129
107
 
@@ -131,16 +109,7 @@ run_edit_plan_gate() {
131
109
  case "$gate_status" in
132
110
  Draft|Annotating)
133
111
  echo "[PlanStatusGuard] Plan status is '$gate_status' in $gate_plan; implementation edit: $FILE_PATH"
134
- if [[ "$mode" == "advice" ]]; then
135
- echo "[PlanStatusGuard] Advisory: complete the annotation cycle and move the plan to Approved before implementation."
136
- else
137
- hook_structured_error \
138
- "PlanStatusGuard" \
139
- "Implementation edit to $FILE_PATH while plan status is $gate_status in $gate_plan." \
140
- "Complete the annotation cycle and move the plan to Approved before implementation." \
141
- "state_violation"
142
- exit 2
143
- fi
112
+ echo "[PlanStatusGuard] Advisory: this Plan is not execution-ready; ordinary Direct work remains independent."
144
113
  ;;
145
114
  esac
146
115
  }
@@ -768,7 +768,7 @@ render_prompt_guard_action() {
768
768
  exit 0
769
769
  ;;
770
770
  plan_status_no_active_block)
771
- echo "[PlanStatusGuard] Advisory: No active plan found in plans/. Implementation edits will be blocked at the edit layer until a plan is captured."
771
+ echo "[PlanStatusGuard] Legacy advisory: no active Plan found. Ordinary implementation is not gated by Plan presence."
772
772
  echo "[PlanStatusGuard] Capture the approved planning output with: bash scripts/capture-plan.sh --slug <slug> --title <title> --status Approved --execute"
773
773
  echo "[PlanStatusGuard] If there is no captured planning output yet, run: bash scripts/ensure-task-workflow.sh --slug <slug> --title <title>"
774
774
  exit 0
@@ -780,7 +780,7 @@ render_prompt_guard_action() {
780
780
  exit 0
781
781
  ;;
782
782
  plan_status_not_approved_block)
783
- echo "[PlanStatusGuard] Advisory: plan status is '$plan_status' in $active_plan. Complete the annotation cycle and move the plan to Approved; implementation edits are blocked at the edit layer until then."
783
+ echo "[PlanStatusGuard] Legacy advisory: plan status is '$plan_status' in $active_plan. This does not authorize or block ordinary implementation."
784
784
  exit 0
785
785
  ;;
786
786
  evidence_contract_block)
@@ -1,8 +1,59 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "plugins": [
4
- {"id":"desktop_operator","name":"Forge Desktop Operator","version":"0.2.1","description":"Native macOS desktop automation provider for Forge.","repository":"https://github.com/moretea-labs/forge-desktop-operator.git","ref":"v0.2.1","installer":"forge-plugin-install.mjs","platforms":["darwin"]},
5
- {"id":"design","name":"Forge Design","version":"0.3.0","description":"Repository-native deterministic design workspace and design.md provider.","repository":"https://github.com/moretea-labs/forge-design.git","ref":"v0.3.0","installer":"forge-plugin-install.mjs","platforms":["darwin","linux","win32"]},
6
- {"id":"personal_knowledge","name":"Personal Knowledge Assistant","version":"0.2.1","description":"Local-first personal knowledge retrieval, memory, safe-write and analysis provider.","repository":"https://github.com/moretea-labs/personal-knowledge-assistant.git","ref":"v0.2.1","installer":"forge-plugin-install.mjs","platforms":["darwin","linux","win32"]}
4
+ {
5
+ "id": "desktop_operator",
6
+ "name": "Forge Desktop Operator",
7
+ "version": "0.2.1",
8
+ "description": "Native macOS desktop automation provider for Forge.",
9
+ "repository": "https://github.com/moretea-labs/forge-desktop-operator.git",
10
+ "ref": "v0.2.1",
11
+ "installer": "forge-plugin-install.mjs",
12
+ "providerVersion": "0.2.0",
13
+ "protocolVersion": "1.0",
14
+ "platforms": [
15
+ "darwin"
16
+ ]
17
+ },
18
+ {
19
+ "id": "design",
20
+ "name": "Forge Design",
21
+ "version": "0.3.0",
22
+ "description": "Repository-native deterministic design workspace and design.md provider.",
23
+ "repository": "https://github.com/moretea-labs/forge-design.git",
24
+ "ref": "v0.3.0",
25
+ "installer": "forge-plugin-install.mjs",
26
+ "platforms": [
27
+ "darwin",
28
+ "linux",
29
+ "win32"
30
+ ]
31
+ },
32
+ {
33
+ "id": "personal_knowledge",
34
+ "name": "Personal Knowledge Assistant",
35
+ "version": "0.2.1",
36
+ "description": "Local-first personal knowledge retrieval, memory, safe-write and analysis provider.",
37
+ "repository": "https://github.com/moretea-labs/personal-knowledge-assistant.git",
38
+ "ref": "v0.2.1",
39
+ "installer": "forge-plugin-install.mjs",
40
+ "platforms": [
41
+ "darwin",
42
+ "linux",
43
+ "win32"
44
+ ]
45
+ },
46
+ {
47
+ "id": "figma",
48
+ "name": "Forge Figma Bridge",
49
+ "version": "0.3.0",
50
+ "description": "Direct Figma Plugin API bridge for typed canvas inspection, editing and native review capture.",
51
+ "repository": "https://github.com/moretea-labs/forge-figma-bridge.git",
52
+ "ref": "v0.3.0",
53
+ "installer": "forge-plugin-install.mjs",
54
+ "platforms": [
55
+ "darwin"
56
+ ]
57
+ }
7
58
  ]
8
59
  }
@@ -18,7 +18,7 @@ Generated host adapter commands carry a 30 second timeout; long-running work bel
18
18
 
19
19
  `UserPromptSubmit.default` dispatches to the active `prompt-guard.sh` resolved by the central-first hook source decision. For ordinary repos that means the packaged/user-level runtime; `.ai/hooks/prompt-guard.sh` is active only when the repo pins `"hook_source": "repo"`. The shell layer parses host prompt JSON, reads workflow files, performs capture side effects, and renders host-safe output; it pipes `{"prompt": ...}` into `forge-hook prompt-guard-decide`, which owns every prompt-text intent classifier (Unicode-aware, in `src/cli/hook/prompt-intents.ts`) plus the intent x state decision table and returns one verdict JSON line (action, intent facts, derived strings). If the engine is unreachable or predates the protocol, the prompt layer degrades to a one-shot advisory instead of guessing; there is no shell fallback decision table.
20
20
 
21
- Prompt-layer plan/spec/contract gates are advisory routing only. `PreToolUse.edit` keeps real path/scope and private-surface safety checks authoritative, while the plan-state gate defaults to `advice`; repositories may opt into `enforce` or `off` through policy `.guards.edit_plan_gate` or `FORGE_EDIT_PLAN_GATE`. Done-claim gates block only on real failed or missing completion evidence, not on workflow ceremony.
21
+ Prompt-layer plan/spec/contract signals are advisory context only. `PreToolUse.edit` keeps real path/scope and private-surface safety checks authoritative; Plan/spec lifecycle is never a write-authorization gate. Legacy `.guards.edit_plan_gate=enforce` or `FORGE_EDIT_PLAN_GATE=enforce` is accepted as advisory compatibility, while `off` suppresses the guidance. Done-claim compatibility gates remain separate until goal-acceptance/evidence convergence removes workflow ceremony from completion.
22
22
 
23
23
  If you are asking "which hook file should I edit?", default to `assets/hooks/` for product changes and mirror into `.ai/hooks/` only for this self-host repo or another repo that pins `"hook_source": "repo"`; runtime pickup outside repo-pinned development happens on the next `install`/CLI upgrade because hooks resolve central-first.
24
24
  After installing or refreshing `~/.codex/hooks.json`, open Codex Settings and mark the user-level hook config as trusted; otherwise Codex will not execute it.
@@ -79,11 +79,11 @@ Existing contracts without this block remain valid. `.ai/harness/scripts/verify-
79
79
  ## Review Coupling
80
80
 
81
81
  - A contract is not truly done until the matching review file records a passing recommendation.
82
- - `tasks/reviews/<plan-stem>.review.md` should be filled from Waza `/check` after verification and cite the contract, implementation notes, checks file, run snapshot, `## External Acceptance Advice`, and any manual observations.
82
+ - `tasks/reviews/<plan-stem>.review.md` should be filled from Forge `/review` after verification and cite the contract, implementation notes, checks file, run snapshot, `## External Acceptance Advice`, and any manual observations.
83
83
  - `tasks/notes/<plan-stem>.notes.md` captures task-local decisions and should be archived or promoted deliberately, not left as hidden long-term memory.
84
84
 
85
85
  ## Worktree Lifecycle
86
86
 
87
87
  - When `.ai/harness/policy.json` has `worktree_strategy.auto_for_contract_tasks: true`, `.ai/harness/scripts/plan-to-todo.sh --plan <approved-plan>` starts a linked `codex/<slug>` worktree instead of mutating the primary tree.
88
88
  - Execute the sprint in that linked worktree. The primary worktree remains a merge target and must stay clean before merge-back.
89
- - After implementation, run Waza `/check` so the review file recommends pass, record passing `## External Acceptance Advice` from the peer reviewer or a concrete manual override, then run `.ai/harness/scripts/contract-worktree.sh finish`. The finish command gates on external acceptance before `verify-sprint.sh`, commits the branch, and fast-forwards the target branch only when the target worktree is clean.
89
+ - After implementation, run Forge `/review` so the review file recommends pass, record passing `## External Acceptance Advice` from the peer reviewer or a concrete manual override, then run `.ai/harness/scripts/contract-worktree.sh finish`. The finish command gates on external acceptance before `verify-sprint.sh`, commits the branch, and fast-forwards the target branch only when the target worktree is clean.
@@ -1,6 +1,6 @@
1
1
  {
2
- "version": "1.5.1",
3
- "templateVersion": "1.5.1",
2
+ "version": "1.6.0",
3
+ "templateVersion": "1.6.0",
4
4
  "skillName": "forge",
5
5
  "contractId": "tasks-first-harness-v1",
6
6
  "compatibility": {
@@ -916,8 +916,8 @@ ARCHITECTURE_INDEX_EOF
916
916
  },
917
917
  "guards": {
918
918
  "edit_plan_gate": "advice",
919
- "edit_plan_gate_modes": ["enforce", "advice", "off"],
920
- "rule": "pre-edit-guard advises when implementation lacks an active plan; execution remains available unless a real safety boundary blocks it"
919
+ "edit_plan_gate_modes": ["advice", "off"],
920
+ "rule": "pre-edit-guard may expose Plan/spec context, but Plan lifecycle never authorizes implementation; only real safety/resource boundaries block execution"
921
921
  },
922
922
  "sidecar_research": {
923
923
  "default": true,
@@ -21,11 +21,11 @@ Usage:
21
21
 
22
22
  Program-level sprint backlog helper. PRDs live in plans/prds/ as the upper
23
23
  planning layer; sprints live in plans/sprints/ as ordered execution backlogs.
24
- Each backlog row is expanded with $think before the existing plan -> contract
24
+ Each backlog row is expanded with /plan before the existing plan -> contract
25
25
  -> worktree flow. tasks/todos.md stays the deferred-goal ledger.
26
26
 
27
27
  start-task reserves the next (or named) pending backlog row and can capture a
28
- thin plan seed. The coding agent must still use `$think` to expand the row into
28
+ thin plan seed. The coding agent must still use `/plan` to expand the row into
29
29
  a decision-complete plan before code edits.
30
30
  --sprint overrides the active-sprint marker (still confined to the sprints
31
31
  dir), which finish back-fill uses inside worktrees where the runtime marker
@@ -218,7 +218,7 @@ render_sprint_file() {
218
218
 
219
219
  Program-level sprint container. The Source PRD summary and ordered backlog
220
220
  decompose product intent into task-contract slices; each backlog row is a
221
- long-task waypoint that must be expanded with `$think` before code edits.
221
+ long-task waypoint that must be expanded with `/plan` before code edits.
222
222
  `tasks/todos.md` stays the deferred-goal ledger and never carries this backlog.
223
223
 
224
224
  ## PRD
@@ -740,12 +740,12 @@ Deliver backlog task \`${target_task}\` so that the acceptance line holds: ${tar
740
740
 
741
741
  ## Planning Expansion
742
742
 
743
- Before editing code, use \`\$think\` to expand this sprint row into a decision-complete implementation plan. The \`\$think\` pass should read the sprint file, preserve the acceptance line, name concrete files or commands, and produce the detailed \`plans/plan-*.md\` body that drives contract execution.
743
+ Before editing code, use \`/plan\` to expand this sprint row into a decision-complete implementation plan. The \`/plan\` pass should read the sprint file, preserve the acceptance line, name concrete files or commands, and produce the detailed \`plans/plan-*.md\` body that drives contract execution.
744
744
 
745
745
  ## Task Breakdown
746
746
 
747
- - [ ] Run \`\$think\` for backlog task \`${target_task}\` using sprint \`${sprint_file}\` and acceptance: ${target_acceptance}
748
- - [ ] Capture the approved Forge \`/plan\` output with \`scripts/capture-plan.sh --source forge-plan --source-ref sprint:${sprint_file}#${target_task}\`
747
+ - [ ] Run \`/plan\` for backlog task \`${target_task}\` using sprint \`${sprint_file}\` and acceptance: ${target_acceptance}
748
+ - [ ] Capture the approved \`/plan\` output with \`scripts/capture-plan.sh --source forge-plan --source-ref sprint:${sprint_file}#${target_task}\`
749
749
  - [ ] Verify acceptance: ${target_acceptance}
750
750
  BODY_EOF
751
751
 
@@ -160,11 +160,17 @@ Deterministic rules are preferred for:
160
160
 
161
161
  Semantic analysis remains external-controller-owned. Forge does not invent the next product or code decision inside the Schedule Engine. A Schedule may use the deterministic `external_controller_wake` action to resume an already bounded Work through Thin Launcher. The wake operation only transports the persisted Work/Handoff context to an external Controller; it does not interpret the model response inside the Kernel.
162
162
 
163
+ Work-bound continuation is one Schedule subtype, not the universal Schedule model. Long-lived policy belongs to the Schedule; one firing belongs to the terminal Occurrence; a Work remains a finite objective. Generic Schedules may therefore finish with `nothing_to_do`, run an explicitly allowlisted deterministic operation/check, or wake an existing finite Work. If an external Controller observes a genuinely new semantic objective, that later request returns through the normal Route Policy and Work admission path rather than turning the Schedule itself into a forever-running Work.
164
+
165
+ For external systems that do not expose a reliable event API, a Work-bound Schedule may instead use the deterministic `browser_probe` operation. The Kernel may navigate or reload one allowed browser target, extract bounded text, normalize a caller-selected projection, compute a stable fingerprint, compare it with the previous persisted observation, and detect explicitly configured login markers. It must not classify the business meaning of the page. The first observation is a silent baseline by default, unchanged observations are `nothing_to_do`, and only a changed observation (or an explicit authentication-required condition) may wake the bound external Controller.
166
+
163
167
  `external_controller_wake` accepts a `work_id`, `controller_type`, and optional launcher/session metadata. For ChatGPT, Thin Launcher prefers a saved Forge browser session (`browser_session_id`), then an explicit `https://chatgpt.com/...` conversation URL, then a new browser consult. Codex/Claude remain external CLI controllers. If the Work already has an active Controller lease, the Occurrence is a deterministic no-op rather than spawning a competing controller.
164
168
 
165
- The stable ChatGPT tool surface manages this policy through `rh_work` rather than exposing another Schedule tool. `rh_work.schedule_create/list/get/pause/resume/trigger` binds only an existing non-terminal Work to `external_controller_wake`; callers cannot use the facade to schedule an arbitrary MCP or repository operation. Creation is idempotent by a stable schedule request identity, defaults to `shadow_mode=true`, limits active occurrences to one, and carries explicit failure/cooldown/daily-budget/backoff policy.
169
+ The stable ChatGPT tool surface manages this policy through `rh_work` rather than exposing another Schedule tool. `rh_work.schedule_create/list/get/pause/resume/trigger` binds only an existing non-terminal Work to one of three bounded modes: `continuation` (`external_controller_wake`), `browser_watch` (`browser_probe` with change-triggered wake), or `browser_keepalive` (`browser_probe` without content-change wake). Callers cannot use the facade to schedule an arbitrary MCP or repository operation. Creation is idempotent by a stable schedule request identity, defaults to `shadow_mode=true`, limits active occurrences to one, and carries explicit failure/cooldown/daily-budget/backoff policy.
170
+
171
+ A Work-bound Schedule is acceptance-driven, not perpetual. Before every wake **or browser probe**, Forge re-reads the bound Work. A missing Work pauses the Schedule; a terminal Work (`completed`, `cancelled`, or another terminal Work state) deterministically disables the Schedule and returns `nothing_to_do` before touching the external browser target. An active Controller lease also suppresses a competing wake. Therefore recurring triggers are only observation/continuation policy for unfinished bounded Work, never a forever-running agent.
166
172
 
167
- A Work continuation Schedule is acceptance-driven, not perpetual. Before every wake, Forge re-reads the bound Work. A missing Work pauses the Schedule; a terminal Work (`completed`, `cancelled`, or another terminal Work state) deterministically disables the Schedule and returns `nothing_to_do`. An active Controller lease also returns `nothing_to_do`. Therefore the recurring trigger is only a wake policy for unfinished bounded Work, never a forever-running agent.
173
+ `browser_watch` persists only normalized observation metadata (fingerprint, observation time/status, and bounded diagnostics), not the extracted page body as Schedule state. Callers may provide `include_terms` and `ignore_patterns` to exclude unrelated or volatile text such as relative timestamps. `browser_keepalive` refreshes the configured browser session and checks explicit login URL/text markers; it can wake ChatGPT when re-authentication is required, but a successful refresh is not treated as a guarantee that a third-party session can never expire.
168
174
 
169
175
  Thin Launcher does not pre-claim Controller ownership. It records a short Controller-Home launch reservation (configured with `launch_reservation_ms`) only to fence duplicate spawns while the provider starts. The external provider must connect to Forge MCP and call `rh_work continue` with its authenticated transport identity; that authenticated principal/session becomes the Work owner. This separation prevents the scheduler from impersonating ChatGPT/Codex/Claude and preserves the Controller-session identity fence. Detached CLI providers also use their non-interactive execution contracts (`codex ... exec` and `claude --print`) instead of launching interactive TUIs with ignored stdio.
170
176
 
@@ -434,7 +440,7 @@ The purpose is to remove unhelpful automation, not merely prove it is active.
434
440
 
435
441
  The runtime implements first-class `RepositorySchedule`, `ScheduleDecision` and `ScheduleOccurrence` records under `src/runtime/workflow/schedules/`. Supported triggers are interval, manual, five-field UTC cron, one-shot calendar timestamp, condition watch, repository event and dependency checkpoint.
436
442
 
437
- Every due trigger uses a deterministic window or event identity. The Decision is persisted before executable work is admitted. Occurrences are indexed, Shadow Mode defaults on, one Occurrence creates at most one durable Job, and repeated trigger delivery returns the existing Occurrence.
443
+ Every due trigger uses a deterministic window or event identity. The Decision is persisted before executable work is admitted. Occurrences are indexed, Shadow Mode defaults on, one Occurrence creates at most one durable Job, and repeated trigger delivery returns the existing Occurrence. Work-bound continuation/browser-watch helpers remain specialized views over this same Schedule/Occurrence engine rather than a second Workflow lifecycle.
438
444
 
439
445
  Budgets, cooldown, maximum active Occurrences, consecutive-failure circuit breaking and exponential backoff are persisted. Dirty Workspaces, release barriers, repository disablement, human-attention state and recent external/infrastructure failures suppress unattended writes. Candidate Findings deduplicate observations and require explicit human promotion before Issue creation.
440
446
 
@@ -1,6 +1,6 @@
1
1
  # CodeGraph Context Provider
2
2
 
3
- Status: reviewed for Phase 1 implementation
3
+ Status: **Runtime Authority — impact-context convergence implemented**
4
4
  Source baseline: `a49465096c4e2532da37ab2f9d10dca2238217ac`
5
5
  Scope: Controller Context Plane only
6
6
 
@@ -99,12 +99,14 @@ Default is `off` to preserve current Direct performance and behavior.
99
99
 
100
100
  Expected mode usage:
101
101
 
102
- - ordinary Direct: `off`
102
+ - ordinary Direct: `off` (zero CodeGraph provider calls)
103
103
  - explicit `-debug`: `auto`
104
104
  - explicit `-plan`: `required` when a CodeGraph index is present; otherwise return a clear degraded-plan warning and use bounded text search
105
105
  - Goal/Plan planning and review: `auto` or `required` when structural evidence materially improves the decision
106
106
 
107
- When enabled, graph results augment candidate ranking. They do not replace raw source reads. Important files selected through CodeGraph still pass through `resolveMcpPath` and `readRepositoryRange` before implementation.
107
+ When enabled, graph results augment candidate ranking and the bounded impact contract. They do not replace raw source reads. Important files selected through CodeGraph still pass through `resolveMcpPath` and `readRepositoryRange` before implementation.
108
+
109
+ After the initial structural `context` query, the Context Plane may issue bounded `file_dependencies` queries for a small number of entry-point files. Dependencies and dependents are folded into the same policy-filtered Context Pack; they are not exposed as another ChatGPT tool flow. The pack derives an `impactContext` containing primary targets, must-inspect and likely-affected files, related tests/checks, architecture contracts, coverage gaps, freshness, and confidence. These remain discovery evidence: ChatGPT is still the semantic-sufficiency authority.
108
110
 
109
111
  Context Pack gains a bounded `structuralContext` section containing:
110
112
 
@@ -138,6 +140,16 @@ If the provider reports changed files, stale extraction, or an index built by an
138
140
 
139
141
  A later typed maintenance action may perform refresh. That action is separate from planning and may write only derived `.codegraph` state, never source files.
140
142
 
143
+ ### Isolated checkout baseline overlay
144
+
145
+ CodeGraph binds source root and `.codegraph` database root to the same `projectRoot`; the embedded API does not expose a separate read-only database path. Forge therefore does **not** copy or synchronously build an 84MB-class structural index for every managed worktree.
146
+
147
+ When structural context is requested for an isolated checkout that has no local index, the Context Plane may reuse an indexed non-worktree checkout from the same Repository Registry family as **repository-baseline structural evidence**. Current-checkout lexical/raw source remains authoritative. Forge overlays the selected checkout's current Git-changed paths on the graph candidates and reports `indexSource=repository_baseline` plus explicit coverage gaps.
148
+
149
+ The baseline is never presented as current-checkout truth. A dirty current checkout or a baseline/current HEAD mismatch marks the structural evidence stale and prevents `structural_context=required` from being satisfied. Optional structural requests may still use the graph as bounded discovery evidence while raw current-checkout reads cover changed files.
150
+
151
+ This fallback executes only when structural context was already requested. Ordinary Direct routing remains `structural_context=off`, performs zero CodeGraph provider calls, and pays no baseline lookup or structural refresh cost.
152
+
141
153
  ## Packaging and platform behavior
142
154
 
143
155
  The provider locates the matching optional platform package:
@@ -10,7 +10,9 @@ The Controller owns dispatch decisions. Workers and Agents execute scoped contra
10
10
 
11
11
  ## 2. Work Assessment
12
12
 
13
- Every change request is assessed before execution using:
13
+ The Controller commits an execution mode only after it has enough evidence to do so. An already-explicit bounded request may commit immediately; an ambiguous or architectural request starts with read-only exploration and is assessed only after that context is available. Forge does not create a Plan/Work merely to perform this exploration.
14
+
15
+ When an execution commitment is needed, the Controller assesses:
14
16
 
15
17
  ```text
16
18
  objective clarity
@@ -39,7 +41,21 @@ verificationClass
39
41
  humanBoundary
40
42
  ```
41
43
 
42
- Repository search is an information-gathering step, not by itself a reason to start an Agent or create a durable Issue.
44
+ Repository search, CodeGraph impact analysis, Runtime state reads, and history/evidence lookup are information-gathering steps. They are not by themselves reasons to start an Agent, create Work, or create a Plan. ChatGPT/human Controller owns semantic sufficiency and the Direct/Work/Plan choice; Forge Route/Hook compatibility code may supply mechanics, safety facts, or advice but MUST NOT become a second semantic decision authority.
45
+
46
+ ### 2.1 Orthogonal routing dimensions
47
+
48
+ Forge keeps three decisions separate:
49
+
50
+ ```text
51
+ semantic ownership = unbound | continue/extend an explicit Work | Plan/Requirement binding
52
+ execution depth = Direct | Process | Durable Work | Handoff
53
+ resource placement = visible checkout | isolated Worktree | external provider resource
54
+ ```
55
+
56
+ `RouteDecision` is the sole authority for execution depth. An unrelated active Work, an existing Plan, or a checkout writer MUST NOT reinterpret an already-safe Direct operation as Durable Work. Explicit Work ownership may be attached to a Direct Edit or Process for attribution/evidence without changing its execution depth. A real checkout writer conflict changes placement or waits for a resource; it does not manufacture a semantic `parallel`/`new_goal` relation.
57
+
58
+ When `rh_work start` actually creates a Durable repository Work, the facade materializes the same-ID execution `WorkHandle` for the selected checkout/worktree and atomically claims that new Work for the authenticated initiating Controller. `work_prepare` remains a lower-level execution/compatibility primitive; a normal new Work does not require a second mechanical prepare/claim round trip before useful execution can begin.
43
59
 
44
60
  ## 3. Execution Modes
45
61
 
@@ -88,7 +104,7 @@ Quick Agent work may carry ephemeral diagnostic metadata, but Job and Run eviden
88
104
 
89
105
  ### 3.3 Requirement, Plan, and Work
90
106
 
91
- A durable Requirement/Plan/Work graph is required when work has one or more of:
107
+ Requirement, Plan, Work, and Workflow are independent durable tools rather than a mandatory graph. The Controller introduces only the minimum durable object justified by the task. A finite Work is useful when one bounded responsibility needs cross-session recovery/ownership; a Plan is useful for real staged/dependency coordination; a Requirement represents longer-lived intent; Workflow/Schedule represents recurrence. Durable state is commonly justified by one or more of:
92
108
 
93
109
  - multiple independently verifiable objectives;
94
110
  - dependencies or ordered migration phases;
@@ -97,25 +113,26 @@ A durable Requirement/Plan/Work graph is required when work has one or more of:
97
113
  - protected or release-sensitive surfaces;
98
114
  - cross-repository work;
99
115
  - long-running verification or environment dependencies;
100
- - schedule-driven recurrence;
101
116
  - a need for review and recovery across multiple sessions;
102
117
  - release or rollout coordination.
103
118
 
104
- A durable Work contract is not ceremony. It owns bounded execution scope, dependencies, evidence, retry history, and completion receipts; Requirement owns user-visible intent and acceptance outcome.
119
+ A durable Work contract is optional, not ceremony and not a universal task wrapper. When explicitly chosen it owns a bounded recoverable responsibility and its execution attribution; Process/ExecutionJob/EditSession remain the technical execution truth. Requirement owns longer-lived user intent; ChatGPT/user review owns semantic acceptance. A Schedule/Occurrence does not require Work unless a particular occurrence needs durable responsibility.
105
120
 
106
121
  ## 4. Decision Order
107
122
 
108
- The Controller applies this order:
123
+ The Controller follows a late-commit order rather than classifying every request at ingress:
109
124
 
110
125
  ```text
111
- 1. Is the request read-only?
112
- 2. Can bounded Direct Edit safely satisfy it?
113
- 3. Is one scoped Agent attempt sufficient?
114
- 4. Does the work require durable Requirement/Plan/Work state?
115
- 5. Does it cross repositories or require a Schedule?
116
- 6. Does any external or destructive boundary require human authorization?
126
+ 1. Is the request already explicit and bounded enough to act safely?
127
+ 2. If not, gather the minimum read-only context first.
128
+ 3. After context is sufficient, can Direct/Process satisfy it?
129
+ 4. Does this bounded responsibility genuinely need durable Work recovery/ownership?
130
+ 5. Does coordination genuinely need a Plan, or recurrence a Workflow/Schedule?
131
+ 6. Independently, do hard authorization/resource/destructive boundaries constrain execution?
117
132
  ```
118
133
 
134
+ Steps 1-5 are semantic Controller decisions. Step 6 and execution mechanics are Forge authority. A later hard-safety rejection may stop an unsafe action, but Forge must not force an A→B execution-mode switch merely because a Plan/Work artifact is absent.
135
+
119
136
  The system MUST NOT default to Agent execution merely because an Agent is available.
120
137
 
121
138
  ## 5. Agent Roles
@@ -315,6 +332,8 @@ Use when:
315
332
 
316
333
  The default `auto` placement policy chooses Workspace for one local serial writer and Worktree when concurrency exists. It MUST still honor explicit claims and dirty-state safety.
317
334
 
335
+ Placement is evaluated after execution depth and semantic ownership. A new durable objective may therefore create a new finite Work and select a Worktree purely because the visible checkout already has a writer; the caller does not need to classify that resource conflict as a semantic `parallel` relation first. Only a managed Worktree/branch is a disposable Work-owned resource: stopping a Work on the current checkout closes lifecycle/process ownership but never removes the repository's current checkout or branch.
336
+
318
337
  ## 11. Review and Continuation
319
338
 
320
339
  After execution:
@@ -347,7 +366,7 @@ The dispatch layer MUST avoid:
347
366
 
348
367
  ## 13. Current Implementation
349
368
 
350
- The repository implements Direct Edit, Quick Agent and Requirement/Work assessment; runtime Agent selection; bounded Task scope; persistent Runs; Workspace/Worktree placement; and risk-adaptive verification.
369
+ The repository implements one canonical Route Policy for execution depth, Direct Edit, Process Runtime, finite Requirement/Work execution, optional Plan decomposition, runtime Agent selection, bounded Task scope, persistent Runs, Workspace/Worktree placement, and risk-adaptive verification.
351
370
 
352
371
  The Thin Gateway keeps deterministic local commands on Direct Edit or Process Runtime paths. Agent dispatch is now an explicit external-Controller handoff; the Kernel no longer creates Execution Jobs for ordinary Agent launches. Work ownership, repository placement, and resource claims remain durable Controller state, while provider selection and model execution belong to the claimed external Controller.
353
372
 
@@ -13,6 +13,26 @@ Forge separates four kinds of truth:
13
13
 
14
14
  Entities from different categories must not be collapsed merely because they are currently stored in adjacent files or exposed by one tool.
15
15
 
16
+ The current Controller model also separates semantic ownership from execution depth and placement. Requirement/Plan/Work describe intent and finite delivery lineage; Direct/Process/Agent describe execution mechanisms; Workspace/Worktree/provider resources describe placement. None of those dimensions substitutes for another.
17
+
18
+ ### 1.1 Current intent hierarchy
19
+
20
+ ```text
21
+ Requirement? long-lived user outcome
22
+ -> Plan? optional decomposition/replanning contract
23
+ -> Work finite recoverable objective
24
+ -> Edit Session / Process / Run / Verification evidence
25
+
26
+ Schedule long-lived trigger/policy
27
+ -> Occurrence one bounded terminal firing
28
+ ```
29
+
30
+ A Requirement may have more than one active Plan slice. Current Plan rows own the forward `requirementId` relation; `Requirement.activePlanId` is migration compatibility only and MUST NOT become a second lifecycle authority. A failed/cancelled Work moves its Plan to `replanning`; a reusable slice returns to `ready` rather than pretending to be in verification.
31
+
32
+ A Durable repository Work has one execution `WorkHandle` with the same Work identity. The handle records the selected checkout/worktree, execution-session binding, permission snapshot and finalization stages; it is execution state, not another user objective. New `rh_work start` creation materializes this handle and claims the initiating authenticated Controller in the same facade flow. `managedWorktree=false` means the Work does not own the current checkout/branch as disposable resources, so terminal cleanup releases lifecycle/process ownership without deleting them.
33
+
34
+ Conversation/session bindings are transport and presentation preferences. They may help resume a Controller, but Work/Schedule identity survives a changed or missing conversation.
35
+
16
36
  ## 2. Identity Hierarchy
17
37
 
18
38
  ```text
@@ -71,7 +71,7 @@ Current source uses Forge authorities for active configuration:
71
71
  - GitHub: `.forge/plugins/github.json` plus Repository Registry GitHub identity;
72
72
  - Gmail/Calendar/Tasks: `.forge/plugins/...`, `FORGE_*_ACCESS_TOKEN`;
73
73
  - iOS: `.forge/plugins/ios.json`, `FORGE_IOS_DEVICE_RUNNER_URL` plus local Xcode/CoreDevice/agent-device facts;
74
- - Desktop: Controller Home `system/desktop/config.json`;
74
+ - Desktop Operator: trusted external registration under Controller Home plus the stable signed macOS app identity;
75
75
  - Local System: Controller Home `system/local-system`.
76
76
 
77
77
  App Store Connect intentionally retains `.repo-harness/plugins/app-store-connect.json` as a named `legacy-read-fallback`. This is an acceptable migration pattern and must not become a new write authority.
@@ -326,7 +326,7 @@ Runtime/recovery/worktree directories are governed separately and are never trea
326
326
  7. Route a non-destructive status/observe action end-to-end.
327
327
  8. Add write action policy tests for press/type/screenshot/batch without bypassing normal Forge confirmation rules.
328
328
  9. Run real macOS E2E when the registered Desktop Operator build/service is available.
329
- 10. Only then decide whether the bundled Desktop helper remains fallback or is retired.
329
+ 10. Retire the bundled Desktop helper after the external Desktop Operator is healthy; do not retain a second desktop authority.
330
330
 
331
331
  ### Phase 1 acceptance
332
332
 
@@ -368,7 +368,7 @@ Preserve its independent Git/product boundary. Integrate only through stable con
368
368
  Audit and close every built-in plugin:
369
369
 
370
370
  - Browser: Chrome/Vivaldi attach, ownership/reuse, DOM/native capability matrix, failure paths, real E2E.
371
- - Local System/Desktop: unregistered target operations, application control, external Desktop provider, destructive-path safeguards.
371
+ - Local System/Desktop Operator: unregistered target operations, background-safe application control, external Desktop provider, destructive-path safeguards.
372
372
  - iOS: simulator, agent-device, CoreDevice, physical runner configuration/E2E.
373
373
  - App Store Connect: auth/read/preview/write policy and remote-write guarded E2E.
374
374
  - GitHub: canonical Forge remote identity after repository rename; issue/project read/write acceptance.