create-walle 0.10.0 → 0.10.2
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/README.md +88 -41
- package/lib/owner-write-safety.js +135 -0
- package/lib/public-runtime.js +13 -5
- package/lib/release-schema.json +3 -2
- package/lib/runtime-closure-policy.json +7 -5
- package/package.json +10 -4
- package/template/bin/deps-doctor.js +1 -1
- package/template/bin/node-bin.sh +11 -0
- package/template/coding-task-manager/api-prompts.js +10 -22
- package/template/coding-task-manager/bin/capture-codex-rollout-records.js +417 -0
- package/template/coding-task-manager/bin/census-codex-lead-history.js +325 -0
- package/template/coding-task-manager/bin/claude-hook.js +7 -3
- package/template/coding-task-manager/bin/claude-table-parity.js +307 -0
- package/template/coding-task-manager/bin/conversation-storage-auto-migration-lib.js +16 -1
- package/template/coding-task-manager/bin/conversation-storage-generation-evidence.js +9 -2
- package/template/coding-task-manager/bin/conversation-storage-service-entry-lib.js +16 -1
- package/template/coding-task-manager/bin/conversation-storage-walle-owner.js +247 -0
- package/template/coding-task-manager/bin/ctm-machine-pair.js +160 -0
- package/template/coding-task-manager/bin/lead-wait-census.js +1348 -0
- package/template/coding-task-manager/bin/repair-foreign-clone.js +564 -0
- package/template/coding-task-manager/bin/repair-resume-echo-titles.js +248 -0
- package/template/coding-task-manager/bin/seam-replay-codex.js +301 -0
- package/template/coding-task-manager/bin/write-lock-bench.js +111 -0
- package/template/coding-task-manager/db.js +705 -286
- package/template/coding-task-manager/git-utils.js +44 -0
- package/template/coding-task-manager/lib/adopted-host-redial.js +4 -0
- package/template/coding-task-manager/lib/agent-presets.js +15 -0
- package/template/coding-task-manager/lib/agent-title-apply.js +88 -0
- package/template/coding-task-manager/lib/agent-title-backfill-read.js +92 -0
- package/template/coding-task-manager/lib/api/host-stats.js +98 -0
- package/template/coding-task-manager/lib/api/ingress.js +35 -12
- package/template/coding-task-manager/lib/api/machine-pairing.js +285 -0
- package/template/coding-task-manager/lib/api/machine-pool.js +307 -0
- package/template/coding-task-manager/lib/api/machines.js +461 -0
- package/template/coding-task-manager/lib/api/misc-ops.js +20 -5
- package/template/coding-task-manager/lib/api/providers.js +53 -6
- package/template/coding-task-manager/lib/api/resume-from-store.js +25 -0
- package/template/coding-task-manager/lib/api/sessions.js +160 -8
- package/template/coding-task-manager/lib/api/transcript-history.js +17 -4
- package/template/coding-task-manager/lib/api/worktrees.js +38 -37
- package/template/coding-task-manager/lib/approval-drift.js +16 -1
- package/template/coding-task-manager/lib/approval-logical-frame.js +5 -1
- package/template/coding-task-manager/lib/approval-scope.js +68 -4
- package/template/coding-task-manager/lib/auth-context.js +32 -2
- package/template/coding-task-manager/lib/auth-rate-limit.js +41 -1
- package/template/coding-task-manager/lib/auth-rules.js +186 -45
- package/template/coding-task-manager/lib/broadcast-serialize.js +2 -1
- package/template/coding-task-manager/lib/browser-session-broker.js +9 -1
- package/template/coding-task-manager/lib/browser-use-adapter.js +33 -2
- package/template/coding-task-manager/lib/claude-markdown-ansi.js +27 -85
- package/template/coding-task-manager/lib/claude-session-title.js +6 -30
- package/template/coding-task-manager/lib/claude-table-layout.js +322 -0
- package/template/coding-task-manager/lib/client-diag-handler.js +25 -0
- package/template/coding-task-manager/lib/codex-config-guard.js +33 -3
- package/template/coding-task-manager/lib/codex-harness-qualification.js +12 -0
- package/template/coding-task-manager/lib/codex-history-terminal-renderer.js +33 -33
- package/template/coding-task-manager/lib/codex-launch-health.js +29 -2
- package/template/coding-task-manager/lib/codex-link-preparation.js +9 -8
- package/template/coding-task-manager/lib/codex-local-links.js +267 -0
- package/template/coding-task-manager/lib/codex-markdown-lists.js +160 -0
- package/template/coding-task-manager/lib/codex-native-history-prefix.js +4 -0
- package/template/coding-task-manager/lib/codex-paths.js +2 -1
- package/template/coding-task-manager/lib/codex-source-handoff.js +186 -0
- package/template/coding-task-manager/lib/coding-agent-models.js +21 -30
- package/template/coding-task-manager/lib/coding-session-model-adapters.js +27 -2
- package/template/coding-task-manager/lib/coding-session-model-projection.js +5 -0
- package/template/coding-task-manager/lib/coding-session-model-runtime.js +1 -2
- package/template/coding-task-manager/lib/coding-session-model-state.js +10 -0
- package/template/coding-task-manager/lib/coding-session-model-sync-state.js +0 -1
- package/template/coding-task-manager/lib/conversation-import/cursor-guard-owner.js +10 -0
- package/template/coding-task-manager/lib/create/resolve-launch-params.js +8 -1
- package/template/coding-task-manager/lib/ctm-boot-lifecycle.js +17 -1
- package/template/coding-task-manager/lib/db-domain-tables.js +7 -0
- package/template/coding-task-manager/lib/db-domains.js +21 -2
- package/template/coding-task-manager/lib/db-owner-op-registry.js +7 -0
- package/template/coding-task-manager/lib/db-owner-worker-client.js +22 -0
- package/template/coding-task-manager/lib/db-schema-source-files.js +1 -0
- package/template/coding-task-manager/lib/feature-manifest.js +1 -3
- package/template/coding-task-manager/lib/fs-watcher.js +3 -2
- package/template/coding-task-manager/lib/harness-history-transition.js +41 -14
- package/template/coding-task-manager/lib/headless-inflight-ops.js +203 -0
- package/template/coding-task-manager/lib/headless-missing-reply.js +42 -0
- package/template/coding-task-manager/lib/headless-term-service.js +60 -23
- package/template/coding-task-manager/lib/history-transition-read-op.js +179 -23
- package/template/coding-task-manager/lib/host-control-dial.js +167 -0
- package/template/coding-task-manager/lib/host-handoff-orchestrator.js +16 -2
- package/template/coding-task-manager/lib/host-handoff.js +51 -13
- package/template/coding-task-manager/lib/host-health-ledger.js +164 -12
- package/template/coding-task-manager/lib/host-self-truth-watchdog.js +4 -0
- package/template/coding-task-manager/lib/host-stats.js +328 -0
- package/template/coding-task-manager/lib/host-threadpool-evacuation.js +160 -0
- package/template/coding-task-manager/lib/host-threadpool-monitor.js +14 -1
- package/template/coding-task-manager/lib/hosted-input-dispatch.js +203 -0
- package/template/coding-task-manager/lib/hosted-sync-worker.js +113 -5
- package/template/coding-task-manager/lib/instance-id-ownership-manifest.js +4 -0
- package/template/coding-task-manager/lib/instance-manifest-runtime.js +3 -0
- package/template/coding-task-manager/lib/instance-manifest.js +13 -1
- package/template/coding-task-manager/lib/instance-sync-status.js +15 -0
- package/template/coding-task-manager/lib/kernel/diag-log.js +12 -0
- package/template/coding-task-manager/lib/launch-model-override.js +160 -1
- package/template/coding-task-manager/lib/launch-plan-worker.js +59 -2
- package/template/coding-task-manager/lib/lead-model-observer.js +17 -2
- package/template/coding-task-manager/lib/lead-model-switch-runtime.js +57 -4
- package/template/coding-task-manager/lib/lead-model-switch.js +11 -2
- package/template/coding-task-manager/lib/lead-model-transition-runtime.js +42 -4
- package/template/coding-task-manager/lib/lead-model-transition-store.js +61 -3
- package/template/coding-task-manager/lib/legacy-draft-cancellation-recovery.js +111 -0
- package/template/coding-task-manager/lib/login-tripwire.js +18 -0
- package/template/coding-task-manager/lib/machine-pairing.js +238 -0
- package/template/coding-task-manager/lib/machine-pool.js +409 -0
- package/template/coding-task-manager/lib/machine-registry.js +749 -0
- package/template/coding-task-manager/lib/machine-self.js +66 -0
- package/template/coding-task-manager/lib/main-thread-lint-exemptions.json +56 -4
- package/template/coding-task-manager/lib/media-journal-control-reader.js +473 -0
- package/template/coding-task-manager/lib/media-journal.js +84 -27
- package/template/coding-task-manager/lib/media-store-options.js +43 -15
- package/template/coding-task-manager/lib/migrations/v56-host-samples-and-machine-pool.js +76 -0
- package/template/coding-task-manager/lib/mirror-feed-sanitize.js +12 -3
- package/template/coding-task-manager/lib/model-execution-recipe-metadata.js +16 -3
- package/template/coding-task-manager/lib/model-proxy/anthropic-face.js +4 -0
- package/template/coding-task-manager/lib/model-proxy/chat-response-translators.js +3 -0
- package/template/coding-task-manager/lib/model-proxy/collaboration-codec.js +94 -0
- package/template/coding-task-manager/lib/model-proxy/handoff.js +494 -0
- package/template/coding-task-manager/lib/model-proxy/lead-worker-picks.js +25 -0
- package/template/coding-task-manager/lib/model-proxy/native-lead-listener.js +61 -7
- package/template/coding-task-manager/lib/model-proxy/proxy-cli.js +200 -0
- package/template/coding-task-manager/lib/model-proxy/proxy-instance-record.js +257 -0
- package/template/coding-task-manager/lib/model-proxy/responses-face.js +24 -2
- package/template/coding-task-manager/lib/model-proxy/stream-accounting.js +205 -0
- package/template/coding-task-manager/lib/model-proxy/tokens.js +78 -0
- package/template/coding-task-manager/lib/model-proxy/upstream-outcome.js +9 -0
- package/template/coding-task-manager/lib/native-history-control.js +62 -14
- package/template/coding-task-manager/lib/native-lead-settings-client.js +2 -1
- package/template/coding-task-manager/lib/native-lead-tls.js +18 -4
- package/template/coding-task-manager/lib/oauth-proxy-supervisor.js +628 -64
- package/template/coding-task-manager/lib/owner-action-manifest-data.json +14 -0
- package/template/coding-task-manager/lib/painted-row-recorder.js +9 -1
- package/template/coding-task-manager/lib/prompt-admission-trace.js +69 -0
- package/template/coding-task-manager/lib/prompt-submission-contract.js +21 -1
- package/template/coding-task-manager/lib/provider-login-broker.js +192 -9
- package/template/coding-task-manager/lib/provider-login-capture.js +153 -0
- package/template/coding-task-manager/lib/queue-draft-status-overlay.js +36 -0
- package/template/coding-task-manager/lib/raw-codex-history-window.js +5 -3
- package/template/coding-task-manager/lib/raw-history-block.js +3 -1
- package/template/coding-task-manager/lib/read-pool-client.js +36 -24
- package/template/coding-task-manager/lib/read-pool-op-registry.js +10 -1
- package/template/coding-task-manager/lib/read-pool-telemetry.js +14 -5
- package/template/coding-task-manager/lib/recent-catalog-query.js +26 -0
- package/template/coding-task-manager/lib/recent-session-catalog-response.js +9 -0
- package/template/coding-task-manager/lib/remote-command-context.js +12 -0
- package/template/coding-task-manager/lib/remote-command-runtime.js +18 -5
- package/template/coding-task-manager/lib/remote-machine-catalog.js +1062 -0
- package/template/coding-task-manager/lib/remote-machine-create.js +693 -0
- package/template/coding-task-manager/lib/remote-machine-link.js +939 -0
- package/template/coding-task-manager/lib/remote-machine-proxy.js +520 -0
- package/template/coding-task-manager/lib/remote-session-forward.js +306 -0
- package/template/coding-task-manager/lib/remote-submission-status.js +6 -0
- package/template/coding-task-manager/lib/restart-outcome-truth.js +20 -3
- package/template/coding-task-manager/lib/restart-preflight.js +9 -2
- package/template/coding-task-manager/lib/restore-backoff-gate.js +10 -2
- package/template/coding-task-manager/lib/restore-prepare-retry.js +12 -5
- package/template/coding-task-manager/lib/restore-resume-batch.js +22 -1
- package/template/coding-task-manager/lib/resume-blocked-wire.js +62 -1
- package/template/coding-task-manager/lib/resume-cwd.js +13 -0
- package/template/coding-task-manager/lib/resume-from-store.js +12 -1
- package/template/coding-task-manager/lib/resume-origin-facts.js +38 -1
- package/template/coding-task-manager/lib/resume-preflight.js +21 -16
- package/template/coding-task-manager/lib/review-repo-admission.js +39 -6
- package/template/coding-task-manager/lib/review-repo-registry.js +17 -0
- package/template/coding-task-manager/lib/root-delivery-runtime.js +72 -15
- package/template/coding-task-manager/lib/root-delivery-selection.js +37 -1
- package/template/coding-task-manager/lib/root-prompt-admission.js +43 -11
- package/template/coding-task-manager/lib/root-prompt-flow.js +175 -38
- package/template/coding-task-manager/lib/scrollback-archive-store.js +7 -4
- package/template/coding-task-manager/lib/server-memory-sampler-runtime.js +10 -0
- package/template/coding-task-manager/lib/server-memory-sampler.js +41 -2
- package/template/coding-task-manager/lib/session-analysis-memory.js +2 -0
- package/template/coding-task-manager/lib/session-create/codex-native-provider-gate.js +218 -0
- package/template/coding-task-manager/lib/session-create/codex-resume-exit-classify.js +52 -0
- package/template/coding-task-manager/lib/session-create/delegate-worker.js +95 -6
- package/template/coding-task-manager/lib/session-create/identity.js +20 -1
- package/template/coding-task-manager/lib/session-create/prepared.js +69 -1
- package/template/coding-task-manager/lib/session-create/provider-launch-context.js +77 -0
- package/template/coding-task-manager/lib/session-create/provider-process.js +38 -39
- package/template/coding-task-manager/lib/session-create/response.js +30 -12
- package/template/coding-task-manager/lib/session-create/transcript.js +13 -4
- package/template/coding-task-manager/lib/session-create/worker-continuation.js +43 -1
- package/template/coding-task-manager/lib/session-create/worker-notices.js +94 -5
- package/template/coding-task-manager/lib/session-create/worker-observability.js +99 -7
- package/template/coding-task-manager/lib/session-create/worker-stop.js +11 -3
- package/template/coding-task-manager/lib/session-create/worker-wait-watcher.js +315 -0
- package/template/coding-task-manager/lib/session-geometry-authority-handler.js +10 -1
- package/template/coding-task-manager/lib/session-host-manager.js +152 -206
- package/template/coding-task-manager/lib/session-jobs.js +17 -9
- package/template/coding-task-manager/lib/session-lifecycle.js +20 -50
- package/template/coding-task-manager/lib/session-model-action-preconditions.js +68 -3
- package/template/coding-task-manager/lib/session-resource-sampler.js +67 -9
- package/template/coding-task-manager/lib/session-standup.js +67 -4
- package/template/coding-task-manager/lib/session-status-ledger.js +42 -3
- package/template/coding-task-manager/lib/session-status-runtime.js +45 -1
- package/template/coding-task-manager/lib/session-status.js +2 -2
- package/template/coding-task-manager/lib/session-title-mirror.js +25 -57
- package/template/coding-task-manager/lib/session-transcript-trash.js +8 -1
- package/template/coding-task-manager/lib/startup-pointer-write.js +57 -0
- package/template/coding-task-manager/lib/state-sync/painted-frame-field.js +11 -0
- package/template/coding-task-manager/lib/storage/coding-session-model-store.js +21 -22
- package/template/coding-task-manager/lib/surviving-owner-bootstrap.js +7 -2
- package/template/coding-task-manager/lib/surviving-owner-recovery.js +2 -1
- package/template/coding-task-manager/lib/terminal-draft-http-status.js +25 -0
- package/template/coding-task-manager/lib/transcript-archiver.js +229 -229
- package/template/coding-task-manager/lib/transcript-frame-cache.js +12 -2
- package/template/coding-task-manager/lib/transcript-guard-job.js +55 -4
- package/template/coding-task-manager/lib/transcript-link.js +77 -0
- package/template/coding-task-manager/lib/transcript-manifest-store.js +8 -4
- package/template/coding-task-manager/lib/transcript-source.js +8 -3
- package/template/coding-task-manager/lib/transcript-store.js +40 -0
- package/template/coding-task-manager/lib/tunnel-lane-governor.js +6 -3
- package/template/coding-task-manager/lib/typing-interaction-trace.js +136 -2
- package/template/coding-task-manager/lib/typing-worker-stages.js +208 -1
- package/template/coding-task-manager/lib/usage-ledger/claude-parse.js +53 -2
- package/template/coding-task-manager/lib/usage-ledger/ingest.js +13 -4
- package/template/coding-task-manager/lib/usage-ledger/read.js +14 -0
- package/template/coding-task-manager/lib/usage-ledger/schema.js +49 -1
- package/template/coding-task-manager/lib/usage-ledger/store.js +337 -6
- package/template/coding-task-manager/lib/usage-ledger/task-read.js +123 -5
- package/template/coding-task-manager/lib/visible-revision-watchdog.js +8 -12
- package/template/coding-task-manager/lib/wake-skip-reasons.js +46 -0
- package/template/coding-task-manager/lib/walle-supervisor.js +98 -14
- package/template/coding-task-manager/lib/worker-failure-classify.js +13 -1
- package/template/coding-task-manager/lib/ws/input.js +1 -0
- package/template/coding-task-manager/lib/ws/state-sync.js +19 -2
- package/template/coding-task-manager/lib/ws/terminal-attach.js +32 -1
- package/template/coding-task-manager/lib/ws-router.js +68 -1
- package/template/coding-task-manager/lib/ws-send-admission.js +22 -4
- package/template/coding-task-manager/oauth-proxy.js +99 -55
- package/template/coding-task-manager/package-lock.json +24 -0
- package/template/coding-task-manager/package.json +3 -0
- package/template/coding-task-manager/protocol/message-table.json +0 -10
- package/template/coding-task-manager/protocol/messages.js +0 -10
- package/template/coding-task-manager/protocol/ws-schema.json +0 -20
- package/template/coding-task-manager/protocol/ws-schema.md +0 -2
- package/template/coding-task-manager/providers/codex-mcp-extract.js +121 -19
- package/template/coding-task-manager/providers/codex-mcp.js +14 -5
- package/template/coding-task-manager/public/css/app.css +279 -2
- package/template/coding-task-manager/public/css/reviews.css +4 -0
- package/template/coding-task-manager/public/index.html +297 -240
- package/template/coding-task-manager/public/js/app/machines-page.js +1252 -0
- package/template/coding-task-manager/public/js/app/models-tab.js +546 -36
- package/template/coding-task-manager/public/js/app/worktrees-panel.js +7 -5
- package/template/coding-task-manager/public/js/background-work.js +13 -7
- package/template/coding-task-manager/public/js/client-health-core.js +81 -0
- package/template/coding-task-manager/public/js/client-health-main.js +61 -0
- package/template/coding-task-manager/public/js/coding-session-model-presentation.js +44 -4
- package/template/coding-task-manager/public/js/core/session-commands.js +676 -0
- package/template/coding-task-manager/public/js/core/session-selectors.js +5 -1
- package/template/coding-task-manager/public/js/history-app-seam.js +26 -2
- package/template/coding-task-manager/public/js/history-painted-rows.js +17 -2
- package/template/coding-task-manager/public/js/history-reader-park.js +13 -1
- package/template/coding-task-manager/public/js/history-scroller.js +187 -9
- package/template/coding-task-manager/public/js/history-transcript-pages.js +5 -5
- package/template/coding-task-manager/public/js/machine-pool-shared.js +436 -0
- package/template/coding-task-manager/public/js/private-state-scope.js +31 -3
- package/template/coding-task-manager/public/js/prompt-submission-client.js +173 -4
- package/template/coding-task-manager/public/js/prompt-submission-tray.js +281 -0
- package/template/coding-task-manager/public/js/protocol.js +0 -10
- package/template/coding-task-manager/public/js/queue-panel-submission-reconcile.js +174 -1
- package/template/coding-task-manager/public/js/reviews.js +7 -3
- package/template/coding-task-manager/public/js/root-draft-lifetime.js +139 -2
- package/template/coding-task-manager/public/js/root-queue-builder-lifetime.js +16 -0
- package/template/coding-task-manager/public/js/row-join.js +18 -3
- package/template/coding-task-manager/public/js/session-model-picker.js +1 -1
- package/template/coding-task-manager/public/js/session-search-utils.js +46 -19
- package/template/coding-task-manager/public/js/session-usage-view.js +1 -0
- package/template/coding-task-manager/public/js/state-sync-client.js +4 -0
- package/template/coding-task-manager/public/js/terminal/runtime-02.js +16 -7
- package/template/coding-task-manager/public/js/terminal/runtime-03.js +41 -0
- package/template/coding-task-manager/public/js/terminal/runtime-04.js +41 -4
- package/template/coding-task-manager/public/js/terminal/runtime-12.js +52 -2
- package/template/coding-task-manager/public/js/terminal/runtime-16.js +12 -12
- package/template/coding-task-manager/public/js/terminal/runtime-18.js +14 -0
- package/template/coding-task-manager/public/js/terminal/runtime-19.js +8 -4
- package/template/coding-task-manager/public/js/terminal/runtime-20.js +210 -73
- package/template/coding-task-manager/public/js/terminal/runtime-21.js +19 -6
- package/template/coding-task-manager/public/js/terminal/runtime-22.js +86 -0
- package/template/coding-task-manager/public/js/terminal-history-viewport.js +1 -3
- package/template/coding-task-manager/public/js/terminal-wheel.js +39 -2
- package/template/coding-task-manager/public/js/walle/chat-conversation.js +11 -3
- package/template/coding-task-manager/public/js/walle-session.js +30 -7
- package/template/coding-task-manager/public/m/app.css +226 -8
- package/template/coding-task-manager/public/m/app.js +502 -9
- package/template/coding-task-manager/public/m/index.html +38 -1
- package/template/coding-task-manager/public/m/machines.js +1313 -0
- package/template/coding-task-manager/public/m/pool-failover.js +391 -0
- package/template/coding-task-manager/public/m/private-queue-actions.js +26 -7
- package/template/coding-task-manager/public/m/sw.js +5 -0
- package/template/coding-task-manager/queue-engine.js +13 -0
- package/template/coding-task-manager/server/approvals.js +5 -6
- package/template/coding-task-manager/server/boot.js +136 -17
- package/template/coding-task-manager/server.js +964 -425
- package/template/coding-task-manager/session-integrity.js +7 -9
- package/template/coding-task-manager/workers/db-owner-worker.js +53 -7
- package/template/coding-task-manager/workers/read-pool-worker.js +17 -6
- package/template/coding-task-manager/workers/session-host-pool-process.js +18 -4
- package/template/coding-task-manager/workers/session-host-process.js +14 -3
- package/template/coding-task-manager/workers/transcript-archive-worker.js +1 -1
- package/template/coding-task-manager/workers/worktree-worker.js +34 -0
- package/template/package-lock.json +2 -2
- package/template/package.json +1 -1
- package/template/scripts/conversation-storage-v2-migration.js +78 -11
- package/template/shared/conversation-storage-v2-contract.js +42 -6
- package/template/shared/fixtures/worker-status-payloads.json +392 -0
- package/template/shared/git-remote-key.js +83 -0
- package/template/shared/host-identity.js +98 -2
- package/template/shared/owner-write-safety.js +135 -0
- package/template/shared/public-runtime.js +13 -5
- package/template/shared/release-schema.json +3 -2
- package/template/shared/report-citations.js +14 -0
- package/template/shared/sqlite-write-lock.js +361 -223
- package/template/shared/storage/contract.js +35 -3
- package/template/wall-e/agent.js +21 -0
- package/template/wall-e/api-walle.js +5 -0
- package/template/wall-e/bin/brain-purge-legacy-ctm.js +3 -2
- package/template/wall-e/bin/walle-mcp-stdio.js +12 -6
- package/template/wall-e/brain/helper-rules-schema.js +129 -0
- package/template/wall-e/brain/migrations.js +51 -22
- package/template/wall-e/brain/model-deployment-facts.js +31 -1
- package/template/wall-e/brain/owner-call-whitelist.js +16 -0
- package/template/wall-e/brain/schema-ensures.js +22 -0
- package/template/wall-e/brain.js +1 -1
- package/template/wall-e/coding/host-capabilities.js +2 -2
- package/template/wall-e/coding/journal-dispatcher.js +51 -0
- package/template/wall-e/coding/session-journal.js +28 -40
- package/template/wall-e/coding-orchestrator.js +23 -26
- package/template/wall-e/fly.toml +1 -1
- package/template/wall-e/http/auth.js +18 -1
- package/template/wall-e/http/blog-views-api.js +318 -0
- package/template/wall-e/http/helper-rules-api.js +321 -0
- package/template/wall-e/http/model-proxy-providers.js +3 -1
- package/template/wall-e/http/telemetry-api.js +12 -0
- package/template/wall-e/lib/blog-view-policy.js +88 -0
- package/template/wall-e/lib/blog-view-store.js +169 -0
- package/template/wall-e/lib/client-config-lock.js +2 -1
- package/template/wall-e/lib/coding-journal-writer-child-client.js +67 -18
- package/template/wall-e/lib/error-kinds.js +10 -1
- package/template/wall-e/lib/feature-manifest.js +1 -1
- package/template/wall-e/lib/helper-rules/cell-state.js +123 -0
- package/template/wall-e/lib/helper-rules/evaluate.js +357 -0
- package/template/wall-e/lib/helper-rules/explore-rubric.md +12 -0
- package/template/wall-e/lib/helper-rules/grade.js +277 -0
- package/template/wall-e/lib/helper-rules/label.js +247 -0
- package/template/wall-e/lib/helper-rules/lead-call-hook.js +522 -0
- package/template/wall-e/lib/helper-rules/store.js +667 -0
- package/template/wall-e/lib/mcp-integration.js +5 -6
- package/template/wall-e/lib/runtime-worker-pool.js +1 -0
- package/template/wall-e/lib/scheduler-worker-jobs.js +6 -0
- package/template/wall-e/lib/telemetry-db-schema.js +37 -0
- package/template/wall-e/lib/telemetry-process-client.js +76 -1
- package/template/wall-e/llm/default-fallback.js +4 -0
- package/template/wall-e/llm/model-catalog.js +13 -4
- package/template/wall-e/llm/model-roles.js +6 -0
- package/template/wall-e/llm/portkey-http.js +150 -0
- package/template/wall-e/llm/portkey-sync.js +15 -145
- package/template/wall-e/llm/worker-mcp-routing.js +61 -0
- package/template/wall-e/llm/worker-route.js +43 -1
- package/template/wall-e/loops/brain-custom-writes.js +45 -0
- package/template/wall-e/mcp-protocol-contract.js +41 -1
- package/template/wall-e/mcp-server.js +13 -2
- package/template/wall-e/mcp-worker-schemas.js +20 -2
- package/template/wall-e/memory/ctm-context-client.js +25 -5
- package/template/wall-e/shared/release-schema.json +3 -2
- package/template/wall-e/shared/sqlite-write-lock.js +361 -223
- package/template/wall-e/shared/storage/contract.js +35 -3
- package/template/wall-e/skills/_templates/delegate-worker/VERSION +1 -1
- package/template/wall-e/skills/_templates/delegate-worker/released-sha256.json +6 -0
- package/template/wall-e/skills/_templates/delegate-worker/templates/claude/SKILL.md +7 -2
- package/template/wall-e/skills/_templates/delegate-worker/templates/codex/SKILL.md +7 -2
- package/template/wall-e/tools/local-tools.js +12 -5
- package/template/wall-e/workers/brain-owner-worker.js +9 -0
- package/template/wall-e/workers/coding-journal-writer-child.js +8 -1
- package/template/wall-e/workers/telemetry-worker.js +8 -0
- package/template/coding-task-manager/lib/giant-freeze-park.js +0 -31
|
@@ -363,7 +363,7 @@ const OP_META = {
|
|
|
363
363
|
materializeRestoredSessionIndex: { kind: 'write', equality: 'exact', domain: 'core' },
|
|
364
364
|
persistJsonlReconciliationBatch: { kind: 'write', equality: 'exact', domain: 'core' },
|
|
365
365
|
getAllSessionTitles: { kind: 'read', equality: 'exact' },
|
|
366
|
-
setSessionTitleStatusNew: { kind: 'write', equality: 'exact', domain: 'core' }, setSessionTitleMirror: { kind: 'write', equality: 'exact', domain: 'core' }, getSessionTitleMirror: { kind: 'read', equality: 'exact' }, // WP-1
|
|
366
|
+
setSessionTitleStatusNew: { kind: 'write', equality: 'exact', domain: 'core' }, setSessionTitleMirror: { kind: 'write', equality: 'exact', domain: 'core' }, getSessionTitleMirror: { kind: 'read', equality: 'exact' }, applyAgentTitleBackfillRows: { kind: 'write', equality: 'exact', domain: 'core' }, // WP-1 / session-name WP-6
|
|
367
367
|
updateSessionTokens: { kind: 'write', equality: 'exact', domain: 'core' },
|
|
368
368
|
getSessionTokens: { kind: 'read', equality: 'exact' },
|
|
369
369
|
// WP-1 (design doc §5/§9 S-19): last known physical-footprint sample, persisted at
|
|
@@ -426,6 +426,40 @@ const OP_META = {
|
|
|
426
426
|
getHostedSyncSchemaStatus: { kind: 'sqlite-only', equality: 'exact' },
|
|
427
427
|
listHostedWorkspaceBindings: { kind: 'sqlite-only', equality: 'set', idKey: 'logical_id' },
|
|
428
428
|
upsertHostedWorkspaceBinding: { kind: 'write', equality: 'exact', domain: 'core' },
|
|
429
|
+
// WP-2 (docs/remote-machine-hub-sessions-2026-10-22.html §6.1/§8, deferred from WP-0): the hub
|
|
430
|
+
// machine-registry writes. Single-table (`machines`, classified 'core' in
|
|
431
|
+
// coding-task-manager/lib/db-domain-tables.js) — hence the explicit `tables` list Gate 2i
|
|
432
|
+
// checks against the tag, and the domain tag itself, which is what keeps these off the base
|
|
433
|
+
// (firehose) writer behind conversation import once the domain split is on.
|
|
434
|
+
upsertMachineRow: { kind: 'write', equality: 'exact', domain: 'core', tables: ['machines'] },
|
|
435
|
+
recordMachineProbe: { kind: 'write', equality: 'exact', domain: 'core', tables: ['machines'] },
|
|
436
|
+
deleteMachineRow: { kind: 'write', equality: 'exact', domain: 'core', tables: ['machines'] },
|
|
437
|
+
// WP-1 (docs/machine-pool-picker-pairing-dashboard-2026-10-24.html §6.1, D-11, §9 S-4): the
|
|
438
|
+
// host-sample pair. `recordHostSample` is one INSERT OR REPLACE plus the 24 h DELETE in a single
|
|
439
|
+
// transaction, single-table (`host_samples`, classified 'core' in
|
|
440
|
+
// coding-task-manager/lib/db-domain-tables.js) — so the explicit `tables` list Gate 2i checks
|
|
441
|
+
// against the tag is exact, and Gate 2g finds the routing declaration the action needs.
|
|
442
|
+
recordHostSample: { kind: 'write', equality: 'exact', domain: 'core', tables: ['host_samples'] },
|
|
443
|
+
// The bounded read beside it (oldest first, `sinceMs`/`limit`). `set` equality, keyed on `at`
|
|
444
|
+
// — the same shape as listSyncOutbox below.
|
|
445
|
+
listHostSamples: { kind: 'read', equality: 'set', idKey: 'at' },
|
|
446
|
+
// WP-2a (docs/machine-pool-picker-pairing-dashboard-2026-10-24.html §6.1, D-4/P-5/P-6, §9 S-4):
|
|
447
|
+
// the machine-owned settings write (single row, single table `machine_self`), the P-5 roster
|
|
448
|
+
// replacement (single table `machines`, one transaction) and the leave() sweep (`machines`).
|
|
449
|
+
// Both tables are classified 'core' in coding-task-manager/lib/db-domain-tables.js.
|
|
450
|
+
setMachineSelf: { kind: 'write', equality: 'exact', domain: 'core', tables: ['machine_self'] },
|
|
451
|
+
replaceRosterMachines: { kind: 'write', equality: 'exact', domain: 'core', tables: ['machines'] },
|
|
452
|
+
deleteAllMachineRows: { kind: 'write', equality: 'exact', domain: 'core', tables: ['machines'] },
|
|
453
|
+
// WP-3 (machine-pool-picker-pairing-dashboard-2026-10-24.html §6.3, D-6/D-9, §9 S-15/S-16): the
|
|
454
|
+
// pairing-offer trio — mint one offer, mark exactly one redeemed (single-use), and the AC-3c burn
|
|
455
|
+
// that flips every live offer at once. Single-table (`machine_pairing_offers`, classified 'core' in
|
|
456
|
+
// coding-task-manager/lib/db-domain-tables.js), so Gate 2i's `tables` list is exact. The bounded
|
|
457
|
+
// read beside them (`listLivePairingOffers`, unspent+unexpired as of `at`) is `set` equality keyed
|
|
458
|
+
// on `id`, the same shape as listHostSamples above.
|
|
459
|
+
insertPairingOffer: { kind: 'write', equality: 'exact', domain: 'core', tables: ['machine_pairing_offers'] },
|
|
460
|
+
markPairingOfferRedeemed: { kind: 'write', equality: 'exact', domain: 'core', tables: ['machine_pairing_offers'] },
|
|
461
|
+
burnLivePairingOffers: { kind: 'write', equality: 'exact', domain: 'core', tables: ['machine_pairing_offers'] },
|
|
462
|
+
listLivePairingOffers: { kind: 'read', equality: 'set', idKey: 'id' },
|
|
429
463
|
seedHostedWorkspaceBindings: { kind: 'sqlite-only', equality: 'exact', domain: 'core', tables: ['workspace_bindings'] },
|
|
430
464
|
updateStartupTaskWorkspaceMapping: { kind: 'write', equality: 'exact', domain: 'core' },
|
|
431
465
|
repointStartupTaskWorkspace: { kind: 'sqlite-only', equality: 'exact', domain: 'core', tables: ['startup_tasks', 'sync_outbox', 'synced_entities'] },
|
|
@@ -784,8 +818,6 @@ const OP_META = {
|
|
|
784
818
|
// the live scrollback_identity table is listed.
|
|
785
819
|
prepareScrollbackForSession: { kind: 'write', equality: 'exact', domain: 'core', tables: ['scrollback_identity'] },
|
|
786
820
|
upsertAgentSessionIdentity: { kind: 'write', equality: 'exact', domain: 'core', tables: ['agent_sessions'] },
|
|
787
|
-
promoteStartupTaskTitleIfUserNamed: { kind: 'write', equality: 'exact', domain: 'core', tables: ['ctm_sessions'] },
|
|
788
|
-
repairSessionTitlesFromStartupTasks: { kind: 'write', equality: 'exact', domain: 'core', tables: ['ctm_sessions'] },
|
|
789
821
|
repairCodexRolloutAgentIdentities: { kind: 'write', equality: 'exact', domain: 'core', tables: ['agent_sessions', 'ctm_sessions'] },
|
|
790
822
|
cleanupOrphanScrollbackIdentities: { kind: 'write', equality: 'exact', domain: 'core', tables: ['scrollback_identity', 'startup_tasks'] },
|
|
791
823
|
// --- writer:'base' pins (deliberately NOT re-routed; behaviour unchanged) ---
|
|
@@ -1 +1 @@
|
|
|
1
|
-
4.
|
|
1
|
+
4.7.0
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
"06efbe01e436b34adb7102fe04a5d59748dc4834b1ae6c4c45a492b2e1e79e9a": "4.1.0",
|
|
6
6
|
"0dde179abdab5d523da264cab944ce48306009807e5dc566ffa14aa0c8017186": "3.0.0",
|
|
7
7
|
"0e162871e8fd037c6a954c491ba5100d3f64cede44a8f82c519d2d2e33e032e3": "3.3.0",
|
|
8
|
+
"120cc88fa7b15ca0b75cf68873cde02bf56f867331e45a545589062b87127a89": "4.6.0",
|
|
8
9
|
"14d6d156625905d0b7ed12dea1c2131edc62146f61b6f9fd187a422773d7f300": "4.4.0",
|
|
9
10
|
"24a429b3c1b3651cad34317fd74d574ddb2f4863252b60db0d6b3b76050607f5": "3.8.0",
|
|
10
11
|
"31e405815c6010db8a90897d69b6448dfd4c3b21cc464e5b447ab43e60f6c69e": "3.1.0",
|
|
@@ -21,7 +22,9 @@
|
|
|
21
22
|
"9253a28aa91552c0555c0bc248ed66c61cc98ec716d517b9d1c8c3204d46d590": "3.7.0",
|
|
22
23
|
"a224ec90dc7df131415d89e2fa2df82c62e7ee2981c73c0c3cae8ec35e8c3d9e": "3.2.0",
|
|
23
24
|
"a87cd74831aa010a9fa28a68242038ca3e91461b070cf43ea91b4ff08848c54c": "3.8.0",
|
|
25
|
+
"b6c9bdc82070a8458af94d5bdad9026806e378b3adee8fe2c135f9bc3c72d720": "4.6.0",
|
|
24
26
|
"c5c66a11c5262014f58b127c4b7e21e0cfaf1179f2678ee6dc6a922d27362cbe": "4.2.0",
|
|
27
|
+
"c9e6f75ab694bbd66c841979fe2468db2c57177d6cfc18ea4eb97e034e5d98dc": "4.7.0",
|
|
25
28
|
"d9d6e3687ff5f626258f0b629e74829719df82bfcc25e079456bdd667e30abb8": "3.2.1",
|
|
26
29
|
"e22741fb1233863289757660b546691b7bfd70d21f3f641d82b743324c335f9c": "3.4.0",
|
|
27
30
|
"eba2b4dea2eb856fe3933be618730f75f8fc3c38c554e3a6063438bafa41d368": "4.6.0",
|
|
@@ -34,10 +37,12 @@
|
|
|
34
37
|
"21c9ca776a755692b0bfe64960c909db804dcaaf803c725c1684e53317d9f288": "3.2.0",
|
|
35
38
|
"290a270a69332fb18289f153b46b67f8a6e06459891665b952bbeca9e54d7371": "3.8.0",
|
|
36
39
|
"3c5d22d4a7c432662ca8036022b79a5b9097357f2139eda7ebf4acb3c18f2b71": "3.1.0",
|
|
40
|
+
"3e5db71601f075a303a1a7442cc1fbac11a37362e60fd25b717e86b180c177cc": "4.7.0",
|
|
37
41
|
"3ea78bdc6c5cd377e01b2061f63a4586e4859159f5c771eafea7ca0e984c8969": "4.2.0",
|
|
38
42
|
"4461f6ebdf10398b6529bff84f3cd3b4145f2935fd3a5f0f1efe38ab52b2c871": "4.6.0",
|
|
39
43
|
"56a9df7b9a49e7a47abadfa6c026ee599bf12f6a3cc5fc9370bfdc776f46e835": "3.4.0",
|
|
40
44
|
"576083d2286162eed343150f0a28305863fb7773960f2618ddb033c6d2e1f306": "3.8.0",
|
|
45
|
+
"5f9eb74ee52154661e2d572269b121b45d5d76e42989a091fa83086ba5eef3ec": "4.6.0",
|
|
41
46
|
"60a96b080de8243321fb68c76d664d5be9cb9983c3088e64b31da8b53b8bca5b": "4.3.0",
|
|
42
47
|
"75be2666f123930e7f655ad03ed6e18b512c8349bc1cca8af7a92699616e1074": "3.2.1",
|
|
43
48
|
"7de463c9f1647140a636b5155c2291c2df207e088d109ca7db6d16d2591fd948": "3.5.0",
|
|
@@ -47,6 +52,7 @@
|
|
|
47
52
|
"8aad4b5b96ff40df281b1657a390cd8f350d3608f2349f3867d2bc985a7fe979": "3.1.0",
|
|
48
53
|
"8c94e50631795fece512e58d1f849e2abd28f181ae66088806df75f718aeae61": "3.2.0",
|
|
49
54
|
"b7f5ba39bd37adf2f126b07b288a1ed4195ae2c9a87a3d6db642ecb8c83b776c": "4.1.0",
|
|
55
|
+
"bf16fbc5d9dadb36163dd161e8621158a90c9e79b3fd72ecd6b6bcbb701ad440": "4.6.0",
|
|
50
56
|
"c6cb630aca4487c95311146b5f0c148b9d6f68d42f88fc8a9a6a5fec663b54e6": "3.0.0",
|
|
51
57
|
"c75019cf38784040fda2f63e8be8c8aaf988d612fb1c868a3e5f2064b971cb42": "4.3.0",
|
|
52
58
|
"e1a85b80e419b38459a45c5d6c4884931b97b10a1e4e6a352af626f7a40dcd9d": "4.0.0",
|
|
@@ -52,6 +52,11 @@ Write a self-contained brief to a scratch path inside the worktree (never commit
|
|
|
52
52
|
- `lane: "native"`: Wall-E launched nothing; spawn a read-only helper (an Agent with read-only tools) for the review as before.
|
|
53
53
|
- Either way you own the verdict: check each claim against the code before acting on it. A review worker's lease does not renew (renewal needs file writes); resume it if it needs more, and a resume cannot change its profile.
|
|
54
54
|
|
|
55
|
+
## Lead: waiting
|
|
56
|
+
- Wait on workers with walle_worker_wait and omit wait_ms. It wakes on a finished, failed, resumed or stuck worker,
|
|
57
|
+
on a question, and when your user types. Do not sleep-and-check and do not wrap it in a script with a short yield.
|
|
58
|
+
- The exploration hand-off rule (write a four-field brief before the third read; hand it to a review worker) arrives in Wall-E's MCP instructions at connect; follow it when present.
|
|
59
|
+
|
|
55
60
|
## Worker: implement and test
|
|
56
61
|
|
|
57
62
|
Give the worker these requirements in its brief:
|
|
@@ -67,8 +72,8 @@ Use additional workers only for independent, useful subtasks with clear ownershi
|
|
|
67
72
|
## Lead: wait for the worker
|
|
68
73
|
|
|
69
74
|
- Native lane: the Agent tool returns when the worker finishes; then read the report file.
|
|
70
|
-
- While workers run, do non-overlapping work. When you are blocked, call `walle_worker_wait({})` with no id: it waits for all of your workers at once, in stretches of minutes, and returns as soon as one finishes or starts a new run. `woke_on: "user_input"` means your user just spoke — answer them before waiting again.
|
|
71
|
-
- `woke_on: "advisory"` means the worker has gone many turns without a verified write; read its status and decide — keep waiting or stop it. `walle_stop_worker({ ctm_session_id, mode, reason })` stops a worker you own: mode `after_turn` (default) lets the in-flight request finish then ends the process; mode `now` ends it immediately. The transcript and report stay and the worker can be resumed. Use it when a worker is off-brief, duplicating another worker, or no longer needed; never DELETE the session.
|
|
75
|
+
- While workers run, do non-overlapping work. When you are blocked, call `walle_worker_wait({})` with no id: it waits for all of your workers at once, in stretches of minutes, and returns as soon as one finishes or starts a new run. `woke_on: "user_input"` means your user just spoke — answer them before waiting again. Until every worker is terminal, re-issue the wait after any non-terminal wake (`timeout`, `advisory`, `generation`, `user_input` once you have answered your user); the result's `lead_next_step` says so. Ending your turn with a live worker and no wait in flight leaves you idle until your user types.
|
|
76
|
+
- `woke_on: "advisory"` means the worker has gone many turns without a verified write; read its status and decide — call `walle_worker_wait` again to keep waiting, or stop it. `walle_stop_worker({ ctm_session_id, mode, reason })` stops a worker you own: mode `after_turn` (default) lets the in-flight request finish then ends the process; mode `now` ends it immediately. The transcript and report stay and the worker can be resumed. Use it when a worker is off-brief, duplicating another worker, or no longer needed; never DELETE the session.
|
|
72
77
|
- Routed lane: never sleep-loop on the report file (a failed worker never writes one — `terminal_path` is written on every stop). For a one-off status read, poll `walle_worker_status({ ctm_session_id })` no sooner than its `poll_after_ms` (30 s when the field is absent). Terminal states are `report_ready`, `failed`, and `exited`; also stop when `exitCode` is not null. If `report_ready` arrives while `exitCode` is still null, poll once more before reading `report_text`. `exited` without a report, or a `report_text_error`, is a failure — say so. `throttled` means the worker is alive and mid-retry; keep polling; stop it only with walle_stop_worker, never by killing the process.
|
|
73
78
|
- On `failed`, follow `failure.next_step`; it is written for the exact failure. `budget` means the proxy stopped the worker at a limit of its lease (`failure.budget` names the kind, the task total used, and the lease). The lease renews in place while the worker makes verifiable progress, and the ×4 ceiling covers the whole task, resumes included — but a resume never uses a lease: it is accepted at the task's current lease while `lease.headroom_requests` in `walle_worker_status` is above zero. Only a 409 `task_lease_ceiling` refusal means the task spent its whole budget; report its `task_requests` and `base_requests` to the user and pass `extra_leases` only on their word, never pre-emptively. Never switch models because of a budget stop.
|
|
74
79
|
- `terminal` with `worker_repeated_action` or `worker_repeated_error` means the worker repeated the same step without new results: read what it repeated, fix the brief or the environment, then resume with a corrective message — never resume blind.
|
|
@@ -50,6 +50,11 @@ Write a self-contained brief to a scratch path inside the worktree (never commit
|
|
|
50
50
|
- `lane: "native"`: Wall-E launched nothing; spawn a read-only helper (`spawn_agent`) for the review as before.
|
|
51
51
|
- Either way you own the verdict: check each claim against the code before acting on it. A review worker's lease does not renew (renewal needs file writes); resume it if it needs more, and a resume cannot change its profile.
|
|
52
52
|
|
|
53
|
+
## Lead: waiting
|
|
54
|
+
- Wait on workers with walle_worker_wait and omit wait_ms. It wakes on a finished, failed, resumed or stuck worker,
|
|
55
|
+
on a question, and when your user types. Do not sleep-and-check and do not wrap it in a script with a short yield.
|
|
56
|
+
- The exploration hand-off rule (write a four-field brief before the third read; hand it to a review worker) arrives in Wall-E's MCP instructions at connect; follow it when present.
|
|
57
|
+
|
|
53
58
|
## Worker: implement and test
|
|
54
59
|
|
|
55
60
|
Give the worker these requirements in its brief:
|
|
@@ -65,8 +70,8 @@ Use additional workers only for independent, useful subtasks with clear ownershi
|
|
|
65
70
|
## Lead: wait for the worker
|
|
66
71
|
|
|
67
72
|
- Native lane: `wait_agent` returns when the worker finishes; then read the report file.
|
|
68
|
-
- While workers run, do non-overlapping work. When you are blocked, call `walle_worker_wait({})` with no id: it waits for all of your workers at once, in stretches of minutes, and returns as soon as one finishes or starts a new run. `woke_on: "user_input"` means your user just spoke — answer them before waiting again.
|
|
69
|
-
- `woke_on: "advisory"` means the worker has gone many turns without a verified write; read its status and decide — keep waiting or stop it. `walle_stop_worker({ ctm_session_id, mode, reason })` stops a worker you own: mode `after_turn` (default) lets the in-flight request finish then ends the process; mode `now` ends it immediately. The transcript and report stay and the worker can be resumed. Use it when a worker is off-brief, duplicating another worker, or no longer needed; never DELETE the session.
|
|
73
|
+
- While workers run, do non-overlapping work. When you are blocked, call `walle_worker_wait({})` with no id: it waits for all of your workers at once, in stretches of minutes, and returns as soon as one finishes or starts a new run. `woke_on: "user_input"` means your user just spoke — answer them before waiting again. Until every worker is terminal, re-issue the wait after any non-terminal wake (`timeout`, `advisory`, `generation`, `user_input` once you have answered your user); the result's `lead_next_step` says so. Ending your turn with a live worker and no wait in flight leaves you idle until your user types.
|
|
74
|
+
- `woke_on: "advisory"` means the worker has gone many turns without a verified write; read its status and decide — call `walle_worker_wait` again to keep waiting, or stop it. `walle_stop_worker({ ctm_session_id, mode, reason })` stops a worker you own: mode `after_turn` (default) lets the in-flight request finish then ends the process; mode `now` ends it immediately. The transcript and report stay and the worker can be resumed. Use it when a worker is off-brief, duplicating another worker, or no longer needed; never DELETE the session.
|
|
70
75
|
- Routed lane: never sleep-loop on the report file (a failed worker never writes one — `terminal_path` is written on every stop). For a one-off status read, poll `walle_worker_status({ ctm_session_id })` no sooner than its `poll_after_ms` (30 s when the field is absent). Terminal states are `report_ready`, `failed`, and `exited`; also stop when `exitCode` is not null. If `report_ready` arrives while `exitCode` is still null, poll once more before reading `report_text`. `exited` without a report, or a `report_text_error`, is a failure — say so. `throttled` means the worker is alive and mid-retry; keep polling; stop it only with walle_stop_worker, never by killing the process.
|
|
71
76
|
- On `failed`, follow `failure.next_step`; it is written for the exact failure. `budget` means the proxy stopped the worker at a limit of its lease (`failure.budget` names the kind, the task total used, and the lease). The lease renews in place while the worker makes verifiable progress, and the ×4 ceiling covers the whole task, resumes included — but a resume never uses a lease: it is accepted at the task's current lease while `lease.headroom_requests` in `walle_worker_status` is above zero. Only a 409 `task_lease_ceiling` refusal means the task spent its whole budget; report its `task_requests` and `base_requests` to the user and pass `extra_leases` only on their word, never pre-emptively. Never switch models because of a budget stop.
|
|
72
77
|
- `terminal` with `worker_repeated_action` or `worker_repeated_error` means the worker repeated the same step without new results: read what it repeated, fix the brief or the environment, then resume with a corrective message — never resume blind.
|
|
@@ -2555,7 +2555,9 @@ async function _autoChromeUsable(chromePath, { timeoutMs = 15000, pollMs = 100 }
|
|
|
2555
2555
|
'--window-size=200,200',
|
|
2556
2556
|
'--virtual-time-budget=2000',
|
|
2557
2557
|
'data:text/html,<title>walle-probe</title><p>ok</p>',
|
|
2558
|
-
|
|
2558
|
+
// Own process group (detached): Chrome forks GPU/renderer/utility helpers into it,
|
|
2559
|
+
// and the cleanup below must reach them, not just the browser pid.
|
|
2560
|
+
], { stdio: 'ignore', env: hostAutomationEnv(), detached: process.platform !== 'win32' });
|
|
2559
2561
|
child.on('error', () => { /* expected: the poll loop below is the single source of truth for usability, not this event */ });
|
|
2560
2562
|
|
|
2561
2563
|
const deadline = Date.now() + timeoutMs;
|
|
@@ -2570,9 +2572,9 @@ async function _autoChromeUsable(chromePath, { timeoutMs = 15000, pollMs = 100 }
|
|
|
2570
2572
|
/* expected: spawn/stat failures (e.g. ENOENT, EACCES) mean unusable, not a bug to surface */
|
|
2571
2573
|
usable = false;
|
|
2572
2574
|
} finally {
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2575
|
+
// Kill the whole tree: SIGKILL to the browser pid alone left its helpers alive,
|
|
2576
|
+
// re-parented to launchd, after every probe (observed: 2-4 helpers per probe).
|
|
2577
|
+
if (child && child.pid) terminateForegroundProcessTree(child, 'SIGKILL');
|
|
2576
2578
|
try { fs.rmSync(userDataDir, { recursive: true, force: true }); } catch { /* expected: probe child may already be gone */ }
|
|
2577
2579
|
}
|
|
2578
2580
|
_chromeProbeCache.set(chromePath, usable);
|
|
@@ -2586,6 +2588,11 @@ async function _autoChromeUsable(chromePath, { timeoutMs = 15000, pollMs = 100 }
|
|
|
2586
2588
|
async function inspectChromeCapability({
|
|
2587
2589
|
candidates = CHROME_CANDIDATES,
|
|
2588
2590
|
probe = _autoChromeUsable,
|
|
2591
|
+
// probeOptions (no default): the same timer seam host-capabilities.js's
|
|
2592
|
+
// getCapability() already exposes for pdf.poppler (WP-3). It is handed to
|
|
2593
|
+
// the probe unchanged; production callers omit it, so _autoChromeUsable's
|
|
2594
|
+
// own 15000/100 defaults stand.
|
|
2595
|
+
probeOptions,
|
|
2589
2596
|
overridePath = process.env.WALLE_CHROME_PATH || '',
|
|
2590
2597
|
} = {}) {
|
|
2591
2598
|
if (overridePath && fs.existsSync(overridePath)) {
|
|
@@ -2595,7 +2602,7 @@ async function inspectChromeCapability({
|
|
|
2595
2602
|
let executable = null;
|
|
2596
2603
|
for (const candidate of detected) {
|
|
2597
2604
|
// eslint-disable-next-line no-await-in-loop -- probes must run sequentially: first usable wins
|
|
2598
|
-
if (await probe(candidate)) { executable = candidate; break; }
|
|
2605
|
+
if (await probe(candidate, probeOptions)) { executable = candidate; break; }
|
|
2599
2606
|
}
|
|
2600
2607
|
if (executable) return { executable, detected, source: 'auto' };
|
|
2601
2608
|
const installedButUnavailable = detected.length > 0;
|
|
@@ -318,6 +318,15 @@ const CUSTOM_BRAIN_CALLS = { agentRunShadowOperation: (args) => require('../runt
|
|
|
318
318
|
recordProviderHealthStatus: (args) => require('../llm/provider-health-state').recordProviderHealthStatus(args[0], { brain, ...(args[1] || {}) }),
|
|
319
319
|
reserveProviderModelCircuitProbe: (args) => require('../llm/provider-health-state').reserveProviderModelCircuitProbe(args[0], args[1], { brain }),
|
|
320
320
|
workflowStoreOperation: (args) => require('../routing/workflow-store-operations').runWorkflowStoreOperation(brain, args[0], args[1] || {}),
|
|
321
|
+
helperRulesRecordOutcome: (args) => require('../loops/brain-custom-writes').helperRulesRecordOutcome(args[0]),
|
|
322
|
+
helperRulesCloseOutcome: (args) => require('../loops/brain-custom-writes').helperRulesCloseOutcome(args[0], args[1]),
|
|
323
|
+
helperRulesSetCellState: (args) => require('../loops/brain-custom-writes').helperRulesSetCellState(args[0], args[1]),
|
|
324
|
+
helperRulesDailyTick: () => require('../loops/brain-custom-writes').helperRulesDailyTick(),
|
|
325
|
+
helperRulesSetGrade: (args) => require('../loops/brain-custom-writes').helperRulesSetGrade(args[0], args[1]), // WP-6
|
|
326
|
+
// Round 2 WP-2 (§6.4 S-16): D-5's close-by-worker (the hook's terminal-read path) and the
|
|
327
|
+
// one-time relabel/recovery pass (D-5/D-6).
|
|
328
|
+
helperRulesCloseOutcomeByWorker: (args) => require('../loops/brain-custom-writes').helperRulesCloseOutcomeByWorker(args[0], args[1]),
|
|
329
|
+
helperRulesRelabel: (args) => require('../loops/brain-custom-writes').helperRulesRelabel(args[0]),
|
|
321
330
|
};
|
|
322
331
|
|
|
323
332
|
async function _brainCall(payload = {}) {
|
|
@@ -54,7 +54,7 @@ async function reply(message) {
|
|
|
54
54
|
// If the daemon dies before sending it (or mid-write), there is no other
|
|
55
55
|
// exit path — install the backstop before anything else so an orphaned
|
|
56
56
|
// instance can't hold the WAL open indefinitely.
|
|
57
|
-
installParentDeathWatch({
|
|
57
|
+
const parentDeathWatch = installParentDeathWatch({
|
|
58
58
|
label: 'coding-journal-writer-child',
|
|
59
59
|
onShutdown: async () => {
|
|
60
60
|
if (!openBrain) return;
|
|
@@ -102,6 +102,13 @@ process.once('message', async (message) => {
|
|
|
102
102
|
code: error?.code ? String(error.code).slice(0, 100) : undefined,
|
|
103
103
|
});
|
|
104
104
|
} finally {
|
|
105
|
+
// The watch is a backstop for a parent that dies mid-write, so it stays
|
|
106
|
+
// armed for as long as this child is doing work. On our OWN completed
|
|
107
|
+
// request path it must be disarmed immediately BEFORE this self-initiated
|
|
108
|
+
// disconnect: otherwise our own disconnect looks like parent death to the
|
|
109
|
+
// watch, whose shutdown hook calls exit(0) and erases the exit status set
|
|
110
|
+
// above (a schema/owner refusal must leave the process exiting 1, not 0).
|
|
111
|
+
parentDeathWatch.stop();
|
|
105
112
|
try { process.disconnect(); } catch { /* expected: process.disconnect() throws ERR_IPC_DISCONNECTED when the parent already closed the channel after taking the reply; this one-shot worker is finished either way and exits when the loop drains */ }
|
|
106
113
|
}
|
|
107
114
|
});
|
|
@@ -28,6 +28,14 @@ function runRequest(payload, maxResponseBytes) {
|
|
|
28
28
|
req.method = payload.method || 'GET';
|
|
29
29
|
req.headers = payload.headers || {};
|
|
30
30
|
req.url = payload.path;
|
|
31
|
+
// WP-1 (blog-view-counts): the parent sends the TCP peer it observed in its own
|
|
32
|
+
// IPC field (never as a header, so a client cannot forge it). Re-attach it as
|
|
33
|
+
// the request's socket address — the blog counter's per-IP limiter reads it
|
|
34
|
+
// there. Routes that do not carry the field keep the request exactly as before
|
|
35
|
+
// (no req.socket at all).
|
|
36
|
+
if (typeof payload.clientAddress === 'string' && payload.clientAddress) {
|
|
37
|
+
req.socket = { remoteAddress: payload.clientAddress };
|
|
38
|
+
}
|
|
31
39
|
req.destroy = () => {};
|
|
32
40
|
let status = 200;
|
|
33
41
|
let headers = {};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const DEFAULT_GIANT_ROLLOUT_BYTES = 500 * 1024 * 1024;
|
|
4
|
-
const RECLAIM_REASONS = new Set([
|
|
5
|
-
'cap',
|
|
6
|
-
'interactive-preempt',
|
|
7
|
-
'prewarm-cap',
|
|
8
|
-
'pressure',
|
|
9
|
-
'pressure-relief',
|
|
10
|
-
'rss-budget',
|
|
11
|
-
]);
|
|
12
|
-
|
|
13
|
-
function shouldFreezeParkGiant({
|
|
14
|
-
enabled = true,
|
|
15
|
-
fileSizeBytes = 0,
|
|
16
|
-
pressure = 'normal',
|
|
17
|
-
reason = 'idle',
|
|
18
|
-
thresholdBytes = DEFAULT_GIANT_ROLLOUT_BYTES,
|
|
19
|
-
alreadyFrozen = false,
|
|
20
|
-
} = {}) {
|
|
21
|
-
if (!enabled || alreadyFrozen) return false;
|
|
22
|
-
if (String(pressure || 'normal') !== 'normal') return false;
|
|
23
|
-
if (RECLAIM_REASONS.has(String(reason || ''))) return false;
|
|
24
|
-
return Math.max(0, Number(fileSizeBytes) || 0)
|
|
25
|
-
>= Math.max(1, Number(thresholdBytes) || DEFAULT_GIANT_ROLLOUT_BYTES);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
module.exports = {
|
|
29
|
-
DEFAULT_GIANT_ROLLOUT_BYTES,
|
|
30
|
-
shouldFreezeParkGiant,
|
|
31
|
-
};
|