smol-symphony 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +41 -22
- package/DESIGN.md +494 -273
- package/README.md +109 -57
- package/SPEC.md +33 -24
- package/WORKFLOW.minimal.yaml +34 -0
- package/{WORKFLOW.template.md → WORKFLOW.template.yaml} +409 -256
- package/WORKFLOW.yaml +487 -0
- package/assets/skills/symphony-issues/SKILL.md +136 -0
- package/assets/symphony-mise.system.toml +68 -0
- package/dist/src/bin/symphony.js +30 -0
- package/dist/src/bin/symphony.js.map +1 -0
- package/dist/src/core/actions/context.js +109 -0
- package/dist/src/core/actions/context.js.map +1 -0
- package/dist/{actions/parsing.js → src/core/actions/parse.js} +33 -114
- package/dist/src/core/actions/parse.js.map +1 -0
- package/dist/src/core/actions/plan.js +197 -0
- package/dist/src/core/actions/plan.js.map +1 -0
- package/dist/src/core/actions/predicates.js +111 -0
- package/dist/src/core/actions/predicates.js.map +1 -0
- package/dist/src/core/actions/run-fold.js +248 -0
- package/dist/src/core/actions/run-fold.js.map +1 -0
- package/dist/src/core/actions/template.js +118 -0
- package/dist/src/core/actions/template.js.map +1 -0
- package/dist/src/core/cli/args.js +116 -0
- package/dist/src/core/cli/args.js.map +1 -0
- package/dist/src/core/coerce.js +75 -0
- package/dist/src/core/coerce.js.map +1 -0
- package/dist/src/core/credential/account-id.js +20 -0
- package/dist/src/core/credential/account-id.js.map +1 -0
- package/dist/src/core/credential/adapter-config.js +136 -0
- package/dist/src/core/credential/adapter-config.js.map +1 -0
- package/dist/src/core/credential/availability.js +98 -0
- package/dist/src/core/credential/availability.js.map +1 -0
- package/dist/src/core/credential/extract.js +228 -0
- package/dist/src/core/credential/extract.js.map +1 -0
- package/dist/src/core/credential/fake-creds.js +171 -0
- package/dist/src/core/credential/fake-creds.js.map +1 -0
- package/dist/src/core/credential/identity.js +125 -0
- package/dist/src/core/credential/identity.js.map +1 -0
- package/dist/src/core/credential/shape.js +230 -0
- package/dist/src/core/credential/shape.js.map +1 -0
- package/dist/src/core/credential/strings.js +15 -0
- package/dist/src/core/credential/strings.js.map +1 -0
- package/dist/src/core/doctor/checks.js +303 -0
- package/dist/src/core/doctor/checks.js.map +1 -0
- package/dist/src/core/git/result.js +107 -0
- package/dist/src/core/git/result.js.map +1 -0
- package/dist/src/core/http/decisions.js +225 -0
- package/dist/src/core/http/decisions.js.map +1 -0
- package/dist/{http.js → src/core/http/render.js} +472 -738
- package/dist/src/core/http/render.js.map +1 -0
- package/dist/{http-handlers.js → src/core/http/routes.js} +52 -87
- package/dist/src/core/http/routes.js.map +1 -0
- package/dist/src/core/http/views.js +181 -0
- package/dist/src/core/http/views.js.map +1 -0
- package/dist/src/core/image/managed-image.js +95 -0
- package/dist/src/core/image/managed-image.js.map +1 -0
- package/dist/src/core/issue/file.js +149 -0
- package/dist/src/core/issue/file.js.map +1 -0
- package/dist/src/core/issue/parse.js +210 -0
- package/dist/src/core/issue/parse.js.map +1 -0
- package/dist/src/core/mcp/dispatch.js +239 -0
- package/dist/src/core/mcp/dispatch.js.map +1 -0
- package/dist/src/core/mcp/post-move.js +92 -0
- package/dist/src/core/mcp/post-move.js.map +1 -0
- package/dist/src/core/mcp/protocol.js +293 -0
- package/dist/src/core/mcp/protocol.js.map +1 -0
- package/dist/src/core/mcp/url.js +162 -0
- package/dist/src/core/mcp/url.js.map +1 -0
- package/dist/src/core/path.js +63 -0
- package/dist/src/core/path.js.map +1 -0
- package/dist/src/core/reconcile/image-decide.js +48 -0
- package/dist/src/core/reconcile/image-decide.js.map +1 -0
- package/dist/src/core/reconcile/ledger.js +142 -0
- package/dist/src/core/reconcile/ledger.js.map +1 -0
- package/dist/src/core/reconcile/pr-classify.js +62 -0
- package/dist/src/core/reconcile/pr-classify.js.map +1 -0
- package/dist/{reconciler → src/core/reconcile}/pr-decide.js +25 -12
- package/dist/src/core/reconcile/pr-decide.js.map +1 -0
- package/dist/src/core/reconcile/pr-loop.js +161 -0
- package/dist/src/core/reconcile/pr-loop.js.map +1 -0
- package/dist/src/core/reconcile/pr-notes.js +35 -0
- package/dist/src/core/reconcile/pr-notes.js.map +1 -0
- package/dist/src/core/reconcile/vm-decide.js +70 -0
- package/dist/src/core/reconcile/vm-decide.js.map +1 -0
- package/dist/src/core/reconcile/vm-reap.js +207 -0
- package/dist/src/core/reconcile/vm-reap.js.map +1 -0
- package/dist/src/core/reconcile/workspace-decide.js +162 -0
- package/dist/src/core/reconcile/workspace-decide.js.map +1 -0
- package/dist/src/core/runlog/summary.js +231 -0
- package/dist/src/core/runlog/summary.js.map +1 -0
- package/dist/src/core/runner/dispatch-config.js +95 -0
- package/dist/src/core/runner/dispatch-config.js.map +1 -0
- package/dist/src/core/runner/injection.js +61 -0
- package/dist/src/core/runner/injection.js.map +1 -0
- package/dist/src/core/runner/mise.js +210 -0
- package/dist/src/core/runner/mise.js.map +1 -0
- package/dist/src/core/runner/prompt.js +720 -0
- package/dist/src/core/runner/prompt.js.map +1 -0
- package/dist/src/core/runner/turn.js +242 -0
- package/dist/src/core/runner/turn.js.map +1 -0
- package/dist/src/core/runner/vm-plan.js +390 -0
- package/dist/src/core/runner/vm-plan.js.map +1 -0
- package/dist/src/core/schedule/admission.js +123 -0
- package/dist/src/core/schedule/admission.js.map +1 -0
- package/dist/src/core/schedule/circuit-breaker.js +111 -0
- package/dist/src/core/schedule/circuit-breaker.js.map +1 -0
- package/dist/src/core/schedule/eligibility.js +83 -0
- package/dist/src/core/schedule/eligibility.js.map +1 -0
- package/dist/src/core/schedule/reconcile-issue.js +82 -0
- package/dist/src/core/schedule/reconcile-issue.js.map +1 -0
- package/dist/src/core/schedule/retry.js +96 -0
- package/dist/src/core/schedule/retry.js.map +1 -0
- package/dist/src/core/schedule/sleep-cycle.js +133 -0
- package/dist/src/core/schedule/sleep-cycle.js.map +1 -0
- package/dist/src/core/schedule/slots.js +124 -0
- package/dist/src/core/schedule/slots.js.map +1 -0
- package/dist/src/core/schedule/tick.js +553 -0
- package/dist/src/core/schedule/tick.js.map +1 -0
- package/dist/src/core/schedule/token-fold.js +181 -0
- package/dist/src/core/schedule/token-fold.js.map +1 -0
- package/dist/src/core/state-resolve.js +86 -0
- package/dist/src/core/state-resolve.js.map +1 -0
- package/dist/src/core/vm-guards.js +278 -0
- package/dist/src/core/vm-guards.js.map +1 -0
- package/dist/src/core/workflow/derive.js +107 -0
- package/dist/src/core/workflow/derive.js.map +1 -0
- package/dist/src/core/workflow/parse.js +687 -0
- package/dist/src/core/workflow/parse.js.map +1 -0
- package/dist/src/core/workflow/prompt-probe.js +78 -0
- package/dist/src/core/workflow/prompt-probe.js.map +1 -0
- package/dist/src/core/workflow/validate.js +189 -0
- package/dist/src/core/workflow/validate.js.map +1 -0
- package/dist/src/core/workspace-key.js +19 -0
- package/dist/src/core/workspace-key.js.map +1 -0
- package/dist/src/shell/actions-runner.js +356 -0
- package/dist/src/shell/actions-runner.js.map +1 -0
- package/dist/src/shell/adapter/adapter-registry.js +45 -0
- package/dist/src/shell/adapter/adapter-registry.js.map +1 -0
- package/dist/src/shell/adapter/clock-random.js +96 -0
- package/dist/src/shell/adapter/clock-random.js.map +1 -0
- package/dist/src/shell/adapter/gondolin-dispatch-helpers.js +158 -0
- package/dist/src/shell/adapter/gondolin-dispatch-helpers.js.map +1 -0
- package/dist/src/shell/adapter/gondolin-dispatch.js +385 -0
- package/dist/src/shell/adapter/gondolin-dispatch.js.map +1 -0
- package/dist/src/shell/adapter/gondolin-image-converter.js +233 -0
- package/dist/src/shell/adapter/gondolin-image-converter.js.map +1 -0
- package/dist/src/shell/adapter/gondolin-image-fetch.js +180 -0
- package/dist/src/shell/adapter/gondolin-image-fetch.js.map +1 -0
- package/dist/src/shell/adapter/launcher-asset.js +57 -0
- package/dist/src/shell/adapter/launcher-asset.js.map +1 -0
- package/dist/src/shell/adapter/mise-config-asset.js +65 -0
- package/dist/src/shell/adapter/mise-config-asset.js.map +1 -0
- package/dist/src/shell/adapter/workflow-loader.js +304 -0
- package/dist/src/shell/adapter/workflow-loader.js.map +1 -0
- package/dist/src/shell/cli/doctor.js +268 -0
- package/dist/src/shell/cli/doctor.js.map +1 -0
- package/dist/src/shell/effect-interpreter-families.js +314 -0
- package/dist/src/shell/effect-interpreter-families.js.map +1 -0
- package/dist/src/shell/effect-interpreter.js +29 -0
- package/dist/src/shell/effect-interpreter.js.map +1 -0
- package/dist/src/shell/interp/acp-frame.js +137 -0
- package/dist/src/shell/interp/acp-frame.js.map +1 -0
- package/dist/src/shell/interp/acp-ws-conn.js +320 -0
- package/dist/src/shell/interp/acp-ws-conn.js.map +1 -0
- package/dist/src/shell/interp/acp-ws-frames.js +159 -0
- package/dist/src/shell/interp/acp-ws-frames.js.map +1 -0
- package/dist/src/shell/interp/acp-ws.js +197 -0
- package/dist/src/shell/interp/acp-ws.js.map +1 -0
- package/dist/src/shell/interp/acp.js +319 -0
- package/dist/src/shell/interp/acp.js.map +1 -0
- package/dist/src/shell/interp/credential-defaults.js +128 -0
- package/dist/src/shell/interp/credential-defaults.js.map +1 -0
- package/dist/src/shell/interp/credential-hooks.js +149 -0
- package/dist/src/shell/interp/credential-hooks.js.map +1 -0
- package/dist/src/shell/interp/credential-registry.js +226 -0
- package/dist/src/shell/interp/credential-registry.js.map +1 -0
- package/dist/src/shell/interp/credential.js +103 -0
- package/dist/src/shell/interp/credential.js.map +1 -0
- package/dist/src/shell/interp/gh.js +163 -0
- package/dist/src/shell/interp/gh.js.map +1 -0
- package/dist/src/shell/interp/git.js +28 -0
- package/dist/src/shell/interp/git.js.map +1 -0
- package/dist/src/shell/interp/log.js +213 -0
- package/dist/src/shell/interp/log.js.map +1 -0
- package/dist/src/shell/interp/process.js +178 -0
- package/dist/src/shell/interp/process.js.map +1 -0
- package/dist/src/shell/interp/runlog.js +193 -0
- package/dist/src/shell/interp/runlog.js.map +1 -0
- package/dist/src/shell/interp/timer.js +64 -0
- package/dist/src/shell/interp/timer.js.map +1 -0
- package/dist/src/shell/interp/tracker-disk.js +99 -0
- package/dist/src/shell/interp/tracker-disk.js.map +1 -0
- package/dist/src/shell/interp/tracker-parse.js +71 -0
- package/dist/src/shell/interp/tracker-parse.js.map +1 -0
- package/dist/src/shell/interp/tracker-scan.js +238 -0
- package/dist/src/shell/interp/tracker-scan.js.map +1 -0
- package/dist/src/shell/interp/tracker-write.js +91 -0
- package/dist/src/shell/interp/tracker-write.js.map +1 -0
- package/dist/src/shell/interp/tracker.js +41 -0
- package/dist/src/shell/interp/tracker.js.map +1 -0
- package/dist/src/shell/interp/tty.js +48 -0
- package/dist/src/shell/interp/tty.js.map +1 -0
- package/dist/src/shell/interp/vm.js +199 -0
- package/dist/src/shell/interp/vm.js.map +1 -0
- package/dist/src/shell/interp/workspace.js +310 -0
- package/dist/src/shell/interp/workspace.js.map +1 -0
- package/dist/src/shell/main-acp.js +78 -0
- package/dist/src/shell/main-acp.js.map +1 -0
- package/dist/src/shell/main-adapters.js +222 -0
- package/dist/src/shell/main-adapters.js.map +1 -0
- package/dist/src/shell/main-credential.js +122 -0
- package/dist/src/shell/main-credential.js.map +1 -0
- package/dist/src/shell/main-doctor.js +22 -0
- package/dist/src/shell/main-doctor.js.map +1 -0
- package/dist/src/shell/main-entry.js +46 -0
- package/dist/src/shell/main-entry.js.map +1 -0
- package/dist/src/shell/main-http-csrf.js +45 -0
- package/dist/src/shell/main-http-csrf.js.map +1 -0
- package/dist/src/shell/main-http-handler.js +389 -0
- package/dist/src/shell/main-http-handler.js.map +1 -0
- package/dist/src/shell/main-http-mcp.js +122 -0
- package/dist/src/shell/main-http-mcp.js.map +1 -0
- package/dist/src/shell/main-http-views.js +253 -0
- package/dist/src/shell/main-http-views.js.map +1 -0
- package/dist/src/shell/main-http.js +76 -0
- package/dist/src/shell/main-http.js.map +1 -0
- package/dist/src/shell/main-loops.js +130 -0
- package/dist/src/shell/main-loops.js.map +1 -0
- package/dist/src/shell/main-mcp.js +129 -0
- package/dist/src/shell/main-mcp.js.map +1 -0
- package/dist/src/shell/main-orchestrator.js +120 -0
- package/dist/src/shell/main-orchestrator.js.map +1 -0
- package/dist/src/shell/main-preflight.js +43 -0
- package/dist/src/shell/main-preflight.js.map +1 -0
- package/dist/src/shell/main-reconcilers-helpers.js +244 -0
- package/dist/src/shell/main-reconcilers-helpers.js.map +1 -0
- package/dist/src/shell/main-reconcilers-pr.js +148 -0
- package/dist/src/shell/main-reconcilers-pr.js.map +1 -0
- package/dist/src/shell/main-reconcilers.js +225 -0
- package/dist/src/shell/main-reconcilers.js.map +1 -0
- package/dist/src/shell/main-runner.js +355 -0
- package/dist/src/shell/main-runner.js.map +1 -0
- package/dist/src/shell/main-scaffold.js +116 -0
- package/dist/src/shell/main-scaffold.js.map +1 -0
- package/dist/src/shell/main-shutdown.js +115 -0
- package/dist/src/shell/main-shutdown.js.map +1 -0
- package/dist/src/shell/main-startup.js +48 -0
- package/dist/src/shell/main-startup.js.map +1 -0
- package/dist/src/shell/main-substrates.js +43 -0
- package/dist/src/shell/main-substrates.js.map +1 -0
- package/dist/src/shell/main.js +385 -0
- package/dist/src/shell/main.js.map +1 -0
- package/dist/src/shell/orchestrator-feedback.js +69 -0
- package/dist/src/shell/orchestrator-feedback.js.map +1 -0
- package/dist/src/shell/orchestrator-image.js +167 -0
- package/dist/src/shell/orchestrator-image.js.map +1 -0
- package/dist/src/shell/orchestrator-loop.js +468 -0
- package/dist/src/shell/orchestrator-loop.js.map +1 -0
- package/dist/src/shell/orchestrator-reconcile.js +36 -0
- package/dist/src/shell/orchestrator-reconcile.js.map +1 -0
- package/dist/src/shell/reconciler-loop.js +228 -0
- package/dist/src/shell/reconciler-loop.js.map +1 -0
- package/dist/src/shell/runner-loop-turn.js +301 -0
- package/dist/src/shell/runner-loop-turn.js.map +1 -0
- package/dist/src/shell/runner-loop.js +338 -0
- package/dist/src/shell/runner-loop.js.map +1 -0
- package/dist/src/shell/server/http.js +208 -0
- package/dist/src/shell/server/http.js.map +1 -0
- package/dist/src/shell/server/mcp-runtime-effects.js +237 -0
- package/dist/src/shell/server/mcp-runtime-effects.js.map +1 -0
- package/dist/src/shell/server/mcp-runtime.js +99 -0
- package/dist/src/shell/server/mcp-runtime.js.map +1 -0
- package/dist/src/shell/workspace-key.js +14 -0
- package/dist/src/shell/workspace-key.js.map +1 -0
- package/dist/src/types/acp.js +8 -0
- package/dist/src/types/acp.js.map +1 -0
- package/dist/src/types/actions/plan.js +6 -0
- package/dist/src/types/actions/plan.js.map +1 -0
- package/dist/src/types/actions/predicates.js +6 -0
- package/dist/src/types/actions/predicates.js.map +1 -0
- package/dist/src/types/actions/run-fold.js +8 -0
- package/dist/src/types/actions/run-fold.js.map +1 -0
- package/dist/src/types/actions.js +7 -0
- package/dist/src/types/actions.js.map +1 -0
- package/dist/src/types/adapter/clock-random.js +4 -0
- package/dist/src/types/adapter/clock-random.js.map +1 -0
- package/dist/src/types/adapter/gondolin-image-converter.js +5 -0
- package/dist/src/types/adapter/gondolin-image-converter.js.map +1 -0
- package/dist/src/types/adapter/gondolin-image-fetch.js +5 -0
- package/dist/src/types/adapter/gondolin-image-fetch.js.map +1 -0
- package/dist/src/types/adapter/workflow-loader.js +4 -0
- package/dist/src/types/adapter/workflow-loader.js.map +1 -0
- package/dist/src/types/cli/args.js +8 -0
- package/dist/src/types/cli/args.js.map +1 -0
- package/dist/src/types/config.js +8 -0
- package/dist/src/types/config.js.map +1 -0
- package/dist/src/types/credential-interp.js +6 -0
- package/dist/src/types/credential-interp.js.map +1 -0
- package/dist/src/types/credentials.js +10 -0
- package/dist/src/types/credentials.js.map +1 -0
- package/dist/src/types/doctor.js +7 -0
- package/dist/src/types/doctor.js.map +1 -0
- package/dist/src/types/domain.js +7 -0
- package/dist/src/types/domain.js.map +1 -0
- package/dist/src/types/effect.js +15 -0
- package/dist/src/types/effect.js.map +1 -0
- package/dist/src/types/errors.js +39 -0
- package/dist/src/types/errors.js.map +1 -0
- package/dist/src/types/http/decisions.js +6 -0
- package/dist/src/types/http/decisions.js.map +1 -0
- package/dist/src/types/http/render.js +10 -0
- package/dist/src/types/http/render.js.map +1 -0
- package/dist/src/types/http/views.js +6 -0
- package/dist/src/types/http/views.js.map +1 -0
- package/dist/src/types/http.js +9 -0
- package/dist/src/types/http.js.map +1 -0
- package/dist/src/types/image/managed-image.js +7 -0
- package/dist/src/types/image/managed-image.js.map +1 -0
- package/dist/src/types/interp/effect-interpreter.js +8 -0
- package/dist/src/types/interp/effect-interpreter.js.map +1 -0
- package/dist/src/types/interp/tracker.js +7 -0
- package/dist/src/types/interp/tracker.js.map +1 -0
- package/dist/src/types/issue/file.js +6 -0
- package/dist/src/types/issue/file.js.map +1 -0
- package/dist/src/types/issue/parse.js +8 -0
- package/dist/src/types/issue/parse.js.map +1 -0
- package/dist/src/types/main-acp.js +13 -0
- package/dist/src/types/main-acp.js.map +1 -0
- package/dist/src/types/main-adapters.js +5 -0
- package/dist/src/types/main-adapters.js.map +1 -0
- package/dist/src/types/main-credential.js +21 -0
- package/dist/src/types/main-credential.js.map +1 -0
- package/dist/src/types/main-doctor.js +6 -0
- package/dist/src/types/main-doctor.js.map +1 -0
- package/dist/src/types/main-http-handler.js +12 -0
- package/dist/src/types/main-http-handler.js.map +1 -0
- package/dist/src/types/main-http.js +5 -0
- package/dist/src/types/main-http.js.map +1 -0
- package/dist/src/types/main-loops.js +5 -0
- package/dist/src/types/main-loops.js.map +1 -0
- package/dist/src/types/main-mcp.js +12 -0
- package/dist/src/types/main-mcp.js.map +1 -0
- package/dist/src/types/main-orchestrator.js +5 -0
- package/dist/src/types/main-orchestrator.js.map +1 -0
- package/dist/src/types/main-reconcilers.js +11 -0
- package/dist/src/types/main-reconcilers.js.map +1 -0
- package/dist/src/types/main-runner.js +13 -0
- package/dist/src/types/main-runner.js.map +1 -0
- package/dist/src/types/main-startup.js +5 -0
- package/dist/src/types/main-startup.js.map +1 -0
- package/dist/src/types/main-substrates.js +5 -0
- package/dist/src/types/main-substrates.js.map +1 -0
- package/dist/src/types/mcp/dispatch.js +4 -0
- package/dist/src/types/mcp/dispatch.js.map +1 -0
- package/dist/src/types/mcp/post-move.js +7 -0
- package/dist/src/types/mcp/post-move.js.map +1 -0
- package/dist/src/types/mcp.js +9 -0
- package/dist/src/types/mcp.js.map +1 -0
- package/dist/src/types/ports.js +12 -0
- package/dist/src/types/ports.js.map +1 -0
- package/dist/src/types/reconcile/image-decide.js +5 -0
- package/dist/src/types/reconcile/image-decide.js.map +1 -0
- package/dist/src/types/reconcile/ledger.js +7 -0
- package/dist/src/types/reconcile/ledger.js.map +1 -0
- package/dist/src/types/reconcile/pr-loop.js +8 -0
- package/dist/src/types/reconcile/pr-loop.js.map +1 -0
- package/dist/src/types/reconcile/vm-reap.js +8 -0
- package/dist/src/types/reconcile/vm-reap.js.map +1 -0
- package/dist/src/types/reconcile/workspace-decide.js +7 -0
- package/dist/src/types/reconcile/workspace-decide.js.map +1 -0
- package/dist/src/types/reconcile.js +9 -0
- package/dist/src/types/reconcile.js.map +1 -0
- package/dist/src/types/runlog.js +7 -0
- package/dist/src/types/runlog.js.map +1 -0
- package/dist/src/types/runner/actions-runner.js +12 -0
- package/dist/src/types/runner/actions-runner.js.map +1 -0
- package/dist/src/types/runner/gondolin-dispatch.js +5 -0
- package/dist/src/types/runner/gondolin-dispatch.js.map +1 -0
- package/dist/src/types/runner/injection.js +6 -0
- package/dist/src/types/runner/injection.js.map +1 -0
- package/dist/src/types/runner/runner-loop.js +5 -0
- package/dist/src/types/runner/runner-loop.js.map +1 -0
- package/dist/src/types/runner/turn.js +4 -0
- package/dist/src/types/runner/turn.js.map +1 -0
- package/dist/src/types/runner/vm-plan.js +4 -0
- package/dist/src/types/runner/vm-plan.js.map +1 -0
- package/dist/src/types/runtime.js +9 -0
- package/dist/src/types/runtime.js.map +1 -0
- package/dist/src/types/schedule/admission.js +7 -0
- package/dist/src/types/schedule/admission.js.map +1 -0
- package/dist/src/types/schedule/circuit-breaker.js +2 -0
- package/dist/src/types/schedule/circuit-breaker.js.map +1 -0
- package/dist/src/types/schedule/eligibility.js +9 -0
- package/dist/src/types/schedule/eligibility.js.map +1 -0
- package/dist/src/types/schedule/orchestrator-loop.js +10 -0
- package/dist/src/types/schedule/orchestrator-loop.js.map +1 -0
- package/dist/src/types/schedule/sleep-cycle.js +4 -0
- package/dist/src/types/schedule/sleep-cycle.js.map +1 -0
- package/dist/src/types/schedule/slots.js +8 -0
- package/dist/src/types/schedule/slots.js.map +1 -0
- package/dist/src/types/schedule/tick.js +9 -0
- package/dist/src/types/schedule/tick.js.map +1 -0
- package/dist/src/types/server/mcp-runtime.js +8 -0
- package/dist/src/types/server/mcp-runtime.js.map +1 -0
- package/dist/src/types/workflow/parse.js +4 -0
- package/dist/src/types/workflow/parse.js.map +1 -0
- package/dist/tests/core/account-id.test.js +35 -0
- package/dist/tests/core/account-id.test.js.map +1 -0
- package/dist/tests/core/actions-parse.test.js +176 -0
- package/dist/tests/core/actions-parse.test.js.map +1 -0
- package/dist/tests/core/adapter-config.test.js +133 -0
- package/dist/tests/core/adapter-config.test.js.map +1 -0
- package/dist/tests/core/admission.test.js +215 -0
- package/dist/tests/core/admission.test.js.map +1 -0
- package/dist/tests/core/args.test.js +132 -0
- package/dist/tests/core/args.test.js.map +1 -0
- package/dist/tests/core/availability.test.js +62 -0
- package/dist/tests/core/availability.test.js.map +1 -0
- package/dist/tests/core/checks.test.js +395 -0
- package/dist/tests/core/checks.test.js.map +1 -0
- package/dist/tests/core/circuit-breaker.test.js +172 -0
- package/dist/tests/core/circuit-breaker.test.js.map +1 -0
- package/dist/tests/core/coerce.test.js +87 -0
- package/dist/tests/core/coerce.test.js.map +1 -0
- package/dist/tests/core/context.test.js +228 -0
- package/dist/tests/core/context.test.js.map +1 -0
- package/dist/tests/core/decisions.test.js +310 -0
- package/dist/tests/core/decisions.test.js.map +1 -0
- package/dist/tests/core/derive.test.js +205 -0
- package/dist/tests/core/derive.test.js.map +1 -0
- package/dist/tests/core/dispatch-config.test.js +164 -0
- package/dist/tests/core/dispatch-config.test.js.map +1 -0
- package/dist/tests/core/dispatch.test.js +302 -0
- package/dist/tests/core/dispatch.test.js.map +1 -0
- package/dist/tests/core/eligibility.test.js +163 -0
- package/dist/tests/core/eligibility.test.js.map +1 -0
- package/dist/tests/core/extract.test.js +139 -0
- package/dist/tests/core/extract.test.js.map +1 -0
- package/dist/tests/core/fake-creds.test.js +134 -0
- package/dist/tests/core/fake-creds.test.js.map +1 -0
- package/dist/tests/core/file.test.js +197 -0
- package/dist/tests/core/file.test.js.map +1 -0
- package/dist/tests/core/git-result.test.js +113 -0
- package/dist/tests/core/git-result.test.js.map +1 -0
- package/dist/tests/core/identity.test.js +180 -0
- package/dist/tests/core/identity.test.js.map +1 -0
- package/dist/tests/core/image-decide.test.js +59 -0
- package/dist/tests/core/image-decide.test.js.map +1 -0
- package/dist/tests/core/injection.test.js +163 -0
- package/dist/tests/core/injection.test.js.map +1 -0
- package/dist/tests/core/ledger.test.js +218 -0
- package/dist/tests/core/ledger.test.js.map +1 -0
- package/dist/tests/core/managed-image.test.js +68 -0
- package/dist/tests/core/managed-image.test.js.map +1 -0
- package/dist/tests/core/mise.test.js +138 -0
- package/dist/tests/core/mise.test.js.map +1 -0
- package/dist/tests/core/parse.test.js +174 -0
- package/dist/tests/core/parse.test.js.map +1 -0
- package/dist/tests/core/path.test.js +50 -0
- package/dist/tests/core/path.test.js.map +1 -0
- package/dist/tests/core/plan.test.js +218 -0
- package/dist/tests/core/plan.test.js.map +1 -0
- package/dist/tests/core/post-move.test.js +162 -0
- package/dist/tests/core/post-move.test.js.map +1 -0
- package/dist/tests/core/pr-classify.test.js +117 -0
- package/dist/tests/core/pr-classify.test.js.map +1 -0
- package/dist/tests/core/pr-decide.test.js +298 -0
- package/dist/tests/core/pr-decide.test.js.map +1 -0
- package/dist/tests/core/pr-loop.test.js +301 -0
- package/dist/tests/core/pr-loop.test.js.map +1 -0
- package/dist/tests/core/pr-notes.test.js +165 -0
- package/dist/tests/core/pr-notes.test.js.map +1 -0
- package/dist/tests/core/predicates.test.js +154 -0
- package/dist/tests/core/predicates.test.js.map +1 -0
- package/dist/tests/core/prompt.test.js +189 -0
- package/dist/tests/core/prompt.test.js.map +1 -0
- package/dist/tests/core/protocol.test.js +195 -0
- package/dist/tests/core/protocol.test.js.map +1 -0
- package/dist/tests/core/reconcile-issue.test.js +116 -0
- package/dist/tests/core/reconcile-issue.test.js.map +1 -0
- package/dist/tests/core/render.test.js +549 -0
- package/dist/tests/core/render.test.js.map +1 -0
- package/dist/tests/core/retry.test.js +186 -0
- package/dist/tests/core/retry.test.js.map +1 -0
- package/dist/tests/core/routes.test.js +247 -0
- package/dist/tests/core/routes.test.js.map +1 -0
- package/dist/tests/core/run-fold.test.js +299 -0
- package/dist/tests/core/run-fold.test.js.map +1 -0
- package/dist/tests/core/shape.test.js +185 -0
- package/dist/tests/core/shape.test.js.map +1 -0
- package/dist/tests/core/sleep-cycle.test.js +150 -0
- package/dist/tests/core/sleep-cycle.test.js.map +1 -0
- package/dist/tests/core/slots.test.js +201 -0
- package/dist/tests/core/slots.test.js.map +1 -0
- package/dist/tests/core/state-resolve.test.js +80 -0
- package/dist/tests/core/state-resolve.test.js.map +1 -0
- package/dist/tests/core/summary.test.js +200 -0
- package/dist/tests/core/summary.test.js.map +1 -0
- package/dist/tests/core/template.test.js +116 -0
- package/dist/tests/core/template.test.js.map +1 -0
- package/dist/tests/core/tick.test.js +558 -0
- package/dist/tests/core/tick.test.js.map +1 -0
- package/dist/tests/core/token-fold.test.js +176 -0
- package/dist/tests/core/token-fold.test.js.map +1 -0
- package/dist/tests/core/turn.test.js +388 -0
- package/dist/tests/core/turn.test.js.map +1 -0
- package/dist/tests/core/url.test.js +118 -0
- package/dist/tests/core/url.test.js.map +1 -0
- package/dist/tests/core/validate.test.js +247 -0
- package/dist/tests/core/validate.test.js.map +1 -0
- package/dist/tests/core/views.test.js +252 -0
- package/dist/tests/core/views.test.js.map +1 -0
- package/dist/tests/core/vm-decide.test.js +110 -0
- package/dist/tests/core/vm-decide.test.js.map +1 -0
- package/dist/tests/core/vm-guards.test.js +153 -0
- package/dist/tests/core/vm-guards.test.js.map +1 -0
- package/dist/tests/core/vm-plan.test.js +332 -0
- package/dist/tests/core/vm-plan.test.js.map +1 -0
- package/dist/tests/core/vm-reap.test.js +196 -0
- package/dist/tests/core/vm-reap.test.js.map +1 -0
- package/dist/tests/core/workflow-parse.test.js +493 -0
- package/dist/tests/core/workflow-parse.test.js.map +1 -0
- package/dist/tests/core/workspace-decide.test.js +236 -0
- package/dist/tests/core/workspace-decide.test.js.map +1 -0
- package/dist/tests/helpers/fixtures.js +167 -0
- package/dist/tests/helpers/fixtures.js.map +1 -0
- package/dist/tests/shell/acp-substrate.test.js +101 -0
- package/dist/tests/shell/acp-substrate.test.js.map +1 -0
- package/dist/tests/shell/actions-runner-push.test.js +203 -0
- package/dist/tests/shell/actions-runner-push.test.js.map +1 -0
- package/dist/tests/shell/credential-hooks.test.js +36 -0
- package/dist/tests/shell/credential-hooks.test.js.map +1 -0
- package/dist/tests/shell/credential-registry.test.js +165 -0
- package/dist/tests/shell/credential-registry.test.js.map +1 -0
- package/dist/tests/shell/credential-substrate.test.js +179 -0
- package/dist/tests/shell/credential-substrate.test.js.map +1 -0
- package/dist/tests/shell/dockerfile-mise-pin.test.js +51 -0
- package/dist/tests/shell/dockerfile-mise-pin.test.js.map +1 -0
- package/dist/tests/shell/doctor.test.js +101 -0
- package/dist/tests/shell/doctor.test.js.map +1 -0
- package/dist/tests/shell/effect-vm-create.test.js +52 -0
- package/dist/tests/shell/effect-vm-create.test.js.map +1 -0
- package/dist/tests/shell/gh-port.test.js +63 -0
- package/dist/tests/shell/gh-port.test.js.map +1 -0
- package/dist/tests/shell/gondolin-dispatch-guard.test.js +144 -0
- package/dist/tests/shell/gondolin-dispatch-guard.test.js.map +1 -0
- package/dist/tests/shell/gondolin-dispatch-shquote.test.js +168 -0
- package/dist/tests/shell/gondolin-dispatch-shquote.test.js.map +1 -0
- package/dist/tests/shell/gondolin-image-converter.test.js +208 -0
- package/dist/tests/shell/gondolin-image-converter.test.js.map +1 -0
- package/dist/tests/shell/gondolin-image-fetch.test.js +93 -0
- package/dist/tests/shell/gondolin-image-fetch.test.js.map +1 -0
- package/dist/tests/shell/http-handler.test.js +608 -0
- package/dist/tests/shell/http-handler.test.js.map +1 -0
- package/dist/tests/shell/http-server.test.js +53 -0
- package/dist/tests/shell/http-server.test.js.map +1 -0
- package/dist/tests/shell/mcp-runtime.test.js +366 -0
- package/dist/tests/shell/mcp-runtime.test.js.map +1 -0
- package/dist/tests/shell/mise-config-asset.test.js +87 -0
- package/dist/tests/shell/mise-config-asset.test.js.map +1 -0
- package/dist/tests/shell/orchestrator-loop.test.js +583 -0
- package/dist/tests/shell/orchestrator-loop.test.js.map +1 -0
- package/dist/tests/shell/reconciler-passes.test.js +314 -0
- package/dist/tests/shell/reconciler-passes.test.js.map +1 -0
- package/dist/tests/shell/runner-loop-turn.test.js +97 -0
- package/dist/tests/shell/runner-loop-turn.test.js.map +1 -0
- package/dist/tests/shell/runner-slice.test.js +536 -0
- package/dist/tests/shell/runner-slice.test.js.map +1 -0
- package/dist/tests/shell/scaffold.test.js +65 -0
- package/dist/tests/shell/scaffold.test.js.map +1 -0
- package/dist/tests/shell/tick-config.test.js +83 -0
- package/dist/tests/shell/tick-config.test.js.map +1 -0
- package/dist/tests/shell/tracker-parse-dates.test.js +44 -0
- package/dist/tests/shell/tracker-parse-dates.test.js.map +1 -0
- package/dist/tests/shell/tracker-write-issue.test.js +154 -0
- package/dist/tests/shell/tracker-write-issue.test.js.map +1 -0
- package/dist/tests/shell/workflow-prompt-split.test.js +208 -0
- package/dist/tests/shell/workflow-prompt-split.test.js.map +1 -0
- package/dist/tests/shell/workspace-live-config.test.js +140 -0
- package/dist/tests/shell/workspace-live-config.test.js.map +1 -0
- package/package.json +21 -9
- package/patches/@earendil-works+gondolin+0.12.0.patch +173 -0
- package/prompts/Reflect.md +91 -0
- package/prompts/Review.md +97 -0
- package/prompts/Todo.md +96 -0
- package/prompts/_footer.md +41 -0
- package/prompts/_preamble.md +42 -0
- package/prompts-minimal/Todo.md +26 -0
- package/scripts/postinstall.mjs +63 -0
- package/scripts/vm-agent.mjs +312 -90
- package/WORKFLOW.md +0 -744
- package/dist/acp-bridge.js +0 -324
- package/dist/acp-bridge.js.map +0 -1
- package/dist/actions/cache.js +0 -191
- package/dist/actions/cache.js.map +0 -1
- package/dist/actions/effects.js +0 -41
- package/dist/actions/effects.js.map +0 -1
- package/dist/actions/executor.js +0 -570
- package/dist/actions/executor.js.map +0 -1
- package/dist/actions/index.js +0 -13
- package/dist/actions/index.js.map +0 -1
- package/dist/actions/parsing.js.map +0 -1
- package/dist/actions/predicate-env.js +0 -27
- package/dist/actions/predicate-env.js.map +0 -1
- package/dist/actions/predicates.js +0 -49
- package/dist/actions/predicates.js.map +0 -1
- package/dist/actions/templating.js +0 -66
- package/dist/actions/templating.js.map +0 -1
- package/dist/actions/types.js +0 -15
- package/dist/actions/types.js.map +0 -1
- package/dist/agent/acp.js +0 -473
- package/dist/agent/acp.js.map +0 -1
- package/dist/agent/adapter-names.js +0 -159
- package/dist/agent/adapter-names.js.map +0 -1
- package/dist/agent/adapters.js +0 -511
- package/dist/agent/adapters.js.map +0 -1
- package/dist/agent/credential-extractors.js +0 -342
- package/dist/agent/credential-extractors.js.map +0 -1
- package/dist/agent/credential-secrets.js +0 -628
- package/dist/agent/credential-secrets.js.map +0 -1
- package/dist/agent/credential-ticker.js +0 -57
- package/dist/agent/credential-ticker.js.map +0 -1
- package/dist/agent/gondolin-creds-staging.js +0 -356
- package/dist/agent/gondolin-creds-staging.js.map +0 -1
- package/dist/agent/gondolin-dispatch.js +0 -375
- package/dist/agent/gondolin-dispatch.js.map +0 -1
- package/dist/agent/gondolin.js +0 -124
- package/dist/agent/gondolin.js.map +0 -1
- package/dist/agent/runner-decisions.js +0 -134
- package/dist/agent/runner-decisions.js.map +0 -1
- package/dist/agent/runner.js +0 -1456
- package/dist/agent/runner.js.map +0 -1
- package/dist/agent/tool-call-summary.js +0 -102
- package/dist/agent/tool-call-summary.js.map +0 -1
- package/dist/agent/vm-acp-mapping.js +0 -73
- package/dist/agent/vm-acp-mapping.js.map +0 -1
- package/dist/agent/vm-guards.js +0 -262
- package/dist/agent/vm-guards.js.map +0 -1
- package/dist/agent/vm-port.js +0 -22
- package/dist/agent/vm-port.js.map +0 -1
- package/dist/agent/vm-process-registry.js +0 -79
- package/dist/agent/vm-process-registry.js.map +0 -1
- package/dist/bin/cli-args.js +0 -105
- package/dist/bin/cli-args.js.map +0 -1
- package/dist/bin/symphony.js +0 -794
- package/dist/bin/symphony.js.map +0 -1
- package/dist/errors.js +0 -15
- package/dist/errors.js.map +0 -1
- package/dist/http-disk.js +0 -135
- package/dist/http-disk.js.map +0 -1
- package/dist/http-handlers.js.map +0 -1
- package/dist/http.js.map +0 -1
- package/dist/issues.js +0 -178
- package/dist/issues.js.map +0 -1
- package/dist/logging.js +0 -203
- package/dist/logging.js.map +0 -1
- package/dist/mcp.js +0 -706
- package/dist/mcp.js.map +0 -1
- package/dist/memory.js +0 -85
- package/dist/memory.js.map +0 -1
- package/dist/orchestrator-decisions.js +0 -331
- package/dist/orchestrator-decisions.js.map +0 -1
- package/dist/orchestrator.js +0 -1569
- package/dist/orchestrator.js.map +0 -1
- package/dist/prompt.js +0 -65
- package/dist/prompt.js.map +0 -1
- package/dist/reconciler/cache.js +0 -65
- package/dist/reconciler/cache.js.map +0 -1
- package/dist/reconciler/index.js +0 -448
- package/dist/reconciler/index.js.map +0 -1
- package/dist/reconciler/ledger.js +0 -131
- package/dist/reconciler/ledger.js.map +0 -1
- package/dist/reconciler/pr-adapters.js +0 -174
- package/dist/reconciler/pr-adapters.js.map +0 -1
- package/dist/reconciler/pr-decide.js.map +0 -1
- package/dist/reconciler/pr.js +0 -422
- package/dist/reconciler/pr.js.map +0 -1
- package/dist/reconciler/types.js +0 -12
- package/dist/reconciler/types.js.map +0 -1
- package/dist/reconciler/vm.js +0 -243
- package/dist/reconciler/vm.js.map +0 -1
- package/dist/reconciler/workspace-defaults.js +0 -83
- package/dist/reconciler/workspace-defaults.js.map +0 -1
- package/dist/reconciler/workspace.js +0 -272
- package/dist/reconciler/workspace.js.map +0 -1
- package/dist/runlog.js +0 -403
- package/dist/runlog.js.map +0 -1
- package/dist/scaffold.js +0 -165
- package/dist/scaffold.js.map +0 -1
- package/dist/trackers/local.js +0 -445
- package/dist/trackers/local.js.map +0 -1
- package/dist/trackers/types.js +0 -10
- package/dist/trackers/types.js.map +0 -1
- package/dist/types.js +0 -3
- package/dist/types.js.map +0 -1
- package/dist/util/clock.js +0 -12
- package/dist/util/clock.js.map +0 -1
- package/dist/util/crypto.js +0 -25
- package/dist/util/crypto.js.map +0 -1
- package/dist/util/frontmatter.js +0 -70
- package/dist/util/frontmatter.js.map +0 -1
- package/dist/util/fs-issues.js +0 -22
- package/dist/util/fs-issues.js.map +0 -1
- package/dist/util/process.js +0 -152
- package/dist/util/process.js.map +0 -1
- package/dist/util/workspace-key.js +0 -10
- package/dist/util/workspace-key.js.map +0 -1
- package/dist/workflow-loader.js +0 -147
- package/dist/workflow-loader.js.map +0 -1
- package/dist/workflow.js +0 -822
- package/dist/workflow.js.map +0 -1
- package/dist/workspace-types.js +0 -8
- package/dist/workspace-types.js.map +0 -1
- package/dist/workspace.js +0 -443
- package/dist/workspace.js.map +0 -1
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
// FCIS rewrite — pure token-usage / runtime-event / tool-call-lifecycle folds.
|
|
2
|
+
//
|
|
3
|
+
// Ported faithfully from the original orchestrator (`reportTokenUsage`,
|
|
4
|
+
// `reportRuntimeEvent`, `reportTurnStarted`, the `detectStalls` in-flight guard)
|
|
5
|
+
// and `src/agent/tool-call-summary.ts:toolCallLifecycle`. The original mutated
|
|
6
|
+
// the live `RunningEntry` map and the aggregate `SessionTotals` in place; here
|
|
7
|
+
// every fold is a pure, SYNCHRONOUS `(data) -> data` returning the next state
|
|
8
|
+
// (and, for the token fold, the per-report delta so the shell can add it into
|
|
9
|
+
// the aggregate SessionTotals). No clock, no randomness, no IO, no Effects —
|
|
10
|
+
// these are in-memory state folds, not side effects. Imports are restricted to
|
|
11
|
+
// src/types.
|
|
12
|
+
//
|
|
13
|
+
// Three responsibilities, one per concern in the original:
|
|
14
|
+
// 1. foldTokenUsage — absolute totals → session deltas (no double counting).
|
|
15
|
+
// 2. foldRuntimeEvent — append into the recent_events ring + last_event/at.
|
|
16
|
+
// 3. tool-call lifecycle — active-tool-call set updates + stall-reaper guard.
|
|
17
|
+
// ─── 1. Token-usage delta accounting ─────────────────────────────────────────
|
|
18
|
+
/**
|
|
19
|
+
* Cap on the recent-events ring buffer. The original kept the last 50 events
|
|
20
|
+
* (`if (e.recent_events.length > 50) e.recent_events.shift()`).
|
|
21
|
+
*/
|
|
22
|
+
export const RECENT_EVENTS_CAP = 50;
|
|
23
|
+
/**
|
|
24
|
+
* §9.4 token accounting: prefer the adapter's ABSOLUTE running totals, but only
|
|
25
|
+
* add the per-report DELTA into the aggregate so re-reported totals are not
|
|
26
|
+
* double counted.
|
|
27
|
+
*
|
|
28
|
+
* Mirrors the original `reportTokenUsage`:
|
|
29
|
+
* - `dX = max(0, usage.X - last_reported_X)` (clamped at 0 — a regression /
|
|
30
|
+
* reset in the absolute counter never SUBTRACTS from the aggregate),
|
|
31
|
+
* - the entry's visible totals become the new absolute values,
|
|
32
|
+
* - the baselines advance to the new absolute values.
|
|
33
|
+
*
|
|
34
|
+
* Pure: takes the prior baselines + the new reading, returns the TokenDelta the
|
|
35
|
+
* shell folds. The shell adds `*_delta` into the aggregate SessionTotals (see
|
|
36
|
+
* `addDeltaToTotals`) and stores the new `last_reported_*` + absolute totals on
|
|
37
|
+
* the running entry.
|
|
38
|
+
*/
|
|
39
|
+
export function foldTokenUsage(prior, usage) {
|
|
40
|
+
const input_delta = Math.max(0, usage.input_tokens - prior.last_reported_input);
|
|
41
|
+
const output_delta = Math.max(0, usage.output_tokens - prior.last_reported_output);
|
|
42
|
+
const total_delta = Math.max(0, usage.total_tokens - prior.last_reported_total);
|
|
43
|
+
return {
|
|
44
|
+
input_delta,
|
|
45
|
+
output_delta,
|
|
46
|
+
total_delta,
|
|
47
|
+
last_reported_input: usage.input_tokens,
|
|
48
|
+
last_reported_output: usage.output_tokens,
|
|
49
|
+
last_reported_total: usage.total_tokens,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Add a TokenDelta into the aggregate SessionTotals (no double counting — the
|
|
54
|
+
* delta is already de-duplicated by `foldTokenUsage`). `seconds_running` is
|
|
55
|
+
* carried through unchanged; it is accrued elsewhere (on attempt exit). Returns
|
|
56
|
+
* a new SessionTotals; does not mutate the input.
|
|
57
|
+
*/
|
|
58
|
+
export function addDeltaToTotals(totals, delta) {
|
|
59
|
+
return {
|
|
60
|
+
input_tokens: totals.input_tokens + delta.input_delta,
|
|
61
|
+
output_tokens: totals.output_tokens + delta.output_delta,
|
|
62
|
+
total_tokens: totals.total_tokens + delta.total_delta,
|
|
63
|
+
seconds_running: totals.seconds_running,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Fold one RuntimeEvent into a running entry's event slice. Mirrors the
|
|
68
|
+
* original `reportRuntimeEvent` (minus the live tool-call-set mutation, which is
|
|
69
|
+
* a separate concern handled by `foldToolCall`): updates `last_event` /
|
|
70
|
+
* `last_event_at` / `last_message` and pushes onto the recent-events ring,
|
|
71
|
+
* trimming the OLDEST when it exceeds `RECENT_EVENTS_CAP`.
|
|
72
|
+
*
|
|
73
|
+
* Pure: returns a new RuntimeEventState (and a fresh `recent_events` array); the
|
|
74
|
+
* input is not mutated.
|
|
75
|
+
*/
|
|
76
|
+
export function foldRuntimeEvent(state, ev) {
|
|
77
|
+
const recent_events = [...state.recent_events, ev];
|
|
78
|
+
while (recent_events.length > RECENT_EVENTS_CAP)
|
|
79
|
+
recent_events.shift();
|
|
80
|
+
return {
|
|
81
|
+
last_event: ev.event,
|
|
82
|
+
last_event_at: ev.at,
|
|
83
|
+
last_message: ev.message,
|
|
84
|
+
recent_events,
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
// ─── 3. Active-tool-call lifecycle / stall-reaper suppression ─────────────────
|
|
88
|
+
/**
|
|
89
|
+
* Map an ACP tool notification to its effect on the in-flight tool-call set.
|
|
90
|
+
* Ported verbatim from `src/agent/tool-call-summary.ts:toolCallLifecycle`.
|
|
91
|
+
*
|
|
92
|
+
* ACP `ToolCallStatus` is `pending | in_progress | completed | failed`;
|
|
93
|
+
* `completed` / `failed` are terminal. A `tool_call` STARTS a tool (in-flight)
|
|
94
|
+
* unless it already carries a terminal status. A `tool_call_update` acts ONLY on
|
|
95
|
+
* a known status: terminal → ended, pending / in_progress → in-flight; an
|
|
96
|
+
* omitted / null / unknown status is a content-or-title-only delta and must NOT
|
|
97
|
+
* mutate the set (returns `undefined` = "no change").
|
|
98
|
+
*/
|
|
99
|
+
export function toolCallLifecycle(event, status) {
|
|
100
|
+
const terminal = status === 'completed' || status === 'failed';
|
|
101
|
+
if (event === 'tool_call')
|
|
102
|
+
return { ended: terminal };
|
|
103
|
+
if (terminal)
|
|
104
|
+
return { ended: true };
|
|
105
|
+
if (status === 'pending' || status === 'in_progress')
|
|
106
|
+
return { ended: false };
|
|
107
|
+
return undefined;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Apply a tool-call lifecycle delta to the in-flight set. Mirrors the original
|
|
111
|
+
* `reportRuntimeEvent` tool branch: a non-terminal delta ADDS the id (in
|
|
112
|
+
* flight), a terminal delta DELETES it (ended). The set is modeled as a sorted,
|
|
113
|
+
* de-duplicated array of ids so core stays free of live `Set` handles and the
|
|
114
|
+
* result is deterministic. Pure: returns a new array; the input is not mutated.
|
|
115
|
+
*
|
|
116
|
+
* Pass `undefined` (the "no change" case from `toolCallLifecycle`) and the set
|
|
117
|
+
* is returned unchanged. An empty `id` is ignored (matches the original guard
|
|
118
|
+
* `if (ev.tool && ev.tool.id)`).
|
|
119
|
+
*/
|
|
120
|
+
export function applyToolDelta(active, delta) {
|
|
121
|
+
if (!delta || !delta.id)
|
|
122
|
+
return [...active];
|
|
123
|
+
if (delta.ended)
|
|
124
|
+
return active.filter((id) => id !== delta.id);
|
|
125
|
+
if (active.includes(delta.id))
|
|
126
|
+
return [...active];
|
|
127
|
+
return [...active, delta.id].sort();
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Turn-boundary reset of the in-flight set. Mirrors the original
|
|
131
|
+
* `reportTurnStarted`, which `e.active_tool_calls.clear()`s at every turn
|
|
132
|
+
* boundary: the prior turn's `session/prompt` has resolved, so no tool call from
|
|
133
|
+
* it can still be in flight. Clearing here backstops a leaked terminal
|
|
134
|
+
* `tool_call_update` so a stale id can't mask a real mid-turn stall (RCA
|
|
135
|
+
* 2026-06-02). Pure: always returns an empty set.
|
|
136
|
+
*/
|
|
137
|
+
export function clearToolCallsAtTurnBoundary() {
|
|
138
|
+
return [];
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Whether the no-activity stall reaper should be SUPPRESSED for a running entry.
|
|
142
|
+
* Mirrors the two `continue` guards in the original `detectStalls`:
|
|
143
|
+
* - `steeringRequested` — the agent is intentionally paused while the human
|
|
144
|
+
* composes a reply, which can legitimately exceed `stall_timeout_ms`.
|
|
145
|
+
* - `activeToolCallCount > 0` — a long silent tool (e.g. `… | tail`) produces
|
|
146
|
+
* no ACP frames for its whole duration, so the no-activity timer would reap a
|
|
147
|
+
* legitimately-busy agent merely blocked on the tool.
|
|
148
|
+
*
|
|
149
|
+
* The hard `prompt_timeout_ms` cap (a separate concern) backstops a tool that
|
|
150
|
+
* genuinely hangs, and operator/terminal cancel still applies regardless.
|
|
151
|
+
*/
|
|
152
|
+
export function shouldSuppressStallReaper(args) {
|
|
153
|
+
return args.steeringRequested || args.activeToolCallCount > 0;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Whether a running entry has stalled: the no-activity reaper fires when the
|
|
157
|
+
* timeout is positive, the entry is NOT suppressed, and the elapsed time since
|
|
158
|
+
* the last reference point (`last_event_at` ?? `started_at`) exceeds the
|
|
159
|
+
* timeout. Mirrors the body of the original `detectStalls` loop.
|
|
160
|
+
*
|
|
161
|
+
* The clock is INJECTED as `nowMs` (core never reads the wall clock).
|
|
162
|
+
* `lastReferenceMs` is the parsed `last_event_at ?? started_at` epoch ms (the
|
|
163
|
+
* shell parses the ISO timestamp; core stays free of `Date.parse`). A
|
|
164
|
+
* non-finite `lastReferenceMs` is treated as "cannot decide" → not stalled
|
|
165
|
+
* (matches the original `Number.isFinite(elapsed)` guard). Returns the elapsed
|
|
166
|
+
* ms when stalled so the shell can format the terminate reason
|
|
167
|
+
* (`stalled after <elapsed>ms`), or `null` when not stalled.
|
|
168
|
+
*/
|
|
169
|
+
export function detectStall(args) {
|
|
170
|
+
if (args.stallTimeoutMs <= 0)
|
|
171
|
+
return { stalled: false };
|
|
172
|
+
if (shouldSuppressStallReaper(args))
|
|
173
|
+
return { stalled: false };
|
|
174
|
+
const elapsed = args.nowMs - args.lastReferenceMs;
|
|
175
|
+
if (!Number.isFinite(elapsed))
|
|
176
|
+
return { stalled: false };
|
|
177
|
+
if (elapsed > args.stallTimeoutMs)
|
|
178
|
+
return { stalled: true, elapsedMs: elapsed };
|
|
179
|
+
return { stalled: false };
|
|
180
|
+
}
|
|
181
|
+
//# sourceMappingURL=token-fold.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"token-fold.js","sourceRoot":"","sources":["../../../../src/core/schedule/token-fold.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,EAAE;AACF,wEAAwE;AACxE,iFAAiF;AACjF,+EAA+E;AAC/E,+EAA+E;AAC/E,8EAA8E;AAC9E,8EAA8E;AAC9E,6EAA6E;AAC7E,+EAA+E;AAC/E,aAAa;AACb,EAAE;AACF,2DAA2D;AAC3D,gFAAgF;AAChF,8EAA8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;;;;;;;;;GAWG;AACH,MAAM,UAAU,yBAAyB,CAAC,IAGzC;IACC,OAAO,IAAI,CAAC,iBAAiB,IAAI,IAAI,CAAC,mBAAmB,GAAG,CAAC,CAAC;AAChE,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,WAAW,CAAC,IAM3B;IACC,IAAI,IAAI,CAAC,cAAc,IAAI,CAAC;QAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IACxD,IAAI,yBAAyB,CAAC,IAAI,CAAC;QAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAC/D,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,eAAe,CAAC;IAClD,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IACzD,IAAI,OAAO,GAAG,IAAI,CAAC,cAAc;QAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC;IAChF,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;AAC5B,CAAC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
// FCIS rewrite — the ONE canonical case-insensitive declared-state-name resolver.
|
|
2
|
+
//
|
|
3
|
+
// Functional core: pure, synchronous (data) -> data. No IO, no clock, no
|
|
4
|
+
// randomness, no node: imports. Imports ONLY from src/types.
|
|
5
|
+
//
|
|
6
|
+
// Collapses what used to be FIVE byte-equivalent copies of the same
|
|
7
|
+
// case-insensitive declared-name lookup (the original spread it across
|
|
8
|
+
// src/issues.ts, src/agent/runner.ts, and src/mcp.ts):
|
|
9
|
+
// - core/states.ts:resolveStateKey (deleted — orphan module)
|
|
10
|
+
// - core/runner/dispatch-config.ts:resolveStateKey (re-points here)
|
|
11
|
+
// - core/mcp/url.ts:canonicalStateName (re-points here)
|
|
12
|
+
// - core/mcp/dispatch.ts:canonicalStateName (re-points to resolveDeclaredName)
|
|
13
|
+
// - core/schedule/eligibility.ts:canonicalStateKey (re-points here)
|
|
14
|
+
// - inlined in core/workflow/derive.ts:resolveActionsForState (re-points here)
|
|
15
|
+
//
|
|
16
|
+
// Resolution contract (ported verbatim from every copy): an exact own-property
|
|
17
|
+
// match wins; failing that, a case-insensitive scan over the declared keys in
|
|
18
|
+
// declaration order (first match wins). Matches the rest of symphony, where
|
|
19
|
+
// eligibility, reconciliation, and the local-tracker directories all compare
|
|
20
|
+
// lowercase, so a workflow that declares `Todo` and a tracker file living under
|
|
21
|
+
// `todo/` still resolves correctly.
|
|
22
|
+
/**
|
|
23
|
+
* Resolve `name` to its canonical declared form given the declared names in
|
|
24
|
+
* declaration order. Exact match wins; otherwise a case-insensitive scan
|
|
25
|
+
* (first match in declaration order). Returns null when no declared name
|
|
26
|
+
* matches.
|
|
27
|
+
*
|
|
28
|
+
* This is the shape-agnostic core: callers that hold a `Record<string,
|
|
29
|
+
* StateConfig>` use {@link resolveStateKey}; callers that hold a precomputed
|
|
30
|
+
* declared-name list (e.g. the MCP `McpStatesView.order`) call this directly.
|
|
31
|
+
*/
|
|
32
|
+
export function resolveDeclaredName(order, name) {
|
|
33
|
+
for (const declared of order) {
|
|
34
|
+
if (declared === name)
|
|
35
|
+
return declared;
|
|
36
|
+
}
|
|
37
|
+
const lower = name.toLowerCase();
|
|
38
|
+
for (const declared of order) {
|
|
39
|
+
if (declared.toLowerCase() === lower)
|
|
40
|
+
return declared;
|
|
41
|
+
}
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Resolve a (possibly differently-cased) state name to its canonical declared
|
|
46
|
+
* key in `states`, or null when no state matches. Thin wrapper over
|
|
47
|
+
* {@link resolveDeclaredName} keyed by `Object.keys(states)` (which is the
|
|
48
|
+
* declaration order). An exact own-property hit short-circuits the scan.
|
|
49
|
+
*/
|
|
50
|
+
export function resolveStateKey(states, state) {
|
|
51
|
+
if (Object.prototype.hasOwnProperty.call(states, state))
|
|
52
|
+
return state;
|
|
53
|
+
const lower = state.toLowerCase();
|
|
54
|
+
for (const name of Object.keys(states)) {
|
|
55
|
+
if (name.toLowerCase() === lower)
|
|
56
|
+
return name;
|
|
57
|
+
}
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Is moving `fromState -> toState` *in-flow* given the from-state's
|
|
62
|
+
* `allowed_transitions`? The ONE definition shared by the agent's hard gate
|
|
63
|
+
* (`decideTransition`, src/core/mcp/dispatch.ts — it rejects an off-flow move
|
|
64
|
+
* with `transition_not_allowed`) and the operator's soft warning
|
|
65
|
+
* (`decideMoveTransition`, src/core/http/decisions.ts — it merely flags
|
|
66
|
+
* `off_flow` and lets the move through). Factoring it here keeps the two from
|
|
67
|
+
* drifting (issue 126).
|
|
68
|
+
*
|
|
69
|
+
* A move is in-flow when ANY of:
|
|
70
|
+
* - it is a self-transition (case-insensitive `from === to`) — always a no-op;
|
|
71
|
+
* - the from-state's `allowed_transitions` is null/undefined — the open
|
|
72
|
+
* default ("any declared state is reachable");
|
|
73
|
+
* - the target is a member of a non-null `allowed_transitions` list
|
|
74
|
+
* (case-insensitive).
|
|
75
|
+
* It is OFF-flow only when the list is non-null and does not include the target.
|
|
76
|
+
* An empty list (`[]`) therefore makes every non-self target off-flow.
|
|
77
|
+
*/
|
|
78
|
+
export function isInFlowTransition(allowedTransitions, fromState, toState) {
|
|
79
|
+
if (fromState.toLowerCase() === toState.toLowerCase())
|
|
80
|
+
return true;
|
|
81
|
+
if (allowedTransitions == null)
|
|
82
|
+
return true;
|
|
83
|
+
const wanted = toState.toLowerCase();
|
|
84
|
+
return allowedTransitions.some((s) => s.toLowerCase() === wanted);
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=state-resolve.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state-resolve.js","sourceRoot":"","sources":["../../../src/core/state-resolve.ts"],"names":[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ACjB,OAAe;IAEf,IAAI,SAAS,CAAC,WAAW,EAAE,KAAK,OAAO,CAAC,WAAW,EAAE;QAAE,OAAO,IAAI,CAAC;IACnE,IAAI,kBAAkB,IAAI,IAAI;QAAE,OAAO,IAAI,CAAC;IAC5C,MAAM,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IACrC,OAAO,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,KAAK,MAAM,CAAC,CAAC;AACpE,CAAC"}
|
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
// FCIS rewrite — pure VM safety guards (the *teeth* of the host-only-refresh
|
|
2
|
+
// invariant). These are the createVm-options-building checks the Gondolin
|
|
3
|
+
// dispatch path runs so the guest is enforced-by-construction to hold only
|
|
4
|
+
// placeholders: real refresh / durable tokens never leave the host.
|
|
5
|
+
//
|
|
6
|
+
// 100% PURE + SYNCHRONOUS. No IO, no node: imports, no clock/randomness. POSIX
|
|
7
|
+
// path normalization is done LEXICALLY and inline (the original leaned on
|
|
8
|
+
// `node:path` + an injected `fs.realpath`; core may import neither). The lexical
|
|
9
|
+
// denylist check is *more conservative* than a symlink-resolving one — it cannot
|
|
10
|
+
// be widened by a symlink that resolves out of a denied dir, and a non-existent
|
|
11
|
+
// path can't be mounted anyway.
|
|
12
|
+
//
|
|
13
|
+
// The reference's `realpath` symlink-resolution (codex HIGH) is IO and lives in
|
|
14
|
+
// the shell: the shell canonicalizes the mount source through `fs.realpathSync`
|
|
15
|
+
// and passes BOTH the lexical and resolved forms through assertNoCredentialMounts.
|
|
16
|
+
// This pure core does only the lexical check by design.
|
|
17
|
+
import { CredentialMountError } from '../types/errors.js';
|
|
18
|
+
import { joinPosix } from './path.js';
|
|
19
|
+
// The synthetic guest↔host control-plane vocabulary lives canonically in
|
|
20
|
+
// core/mcp/url.ts (the dedicated MCP/ACP URL module); only MCP_GUEST_BASE_URL is
|
|
21
|
+
// used locally (by guestMcpBaseUrl below) — the rest is re-exported, see the
|
|
22
|
+
// "ACP / MCP guest control-plane URL derivation" section at the bottom.
|
|
23
|
+
import { MCP_GUEST_BASE_URL } from './mcp/url.js';
|
|
24
|
+
// ---------------------------------------------------------------------------
|
|
25
|
+
// Lexical POSIX path helpers. `joinPosix` is the canonical one from core/path.ts
|
|
26
|
+
// (this module's old copy lacked the empty-base/absolute-rel handling that the
|
|
27
|
+
// canonical adopts — behaviour-identical for every call here, which only ever
|
|
28
|
+
// passes a non-empty base + a relative rel). `resolvePosix` (with `.`/`..`
|
|
29
|
+
// collapse) stays local — it is a stronger, security-load-bearing canonicalizer.
|
|
30
|
+
// ---------------------------------------------------------------------------
|
|
31
|
+
const SEP = '/';
|
|
32
|
+
/**
|
|
33
|
+
* Lexically resolve an absolute POSIX path, collapsing `.` / `..` and
|
|
34
|
+
* duplicate separators WITHOUT touching the filesystem. A relative input is
|
|
35
|
+
* resolved against `base` (default the POSIX root `/`), mirroring how the
|
|
36
|
+
* original relied on `path.resolve` to absolutize a relative mount source. We do
|
|
37
|
+
* not consult cwd (that would be ambient state); the shell passes absolute mount
|
|
38
|
+
* sources, and `base` is supplied explicitly for any relative input.
|
|
39
|
+
*/
|
|
40
|
+
function resolvePosix(input, base = SEP) {
|
|
41
|
+
// Normalize Windows-style separators defensively, then anchor.
|
|
42
|
+
const raw = input.replace(/\\/g, SEP);
|
|
43
|
+
const anchored = raw.startsWith(SEP) ? raw : joinPosix(base, raw);
|
|
44
|
+
const out = [];
|
|
45
|
+
for (const part of anchored.split(SEP)) {
|
|
46
|
+
if (part === '' || part === '.')
|
|
47
|
+
continue;
|
|
48
|
+
if (part === '..') {
|
|
49
|
+
if (out.length > 0)
|
|
50
|
+
out.pop();
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
out.push(part);
|
|
54
|
+
}
|
|
55
|
+
return SEP + out.join(SEP);
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Lexically canonicalize a host path WITHOUT touching the filesystem: expand a
|
|
59
|
+
* leading `~` / `~/…` against `homeDir`, then lexically resolve (collapse
|
|
60
|
+
* `.`/`..`, make absolute). Mirrors the reference's `canonicalizeHostPath` but
|
|
61
|
+
* uses inline POSIX logic instead of `node:path` so it stays importable from the
|
|
62
|
+
* functional core. We deliberately do NOT `fs.realpath` — the path need not
|
|
63
|
+
* exist, and a symlink-following resolve is IO + a TOCTOU surface; the deny check
|
|
64
|
+
* is a prefix test on the lexical canonical form, which is strictly more
|
|
65
|
+
* conservative.
|
|
66
|
+
*/
|
|
67
|
+
export function canonicalizeHostPath(hostPath, homeDir) {
|
|
68
|
+
let p = hostPath;
|
|
69
|
+
if (p === '~') {
|
|
70
|
+
p = homeDir;
|
|
71
|
+
}
|
|
72
|
+
else if (p.startsWith('~/') || p.startsWith('~\\')) {
|
|
73
|
+
p = joinPosix(homeDir, p.slice(2));
|
|
74
|
+
}
|
|
75
|
+
return resolvePosix(p, resolvePosix(homeDir));
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* True when `child` is `parent` or lies beneath it. Compares canonical absolute
|
|
79
|
+
* paths with a trailing-separator guard so `/home/u/.codexible` does not count as
|
|
80
|
+
* under `/home/u/.codex`.
|
|
81
|
+
*/
|
|
82
|
+
function isUnder(child, parent) {
|
|
83
|
+
if (child === parent)
|
|
84
|
+
return true;
|
|
85
|
+
const withSep = parent.endsWith(SEP) ? parent : parent + SEP;
|
|
86
|
+
return child.startsWith(withSep);
|
|
87
|
+
}
|
|
88
|
+
// ---------------------------------------------------------------------------
|
|
89
|
+
// Credential-mount denylist guard.
|
|
90
|
+
// ---------------------------------------------------------------------------
|
|
91
|
+
/**
|
|
92
|
+
* Built-in credential directories/files, `~`-relative. `~/.claude` and `~/.codex`
|
|
93
|
+
* hold the adapter OAuth credentials; `~/.config`, `~/.ssh`, and `~/.symphony/oauth`
|
|
94
|
+
* round out the denylist.
|
|
95
|
+
*/
|
|
96
|
+
const BUILTIN_CRED_RELATIVE = [
|
|
97
|
+
'.claude',
|
|
98
|
+
'.codex',
|
|
99
|
+
'.config',
|
|
100
|
+
'.ssh',
|
|
101
|
+
'.symphony/oauth',
|
|
102
|
+
];
|
|
103
|
+
/** Resolve the full denylist (built-ins + extras) to canonical absolute paths. */
|
|
104
|
+
function resolveDenylist(homeDir, extra) {
|
|
105
|
+
const home = resolvePosix(homeDir);
|
|
106
|
+
const out = new Set();
|
|
107
|
+
for (const rel of BUILTIN_CRED_RELATIVE)
|
|
108
|
+
out.add(joinPosix(home, rel));
|
|
109
|
+
for (const e of extra)
|
|
110
|
+
out.add(canonicalizeHostPath(e, homeDir));
|
|
111
|
+
return [...out];
|
|
112
|
+
}
|
|
113
|
+
/** Throw if `candidate` is the home root or overlaps any denylist entry. */
|
|
114
|
+
function assertCandidateAllowed(candidate, homeRoot, denylist) {
|
|
115
|
+
// The home root is always denied — mounting it exposes every credential dir at
|
|
116
|
+
// once, and a workspace legitimately lives *under* home so the root can't just
|
|
117
|
+
// go in the per-dir denylist.
|
|
118
|
+
if (candidate === homeRoot) {
|
|
119
|
+
throw new CredentialMountError(`refusing to mount the home directory root ${candidate} into a guest VM ` +
|
|
120
|
+
`(exposes every credential directory at once)`);
|
|
121
|
+
}
|
|
122
|
+
for (const denied of denylist) {
|
|
123
|
+
// Bidirectional overlap: reject if the mount is UNDER a credential dir, IS
|
|
124
|
+
// one, OR is an ANCESTOR that contains one (e.g. mounting `~/.symphony`
|
|
125
|
+
// exposes `~/.symphony/oauth`). Read-only sources are NOT exempt.
|
|
126
|
+
if (isUnder(candidate, denied) || isUnder(denied, candidate)) {
|
|
127
|
+
throw new CredentialMountError(`refusing to mount ${candidate} into a guest VM: it overlaps the credential ` +
|
|
128
|
+
`path ${denied} (mounting it, a parent of it, or a child of it all expose ` +
|
|
129
|
+
`the credential tree; read-only sources are NOT exempt)`);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* HARD-FAIL if any mount's host path OVERLAPS a credential directory (the mount
|
|
135
|
+
* is under one, IS one, or is an ancestor that contains one) or is the home-dir
|
|
136
|
+
* root. Lexical-only (see module header). Read-only mounts are NOT exempt. Throws
|
|
137
|
+
* {@link CredentialMountError} on the first offender; returns void on success.
|
|
138
|
+
*/
|
|
139
|
+
export function assertNoCredentialMounts(mounts, opts) {
|
|
140
|
+
const homeRoot = resolvePosix(opts.homeDir);
|
|
141
|
+
const denylist = resolveDenylist(opts.homeDir, opts.extraDenylist ?? []);
|
|
142
|
+
for (const m of mounts) {
|
|
143
|
+
const candidate = canonicalizeHostPath(m.host, opts.homeDir);
|
|
144
|
+
assertCandidateAllowed(candidate, homeRoot, denylist);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
// ---------------------------------------------------------------------------
|
|
148
|
+
// assertContained — path-escape guard for workspace restore (critic gap).
|
|
149
|
+
// ---------------------------------------------------------------------------
|
|
150
|
+
/**
|
|
151
|
+
* HARD-FAIL if `target` escapes `root` after lexical normalization. The
|
|
152
|
+
* workspace-restore path materializes agent-named entries under a workspace root;
|
|
153
|
+
* an entry like `../../.ssh/authorized_keys` (or an absolute path) would write
|
|
154
|
+
* outside the sandbox. This guard rejects any `target` that does not resolve to
|
|
155
|
+
* `root` itself or a path strictly beneath it.
|
|
156
|
+
*
|
|
157
|
+
* `target` is resolved RELATIVE TO `root` (so a bare relative path is anchored at
|
|
158
|
+
* the workspace), but an absolute `target` resolves to itself and is rejected
|
|
159
|
+
* unless it already lies under `root`. Returns the canonical contained path on
|
|
160
|
+
* success; throws {@link CredentialMountError} on escape — reused as the typed
|
|
161
|
+
* sandbox-violation error (the closest existing boundary-violation class; no
|
|
162
|
+
* separate `PathEscapeError` exists in src/types).
|
|
163
|
+
*/
|
|
164
|
+
export function assertContained(root, target) {
|
|
165
|
+
const canonRoot = resolvePosix(root);
|
|
166
|
+
// An absolute target resolves to itself; a relative one anchors at the root.
|
|
167
|
+
const canonTarget = target.startsWith(SEP)
|
|
168
|
+
? resolvePosix(target)
|
|
169
|
+
: resolvePosix(joinPosix(canonRoot, target));
|
|
170
|
+
if (!isUnder(canonTarget, canonRoot)) {
|
|
171
|
+
throw new CredentialMountError(`refusing to write ${canonTarget}: it escapes the workspace root ${canonRoot} ` +
|
|
172
|
+
`(path-traversal guard for workspace restore)`);
|
|
173
|
+
}
|
|
174
|
+
return canonTarget;
|
|
175
|
+
}
|
|
176
|
+
// ---------------------------------------------------------------------------
|
|
177
|
+
// Credential env-var stripping.
|
|
178
|
+
// ---------------------------------------------------------------------------
|
|
179
|
+
/**
|
|
180
|
+
* Exact credential env-var names dropped regardless of the family-suffix rules.
|
|
181
|
+
* Covers each adapter's token var plus the GitHub durable-token vars.
|
|
182
|
+
*/
|
|
183
|
+
const NAMED_CREDENTIAL_VARS = new Set([
|
|
184
|
+
'ANTHROPIC_AUTH_TOKEN',
|
|
185
|
+
'ANTHROPIC_API_KEY',
|
|
186
|
+
'OPENAI_API_KEY',
|
|
187
|
+
'GITHUB_TOKEN',
|
|
188
|
+
'GH_TOKEN',
|
|
189
|
+
]);
|
|
190
|
+
/**
|
|
191
|
+
* Vendor name prefixes whose entire family is credential-bearing under the strict
|
|
192
|
+
* boot-env policy.
|
|
193
|
+
*/
|
|
194
|
+
const CREDENTIAL_NAME_PREFIXES = [
|
|
195
|
+
'ANTHROPIC_',
|
|
196
|
+
'OPENAI_',
|
|
197
|
+
'GITHUB_',
|
|
198
|
+
'GH_',
|
|
199
|
+
];
|
|
200
|
+
/** Secret-bearing name suffixes across any vendor (`*_API_KEY` / `*_TOKEN` / `*_SECRET`). */
|
|
201
|
+
const CREDENTIAL_NAME_SUFFIXES = ['_API_KEY', '_TOKEN', '_SECRET'];
|
|
202
|
+
/**
|
|
203
|
+
* True when a name is a *secret-bearing token* by the named-set or the
|
|
204
|
+
* `*_API_KEY`/`*_TOKEN`/`*_SECRET` suffix rule. Deliberately does NOT include the
|
|
205
|
+
* vendor *prefix* families — this is the strip applied to adapter-injected runtime
|
|
206
|
+
* env, which legitimately carries non-secret config like `ANTHROPIC_MODEL` /
|
|
207
|
+
* `OPENAI_BASE_URL`.
|
|
208
|
+
*/
|
|
209
|
+
export function isCredentialTokenName(name) {
|
|
210
|
+
const upper = name.toUpperCase();
|
|
211
|
+
if (NAMED_CREDENTIAL_VARS.has(upper))
|
|
212
|
+
return true;
|
|
213
|
+
for (const suffix of CREDENTIAL_NAME_SUFFIXES) {
|
|
214
|
+
if (upper.endsWith(suffix))
|
|
215
|
+
return true;
|
|
216
|
+
}
|
|
217
|
+
return false;
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* True when an env var name is credential-bearing under ANY rule: the named set,
|
|
221
|
+
* the vendor prefix families, or the secret suffix families. The strict boot-env policy.
|
|
222
|
+
*/
|
|
223
|
+
export function isCredentialEnvName(name) {
|
|
224
|
+
if (isCredentialTokenName(name))
|
|
225
|
+
return true;
|
|
226
|
+
const upper = name.toUpperCase();
|
|
227
|
+
for (const prefix of CREDENTIAL_NAME_PREFIXES) {
|
|
228
|
+
if (upper.startsWith(prefix))
|
|
229
|
+
return true;
|
|
230
|
+
}
|
|
231
|
+
return false;
|
|
232
|
+
}
|
|
233
|
+
function stripBy(env, drop) {
|
|
234
|
+
const out = {};
|
|
235
|
+
for (const [k, v] of Object.entries(env)) {
|
|
236
|
+
if (drop(k))
|
|
237
|
+
continue;
|
|
238
|
+
out[k] = v;
|
|
239
|
+
}
|
|
240
|
+
return out;
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Return a copy of `env` with every credential-bearing var removed (the strict
|
|
244
|
+
* boot-env policy — named set + vendor prefix families + secret suffixes). Use
|
|
245
|
+
* for the operator-forwarded boot env.
|
|
246
|
+
*/
|
|
247
|
+
export function stripCredentialEnv(env) {
|
|
248
|
+
return stripBy(env, isCredentialEnvName);
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* Return a copy of `env` with only secret-bearing TOKENS removed (named set +
|
|
252
|
+
* secret suffixes), preserving non-secret vendor-prefixed config like
|
|
253
|
+
* `ANTHROPIC_MODEL` / `OPENAI_BASE_URL`. Defense-in-depth for the adapter runtime env.
|
|
254
|
+
*/
|
|
255
|
+
export function stripCredentialTokenVars(env) {
|
|
256
|
+
return stripBy(env, isCredentialTokenName);
|
|
257
|
+
}
|
|
258
|
+
// ---------------------------------------------------------------------------
|
|
259
|
+
// ACP / MCP guest control-plane URL derivation.
|
|
260
|
+
// ---------------------------------------------------------------------------
|
|
261
|
+
//
|
|
262
|
+
// The synthetic guest↔host control-plane vocabulary (the `symphony-mcp:7001`
|
|
263
|
+
// tunnel constants + the ACP-URL / tcp.hosts derivations) lives canonically in
|
|
264
|
+
// core/mcp/url.ts — the dedicated MCP/ACP URL module. It is re-exported here so
|
|
265
|
+
// vm-guards importers keep their `vm-guards.js` specifier WITHOUT a second
|
|
266
|
+
// source of truth: a single home for MCP_GUEST_PORT / MCP_SYNTHETIC_HOST means a
|
|
267
|
+
// port changed in one place can't silently desync the `tcp.hosts` rewire from
|
|
268
|
+
// the URLs it's supposed to back. `guestMcpBaseUrl` is vm-guards-only (no
|
|
269
|
+
// equivalent in url.ts) and stays defined here.
|
|
270
|
+
export { MCP_SYNTHETIC_HOST, MCP_GUEST_PORT, MCP_GUEST_BASE_URL, ACP_WS_PATH, ACP_WS_GUEST_URL, acpWsUrlFromExplicit, guestAcpWsUrl, buildMcpTcpHostEntry, } from './mcp/url.js';
|
|
271
|
+
/**
|
|
272
|
+
* The guest MCP base URL: the synthetic-tunnel base unless an explicit host URL
|
|
273
|
+
* is configured (in which case the guest reaches the orchestrator directly).
|
|
274
|
+
*/
|
|
275
|
+
export function guestMcpBaseUrl(mcp) {
|
|
276
|
+
return mcp.explicit_host_url ?? MCP_GUEST_BASE_URL;
|
|
277
|
+
}
|
|
278
|
+
//# sourceMappingURL=vm-guards.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vm-guards.js","sourceRoot":"","sources":["../../../src/core/vm-guards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