@moretea-labs/forge 1.6.0 → 1.7.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.
- package/AGENTS.md +4 -0
- package/CHANGELOG.md +39 -0
- package/CLAUDE.md +4 -0
- package/README.md +2 -2
- package/README.zh-CN.md +1 -1
- package/SKILL.md +2 -2
- package/THIRD_PARTY_NOTICES.md +1 -1
- package/agents/openai.yaml +1 -1
- package/assets/hooks/hook-input.sh +11 -8
- package/assets/hooks/lib/session-state.sh +10 -7
- package/assets/hooks/lib/workflow-state.sh +13 -177
- package/assets/hooks/post-tool-observer.sh +8 -2
- package/assets/hooks/prompt-guard.sh +5 -81
- package/assets/hooks/session-start-context.sh +56 -1
- package/assets/partials/05-workflow.partial.md +1 -1
- package/assets/partials-agents/02-operating-mode.partial.md +2 -0
- package/assets/partials-agents/03-orchestration.partial.md +1 -1
- package/assets/plugin-registry.v1.json +3 -3
- package/assets/reference-configs/document-generation.md +1 -1
- package/assets/reference-configs/harness-overview.md +1 -1
- package/assets/reference-configs/sprint-contracts.md +3 -3
- package/assets/skill-version.json +2 -2
- package/assets/templates/contract.template.md +2 -7
- package/assets/templates/helpers/capture-plan.sh +2 -2
- package/assets/templates/helpers/check-architecture-sync.sh +17 -0
- package/assets/templates/helpers/check-task-workflow.sh +4 -4
- package/assets/templates/helpers/contract-worktree.sh +1 -21
- package/assets/templates/helpers/ensure-task-workflow.sh +11 -36
- package/assets/templates/helpers/inspect-project-state.ts +8 -6
- package/assets/templates/helpers/migrate-project-template.sh +22 -45
- package/assets/templates/helpers/migrate-workflow-docs.ts +9 -7
- package/assets/templates/helpers/new-plan.sh +1 -1
- package/assets/templates/helpers/plan-to-todo.sh +12 -37
- package/assets/templates/helpers/ship-worktrees.sh +2 -29
- package/assets/templates/helpers/verify-contract.sh +1 -111
- package/assets/templates/helpers/verify-sprint.sh +3 -180
- package/assets/templates/helpers/workflow-contract.ts +5 -1
- package/assets/templates/plan.template.md +1 -1
- package/assets/templates/review.template.md +9 -34
- package/assets/workflow-contract.v1.json +10 -19
- package/docs/README.md +10 -10
- package/docs/architecture/CURRENT.md +178 -0
- package/docs/architecture/EVOLUTION.md +42 -0
- package/docs/architecture/current/README.md +4 -156
- package/docs/architecture/decisions/20260803-release-identity-binding-and-exit-policy.md +2 -2
- package/docs/architecture/decisions/20260823-immediate-controller-relay.md +53 -0
- package/docs/architecture/decisions/20260826-browser-runtime-v2.md +73 -0
- package/docs/architecture/history/README.md +7 -0
- package/docs/architecture/{chatgpt-handoff-facade.md → history/chatgpt-handoff-facade.md} +4 -0
- package/docs/architecture/{global-hook-runtime.md → history/global-hook-runtime.md} +7 -3
- package/docs/architecture/{ios-semantic-automation-provider-v2.md → history/ios-semantic-automation-provider-v2.md} +6 -2
- package/docs/architecture/history.md +3 -34
- package/docs/architecture/index.md +15 -98
- package/docs/architecture/modules/controller-runtime/transport-lifecycle.md +1 -1
- package/docs/architecture/reviews/2026-08-22-semantic-harness-convergence-acceptance.md +39 -0
- package/docs/architecture/versions/1.6.md +38 -0
- package/docs/architecture/versions/1.7.md +41 -0
- package/docs/forge-chatgpt-browser-engine.md +2 -2
- package/docs/forge-chatgpt-mcp-setup.md +4 -28
- package/docs/forge-chatgpt-supervised-automation.md +3 -3
- package/docs/forge-github-issue-launcher.md +1 -1
- package/docs/forge-plugin-management.md +1 -1
- package/docs/forge-runtime-self-healing-loop.md +1 -1
- package/docs/operations/controller-browser-plugin.md +26 -6
- package/docs/operations/controller-performance-and-502.md +143 -0
- package/docs/operations/controller-reliability-runbook.md +1 -1
- package/docs/operations/features.md +2 -2
- package/docs/operations/github-repository.md +1 -1
- package/docs/operations/homebrew.md +2 -2
- package/docs/operations/mcp-tool-exposure.md +5 -3
- package/docs/wiki/Architecture.md +6 -6
- package/docs/wiki/Implementation.md +2 -2
- package/docs/wiki/Integrations.md +2 -2
- package/docs/wiki/Work-Lifecycle.md +1 -1
- package/package.json +33 -11
- package/scripts/activate-source-baseline.ts +17 -13
- package/scripts/architecture-event.ts +2 -820
- package/scripts/architecture-queue.sh +2 -645
- package/scripts/archive-architecture-request.sh +2 -242
- package/scripts/archive-workflow.sh +1 -291
- package/scripts/benchmark-background-check-overlap.ts +228 -0
- package/scripts/benchmark-mcp-host.sh +117 -0
- package/scripts/benchmark-mcp-transport.ts +170 -0
- package/scripts/benchmark-quality-harness.ts +146 -0
- package/scripts/benchmark-route-session-concurrency.ts +207 -6
- package/scripts/benchmark-thin-harness-mcp-e2e.ts +7 -1
- package/scripts/benchmark-typescript-navigation.ts +186 -0
- package/scripts/benchmark-work-efficiency.ts +334 -0
- package/scripts/capability-config.ts +2 -392
- package/scripts/capability-resolver.ts +2 -503
- package/scripts/capture-plan.sh +1 -332
- package/scripts/check-agent-tooling.sh +2 -1558
- package/scripts/check-architecture-sync.sh +2 -371
- package/scripts/check-brain-manifest.sh +2 -253
- package/scripts/check-context-files.sh +2 -47
- package/scripts/check-deploy-sql-order.sh +2 -115
- package/scripts/check-mcp-compatibility.ts +14 -0
- package/scripts/check-runtime-architecture.mjs +349 -79
- package/scripts/check-skill-version.ts +3 -191
- package/scripts/check-source-duplication.mjs +61 -0
- package/scripts/check-stable-baseline.ts +92 -0
- package/scripts/check-task-sync.sh +2 -63
- package/scripts/check-task-workflow.sh +2 -1000
- package/scripts/codex-handoff-resume.sh +2 -267
- package/scripts/context-contract-sync.sh +2 -514
- package/scripts/contract-run.ts +2 -463
- package/scripts/contract-worktree.sh +1 -722
- package/scripts/ensure-task-workflow.sh +1 -1225
- package/scripts/host-temporary-cloud-mcp-e2e.sh +265 -0
- package/scripts/inspect-project-state.ts +4 -279
- package/scripts/install-standalone-recovery.ts +24 -0
- package/scripts/lib/project-init-lib.sh +22 -46
- package/scripts/lib/run-forge-helper.sh +19 -0
- package/scripts/lib/run-forge-helper.ts +26 -0
- package/scripts/migrate-project-template.sh +1 -1189
- package/scripts/migrate-workflow-docs.ts +4 -412
- package/scripts/new-plan.sh +1 -180
- package/scripts/new-spec.sh +1 -47
- package/scripts/new-sprint.sh +1 -46
- package/scripts/plan-to-todo.sh +1 -796
- package/scripts/prepare-codex-handoff.sh +2 -201
- package/scripts/prepare-handoff.sh +1 -78
- package/scripts/refresh-current-status.sh +2 -467
- package/scripts/run-governed-gate.ts +5 -1
- package/scripts/select-agent-context-blocks.sh +2 -64
- package/scripts/ship-worktrees.sh +1 -558
- package/scripts/smoke-ios-physical-device.ts +4 -2
- package/scripts/smoke-runtime-recovery.ts +1 -35
- package/scripts/smoke-schedule-engine.ts +1 -20
- package/scripts/sprint-backlog.sh +1 -834
- package/scripts/stage-runtime-release.ts +2 -1
- package/scripts/summarize-failures.sh +2 -123
- package/scripts/switch-plan.sh +1 -150
- package/scripts/sync-brain-docs.sh +2 -379
- package/scripts/sync-generated-authority.mjs +175 -0
- package/scripts/verify-contract.sh +2 -703
- package/scripts/verify-forge-runtime.sh +0 -1
- package/scripts/verify-sprint.sh +1 -677
- package/scripts/workflow-contract.ts +4 -205
- package/scripts/workstream-sync.sh +2 -261
- package/src/cli/agent-jobs/executor-health.ts +1 -1
- package/src/cli/commands/init-hook.ts +3 -3
- package/src/cli/commands/mcp.ts +9 -5
- package/src/cli/commands/plugin.ts +12 -3
- package/src/cli/commands/recovery.ts +25 -3
- package/src/cli/commands/runtime.ts +55 -3
- package/src/cli/commands/security.ts +12 -1
- package/src/cli/commands/setup-profile.ts +31 -21
- package/src/cli/controller/check-runner.ts +113 -5
- package/src/cli/controller/composite-result.ts +1 -1
- package/src/cli/controller/context/focus.ts +51 -0
- package/src/cli/controller/context/instruction-context.ts +114 -0
- package/src/cli/controller/context/known-paths.ts +76 -0
- package/src/cli/controller/context/query-planning.ts +110 -0
- package/src/cli/controller/context/rule-resolution.ts +532 -0
- package/src/cli/controller/context/source-materializer.ts +278 -0
- package/src/cli/controller/context/structural.ts +16 -0
- package/src/cli/controller/context/types.ts +286 -0
- package/src/cli/controller/context-pack.ts +828 -487
- package/src/cli/controller/launch-agents.ts +77 -2
- package/src/cli/controller/operational-plan.ts +2 -2
- package/src/cli/controller/work-mode.ts +6 -4
- package/src/cli/editing/edit-session.ts +60 -7
- package/src/cli/github/contracts.ts +16 -0
- package/src/cli/github/github.ts +135 -16
- package/src/cli/github/session.ts +2 -1
- package/src/cli/installer/managed-entries.ts +15 -1
- package/src/cli/local-bridge/console-automations.ts +54 -78
- package/src/cli/local-bridge/console-view-models.ts +1 -35
- package/src/cli/local-bridge/facade-api.ts +37 -264
- package/src/cli/local-bridge/frontend/src/App.tsx +3 -3
- package/src/cli/local-bridge/frontend/src/features/automations/AutomationsView.tsx +23 -13
- package/src/cli/local-bridge/frontend/src/features/capabilities/CapabilitiesView.tsx +37 -4
- package/src/cli/local-bridge/frontend/src/features/overview/OverviewView.tsx +6 -4
- package/src/cli/local-bridge/frontend/src/lib/api.ts +1 -6
- package/src/cli/local-bridge/frontend/src/lib/routes.ts +1 -1
- package/src/cli/local-bridge/frontend/src/shell/Sidebar.tsx +2 -2
- package/src/cli/local-bridge/frontend/src/styles.css +1 -1
- package/src/cli/local-bridge/frontend/src/types.ts +5 -8
- package/src/cli/local-bridge/job-store.ts +1 -490
- package/src/cli/local-bridge/server.ts +2 -515
- package/src/cli/local-bridge/ui-dist/app.css +1 -1
- package/src/cli/local-bridge/ui-dist/app.js +3703 -3757
- package/src/cli/mcp/auth.ts +5 -5
- package/src/cli/mcp/instructions.ts +3 -2
- package/src/cli/mcp/legacy-tool-service.ts +10 -222
- package/src/cli/mcp/multi-repository.ts +16 -5
- package/src/cli/mcp/oauth.ts +175 -26
- package/src/cli/mcp/post-finalize-work-attribution.ts +150 -0
- package/src/cli/mcp/repository-tools.ts +282 -146
- package/src/cli/mcp/server.ts +586 -116
- package/src/cli/mcp/tool-capability-cache.ts +1 -1
- package/src/cli/mcp/tool-contract.ts +14 -0
- package/src/cli/mcp/toolset-selection.ts +1 -1
- package/src/cli/mcp/toolset.ts +44 -7
- package/src/cli/mcp/transports/http.ts +124 -14
- package/src/cli/mcp/transports/session-registry.ts +43 -5
- package/src/cli/mcp/types.ts +3 -3
- package/src/cli/repositories/command-classifier.ts +103 -21
- package/src/cli/repositories/command-executor.ts +78 -526
- package/src/cli/repositories/command-process.ts +108 -0
- package/src/cli/repositories/command-scope.ts +99 -41
- package/src/cli/repositories/controller-home.ts +7 -8
- package/src/cli/repositories/git-command-executor.ts +2 -0
- package/src/cli/repositories/locks.ts +53 -16
- package/src/cli/repositories/repository-snapshot.ts +124 -0
- package/src/cli/repositories/selected-path-actions.ts +17 -9
- package/src/cli/repositories/structured-git.ts +118 -6
- package/src/cli/repository/inspector.ts +563 -65
- package/src/cli/repository/session-cache.ts +58 -17
- package/src/cli/v81-entry.ts +1 -4
- package/src/effects/fs-transaction.ts +85 -17
- package/src/runtime/context/codegraph-read-provider.ts +233 -2
- package/src/runtime/context/codegraph-sidecar.cjs +74 -40
- package/src/runtime/context/generic-lsp-provider.ts +355 -0
- package/src/runtime/context/lsp-client.ts +283 -0
- package/src/runtime/context/semantic-navigation-contract.ts +61 -0
- package/src/runtime/context/semantic-navigation.ts +223 -0
- package/src/runtime/context/swift-navigation.ts +565 -0
- package/src/runtime/context/typescript-navigation.ts +226 -0
- package/src/runtime/control-plane/dispatch-priority.ts +28 -0
- package/src/runtime/control-plane/execution/direct-edit-work-completion.ts +48 -16
- package/src/runtime/control-plane/execution/edit-validation-coordinator.ts +86 -24
- package/src/runtime/control-plane/execution/repository-work-attribution.ts +106 -0
- package/src/runtime/control-plane/execution/retained-work-resume.ts +203 -0
- package/src/runtime/control-plane/execution/session-store.ts +18 -0
- package/src/runtime/control-plane/execution/verification-evidence.ts +58 -3
- package/src/runtime/control-plane/execution/work-completion-authority.ts +58 -0
- package/src/runtime/control-plane/execution/work-evidence-policy.ts +200 -0
- package/src/runtime/control-plane/execution/work-execution-support.ts +386 -0
- package/src/runtime/control-plane/execution/work-finalization-service.ts +1913 -0
- package/src/runtime/control-plane/execution/work-handle-authority.ts +96 -0
- package/src/runtime/control-plane/execution/work-handle-store.ts +27 -2
- package/src/runtime/control-plane/execution/work-lifecycle-audit.ts +258 -0
- package/src/runtime/control-plane/execution/work-operation-service.ts +468 -0
- package/src/runtime/control-plane/execution/work-path-scope.ts +37 -0
- package/src/runtime/control-plane/execution/work-preparation-service.ts +479 -0
- package/src/runtime/control-plane/execution/work-process-evidence.ts +129 -0
- package/src/runtime/control-plane/execution/work-remote-delivery.ts +215 -0
- package/src/runtime/control-plane/execution/work-task-receipt.ts +22 -18
- package/src/runtime/control-plane/execution/work-terminal-cleanup.ts +156 -11
- package/src/runtime/control-plane/execution/work-validation-reconciler.ts +22 -14
- package/src/runtime/control-plane/execution/work-verification-context.ts +56 -0
- package/src/runtime/control-plane/execution/work-verification-service.ts +388 -0
- package/src/runtime/control-plane/execution/work-verification-snapshot.ts +90 -9
- package/src/runtime/control-plane/facade/capability-registry.ts +129 -25
- package/src/runtime/control-plane/facade/controller-round-relay.ts +1118 -0
- package/src/runtime/control-plane/facade/controller-session-store.ts +302 -12
- package/src/runtime/control-plane/facade/goal-workloop-access.ts +17 -1
- package/src/runtime/control-plane/facade/goal-workloop.ts +928 -190
- package/src/runtime/control-plane/facade/index.ts +3 -0
- package/src/runtime/control-plane/facade/plan-contract-store.ts +275 -42
- package/src/runtime/control-plane/facade/repository-work-admission.ts +147 -0
- package/src/runtime/control-plane/facade/requirement-authority.ts +83 -0
- package/src/runtime/control-plane/facade/semantic-admission.ts +205 -0
- package/src/runtime/control-plane/facade/suggested-actions.ts +5 -1
- package/src/runtime/control-plane/facade/types.ts +90 -10
- package/src/runtime/control-plane/facade/work-contract-store.ts +157 -261
- package/src/runtime/control-plane/facade/work-state-machine.ts +250 -0
- package/src/runtime/control-plane/generated-cache-retention.ts +271 -0
- package/src/runtime/control-plane/global-scheduler/config.ts +44 -0
- package/src/runtime/control-plane/global-scheduler/dispatch-capacity.ts +80 -0
- package/src/runtime/control-plane/global-scheduler/durable-admission.ts +46 -0
- package/src/runtime/control-plane/global-scheduler/maintenance.ts +152 -0
- package/src/runtime/control-plane/global-scheduler/projection-refresh.ts +84 -0
- package/src/runtime/control-plane/global-scheduler/reconciliation.ts +3 -3
- package/src/runtime/control-plane/global-scheduler/scheduler.ts +278 -543
- package/src/runtime/control-plane/global-scheduler/source-scan.ts +59 -0
- package/src/runtime/control-plane/global-scheduler/state.ts +88 -0
- package/src/runtime/control-plane/global-scheduler/worker-attachment.ts +57 -0
- package/src/runtime/control-plane/global-scheduler/worker-exit-decision.ts +38 -0
- package/src/runtime/control-plane/global-scheduler/worker-exit-reconciler.ts +175 -0
- package/src/runtime/control-plane/global-scheduler/worker-launch.ts +111 -0
- package/src/runtime/control-plane/global-scheduler/worker-lifecycle-store.ts +64 -0
- package/src/runtime/control-plane/global-scheduler/worker-lifecycle.ts +150 -0
- package/src/runtime/control-plane/global-scheduler/worker-process.ts +119 -0
- package/src/runtime/control-plane/global-scheduler/worker-stderr.ts +60 -0
- package/src/runtime/control-plane/launcher/chatgpt-work-binding-store.ts +63 -0
- package/src/runtime/control-plane/launcher/chatgpt-work-continuation.ts +365 -117
- package/src/runtime/control-plane/launcher/launch-reservation-store.ts +89 -0
- package/src/runtime/control-plane/launcher/thin-launcher.ts +244 -11
- package/src/runtime/control-plane/persistence/controller-home-migration.ts +487 -0
- package/src/runtime/control-plane/persistence/requirement-store.ts +0 -12
- package/src/runtime/control-plane/persistence/sqlite-store.ts +33 -2
- package/src/runtime/control-plane/release-retention.ts +62 -2
- package/src/runtime/control-plane/repo-actor/registry.ts +4 -2
- package/src/runtime/control-plane/routing/route-policy.ts +24 -21
- package/src/runtime/control-plane/routing/workspace-admission.ts +70 -0
- package/src/runtime/control-plane/runtime-status-client.ts +0 -2
- package/src/runtime/diagnostics/mcp-timing.ts +13 -0
- package/src/runtime/diagnostics/mcp-transport-benchmark.ts +129 -0
- package/src/runtime/diagnostics/performance.ts +24 -1
- package/src/runtime/evidence/event-ledger.ts +1 -1
- package/src/runtime/evidence/process-check-execution.ts +18 -0
- package/src/runtime/execution/jobs/child-reference.ts +6 -2
- package/src/runtime/execution/jobs/store.ts +58 -4
- package/src/runtime/execution/jobs/types.ts +1 -1
- package/src/runtime/execution/managed-workspace.ts +203 -1
- package/src/runtime/execution/process-runtime/check-facade.ts +51 -4
- package/src/runtime/execution/process-runtime/check-result.ts +88 -0
- package/src/runtime/execution/process-runtime/check-runner-sidecar.ts +7 -1
- package/src/runtime/execution/process-runtime/check-scheduling.ts +114 -0
- package/src/runtime/execution/process-runtime/command-facade.ts +367 -40
- package/src/runtime/execution/process-runtime/gc.ts +38 -6
- package/src/runtime/execution/process-runtime/lightweight-managed.ts +1201 -0
- package/src/runtime/execution/process-runtime/persisted-check.ts +51 -5
- package/src/runtime/execution/process-runtime/resource-claims.ts +10 -6
- package/src/runtime/execution/process-runtime/runtime.ts +53 -3
- package/src/runtime/execution/process-runtime/store.ts +1 -0
- package/src/runtime/execution/process-runtime/types.ts +4 -12
- package/src/runtime/execution/thin-harness/async-process.ts +12 -2
- package/src/runtime/execution/thin-harness/search-worker.ts +54 -5
- package/src/runtime/execution/work-activity.ts +21 -0
- package/src/runtime/execution/workers/executor.ts +18 -61
- package/src/runtime/gateway/mcp/execution-tools.ts +35 -1852
- package/src/runtime/gateway/mcp/legacy-ios-tool-adapter.ts +61 -0
- package/src/runtime/gateway/mcp/process-tools.ts +83 -37
- package/src/runtime/gateway/mcp/router.ts +186 -84
- package/src/runtime/gateway/mcp/runtime-tool-definitions.ts +565 -0
- package/src/runtime/gateway/mcp/runtime-tools.ts +2378 -1947
- package/src/runtime/plugins/app-store-connect-adapter.ts +216 -47
- package/src/runtime/plugins/browser-adapter.ts +2662 -829
- package/src/runtime/plugins/browser-automation-service.ts +10 -0
- package/src/runtime/plugins/browser-handoff-host.ts +2 -25
- package/src/runtime/plugins/browser-handoff.ts +110 -5
- package/src/runtime/plugins/browser-macos-bridge.ts +701 -63
- package/src/runtime/plugins/browser-manifest-surface.ts +603 -0
- package/src/runtime/plugins/browser-native-session-service.ts +222 -0
- package/src/runtime/plugins/browser-node-bridge.ts +6 -34
- package/src/runtime/plugins/browser-provider-registry.ts +109 -0
- package/src/runtime/plugins/browser-runtime-contract.ts +154 -0
- package/src/runtime/plugins/browser-runtime.ts +193 -0
- package/src/runtime/plugins/browser-session-authority.ts +332 -0
- package/src/runtime/plugins/browser-session-store.ts +121 -0
- package/src/runtime/plugins/browser-session-types.ts +98 -0
- package/src/runtime/plugins/capability-authorization-grants.ts +354 -0
- package/src/runtime/plugins/desktop-operator-registration.ts +10 -4
- package/src/runtime/plugins/external-adapter.ts +358 -3
- package/src/runtime/plugins/external-unix-socket.ts +7 -1
- package/src/runtime/plugins/first-party-registry.ts +2 -0
- package/src/runtime/plugins/github-adapter.ts +125 -0
- package/src/runtime/plugins/ios/agent-device-provider.ts +1 -1
- package/src/runtime/plugins/ios/agent-device-typed-provider.ts +52 -9
- package/src/runtime/plugins/ios/remote-xpc-hid.ts +1171 -0
- package/src/runtime/plugins/ios-adapter.ts +106 -16
- package/src/runtime/plugins/ios-agent-device.ts +234 -64
- package/src/runtime/plugins/ios-physical-device.ts +1143 -392
- package/src/runtime/plugins/lightweight-action.ts +153 -0
- package/src/runtime/plugins/local-system-adapter.ts +123 -6
- package/src/runtime/plugins/macos-capability-broker.ts +47 -9
- package/src/runtime/plugins/plugin-action-sidecar.ts +59 -0
- package/src/runtime/plugins/plugin-management-adapter.ts +49 -8
- package/src/runtime/plugins/resend-adapter.ts +1 -1
- package/src/runtime/plugins/store.ts +330 -33
- package/src/runtime/plugins/types.ts +38 -3
- package/src/runtime/plugins/xiaohongshu-publish.ts +515 -0
- package/src/runtime/projections/git-status-sampler.ts +16 -16
- package/src/runtime/projections/materialized-view.ts +28 -10
- package/src/runtime/recovery/maintenance-executor.ts +426 -25
- package/src/runtime/root/mcp-transport.ts +180 -10
- package/src/runtime/root/package-connector-service.ts +230 -10
- package/src/runtime/root/package-runtime-release.ts +143 -17
- package/src/runtime/root/package-runtime-service.ts +461 -22
- package/src/runtime/root/release-manifest.ts +144 -18
- package/src/runtime/root/release-materialize.ts +125 -32
- package/src/runtime/root/release-store.ts +48 -11
- package/src/runtime/root/runtime.ts +23 -5
- package/src/runtime/root/service.ts +100 -29
- package/src/runtime/root/types.ts +12 -0
- package/src/runtime/safe-tooling/ios-development.ts +321 -63
- package/src/runtime/shared/trusted-executable.ts +62 -0
- package/src/runtime/shared/trusted-node-executable.ts +48 -0
- package/src/runtime/standalone-recovery/core.ts +1079 -240
- package/src/runtime/standalone-recovery/entry.ts +100 -24
- package/src/runtime/standalone-recovery/installer.ts +20 -4
- package/src/runtime/standalone-recovery/service-labels.ts +2 -0
- package/src/runtime/standalone-recovery/watchdog-heartbeat.ts +160 -0
- package/src/runtime/workflow/schedules/browser-probe.ts +81 -3
- package/src/runtime/workflow/schedules/engine.ts +364 -202
- package/src/runtime/workflow/schedules/github-issue-watch.ts +158 -0
- package/src/runtime/workflow/schedules/settlement.ts +64 -17
- package/src/runtime/workflow/schedules/store.ts +209 -19
- package/src/runtime/workflow/schedules/types.ts +2 -4
- package/src/runtime/workflow/schedules/work-continuation.ts +26 -13
- package/src/testing/test-governance.ts +8 -40
- package/assets/reference-configs/heartbeat-triage.md +0 -57
- package/assets/templates/helpers/harness-trace-grade.sh +0 -150
- package/assets/templates/helpers/heartbeat-triage.sh +0 -361
- package/assets/templates/helpers/maintenance-triage.sh +0 -167
- package/docs/architecture/current/approved-target-architecture.zh-CN.md +0 -1501
- package/docs/architecture/current/architecture-invariants.md +0 -331
- package/docs/architecture/current/automation-and-schedule-engine.md +0 -459
- package/docs/architecture/current/codegraph-context-provider.md +0 -238
- package/docs/architecture/current/control-plane-authority-inventory.md +0 -94
- package/docs/architecture/current/controller-repository-decoupling.md +0 -148
- package/docs/architecture/current/dispatch-and-agent-strategy.md +0 -373
- package/docs/architecture/current/entity-model.md +0 -612
- package/docs/architecture/current/external-plugin-governance.md +0 -396
- package/docs/architecture/current/failure-recovery.md +0 -447
- package/docs/architecture/current/governance.md +0 -213
- package/docs/architecture/current/human-interaction-plane.md +0 -87
- package/docs/architecture/current/implementation-status.md +0 -128
- package/docs/architecture/current/job-and-run-lifecycle.md +0 -413
- package/docs/architecture/current/legacy-governance.md +0 -58
- package/docs/architecture/current/local-workspace-target-grants.md +0 -70
- package/docs/architecture/current/migration-roadmap.md +0 -105
- package/docs/architecture/current/multi-repository-execution.md +0 -371
- package/docs/architecture/current/operations-runbook.md +0 -45
- package/docs/architecture/current/peer-supercontroller-runtime.md +0 -32
- package/docs/architecture/current/personal-assistant-plugin-baseline.md +0 -206
- package/docs/architecture/current/repository-access-modes.md +0 -102
- package/docs/architecture/current/route-policy.md +0 -15
- package/docs/architecture/current/route-session-concurrency.md +0 -85
- package/docs/architecture/current/runtime-architecture-simplification.md +0 -214
- package/docs/architecture/current/runtime-directory-map.md +0 -49
- package/docs/architecture/current/runtime-health-and-resource-lifecycle.md +0 -85
- package/docs/architecture/current/scheduler-and-resource-claims.md +0 -422
- package/docs/architecture/current/session-aware-execution-and-authorization.md +0 -77
- package/docs/architecture/current/system-overview.md +0 -169
- package/docs/architecture/current/target-requirements-traceability.md +0 -202
- package/docs/architecture/current/thin-harness-governance-policy.md +0 -32
- package/docs/architecture/current/thin-harness-v1.md +0 -321
- package/docs/architecture/current/verification-and-release-gates.md +0 -391
- package/docs/forge-autonomous-goal-loop.md +0 -9
- package/docs/forge-provider-configuration.md +0 -7
- package/docs/operations/chatgpt-personal-assistant-runtime.md +0 -93
- package/docs/operations/gmail-assistant-routines.md +0 -186
- package/docs/operations/personal-assistant-operator-guide.md +0 -61
- package/docs/operations/provider-configuration.md +0 -31
- package/scripts/harness-trace-grade.sh +0 -150
- package/scripts/heartbeat-triage.sh +0 -361
- package/scripts/maintenance-triage.sh +0 -167
- package/src/cli/local-bridge/frontend/src/features/settings/SettingsView.tsx +0 -2
- package/src/cli/repositories/goal-registry.ts +0 -239
- package/src/runtime/assistant/action-proposals.ts +0 -279
- package/src/runtime/assistant/intent.ts +0 -395
- package/src/runtime/assistant/model-provider.ts +0 -460
- package/src/runtime/assistant/openapi.ts +0 -223
- package/src/runtime/assistant/policy.ts +0 -89
- package/src/runtime/assistant/readiness.ts +0 -258
- package/src/runtime/assistant/routine-runtime.ts +0 -477
- package/src/runtime/assistant/schedule-binding.ts +0 -171
- package/src/runtime/assistant/standing-grants.ts +0 -375
- package/src/runtime/assistant/store.ts +0 -243
- package/src/runtime/assistant/types.ts +0 -135
- package/src/runtime/control-plane/goal-loop/config-facade.ts +0 -700
- package/src/runtime/control-plane/goal-loop/config-store.ts +0 -570
- package/src/runtime/control-plane/goal-loop/config-types.ts +0 -213
- package/src/runtime/control-plane/goal-loop/executor-router.ts +0 -109
- package/src/runtime/control-plane/goal-loop/failure-taxonomy.ts +0 -149
- package/src/runtime/control-plane/goal-loop/goal-contract-store.ts +0 -304
- package/src/runtime/control-plane/goal-loop/goal-loop-engine.ts +0 -1001
- package/src/runtime/control-plane/goal-loop/handoff-packet.ts +0 -160
- package/src/runtime/control-plane/goal-loop/index.ts +0 -13
- package/src/runtime/control-plane/goal-loop/local-tools.ts +0 -290
- package/src/runtime/control-plane/goal-loop/policy-gates.ts +0 -203
- package/src/runtime/control-plane/goal-loop/provider-dispatch.ts +0 -93
- package/src/runtime/control-plane/goal-loop/provider-registry.ts +0 -545
- package/src/runtime/control-plane/goal-loop/types.ts +0 -378
- package/src/runtime/control-plane/startup-recovery.ts +0 -198
- package/src/runtime/gateway/mcp/resource-policy.ts +0 -186
- package/src/runtime/personal-assistant/gmail-triage-manager.ts +0 -231
- package/src/runtime/personal-assistant/reporting-runtime.ts +0 -344
- package/src/runtime/personal-assistant/triage-runtime.ts +0 -748
- package/src/runtime/workflow/findings/store.ts +0 -204
- package/src/runtime/workflow/findings/types.ts +0 -58
- package/src/runtime/workflow/portfolio/engine.ts +0 -20
- package/src/runtime/workflow/portfolio/store.ts +0 -185
- package/src/runtime/workflow/portfolio/types.ts +0 -29
package/docs/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Forge Documentation
|
|
2
2
|
|
|
3
|
-
> Maintained documentation for the current Forge product and runtime. Executable behavior and [`architecture/
|
|
3
|
+
> Maintained documentation for the current Forge product and runtime. Executable behavior and [`architecture/CURRENT.md`](architecture/CURRENT.md) are authoritative for implementation facts and architecture contracts; historical notes are context, not active contracts.
|
|
4
4
|
|
|
5
5
|
[中文文档中心](README.zh-CN.md) · [GitHub](https://github.com/moretea-labs/forge) · [Releases](https://github.com/moretea-labs/forge/releases) · [Support](../SUPPORT.md)
|
|
6
6
|
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
| Install Forge | [Install and start](tutorials/01-install-and-start.md) | [Platform support](operations/platform-support.md) |
|
|
12
12
|
| Connect ChatGPT | [Connect ChatGPT](tutorials/02-connect-chatgpt.md) | [MCP setup](forge-chatgpt-mcp-setup.md) |
|
|
13
13
|
| Complete a first task | [First repository task](tutorials/03-first-repository-task.md) | [Public usage guide](public-usage-guide.md) |
|
|
14
|
-
| Install an official provider | [Plugin management](forge-plugin-management.md) | [
|
|
15
|
-
| Understand Forge | [
|
|
14
|
+
| Install an official provider | [Plugin management](forge-plugin-management.md) | [Plugin management](forge-plugin-management.md) |
|
|
15
|
+
| Understand Forge | [Current architecture](architecture/CURRENT.md) | [Roadmap](ROADMAP.md) |
|
|
16
16
|
| Operate or recover | [Operations](wiki/Operations.md) | [Troubleshooting](operations/troubleshooting.md) |
|
|
17
17
|
| Contribute or release | [Contributing](../CONTRIBUTING.md) | [Release process](operations/releasing.md) |
|
|
18
18
|
|
|
@@ -31,15 +31,14 @@ Forge is Direct-first: investigation does not create durable Work by itself, and
|
|
|
31
31
|
- [Platform support](operations/platform-support.md)
|
|
32
32
|
|
|
33
33
|
### Understand
|
|
34
|
+
- [Current architecture](architecture/CURRENT.md)
|
|
35
|
+
- [Roadmap](ROADMAP.md)
|
|
36
|
+
- [Architecture evolution](architecture/EVOLUTION.md)
|
|
37
|
+
- [Version architecture snapshots](architecture/versions/)
|
|
34
38
|
- [Core Concepts](wiki/Core-Concepts.md)
|
|
35
|
-
- [Architecture](wiki/Architecture.md)
|
|
36
|
-
- [Runtime Architecture](wiki/Runtime-Architecture.md)
|
|
37
|
-
- [Work Lifecycle](wiki/Work-Lifecycle.md)
|
|
38
|
-
- [Implementation map](wiki/Implementation.md)
|
|
39
39
|
|
|
40
40
|
### Integrate
|
|
41
41
|
- [Plugin management](forge-plugin-management.md)
|
|
42
|
-
- [Provider configuration](operations/provider-configuration.md)
|
|
43
42
|
- [Browser provider](operations/controller-browser-plugin.md)
|
|
44
43
|
- [Desktop provider](operations/controller-desktop-plugin.md)
|
|
45
44
|
- [Local system assistant](operations/local-system-assistant.md)
|
|
@@ -53,9 +52,10 @@ Forge is Direct-first: investigation does not create durable Work by itself, and
|
|
|
53
52
|
- [Standalone disaster recovery](operations/standalone-disaster-recovery.md)
|
|
54
53
|
|
|
55
54
|
### Maintain
|
|
55
|
+
- [Roadmap](ROADMAP.md)
|
|
56
|
+
- [Release changelog](../CHANGELOG.md)
|
|
56
57
|
- [Release process](operations/releasing.md)
|
|
57
58
|
- [Open-source release hygiene](operations/open-source-release-hygiene.md)
|
|
58
|
-
- [GitHub repository baseline](operations/github-repository.md)
|
|
59
59
|
- [Versioning](versioning.md)
|
|
60
60
|
- [Security policy](../SECURITY.md)
|
|
61
61
|
|
|
@@ -69,4 +69,4 @@ Forge is Direct-first: investigation does not create durable Work by itself, and
|
|
|
69
69
|
|
|
70
70
|
## Authority and history
|
|
71
71
|
|
|
72
|
-
Current architecture lives in [`architecture/
|
|
72
|
+
Current architecture lives only in [`architecture/CURRENT.md`](architecture/CURRENT.md). [`ROADMAP.md`](ROADMAP.md) records current priorities, [`architecture/EVOLUTION.md`](architecture/EVOLUTION.md) records architecture history, and [`architecture/versions/`](architecture/versions/) stores release-family snapshots. Research notes and task records are evidence, not current contracts.
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
# Forge Current Architecture
|
|
2
|
+
|
|
3
|
+
Status: **Runtime Authority**
|
|
4
|
+
|
|
5
|
+
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
|
+
|
|
7
|
+
## Product model
|
|
8
|
+
|
|
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.
|
|
10
|
+
|
|
11
|
+
```text
|
|
12
|
+
Semantic Controller
|
|
13
|
+
-> Context Engine
|
|
14
|
+
-> Thin Execution Harness
|
|
15
|
+
-> Verification / Evidence
|
|
16
|
+
-> Optional Durable Workflow / External Effect boundary
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Quality is prioritized over interactive performance; performance is prioritized over durability machinery that does not materially improve ordinary coding.
|
|
20
|
+
|
|
21
|
+
## Controller efficiency contract
|
|
22
|
+
|
|
23
|
+
- 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.
|
|
24
|
+
- Forge may execute deterministic conditionals such as `check failed -> collect bounded diagnostics and failure-site source`; it must stop before semantic actions such as choosing a repair, widening product scope, or deciding that acceptance is satisfied.
|
|
25
|
+
- Controller turns should stay continuous through a coherent implementation slice. External Controller relay is for real continuity boundaries such as scheduling, long waits, context/session rollover, or unattended resumption, not a normal inner-loop coding primitive.
|
|
26
|
+
- Operational output is aggressively bounded, while source/diagnostic evidence may use a larger information budget when that reduces repeated controller round trips. Every evidence bundle remains source/revision identified and reports truncation or coverage gaps rather than claiming semantic completeness.
|
|
27
|
+
- ChatGPT-native perception/compute capabilities are not copied into Forge merely to centralize tools. Web/Vision/one-shot connector perception may stay controller-native; Forge owns the local or durable execution/evidence boundary. A separate ChatGPT sandbox is never repository source or build authority.
|
|
28
|
+
|
|
29
|
+
## Context engine
|
|
30
|
+
|
|
31
|
+
- `rh_context` is the primary discovery/read path and may be called repeatedly.
|
|
32
|
+
- For exact or selected source paths, `rh_context` resolves applicable repository guidance by walking only that path's bounded directory ancestry from repository root to the nearest directory and returning present `AGENTS.md` / `CLAUDE.md` files in `instructionContext`. These files are guidance-only evidence: they do not consume the source `max_files` budget, define semantic scope, or become lifecycle/architecture authority. Missing optional guidance files are normal; policy denial, read failure, or bounded truncation stays visible as a coverage gap.
|
|
33
|
+
- 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
|
+
- 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
|
+
- 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.
|
|
37
|
+
- CodeGraph is discovery/relationship evidence, not semantic-completeness authority. Stale structural evidence must be labeled and current changed files remain raw-source authoritative.
|
|
38
|
+
- 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.
|
|
40
|
+
- 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
|
+
|
|
42
|
+
## Execution lanes
|
|
43
|
+
|
|
44
|
+
### Ephemeral Direct — default
|
|
45
|
+
|
|
46
|
+
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.
|
|
47
|
+
|
|
48
|
+
### Lightweight Managed
|
|
49
|
+
|
|
50
|
+
Commands that outlive the interactive admission window may expose an in-memory/lightweight process handle with bounded logs and wait/cancel/status. This lane does not require durable Process records, recovery membership, or Lease ownership merely to remain queryable during the current Runtime lifetime.
|
|
51
|
+
|
|
52
|
+
### Durable Workflow / Process
|
|
53
|
+
|
|
54
|
+
Persistent Work/Process state is reserved for actual continuity requirements: scheduled workflows, multi-session continuation, independent deliverables, explicit recoverability, long asynchronous workflows, release boundaries, or multi-controller coordination.
|
|
55
|
+
|
|
56
|
+
### External effects
|
|
57
|
+
|
|
58
|
+
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
|
+
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.
|
|
60
|
+
|
|
61
|
+
## Work and Plan
|
|
62
|
+
|
|
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.
|
|
64
|
+
|
|
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.
|
|
66
|
+
|
|
67
|
+
### Persistent autonomous continuation
|
|
68
|
+
|
|
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:
|
|
70
|
+
|
|
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.
|
|
78
|
+
|
|
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.
|
|
80
|
+
|
|
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.
|
|
82
|
+
|
|
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.
|
|
84
|
+
|
|
85
|
+
## State ownership
|
|
86
|
+
|
|
87
|
+
- Git/worktree owns repository source truth.
|
|
88
|
+
- Edit Session owns one deterministic local patch transaction and reviewable diff evidence.
|
|
89
|
+
- Lightweight process handles own only current-runtime attach state.
|
|
90
|
+
- Validation results own check evidence for the exact inputs they verified.
|
|
91
|
+
- Work owns durable continuity only when continuity is actually required.
|
|
92
|
+
- 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.
|
|
94
|
+
- 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.
|
|
97
|
+
- 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
|
+
- 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.
|
|
100
|
+
|
|
101
|
+
## Runtime and MCP boundary
|
|
102
|
+
|
|
103
|
+
- Canonical Runtime is activated as one immutable whole release with a previous release retained for rollback.
|
|
104
|
+
- Runtime availability/recovery keeps Forge itself healthy; it does not imply exactly-once crash recovery for every local shell command.
|
|
105
|
+
- The default Controller MCP schema is the stable **19-tool** surface.
|
|
106
|
+
- `core` and `advanced` expose that same stable surface.
|
|
107
|
+
- `toolset=full` is an explicit compatibility profile and may contain historical definitions; current default schema construction must not depend on those legacy definitions.
|
|
108
|
+
- 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`.
|
|
110
|
+
|
|
111
|
+
### Controller facade and handoff boundary
|
|
112
|
+
|
|
113
|
+
- The stable Controller-facing facade is `rh_access`, `rh_status`, `rh_inbox`, `rh_context`, and `rh_work`. Internal repository, controller, evidence, maintenance, and plugin capabilities may grow behind the capability registry without creating another top-level tool for each feature.
|
|
114
|
+
- Handoff Inbox state is durable decision state for blocked or review-needed Controller judgement. It is not a log sink and must not become a second Requirement, Plan, Work, or Process lifecycle.
|
|
115
|
+
- Facade results are bounded summaries plus evidence references. Forge may report policy, verification, lifecycle, and capability facts; semantic acceptance and the decision to continue remain Controller-owned.
|
|
116
|
+
|
|
117
|
+
### Host hook boundary
|
|
118
|
+
|
|
119
|
+
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
|
+
|
|
121
|
+
## Provider boundary
|
|
122
|
+
|
|
123
|
+
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
|
+
|
|
125
|
+
### iOS physical-device boundary
|
|
126
|
+
|
|
127
|
+
- `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.
|
|
128
|
+
- Agent-device readiness is capability-negotiated from a reviewed version/help contract and a stable contract fingerprint. A preferred version is support guidance rather than authority; unsupported or unreviewed pre-1.0 contracts fail closed instead of guessing flags or semantic support.
|
|
129
|
+
- Application adapters own app-specific semantic targeting and assertions; provider code owns transport, device/session lifecycle, and command execution. Semantic action failure is distinct from transport/session death, and unknown mutation outcomes are fenced rather than blindly replayed.
|
|
130
|
+
- iOS evidence is bounded and redacted. Read-only lifecycle/screenshot capability must never be represented as proof of semantic mutation capability.
|
|
131
|
+
|
|
132
|
+
## Browser Runtime V3 contract
|
|
133
|
+
|
|
134
|
+
Browser Runtime V3 is the current Browser execution authority. Controller-home BrowserSession state is the sole durable browser-session authority; stable provider/resource identity is distinct from mutable observed URL/title, and provider-local live handles are acceleration state only. The accepted Browser Runtime V2 ADR remains historical rationale rather than a competing current authority.
|
|
135
|
+
|
|
136
|
+
Browser providers are selected by declared capability. Common DOM and typed browser-internal operations must remain background-safe. Native macOS sessions reuse or recover only exact Forge-owned `windowId` + `tabId` identities. Provider-wide tab inventory is an optional optimization: when the installed broker cannot enumerate tabs, Forge may create a new plugin-owned tab or validate a saved exact ref, but it must not scan for or guess an unrelated user tab.
|
|
137
|
+
|
|
138
|
+
Foreground presentation is an explicit effect reserved for capabilities that truly require physical pointer/keyboard input or human handoff. Browser `trusted_input` never silently activates a background tab or converts CSS viewport coordinates into desktop coordinates. If the native broker lacks the required trusted-input capability, Browser fails with a typed capability error; an explicitly requested Desktop Operator foreground/physical action remains a separate authority boundary. Mutating provider actions are complete only when their declared postconditions are verified; transport, Apple Events, Accessibility, socket, or CGEvent success alone is not semantic completion.
|
|
139
|
+
|
|
140
|
+
The public Browser action surface remains compatible across Playwright/CDP/native providers. Current native compatibility may omit optional broker methods such as global tab inventory while preserving exact-ref lifecycle safety. DOM automation through Chrome/Vivaldi Apple Events still requires the browser's JavaScript-from-Apple-Events permission; missing permission fails closed instead of weakening the provider contract. Browser replay safety is derived from the Browser Runtime transaction contract rather than an adapter-local action allowlist, and native session liveness/reconciliation is centralized outside the plugin composition root. A human-handoff host may persist its own InteractionSession result, but BrowserSession mutation returns to the canonical Runtime authority.
|
|
141
|
+
|
|
142
|
+
## Testing and verification
|
|
143
|
+
|
|
144
|
+
Tests are verification evidence, not an alternate architecture authority.
|
|
145
|
+
|
|
146
|
+
- Development/task gate: typecheck + static architecture + generated-authority drift + source-duplication classification + controller-UI reproduction + manifest validity + affected tests.
|
|
147
|
+
- Main candidate: task gate + core regression + Runtime smoke.
|
|
148
|
+
- Release candidate: main gate + full regression + release packaging/readiness.
|
|
149
|
+
- Static architecture additionally requires the production `src/**/*.ts` relative-import graph to be acyclic. Neutral contracts may break dependency direction; dynamic imports must not be used merely to conceal a static architecture cycle.
|
|
150
|
+
- Source-duplication governance permits only classified distribution/template projections, guidance aliases, and placeholders; unclassified exact duplicates fail the gate. Generated copies may exist for packaging, but manual implementation duplication is not an accepted source-authoring model.
|
|
151
|
+
- Test governance validates registration, resource classification, selection and execution isolation; it does not impose arbitrary global test-line or resource-count budgets.
|
|
152
|
+
- Prefer a small number of architectural invariants, focused module tests and essential integration/E2E coverage. Delete implementation-coupled or retired-compatibility tests when the underlying obligation is removed.
|
|
153
|
+
|
|
154
|
+
## Documentation authority
|
|
155
|
+
|
|
156
|
+
The maintained documentation surface is intentionally small:
|
|
157
|
+
|
|
158
|
+
- [`../README.md`](../README.md) — documentation entry.
|
|
159
|
+
- [`../ROADMAP.md`](../ROADMAP.md) — current/next priorities.
|
|
160
|
+
- `CURRENT.md` — sole maintained current architecture authority.
|
|
161
|
+
- [`index.md`](index.md) — architecture navigation and lifecycle rules.
|
|
162
|
+
- [`EVOLUTION.md`](EVOLUTION.md) — append-only architecture change log.
|
|
163
|
+
- [`decisions/`](decisions/) — accepted ADR rationale; once a rule is ordinary current architecture it is folded into `CURRENT.md` and the ADR remains historical rationale.
|
|
164
|
+
- [`versions/`](versions/) — architecture snapshot created at release/version boundaries.
|
|
165
|
+
- [`history/`](history/) and [`history.md`](history.md) — archived historical evidence and compatibility history, never runtime authority.
|
|
166
|
+
- [`../../CHANGELOG.md`](../../CHANGELOG.md) — release/user-visible change log.
|
|
167
|
+
|
|
168
|
+
Architecture-root Markdown is deliberately restricted to `CURRENT.md`, `EVOLUTION.md`, `history.md`, and `index.md`. A proposed architecture change belongs in a request/ADR or durable Plan/Work evidence until its accepted invariant is folded into `CURRENT.md`; do not create a parallel root-level "current design" page. Execution statuses such as phases, "implementation in progress", pending manual validation, operator-specific paths, and machine-local observations belong in Work/Plan/evidence or the history archive, not in maintained current architecture.
|
|
169
|
+
|
|
170
|
+
Research notes, tasks, reviews, archived architecture pages, plans and Git history are evidence/history only. They do not need to be synchronized on every source edit.
|
|
171
|
+
|
|
172
|
+
## Intentionally retained compatibility debt
|
|
173
|
+
|
|
174
|
+
- Explicit `toolset=full` remains a supported legacy compatibility boundary for now. Issue/Task/project-board writers are migration-only compatibility and are permanently retired after the SQLite requirement-portfolio cutover marker; they must not become a second current control plane.
|
|
175
|
+
- Some large runtime modules still aggregate multiple responsibilities and should be decomposed only when a clear ownership boundary is available.
|
|
176
|
+
- CodeGraph may be structurally stale between index refreshes; current raw source and changed-file overlays remain authoritative.
|
|
177
|
+
|
|
178
|
+
These items belong on the roadmap, not in parallel current-architecture documents.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Forge Architecture Evolution
|
|
2
|
+
|
|
3
|
+
Status: **Historical Design — Not Runtime Authority**
|
|
4
|
+
|
|
5
|
+
Append-only summary of why the architecture changed. The current contract is always [`CURRENT.md`](CURRENT.md); detailed superseded implementations remain available through Git history instead of parallel maintained architecture documents.
|
|
6
|
+
|
|
7
|
+
## 2026-08-18 — Quality-first executable harness
|
|
8
|
+
|
|
9
|
+
- Reframed Forge as an executable harness for the semantic controller rather than a lifecycle-heavy coding control plane.
|
|
10
|
+
- Made repository context progressive and repeatable; exact known paths receive reserved budget and source materialization prefers complete symbols/small files.
|
|
11
|
+
- Kept CodeGraph as discovery evidence while current raw source remains authoritative.
|
|
12
|
+
- Added an internal zero-dependency TypeScript Language Service navigation prototype and benchmarked real Forge refactors; compiler references found useful caller structure while exact lexical search still found unrelated same-name/registration paths.
|
|
13
|
+
- Moved ordinary shell wrappers and inline interpreters onto Lightweight/direct execution when high-level effect classification permits it.
|
|
14
|
+
- Removed dirty workspace, protected path and review intent as automatic Work triggers; Work remains for continuity/orchestration/external-effect needs.
|
|
15
|
+
- Retired hundreds of lines of unreachable Local Bridge execution/submission code instead of relocating it.
|
|
16
|
+
- Detached the default 19-tool Controller schema from the historical legacy tool-definition set; `toolset=full` remains explicit compatibility only.
|
|
17
|
+
- Simplified test governance: affected tests for development, core regression for main candidates, full regression for release candidates; removed arbitrary global test-line/resource-count budgets.
|
|
18
|
+
- Consolidated current architecture documentation into a single `CURRENT.md`, a single roadmap, this evolution log and per-version snapshots.
|
|
19
|
+
|
|
20
|
+
## 2026-08 — Canonical Runtime and thin public surface
|
|
21
|
+
|
|
22
|
+
- Converged Runtime activation on immutable whole releases with standalone recovery and exact release identity.
|
|
23
|
+
- Reduced the normal ChatGPT Connector surface to a bounded 19-tool schema and separated public Gateway concerns from Canonical Runtime execution.
|
|
24
|
+
- Moved ordinary repository actions toward direct/lightweight paths while retaining durable paths for explicit lifecycle requirements.
|
|
25
|
+
|
|
26
|
+
## Earlier Controller generations
|
|
27
|
+
|
|
28
|
+
Earlier V4–V8 Controller, Local Bridge, Supervisor, Issue/Task/Job and recovery designs are retained in Git history and accepted ADRs where still useful. They are not maintained as parallel current architecture authorities.
|
|
29
|
+
|
|
30
|
+
## 2026-08-26 — Documentation lifecycle governance
|
|
31
|
+
|
|
32
|
+
- Folded the still-current Controller facade/Handoff, host-hook ownership, and iOS physical-device provider invariants into `CURRENT.md` from current source rather than preserving old implementation plans as parallel authority.
|
|
33
|
+
- Retired root-level phase/status design pages into the history archive; accepted ADRs and version snapshots remain rationale/snapshots while `CURRENT.md` remains the sole current architecture contract.
|
|
34
|
+
- Added deterministic task-gate protection so new root-level parallel architecture pages and stale current-status/personal-machine identity markers fail existing static architecture verification instead of relying on a daemon or manual cleanup pass.
|
|
35
|
+
|
|
36
|
+
## 2026-08-27 — Browser Runtime V3 becomes current authority
|
|
37
|
+
|
|
38
|
+
- Promoted the Browser provider/resource transaction model from V2 migration rationale to the current V3 runtime contract while retaining one public Browser action surface.
|
|
39
|
+
- Kept controller-home BrowserSession state as the only durable browser-session authority and made exact native `windowId` + `tabId` identity authoritative across warm-handle invalidation and cold rebind.
|
|
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
|
+
- 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
|
+
- 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.
|
|
@@ -1,159 +1,7 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Legacy current-architecture path
|
|
2
2
|
|
|
3
|
-
> **
|
|
3
|
+
> **Historical compatibility path — Not Runtime Authority**
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
The maintained Forge architecture moved to [`../CURRENT.md`](../CURRENT.md).
|
|
6
6
|
|
|
7
|
-
This directory
|
|
8
|
-
|
|
9
|
-
Forge is designed as an **Agent Engineering Control Plane**:
|
|
10
|
-
|
|
11
|
-
```text
|
|
12
|
-
Thin Gateway
|
|
13
|
-
-> Global Control Plane
|
|
14
|
-
-> Per-Repository Actor
|
|
15
|
-
-> Durable Job Queue
|
|
16
|
-
-> Isolated Worker
|
|
17
|
-
-> Evidence Plane
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
The architecture is both technical and operational. It defines not only modules and processes, but also:
|
|
21
|
-
|
|
22
|
-
- who may decide;
|
|
23
|
-
- who may execute;
|
|
24
|
-
- how work is persisted and recovered;
|
|
25
|
-
- when tasks may run concurrently;
|
|
26
|
-
- what counts as a conflict;
|
|
27
|
-
- how multiple repositories share system resources;
|
|
28
|
-
- how scheduled work remains bounded;
|
|
29
|
-
- what evidence is required before completion or release.
|
|
30
|
-
|
|
31
|
-
## Authority Statement
|
|
32
|
-
|
|
33
|
-
The documents in this directory are the sole architecture authority for the current Controller Runtime.
|
|
34
|
-
|
|
35
|
-
The execution control-plane topology is implemented, but the lifecycle simplification described by `runtime-architecture-simplification.md` remains a target under migration. Normative documents must distinguish current behavior, approved target rules, and compatibility boundaries using these labels:
|
|
36
|
-
|
|
37
|
-
### Current Implementation
|
|
38
|
-
|
|
39
|
-
Verified behavior that exists in code, tests, persisted schemas, or observable runtime state.
|
|
40
|
-
|
|
41
|
-
Use this label only when a repository path or executable check can support the claim.
|
|
42
|
-
|
|
43
|
-
### Architecture Requirement
|
|
44
|
-
|
|
45
|
-
A non-negotiable behavior that current and future implementations must preserve. Runtime evidence is listed in `implementation-status.md`.
|
|
46
|
-
|
|
47
|
-
### Compatibility Rule
|
|
48
|
-
|
|
49
|
-
A rule that protects existing tools, stored state and callers while the runtime uses the new control-plane implementation.
|
|
50
|
-
|
|
51
|
-
## Reading Order
|
|
52
|
-
|
|
53
|
-
Read the architecture in this order:
|
|
54
|
-
|
|
55
|
-
1. `system-overview.md` — boundary, layers, and process topology.
|
|
56
|
-
2. `personal-assistant-plugin-baseline.md` — concrete assistant/plugin/GitHub/Gmail/Calendar boundary and migration baseline.
|
|
57
|
-
3. `architecture-invariants.md` — non-negotiable rules.
|
|
58
|
-
4. `entity-model.md` — durable entity meanings and ownership.
|
|
59
|
-
5. `job-and-run-lifecycle.md` — execution, retry, cancellation, and terminal-state semantics.
|
|
60
|
-
6. `dispatch-and-agent-strategy.md` — selection of Direct Edit, Quick Agent, durable Tasks, and Agent roles.
|
|
61
|
-
6a. `thin-harness-v1.md` — Fast Path router, typed batch, lightweight lanes, and durable escalation rules.
|
|
62
|
-
7. `scheduler-and-resource-claims.md` — repository actors, claims, leases, workspace conflicts, and integration queues.
|
|
63
|
-
8. `multi-repository-execution.md` — cross-repository quotas, fairness, DAGs, and failure isolation.
|
|
64
|
-
9. `automation-and-schedule-engine.md` — schedules, bounded occurrences, deduplication, budgets, and stop conditions.
|
|
65
|
-
10. `failure-recovery.md` — Gateway, Controller, Worker, orphan, stale, timeout, and reconciliation behavior.
|
|
66
|
-
11. `verification-and-release-gates.md` — exact-revision verification, acceptance, release freeze, and human authorization.
|
|
67
|
-
12. `implementation-status.md` — verified implementation coverage and compatibility boundaries.
|
|
68
|
-
13. `migration-roadmap.md` — completed execution-plane phases and the active lifecycle convergence record.
|
|
69
|
-
14. `runtime-architecture-simplification.md` — single-owner services, canonical authority/config, immutable activation, Recovery boundary, invariants, and deletion map.
|
|
70
|
-
15. `runtime-directory-map.md` — executable module boundaries.
|
|
71
|
-
16. `operations-runbook.md` — health, recovery and release operations.
|
|
72
|
-
17. `governance.md` — ownership, ADR, drift, and maintenance rules.
|
|
73
|
-
18. `session-aware-execution-and-authorization.md` — Session Context, Work Handle, Goal delegation, and resumable approval boundaries.
|
|
74
|
-
19. `runtime-health-and-resource-lifecycle.md` — shared health evaluation, projection freshness, capability status, attention/history, and bounded ownership-aware cleanup.
|
|
75
|
-
20. `runtime-architecture-simplification.md` — canonical single Runtime lifecycle, release and recovery boundary.
|
|
76
|
-
21. `human-interaction-plane.md` — foreground provider sessions, bounded human-interaction handoff, profile fencing, and safe resumption.
|
|
77
|
-
22. `control-plane-authority-inventory.md` — single-writer persistence families and frozen legacy writers.
|
|
78
|
-
23. `legacy-governance.md` — RepoHarness inheritance, session-continuation boundary, CLI governance, and deletion rules.
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
## Architecture Layers
|
|
82
|
-
|
|
83
|
-
The approved top-level layers are:
|
|
84
|
-
|
|
85
|
-
| Layer | Primary responsibility | Must not own |
|
|
86
|
-
| --- | --- | --- |
|
|
87
|
-
| Thin Gateway | Authentication, validation, routing, compact reads, durable command acceptance | Long execution, Agent lifetime, heavy checks |
|
|
88
|
-
| Global Control Plane | Repository registry, global quotas, portfolio scheduling | Repository-local workflow mutation |
|
|
89
|
-
| Per-Repository Actor | Repository-local ordering, claims, conflict decisions, integration and release coordination | Cross-repository global locks |
|
|
90
|
-
| Workflow Plane | Requirement, PlanStep, Work, Schedule, Occurrence intent and dependency state | Process lifetime and raw logs |
|
|
91
|
-
| Durable Execution Plane | Job acceptance, dispatch, Run attempts, commands, checks, workers | Product acceptance decisions |
|
|
92
|
-
| Workspace Plane | Workspace/worktree allocation, Git integration, resource leases | Business intent |
|
|
93
|
-
| Evidence Plane | Diffs, checks, logs, artifacts, verification and release evidence | Scheduling policy |
|
|
94
|
-
| Projection Plane | Compact snapshots, indexes, dashboard and MCP read models | Source-of-truth state mutation |
|
|
95
|
-
|
|
96
|
-
## Source-of-Truth Rules
|
|
97
|
-
|
|
98
|
-
- Migrated Requirement, ExecutionPlan/PlanStep, Work, dependency, receipt, validation, and approval lifecycle state is single-writer state in `<durable-controller-home>/control-plane.sqlite` as defined by `control-plane-authority-inventory.md`.
|
|
99
|
-
- Git owns source code and accepted source artifacts such as specs, design notes, and captured plans; those artifacts are not a second lifecycle writer after migration.
|
|
100
|
-
- Jobs own asynchronous system-operation state and Runs own individual Agent execution attempts.
|
|
101
|
-
- Edit Sessions own transactional direct modifications.
|
|
102
|
-
- Verification records own exact-revision completion evidence; event logs own audit history.
|
|
103
|
-
- Atomic snapshots, indexes, task-ledger files, historical Issue/Task aliases, `tasks/current.md`, and `.ai/harness/session/*` are projections or compatibility/session caches only.
|
|
104
|
-
- The legacy controller task-ledger projection is read-only after control-plane cutover and cannot mutate Requirement/Plan/Work state.
|
|
105
|
-
- The controller context pack is a transient Projection Plane read model for scoped code investigation. It may return live Git metadata, validation hints, ranked candidate files, and bounded raw snippets, but it must not become source-of-truth for implementation decisions or replace exact source, diff, and validation review.
|
|
106
|
-
- Chat history, UI state, worker self-reports, and in-memory maps are never durable truth.
|
|
107
|
-
|
|
108
|
-
## Historical Documents
|
|
109
|
-
|
|
110
|
-
Superseded V5–V8 decisions are consolidated in [`docs/architecture/history.md`](../history.md), which is explicitly **Historical Design — Not Runtime Authority**. Detailed legacy documents are retained by Git history rather than published as parallel architecture surfaces.
|
|
111
|
-
|
|
112
|
-
The history may describe behavior that still exists, behavior that was removed, or behavior not yet migrated. It never overrides this directory.
|
|
113
|
-
|
|
114
|
-
## Change Discipline
|
|
115
|
-
|
|
116
|
-
A change requires architecture review when it modifies any of the following:
|
|
117
|
-
|
|
118
|
-
- process or service boundaries;
|
|
119
|
-
- authority or ownership of state;
|
|
120
|
-
- entity meanings or lifecycle transitions;
|
|
121
|
-
- task dispatch or Agent-selection behavior;
|
|
122
|
-
- concurrency, conflict, claim, lease, or integration semantics;
|
|
123
|
-
- multi-repository isolation or fairness;
|
|
124
|
-
- schedule, retry, budget, or stop-condition behavior;
|
|
125
|
-
- verification, acceptance, release, or destructive-operation boundaries;
|
|
126
|
-
- public MCP execution contracts or durable schema compatibility.
|
|
127
|
-
|
|
128
|
-
The expected sequence is:
|
|
129
|
-
|
|
130
|
-
```text
|
|
131
|
-
request or ADR
|
|
132
|
-
-> current architecture update
|
|
133
|
-
-> implementation Task
|
|
134
|
-
-> executable verification
|
|
135
|
-
-> architecture drift check
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
Implementation may precede the documentation update only for an urgent incident fix. In that case the change must record a temporary architecture drift item with an owner and closure condition.
|
|
139
|
-
|
|
140
|
-
## Completion Standard
|
|
141
|
-
|
|
142
|
-
The architecture baseline is complete only when:
|
|
143
|
-
|
|
144
|
-
- every required document exists;
|
|
145
|
-
- terms have one meaning across documents;
|
|
146
|
-
- Current Implementation and Target Architecture are distinguishable;
|
|
147
|
-
- every normative invariant has an implementation owner or migration item;
|
|
148
|
-
- historical documents are visibly non-authoritative;
|
|
149
|
-
- automated checks protect the document set and authority markers;
|
|
150
|
-
- future Issues can cite these documents instead of reconstructing strategy from conversation history.
|
|
151
|
-
|
|
152
|
-
See [Architecture Governance Contract](governance.md).
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
- [Forge + ChatGPT current comprehensive architecture (zh-CN)](chatgpt-Forge-current-architecture.zh-CN.md)
|
|
156
|
-
- [Approved target architecture (zh-CN)](approved-target-architecture.zh-CN.md)
|
|
157
|
-
- [Personal assistant/plugin baseline](personal-assistant-plugin-baseline.md)
|
|
158
|
-
- [Target requirements traceability](target-requirements-traceability.md)
|
|
159
|
-
- [Human interaction plane](human-interaction-plane.md)
|
|
7
|
+
This directory is retained only so old links fail gracefully. Detailed pre-consolidation architecture pages were removed from the maintained working tree; their exact content remains available in Git history. Do not add new current architecture documents here.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
- **Status:** Accepted and aligned with the Canonical Forge Runtime
|
|
4
4
|
- **Date:** 2026-08-03; revised 2026-08-09
|
|
5
|
-
- **Authority:** [`../
|
|
5
|
+
- **Authority:** [`../CURRENT.md`](../CURRENT.md), [`../CURRENT.md`](../CURRENT.md)
|
|
6
6
|
|
|
7
7
|
## Decision
|
|
8
8
|
|
|
@@ -25,7 +25,7 @@ Authority order is:
|
|
|
25
25
|
3. an owning Git checkout only for explicit developer launches;
|
|
26
26
|
4. never an ambient parent repository.
|
|
27
27
|
|
|
28
|
-
The OS service manager starts and automatically restarts the single `forge-runtime` root process after unexpected process death. Module readiness failure does not create component restart authority. A release transition stops and starts the complete Runtime, verifies binary whole-Runtime readiness, and on failure restores the previous complete release together with its bound SQLite backup.
|
|
28
|
+
The OS service manager starts and automatically restarts the single `forge-runtime` root process after unexpected process death. The service executes from the stable physical path `ControllerHome/runtime/service/active-forge-runtime`; that file is an atomic byte-for-byte mirror of the signed entrypoint in the selected immutable release, not a symlink into `runtime/releases/<releaseId>`. Release assets and semantic identity remain bound by the selected manifest and `FORGE_RELEASE_*` environment. The fixed physical executable path is required so macOS TCC descendants inherit one stable responsible-process identity across releases instead of creating one permission principal per release directory. Module readiness failure does not create component restart authority. A release transition stops and starts the complete Runtime, refreshes the stable mirror from the selected release before launch, verifies binary whole-Runtime readiness, and on failure restores the previous complete release together with its matching stable mirror and bound SQLite backup.
|
|
29
29
|
|
|
30
30
|
Standalone Recovery remains independently installed. It may diagnose the service, repair the service definition or tunnel, and perform authorized offline whole-Runtime rollback when the primary Runtime cannot start. It never becomes a second scheduler, Gateway, state writer, or component owner.
|
|
31
31
|
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# ADR: Immediate Controller Relay
|
|
2
|
+
|
|
3
|
+
- **Status:** Accepted for the Forge 1.6.x stabilization line
|
|
4
|
+
- **Date:** 2026-08-23
|
|
5
|
+
- **Authority:** [`../CURRENT.md`](../CURRENT.md), [`../../../AGENTS.md`](../../../AGENTS.md)
|
|
6
|
+
|
|
7
|
+
## Decision
|
|
8
|
+
|
|
9
|
+
ChatGPT remains the semantic Controller. Forge may persist and execute an explicit end-of-round Controller disposition, but it must never infer that a Requirement, Goal, or Work should continue.
|
|
10
|
+
|
|
11
|
+
The supported dispositions are:
|
|
12
|
+
|
|
13
|
+
```text
|
|
14
|
+
continue_immediately
|
|
15
|
+
wait
|
|
16
|
+
wait_for_user
|
|
17
|
+
goal_complete
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
`continue_immediately` creates a durable `controller_round_relay` record under the existing Controller Home SQLite authority. It does not create a second scheduler, daemon, lifecycle owner, or autonomous agent. The current ChatGPT controller must own the exact live Work lease when it submits the disposition. Dispatch begins only after that lease is explicitly released.
|
|
21
|
+
|
|
22
|
+
A ChatGPT wake is a two-stage mechanical lifecycle: `dispatched -> claimed`. Browser prompt submission proves only transport dispatch. The round becomes `claimed` only when an authenticated ChatGPT Controller acquires the exact Work lease. Neither state is semantic acceptance. A claimed round must still end with an explicit ChatGPT disposition. If the lease disappears without a disposition, Forge may mechanically re-dispatch after the bounded liveness grace; it must not infer whether the Goal should continue or complete.
|
|
23
|
+
|
|
24
|
+
The relay reuses the existing ChatGPT controller-browser launcher path. The originating Work's durable ChatGPT conversation binding is inherited automatically and then carried forward by stable relay scope, so later rounds and later Works under the same Requirement/Goal can reuse the same ChatGPT conversation without making chat history authoritative. Requirement, Work, Handoff and evidence state remain the source of truth.
|
|
25
|
+
|
|
26
|
+
A Requirement-bound relay scope is `requirement:<requirementId>`. A Goal without a durable Requirement uses an explicit stable goal scope; the initial fallback is `goal:<originWorkId>`. The next ChatGPT round may select or create a different Work under the same semantic scope.
|
|
27
|
+
|
|
28
|
+
## Lifecycle authority
|
|
29
|
+
|
|
30
|
+
- `rh_work controller_disposition` records the Controller's explicit semantic decision.
|
|
31
|
+
- `controller_release` is the only transition that may consume a pending immediate relay for that Work.
|
|
32
|
+
- the canonical ChatGPT launcher performs the next-round dispatch;
|
|
33
|
+
- Controller Session ownership, principal/session/instance fences, Handoff authority and external-effect policy remain unchanged and cannot be bypassed by Relay;
|
|
34
|
+
- `wait_for_user` requires an active Handoff bound to the relevant Work or repository decision surface.
|
|
35
|
+
|
|
36
|
+
## Mechanical anti-spin policy
|
|
37
|
+
|
|
38
|
+
Forge may block repeated execution mechanically, without making a semantic product decision. The relay records bounded round count, repeated semantic-state fingerprint count and consecutive launch failures. Limits can be tightened by a Controller but cannot be loosened inside an existing relay scope. A blocked relay requires a fresh Controller decision or explicit recovery.
|
|
39
|
+
|
|
40
|
+
## Failure and cleanup
|
|
41
|
+
|
|
42
|
+
A failed next-round launch records failure evidence and does not silently retry, fabricate progress, or create an alternate scheduler. If Browser/ChatGPT launch requires a user or host permission, the relay stops at that external blocker.
|
|
43
|
+
|
|
44
|
+
Terminal dispositions (`wait`, `wait_for_user`, `goal_complete`) leave no runnable immediate relay. Completed or superseded relay records are historical control-plane evidence and are subject to the same bounded Controller Home retention/maintenance policy as other durable control-plane records; they have no independent process or service cleanup lifecycle.
|
|
45
|
+
|
|
46
|
+
## Verification
|
|
47
|
+
|
|
48
|
+
- a same-principal but different live MCP session cannot submit a disposition for another session's Work lease;
|
|
49
|
+
- `continue_immediately` remains pending until explicit controller release;
|
|
50
|
+
- the existing Work-to-ChatGPT conversation binding is inherited when the Controller omits browser/session URL arguments;
|
|
51
|
+
- repeated unchanged state and round/failure budgets fail closed;
|
|
52
|
+
- Runtime architecture retains one Scheduler and one lifecycle owner;
|
|
53
|
+
- a live browser dispatch is required before the stabilization baseline is declared complete.
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# Browser Runtime V2: unified authority and provider transactions
|
|
2
|
+
|
|
3
|
+
Status: accepted migration architecture
|
|
4
|
+
Date: 2026-08-26
|
|
5
|
+
|
|
6
|
+
## Decision
|
|
7
|
+
|
|
8
|
+
Forge Browser converges on one controller-owned Browser Runtime. The public `browser` plugin action names remain stable during migration, but provider-specific workflows are internal implementation details.
|
|
9
|
+
|
|
10
|
+
The durable source of truth for Browser sessions is Controller Home SQLite. A provider may keep an ephemeral live handle, cache, socket connection, CDP session, Apple Events reference, or Accessibility element reference, but it must not maintain a second durable Browser-session authority.
|
|
11
|
+
|
|
12
|
+
A Browser session separates **stable target identity** from **mutable observed state**. The identity names the exact provider resource (for example a Chrome window/tab identity or a managed page identity). URL and title are observations of that resource and may change without invalidating the session. This applies to supported browser-internal resources such as `chrome://bookmarks/`: changing an internal route or query parameter is not a new tab identity.
|
|
13
|
+
|
|
14
|
+
## Capability ladder
|
|
15
|
+
|
|
16
|
+
The Runtime selects providers by declared capability rather than by catching one provider failure and falling through a long chain. Capabilities include DOM read, DOM interaction, browser-internal resources, screenshot/vision, trusted physical input, foreground authority, provider transaction execution, and persistent handle reuse.
|
|
17
|
+
|
|
18
|
+
Preferred order is capability-driven:
|
|
19
|
+
|
|
20
|
+
1. persistent DOM/CDP/extension/native background capability for normal web work;
|
|
21
|
+
2. typed browser-internal-resource capability for bookmarks/tabs/downloads/history-like browser resources where supported;
|
|
22
|
+
3. screenshot/vision only when DOM/resource APIs are insufficient;
|
|
23
|
+
4. Accessibility/physical input only for operations that cannot be expressed above;
|
|
24
|
+
5. foreground physical input only when the selected capability explicitly declares `explicit_required`.
|
|
25
|
+
|
|
26
|
+
Foreground activation is never a hidden fallback side effect. If a provider cannot satisfy an operation without foreground authority, it returns that capability requirement to the Runtime; the controller then chooses an explicit foreground/handoff path or another provider.
|
|
27
|
+
|
|
28
|
+
## Provider transaction
|
|
29
|
+
|
|
30
|
+
Browser interactions use a provider-local transaction:
|
|
31
|
+
|
|
32
|
+
`precondition -> action -> postcondition -> bounded evidence`
|
|
33
|
+
|
|
34
|
+
The provider performs these phases in one RPC whenever it declares `browser.transaction`. Transport success, Apple Events success, `AXPress == .success`, or successful CGEvent injection are execution facts only. They do **not** make the Browser action successful unless the configured postcondition is also satisfied.
|
|
35
|
+
|
|
36
|
+
A transaction binds the stable target identity, required capabilities, replay safety, foreground requirement, timeout, action, and verification predicates. Non-idempotent actions are never retried by the Runtime after an ambiguous result unless the provider supplies a transaction/deduplication identity proving that replay is safe.
|
|
37
|
+
|
|
38
|
+
## Session and handle lifecycle
|
|
39
|
+
|
|
40
|
+
Controller Home stores the durable BrowserSession record. Providers return ephemeral handles that may be cached for bounded consecutive actions. The Runtime revalidates the stable target identity when a handle is stale or after provider restart. It does not rediscover every provider on every action when a live compatible handle already exists.
|
|
41
|
+
|
|
42
|
+
Provider restart may invalidate an ephemeral handle but not the controller session. Rebind uses exact stable resource identity and fails closed if exact-target fencing cannot be restored. User-owned resources are never silently substituted, navigated, closed, or replaced merely to recover a session.
|
|
43
|
+
|
|
44
|
+
Desktop Operator remains a controller-scoped execution provider. Its generic desktop session store is not Browser session truth.
|
|
45
|
+
|
|
46
|
+
## Browser-internal resources
|
|
47
|
+
|
|
48
|
+
Generic top-level navigation may remain HTTP(S)-only for the public web-navigation actions. Browser-internal resources are represented through typed provider capability, not by weakening the generic URL boundary. Native/adopted Chrome or Vivaldi targets can therefore model internal resources without conflating `chrome:`/`vivaldi:` with ordinary network navigation.
|
|
49
|
+
|
|
50
|
+
## Performance and round-trip budgets
|
|
51
|
+
|
|
52
|
+
V2 targets the common warm path at one provider call after session resolution:
|
|
53
|
+
|
|
54
|
+
| Operation | p95 target | Warm provider calls | Cold/rebind calls | Foreground |
|
|
55
|
+
| --- | ---: | ---: | ---: | --- |
|
|
56
|
+
| Read/extract | 350 ms | 1 | <=2 | forbidden |
|
|
57
|
+
| DOM interaction + verify | 600 ms | 1 | <=2 | forbidden |
|
|
58
|
+
| Browser-internal resource operation | 700 ms | 1 | <=2 | forbidden |
|
|
59
|
+
| Explicit physical-input fallback | 1500 ms | 1 | <=2 | allowed only when explicit |
|
|
60
|
+
|
|
61
|
+
These are architecture targets and live-gate budgets, not promises about every website or machine. A regression that exceeds them must expose attributable provider timing instead of being hidden behind controller sleeps/retries.
|
|
62
|
+
|
|
63
|
+
There is no unconditional post-action sleep in the V2 transaction contract. Providers wait on explicit state/postconditions within the action timeout.
|
|
64
|
+
|
|
65
|
+
## Migration
|
|
66
|
+
|
|
67
|
+
1. Land this contract and architecture authority.
|
|
68
|
+
2. Introduce a Runtime coordinator/provider registry behind the existing Browser action surface.
|
|
69
|
+
3. Move macOS existing-browser support to capability-based persistent handles and internal-resource operations.
|
|
70
|
+
4. Version the Desktop Operator browser broker with transaction execution and postcondition evidence.
|
|
71
|
+
5. Add real-socket live gates and latency reporting, then remove redundant fallback/reconnect paths.
|
|
72
|
+
|
|
73
|
+
Legacy compatibility remains bounded during migration and must not become an independent source of business rules.
|