@iowarp/clio-coder 0.4.1 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +92 -0
- package/CONTRIBUTING.md +59 -36
- package/README.md +404 -472
- package/SECURITY.md +2 -1
- package/dist/{acp-ZILU3AUO.js → acp-TMDQZDIG.js} +7 -7
- package/dist/{agents-HYWGBGQR.js → agents-5N5NG3XG.js} +28 -28
- package/dist/assets/codewiki.json +1 -1
- package/dist/{auth-N3QT7CBO.js → auth-Z5CCBXKQ.js} +8 -9
- package/dist/{builtins-UJLMOVOV.js → builtins-K6TNDT24.js} +4 -4
- package/dist/{chunk-GVQJ5CCZ.js → chunk-2HFQNRV3.js} +7 -7
- package/dist/{chunk-QMXC4JB7.js → chunk-2NHR3NAY.js} +163 -1401
- package/dist/chunk-2X4RYJTJ.js +39 -0
- package/dist/{chunk-Y45G3AXC.js → chunk-2Z2IKEXI.js} +6 -10
- package/dist/{chunk-EIMVLWB3.js → chunk-34BHNEE3.js} +7 -3
- package/dist/{chunk-GIZNH63R.js → chunk-35MSIRKH.js} +9 -4
- package/dist/chunk-3EBYEESD.js +314 -0
- package/dist/{chunk-CTJ4RNAA.js → chunk-3F7VUY77.js} +2 -2
- package/dist/{chunk-AP73CFDC.js → chunk-3KIPBMUA.js} +2 -2
- package/dist/{chunk-J5LZHVIT.js → chunk-3M6DQK6S.js} +113 -35
- package/dist/{chunk-VEGN6WIQ.js → chunk-462T4EGZ.js} +2 -2
- package/dist/{chunk-AFKWHWXF.js → chunk-4JDLP6ZS.js} +33 -16
- package/dist/{chunk-6FN3E6KX.js → chunk-4O6MANBS.js} +2 -2
- package/dist/{chunk-AKB4GYDL.js → chunk-54ODD65L.js} +5 -5
- package/dist/{chunk-BBTJOK6Y.js → chunk-5KW52TEP.js} +3 -3
- package/dist/{chunk-6CCS4G3W.js → chunk-5PFYMY2V.js} +2 -2
- package/dist/chunk-77QIVUZB.js +1334 -0
- package/dist/{chunk-7OBGU7UB.js → chunk-7BHIY2MW.js} +7 -13
- package/dist/{chunk-3QSOM6PA.js → chunk-AZ4WMN4W.js} +2 -2
- package/dist/{chunk-6NJQITNH.js → chunk-B74PXLU7.js} +6 -3
- package/dist/{chunk-R23Z6K6I.js → chunk-B7HM5Z7T.js} +15 -15
- package/dist/{chunk-R32CLGZ6.js → chunk-BO7Y52RY.js} +81 -20
- package/dist/{chunk-UEDMSP56.js → chunk-BYMNWQ7O.js} +123 -148
- package/dist/{chunk-ZJLUDYFY.js → chunk-CRFOIAX3.js} +4 -4
- package/dist/{chunk-2NM363SV.js → chunk-CYZW7JHJ.js} +7 -7
- package/dist/{chunk-6HMJX2VU.js → chunk-DYHAXKHD.js} +38 -10
- package/dist/{chunk-THYWACCR.js → chunk-DZAW46HP.js} +3 -3
- package/dist/{chunk-FYUN5KZ3.js → chunk-DZEK6CJN.js} +17 -17
- package/dist/{chunk-3I5NY75V.js → chunk-E7GT7O5N.js} +5 -5
- package/dist/{chunk-VKFQTNDV.js → chunk-F2I26BDK.js} +4 -4
- package/dist/{chunk-HLW2MRKE.js → chunk-F4EKGO4N.js} +3 -1
- package/dist/{chunk-IXJT6DCX.js → chunk-FVDGR2ZL.js} +3 -3
- package/dist/{chunk-TZSKNMZG.js → chunk-GTUD2WMY.js} +2 -1
- package/dist/{chunk-7EPLI7VL.js → chunk-HIICAHCJ.js} +2 -2
- package/dist/{chunk-E67WX76H.js → chunk-HKMD33FO.js} +29 -80
- package/dist/chunk-HLAFFSEK.js +360 -0
- package/dist/{chunk-UAPGZHYC.js → chunk-I64IFBLB.js} +9 -2
- package/dist/{chunk-XKA2ICR3.js → chunk-I66ZTYNP.js} +440 -175
- package/dist/{chunk-7PWAODYW.js → chunk-I7XBWTYH.js} +2 -2
- package/dist/{chunk-PVAMAVBB.js → chunk-IDNA72AH.js} +102 -2
- package/dist/{chunk-GCSMB2KY.js → chunk-IKOZFYBN.js} +1 -1
- package/dist/{chunk-2VG7KLYV.js → chunk-IKSLQ4XV.js} +5460 -3241
- package/dist/{chunk-QKIFBZKT.js → chunk-IMXMHHMQ.js} +166 -25
- package/dist/{chunk-74YWRRU5.js → chunk-JBCS7CRR.js} +2 -2
- package/dist/{chunk-BDPT6GTK.js → chunk-JWJGP5DQ.js} +2 -2
- package/dist/{chunk-K6BF4U2H.js → chunk-KKOJXO6R.js} +62 -14
- package/dist/chunk-KPXDY6QF.js +47 -0
- package/dist/{chunk-ABLSQ6JX.js → chunk-LJID3DYZ.js} +7 -1
- package/dist/{chunk-VKRH2TCS.js → chunk-M2DAX4F6.js} +2 -2
- package/dist/{chunk-6I5ILFOF.js → chunk-M2WXEHER.js} +2 -2
- package/dist/{chunk-YPI3QQCF.js → chunk-MCEPRMZW.js} +2 -4
- package/dist/{chunk-N5UK64DP.js → chunk-MCMZMDAC.js} +2 -2
- package/dist/{chunk-Y4CAGMM6.js → chunk-MNJGS2IN.js} +5 -6
- package/dist/{chunk-TVHHYFHE.js → chunk-NEDJ26B5.js} +2 -2
- package/dist/{chunk-U2WB7TZS.js → chunk-NMJXSHBJ.js} +97 -85
- package/dist/{chunk-HUAS7ITX.js → chunk-O3YUNJZ2.js} +13 -21
- package/dist/{chunk-MA3H6DM5.js → chunk-P75RZCJW.js} +25 -3
- package/dist/{chunk-IG7BCQBA.js → chunk-PGF63K6I.js} +2 -2
- package/dist/chunk-PJX3WQUQ.js +42 -0
- package/dist/{chunk-6DWBAZ5U.js → chunk-Q4XWMHX6.js} +4 -6
- package/dist/{chunk-OJTRZGR3.js → chunk-QQLGQY2A.js} +8 -8
- package/dist/{chunk-J4HBWF6Y.js → chunk-RLYRBIYQ.js} +115 -20
- package/dist/{chunk-NLFAQR7Z.js → chunk-S66XZJOF.js} +3 -23
- package/dist/{chunk-C537JADH.js → chunk-SSEYRH53.js} +6 -7
- package/dist/chunk-SZAA6XDG.js +30 -0
- package/dist/{chunk-MOPSG2X7.js → chunk-TPEQIQIE.js} +6 -6
- package/dist/{chunk-JA5QWE4Z.js → chunk-UBRFI4HS.js} +1879 -1650
- package/dist/{chunk-BTGG6BG2.js → chunk-UH347SHR.js} +154 -15
- package/dist/{chunk-5YHDIDBP.js → chunk-UH632ZYL.js} +2 -2
- package/dist/{chunk-BWW4HLO4.js → chunk-UXCU4E3T.js} +8 -6
- package/dist/{chunk-6VC4OV3Z.js → chunk-VIA6RFQZ.js} +3 -11
- package/dist/{chunk-ZAZB4JMW.js → chunk-VKPAQYEB.js} +27 -8
- package/dist/{chunk-UXN6JT4W.js → chunk-W4YEMFBX.js} +2 -2
- package/dist/{chunk-TD3PGPQA.js → chunk-W6NIE6OW.js} +2 -2
- package/dist/{chunk-TVH4ONAM.js → chunk-X7IARSHT.js} +3 -3
- package/dist/{chunk-PJJ6MY27.js → chunk-XE3PCIXH.js} +3 -3
- package/dist/{chunk-FEFIFZTL.js → chunk-XGDPUNND.js} +2 -2
- package/dist/{chunk-SCYB3HA4.js → chunk-XOXV5GKE.js} +51 -16
- package/dist/{chunk-QTFGO774.js → chunk-XQRY4DTA.js} +24 -11
- package/dist/{chunk-BJGUKIG4.js → chunk-YJISEZKC.js} +2 -2
- package/dist/{chunk-GPPB3JBE.js → chunk-ZGNYYXQ6.js} +2 -2
- package/dist/{chunk-SINK3QR6.js → chunk-ZNT2M6TG.js} +7 -7
- package/dist/{chunk-7RY5VZPH.js → chunk-ZW4HH5JJ.js} +6 -6
- package/dist/cli/index.js +33 -32
- package/dist/{clio-IT3G3VQH.js → clio-7VB377CC.js} +7 -7
- package/dist/{code-nav-RK6S7F6E.js → code-nav-YVLCYA7V.js} +85 -17
- package/dist/{config-3QZRWZJF.js → config-4HVOS65E.js} +88 -43
- package/dist/{configure-FL7Y3KJF.js → configure-PIWO7B24.js} +10 -10
- package/dist/{context-5HE7ODYK.js → context-IYEHL3WQ.js} +33 -31
- package/dist/{context-XNHL75JV.js → context-KQYIWPWT.js} +47 -34
- package/dist/{context-KYQFRVDC.js → context-N6ZE3LGJ.js} +11 -11
- package/dist/{context-clear-N545L53A.js → context-clear-G4OGZJDS.js} +33 -31
- package/dist/{context-working-set-QHKXSV2F.js → context-working-set-BWLF6LJP.js} +7 -7
- package/dist/{dispatch-runner-RGIE5PCT.js → dispatch-runner-2QQAITS3.js} +38 -38
- package/dist/{docs-5NAF6AU7.js → docs-PD3EXDKU.js} +21 -20
- package/dist/{doctor-ZGPEGHIP.js → doctor-LHBD36VU.js} +23 -22
- package/dist/{eval-GXLL44RD.js → eval-C45FYRJ6.js} +21 -20
- package/dist/{eval-inventory-HBWSWQOK.js → eval-inventory-6DEJPLBF.js} +2 -2
- package/dist/{evidence-HWLBRH3Q.js → evidence-6SHONYAF.js} +30 -28
- package/dist/{evolve-FTZBMNVW.js → evolve-KRKMV72X.js} +30 -28
- package/dist/{extensions-VHRBEID7.js → extensions-KPZ2UHBB.js} +5 -3
- package/dist/{fleet-CKZHJWZJ.js → fleet-IVTCKDHT.js} +62 -61
- package/dist/{fleet-commands-EXDXBMV6.js → fleet-commands-EDWL3IT7.js} +5 -5
- package/dist/{fleet-decisions-OTHB6KRL.js → fleet-decisions-YP3YEFGK.js} +4 -4
- package/dist/{fleet-graph-YTEZUCUT.js → fleet-graph-ZFWKHY2M.js} +16 -14
- package/dist/{fleet-inspect-SS6YMDCK.js → fleet-inspect-FVUNCBML.js} +31 -29
- package/dist/{fleet-preflight-PBY4VYOM.js → fleet-preflight-UN5XED4R.js} +2 -2
- package/dist/{fleet-validate-KMEM5L3S.js → fleet-validate-XOWC4HSX.js} +17 -15
- package/dist/{fleet-verify-QD5M7E7Q.js → fleet-verify-UN3SODEL.js} +30 -28
- package/dist/{fleet-view-WAMJYNDT.js → fleet-view-TWHJKCN6.js} +31 -29
- package/dist/{init-5XQRBOFV.js → init-T2QORQ3Y.js} +50 -49
- package/dist/{interop-34TVO25M.js → interop-IN5I2A66.js} +5 -5
- package/dist/{library-3QY6KF57.js → library-LSCATDLZ.js} +15 -13
- package/dist/{memory-L4UTIIIW.js → memory-HYOKAGGJ.js} +31 -29
- package/dist/{models-ZVX3QOWE.js → models-2GPMFYCM.js} +22 -21
- package/dist/{monitor-CEKVSYTS.js → monitor-E4ASVUJH.js} +34 -32
- package/dist/{orchestrator-77BAP6BC.js → orchestrator-DDMPR3PY.js} +984 -583
- package/dist/{panes-7STHOAUJ.js → panes-E3RUXOW5.js} +4 -4
- package/dist/{panes-SHAUIRXY.js → panes-IXKLOKA2.js} +23 -8
- package/dist/{reset-EOLM7GVE.js → reset-OAQP3W4O.js} +4 -4
- package/dist/{resources-74GKTLSF.js → resources-OTRSN34L.js} +15 -13
- package/dist/{run-HBAUJNNZ.js → run-5DEYH5QK.js} +60 -59
- package/dist/{share-G3APVLVP.js → share-IHWTLO3M.js} +19 -15
- package/dist/{skills-35HHUKCR.js → skills-IYMXMKW4.js} +17 -15
- package/dist/{skills-eval-QN4HSHDC.js → skills-eval-DROHSJAR.js} +36 -36
- package/dist/{skills-inventory-J357J34F.js → skills-inventory-D7X4L4ZX.js} +15 -13
- package/dist/{slash-commands-JZZCQA32.js → slash-commands-QBM7UZ3B.js} +21 -18
- package/dist/{steer-XAVHJM22.js → steer-Z5DO23FJ.js} +2 -2
- package/dist/{targets-DSM6CY3M.js → targets-P2FUC4IL.js} +25 -28
- package/dist/{terminal-lease-JOPFUVEM.js → terminal-lease-YREJ3JX2.js} +5 -5
- package/dist/{tools-MKNWVPBH.js → tools-5B7RO6MV.js} +4 -4
- package/dist/{trace-ECQ7TIYZ.js → trace-YMGMUM6A.js} +55 -7
- package/dist/{upgrade-H7TOM7YL.js → upgrade-PXK3S2YM.js} +11 -9
- package/dist/{usage-X52N3IDJ.js → usage-ME5MPXGX.js} +36 -34
- package/dist/{verifiers-EJTVVSMA.js → verifiers-BVZ7IWOO.js} +5 -5
- package/dist/{verify-YJL6XET2.js → verify-5K7ZKQFC.js} +4 -4
- package/dist/{web-fetch-MPIFL3LL.js → web-fetch-MPARV2K7.js} +2 -2
- package/dist/{wiki-generate-4NDZTQ4B.js → wiki-generate-F5W5QTYY.js} +48 -47
- package/dist/{with-panes-OBOBFIIR.js → with-panes-BYOJCLAM.js} +51 -255
- package/dist/worker/entry.js +45 -30
- package/docs/README.md +176 -81
- package/docs/{acp.md → architecture/acp.md} +36 -20
- package/docs/{alcf-provider.md → architecture/alcf-provider.md} +8 -5
- package/docs/{architecture.md → architecture/architecture.md} +43 -22
- package/docs/{artifact-placement.md → architecture/artifact-placement.md} +26 -23
- package/docs/architecture/artifact-versions.md +90 -0
- package/docs/{capacity-and-scheduling.md → architecture/capacity-and-scheduling.md} +26 -13
- package/docs/{context-engine.md → architecture/context-engine.md} +25 -25
- package/docs/{context-working-set.md → architecture/context-working-set.md} +13 -10
- package/docs/{dispatch-architecture-rationale.md → architecture/dispatch-architecture-rationale.md} +12 -9
- package/docs/{dispatch-typed-intent.md → architecture/dispatch-typed-intent.md} +68 -46
- package/docs/{evidence-and-memory.md → architecture/evidence-and-memory.md} +23 -16
- package/docs/{middleware-and-components.md → architecture/middleware-and-components.md} +11 -5
- package/docs/{model-catalog.md → architecture/model-catalog.md} +40 -17
- package/docs/{observability.md → architecture/observability.md} +26 -13
- package/docs/{pi-boundary.md → architecture/pi-boundary.md} +24 -11
- package/docs/{prompt-envelope-and-tools.md → architecture/prompt-envelope-and-tools.md} +55 -20
- package/docs/{provider-adapter-cookbook.md → architecture/provider-adapter-cookbook.md} +35 -24
- package/docs/{safety-model.md → architecture/safety-model.md} +20 -15
- package/docs/{session-lifecycle.md → architecture/session-lifecycle.md} +8 -5
- package/docs/architecture/time-conventions.md +125 -0
- package/docs/{trace-store.md → architecture/trace-store.md} +13 -5
- package/docs/{tui-design.md → architecture/tui-design.md} +13 -13
- package/docs/{worker-dispatch-mechanics.md → architecture/worker-dispatch-mechanics.md} +27 -30
- package/docs/{built-in-agents.md → guide/built-in-agents.md} +50 -34
- package/docs/{commands-and-modes.md → guide/commands-and-modes.md} +65 -60
- package/docs/{configuration-and-targets.md → guide/configuration-and-targets.md} +227 -289
- package/docs/guide/configuration-reference.md +1158 -0
- package/docs/{environment-variables.md → guide/environment-variables.md} +31 -28
- package/docs/{exit-codes-and-output.md → guide/exit-codes-and-output.md} +6 -3
- package/docs/{extensions-and-sharing.md → guide/extensions-and-sharing.md} +41 -14
- package/docs/{fleet-dispatch.md → guide/fleet-dispatch.md} +39 -43
- package/docs/{glossary.md → guide/glossary.md} +14 -11
- package/docs/{installation-and-lifecycle.md → guide/installation-and-lifecycle.md} +44 -13
- package/docs/guide/panes-and-files.md +290 -0
- package/docs/{proactive-memory.md → guide/proactive-memory.md} +79 -66
- package/docs/{resource-library.md → guide/resource-library.md} +13 -4
- package/docs/{skills-marketplace.md → guide/skills-marketplace.md} +7 -3
- package/docs/{tool-usage.md → guide/tool-usage.md} +87 -23
- package/docs/{troubleshooting.md → guide/troubleshooting.md} +9 -4
- package/docs/{config-knobs-audit.md → history/config-knobs-audit.md} +11 -11
- package/docs/{release-cut-checklist.md → history/release-cut-checklist.md} +29 -2
- package/docs/{development-pipeline.md → process/development-pipeline.md} +24 -26
- package/docs/process/documentation-coverage.md +100 -0
- package/docs/process/documentation-guide.md +187 -0
- package/docs/{eval-runner.md → process/eval-runner.md} +41 -50
- package/docs/{evals-internal.md → process/evals-internal.md} +10 -10
- package/docs/{evolution.md → process/evolution.md} +2 -2
- package/docs/{fleet-demo-runbook.md → process/fleet-demo-runbook.md} +11 -7
- package/docs/{git-commit-provenance.md → process/git-commit-provenance.md} +11 -4
- package/docs/{performance-methodology.md → process/performance-methodology.md} +87 -69
- package/docs/{scientific-validation.md → process/scientific-validation.md} +4 -4
- package/evals/README.md +2 -2
- package/package.json +9 -7
- package/skills/README.md +46 -37
- package/skills/coding/ast-grep/SKILL.md +2 -2
- package/skills/coding/coding-standards/SKILL.md +2 -2
- package/skills/coding/prototype/SKILL.md +2 -2
- package/skills/coding/tdd/SKILL.md +2 -2
- package/skills/context/context-handoff/SKILL.md +2 -2
- package/skills/context/context-prime/SKILL.md +2 -2
- package/skills/git/file-ticket/SKILL.md +2 -2
- package/skills/git/fix-issue/SKILL.md +3 -3
- package/skills/git/resolve-merge-conflicts/SKILL.md +2 -2
- package/skills/git/ship/SKILL.md +2 -2
- package/skills/git/worktree-create/SKILL.md +2 -2
- package/skills/git/worktree-merge/SKILL.md +2 -2
- package/skills/meta/clio-coder-dev/SKILL.md +9 -5
- package/skills/meta/clio-coder-dev/evals.md +3 -2
- package/skills/meta/clio-coder-test/SKILL.md +102 -95
- package/skills/meta/clio-coder-test/evals.md +9 -4
- package/skills/meta/clio-coder-test/references/harness.md +100 -124
- package/skills/meta/clio-coder-test/references/test-map.md +77 -50
- package/skills/meta/credentials/SKILL.md +2 -2
- package/skills/meta/find-skills/SKILL.md +2 -2
- package/skills/meta/herdr/SKILL.md +2 -2
- package/skills/meta/skill-craft/SKILL.md +22 -16
- package/skills/planning/architecture/SKILL.md +2 -2
- package/skills/planning/backlog/SKILL.md +2 -2
- package/skills/planning/prd/SKILL.md +2 -2
- package/skills/planning/product-intent/SKILL.md +2 -2
- package/skills/planning/tech-spec/SKILL.md +2 -2
- package/skills/registry.yaml +62 -62
- package/skills/research/arxiv-literature/SKILL.md +2 -2
- package/skills/research/experiment-protocol/SKILL.md +2 -2
- package/skills/research/scientific-debugging/SKILL.md +2 -2
- package/skills/research/scientific-modernization/SKILL.md +2 -2
- package/skills/skill-marketplace.json +62 -62
- package/skills/workflow/cut-it/SKILL.md +2 -2
- package/skills/workflow/design-council/SKILL.md +2 -2
- package/skills/workflow/grill-me/SKILL.md +2 -2
- package/skills/workflow/workflow-distiller/SKILL.md +2 -2
- package/src/cli/args.ts +2 -2
- package/src/cli/bootstrap-generate.ts +1 -1
- package/src/cli/config-inspect.ts +65 -12
- package/src/cli/configure.ts +0 -4
- package/src/cli/docs.ts +22 -14
- package/src/cli/doctor-naming.ts +5 -5
- package/src/cli/doctor-toolchain.ts +3 -3
- package/src/cli/eval.ts +1 -2
- package/src/cli/extensions.ts +2 -1
- package/src/cli/fleet.ts +1 -1
- package/src/cli/index.ts +2 -1
- package/src/cli/internal-dispatch.ts +3 -4
- package/src/cli/panes.ts +19 -5
- package/src/cli/run.ts +2 -2
- package/src/cli/share.ts +5 -1
- package/src/cli/skills-eval.ts +3 -3
- package/src/cli/targets.ts +2 -6
- package/src/cli/trace.ts +55 -4
- package/src/cli/wiki-generate.ts +1 -1
- package/src/core/artifact-paths.ts +1 -1
- package/src/core/bash-exec.ts +131 -86
- package/src/core/bus-events.ts +51 -6
- package/src/core/config.ts +5 -1
- package/src/core/defaults.ts +7 -4
- package/src/core/dispatch-outcome.ts +16 -0
- package/src/core/guardrails.ts +10 -49
- package/src/core/prompt-hint.ts +9 -0
- package/src/domains/agents/builtins/architect.md +2 -3
- package/src/domains/agents/builtins/coder.md +3 -2
- package/src/domains/agents/builtins/debugger.md +2 -2
- package/src/domains/agents/builtins/documenter.md +2 -2
- package/src/domains/agents/builtins/git-master.md +1 -1
- package/src/domains/agents/builtins/oracle.md +1 -1
- package/src/domains/agents/builtins/provenance.md +1 -1
- package/src/domains/agents/builtins/researcher.md +1 -1
- package/src/domains/agents/builtins/scout.md +1 -1
- package/src/domains/agents/builtins/tester.md +2 -2
- package/src/domains/agents/builtins/verifier.md +2 -2
- package/src/domains/agents/builtins/wiki-writer.md +1 -1
- package/src/domains/agents/catalog.ts +12 -14
- package/src/domains/agents/contract.ts +2 -0
- package/src/domains/agents/extension.ts +23 -1
- package/src/domains/config/keybindings.ts +8 -0
- package/src/domains/context/extension.ts +0 -3
- package/src/domains/context/working-set/path-index.ts +1 -0
- package/src/domains/dispatch/capability-match.ts +10 -0
- package/src/domains/dispatch/extension.ts +105 -22
- package/src/domains/dispatch/host-verification.ts +435 -39
- package/src/domains/dispatch/intent-requirements.ts +10 -0
- package/src/domains/dispatch/intent.ts +18 -1
- package/src/domains/dispatch/path-scope.ts +235 -24
- package/src/domains/dispatch/run-event-journal.ts +4 -15
- package/src/domains/dispatch/state.ts +2 -3
- package/src/domains/dispatch/transport.ts +45 -21
- package/src/domains/dispatch/types.ts +55 -3
- package/src/domains/eval/artifacts/store.ts +5 -0
- package/src/domains/eval/store.ts +8 -1
- package/src/domains/evidence/trust-status.ts +10 -1
- package/src/domains/extensions/contract.ts +15 -1
- package/src/domains/extensions/discovery.ts +238 -41
- package/src/domains/extensions/extension.ts +105 -6
- package/src/domains/extensions/index.ts +24 -0
- package/src/domains/extensions/integrity.ts +189 -0
- package/src/domains/extensions/manager.ts +17 -1
- package/src/domains/extensions/resource-path.ts +27 -0
- package/src/domains/extensions/resources.ts +18 -38
- package/src/domains/extensions/snapshot-store.ts +39 -0
- package/src/domains/extensions/snapshot.ts +180 -0
- package/src/domains/extensions/state.ts +385 -57
- package/src/domains/extensions/types.ts +118 -1
- package/src/domains/lifecycle/migrations/2026-09-01-extension-install-digests.ts +27 -0
- package/src/domains/lifecycle/migrations/index.ts +2 -0
- package/src/domains/lifecycle/naming-resources.ts +19 -4
- package/src/domains/lifecycle/naming-yazi.ts +10 -5
- package/src/domains/middleware/contract.ts +26 -0
- package/src/domains/middleware/extension.ts +24 -24
- package/src/domains/middleware/hook-receipts.ts +27 -4
- package/src/domains/middleware/hooks-io.ts +65 -32
- package/src/domains/middleware/hooks.ts +64 -0
- package/src/domains/middleware/index.ts +28 -4
- package/src/domains/middleware/registrations.ts +326 -0
- package/src/domains/middleware/runtime.ts +28 -0
- package/src/domains/middleware/snapshot.ts +20 -7
- package/src/domains/mux/contract.ts +38 -0
- package/src/domains/mux/detect.ts +6 -13
- package/src/domains/mux/index.ts +1 -1
- package/src/domains/mux/operations.ts +44 -5
- package/src/domains/mux/yazi/assets/yazi.toml +2 -2
- package/src/domains/mux/yazi/session.ts +53 -4
- package/src/domains/mux/yazi/theme.ts +117 -17
- package/src/domains/observability/contract.ts +10 -11
- package/src/domains/observability/extension.ts +11 -3
- package/src/domains/observability/projection.ts +14 -90
- package/src/domains/observability/trace-store.ts +43 -7
- package/src/domains/prompts/compiler.ts +73 -53
- package/src/domains/prompts/contract.ts +15 -3
- package/src/domains/prompts/extension.ts +97 -9
- package/src/domains/prompts/fragments/identity/clio-worker.md +1 -3
- package/src/domains/prompts/fragments/identity/clio.md +6 -12
- package/src/domains/prompts/fragments/identity/docs-routing.md +1 -2
- package/src/domains/prompts/fragments/identity/self-awareness.md +3 -11
- package/src/domains/prompts/fragments/operating/contract.md +7 -15
- package/src/domains/prompts/fragments/operating/delegation.md +32 -34
- package/src/domains/prompts/fragments/operating/skills.md +10 -24
- package/src/domains/prompts/fragments/operating/worker.md +1 -8
- package/src/domains/providers/index.ts +1 -1
- package/src/domains/providers/model-runtime-capabilities.ts +85 -21
- package/src/domains/providers/models/local-models/clio-coder-local-coding-targets.yaml +669 -104
- package/src/domains/providers/runtime-resolution.ts +31 -0
- package/src/domains/providers/runtimes/common/probe-helpers.ts +7 -2
- package/src/domains/providers/runtimes/local-native/llamacpp.ts +9 -1
- package/src/domains/providers/types/cost-provenance.ts +19 -0
- package/src/domains/providers/types/local-model-quirks.ts +85 -37
- package/src/domains/resources/skills/loader.ts +16 -19
- package/src/domains/safety/call-target.ts +1 -1
- package/src/domains/safety/loop-detector.ts +7 -4
- package/src/domains/session/task-board.ts +10 -9
- package/src/domains/share/archive.ts +164 -7
- package/src/engine/acp/server.ts +62 -9
- package/src/engine/apis/llamacpp-residency.ts +3 -4
- package/src/engine/apis/lmstudio.ts +3 -3
- package/src/engine/apis/ollama-native.ts +6 -6
- package/src/engine/apis/openai-completions.ts +28 -25
- package/src/engine/apis/output-budget.ts +8 -18
- package/src/engine/apis/residency.ts +8 -27
- package/src/engine/gemma-channel-filter.ts +19 -0
- package/src/engine/loop-guard.ts +92 -12
- package/src/engine/worker-runtime.ts +40 -11
- package/src/engine/worker-tools.ts +3 -1
- package/src/entry/extension-hook-sources.ts +28 -0
- package/src/entry/extension-reload.ts +309 -0
- package/src/entry/orchestrator.ts +59 -35
- package/src/interactive/application-controller.ts +2 -1
- package/src/interactive/bus-notices.ts +8 -1
- package/src/interactive/chat-loop-messages.ts +3 -13
- package/src/interactive/chat-loop.ts +10 -1
- package/src/interactive/chat-panel.ts +36 -13
- package/src/interactive/chat-renderer.ts +71 -7
- package/src/interactive/dispatch-board.ts +6 -11
- package/src/interactive/footer/widgets.ts +13 -0
- package/src/interactive/interactive-application.ts +39 -4
- package/src/interactive/interactive-input-runtime.ts +4 -0
- package/src/interactive/interactive-presentation.ts +2 -2
- package/src/interactive/interactive-slash-runtime.ts +2 -0
- package/src/interactive/overlays/extensions.ts +9 -1
- package/src/interactive/overlays/help-reference.ts +13 -0
- package/src/interactive/overlays/settings.ts +27 -16
- package/src/interactive/panes-runtime.ts +111 -35
- package/src/interactive/prompt-cache-identity.ts +88 -0
- package/src/interactive/slash-commands.ts +129 -14
- package/src/interactive/stream-pacing-policy.ts +0 -23
- package/src/interactive/turn-context.ts +30 -15
- package/src/interactive/yazi-bridge.ts +60 -6
- package/src/tools/agent-tools.ts +30 -1
- package/src/tools/artifact.ts +2 -2
- package/src/tools/ask-user.ts +3 -3
- package/src/tools/bash.ts +1 -1
- package/src/tools/bootstrap.ts +4 -0
- package/src/tools/builtin-tool-catalog.ts +52 -22
- package/src/tools/codewiki/code-nav-surface.ts +6 -0
- package/src/tools/codewiki/code-nav.ts +99 -13
- package/src/tools/context/docs-engine.ts +20 -7
- package/src/tools/context/index.ts +29 -12
- package/src/tools/core-bootstrap.ts +28 -6
- package/src/tools/credential-present.ts +1 -2
- package/src/tools/dispatch-arguments.ts +5 -1
- package/src/tools/dispatch-plan.ts +48 -4
- package/src/tools/dispatch-run-events.ts +1 -1
- package/src/tools/dispatch-schema.ts +338 -0
- package/src/tools/dispatch-types.ts +3 -0
- package/src/tools/dispatch.ts +9 -254
- package/src/tools/ledger.ts +3 -5
- package/src/tools/monitor-surface.ts +5 -13
- package/src/tools/observation.ts +4 -5
- package/src/tools/panes-surface.ts +4 -11
- package/src/tools/panes.ts +4 -2
- package/src/tools/policy.ts +15 -2
- package/src/tools/read.ts +5 -6
- package/src/tools/registry.ts +30 -7
- package/src/tools/result-shaping.ts +18 -14
- package/src/tools/steer-surface.ts +1 -1
- package/src/tools/tasks.ts +1 -1
- package/src/tools/truncate.ts +6 -5
- package/src/tools/verify/surface.ts +6 -12
- package/src/tools/web-fetch-surface.ts +1 -3
- package/dist/chunk-5QIAJV2D.js +0 -48
- package/dist/chunk-JZWT5J3Y.js +0 -814
- package/dist/chunk-K7VKOLQQ.js +0 -15
- package/dist/chunk-PMZCIOCJ.js +0 -25
- package/dist/chunk-SUW5DORT.js +0 -819
- package/dist/chunk-UOV2BYIW.js +0 -107
- package/dist/chunk-WR6U3OVP.js +0 -45
- package/docs/artifact-versions.md +0 -67
- package/docs/documentation-coverage.md +0 -46
- package/docs/documentation-guide.md +0 -167
- package/docs/time-conventions.md +0 -101
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
readGateDecisionArtifactsForRunIds,
|
|
7
7
|
stagePendingGateDecision,
|
|
8
8
|
verifyGateDecisionArtifact
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-ZGNYYXQ6.js";
|
|
10
10
|
import {
|
|
11
11
|
RUN_RECEIPT_INTEGRITY_ALGORITHM,
|
|
12
12
|
RUN_RECEIPT_INTEGRITY_VERSION,
|
|
@@ -24,14 +24,18 @@ import {
|
|
|
24
24
|
trustVerdict,
|
|
25
25
|
verifyReceiptIntegrity,
|
|
26
26
|
withReceiptIntegrity
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-B74PXLU7.js";
|
|
28
28
|
import {
|
|
29
29
|
protectedArtifactFromSessionEntry,
|
|
30
30
|
protectedArtifactStateFromSessionEntries,
|
|
31
31
|
readAuditRows,
|
|
32
32
|
readSessionEntriesForId,
|
|
33
33
|
responseModelIdObservationFromRecord
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-X7IARSHT.js";
|
|
35
|
+
import {
|
|
36
|
+
codeStepDir,
|
|
37
|
+
writeCodeStepRecord
|
|
38
|
+
} from "./chunk-KPXDY6QF.js";
|
|
35
39
|
import {
|
|
36
40
|
applyTaskWorktree,
|
|
37
41
|
captureWorkspaceSnapshot,
|
|
@@ -39,11 +43,11 @@ import {
|
|
|
39
43
|
createTaskWorktree,
|
|
40
44
|
createWriteBoundaryEnforcer,
|
|
41
45
|
gitCheckoutRoot
|
|
42
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-W6NIE6OW.js";
|
|
43
47
|
import {
|
|
44
48
|
executionPlanAncestors,
|
|
45
49
|
spliceExecutionPlan
|
|
46
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-DZAW46HP.js";
|
|
47
51
|
import {
|
|
48
52
|
parseRigorOverride,
|
|
49
53
|
resolveRigor
|
|
@@ -53,11 +57,11 @@ import {
|
|
|
53
57
|
parseEvalArtifactV4,
|
|
54
58
|
redactArtifactForStorage,
|
|
55
59
|
sumEvalHarnessMetrics
|
|
56
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-5PFYMY2V.js";
|
|
57
61
|
import {
|
|
58
62
|
defaultRunEventJournal,
|
|
59
63
|
removeRunEventJournals
|
|
60
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-VIA6RFQZ.js";
|
|
61
65
|
import {
|
|
62
66
|
AdmissionCanceledError,
|
|
63
67
|
EVENT_TEE_LIMIT,
|
|
@@ -75,11 +79,11 @@ import {
|
|
|
75
79
|
receiptAttestationFields,
|
|
76
80
|
routeFactVerdict,
|
|
77
81
|
spawnNativeWorker
|
|
78
|
-
} from "./chunk-
|
|
82
|
+
} from "./chunk-4JDLP6ZS.js";
|
|
79
83
|
import {
|
|
80
84
|
FLEET_COMMAND_BASE_ENV,
|
|
81
85
|
normalizeWriteBoundary
|
|
82
|
-
} from "./chunk-
|
|
86
|
+
} from "./chunk-3F7VUY77.js";
|
|
83
87
|
import {
|
|
84
88
|
AGENT_LEDGER_PROMPT_MAX_CHARS,
|
|
85
89
|
COUNCIL_MIN_MEMBERS,
|
|
@@ -103,12 +107,15 @@ import {
|
|
|
103
107
|
declaredScopeIntent,
|
|
104
108
|
declaredScopeReplacementDiagnostic,
|
|
105
109
|
declaredScopeReplacementNotice,
|
|
110
|
+
inferredScopeParentTokenDiagnostic,
|
|
111
|
+
inferredScopeParentTokenNotice,
|
|
106
112
|
isBoundedGateRolePrompt,
|
|
107
113
|
isClaudeCanonicalTool,
|
|
108
114
|
isResponseSchemaRejection,
|
|
109
115
|
isRunOutcomeCode,
|
|
110
116
|
networkToolsDisabled,
|
|
111
117
|
nodeResultContractFilesystem,
|
|
118
|
+
normalizePromptHint,
|
|
112
119
|
projectExecutionHandoffs,
|
|
113
120
|
renderAgentLedger,
|
|
114
121
|
resolveDispatchPathScope,
|
|
@@ -119,7 +126,7 @@ import {
|
|
|
119
126
|
serializeWorkerRuntimeDescriptor,
|
|
120
127
|
toolPromptHintsForNames,
|
|
121
128
|
validateJobSpec
|
|
122
|
-
} from "./chunk-
|
|
129
|
+
} from "./chunk-IKSLQ4XV.js";
|
|
123
130
|
import {
|
|
124
131
|
decideRoute,
|
|
125
132
|
defaultRoutingIntent,
|
|
@@ -137,16 +144,16 @@ import {
|
|
|
137
144
|
routingIntentRejection,
|
|
138
145
|
sameRouteIdentity,
|
|
139
146
|
toRouteCandidate
|
|
140
|
-
} from "./chunk-
|
|
147
|
+
} from "./chunk-HIICAHCJ.js";
|
|
141
148
|
import {
|
|
142
149
|
assessFinishContract
|
|
143
|
-
} from "./chunk-
|
|
150
|
+
} from "./chunk-IDNA72AH.js";
|
|
144
151
|
import {
|
|
145
152
|
WRITE_ROOT_REFUSED_TOOLS
|
|
146
|
-
} from "./chunk-
|
|
153
|
+
} from "./chunk-FVDGR2ZL.js";
|
|
147
154
|
import {
|
|
148
155
|
describeCallAction
|
|
149
|
-
} from "./chunk-
|
|
156
|
+
} from "./chunk-NEDJ26B5.js";
|
|
150
157
|
import {
|
|
151
158
|
applyToolProfile,
|
|
152
159
|
assertToolProfileEnforceable
|
|
@@ -182,7 +189,9 @@ import {
|
|
|
182
189
|
parseAgentLedgerBody
|
|
183
190
|
} from "./chunk-VAVR4IJY.js";
|
|
184
191
|
import {
|
|
185
|
-
|
|
192
|
+
PATH_BOUNDARY_MAX_ENTRIES,
|
|
193
|
+
pathBoundaryCovers,
|
|
194
|
+
resolvePathBoundary
|
|
186
195
|
} from "./chunk-HHV2GANA.js";
|
|
187
196
|
import {
|
|
188
197
|
agentSpecFingerprint,
|
|
@@ -194,10 +203,10 @@ import {
|
|
|
194
203
|
resolveAgentToolCompatibility,
|
|
195
204
|
resultContractAuthorship,
|
|
196
205
|
validateRecipeResult
|
|
197
|
-
} from "./chunk-
|
|
206
|
+
} from "./chunk-PGF63K6I.js";
|
|
198
207
|
import {
|
|
199
208
|
detectValidationCommand
|
|
200
|
-
} from "./chunk-
|
|
209
|
+
} from "./chunk-IKOZFYBN.js";
|
|
201
210
|
import {
|
|
202
211
|
isProjectVerifierCheckId,
|
|
203
212
|
isVerificationScriptName
|
|
@@ -210,6 +219,7 @@ import {
|
|
|
210
219
|
isBuiltinToolName
|
|
211
220
|
} from "./chunk-K6BSR66V.js";
|
|
212
221
|
import {
|
|
222
|
+
canonicalEndpointKey,
|
|
213
223
|
canonicalizeWireModelId,
|
|
214
224
|
endpointCapacityFor,
|
|
215
225
|
endpointCapacityForStatus,
|
|
@@ -223,7 +233,7 @@ import {
|
|
|
223
233
|
resolveRuntimeTarget,
|
|
224
234
|
runtimeResolutionWarnings,
|
|
225
235
|
runtimeTargetSnapshot
|
|
226
|
-
} from "./chunk-
|
|
236
|
+
} from "./chunk-BYMNWQ7O.js";
|
|
227
237
|
import {
|
|
228
238
|
ceilChars
|
|
229
239
|
} from "./chunk-CWVRRIEI.js";
|
|
@@ -233,13 +243,13 @@ import {
|
|
|
233
243
|
import {
|
|
234
244
|
assertSafeId
|
|
235
245
|
} from "./chunk-R346GLFC.js";
|
|
236
|
-
import {
|
|
237
|
-
BusChannels
|
|
238
|
-
} from "./chunk-HLW2MRKE.js";
|
|
239
246
|
import {
|
|
240
247
|
normalizeClioCoderEventRecord,
|
|
241
248
|
normalizeClioCoderEventType
|
|
242
249
|
} from "./chunk-BTK3SSSK.js";
|
|
250
|
+
import {
|
|
251
|
+
BusChannels
|
|
252
|
+
} from "./chunk-F4EKGO4N.js";
|
|
243
253
|
import {
|
|
244
254
|
attributeCommitMessage,
|
|
245
255
|
gitCommitAttributionEnabled,
|
|
@@ -263,11 +273,11 @@ import {
|
|
|
263
273
|
DEFAULT_DELEGATION_TURN_TIMEOUT_MS,
|
|
264
274
|
DEFAULT_SETTINGS,
|
|
265
275
|
THINKING_LEVELS
|
|
266
|
-
} from "./chunk-
|
|
276
|
+
} from "./chunk-UXCU4E3T.js";
|
|
267
277
|
import {
|
|
268
278
|
GUARDRAIL_DEFAULTS,
|
|
269
279
|
resolveGuardrail
|
|
270
|
-
} from "./chunk-
|
|
280
|
+
} from "./chunk-S66XZJOF.js";
|
|
271
281
|
import {
|
|
272
282
|
targetRequiresAuth
|
|
273
283
|
} from "./chunk-WNP7O5WZ.js";
|
|
@@ -284,6 +294,7 @@ import {
|
|
|
284
294
|
import {
|
|
285
295
|
clioDataDir,
|
|
286
296
|
clioStateDir,
|
|
297
|
+
resolveClioDirs,
|
|
287
298
|
stateRootRemoved
|
|
288
299
|
} from "./chunk-BYP5D4HI.js";
|
|
289
300
|
import {
|
|
@@ -1407,6 +1418,12 @@ function renderDispatchIntentRequirements(intent) {
|
|
|
1407
1418
|
"# Declared Result Requirements",
|
|
1408
1419
|
"These entries are requirements to satisfy and verify. They are not evidence that an output exists or a check passed."
|
|
1409
1420
|
];
|
|
1421
|
+
if (intent.writeRoots.length > 0) {
|
|
1422
|
+
lines.push(
|
|
1423
|
+
"",
|
|
1424
|
+
"This run is confined to its write roots and has no bash or verify tool, so you cannot run tests, scripts, or the checks below yourself. Write the code and the tests, re-read them, and report what you wrote; the host runs the declared checks after you finish and records the result on the receipt."
|
|
1425
|
+
);
|
|
1426
|
+
}
|
|
1410
1427
|
if (intent.expectedOutputs.length > 0) {
|
|
1411
1428
|
lines.push("", "Expected outputs:", ...intent.expectedOutputs.map((output) => `- ${output}`));
|
|
1412
1429
|
}
|
|
@@ -1442,7 +1459,7 @@ init_esm_shims();
|
|
|
1442
1459
|
// src/domains/evidence/build.ts
|
|
1443
1460
|
init_esm_shims();
|
|
1444
1461
|
import { mkdir, readFile as readFile2, writeFile } from "node:fs/promises";
|
|
1445
|
-
import { join as
|
|
1462
|
+
import { join as join15 } from "node:path";
|
|
1446
1463
|
|
|
1447
1464
|
// src/domains/dispatch/index.ts
|
|
1448
1465
|
init_esm_shims();
|
|
@@ -2437,7 +2454,6 @@ function startAcpDelegationRun(input) {
|
|
|
2437
2454
|
// src/domains/prompts/compiler.ts
|
|
2438
2455
|
init_esm_shims();
|
|
2439
2456
|
import { join as join3 } from "node:path";
|
|
2440
|
-
var FLEET_ROUTING_GUIDANCE = 'Fleet routing: pin the `agent` id from the Fleet section; agent:"auto" baselines from the task text and is a fallback, not a router.';
|
|
2441
2457
|
var WORKER_CLAIM_GUIDANCE = 'Never claim a completion, a validation, or a file change that no tool call in this run supports. If you did not run it or write it here, say "not verified" and report what you did do.';
|
|
2442
2458
|
function lookupFragment(table, id, role) {
|
|
2443
2459
|
const frag = table.byId.get(id);
|
|
@@ -2487,16 +2503,32 @@ function renderRuntimeBlock(inputs) {
|
|
|
2487
2503
|
}
|
|
2488
2504
|
function sessionCanDispatch(inputs) {
|
|
2489
2505
|
if (inputs.providerSupportsTools === false) return false;
|
|
2490
|
-
return toolSurfaceHasTool(inputs.toolNames,
|
|
2506
|
+
return toolSurfaceHasTool(inputs.toolNames, "dispatch");
|
|
2491
2507
|
}
|
|
2492
2508
|
function sessionHasContext(inputs) {
|
|
2493
2509
|
if (inputs.providerSupportsTools === false) return false;
|
|
2494
|
-
return toolSurfaceHasTool(inputs.toolNames,
|
|
2510
|
+
return toolSurfaceHasTool(inputs.toolNames, "context");
|
|
2495
2511
|
}
|
|
2496
|
-
function toolSurfaceHasTool(toolNames,
|
|
2512
|
+
function toolSurfaceHasTool(toolNames, tool) {
|
|
2497
2513
|
const names = new Set((toolNames ?? []).map((name) => name.trim()));
|
|
2498
|
-
|
|
2499
|
-
|
|
2514
|
+
return names.has(tool);
|
|
2515
|
+
}
|
|
2516
|
+
function canonicalToolPromptHints(entries, admitted) {
|
|
2517
|
+
const normalized = entries.map((entry) => ({
|
|
2518
|
+
tool: entry.tool.trim(),
|
|
2519
|
+
hint: normalizePromptHint(entry.hint) ?? ""
|
|
2520
|
+
})).filter((entry) => admitted.has(entry.tool) && entry.hint.length > 0).sort((a, b) => {
|
|
2521
|
+
if (a.tool !== b.tool) return a.tool < b.tool ? -1 : 1;
|
|
2522
|
+
return a.hint < b.hint ? -1 : a.hint > b.hint ? 1 : 0;
|
|
2523
|
+
});
|
|
2524
|
+
const seenTools = /* @__PURE__ */ new Set();
|
|
2525
|
+
const seenHints = /* @__PURE__ */ new Set();
|
|
2526
|
+
return normalized.filter((entry) => {
|
|
2527
|
+
if (seenTools.has(entry.tool) || seenHints.has(entry.hint)) return false;
|
|
2528
|
+
seenTools.add(entry.tool);
|
|
2529
|
+
seenHints.add(entry.hint);
|
|
2530
|
+
return true;
|
|
2531
|
+
});
|
|
2500
2532
|
}
|
|
2501
2533
|
function renderFleetBlock(inputs) {
|
|
2502
2534
|
if (!sessionCanDispatch(inputs)) return "";
|
|
@@ -2515,36 +2547,43 @@ function renderToolContractBlock(inputs) {
|
|
|
2515
2547
|
].sort();
|
|
2516
2548
|
const canDispatch = sessionCanDispatch(inputs);
|
|
2517
2549
|
const canListSkills = sessionHasContext(inputs);
|
|
2550
|
+
const admitted = new Set(names);
|
|
2518
2551
|
const inventoryGuidance = [
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
...
|
|
2524
|
-
...canListSkills ? ['add context(scope="skills") only if skills are requested (it lists installed and marketplace skills)'] : []
|
|
2552
|
+
"When asked what tools you have, copy the Direct tools line verbatim and call nothing",
|
|
2553
|
+
...canDispatch ? [
|
|
2554
|
+
"dispatch(list:true) answers a question about agents, the fleet, or which target and model run this session and its workers"
|
|
2555
|
+
] : [],
|
|
2556
|
+
...canListSkills ? ['context(scope="skills") answers only a question about skills'] : []
|
|
2525
2557
|
].join("; ");
|
|
2558
|
+
const capabilityKinds = [
|
|
2559
|
+
"direct tools are attached schemas",
|
|
2560
|
+
...canDispatch ? ["fleet agents are workers behind dispatch"] : [],
|
|
2561
|
+
...canListSkills ? ["skills are operator-activated workflows reached through context"] : []
|
|
2562
|
+
];
|
|
2563
|
+
const orientationTools = ["context", "code_nav", "grep", "read"].filter((name) => admitted.has(name));
|
|
2564
|
+
const validationTools = ["verify", "git"].filter((name) => admitted.has(name));
|
|
2526
2565
|
const lines = [
|
|
2527
2566
|
"# Tool Contract",
|
|
2528
2567
|
"The attached schemas are the session's complete direct-tool surface; follow each schema exactly.",
|
|
2529
2568
|
...names.length > 0 ? [`Direct tools: ${names.map((name) => `\`${name}\``).join(", ")}.`] : [],
|
|
2530
|
-
|
|
2569
|
+
`Harness model: ${capabilityKinds.join("; ")}. Keep these capability sets distinct.`,
|
|
2531
2570
|
`${inventoryGuidance}.`,
|
|
2532
|
-
"Call tools only for concrete inspection or changes the task requires
|
|
2571
|
+
"Call tools only for concrete inspection or changes the task requires; a tool-free question gets a tool-free answer.",
|
|
2533
2572
|
// The tool-specific instantiation of the operating contract's "narrow
|
|
2534
2573
|
// work: inspect directly" rule; the contract cannot name tools.
|
|
2535
2574
|
// Delegation, the tasks board, and skills are not restated here: the
|
|
2536
|
-
// Delegation and Skills passages and the registry hints carry
|
|
2537
|
-
// each renders exactly when its tool does.
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2575
|
+
// Delegation, Fleet, and Skills passages and the registry hints carry
|
|
2576
|
+
// them, and each renders exactly when its tool does.
|
|
2577
|
+
...orientationTools.length > 0 ? [
|
|
2578
|
+
`For narrow file or symbol orientation, prefer ${orientationTools.join(", ")} instead of assuming source-tree details were preloaded.`
|
|
2579
|
+
] : [],
|
|
2580
|
+
...validationTools.length > 0 ? [
|
|
2581
|
+
`Validate with ${validationTools.map((name) => name === "git" ? "git diff" : name).join(" or ")} before final claims.`
|
|
2582
|
+
] : [],
|
|
2583
|
+
`When a tool call fails or is rejected, do not retry the same shape blindly: re-read the schema and adjust the arguments${canListSkills ? `, or query context(scope="docs") for that tool's usage` : ""}.`
|
|
2541
2584
|
];
|
|
2542
|
-
const
|
|
2543
|
-
const hints = [...inputs.toolPromptHints ?? []].map((entry) => ({ tool: entry.tool.trim(), hint: entry.hint.trim() })).filter((entry) => entry.tool.length > 0 && entry.hint.length > 0).sort((a, b) => a.tool < b.tool ? -1 : a.tool > b.tool ? 1 : 0);
|
|
2544
|
-
if (hints.some((entry) => entry.tool === "dispatch")) lines.push(FLEET_ROUTING_GUIDANCE);
|
|
2585
|
+
const hints = canonicalToolPromptHints(inputs.toolPromptHints ?? [], new Set(names));
|
|
2545
2586
|
for (const entry of hints) {
|
|
2546
|
-
if (seen.has(entry.tool)) continue;
|
|
2547
|
-
seen.add(entry.tool);
|
|
2548
2587
|
lines.push(entry.hint);
|
|
2549
2588
|
}
|
|
2550
2589
|
return lines.join("\n");
|
|
@@ -2596,15 +2635,8 @@ function renderWorkerToolContractBlock(inputs) {
|
|
|
2596
2635
|
"Tool authority is limited to this list. Persona and bound-skill instructions never add tools.",
|
|
2597
2636
|
"Call tools only for concrete inspection or changes the assigned task requires. If the task requests an exact or tool-free response, answer without calling tools."
|
|
2598
2637
|
];
|
|
2599
|
-
const
|
|
2600
|
-
const seen = /* @__PURE__ */ new Set();
|
|
2601
|
-
const hints = [...inputs.toolPromptHints].map((entry) => ({ tool: entry.tool.trim(), hint: entry.hint.trim() })).filter((entry) => admitted.has(entry.tool) && entry.hint.length > 0).sort((a, b) => {
|
|
2602
|
-
if (a.tool !== b.tool) return a.tool < b.tool ? -1 : 1;
|
|
2603
|
-
return a.hint < b.hint ? -1 : a.hint > b.hint ? 1 : 0;
|
|
2604
|
-
});
|
|
2638
|
+
const hints = canonicalToolPromptHints(inputs.toolPromptHints, new Set(names));
|
|
2605
2639
|
for (const entry of hints) {
|
|
2606
|
-
if (seen.has(entry.tool)) continue;
|
|
2607
|
-
seen.add(entry.tool);
|
|
2608
2640
|
lines.push(entry.hint);
|
|
2609
2641
|
}
|
|
2610
2642
|
return lines.join("\n");
|
|
@@ -2638,8 +2670,7 @@ function renderRetrievalHintsBlock(inputs) {
|
|
|
2638
2670
|
}
|
|
2639
2671
|
return [
|
|
2640
2672
|
"# Retrieval Hints",
|
|
2641
|
-
"
|
|
2642
|
-
"Never invent file paths, automatic tool behavior, or mutable repo details from the system prompt."
|
|
2673
|
+
"Repository details not included above must be fetched, never invented; compact CLIO-CODER.md instructions may be preloaded."
|
|
2643
2674
|
].join("\n");
|
|
2644
2675
|
}
|
|
2645
2676
|
function renderProjectBlock(contextFiles) {
|
|
@@ -2706,7 +2737,8 @@ function compile(table, inputs) {
|
|
|
2706
2737
|
const docsRouting = selfAwareness && sessionHasContext(session) ? table.byId.get("identity.docs-routing") : void 0;
|
|
2707
2738
|
if (selfAwareness) {
|
|
2708
2739
|
const packageRoot = resolvePackageRoot();
|
|
2709
|
-
const
|
|
2740
|
+
const clioDirs = resolveClioDirs();
|
|
2741
|
+
const rendered2 = selfAwareness.body.replace("{CLIO_DOCS_PATH}", join3(packageRoot, "docs")).replace("{CLIO_SRC_PATH}", join3(packageRoot, "src")).replace("{CLIO_CODEWIKI_PATH}", join3(packageRoot, "dist", "assets", "codewiki.json")).replace("{CLIO_SETTINGS_PATH}", join3(clioDirs.config, "settings.yaml")).replace("{CLIO_STATE_PATH}", clioDirs.state);
|
|
2710
2742
|
identityBody = [identity.body.trim(), rendered2.trim(), ...docsRouting ? [docsRouting.body.trim()] : []].join(
|
|
2711
2743
|
"\n\n"
|
|
2712
2744
|
);
|
|
@@ -4358,6 +4390,7 @@ function suggestedSpecialist(taskType, specs) {
|
|
|
4358
4390
|
}
|
|
4359
4391
|
function assessCapabilityMismatch(input) {
|
|
4360
4392
|
if (!READ_ONLY_CAPABILITY_CLASSES.has(input.capabilityClass)) return null;
|
|
4393
|
+
if (input.intent && input.intent.writeRoots.length === 0 && input.intent.expectedOutputs.length === 0) return null;
|
|
4361
4394
|
const features = classifyAgentTask(input.task);
|
|
4362
4395
|
if (!MUTATING_TASK_TYPES.has(features.taskType)) return null;
|
|
4363
4396
|
const readShaped = READ_SHAPED_PATTERNS.some((pattern) => pattern.test(input.task));
|
|
@@ -4844,6 +4877,9 @@ ${spawned.spawnError}
|
|
|
4844
4877
|
// src/domains/dispatch/host-verification.ts
|
|
4845
4878
|
var OUTPUT_TAIL_BYTES = 2048;
|
|
4846
4879
|
var MEMO_VERSION = 1;
|
|
4880
|
+
var HTTP_URL_RE = /\bhttps?:\/\/\S+/gu;
|
|
4881
|
+
var CHECK_OUTPUT_PATH_RE = /\/?(?:[A-Za-z0-9_.@+-]+\/)+[A-Za-z0-9_.@+-]*\.(?:[cm]?[jt]sx?|json|ya?ml|md|txt|py|go|rs|c|h|cc|cpp|hpp|java|rb|sh|toml|css|html|sql)\b/gu;
|
|
4882
|
+
var IMPLICATED_PATH_CAP = PATH_BOUNDARY_MAX_ENTRIES;
|
|
4847
4883
|
function sha2563(value) {
|
|
4848
4884
|
return createHash4("sha256").update(value, "utf8").digest("hex");
|
|
4849
4885
|
}
|
|
@@ -4915,6 +4951,52 @@ function hostVerificationRejection(verification) {
|
|
|
4915
4951
|
detail: failedCheck === void 0 ? "host verification rejected" : `host verification check '${failedCheck.check}' rejected with exit code ${failedCheck.exitCode}`
|
|
4916
4952
|
};
|
|
4917
4953
|
}
|
|
4954
|
+
async function runResolvedCheck(input) {
|
|
4955
|
+
const resolvedCheck = input.resolvedCheck;
|
|
4956
|
+
const command = {
|
|
4957
|
+
id: resolvedCheck.check,
|
|
4958
|
+
argv: [...resolvedCheck.argv],
|
|
4959
|
+
cwd: "",
|
|
4960
|
+
timeoutMs: resolvedCheck.timeoutMs,
|
|
4961
|
+
env: [],
|
|
4962
|
+
description: `Host verification check ${resolvedCheck.check}.`
|
|
4963
|
+
};
|
|
4964
|
+
const fingerprint = workspaceFingerprint(resolvedCheck.cwd);
|
|
4965
|
+
const key = fingerprint === null ? null : memoKey({ ...command, cwd: resolve3(resolvedCheck.cwd) }, fingerprint, input.env);
|
|
4966
|
+
const hit = key === null ? void 0 : readMemo(input.stateDir).entries.find((entry) => entry.key === key && entry.check.exitCode === 0);
|
|
4967
|
+
if (hit !== void 0) {
|
|
4968
|
+
return {
|
|
4969
|
+
check: { ...hit.check, argv: [...hit.check.argv], memo: true, evidenceRunId: hit.runId },
|
|
4970
|
+
outputExcerpt: ""
|
|
4971
|
+
};
|
|
4972
|
+
}
|
|
4973
|
+
const outcome = await runCodeStep({
|
|
4974
|
+
stepId: `verification-${input.index + 1}-${resolvedCheck.check.replace(/[^a-z0-9._-]/giu, "_")}`,
|
|
4975
|
+
command,
|
|
4976
|
+
workspaceRoot: resolvedCheck.cwd,
|
|
4977
|
+
artifactDir: join8(input.stateDir, "artifacts", input.runId, "verification"),
|
|
4978
|
+
env: input.env
|
|
4979
|
+
});
|
|
4980
|
+
const artifactPath = outcome.record.artifactPaths[0];
|
|
4981
|
+
const check = {
|
|
4982
|
+
check: resolvedCheck.check,
|
|
4983
|
+
argv: [...outcome.record.argv],
|
|
4984
|
+
cwd: outcome.record.cwd,
|
|
4985
|
+
exitCode: outcome.record.exitCode,
|
|
4986
|
+
durationMs: outcome.record.durationMs,
|
|
4987
|
+
memo: false,
|
|
4988
|
+
outputTail: outputTail(outcome.report.outputExcerpt),
|
|
4989
|
+
...artifactPath !== void 0 ? { artifactPath } : {}
|
|
4990
|
+
};
|
|
4991
|
+
if (check.exitCode === 0 && key !== null) {
|
|
4992
|
+
try {
|
|
4993
|
+
storeMemoEntry(input.stateDir, { key, runId: input.runId, check });
|
|
4994
|
+
} catch (error) {
|
|
4995
|
+
input.onDiagnostic?.(error);
|
|
4996
|
+
}
|
|
4997
|
+
}
|
|
4998
|
+
return { check, outputExcerpt: outcome.report.outputExcerpt };
|
|
4999
|
+
}
|
|
4918
5000
|
async function runHostVerification(input) {
|
|
4919
5001
|
const checks = input.request.resolvedVerification;
|
|
4920
5002
|
if (checks === void 0 || checks.length === 0) return void 0;
|
|
@@ -4923,51 +5005,220 @@ async function runHostVerification(input) {
|
|
|
4923
5005
|
const env = input.env ?? process.env;
|
|
4924
5006
|
const results = [];
|
|
4925
5007
|
for (const [index, resolvedCheck] of checks.entries()) {
|
|
4926
|
-
const
|
|
4927
|
-
|
|
5008
|
+
const outcome = await runResolvedCheck({
|
|
5009
|
+
runId: input.runId,
|
|
5010
|
+
index,
|
|
5011
|
+
resolvedCheck,
|
|
5012
|
+
stateDir,
|
|
5013
|
+
env,
|
|
5014
|
+
...input.onDiagnostic !== void 0 ? { onDiagnostic: input.onDiagnostic } : {}
|
|
5015
|
+
});
|
|
5016
|
+
results.push(outcome.check);
|
|
5017
|
+
}
|
|
5018
|
+
return {
|
|
5019
|
+
status: results.every((check) => check.exitCode === 0) ? "verified" : "rejected",
|
|
5020
|
+
checks: results
|
|
5021
|
+
};
|
|
5022
|
+
}
|
|
5023
|
+
function implicatedPaths(outputExcerpt, checkCwd) {
|
|
5024
|
+
const withoutUrls = outputExcerpt.replace(HTTP_URL_RE, (url) => " ".repeat(url.length));
|
|
5025
|
+
const paths = /* @__PURE__ */ new Set();
|
|
5026
|
+
for (const match of withoutUrls.matchAll(CHECK_OUTPUT_PATH_RE)) paths.add(resolve3(checkCwd, match[0]));
|
|
5027
|
+
return [...paths].sort();
|
|
5028
|
+
}
|
|
5029
|
+
function checkDedupeKey(resolvedCheck) {
|
|
5030
|
+
return sha2563(
|
|
5031
|
+
JSON.stringify({
|
|
5032
|
+
check: resolvedCheck.check,
|
|
4928
5033
|
argv: [...resolvedCheck.argv],
|
|
4929
|
-
cwd:
|
|
4930
|
-
timeoutMs: resolvedCheck.timeoutMs
|
|
4931
|
-
|
|
4932
|
-
|
|
4933
|
-
|
|
4934
|
-
|
|
4935
|
-
|
|
4936
|
-
|
|
4937
|
-
|
|
4938
|
-
|
|
5034
|
+
cwd: resolve3(resolvedCheck.cwd),
|
|
5035
|
+
timeoutMs: resolvedCheck.timeoutMs
|
|
5036
|
+
})
|
|
5037
|
+
);
|
|
5038
|
+
}
|
|
5039
|
+
function memberBoundary(participant) {
|
|
5040
|
+
const writeRoots = participant.request.intent?.writeRoots ?? [];
|
|
5041
|
+
return writeRoots.map((root) => resolvePathBoundary(participant.request.cwd ?? process.cwd(), root));
|
|
5042
|
+
}
|
|
5043
|
+
function attributeFailure(input) {
|
|
5044
|
+
const declared = new Set(input.declarers.map((member) => member.runId));
|
|
5045
|
+
const implicatedDeclarers = /* @__PURE__ */ new Set();
|
|
5046
|
+
const unconfined = /* @__PURE__ */ new Set();
|
|
5047
|
+
const decisive = /* @__PURE__ */ new Set();
|
|
5048
|
+
for (const member of input.declarers) {
|
|
5049
|
+
const boundary = memberBoundary(member);
|
|
5050
|
+
if (boundary.length === 0) {
|
|
5051
|
+
unconfined.add(member.runId);
|
|
4939
5052
|
continue;
|
|
4940
5053
|
}
|
|
4941
|
-
const
|
|
4942
|
-
|
|
4943
|
-
|
|
4944
|
-
|
|
4945
|
-
|
|
4946
|
-
|
|
4947
|
-
|
|
4948
|
-
|
|
4949
|
-
|
|
4950
|
-
|
|
4951
|
-
|
|
4952
|
-
|
|
4953
|
-
|
|
4954
|
-
|
|
4955
|
-
|
|
4956
|
-
|
|
4957
|
-
|
|
4958
|
-
|
|
4959
|
-
|
|
4960
|
-
|
|
4961
|
-
|
|
4962
|
-
|
|
4963
|
-
|
|
4964
|
-
|
|
5054
|
+
const hits = input.implicated.filter((path2) => pathBoundaryCovers(boundary, path2));
|
|
5055
|
+
if (hits.length === 0) continue;
|
|
5056
|
+
implicatedDeclarers.add(member.runId);
|
|
5057
|
+
for (const hit of hits) decisive.add(hit);
|
|
5058
|
+
}
|
|
5059
|
+
const others = input.wave.filter((member) => !declared.has(member.runId));
|
|
5060
|
+
const ownedElsewhere = input.implicated.length > 0 && input.implicated.every((path2) => others.some((member) => pathBoundaryCovers(memberBoundary(member), path2)));
|
|
5061
|
+
const localized = implicatedDeclarers.size > 0 || ownedElsewhere;
|
|
5062
|
+
const charged = localized ? new Set(implicatedDeclarers) : new Set(declared);
|
|
5063
|
+
for (const runId of unconfined) charged.add(runId);
|
|
5064
|
+
return {
|
|
5065
|
+
charged,
|
|
5066
|
+
basis: !localized || unconfined.size > 0 ? "unattributable" : implicatedDeclarers.size > 0 ? "write_roots" : "attributed_elsewhere",
|
|
5067
|
+
decisive: [...decisive].sort()
|
|
5068
|
+
};
|
|
5069
|
+
}
|
|
5070
|
+
function createBatchVerificationGate(options = {}) {
|
|
5071
|
+
const stateDir = options.stateDir ?? clioStateDir();
|
|
5072
|
+
const env = options.env ?? process.env;
|
|
5073
|
+
const liveMembers = /* @__PURE__ */ new Set();
|
|
5074
|
+
const parked = /* @__PURE__ */ new Map();
|
|
5075
|
+
let settling = false;
|
|
5076
|
+
const perRun = (participant) => runHostVerification({
|
|
5077
|
+
runId: participant.runId,
|
|
5078
|
+
request: participant.request,
|
|
5079
|
+
workerSuccessful: participant.workerSuccessful,
|
|
5080
|
+
stateDir,
|
|
5081
|
+
env,
|
|
5082
|
+
...participant.onDiagnostic !== void 0 ? { onDiagnostic: participant.onDiagnostic } : {}
|
|
5083
|
+
});
|
|
5084
|
+
const nothingToRun = (participant) => {
|
|
5085
|
+
const checks = participant.request.resolvedVerification;
|
|
5086
|
+
if (checks === void 0 || checks.length === 0) return void 0;
|
|
5087
|
+
return { status: "skipped", reason: "worker_not_successful", checks: [] };
|
|
5088
|
+
};
|
|
5089
|
+
async function settleBatch(wave) {
|
|
5090
|
+
const members = wave.map((entry) => entry.participant);
|
|
5091
|
+
const contributors = members.filter(
|
|
5092
|
+
(member) => member.workerSuccessful && (member.request.resolvedVerification?.length ?? 0) > 0
|
|
5093
|
+
);
|
|
5094
|
+
const distinct = /* @__PURE__ */ new Map();
|
|
5095
|
+
for (const member of contributors) {
|
|
5096
|
+
for (const resolvedCheck of member.request.resolvedVerification ?? []) {
|
|
5097
|
+
const key = checkDedupeKey(resolvedCheck);
|
|
5098
|
+
if (!distinct.has(key)) distinct.set(key, { resolvedCheck, owner: member, index: distinct.size });
|
|
5099
|
+
}
|
|
5100
|
+
}
|
|
5101
|
+
const ran = /* @__PURE__ */ new Map();
|
|
5102
|
+
for (const [key, entry] of distinct) {
|
|
5103
|
+
const outcome = await runResolvedCheck({
|
|
5104
|
+
runId: entry.owner.runId,
|
|
5105
|
+
index: entry.index,
|
|
5106
|
+
resolvedCheck: entry.resolvedCheck,
|
|
5107
|
+
stateDir,
|
|
5108
|
+
env,
|
|
5109
|
+
// The owning member's callback, because the artifact directory is
|
|
5110
|
+
// named for that same run and the diagnostic text is closed over the
|
|
5111
|
+
// run id it was built for (`extension.ts:5534`); any other member's
|
|
5112
|
+
// callback would name a run whose artifacts the failure is not under.
|
|
5113
|
+
...entry.owner.onDiagnostic !== void 0 ? { onDiagnostic: entry.owner.onDiagnostic } : {}
|
|
5114
|
+
});
|
|
5115
|
+
ran.set(key, { check: outcome.check, owner: entry.owner.runId, outputExcerpt: outcome.outputExcerpt });
|
|
5116
|
+
}
|
|
5117
|
+
const attribution = [];
|
|
5118
|
+
const chargedByKey = /* @__PURE__ */ new Map();
|
|
5119
|
+
for (const [key, entry] of ran) {
|
|
5120
|
+
if (entry.check.exitCode === 0) continue;
|
|
5121
|
+
const declarers = contributors.filter(
|
|
5122
|
+
(member) => (member.request.resolvedVerification ?? []).some((candidate) => checkDedupeKey(candidate) === key)
|
|
5123
|
+
);
|
|
5124
|
+
const implicated = implicatedPaths(entry.outputExcerpt, entry.check.cwd);
|
|
5125
|
+
const verdict = attributeFailure({ implicated, declarers, wave: members });
|
|
5126
|
+
chargedByKey.set(key, verdict.charged);
|
|
5127
|
+
const decisive = new Set(verdict.decisive);
|
|
5128
|
+
attribution.push({
|
|
5129
|
+
check: entry.check.check,
|
|
5130
|
+
// The paths that decided the charge lead the capped list. A large
|
|
5131
|
+
// suite names more than 32 files and the sealed evidence has to
|
|
5132
|
+
// contain the path a receipt was charged on, or it documents nothing.
|
|
5133
|
+
implicated: [...verdict.decisive, ...implicated.filter((path2) => !decisive.has(path2))].slice(
|
|
5134
|
+
0,
|
|
5135
|
+
IMPLICATED_PATH_CAP
|
|
5136
|
+
),
|
|
5137
|
+
charged: [...verdict.charged].sort(),
|
|
5138
|
+
basis: verdict.basis
|
|
5139
|
+
});
|
|
5140
|
+
}
|
|
5141
|
+
attribution.sort((first, second) => first.check < second.check ? -1 : first.check > second.check ? 1 : 0);
|
|
5142
|
+
for (const entry of wave) {
|
|
5143
|
+
const member = entry.participant;
|
|
5144
|
+
if (!contributors.includes(member)) {
|
|
5145
|
+
entry.settle(nothingToRun(member));
|
|
5146
|
+
continue;
|
|
4965
5147
|
}
|
|
5148
|
+
const own = [];
|
|
5149
|
+
let rejected = false;
|
|
5150
|
+
let unimplicated = false;
|
|
5151
|
+
for (const resolvedCheck of member.request.resolvedVerification ?? []) {
|
|
5152
|
+
const key = checkDedupeKey(resolvedCheck);
|
|
5153
|
+
const shared = ran.get(key);
|
|
5154
|
+
if (shared === void 0) continue;
|
|
5155
|
+
own.push(
|
|
5156
|
+
shared.owner === member.runId || shared.check.evidenceRunId !== void 0 ? { ...shared.check, argv: [...shared.check.argv] } : { ...shared.check, argv: [...shared.check.argv], evidenceRunId: shared.owner }
|
|
5157
|
+
);
|
|
5158
|
+
if (shared.check.exitCode === 0) continue;
|
|
5159
|
+
if (chargedByKey.get(key)?.has(member.runId) === true) rejected = true;
|
|
5160
|
+
else unimplicated = true;
|
|
5161
|
+
}
|
|
5162
|
+
entry.settle({
|
|
5163
|
+
// `verified` states that every declared check passed, which is what
|
|
5164
|
+
// `trust-status.ts:619` certifies and what the board and
|
|
5165
|
+
// `worker-evidence.ts:161` print. An exculpated member's checks array
|
|
5166
|
+
// still carries a non-zero exit code, so it seals its own status
|
|
5167
|
+
// instead of borrowing that claim.
|
|
5168
|
+
status: rejected ? "rejected" : unimplicated ? "not_implicated" : "verified",
|
|
5169
|
+
...!rejected && unimplicated ? { reason: "batch_settled_not_implicated" } : {},
|
|
5170
|
+
checks: own,
|
|
5171
|
+
strategy: "batch-settled",
|
|
5172
|
+
// Copied per receipt so no two members of the batch share a mutable array.
|
|
5173
|
+
...attribution.length > 0 ? {
|
|
5174
|
+
attribution: attribution.map((record) => ({
|
|
5175
|
+
...record,
|
|
5176
|
+
implicated: [...record.implicated],
|
|
5177
|
+
charged: [...record.charged]
|
|
5178
|
+
}))
|
|
5179
|
+
} : {}
|
|
5180
|
+
});
|
|
5181
|
+
}
|
|
5182
|
+
}
|
|
5183
|
+
function maybeSettle() {
|
|
5184
|
+
if (settling || parked.size === 0) return;
|
|
5185
|
+
for (const runId of liveMembers) {
|
|
5186
|
+
if (!parked.has(runId)) return;
|
|
4966
5187
|
}
|
|
5188
|
+
settling = true;
|
|
5189
|
+
const wave = [...parked.values()];
|
|
5190
|
+
for (const runId of parked.keys()) liveMembers.delete(runId);
|
|
5191
|
+
parked.clear();
|
|
5192
|
+
void settleBatch(wave).catch(async (error) => {
|
|
5193
|
+
for (const entry of wave) {
|
|
5194
|
+
entry.participant.onDiagnostic?.(error);
|
|
5195
|
+
try {
|
|
5196
|
+
entry.settle(await perRun(entry.participant));
|
|
5197
|
+
} catch (fallbackError) {
|
|
5198
|
+
entry.fail(fallbackError);
|
|
5199
|
+
}
|
|
5200
|
+
}
|
|
5201
|
+
}).finally(() => {
|
|
5202
|
+
settling = false;
|
|
5203
|
+
maybeSettle();
|
|
5204
|
+
});
|
|
4967
5205
|
}
|
|
4968
5206
|
return {
|
|
4969
|
-
|
|
4970
|
-
|
|
5207
|
+
live(runId) {
|
|
5208
|
+
liveMembers.add(runId);
|
|
5209
|
+
},
|
|
5210
|
+
abandon(runId) {
|
|
5211
|
+
if (parked.has(runId) || !liveMembers.delete(runId)) return;
|
|
5212
|
+
maybeSettle();
|
|
5213
|
+
},
|
|
5214
|
+
arrive(input) {
|
|
5215
|
+
liveMembers.add(input.runId);
|
|
5216
|
+
const parkedPromise = new Promise((settle, fail) => {
|
|
5217
|
+
parked.set(input.runId, { participant: input, settle, fail });
|
|
5218
|
+
});
|
|
5219
|
+
maybeSettle();
|
|
5220
|
+
return parkedPromise;
|
|
5221
|
+
}
|
|
4971
5222
|
};
|
|
4972
5223
|
}
|
|
4973
5224
|
|
|
@@ -7575,9 +7826,7 @@ function assertPostRuntimeToolCompatibility(agentId, spec, effectiveTools, targe
|
|
|
7575
7826
|
);
|
|
7576
7827
|
}
|
|
7577
7828
|
function workerToolCallHardCap(settings) {
|
|
7578
|
-
|
|
7579
|
-
const parsedEnvCap = rawEnvCap && /^[1-9]\d*$/.test(rawEnvCap) ? Number(rawEnvCap) : Number.NaN;
|
|
7580
|
-
return Number.isSafeInteger(parsedEnvCap) ? parsedEnvCap : settings?.fleet.limits.toolCallsPerRun ?? GUARDRAIL_DEFAULTS.workerToolCallCap;
|
|
7829
|
+
return settings?.fleet.limits.toolCallsPerRun ?? GUARDRAIL_DEFAULTS.workerToolCallCap;
|
|
7581
7830
|
}
|
|
7582
7831
|
function resolveEffectiveWorkerBudget(input) {
|
|
7583
7832
|
const hardCap = workerToolCallHardCap(input.settings);
|
|
@@ -8267,6 +8516,17 @@ function createDispatchBundle(context, options) {
|
|
|
8267
8516
|
function configuredEndpointLimits() {
|
|
8268
8517
|
return Object.fromEntries(Object.entries(configuredEndpointCapacities()).map(([key, value]) => [key, value.limit]));
|
|
8269
8518
|
}
|
|
8519
|
+
const probedDefaultBoundEndpoints = /* @__PURE__ */ new Set();
|
|
8520
|
+
function probeEndpointsAtDefaultBound() {
|
|
8521
|
+
const capacities = configuredEndpointCapacities();
|
|
8522
|
+
for (const target of getEffectiveSettings()?.targets ?? []) {
|
|
8523
|
+
const key = canonicalEndpointKey(target);
|
|
8524
|
+
if (key === null || capacities[key]?.source !== "local-native-default") continue;
|
|
8525
|
+
if (probedDefaultBoundEndpoints.has(key)) continue;
|
|
8526
|
+
probedDefaultBoundEndpoints.add(key);
|
|
8527
|
+
void providers.probeTarget(target.id, { reasoning: false }).catch(() => void 0);
|
|
8528
|
+
}
|
|
8529
|
+
}
|
|
8270
8530
|
function endpointCapacityForTarget(targetId) {
|
|
8271
8531
|
const status = providers.list().find((entry) => entry.target.id === targetId);
|
|
8272
8532
|
const target = status?.target ?? providers.getTarget(targetId);
|
|
@@ -8920,6 +9180,17 @@ function createDispatchBundle(context, options) {
|
|
|
8920
9180
|
agentId: req.agentId
|
|
8921
9181
|
});
|
|
8922
9182
|
}
|
|
9183
|
+
const parentTokenDiagnostic = inferredScopeParentTokenDiagnostic(pathScope);
|
|
9184
|
+
if (parentTokenDiagnostic !== null) {
|
|
9185
|
+
reportDispatchDiagnostic("inferred scope parent tokens", new Error(parentTokenDiagnostic));
|
|
9186
|
+
}
|
|
9187
|
+
const parentTokenNotice = inferredScopeParentTokenNotice(pathScope);
|
|
9188
|
+
if (parentTokenNotice !== null) {
|
|
9189
|
+
context.bus.emit(BusChannels.DispatchScopeNotice, {
|
|
9190
|
+
...parentTokenNotice,
|
|
9191
|
+
agentId: req.agentId
|
|
9192
|
+
});
|
|
9193
|
+
}
|
|
8923
9194
|
}
|
|
8924
9195
|
async function resolveLifecycle(req, settings) {
|
|
8925
9196
|
const recipe = agents.get(req.agentId);
|
|
@@ -8941,7 +9212,8 @@ function createDispatchBundle(context, options) {
|
|
|
8941
9212
|
task: req.task,
|
|
8942
9213
|
autoSelected: req.agentSelection?.mode === "auto",
|
|
8943
9214
|
resultContractKind: spec.resultContract.kind,
|
|
8944
|
-
specs: agents.listSpecs()
|
|
9215
|
+
specs: agents.listSpecs(),
|
|
9216
|
+
intent: req.intent ?? null
|
|
8945
9217
|
});
|
|
8946
9218
|
if (capabilityMismatch?.verdict === "refuse") throw new Error(capabilityMismatch.detail);
|
|
8947
9219
|
const pathScope = resolveDispatchPathScope(req);
|
|
@@ -8973,13 +9245,15 @@ function createDispatchBundle(context, options) {
|
|
|
8973
9245
|
allowedTools: effectiveTools
|
|
8974
9246
|
};
|
|
8975
9247
|
const personaBody = workerPersonaBody(req, recipe, effectiveTools);
|
|
9248
|
+
const hasCanonicalContext = effectiveTools.includes(ToolNames.Context);
|
|
9249
|
+
const hasBoundSkills = hasCanonicalContext && recipe.skills !== void 0 && recipe.skills.length > 0 && req.noSkills !== true;
|
|
8976
9250
|
const compiledWorkerPrompt = await prompts.compileWorkerPrompt({
|
|
8977
9251
|
autonomy: effectiveAutonomy,
|
|
8978
9252
|
providerSupportsTools: target.runtime.kind === "subprocess" ? null : targetToolCapability(target),
|
|
8979
9253
|
toolNames: effectiveTools,
|
|
8980
|
-
toolPromptHints: toolPromptHintsForNames(effectiveTools),
|
|
8981
|
-
hasCanonicalContext
|
|
8982
|
-
hasBoundSkills
|
|
9254
|
+
toolPromptHints: toolPromptHintsForNames(effectiveTools, hasBoundSkills ? "bound-worker" : "worker"),
|
|
9255
|
+
hasCanonicalContext,
|
|
9256
|
+
hasBoundSkills,
|
|
8983
9257
|
onPermission: settings?.fleet.permissions.mode ?? "deny",
|
|
8984
9258
|
persona: {
|
|
8985
9259
|
id: `persona.${recipe.id}`,
|
|
@@ -9757,7 +10031,7 @@ function createDispatchBundle(context, options) {
|
|
|
9757
10031
|
finalPromise
|
|
9758
10032
|
};
|
|
9759
10033
|
}
|
|
9760
|
-
async function dispatchAttempt(req, observer) {
|
|
10034
|
+
async function dispatchAttempt(req, observer, settlement) {
|
|
9761
10035
|
const requestedAt = new Date(now()).toISOString();
|
|
9762
10036
|
const timing = { requestedAt, decisionStartedAt: requestedAt };
|
|
9763
10037
|
const settings = getEffectiveSettings();
|
|
@@ -9838,10 +10112,9 @@ function createDispatchBundle(context, options) {
|
|
|
9838
10112
|
}
|
|
9839
10113
|
rebindReservationSlot(req, "local", null, UNKNOWN_PRICING_ADMISSION_ESTIMATE_USD, settings);
|
|
9840
10114
|
routeObservation = observeShadowRoute(req, void 0, settings);
|
|
9841
|
-
|
|
9842
|
-
|
|
9843
|
-
|
|
9844
|
-
});
|
|
10115
|
+
const delegated = await dispatchAcpDelegation(req, settings, timing, routeObservation.decision, observer);
|
|
10116
|
+
settlement?.live(delegated.runId);
|
|
10117
|
+
return attachRouteObservation({ ...delegated, effectiveRequest: req });
|
|
9845
10118
|
}
|
|
9846
10119
|
req = routeAroundCoolingTarget(req, settings) ?? req;
|
|
9847
10120
|
const lifecycle = await resolveLifecycle(req, settings);
|
|
@@ -10590,6 +10863,7 @@ function createDispatchBundle(context, options) {
|
|
|
10590
10863
|
}
|
|
10591
10864
|
return { assessment, rigor };
|
|
10592
10865
|
};
|
|
10866
|
+
settlement?.live(envelope.id);
|
|
10593
10867
|
const finalPromise = (async () => {
|
|
10594
10868
|
try {
|
|
10595
10869
|
const result = await workerDone;
|
|
@@ -10686,12 +10960,13 @@ function createDispatchBundle(context, options) {
|
|
|
10686
10960
|
finalDetail = WORKER_FINAL_OUTPUT_MISSING_DETAIL;
|
|
10687
10961
|
failureMessage = finalDetail;
|
|
10688
10962
|
}
|
|
10689
|
-
const
|
|
10963
|
+
const hostVerificationInput = {
|
|
10690
10964
|
runId: envelope.id,
|
|
10691
10965
|
request: req,
|
|
10692
10966
|
workerSuccessful: finalOutcome === "succeeded",
|
|
10693
10967
|
onDiagnostic: (error) => reportDispatchDiagnostic(`write host verification memo for ${envelope.id}`, error)
|
|
10694
|
-
}
|
|
10968
|
+
};
|
|
10969
|
+
const hostVerification = settlement === void 0 ? await runHostVerification(hostVerificationInput) : await settlement.arrive(hostVerificationInput);
|
|
10695
10970
|
const hostRejection = hostVerificationRejection(hostVerification);
|
|
10696
10971
|
if (hostRejection !== null && finalOutcome === "succeeded") {
|
|
10697
10972
|
finalOutcome = "failed";
|
|
@@ -10854,7 +11129,7 @@ function createDispatchBundle(context, options) {
|
|
|
10854
11129
|
effectiveRequest: req
|
|
10855
11130
|
});
|
|
10856
11131
|
}
|
|
10857
|
-
async function dispatch(req, observer) {
|
|
11132
|
+
async function dispatch(req, observer, settlement) {
|
|
10858
11133
|
let prepared = req;
|
|
10859
11134
|
let createdWorktree;
|
|
10860
11135
|
let writerLease;
|
|
@@ -10897,7 +11172,7 @@ function createDispatchBundle(context, options) {
|
|
|
10897
11172
|
}
|
|
10898
11173
|
let handle;
|
|
10899
11174
|
try {
|
|
10900
|
-
handle = await dispatchAttempt(prepared, observer);
|
|
11175
|
+
handle = await dispatchAttempt(prepared, observer, settlement);
|
|
10901
11176
|
} catch (error) {
|
|
10902
11177
|
writerLease?.release();
|
|
10903
11178
|
if (createdWorktree !== void 0) {
|
|
@@ -10912,6 +11187,10 @@ function createDispatchBundle(context, options) {
|
|
|
10912
11187
|
}
|
|
10913
11188
|
throw error;
|
|
10914
11189
|
}
|
|
11190
|
+
if (settlement !== void 0) {
|
|
11191
|
+
const release = () => settlement.abandon(handle.runId);
|
|
11192
|
+
handle.finalPromise.then(release, release);
|
|
11193
|
+
}
|
|
10915
11194
|
if (req.lineage) return { ...handle, finalPromise: handle.finalPromise.finally(() => writerLease?.release()) };
|
|
10916
11195
|
const assignment = assignments.open(handle.runId, assignmentPolicyFor(handle.effectiveRequest));
|
|
10917
11196
|
persistAssignment(registerAssignment(assignment.id), `${assignment.id}:open`);
|
|
@@ -11217,10 +11496,11 @@ function createDispatchBundle(context, options) {
|
|
|
11217
11496
|
}
|
|
11218
11497
|
async function dispatchBatch(reqs) {
|
|
11219
11498
|
if (reqs.length === 0) throw new Error("dispatch: batch requires at least one request");
|
|
11499
|
+
const settlement = reqs.length > 1 && reqs.some((req) => (req.resolvedVerification?.length ?? 0) > 0) ? createBatchVerificationGate() : void 0;
|
|
11220
11500
|
const handles = [];
|
|
11221
11501
|
try {
|
|
11222
11502
|
for (const req of reqs) {
|
|
11223
|
-
const handle = await dispatch(req);
|
|
11503
|
+
const handle = await dispatch(req, void 0, settlement);
|
|
11224
11504
|
handles.push({ ...handle, agentId: req.agentId });
|
|
11225
11505
|
}
|
|
11226
11506
|
} catch (err) {
|
|
@@ -11407,6 +11687,7 @@ function createDispatchBundle(context, options) {
|
|
|
11407
11687
|
} catch {
|
|
11408
11688
|
}
|
|
11409
11689
|
startHeartbeatWatchdog();
|
|
11690
|
+
probeEndpointsAtDefaultBound();
|
|
11410
11691
|
},
|
|
11411
11692
|
async stop() {
|
|
11412
11693
|
draining = true;
|
|
@@ -11733,22 +12014,6 @@ var DispatchManifest = {
|
|
|
11733
12014
|
dependsOn: ["config", "safety", "agents", "providers", "middleware", "prompts", "scheduling"]
|
|
11734
12015
|
};
|
|
11735
12016
|
|
|
11736
|
-
// src/domains/dispatch/code-step-store.ts
|
|
11737
|
-
init_esm_shims();
|
|
11738
|
-
import { join as join13 } from "node:path";
|
|
11739
|
-
function codeStepDir(rootId) {
|
|
11740
|
-
return join13(clioStateDir(), "code-steps", rootId);
|
|
11741
|
-
}
|
|
11742
|
-
function codeStepRecordPath(rootId, runId) {
|
|
11743
|
-
return join13(codeStepDir(rootId), `${runId}.json`);
|
|
11744
|
-
}
|
|
11745
|
-
async function writeCodeStepRecord(rootId, record) {
|
|
11746
|
-
const path2 = codeStepRecordPath(rootId, record.runId);
|
|
11747
|
-
await atomicWrite(path2, `${JSON.stringify(record, null, 2)}
|
|
11748
|
-
`);
|
|
11749
|
-
return path2;
|
|
11750
|
-
}
|
|
11751
|
-
|
|
11752
12017
|
// src/domains/dispatch/delegation-plan.ts
|
|
11753
12018
|
init_esm_shims();
|
|
11754
12019
|
import { createHash as createHash8 } from "node:crypto";
|
|
@@ -12289,7 +12554,7 @@ function gateFailureLines(output) {
|
|
|
12289
12554
|
init_esm_shims();
|
|
12290
12555
|
import { createHash as createHash9 } from "node:crypto";
|
|
12291
12556
|
import { readFileSync as readFileSync12 } from "node:fs";
|
|
12292
|
-
import { join as
|
|
12557
|
+
import { join as join13 } from "node:path";
|
|
12293
12558
|
|
|
12294
12559
|
// src/domains/observability/cost.ts
|
|
12295
12560
|
init_esm_shims();
|
|
@@ -12573,7 +12838,7 @@ async function executeFleetRun(input) {
|
|
|
12573
12838
|
for (const [stepId, replayedResult] of replayed) {
|
|
12574
12839
|
try {
|
|
12575
12840
|
const receipt = JSON.parse(
|
|
12576
|
-
readFileSync12(
|
|
12841
|
+
readFileSync12(join13(clioStateDir(), "receipts", `${replayedResult.terminalRunId}.json`), "utf8")
|
|
12577
12842
|
);
|
|
12578
12843
|
receiptsByStep.set(stepId, receipt);
|
|
12579
12844
|
} catch {
|
|
@@ -12760,7 +13025,7 @@ async function executeFleetRun(input) {
|
|
|
12760
13025
|
if (step.gate !== void 0 && succeeded) {
|
|
12761
13026
|
let gateBytes = "";
|
|
12762
13027
|
try {
|
|
12763
|
-
gateBytes = readFileSync12(
|
|
13028
|
+
gateBytes = readFileSync12(join13(workspaceRoot, step.gate.path), "utf8");
|
|
12764
13029
|
} catch {
|
|
12765
13030
|
gateBytes = "";
|
|
12766
13031
|
}
|
|
@@ -13329,7 +13594,7 @@ function latestGateDecisionForRun(decisions, runId) {
|
|
|
13329
13594
|
// src/domains/evidence/store.ts
|
|
13330
13595
|
init_esm_shims();
|
|
13331
13596
|
import { readdir, readFile } from "node:fs/promises";
|
|
13332
|
-
import { join as
|
|
13597
|
+
import { join as join14 } from "node:path";
|
|
13333
13598
|
var EVIDENCE_FILES = [
|
|
13334
13599
|
"overview.json",
|
|
13335
13600
|
"transcript.md",
|
|
@@ -13345,11 +13610,11 @@ var EVIDENCE_FILES = [
|
|
|
13345
13610
|
"findings.md"
|
|
13346
13611
|
];
|
|
13347
13612
|
function evidenceRoot(dataDir) {
|
|
13348
|
-
return
|
|
13613
|
+
return join14(dataDir, "evidence");
|
|
13349
13614
|
}
|
|
13350
13615
|
function evidenceDirectory(dataDir, evidenceId) {
|
|
13351
13616
|
assertSafeId(evidenceId, "evidence");
|
|
13352
|
-
return
|
|
13617
|
+
return join14(evidenceRoot(dataDir), evidenceId);
|
|
13353
13618
|
}
|
|
13354
13619
|
var EvidenceNotFoundError = class extends Error {
|
|
13355
13620
|
constructor(evidenceId) {
|
|
@@ -13365,7 +13630,7 @@ function isMissingFile(error) {
|
|
|
13365
13630
|
async function loadEvidenceOverview(dataDir, evidenceId) {
|
|
13366
13631
|
let raw;
|
|
13367
13632
|
try {
|
|
13368
|
-
raw = await readFile(
|
|
13633
|
+
raw = await readFile(join14(evidenceDirectory(dataDir, evidenceId), "overview.json"), "utf8");
|
|
13369
13634
|
} catch (error) {
|
|
13370
13635
|
if (isMissingFile(error)) throw new EvidenceNotFoundError(evidenceId);
|
|
13371
13636
|
throw error;
|
|
@@ -13377,7 +13642,7 @@ async function inspectEvidence(dataDir, evidenceId) {
|
|
|
13377
13642
|
const overview = await loadEvidenceOverview(dataDir, evidenceId);
|
|
13378
13643
|
let findingsRaw;
|
|
13379
13644
|
try {
|
|
13380
|
-
findingsRaw = await readFile(
|
|
13645
|
+
findingsRaw = await readFile(join14(evidenceDirectory(dataDir, evidenceId), "findings.json"), "utf8");
|
|
13381
13646
|
} catch (error) {
|
|
13382
13647
|
if (isMissingFile(error)) throw new Error(`evidence artifact ${evidenceId} is missing findings.json`);
|
|
13383
13648
|
throw error;
|
|
@@ -13389,7 +13654,7 @@ async function inspectEvidence(dataDir, evidenceId) {
|
|
|
13389
13654
|
async function loadEvidenceTrustStatus(dataDir, evidenceId) {
|
|
13390
13655
|
let raw;
|
|
13391
13656
|
try {
|
|
13392
|
-
raw = await readFile(
|
|
13657
|
+
raw = await readFile(join14(evidenceDirectory(dataDir, evidenceId), "trust-status.json"), "utf8");
|
|
13393
13658
|
} catch (error) {
|
|
13394
13659
|
if (isMissingFile(error)) {
|
|
13395
13660
|
return { version: 1, evidenceId, projection: "historical_format", runs: [] };
|
|
@@ -13422,7 +13687,7 @@ async function loadEvidenceTrustStatus(dataDir, evidenceId) {
|
|
|
13422
13687
|
async function loadEvidenceRunProvenance(dataDir, evidenceId) {
|
|
13423
13688
|
let raw;
|
|
13424
13689
|
try {
|
|
13425
|
-
raw = await readFile(
|
|
13690
|
+
raw = await readFile(join14(evidenceDirectory(dataDir, evidenceId), "receipt.json"), "utf8");
|
|
13426
13691
|
} catch (error) {
|
|
13427
13692
|
const err = error;
|
|
13428
13693
|
if (err.code === "ENOENT") return [];
|
|
@@ -13997,22 +14262,22 @@ function finding(index, severity, tag, runId, message) {
|
|
|
13997
14262
|
}
|
|
13998
14263
|
async function writeEvidenceFiles(directory, overview, runSources, findings, sessionLinks, auditLinks, toolEventRows, gateDecisions, trustStatus, protectedArtifacts, transcript) {
|
|
13999
14264
|
await mkdir(directory, { recursive: true });
|
|
14000
|
-
await writeJson(
|
|
14265
|
+
await writeJson(join15(directory, "overview.json"), overview);
|
|
14001
14266
|
await writeFile(
|
|
14002
|
-
|
|
14267
|
+
join15(directory, "transcript.md"),
|
|
14003
14268
|
transcript ?? renderTranscript(overview, runSources, sessionLinks, trustStatus),
|
|
14004
14269
|
"utf8"
|
|
14005
14270
|
);
|
|
14006
|
-
await writeJsonl(
|
|
14007
|
-
await writeJsonl(
|
|
14008
|
-
await writeJsonl(
|
|
14009
|
-
await writeJsonl(
|
|
14010
|
-
await writeJson(
|
|
14011
|
-
await writeJson(
|
|
14012
|
-
await writeJson(
|
|
14013
|
-
await writeJson(
|
|
14014
|
-
await writeJson(
|
|
14015
|
-
await writeFile(
|
|
14271
|
+
await writeJsonl(join15(directory, "trace.raw.jsonl"), rawTraceRows(runSources));
|
|
14272
|
+
await writeJsonl(join15(directory, "trace.cleaned.jsonl"), cleanedTraceRows(runSources, findings, toolEventRows));
|
|
14273
|
+
await writeJsonl(join15(directory, "tool-events.jsonl"), toolEventRows);
|
|
14274
|
+
await writeJsonl(join15(directory, "audit-linked.jsonl"), auditLinks.rows);
|
|
14275
|
+
await writeJson(join15(directory, "receipt.json"), receiptsFile(runSources));
|
|
14276
|
+
await writeJson(join15(directory, "gate-decisions.json"), gateDecisions);
|
|
14277
|
+
await writeJson(join15(directory, "trust-status.json"), trustStatus);
|
|
14278
|
+
await writeJson(join15(directory, "protected-artifacts.json"), protectedArtifacts);
|
|
14279
|
+
await writeJson(join15(directory, "findings.json"), findingsFile(overview.evidenceId, [...findings]));
|
|
14280
|
+
await writeFile(join15(directory, "findings.md"), renderEvidenceFindingsMarkdown(findings, trustStatus), "utf8");
|
|
14016
14281
|
}
|
|
14017
14282
|
function rawTraceRows(runSources) {
|
|
14018
14283
|
const rows = [];
|
|
@@ -14692,7 +14957,7 @@ function axisFindings(offset, source, status) {
|
|
|
14692
14957
|
return out;
|
|
14693
14958
|
}
|
|
14694
14959
|
async function readRunLedger(stateDir) {
|
|
14695
|
-
const target =
|
|
14960
|
+
const target = join15(stateDir, "runs.json");
|
|
14696
14961
|
let raw;
|
|
14697
14962
|
try {
|
|
14698
14963
|
raw = await readFile2(target, "utf8");
|
|
@@ -14713,7 +14978,7 @@ function selectRunEnvelopes(ledger, source) {
|
|
|
14713
14978
|
});
|
|
14714
14979
|
}
|
|
14715
14980
|
async function readReceipt(stateDir, envelope) {
|
|
14716
|
-
const receiptPath = envelope.receiptPath ??
|
|
14981
|
+
const receiptPath = envelope.receiptPath ?? join15(stateDir, "receipts", `${envelope.id}.json`);
|
|
14717
14982
|
let raw;
|
|
14718
14983
|
try {
|
|
14719
14984
|
raw = await readFile2(receiptPath, "utf8");
|
|
@@ -15006,7 +15271,7 @@ function sanitizeEvidenceId(value) {
|
|
|
15006
15271
|
// src/domains/evidence/eval.ts
|
|
15007
15272
|
init_esm_shims();
|
|
15008
15273
|
import { mkdir as mkdir2, readdir as readdir2, readFile as readFile3, writeFile as writeFile2 } from "node:fs/promises";
|
|
15009
|
-
import { join as
|
|
15274
|
+
import { join as join16 } from "node:path";
|
|
15010
15275
|
|
|
15011
15276
|
// src/domains/eval/index.ts
|
|
15012
15277
|
init_esm_shims();
|
|
@@ -15207,19 +15472,19 @@ async function writeEvalEvidenceFiles(directory, artifact, overview, findings, t
|
|
|
15207
15472
|
};
|
|
15208
15473
|
const redactedArtifact = redactArtifactForStorage(artifact);
|
|
15209
15474
|
await mkdir2(directory, { recursive: true });
|
|
15210
|
-
await writeJson2(
|
|
15211
|
-
await writeFile2(
|
|
15212
|
-
await writeJsonl2(
|
|
15213
|
-
await writeJsonl2(
|
|
15214
|
-
await writeJsonl2(
|
|
15215
|
-
await writeJsonl2(
|
|
15216
|
-
await writeJson2(
|
|
15217
|
-
await writeJson2(
|
|
15218
|
-
await writeJson2(
|
|
15219
|
-
await writeJson2(
|
|
15220
|
-
await writeJson2(
|
|
15221
|
-
await writeJson2(
|
|
15222
|
-
await writeFile2(
|
|
15475
|
+
await writeJson2(join16(directory, "overview.json"), overview);
|
|
15476
|
+
await writeFile2(join16(directory, "transcript.md"), renderEvalTranscript(redactedArtifact, overview), "utf8");
|
|
15477
|
+
await writeJsonl2(join16(directory, "trace.raw.jsonl"), rawEvalTraceRows(redactedArtifact));
|
|
15478
|
+
await writeJsonl2(join16(directory, "trace.cleaned.jsonl"), cleanedEvalTraceRows(redactedArtifact, findings));
|
|
15479
|
+
await writeJsonl2(join16(directory, "tool-events.jsonl"), redactArtifactForStorage(toolEventRows));
|
|
15480
|
+
await writeJsonl2(join16(directory, "audit-linked.jsonl"), linkedRuns.auditRows);
|
|
15481
|
+
await writeJson2(join16(directory, "receipt.json"), receiptsFile2);
|
|
15482
|
+
await writeJson2(join16(directory, "gate-decisions.json"), gateDecisions);
|
|
15483
|
+
await writeJson2(join16(directory, "trust-status.json"), trustStatus);
|
|
15484
|
+
await writeJson2(join16(directory, "protected-artifacts.json"), emptyProtected);
|
|
15485
|
+
await writeJson2(join16(directory, "eval-result.json"), redactedArtifact);
|
|
15486
|
+
await writeJson2(join16(directory, "findings.json"), findingsFile(overview.evidenceId, [...findings]));
|
|
15487
|
+
await writeFile2(join16(directory, "findings.md"), renderEvidenceFindingsMarkdown(findings, trustStatus), "utf8");
|
|
15223
15488
|
}
|
|
15224
15489
|
function rawEvalTraceRows(artifact) {
|
|
15225
15490
|
return artifact.results.map((result) => ({
|
|
@@ -15360,7 +15625,7 @@ async function linkEvalRuns(stateDir, artifact) {
|
|
|
15360
15625
|
}
|
|
15361
15626
|
async function readRunLedger2(stateDir) {
|
|
15362
15627
|
try {
|
|
15363
|
-
const raw = await readFile3(
|
|
15628
|
+
const raw = await readFile3(join16(stateDir, "runs.json"), "utf8");
|
|
15364
15629
|
const parsed = JSON.parse(raw);
|
|
15365
15630
|
return Array.isArray(parsed) ? parsed.filter(isRecord12) : [];
|
|
15366
15631
|
} catch {
|
|
@@ -15371,7 +15636,7 @@ function evalRunMatches(artifact, envelope) {
|
|
|
15371
15636
|
return artifact.results.some((result) => result.runId === envelope.id);
|
|
15372
15637
|
}
|
|
15373
15638
|
async function readReceiptForRun(stateDir, envelope) {
|
|
15374
|
-
const path2 = envelope.receiptPath ??
|
|
15639
|
+
const path2 = envelope.receiptPath ?? join16(stateDir, "receipts", `${envelope.id}.json`);
|
|
15375
15640
|
try {
|
|
15376
15641
|
const parsed = JSON.parse(await readFile3(path2, "utf8"));
|
|
15377
15642
|
return isRecord12(parsed) ? parsed : null;
|
|
@@ -15400,7 +15665,7 @@ async function countSessionEntries(stateDir, sessionIds) {
|
|
|
15400
15665
|
return count;
|
|
15401
15666
|
}
|
|
15402
15667
|
async function findSessionLedgerPath(stateDir, sessionId) {
|
|
15403
|
-
const root =
|
|
15668
|
+
const root = join16(stateDir, "sessions");
|
|
15404
15669
|
let cwdHashes;
|
|
15405
15670
|
try {
|
|
15406
15671
|
cwdHashes = await readdir2(root);
|
|
@@ -15408,7 +15673,7 @@ async function findSessionLedgerPath(stateDir, sessionId) {
|
|
|
15408
15673
|
return null;
|
|
15409
15674
|
}
|
|
15410
15675
|
for (const cwdHash of cwdHashes) {
|
|
15411
|
-
const path2 =
|
|
15676
|
+
const path2 = join16(root, cwdHash, sessionId, "current.jsonl");
|
|
15412
15677
|
try {
|
|
15413
15678
|
await readFile3(path2, "utf8");
|
|
15414
15679
|
return path2;
|
|
@@ -15418,7 +15683,7 @@ async function findSessionLedgerPath(stateDir, sessionId) {
|
|
|
15418
15683
|
return null;
|
|
15419
15684
|
}
|
|
15420
15685
|
async function linkedEvalAuditRows(stateDir, runIds, artifact) {
|
|
15421
|
-
const root =
|
|
15686
|
+
const root = join16(stateDir, "audit");
|
|
15422
15687
|
let files;
|
|
15423
15688
|
try {
|
|
15424
15689
|
files = await readdir2(root);
|
|
@@ -15427,7 +15692,7 @@ async function linkedEvalAuditRows(stateDir, runIds, artifact) {
|
|
|
15427
15692
|
}
|
|
15428
15693
|
const rows = [];
|
|
15429
15694
|
for (const file of files.filter((name) => name.endsWith(".jsonl")).sort(compareCodepoints)) {
|
|
15430
|
-
const raw = await readFile3(
|
|
15695
|
+
const raw = await readFile3(join16(root, file), "utf8").catch(() => "");
|
|
15431
15696
|
const lines = raw.split("\n");
|
|
15432
15697
|
for (let index = 0; index < lines.length; index += 1) {
|
|
15433
15698
|
const line = lines[index];
|
|
@@ -15715,4 +15980,4 @@ export {
|
|
|
15715
15980
|
summarizeEvalResults,
|
|
15716
15981
|
buildEvalEvidence
|
|
15717
15982
|
};
|
|
15718
|
-
//# sourceMappingURL=chunk-
|
|
15983
|
+
//# sourceMappingURL=chunk-I66ZTYNP.js.map
|