smol-symphony 0.2.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +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/bin/symphony.js +22 -786
- package/dist/bin/symphony.js.map +1 -1
- package/dist/core/actions/context.js +109 -0
- package/dist/core/actions/context.js.map +1 -0
- package/dist/{actions/parsing.js → core/actions/parse.js} +33 -114
- package/dist/core/actions/parse.js.map +1 -0
- package/dist/core/actions/plan.js +197 -0
- package/dist/core/actions/plan.js.map +1 -0
- package/dist/core/actions/predicates.js +111 -0
- package/dist/core/actions/predicates.js.map +1 -0
- package/dist/core/actions/run-fold.js +248 -0
- package/dist/core/actions/run-fold.js.map +1 -0
- package/dist/core/actions/template.js +118 -0
- package/dist/core/actions/template.js.map +1 -0
- package/dist/core/cli/args.js +116 -0
- package/dist/core/cli/args.js.map +1 -0
- package/dist/core/coerce.js +75 -0
- package/dist/core/coerce.js.map +1 -0
- package/dist/core/credential/account-id.js +20 -0
- package/dist/core/credential/account-id.js.map +1 -0
- package/dist/core/credential/adapter-config.js +136 -0
- package/dist/core/credential/adapter-config.js.map +1 -0
- package/dist/core/credential/availability.js +98 -0
- package/dist/core/credential/availability.js.map +1 -0
- package/dist/core/credential/extract.js +228 -0
- package/dist/core/credential/extract.js.map +1 -0
- package/dist/core/credential/fake-creds.js +171 -0
- package/dist/core/credential/fake-creds.js.map +1 -0
- package/dist/core/credential/identity.js +125 -0
- package/dist/core/credential/identity.js.map +1 -0
- package/dist/core/credential/shape.js +230 -0
- package/dist/core/credential/shape.js.map +1 -0
- package/dist/core/credential/strings.js +15 -0
- package/dist/core/credential/strings.js.map +1 -0
- package/dist/core/doctor/checks.js +303 -0
- package/dist/core/doctor/checks.js.map +1 -0
- package/dist/core/git/result.js +107 -0
- package/dist/core/git/result.js.map +1 -0
- package/dist/core/http/decisions.js +225 -0
- package/dist/core/http/decisions.js.map +1 -0
- package/dist/{http.js → core/http/render.js} +472 -738
- package/dist/core/http/render.js.map +1 -0
- package/dist/{http-handlers.js → core/http/routes.js} +52 -87
- package/dist/core/http/routes.js.map +1 -0
- package/dist/core/http/views.js +181 -0
- package/dist/core/http/views.js.map +1 -0
- package/dist/core/image/managed-image.js +95 -0
- package/dist/core/image/managed-image.js.map +1 -0
- package/dist/core/issue/file.js +149 -0
- package/dist/core/issue/file.js.map +1 -0
- package/dist/core/issue/parse.js +210 -0
- package/dist/core/issue/parse.js.map +1 -0
- package/dist/core/mcp/dispatch.js +239 -0
- package/dist/core/mcp/dispatch.js.map +1 -0
- package/dist/core/mcp/post-move.js +92 -0
- package/dist/core/mcp/post-move.js.map +1 -0
- package/dist/core/mcp/protocol.js +293 -0
- package/dist/core/mcp/protocol.js.map +1 -0
- package/dist/core/mcp/url.js +162 -0
- package/dist/core/mcp/url.js.map +1 -0
- package/dist/core/path.js +63 -0
- package/dist/core/path.js.map +1 -0
- package/dist/core/reconcile/image-decide.js +48 -0
- package/dist/core/reconcile/image-decide.js.map +1 -0
- package/dist/core/reconcile/ledger.js +142 -0
- package/dist/core/reconcile/ledger.js.map +1 -0
- package/dist/core/reconcile/pr-classify.js +62 -0
- package/dist/core/reconcile/pr-classify.js.map +1 -0
- package/dist/{reconciler → core/reconcile}/pr-decide.js +25 -12
- package/dist/core/reconcile/pr-decide.js.map +1 -0
- package/dist/core/reconcile/pr-loop.js +161 -0
- package/dist/core/reconcile/pr-loop.js.map +1 -0
- package/dist/core/reconcile/pr-notes.js +35 -0
- package/dist/core/reconcile/pr-notes.js.map +1 -0
- package/dist/core/reconcile/vm-decide.js +70 -0
- package/dist/core/reconcile/vm-decide.js.map +1 -0
- package/dist/core/reconcile/vm-reap.js +207 -0
- package/dist/core/reconcile/vm-reap.js.map +1 -0
- package/dist/core/reconcile/workspace-decide.js +162 -0
- package/dist/core/reconcile/workspace-decide.js.map +1 -0
- package/dist/core/runlog/summary.js +231 -0
- package/dist/core/runlog/summary.js.map +1 -0
- package/dist/core/runner/dispatch-config.js +95 -0
- package/dist/core/runner/dispatch-config.js.map +1 -0
- package/dist/core/runner/injection.js +61 -0
- package/dist/core/runner/injection.js.map +1 -0
- package/dist/core/runner/mise.js +210 -0
- package/dist/core/runner/mise.js.map +1 -0
- package/dist/core/runner/prompt.js +720 -0
- package/dist/core/runner/prompt.js.map +1 -0
- package/dist/core/runner/turn.js +242 -0
- package/dist/core/runner/turn.js.map +1 -0
- package/dist/core/runner/vm-plan.js +390 -0
- package/dist/core/runner/vm-plan.js.map +1 -0
- package/dist/core/schedule/admission.js +123 -0
- package/dist/core/schedule/admission.js.map +1 -0
- package/dist/core/schedule/circuit-breaker.js +111 -0
- package/dist/core/schedule/circuit-breaker.js.map +1 -0
- package/dist/core/schedule/eligibility.js +83 -0
- package/dist/core/schedule/eligibility.js.map +1 -0
- package/dist/core/schedule/reconcile-issue.js +82 -0
- package/dist/core/schedule/reconcile-issue.js.map +1 -0
- package/dist/core/schedule/retry.js +96 -0
- package/dist/core/schedule/retry.js.map +1 -0
- package/dist/core/schedule/sleep-cycle.js +133 -0
- package/dist/core/schedule/sleep-cycle.js.map +1 -0
- package/dist/core/schedule/slots.js +124 -0
- package/dist/core/schedule/slots.js.map +1 -0
- package/dist/core/schedule/tick.js +553 -0
- package/dist/core/schedule/tick.js.map +1 -0
- package/dist/core/schedule/token-fold.js +181 -0
- package/dist/core/schedule/token-fold.js.map +1 -0
- package/dist/core/state-resolve.js +86 -0
- package/dist/core/state-resolve.js.map +1 -0
- package/dist/core/vm-guards.js +278 -0
- package/dist/core/vm-guards.js.map +1 -0
- package/dist/core/workflow/derive.js +107 -0
- package/dist/core/workflow/derive.js.map +1 -0
- package/dist/core/workflow/parse.js +687 -0
- package/dist/core/workflow/parse.js.map +1 -0
- package/dist/core/workflow/prompt-probe.js +78 -0
- package/dist/core/workflow/prompt-probe.js.map +1 -0
- package/dist/core/workflow/validate.js +189 -0
- package/dist/core/workflow/validate.js.map +1 -0
- package/dist/core/workspace-key.js +19 -0
- package/dist/core/workspace-key.js.map +1 -0
- package/dist/shell/actions-runner.js +356 -0
- package/dist/shell/actions-runner.js.map +1 -0
- package/dist/shell/adapter/adapter-registry.js +45 -0
- package/dist/shell/adapter/adapter-registry.js.map +1 -0
- package/dist/shell/adapter/clock-random.js +96 -0
- package/dist/shell/adapter/clock-random.js.map +1 -0
- package/dist/shell/adapter/gondolin-dispatch-helpers.js +158 -0
- package/dist/shell/adapter/gondolin-dispatch-helpers.js.map +1 -0
- package/dist/shell/adapter/gondolin-dispatch.js +385 -0
- package/dist/shell/adapter/gondolin-dispatch.js.map +1 -0
- package/dist/shell/adapter/gondolin-image-converter.js +233 -0
- package/dist/shell/adapter/gondolin-image-converter.js.map +1 -0
- package/dist/shell/adapter/gondolin-image-fetch.js +180 -0
- package/dist/shell/adapter/gondolin-image-fetch.js.map +1 -0
- package/dist/shell/adapter/launcher-asset.js +57 -0
- package/dist/shell/adapter/launcher-asset.js.map +1 -0
- package/dist/shell/adapter/mise-config-asset.js +65 -0
- package/dist/shell/adapter/mise-config-asset.js.map +1 -0
- package/dist/shell/adapter/workflow-loader.js +304 -0
- package/dist/shell/adapter/workflow-loader.js.map +1 -0
- package/dist/shell/cli/doctor.js +268 -0
- package/dist/shell/cli/doctor.js.map +1 -0
- package/dist/shell/effect-interpreter-families.js +314 -0
- package/dist/shell/effect-interpreter-families.js.map +1 -0
- package/dist/shell/effect-interpreter.js +29 -0
- package/dist/shell/effect-interpreter.js.map +1 -0
- package/dist/shell/interp/acp-frame.js +137 -0
- package/dist/shell/interp/acp-frame.js.map +1 -0
- package/dist/shell/interp/acp-ws-conn.js +320 -0
- package/dist/shell/interp/acp-ws-conn.js.map +1 -0
- package/dist/shell/interp/acp-ws-frames.js +159 -0
- package/dist/shell/interp/acp-ws-frames.js.map +1 -0
- package/dist/shell/interp/acp-ws.js +197 -0
- package/dist/shell/interp/acp-ws.js.map +1 -0
- package/dist/shell/interp/acp.js +319 -0
- package/dist/shell/interp/acp.js.map +1 -0
- package/dist/shell/interp/credential-defaults.js +128 -0
- package/dist/shell/interp/credential-defaults.js.map +1 -0
- package/dist/shell/interp/credential-hooks.js +149 -0
- package/dist/shell/interp/credential-hooks.js.map +1 -0
- package/dist/shell/interp/credential-registry.js +226 -0
- package/dist/shell/interp/credential-registry.js.map +1 -0
- package/dist/shell/interp/credential.js +103 -0
- package/dist/shell/interp/credential.js.map +1 -0
- package/dist/shell/interp/gh.js +163 -0
- package/dist/shell/interp/gh.js.map +1 -0
- package/dist/shell/interp/git.js +28 -0
- package/dist/shell/interp/git.js.map +1 -0
- package/dist/shell/interp/log.js +213 -0
- package/dist/shell/interp/log.js.map +1 -0
- package/dist/shell/interp/process.js +178 -0
- package/dist/shell/interp/process.js.map +1 -0
- package/dist/shell/interp/runlog.js +193 -0
- package/dist/shell/interp/runlog.js.map +1 -0
- package/dist/shell/interp/timer.js +64 -0
- package/dist/shell/interp/timer.js.map +1 -0
- package/dist/shell/interp/tracker-disk.js +99 -0
- package/dist/shell/interp/tracker-disk.js.map +1 -0
- package/dist/shell/interp/tracker-parse.js +71 -0
- package/dist/shell/interp/tracker-parse.js.map +1 -0
- package/dist/shell/interp/tracker-scan.js +238 -0
- package/dist/shell/interp/tracker-scan.js.map +1 -0
- package/dist/shell/interp/tracker-write.js +91 -0
- package/dist/shell/interp/tracker-write.js.map +1 -0
- package/dist/shell/interp/tracker.js +41 -0
- package/dist/shell/interp/tracker.js.map +1 -0
- package/dist/shell/interp/tty.js +48 -0
- package/dist/shell/interp/tty.js.map +1 -0
- package/dist/shell/interp/vm.js +199 -0
- package/dist/shell/interp/vm.js.map +1 -0
- package/dist/shell/interp/workspace.js +310 -0
- package/dist/shell/interp/workspace.js.map +1 -0
- package/dist/shell/main-acp.js +78 -0
- package/dist/shell/main-acp.js.map +1 -0
- package/dist/shell/main-adapters.js +222 -0
- package/dist/shell/main-adapters.js.map +1 -0
- package/dist/shell/main-credential.js +122 -0
- package/dist/shell/main-credential.js.map +1 -0
- package/dist/shell/main-doctor.js +22 -0
- package/dist/shell/main-doctor.js.map +1 -0
- package/dist/shell/main-entry.js +46 -0
- package/dist/shell/main-entry.js.map +1 -0
- package/dist/shell/main-http-csrf.js +45 -0
- package/dist/shell/main-http-csrf.js.map +1 -0
- package/dist/shell/main-http-handler.js +389 -0
- package/dist/shell/main-http-handler.js.map +1 -0
- package/dist/shell/main-http-mcp.js +122 -0
- package/dist/shell/main-http-mcp.js.map +1 -0
- package/dist/shell/main-http-views.js +253 -0
- package/dist/shell/main-http-views.js.map +1 -0
- package/dist/shell/main-http.js +76 -0
- package/dist/shell/main-http.js.map +1 -0
- package/dist/shell/main-loops.js +130 -0
- package/dist/shell/main-loops.js.map +1 -0
- package/dist/shell/main-mcp.js +129 -0
- package/dist/shell/main-mcp.js.map +1 -0
- package/dist/shell/main-orchestrator.js +120 -0
- package/dist/shell/main-orchestrator.js.map +1 -0
- package/dist/shell/main-preflight.js +43 -0
- package/dist/shell/main-preflight.js.map +1 -0
- package/dist/shell/main-reconcilers-helpers.js +244 -0
- package/dist/shell/main-reconcilers-helpers.js.map +1 -0
- package/dist/shell/main-reconcilers-pr.js +148 -0
- package/dist/shell/main-reconcilers-pr.js.map +1 -0
- package/dist/shell/main-reconcilers.js +225 -0
- package/dist/shell/main-reconcilers.js.map +1 -0
- package/dist/shell/main-runner.js +355 -0
- package/dist/shell/main-runner.js.map +1 -0
- package/dist/shell/main-scaffold.js +116 -0
- package/dist/shell/main-scaffold.js.map +1 -0
- package/dist/shell/main-shutdown.js +115 -0
- package/dist/shell/main-shutdown.js.map +1 -0
- package/dist/shell/main-startup.js +48 -0
- package/dist/shell/main-startup.js.map +1 -0
- package/dist/shell/main-substrates.js +43 -0
- package/dist/shell/main-substrates.js.map +1 -0
- package/dist/shell/main.js +385 -0
- package/dist/shell/main.js.map +1 -0
- package/dist/shell/orchestrator-feedback.js +69 -0
- package/dist/shell/orchestrator-feedback.js.map +1 -0
- package/dist/shell/orchestrator-image.js +167 -0
- package/dist/shell/orchestrator-image.js.map +1 -0
- package/dist/shell/orchestrator-loop.js +468 -0
- package/dist/shell/orchestrator-loop.js.map +1 -0
- package/dist/shell/orchestrator-reconcile.js +36 -0
- package/dist/shell/orchestrator-reconcile.js.map +1 -0
- package/dist/shell/reconciler-loop.js +228 -0
- package/dist/shell/reconciler-loop.js.map +1 -0
- package/dist/shell/runner-loop-turn.js +301 -0
- package/dist/shell/runner-loop-turn.js.map +1 -0
- package/dist/shell/runner-loop.js +338 -0
- package/dist/shell/runner-loop.js.map +1 -0
- package/dist/shell/server/http.js +208 -0
- package/dist/shell/server/http.js.map +1 -0
- package/dist/shell/server/mcp-runtime-effects.js +237 -0
- package/dist/shell/server/mcp-runtime-effects.js.map +1 -0
- package/dist/shell/server/mcp-runtime.js +99 -0
- package/dist/shell/server/mcp-runtime.js.map +1 -0
- package/dist/shell/workspace-key.js +14 -0
- package/dist/shell/workspace-key.js.map +1 -0
- package/dist/types/acp.js +8 -0
- package/dist/types/acp.js.map +1 -0
- package/dist/types/actions/plan.js +6 -0
- package/dist/types/actions/plan.js.map +1 -0
- package/dist/types/actions/predicates.js +6 -0
- package/dist/types/actions/predicates.js.map +1 -0
- package/dist/types/actions/run-fold.js +8 -0
- package/dist/types/actions/run-fold.js.map +1 -0
- package/dist/types/actions.js +7 -0
- package/dist/types/actions.js.map +1 -0
- package/dist/types/adapter/clock-random.js +4 -0
- package/dist/types/adapter/clock-random.js.map +1 -0
- package/dist/types/adapter/gondolin-image-converter.js +5 -0
- package/dist/types/adapter/gondolin-image-converter.js.map +1 -0
- package/dist/types/adapter/gondolin-image-fetch.js +5 -0
- package/dist/types/adapter/gondolin-image-fetch.js.map +1 -0
- package/dist/types/adapter/workflow-loader.js +4 -0
- package/dist/types/adapter/workflow-loader.js.map +1 -0
- package/dist/types/cli/args.js +8 -0
- package/dist/types/cli/args.js.map +1 -0
- package/dist/types/config.js +8 -0
- package/dist/types/config.js.map +1 -0
- package/dist/types/credential-interp.js +6 -0
- package/dist/types/credential-interp.js.map +1 -0
- package/dist/types/credentials.js +10 -0
- package/dist/types/credentials.js.map +1 -0
- package/dist/types/doctor.js +7 -0
- package/dist/types/doctor.js.map +1 -0
- package/dist/types/domain.js +7 -0
- package/dist/types/domain.js.map +1 -0
- package/dist/types/effect.js +15 -0
- package/dist/types/effect.js.map +1 -0
- package/dist/types/errors.js +39 -0
- package/dist/types/errors.js.map +1 -0
- package/dist/types/http/decisions.js +6 -0
- package/dist/types/http/decisions.js.map +1 -0
- package/dist/types/http/render.js +10 -0
- package/dist/types/http/render.js.map +1 -0
- package/dist/types/http/views.js +6 -0
- package/dist/types/http/views.js.map +1 -0
- package/dist/types/http.js +9 -0
- package/dist/types/http.js.map +1 -0
- package/dist/types/image/managed-image.js +7 -0
- package/dist/types/image/managed-image.js.map +1 -0
- package/dist/types/interp/effect-interpreter.js +8 -0
- package/dist/types/interp/effect-interpreter.js.map +1 -0
- package/dist/types/interp/tracker.js +7 -0
- package/dist/types/interp/tracker.js.map +1 -0
- package/dist/types/issue/file.js +6 -0
- package/dist/types/issue/file.js.map +1 -0
- package/dist/types/issue/parse.js +8 -0
- package/dist/types/issue/parse.js.map +1 -0
- package/dist/types/main-acp.js +13 -0
- package/dist/types/main-acp.js.map +1 -0
- package/dist/types/main-adapters.js +5 -0
- package/dist/types/main-adapters.js.map +1 -0
- package/dist/types/main-credential.js +21 -0
- package/dist/types/main-credential.js.map +1 -0
- package/dist/types/main-doctor.js +6 -0
- package/dist/types/main-doctor.js.map +1 -0
- package/dist/types/main-http-handler.js +12 -0
- package/dist/types/main-http-handler.js.map +1 -0
- package/dist/types/main-http.js +5 -0
- package/dist/types/main-http.js.map +1 -0
- package/dist/types/main-loops.js +5 -0
- package/dist/types/main-loops.js.map +1 -0
- package/dist/types/main-mcp.js +12 -0
- package/dist/types/main-mcp.js.map +1 -0
- package/dist/types/main-orchestrator.js +5 -0
- package/dist/types/main-orchestrator.js.map +1 -0
- package/dist/types/main-reconcilers.js +11 -0
- package/dist/types/main-reconcilers.js.map +1 -0
- package/dist/types/main-runner.js +13 -0
- package/dist/types/main-runner.js.map +1 -0
- package/dist/types/main-startup.js +5 -0
- package/dist/types/main-startup.js.map +1 -0
- package/dist/types/main-substrates.js +5 -0
- package/dist/types/main-substrates.js.map +1 -0
- package/dist/types/mcp/dispatch.js +4 -0
- package/dist/types/mcp/dispatch.js.map +1 -0
- package/dist/types/mcp/post-move.js +7 -0
- package/dist/types/mcp/post-move.js.map +1 -0
- package/dist/types/mcp.js +9 -0
- package/dist/types/mcp.js.map +1 -0
- package/dist/types/ports.js +12 -0
- package/dist/types/ports.js.map +1 -0
- package/dist/types/reconcile/image-decide.js +5 -0
- package/dist/types/reconcile/image-decide.js.map +1 -0
- package/dist/types/reconcile/ledger.js +7 -0
- package/dist/types/reconcile/ledger.js.map +1 -0
- package/dist/types/reconcile/pr-loop.js +8 -0
- package/dist/types/reconcile/pr-loop.js.map +1 -0
- package/dist/types/reconcile/vm-reap.js +8 -0
- package/dist/types/reconcile/vm-reap.js.map +1 -0
- package/dist/types/reconcile/workspace-decide.js +7 -0
- package/dist/types/reconcile/workspace-decide.js.map +1 -0
- package/dist/types/reconcile.js +9 -0
- package/dist/types/reconcile.js.map +1 -0
- package/dist/types/runlog.js +7 -0
- package/dist/types/runlog.js.map +1 -0
- package/dist/types/runner/actions-runner.js +12 -0
- package/dist/types/runner/actions-runner.js.map +1 -0
- package/dist/types/runner/gondolin-dispatch.js +5 -0
- package/dist/types/runner/gondolin-dispatch.js.map +1 -0
- package/dist/types/runner/injection.js +6 -0
- package/dist/types/runner/injection.js.map +1 -0
- package/dist/types/runner/runner-loop.js +5 -0
- package/dist/types/runner/runner-loop.js.map +1 -0
- package/dist/types/runner/turn.js +4 -0
- package/dist/types/runner/turn.js.map +1 -0
- package/dist/types/runner/vm-plan.js +4 -0
- package/dist/types/runner/vm-plan.js.map +1 -0
- package/dist/types/runtime.js +9 -0
- package/dist/types/runtime.js.map +1 -0
- package/dist/types/schedule/admission.js +7 -0
- package/dist/types/schedule/admission.js.map +1 -0
- package/dist/types/schedule/circuit-breaker.js +2 -0
- package/dist/types/schedule/circuit-breaker.js.map +1 -0
- package/dist/types/schedule/eligibility.js +9 -0
- package/dist/types/schedule/eligibility.js.map +1 -0
- package/dist/types/schedule/orchestrator-loop.js +10 -0
- package/dist/types/schedule/orchestrator-loop.js.map +1 -0
- package/dist/types/schedule/sleep-cycle.js +4 -0
- package/dist/types/schedule/sleep-cycle.js.map +1 -0
- package/dist/types/schedule/slots.js +8 -0
- package/dist/types/schedule/slots.js.map +1 -0
- package/dist/types/schedule/tick.js +9 -0
- package/dist/types/schedule/tick.js.map +1 -0
- package/dist/types/server/mcp-runtime.js +8 -0
- package/dist/types/server/mcp-runtime.js.map +1 -0
- package/dist/types/workflow/parse.js +4 -0
- package/dist/types/workflow/parse.js.map +1 -0
- package/package.json +22 -10
- 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/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,225 @@
|
|
|
1
|
+
// FCIS rewrite — reconciler-pass construction for the composition root (shell).
|
|
2
|
+
//
|
|
3
|
+
// Sliced out of src/shell/main.ts (mirroring main-adapters.ts) so the root keeps
|
|
4
|
+
// only the core-wiring under the max-lines budget. This module builds the three
|
|
5
|
+
// ReconcilerLoop passes (VM reaper / workspace janitor / PR autopilot) + the two
|
|
6
|
+
// effect appliers (applyKillStep / applyPrEffect) the central interpreter routes
|
|
7
|
+
// the `reaper` / `pr` families through. It imports NO core (only the root may) —
|
|
8
|
+
// every pure decider arrives already injected via `ReconcilerCoreDeps`.
|
|
9
|
+
//
|
|
10
|
+
// Each pass is the imperative shell of one resource: OBSERVE live state through
|
|
11
|
+
// the injected IO ports, DECIDE via the pure core decider, APPLY the returned
|
|
12
|
+
// effects/actions back through the ports, and project a ResourceSnapshot for the
|
|
13
|
+
// dashboard via the shared (pure) ledger reducer. The loop driver
|
|
14
|
+
// (reconciler-loop.ts) owns coalescing + ordering + the backstop timer only.
|
|
15
|
+
// The OBSERVE / apply-step / ledger primitives live in
|
|
16
|
+
// ./main-reconcilers-helpers; the PR sticky-cache applier in ./main-reconcilers-pr.
|
|
17
|
+
//
|
|
18
|
+
// Shell rule: imports from src/types/** ONLY. Concrete ports are injected.
|
|
19
|
+
import { buildPrApplier, EMPTY_PR_CACHE } from './main-reconcilers-pr.js';
|
|
20
|
+
import { applyKillLedger, buildApplyKillStep, collectPrIntents, firstActiveState, observeDesiredWorkspaces, observeHandoffMarkers, observeInspections, recordPrLedger, resolveBaseRefSha, sanitizeWorkspaceKey, } from './main-reconcilers-helpers.js';
|
|
21
|
+
/**
|
|
22
|
+
* Build the VM-reaper / workspace-janitor / PR-autopilot passes + the two
|
|
23
|
+
* appliers. Each pass observes → calls a pure core decider → applies through the
|
|
24
|
+
* ports → projects a ResourceSnapshot. Returns the appliers separately so the
|
|
25
|
+
* root can also inject them into the central EffectAdapters bundle (the
|
|
26
|
+
* interpreter's `reaper` / `pr` families).
|
|
27
|
+
*/
|
|
28
|
+
export function buildReconcilerPasses(deps) {
|
|
29
|
+
const applyKillStep = buildApplyKillStep(deps);
|
|
30
|
+
const pr = buildPrApplier(deps);
|
|
31
|
+
const ledgers = {
|
|
32
|
+
vm: deps.core.createLedger('vm', 32),
|
|
33
|
+
workspace: deps.core.createLedger('workspace', 32),
|
|
34
|
+
pr: deps.core.createLedger('pr', 64),
|
|
35
|
+
};
|
|
36
|
+
return {
|
|
37
|
+
passes: {
|
|
38
|
+
vm: () => vmPass(deps, applyKillStep, ledgers),
|
|
39
|
+
workspace: () => workspacePass(deps, ledgers),
|
|
40
|
+
pr: () => prPass(deps, pr, ledgers),
|
|
41
|
+
},
|
|
42
|
+
applyKillStep,
|
|
43
|
+
applyPrEffect: pr.applyFamily,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
// ─── VM reaper pass ─────────────────────────────────────────────────────────
|
|
47
|
+
async function vmPass(deps, applyKillStep, ledgers) {
|
|
48
|
+
const { core, log } = deps;
|
|
49
|
+
// gc STALE/dead-pid sessions first, then enumerate the LIVE set.
|
|
50
|
+
const observed = await observeVmSessions(deps);
|
|
51
|
+
let lastError = observed.error;
|
|
52
|
+
if (observed.sessions === null)
|
|
53
|
+
return core.ledgerResourceSnapshot(ledgers.vm, { ready: true, last_error: lastError });
|
|
54
|
+
const intendedLabels = new Set(deps.intended.inFlight().map((e) => e.sessionLabel));
|
|
55
|
+
const selfPid = deps.signal.selfPid();
|
|
56
|
+
const actions = core.decideVm({ sessions: observed.sessions, intendedLabels, selfPid });
|
|
57
|
+
if (actions.length > 0)
|
|
58
|
+
log.emit('info', 'vm reaper: killing orphan sessions', { orphans: actions.length });
|
|
59
|
+
for (const action of actions) {
|
|
60
|
+
const err = await driveKill(deps, applyKillStep, ledgers, action, selfPid);
|
|
61
|
+
if (err)
|
|
62
|
+
lastError = err;
|
|
63
|
+
}
|
|
64
|
+
return core.ledgerResourceSnapshot(ledgers.vm, { ready: true, last_error: lastError });
|
|
65
|
+
}
|
|
66
|
+
/** gc + live-session enumeration; `sessions === null` ⇒ enumeration failed (bail). */
|
|
67
|
+
async function observeVmSessions(deps) {
|
|
68
|
+
let error = null;
|
|
69
|
+
try {
|
|
70
|
+
const reaped = await deps.vm.gc();
|
|
71
|
+
if (reaped > 0)
|
|
72
|
+
deps.log.emit('info', 'vm reaper: gondolin gc collected stale sessions', { reaped });
|
|
73
|
+
}
|
|
74
|
+
catch (err) {
|
|
75
|
+
error = `gondolin gc failed: ${err.message}`;
|
|
76
|
+
deps.log.emit('warn', 'vm reaper: gondolin gc failed', { error: err.message });
|
|
77
|
+
}
|
|
78
|
+
try {
|
|
79
|
+
const sessions = (await deps.vm.listSessions()).filter((s) => s.alive).map((s) => ({ pid: s.pid, label: s.label }));
|
|
80
|
+
return { sessions, error };
|
|
81
|
+
}
|
|
82
|
+
catch (err) {
|
|
83
|
+
deps.log.emit('warn', 'vm reaper: session enumeration failed', { error: err.message });
|
|
84
|
+
return { sessions: null, error: `session enumeration failed: ${err.message}` };
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Drive one session's SIGTERM→grace→probe→SIGKILL escalation: the pure
|
|
89
|
+
* beginKill/foldKillStep emit the next KillStep, applyKillStep performs its IO
|
|
90
|
+
* and returns the result the fold consumes. Bounded by the pure terminal-`done`
|
|
91
|
+
* state. Returns the terminal error message (if any) for the snapshot.
|
|
92
|
+
*/
|
|
93
|
+
async function driveKill(deps, applyKillStep, ledgers, action, selfPid) {
|
|
94
|
+
let lastError = null;
|
|
95
|
+
let decision = deps.core.beginKill(action, selfPid);
|
|
96
|
+
ledgers.vm = applyKillLedger(ledgers.vm, decision, deps.core, deps.clock);
|
|
97
|
+
let guard = 0;
|
|
98
|
+
while (decision.next.kind !== 'done' && guard < 16) {
|
|
99
|
+
guard += 1;
|
|
100
|
+
const result = await applyKillStep(decision.next);
|
|
101
|
+
decision = deps.core.foldKillStep(decision.next, result);
|
|
102
|
+
ledgers.vm = applyKillLedger(ledgers.vm, decision, deps.core, deps.clock);
|
|
103
|
+
if (decision.ledger.op === 'error')
|
|
104
|
+
lastError = decision.ledger.message;
|
|
105
|
+
}
|
|
106
|
+
return lastError;
|
|
107
|
+
}
|
|
108
|
+
// ─── workspace janitor pass ─────────────────────────────────────────────────
|
|
109
|
+
async function workspacePass(deps, ledgers) {
|
|
110
|
+
const { core, log } = deps;
|
|
111
|
+
const cfg = deps.getCfg();
|
|
112
|
+
const routing = deps.derivePrRouting(cfg);
|
|
113
|
+
const obs = await observeWorkspaceState(deps, cfg);
|
|
114
|
+
if (obs.error !== null) {
|
|
115
|
+
log.emit('warn', 'workspace reconcile: observe failed', { error: obs.error });
|
|
116
|
+
return core.ledgerResourceSnapshot(ledgers.workspace, { ready: true, last_error: obs.error });
|
|
117
|
+
}
|
|
118
|
+
const decision = core.decideWorkspace({ ...obs.observation, prMergeState: routing.mergeState });
|
|
119
|
+
for (const l of decision.logs)
|
|
120
|
+
log.emit(l.level, l.message, l.fields);
|
|
121
|
+
let lastError = null;
|
|
122
|
+
for (const action of decision.actions)
|
|
123
|
+
lastError = (await applyWorkspaceAction(deps, ledgers, action, cfg)) ?? lastError;
|
|
124
|
+
for (const mark of decision.marks) {
|
|
125
|
+
ledgers.workspace = core.ledgerRecord(ledgers.workspace, `mark_${mark.status}:${mark.identifier}`, 'done', deps.clock.iso(), mark.reason);
|
|
126
|
+
}
|
|
127
|
+
if (decision.lastError)
|
|
128
|
+
lastError = decision.lastError;
|
|
129
|
+
return core.ledgerResourceSnapshot(ledgers.workspace, { ready: true, last_error: lastError });
|
|
130
|
+
}
|
|
131
|
+
/** Observe the workspace inputs; `error` set ⇒ fail closed (leave dirs untouched). */
|
|
132
|
+
async function observeWorkspaceState(deps, cfg) {
|
|
133
|
+
const empty = { desired: [], observed: [], baseRefSha: null, inspections: {}, handoffPending: new Set() };
|
|
134
|
+
let desired;
|
|
135
|
+
try {
|
|
136
|
+
desired = await observeDesiredWorkspaces(deps, cfg);
|
|
137
|
+
}
|
|
138
|
+
catch (err) {
|
|
139
|
+
return { error: `active_fetch_failed: ${err.message}`, observation: empty };
|
|
140
|
+
}
|
|
141
|
+
let observed;
|
|
142
|
+
try {
|
|
143
|
+
observed = await deps.workspace.list();
|
|
144
|
+
}
|
|
145
|
+
catch (err) {
|
|
146
|
+
return { error: `workspace_root_read_failed: ${err.message}`, observation: empty };
|
|
147
|
+
}
|
|
148
|
+
const baseRefSha = await resolveBaseRefSha(deps, cfg);
|
|
149
|
+
const inspections = baseRefSha === null ? {} : await observeInspections(deps, cfg, desired, observed);
|
|
150
|
+
const handoffPending = await observeHandoffMarkers(deps, desired, observed);
|
|
151
|
+
return { error: null, observation: { desired, observed, baseRefSha, inspections, handoffPending } };
|
|
152
|
+
}
|
|
153
|
+
/** Apply one create/remove workspace action through the port; ledger + return any error. */
|
|
154
|
+
async function applyWorkspaceAction(deps, ledgers, action, cfg) {
|
|
155
|
+
const { core, clock } = deps;
|
|
156
|
+
const isRemove = action.kind === 'remove_workspace';
|
|
157
|
+
const key = isRemove ? `remove_workspace:${action.identifier}` : `create_workspace:${sanitizeWorkspaceKey(action.identifier)}`;
|
|
158
|
+
ledgers.workspace = core.ledgerStart(ledgers.workspace, key, clock.iso());
|
|
159
|
+
try {
|
|
160
|
+
if (isRemove)
|
|
161
|
+
await deps.workspace.remove(action.identifier, 'stale_issue');
|
|
162
|
+
else
|
|
163
|
+
await deps.workspace.ensureFor(action.identifier, { baseBranch: cfg.workspace.base_branch, githubRepo: cfg.workspace.github_repo });
|
|
164
|
+
ledgers.workspace = core.ledgerDone(ledgers.workspace, key, clock.iso());
|
|
165
|
+
return null;
|
|
166
|
+
}
|
|
167
|
+
catch (err) {
|
|
168
|
+
const msg = err.message;
|
|
169
|
+
ledgers.workspace = core.ledgerError(ledgers.workspace, key, msg, clock.iso());
|
|
170
|
+
return msg;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
// ─── PR autopilot pass ──────────────────────────────────────────────────────
|
|
174
|
+
async function prPass(deps, pr, ledgers) {
|
|
175
|
+
const cfg = deps.getCfg();
|
|
176
|
+
if (!cfg.pr.enabled)
|
|
177
|
+
return null;
|
|
178
|
+
const routing = deps.derivePrRouting(cfg);
|
|
179
|
+
if (routing.mergeState === null && routing.closeState === null)
|
|
180
|
+
return null;
|
|
181
|
+
const intents = await collectPrIntents(deps, cfg, routing);
|
|
182
|
+
pr.dropExcept(new Set(intents.map((i) => i.identifier)));
|
|
183
|
+
let lastError = null;
|
|
184
|
+
for (const intent of intents) {
|
|
185
|
+
try {
|
|
186
|
+
await drivePrIntent(deps, pr, ledgers, intent, routing);
|
|
187
|
+
}
|
|
188
|
+
catch (err) {
|
|
189
|
+
lastError = err.message;
|
|
190
|
+
deps.log.emit('warn', 'pr reconcile: per-issue pass threw', { identifier: intent.identifier, error: lastError });
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
return deps.core.ledgerResourceSnapshot(ledgers.pr, { ready: true, last_error: lastError });
|
|
194
|
+
}
|
|
195
|
+
async function drivePrIntent(deps, pr, ledgers, intent, routing) {
|
|
196
|
+
const { core, clock } = deps;
|
|
197
|
+
let obs = freshObservation(deps, intent, routing);
|
|
198
|
+
for (let i = 0; i < core.maxPrDecideIterations; i += 1) {
|
|
199
|
+
const effects = core.decidePr(obs);
|
|
200
|
+
if (effects.length === 0)
|
|
201
|
+
return;
|
|
202
|
+
for (const effect of effects) {
|
|
203
|
+
ledgers.pr = recordPrLedger(ledgers.pr, effect, 'start', clock, core);
|
|
204
|
+
const outcome = await pr.apply(intent, effect);
|
|
205
|
+
ledgers.pr = recordPrLedger(ledgers.pr, effect, 'done', clock, core);
|
|
206
|
+
obs = core.foldPrEffectOutcome(obs, effect, outcome);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
deps.log.emit('warn', 'pr reconcile: decide loop iteration cap reached', { identifier: intent.identifier });
|
|
210
|
+
}
|
|
211
|
+
function freshObservation(deps, intent, routing) {
|
|
212
|
+
return {
|
|
213
|
+
intent,
|
|
214
|
+
cache: EMPTY_PR_CACHE,
|
|
215
|
+
summaryResolved: false,
|
|
216
|
+
summary: null,
|
|
217
|
+
viewResolved: false,
|
|
218
|
+
view: null,
|
|
219
|
+
closeAttempted: false,
|
|
220
|
+
closeOutcome: null,
|
|
221
|
+
halt: false,
|
|
222
|
+
config: { strategy: routing.strategy, conflictRouteTo: routing.conflictRouteTo ?? firstActiveState(deps.getCfg()) },
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
//# sourceMappingURL=main-reconcilers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main-reconcilers.js","sourceRoot":"","sources":["../../src/shell/main-reconcilers.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,EAAE;AACF,iFAAiF;AACjF,gFAAgF;AAChF,iFAAiF;AACjF,iFAAiF;AACjF,iFAAiF;AACjF,wEAAwE;AACxE,EAAE;AACF,gFAAgF;AAChF,8EAA8E;AAC9E,iFAAiF;AACjF,kEAAkE;AAClE,6EAA6E;AAC7E,uDAAuD;AACvD,oFAAoF;AACpF,EAAE;AACF,2EAA2E;AAa3E,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1E,OAAO,EACL,eAAe,EACf,kBAAk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IAAI;QAClB,IAAI,EAAE,KAAK;QACX,MAAM,EAAE,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,eAAe,EAAE,OAAO,CAAC,eAAe,IAAI,gBAAgB,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE;KACpH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
// FCIS rewrite — RUNNER-slice construction for the composition root (kind: shell).
|
|
2
|
+
//
|
|
3
|
+
// THE CAPSTONE WIRING. Replaces the `runWorker: async () => undefined` stub with a
|
|
4
|
+
// real per-dispatch worker: it builds the per-attempt `RunnerLoopDeps` (the
|
|
5
|
+
// workspace→VM→ACP→turn-loop→actions pipeline `runAttempt` drives), the terminal-
|
|
6
|
+
// actions runner, the SINGLE dispatcher-backed VM bring-up (the real
|
|
7
|
+
// `GondolinDispatcher`: stages the guest files INCL. the vm-agent.mjs launcher,
|
|
8
|
+
// builds the `{ tcp: { hosts }, dns }` tunnel, runs the BYO probe + the §2a security
|
|
9
|
+
// mount guard, registers the per-VM egress secret, and launches the agent), and the
|
|
10
|
+
// DispatchRunner (`runWorker`) the orchestrator loop spawns per dispatch.
|
|
11
|
+
//
|
|
12
|
+
// PER-DISPATCH BRACKETING (the contract the task pins):
|
|
13
|
+
// • MCP lifecycle: an `mcp` activate effect at bring-up (mints the per-dispatch
|
|
14
|
+
// bearer the guest's tools/call authenticates with; the token rides back on the
|
|
15
|
+
// EffectResult) and an `mcp` deactivate effect at teardown (entry removed + parked
|
|
16
|
+
// steering cancelled). Both cross the CENTRAL interpreter, NOT a direct poke on the
|
|
17
|
+
// runtime read surface (the app-db one-mutation-seam rule).
|
|
18
|
+
// • ACP dispatch context: registered (vmId → issue/workspace + the MCP server set)
|
|
19
|
+
// when the VM comes up so `sessionNew(vmId)` resolves; deregistered at teardown.
|
|
20
|
+
// • the SECURITY mount guard fires IMMEDIATELY before createVm (host-only-refresh),
|
|
21
|
+
// over BOTH the lexical AND the realpath-resolved mount set (symlink bypass).
|
|
22
|
+
// • ONE AdapterCredentialSpec per dispatch threaded through guest staging + the
|
|
23
|
+
// egress hooks (placeholder parity), keyed on the LIVE token (codex route active).
|
|
24
|
+
//
|
|
25
|
+
// Core-free: imports src/types + sibling shell ONLY — every pure decider arrives
|
|
26
|
+
// injected via `input.core` (only the composition root imports core).
|
|
27
|
+
import os from 'node:os';
|
|
28
|
+
import { realpath } from 'node:fs/promises';
|
|
29
|
+
import { runAttempt } from './runner-loop.js';
|
|
30
|
+
import { createActionsRunner } from './actions-runner.js';
|
|
31
|
+
import { GondolinDispatcher } from './adapter/gondolin-dispatch.js';
|
|
32
|
+
/**
|
|
33
|
+
* Build the runner slice: returns the `runWorker` DispatchRunner the orchestrator
|
|
34
|
+
* loop calls per dispatch plan. Everything per-dispatch (adapter resolution, the
|
|
35
|
+
* single dispatcher-backed VM bring-up, the MCP/ACP bracketing) is captured in a
|
|
36
|
+
* closure so the loop just hands it `(plan, entry, cancel)`.
|
|
37
|
+
*/
|
|
38
|
+
export function buildRunnerSlice(input) {
|
|
39
|
+
const actions = createActionsRunner({
|
|
40
|
+
core: input.core.actions,
|
|
41
|
+
interpreter: input.ports.interpreter,
|
|
42
|
+
clock: input.ports.clock,
|
|
43
|
+
log: input.ports.log,
|
|
44
|
+
runlog: input.ports.runlog,
|
|
45
|
+
cfg: input.getLiveCfg,
|
|
46
|
+
readEnv: input.readEnv,
|
|
47
|
+
});
|
|
48
|
+
const runWorker = async (plan, entry, cancel) => {
|
|
49
|
+
await runOneDispatch(input, actions, plan, entry, cancel);
|
|
50
|
+
};
|
|
51
|
+
return { runWorker };
|
|
52
|
+
}
|
|
53
|
+
// ─── one dispatch: activate MCP, run the attempt, deactivate, report exit ──────
|
|
54
|
+
async function runOneDispatch(input, actions, plan, entry, cancel) {
|
|
55
|
+
const { core, substrates } = input;
|
|
56
|
+
// Pin the dispatch-time actor on the entry (RunningEntry.resolved_actor) so the
|
|
57
|
+
// dashboard + breaker-trip moves carry `<adapter>/<model>` (§2c resolveActorString).
|
|
58
|
+
const cfg = input.getLiveCfg();
|
|
59
|
+
entry.resolved_actor = core.resolveActorString(cfg.states, cfg.acp.adapter, cfg.acp.model, entry.issue.state);
|
|
60
|
+
// MCP activate at bring-up: mint the per-dispatch bearer the in-VM agent's
|
|
61
|
+
// tools/call authenticates with. The bearer + the synthetic-guest MCP URL form
|
|
62
|
+
// the MCP server descriptor the ACP session advertises.
|
|
63
|
+
const mcpServers = await activateMcp(input, entry);
|
|
64
|
+
// Register the `/acp` WS registration NOW — BEFORE the agent launches — so the
|
|
65
|
+
// dial-back token in the launch env matches a pending registration the guest dials
|
|
66
|
+
// back against. The returned `acpReg.token` is threaded into the VmPlan launch env
|
|
67
|
+
// (buildRunnerDeps → runAttempt → buildVmPlan), and `acpReg.accepted` is carried
|
|
68
|
+
// into the ACP dispatch context so `sessionNew` CONSUMES it (it must NOT register a
|
|
69
|
+
// second, divergent token — that late-registration race was the dial-back rejection).
|
|
70
|
+
const acpReg = substrates.acpRegistry.register(entry.issue_id, entry.identifier);
|
|
71
|
+
// ONE AdapterCredentialSpec per dispatch (codex HIGH): the randomized placeholder
|
|
72
|
+
// is built ONCE and memoized, then threaded through BOTH guest staging (→ buildVmPlan)
|
|
73
|
+
// AND the egress substitution hooks, so the guest placeholder and the substitution
|
|
74
|
+
// placeholder can never diverge. Keyed by adapter (one per dispatch in practice).
|
|
75
|
+
const specFor = buildDispatchSpec(input);
|
|
76
|
+
const credStager = buildCredStager(input, specFor);
|
|
77
|
+
const bringUp = buildBringUp(input, entry, mcpServers, specFor, acpReg);
|
|
78
|
+
let outcome;
|
|
79
|
+
try {
|
|
80
|
+
const deps = buildRunnerDeps(input, credStager, actions, bringUp, cfg, acpReg.token);
|
|
81
|
+
outcome = await runAttemptSafely(input, deps, entry, cancel);
|
|
82
|
+
}
|
|
83
|
+
finally {
|
|
84
|
+
// Teardown bracket: MCP deactivate + ACP context deregister always run, even on
|
|
85
|
+
// a thrown attempt, so a dispatch's control-plane registrations never leak. Cancel
|
|
86
|
+
// the WS registration too so a dispatch that tore down before the guest connected
|
|
87
|
+
// doesn't leave a pending registration (and its unsettled `accepted` promise) behind.
|
|
88
|
+
// The deactivate crosses the seam as an `mcp` effect (removes the active entry +
|
|
89
|
+
// cancels any parked steering inside the runtime) — never a direct poke.
|
|
90
|
+
await input.ports.interpreter.execute({ family: 'mcp', kind: 'deactivate', identifier: entry.identifier });
|
|
91
|
+
deregisterAcpContext(input, entry);
|
|
92
|
+
acpReg.cancel('dispatch_ended');
|
|
93
|
+
}
|
|
94
|
+
reportWorkerExit(input, plan, entry, outcome.ok, outcome.reason, outcome.turnsCompleted);
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Per-dispatch ONE-spec resolver (codex HIGH fix). `buildAdapterSpec` mints a fresh
|
|
98
|
+
* RANDOM placeholder each call, so calling it twice in a dispatch (once for guest
|
|
99
|
+
* staging, once for egress hooks) yields two different placeholders → the egress
|
|
100
|
+
* substitution never matches the guest's bearer. This memoizes the spec per adapter
|
|
101
|
+
* for the dispatch so the SAME `AdapterCredentialSpec` is threaded everywhere.
|
|
102
|
+
*/
|
|
103
|
+
function buildDispatchSpec(input) {
|
|
104
|
+
const cache = new Map();
|
|
105
|
+
return (adapter) => {
|
|
106
|
+
const hit = cache.get(adapter);
|
|
107
|
+
if (hit)
|
|
108
|
+
return hit;
|
|
109
|
+
const spec = input.substrates.credential.buildAdapterSpec(adapter);
|
|
110
|
+
cache.set(adapter, spec);
|
|
111
|
+
return spec;
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
/** Run one attempt, converting a thrown worker into an abnormal-exit outcome. */
|
|
115
|
+
async function runAttemptSafely(input, deps, entry, cancel) {
|
|
116
|
+
try {
|
|
117
|
+
const result = await runAttempt(deps, entry.issue, entry.retry_attempt, cancel, entry);
|
|
118
|
+
if (result.threadId)
|
|
119
|
+
entry.thread_id = result.threadId;
|
|
120
|
+
entry.turn_count = result.turnsCompleted;
|
|
121
|
+
return { ok: result.ok, reason: result.reason, turnsCompleted: result.turnsCompleted };
|
|
122
|
+
}
|
|
123
|
+
catch (err) {
|
|
124
|
+
input.ports.log.withIssue(entry.issue_id).emit('error', 'runner worker threw', { error: err.message });
|
|
125
|
+
return { ok: false, reason: err.message, turnsCompleted: 0 };
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
/** MCP activate → the guest MCP server descriptor (bearer + synthetic-guest URL). */
|
|
129
|
+
async function activateMcp(input, entry) {
|
|
130
|
+
const cfg = input.getLiveCfg();
|
|
131
|
+
if (!cfg.mcp.enabled)
|
|
132
|
+
return [];
|
|
133
|
+
// Cross the seam: the central interpreter performs the `mcp` activate effect
|
|
134
|
+
// (registers the live entry + mints the bearer) and hands the token back on the
|
|
135
|
+
// EffectResult — the runner never pokes the runtime's active-entry map directly.
|
|
136
|
+
const res = await input.ports.interpreter.execute({ family: 'mcp', kind: 'activate', entry });
|
|
137
|
+
const token = 'kind' in res && res.kind === 'mcp_activated' ? res.token : null;
|
|
138
|
+
if (!token) {
|
|
139
|
+
input.ports.log.withIssue(entry.issue_id).emit('warn', 'mcp activate produced no bearer; tools/call disabled', {
|
|
140
|
+
reason: 'error' in res ? res.error : 'unexpected effect result',
|
|
141
|
+
});
|
|
142
|
+
return [];
|
|
143
|
+
}
|
|
144
|
+
entry.mcp_token = token;
|
|
145
|
+
const url = input.core.guestMcpUrl(entry.identifier, { host: cfg.mcp.host, explicit_host_url: cfg.mcp.explicit_host_url }, input.boundMcpPort());
|
|
146
|
+
if (!url) {
|
|
147
|
+
input.ports.log.withIssue(entry.issue_id).emit('warn', 'mcp enabled but no reachable url', {
|
|
148
|
+
host: cfg.mcp.host,
|
|
149
|
+
explicit_host_url: cfg.mcp.explicit_host_url,
|
|
150
|
+
});
|
|
151
|
+
return [];
|
|
152
|
+
}
|
|
153
|
+
return [{ type: 'http', name: 'symphony', url, headers: [{ name: 'Authorization', value: `Bearer ${token}` }] }];
|
|
154
|
+
}
|
|
155
|
+
/** Deregister the ACP dispatch context for every vm id this dispatch registered. */
|
|
156
|
+
function deregisterAcpContext(input, entry) {
|
|
157
|
+
const vmId = vmIdFor.get(entry.issue_id);
|
|
158
|
+
if (vmId) {
|
|
159
|
+
input.substrates.acpContext.deregister(vmId);
|
|
160
|
+
vmIdFor.delete(entry.issue_id);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
/** issueId → live vmId, set by the credential-aware VmClient at createVm. */
|
|
164
|
+
const vmIdFor = new Map();
|
|
165
|
+
/** Fold the attempt outcome into the orchestrator's worker-exit reducer event. */
|
|
166
|
+
function reportWorkerExit(input, plan, entry, ok, reason, turnsCompleted) {
|
|
167
|
+
if (entry.last_transition)
|
|
168
|
+
input.ports.runlog.system(entry.issue_id, 'transition', { ...entry.last_transition });
|
|
169
|
+
input.ports.runlog.system(entry.issue_id, 'attempt_ended', { ok, reason, turns_completed: turnsCompleted });
|
|
170
|
+
// TODO(compose) §2h: emit `write_summary` here so the sibling `*.summary.json` is
|
|
171
|
+
// written (core summarizeRunLog → RunLogStore.writeSummary). DEFERRED, not cheap:
|
|
172
|
+
// summarizeRunLog needs the per-issue accumulated trajectory (the buffered .jsonl
|
|
173
|
+
// entries), which FsRunLogStore owns internally and does NOT yet surface. Wiring
|
|
174
|
+
// it means (a) exposing the accumulator off the runlog store and (b) injecting the
|
|
175
|
+
// core summarizeRunLog into this slice. The .jsonl is written today; only the
|
|
176
|
+
// reflector's sibling summary is absent. Tracked as the §2h gap.
|
|
177
|
+
// The orchestrator loop owns the running map + onWorkerExit; it injects the exit
|
|
178
|
+
// reporter so the runner slice stays decoupled from the loop's internals.
|
|
179
|
+
input.onWorkerExit({
|
|
180
|
+
kind: 'worker_exit',
|
|
181
|
+
issueId: entry.issue_id,
|
|
182
|
+
identifier: entry.identifier,
|
|
183
|
+
normal: ok,
|
|
184
|
+
reason,
|
|
185
|
+
priorAttempt: entry.retry_attempt,
|
|
186
|
+
targetState: entry.issue.state,
|
|
187
|
+
progress: { issue_id: entry.issue_id, identifier: entry.identifier, last_transition: entry.last_transition },
|
|
188
|
+
trackerRootAtDispatch: entry.tracker_root_at_dispatch,
|
|
189
|
+
resolvedActor: entry.resolved_actor || null,
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
// ─── the single VM bring-up path (GondolinDispatcher: stage+probe+tunnel+guard) ─
|
|
193
|
+
/**
|
|
194
|
+
* Build the per-dispatch VM bring-up backed by the REAL {@link GondolinDispatcher} —
|
|
195
|
+
* the ONE bring-up path (codex CRITICAL: the old bespoke VmClient skipped guest-file
|
|
196
|
+
* staging, the BYO probe, and the `{ tcp: { hosts }, dns }` tunnel shape). Per call
|
|
197
|
+
* it: builds the per-VM egress hooks keyed on the LIVE token (so the codex
|
|
198
|
+
* chatgpt-backend route is active — codex CRITICAL #2), constructs a dispatcher whose
|
|
199
|
+
* mount guard ALSO resolves symlinks (codex HIGH #3), and dispatches the core-built
|
|
200
|
+
* VmPlan. The ACP dispatch context is registered the moment the VM exists (onVmCreated),
|
|
201
|
+
* and the returned `teardown` releases the VM + the per-VM secret registration.
|
|
202
|
+
*/
|
|
203
|
+
function buildBringUp(input, entry, mcpServers, specFor, acpReg) {
|
|
204
|
+
const { core, ports, substrates } = input;
|
|
205
|
+
const dispatcher = new GondolinDispatcher(ports.baseVm, substrates.credential.registry, core.assertNoCredentialMounts, resolveMountRealpath, core.byoProbeFailureMessage, core.byoProbeScript, core.miseInstallFailureMessage, core.hasProjectMiseConfig, ports.log);
|
|
206
|
+
return {
|
|
207
|
+
bringUp: async (req) => {
|
|
208
|
+
// The live credential keys the codex chatgpt-backend route swap (PR#119) — the
|
|
209
|
+
// REAL token lands ONLY in the egress SecretManager + the route hook (host side),
|
|
210
|
+
// NEVER in the guest (the guest holds the placeholder from the SAME spec).
|
|
211
|
+
const token = await resolveLiveToken(ports, req.adapterId);
|
|
212
|
+
const egress = buildEgress(input, req.adapterId, specFor(req.adapterId), token);
|
|
213
|
+
const opts = {
|
|
214
|
+
plan: req.plan,
|
|
215
|
+
launchEnv: req.launchEnv,
|
|
216
|
+
// The probe resolves the ADAPTER CLI name on PATH — NOT the launcher path
|
|
217
|
+
// (plan.agentCommand is `[node, launcher]`). core threads the CLI name into
|
|
218
|
+
// launchEnv.SYMPHONY_ADAPTER_BIN (same value the launcher spawns); fall back
|
|
219
|
+
// to the adapter id only if absent.
|
|
220
|
+
adapterBin: req.launchEnv.SYMPHONY_ADAPTER_BIN ?? req.adapterId,
|
|
221
|
+
workdir: req.workspacePath,
|
|
222
|
+
egress,
|
|
223
|
+
onStderr: req.onStderr,
|
|
224
|
+
onVmCreated: (vmId) => {
|
|
225
|
+
vmIdFor.set(entry.issue_id, vmId);
|
|
226
|
+
// Carry the dial-back stream of the WS registration created BEFORE bring-up so
|
|
227
|
+
// `sessionNew(vmId)` CONSUMES the same `accepted` the guest (presenting the
|
|
228
|
+
// launch-env token) resolves — no second, mismatched registration.
|
|
229
|
+
substrates.acpContext.register(vmId, {
|
|
230
|
+
issueId: entry.issue_id,
|
|
231
|
+
identifier: entry.identifier,
|
|
232
|
+
workspacePath: req.workspacePath || entry.workspace_path,
|
|
233
|
+
mcpServers,
|
|
234
|
+
accepted: acpReg.accepted,
|
|
235
|
+
cancelAccept: acpReg.cancel,
|
|
236
|
+
});
|
|
237
|
+
},
|
|
238
|
+
};
|
|
239
|
+
const handle = await dispatcher.dispatch(opts);
|
|
240
|
+
return { vm: handle.vm, exec: handle.exec, teardown: () => handle.teardown() };
|
|
241
|
+
},
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
/** Resolve the live host credential for this dispatch (null = none / will 401 visibly). */
|
|
245
|
+
async function resolveLiveToken(ports, adapter) {
|
|
246
|
+
try {
|
|
247
|
+
return await ports.credentialPort.probe(adapter);
|
|
248
|
+
}
|
|
249
|
+
catch (err) {
|
|
250
|
+
ports.log.emit('warn', 'credential probe failed; egress route built without live token', {
|
|
251
|
+
adapter, error: err.message,
|
|
252
|
+
});
|
|
253
|
+
return null;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* Build the per-dispatch egress hooks + secret manager from the ONE shared spec.
|
|
258
|
+
* The live `token` keys the codex chatgpt-backend route swap (PR#119); the secret
|
|
259
|
+
* substitution + egress audit are wired inside the substrate. The SAME spec.placeholder
|
|
260
|
+
* is staged into the guest (buildFakeCreds) so the substitution matches at egress.
|
|
261
|
+
*/
|
|
262
|
+
function buildEgress(input, adapterId, spec, token) {
|
|
263
|
+
const { credential } = input.substrates;
|
|
264
|
+
const hooksConfig = credential.buildHooksConfig([spec], input.getLiveCfg().egress.allowed_hosts);
|
|
265
|
+
const result = credential.buildPerVmHooks({
|
|
266
|
+
adapterId,
|
|
267
|
+
secretName: spec.secretName,
|
|
268
|
+
placeholder: spec.placeholder,
|
|
269
|
+
substitutionHosts: spec.substitutionHosts,
|
|
270
|
+
allowedHosts: hooksConfig.allowedHosts,
|
|
271
|
+
token,
|
|
272
|
+
});
|
|
273
|
+
return {
|
|
274
|
+
httpHooks: result.httpHooks,
|
|
275
|
+
secretManager: result.secretManager,
|
|
276
|
+
secretName: spec.secretName,
|
|
277
|
+
adapterId,
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* Symlink-resolving mount canonicalizer (IO) injected into the dispatcher's guard so
|
|
282
|
+
* a symlink whose lexical path is benign but whose target overlaps a credential dir
|
|
283
|
+
* is still rejected (codex HIGH). A non-existent path resolves to itself (it can't be
|
|
284
|
+
* mounted anyway — the lexical check then governs).
|
|
285
|
+
*/
|
|
286
|
+
const resolveMountRealpath = async (hostPath) => {
|
|
287
|
+
try {
|
|
288
|
+
return await realpath(hostPath);
|
|
289
|
+
}
|
|
290
|
+
catch {
|
|
291
|
+
return hostPath;
|
|
292
|
+
}
|
|
293
|
+
};
|
|
294
|
+
// ─── per-adapter fake-cred staging (CredStager) ────────────────────────────────
|
|
295
|
+
/**
|
|
296
|
+
* Build the CredStager from the per-dispatch shared spec resolver: the guest is
|
|
297
|
+
* staged the placeholder-only fake creds keyed on the SAME `AdapterCredentialSpec`
|
|
298
|
+
* the egress hooks substitute (codex HIGH #4 — one spec, threaded everywhere).
|
|
299
|
+
*/
|
|
300
|
+
function buildCredStager(input, specFor) {
|
|
301
|
+
const { credential } = input.substrates;
|
|
302
|
+
return {
|
|
303
|
+
stageFakeCreds: async (adapter) => {
|
|
304
|
+
const spec = specFor(adapter);
|
|
305
|
+
const [claudeIdentity, codexIdentity] = await Promise.all([
|
|
306
|
+
input.ports.credentialPort.readClaudeIdentity(),
|
|
307
|
+
input.ports.credentialPort.readCodexIdentity(),
|
|
308
|
+
]);
|
|
309
|
+
return credential.buildFakeCreds({ adapter, placeholder: spec.placeholder, secretName: spec.secretName, claudeIdentity, codexIdentity });
|
|
310
|
+
},
|
|
311
|
+
};
|
|
312
|
+
}
|
|
313
|
+
// ─── per-attempt RunnerLoopDeps assembly ───────────────────────────────────────
|
|
314
|
+
function buildRunnerDeps(input, credStager, actions, bringUp, cfg, acpToken) {
|
|
315
|
+
const { core, ports, substrates } = input;
|
|
316
|
+
return {
|
|
317
|
+
cfg,
|
|
318
|
+
workflow: input.getWorkflow(),
|
|
319
|
+
core: core.loop,
|
|
320
|
+
workspaces: ports.workspaces,
|
|
321
|
+
tracker: ports.tracker,
|
|
322
|
+
bringUp,
|
|
323
|
+
acp: ports.acp,
|
|
324
|
+
adapters: ports.adapters,
|
|
325
|
+
actions,
|
|
326
|
+
credStager,
|
|
327
|
+
steering: substrates.mcp.steering,
|
|
328
|
+
// Teardown's steering.cancel rides the SAME central interpreter the HTTP reply path
|
|
329
|
+
// does (issue 200): emit the Effect through ports.interpreter, never poke the awaiter.
|
|
330
|
+
performSteering: (effect) => ports.interpreter.execute(effect),
|
|
331
|
+
runlog: ports.runlog,
|
|
332
|
+
log: ports.log,
|
|
333
|
+
clock: ports.clock,
|
|
334
|
+
random: ports.random,
|
|
335
|
+
launcherSource: input.launcherSource,
|
|
336
|
+
// The symphony-bundled mise SYSTEM config source (issue 209), read off host disk
|
|
337
|
+
// once at startup; core always stages it at /etc/mise/config.toml (issue 233).
|
|
338
|
+
miseSystemConfigSource: input.miseSystemConfigSource,
|
|
339
|
+
// The pre-minted ACP bearer (AcpWsRegistry.register) — the SAME token the
|
|
340
|
+
// dial-back registration is keyed on (unified-token fix).
|
|
341
|
+
acpToken,
|
|
342
|
+
boundMcpPort: input.boundMcpPort(),
|
|
343
|
+
resolvedNodeBin: input.resolvedNodeBin(),
|
|
344
|
+
allowWebSockets: (adapter) => adapter === 'codex',
|
|
345
|
+
// In-session 401 recovery (issue 214): refresh the host token + fan it out into the
|
|
346
|
+
// live VM's SecretManager, reporting whether a fresh token landed.
|
|
347
|
+
refreshCredential: (adapter) => substrates.credential.refreshCredential(adapter),
|
|
348
|
+
// Resolved at dispatch time (issue 206): the asset auto-converted from
|
|
349
|
+
// `gondolin.oci_image`, or null when inactive / not yet ready. buildVmPlan uses
|
|
350
|
+
// it as the boot imagePath only when the `gondolin.image` escape hatch is unset.
|
|
351
|
+
convertedImageSelector: input.resolveImageSelector?.() ?? null,
|
|
352
|
+
readEnv: input.readEnv,
|
|
353
|
+
};
|
|
354
|
+
}
|
|
355
|
+
//# sourceMappingURL=main-runner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main-runner.js","sourceRoot":"","sources":["../../src/shell/main-runner.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,EAAE;AACF,mFAAmF;AACnF,4EAA4E;AAC5E,kFAAkF;AAClF,qEAAqE;AACrE,gFAAgF;AAChF,qFAAqF;AACrF,oFAAoF;AACpF,0EAA0E;AAC1E,EAAE;AACF,wDAAwD;AACxD,kFAAkF;AAClF,oFAAoF;AACpF,uFAAuF;AACvF,wFAAwF;AACxF,gEAAgE;AAChE,qFAAqF;AACrF,qFAAqF;AACrF,sFAAsF;AACtF,kFAAkF;AAClF,kFAAkF;AAClF,uFAAuF;AACvF,EAAE;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