@iowarp/clio-coder 0.3.3 → 0.3.6
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 +74 -0
- package/CONTRIBUTING.md +7 -7
- package/README.md +3 -3
- package/dist/{acp-P2AQILE2.js → acp-2BEHC4DL.js} +9 -8
- package/dist/{agents-72W3BI7I.js → agents-LNNFTM53.js} +29 -24
- package/dist/assets/codewiki.json +1 -1
- package/dist/{auth-5TWEIYDN.js → auth-KXXFI2VS.js} +14 -10
- package/dist/{chunk-GGXXDWE4.js → chunk-22NAGB7X.js} +2 -2
- package/dist/{chunk-YCWGATWI.js → chunk-24I7BN55.js} +2 -2
- package/dist/{chunk-EKMEHE4H.js → chunk-33YXPOE3.js} +2 -3
- package/dist/chunk-3BPUFZDL.js +37 -0
- package/dist/chunk-43AOLP7E.js +375 -0
- package/dist/{chunk-ZDOOVTXZ.js → chunk-4OC57DA6.js} +27 -4
- package/dist/{chunk-6SGHMWE3.js → chunk-5JGRAMKL.js} +5 -5
- package/dist/{chunk-V6RTAOC2.js → chunk-6US73PDB.js} +572 -51
- package/dist/{chunk-5UFT4SUX.js → chunk-6XXKFVSN.js} +3 -3
- package/dist/{chunk-A3CYT5EX.js → chunk-AD2SYQYC.js} +55 -2
- package/dist/chunk-AOCYTWAV.js +449 -0
- package/dist/chunk-CFGTUFWB.js +67 -0
- package/dist/chunk-CJUB2JJ2.js +1478 -0
- package/dist/{chunk-FNTMWMX5.js → chunk-CKXWIANG.js} +14 -12
- package/dist/{chunk-PIWWS5BL.js → chunk-CYQKWTG3.js} +63 -78
- package/dist/{chunk-LZSJBIVT.js → chunk-DJVECN66.js} +271 -762
- package/dist/{chunk-CBCAPZAA.js → chunk-E25LMLRW.js} +2 -2
- package/dist/{chunk-ZWMF7253.js → chunk-E2ER4LJF.js} +304 -9
- package/dist/{chunk-STBPMHSX.js → chunk-EKY57CSP.js} +51 -84
- package/dist/{chunk-DUYJ5IO6.js → chunk-EYPA3EGJ.js} +12 -4
- package/dist/{chunk-M6SHUN7Q.js → chunk-FO5ZOVUY.js} +2 -2
- package/dist/chunk-FYYLNIL5.js +313 -0
- package/dist/{chunk-OQ33BKR3.js → chunk-G7MUEIGA.js} +3 -60
- package/dist/chunk-GEYXPTRF.js +613 -0
- package/dist/chunk-GOXNB3AO.js +261 -0
- package/dist/{chunk-G4BMMOKF.js → chunk-HVDIIIQW.js} +2 -2
- package/dist/chunk-HWUFFB6L.js +83 -0
- package/dist/{chunk-4XUGQOHA.js → chunk-K7T3E2SR.js} +15 -8
- package/dist/chunk-K7VKOLQQ.js +15 -0
- package/dist/{chunk-UFIIWP2H.js → chunk-KHSFENX2.js} +8 -8
- package/dist/{chunk-BMEMKKIT.js → chunk-KOHPCX4K.js} +2 -2
- package/dist/chunk-LCGCVYZ4.js +57 -0
- package/dist/chunk-LL4KHSZI.js +22 -0
- package/dist/{chunk-PAJK6MAQ.js → chunk-LYF7OHWH.js} +42 -15
- package/dist/{chunk-POHLU5DW.js → chunk-M6L6IDJG.js} +3 -3
- package/dist/{chunk-5UUP6MWO.js → chunk-MV3K5QF2.js} +5 -436
- package/dist/{chunk-X4RCMKVQ.js → chunk-NDINPTJ4.js} +2 -2
- package/dist/{chunk-TZK7PACC.js → chunk-NILBFAPG.js} +14 -8
- package/dist/chunk-ODFEOB4F.js +1082 -0
- package/dist/{chunk-AGYYIBLL.js → chunk-OH3TOQTB.js} +6 -2
- package/dist/chunk-OZNBF4L3.js +23 -0
- package/dist/{chunk-DSELYM6W.js → chunk-PBTHKCPN.js} +30 -10
- package/dist/{verify-375KUB3Y.js → chunk-PCZJO5TI.js} +127 -42
- package/dist/{chunk-ED4KHGC3.js → chunk-PPAMZ32Z.js} +9 -2
- package/dist/{chunk-SRDMMSEP.js → chunk-QM3F2GKX.js} +1063 -1645
- package/dist/{chunk-X6IAEBZR.js → chunk-QNQHSOLF.js} +7 -7
- package/dist/{chunk-OC7FIQPC.js → chunk-R46L2BIR.js} +10 -7
- package/dist/{chunk-2TLUCQVG.js → chunk-RD5U66HV.js} +3 -3
- package/dist/{chunk-6N5PTWMY.js → chunk-RY3LY4J5.js} +50 -13
- package/dist/{chunk-OKGUZO2U.js → chunk-SPULKLCF.js} +4 -3
- package/dist/{chunk-OOJYHWRB.js → chunk-TSHXZTOQ.js} +6 -5
- package/dist/chunk-TZSKNMZG.js +434 -0
- package/dist/{chunk-7MNJORFF.js → chunk-UL3WSD3F.js} +6 -1
- package/dist/{chunk-VJWL6YS5.js → chunk-UUVG37B4.js} +2 -2
- package/dist/{chunk-COU2UHX6.js → chunk-VEZEGCGW.js} +170 -2
- package/dist/chunk-W6GROXXM.js +69 -0
- package/dist/{chunk-OAO4GE4M.js → chunk-WHGPSPT5.js} +2 -2
- package/dist/chunk-WHJYKASB.js +677 -0
- package/dist/{chunk-ORBHGJC5.js → chunk-WR67VIZY.js} +3 -3
- package/dist/{chunk-YHZX5GEU.js → chunk-XAKHZX5N.js} +2 -2
- package/dist/{chunk-TZTZS7QK.js → chunk-XE2VEJHX.js} +5 -3
- package/dist/{chunk-LM5TQCJZ.js → chunk-XF5N4U5A.js} +8 -7
- package/dist/{chunk-LWLEKMDQ.js → chunk-XXQNGV4M.js} +1073 -552
- package/dist/{chunk-KZWTDYJF.js → chunk-XYDYPRZI.js} +7 -7
- package/dist/chunk-ZGVHUX3M.js +66 -0
- package/dist/{chunk-LW6DSM3M.js → chunk-ZRGEBJ4T.js} +1192 -1119
- package/dist/{chunk-2DJ2KNFG.js → chunk-ZXF4XRKW.js} +202 -40
- package/dist/chunk-ZZMN5OM4.js +122 -0
- package/dist/cli/index.js +34 -30
- package/dist/{clio-JOU4FXVA.js → clio-M2KGYUFZ.js} +7 -6
- package/dist/{code-nav-7AX6FYE6.js → code-nav-GQNL7XA6.js} +8 -6
- package/dist/codewiki/build-worker.js +4 -4
- package/dist/{components-KELWS457.js → components-5TTYYX6G.js} +3 -3
- package/dist/{config-XCDVKR23.js → config-XUUYQIWO.js} +47 -35
- package/dist/{configure-4GAP54ZW.js → configure-IHJ7YOMV.js} +18 -15
- package/dist/{context-77FM5DV5.js → context-74JLXAWD.js} +18 -10
- package/dist/{context-4UOGGLQ5.js → context-75MIWW3U.js} +41 -29
- package/dist/{context-5VKGUVJJ.js → context-ZQ7SIFJV.js} +85 -9
- package/dist/{context-clear-XXJRLCJJ.js → context-clear-GYKWNUML.js} +41 -29
- package/dist/{context-index-BZ4UYMTC.js → context-index-SSR5ECNE.js} +3 -3
- package/dist/context-working-set-UX5KEP4J.js +1553 -0
- package/dist/{dispatch-runner-QPRDDBDX.js → dispatch-runner-GIJBHNFL.js} +47 -32
- package/dist/{docs-2C2LTVT2.js → docs-6FZSCG5B.js} +3 -3
- package/dist/{doctor-HR46URBJ.js → doctor-SVJ5BZCW.js} +12 -12
- package/dist/{eval-XSSNATB4.js → eval-CG6LLBLD.js} +54 -238
- package/dist/{evidence-6HG2PY2B.js → evidence-ZYFIEN42.js} +57 -28
- package/dist/{evolve-K7YU3NCY.js → evolve-QGEXEMDW.js} +36 -25
- package/dist/{extensions-QVDOHDGJ.js → extensions-ADGNCJJD.js} +3 -3
- package/dist/{fleet-VY3HHKN6.js → fleet-S5R4ZOQY.js} +73 -44
- package/dist/{fleet-preflight-DDN536IT.js → fleet-preflight-BHSNPBMH.js} +3 -3
- package/dist/{init-JYGXI3FK.js → init-5DRU55YR.js} +49 -37
- package/dist/memory-7YKKR6UC.js +467 -0
- package/dist/{models-I5QWSEOM.js → models-ZPOLRU2C.js} +24 -21
- package/dist/{monitor-GE4ID3IA.js → monitor-US5F5YGZ.js} +73 -46
- package/dist/{orchestrator-EM5MC3HM.js → orchestrator-E2AL4T5N.js} +1624 -1007
- package/dist/{paths-UXLN5YYZ.js → paths-E7KYAQWE.js} +3 -3
- package/dist/{reset-L2FQEE3E.js → reset-KZ652EK6.js} +6 -5
- package/dist/{run-ZU3QMZPZ.js → run-SRNBKDWD.js} +76 -54
- package/dist/{share-S5BZQC5I.js → share-CGZE33UP.js} +7 -6
- package/dist/{skills-X5VXCRNQ.js → skills-S2X4DLY5.js} +4 -4
- package/dist/{skills-eval-WKIHWTHR.js → skills-eval-W2GGIC4R.js} +40 -29
- package/dist/{targets-SNCPI2NR.js → targets-54SWINWB.js} +28 -23
- package/dist/{terminal-lease-BNAHVHBS.js → terminal-lease-SAIF2OGY.js} +6 -4
- package/dist/{uninstall-FZCQCDKC.js → uninstall-BVLWXKBT.js} +3 -3
- package/dist/{upgrade-JQHHPQ4K.js → upgrade-JKAR27XC.js} +20 -19
- package/dist/{usage-OR4O5SMZ.js → usage-MSAWCLX4.js} +79 -36
- package/dist/verifiers-NCBTHHN2.js +1220 -0
- package/dist/verify-X5HDROLA.js +25 -0
- package/dist/{wiki-generate-UEXP2ARI.js → wiki-generate-GUSOQ6ZP.js} +50 -37
- package/dist/worker/entry.js +90 -70
- package/dist/{workspace-G4ZWUIPR.js → workspace-ZJ6BFM3Q.js} +4 -4
- package/docs/README.md +8 -7
- package/docs/acp.md +1 -1
- package/docs/alcf-provider.md +1 -1
- package/docs/architecture.md +2 -2
- package/docs/artifact-placement.md +1 -2
- package/docs/artifact-versions.md +1 -1
- package/docs/built-in-agents.md +1 -1
- package/docs/capacity-and-scheduling.md +1 -1
- package/docs/commands-and-modes.md +60 -26
- package/docs/config-knobs-audit.md +1 -2
- package/docs/configuration-and-targets.md +26 -1
- package/docs/context-engine.md +67 -13
- package/docs/context-working-set.md +194 -0
- package/docs/development-pipeline.md +1 -1
- package/docs/documentation-coverage.md +6 -6
- package/docs/documentation-guide.md +7 -6
- package/docs/environment-variables.md +2 -1
- package/docs/eval-runner.md +1 -1
- package/docs/evals-internal.md +4 -32
- package/docs/evidence-and-memory.md +139 -7
- package/docs/evolution.md +1 -1
- package/docs/exit-codes-and-output.md +1 -1
- package/docs/extensions-and-sharing.md +2 -2
- package/docs/fleet-dispatch.md +49 -8
- package/docs/glossary.md +21 -1
- package/docs/installation-and-lifecycle.md +2 -2
- package/docs/middleware-and-components.md +19 -2
- package/docs/model-catalog.md +7 -9
- package/docs/observability.md +4 -4
- package/docs/proactive-memory.md +26 -16
- package/docs/prompt-envelope-and-tools.md +7 -5
- package/docs/provider-adapter-cookbook.md +1 -1
- package/docs/release-cut-checklist.md +43 -40
- package/docs/safety-model.md +49 -8
- package/docs/scientific-validation.md +21 -3
- package/docs/session-lifecycle.md +3 -3
- package/docs/skills-marketplace.md +1 -1
- package/docs/tool-usage.md +79 -12
- package/docs/trace-store.md +1 -1
- package/docs/troubleshooting.md +1 -1
- package/docs/tui-design.md +38 -4
- package/docs/worker-dispatch-mechanics.md +11 -1
- package/package.json +13 -13
- package/skills/meta/clio-test/SKILL.md +20 -17
- package/skills/meta/clio-test/evals.md +3 -3
- package/skills/meta/clio-test/references/harness.md +35 -6
- package/skills/meta/clio-test/references/test-map.md +20 -10
- package/skills/registry.yaml +2 -2
- package/skills/skill-marketplace.json +1 -1
- package/src/cli/agents.ts +2 -3
- package/src/cli/argv.ts +14 -1
- package/src/cli/context-working-set.ts +513 -0
- package/src/cli/context.ts +8 -0
- package/src/cli/evidence.ts +20 -2
- package/src/cli/fleet.ts +15 -0
- package/src/cli/index.ts +5 -1
- package/src/cli/memory.ts +272 -10
- package/src/cli/modes/json-stream.ts +2 -2
- package/src/cli/modes/print.ts +12 -1
- package/src/cli/run.ts +22 -2
- package/src/cli/targets.ts +12 -3
- package/src/cli/usage.ts +55 -7
- package/src/cli/verifiers.ts +325 -0
- package/src/core/bash-exec.ts +39 -14
- package/src/core/bus-events.ts +22 -4
- package/src/core/config.ts +54 -0
- package/src/core/defaults.ts +50 -3
- package/src/core/response-model-id.ts +134 -0
- package/src/core/toml.ts +62 -0
- package/src/core/verification-scripts.ts +6 -0
- package/src/core/workspace-files.ts +0 -1
- package/src/domains/agents/builtins/architect.md +1 -1
- package/src/domains/agents/builtins/verifier.md +3 -0
- package/src/domains/agents/catalog.ts +5 -4
- package/src/domains/agents/recipe.ts +54 -14
- package/src/domains/agents/result-contract.ts +7 -4
- package/src/domains/config/classify.ts +1 -0
- package/src/domains/context/bootstrap.ts +36 -27
- package/src/domains/context/project-metadata.ts +19 -63
- package/src/domains/context/prompt-context.ts +8 -0
- package/src/domains/context/working-set/contract.ts +161 -0
- package/src/domains/context/working-set/defaults.ts +28 -0
- package/src/domains/context/working-set/engine.ts +203 -0
- package/src/domains/context/working-set/fold.ts +62 -0
- package/src/domains/context/working-set/horizon.ts +38 -0
- package/src/domains/context/working-set/marker.ts +103 -0
- package/src/domains/context/working-set/path-index.ts +436 -0
- package/src/domains/context/working-set/payload.ts +152 -0
- package/src/domains/context/working-set/policies/age-horizon.ts +55 -0
- package/src/domains/context/working-set/policies/index.ts +20 -0
- package/src/domains/context/working-set/policies/structural.ts +160 -0
- package/src/domains/context/working-set/project.ts +132 -0
- package/src/domains/context/working-set/protect.ts +109 -0
- package/src/domains/context/working-set/recall.ts +177 -0
- package/src/domains/context/working-set/replay/controls.ts +112 -0
- package/src/domains/context/working-set/replay/load-clio.ts +199 -0
- package/src/domains/context/working-set/replay/metrics.ts +185 -0
- package/src/domains/context/working-set/replay/reference-graph.ts +79 -0
- package/src/domains/context/working-set/replay/report.ts +139 -0
- package/src/domains/context/working-set/replay/runner.ts +325 -0
- package/src/domains/context/working-set/replay/synthetic.ts +422 -0
- package/src/domains/context/working-set/replay/trace.ts +21 -0
- package/src/domains/context/working-set/visible.ts +54 -0
- package/src/domains/dispatch/budget-envelope.ts +396 -0
- package/src/domains/dispatch/contract.ts +2 -0
- package/src/domains/dispatch/extension.ts +81 -27
- package/src/domains/dispatch/orphan-recovery.ts +1 -0
- package/src/domains/dispatch/receipt-integrity.ts +4 -0
- package/src/domains/dispatch/state.ts +1 -0
- package/src/domains/dispatch/types.ts +10 -3
- package/src/domains/dispatch/validation.ts +14 -0
- package/src/domains/dispatch/worker-spawn.ts +14 -3
- package/src/domains/eval/metrics/evidence.ts +0 -116
- package/src/domains/eval/metrics/invariants.ts +1 -1
- package/src/domains/eval/runners/clio-run.ts +1 -10
- package/src/domains/eval/runners/external-command.ts +2 -29
- package/src/domains/eval/schema/suite.ts +0 -7
- package/src/domains/eval/suites/run.ts +1 -7
- package/src/domains/evidence/build.ts +112 -45
- package/src/domains/evidence/eval.ts +24 -7
- package/src/domains/evidence/index.ts +53 -0
- package/src/domains/evidence/ordering.ts +12 -0
- package/src/domains/evidence/run-trust.ts +221 -0
- package/src/domains/evidence/store.ts +46 -6
- package/src/domains/evidence/trust-status.ts +854 -0
- package/src/domains/evidence/types.ts +26 -0
- package/src/domains/memory/index.ts +22 -0
- package/src/domains/memory/operations.ts +58 -1
- package/src/domains/memory/promotion.ts +281 -0
- package/src/domains/memory/prompt-section.ts +25 -5
- package/src/domains/memory/proposal.ts +51 -7
- package/src/domains/memory/task-bank.ts +3 -2
- package/src/domains/memory/task-memory-handoff.ts +181 -24
- package/src/domains/memory/task-memory-policy.ts +3 -1
- package/src/domains/memory/types.ts +37 -0
- package/src/domains/memory/validate.ts +178 -0
- package/src/domains/middleware/memory-intervention.ts +38 -25
- package/src/domains/middleware/runtime.ts +6 -0
- package/src/domains/middleware/skills-reminder.ts +19 -4
- package/src/domains/middleware/stalled-turn.ts +208 -5
- package/src/domains/middleware/types.ts +10 -0
- package/src/domains/observability/contract.ts +6 -1
- package/src/domains/observability/cost.ts +20 -4
- package/src/domains/observability/extension.ts +2 -2
- package/src/domains/providers/index.ts +3 -0
- package/src/domains/providers/model-discovery.ts +9 -0
- package/src/domains/providers/runtime-resolution.ts +38 -1
- package/src/domains/providers/runtimes/common/probe-helpers.ts +97 -16
- package/src/domains/providers/types/context-window-slots.ts +18 -0
- package/src/domains/providers/types/runtime-descriptor.ts +3 -1
- package/src/domains/safety/autonomy.ts +1 -1
- package/src/domains/safety/call-target.ts +211 -14
- package/src/domains/safety/decision-presentation.ts +268 -0
- package/src/domains/safety/default-path-policy.ts +8 -0
- package/src/domains/safety/finish-contract.ts +4 -3
- package/src/domains/safety/policy-engine.ts +48 -6
- package/src/domains/safety/redaction.ts +73 -0
- package/src/domains/session/compaction/compact.ts +23 -1
- package/src/domains/session/compaction/cut-point.ts +2 -0
- package/src/domains/session/compaction/tokens.ts +16 -1
- package/src/domains/session/context-ledger.ts +12 -1
- package/src/domains/session/decision-board.ts +4 -0
- package/src/domains/session/entries.ts +110 -1
- package/src/domains/session/history.ts +68 -19
- package/src/domains/session/manager.ts +9 -2
- package/src/domains/session/migrations/index.ts +22 -3
- package/src/domains/session/usage.ts +24 -7
- package/src/engine/acp/event-mapper.ts +7 -0
- package/src/engine/acp/server.ts +32 -2
- package/src/engine/agent.ts +18 -1
- package/src/engine/apis/lmstudio.ts +25 -4
- package/src/engine/apis/openai-completions.ts +147 -22
- package/src/engine/claude/sdk-runtime.ts +8 -2
- package/src/engine/claude/tool-safety.ts +13 -0
- package/src/engine/loop-guard.ts +27 -3
- package/src/engine/session.ts +9 -3
- package/src/engine/worker-events.ts +4 -3
- package/src/engine/worker-runtime.ts +59 -54
- package/src/entry/orchestrator.ts +34 -5
- package/src/interactive/chat-loop-messages.ts +40 -6
- package/src/interactive/chat-loop.ts +13 -0
- package/src/interactive/chat-panel.ts +17 -1
- package/src/interactive/chat-renderer.ts +49 -24
- package/src/interactive/clio-editor.ts +44 -7
- package/src/interactive/context-meter.ts +10 -0
- package/src/interactive/context-overlay.ts +120 -7
- package/src/interactive/context-recall-command.ts +110 -0
- package/src/interactive/cost-overlay.ts +39 -8
- package/src/interactive/dispatch-board.ts +212 -35
- package/src/interactive/footer/widgets.ts +13 -0
- package/src/interactive/interactive-application.ts +6 -1
- package/src/interactive/interactive-input-runtime.ts +11 -1
- package/src/interactive/interactive-presentation.ts +11 -1
- package/src/interactive/interactive-slash-runtime.ts +37 -1
- package/src/interactive/memory-overlay.ts +89 -4
- package/src/interactive/model-session-replay.ts +21 -0
- package/src/interactive/overlay-ask-user-lifecycle.ts +1 -1
- package/src/interactive/overlay-frame.ts +5 -2
- package/src/interactive/overlay-general-openers.ts +46 -1
- package/src/interactive/overlay-key-routing.ts +41 -1
- package/src/interactive/overlay-lifecycle.ts +11 -4
- package/src/interactive/overlay-permission-lifecycle.ts +23 -8
- package/src/interactive/overlay-session-lifecycle.ts +8 -4
- package/src/interactive/overlay-transitions.ts +11 -0
- package/src/interactive/overlays/ask-user.ts +74 -30
- package/src/interactive/overlays/decisions.ts +3 -1
- package/src/interactive/permission-hint.ts +35 -0
- package/src/interactive/permission-overlay.ts +95 -45
- package/src/interactive/renderers/tool-execution.ts +37 -51
- package/src/interactive/session-last-turn.ts +8 -1
- package/src/interactive/session-transcript.ts +2 -2
- package/src/interactive/session-usage-reseed.ts +36 -10
- package/src/interactive/slash-commands.ts +31 -4
- package/src/interactive/status/summary.ts +5 -0
- package/src/interactive/status/types.ts +5 -0
- package/src/interactive/terminal-lease.ts +1 -0
- package/src/interactive/turn-context.ts +333 -110
- package/src/interactive/turn-middleware.ts +7 -6
- package/src/interactive/turn-runtime.ts +37 -8
- package/src/interactive/turn-state.ts +3 -0
- package/src/interactive/worker-progress.ts +440 -0
- package/src/interactive/worker-stream.ts +51 -110
- package/src/tools/agent-tools.ts +39 -7
- package/src/tools/ask-user.ts +21 -1
- package/src/tools/bash.ts +144 -82
- package/src/tools/builtin-tool-catalog.ts +11 -5
- package/src/tools/context/index.ts +107 -5
- package/src/tools/context/surface.ts +3 -2
- package/src/tools/core-bootstrap.ts +21 -0
- package/src/tools/dispatch-arguments.ts +8 -0
- package/src/tools/dispatch-event-text.ts +19 -0
- package/src/tools/dispatch-runner.ts +9 -7
- package/src/tools/dispatch.ts +24 -1
- package/src/tools/monitor.ts +43 -20
- package/src/tools/registry.ts +72 -10
- package/src/tools/result-disposition.ts +706 -0
- package/src/tools/result-shaping.ts +321 -20
- package/src/tools/safe-exec.ts +2 -0
- package/src/tools/verify/authoring.ts +1120 -0
- package/src/tools/verify/catalog.ts +346 -0
- package/src/tools/verify/index.ts +13 -3
- package/src/tools/verify/scripts.ts +135 -37
- package/src/tools/verify/surface.ts +9 -5
- package/src/tools/worker-evidence.ts +54 -12
- package/src/worker/spec-contract.ts +43 -3
- package/dist/chunk-J7CWMCQD.js +0 -255
- package/dist/chunk-T6YILFSB.js +0 -80
- package/dist/chunk-VAKQQHWR.js +0 -434
- package/dist/chunk-VPAYEGVX.js +0 -184
- package/dist/chunk-XBXAASKX.js +0 -18
- package/dist/memory-WFZMGYHX.js +0 -236
- package/src/domains/eval/metrics/chaos-stream.ts +0 -93
|
@@ -76,6 +76,8 @@ export const RECEIPT_INTEGRITY_FIELD_COVERAGE = {
|
|
|
76
76
|
agentAudience: true,
|
|
77
77
|
requestOrigin: true,
|
|
78
78
|
task: true,
|
|
79
|
+
// Historical receipts omit this field, so their receipt and ledger payloads remain unchanged.
|
|
80
|
+
budget: true,
|
|
79
81
|
targetId: true,
|
|
80
82
|
wireModelId: true,
|
|
81
83
|
runtimeId: true,
|
|
@@ -179,6 +181,7 @@ function ledgerDigestFields(envelope: RunEnvelope): Record<string, unknown> {
|
|
|
179
181
|
agentId: envelope.agentId,
|
|
180
182
|
executionRole: envelope.executionRole,
|
|
181
183
|
task: envelope.task,
|
|
184
|
+
...(envelope.budget !== undefined ? { budget: envelope.budget } : {}),
|
|
182
185
|
targetId: envelope.targetId,
|
|
183
186
|
wireModelId: envelope.wireModelId,
|
|
184
187
|
runtimeId: envelope.runtimeId,
|
|
@@ -356,6 +359,7 @@ function firstLedgerMismatch(receipt: RunReceipt, envelope: RunEnvelope): string
|
|
|
356
359
|
if (!Object.is(receiptValue, ledgerValue)) return field;
|
|
357
360
|
}
|
|
358
361
|
if (canonicalJson(receipt.briefing ?? null) !== canonicalJson(envelope.briefing ?? null)) return "briefing";
|
|
362
|
+
if (canonicalJson(receipt.budget ?? null) !== canonicalJson(envelope.budget ?? null)) return "budget";
|
|
359
363
|
if (canonicalJson(receipt.steering ?? null) !== canonicalJson(envelope.steering ?? null)) return "steering";
|
|
360
364
|
return null;
|
|
361
365
|
}
|
|
@@ -175,6 +175,7 @@ export function openLedger(opts?: LedgerOptions): Ledger {
|
|
|
175
175
|
...(input.agentAudience !== undefined ? { agentAudience: input.agentAudience } : {}),
|
|
176
176
|
...(input.requestOrigin !== undefined ? { requestOrigin: input.requestOrigin } : {}),
|
|
177
177
|
task: input.task,
|
|
178
|
+
...(input.budget !== undefined ? { budget: structuredClone(input.budget) } : {}),
|
|
178
179
|
...(input.briefing !== undefined ? { briefing: structuredClone(input.briefing) } : {}),
|
|
179
180
|
...(input.steering !== undefined ? { steering: structuredClone(input.steering) } : {}),
|
|
180
181
|
targetId: input.targetId,
|
|
@@ -6,11 +6,13 @@
|
|
|
6
6
|
* are pure data: no class methods, no engine refs.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
+
import type { ResponseModelIdObservation } from "../../core/response-model-id.js";
|
|
9
10
|
import type { SkillActivation } from "../../core/skill-activation.js";
|
|
10
11
|
import type { ToolProfileName } from "../../tools/profiles.js";
|
|
11
12
|
import type { AgentAudience } from "../agents/spec.js";
|
|
12
13
|
import type { EvidenceTag } from "../evidence/index.js";
|
|
13
14
|
import type { CostProvenance, RuntimeTargetSnapshot } from "../providers/index.js";
|
|
15
|
+
import type { RunToolBudgetEnvelope } from "./budget-envelope.js";
|
|
14
16
|
import type { ExecutionRole, GateTopologyRole } from "./execution-role.js";
|
|
15
17
|
import type { RouteDecisionV1 } from "./route-decision.js";
|
|
16
18
|
import type { RoutingIntent } from "./routing-intent.js";
|
|
@@ -418,6 +420,8 @@ export interface RunEnvelope {
|
|
|
418
420
|
agentAudience?: AgentAudience;
|
|
419
421
|
requestOrigin?: DispatchRequestOrigin;
|
|
420
422
|
task: string;
|
|
423
|
+
/** Immutable recipe policy, invocation request, effective phase, and admission reasons. */
|
|
424
|
+
budget?: RunToolBudgetEnvelope;
|
|
421
425
|
/** Present only when a bounded parent briefing was sent as dynamic task data. */
|
|
422
426
|
briefing?: RunBriefingProvenance;
|
|
423
427
|
/** Sent steering provenance in stable per-run sequence order; prose is never persisted. */
|
|
@@ -615,9 +619,10 @@ export interface RunReceiptReproducibility {
|
|
|
615
619
|
}
|
|
616
620
|
|
|
617
621
|
export interface RunReceiptUpstreamResponse {
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
622
|
+
requestedModelId: string | null;
|
|
623
|
+
responseModelIdObservation: ResponseModelIdObservation;
|
|
624
|
+
differingResponseModelId: string | null;
|
|
625
|
+
providerResponseId: string | null;
|
|
621
626
|
}
|
|
622
627
|
|
|
623
628
|
/**
|
|
@@ -677,6 +682,8 @@ export interface RunReceipt {
|
|
|
677
682
|
agentAudience?: AgentAudience;
|
|
678
683
|
requestOrigin?: DispatchRequestOrigin;
|
|
679
684
|
task: string;
|
|
685
|
+
/** Integrity-sealed recipe policy, invocation request, effective phase, and admission reasons. */
|
|
686
|
+
budget?: RunToolBudgetEnvelope;
|
|
680
687
|
/** Proof of briefing content without copying its prose into the receipt. */
|
|
681
688
|
briefing?: RunBriefingProvenance;
|
|
682
689
|
/** Sent steering provenance in stable per-run sequence order; prose is never persisted. */
|
|
@@ -11,6 +11,7 @@ import { cloneValidatedResponseSchema } from "../../core/response-schema.js";
|
|
|
11
11
|
import { isToolProfileName, type ToolProfileName } from "../../tools/profiles.js";
|
|
12
12
|
import type { AgentProduct } from "../agents/spec.js";
|
|
13
13
|
import { type AutonomyLevel, isAutonomyLevel } from "../safety/autonomy.js";
|
|
14
|
+
import { cloneDispatchBudgetRequest, type DispatchBudgetRequest } from "./budget-envelope.js";
|
|
14
15
|
import {
|
|
15
16
|
EXECUTION_HANDOFF_MAX_ITEMS,
|
|
16
17
|
EXECUTION_HANDOFF_MAX_TEXT_BYTES,
|
|
@@ -76,6 +77,8 @@ export interface JobSpec {
|
|
|
76
77
|
target?: string;
|
|
77
78
|
model?: string;
|
|
78
79
|
thinkingLevel?: JobThinkingLevel;
|
|
80
|
+
/** Invocation phase and optional preauthorized retry or revision ceiling. */
|
|
81
|
+
budget?: DispatchBudgetRequest;
|
|
79
82
|
/**
|
|
80
83
|
* What this run delivers, which decides what its reserve window admits.
|
|
81
84
|
* "orientation" adds `code_nav` to the delivery tools kept live inside the
|
|
@@ -180,6 +183,7 @@ const KNOWN_KEYS = new Set([
|
|
|
180
183
|
"target",
|
|
181
184
|
"model",
|
|
182
185
|
"thinkingLevel",
|
|
186
|
+
"budget",
|
|
183
187
|
"node",
|
|
184
188
|
"routingIntent",
|
|
185
189
|
"failover",
|
|
@@ -378,6 +382,15 @@ export function validateJobSpec(spec: unknown): Validated {
|
|
|
378
382
|
}
|
|
379
383
|
}
|
|
380
384
|
|
|
385
|
+
let budget: DispatchBudgetRequest | undefined;
|
|
386
|
+
if ("budget" in spec && spec.budget !== undefined) {
|
|
387
|
+
try {
|
|
388
|
+
budget = cloneDispatchBudgetRequest(spec.budget);
|
|
389
|
+
} catch (error) {
|
|
390
|
+
errors.push(error instanceof Error ? error.message : String(error));
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
|
|
381
394
|
if ("requiredCapabilities" in spec && spec.requiredCapabilities !== undefined) {
|
|
382
395
|
if (!Array.isArray(spec.requiredCapabilities) || spec.requiredCapabilities.some((c) => typeof c !== "string")) {
|
|
383
396
|
errors.push("requiredCapabilities must be a string[]");
|
|
@@ -530,6 +543,7 @@ export function validateJobSpec(spec: unknown): Validated {
|
|
|
530
543
|
out.reroutes = spec.reroutes.map((hop) => ({ ...hop }));
|
|
531
544
|
}
|
|
532
545
|
if (typeof spec.thinkingLevel === "string") out.thinkingLevel = spec.thinkingLevel as JobThinkingLevel;
|
|
546
|
+
if (budget !== undefined) out.budget = budget;
|
|
533
547
|
if (Array.isArray(spec.requiredCapabilities)) {
|
|
534
548
|
out.requiredCapabilities = spec.requiredCapabilities.map((c) => String(c));
|
|
535
549
|
}
|
|
@@ -133,6 +133,16 @@ export interface WorkerProcessOptions {
|
|
|
133
133
|
approvedIdentity?: ApprovedWorkerIdentity;
|
|
134
134
|
/** How long bulk output may precede the announce before the peer is refused. */
|
|
135
135
|
attestationGraceMs?: number;
|
|
136
|
+
/**
|
|
137
|
+
* Clock behind the heartbeat stamp, defaulting to `Date.now`. The stamp stays
|
|
138
|
+
* a wall-clock instant in production because the ledger, the receipt, and the
|
|
139
|
+
* evidence record all serialize it as ISO-8601 for an operator to read. That
|
|
140
|
+
* leaves a test with no honest way to assert the stamp advanced: comparing
|
|
141
|
+
* two wall-clock reads taken either side of an interval orders them backward
|
|
142
|
+
* on any host that resyncs its clock in between. A test injects the steppable
|
|
143
|
+
* clock from tests/harness/clock.ts here and asserts on that instead.
|
|
144
|
+
*/
|
|
145
|
+
now?: () => number;
|
|
136
146
|
}
|
|
137
147
|
|
|
138
148
|
/**
|
|
@@ -181,6 +191,7 @@ export function spawnWorkerProcess(
|
|
|
181
191
|
): SpawnedWorker {
|
|
182
192
|
const shutdownGraceMs = opts?.shutdownGraceMs ?? DEFAULT_SHUTDOWN_GRACE_MS;
|
|
183
193
|
const attestationGraceMs = opts?.attestationGraceMs ?? DEFAULT_ATTESTATION_GRACE_MS;
|
|
194
|
+
const now = opts?.now ?? Date.now;
|
|
184
195
|
const approved = opts?.approvedIdentity ?? approvedIdentityForSpec(spec);
|
|
185
196
|
|
|
186
197
|
const child: ChildProcess = spawn(command, [...args], {
|
|
@@ -193,7 +204,7 @@ export function spawnWorkerProcess(
|
|
|
193
204
|
});
|
|
194
205
|
const pid = child.pid ?? null;
|
|
195
206
|
|
|
196
|
-
const heartbeatAt = { current:
|
|
207
|
+
const heartbeatAt = { current: now() };
|
|
197
208
|
|
|
198
209
|
const queue = createBoundedEventQueue();
|
|
199
210
|
const waiters: Array<(r: IteratorResult<unknown>) => void> = [];
|
|
@@ -222,7 +233,7 @@ export function spawnWorkerProcess(
|
|
|
222
233
|
}
|
|
223
234
|
|
|
224
235
|
function push(value: unknown): void {
|
|
225
|
-
heartbeatAt.current =
|
|
236
|
+
heartbeatAt.current = now();
|
|
226
237
|
const w = waiters.shift();
|
|
227
238
|
if (w) {
|
|
228
239
|
w({ value, done: false });
|
|
@@ -367,7 +378,7 @@ export function spawnWorkerProcess(
|
|
|
367
378
|
if (!announceAccepted) failAttestation(`Invalid worker attestation: ${frame.reason}`);
|
|
368
379
|
return;
|
|
369
380
|
}
|
|
370
|
-
heartbeatAt.current =
|
|
381
|
+
heartbeatAt.current = now();
|
|
371
382
|
if (frame.value.kind === "announce") {
|
|
372
383
|
if (announceAccepted || announceFailed) return;
|
|
373
384
|
const verdict = verifyWorkerAttestation(frame.value.attestation, approved);
|
|
@@ -64,119 +64,3 @@ export function evidenceMetricsFromReceipt(receipt: RunReceipt): Record<string,
|
|
|
64
64
|
...(typeof receipt.costUsd === "number" && Number.isFinite(receipt.costUsd) ? { "cost.usd": receipt.costUsd } : {}),
|
|
65
65
|
};
|
|
66
66
|
}
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Count terminal dispatch tool calls in a `clio-coder run --json` stream: the
|
|
70
|
-
* decomposition checkpoint. Mirrors the dedup rules of the tool-call metric
|
|
71
|
-
* fold (canonical clio finishes win over pi execution ends when both exist).
|
|
72
|
-
* An absent or eventless stream counts zero.
|
|
73
|
-
*/
|
|
74
|
-
export function dispatchCountFromJsonl(stdout: string): number {
|
|
75
|
-
let executionEnds = 0;
|
|
76
|
-
let canonicalFinishes = 0;
|
|
77
|
-
const seenExecutionEnds = new Set<string>();
|
|
78
|
-
const seenCanonicalFinishes = new Set<string>();
|
|
79
|
-
let sawCanonicalFinishEvent = false;
|
|
80
|
-
for (const event of jsonlEvents(stdout)) {
|
|
81
|
-
if (event.type === "tool_execution_end") {
|
|
82
|
-
if (stringField(event, "toolName") !== "dispatch") continue;
|
|
83
|
-
const callId = stringField(event, "toolCallId");
|
|
84
|
-
if (callId !== undefined) {
|
|
85
|
-
if (seenExecutionEnds.has(callId)) continue;
|
|
86
|
-
seenExecutionEnds.add(callId);
|
|
87
|
-
}
|
|
88
|
-
executionEnds += 1;
|
|
89
|
-
continue;
|
|
90
|
-
}
|
|
91
|
-
if (event.type !== "clio_tool_finish" || !isRecord(event.payload)) continue;
|
|
92
|
-
sawCanonicalFinishEvent = true;
|
|
93
|
-
if (stringField(event.payload, "tool") !== "dispatch") continue;
|
|
94
|
-
const callId = stringField(event.payload, "toolCallId") ?? stringField(event, "toolCallId");
|
|
95
|
-
if (callId !== undefined) {
|
|
96
|
-
if (seenCanonicalFinishes.has(callId)) continue;
|
|
97
|
-
seenCanonicalFinishes.add(callId);
|
|
98
|
-
}
|
|
99
|
-
canonicalFinishes += 1;
|
|
100
|
-
}
|
|
101
|
-
return sawCanonicalFinishEvent ? canonicalFinishes : executionEnds;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
/** Count model-authored dispatch calls whose normalized task set includes Scout. */
|
|
105
|
-
export function scoutDispatchCountFromJsonl(stdout: string): number {
|
|
106
|
-
const seen = new Set<string>();
|
|
107
|
-
let count = 0;
|
|
108
|
-
for (const event of jsonlEvents(stdout)) {
|
|
109
|
-
if (event.type !== "tool_execution_start" || stringField(event, "toolName") !== "dispatch") continue;
|
|
110
|
-
if (!isRecord(event.args) || !dispatchArgsIncludeAgent(event.args, "scout")) continue;
|
|
111
|
-
const callId = stringField(event, "toolCallId");
|
|
112
|
-
if (callId !== undefined) {
|
|
113
|
-
if (seen.has(callId)) continue;
|
|
114
|
-
seen.add(callId);
|
|
115
|
-
}
|
|
116
|
-
count += 1;
|
|
117
|
-
}
|
|
118
|
-
return count;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
function dispatchArgsIncludeAgent(args: Record<string, unknown>, expectedAgent: string): boolean {
|
|
122
|
-
const sharedAgent = stringField(args, "agent") ?? stringField(args, "agent_id") ?? stringField(args, "agentId");
|
|
123
|
-
let tasks: unknown = args.tasks;
|
|
124
|
-
if (typeof tasks === "string") {
|
|
125
|
-
const trimmed = tasks.trim();
|
|
126
|
-
if (trimmed.startsWith("[") || trimmed.startsWith("{")) {
|
|
127
|
-
try {
|
|
128
|
-
tasks = JSON.parse(trimmed) as unknown;
|
|
129
|
-
} catch {
|
|
130
|
-
// A plain task string keeps using the shared agent below.
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
const taskList: unknown[] = Array.isArray(tasks) ? tasks : tasks === undefined ? [{ task: args.task }] : [tasks];
|
|
135
|
-
return taskList.some((task: unknown) => {
|
|
136
|
-
if (typeof task === "string") return sharedAgent?.toLowerCase() === expectedAgent;
|
|
137
|
-
if (!isRecord(task)) return false;
|
|
138
|
-
const agent =
|
|
139
|
-
stringField(task, "agent") ?? stringField(task, "agent_id") ?? stringField(task, "agentId") ?? sharedAgent;
|
|
140
|
-
return agent?.toLowerCase() === expectedAgent;
|
|
141
|
-
});
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
/**
|
|
145
|
-
* Stale-wiki behavioral checkpoint: true when the stream shows a live source
|
|
146
|
-
* read (read/grep start) AFTER a `code_nav mode=wiki` start, i.e. the model
|
|
147
|
-
* did not answer from the wiki alone. Absent either half → false.
|
|
148
|
-
*/
|
|
149
|
-
export function wikiStaleAcknowledgedFromJsonl(stdout: string): boolean {
|
|
150
|
-
let sawWikiLookup = false;
|
|
151
|
-
for (const event of jsonlEvents(stdout)) {
|
|
152
|
-
if (event.type !== "tool_execution_start") continue;
|
|
153
|
-
const toolName = stringField(event, "toolName");
|
|
154
|
-
if (toolName === "code_nav" && isRecord(event.args) && event.args.mode === "wiki") {
|
|
155
|
-
sawWikiLookup = true;
|
|
156
|
-
continue;
|
|
157
|
-
}
|
|
158
|
-
if (sawWikiLookup && (toolName === "read" || toolName === "grep")) return true;
|
|
159
|
-
}
|
|
160
|
-
return false;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
function* jsonlEvents(stdout: string): Generator<Record<string, unknown>> {
|
|
164
|
-
for (const line of stdout.split(/\r?\n/)) {
|
|
165
|
-
if (line.trim().length === 0) continue;
|
|
166
|
-
try {
|
|
167
|
-
const parsed: unknown = JSON.parse(line);
|
|
168
|
-
if (isRecord(parsed)) yield parsed;
|
|
169
|
-
} catch {
|
|
170
|
-
// Non-JSON noise (including the pretty receipt tail) is not an event.
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
function stringField(record: Record<string, unknown>, field: string): string | undefined {
|
|
176
|
-
const value = record[field];
|
|
177
|
-
return typeof value === "string" && value.length > 0 ? value : undefined;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
function isRecord(value: unknown): value is Record<string, unknown> {
|
|
181
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
182
|
-
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Invariant metrics: the promises Clio makes about its own machinery, read
|
|
3
3
|
* from the journal one eval item left behind.
|
|
4
4
|
*
|
|
5
|
-
* These invert what a
|
|
5
|
+
* These invert what a task outcome measures. A weak model that never solved the
|
|
6
6
|
* task leaves every one of them intact; a strong model that solved it leaves
|
|
7
7
|
* them broken the moment Clio failed to seal, to agree with itself, or to
|
|
8
8
|
* write a receipt its own ledger can authenticate. The task outcome and the
|
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
import { shellQuote } from "../../../core/shell-quote.js";
|
|
2
|
-
import {
|
|
3
|
-
dispatchCountFromJsonl,
|
|
4
|
-
evidenceMetricsFromReceipt,
|
|
5
|
-
receiptFromRunJsonStdout,
|
|
6
|
-
scoutDispatchCountFromJsonl,
|
|
7
|
-
wikiStaleAcknowledgedFromJsonl,
|
|
8
|
-
} from "../metrics/evidence.js";
|
|
2
|
+
import { evidenceMetricsFromReceipt, receiptFromRunJsonStdout } from "../metrics/evidence.js";
|
|
9
3
|
import { streamInvariantMetrics } from "../metrics/invariants.js";
|
|
10
4
|
import { tokenMetricEntries } from "../metrics/token-stream.js";
|
|
11
5
|
import type { EvalRunnerV2, EvalSuiteTargetV2 } from "../schema/suite.js";
|
|
@@ -58,9 +52,6 @@ export async function runClioRunRunner(
|
|
|
58
52
|
"tools.failed": tools.failed,
|
|
59
53
|
"tools.blocked": tools.blocked,
|
|
60
54
|
"verifier.exitCode": result.exitCode,
|
|
61
|
-
"dispatch.count": dispatchCountFromJsonl(toolMetricStream),
|
|
62
|
-
"dispatch.scoutCount": scoutDispatchCountFromJsonl(toolMetricStream),
|
|
63
|
-
"wiki.staleAcknowledged": wikiStaleAcknowledgedFromJsonl(toolMetricStream),
|
|
64
55
|
...(receipt === null ? {} : evidenceMetricsFromReceipt(receipt)),
|
|
65
56
|
...(receipt === null
|
|
66
57
|
? {}
|
|
@@ -1,13 +1,5 @@
|
|
|
1
1
|
import { spawn } from "node:child_process";
|
|
2
2
|
import { performance } from "node:perf_hooks";
|
|
3
|
-
import {
|
|
4
|
-
addChaosObservations,
|
|
5
|
-
chaosMetricEntries,
|
|
6
|
-
createChaosFold,
|
|
7
|
-
EMPTY_CHAOS_OBSERVATION,
|
|
8
|
-
type EvalChaosObservation,
|
|
9
|
-
parseChaosMarker,
|
|
10
|
-
} from "../metrics/chaos-stream.js";
|
|
11
3
|
import {
|
|
12
4
|
addFleetLoopObservations,
|
|
13
5
|
createFleetLoopFold,
|
|
@@ -53,8 +45,6 @@ export interface ShellCommandResult {
|
|
|
53
45
|
usage: EvalTokenStreamUsage;
|
|
54
46
|
/** Wire-stream structural invariants folded live, for the same reason. */
|
|
55
47
|
streamInvariants: EvalStreamInvariants;
|
|
56
|
-
/** Strict SIGINT harness marker folded live from stdout. */
|
|
57
|
-
chaos: EvalChaosObservation;
|
|
58
48
|
fleetLoops: EvalFleetLoopObservation;
|
|
59
49
|
stderr: string;
|
|
60
50
|
wallTimeMs: number;
|
|
@@ -84,7 +74,6 @@ export async function runExternalCommandRunner(
|
|
|
84
74
|
// is reported as unmeasured, never as zero cost.
|
|
85
75
|
let usage = UNMEASURED_TOKEN_USAGE;
|
|
86
76
|
let streamInvariants = EMPTY_STREAM_INVARIANTS;
|
|
87
|
-
let chaos = EMPTY_CHAOS_OBSERVATION;
|
|
88
77
|
let fleetLoops = EMPTY_FLEET_LOOP_OBSERVATION;
|
|
89
78
|
for (const command of commands) {
|
|
90
79
|
const result = await runShellCommand(command, cwd, runner.timeoutMs ?? timeoutMs, env);
|
|
@@ -93,7 +82,6 @@ export async function runExternalCommandRunner(
|
|
|
93
82
|
wallTimeMs += result.wallTimeMs;
|
|
94
83
|
usage = addTokenStreamUsage(usage, result.usage);
|
|
95
84
|
streamInvariants = addStreamInvariants(streamInvariants, result.streamInvariants);
|
|
96
|
-
chaos = addChaosObservations(chaos, result.chaos);
|
|
97
85
|
fleetLoops = addFleetLoopObservations(fleetLoops, result.fleetLoops);
|
|
98
86
|
if (result.exitCode !== 0) {
|
|
99
87
|
return {
|
|
@@ -107,11 +95,10 @@ export async function runExternalCommandRunner(
|
|
|
107
95
|
"latency.wallMs": wallTimeMs,
|
|
108
96
|
...tokenMetricEntries(usage),
|
|
109
97
|
...streamInvariantMetrics(streamInvariants),
|
|
110
|
-
...chaosMetricEntries(chaos),
|
|
111
98
|
...fleetLoopMetricEntries(fleetLoops),
|
|
112
99
|
"verifier.exitCode": result.exitCode,
|
|
113
100
|
},
|
|
114
|
-
artifacts:
|
|
101
|
+
artifacts: {},
|
|
115
102
|
};
|
|
116
103
|
}
|
|
117
104
|
}
|
|
@@ -126,11 +113,10 @@ export async function runExternalCommandRunner(
|
|
|
126
113
|
"latency.wallMs": wallTimeMs,
|
|
127
114
|
...tokenMetricEntries(usage),
|
|
128
115
|
...streamInvariantMetrics(streamInvariants),
|
|
129
|
-
...chaosMetricEntries(chaos),
|
|
130
116
|
...fleetLoopMetricEntries(fleetLoops),
|
|
131
117
|
"verifier.exitCode": 0,
|
|
132
118
|
},
|
|
133
|
-
artifacts:
|
|
119
|
+
artifacts: {},
|
|
134
120
|
};
|
|
135
121
|
}
|
|
136
122
|
|
|
@@ -150,7 +136,6 @@ export function runShellCommand(
|
|
|
150
136
|
const metricCapture = createJsonlMetricCapture();
|
|
151
137
|
const usageFold = createTokenUsageFold();
|
|
152
138
|
const streamFold = createStreamInvariantFold();
|
|
153
|
-
const chaosFold = createChaosFold();
|
|
154
139
|
const fleetLoopFold = createFleetLoopFold();
|
|
155
140
|
let timedOut = false;
|
|
156
141
|
let settled = false;
|
|
@@ -169,7 +154,6 @@ export function runShellCommand(
|
|
|
169
154
|
metricCapture.push(chunk);
|
|
170
155
|
usageFold.push(chunk);
|
|
171
156
|
streamFold.push(chunk);
|
|
172
|
-
chaosFold.push(chunk);
|
|
173
157
|
fleetLoopFold.push(chunk);
|
|
174
158
|
});
|
|
175
159
|
child.stderr.on("data", (chunk: string) => {
|
|
@@ -191,7 +175,6 @@ export function runShellCommand(
|
|
|
191
175
|
metricJsonl: metricCapture.finish(),
|
|
192
176
|
usage: usageFold.usage(),
|
|
193
177
|
streamInvariants: streamFold.invariants(),
|
|
194
|
-
chaos: chaosFold.observation(),
|
|
195
178
|
fleetLoops: fleetLoopFold.observation(),
|
|
196
179
|
stderr,
|
|
197
180
|
wallTimeMs: Math.round(performance.now() - started),
|
|
@@ -290,10 +273,6 @@ export function createJsonlMetricCapture(): JsonlMetricCapture {
|
|
|
290
273
|
|
|
291
274
|
function compactMetricEvent(event: Record<string, unknown>): Record<string, unknown> | null {
|
|
292
275
|
const type = event.type;
|
|
293
|
-
if (type === "clio_soak_chaos") {
|
|
294
|
-
const marker = parseChaosMarker(event);
|
|
295
|
-
return marker === null ? null : { type, ...marker };
|
|
296
|
-
}
|
|
297
276
|
if (type === "tool_execution_start") {
|
|
298
277
|
const toolName = stringField(event, "toolName");
|
|
299
278
|
if (toolName !== "dispatch" && toolName !== "code_nav" && toolName !== "read" && toolName !== "grep") {
|
|
@@ -334,12 +313,6 @@ function compactMetricEvent(event: Record<string, unknown>): Record<string, unkn
|
|
|
334
313
|
};
|
|
335
314
|
}
|
|
336
315
|
|
|
337
|
-
function chaosArtifacts(observation: EvalChaosObservation): Record<string, string> {
|
|
338
|
-
return observation.markerCount === 1 && observation.marker !== null
|
|
339
|
-
? { chaosSeed: String(observation.marker.seed) }
|
|
340
|
-
: {};
|
|
341
|
-
}
|
|
342
|
-
|
|
343
316
|
function isRecord(value: unknown): value is Record<string, unknown> {
|
|
344
317
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
345
318
|
}
|
|
@@ -43,13 +43,6 @@ export const CANONICAL_METRICS = [
|
|
|
43
43
|
"evidence.verification",
|
|
44
44
|
"evidence.firstPassSuccess",
|
|
45
45
|
"cost.usd",
|
|
46
|
-
// Behavioral checkpoints for the bounded reconnaissance live suite.
|
|
47
|
-
"dispatch.count",
|
|
48
|
-
"wiki.staleAcknowledged",
|
|
49
|
-
// SIGINT chaos-harness facts folded live from its one strict stdout marker.
|
|
50
|
-
"chaos.seed",
|
|
51
|
-
"chaos.faultInjected",
|
|
52
|
-
"chaos.exitCode",
|
|
53
46
|
// Invariant checks: what Clio promised about its own machinery, read from
|
|
54
47
|
// the journal the item's run left behind. These are true or false about
|
|
55
48
|
// Clio and say nothing about whether the model solved the task. A check
|
|
@@ -126,7 +126,7 @@ async function runMatrixItem(
|
|
|
126
126
|
CLIO_CODER_ENTRY: clioEntry,
|
|
127
127
|
});
|
|
128
128
|
const patch = collectPatchMetrics(workspace.dir);
|
|
129
|
-
const receiptExitCode =
|
|
129
|
+
const receiptExitCode = runner.exitCode;
|
|
130
130
|
// Read after the runner returned and before the journal is removed: what
|
|
131
131
|
// Clio sealed for this item, judged against its own ledger, and whether
|
|
132
132
|
// the workers it attested are still running.
|
|
@@ -193,12 +193,6 @@ async function runMatrixItem(
|
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
195
|
|
|
196
|
-
/** A SIGINT harness exits cleanly after checking the nested Clio process; reconcile its receipt to that nested exit. */
|
|
197
|
-
export function receiptProcessExitCode(runner: Pick<EvalRunnerOutput, "exitCode" | "metrics">): number {
|
|
198
|
-
const chaosExitCode = runner.metrics["chaos.exitCode"];
|
|
199
|
-
return typeof chaosExitCode === "number" && Number.isInteger(chaosExitCode) ? chaosExitCode : runner.exitCode;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
196
|
/** Journal-derived invariants for one finished item, read from its isolated state directory. */
|
|
203
197
|
function invariantMetrics(stateDir: string, runnerExitCode: number): Record<string, number | boolean> {
|
|
204
198
|
const journal = readRunJournal(stateDir);
|