@moretea-labs/forge 1.8.0 → 1.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +70 -7
- package/CHANGELOG.md +14 -0
- package/CLAUDE.md +17 -2
- package/CONTRIBUTING.md +3 -2
- package/THIRD_PARTY_NOTICES.md +1 -1
- package/adapters/chatgpt/browser-delivery-host.ts +7 -1
- package/adapters/chatgpt/browser-delivery-runtime.ts +529 -56
- package/adapters/chatgpt/controller-binding-store.ts +101 -22
- package/adapters/chatgpt/controller-round-host.ts +15 -25
- package/adapters/chatgpt/controller-round-settlement-store.ts +58 -4
- package/adapters/chatgpt/provider-delivery.ts +228 -1
- package/adapters/chatgpt/work-conversation-binding-store.ts +79 -53
- package/adapters/computer/chatgpt-extension-target.ts +463 -0
- package/adapters/computer/chatgpt-target-router.ts +103 -0
- package/adapters/computer/chrome-extension/background.js +385 -0
- package/adapters/computer/chrome-extension/content.js +378 -0
- package/adapters/computer/chrome-extension/core.js +24 -0
- package/adapters/computer/chrome-extension/manifest.json +30 -0
- package/adapters/computer/desktop-operator-discovery.ts +11 -31
- package/adapters/computer/interaction-target-authority.ts +142 -18
- package/adapters/mcp/auth.ts +0 -1
- package/adapters/mcp/instructions.ts +5 -4
- package/adapters/mcp/multi-repository.ts +3 -19
- package/adapters/mcp/oauth.ts +73 -0
- package/adapters/mcp/paths.ts +4 -1
- package/adapters/mcp/runtime-gateway/automation-receipt-adapter.ts +87 -0
- package/adapters/mcp/runtime-gateway/bounded-result-runtime.ts +62 -0
- package/adapters/mcp/runtime-gateway/cognition-settlement.ts +201 -0
- package/adapters/mcp/runtime-gateway/context-adapter.ts +411 -73
- package/adapters/mcp/runtime-gateway/context-pack-sidecar.ts +91 -0
- package/adapters/mcp/runtime-gateway/controller-authority-adapter.ts +20 -5
- package/adapters/mcp/runtime-gateway/core-capability-adapter.ts +258 -0
- package/adapters/mcp/runtime-gateway/engineering-preconditions.ts +10 -27
- package/adapters/mcp/runtime-gateway/engineering-tool-contract.ts +15 -0
- package/adapters/mcp/runtime-gateway/execution-tools.ts +8 -42
- package/adapters/mcp/runtime-gateway/gateway-execution-adapter.ts +2 -1
- package/adapters/mcp/runtime-gateway/plugin-adapter.ts +117 -45
- package/adapters/mcp/runtime-gateway/process-tools.ts +190 -22
- package/adapters/mcp/runtime-gateway/protected-computer-adapter.ts +16 -4
- package/adapters/mcp/runtime-gateway/recovery-adapter.ts +69 -52
- package/adapters/mcp/runtime-gateway/repository-compat-adapter.ts +4 -35
- package/adapters/mcp/runtime-gateway/result-adapter.ts +10 -4
- package/adapters/mcp/runtime-gateway/router.ts +18 -504
- package/adapters/mcp/runtime-gateway/routing-policy.ts +499 -0
- package/adapters/mcp/runtime-gateway/runtime-observation-adapter.ts +14 -65
- package/adapters/mcp/runtime-gateway/runtime-readiness-observation.ts +218 -0
- package/adapters/mcp/runtime-gateway/runtime-tool-definitions.ts +113 -173
- package/adapters/mcp/runtime-gateway/runtime-tools.ts +15 -5
- package/adapters/mcp/runtime-gateway/scheduler-adapter.ts +1 -0
- package/adapters/mcp/runtime-gateway/shared-adapter.ts +20 -0
- package/adapters/mcp/runtime-gateway/status-inbox-adapter.ts +358 -266
- package/adapters/mcp/runtime-gateway/typescript-navigation-sidecar.ts +136 -0
- package/adapters/mcp/runtime-gateway/work-adapter.ts +261 -3122
- package/adapters/mcp/runtime-gateway/work-controller-operations.ts +257 -0
- package/adapters/mcp/runtime-gateway/work-detail-projection.ts +60 -0
- package/adapters/mcp/runtime-gateway/work-input-wire-migration.ts +246 -0
- package/adapters/mcp/runtime-gateway/work-learning-operations.ts +145 -0
- package/adapters/mcp/runtime-gateway/work-list-projection.ts +38 -0
- package/adapters/mcp/runtime-gateway/work-plan-operations.ts +382 -0
- package/adapters/mcp/runtime-gateway/work-repair-adapter.ts +308 -0
- package/adapters/mcp/runtime-gateway/work-requirement-operations.ts +148 -0
- package/adapters/mcp/runtime-gateway/work-semantic-operations.ts +263 -0
- package/adapters/mcp/runtime-gateway/work-workflow-operations.ts +113 -0
- package/adapters/mcp/runtime-gateway/workflow-supervisor-adapter.ts +156 -0
- package/adapters/mcp/server.ts +67 -23
- package/adapters/mcp/setup.ts +1 -3
- package/adapters/mcp/tool-mapping/legacy-tool-service.ts +44 -170
- package/adapters/mcp/tool-mapping/post-finalize-work-attribution.ts +4 -9
- package/adapters/mcp/tool-mapping/repository-tools.ts +133 -142
- package/adapters/mcp/toolset-names.ts +5 -0
- package/adapters/mcp/toolset.ts +6 -5
- package/adapters/mcp/transports/http-observation.ts +365 -0
- package/adapters/mcp/transports/http.ts +154 -677
- package/adapters/mcp/transports/oauth-http.ts +322 -0
- package/adapters/mcp/transports/session-registry.ts +6 -0
- package/adapters/mcp/tunnels/openai-secure-tunnel.ts +89 -5
- package/assets/plugin-registry.v1.json +6 -4
- package/assets/reference-configs/agentic-development-flow.md +25 -0
- package/assets/reference-configs/global-working-rules.md +19 -0
- package/assets/skill-version.json +2 -2
- package/docs/architecture/CURRENT.md +111 -41
- package/docs/architecture/decisions/20260803-release-identity-binding-and-exit-policy.md +14 -5
- package/docs/architecture/decisions/20260823-immediate-controller-relay.md +6 -3
- package/docs/architecture/decisions/20260907-assistant-learning-loop.md +2 -0
- package/docs/architecture/decisions/20260907-controller-round-transition-policy.md +19 -4
- package/docs/architecture/decisions/20260916-workflow-supervisor-authority.md +249 -0
- package/docs/architecture/decisions/20260917-cognitive-memory-foundation.md +82 -0
- package/docs/architecture/decisions/20260918-stable-candidate-release-lifecycle.md +221 -0
- package/docs/architecture/decisions/20260919-autonomous-work-liveness.md +62 -0
- package/docs/architecture/decisions/20260924-thin-semantic-working-context.md +72 -0
- package/docs/architecture/decisions/20261001-supervisor-turn-authority.md +237 -0
- package/docs/architecture/decisions/20261005-forge-v3-desktop-client-boundary.md +77 -0
- package/docs/architecture/domains/verification.md +1 -0
- package/docs/architecture/domains/workflow-engine.md +6 -0
- package/docs/architecture/modules/controller-runtime/transport-lifecycle.md +1 -1
- package/docs/forge-plugin-management.md +2 -2
- package/docs/operations/controller-performance-and-502.md +17 -0
- package/docs/operations/controller-reliability-runbook.md +2 -2
- package/docs/operations/features.md +1 -1
- package/docs/operations/features.zh-CN.md +1 -1
- package/docs/operations/homebrew.md +2 -2
- package/docs/operations/mcp-tool-exposure.md +2 -0
- package/docs/operations/releasing.md +2 -0
- package/docs/operations/standalone-disaster-recovery.md +14 -6
- package/docs/wiki/Implementation.md +1 -1
- package/package.json +25 -14
- package/packages/kernel/cognition/api/index.ts +6 -0
- package/packages/kernel/cognition/application/activation-service.ts +451 -0
- package/packages/kernel/cognition/application/consolidation-service.ts +185 -0
- package/packages/kernel/cognition/application/legacy-experience-adapter.ts +38 -0
- package/packages/kernel/cognition/application/memory-service.ts +64 -0
- package/packages/kernel/cognition/domain/learning.ts +106 -0
- package/packages/kernel/cognition/domain/memory.ts +254 -0
- package/packages/kernel/controller/api/index.ts +1 -0
- package/packages/kernel/controller/application/continuation-service.ts +281 -0
- package/packages/kernel/controller/application/controller-round-service.ts +12 -0
- package/packages/kernel/controller/domain/controller-round-transition-policy.ts +242 -21
- package/packages/kernel/controller/domain/controller-round.ts +4 -1
- package/packages/kernel/controller/domain/execution-quality.ts +3 -1
- package/packages/kernel/controller/infrastructure/controller-round-store.ts +689 -103
- package/packages/kernel/controller/infrastructure/controller-session-store.ts +297 -71
- package/packages/kernel/controller/ports/controller-host.ts +2 -0
- package/packages/kernel/identity/api/index.ts +10 -0
- package/packages/kernel/identity/domain/activity-projection.ts +43 -0
- package/packages/kernel/identity/domain/capability-broker.ts +60 -0
- package/packages/kernel/identity/domain/grant.ts +72 -0
- package/packages/kernel/identity/domain/owned-resource.ts +116 -0
- package/packages/kernel/identity/domain/user-request.ts +93 -0
- package/packages/kernel/identity/infrastructure/activity-projection-store.ts +77 -0
- package/packages/kernel/identity/infrastructure/capability-broker.ts +81 -0
- package/packages/kernel/identity/infrastructure/grant-store.ts +284 -0
- package/packages/kernel/identity/infrastructure/owned-resource-store.ts +259 -0
- package/packages/kernel/identity/infrastructure/user-request-store.ts +182 -0
- package/packages/kernel/scheduler/api/index.ts +0 -2
- package/packages/kernel/scheduler/application/schedule-service.ts +3 -0
- package/packages/kernel/scheduler/application/settlement.ts +0 -15
- package/packages/kernel/scheduler/domain/schedule.ts +87 -0
- package/packages/kernel/scheduler/infrastructure/schedule-store.ts +153 -133
- package/packages/kernel/work/api/index.ts +3 -2
- package/packages/kernel/work/application/work-service.ts +17 -42
- package/packages/kernel/work/domain/current-task-lineage.ts +104 -0
- package/packages/kernel/work/domain/engineering-design.ts +10 -5
- package/packages/kernel/work/domain/engineering-profile.ts +8 -12
- package/packages/kernel/work/domain/evaluation-promotion-receipt.ts +186 -0
- package/packages/kernel/work/domain/execution-concurrency.ts +19 -26
- package/packages/kernel/work/domain/execution-snapshot.ts +0 -31
- package/packages/kernel/work/domain/implementation-review.ts +14 -331
- package/packages/kernel/work/domain/objective-graph.ts +119 -0
- package/packages/kernel/work/domain/project-engineering-contract.ts +23 -1
- package/packages/kernel/work/domain/repository-completion-receipt.ts +1 -1
- package/packages/kernel/work/domain/state-machine.ts +25 -63
- package/packages/kernel/work/domain/types.ts +57 -51
- package/packages/kernel/work/infrastructure/work-contract-store.ts +819 -728
- package/packages/kernel/work/ports/work-contract-store.ts +5 -2
- package/packages/plugin-runtime/browser/session-authority.ts +2 -1
- package/packages/plugin-runtime/computer/chatgpt-identity.ts +24 -0
- package/packages/plugin-runtime/computer/conversation-target.ts +143 -0
- package/packages/plugin-runtime/computer/index.ts +2 -0
- package/packages/plugin-runtime/computer/target-authority.ts +26 -1
- package/packages/plugin-runtime/external/unix-jsonl-transport.ts +142 -18
- package/packages/protocols/computer/contract.ts +27 -1
- package/scripts/activate-source-baseline.ts +7 -9
- package/scripts/canary-controller-semantic-wait.ts +12 -24
- package/scripts/check-mcp-compatibility.ts +48 -136
- package/scripts/check-runtime-architecture.mjs +622 -217
- package/scripts/forge-local-recovery-helper.mjs +93 -15
- package/scripts/lib/project-init-lib.sh +3 -0
- package/scripts/open-source-audit-allowlist.txt +1 -2
- package/scripts/run-bounded-command.mjs +5 -0
- package/scripts/run-governed-gate.ts +0 -1
- package/scripts/run-mobile-monitor-bridge.ts +0 -1
- package/scripts/smoke-control-plane-failure-domain.ts +94 -0
- package/scripts/smoke-mcp-http-runtime.ts +5 -0
- package/scripts/smoke-runtime-recovery.ts +12 -43
- package/scripts/smoke-schedule-engine.ts +23 -15
- package/scripts/smoke-unattended-transport-recovery.ts +223 -0
- package/scripts/smoke-user-request-continuation-restart.ts +232 -0
- package/scripts/smoke-workflow-supervisor-chrome-adapter.ts +92 -0
- package/scripts/smoke-workflow-supervisor-process-restart.ts +276 -0
- package/scripts/smoke-workflow-supervisor-restart-recovery.ts +150 -0
- package/scripts/smoke-workflow-supervisor.ts +103 -0
- package/scripts/verify-forge-runtime.sh +2 -1
- package/src/cli/agent-jobs/executor-health.ts +11 -34
- package/src/cli/agent-jobs/integration.ts +18 -49
- package/src/cli/agent-jobs/job-manager.ts +7 -3
- package/src/cli/commands/brain-assistant.ts +27 -13
- package/src/cli/commands/brain.ts +13 -15
- package/src/cli/commands/chatgpt.ts +1 -163
- package/src/cli/commands/recovery.ts +135 -121
- package/src/cli/commands/runtime.ts +3 -3
- package/src/cli/commands/setup-profile.ts +8 -0
- package/src/cli/controller/check-runner.ts +13 -2
- package/src/cli/controller/completion-backlog.ts +3 -3
- package/src/cli/controller/completion-orchestrator.ts +4 -43
- package/src/cli/controller/completion-target.ts +3 -72
- package/src/cli/controller/context/source-materializer.ts +81 -100
- package/src/cli/controller/context-pack.ts +10 -8
- package/src/cli/controller/execution-completion.ts +4 -7
- package/src/cli/controller/execution-policy.ts +36 -153
- package/src/cli/controller/governance.ts +2 -3
- package/src/cli/controller/issue-store.ts +4 -99
- package/src/cli/controller/launch-agents.ts +59 -18
- package/src/cli/controller/operational-plan.ts +24 -51
- package/src/cli/controller/runtime-config.ts +5 -1
- package/src/cli/controller/stuck-state-migration.ts +2 -3
- package/src/cli/controller/systemd-user.ts +39 -1
- package/src/cli/editing/edit-session.ts +1 -7
- package/src/cli/local-bridge/console-automations.ts +18 -13
- package/src/cli/local-bridge/console-view-models.ts +3 -12
- package/src/cli/local-bridge/facade-api.ts +64 -191
- package/src/cli/local-bridge/server.ts +24 -147
- package/src/cli/local-bridge/types.ts +0 -1
- package/src/cli/mcp/oauth-client-retirement.ts +74 -0
- package/src/cli/repositories/command-executor.ts +29 -23
- package/src/cli/repositories/command-scope.ts +35 -16
- package/src/cli/repositories/controller-home.ts +48 -0
- package/src/cli/repositories/ephemeral-workspace.ts +20 -30
- package/src/cli/repositories/git-command-executor.ts +2 -2
- package/src/cli/repositories/registry.ts +77 -11
- package/src/cli/repositories/structured-git.ts +62 -2
- package/src/cli/repository/session-cache.ts +92 -6
- package/src/runtime/context/assistant-context.ts +20 -7
- package/src/runtime/context/assistant-work-context.ts +89 -27
- package/src/runtime/context/automatic-learning.ts +565 -0
- package/src/runtime/context/cognitive-attention.ts +173 -0
- package/src/runtime/context/cognitive-skill-canary.ts +158 -0
- package/src/runtime/context/context-closure.ts +46 -9
- package/src/runtime/context/context-pack-process.ts +103 -0
- package/src/runtime/context/context-plane.ts +1 -9
- package/src/runtime/context/direct-controller-learning.ts +298 -0
- package/src/runtime/context/semantic-navigation-contract.ts +9 -0
- package/src/runtime/context/semantic-navigation.ts +6 -34
- package/src/runtime/context/typescript-navigation-process.ts +145 -0
- package/src/runtime/context/typescript-navigation.ts +89 -3
- package/src/runtime/control-plane/cleanup-artifact-retention.ts +212 -9
- package/src/runtime/control-plane/concurrency/work-execution-concurrency.ts +9 -47
- package/src/runtime/control-plane/execution/controller-authority-recovery.ts +34 -4
- package/src/runtime/control-plane/execution/edit-validation-coordinator.ts +29 -20
- package/src/runtime/control-plane/execution/execution-identity.ts +23 -3
- package/src/runtime/control-plane/execution/repository-work-attribution.ts +7 -30
- package/src/runtime/control-plane/execution/retained-work-resume.ts +206 -199
- package/src/runtime/control-plane/execution/session-store.ts +31 -1
- package/src/runtime/control-plane/execution/validation.ts +6 -8
- package/src/runtime/control-plane/execution/work-authority-reconciler.ts +13 -42
- package/src/runtime/control-plane/execution/work-check-evidence.ts +137 -0
- package/src/runtime/control-plane/execution/work-completion-authority.ts +30 -85
- package/src/runtime/control-plane/execution/work-delivery-service.ts +497 -0
- package/src/runtime/control-plane/execution/work-evidence-policy.ts +12 -50
- package/src/runtime/control-plane/execution/work-execution-support.ts +50 -149
- package/src/runtime/control-plane/execution/work-handle-authority.ts +188 -109
- package/src/runtime/control-plane/execution/work-handle-store.ts +19 -43
- package/src/runtime/control-plane/execution/work-head-settlement.ts +53 -20
- package/src/runtime/control-plane/execution/work-lifecycle-audit.ts +52 -29
- package/src/runtime/control-plane/execution/work-operation-service.ts +43 -27
- package/src/runtime/control-plane/execution/work-preparation-service.ts +126 -266
- package/src/runtime/control-plane/execution/work-remote-delivery.ts +2 -3
- package/src/runtime/control-plane/execution/work-revision-diff.ts +39 -0
- package/src/runtime/control-plane/execution/work-terminal-cleanup.ts +173 -186
- package/src/runtime/control-plane/execution/work-validation-reconciler.ts +28 -84
- package/src/runtime/control-plane/execution/work-verification-service.ts +406 -50
- package/src/runtime/control-plane/execution/work-verification-snapshot.ts +5 -1
- package/src/runtime/control-plane/facade/capability-registry.ts +362 -37
- package/src/runtime/control-plane/facade/check-normalization.ts +3 -9
- package/src/runtime/control-plane/facade/codex-delegation.ts +10 -11
- package/src/runtime/control-plane/facade/controller-connection.ts +135 -0
- package/src/runtime/control-plane/facade/goal-workloop-access.ts +1 -20
- package/src/runtime/control-plane/facade/goal-workloop.ts +281 -1753
- package/src/runtime/control-plane/facade/handoff-inbox-application.ts +12 -25
- package/src/runtime/control-plane/facade/handoff-inbox-store.ts +256 -52
- package/src/runtime/control-plane/facade/index.ts +0 -1
- package/src/runtime/control-plane/facade/operation-digest.ts +12 -15
- package/src/runtime/control-plane/facade/plan-contract-store.ts +451 -991
- package/src/runtime/control-plane/facade/policy-gate.ts +0 -23
- package/src/runtime/control-plane/facade/repository-work-admission.ts +12 -22
- package/src/runtime/control-plane/facade/requirement-authority.ts +102 -199
- package/src/runtime/control-plane/facade/requirement-board.ts +3 -3
- package/src/runtime/control-plane/facade/rh-work-operation-contract.ts +51 -14
- package/src/runtime/control-plane/facade/self-healing-loop.ts +18 -53
- package/src/runtime/control-plane/facade/suggested-actions.ts +15 -18
- package/src/runtime/control-plane/facade/types.ts +49 -108
- package/src/runtime/control-plane/facade/work-continuation.ts +8 -8
- package/src/runtime/control-plane/generated-cache-retention.ts +97 -1
- package/src/runtime/control-plane/global-scheduler/autonomous-continuation.ts +248 -0
- package/src/runtime/control-plane/global-scheduler/durable-admission.ts +1 -1
- package/src/runtime/control-plane/global-scheduler/maintenance.ts +239 -112
- package/src/runtime/control-plane/global-scheduler/reconciliation.ts +2 -1
- package/src/runtime/control-plane/global-scheduler/scheduler.ts +66 -40
- package/src/runtime/control-plane/global-scheduler/wake-signal.ts +42 -2
- package/src/runtime/control-plane/governance/access-policy.ts +19 -2
- package/src/runtime/control-plane/governance/authorization.ts +20 -3
- package/src/runtime/control-plane/launcher/chatgpt-round-continuation.ts +63 -300
- package/src/runtime/control-plane/launcher/chatgpt-work-continuation.ts +28 -300
- package/src/runtime/control-plane/launcher/local-conversation-controller.ts +238 -0
- package/src/runtime/control-plane/launcher/provider-mcp-bootstrap.ts +5 -2
- package/src/runtime/control-plane/launcher/thin-launcher.ts +96 -240
- package/src/runtime/control-plane/persistence/cognition-store.ts +820 -0
- package/src/runtime/control-plane/persistence/experience-store.ts +162 -29
- package/src/runtime/control-plane/persistence/requirement-store.ts +216 -74
- package/src/runtime/control-plane/persistence/sqlite-store.ts +113 -6
- package/src/runtime/control-plane/release-retention.ts +135 -47
- package/src/runtime/control-plane/repository-namespace-retention.ts +2 -2
- package/src/runtime/control-plane/runtime-cleanup.ts +290 -21
- package/src/runtime/control-plane/workspace/project-onboarding.ts +80 -0
- package/src/runtime/control-plane/workspace/semantic-sync-service.ts +19 -5
- package/src/runtime/control-plane/workspace/workspace-store.ts +169 -0
- package/src/runtime/diagnostics/incident-repair.ts +313 -146
- package/src/runtime/diagnostics/mcp-timing.ts +114 -0
- package/src/runtime/evidence/artifact-store.ts +158 -40
- package/src/runtime/evidence/evidence-store.ts +112 -8
- package/src/runtime/evidence/output-handle-index.ts +225 -0
- package/src/runtime/evidence/result-store.ts +158 -44
- package/src/runtime/execution/jobs/store.ts +3 -4
- package/src/runtime/execution/managed-workspace.ts +57 -0
- package/src/runtime/execution/process-runtime/check-facade.ts +1 -1
- package/src/runtime/execution/process-runtime/check-result-retention.ts +2 -2
- package/src/runtime/execution/process-runtime/check-result.ts +105 -1
- package/src/runtime/execution/process-runtime/check-runner-sidecar.ts +18 -8
- package/src/runtime/execution/process-runtime/command-facade.ts +79 -27
- package/src/runtime/execution/process-runtime/gc.ts +15 -2
- package/src/runtime/execution/process-runtime/handle-index.ts +176 -0
- package/src/runtime/execution/process-runtime/host-command-lane.ts +139 -0
- package/src/runtime/execution/process-runtime/index.ts +3 -0
- package/src/runtime/execution/process-runtime/lightweight-managed.ts +251 -72
- package/src/runtime/execution/process-runtime/persisted-check.ts +3 -3
- package/src/runtime/execution/process-runtime/process-runner-entry.ts +47 -5
- package/src/runtime/execution/process-runtime/process-scope.ts +160 -0
- package/src/runtime/execution/process-runtime/resource-claims.ts +65 -61
- package/src/runtime/execution/process-runtime/runtime.ts +35 -2
- package/src/runtime/execution/process-runtime/store.ts +30 -2
- package/src/runtime/execution/process-runtime/types.ts +6 -1
- package/src/runtime/execution/workers/executor.ts +2 -6
- package/src/runtime/platform/service-inventory.ts +130 -0
- package/src/runtime/platform/service-manager.ts +8 -0
- package/src/runtime/plugins/action-application.ts +85 -28
- package/src/runtime/plugins/app-store-connect-adapter.ts +38 -14
- package/src/runtime/plugins/browser-adapter.ts +757 -34
- package/src/runtime/plugins/browser-automation-service.ts +23 -3
- package/src/runtime/plugins/browser-macos-bridge.ts +321 -29
- package/src/runtime/plugins/browser-manifest-surface.ts +45 -11
- package/src/runtime/plugins/browser-native-session-service.ts +63 -13
- package/src/runtime/plugins/browser-registration.ts +16 -0
- package/src/runtime/plugins/browser-runtime.ts +14 -1
- package/src/runtime/plugins/browser-session-authority.ts +2 -2
- package/src/runtime/plugins/browser-session-store.ts +46 -76
- package/src/runtime/plugins/capability-authorization-grants.ts +258 -62
- package/src/runtime/plugins/computer-chatgpt-browser-adapter-installer.ts +219 -0
- package/src/runtime/plugins/computer-chatgpt-macos-target.ts +891 -0
- package/src/runtime/plugins/computer-registration.ts +222 -11
- package/src/runtime/plugins/desktop-operator-external-policy.ts +36 -4
- package/src/runtime/plugins/desktop-operator-registration.ts +12 -4
- package/src/runtime/plugins/external-adapter.ts +42 -6
- package/src/runtime/plugins/external-registration.ts +21 -1
- package/src/runtime/plugins/gmail-adapter.ts +23 -2
- package/src/runtime/plugins/google-calendar-adapter.ts +2 -2
- package/src/runtime/plugins/google-shared.ts +14 -7
- package/src/runtime/plugins/google-tasks-adapter.ts +2 -2
- package/src/runtime/plugins/ios-adapter.ts +1 -1
- package/src/runtime/plugins/lightweight-action.ts +208 -2
- package/src/runtime/plugins/local-system-adapter.ts +12 -2
- package/src/runtime/plugins/managed-process-adapter.ts +12 -5
- package/src/runtime/plugins/plugin-action-sidecar.ts +17 -13
- package/src/runtime/plugins/plugin-management-adapter.ts +1 -1
- package/src/runtime/plugins/store.ts +602 -428
- package/src/runtime/plugins/types.ts +20 -0
- package/src/runtime/plugins/xiaohongshu-publish.ts +16 -0
- package/src/runtime/projections/invalidation.ts +7 -3
- package/src/runtime/projections/materialized-view.ts +80 -36
- package/src/runtime/recovery/actions.ts +3 -3
- package/src/runtime/recovery/capability-action-application.ts +46 -45
- package/src/runtime/recovery/lifecycle-inventory.ts +29 -29
- package/src/runtime/recovery/maintenance-executor.ts +374 -123
- package/src/runtime/recovery/store.ts +29 -11
- package/src/runtime/release/release-coordinator.ts +296 -0
- package/src/runtime/release/release-session.ts +716 -0
- package/src/runtime/release/release-state-migration.ts +25 -0
- package/src/runtime/resources/leases/store.ts +56 -25
- package/src/runtime/root/computer-composition.ts +191 -6
- package/src/runtime/root/controller-progression-composition.ts +192 -0
- package/src/runtime/root/controller-round-composition.ts +20 -1
- package/src/runtime/root/deployment-topology.ts +106 -0
- package/src/runtime/root/entry.ts +4 -3
- package/src/runtime/root/known-good-recovery.ts +184 -0
- package/src/runtime/root/local-bridge.ts +0 -1
- package/src/runtime/root/mcp-transport.ts +111 -18
- package/src/runtime/root/ownership.ts +261 -9
- package/src/runtime/root/package-connector-service.ts +105 -19
- package/src/runtime/root/package-runtime-release.ts +117 -18
- package/src/runtime/root/package-runtime-service.ts +17 -11
- package/src/runtime/root/release-execution-canary.ts +44 -12
- package/src/runtime/root/release-loader.ts +90 -8
- package/src/runtime/root/release-manifest.ts +80 -6
- package/src/runtime/root/release-materialize.ts +372 -28
- package/src/runtime/root/release-store.ts +395 -36
- package/src/runtime/root/runtime-lane.ts +191 -0
- package/src/runtime/root/runtime.ts +159 -27
- package/src/runtime/root/scheduled-controller-composition.ts +28 -3
- package/src/runtime/root/service-runner.ts +2 -2
- package/src/runtime/root/service.ts +36 -33
- package/src/runtime/root/status.ts +48 -0
- package/src/runtime/root/types.ts +32 -3
- package/src/runtime/root/workflow-supervisor-composition.ts +493 -0
- package/src/runtime/root/workflow-supervisor-runtime.ts +209 -0
- package/src/runtime/root/write-fence.ts +50 -2
- package/src/runtime/safe-tooling/google-credential-store.ts +76 -21
- package/src/runtime/safe-tooling/google-oauth-broker.ts +25 -7
- package/src/runtime/safe-tooling/workspace-auth.ts +1 -1
- package/src/runtime/shared/bounded-child-supervisor.ts +9 -1
- package/src/runtime/shared/process-environment.ts +20 -9
- package/src/runtime/shared/response-budget.ts +1 -3
- package/src/runtime/standalone-recovery/controller-home-migration.ts +16 -24
- package/src/runtime/standalone-recovery/core.ts +3702 -342
- package/src/runtime/standalone-recovery/entry.ts +469 -39
- package/src/runtime/standalone-recovery/installer.ts +262 -148
- package/src/runtime/standalone-recovery/mcp-server.ts +29 -193
- package/src/runtime/standalone-recovery/operation-lock.ts +1 -1
- package/src/runtime/standalone-recovery/performance.ts +54 -16
- package/src/runtime/standalone-recovery/release.ts +53 -5
- package/src/runtime/standalone-recovery/service-labels.ts +5 -2
- package/src/runtime/standalone-recovery/watchdog-heartbeat.ts +5 -2
- package/src/runtime/workflow/schedules/browser-probe.ts +17 -6
- package/src/runtime/workflow/schedules/chatgpt-automation-migration.ts +10 -3
- package/src/runtime/workflow/schedules/engine.ts +138 -172
- package/src/runtime/workflow/schedules/work-continuation.ts +44 -5
- package/src/runtime/workflows/runtime.ts +15 -19
- package/src/testing/test-governance.ts +5 -1
- package/supervisor/chatgpt-conversation.ts +23 -0
- package/supervisor/client.ts +201 -0
- package/supervisor/control-plane.ts +868 -0
- package/supervisor/entry.ts +15 -0
- package/supervisor/forge-validators.ts +80 -0
- package/supervisor/index.ts +5 -0
- package/supervisor/native-browser-adapter.ts +786 -0
- package/supervisor/native-messaging/host.ts +39 -0
- package/supervisor/native-messaging/manifest.ts +26 -0
- package/supervisor/native-messaging/protocol.ts +27 -0
- package/supervisor/paths.ts +18 -0
- package/supervisor/protocol.ts +202 -0
- package/supervisor/server.ts +404 -0
- package/supervisor/store.ts +1451 -0
- package/supervisor/tsconfig.json +8 -0
- package/supervisor/types.ts +255 -0
- package/adapters/chatgpt/controller-host.ts +0 -119
- package/adapters/mcp/controller-round-compatibility.ts +0 -184
- package/adapters/mcp/frozen-client-semantic-compatibility.ts +0 -292
- package/adapters/mcp/runtime-gateway/work-compat-adapter.ts +0 -502
- package/packages/kernel/progression/api/index.ts +0 -2
- package/packages/kernel/progression/application/projector.ts +0 -211
- package/packages/kernel/progression/domain/types.ts +0 -116
- package/packages/kernel/progression/index.ts +0 -1
- package/packages/kernel/scheduler/application/continuation-service.ts +0 -212
- package/packages/kernel/scheduler/domain/continuation.ts +0 -38
- package/packages/kernel/scheduler/infrastructure/continuation-dispatch-store.ts +0 -38
- package/packages/kernel/work/domain/admission-policy.ts +0 -34
- package/scripts/benchmark-background-check-overlap.ts +0 -228
- package/scripts/benchmark-computer-hotpath.ts +0 -255
- package/scripts/benchmark-controller-hotpath.ts +0 -212
- package/scripts/benchmark-controller-round2.ts +0 -191
- package/scripts/benchmark-ios-agent-device.ts +0 -511
- package/scripts/benchmark-mcp-host.sh +0 -117
- package/scripts/benchmark-mcp-transport.ts +0 -169
- package/scripts/benchmark-operational-memory-activation.ts +0 -235
- package/scripts/benchmark-operational-shadow.ts +0 -28
- package/scripts/benchmark-quality-harness.ts +0 -146
- package/scripts/benchmark-route-session-concurrency.ts +0 -915
- package/scripts/benchmark-thin-harness-gateway-ab.ts +0 -632
- package/scripts/benchmark-thin-harness-mcp-e2e.ts +0 -498
- package/scripts/benchmark-thin-harness.ts +0 -251
- package/scripts/benchmark-typescript-navigation.ts +0 -186
- package/scripts/benchmark-work-efficiency.ts +0 -334
- package/scripts/build-controller-ui.ts +0 -28
- package/scripts/check-npm-release.sh +0 -32
- package/scripts/check-public-release-surface.sh +0 -19
- package/scripts/check-release-published.sh +0 -57
- package/scripts/check-release-readiness.sh +0 -37
- package/scripts/check-release-version.mjs +0 -74
- package/scripts/check-tarball-install-smoke.sh +0 -150
- package/scripts/package-source-archive.sh +0 -147
- package/scripts/public-release-files.txt +0 -39
- package/scripts/public-release.ts +0 -174
- package/scripts/publish-release-tarball.sh +0 -27
- package/scripts/route-nl-vs-ts-eval.ts +0 -679
- package/scripts/stage-runtime-release.ts +0 -44
- package/src/cli/controller/progress.ts +0 -656
- package/src/cli/controller/work-mode.ts +0 -181
- package/src/cli/local-bridge/console-assets.ts +0 -17
- package/src/cli/local-bridge/dashboard.ts +0 -17
- package/src/cli/local-bridge/frontend/src/App.tsx +0 -10
- package/src/cli/local-bridge/frontend/src/components/Button.tsx +0 -1
- package/src/cli/local-bridge/frontend/src/components/DetailPane.tsx +0 -3
- package/src/cli/local-bridge/frontend/src/components/SearchField.tsx +0 -1
- package/src/cli/local-bridge/frontend/src/components/SectionHeader.tsx +0 -1
- package/src/cli/local-bridge/frontend/src/components/Segmented.tsx +0 -1
- package/src/cli/local-bridge/frontend/src/components/StatusText.tsx +0 -3
- package/src/cli/local-bridge/frontend/src/design/icons.tsx +0 -11
- package/src/cli/local-bridge/frontend/src/design/tokens.css +0 -8
- package/src/cli/local-bridge/frontend/src/features/automations/AutomationsView.tsx +0 -153
- package/src/cli/local-bridge/frontend/src/features/capabilities/CapabilitiesView.tsx +0 -37
- package/src/cli/local-bridge/frontend/src/features/overview/OverviewView.tsx +0 -183
- package/src/cli/local-bridge/frontend/src/features/repositories/RepositoriesView.tsx +0 -2
- package/src/cli/local-bridge/frontend/src/features/system/SystemView.tsx +0 -2
- package/src/cli/local-bridge/frontend/src/features/work/WorkView.tsx +0 -4
- package/src/cli/local-bridge/frontend/src/lib/api.ts +0 -30
- package/src/cli/local-bridge/frontend/src/lib/format.ts +0 -4
- package/src/cli/local-bridge/frontend/src/lib/routes.ts +0 -7
- package/src/cli/local-bridge/frontend/src/main.tsx +0 -1
- package/src/cli/local-bridge/frontend/src/shell/AppShell.tsx +0 -1
- package/src/cli/local-bridge/frontend/src/shell/CommandBar.tsx +0 -2
- package/src/cli/local-bridge/frontend/src/shell/Sidebar.tsx +0 -4
- package/src/cli/local-bridge/frontend/src/styles.css +0 -28
- package/src/cli/local-bridge/frontend/src/types.ts +0 -15
- package/src/cli/local-bridge/frontend/src/vite-env.d.ts +0 -1
- package/src/cli/local-bridge/frontend/vite.config.ts +0 -27
- package/src/cli/local-bridge/ui-dist/app.css +0 -1
- package/src/cli/local-bridge/ui-dist/app.js +0 -11228
- package/src/runtime/control-plane/execution/content-equivalent-commit-authority.ts +0 -169
- package/src/runtime/control-plane/execution/direct-canonical-work-reconciliation.ts +0 -85
- package/src/runtime/control-plane/execution/direct-edit-work-completion.ts +0 -655
- package/src/runtime/control-plane/execution/work-finalization-service.ts +0 -2850
- package/src/runtime/control-plane/execution/work-path-scope.ts +0 -37
- package/src/runtime/control-plane/execution/work-task-receipt.ts +0 -468
- package/src/runtime/control-plane/facade/controller-round-relay.ts +0 -3
- package/src/runtime/control-plane/facade/work-admission-policy.ts +0 -142
- package/src/runtime/control-plane/facade/work-implementation-review.ts +0 -2
- package/src/runtime/control-plane/facade/work-state-machine.ts +0 -2
- package/src/runtime/control-plane/facade/work-task-projection.ts +0 -66
- package/src/runtime/control-plane/routing/index.ts +0 -1
- package/src/runtime/control-plane/routing/route-policy.ts +0 -401
- package/src/runtime/control-plane/routing/workspace-admission.ts +0 -70
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
## Decision
|
|
8
8
|
|
|
9
|
-
ChatGPT remains the semantic Controller. Forge may
|
|
9
|
+
ChatGPT remains the semantic Controller for goal interpretation, completion, waiting, and user-blocking decisions. The original stabilization rule that Forge may continue only after an explicit `continue_immediately` disposition is amended for V2 autonomous session continuation: once the exact Controller turn is provider-observed as settled, a still-nonterminal Work with no explicit stopping disposition has a Kernel-owned continuation obligation. This default is mechanical lifecycle policy, not semantic goal acceptance. Explicit `wait`, `wait_for_user`, `goal_complete`, active user-decision handoff, terminal Work, or bounded failure/budget state always wins and stops automatic continuation.
|
|
10
10
|
|
|
11
11
|
The supported dispositions are:
|
|
12
12
|
|
|
@@ -19,7 +19,9 @@ goal_complete
|
|
|
19
19
|
|
|
20
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
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
|
|
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 normally ends with an explicit ChatGPT disposition. If the provider proves the exact assistant turn has settled and no explicit disposition exists, Kernel policy closes that nonterminal round as `continue_immediately`; it never infers `goal_complete`. If an explicit stop state already exists, settled-turn replay is a no-op. Lease disappearance without either a disposition or exact turn-settled evidence remains abandonment/recovery, not implicit progress.
|
|
23
|
+
|
|
24
|
+
**2026-09-16 authority clarification:** this `turn settled` fact is a lower-layer ControllerRound liveness fallback only. It does not prove that a ChatGPT Web assistant response committed the Workflow Supervisor completion protocol, and it does not own cross-assistant-turn scheduling after the caller has ended. The outer commit/start authority is defined by [`20260916-workflow-supervisor-authority.md`](20260916-workflow-supervisor-authority.md), which requires the complete terminal control block and exact END marker plus causal effect identity.
|
|
23
25
|
|
|
24
26
|
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
27
|
|
|
@@ -27,7 +29,8 @@ A Requirement-bound relay scope is `requirement:<requirementId>`. A Goal without
|
|
|
27
29
|
|
|
28
30
|
## Lifecycle authority
|
|
29
31
|
|
|
30
|
-
- `rh_work controller_disposition` records the Controller's explicit semantic decision.
|
|
32
|
+
- `rh_work controller_disposition` records the Controller's explicit semantic decision; explicit stop dispositions override the default autonomous continuation rule.
|
|
33
|
+
- exact provider-observed Controller-turn settlement is evidence only; Kernel transition policy alone may convert a still-claimed, nonterminal round with no stop disposition into the existing `continue_immediately` lifecycle.
|
|
31
34
|
- `controller_release` is the only transition that may consume a pending immediate relay for that Work.
|
|
32
35
|
- the canonical ChatGPT launcher performs the next-round dispatch;
|
|
33
36
|
- Controller Session ownership, principal/session/instance fences, Handoff authority and external-effect policy remain unchanged and cannot be bypassed by Relay;
|
|
@@ -4,6 +4,8 @@ Status: Accepted implementation decision; live promotion certification remains r
|
|
|
4
4
|
|
|
5
5
|
Implementation note: Xiaohongshu platform-specific publishing choreography is migrated into versioned Workflow assets; Core retains only generic Workflow execution, reconciliation, evidence, and learning authorities; this decision document is not an operational state store.
|
|
6
6
|
|
|
7
|
+
2026-09-17 evolution: this loop is now a compatibility producer/consumer of the generic Cognitive Plane. `ExperienceRecord` remains canonical during migration and is transiently adapted at recall; it is not copied into a second durable memory authority. General cognition is defined by `20260917-cognitive-memory-foundation.md` and is not limited to publication outcomes or failures.
|
|
8
|
+
|
|
7
9
|
Forge self-defect observed during this delivery: an accidentally isolated Work was terminalized before its active controller lease was released, so cleanup was blocked until a separate controller_release; a subsequent maintenance diagnosis also reported accumulated terminal edit-session/temp ownership records. Treat this as one lifecycle-cleanup root-cause family rather than adding per-call workarounds. Maintenance diagnosis for this state took 25-35 seconds despite no source investigation, so cleanup ownership cardinality is also a performance concern. Track under the existing lifecycle-cleanup/maintenance root-cause issue if present; otherwise create one before this delivery closes. Do not create a duplicate authority for the same defect family.
|
|
8
10
|
|
|
9
11
|
The accepted user outcome is two consecutive, evidence-linked assistant rounds for one explicitly bound project/account. The first-party Xiaohongshu workflow is the concrete certification case for this implementation; production execution must enter through rh_work rather than direct platform choreography, with Workflow Runtime as the sole external-effect owner and canonical receipt producer. Operational priors remain mechanical only. Controller reasoning produces observations, hypotheses and lessons; no autonomous compiler, scheduler, authorization owner or database is introduced.
|
|
@@ -210,13 +210,15 @@ The implementation step must add focused failures at least at:
|
|
|
210
210
|
|
|
211
211
|
Assertions must cover status, lifecycleStage, `roundCount`, `repeatedStateCount`, provider-failure epoch/history, `authorityId`, `claimGeneration`, provider dispatch/effect receipt identity, duplicate-effect count and durable revision/CAS behavior.
|
|
212
212
|
|
|
213
|
-
##
|
|
213
|
+
## ControllerRound validation Supervisor Work acceptance sequence
|
|
214
214
|
|
|
215
|
-
|
|
215
|
+
Here, “Supervisor” is the historical name of the existing long-lived **ControllerRound validation Work lineage**. It is not the cross-assistant-turn Workflow Supervisor defined by `20260916-workflow-supervisor-authority.md` and owns no outer WorkflowRun scheduling authority.
|
|
216
|
+
|
|
217
|
+
Production validation uses that existing ControllerRound validation Work lineage. It may not manufacture a new Work/Requirement/relay to make the test pass.
|
|
216
218
|
|
|
217
219
|
1. Build and activate one exact candidate Runtime containing the transition policy.
|
|
218
220
|
2. Verify required provider/plugin capability on that installed Runtime before relay mutation.
|
|
219
|
-
3. Re-read the exact existing Supervisor Work, Requirement, relay scope, authority, blocked class, budgets and current record revision.
|
|
221
|
+
3. Re-read the exact existing ControllerRound validation Supervisor Work, Requirement, relay scope, authority, blocked class, budgets and current record revision.
|
|
220
222
|
4. Submit verified provider/environment recovery evidence for the existing `consecutive_failures` block.
|
|
221
223
|
5. Prove the same semantic round is rearmed without changing `roundCount`, `repeatedStateCount`, relay scope or per-round authority, and without erasing historical failure evidence.
|
|
222
224
|
6. Prove provider dispatch occurs at most once and exact Controller claim succeeds.
|
|
@@ -252,7 +254,7 @@ Do not:
|
|
|
252
254
|
- treat Browser/ChatGPT registration as Kernel-specific lifecycle logic,
|
|
253
255
|
- infer successful dispatch from a transport session id,
|
|
254
256
|
- reopen semantic terminal states from stalled recovery,
|
|
255
|
-
- create another Supervisor/relay to avoid the blocked lineage, or
|
|
257
|
+
- create another ControllerRound validation Supervisor Work/relay to avoid the blocked lineage, or
|
|
256
258
|
- keep parallel mutation tables in Scheduler/Launcher/MCP while claiming a central policy exists.
|
|
257
259
|
|
|
258
260
|
This ADR is the acceptance authority for the r3 ControllerRound recovery-convergence implementation.
|
|
@@ -294,3 +296,16 @@ Current outer composition demonstrates why this is necessary:
|
|
|
294
296
|
### Completion assertion
|
|
295
297
|
|
|
296
298
|
A static regression should fail if Scheduler, Launcher, MCP compatibility or provider adapters acquire a new direct ControllerRound status/blocker mutation table or write ControllerRound relay records outside the canonical apply executor. This is an architecture boundary, not a code-style preference.
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
## Workflow Supervisor boundary clarification
|
|
302
|
+
|
|
303
|
+
ControllerRound transition authority remains lower-layer execution authority. Any provider-observed `controller_turn_settled` event in this ADR is a mechanical liveness fallback for an exact claimed round. It must not be reused as the outer Workflow Supervisor's assistant-message commit event or next-turn scheduling authority. The latter requires the completed `FORGE_WORKFLOW_SUPERVISOR_V1` block, exact END marker, conversation identity and causal submission-effect evidence defined in [`20260916-workflow-supervisor-authority.md`](20260916-workflow-supervisor-authority.md).
|
|
304
|
+
|
|
305
|
+
## 2026-09-16 amendment: settled Controller turns cannot silently strand nonterminal Work
|
|
306
|
+
|
|
307
|
+
User-free continuation is a P0 lifecycle invariant. A provider may submit a typed `controller_turn_settled` fact only after the exact assistant turn is observably complete; prompt submission itself is not completion evidence. The provider supplies bounded completion evidence, never a disposition.
|
|
308
|
+
|
|
309
|
+
The canonical ControllerRound transition policy decides the consequence. If the current round is still `claimed`, its Work is nonterminal, and no explicit stop state exists, the policy records the existing `continue_immediately -> pending_release` lifecycle while preserving round/repeated/failure budgets. If an active control-plane Handoff proves a user decision is required, the same policy closes as `wait_for_user`. If `wait`, `wait_for_user`, `goal_complete`, `blocked`, `failed`, or another already-closed state won the race first, settled-turn replay is idempotent and changes nothing. Terminal Work is retired through the existing terminal-work transition.
|
|
310
|
+
|
|
311
|
+
This amendment does not create a second Scheduler or semantic Controller. It changes the default for one previously ambiguous state only: **a completed Controller turn may not leave a still-running Work silently claimed merely because the model failed to call the explicit continue helper.** The provider-specific observation and same-conversation dispatch mechanics remain adapter responsibilities, while all durable lifecycle mutation continues through this provider-neutral policy.
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
# Workflow Supervisor authority above the ChatGPT-turn / Forge execution boundary
|
|
2
|
+
|
|
3
|
+
Status: **Accepted architecture contract; production Runtime integration implemented, live unattended canary proof remains pending.**
|
|
4
|
+
|
|
5
|
+
Date: 2026-09-16
|
|
6
|
+
|
|
7
|
+
## Context
|
|
8
|
+
|
|
9
|
+
Forge already has durable authorities for repository Work, Controller ownership, ControllerRound transition, Scheduler occurrences, provider recovery, verification evidence, Outcome and Experience. Those authorities are inside the Forge execution/control plane. They can record that more semantic work is required and can prepare or dispatch a lower-layer continuation while the controlling call stack is alive.
|
|
10
|
+
|
|
11
|
+
That does not solve the outer lifecycle gap for a ChatGPT Web controller. A typical development loop is:
|
|
12
|
+
|
|
13
|
+
```text
|
|
14
|
+
ChatGPT assistant turn
|
|
15
|
+
-> calls Forge
|
|
16
|
+
-> Forge Work / ControllerRound executes
|
|
17
|
+
-> Forge returns evidence
|
|
18
|
+
-> ChatGPT reasons over the evidence
|
|
19
|
+
-> assistant response commits
|
|
20
|
+
-> original assistant/MCP call stack ends
|
|
21
|
+
X no durable authority outside that call stack owns starting the next assistant turn
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
A ControllerRound continuation record is therefore not, by itself, an assistant-turn scheduler. Likewise, an MCP session, Browser session, Work lease, Schedule occurrence, or conversation binding is not the authority to decide and durably execute the next outer ChatGPT turn.
|
|
25
|
+
|
|
26
|
+
The missing authority is a **Workflow Supervisor** above the ChatGPT-turn / Forge execution boundary. It is part of Forge's general autonomous-workflow architecture, but it is not another Work, ControllerRound, Scheduler, or MCP lifecycle owner.
|
|
27
|
+
|
|
28
|
+
## Decision
|
|
29
|
+
|
|
30
|
+
Introduce one logical `WorkflowRun` supervised by one durable **Workflow Supervisor**. The Supervisor owns only cross-turn continuation of the original Goal. It delegates each semantic turn to ChatGPT and delegates repository execution to Forge.
|
|
31
|
+
|
|
32
|
+
```text
|
|
33
|
+
Original Goal / logical WorkflowRun
|
|
34
|
+
|
|
|
35
|
+
v
|
|
36
|
+
Workflow Supervisor
|
|
37
|
+
durable single writer
|
|
38
|
+
|
|
|
39
|
+
v
|
|
40
|
+
ChatGPT assistant turn
|
|
41
|
+
|
|
|
42
|
+
v
|
|
43
|
+
Forge Controller / Work
|
|
44
|
+
|
|
|
45
|
+
v
|
|
46
|
+
repository execution
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
V1 is a **TypeScript/Bun Supervisor authority co-hosted inside the Canonical Forge Runtime process**. It has its own dedicated Supervisor persistence and Unix socket under the exact configured Controller Home, and only the Supervisor composition opens/writes that database. Authority separation is therefore defined by persistence/protocol/single-writer boundaries, not by inventing a second OS daemon. The existing Canonical Runtime launchd/systemd/portable lifecycle starts and stops Supervisor with the rest of the Runtime. Go or another runtime is reconsidered only if later packaging, restart-recovery or operability evidence proves a material benefit without changing this protocol or authority contract. ChatGPT Web is the first execution target, not the definition of the Supervisor.
|
|
50
|
+
|
|
51
|
+
### Authority matrix
|
|
52
|
+
|
|
53
|
+
| Concern | Authority | What it may decide | What it must not decide |
|
|
54
|
+
| --- | --- | --- | --- |
|
|
55
|
+
| 1. Forge Work completion | Forge Work finalization / completion receipt | Whether one Work has satisfied its declared Work contract and delivery gates | Whether the original multi-turn Goal is globally DONE |
|
|
56
|
+
| 2. ControllerRound continuation | Canonical provider-neutral ControllerRound transition policy | Lower-layer round transitions and fenced continuation obligations | Whether a new outer assistant turn should be scheduled after the caller has disappeared |
|
|
57
|
+
| 3. MCP / execution-session recovery | MCP/session/Controller ownership recovery authorities | Rebind transport, recover session/claim, preserve exact lower-layer authority | Goal semantics, outer turn scheduling, or user escalation |
|
|
58
|
+
| 4. ChatGPT assistant-turn commit | Workflow Supervisor completion contract, based on a complete final assistant message | Whether one supervised assistant turn committed a valid completion proposal | Goal acceptance merely because the page stopped generating |
|
|
59
|
+
| 5. Next assistant-turn startup | Workflow Supervisor | Reserve/reconcile and submit one next turn to the exact execution target | Forge Work internals or repository mutation |
|
|
60
|
+
| 6. Long-lived Goal completion | Requirement/Goal semantics plus the WorkflowRun `completionContract` | Validate that a model `DONE` proposal actually satisfies the original Goal and required gates | Treat one Work, patch, test, round or model assertion as sufficient by itself |
|
|
61
|
+
| 7. Stagnation / no-progress detection | Workflow Supervisor using execution-quality / evidence observations | Detect repeated checkpoints, no new evidence, repeated failure/verification/recovery patterns | Rewrite lower-layer verification gates or silently terminate the Goal |
|
|
62
|
+
| 8. Workflow strategy adaptation | Semantic Controller, guided by Supervisor correction policy and Experience/evaluation evidence | Choose a different execution strategy for the same Goal; later evaluate cross-Work candidates | Create a second execution state machine or promote policy without evidence |
|
|
63
|
+
|
|
64
|
+
The separation is deliberate. A lower layer may report facts upward, but it does not acquire the upper layer's lifecycle authority by exposing more states.
|
|
65
|
+
|
|
66
|
+
## Logical WorkflowRun contract
|
|
67
|
+
|
|
68
|
+
The generic upper-layer contract is intentionally small:
|
|
69
|
+
|
|
70
|
+
```text
|
|
71
|
+
WorkflowRun
|
|
72
|
+
objective
|
|
73
|
+
executionTarget
|
|
74
|
+
completionContract
|
|
75
|
+
continuationPolicy
|
|
76
|
+
userBlockerPolicy
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
`executionTarget` is an adapter identity. Initial support is ChatGPT Web; future targets may include ChatGPT Work, Forge local, Forge Cloud, browser/desktop automation, or another agent runtime.
|
|
80
|
+
|
|
81
|
+
`completionContract` is a read/validation contract for the original Goal and required evidence. For Forge-backed development Goals it may consult Requirement/Plan/Work receipts and semantic acceptance, but it does not mutate those lower authorities.
|
|
82
|
+
|
|
83
|
+
`continuationPolicy` defines the fixed enrollment/continuation template, exact target identity, recovery bounds and correction policy. It never accepts model-generated executable `next_prompt` content.
|
|
84
|
+
|
|
85
|
+
`userBlockerPolicy` validates whether a `NEEDS_USER` proposal is a genuine user-only action, authorization, consent/legal decision, or equivalent blocker with no autonomous recovery path.
|
|
86
|
+
|
|
87
|
+
### Namespace boundary
|
|
88
|
+
|
|
89
|
+
Forge already persists `workflow_run` for the declarative Workflow asset interpreter. That record is a checkpoint for executing a versioned Workflow asset; it is not the long-lived autonomous development Goal described here.
|
|
90
|
+
|
|
91
|
+
V1 Supervisor storage therefore uses a **dedicated Supervisor persistence authority/namespace**. It must not alias or reinterpret the existing declarative `workflow_run` record. Any future convergence requires an explicit migration and authority contract rather than a same-name shortcut.
|
|
92
|
+
|
|
93
|
+
## Assistant completion proposal protocol
|
|
94
|
+
|
|
95
|
+
Every supervised ChatGPT turn ends with exactly one machine-readable terminal block at the end of the assistant response:
|
|
96
|
+
|
|
97
|
+
```text
|
|
98
|
+
<<<FORGE_WORKFLOW_SUPERVISOR_V1>>>
|
|
99
|
+
{
|
|
100
|
+
"action": "CONTINUE",
|
|
101
|
+
"conversation_id": "<exact ChatGPT conversation id>",
|
|
102
|
+
"task_id": "<stable conversation-scoped Supervisor task id>",
|
|
103
|
+
"supervisor_state": "running",
|
|
104
|
+
"active_scope": "requirement:<id>",
|
|
105
|
+
"source_effect_id": "fx_...",
|
|
106
|
+
"checkpoint": "...",
|
|
107
|
+
"reason": "...",
|
|
108
|
+
"evidence": ["..."]
|
|
109
|
+
}
|
|
110
|
+
<<<END_FORGE_WORKFLOW_SUPERVISOR_V1>>>
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
`action` is exactly one of:
|
|
114
|
+
|
|
115
|
+
- `CONTINUE`: the original Goal is not complete and autonomous work remains.
|
|
116
|
+
- `DONE`: a terminal **proposal** that requires `completionContract` validation.
|
|
117
|
+
- `NEEDS_USER`: a blocker **proposal** that requires `userBlockerPolicy` validation.
|
|
118
|
+
|
|
119
|
+
Each newly rendered Supervisor prompt also requires exactly one concise user-visible status line before the control block, derived only from that same action:
|
|
120
|
+
|
|
121
|
+
- `CONTINUE` → `🔄 仍在执行,无需你操作`
|
|
122
|
+
- `NEEDS_USER` → `⏸ 需要你处理,暂时不要关闭会话`
|
|
123
|
+
- `DONE` → `✅ 已完成,可以关闭此会话`
|
|
124
|
+
|
|
125
|
+
This is presentation, not lifecycle authority or persisted state. In particular, completion wording is reserved for `DONE`; a model cannot make work complete by printing it, and the existing `completionContract` validation remains authoritative.
|
|
126
|
+
|
|
127
|
+
The exact `<<<END_FORGE_WORKFLOW_SUPERVISOR_V1>>>` marker is required before the Supervisor accepts the turn as committed. Prompt delivery, `Stop generating`, spinner/loading state, button state, DOM stability, a text-stability timer, Work completion, ControllerRound closure, or transport disconnection are not assistant-turn commit authority.
|
|
128
|
+
|
|
129
|
+
Every newly rendered Supervisor enrollment or continuation message also carries a machine-readable marker containing its daemon-minted `submission_effect_id` and instructs the assistant to echo exact `conversation_id`, stable `task_id`, `supervisor_state`, and `active_scope` together with `source_effect_id`. `supervisor_state` is redundant by design (`CONTINUE -> running`, `DONE -> done`, `NEEDS_USER -> needs_user`) so each response is independently classifiable. `active_scope` identifies the current durable lower-layer relay authority, normally `requirement:<id>` or `goal:<id>`; it never replaces that authority. The assistant may only echo these immutable/observed identities; it does not mint, rewrite or interpret them as executable prompt authority. A completion is commit-eligible only when `source_effect_id` matches the exact applied outbound effect for the exact task and conversation and the echoed identities match the registered task/scope. Already-reserved pre-upgrade effects remain parse-compatible so a Runtime upgrade does not strand an unknown remote effect.
|
|
130
|
+
|
|
131
|
+
The Supervisor never executes arbitrary model-provided `next_prompt`. Enrollment, normal continuation, recovery correction and stagnation correction use Supervisor-owned fixed templates. The normal same-conversation continuation is intentionally context-light. It does not repeat the original objective, checkpoint payload, Requirement/Plan/AGENTS text, or lower-layer authority context already present in the conversation. Its semantic instruction is bounded to one coherent safe work wave:
|
|
132
|
+
|
|
133
|
+
```text
|
|
134
|
+
Continue using the context already present in this same conversation.
|
|
135
|
+
Complete one coherent safe work wave and persist/checkpoint durable progress.
|
|
136
|
+
Use CONTINUE while autonomous work remains; use DONE only after the completion contract is satisfied; use NEEDS_USER only for a genuine user-only blocker.
|
|
137
|
+
Echo the immutable effect/task/conversation/scope identities and end with the FORGE_WORKFLOW_SUPERVISOR_V1 control block.
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Enrollment, recovery and correction prompts may include bounded original-objective, checkpoint, validation-result or lower-layer recovery context because those turns are specifically reconstructing durable state. Implementations may localize the wording, but not delegate prompt-chain control back to the assistant.
|
|
141
|
+
|
|
142
|
+
## DONE and NEEDS_USER validation
|
|
143
|
+
|
|
144
|
+
A model control block is evidence, not terminal authority.
|
|
145
|
+
|
|
146
|
+
For `DONE`, the Supervisor validates the configured `completionContract`. A Forge-backed development run must preserve the distinction between Requirement acceptance, Plan/Work delivery, verification/review evidence and outer Goal completion. Missing required evidence causes the `DONE` proposal to be rejected and converted into continuation/correction evidence; it does not lower the gate.
|
|
147
|
+
|
|
148
|
+
For `NEEDS_USER`, the Supervisor validates `userBlockerPolicy`. Test failures, tool failures, MCP errors, session replacement, provider recovery, implementation failures and ordinary Forge recovery are autonomous failure/recovery facts, not user blockers. A false `NEEDS_USER` proposal is rejected and routed to recovery/correction. Only a validated user-only blocker makes the WorkflowRun quiescent for user action.
|
|
149
|
+
|
|
150
|
+
## Single writer and event journal
|
|
151
|
+
|
|
152
|
+
The long-lived Supervisor authority hosted by Canonical Runtime is the **only durable writer** for Supervisor task/run state. Chrome Extension, Native Messaging transport, Forge execution, and lower schedulers submit observations or execute authorized effects; they never independently mutate Supervisor state.
|
|
153
|
+
|
|
154
|
+
V1 owns a dedicated `supervisor.sqlite` authority under the Forge user-data root instead of reusing `control-plane.sqlite`, generic `control_plane_records`, the declarative `workflow_run` namespace, or a collection of mutable status JSON files. It reuses only the runtime-neutral SQLite mechanics already proven by Forge: Bun/Node driver adaptation, WAL, foreign keys, bounded busy waiting, lifecycle integrity checks, statement finalization and short `BEGIN IMMEDIATE` write transactions.
|
|
155
|
+
|
|
156
|
+
The core schema keeps the exactly-once invariants relational rather than burying them in opaque JSON payloads. It has explicit task, append-oriented event and outbound-effect facts (`tasks`, `events`, `effects` or schema-equivalent names), with database-level uniqueness for committed completion fingerprints and for the one successor effect derived from a committed completion. Supervisor task identity is stable per exact conversation; Requirement and Work changes advance `active_scope` rather than minting a second outer-turn identity for the same conversation. Bounded discovered-conversation metadata may be persisted in the same Supervisor database so Runtime/browser restarts do not erase project inventory, but discovery rows are observations only and cannot reserve effects or terminalize a task by themselves. Durable journal facts include at least:
|
|
157
|
+
|
|
158
|
+
- enrollment / turn submission intent;
|
|
159
|
+
- assistant turn committed;
|
|
160
|
+
- continuation effect reserved;
|
|
161
|
+
- external effect observed `applied`, `not_applied`, or `unknown`;
|
|
162
|
+
- completion/blocker proposal validation;
|
|
163
|
+
- recovery/correction decisions;
|
|
164
|
+
- verified terminalization.
|
|
165
|
+
|
|
166
|
+
Current state is derived from those durable facts. The Canonical Forge Runtime owns the one long-lived process lifecycle and starts the Supervisor server in-process; Supervisor still owns its separate SQLite and Unix-JSONL socket authority. The Chrome Native Messaging host is only a bounded stdin/stdout-to-socket relay; it does not open `supervisor.sqlite`, make continuation/terminal decisions, or become a second writer. Relay processes may reconnect or respawn without changing WorkflowRun identity.
|
|
167
|
+
|
|
168
|
+
## Exactly-once continuation and external-effect reconciliation
|
|
169
|
+
|
|
170
|
+
Each supervised outbound turn is assigned a daemon-minted `submission_effect_id`, and the exact fixed outbound message embeds that id in its machine-readable marker. The completion of that turn is causally tied to that applied effect and must echo it as `source_effect_id`. When a stable provider message id is unavailable, the completion fingerprint is derived from:
|
|
171
|
+
|
|
172
|
+
```text
|
|
173
|
+
task identity
|
|
174
|
+
+ exact conversation identity
|
|
175
|
+
+ source_effect_id
|
|
176
|
+
+ canonical full assistant-response hash
|
|
177
|
+
+ control-block hash
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
This prevents two different turns with identical assistant text from colliding.
|
|
181
|
+
|
|
182
|
+
For a valid `CONTINUE`, one short SQLite transaction consumes/idempotently records the committed assistant completion and reserves the one successor `submission_effect_id`. Database uniqueness makes duplicate observations converge on the same logical successor effect. The transaction does not claim that the external ChatGPT send committed.
|
|
183
|
+
|
|
184
|
+
`DONE` and `NEEDS_USER` proposals have a different boundary because their contracts may read Forge or other authoritative evidence. The daemon first journals the proposal idempotently, releases the SQLite write transaction, performs the required read-only completion/blocker validation, then uses another short transaction either to record validated terminalization or to reserve a correction/continuation effect. No SQLite write lock is held across Forge, browser or other external evidence reads.
|
|
185
|
+
|
|
186
|
+
External send outcome uses the same three-way rule as Forge's non-idempotent effect reconciliation:
|
|
187
|
+
|
|
188
|
+
- `applied`: the exact effect marker/fixed outbound message is observed in the exact conversation; acknowledge it and never resend.
|
|
189
|
+
- `not_applied`: affirmative preserved-baseline proof establishes that the exact source completion is still the latest committed assistant turn, the latest user message is still the previously applied source/baseline message, and the target `submission_effect_id` marker is absent; only then may retry reuse the same reserved effect identity.
|
|
190
|
+
- `unknown`: any conflicting, newer, partial or otherwise insufficient observation stays reconciliation-only; do not blindly resend.
|
|
191
|
+
|
|
192
|
+
The crash windows before reservation, after reservation/before send, after send/before acknowledgement, and after acknowledgement must all converge through this journal plus remote observation. Daemon restart, extension reload, Chrome restart, tab close/reopen/discard/freeze, Native Messaging reconnect and Forge/MCP session replacement never create a new original Goal or a second continuation for the same committed completion.
|
|
193
|
+
|
|
194
|
+
## ChatGPT Web adapter boundary
|
|
195
|
+
|
|
196
|
+
The Chrome Extension is a discovery/assistant-observation adapter, not a state authority or outbound sender. Native macOS Browser transport is the single sender: it uses trusted input, confirms the composer contains the exact fixed prompt before it clicks Send, and waits for the exact committed user message before recording the effect outcome. It may:
|
|
197
|
+
|
|
198
|
+
- locate or open only an allowlisted exact conversation id/URL;
|
|
199
|
+
- obtain repository-derived ChatGPT Project scopes from the Supervisor and scan visible project links for canonical `/c/<id>` conversation identities;
|
|
200
|
+
- publish bounded project/conversation discovery observations; the Supervisor alone decides whether an unbound discovered conversation receives one enrollment effect;
|
|
201
|
+
- read the final complete assistant response, its echoed identity/state fields and `source_effect_id`, and forward bounded evidence;
|
|
202
|
+
- rediscover a closed/discarded tab without changing durable task identity.
|
|
203
|
+
|
|
204
|
+
It must not select durable tasks by mutable title, open the Supervisor database, decide `CONTINUE/DONE/NEEDS_USER`, invent prompts, weaken Forge gates, or depend on private ChatGPT APIs. A repository/project title is only a bounded discovery selector; exact conversation URL/id becomes the stable execution target before any enrollment effect exists. Transient generation UI may help avoid pointless reads but is never commit evidence.
|
|
205
|
+
|
|
206
|
+
Existing conversations require an explicit enrollment handshake. A conversation may be explicitly bound by a current Work or discovered inside the repository-derived ChatGPT Project scope. In either case the Supervisor persists exact conversation identity and one conversation-stable task, then reserves one fixed enrollment effect. A discovered conversation that has not yet recovered a durable Requirement must use a bootstrap enrollment turn that recovers the original task from conversation history plus Forge durable state and emits the exact `active_scope` before repository mutation. Repeated project scans never reserve a second bootstrap for an already enrolled conversation. A pre-enrollment response without the END marker is never retroactively imported as a committed supervised turn.
|
|
207
|
+
|
|
208
|
+
## Relationship to existing Forge continuation
|
|
209
|
+
|
|
210
|
+
The cross-turn dependency described in this section is superseded by [Supervisor turn authority](20261001-supervisor-turn-authority.md): ControllerRound remains initial admission and direct non-ChatGPT provider-effect authority, while enrolled ChatGPT turns use only the Supervisor causal effect ledger. Exact-conversation Supervisor lookup occurs before lower ControllerRound readiness, so an already-enrolled conversation cannot be stranded by a retired lower round. Every nonterminal Supervisor task must retain one mechanically derivable causal obligation; Runtime restart repairs missing enrollment/successor/terminal settlement from the existing ledger rather than adding lifecycle state. Schedule occurrences hand exact trigger identity into ControllerRound; Scheduler-owned continuation-dispatch persistence has been removed. ControllerRound is not the authority that reactivates ChatGPT after the outer assistant call stack is gone, and it is not proof that the long-lived WorkflowRun progressed or completed.
|
|
211
|
+
|
|
212
|
+
The existing Scheduler remains only an execution/occurrence scheduler. Once an exact Requirement-backed ChatGPT conversation binding exists, lower Scheduler/maintenance/direct-continuation paths must not submit the next outer ChatGPT turn; Workflow Supervisor is the single outer writer.
|
|
213
|
+
|
|
214
|
+
Standalone Supervisor lifecycle and release-bound live proof are reachable from the six-tool ChatGPT facade as the `controller.workflow_supervisor` core capability on `capability_execute`. Its `start/list/get/stop/proof` actions route into the same `WorkflowSupervisorControlPlane` adapter and dedicated Supervisor persistence. Newly generated autonomous turns carry typed automation metadata on their real Forge calls; the old receipt-only `rh_work repair` carrier is migration-only for already-issued prompts. The retained internal/compatibility `supervisor_task` definition is not a second facade or authority. ReleaseSession keeps Candidate B's isolated Runtime canaries separate from the real external multi-turn proof: after cutover the session remains `soaking` until the exact active release has durable `CONTINUE → CONTINUE → DONE` proof spanning a Runtime reconnect; only then may it become known-good.
|
|
215
|
+
|
|
216
|
+
No Supervisor state is added to Work, ControllerRound, relay, MCP session or existing declarative Workflow asset records in V1. Integration is through typed observations/read-only completion evidence and authorized execution effects.
|
|
217
|
+
|
|
218
|
+
## Stagnation and strategy evolution
|
|
219
|
+
|
|
220
|
+
P0 is cross-turn liveness and correctness: durable Supervisor, exactly-once/restart recovery and real unattended Avela development canaries.
|
|
221
|
+
|
|
222
|
+
After P0 proof, P1 may consume existing execution-quality and Experience evidence to detect repeated checkpoint/evidence/failure/verification/recovery patterns. First confirmed stagnation injects one fixed root-cause correction while keeping the same original Goal and gates. It does not immediately escalate to the user.
|
|
223
|
+
|
|
224
|
+
Only after P0/P1 evidence should P2 perform cross-Work strategy comparison, policy candidate trials, evaluation and bounded promotion. Existing Experience/evaluation authorities are reused rather than replaced.
|
|
225
|
+
|
|
226
|
+
## First P0 canary
|
|
227
|
+
|
|
228
|
+
The current P0 canary also exercises the Forge ChatGPT Project itself: the adapter must discover the repository-matched project conversations by exact `/c/<id>` identity, persist the inventory across Runtime restart, enroll each unbound nonterminal conversation at most once, and allow each conversation to recover its own durable `active_scope`. The historical Avela three-conversation canary remains valid evidence for exact-conversation isolation; promotion/excluded conversations must remain outside any configured discovery scope.
|
|
229
|
+
|
|
230
|
+
P0 is not complete when Forge can send one automatic `continue` or merely list browser tabs. It is complete only after a real project/conversation canary demonstrates multi-turn unattended progress with no user continuation messages, correct conversation isolation, no duplicate bootstrap/continuation, restart recovery, technical-failure recovery, MCP-session replacement, validated `DONE`, and validated `NEEDS_USER`, without lowering Forge verification/review/authorization gates.
|
|
231
|
+
|
|
232
|
+
## Consequences
|
|
233
|
+
|
|
234
|
+
- Forge gains one missing upper lifecycle authority instead of stretching lower state machines upward.
|
|
235
|
+
- The external protocol remains deliberately smaller than Forge's internal lifecycles.
|
|
236
|
+
- Exactly-once is treated as an external-effect reconciliation problem, not as a SQLite uniqueness problem pretending the network does not exist.
|
|
237
|
+
- ChatGPT remains the semantic reasoner, but model assertions do not bypass durable Goal or blocker evidence.
|
|
238
|
+
- The system can later add execution targets without making Chrome Extension behavior part of the kernel.
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
## Restart-safe remote effect generations
|
|
242
|
+
|
|
243
|
+
The remote ChatGPT send boundary is recovered from the Supervisor journal, never from browser-local shadow state. Each reserved effect keeps one stable `submission_effect_id`; retries do **not** mint a replacement effect. Instead, every authorized send attempt appends an `effect_dispatch_started` event carrying a monotonically increasing dispatch generation. Generation 1 is allowed before any prior dispatch. A later generation is allowed only when a canonical `effect_not_applied` event was committed after the previous dispatch. `effect_unknown` never authorizes a resend.
|
|
244
|
+
|
|
245
|
+
`not_applied` is a daemon-validated fact, not a caller assertion. The generic observation RPC may record only `applied` or `unknown`. The browser reconciliation path may commit `effect_not_applied` only when the exact conversation remains on the preserved dispatch baseline, the target effect marker is absent, and, for continuation/correction effects, the latest complete assistant response hashes to the exact source completion while the latest user message is the exact applied source-effect prompt. Any drift, partial response, conflicting message, missing baseline, or other ambiguity is recorded as `unknown` and remains reconciliation-only.
|
|
246
|
+
|
|
247
|
+
Raw ChatGPT page bodies are ephemeral verifier input. The Supervisor persists bounded hashes and a fixed allowlist of small browser evidence fields, not arbitrary `latest_user_text` or `latest_assistant_response` payloads. This keeps restart evidence durable without turning the event journal into a conversation mirror.
|
|
248
|
+
|
|
249
|
+
Daemon restart, Native Messaging respawn, extension reload, Chrome tab reopen/discard recovery, and Forge/MCP session replacement therefore reconstruct the same task/effect chain from `supervisor.sqlite`. The relay and extension may disappear and return freely; neither owns retry generations, terminal state, or durable recovery policy. Verified `DONE` and `NEEDS_USER` remain quiescent because terminal tasks expose no browser continuation command.
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# Generic Cognitive Plane and associative memory foundation
|
|
2
|
+
|
|
3
|
+
Status: Accepted and implemented Kernel V2 architecture foundation. Ongoing evolution must preserve the single Cognitive authority, bounded recall, and advisory-only policy boundary.
|
|
4
|
+
|
|
5
|
+
## Problem
|
|
6
|
+
|
|
7
|
+
The previous assistant learning loop persisted bounded `ExperienceRecord` and `OutcomeObservation` facts and reused them through lexical context injection. That is useful operational memory, but it is not a general learning substrate: it over-centers error/outcome feedback, stores most meaning as prose, has weak cross-memory association, and makes the model perform too much recall work through context/tool round trips.
|
|
8
|
+
|
|
9
|
+
Forge needs a domain-independent cognitive substrate that can learn from good examples, successful practice, explicit knowledge, novelty, corrections, contradictions, preferences, principles and procedures as well as failures. It must improve retrieval and information density without creating a second lifecycle/authority system.
|
|
10
|
+
|
|
11
|
+
## Learning admission is not authority promotion
|
|
12
|
+
|
|
13
|
+
Forge follows **learn early, trust gradually**. The model decides whether an observation would change future similar judgement/action and therefore deserves advisory memory. Repeated independent evidence may justify stronger confidence or a broader abstraction, but Forge never converts a repetition count, kind, keyword, score or failure frequency into semantic admission/generalization authority.
|
|
14
|
+
|
|
15
|
+
`LearningSignal.admissionSource` records provenance (`explicit_human`, `controller_observation`, `verified_outcome`, `execution_quality`, or `system_inference`); `kind` is open descriptive vocabulary; `portability` records semantic intent, not policy authority. Project-specific learning normally stays Project-local. When the model explicitly judges a distilled lesson genuinely cross-project, it may author Workspace advisory memory with portable intent regardless of admission-source category. Forge validates reachable scope/provenance/evidence and mechanical resource bounds only; it never auto-promotes a memory.
|
|
16
|
+
|
|
17
|
+
Confidence and utility are deliberately orthogonal. `confidence` measures evidentiary/semantic strength of the claim. `utility` is the initial retrieval-usefulness prior and may later be adjusted by context usage feedback without changing factual confidence. `salience` is only extraction-time importance. None of these scores grants policy authority.
|
|
18
|
+
|
|
19
|
+
Cognitive Memory remains advisory. Hard invariants continue to live in normal repository/project authority such as AGENTS, project contracts, architecture decisions, Requirements, Plans, Work acceptance, authorization, and verification gates. Learning never promotes itself into those authorities.
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## Authority boundary
|
|
23
|
+
|
|
24
|
+
The Cognitive Plane owns knowledge representation, association, consolidation and model projection. It does **not** own Requirement, Plan, Work, ControllerRound, Scheduler, safety, authorization, acceptance or repository lifecycle decisions. A cognitive record can advise a Controller; it cannot terminalize Work, bypass fencing or mutate hard policy.
|
|
25
|
+
|
|
26
|
+
Cognitive writes pass through an application `CognitiveWriteAuthorityPort` supplied by trusted composition. Controller-origin writes reuse reachable semantic Work/Requirement/Project/Workspace placement plus evidence checks; ordinary model-authored learning may be carried as optional `cognition_settlement` metadata on the successful MCP tool outcome that closes a meaningful task boundary. The MCP server settles it only after the primary result, so a learning failure cannot turn an already-applied repository/process/external effect into a retry signal. Persistence helpers are not a transport-facing write authority. MCP does not receive a parallel `memory.*` lifecycle.
|
|
27
|
+
|
|
28
|
+
## Canonical storage
|
|
29
|
+
|
|
30
|
+
Canonical cognitive metadata stays in the existing Controller SQLite authority. Memory units, evidence references and graph edges use structured tables instead of duplicating whole records into generic JSON payloads. Large immutable content is content-addressed under a SHA-256 CAS and referenced by digest/size/media type.
|
|
31
|
+
|
|
32
|
+
There is one durable truth. Existing `ExperienceRecord` remains a compatibility authority during migration and is projected transiently into `MemoryUnit` at recall; it is not copied into a second durable cognition row. New generic memories use the cognition store directly through the authority-bearing application service.
|
|
33
|
+
|
|
34
|
+
Derived concept/term indexes are rebuildable projections. Future vector/ANN, compact adjacency, bitmap, Float16/BLOB or other machine-native indexes follow the same rule: they may accelerate recall but never become a second truth. Corrupt/missing derived indexes are rebuilt from canonical memory.
|
|
35
|
+
|
|
36
|
+
## Representation
|
|
37
|
+
|
|
38
|
+
`MemoryUnit` is the high-information-density knowledge atom. It carries stable identity, scope, open facets, concepts, concise canonical text, provenance/evidence, confidence, utility, temporal validity, counter-evidence and a hot/warm/cold tier hint. Facets are descriptive rather than a lifecycle enum, allowing one unit to be both a principle, procedure and successful pattern.
|
|
39
|
+
|
|
40
|
+
`MemoryEdge` represents explicit relations such as `supports`, `contradicts`, `causes`, `derived_from`, `supersedes` or `analogous_to`. Relation vocabulary is open but validated. `CognitiveIR` is the machine-readable semantic boundary between durable knowledge and model projection; it is not CPU bytecode and does not replace provenance.
|
|
41
|
+
|
|
42
|
+
`LearningSignal` makes learning trigger-neutral. Kinds such as knowledge, success, failure, novelty, correction, contradiction, pattern, preference, principle and procedure are useful descriptive examples, not a closed taxonomy or admission list. Failure is one possible observation source, not the definition of learning.
|
|
43
|
+
|
|
44
|
+
## Retrieval and working memory
|
|
45
|
+
|
|
46
|
+
One bounded associative activation path combines stable-id seeds, exact concepts plus rebuildable lexical parts, lexical candidates, optional configured semantic-provider candidates, graph spreading, scope prior, recency, confidence, utility and usage feedback. All reachable scopes compete in that ranking. Consolidated patterns retain `derived_from` provenance but share one ordinary recall slot with those sources. Multi-cue natural language can qualify long memories without lowering the global cue threshold. No vector semantics are claimed without a configured provider. Candidate, depth, item and byte budgets are mechanical retrieval bounds, never semantic sufficiency thresholds.
|
|
47
|
+
|
|
48
|
+
The normal Controller hot path receives one compact initial `ActivationPack`; it does not simulate association with repeated MCP `memory.search` calls. The model decides whether that working set is enough. If not, the same `rh_context` surface supports progressive semantic expansion through a narrower query or explicit `knowledge_query`/`knowledge_limit`; routine micro-steps reuse the current set. Legacy Experience is admitted as transient candidates and de-duplicated by scope-qualified memory identity, never by bare id. Model-facing projection stays semantic typed JSON/text because ChatGPT consumes semantics, while machine-native binary/index encodings remain internal.
|
|
49
|
+
|
|
50
|
+
Scope-qualified identity survives the entire model-facing boundary: activation, AssistantContext item identity, ControllerRound snapshot and usage accounting all use the same scope-qualified memory address, so equal bare ids in different Work/Requirement/Plan/Project scopes cannot collide. Project knowledge is optional enrichment rather than a prerequisite for Cognitive recall; Work/Requirement/Plan memory remains available without a Project binding, while repository/project knowledge sources still require an explicit Project identity.
|
|
51
|
+
|
|
52
|
+
Temporal validity is part of candidate selection, not merely post-selection filtering. Canonical SQL reads exclude retracted, expired and not-yet-valid memories/edges before bounded `LIMIT` is applied, preventing inactive rows from starving live recall. If canonical memory exists while concept/term projections are missing or structurally corrupt, the cognition persistence owner rebuilds those derived indexes from canonical memory before normal activation proceeds and records the recovery in activation gaps.
|
|
53
|
+
|
|
54
|
+
## Consolidation and compression
|
|
55
|
+
|
|
56
|
+
Consolidation compresses **representation**, not semantics or provenance. Related traceable memories may form a warm consolidated representation plus `derived_from` edges, but Forge does not invent a higher-level abstraction or decide a broader scope. Independent repetition is evidence the model may use when distilling/generalizing; there is no fixed repeat threshold for local learning or Workspace generalization. Source memories stay addressable, and original evidence or CAS payload can be expanded when a summary is disputed, stale or insufficient.
|
|
57
|
+
|
|
58
|
+
Hot/warm/cold are retrieval/retention hints, not three durable authorities. Working memory is intentionally small; long-term storage is not capped to an arbitrary `1000` learned facts. Capacity pressure is handled by compact indexes, CAS de-duplication, consolidation and bounded activation rather than deleting knowledge merely to imitate human forgetting.
|
|
59
|
+
|
|
60
|
+
### Cross-project promotion
|
|
61
|
+
|
|
62
|
+
Portable `WorkspaceIdentity` is the existing cross-Project semantic boundary; no `global`/organization memory scope or second policy store is introduced. Project onboarding happens through the normal semantic placement path rather than repository registration. An authored `.forge/project-engineering.json` `projectId` is preferred; a canonical Git remote contributes a portable source fingerprint and becomes the stable Project-id source only when no authored project id exists. Later admissions preserve an existing Project's Workspace and reject source aliases or conflicting ForgeInstance-local placements rather than rebinding. Project-local observations should be distilled into Project lessons. Workspace advisory memory is written only when the model explicitly chooses Workspace scope plus portable intent because the abstraction is genuinely cross-project; this decision may be based on one strong source or many independent observations, but Forge has no automatic promotion formula.
|
|
63
|
+
|
|
64
|
+
Workspace memory remains advisory learned guidance and acquires no lifecycle, policy or acceptance authority. Forge never turns repeated failures, categories, scores or consolidated clusters into a Workspace lesson or Requirement candidate on its own. If learned knowledge implies a durable product/architecture change, the model/user explicitly enters the existing Requirement/Plan/Work authority. Project product/domain contracts, authored architecture, authorization and verification gates remain higher semantic authority and are never rewritten by learning.
|
|
65
|
+
|
|
66
|
+
Work-bound learning may be recorded at Controller-round closure but is not Controller lifecycle authority. The same writer is reached by lifecycle-free `learning_record` and one optional cognition-settlement field injected across the entire Controller MCP tool surface, including ordinary repository/edit/process work. Settlement occurs only after a successful primary tool result; settlement failure is surfaced separately so a completed primary effect is never misreported as failed and retried. With a selected reachable Work, Forge server-derives Work/Requirement provenance without fabricating a ControllerRound; otherwise Project/Workspace learning remains lifecycle-free. The active model emits typed semantic deltas, possibly in multiple transport-bounded batches; Forge derives source identity/time, validates scope/provenance/evidence and persists them without deciding their semantic meaning.
|
|
67
|
+
|
|
68
|
+
## Usage feedback and audit
|
|
69
|
+
|
|
70
|
+
`assistant_context_usage` is canonical ControllerRound evidence about whether each exact claim-time context item was used or rejected. It does not mutate factual confidence merely because an item was useful or irrelevant. A bounded rebuildable projection feeds future activation: `used` raises retrieval applicability, ordinary rejection lowers applicability, and stale/contradicted rejection contributes an explainable conflict penalty. Confidence changes only through supporting/counter evidence. The projection is scope-qualified, Project-aware, deterministic and idempotent; no second usage truth table is introduced.
|
|
71
|
+
|
|
72
|
+
`rh_context operation=search` is the read-only Cognitive audit surface. Explicit `knowledge_*` filters can inspect memory by reachable scope, concept, facet, source, source Work or exact memory id and return canonical provenance/confidence/utility/evidence/counter-evidence, relations/supersession, recent usage and query-time activation reasons/path. Knowledge-only audit may run without source-code retrieval; mixed audit never contributes to `ContextClosureReceipt` or mutation readiness. Audit is advisory observation, not write/lifecycle authority.
|
|
73
|
+
|
|
74
|
+
## Transport and encoding
|
|
75
|
+
|
|
76
|
+
Internal representation may use SQLite native columns, BLOBs, compact graph structures, vector encodings, bitmaps, varints or other machine-oriented formats when benchmarks justify them. The ChatGPT/MCP boundary remains compact semantic structured data. Base64-wrapped bytecode or machine code is not a model-facing optimization.
|
|
77
|
+
|
|
78
|
+
The performance target is the complete path: large long-term memory -> bounded local association -> small high-relevance working-memory pack -> one Controller context injection. Serialization micro-optimizations are subordinate to recall quality, round-trip count, latency and context bytes.
|
|
79
|
+
|
|
80
|
+
## Evolution boundary
|
|
81
|
+
|
|
82
|
+
This foundation supplies memory and learning primitives, not uncontrolled self-modification. Strategy evolution may use learned recurring patterns, normal Requirement/Plan/Work context, isolated candidates, shadow/canary evidence, and promotion receipts when the model judges them useful. A promotion receipt is a deterministic immutable evaluation attestation, not lifecycle or mutation authority: it is minted only by re-evaluating existing bounded evidence and has no clock-driven state, store, scheduler, policy writer, source writer, Requirement-creation authority, or approval authority. It may be attached to an exact review record as evidence; raw MCP review arguments cannot inject arbitrary trusted architecture evidence. Review, verification, and finalization are optional capability/evidence carriers, never prerequisite authorities for Git delivery or semantic Work completion.
|