@iowarp/clio-coder 0.3.6 → 0.3.8
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/CHANGELOG.md +59 -0
- package/README.md +22 -6
- package/dist/{acp-2BEHC4DL.js → acp-U67UHUK2.js} +14 -14
- package/dist/{agents-LNNFTM53.js → agents-YU6SGALZ.js} +42 -35
- package/dist/assets/codewiki.json +1 -1
- package/dist/{auth-KXXFI2VS.js → auth-5ZPJOIVG.js} +32 -24
- package/dist/builtins-C6JMZVV6.js +17 -0
- package/dist/{chunk-E25LMLRW.js → chunk-26LEYJZH.js} +2 -2
- package/dist/{chunk-TSHXZTOQ.js → chunk-2HEJ2F35.js} +5 -5
- package/dist/{chunk-PBTHKCPN.js → chunk-2HFZQUHL.js} +7 -7
- package/dist/{chunk-FO5ZOVUY.js → chunk-3BINW3FP.js} +5 -5
- package/dist/{chunk-4OC57DA6.js → chunk-4DGYLA73.js} +53 -2
- package/dist/{chunk-CKXWIANG.js → chunk-4SPRNWDE.js} +18 -16
- package/dist/{chunk-E2ER4LJF.js → chunk-5C3AQNDW.js} +25 -1
- package/dist/{chunk-XF5N4U5A.js → chunk-5DHKRSMQ.js} +9 -8
- package/dist/{chunk-43AOLP7E.js → chunk-5FR74PWO.js} +2 -1
- package/dist/{chunk-EKY57CSP.js → chunk-5H3GB5BO.js} +68 -772
- package/dist/{chunk-6XXKFVSN.js → chunk-5Q2VVUKB.js} +4 -4
- package/dist/{chunk-DJVECN66.js → chunk-7RFXX52T.js} +295 -3705
- package/dist/{chunk-ZXF4XRKW.js → chunk-7RGZWPB6.js} +158 -8
- package/dist/{chunk-FYYLNIL5.js → chunk-A2NJGIB3.js} +2 -2
- package/dist/{chunk-XXQNGV4M.js → chunk-A3WNZD3P.js} +548 -72
- package/dist/{chunk-VEZEGCGW.js → chunk-B5CSFE7B.js} +23 -21
- package/dist/{chunk-2SFS6XQE.js → chunk-DGSYXYMX.js} +3 -2
- package/dist/chunk-DR52UMZW.js +21 -0
- package/dist/{chunk-ZWLZP4ZT.js → chunk-DYIM5TJT.js} +98 -12
- package/dist/{chunk-QKMUKYO7.js → chunk-E77JEWSD.js} +270 -125
- package/dist/{chunk-LYF7OHWH.js → chunk-EMYUUSFG.js} +12 -467
- package/dist/{chunk-4VP4KH3K.js → chunk-EQ63NRB7.js} +8 -8
- package/dist/chunk-FBVTI2TJ.js +518 -0
- package/dist/{chunk-R46L2BIR.js → chunk-FHJEP5SW.js} +19 -25
- package/dist/{chunk-WR67VIZY.js → chunk-GN57SG4G.js} +66 -8
- package/dist/{chunk-RD5U66HV.js → chunk-GPIEI3LY.js} +9 -9
- package/dist/{chunk-PCZJO5TI.js → chunk-GU2UIAFZ.js} +13 -178
- package/dist/chunk-GWS3VEIW.js +195 -0
- package/dist/chunk-H7IXIC72.js +103 -0
- package/dist/{chunk-3BPUFZDL.js → chunk-HLE42MG7.js} +3 -3
- package/dist/{chunk-24I7BN55.js → chunk-IFBNV6H6.js} +3 -3
- package/dist/{chunk-QNQHSOLF.js → chunk-IGWKHNIQ.js} +114 -55
- package/dist/chunk-IIZWH4XA.js +172 -0
- package/dist/{chunk-AD2SYQYC.js → chunk-IJ7RPIYJ.js} +124 -6
- package/dist/chunk-J3YUBZWY.js +382 -0
- package/dist/{chunk-5JGRAMKL.js → chunk-JOZYP4GM.js} +8 -6
- package/dist/{chunk-OH3TOQTB.js → chunk-K4XHGFR5.js} +751 -15
- package/dist/{chunk-EYPA3EGJ.js → chunk-KTYTFRMB.js} +178 -14
- package/dist/chunk-LU7P4LHA.js +33 -0
- package/dist/chunk-ME6CCNFO.js +108 -0
- package/dist/chunk-MXKJU4JB.js +1100 -0
- package/dist/{chunk-RY3LY4J5.js → chunk-N22QMJKY.js} +21 -18
- package/dist/chunk-NMPKI6XL.js +3006 -0
- package/dist/chunk-NUGM5KR6.js +165 -0
- package/dist/{chunk-22NAGB7X.js → chunk-P43ETTHK.js} +5 -94
- package/dist/{chunk-NILBFAPG.js → chunk-PMDBGQSJ.js} +2 -2
- package/dist/chunk-PT7HYKEM.js +165 -0
- package/dist/chunk-RVG5JXAL.js +41 -0
- package/dist/{chunk-GEYXPTRF.js → chunk-RWSI4YD7.js} +2 -2
- package/dist/{chunk-4BPJXDWC.js → chunk-TANS5ZJS.js} +35 -19
- package/dist/{verifiers-NCBTHHN2.js → chunk-TB5666IT.js} +67 -324
- package/dist/{chunk-QM3F2GKX.js → chunk-TLQJPP24.js} +7927 -8088
- package/dist/{chunk-G7MUEIGA.js → chunk-TT36MB5S.js} +2 -1
- package/dist/chunk-TTHACPOM.js +961 -0
- package/dist/{chunk-6US73PDB.js → chunk-TYPGUK6W.js} +7 -7
- package/dist/{chunk-MFFY33HR.js → chunk-U6MBIEMB.js} +554 -209
- package/dist/chunk-VAWNZU7Z.js +242 -0
- package/dist/{chunk-IR4CFBFN.js → chunk-VCBR6CU7.js} +12 -12
- package/dist/{chunk-WHJYKASB.js → chunk-VHN4MY6O.js} +2 -2
- package/dist/{chunk-XYDYPRZI.js → chunk-VWZOAB7K.js} +10 -10
- package/dist/{chunk-ZRGEBJ4T.js → chunk-WLFILSD5.js} +48 -48
- package/dist/{chunk-K7T3E2SR.js → chunk-WNIJTQQK.js} +12 -11
- package/dist/{chunk-CYQKWTG3.js → chunk-WSB3FPX7.js} +68 -20
- package/dist/{chunk-KHSFENX2.js → chunk-WWCZ5F23.js} +116 -14
- package/dist/{chunk-XE2VEJHX.js → chunk-WXY7KU3G.js} +2 -2
- package/dist/{chunk-PPAMZ32Z.js → chunk-XK56QHLX.js} +6 -1
- package/dist/{chunk-KOHPCX4K.js → chunk-XWSF374K.js} +5 -5
- package/dist/{chunk-CJUB2JJ2.js → chunk-YS5VLNH5.js} +10 -10
- package/dist/{chunk-ZZMN5OM4.js → chunk-ZNLWCMVZ.js} +2 -2
- package/dist/{chunk-WHGPSPT5.js → chunk-ZVJ5BLO2.js} +2 -2
- package/dist/cli/index.js +33 -31
- package/dist/{clio-M2KGYUFZ.js → clio-QVTYJ57A.js} +10 -10
- package/dist/{code-nav-GQNL7XA6.js → code-nav-FGGFIE7L.js} +5 -5
- package/dist/codewiki/build-worker.js +4 -4
- package/dist/{components-5TTYYX6G.js → components-ZFA3SAER.js} +9 -9
- package/dist/{config-XUUYQIWO.js → config-LW5IJFQN.js} +65 -55
- package/dist/{configure-IHJ7YOMV.js → configure-7XIZCOU4.js} +29 -24
- package/dist/{context-75MIWW3U.js → context-L3WL3X7K.js} +54 -43
- package/dist/{context-ZQ7SIFJV.js → context-N52ZA626.js} +30 -14
- package/dist/{context-74JLXAWD.js → context-Y6Y7QPR6.js} +12 -12
- package/dist/{context-clear-GYKWNUML.js → context-clear-MBQRLSDQ.js} +54 -43
- package/dist/{context-index-SSR5ECNE.js → context-index-HVMFQHK3.js} +5 -5
- package/dist/{context-working-set-UX5KEP4J.js → context-working-set-GS6DSO7F.js} +18 -18
- package/dist/{dispatch-runner-GIJBHNFL.js → dispatch-runner-22ZCNOM3.js} +367 -79
- package/dist/{docs-6FZSCG5B.js → docs-7LQ23DLM.js} +9 -9
- package/dist/{doctor-SVJ5BZCW.js → doctor-M7YEDGAE.js} +27 -23
- package/dist/{eval-CG6LLBLD.js → eval-BEC2WHDA.js} +73 -20
- package/dist/{evidence-ZYFIEN42.js → evidence-REJUMSKM.js} +70 -59
- package/dist/{evolve-QGEXEMDW.js → evolve-PY5ZBA5K.js} +50 -39
- package/dist/{extensions-ADGNCJJD.js → extensions-HVKU65YU.js} +7 -7
- package/dist/{fleet-S5R4ZOQY.js → fleet-7WZEWRFA.js} +236 -377
- package/dist/fleet-commands-UVHWM76J.js +70 -0
- package/dist/fleet-graph-6ULH7PES.js +125 -0
- package/dist/fleet-new-RDVJLHHH.js +48 -0
- package/dist/{fleet-preflight-BHSNPBMH.js → fleet-preflight-J53T6CCE.js} +5 -5
- package/dist/fleet-validate-72PC4SLA.js +79 -0
- package/dist/{init-5DRU55YR.js → init-OG3TPGQG.js} +69 -57
- package/dist/library-CNTMPLRF.js +217 -0
- package/dist/{memory-7YKKR6UC.js → memory-6IS7F275.js} +52 -41
- package/dist/{models-ZPOLRU2C.js → models-ENRJDA5W.js} +37 -31
- package/dist/{monitor-US5F5YGZ.js → monitor-XLDVO7TN.js} +79 -42
- package/dist/{orchestrator-E2AL4T5N.js → orchestrator-6KSPYRHA.js} +4126 -762
- package/dist/{paths-E7KYAQWE.js → paths-DBXMZMDU.js} +6 -6
- package/dist/registry-LG64LTF4.js +11 -0
- package/dist/{reset-KZ652EK6.js → reset-RZ4ER727.js} +12 -12
- package/dist/{run-SRNBKDWD.js → run-Y2CNK5RU.js} +89 -76
- package/dist/{share-CGZE33UP.js → share-A55GYP6Z.js} +37 -13
- package/dist/{skills-S2X4DLY5.js → skills-ALC5J6AT.js} +29 -13
- package/dist/{skills-eval-W2GGIC4R.js → skills-eval-JPBEBYQU.js} +60 -48
- package/dist/support-MIETYA5E.js +38 -0
- package/dist/{targets-54SWINWB.js → targets-VGNXIR3S.js} +46 -36
- package/dist/{terminal-lease-SAIF2OGY.js → terminal-lease-WOBR64YA.js} +4 -4
- package/dist/{uninstall-BVLWXKBT.js → uninstall-ZJF5H5ZN.js} +9 -9
- package/dist/{upgrade-JKAR27XC.js → upgrade-FUSUAGHR.js} +31 -28
- package/dist/{usage-MSAWCLX4.js → usage-N4MKVHKD.js} +140 -68
- package/dist/verifiers-YAWOJ3H2.js +336 -0
- package/dist/{verify-X5HDROLA.js → verify-LTDHYBGY.js} +10 -9
- package/dist/{wiki-generate-GUSOQ6ZP.js → wiki-generate-6M7GHTBJ.js} +75 -62
- package/dist/worker/entry.js +67 -57
- package/docs/README.md +3 -2
- package/docs/acp.md +1 -1
- package/docs/alcf-provider.md +1 -1
- package/docs/architecture.md +2 -2
- package/docs/artifact-versions.md +11 -6
- package/docs/built-in-agents.md +26 -2
- package/docs/capacity-and-scheduling.md +1 -1
- package/docs/commands-and-modes.md +83 -3
- package/docs/configuration-and-targets.md +86 -4
- package/docs/context-engine.md +1 -1
- package/docs/development-pipeline.md +1 -1
- package/docs/dispatch-architecture-rationale.md +1 -1
- package/docs/documentation-coverage.md +3 -3
- package/docs/documentation-guide.md +3 -3
- package/docs/eval-runner.md +1 -1
- package/docs/evals-internal.md +1 -1
- package/docs/evidence-and-memory.md +74 -10
- package/docs/evolution.md +1 -1
- package/docs/exit-codes-and-output.md +4 -1
- package/docs/extensions-and-sharing.md +6 -2
- package/docs/fleet-demo-runbook.md +2 -2
- package/docs/fleet-dispatch.md +228 -16
- package/docs/git-commit-provenance.md +2 -2
- package/docs/glossary.md +22 -2
- package/docs/installation-and-lifecycle.md +2 -2
- package/docs/middleware-and-components.md +2 -1
- package/docs/model-catalog.md +1 -1
- package/docs/observability.md +56 -9
- package/docs/proactive-memory.md +1 -1
- package/docs/prompt-envelope-and-tools.md +4 -2
- package/docs/provider-adapter-cookbook.md +1 -1
- package/docs/release-cut-checklist.md +83 -65
- package/docs/resource-library.md +59 -0
- package/docs/safety-model.md +2 -2
- package/docs/scientific-validation.md +3 -3
- package/docs/session-lifecycle.md +37 -1
- package/docs/skills-marketplace.md +16 -3
- package/docs/tool-usage.md +14 -7
- package/docs/trace-store.md +1 -1
- package/docs/troubleshooting.md +1 -1
- package/docs/tui-design.md +1 -1
- package/docs/worker-dispatch-mechanics.md +3 -3
- package/package.json +1 -2
- package/src/cli/argv.ts +5 -0
- package/src/cli/configure.ts +107 -23
- package/src/cli/doctor.ts +5 -1
- package/src/cli/evidence.ts +30 -25
- package/src/cli/fleet-commands.ts +37 -0
- package/src/cli/fleet-graph.ts +102 -0
- package/src/cli/fleet-new.ts +36 -0
- package/src/cli/fleet-preflight.ts +111 -0
- package/src/cli/fleet-validate.ts +30 -0
- package/src/cli/fleet.ts +173 -335
- package/src/cli/index.ts +3 -1
- package/src/cli/library.ts +190 -0
- package/src/cli/share.ts +13 -1
- package/src/cli/shared.ts +1 -0
- package/src/cli/targets.ts +4 -1
- package/src/cli/usage.ts +111 -19
- package/src/cli/validate-model.ts +60 -5
- package/src/core/bus-events.ts +29 -0
- package/src/core/commit-attribution.ts +4 -4
- package/src/core/config.ts +130 -0
- package/src/core/defaults.ts +81 -0
- package/src/core/path-boundary.ts +100 -0
- package/src/domains/agents/builtins/architect.md +1 -0
- package/src/domains/agents/builtins/oracle.md +33 -0
- package/src/domains/agents/catalog.ts +13 -1
- package/src/domains/agents/extension.ts +2 -11
- package/src/domains/agents/fleet-contract.ts +304 -24
- package/src/domains/agents/index.ts +14 -0
- package/src/domains/agents/recipe.ts +7 -1
- package/src/domains/agents/registry.ts +73 -5
- package/src/domains/agents/result-contract.ts +360 -15
- package/src/domains/agents/write-boundary.ts +15 -50
- package/src/domains/config/classify.ts +4 -0
- package/src/domains/context/project-rules.ts +51 -1
- package/src/domains/dispatch/active-route-planner.ts +14 -0
- package/src/domains/dispatch/assignment-reconcile.ts +22 -5
- package/src/domains/dispatch/assignment-store.ts +151 -14
- package/src/domains/dispatch/backoff.ts +2 -1
- package/src/domains/dispatch/capability-match.ts +1 -0
- package/src/domains/dispatch/checkout-writer-lease.ts +175 -0
- package/src/domains/dispatch/contract.ts +48 -0
- package/src/domains/dispatch/delegation-plan.ts +164 -0
- package/src/domains/dispatch/execution-plan.ts +76 -5
- package/src/domains/dispatch/execution-role.ts +12 -2
- package/src/domains/dispatch/execution-scheduler.ts +183 -67
- package/src/domains/dispatch/extension.ts +412 -74
- package/src/domains/dispatch/fleet-gate.ts +14 -0
- package/src/domains/dispatch/fleet-plan.ts +63 -3
- package/src/domains/dispatch/fleet-run.ts +791 -0
- package/src/domains/dispatch/gate-role-prompts.ts +47 -0
- package/src/domains/dispatch/host-verification.ts +178 -0
- package/src/domains/dispatch/index.ts +41 -1
- package/src/domains/dispatch/intent-requirements.ts +40 -0
- package/src/domains/dispatch/intent.ts +235 -0
- package/src/domains/dispatch/path-scope.ts +370 -0
- package/src/domains/dispatch/receipt-integrity.ts +9 -4
- package/src/domains/dispatch/state.ts +36 -3
- package/src/domains/dispatch/types.ts +64 -12
- package/src/domains/dispatch/validation.ts +69 -6
- package/src/domains/dispatch/write-boundary-enforcer.ts +45 -0
- package/src/domains/dispatch/write-boundary.ts +201 -22
- package/src/domains/eval/metrics/evidence.ts +79 -2
- package/src/domains/eval/runners/clio-run.ts +12 -2
- package/src/domains/evidence/build.ts +69 -11
- package/src/domains/evidence/index.ts +21 -0
- package/src/domains/evidence/provenance.ts +46 -11
- package/src/domains/evidence/trust-projection.ts +274 -0
- package/src/domains/evidence/trust-status.ts +155 -18
- package/src/domains/evidence/types.ts +4 -0
- package/src/domains/extensions/discovery.ts +88 -1
- package/src/domains/extensions/resources.ts +20 -8
- package/src/domains/extensions/state.ts +6 -2
- package/src/domains/extensions/types.ts +4 -1
- package/src/domains/lifecycle/doctor.ts +140 -1
- package/src/domains/middleware/index.ts +15 -0
- package/src/domains/middleware/watchdog.ts +281 -0
- package/src/domains/observability/contract.ts +3 -1
- package/src/domains/observability/cost.ts +12 -1
- package/src/domains/observability/extension.ts +2 -2
- package/src/domains/observability/index.ts +10 -0
- package/src/domains/observability/out-of-turn-usage.ts +223 -0
- package/src/domains/prompts/contract.ts +3 -5
- package/src/domains/providers/extension.ts +30 -2
- package/src/domains/resources/common-loader.ts +3 -0
- package/src/domains/resources/index.ts +20 -0
- package/src/domains/resources/library.ts +326 -0
- package/src/domains/resources/prompts/loader.ts +119 -14
- package/src/domains/resources/skills/marketplace.ts +37 -12
- package/src/domains/safety/policy-engine.ts +5 -5
- package/src/domains/safety/run-effects.ts +64 -1
- package/src/domains/safety/scope.ts +7 -12
- package/src/domains/session/handoff.ts +629 -0
- package/src/domains/share/archive.ts +67 -2
- package/src/engine/acp/server.ts +4 -1
- package/src/engine/prompt-templates.ts +18 -1
- package/src/engine/worker-runtime.ts +6 -3
- package/src/entry/orchestrator.ts +37 -0
- package/src/interactive/bus-notices.ts +26 -0
- package/src/interactive/chat-loop.ts +235 -1
- package/src/interactive/chat-renderer.ts +22 -0
- package/src/interactive/cost-overlay.ts +31 -3
- package/src/interactive/council-dispatch.ts +30 -0
- package/src/interactive/council-grid.ts +213 -0
- package/src/interactive/council.ts +99 -0
- package/src/interactive/dispatch-board.ts +311 -17
- package/src/interactive/fleet-run-preview.ts +307 -0
- package/src/interactive/footer/notifications.ts +219 -0
- package/src/interactive/handoff-round.ts +56 -0
- package/src/interactive/interactive-application.ts +43 -1
- package/src/interactive/interactive-event-projection.ts +23 -1
- package/src/interactive/interactive-slash-runtime.ts +52 -2
- package/src/interactive/interactive-subscriptions.ts +14 -2
- package/src/interactive/oracle.ts +179 -0
- package/src/interactive/overlay-ask-user-lifecycle.ts +6 -0
- package/src/interactive/overlay-general-openers.ts +190 -1
- package/src/interactive/overlay-key-routing.ts +17 -1
- package/src/interactive/overlay-lifecycle.ts +41 -1
- package/src/interactive/overlay-permission-lifecycle.ts +10 -0
- package/src/interactive/overlay-resource-openers.ts +11 -3
- package/src/interactive/overlay-session-lifecycle.ts +234 -2
- package/src/interactive/overlays/fleet-run-approval.ts +208 -0
- package/src/interactive/overlays/handoff-review.ts +185 -0
- package/src/interactive/overlays/library-install-confirm.ts +151 -0
- package/src/interactive/overlays/list-overlay.ts +168 -2
- package/src/interactive/overlays/settings.ts +221 -30
- package/src/interactive/overlays/side-question.ts +139 -0
- package/src/interactive/overlays/skills-hub.ts +401 -15
- package/src/interactive/side-question.ts +171 -0
- package/src/interactive/slash-commands.ts +439 -7
- package/src/interactive/slash-spec.ts +19 -6
- package/src/interactive/theme/tokens.ts +30 -0
- package/src/interactive/turn-middleware.ts +15 -1
- package/src/interactive/view/artifacts.ts +42 -9
- package/src/interactive/view/view-overlay.ts +15 -3
- package/src/interactive/watchdog-run.ts +75 -0
- package/src/interactive/worker-receipts.ts +14 -2
- package/src/interactive/worker-share.ts +56 -1
- package/src/interactive/worker-stream.ts +15 -0
- package/src/tools/bootstrap.ts +3 -0
- package/src/tools/compete-worktrees.ts +13 -79
- package/src/tools/dispatch-admission.ts +251 -18
- package/src/tools/dispatch-arguments.ts +84 -1
- package/src/tools/dispatch-plan.ts +165 -6
- package/src/tools/dispatch-runner.ts +364 -23
- package/src/tools/dispatch-types.ts +20 -1
- package/src/tools/dispatch.ts +72 -2
- package/src/tools/monitor.ts +29 -0
- package/src/tools/profiles.ts +18 -4
- package/src/tools/task-worktree.ts +238 -0
- package/src/tools/verify/authoring.ts +61 -1
- package/src/tools/verify/scripts.ts +62 -0
- package/src/tools/worker-evidence.ts +21 -14
- package/src/worker/spec-contract.ts +3 -1
- package/dist/chunk-HC4CLZ2Y.js +0 -68
|
@@ -4,92 +4,106 @@ import {
|
|
|
4
4
|
receiptEvidenceLabels,
|
|
5
5
|
workerTextLabel,
|
|
6
6
|
workerTextNonEvidenceNotices
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-N22QMJKY.js";
|
|
8
8
|
import {
|
|
9
9
|
createDispatchRunEventRegistry
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
10
|
+
} from "./chunk-JOZYP4GM.js";
|
|
11
|
+
import "./chunk-HLE42MG7.js";
|
|
12
12
|
import {
|
|
13
13
|
UNVERIFIABLE_RECEIPT_VERIFICATION,
|
|
14
|
-
adaptRunReceiptTrustStatus,
|
|
15
|
-
candidateDiffStat,
|
|
16
|
-
claimCompeteGroup,
|
|
17
|
-
cleanupCompeteGroup,
|
|
18
14
|
closeAgentLedger,
|
|
19
|
-
commitCandidateWork,
|
|
20
|
-
compileExecutionPlan,
|
|
21
|
-
createCandidateWorktree,
|
|
22
15
|
decideReviewGate,
|
|
23
16
|
durableAssistantTextFromEvent,
|
|
24
17
|
executePlan,
|
|
25
18
|
extractRunProvenance,
|
|
26
19
|
finalizePendingGateDecision,
|
|
27
|
-
isGitRepository,
|
|
28
|
-
loadCompeteGroup,
|
|
29
|
-
markCompeteGroupCleanupReady,
|
|
30
|
-
markCompeteGroupWinnerPreserved,
|
|
31
20
|
materializePendingGateDecision,
|
|
32
|
-
mergeWinnerBranch,
|
|
33
21
|
openAgentLedger,
|
|
34
22
|
parseCompeteGateResult,
|
|
35
23
|
preflightPendingGateDecisionMaterialization,
|
|
36
24
|
preparePendingGateDecisionRecovery,
|
|
37
|
-
protectedPathsChangedByCompeteBranch,
|
|
38
25
|
provenanceCompactSuffix,
|
|
39
26
|
readGateDecisionArtifacts,
|
|
40
|
-
recoverCleanupReadyCompeteGroups,
|
|
41
|
-
registerCompeteGroupRun,
|
|
42
|
-
removeCandidateWorktree,
|
|
43
27
|
renderAgentLedgerBoard,
|
|
44
|
-
|
|
28
|
+
renderDispatchReviewerTask,
|
|
45
29
|
resolvePendingGateDecision,
|
|
46
|
-
settleCompeteGroupRun,
|
|
47
|
-
settleRecoveredCompeteDecision,
|
|
48
30
|
stagePendingGateDecision,
|
|
49
31
|
stagePendingGateOutput
|
|
50
|
-
} from "./chunk-
|
|
51
|
-
import "./chunk-
|
|
52
|
-
import "./chunk-QKMUKYO7.js";
|
|
32
|
+
} from "./chunk-TLQJPP24.js";
|
|
33
|
+
import "./chunk-YS5VLNH5.js";
|
|
53
34
|
import {
|
|
35
|
+
adaptRunReceiptTrustStatus,
|
|
36
|
+
summarizeTrustStatus,
|
|
54
37
|
verifyReceiptIntegrity
|
|
55
|
-
} from "./chunk-
|
|
56
|
-
import
|
|
38
|
+
} from "./chunk-K4XHGFR5.js";
|
|
39
|
+
import {
|
|
40
|
+
candidateDiffStat,
|
|
41
|
+
claimCompeteGroup,
|
|
42
|
+
cleanupCompeteGroup,
|
|
43
|
+
commitCandidateWork,
|
|
44
|
+
createCandidateWorktree,
|
|
45
|
+
isGitRepository,
|
|
46
|
+
loadCompeteGroup,
|
|
47
|
+
markCompeteGroupCleanupReady,
|
|
48
|
+
markCompeteGroupWinnerPreserved,
|
|
49
|
+
mergeWinnerBranch,
|
|
50
|
+
protectedPathsChangedByCompeteBranch,
|
|
51
|
+
recoverCleanupReadyCompeteGroups,
|
|
52
|
+
registerCompeteGroupRun,
|
|
53
|
+
removeCandidateWorktree,
|
|
54
|
+
settleCompeteGroupRun,
|
|
55
|
+
settleRecoveredCompeteDecision
|
|
56
|
+
} from "./chunk-MXKJU4JB.js";
|
|
57
|
+
import {
|
|
58
|
+
compileExecutionPlan,
|
|
59
|
+
requireAgentSteps
|
|
60
|
+
} from "./chunk-J3YUBZWY.js";
|
|
61
|
+
import "./chunk-RVG5JXAL.js";
|
|
62
|
+
import "./chunk-W6GROXXM.js";
|
|
63
|
+
import "./chunk-E77JEWSD.js";
|
|
64
|
+
import "./chunk-DYIM5TJT.js";
|
|
65
|
+
import "./chunk-2HEJ2F35.js";
|
|
57
66
|
import "./chunk-TXOTCRLG.js";
|
|
58
67
|
import "./chunk-HVDIIIQW.js";
|
|
59
|
-
import "./chunk-W6GROXXM.js";
|
|
60
68
|
import {
|
|
61
69
|
RESOLVED_DISPATCH_PLAN_ARGUMENT,
|
|
62
70
|
describeDispatchPlan,
|
|
63
71
|
withResolvedPlanTaskPin
|
|
64
|
-
} from "./chunk-
|
|
72
|
+
} from "./chunk-KTYTFRMB.js";
|
|
65
73
|
import {
|
|
66
74
|
COMPETE_STANCES,
|
|
75
|
+
COUNCIL_JUDGE_PROMPT,
|
|
67
76
|
JUDGE_GATE_PROMPT,
|
|
68
|
-
REVIEWER_GATE_PROMPT
|
|
69
|
-
|
|
70
|
-
|
|
77
|
+
REVIEWER_GATE_PROMPT,
|
|
78
|
+
renderCouncilVoteMemberTask
|
|
79
|
+
} from "./chunk-A3WNZD3P.js";
|
|
80
|
+
import "./chunk-5FR74PWO.js";
|
|
71
81
|
import {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
} from "./chunk-EKY57CSP.js";
|
|
82
|
+
explainRouteDecision
|
|
83
|
+
} from "./chunk-P43ETTHK.js";
|
|
75
84
|
import {
|
|
76
|
-
explainRouteDecision,
|
|
77
85
|
gateDeciderAgentId,
|
|
78
86
|
gateRouteCorrelation
|
|
79
|
-
} from "./chunk-
|
|
80
|
-
import "./chunk-
|
|
81
|
-
import "./chunk-
|
|
82
|
-
import "./chunk-CMZWFGD2.js";
|
|
83
|
-
import "./chunk-I4HZDVNP.js";
|
|
84
|
-
import "./chunk-FYYLNIL5.js";
|
|
85
|
-
import "./chunk-UL3WSD3F.js";
|
|
87
|
+
} from "./chunk-H7IXIC72.js";
|
|
88
|
+
import "./chunk-5H3GB5BO.js";
|
|
89
|
+
import "./chunk-A2NJGIB3.js";
|
|
86
90
|
import "./chunk-OQE5J4C6.js";
|
|
87
|
-
import "./chunk-ECH6PKUQ.js";
|
|
88
91
|
import "./chunk-GOXNB3AO.js";
|
|
89
92
|
import "./chunk-HWUFFB6L.js";
|
|
93
|
+
import {
|
|
94
|
+
parseJsonObjectPayload,
|
|
95
|
+
parseScoutResult,
|
|
96
|
+
resultContractSourceId
|
|
97
|
+
} from "./chunk-TTHACPOM.js";
|
|
98
|
+
import "./chunk-AOCYTWAV.js";
|
|
99
|
+
import "./chunk-MV3K5QF2.js";
|
|
100
|
+
import "./chunk-UL3WSD3F.js";
|
|
90
101
|
import "./chunk-ODFEOB4F.js";
|
|
91
102
|
import "./chunk-OZNBF4L3.js";
|
|
92
103
|
import "./chunk-4BJ5BYCE.js";
|
|
104
|
+
import "./chunk-ECH6PKUQ.js";
|
|
105
|
+
import "./chunk-CMZWFGD2.js";
|
|
106
|
+
import "./chunk-I4HZDVNP.js";
|
|
93
107
|
import {
|
|
94
108
|
truncateUtf8
|
|
95
109
|
} from "./chunk-6XLNIQDB.js";
|
|
@@ -97,36 +111,41 @@ import "./chunk-5B2AEOW5.js";
|
|
|
97
111
|
import "./chunk-CGKSTWHD.js";
|
|
98
112
|
import "./chunk-XAKHZX5N.js";
|
|
99
113
|
import "./chunk-33YXPOE3.js";
|
|
100
|
-
import "./chunk-
|
|
114
|
+
import "./chunk-7CR24IG7.js";
|
|
115
|
+
import "./chunk-7RFXX52T.js";
|
|
101
116
|
import "./chunk-CFGTUFWB.js";
|
|
102
|
-
import "./chunk-
|
|
103
|
-
import "./chunk-
|
|
104
|
-
import "./chunk-LL4KHSZI.js";
|
|
105
|
-
import "./chunk-4VP4KH3K.js";
|
|
106
|
-
import "./chunk-VEZEGCGW.js";
|
|
107
|
-
import "./chunk-FQ4SKYE4.js";
|
|
108
|
-
import "./chunk-IKCO5N3L.js";
|
|
109
|
-
import "./chunk-3I7MS7N2.js";
|
|
117
|
+
import "./chunk-LU7P4LHA.js";
|
|
118
|
+
import "./chunk-RWSI4YD7.js";
|
|
110
119
|
import "./chunk-IHXBNWMM.js";
|
|
111
|
-
import "./chunk-
|
|
112
|
-
import "./chunk-
|
|
113
|
-
import "./chunk-
|
|
120
|
+
import "./chunk-B5CSFE7B.js";
|
|
121
|
+
import "./chunk-IJ7RPIYJ.js";
|
|
122
|
+
import "./chunk-FQ4SKYE4.js";
|
|
123
|
+
import "./chunk-ZGVHUX3M.js";
|
|
124
|
+
import {
|
|
125
|
+
BusChannels
|
|
126
|
+
} from "./chunk-TT36MB5S.js";
|
|
127
|
+
import "./chunk-3BINW3FP.js";
|
|
114
128
|
import "./chunk-R346GLFC.js";
|
|
129
|
+
import "./chunk-6EJMN2Y3.js";
|
|
130
|
+
import "./chunk-IWHMRKLL.js";
|
|
131
|
+
import "./chunk-NMPKI6XL.js";
|
|
132
|
+
import "./chunk-4DGYLA73.js";
|
|
133
|
+
import "./chunk-LL4KHSZI.js";
|
|
115
134
|
import "./chunk-4ZG3XFUR.js";
|
|
116
|
-
import "./chunk-
|
|
135
|
+
import "./chunk-IIZWH4XA.js";
|
|
136
|
+
import "./chunk-EQ63NRB7.js";
|
|
137
|
+
import "./chunk-SST6Z5JA.js";
|
|
138
|
+
import "./chunk-IKCO5N3L.js";
|
|
139
|
+
import "./chunk-3I7MS7N2.js";
|
|
117
140
|
import "./chunk-APJ265NV.js";
|
|
118
|
-
import "./chunk-YXLYO42X.js";
|
|
119
141
|
import {
|
|
120
142
|
clioStateDir
|
|
121
143
|
} from "./chunk-BNAZZHFG.js";
|
|
122
|
-
import "./chunk-6EJMN2Y3.js";
|
|
123
144
|
import "./chunk-WEPFGWHJ.js";
|
|
124
|
-
import "./chunk-
|
|
125
|
-
import
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
import "./chunk-7CR24IG7.js";
|
|
129
|
-
import "./chunk-IWHMRKLL.js";
|
|
145
|
+
import "./chunk-NUGM5KR6.js";
|
|
146
|
+
import "./chunk-PT7HYKEM.js";
|
|
147
|
+
import "./chunk-FCSXB6T2.js";
|
|
148
|
+
import "./chunk-YXLYO42X.js";
|
|
130
149
|
import {
|
|
131
150
|
init_esm_shims
|
|
132
151
|
} from "./chunk-3R73A4XB.js";
|
|
@@ -506,7 +525,10 @@ function formatDispatchOutput(mode, runs, maxOutputBytes, board = null) {
|
|
|
506
525
|
const stepLabel = mode === "pipeline" ? `step ${index + 1}/${runs.length} ` : "";
|
|
507
526
|
const provenance = provenanceCompactSuffix(extractRunProvenance(receipt));
|
|
508
527
|
const verification = run.integrity.ok ? receipt.verification : UNVERIFIABLE_RECEIPT_VERIFICATION;
|
|
509
|
-
const trustStatus = adaptRunReceiptTrustStatus(
|
|
528
|
+
const trustStatus = adaptRunReceiptTrustStatus(
|
|
529
|
+
{ ...receipt, verification },
|
|
530
|
+
{ integrity: run.integrity }
|
|
531
|
+
);
|
|
510
532
|
const evidenceSuffix = ` ${receiptEvidenceLabels(receipt, verification, run.integrity).join(" ")}`;
|
|
511
533
|
const routingSuffix = run.integrity.ok && receipt.routeDecision !== void 0 && receipt.routingIntent !== void 0 ? ` route_decision=${receipt.routeDecision.decisionHash} route_mode=${receipt.routeDecision.mode}` : "";
|
|
512
534
|
const answerText = run.integrity.ok && (receipt.output?.state === "final" || receipt.outcome !== void 0 && receipt.outcome !== "succeeded") ? receipt.output?.text ?? "" : "";
|
|
@@ -559,8 +581,13 @@ function dispatchDetails(deps, mode, runs, board = null) {
|
|
|
559
581
|
// sealed receipt read-only, plus the integrity check so a tampered
|
|
560
582
|
// receipt is machine-visible here too.
|
|
561
583
|
verification: integrity.ok ? receipt.verification : UNVERIFIABLE_RECEIPT_VERIFICATION,
|
|
584
|
+
hostVerification: integrity.ok ? receipt.hostVerification ?? null : null,
|
|
562
585
|
receiptIntegrity: integrity,
|
|
563
586
|
trustStatus,
|
|
587
|
+
// The bounded projection sits shallow and flat on purpose: a
|
|
588
|
+
// depth-capped wire (ACP rawOutput) keeps it whole while the
|
|
589
|
+
// canonical status's nested references fall off the end.
|
|
590
|
+
trust: summarizeTrustStatus(trustStatus),
|
|
564
591
|
...receipt.outcome !== void 0 && receipt.outcome !== "succeeded" ? { outcome: receipt.outcome, outcomeDetail: receipt.outcomeDetail ?? null } : {},
|
|
565
592
|
...provenance.pipeline !== void 0 ? { pipeline: provenance.pipeline } : {},
|
|
566
593
|
...provenance.personaOverride !== void 0 ? { personaOverride: provenance.personaOverride } : {},
|
|
@@ -596,14 +623,6 @@ function competeCorrelation(candidates, decider) {
|
|
|
596
623
|
if (subject === void 0) throw new Error("compete decision requires at least one candidate receipt");
|
|
597
624
|
return gateCorrelationOf(subject, decider);
|
|
598
625
|
}
|
|
599
|
-
function reviewerTask(originalTask, builderRunId, cycle) {
|
|
600
|
-
return [
|
|
601
|
-
`Review the work of builder run ${builderRunId} (review cycle ${cycle}).`,
|
|
602
|
-
"The builder's final answer is provided as input data; verify it against the workspace, do not trust it blindly.",
|
|
603
|
-
"Original task the builder was given:",
|
|
604
|
-
originalTask
|
|
605
|
-
].join("\n\n");
|
|
606
|
-
}
|
|
607
626
|
var REVIEW_SINGLE_TASK_MESSAGE = "dispatch: review supports exactly one task; run the fan-out without review, then dispatch one integration task with review to gate the combined result";
|
|
608
627
|
var COMPETE_SINGLE_TASK_MESSAGE = "dispatch: compete requires exactly one task";
|
|
609
628
|
var COMPETE_NO_REVIEW_MESSAGE = "dispatch: compete has its own judge and cannot combine with review";
|
|
@@ -712,7 +731,7 @@ async function runReviewGated(deps, base, review, timeoutMs, signal) {
|
|
|
712
731
|
const reviewerRequest = {
|
|
713
732
|
agentId: gateDeciderAgentId(review.reviewer),
|
|
714
733
|
executionRole: "reviewer",
|
|
715
|
-
task:
|
|
734
|
+
task: renderDispatchReviewerTask(base.task, builder.receipt.runId, cycle, base.intent),
|
|
716
735
|
systemPrompt: REVIEWER_GATE_PROMPT,
|
|
717
736
|
autonomy: "read-only",
|
|
718
737
|
gate: { role: "reviewer", group, cycle, subjects: [subjectRef(builder.receipt)] },
|
|
@@ -1546,6 +1565,219 @@ ${body}`,
|
|
|
1546
1565
|
details
|
|
1547
1566
|
};
|
|
1548
1567
|
}
|
|
1568
|
+
var COUNCIL_BRIEFING_MAX_BYTES = 8 * 1024;
|
|
1569
|
+
var COUNCIL_BRIEFING_TRUNCATION = "\n[council peer briefing truncated]";
|
|
1570
|
+
function councilVerdict(text) {
|
|
1571
|
+
const parsed = parseJsonObjectPayload(text);
|
|
1572
|
+
return parsed.ok && typeof parsed.value.verdict === "string" && parsed.value.verdict.trim().length > 0 ? parsed.value.verdict.trim().toLowerCase() : void 0;
|
|
1573
|
+
}
|
|
1574
|
+
function councilJudgeText(text) {
|
|
1575
|
+
const parsed = parseJsonObjectPayload(text);
|
|
1576
|
+
return parsed.ok && typeof parsed.value.text === "string" && parsed.value.text.trim().length > 0 ? parsed.value.text.trim() : text;
|
|
1577
|
+
}
|
|
1578
|
+
function boundedCouncilBriefing(parts) {
|
|
1579
|
+
return truncateUtf8(parts.join("\n\n"), COUNCIL_BRIEFING_MAX_BYTES, COUNCIL_BRIEFING_TRUNCATION);
|
|
1580
|
+
}
|
|
1581
|
+
async function runCouncil(deps, base, council, timeoutMs, signal) {
|
|
1582
|
+
const group = newGateGroupId("council");
|
|
1583
|
+
const runs = [];
|
|
1584
|
+
let prior = /* @__PURE__ */ new Map();
|
|
1585
|
+
const runMember = async (request) => {
|
|
1586
|
+
if (signal?.aborted) throw new Error("council dispatch aborted");
|
|
1587
|
+
const handle = await deps.dispatch.dispatch(request);
|
|
1588
|
+
let timer;
|
|
1589
|
+
if (timeoutMs !== void 0) {
|
|
1590
|
+
timer = setTimeout(
|
|
1591
|
+
() => deps.dispatch.abort(handle.runId, { cause: "timeout", detail: `timed out after ${timeoutMs}ms` }),
|
|
1592
|
+
timeoutMs
|
|
1593
|
+
);
|
|
1594
|
+
}
|
|
1595
|
+
const abort = () => deps.dispatch.abort(handle.runId);
|
|
1596
|
+
signal?.addEventListener("abort", abort, { once: true });
|
|
1597
|
+
try {
|
|
1598
|
+
const [summary, receipt] = await Promise.all([
|
|
1599
|
+
consumeGateSensitiveDispatchEvents(deps, handle.runId, request.agentId, handle.events),
|
|
1600
|
+
handle.finalPromise
|
|
1601
|
+
]);
|
|
1602
|
+
return completeRun(deps, receipt, summary);
|
|
1603
|
+
} finally {
|
|
1604
|
+
if (timer !== void 0) clearTimeout(timer);
|
|
1605
|
+
signal?.removeEventListener("abort", abort);
|
|
1606
|
+
}
|
|
1607
|
+
};
|
|
1608
|
+
for (let round = 1; round <= council.rounds; round += 1) {
|
|
1609
|
+
const settled = await Promise.all(
|
|
1610
|
+
council.members.map(async (member, index) => {
|
|
1611
|
+
const peerParts = base.briefing === void 0 ? [] : [`[original briefing] ${base.briefing}`];
|
|
1612
|
+
if (round > 1) {
|
|
1613
|
+
for (const peer of council.members) {
|
|
1614
|
+
if (peer.label === member.label) continue;
|
|
1615
|
+
const previous = prior.get(peer.label);
|
|
1616
|
+
if (previous === void 0 || isPipelineStepFailure(previous.receipt)) {
|
|
1617
|
+
peerParts.push(`[${peer.label}] failed in prior round; no answer contributed.`);
|
|
1618
|
+
} else {
|
|
1619
|
+
peerParts.push(`[${peer.label}] ${normalizedAssistantText(previous.summary)}`);
|
|
1620
|
+
}
|
|
1621
|
+
}
|
|
1622
|
+
}
|
|
1623
|
+
const position = (round - 1) * council.members.length + index + 1;
|
|
1624
|
+
const pinned = council.resolvedTasks?.find((task) => task.role === "member" && task.position === position);
|
|
1625
|
+
let voteTask = base.task;
|
|
1626
|
+
if (council.synthesis === "vote") {
|
|
1627
|
+
if (pinned !== void 0) voteTask = pinned.task;
|
|
1628
|
+
else if (council.resolvedTasks !== void 0)
|
|
1629
|
+
throw new Error(`dispatch: resolved council plan has no member task at position ${position}`);
|
|
1630
|
+
else voteTask = renderCouncilVoteMemberTask(base.task);
|
|
1631
|
+
}
|
|
1632
|
+
const request = {
|
|
1633
|
+
...base,
|
|
1634
|
+
executionRole: "researcher",
|
|
1635
|
+
autonomy: "read-only",
|
|
1636
|
+
toolProfile: "council-read-only",
|
|
1637
|
+
// A vote is a majority over the members' verdict fields, so a vote
|
|
1638
|
+
// council asks each member for one and seals the ballot it asked
|
|
1639
|
+
// for. The seated recipe is untouched: the ask is a task suffix and
|
|
1640
|
+
// the postcondition is an override, so the member is still the
|
|
1641
|
+
// agent the operator seated, and any recipe can be voted with.
|
|
1642
|
+
// Admission already composed the suffix into each resolved member
|
|
1643
|
+
// task, so reuse its exact bytes. The fallback supports dispatch
|
|
1644
|
+
// contracts that have no resolved admission artifact.
|
|
1645
|
+
...council.synthesis === "vote" ? {
|
|
1646
|
+
task: voteTask,
|
|
1647
|
+
resultContractOverride: { kind: "council-ballot" }
|
|
1648
|
+
} : {},
|
|
1649
|
+
target: member.target,
|
|
1650
|
+
...member.model ? { model: member.model } : {},
|
|
1651
|
+
...member.thinking ? { thinkingLevel: member.thinking } : {},
|
|
1652
|
+
gate: {
|
|
1653
|
+
role: "member",
|
|
1654
|
+
group,
|
|
1655
|
+
cycle: round,
|
|
1656
|
+
...round > 1 ? {
|
|
1657
|
+
subjects: [...prior.entries()].filter(([label]) => label !== member.label).map(([, run]) => subjectRef(run.receipt))
|
|
1658
|
+
} : {}
|
|
1659
|
+
},
|
|
1660
|
+
council: { group, label: member.label, ...member.color ? { color: member.color } : {}, round },
|
|
1661
|
+
...round > 1 ? { briefing: boundedCouncilBriefing(peerParts) } : base.briefing !== void 0 ? { briefing: base.briefing } : {}
|
|
1662
|
+
};
|
|
1663
|
+
return [
|
|
1664
|
+
member.label,
|
|
1665
|
+
await runMember(withResolvedPlanTaskPin(request, pinned, { pinTask: false, pinBriefing: false }))
|
|
1666
|
+
];
|
|
1667
|
+
})
|
|
1668
|
+
);
|
|
1669
|
+
prior = new Map(settled);
|
|
1670
|
+
runs.push(...settled.map(([, run]) => run));
|
|
1671
|
+
}
|
|
1672
|
+
const members = runs.map((run) => {
|
|
1673
|
+
const text = normalizedAssistantText(run.summary);
|
|
1674
|
+
const failed = isPipelineStepFailure(run.receipt);
|
|
1675
|
+
const verdict = councilVerdict(text);
|
|
1676
|
+
return {
|
|
1677
|
+
label: run.receipt.council?.label ?? "member",
|
|
1678
|
+
runId: run.receipt.runId,
|
|
1679
|
+
round: run.receipt.council?.round ?? 1,
|
|
1680
|
+
// A ballot's prose lives in its `text` field, so the report carries the
|
|
1681
|
+
// member's answer rather than its wire envelope, the same way the judge
|
|
1682
|
+
// line already does. A member answering any other shape has no `text`
|
|
1683
|
+
// key and keeps its whole answer.
|
|
1684
|
+
answer: councilJudgeText(text),
|
|
1685
|
+
...verdict !== void 0 ? { verdict } : {},
|
|
1686
|
+
...failed ? { failed: { reason: pipelineFailureReason(run.receipt) } } : {}
|
|
1687
|
+
};
|
|
1688
|
+
});
|
|
1689
|
+
const finalMembers = members.filter((member) => member.round === council.rounds && member.failed === void 0);
|
|
1690
|
+
const finalReports = members.filter((member) => member.round === council.rounds);
|
|
1691
|
+
let synthesis = { kind: council.synthesis };
|
|
1692
|
+
if (council.synthesis === "vote") {
|
|
1693
|
+
const tally = {};
|
|
1694
|
+
for (const member of finalMembers)
|
|
1695
|
+
if (member.verdict !== void 0) tally[member.verdict] = (tally[member.verdict] ?? 0) + 1;
|
|
1696
|
+
const ranked = Object.entries(tally).sort((left, right) => right[1] - left[1] || left[0].localeCompare(right[0]));
|
|
1697
|
+
const winner = ranked[0];
|
|
1698
|
+
const verdict = winner === void 0 ? "no_verdict_field" : winner[1] > finalMembers.length / 2 ? winner[0] : "no_majority";
|
|
1699
|
+
synthesis = { kind: "vote", verdict, tally };
|
|
1700
|
+
} else if (council.synthesis === "judge") {
|
|
1701
|
+
const finalRuns = [...prior.values()];
|
|
1702
|
+
const judgeRequest = {
|
|
1703
|
+
agentId: council.judge?.agent ?? base.agentId,
|
|
1704
|
+
executionRole: "judge",
|
|
1705
|
+
task: `Synthesize the council answers for this task:
|
|
1706
|
+
|
|
1707
|
+
${base.task}`,
|
|
1708
|
+
briefing: boundedCouncilBriefing(
|
|
1709
|
+
finalReports.map(
|
|
1710
|
+
(member) => member.failed === void 0 ? `[${member.label}] ${member.answer}` : `[${member.label}] failed; no final answer contributed. Reason: ${member.failed.reason}`
|
|
1711
|
+
)
|
|
1712
|
+
),
|
|
1713
|
+
systemPrompt: COUNCIL_JUDGE_PROMPT,
|
|
1714
|
+
autonomy: "read-only",
|
|
1715
|
+
toolProfile: "council-read-only",
|
|
1716
|
+
gate: { role: "synthesis", group, cycle: council.rounds, subjects: finalRuns.map((run) => subjectRef(run.receipt)) },
|
|
1717
|
+
council: { group, label: "synthesis", round: council.rounds },
|
|
1718
|
+
...council.judge?.target ? { target: council.judge.target } : {},
|
|
1719
|
+
...council.judge?.model ? { model: council.judge.model } : {},
|
|
1720
|
+
...council.judge?.node ? { node: council.judge.node } : {},
|
|
1721
|
+
...base.plan ? { plan: base.plan } : {},
|
|
1722
|
+
...base.parentToolCallId ? { parentToolCallId: base.parentToolCallId } : {}
|
|
1723
|
+
};
|
|
1724
|
+
const pinned = council.resolvedTasks?.find((task) => task.role === "synthesis");
|
|
1725
|
+
const judgeRun = await runMember(
|
|
1726
|
+
withResolvedPlanTaskPin(judgeRequest, pinned, { pinTask: false, pinBriefing: false })
|
|
1727
|
+
);
|
|
1728
|
+
runs.push(judgeRun);
|
|
1729
|
+
const rawText = normalizedAssistantText(judgeRun.summary);
|
|
1730
|
+
const text = councilJudgeText(rawText);
|
|
1731
|
+
const verdict = councilVerdict(rawText);
|
|
1732
|
+
synthesis = {
|
|
1733
|
+
kind: "judge",
|
|
1734
|
+
text,
|
|
1735
|
+
...verdict !== void 0 ? { verdict } : {},
|
|
1736
|
+
judgeRunId: judgeRun.receipt.runId
|
|
1737
|
+
};
|
|
1738
|
+
}
|
|
1739
|
+
if (prior.size > 0 && deps.dispatch.sealCouncilSynthesis !== void 0) {
|
|
1740
|
+
const finalRuns = [...prior.values()];
|
|
1741
|
+
const template = finalRuns[0];
|
|
1742
|
+
if (template === void 0) throw new Error("council synthesis has no final member receipt");
|
|
1743
|
+
const text = JSON.stringify({ members, synthesis });
|
|
1744
|
+
const receipt = await deps.dispatch.sealCouncilSynthesis({
|
|
1745
|
+
group,
|
|
1746
|
+
round: council.rounds,
|
|
1747
|
+
kind: council.synthesis,
|
|
1748
|
+
text,
|
|
1749
|
+
subjects: finalRuns.map((run) => subjectRef(run.receipt)),
|
|
1750
|
+
template: template.receipt
|
|
1751
|
+
});
|
|
1752
|
+
runs.push(
|
|
1753
|
+
completeRun(deps, receipt, {
|
|
1754
|
+
count: 0,
|
|
1755
|
+
types: [],
|
|
1756
|
+
lastAssistantText: text,
|
|
1757
|
+
terminalAttemptRunId: receipt.runId
|
|
1758
|
+
})
|
|
1759
|
+
);
|
|
1760
|
+
}
|
|
1761
|
+
return { report: { members, synthesis }, runs, group };
|
|
1762
|
+
}
|
|
1763
|
+
function councilResult(deps, outcome) {
|
|
1764
|
+
const sections = outcome.report.members.filter((member) => member.round === Math.max(...outcome.report.members.map((entry) => entry.round))).map((member) => {
|
|
1765
|
+
const run = outcome.runs.find((entry) => entry.receipt.runId === member.runId);
|
|
1766
|
+
return `[${member.label}] ${run?.receipt.targetId ?? "unknown"}/${run?.receipt.wireModelId ?? "unknown"}
|
|
1767
|
+
${member.answer}`;
|
|
1768
|
+
});
|
|
1769
|
+
sections.push(
|
|
1770
|
+
`[synthesis] ${outcome.report.synthesis.kind}
|
|
1771
|
+
${outcome.report.synthesis.text ?? outcome.report.synthesis.verdict ?? "none"}`
|
|
1772
|
+
);
|
|
1773
|
+
const details = {
|
|
1774
|
+
...dispatchDetails(deps, "council", outcome.runs),
|
|
1775
|
+
council: { group: outcome.group, ...outcome.report }
|
|
1776
|
+
};
|
|
1777
|
+
const finalRound = Math.max(...outcome.report.members.map((member) => member.round));
|
|
1778
|
+
const failed = outcome.report.members.some((member) => member.round === finalRound && member.failed !== void 0) || outcome.runs.some((run) => run.receipt.gate?.role === "synthesis" && isPipelineStepFailure(run.receipt));
|
|
1779
|
+
return failed ? { kind: "error", message: sections.join("\n\n"), details } : { kind: "ok", output: sections.join("\n\n"), details };
|
|
1780
|
+
}
|
|
1549
1781
|
async function runDispatchTool(inputDeps, admissionState, args, options) {
|
|
1550
1782
|
const deps = {
|
|
1551
1783
|
...inputDeps,
|
|
@@ -1607,6 +1839,7 @@ async function runDispatchTool(inputDeps, admissionState, args, options) {
|
|
|
1607
1839
|
const maxOutputBytes = snapshot.maxOutputBytes;
|
|
1608
1840
|
const timeoutMs = snapshot.timeoutMs;
|
|
1609
1841
|
let review = snapshot.review === void 0 ? void 0 : structuredClone(snapshot.review);
|
|
1842
|
+
let council = snapshot.council === void 0 ? void 0 : structuredClone(snapshot.council);
|
|
1610
1843
|
const autonomy = deps.getAutonomy?.() ?? "auto-edit";
|
|
1611
1844
|
const authenticatedApproval = options?.approval?.actionClass === "dispatch" ? options.approval : void 0;
|
|
1612
1845
|
const trustedResolvedPlan = admissionState.trustedResolvedPlans.get(args) ?? null;
|
|
@@ -1625,7 +1858,7 @@ async function runDispatchTool(inputDeps, admissionState, args, options) {
|
|
|
1625
1858
|
};
|
|
1626
1859
|
}
|
|
1627
1860
|
if (resolvedPlan !== null) {
|
|
1628
|
-
const primaryRole = review !== void 0 ? "builder" : mode === "compete" ? "candidate" : "task";
|
|
1861
|
+
const primaryRole = review !== void 0 ? "builder" : mode === "compete" ? "candidate" : mode === "council" ? "member" : "task";
|
|
1629
1862
|
const primaryTasks = resolvedPlan.tasks.filter((task) => task.role === primaryRole);
|
|
1630
1863
|
const executionTasks = primaryRole === "task" ? primaryTasks : primaryTasks.slice(0, 1);
|
|
1631
1864
|
if (executionTasks.length !== requests.length) {
|
|
@@ -1659,6 +1892,7 @@ async function runDispatchTool(inputDeps, admissionState, args, options) {
|
|
|
1659
1892
|
resolvedTasks: resolvedPlan.tasks
|
|
1660
1893
|
};
|
|
1661
1894
|
}
|
|
1895
|
+
if (council !== void 0) council = { ...council, resolvedTasks: resolvedPlan.tasks };
|
|
1662
1896
|
}
|
|
1663
1897
|
if (planView.planScale) {
|
|
1664
1898
|
const plan = {
|
|
@@ -1680,7 +1914,7 @@ async function runDispatchTool(inputDeps, admissionState, args, options) {
|
|
|
1680
1914
|
};
|
|
1681
1915
|
requests = requests.map((request) => ({ ...request, plan }));
|
|
1682
1916
|
}
|
|
1683
|
-
const backgroundRefusal = resolvedPlan?.topology === "fleet" ? "a Scout dependency plan drives its stages from this turn" : mode === "compete" ? "compete holds its judge gate in this turn" : review !== void 0 ? "a review gate holds its cycle state in this turn" : mode === "pipeline" && requests.length > 1 ? "a pipeline threads each step's output through this turn" : timeoutMs !== void 0 ? `this call set timeout_ms=${timeoutMs} and nobody would be left to enforce the deadline` : deps.dispatch.detached === void 0 ? "detached batch records are unavailable in this context" : null;
|
|
1917
|
+
const backgroundRefusal = resolvedPlan?.topology === "fleet" ? "a Scout dependency plan drives its stages from this turn" : mode === "compete" ? "compete holds its judge gate in this turn" : mode === "council" ? "council holds its rounds and synthesis in this turn" : review !== void 0 ? "a review gate holds its cycle state in this turn" : mode === "pipeline" && requests.length > 1 ? "a pipeline threads each step's output through this turn" : timeoutMs !== void 0 ? `this call set timeout_ms=${timeoutMs} and nobody would be left to enforce the deadline` : deps.dispatch.detached === void 0 ? "detached batch records are unavailable in this context" : null;
|
|
1684
1918
|
const background = createBackgroundSwitch();
|
|
1685
1919
|
const backgroundLabel = resolvedPlan?.topology === "fleet" ? "fleet" : review !== void 0 ? "review" : mode;
|
|
1686
1920
|
const releaseBackground = registerBackgroundControl(deps, options?.toolCallId, {
|
|
@@ -1704,6 +1938,7 @@ async function runDispatchTool(inputDeps, admissionState, args, options) {
|
|
|
1704
1938
|
topology: executionPlan.topology,
|
|
1705
1939
|
rootTask: executionPlan.rootTask,
|
|
1706
1940
|
maxWorkers: executionPlan.maxWorkers,
|
|
1941
|
+
...executionPlan.writers === 1 ? { writers: 1 } : {},
|
|
1707
1942
|
onFailure: executionPlan.onFailure,
|
|
1708
1943
|
steps: requireAgentSteps(executionPlan.steps).map((step) => ({
|
|
1709
1944
|
...step,
|
|
@@ -1790,6 +2025,16 @@ async function runDispatchTool(inputDeps, admissionState, args, options) {
|
|
|
1790
2025
|
return { kind: "error", message: dispatchErrorMessage(err) };
|
|
1791
2026
|
}
|
|
1792
2027
|
}
|
|
2028
|
+
if (mode === "council") {
|
|
2029
|
+
if (requests.length !== 1 || requests[0] === void 0 || council === void 0) {
|
|
2030
|
+
return { kind: "error", message: "dispatch: trusted council settings are unavailable" };
|
|
2031
|
+
}
|
|
2032
|
+
try {
|
|
2033
|
+
return councilResult(deps, await runCouncil(deps, requests[0], council, timeoutMs, options?.signal));
|
|
2034
|
+
} catch (err) {
|
|
2035
|
+
return { kind: "error", message: dispatchErrorMessage(err) };
|
|
2036
|
+
}
|
|
2037
|
+
}
|
|
1793
2038
|
if (review !== void 0) {
|
|
1794
2039
|
if (requests.length !== 1 || requests[0] === void 0) {
|
|
1795
2040
|
return { kind: "error", message: REVIEW_SINGLE_TASK_MESSAGE };
|
|
@@ -1812,7 +2057,7 @@ async function runDispatchTool(inputDeps, admissionState, args, options) {
|
|
|
1812
2057
|
} else if (mode === "sequential" || mode === "pipeline" || requests.length === 1) {
|
|
1813
2058
|
runs = await runSequential(deps, requests, mode, timeoutMs, options?.signal, background);
|
|
1814
2059
|
} else {
|
|
1815
|
-
const batch = await runBatch(deps, requests, timeoutMs, options?.signal, background);
|
|
2060
|
+
const batch = snapshot.writers === 1 ? await runWriterLimitedBatch(deps, requests, timeoutMs, options?.signal) : await runBatch(deps, requests, timeoutMs, options?.signal, background);
|
|
1816
2061
|
runs = batch.runs;
|
|
1817
2062
|
board = batch.board;
|
|
1818
2063
|
}
|
|
@@ -2006,7 +2251,50 @@ async function runBatch(deps, requests, timeoutMs, signal, background) {
|
|
|
2006
2251
|
if (!backgrounded) await closeAgentLedger(ledgerId);
|
|
2007
2252
|
}
|
|
2008
2253
|
}
|
|
2254
|
+
async function runWriterLimitedBatch(deps, requests, timeoutMs, signal) {
|
|
2255
|
+
const specs = new Map(deps.getAgentSpecs().map((spec) => [spec.id, spec]));
|
|
2256
|
+
const readers = requests.filter((request) => specs.get(request.agentId)?.capabilityClass === "read-only");
|
|
2257
|
+
const writers = requests.filter((request) => specs.get(request.agentId)?.capabilityClass !== "read-only");
|
|
2258
|
+
const ledgerId = newGateGroupId("ledger");
|
|
2259
|
+
await openAgentLedger(ledgerId);
|
|
2260
|
+
const activeIds = /* @__PURE__ */ new Set();
|
|
2261
|
+
const completed = /* @__PURE__ */ new Map();
|
|
2262
|
+
const start = async (request) => {
|
|
2263
|
+
const ledgered = { ...request, ledger: { id: ledgerId, sequence: 0 } };
|
|
2264
|
+
const handle = await deps.dispatch.dispatch(ledgered);
|
|
2265
|
+
activeIds.add(handle.runId);
|
|
2266
|
+
const registered = deps.runEvents.registerSingle(handle, request.agentId, fallbackProgressBus(deps));
|
|
2267
|
+
const value = await registered.completion;
|
|
2268
|
+
activeIds.delete(handle.runId);
|
|
2269
|
+
const run = completeRun(deps, value.receipt, value.summary);
|
|
2270
|
+
completed.set(request, run);
|
|
2271
|
+
return run;
|
|
2272
|
+
};
|
|
2273
|
+
const abort = (bySignal) => {
|
|
2274
|
+
const reason = bySignal ? void 0 : { cause: "timeout", detail: `timed out after ${timeoutMs}ms` };
|
|
2275
|
+
for (const runId of activeIds) deps.dispatch.abort(runId, reason);
|
|
2276
|
+
};
|
|
2277
|
+
const onSignalAbort = () => abort(true);
|
|
2278
|
+
const timer = timeoutMs === void 0 ? null : setTimeout(() => abort(false), timeoutMs);
|
|
2279
|
+
signal?.addEventListener("abort", onSignalAbort, { once: true });
|
|
2280
|
+
try {
|
|
2281
|
+
const readerPromises = readers.map((request) => start(request));
|
|
2282
|
+
for (const writer of writers) await start(writer);
|
|
2283
|
+
await Promise.all(readerPromises);
|
|
2284
|
+
return {
|
|
2285
|
+
runs: requests.flatMap((request) => {
|
|
2286
|
+
const run = completed.get(request);
|
|
2287
|
+
return run === void 0 ? [] : [run];
|
|
2288
|
+
}),
|
|
2289
|
+
board: renderAgentLedgerBoard(ledgerId)
|
|
2290
|
+
};
|
|
2291
|
+
} finally {
|
|
2292
|
+
if (timer !== null) clearTimeout(timer);
|
|
2293
|
+
signal?.removeEventListener("abort", onSignalAbort);
|
|
2294
|
+
await closeAgentLedger(ledgerId);
|
|
2295
|
+
}
|
|
2296
|
+
}
|
|
2009
2297
|
export {
|
|
2010
2298
|
runDispatchTool
|
|
2011
2299
|
};
|
|
2012
|
-
//# sourceMappingURL=dispatch-runner-
|
|
2300
|
+
//# sourceMappingURL=dispatch-runner-22ZCNOM3.js.map
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { createRequire as __clioCreateRequire } from "node:module"; const require = __clioCreateRequire(import.meta.url);
|
|
2
|
-
import "./chunk-
|
|
2
|
+
import "./chunk-IFBNV6H6.js";
|
|
3
3
|
import {
|
|
4
4
|
printError,
|
|
5
5
|
printHeader
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-XK56QHLX.js";
|
|
7
7
|
import {
|
|
8
8
|
source_default
|
|
9
9
|
} from "./chunk-5TSRNF4G.js";
|
|
10
|
-
import
|
|
10
|
+
import {
|
|
11
|
+
resolvePackageRoot
|
|
12
|
+
} from "./chunk-IWHMRKLL.js";
|
|
13
|
+
import "./chunk-EQ63NRB7.js";
|
|
14
|
+
import "./chunk-SST6Z5JA.js";
|
|
11
15
|
import "./chunk-IKCO5N3L.js";
|
|
12
16
|
import "./chunk-3I7MS7N2.js";
|
|
13
|
-
import "./chunk-SST6Z5JA.js";
|
|
14
17
|
import "./chunk-APJ265NV.js";
|
|
15
|
-
import "./chunk-YXLYO42X.js";
|
|
16
18
|
import "./chunk-BNAZZHFG.js";
|
|
17
19
|
import "./chunk-WEPFGWHJ.js";
|
|
18
|
-
import
|
|
19
|
-
resolvePackageRoot
|
|
20
|
-
} from "./chunk-IWHMRKLL.js";
|
|
20
|
+
import "./chunk-YXLYO42X.js";
|
|
21
21
|
import {
|
|
22
22
|
init_esm_shims
|
|
23
23
|
} from "./chunk-3R73A4XB.js";
|
|
@@ -296,4 +296,4 @@ export {
|
|
|
296
296
|
synthesizeMenu,
|
|
297
297
|
topicToFile
|
|
298
298
|
};
|
|
299
|
-
//# sourceMappingURL=docs-
|
|
299
|
+
//# sourceMappingURL=docs-7LQ23DLM.js.map
|