@iowarp/clio-coder 0.3.4 → 0.3.7
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 +65 -2
- package/CONTRIBUTING.md +6 -6
- package/README.md +16 -5
- package/dist/{acp-S5R4RR5B.js → acp-SK4MD6MM.js} +11 -11
- package/dist/{agents-P6DMMVZY.js → agents-2FN2K6ME.js} +33 -26
- package/dist/assets/codewiki.json +1 -1
- package/dist/{auth-2XCZLPKS.js → auth-QIYZWM5I.js} +15 -15
- package/dist/{chunk-EKMEHE4H.js → chunk-33YXPOE3.js} +2 -3
- package/dist/{chunk-VAWWTKDP.js → chunk-3HAPLH5M.js} +11 -11
- package/dist/{chunk-YCWGATWI.js → chunk-465YSENW.js} +3 -3
- package/dist/{chunk-4OC57DA6.js → chunk-4DGYLA73.js} +53 -2
- package/dist/{chunk-UZHIZC5S.js → chunk-4DWFMQDR.js} +61 -76
- package/dist/{chunk-ZWMF7253.js → chunk-5C3AQNDW.js} +328 -9
- package/dist/{chunk-22NAGB7X.js → chunk-5C77SEEY.js} +5 -94
- package/dist/{chunk-WPQLXFOZ.js → chunk-5FR74PWO.js} +3 -2
- package/dist/{chunk-35MKKU5R.js → chunk-5UJ6ECTS.js} +18 -10
- package/dist/{chunk-BRXQQJFP.js → chunk-6M7VS3J3.js} +571 -50
- package/dist/{chunk-QQK64KLB.js → chunk-6TUKSZVF.js} +141 -23
- package/dist/{chunk-N4CZJQRK.js → chunk-AB4XIIVB.js} +8 -6
- package/dist/{chunk-KRPY7NTG.js → chunk-BMWK7ZIZ.js} +14 -20
- package/dist/{chunk-4BPJXDWC.js → chunk-C4JBQ5SR.js} +30 -14
- package/dist/{chunk-ZYKPLLNQ.js → chunk-CEYBNUGC.js} +821 -83
- package/dist/{chunk-VEZEGCGW.js → chunk-D4MDIG46.js} +20 -18
- package/dist/chunk-DJNLUABN.js +843 -0
- package/dist/{chunk-BP4OYD6A.js → chunk-DMD2AGVS.js} +21 -2
- package/dist/{chunk-KOHPCX4K.js → chunk-DOOEX22V.js} +2 -2
- package/dist/chunk-DQA7QLMD.js +123 -0
- package/dist/chunk-DR52UMZW.js +21 -0
- package/dist/{chunk-3HZ5RWN2.js → chunk-EBEFWSGL.js} +9 -7
- package/dist/{chunk-EDRHSCIE.js → chunk-EELBMBT6.js} +128 -13
- package/dist/{chunk-HV5X7OR2.js → chunk-EOOQZZDE.js} +16 -14
- package/dist/{chunk-WR67VIZY.js → chunk-FOT2FX5J.js} +63 -5
- package/dist/{chunk-BPGS2WCQ.js → chunk-GEYXPTRF.js} +2 -1
- package/dist/{chunk-FYYLNIL5.js → chunk-GH5622CP.js} +2 -2
- package/dist/{chunk-BEY543CS.js → chunk-GOXNB3AO.js} +5 -2
- package/dist/chunk-GWS3VEIW.js +195 -0
- package/dist/{chunk-G4BMMOKF.js → chunk-HVDIIIQW.js} +2 -2
- package/dist/chunk-HWUFFB6L.js +83 -0
- package/dist/{chunk-X6COSD2O.js → chunk-J7PIKKWC.js} +8 -436
- package/dist/{chunk-NILBFAPG.js → chunk-JNXPYBB4.js} +2 -2
- package/dist/{chunk-4VP4KH3K.js → chunk-JRIO5UD2.js} +4 -4
- package/dist/{chunk-K6WL7QZT.js → chunk-JTSEDYVQ.js} +7 -7
- package/dist/{chunk-QKMUKYO7.js → chunk-KCMKRQX4.js} +236 -84
- package/dist/chunk-KZ2H5X4G.js +1026 -0
- package/dist/{chunk-A2GZF7DC.js → chunk-LADCF22A.js} +13 -13
- package/dist/chunk-LCGCVYZ4.js +57 -0
- package/dist/chunk-M4AKACEO.js +382 -0
- package/dist/{chunk-POHLU5DW.js → chunk-M6L6IDJG.js} +3 -3
- package/dist/{chunk-4JUF2NNX.js → chunk-MXI6J5JF.js} +7 -7
- package/dist/{chunk-X4RCMKVQ.js → chunk-NDINPTJ4.js} +2 -2
- package/dist/{chunk-TTNYS3EA.js → chunk-OB5HIGJY.js} +1 -1
- package/dist/{chunk-7RXG6QRZ.js → chunk-OBMAI2DP.js} +61 -840
- package/dist/{chunk-5M54SPOL.js → chunk-ODFEOB4F.js} +161 -5
- package/dist/chunk-PD3MESLB.js +242 -0
- package/dist/{chunk-ED4KHGC3.js → chunk-PPAMZ32Z.js} +9 -2
- package/dist/{chunk-VMNQ6OZA.js → chunk-QCTRSGHQ.js} +963 -786
- package/dist/chunk-RVG5JXAL.js +41 -0
- package/dist/{chunk-RD5U66HV.js → chunk-SROCI7ZU.js} +7 -7
- package/dist/{chunk-MFFY33HR.js → chunk-THKY7CD7.js} +466 -205
- package/dist/{chunk-34475P3I.js → chunk-TSHXZTOQ.js} +5 -4
- package/dist/{chunk-PCZJO5TI.js → chunk-UFQ3F4FW.js} +13 -178
- package/dist/{chunk-AD2SYQYC.js → chunk-UHXRNZ2J.js} +121 -3
- package/dist/chunk-UND3GU2L.js +103 -0
- package/dist/{chunk-QQL5RT5M.js → chunk-UUANF5CR.js} +2323 -2114
- package/dist/{chunk-VJWL6YS5.js → chunk-UUVG37B4.js} +2 -2
- package/dist/chunk-UVDSQ6LW.js +472 -0
- package/dist/{chunk-QWU7ZBO7.js → chunk-VQNODYQ4.js} +215 -56
- package/dist/chunk-VREKEFLL.js +37 -0
- package/dist/{chunk-2TZWSW76.js → chunk-WHGPSPT5.js} +2 -2
- package/dist/{chunk-TW3WDMVS.js → chunk-WHJYKASB.js} +2 -2
- package/dist/{chunk-MEQ45TQ4.js → chunk-WJHBC77E.js} +21 -7
- package/dist/{chunk-HXG4IURW.js → chunk-X2KV5FXT.js} +2 -2
- package/dist/{chunk-YHZX5GEU.js → chunk-XAKHZX5N.js} +2 -2
- package/dist/{chunk-2LZI5CAG.js → chunk-XEGB6BCN.js} +228 -36
- package/dist/{chunk-E25LMLRW.js → chunk-YD734TPH.js} +2 -2
- package/dist/{verifiers-4UUM6TEE.js → chunk-YTYFXUI3.js} +121 -372
- package/dist/{chunk-3JLKSKD7.js → chunk-ZGH7FGS5.js} +17 -7
- package/dist/{chunk-VSNATDE6.js → chunk-ZZMN5OM4.js} +2 -2
- package/dist/cli/index.js +34 -32
- package/dist/{clio-J5JIOIDS.js → clio-WBVQEBKO.js} +7 -7
- package/dist/{code-nav-AXCXSBHX.js → code-nav-FGGFIE7L.js} +7 -7
- package/dist/codewiki/build-worker.js +4 -4
- package/dist/{components-KELWS457.js → components-F7OEATSO.js} +5 -5
- package/dist/{config-OEBMIN2U.js → config-TRBL3RCF.js} +48 -41
- package/dist/{configure-PUQOSIXQ.js → configure-OLCVPHNM.js} +17 -17
- package/dist/{context-URSXPBCK.js → context-MJIJ6GOX.js} +12 -12
- package/dist/{context-EKDCKUUZ.js → context-WFPKQSM6.js} +26 -9
- package/dist/{context-MGSE4Z2T.js → context-XEWE3MOJ.js} +44 -37
- package/dist/{context-clear-KDAJRNUK.js → context-clear-KNOS2JPB.js} +44 -37
- package/dist/{context-index-BZ4UYMTC.js → context-index-SSR5ECNE.js} +3 -3
- package/dist/{context-working-set-SBKMPPI2.js → context-working-set-EUXAZI6N.js} +14 -13
- package/dist/{dispatch-runner-MSWN72NK.js → dispatch-runner-B7MTOVKL.js} +321 -60
- package/dist/{docs-2C2LTVT2.js → docs-FLJTIDSE.js} +5 -5
- package/dist/{doctor-7BSE27PJ.js → doctor-RN4YKO2X.js} +15 -15
- package/dist/{eval-IZGDOO4H.js → eval-RUBJVSNQ.js} +52 -236
- package/dist/{evidence-SR7WXB5B.js → evidence-JZNBUOQZ.js} +39 -33
- package/dist/{evolve-K7VE2CBX.js → evolve-FJVC4KKI.js} +39 -33
- package/dist/{extensions-QVDOHDGJ.js → extensions-IQL36S7K.js} +5 -5
- package/dist/{fleet-7XMJNQNF.js → fleet-BDKYJFCP.js} +243 -370
- package/dist/fleet-commands-ZFIWZSB3.js +70 -0
- package/dist/fleet-graph-Y6HPXIVF.js +125 -0
- package/dist/fleet-new-RDVJLHHH.js +48 -0
- package/dist/{fleet-preflight-AQNAH644.js → fleet-preflight-BHSNPBMH.js} +2 -2
- package/dist/fleet-validate-BIYREGIK.js +79 -0
- package/dist/{init-JGNPAYXT.js → init-LQUB5COQ.js} +57 -48
- package/dist/library-NJAHIGG4.js +217 -0
- package/dist/memory-OG6HOYKM.js +472 -0
- package/dist/{models-ZMMLFJNN.js → models-5ZG5XY7J.js} +23 -22
- package/dist/{monitor-2F3T5KHP.js → monitor-TJ7AMTGB.js} +69 -35
- package/dist/{orchestrator-ORHT43JB.js → orchestrator-WZYB54DM.js} +4868 -1189
- package/dist/{paths-UXLN5YYZ.js → paths-XUC7GS6E.js} +5 -5
- package/dist/{reset-NXGTYNUO.js → reset-PXQT45IY.js} +8 -8
- package/dist/{run-RF4WJGMT.js → run-FQ74YF62.js} +82 -62
- package/dist/{share-UT3W6E4M.js → share-FW7SVCL3.js} +34 -10
- package/dist/{skills-PSACKC5Q.js → skills-7E7IRB3R.js} +25 -9
- package/dist/{skills-eval-WJSI55RZ.js → skills-eval-LI75W6OK.js} +43 -35
- package/dist/{targets-PIIRAOYS.js → targets-4CIFKCTW.js} +27 -24
- package/dist/{terminal-lease-ULWXWNVY.js → terminal-lease-WUZY7ZV5.js} +5 -4
- package/dist/{uninstall-FZCQCDKC.js → uninstall-7FV7IP4E.js} +5 -5
- package/dist/{upgrade-346TZ6AV.js → upgrade-K2HVIVMQ.js} +21 -20
- package/dist/{usage-6KKXR32N.js → usage-GTZELZQX.js} +159 -59
- package/dist/verifiers-RLAHT27O.js +336 -0
- package/dist/{verify-X5HDROLA.js → verify-BX3BRKH5.js} +7 -6
- package/dist/{wiki-generate-7STOCIFZ.js → wiki-generate-ASIFASCN.js} +58 -48
- package/dist/worker/entry.js +98 -84
- package/dist/{workspace-G4ZWUIPR.js → workspace-ZJ6BFM3Q.js} +4 -4
- package/docs/README.md +4 -3
- 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 +10 -6
- package/docs/built-in-agents.md +26 -2
- package/docs/capacity-and-scheduling.md +1 -1
- package/docs/commands-and-modes.md +90 -8
- package/docs/configuration-and-targets.md +90 -2
- package/docs/context-engine.md +4 -2
- package/docs/context-working-set.md +4 -4
- package/docs/development-pipeline.md +1 -1
- package/docs/dispatch-architecture-rationale.md +1 -1
- package/docs/documentation-coverage.md +4 -4
- package/docs/documentation-guide.md +4 -4
- package/docs/eval-runner.md +1 -1
- package/docs/evals-internal.md +4 -45
- package/docs/evidence-and-memory.md +70 -10
- package/docs/evolution.md +1 -1
- package/docs/exit-codes-and-output.md +4 -1
- package/docs/extensions-and-sharing.md +6 -2
- package/docs/fleet-demo-runbook.md +2 -2
- package/docs/fleet-dispatch.md +224 -11
- package/docs/git-commit-provenance.md +2 -2
- package/docs/glossary.md +1 -1
- package/docs/installation-and-lifecycle.md +2 -2
- package/docs/middleware-and-components.md +20 -2
- package/docs/model-catalog.md +1 -1
- package/docs/observability.md +55 -8
- package/docs/proactive-memory.md +26 -16
- package/docs/prompt-envelope-and-tools.md +4 -2
- package/docs/provider-adapter-cookbook.md +1 -1
- package/docs/release-cut-checklist.md +83 -65
- package/docs/resource-library.md +59 -0
- package/docs/safety-model.md +29 -7
- package/docs/scientific-validation.md +3 -3
- package/docs/session-lifecycle.md +37 -1
- package/docs/skills-marketplace.md +16 -3
- package/docs/tool-usage.md +14 -7
- package/docs/trace-store.md +1 -1
- package/docs/troubleshooting.md +1 -1
- package/docs/tui-design.md +38 -4
- package/docs/worker-dispatch-mechanics.md +3 -3
- package/package.json +7 -4
- package/src/cli/agents.ts +2 -3
- package/src/cli/argv.ts +14 -1
- package/src/cli/fleet-commands.ts +37 -0
- package/src/cli/fleet-graph.ts +102 -0
- package/src/cli/fleet-new.ts +36 -0
- package/src/cli/fleet-preflight.ts +121 -0
- package/src/cli/fleet-validate.ts +30 -0
- package/src/cli/fleet.ts +188 -335
- package/src/cli/index.ts +4 -2
- package/src/cli/library.ts +190 -0
- 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/share.ts +13 -1
- package/src/cli/targets.ts +12 -3
- package/src/cli/usage.ts +160 -20
- package/src/core/bus-events.ts +7 -0
- package/src/core/commit-attribution.ts +4 -4
- package/src/core/config.ts +130 -0
- package/src/core/defaults.ts +81 -0
- package/src/core/response-model-id.ts +134 -0
- package/src/core/toml.ts +62 -0
- package/src/core/workspace-files.ts +0 -1
- package/src/domains/agents/builtins/architect.md +2 -1
- package/src/domains/agents/builtins/oracle.md +33 -0
- package/src/domains/agents/catalog.ts +18 -5
- package/src/domains/agents/fleet-contract.ts +278 -16
- package/src/domains/agents/index.ts +14 -0
- package/src/domains/agents/recipe.ts +54 -14
- package/src/domains/agents/result-contract.ts +242 -5
- package/src/domains/config/classify.ts +4 -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/policies/index.ts +3 -4
- package/src/domains/dispatch/active-route-planner.ts +14 -0
- package/src/domains/dispatch/backoff.ts +2 -1
- package/src/domains/dispatch/budget-envelope.ts +396 -0
- package/src/domains/dispatch/capability-match.ts +1 -0
- package/src/domains/dispatch/checkout-writer-lease.ts +175 -0
- package/src/domains/dispatch/contract.ts +36 -0
- package/src/domains/dispatch/delegation-plan.ts +167 -0
- package/src/domains/dispatch/execution-plan.ts +76 -5
- package/src/domains/dispatch/execution-role.ts +3 -1
- package/src/domains/dispatch/execution-scheduler.ts +183 -67
- package/src/domains/dispatch/extension.ts +339 -36
- package/src/domains/dispatch/fleet-gate.ts +14 -0
- package/src/domains/dispatch/fleet-plan.ts +63 -3
- package/src/domains/dispatch/fleet-run.ts +737 -0
- package/src/domains/dispatch/gate-role-prompts.ts +9 -0
- package/src/domains/dispatch/host-verification.ts +178 -0
- package/src/domains/dispatch/index.ts +38 -0
- package/src/domains/dispatch/intent.ts +159 -0
- package/src/domains/dispatch/orphan-recovery.ts +1 -0
- package/src/domains/dispatch/receipt-integrity.ts +12 -4
- package/src/domains/dispatch/state.ts +37 -3
- package/src/domains/dispatch/types.ts +61 -9
- package/src/domains/dispatch/validation.ts +80 -6
- 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/trust-status.ts +10 -1
- 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/index.ts +15 -0
- package/src/domains/middleware/memory-intervention.ts +35 -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 +43 -1
- package/src/domains/middleware/types.ts +10 -0
- package/src/domains/middleware/watchdog.ts +281 -0
- package/src/domains/observability/contract.ts +9 -2
- package/src/domains/observability/cost.ts +31 -4
- package/src/domains/observability/extension.ts +2 -2
- package/src/domains/observability/index.ts +10 -0
- package/src/domains/observability/out-of-turn-usage.ts +223 -0
- package/src/domains/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/resources/index.ts +20 -0
- package/src/domains/resources/library.ts +326 -0
- package/src/domains/resources/skills/marketplace.ts +37 -12
- package/src/domains/safety/call-target.ts +211 -14
- package/src/domains/safety/decision-presentation.ts +268 -0
- package/src/domains/safety/redaction.ts +73 -0
- package/src/domains/session/context-ledger.ts +10 -1
- package/src/domains/session/decision-board.ts +4 -0
- package/src/domains/session/entries.ts +3 -0
- package/src/domains/session/handoff.ts +629 -0
- package/src/domains/session/history.ts +68 -19
- package/src/domains/session/usage.ts +24 -7
- package/src/domains/share/archive.ts +67 -2
- package/src/engine/acp/event-mapper.ts +7 -0
- package/src/engine/acp/server.ts +29 -2
- 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/worker-events.ts +4 -3
- package/src/engine/worker-runtime.ts +59 -54
- package/src/entry/orchestrator.ts +55 -1
- package/src/interactive/bus-notices.ts +26 -0
- package/src/interactive/chat-loop-messages.ts +22 -0
- package/src/interactive/chat-loop.ts +248 -1
- package/src/interactive/chat-renderer.ts +41 -3
- package/src/interactive/clio-editor.ts +44 -7
- package/src/interactive/context-overlay.ts +43 -5
- package/src/interactive/cost-overlay.ts +70 -11
- package/src/interactive/council-dispatch.ts +30 -0
- package/src/interactive/council-grid.ts +213 -0
- package/src/interactive/council.ts +99 -0
- package/src/interactive/dispatch-board.ts +471 -50
- package/src/interactive/fleet-run-preview.ts +307 -0
- package/src/interactive/footer/notifications.ts +219 -0
- package/src/interactive/footer/widgets.ts +13 -0
- package/src/interactive/handoff-round.ts +56 -0
- package/src/interactive/interactive-application.ts +49 -2
- package/src/interactive/interactive-event-projection.ts +9 -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 +52 -2
- package/src/interactive/interactive-subscriptions.ts +14 -2
- package/src/interactive/memory-overlay.ts +89 -4
- package/src/interactive/oracle.ts +179 -0
- package/src/interactive/overlay-ask-user-lifecycle.ts +7 -1
- package/src/interactive/overlay-frame.ts +5 -2
- package/src/interactive/overlay-general-openers.ts +230 -2
- package/src/interactive/overlay-key-routing.ts +58 -2
- package/src/interactive/overlay-lifecycle.ts +52 -5
- package/src/interactive/overlay-permission-lifecycle.ts +33 -8
- package/src/interactive/overlay-resource-openers.ts +11 -3
- package/src/interactive/overlay-session-lifecycle.ts +234 -2
- 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/overlays/fleet-run-approval.ts +208 -0
- package/src/interactive/overlays/handoff-review.ts +185 -0
- package/src/interactive/overlays/library-install-confirm.ts +151 -0
- package/src/interactive/overlays/list-overlay.ts +168 -2
- package/src/interactive/overlays/settings.ts +101 -4
- package/src/interactive/overlays/side-question.ts +139 -0
- package/src/interactive/overlays/skills-hub.ts +401 -15
- package/src/interactive/permission-hint.ts +35 -0
- package/src/interactive/permission-overlay.ts +95 -45
- package/src/interactive/renderers/tool-execution.ts +19 -49
- package/src/interactive/session-last-turn.ts +8 -1
- package/src/interactive/session-usage-reseed.ts +36 -10
- package/src/interactive/side-question.ts +171 -0
- package/src/interactive/slash-commands.ts +434 -7
- package/src/interactive/slash-spec.ts +19 -6
- 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/theme/tokens.ts +30 -0
- package/src/interactive/turn-context.ts +96 -23
- package/src/interactive/turn-middleware.ts +16 -1
- package/src/interactive/turn-runtime.ts +37 -8
- package/src/interactive/turn-state.ts +3 -0
- package/src/interactive/watchdog-run.ts +75 -0
- package/src/interactive/worker-progress.ts +440 -0
- package/src/interactive/worker-share.ts +56 -1
- package/src/interactive/worker-stream.ts +58 -110
- package/src/tools/agent-tools.ts +28 -3
- package/src/tools/ask-user.ts +21 -1
- package/src/tools/bootstrap.ts +3 -0
- package/src/tools/compete-worktrees.ts +13 -79
- package/src/tools/context/index.ts +2 -2
- package/src/tools/dispatch-admission.ts +242 -8
- package/src/tools/dispatch-arguments.ts +65 -1
- package/src/tools/dispatch-event-text.ts +19 -0
- package/src/tools/dispatch-plan.ts +136 -6
- package/src/tools/dispatch-runner.ts +319 -13
- package/src/tools/dispatch-types.ts +20 -1
- package/src/tools/dispatch.ts +96 -3
- package/src/tools/monitor.ts +31 -0
- package/src/tools/profiles.ts +18 -4
- package/src/tools/registry.ts +15 -5
- package/src/tools/result-disposition.ts +156 -0
- package/src/tools/result-shaping.ts +59 -1
- package/src/tools/task-worktree.ts +238 -0
- package/src/tools/verify/authoring.ts +116 -55
- package/src/tools/verify/scripts.ts +62 -0
- package/src/tools/worker-evidence.ts +21 -1
- package/src/worker/spec-contract.ts +44 -3
- package/dist/chunk-EFADSJET.js +0 -18
- package/dist/chunk-HC4CLZ2Y.js +0 -68
- package/dist/memory-4ALKDJ4Q.js +0 -246
- package/src/domains/eval/metrics/chaos-stream.ts +0 -93
|
@@ -1,51 +1,37 @@
|
|
|
1
1
|
import { createRequire as __clioCreateRequire } from "node:module"; const require = __clioCreateRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
|
-
|
|
3
|
+
parseTomlDocument,
|
|
4
|
+
tomlTableAt
|
|
5
|
+
} from "./chunk-LCGCVYZ4.js";
|
|
6
|
+
import {
|
|
4
7
|
verifyTool
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import
|
|
8
|
+
} from "./chunk-UFQ3F4FW.js";
|
|
9
|
+
import {
|
|
10
|
+
discoverDeclaredChecksAtRoot,
|
|
11
|
+
discoverDeclaredProjectEntriesAtRoot
|
|
12
|
+
} from "./chunk-PD3MESLB.js";
|
|
7
13
|
import {
|
|
8
14
|
PROJECT_VERIFIER_CATALOG_CAPS,
|
|
9
15
|
PROJECT_VERIFIER_CATALOG_RELATIVE_PATH,
|
|
10
16
|
PROJECT_VERIFIER_CATALOG_VERSION,
|
|
11
17
|
compareCodepoints,
|
|
12
|
-
loadProjectVerifierCatalog,
|
|
13
18
|
parseProjectVerifierCatalogText
|
|
14
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-GH5622CP.js";
|
|
15
20
|
import {
|
|
16
21
|
isVerificationScriptName
|
|
17
22
|
} from "./chunk-UL3WSD3F.js";
|
|
18
|
-
import "./chunk-VG7TBQIY.js";
|
|
19
|
-
import "./chunk-OQE5J4C6.js";
|
|
20
|
-
import "./chunk-ECH6PKUQ.js";
|
|
21
|
-
import "./chunk-6XLNIQDB.js";
|
|
22
|
-
import "./chunk-5B2AEOW5.js";
|
|
23
|
-
import "./chunk-CGKSTWHD.js";
|
|
24
|
-
import {
|
|
25
|
-
printError,
|
|
26
|
-
printOk
|
|
27
|
-
} from "./chunk-ED4KHGC3.js";
|
|
28
|
-
import "./chunk-5TSRNF4G.js";
|
|
29
23
|
import {
|
|
30
24
|
SAFE_EXEC_DEFAULT_TIMEOUT_MS,
|
|
31
25
|
resolveSafeCwd
|
|
32
|
-
} from "./chunk-
|
|
33
|
-
import "./chunk-FQ4SKYE4.js";
|
|
34
|
-
import "./chunk-FCSXB6T2.js";
|
|
26
|
+
} from "./chunk-D4MDIG46.js";
|
|
35
27
|
import {
|
|
36
28
|
require_dist
|
|
37
29
|
} from "./chunk-APJ265NV.js";
|
|
38
|
-
import "./chunk-YXLYO42X.js";
|
|
39
|
-
import "./chunk-BNAZZHFG.js";
|
|
40
|
-
import "./chunk-6EJMN2Y3.js";
|
|
41
30
|
import {
|
|
42
31
|
__toESM,
|
|
43
32
|
init_esm_shims
|
|
44
33
|
} from "./chunk-3R73A4XB.js";
|
|
45
34
|
|
|
46
|
-
// src/cli/verifiers.ts
|
|
47
|
-
init_esm_shims();
|
|
48
|
-
|
|
49
35
|
// src/tools/verify/authoring.ts
|
|
50
36
|
init_esm_shims();
|
|
51
37
|
var import_yaml = __toESM(require_dist(), 1);
|
|
@@ -166,8 +152,13 @@ function cargoProposals(workspaceRoot, diagnostics) {
|
|
|
166
152
|
diagnostics.push(`${relative}: ${text.message}; Cargo discovery skipped.`);
|
|
167
153
|
return [];
|
|
168
154
|
}
|
|
169
|
-
const
|
|
170
|
-
|
|
155
|
+
const document = parseTomlDocument(text);
|
|
156
|
+
if (document === null) {
|
|
157
|
+
diagnostics.push(`${relative}: invalid TOML; Cargo discovery skipped.`);
|
|
158
|
+
return [];
|
|
159
|
+
}
|
|
160
|
+
const workspace = tomlTableAt(document, ["workspace"]) !== null;
|
|
161
|
+
const packageManifest = tomlTableAt(document, ["package"]) !== null;
|
|
171
162
|
if (!workspace && !packageManifest) {
|
|
172
163
|
diagnostics.push(`${relative}: no [package] or [workspace] declaration was found; Cargo discovery skipped.`);
|
|
173
164
|
return [];
|
|
@@ -240,71 +231,68 @@ function cmakeProposals(workspaceRoot, diagnostics) {
|
|
|
240
231
|
if (proposals.length === 0) diagnostics.push(`${relative}: no visible buildPresets or testPresets were declared.`);
|
|
241
232
|
return proposals;
|
|
242
233
|
}
|
|
243
|
-
function tomlSections(text) {
|
|
244
|
-
const sections = /* @__PURE__ */ new Map();
|
|
245
|
-
let active = "";
|
|
246
|
-
for (const line of text.split(/\r?\n/u)) {
|
|
247
|
-
const header = /^\s*\[([^\]]+)\]\s*(?:#.*)?$/u.exec(line);
|
|
248
|
-
if (header?.[1] !== void 0) {
|
|
249
|
-
active = header[1].trim();
|
|
250
|
-
if (!sections.has(active)) sections.set(active, []);
|
|
251
|
-
continue;
|
|
252
|
-
}
|
|
253
|
-
if (active.length > 0) sections.get(active)?.push(line);
|
|
254
|
-
}
|
|
255
|
-
return sections;
|
|
256
|
-
}
|
|
257
|
-
function declaredScriptName(line) {
|
|
258
|
-
const match = /^\s*(?:"([^"]+)"|'([^']+)'|([A-Za-z0-9_.:-]+))\s*=\s*(?:"[^"]+"|'[^']+')\s*(?:#.*)?$/u.exec(line);
|
|
259
|
-
return match?.[1] ?? match?.[2] ?? match?.[3] ?? null;
|
|
260
|
-
}
|
|
261
234
|
function pythonProposals(workspaceRoot, diagnostics) {
|
|
262
235
|
const proposals = [];
|
|
263
236
|
const pyprojectPath = "pyproject.toml";
|
|
264
237
|
const pyproject = regularFileText(path.join(workspaceRoot, pyprojectPath), workspaceRoot);
|
|
265
238
|
if (pyproject instanceof Error) diagnostics.push(`${pyprojectPath}: ${pyproject.message}; Python discovery skipped.`);
|
|
266
239
|
if (typeof pyproject === "string") {
|
|
267
|
-
const
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
[
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
detail: `[${section}]`,
|
|
285
|
-
authority: "toolchain-defined"
|
|
286
|
-
}
|
|
287
|
-
});
|
|
288
|
-
}
|
|
289
|
-
for (const section of ["project.scripts", "tool.poetry.scripts"]) {
|
|
290
|
-
for (const line of sections.get(section) ?? []) {
|
|
291
|
-
const name = declaredScriptName(line);
|
|
292
|
-
if (name === null || !isVerificationScriptName(name)) continue;
|
|
240
|
+
const document = parseTomlDocument(pyproject);
|
|
241
|
+
if (document === null) {
|
|
242
|
+
diagnostics.push(`${pyprojectPath}: invalid TOML; Python discovery skipped.`);
|
|
243
|
+
} else {
|
|
244
|
+
for (const [path2, section, module, id, description, tags] of [
|
|
245
|
+
[
|
|
246
|
+
["tool", "pytest", "ini_options"],
|
|
247
|
+
"tool.pytest.ini_options",
|
|
248
|
+
"pytest",
|
|
249
|
+
"python-pytest",
|
|
250
|
+
"Run the declared pytest suite",
|
|
251
|
+
["python", "test"]
|
|
252
|
+
],
|
|
253
|
+
[["tool", "tox"], "tool.tox", "tox", "python-tox", "Run the declared tox environments", ["python", "test"]],
|
|
254
|
+
[["tool", "nox"], "tool.nox", "nox", "python-nox", "Run the declared nox sessions", ["python", "test"]]
|
|
255
|
+
]) {
|
|
256
|
+
if (tomlTableAt(document, path2) === null) continue;
|
|
293
257
|
proposals.push({
|
|
294
|
-
preferredId:
|
|
295
|
-
description
|
|
296
|
-
command: [
|
|
258
|
+
preferredId: id,
|
|
259
|
+
description,
|
|
260
|
+
command: ["python", "-m", module],
|
|
297
261
|
cwd: ".",
|
|
298
262
|
timeoutMs: SAFE_EXEC_DEFAULT_TIMEOUT_MS,
|
|
299
|
-
tags: [
|
|
263
|
+
tags: [...tags],
|
|
300
264
|
provenance: {
|
|
301
265
|
kind: "python-runner",
|
|
302
266
|
path: pyprojectPath,
|
|
303
|
-
detail: `[${section}]
|
|
304
|
-
authority: "
|
|
267
|
+
detail: `[${section}]`,
|
|
268
|
+
authority: "toolchain-defined"
|
|
305
269
|
}
|
|
306
270
|
});
|
|
307
271
|
}
|
|
272
|
+
for (const [path2, section] of [
|
|
273
|
+
[["project", "scripts"], "project.scripts"],
|
|
274
|
+
[["tool", "poetry", "scripts"], "tool.poetry.scripts"]
|
|
275
|
+
]) {
|
|
276
|
+
const scripts = tomlTableAt(document, path2);
|
|
277
|
+
if (scripts === null) continue;
|
|
278
|
+
for (const [name, target] of Object.entries(scripts)) {
|
|
279
|
+
if (typeof target !== "string" || !isVerificationScriptName(name)) continue;
|
|
280
|
+
proposals.push({
|
|
281
|
+
preferredId: `python-${slug(name, "check")}`,
|
|
282
|
+
description: `Run declared Python entry point '${name}'`,
|
|
283
|
+
command: [name],
|
|
284
|
+
cwd: ".",
|
|
285
|
+
timeoutMs: SAFE_EXEC_DEFAULT_TIMEOUT_MS,
|
|
286
|
+
tags: [slug(name.split(/[:.-]/u)[0] ?? "python", "python"), "python"],
|
|
287
|
+
provenance: {
|
|
288
|
+
kind: "python-runner",
|
|
289
|
+
path: pyprojectPath,
|
|
290
|
+
detail: `[${section}] entry '${name}'`,
|
|
291
|
+
authority: "project-declared"
|
|
292
|
+
}
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
}
|
|
308
296
|
}
|
|
309
297
|
}
|
|
310
298
|
for (const [relative, marker, module, id, description] of [
|
|
@@ -337,6 +325,52 @@ function pythonProposals(workspaceRoot, diagnostics) {
|
|
|
337
325
|
}
|
|
338
326
|
return proposals;
|
|
339
327
|
}
|
|
328
|
+
function discoverDeclaredProjectCommands(workspaceRoot = process.cwd()) {
|
|
329
|
+
const commands = [];
|
|
330
|
+
const add = (id, command, pathValue, detail, kind) => {
|
|
331
|
+
commands.push({
|
|
332
|
+
id,
|
|
333
|
+
command,
|
|
334
|
+
provenance: { kind, path: pathValue, detail, authority: "project-declared" }
|
|
335
|
+
});
|
|
336
|
+
};
|
|
337
|
+
for (const entry of discoverDeclaredProjectEntriesAtRoot(workspaceRoot)) {
|
|
338
|
+
add(entry.id, entry.command, entry.path, entry.detail, entry.kind);
|
|
339
|
+
}
|
|
340
|
+
const pyprojectText = regularFileText(path.join(workspaceRoot, "pyproject.toml"), workspaceRoot);
|
|
341
|
+
if (typeof pyprojectText === "string") {
|
|
342
|
+
const document = parseTomlDocument(pyprojectText);
|
|
343
|
+
if (document !== null) {
|
|
344
|
+
for (const [tablePath, label] of [
|
|
345
|
+
[["project", "scripts"], "project.scripts"],
|
|
346
|
+
[["tool", "poetry", "scripts"], "tool.poetry.scripts"]
|
|
347
|
+
]) {
|
|
348
|
+
const scripts = tomlTableAt(document, tablePath);
|
|
349
|
+
if (scripts === null) continue;
|
|
350
|
+
for (const [name, target] of Object.entries(scripts).sort(([left], [right]) => compareCodepoints(left, right))) {
|
|
351
|
+
if (typeof target === "string") add(name, [name], "pyproject.toml", `[${label}] entry '${name}'`, "python-runner");
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
for (const [tablePath, module, id, label] of [
|
|
355
|
+
[["tool", "pytest", "ini_options"], "pytest", "pytest", "tool.pytest.ini_options"],
|
|
356
|
+
[["tool", "tox"], "tox", "tox", "tool.tox"],
|
|
357
|
+
[["tool", "nox"], "nox", "nox", "tool.nox"]
|
|
358
|
+
]) {
|
|
359
|
+
if (tomlTableAt(document, tablePath) !== null)
|
|
360
|
+
add(id, ["python", "-m", module], "pyproject.toml", `[${label}]`, "python-runner");
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
const seen = /* @__PURE__ */ new Set();
|
|
365
|
+
return commands.filter((entry) => {
|
|
366
|
+
let id = slug(entry.id, "command");
|
|
367
|
+
let suffix = 2;
|
|
368
|
+
while (seen.has(id)) id = `${slug(entry.id, "command")}-${suffix++}`;
|
|
369
|
+
seen.add(id);
|
|
370
|
+
entry.id = id;
|
|
371
|
+
return true;
|
|
372
|
+
});
|
|
373
|
+
}
|
|
340
374
|
function goProposals(workspaceRoot, diagnostics) {
|
|
341
375
|
const relative = "go.mod";
|
|
342
376
|
const text = regularFileText(path.join(workspaceRoot, relative), workspaceRoot);
|
|
@@ -500,14 +534,14 @@ function validationContractProposals(workspaceRoot, diagnostics) {
|
|
|
500
534
|
const description = typeof record?.description === "string" ? record.description : `Run validation contract command ${JSON.stringify(argv)}`;
|
|
501
535
|
const cwd = typeof record?.cwd === "string" ? record.cwd : ".";
|
|
502
536
|
const timeoutMs = typeof record?.timeoutMs === "number" ? record.timeoutMs : SAFE_EXEC_DEFAULT_TIMEOUT_MS;
|
|
503
|
-
const
|
|
537
|
+
const tags = Array.isArray(record?.tags) ? record.tags.filter((tag) => typeof tag === "string") : [];
|
|
504
538
|
proposals.push({
|
|
505
539
|
preferredId: declaredId,
|
|
506
540
|
description,
|
|
507
541
|
command: argv,
|
|
508
542
|
cwd,
|
|
509
543
|
timeoutMs,
|
|
510
|
-
tags:
|
|
544
|
+
tags: tags.length > 0 ? tags : ["scientific", "validation"],
|
|
511
545
|
provenance: {
|
|
512
546
|
kind: "validation-contract",
|
|
513
547
|
path: relative,
|
|
@@ -634,8 +668,8 @@ function createVerifierDraft(discovery, options = {}) {
|
|
|
634
668
|
...discovery.catalogText === void 0 ? {} : { catalogText: discovery.catalogText }
|
|
635
669
|
};
|
|
636
670
|
}
|
|
637
|
-
function catalogEntry({ id, description, command, cwd, timeoutMs, tags
|
|
638
|
-
return { id, description, command: [...command], cwd, timeoutMs, tags: [...
|
|
671
|
+
function catalogEntry({ id, description, command, cwd, timeoutMs, tags }) {
|
|
672
|
+
return { id, description, command: [...command], cwd, timeoutMs, tags: [...tags] };
|
|
639
673
|
}
|
|
640
674
|
function serializeVerifierDraft(draft) {
|
|
641
675
|
const checks = [...draft.checks].sort((left, right) => compareCodepoints(left.id, right.id));
|
|
@@ -919,296 +953,11 @@ async function runVerifierAuthoringWorkflow(options) {
|
|
|
919
953
|
};
|
|
920
954
|
}
|
|
921
955
|
|
|
922
|
-
// src/cli/verifiers.ts
|
|
923
|
-
var HELP = `Project verifier authoring
|
|
924
|
-
|
|
925
|
-
Usage:
|
|
926
|
-
clio-coder verifiers discover
|
|
927
|
-
clio-coder verifiers author [--exclude <id>] [--rename <old>=<new>] [--dry-run <id>] [--yes]
|
|
928
|
-
clio-coder verifiers validate
|
|
929
|
-
clio-coder verifiers dry-run <id>
|
|
930
|
-
clio-coder verifiers add --id <id> --description <text> --command <json-argv> [fields] [--yes]
|
|
931
|
-
clio-coder verifiers edit <id> [--description <text>] [--command <json-argv>] [fields] [--yes]
|
|
932
|
-
clio-coder verifiers rename <old> <new> [--yes]
|
|
933
|
-
clio-coder verifiers remove <id> [--yes]
|
|
934
|
-
|
|
935
|
-
Fields:
|
|
936
|
-
--cwd <path> repository-relative working directory (default .)
|
|
937
|
-
--timeout-ms <number> bounded timeout in milliseconds (default 120000)
|
|
938
|
-
--tags <a,b> comma-separated catalog tags
|
|
939
|
-
|
|
940
|
-
Discovery and every preview are read-only. Mutating commands write only with
|
|
941
|
-
--yes after printing the exact argv, cwd, timeout, tags, source provenance, and
|
|
942
|
-
effective execution authority. dry-run invokes the production verify path.
|
|
943
|
-
`;
|
|
944
|
-
var VALUE_OPTIONS = /* @__PURE__ */ new Set([
|
|
945
|
-
"--id",
|
|
946
|
-
"--description",
|
|
947
|
-
"--command",
|
|
948
|
-
"--cwd",
|
|
949
|
-
"--timeout-ms",
|
|
950
|
-
"--tags",
|
|
951
|
-
"--exclude",
|
|
952
|
-
"--rename",
|
|
953
|
-
"--dry-run"
|
|
954
|
-
]);
|
|
955
|
-
function parseAuthoringArgs(argv) {
|
|
956
|
-
const positional = [];
|
|
957
|
-
const values = /* @__PURE__ */ new Map();
|
|
958
|
-
let yes = false;
|
|
959
|
-
let help = false;
|
|
960
|
-
for (let index = 0; index < argv.length; index += 1) {
|
|
961
|
-
const arg = argv[index];
|
|
962
|
-
if (arg === "--yes") {
|
|
963
|
-
yes = true;
|
|
964
|
-
continue;
|
|
965
|
-
}
|
|
966
|
-
if (arg === "--help" || arg === "-h") {
|
|
967
|
-
help = true;
|
|
968
|
-
continue;
|
|
969
|
-
}
|
|
970
|
-
if (arg?.startsWith("--") === true) {
|
|
971
|
-
if (!VALUE_OPTIONS.has(arg)) return { yes, help, positional, values, error: `unknown option: ${arg}` };
|
|
972
|
-
const value = argv[index + 1];
|
|
973
|
-
if (value === void 0 || value.startsWith("--")) {
|
|
974
|
-
return { yes, help, positional, values, error: `${arg} requires a value` };
|
|
975
|
-
}
|
|
976
|
-
const prior = values.get(arg) ?? [];
|
|
977
|
-
prior.push(value);
|
|
978
|
-
values.set(arg, prior);
|
|
979
|
-
index += 1;
|
|
980
|
-
continue;
|
|
981
|
-
}
|
|
982
|
-
if (arg !== void 0) positional.push(arg);
|
|
983
|
-
}
|
|
984
|
-
return { yes, help, positional, values };
|
|
985
|
-
}
|
|
986
|
-
function oneValue(parsed, option) {
|
|
987
|
-
return parsed.values.get(option)?.at(-1);
|
|
988
|
-
}
|
|
989
|
-
function parseCommand(value) {
|
|
990
|
-
if (value === void 0) return new Error("--command is required and must be a JSON argv array");
|
|
991
|
-
let parsed;
|
|
992
|
-
try {
|
|
993
|
-
parsed = JSON.parse(value);
|
|
994
|
-
} catch (error) {
|
|
995
|
-
return new Error(`--command must be valid JSON: ${error instanceof Error ? error.message : String(error)}`);
|
|
996
|
-
}
|
|
997
|
-
if (!Array.isArray(parsed) || parsed.length === 0 || parsed.some((entry) => typeof entry !== "string")) {
|
|
998
|
-
return new Error("--command must be a non-empty JSON string array");
|
|
999
|
-
}
|
|
1000
|
-
return parsed;
|
|
1001
|
-
}
|
|
1002
|
-
function parseTimeout(value) {
|
|
1003
|
-
if (value === void 0) return SAFE_EXEC_DEFAULT_TIMEOUT_MS;
|
|
1004
|
-
const parsed = Number(value);
|
|
1005
|
-
if (!Number.isInteger(parsed) || parsed <= 0) return new Error("--timeout-ms must be a positive integer");
|
|
1006
|
-
return parsed;
|
|
1007
|
-
}
|
|
1008
|
-
function tags(value) {
|
|
1009
|
-
return value === void 0 ? [] : value.split(",").map((tag) => tag.trim()).filter((tag) => tag.length > 0);
|
|
1010
|
-
}
|
|
1011
|
-
function requiredValue(parsed, option) {
|
|
1012
|
-
const value = oneValue(parsed, option);
|
|
1013
|
-
return value === void 0 || value.length === 0 ? new Error(`${option} is required`) : value;
|
|
1014
|
-
}
|
|
1015
|
-
function authorRevisions(parsed) {
|
|
1016
|
-
const revisions = [];
|
|
1017
|
-
for (const id of parsed.values.get("--exclude") ?? []) revisions.push({ kind: "remove", id });
|
|
1018
|
-
for (const rename of parsed.values.get("--rename") ?? []) {
|
|
1019
|
-
const separator = rename.indexOf("=");
|
|
1020
|
-
if (separator <= 0 || separator === rename.length - 1) {
|
|
1021
|
-
return new Error("--rename must use <old>=<new>");
|
|
1022
|
-
}
|
|
1023
|
-
revisions.push({ kind: "rename", id: rename.slice(0, separator), newId: rename.slice(separator + 1) });
|
|
1024
|
-
}
|
|
1025
|
-
return revisions;
|
|
1026
|
-
}
|
|
1027
|
-
function addRevision(parsed) {
|
|
1028
|
-
const id = requiredValue(parsed, "--id");
|
|
1029
|
-
if (id instanceof Error) return id;
|
|
1030
|
-
const description = requiredValue(parsed, "--description");
|
|
1031
|
-
if (description instanceof Error) return description;
|
|
1032
|
-
const command = parseCommand(oneValue(parsed, "--command"));
|
|
1033
|
-
if (command instanceof Error) return command;
|
|
1034
|
-
const timeoutMs = parseTimeout(oneValue(parsed, "--timeout-ms"));
|
|
1035
|
-
if (timeoutMs instanceof Error) return timeoutMs;
|
|
1036
|
-
return {
|
|
1037
|
-
kind: "add",
|
|
1038
|
-
check: {
|
|
1039
|
-
id,
|
|
1040
|
-
description,
|
|
1041
|
-
command,
|
|
1042
|
-
cwd: oneValue(parsed, "--cwd") ?? ".",
|
|
1043
|
-
timeoutMs,
|
|
1044
|
-
tags: tags(oneValue(parsed, "--tags"))
|
|
1045
|
-
}
|
|
1046
|
-
};
|
|
1047
|
-
}
|
|
1048
|
-
function editRevision(parsed) {
|
|
1049
|
-
const id = parsed.positional[1];
|
|
1050
|
-
if (id === void 0) return new Error("edit requires a check ID");
|
|
1051
|
-
const changes = {};
|
|
1052
|
-
const description = oneValue(parsed, "--description");
|
|
1053
|
-
if (description !== void 0) changes.description = description;
|
|
1054
|
-
const commandValue = oneValue(parsed, "--command");
|
|
1055
|
-
if (commandValue !== void 0) {
|
|
1056
|
-
const command = parseCommand(commandValue);
|
|
1057
|
-
if (command instanceof Error) return command;
|
|
1058
|
-
changes.command = command;
|
|
1059
|
-
}
|
|
1060
|
-
const cwd = oneValue(parsed, "--cwd");
|
|
1061
|
-
if (cwd !== void 0) changes.cwd = cwd;
|
|
1062
|
-
const timeoutValue = oneValue(parsed, "--timeout-ms");
|
|
1063
|
-
if (timeoutValue !== void 0) {
|
|
1064
|
-
const timeoutMs = parseTimeout(timeoutValue);
|
|
1065
|
-
if (timeoutMs instanceof Error) return timeoutMs;
|
|
1066
|
-
changes.timeoutMs = timeoutMs;
|
|
1067
|
-
}
|
|
1068
|
-
const tagValue = oneValue(parsed, "--tags");
|
|
1069
|
-
if (tagValue !== void 0) changes.tags = tags(tagValue);
|
|
1070
|
-
if (Object.keys(changes).length === 0) return new Error("edit requires at least one changed field");
|
|
1071
|
-
return { kind: "edit", id, changes };
|
|
1072
|
-
}
|
|
1073
|
-
function mutationRevision(parsed) {
|
|
1074
|
-
const command = parsed.positional[0];
|
|
1075
|
-
if (command === "add") return addRevision(parsed);
|
|
1076
|
-
if (command === "edit") return editRevision(parsed);
|
|
1077
|
-
if (command === "rename") {
|
|
1078
|
-
const id = parsed.positional[1];
|
|
1079
|
-
const newId = parsed.positional[2];
|
|
1080
|
-
if (id === void 0 || newId === void 0) return new Error("rename requires <old> and <new> IDs");
|
|
1081
|
-
return { kind: "rename", id, newId };
|
|
1082
|
-
}
|
|
1083
|
-
if (command === "remove") {
|
|
1084
|
-
const id = parsed.positional[1];
|
|
1085
|
-
if (id === void 0) return new Error("remove requires a check ID");
|
|
1086
|
-
return { kind: "remove", id };
|
|
1087
|
-
}
|
|
1088
|
-
return new Error(`unknown verifiers command: ${command ?? "(none)"}`);
|
|
1089
|
-
}
|
|
1090
|
-
function printDryRun(id, result) {
|
|
1091
|
-
if (result.kind === "error") {
|
|
1092
|
-
printError(`dry-run '${id}' failed: ${result.message}`);
|
|
1093
|
-
return 1;
|
|
1094
|
-
}
|
|
1095
|
-
process.stdout.write(`Dry run '${id}':
|
|
1096
|
-
${result.output}${result.output.endsWith("\n") ? "" : "\n"}`);
|
|
1097
|
-
return 0;
|
|
1098
|
-
}
|
|
1099
|
-
async function executeWorkflow(parsed, options) {
|
|
1100
|
-
let printedPreview = false;
|
|
1101
|
-
const dryRunCheckIds = parsed.values.get("--dry-run") ?? [];
|
|
1102
|
-
const result = await runVerifierAuthoringWorkflow({
|
|
1103
|
-
includeProposals: options.includeProposals,
|
|
1104
|
-
initialRevisions: options.revisions,
|
|
1105
|
-
confirmed: parsed.yes,
|
|
1106
|
-
decide(context) {
|
|
1107
|
-
process.stdout.write(`${context.preview}
|
|
1108
|
-
`);
|
|
1109
|
-
printedPreview = true;
|
|
1110
|
-
if (!parsed.yes || context.draft.checks.length === 0 && options.revisions.length === 0) {
|
|
1111
|
-
return { kind: "reject" };
|
|
1112
|
-
}
|
|
1113
|
-
return { kind: "confirm", dryRunCheckIds };
|
|
1114
|
-
}
|
|
1115
|
-
});
|
|
1116
|
-
if (result.status === "invalid") {
|
|
1117
|
-
if (!printedPreview && result.preview !== void 0) process.stdout.write(`${result.preview}
|
|
1118
|
-
`);
|
|
1119
|
-
printError(result.reason);
|
|
1120
|
-
if (result.wrote && result.path !== void 0) {
|
|
1121
|
-
process.stderr.write(` ${result.path} was written; repair or remove it before running a check.
|
|
1122
|
-
`);
|
|
1123
|
-
}
|
|
1124
|
-
return 1;
|
|
1125
|
-
}
|
|
1126
|
-
if (result.status === "rejected") {
|
|
1127
|
-
if (!parsed.yes) {
|
|
1128
|
-
process.stdout.write("Review complete. Nothing changed; rerun the same command with --yes to write this preview.\n");
|
|
1129
|
-
} else {
|
|
1130
|
-
process.stdout.write(
|
|
1131
|
-
"Nothing changed because the preview contains no catalog checks. Package checks remain active; unsupported commands can be added with `clio-coder verifiers add`.\n"
|
|
1132
|
-
);
|
|
1133
|
-
}
|
|
1134
|
-
return 0;
|
|
1135
|
-
}
|
|
1136
|
-
printOk(`wrote ${result.path}; production parser accepted the catalog`);
|
|
1137
|
-
let code = 0;
|
|
1138
|
-
for (const dryRun of result.dryRuns) code = Math.max(code, printDryRun(dryRun.id, dryRun.result));
|
|
1139
|
-
return code;
|
|
1140
|
-
}
|
|
1141
|
-
async function discoverCommand() {
|
|
1142
|
-
const discovery = discoverVerifierAuthoring();
|
|
1143
|
-
if (!discovery.ok) {
|
|
1144
|
-
printError(discovery.reason);
|
|
1145
|
-
process.stderr.write(`${discovery.manualEntry}
|
|
1146
|
-
`);
|
|
1147
|
-
return 1;
|
|
1148
|
-
}
|
|
1149
|
-
process.stdout.write(`${previewVerifierDraft(createVerifierDraft(discovery))}
|
|
1150
|
-
`);
|
|
1151
|
-
return 0;
|
|
1152
|
-
}
|
|
1153
|
-
function validateCommand() {
|
|
1154
|
-
const loaded = loadProjectVerifierCatalog(process.cwd());
|
|
1155
|
-
if (!loaded.ok) {
|
|
1156
|
-
printError(`production catalog parser rejected ${loaded.reason}`);
|
|
1157
|
-
return 1;
|
|
1158
|
-
}
|
|
1159
|
-
if (loaded.source === null) {
|
|
1160
|
-
process.stdout.write(`No ${PROJECT_VERIFIER_CATALOG_RELATIVE_PATH} exists. Run \`clio-coder verifiers author\`.
|
|
1161
|
-
`);
|
|
1162
|
-
return 0;
|
|
1163
|
-
}
|
|
1164
|
-
printOk(
|
|
1165
|
-
`production catalog parser accepted ${PROJECT_VERIFIER_CATALOG_RELATIVE_PATH} (${loaded.source.checks.length} check${loaded.source.checks.length === 1 ? "" : "s"})`
|
|
1166
|
-
);
|
|
1167
|
-
return 0;
|
|
1168
|
-
}
|
|
1169
|
-
async function runVerifiersCommand(argv) {
|
|
1170
|
-
const parsed = parseAuthoringArgs(argv);
|
|
1171
|
-
if (parsed.error !== void 0) {
|
|
1172
|
-
printError(parsed.error);
|
|
1173
|
-
process.stderr.write(HELP);
|
|
1174
|
-
return 2;
|
|
1175
|
-
}
|
|
1176
|
-
if (parsed.help || parsed.positional.length === 0) {
|
|
1177
|
-
process.stdout.write(HELP);
|
|
1178
|
-
return 0;
|
|
1179
|
-
}
|
|
1180
|
-
const command = parsed.positional[0];
|
|
1181
|
-
if (command === "discover") return discoverCommand();
|
|
1182
|
-
if (command === "validate") return validateCommand();
|
|
1183
|
-
if (command === "dry-run") {
|
|
1184
|
-
const id = parsed.positional[1];
|
|
1185
|
-
if (id === void 0) {
|
|
1186
|
-
printError("dry-run requires a check ID");
|
|
1187
|
-
return 2;
|
|
1188
|
-
}
|
|
1189
|
-
return printDryRun(id, await verifyTool.run({ check: id }));
|
|
1190
|
-
}
|
|
1191
|
-
if (command === "author") {
|
|
1192
|
-
const revisions = authorRevisions(parsed);
|
|
1193
|
-
if (revisions instanceof Error) {
|
|
1194
|
-
printError(revisions.message);
|
|
1195
|
-
return 2;
|
|
1196
|
-
}
|
|
1197
|
-
return executeWorkflow(parsed, { includeProposals: true, revisions });
|
|
1198
|
-
}
|
|
1199
|
-
if (["add", "edit", "rename", "remove"].includes(command ?? "")) {
|
|
1200
|
-
const revision = mutationRevision(parsed);
|
|
1201
|
-
if (revision instanceof Error) {
|
|
1202
|
-
printError(revision.message);
|
|
1203
|
-
return 2;
|
|
1204
|
-
}
|
|
1205
|
-
return executeWorkflow(parsed, { includeProposals: false, revisions: [revision] });
|
|
1206
|
-
}
|
|
1207
|
-
printError(`unknown verifiers command: ${command}`);
|
|
1208
|
-
process.stderr.write(HELP);
|
|
1209
|
-
return 2;
|
|
1210
|
-
}
|
|
1211
956
|
export {
|
|
1212
|
-
|
|
957
|
+
discoverDeclaredProjectCommands,
|
|
958
|
+
discoverVerifierAuthoring,
|
|
959
|
+
createVerifierDraft,
|
|
960
|
+
previewVerifierDraft,
|
|
961
|
+
runVerifierAuthoringWorkflow
|
|
1213
962
|
};
|
|
1214
|
-
//# sourceMappingURL=
|
|
963
|
+
//# sourceMappingURL=chunk-YTYFXUI3.js.map
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { createRequire as __clioCreateRequire } from "node:module"; const require = __clioCreateRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
ROUTE_POLICY_VERSION,
|
|
4
|
-
isExecutionRole,
|
|
5
4
|
isRouteDecisionAgentSelection,
|
|
6
5
|
isRoutingIntent
|
|
7
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-5C77SEEY.js";
|
|
7
|
+
import {
|
|
8
|
+
isExecutionRole
|
|
9
|
+
} from "./chunk-UND3GU2L.js";
|
|
8
10
|
import {
|
|
9
11
|
assertSafeId
|
|
10
12
|
} from "./chunk-R346GLFC.js";
|
|
@@ -26,7 +28,7 @@ import {
|
|
|
26
28
|
// src/domains/dispatch/receipt-integrity.ts
|
|
27
29
|
init_esm_shims();
|
|
28
30
|
import { createHash } from "node:crypto";
|
|
29
|
-
var RUN_RECEIPT_INTEGRITY_VERSION =
|
|
31
|
+
var RUN_RECEIPT_INTEGRITY_VERSION = 19;
|
|
30
32
|
var RUN_RECEIPT_INTEGRITY_ALGORITHM = "sha256";
|
|
31
33
|
function sha256(input) {
|
|
32
34
|
return createHash("sha256").update(input, "utf8").digest("hex");
|
|
@@ -79,6 +81,9 @@ var RECEIPT_INTEGRITY_FIELD_COVERAGE = {
|
|
|
79
81
|
agentAudience: true,
|
|
80
82
|
requestOrigin: true,
|
|
81
83
|
task: true,
|
|
84
|
+
intent: true,
|
|
85
|
+
// Historical receipts omit this field, so their receipt and ledger payloads remain unchanged.
|
|
86
|
+
budget: true,
|
|
82
87
|
targetId: true,
|
|
83
88
|
wireModelId: true,
|
|
84
89
|
runtimeId: true,
|
|
@@ -94,12 +99,13 @@ var RECEIPT_INTEGRITY_FIELD_COVERAGE = {
|
|
|
94
99
|
reroutes: true,
|
|
95
100
|
pipeline: true,
|
|
96
101
|
gate: true,
|
|
102
|
+
council: true,
|
|
97
103
|
plan: true,
|
|
104
|
+
fleetGate: true,
|
|
98
105
|
personaOverride: true,
|
|
99
106
|
projectContext: true,
|
|
100
107
|
// Always set on receipts written after #104 landed; absent only on older
|
|
101
|
-
// receipts, which
|
|
102
|
-
// so the integrity version stays where it is.
|
|
108
|
+
// receipts, which omit these fields from canonical serialization.
|
|
103
109
|
rulesApplied: true,
|
|
104
110
|
operatorProfileApplied: true,
|
|
105
111
|
exitCode: true,
|
|
@@ -129,6 +135,8 @@ var RECEIPT_INTEGRITY_FIELD_COVERAGE = {
|
|
|
129
135
|
toolStats: true,
|
|
130
136
|
toolActivity: true,
|
|
131
137
|
verification: true,
|
|
138
|
+
hostVerification: true,
|
|
139
|
+
worktree: true,
|
|
132
140
|
routingIntent: true,
|
|
133
141
|
quality: true,
|
|
134
142
|
skillActivations: true,
|
|
@@ -144,7 +152,7 @@ var RECEIPT_INTEGRITY_FIELD_COVERAGE = {
|
|
|
144
152
|
validationGrounding: true,
|
|
145
153
|
capabilityMismatch: true,
|
|
146
154
|
// Same reasoning: absent unless the run had an agent ledger, so a receipt
|
|
147
|
-
// without one
|
|
155
|
+
// without one omits the field from canonical serialization.
|
|
148
156
|
ledgerContribution: true,
|
|
149
157
|
sessionId: true,
|
|
150
158
|
briefing: true,
|
|
@@ -175,6 +183,7 @@ function ledgerDigestFields(envelope) {
|
|
|
175
183
|
agentId: envelope.agentId,
|
|
176
184
|
executionRole: envelope.executionRole,
|
|
177
185
|
task: envelope.task,
|
|
186
|
+
...envelope.budget !== void 0 ? { budget: envelope.budget } : {},
|
|
178
187
|
targetId: envelope.targetId,
|
|
179
188
|
wireModelId: envelope.wireModelId,
|
|
180
189
|
runtimeId: envelope.runtimeId,
|
|
@@ -303,6 +312,7 @@ function firstLedgerMismatch(receipt, envelope) {
|
|
|
303
312
|
if (!Object.is(receiptValue, ledgerValue)) return field;
|
|
304
313
|
}
|
|
305
314
|
if (canonicalJson(receipt.briefing ?? null) !== canonicalJson(envelope.briefing ?? null)) return "briefing";
|
|
315
|
+
if (canonicalJson(receipt.budget ?? null) !== canonicalJson(envelope.budget ?? null)) return "budget";
|
|
306
316
|
if (canonicalJson(receipt.steering ?? null) !== canonicalJson(envelope.steering ?? null)) return "steering";
|
|
307
317
|
return null;
|
|
308
318
|
}
|
|
@@ -1066,4 +1076,4 @@ export {
|
|
|
1066
1076
|
loadEvalTaskFile,
|
|
1067
1077
|
EvalTaskFileError
|
|
1068
1078
|
};
|
|
1069
|
-
//# sourceMappingURL=chunk-
|
|
1079
|
+
//# sourceMappingURL=chunk-ZGH7FGS5.js.map
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
} from "./chunk-W6GROXXM.js";
|
|
15
15
|
import {
|
|
16
16
|
ceilChars
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-GEYXPTRF.js";
|
|
18
18
|
import {
|
|
19
19
|
init_esm_shims
|
|
20
20
|
} from "./chunk-3R73A4XB.js";
|
|
@@ -119,4 +119,4 @@ export {
|
|
|
119
119
|
recallableRefListing,
|
|
120
120
|
recallErrorMessage
|
|
121
121
|
};
|
|
122
|
-
//# sourceMappingURL=chunk-
|
|
122
|
+
//# sourceMappingURL=chunk-ZZMN5OM4.js.map
|