switchboard-cli 0.1.0-alpha.1 → 0.1.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/calibration/ledger/baselines/baseline-2026-04-09.yaml +1 -1
- package/calibration/ledger/history.yaml +9 -0
- package/calibration/ledger/runs/2026-04-09T10-11-28-692Z/diffs/adv-056e52eb6d09.yaml +9 -0
- package/calibration/ledger/runs/2026-04-09T10-11-28-692Z/diffs/blind-aa04e10023e9.yaml +9 -0
- package/calibration/ledger/runs/2026-04-09T10-11-28-692Z/escalations/esc-2bd30ef5717a30b3.yaml +15 -0
- package/calibration/ledger/runs/2026-04-09T10-11-28-692Z/manifest.yaml +8 -0
- package/calibration/ledger/runs/2026-04-09T10-11-28-692Z/seeds/adv-056e52eb6d09.yaml +7 -0
- package/calibration/ledger/runs/2026-04-09T10-11-28-692Z/seeds/blind-aa04e10023e9.yaml +8 -0
- package/calibration/ledger/runs/2026-04-09T10-11-28-692Z/summary.yaml +10 -0
- package/calibration/ledger/runs/2026-04-09T10-11-28-692Z/traces/adv-056e52eb6d09.yaml +141 -0
- package/calibration/ledger/runs/2026-04-09T10-11-28-692Z/traces/blind-aa04e10023e9.yaml +146 -0
- package/calibration/ledger/runs/2026-04-09T10-11-28-692Z/verdicts-a/adv-056e52eb6d09.yaml +24 -0
- package/calibration/ledger/runs/2026-04-09T10-11-28-692Z/verdicts-a/blind-aa04e10023e9.yaml +24 -0
- package/calibration/ledger/runs/2026-04-09T10-11-28-692Z/verdicts-b/adv-056e52eb6d09.yaml +31 -0
- package/calibration/ledger/runs/2026-04-09T10-11-28-692Z/verdicts-b/blind-aa04e10023e9.yaml +32 -0
- package/node_modules/@switchboard/core/package.json +20 -0
- package/node_modules/@switchboard/core/src/activation.ts +285 -0
- package/node_modules/@switchboard/core/src/audited-receipt.ts +403 -0
- package/node_modules/@switchboard/core/src/budget-ledger.ts +223 -0
- package/node_modules/@switchboard/core/src/build-map.ts +327 -0
- package/node_modules/@switchboard/core/src/canonical-delta.ts +754 -0
- package/node_modules/@switchboard/core/src/canonical-pack.ts +400 -0
- package/node_modules/@switchboard/core/src/canonical.ts +248 -0
- package/node_modules/@switchboard/core/src/claim-spread.ts +219 -0
- package/node_modules/@switchboard/core/src/classifier.ts +207 -0
- package/node_modules/@switchboard/core/src/claude-executor.ts +37 -0
- package/node_modules/@switchboard/core/src/codex-audit.ts +301 -0
- package/node_modules/@switchboard/core/src/codex-executor.ts +22 -0
- package/node_modules/@switchboard/core/src/compiler-adapter.ts +284 -0
- package/node_modules/@switchboard/core/src/compiler.ts +183 -0
- package/node_modules/@switchboard/core/src/dispatch-formatter.ts +348 -0
- package/node_modules/@switchboard/core/src/dispatch-receipt.ts +135 -0
- package/node_modules/@switchboard/core/src/dossier.ts +229 -0
- package/node_modules/@switchboard/core/src/eval-scope.ts +208 -0
- package/node_modules/@switchboard/core/src/evaluation-lane.ts +584 -0
- package/node_modules/@switchboard/core/src/execution-trace.ts +455 -0
- package/node_modules/@switchboard/core/src/gate-state.ts +296 -0
- package/node_modules/@switchboard/core/src/gates.ts +198 -0
- package/node_modules/@switchboard/core/src/governance-envelope.ts +317 -0
- package/node_modules/@switchboard/core/src/handoff-v2.ts +221 -0
- package/node_modules/@switchboard/core/src/handoff-visibility.ts +204 -0
- package/node_modules/@switchboard/core/src/handoff.ts +87 -0
- package/node_modules/@switchboard/core/src/harness-compiler.ts +246 -0
- package/node_modules/@switchboard/core/src/index.ts +57 -0
- package/node_modules/@switchboard/core/src/ingest.ts +128 -0
- package/node_modules/@switchboard/core/src/launch-block-payload.ts +51 -0
- package/node_modules/@switchboard/core/src/ledger.ts +313 -0
- package/node_modules/@switchboard/core/src/live-event-bus.ts +37 -0
- package/node_modules/@switchboard/core/src/live-event.ts +238 -0
- package/node_modules/@switchboard/core/src/lock-readiness.ts +242 -0
- package/node_modules/@switchboard/core/src/loop-compiler.ts +152 -0
- package/node_modules/@switchboard/core/src/loop-validator.ts +55 -0
- package/node_modules/@switchboard/core/src/meta-harness.ts +411 -0
- package/node_modules/@switchboard/core/src/overflow-manifest.ts +220 -0
- package/node_modules/@switchboard/core/src/packet-integrity.ts +302 -0
- package/node_modules/@switchboard/core/src/parallel-conflict.ts +268 -0
- package/node_modules/@switchboard/core/src/preflight.ts +181 -0
- package/node_modules/@switchboard/core/src/pressure-assessment.ts +265 -0
- package/node_modules/@switchboard/core/src/product-objects.ts +99 -0
- package/node_modules/@switchboard/core/src/project-charter.ts +193 -0
- package/node_modules/@switchboard/core/src/proof-capture.ts +319 -0
- package/node_modules/@switchboard/core/src/provider-registry.ts +163 -0
- package/node_modules/@switchboard/core/src/receipt-v2.ts +904 -0
- package/node_modules/@switchboard/core/src/reconcile-matrix.ts +154 -0
- package/node_modules/@switchboard/core/src/reconcile-v2.ts +272 -0
- package/node_modules/@switchboard/core/src/reconcile.ts +450 -0
- package/node_modules/@switchboard/core/src/return-normalizer.ts +226 -0
- package/node_modules/@switchboard/core/src/router.ts +207 -0
- package/node_modules/@switchboard/core/src/routing-v2.ts +214 -0
- package/node_modules/@switchboard/core/src/run-snapshot.ts +405 -0
- package/node_modules/@switchboard/core/src/surface-playbooks.ts +36 -0
- package/node_modules/@switchboard/core/src/surface-profiles.ts +166 -0
- package/node_modules/@switchboard/core/src/synthesis-provider.ts +1114 -0
- package/node_modules/@switchboard/core/src/types.ts +3054 -0
- package/node_modules/@switchboard/projections/package.json +21 -0
- package/node_modules/@switchboard/projections/src/claude/index.ts +164 -0
- package/node_modules/@switchboard/projections/src/index.ts +160 -0
- package/node_modules/yaml/LICENSE +13 -0
- package/node_modules/yaml/README.md +172 -0
- package/node_modules/yaml/bin.mjs +11 -0
- package/node_modules/yaml/browser/dist/compose/compose-collection.js +88 -0
- package/node_modules/yaml/browser/dist/compose/compose-doc.js +43 -0
- package/node_modules/yaml/browser/dist/compose/compose-node.js +109 -0
- package/node_modules/yaml/browser/dist/compose/compose-scalar.js +86 -0
- package/node_modules/yaml/browser/dist/compose/composer.js +217 -0
- package/node_modules/yaml/browser/dist/compose/resolve-block-map.js +115 -0
- package/node_modules/yaml/browser/dist/compose/resolve-block-scalar.js +198 -0
- package/node_modules/yaml/browser/dist/compose/resolve-block-seq.js +49 -0
- package/node_modules/yaml/browser/dist/compose/resolve-end.js +37 -0
- package/node_modules/yaml/browser/dist/compose/resolve-flow-collection.js +207 -0
- package/node_modules/yaml/browser/dist/compose/resolve-flow-scalar.js +223 -0
- package/node_modules/yaml/browser/dist/compose/resolve-props.js +146 -0
- package/node_modules/yaml/browser/dist/compose/util-contains-newline.js +34 -0
- package/node_modules/yaml/browser/dist/compose/util-empty-scalar-position.js +26 -0
- package/node_modules/yaml/browser/dist/compose/util-flow-indent-check.js +15 -0
- package/node_modules/yaml/browser/dist/compose/util-map-includes.js +13 -0
- package/node_modules/yaml/browser/dist/doc/Document.js +335 -0
- package/node_modules/yaml/browser/dist/doc/anchors.js +71 -0
- package/node_modules/yaml/browser/dist/doc/applyReviver.js +55 -0
- package/node_modules/yaml/browser/dist/doc/createNode.js +88 -0
- package/node_modules/yaml/browser/dist/doc/directives.js +176 -0
- package/node_modules/yaml/browser/dist/errors.js +57 -0
- package/node_modules/yaml/browser/dist/index.js +17 -0
- package/node_modules/yaml/browser/dist/log.js +11 -0
- package/node_modules/yaml/browser/dist/nodes/Alias.js +114 -0
- package/node_modules/yaml/browser/dist/nodes/Collection.js +147 -0
- package/node_modules/yaml/browser/dist/nodes/Node.js +38 -0
- package/node_modules/yaml/browser/dist/nodes/Pair.js +36 -0
- package/node_modules/yaml/browser/dist/nodes/Scalar.js +24 -0
- package/node_modules/yaml/browser/dist/nodes/YAMLMap.js +144 -0
- package/node_modules/yaml/browser/dist/nodes/YAMLSeq.js +113 -0
- package/node_modules/yaml/browser/dist/nodes/addPairToJSMap.js +63 -0
- package/node_modules/yaml/browser/dist/nodes/identity.js +36 -0
- package/node_modules/yaml/browser/dist/nodes/toJS.js +37 -0
- package/node_modules/yaml/browser/dist/parse/cst-scalar.js +214 -0
- package/node_modules/yaml/browser/dist/parse/cst-stringify.js +61 -0
- package/node_modules/yaml/browser/dist/parse/cst-visit.js +97 -0
- package/node_modules/yaml/browser/dist/parse/cst.js +98 -0
- package/node_modules/yaml/browser/dist/parse/lexer.js +717 -0
- package/node_modules/yaml/browser/dist/parse/line-counter.js +39 -0
- package/node_modules/yaml/browser/dist/parse/parser.js +967 -0
- package/node_modules/yaml/browser/dist/public-api.js +102 -0
- package/node_modules/yaml/browser/dist/schema/Schema.js +37 -0
- package/node_modules/yaml/browser/dist/schema/common/map.js +17 -0
- package/node_modules/yaml/browser/dist/schema/common/null.js +15 -0
- package/node_modules/yaml/browser/dist/schema/common/seq.js +17 -0
- package/node_modules/yaml/browser/dist/schema/common/string.js +14 -0
- package/node_modules/yaml/browser/dist/schema/core/bool.js +19 -0
- package/node_modules/yaml/browser/dist/schema/core/float.js +43 -0
- package/node_modules/yaml/browser/dist/schema/core/int.js +38 -0
- package/node_modules/yaml/browser/dist/schema/core/schema.js +23 -0
- package/node_modules/yaml/browser/dist/schema/json/schema.js +62 -0
- package/node_modules/yaml/browser/dist/schema/tags.js +96 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/binary.js +58 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/bool.js +26 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/float.js +46 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/int.js +71 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/merge.js +64 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/omap.js +74 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.js +78 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/schema.js +39 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/set.js +93 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.js +101 -0
- package/node_modules/yaml/browser/dist/stringify/foldFlowLines.js +146 -0
- package/node_modules/yaml/browser/dist/stringify/stringify.js +129 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyCollection.js +153 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyComment.js +20 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyDocument.js +85 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyNumber.js +24 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyPair.js +150 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyString.js +336 -0
- package/node_modules/yaml/browser/dist/util.js +11 -0
- package/node_modules/yaml/browser/dist/visit.js +233 -0
- package/node_modules/yaml/browser/index.js +5 -0
- package/node_modules/yaml/browser/package.json +3 -0
- package/node_modules/yaml/dist/cli.d.ts +8 -0
- package/node_modules/yaml/dist/cli.mjs +201 -0
- package/node_modules/yaml/dist/compose/compose-collection.d.ts +11 -0
- package/node_modules/yaml/dist/compose/compose-collection.js +90 -0
- package/node_modules/yaml/dist/compose/compose-doc.d.ts +7 -0
- package/node_modules/yaml/dist/compose/compose-doc.js +45 -0
- package/node_modules/yaml/dist/compose/compose-node.d.ts +29 -0
- package/node_modules/yaml/dist/compose/compose-node.js +112 -0
- package/node_modules/yaml/dist/compose/compose-scalar.d.ts +5 -0
- package/node_modules/yaml/dist/compose/compose-scalar.js +88 -0
- package/node_modules/yaml/dist/compose/composer.d.ts +63 -0
- package/node_modules/yaml/dist/compose/composer.js +222 -0
- package/node_modules/yaml/dist/compose/resolve-block-map.d.ts +6 -0
- package/node_modules/yaml/dist/compose/resolve-block-map.js +117 -0
- package/node_modules/yaml/dist/compose/resolve-block-scalar.d.ts +11 -0
- package/node_modules/yaml/dist/compose/resolve-block-scalar.js +200 -0
- package/node_modules/yaml/dist/compose/resolve-block-seq.d.ts +6 -0
- package/node_modules/yaml/dist/compose/resolve-block-seq.js +51 -0
- package/node_modules/yaml/dist/compose/resolve-end.d.ts +6 -0
- package/node_modules/yaml/dist/compose/resolve-end.js +39 -0
- package/node_modules/yaml/dist/compose/resolve-flow-collection.d.ts +7 -0
- package/node_modules/yaml/dist/compose/resolve-flow-collection.js +209 -0
- package/node_modules/yaml/dist/compose/resolve-flow-scalar.d.ts +10 -0
- package/node_modules/yaml/dist/compose/resolve-flow-scalar.js +225 -0
- package/node_modules/yaml/dist/compose/resolve-props.d.ts +23 -0
- package/node_modules/yaml/dist/compose/resolve-props.js +148 -0
- package/node_modules/yaml/dist/compose/util-contains-newline.d.ts +2 -0
- package/node_modules/yaml/dist/compose/util-contains-newline.js +36 -0
- package/node_modules/yaml/dist/compose/util-empty-scalar-position.d.ts +2 -0
- package/node_modules/yaml/dist/compose/util-empty-scalar-position.js +28 -0
- package/node_modules/yaml/dist/compose/util-flow-indent-check.d.ts +3 -0
- package/node_modules/yaml/dist/compose/util-flow-indent-check.js +17 -0
- package/node_modules/yaml/dist/compose/util-map-includes.d.ts +4 -0
- package/node_modules/yaml/dist/compose/util-map-includes.js +15 -0
- package/node_modules/yaml/dist/doc/Document.d.ts +141 -0
- package/node_modules/yaml/dist/doc/Document.js +337 -0
- package/node_modules/yaml/dist/doc/anchors.d.ts +24 -0
- package/node_modules/yaml/dist/doc/anchors.js +76 -0
- package/node_modules/yaml/dist/doc/applyReviver.d.ts +9 -0
- package/node_modules/yaml/dist/doc/applyReviver.js +57 -0
- package/node_modules/yaml/dist/doc/createNode.d.ts +17 -0
- package/node_modules/yaml/dist/doc/createNode.js +90 -0
- package/node_modules/yaml/dist/doc/directives.d.ts +49 -0
- package/node_modules/yaml/dist/doc/directives.js +178 -0
- package/node_modules/yaml/dist/errors.d.ts +21 -0
- package/node_modules/yaml/dist/errors.js +62 -0
- package/node_modules/yaml/dist/index.d.ts +25 -0
- package/node_modules/yaml/dist/index.js +50 -0
- package/node_modules/yaml/dist/log.d.ts +3 -0
- package/node_modules/yaml/dist/log.js +19 -0
- package/node_modules/yaml/dist/nodes/Alias.d.ts +29 -0
- package/node_modules/yaml/dist/nodes/Alias.js +116 -0
- package/node_modules/yaml/dist/nodes/Collection.d.ts +73 -0
- package/node_modules/yaml/dist/nodes/Collection.js +151 -0
- package/node_modules/yaml/dist/nodes/Node.d.ts +53 -0
- package/node_modules/yaml/dist/nodes/Node.js +40 -0
- package/node_modules/yaml/dist/nodes/Pair.d.ts +22 -0
- package/node_modules/yaml/dist/nodes/Pair.js +39 -0
- package/node_modules/yaml/dist/nodes/Scalar.d.ts +43 -0
- package/node_modules/yaml/dist/nodes/Scalar.js +27 -0
- package/node_modules/yaml/dist/nodes/YAMLMap.d.ts +53 -0
- package/node_modules/yaml/dist/nodes/YAMLMap.js +147 -0
- package/node_modules/yaml/dist/nodes/YAMLSeq.d.ts +60 -0
- package/node_modules/yaml/dist/nodes/YAMLSeq.js +115 -0
- package/node_modules/yaml/dist/nodes/addPairToJSMap.d.ts +4 -0
- package/node_modules/yaml/dist/nodes/addPairToJSMap.js +65 -0
- package/node_modules/yaml/dist/nodes/identity.d.ts +23 -0
- package/node_modules/yaml/dist/nodes/identity.js +53 -0
- package/node_modules/yaml/dist/nodes/toJS.d.ts +29 -0
- package/node_modules/yaml/dist/nodes/toJS.js +39 -0
- package/node_modules/yaml/dist/options.d.ts +350 -0
- package/node_modules/yaml/dist/parse/cst-scalar.d.ts +64 -0
- package/node_modules/yaml/dist/parse/cst-scalar.js +218 -0
- package/node_modules/yaml/dist/parse/cst-stringify.d.ts +8 -0
- package/node_modules/yaml/dist/parse/cst-stringify.js +63 -0
- package/node_modules/yaml/dist/parse/cst-visit.d.ts +39 -0
- package/node_modules/yaml/dist/parse/cst-visit.js +99 -0
- package/node_modules/yaml/dist/parse/cst.d.ts +109 -0
- package/node_modules/yaml/dist/parse/cst.js +112 -0
- package/node_modules/yaml/dist/parse/lexer.d.ts +87 -0
- package/node_modules/yaml/dist/parse/lexer.js +719 -0
- package/node_modules/yaml/dist/parse/line-counter.d.ts +22 -0
- package/node_modules/yaml/dist/parse/line-counter.js +41 -0
- package/node_modules/yaml/dist/parse/parser.d.ts +84 -0
- package/node_modules/yaml/dist/parse/parser.js +972 -0
- package/node_modules/yaml/dist/public-api.d.ts +44 -0
- package/node_modules/yaml/dist/public-api.js +107 -0
- package/node_modules/yaml/dist/schema/Schema.d.ts +17 -0
- package/node_modules/yaml/dist/schema/Schema.js +39 -0
- package/node_modules/yaml/dist/schema/common/map.d.ts +2 -0
- package/node_modules/yaml/dist/schema/common/map.js +19 -0
- package/node_modules/yaml/dist/schema/common/null.d.ts +4 -0
- package/node_modules/yaml/dist/schema/common/null.js +17 -0
- package/node_modules/yaml/dist/schema/common/seq.d.ts +2 -0
- package/node_modules/yaml/dist/schema/common/seq.js +19 -0
- package/node_modules/yaml/dist/schema/common/string.d.ts +2 -0
- package/node_modules/yaml/dist/schema/common/string.js +16 -0
- package/node_modules/yaml/dist/schema/core/bool.d.ts +4 -0
- package/node_modules/yaml/dist/schema/core/bool.js +21 -0
- package/node_modules/yaml/dist/schema/core/float.d.ts +4 -0
- package/node_modules/yaml/dist/schema/core/float.js +47 -0
- package/node_modules/yaml/dist/schema/core/int.d.ts +4 -0
- package/node_modules/yaml/dist/schema/core/int.js +42 -0
- package/node_modules/yaml/dist/schema/core/schema.d.ts +1 -0
- package/node_modules/yaml/dist/schema/core/schema.js +25 -0
- package/node_modules/yaml/dist/schema/json/schema.d.ts +2 -0
- package/node_modules/yaml/dist/schema/json/schema.js +64 -0
- package/node_modules/yaml/dist/schema/json-schema.d.ts +69 -0
- package/node_modules/yaml/dist/schema/tags.d.ts +48 -0
- package/node_modules/yaml/dist/schema/tags.js +99 -0
- package/node_modules/yaml/dist/schema/types.d.ts +92 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/binary.d.ts +2 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/binary.js +70 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/bool.d.ts +7 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/bool.js +29 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/float.d.ts +4 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/float.js +50 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/int.d.ts +5 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/int.js +76 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/merge.d.ts +9 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/merge.js +68 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/omap.d.ts +22 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/omap.js +77 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/pairs.d.ts +10 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/pairs.js +82 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/schema.d.ts +1 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/schema.js +41 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/set.d.ts +28 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/set.js +96 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/timestamp.d.ts +6 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js +105 -0
- package/node_modules/yaml/dist/stringify/foldFlowLines.d.ts +34 -0
- package/node_modules/yaml/dist/stringify/foldFlowLines.js +151 -0
- package/node_modules/yaml/dist/stringify/stringify.d.ts +21 -0
- package/node_modules/yaml/dist/stringify/stringify.js +132 -0
- package/node_modules/yaml/dist/stringify/stringifyCollection.d.ts +17 -0
- package/node_modules/yaml/dist/stringify/stringifyCollection.js +155 -0
- package/node_modules/yaml/dist/stringify/stringifyComment.d.ts +10 -0
- package/node_modules/yaml/dist/stringify/stringifyComment.js +24 -0
- package/node_modules/yaml/dist/stringify/stringifyDocument.d.ts +4 -0
- package/node_modules/yaml/dist/stringify/stringifyDocument.js +87 -0
- package/node_modules/yaml/dist/stringify/stringifyNumber.d.ts +2 -0
- package/node_modules/yaml/dist/stringify/stringifyNumber.js +26 -0
- package/node_modules/yaml/dist/stringify/stringifyPair.d.ts +3 -0
- package/node_modules/yaml/dist/stringify/stringifyPair.js +152 -0
- package/node_modules/yaml/dist/stringify/stringifyString.d.ts +9 -0
- package/node_modules/yaml/dist/stringify/stringifyString.js +338 -0
- package/node_modules/yaml/dist/test-events.d.ts +4 -0
- package/node_modules/yaml/dist/test-events.js +134 -0
- package/node_modules/yaml/dist/util.d.ts +16 -0
- package/node_modules/yaml/dist/util.js +28 -0
- package/node_modules/yaml/dist/visit.d.ts +102 -0
- package/node_modules/yaml/dist/visit.js +236 -0
- package/node_modules/yaml/package.json +97 -0
- package/node_modules/yaml/util.js +2 -0
- package/node_modules/zod/LICENSE +21 -0
- package/node_modules/zod/README.md +208 -0
- package/node_modules/zod/index.cjs +33 -0
- package/node_modules/zod/index.d.cts +4 -0
- package/node_modules/zod/index.d.ts +4 -0
- package/node_modules/zod/index.js +4 -0
- package/node_modules/zod/package.json +118 -0
- package/node_modules/zod/src/index.ts +4 -0
- package/node_modules/zod/src/v3/ZodError.ts +330 -0
- package/node_modules/zod/src/v3/benchmarks/datetime.ts +58 -0
- package/node_modules/zod/src/v3/benchmarks/discriminatedUnion.ts +80 -0
- package/node_modules/zod/src/v3/benchmarks/index.ts +59 -0
- package/node_modules/zod/src/v3/benchmarks/ipv4.ts +57 -0
- package/node_modules/zod/src/v3/benchmarks/object.ts +69 -0
- package/node_modules/zod/src/v3/benchmarks/primitives.ts +162 -0
- package/node_modules/zod/src/v3/benchmarks/realworld.ts +63 -0
- package/node_modules/zod/src/v3/benchmarks/string.ts +55 -0
- package/node_modules/zod/src/v3/benchmarks/union.ts +80 -0
- package/node_modules/zod/src/v3/errors.ts +13 -0
- package/node_modules/zod/src/v3/external.ts +6 -0
- package/node_modules/zod/src/v3/helpers/enumUtil.ts +17 -0
- package/node_modules/zod/src/v3/helpers/errorUtil.ts +8 -0
- package/node_modules/zod/src/v3/helpers/parseUtil.ts +176 -0
- package/node_modules/zod/src/v3/helpers/partialUtil.ts +34 -0
- package/node_modules/zod/src/v3/helpers/typeAliases.ts +2 -0
- package/node_modules/zod/src/v3/helpers/util.ts +224 -0
- package/node_modules/zod/src/v3/index.ts +4 -0
- package/node_modules/zod/src/v3/locales/en.ts +124 -0
- package/node_modules/zod/src/v3/standard-schema.ts +113 -0
- package/node_modules/zod/src/v3/tests/Mocker.ts +54 -0
- package/node_modules/zod/src/v3/tests/all-errors.test.ts +157 -0
- package/node_modules/zod/src/v3/tests/anyunknown.test.ts +28 -0
- package/node_modules/zod/src/v3/tests/array.test.ts +71 -0
- package/node_modules/zod/src/v3/tests/async-parsing.test.ts +388 -0
- package/node_modules/zod/src/v3/tests/async-refinements.test.ts +46 -0
- package/node_modules/zod/src/v3/tests/base.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/bigint.test.ts +55 -0
- package/node_modules/zod/src/v3/tests/branded.test.ts +53 -0
- package/node_modules/zod/src/v3/tests/catch.test.ts +220 -0
- package/node_modules/zod/src/v3/tests/coerce.test.ts +133 -0
- package/node_modules/zod/src/v3/tests/complex.test.ts +56 -0
- package/node_modules/zod/src/v3/tests/custom.test.ts +31 -0
- package/node_modules/zod/src/v3/tests/date.test.ts +32 -0
- package/node_modules/zod/src/v3/tests/deepmasking.test.ts +186 -0
- package/node_modules/zod/src/v3/tests/default.test.ts +112 -0
- package/node_modules/zod/src/v3/tests/description.test.ts +33 -0
- package/node_modules/zod/src/v3/tests/discriminated-unions.test.ts +315 -0
- package/node_modules/zod/src/v3/tests/enum.test.ts +80 -0
- package/node_modules/zod/src/v3/tests/error.test.ts +551 -0
- package/node_modules/zod/src/v3/tests/firstparty.test.ts +87 -0
- package/node_modules/zod/src/v3/tests/firstpartyschematypes.test.ts +21 -0
- package/node_modules/zod/src/v3/tests/function.test.ts +257 -0
- package/node_modules/zod/src/v3/tests/generics.test.ts +48 -0
- package/node_modules/zod/src/v3/tests/instanceof.test.ts +37 -0
- package/node_modules/zod/src/v3/tests/intersection.test.ts +110 -0
- package/node_modules/zod/src/v3/tests/language-server.source.ts +76 -0
- package/node_modules/zod/src/v3/tests/language-server.test.ts +207 -0
- package/node_modules/zod/src/v3/tests/literal.test.ts +36 -0
- package/node_modules/zod/src/v3/tests/map.test.ts +110 -0
- package/node_modules/zod/src/v3/tests/masking.test.ts +4 -0
- package/node_modules/zod/src/v3/tests/mocker.test.ts +19 -0
- package/node_modules/zod/src/v3/tests/nan.test.ts +21 -0
- package/node_modules/zod/src/v3/tests/nativeEnum.test.ts +87 -0
- package/node_modules/zod/src/v3/tests/nullable.test.ts +42 -0
- package/node_modules/zod/src/v3/tests/number.test.ts +176 -0
- package/node_modules/zod/src/v3/tests/object-augmentation.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/object-in-es5-env.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/object.test.ts +434 -0
- package/node_modules/zod/src/v3/tests/optional.test.ts +42 -0
- package/node_modules/zod/src/v3/tests/parseUtil.test.ts +23 -0
- package/node_modules/zod/src/v3/tests/parser.test.ts +41 -0
- package/node_modules/zod/src/v3/tests/partials.test.ts +243 -0
- package/node_modules/zod/src/v3/tests/pickomit.test.ts +111 -0
- package/node_modules/zod/src/v3/tests/pipeline.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/preprocess.test.ts +186 -0
- package/node_modules/zod/src/v3/tests/primitive.test.ts +440 -0
- package/node_modules/zod/src/v3/tests/promise.test.ts +90 -0
- package/node_modules/zod/src/v3/tests/readonly.test.ts +194 -0
- package/node_modules/zod/src/v3/tests/record.test.ts +171 -0
- package/node_modules/zod/src/v3/tests/recursive.test.ts +197 -0
- package/node_modules/zod/src/v3/tests/refine.test.ts +313 -0
- package/node_modules/zod/src/v3/tests/safeparse.test.ts +27 -0
- package/node_modules/zod/src/v3/tests/set.test.ts +142 -0
- package/node_modules/zod/src/v3/tests/standard-schema.test.ts +83 -0
- package/node_modules/zod/src/v3/tests/string.test.ts +916 -0
- package/node_modules/zod/src/v3/tests/transformer.test.ts +233 -0
- package/node_modules/zod/src/v3/tests/tuple.test.ts +90 -0
- package/node_modules/zod/src/v3/tests/unions.test.ts +57 -0
- package/node_modules/zod/src/v3/tests/validations.test.ts +133 -0
- package/node_modules/zod/src/v3/tests/void.test.ts +15 -0
- package/node_modules/zod/src/v3/types.ts +5136 -0
- package/node_modules/zod/src/v4/classic/checks.ts +30 -0
- package/node_modules/zod/src/v4/classic/coerce.ts +27 -0
- package/node_modules/zod/src/v4/classic/compat.ts +66 -0
- package/node_modules/zod/src/v4/classic/errors.ts +75 -0
- package/node_modules/zod/src/v4/classic/external.ts +50 -0
- package/node_modules/zod/src/v4/classic/index.ts +5 -0
- package/node_modules/zod/src/v4/classic/iso.ts +90 -0
- package/node_modules/zod/src/v4/classic/parse.ts +33 -0
- package/node_modules/zod/src/v4/classic/schemas.ts +2054 -0
- package/node_modules/zod/src/v4/classic/tests/anyunknown.test.ts +26 -0
- package/node_modules/zod/src/v4/classic/tests/array.test.ts +264 -0
- package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +210 -0
- package/node_modules/zod/src/v4/classic/tests/async-parsing.test.ts +381 -0
- package/node_modules/zod/src/v4/classic/tests/async-refinements.test.ts +68 -0
- package/node_modules/zod/src/v4/classic/tests/base.test.ts +7 -0
- package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +54 -0
- package/node_modules/zod/src/v4/classic/tests/brand.test.ts +63 -0
- package/node_modules/zod/src/v4/classic/tests/catch.test.ts +252 -0
- package/node_modules/zod/src/v4/classic/tests/coalesce.test.ts +20 -0
- package/node_modules/zod/src/v4/classic/tests/coerce.test.ts +160 -0
- package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +352 -0
- package/node_modules/zod/src/v4/classic/tests/custom.test.ts +40 -0
- package/node_modules/zod/src/v4/classic/tests/date.test.ts +31 -0
- package/node_modules/zod/src/v4/classic/tests/datetime.test.ts +296 -0
- package/node_modules/zod/src/v4/classic/tests/default.test.ts +313 -0
- package/node_modules/zod/src/v4/classic/tests/description.test.ts +32 -0
- package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +619 -0
- package/node_modules/zod/src/v4/classic/tests/enum.test.ts +285 -0
- package/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +527 -0
- package/node_modules/zod/src/v4/classic/tests/error.test.ts +711 -0
- package/node_modules/zod/src/v4/classic/tests/file.test.ts +91 -0
- package/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +175 -0
- package/node_modules/zod/src/v4/classic/tests/function.test.ts +268 -0
- package/node_modules/zod/src/v4/classic/tests/generics.test.ts +72 -0
- package/node_modules/zod/src/v4/classic/tests/index.test.ts +829 -0
- package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +34 -0
- package/node_modules/zod/src/v4/classic/tests/intersection.test.ts +171 -0
- package/node_modules/zod/src/v4/classic/tests/json.test.ts +108 -0
- package/node_modules/zod/src/v4/classic/tests/lazy.test.ts +227 -0
- package/node_modules/zod/src/v4/classic/tests/literal.test.ts +92 -0
- package/node_modules/zod/src/v4/classic/tests/map.test.ts +196 -0
- package/node_modules/zod/src/v4/classic/tests/nan.test.ts +21 -0
- package/node_modules/zod/src/v4/classic/tests/nested-refine.test.ts +168 -0
- package/node_modules/zod/src/v4/classic/tests/nonoptional.test.ts +86 -0
- package/node_modules/zod/src/v4/classic/tests/nullable.test.ts +22 -0
- package/node_modules/zod/src/v4/classic/tests/number.test.ts +247 -0
- package/node_modules/zod/src/v4/classic/tests/object.test.ts +563 -0
- package/node_modules/zod/src/v4/classic/tests/optional.test.ts +123 -0
- package/node_modules/zod/src/v4/classic/tests/partial.test.ts +147 -0
- package/node_modules/zod/src/v4/classic/tests/pickomit.test.ts +127 -0
- package/node_modules/zod/src/v4/classic/tests/pipe.test.ts +81 -0
- package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +37 -0
- package/node_modules/zod/src/v4/classic/tests/preprocess.test.ts +298 -0
- package/node_modules/zod/src/v4/classic/tests/primitive.test.ts +175 -0
- package/node_modules/zod/src/v4/classic/tests/promise.test.ts +81 -0
- package/node_modules/zod/src/v4/classic/tests/prototypes.test.ts +23 -0
- package/node_modules/zod/src/v4/classic/tests/readonly.test.ts +252 -0
- package/node_modules/zod/src/v4/classic/tests/record.test.ts +342 -0
- package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +356 -0
- package/node_modules/zod/src/v4/classic/tests/refine.test.ts +532 -0
- package/node_modules/zod/src/v4/classic/tests/registries.test.ts +204 -0
- package/node_modules/zod/src/v4/classic/tests/set.test.ts +179 -0
- package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +57 -0
- package/node_modules/zod/src/v4/classic/tests/string-formats.test.ts +109 -0
- package/node_modules/zod/src/v4/classic/tests/string.test.ts +881 -0
- package/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +66 -0
- package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +758 -0
- package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +2314 -0
- package/node_modules/zod/src/v4/classic/tests/transform.test.ts +250 -0
- package/node_modules/zod/src/v4/classic/tests/tuple.test.ts +163 -0
- package/node_modules/zod/src/v4/classic/tests/union.test.ts +94 -0
- package/node_modules/zod/src/v4/classic/tests/validations.test.ts +283 -0
- package/node_modules/zod/src/v4/classic/tests/void.test.ts +12 -0
- package/node_modules/zod/src/v4/core/api.ts +1594 -0
- package/node_modules/zod/src/v4/core/checks.ts +1283 -0
- package/node_modules/zod/src/v4/core/config.ts +15 -0
- package/node_modules/zod/src/v4/core/core.ts +134 -0
- package/node_modules/zod/src/v4/core/doc.ts +44 -0
- package/node_modules/zod/src/v4/core/errors.ts +424 -0
- package/node_modules/zod/src/v4/core/function.ts +176 -0
- package/node_modules/zod/src/v4/core/index.ts +15 -0
- package/node_modules/zod/src/v4/core/json-schema.ts +143 -0
- package/node_modules/zod/src/v4/core/parse.ts +94 -0
- package/node_modules/zod/src/v4/core/regexes.ts +135 -0
- package/node_modules/zod/src/v4/core/registries.ts +96 -0
- package/node_modules/zod/src/v4/core/schemas.ts +3842 -0
- package/node_modules/zod/src/v4/core/standard-schema.ts +64 -0
- package/node_modules/zod/src/v4/core/tests/index.test.ts +46 -0
- package/node_modules/zod/src/v4/core/tests/locales/be.test.ts +124 -0
- package/node_modules/zod/src/v4/core/tests/locales/en.test.ts +22 -0
- package/node_modules/zod/src/v4/core/tests/locales/ru.test.ts +128 -0
- package/node_modules/zod/src/v4/core/tests/locales/tr.test.ts +69 -0
- package/node_modules/zod/src/v4/core/to-json-schema.ts +977 -0
- package/node_modules/zod/src/v4/core/util.ts +775 -0
- package/node_modules/zod/src/v4/core/versions.ts +5 -0
- package/node_modules/zod/src/v4/core/zsf.ts +323 -0
- package/node_modules/zod/src/v4/index.ts +4 -0
- package/node_modules/zod/src/v4/locales/ar.ts +125 -0
- package/node_modules/zod/src/v4/locales/az.ts +121 -0
- package/node_modules/zod/src/v4/locales/be.ts +184 -0
- package/node_modules/zod/src/v4/locales/ca.ts +127 -0
- package/node_modules/zod/src/v4/locales/cs.ts +142 -0
- package/node_modules/zod/src/v4/locales/de.ts +124 -0
- package/node_modules/zod/src/v4/locales/en.ts +127 -0
- package/node_modules/zod/src/v4/locales/eo.ts +125 -0
- package/node_modules/zod/src/v4/locales/es.ts +125 -0
- package/node_modules/zod/src/v4/locales/fa.ts +134 -0
- package/node_modules/zod/src/v4/locales/fi.ts +131 -0
- package/node_modules/zod/src/v4/locales/fr-CA.ts +126 -0
- package/node_modules/zod/src/v4/locales/fr.ts +124 -0
- package/node_modules/zod/src/v4/locales/he.ts +125 -0
- package/node_modules/zod/src/v4/locales/hu.ts +126 -0
- package/node_modules/zod/src/v4/locales/id.ts +125 -0
- package/node_modules/zod/src/v4/locales/index.ts +39 -0
- package/node_modules/zod/src/v4/locales/it.ts +125 -0
- package/node_modules/zod/src/v4/locales/ja.ts +122 -0
- package/node_modules/zod/src/v4/locales/kh.ts +126 -0
- package/node_modules/zod/src/v4/locales/ko.ts +131 -0
- package/node_modules/zod/src/v4/locales/mk.ts +127 -0
- package/node_modules/zod/src/v4/locales/ms.ts +124 -0
- package/node_modules/zod/src/v4/locales/nl.ts +126 -0
- package/node_modules/zod/src/v4/locales/no.ts +124 -0
- package/node_modules/zod/src/v4/locales/ota.ts +125 -0
- package/node_modules/zod/src/v4/locales/pl.ts +126 -0
- package/node_modules/zod/src/v4/locales/ps.ts +133 -0
- package/node_modules/zod/src/v4/locales/pt.ts +123 -0
- package/node_modules/zod/src/v4/locales/ru.ts +184 -0
- package/node_modules/zod/src/v4/locales/sl.ts +126 -0
- package/node_modules/zod/src/v4/locales/sv.ts +127 -0
- package/node_modules/zod/src/v4/locales/ta.ts +125 -0
- package/node_modules/zod/src/v4/locales/th.ts +126 -0
- package/node_modules/zod/src/v4/locales/tr.ts +121 -0
- package/node_modules/zod/src/v4/locales/ua.ts +126 -0
- package/node_modules/zod/src/v4/locales/ur.ts +126 -0
- package/node_modules/zod/src/v4/locales/vi.ts +125 -0
- package/node_modules/zod/src/v4/locales/zh-CN.ts +123 -0
- package/node_modules/zod/src/v4/locales/zh-TW.ts +125 -0
- package/node_modules/zod/src/v4/mini/checks.ts +32 -0
- package/node_modules/zod/src/v4/mini/coerce.ts +22 -0
- package/node_modules/zod/src/v4/mini/external.ts +40 -0
- package/node_modules/zod/src/v4/mini/index.ts +3 -0
- package/node_modules/zod/src/v4/mini/iso.ts +62 -0
- package/node_modules/zod/src/v4/mini/parse.ts +1 -0
- package/node_modules/zod/src/v4/mini/schemas.ts +1579 -0
- package/node_modules/zod/src/v4/mini/tests/assignability.test.ts +129 -0
- package/node_modules/zod/src/v4/mini/tests/brand.test.ts +51 -0
- package/node_modules/zod/src/v4/mini/tests/checks.test.ts +144 -0
- package/node_modules/zod/src/v4/mini/tests/computed.test.ts +36 -0
- package/node_modules/zod/src/v4/mini/tests/error.test.ts +22 -0
- package/node_modules/zod/src/v4/mini/tests/functions.test.ts +43 -0
- package/node_modules/zod/src/v4/mini/tests/index.test.ts +871 -0
- package/node_modules/zod/src/v4/mini/tests/number.test.ts +95 -0
- package/node_modules/zod/src/v4/mini/tests/object.test.ts +185 -0
- package/node_modules/zod/src/v4/mini/tests/prototypes.test.ts +43 -0
- package/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +275 -0
- package/node_modules/zod/src/v4/mini/tests/string.test.ts +299 -0
- package/node_modules/zod/src/v4-mini/index.ts +1 -0
- package/node_modules/zod/v3/ZodError.cjs +138 -0
- package/node_modules/zod/v3/ZodError.d.cts +164 -0
- package/node_modules/zod/v3/ZodError.d.ts +164 -0
- package/node_modules/zod/v3/ZodError.js +133 -0
- package/node_modules/zod/v3/errors.cjs +17 -0
- package/node_modules/zod/v3/errors.d.cts +5 -0
- package/node_modules/zod/v3/errors.d.ts +5 -0
- package/node_modules/zod/v3/errors.js +9 -0
- package/node_modules/zod/v3/external.cjs +22 -0
- package/node_modules/zod/v3/external.d.cts +6 -0
- package/node_modules/zod/v3/external.d.ts +6 -0
- package/node_modules/zod/v3/external.js +6 -0
- package/node_modules/zod/v3/helpers/enumUtil.cjs +2 -0
- package/node_modules/zod/v3/helpers/enumUtil.d.cts +8 -0
- package/node_modules/zod/v3/helpers/enumUtil.d.ts +8 -0
- package/node_modules/zod/v3/helpers/enumUtil.js +1 -0
- package/node_modules/zod/v3/helpers/errorUtil.cjs +9 -0
- package/node_modules/zod/v3/helpers/errorUtil.d.cts +9 -0
- package/node_modules/zod/v3/helpers/errorUtil.d.ts +9 -0
- package/node_modules/zod/v3/helpers/errorUtil.js +6 -0
- package/node_modules/zod/v3/helpers/parseUtil.cjs +124 -0
- package/node_modules/zod/v3/helpers/parseUtil.d.cts +78 -0
- package/node_modules/zod/v3/helpers/parseUtil.d.ts +78 -0
- package/node_modules/zod/v3/helpers/parseUtil.js +109 -0
- package/node_modules/zod/v3/helpers/partialUtil.cjs +2 -0
- package/node_modules/zod/v3/helpers/partialUtil.d.cts +8 -0
- package/node_modules/zod/v3/helpers/partialUtil.d.ts +8 -0
- package/node_modules/zod/v3/helpers/partialUtil.js +1 -0
- package/node_modules/zod/v3/helpers/typeAliases.cjs +2 -0
- package/node_modules/zod/v3/helpers/typeAliases.d.cts +2 -0
- package/node_modules/zod/v3/helpers/typeAliases.d.ts +2 -0
- package/node_modules/zod/v3/helpers/typeAliases.js +1 -0
- package/node_modules/zod/v3/helpers/util.cjs +137 -0
- package/node_modules/zod/v3/helpers/util.d.cts +85 -0
- package/node_modules/zod/v3/helpers/util.d.ts +85 -0
- package/node_modules/zod/v3/helpers/util.js +133 -0
- package/node_modules/zod/v3/index.cjs +33 -0
- package/node_modules/zod/v3/index.d.cts +4 -0
- package/node_modules/zod/v3/index.d.ts +4 -0
- package/node_modules/zod/v3/index.js +4 -0
- package/node_modules/zod/v3/locales/en.cjs +111 -0
- package/node_modules/zod/v3/locales/en.d.cts +3 -0
- package/node_modules/zod/v3/locales/en.d.ts +3 -0
- package/node_modules/zod/v3/locales/en.js +109 -0
- package/node_modules/zod/v3/standard-schema.cjs +2 -0
- package/node_modules/zod/v3/standard-schema.d.cts +102 -0
- package/node_modules/zod/v3/standard-schema.d.ts +102 -0
- package/node_modules/zod/v3/standard-schema.js +1 -0
- package/node_modules/zod/v3/types.cjs +3775 -0
- package/node_modules/zod/v3/types.d.cts +1031 -0
- package/node_modules/zod/v3/types.d.ts +1031 -0
- package/node_modules/zod/v3/types.js +3693 -0
- package/node_modules/zod/v4/classic/checks.cjs +32 -0
- package/node_modules/zod/v4/classic/checks.d.cts +1 -0
- package/node_modules/zod/v4/classic/checks.d.ts +1 -0
- package/node_modules/zod/v4/classic/checks.js +1 -0
- package/node_modules/zod/v4/classic/coerce.cjs +47 -0
- package/node_modules/zod/v4/classic/coerce.d.cts +17 -0
- package/node_modules/zod/v4/classic/coerce.d.ts +17 -0
- package/node_modules/zod/v4/classic/coerce.js +17 -0
- package/node_modules/zod/v4/classic/compat.cjs +57 -0
- package/node_modules/zod/v4/classic/compat.d.cts +46 -0
- package/node_modules/zod/v4/classic/compat.d.ts +46 -0
- package/node_modules/zod/v4/classic/compat.js +27 -0
- package/node_modules/zod/v4/classic/errors.cjs +67 -0
- package/node_modules/zod/v4/classic/errors.d.cts +30 -0
- package/node_modules/zod/v4/classic/errors.d.ts +30 -0
- package/node_modules/zod/v4/classic/errors.js +41 -0
- package/node_modules/zod/v4/classic/external.cjs +70 -0
- package/node_modules/zod/v4/classic/external.d.cts +13 -0
- package/node_modules/zod/v4/classic/external.d.ts +13 -0
- package/node_modules/zod/v4/classic/external.js +18 -0
- package/node_modules/zod/v4/classic/index.cjs +33 -0
- package/node_modules/zod/v4/classic/index.d.cts +4 -0
- package/node_modules/zod/v4/classic/index.d.ts +4 -0
- package/node_modules/zod/v4/classic/index.js +4 -0
- package/node_modules/zod/v4/classic/iso.cjs +60 -0
- package/node_modules/zod/v4/classic/iso.d.cts +22 -0
- package/node_modules/zod/v4/classic/iso.d.ts +22 -0
- package/node_modules/zod/v4/classic/iso.js +30 -0
- package/node_modules/zod/v4/classic/parse.cjs +32 -0
- package/node_modules/zod/v4/classic/parse.d.cts +23 -0
- package/node_modules/zod/v4/classic/parse.d.ts +23 -0
- package/node_modules/zod/v4/classic/parse.js +6 -0
- package/node_modules/zod/v4/classic/schemas.cjs +1109 -0
- package/node_modules/zod/v4/classic/schemas.d.cts +630 -0
- package/node_modules/zod/v4/classic/schemas.d.ts +630 -0
- package/node_modules/zod/v4/classic/schemas.js +1006 -0
- package/node_modules/zod/v4/core/api.cjs +1039 -0
- package/node_modules/zod/v4/core/api.d.cts +284 -0
- package/node_modules/zod/v4/core/api.d.ts +284 -0
- package/node_modules/zod/v4/core/api.js +906 -0
- package/node_modules/zod/v4/core/checks.cjs +591 -0
- package/node_modules/zod/v4/core/checks.d.cts +278 -0
- package/node_modules/zod/v4/core/checks.d.ts +278 -0
- package/node_modules/zod/v4/core/checks.js +565 -0
- package/node_modules/zod/v4/core/core.cjs +67 -0
- package/node_modules/zod/v4/core/core.d.cts +49 -0
- package/node_modules/zod/v4/core/core.d.ts +49 -0
- package/node_modules/zod/v4/core/core.js +61 -0
- package/node_modules/zod/v4/core/doc.cjs +39 -0
- package/node_modules/zod/v4/core/doc.d.cts +14 -0
- package/node_modules/zod/v4/core/doc.d.ts +14 -0
- package/node_modules/zod/v4/core/doc.js +35 -0
- package/node_modules/zod/v4/core/errors.cjs +226 -0
- package/node_modules/zod/v4/core/errors.d.cts +208 -0
- package/node_modules/zod/v4/core/errors.d.ts +208 -0
- package/node_modules/zod/v4/core/errors.js +195 -0
- package/node_modules/zod/v4/core/function.cjs +102 -0
- package/node_modules/zod/v4/core/function.d.cts +52 -0
- package/node_modules/zod/v4/core/function.d.ts +52 -0
- package/node_modules/zod/v4/core/function.js +75 -0
- package/node_modules/zod/v4/core/index.cjs +44 -0
- package/node_modules/zod/v4/core/index.d.cts +15 -0
- package/node_modules/zod/v4/core/index.d.ts +15 -0
- package/node_modules/zod/v4/core/index.js +15 -0
- package/node_modules/zod/v4/core/json-schema.cjs +2 -0
- package/node_modules/zod/v4/core/json-schema.d.cts +87 -0
- package/node_modules/zod/v4/core/json-schema.d.ts +87 -0
- package/node_modules/zod/v4/core/json-schema.js +1 -0
- package/node_modules/zod/v4/core/parse.cjs +87 -0
- package/node_modules/zod/v4/core/parse.d.cts +25 -0
- package/node_modules/zod/v4/core/parse.d.ts +25 -0
- package/node_modules/zod/v4/core/parse.js +57 -0
- package/node_modules/zod/v4/core/regexes.cjs +103 -0
- package/node_modules/zod/v4/core/regexes.d.cts +62 -0
- package/node_modules/zod/v4/core/regexes.d.ts +62 -0
- package/node_modules/zod/v4/core/regexes.js +95 -0
- package/node_modules/zod/v4/core/registries.cjs +56 -0
- package/node_modules/zod/v4/core/registries.d.cts +35 -0
- package/node_modules/zod/v4/core/registries.d.ts +35 -0
- package/node_modules/zod/v4/core/registries.js +51 -0
- package/node_modules/zod/v4/core/schemas.cjs +1748 -0
- package/node_modules/zod/v4/core/schemas.d.cts +1041 -0
- package/node_modules/zod/v4/core/schemas.d.ts +1041 -0
- package/node_modules/zod/v4/core/schemas.js +1717 -0
- package/node_modules/zod/v4/core/standard-schema.cjs +2 -0
- package/node_modules/zod/v4/core/standard-schema.d.cts +55 -0
- package/node_modules/zod/v4/core/standard-schema.d.ts +55 -0
- package/node_modules/zod/v4/core/standard-schema.js +1 -0
- package/node_modules/zod/v4/core/to-json-schema.cjs +854 -0
- package/node_modules/zod/v4/core/to-json-schema.d.cts +88 -0
- package/node_modules/zod/v4/core/to-json-schema.d.ts +88 -0
- package/node_modules/zod/v4/core/to-json-schema.js +849 -0
- package/node_modules/zod/v4/core/util.cjs +539 -0
- package/node_modules/zod/v4/core/util.d.cts +183 -0
- package/node_modules/zod/v4/core/util.d.ts +183 -0
- package/node_modules/zod/v4/core/util.js +493 -0
- package/node_modules/zod/v4/core/versions.cjs +8 -0
- package/node_modules/zod/v4/core/versions.d.cts +5 -0
- package/node_modules/zod/v4/core/versions.d.ts +5 -0
- package/node_modules/zod/v4/core/versions.js +5 -0
- package/node_modules/zod/v4/index.cjs +22 -0
- package/node_modules/zod/v4/index.d.cts +3 -0
- package/node_modules/zod/v4/index.d.ts +3 -0
- package/node_modules/zod/v4/index.js +3 -0
- package/node_modules/zod/v4/locales/ar.cjs +142 -0
- package/node_modules/zod/v4/locales/ar.d.cts +4 -0
- package/node_modules/zod/v4/locales/ar.d.ts +4 -0
- package/node_modules/zod/v4/locales/ar.js +116 -0
- package/node_modules/zod/v4/locales/az.cjs +141 -0
- package/node_modules/zod/v4/locales/az.d.cts +4 -0
- package/node_modules/zod/v4/locales/az.d.ts +4 -0
- package/node_modules/zod/v4/locales/az.js +115 -0
- package/node_modules/zod/v4/locales/be.cjs +190 -0
- package/node_modules/zod/v4/locales/be.d.cts +4 -0
- package/node_modules/zod/v4/locales/be.d.ts +4 -0
- package/node_modules/zod/v4/locales/be.js +164 -0
- package/node_modules/zod/v4/locales/ca.cjs +144 -0
- package/node_modules/zod/v4/locales/ca.d.cts +4 -0
- package/node_modules/zod/v4/locales/ca.d.ts +4 -0
- package/node_modules/zod/v4/locales/ca.js +118 -0
- package/node_modules/zod/v4/locales/cs.cjs +161 -0
- package/node_modules/zod/v4/locales/cs.d.cts +4 -0
- package/node_modules/zod/v4/locales/cs.d.ts +4 -0
- package/node_modules/zod/v4/locales/cs.js +135 -0
- package/node_modules/zod/v4/locales/de.cjs +142 -0
- package/node_modules/zod/v4/locales/de.d.cts +4 -0
- package/node_modules/zod/v4/locales/de.d.ts +4 -0
- package/node_modules/zod/v4/locales/de.js +116 -0
- package/node_modules/zod/v4/locales/en.cjs +145 -0
- package/node_modules/zod/v4/locales/en.d.cts +5 -0
- package/node_modules/zod/v4/locales/en.d.ts +5 -0
- package/node_modules/zod/v4/locales/en.js +117 -0
- package/node_modules/zod/v4/locales/eo.cjs +144 -0
- package/node_modules/zod/v4/locales/eo.d.cts +5 -0
- package/node_modules/zod/v4/locales/eo.d.ts +5 -0
- package/node_modules/zod/v4/locales/eo.js +116 -0
- package/node_modules/zod/v4/locales/es.cjs +143 -0
- package/node_modules/zod/v4/locales/es.d.cts +4 -0
- package/node_modules/zod/v4/locales/es.d.ts +4 -0
- package/node_modules/zod/v4/locales/es.js +117 -0
- package/node_modules/zod/v4/locales/fa.cjs +148 -0
- package/node_modules/zod/v4/locales/fa.d.cts +4 -0
- package/node_modules/zod/v4/locales/fa.d.ts +4 -0
- package/node_modules/zod/v4/locales/fa.js +122 -0
- package/node_modules/zod/v4/locales/fi.cjs +148 -0
- package/node_modules/zod/v4/locales/fi.d.cts +4 -0
- package/node_modules/zod/v4/locales/fi.d.ts +4 -0
- package/node_modules/zod/v4/locales/fi.js +122 -0
- package/node_modules/zod/v4/locales/fr-CA.cjs +143 -0
- package/node_modules/zod/v4/locales/fr-CA.d.cts +4 -0
- package/node_modules/zod/v4/locales/fr-CA.d.ts +4 -0
- package/node_modules/zod/v4/locales/fr-CA.js +117 -0
- package/node_modules/zod/v4/locales/fr.cjs +142 -0
- package/node_modules/zod/v4/locales/fr.d.cts +4 -0
- package/node_modules/zod/v4/locales/fr.d.ts +4 -0
- package/node_modules/zod/v4/locales/fr.js +116 -0
- package/node_modules/zod/v4/locales/he.cjs +143 -0
- package/node_modules/zod/v4/locales/he.d.cts +4 -0
- package/node_modules/zod/v4/locales/he.d.ts +4 -0
- package/node_modules/zod/v4/locales/he.js +117 -0
- package/node_modules/zod/v4/locales/hu.cjs +143 -0
- package/node_modules/zod/v4/locales/hu.d.cts +4 -0
- package/node_modules/zod/v4/locales/hu.d.ts +4 -0
- package/node_modules/zod/v4/locales/hu.js +117 -0
- package/node_modules/zod/v4/locales/id.cjs +142 -0
- package/node_modules/zod/v4/locales/id.d.cts +4 -0
- package/node_modules/zod/v4/locales/id.d.ts +4 -0
- package/node_modules/zod/v4/locales/id.js +116 -0
- package/node_modules/zod/v4/locales/index.cjs +84 -0
- package/node_modules/zod/v4/locales/index.d.cts +39 -0
- package/node_modules/zod/v4/locales/index.d.ts +39 -0
- package/node_modules/zod/v4/locales/index.js +39 -0
- package/node_modules/zod/v4/locales/it.cjs +143 -0
- package/node_modules/zod/v4/locales/it.d.cts +4 -0
- package/node_modules/zod/v4/locales/it.d.ts +4 -0
- package/node_modules/zod/v4/locales/it.js +117 -0
- package/node_modules/zod/v4/locales/ja.cjs +141 -0
- package/node_modules/zod/v4/locales/ja.d.cts +4 -0
- package/node_modules/zod/v4/locales/ja.d.ts +4 -0
- package/node_modules/zod/v4/locales/ja.js +115 -0
- package/node_modules/zod/v4/locales/kh.cjs +143 -0
- package/node_modules/zod/v4/locales/kh.d.cts +4 -0
- package/node_modules/zod/v4/locales/kh.d.ts +4 -0
- package/node_modules/zod/v4/locales/kh.js +117 -0
- package/node_modules/zod/v4/locales/ko.cjs +147 -0
- package/node_modules/zod/v4/locales/ko.d.cts +4 -0
- package/node_modules/zod/v4/locales/ko.d.ts +4 -0
- package/node_modules/zod/v4/locales/ko.js +121 -0
- package/node_modules/zod/v4/locales/mk.cjs +144 -0
- package/node_modules/zod/v4/locales/mk.d.cts +4 -0
- package/node_modules/zod/v4/locales/mk.d.ts +4 -0
- package/node_modules/zod/v4/locales/mk.js +118 -0
- package/node_modules/zod/v4/locales/ms.cjs +142 -0
- package/node_modules/zod/v4/locales/ms.d.cts +4 -0
- package/node_modules/zod/v4/locales/ms.d.ts +4 -0
- package/node_modules/zod/v4/locales/ms.js +116 -0
- package/node_modules/zod/v4/locales/nl.cjs +143 -0
- package/node_modules/zod/v4/locales/nl.d.cts +4 -0
- package/node_modules/zod/v4/locales/nl.d.ts +4 -0
- package/node_modules/zod/v4/locales/nl.js +117 -0
- package/node_modules/zod/v4/locales/no.cjs +142 -0
- package/node_modules/zod/v4/locales/no.d.cts +4 -0
- package/node_modules/zod/v4/locales/no.d.ts +4 -0
- package/node_modules/zod/v4/locales/no.js +116 -0
- package/node_modules/zod/v4/locales/ota.cjs +143 -0
- package/node_modules/zod/v4/locales/ota.d.cts +4 -0
- package/node_modules/zod/v4/locales/ota.d.ts +4 -0
- package/node_modules/zod/v4/locales/ota.js +117 -0
- package/node_modules/zod/v4/locales/pl.cjs +143 -0
- package/node_modules/zod/v4/locales/pl.d.cts +4 -0
- package/node_modules/zod/v4/locales/pl.d.ts +4 -0
- package/node_modules/zod/v4/locales/pl.js +117 -0
- package/node_modules/zod/v4/locales/ps.cjs +148 -0
- package/node_modules/zod/v4/locales/ps.d.cts +4 -0
- package/node_modules/zod/v4/locales/ps.d.ts +4 -0
- package/node_modules/zod/v4/locales/ps.js +122 -0
- package/node_modules/zod/v4/locales/pt.cjs +142 -0
- package/node_modules/zod/v4/locales/pt.d.cts +4 -0
- package/node_modules/zod/v4/locales/pt.d.ts +4 -0
- package/node_modules/zod/v4/locales/pt.js +116 -0
- package/node_modules/zod/v4/locales/ru.cjs +190 -0
- package/node_modules/zod/v4/locales/ru.d.cts +4 -0
- package/node_modules/zod/v4/locales/ru.d.ts +4 -0
- package/node_modules/zod/v4/locales/ru.js +164 -0
- package/node_modules/zod/v4/locales/sl.cjs +143 -0
- package/node_modules/zod/v4/locales/sl.d.cts +4 -0
- package/node_modules/zod/v4/locales/sl.d.ts +4 -0
- package/node_modules/zod/v4/locales/sl.js +117 -0
- package/node_modules/zod/v4/locales/sv.cjs +144 -0
- package/node_modules/zod/v4/locales/sv.d.cts +4 -0
- package/node_modules/zod/v4/locales/sv.d.ts +4 -0
- package/node_modules/zod/v4/locales/sv.js +118 -0
- package/node_modules/zod/v4/locales/ta.cjs +143 -0
- package/node_modules/zod/v4/locales/ta.d.cts +4 -0
- package/node_modules/zod/v4/locales/ta.d.ts +4 -0
- package/node_modules/zod/v4/locales/ta.js +117 -0
- package/node_modules/zod/v4/locales/th.cjs +143 -0
- package/node_modules/zod/v4/locales/th.d.cts +4 -0
- package/node_modules/zod/v4/locales/th.d.ts +4 -0
- package/node_modules/zod/v4/locales/th.js +117 -0
- package/node_modules/zod/v4/locales/tr.cjs +143 -0
- package/node_modules/zod/v4/locales/tr.d.cts +5 -0
- package/node_modules/zod/v4/locales/tr.d.ts +5 -0
- package/node_modules/zod/v4/locales/tr.js +115 -0
- package/node_modules/zod/v4/locales/ua.cjs +143 -0
- package/node_modules/zod/v4/locales/ua.d.cts +4 -0
- package/node_modules/zod/v4/locales/ua.d.ts +4 -0
- package/node_modules/zod/v4/locales/ua.js +117 -0
- package/node_modules/zod/v4/locales/ur.cjs +143 -0
- package/node_modules/zod/v4/locales/ur.d.cts +4 -0
- package/node_modules/zod/v4/locales/ur.d.ts +4 -0
- package/node_modules/zod/v4/locales/ur.js +117 -0
- package/node_modules/zod/v4/locales/vi.cjs +142 -0
- package/node_modules/zod/v4/locales/vi.d.cts +4 -0
- package/node_modules/zod/v4/locales/vi.d.ts +4 -0
- package/node_modules/zod/v4/locales/vi.js +116 -0
- package/node_modules/zod/v4/locales/zh-CN.cjs +142 -0
- package/node_modules/zod/v4/locales/zh-CN.d.cts +4 -0
- package/node_modules/zod/v4/locales/zh-CN.d.ts +4 -0
- package/node_modules/zod/v4/locales/zh-CN.js +116 -0
- package/node_modules/zod/v4/locales/zh-TW.cjs +143 -0
- package/node_modules/zod/v4/locales/zh-TW.d.cts +4 -0
- package/node_modules/zod/v4/locales/zh-TW.d.ts +4 -0
- package/node_modules/zod/v4/locales/zh-TW.js +117 -0
- package/node_modules/zod/v4/mini/checks.cjs +34 -0
- package/node_modules/zod/v4/mini/checks.d.cts +1 -0
- package/node_modules/zod/v4/mini/checks.d.ts +1 -0
- package/node_modules/zod/v4/mini/checks.js +1 -0
- package/node_modules/zod/v4/mini/coerce.cjs +47 -0
- package/node_modules/zod/v4/mini/coerce.d.cts +7 -0
- package/node_modules/zod/v4/mini/coerce.d.ts +7 -0
- package/node_modules/zod/v4/mini/coerce.js +17 -0
- package/node_modules/zod/v4/mini/external.cjs +62 -0
- package/node_modules/zod/v4/mini/external.d.cts +11 -0
- package/node_modules/zod/v4/mini/external.d.ts +11 -0
- package/node_modules/zod/v4/mini/external.js +13 -0
- package/node_modules/zod/v4/mini/index.cjs +32 -0
- package/node_modules/zod/v4/mini/index.d.cts +3 -0
- package/node_modules/zod/v4/mini/index.d.ts +3 -0
- package/node_modules/zod/v4/mini/index.js +3 -0
- package/node_modules/zod/v4/mini/iso.cjs +60 -0
- package/node_modules/zod/v4/mini/iso.d.cts +22 -0
- package/node_modules/zod/v4/mini/iso.d.ts +22 -0
- package/node_modules/zod/v4/mini/iso.js +30 -0
- package/node_modules/zod/v4/mini/parse.cjs +8 -0
- package/node_modules/zod/v4/mini/parse.d.cts +1 -0
- package/node_modules/zod/v4/mini/parse.d.ts +1 -0
- package/node_modules/zod/v4/mini/parse.js +1 -0
- package/node_modules/zod/v4/mini/schemas.cjs +839 -0
- package/node_modules/zod/v4/mini/schemas.d.cts +356 -0
- package/node_modules/zod/v4/mini/schemas.d.ts +356 -0
- package/node_modules/zod/v4/mini/schemas.js +732 -0
- package/node_modules/zod/v4-mini/index.cjs +17 -0
- package/node_modules/zod/v4-mini/index.d.cts +1 -0
- package/node_modules/zod/v4-mini/index.d.ts +1 -0
- package/node_modules/zod/v4-mini/index.js +1 -0
- package/package.json +10 -20
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
ActivationInput,
|
|
3
|
+
ActivationResult,
|
|
4
|
+
Assumption,
|
|
5
|
+
DangerousGate,
|
|
6
|
+
ModeScoring,
|
|
7
|
+
NonFunctionalGate,
|
|
8
|
+
ProcessMode,
|
|
9
|
+
SynthesizedSeed,
|
|
10
|
+
WorkflowCanvas,
|
|
11
|
+
} from "./types";
|
|
12
|
+
import { activationResultSchema } from "./types";
|
|
13
|
+
|
|
14
|
+
function compact(text: string): string {
|
|
15
|
+
return text.replace(/\s+/g, " ").trim();
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
let _ctr = 0;
|
|
19
|
+
function aId(): string { return `asmp-${++_ctr}-${Date.now().toString(36)}`; }
|
|
20
|
+
|
|
21
|
+
// ---------------------------------------------------------------------------
|
|
22
|
+
// 1. Assumption Register
|
|
23
|
+
// ---------------------------------------------------------------------------
|
|
24
|
+
|
|
25
|
+
export function buildAssumptions(seed: SynthesizedSeed, input: ActivationInput): Assumption[] {
|
|
26
|
+
const assumptions: Assumption[] = [];
|
|
27
|
+
|
|
28
|
+
// Open questions → unconfirmed assumptions
|
|
29
|
+
for (const q of seed.open_questions) {
|
|
30
|
+
assumptions.push({
|
|
31
|
+
id: aId(), text: q, status: "unconfirmed",
|
|
32
|
+
evidence_type: "weak-inference", risk_level: "medium", source: "user-question",
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// Missing inputs → high-risk unconfirmed assumptions
|
|
37
|
+
for (const m of seed.missing_inputs) {
|
|
38
|
+
assumptions.push({
|
|
39
|
+
id: aId(), text: m, status: "unconfirmed",
|
|
40
|
+
evidence_type: "weak-inference", risk_level: "high", source: "missing-input",
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// If target user is generic → assumption about audience
|
|
45
|
+
if (seed.target_user === "Solo builders shipping software.") {
|
|
46
|
+
assumptions.push({
|
|
47
|
+
id: aId(), text: "Target user is assumed to be solo builders (not explicitly stated).",
|
|
48
|
+
status: "unconfirmed", evidence_type: "weak-inference", risk_level: "medium", source: "inference",
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// If no repo → assumption about starting fresh
|
|
53
|
+
if (!input.repo_exists) {
|
|
54
|
+
assumptions.push({
|
|
55
|
+
id: aId(), text: "No existing codebase — starting from scratch.",
|
|
56
|
+
status: "confirmed", evidence_type: "user-backed", risk_level: "low", source: "user-input",
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return assumptions;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// ---------------------------------------------------------------------------
|
|
64
|
+
// 2. Workflow Grounding Canvas
|
|
65
|
+
// ---------------------------------------------------------------------------
|
|
66
|
+
|
|
67
|
+
const USER_PATTERNS = [
|
|
68
|
+
/\bfor\s+([^.,;!?\n]{4,60}?)(?:\s+(?:that|who|which))/i,
|
|
69
|
+
/\bfor\s+([^.,;!?\n]{4,60})/i,
|
|
70
|
+
/\btargeting\s+([^.,;!?\n]{4,60})/i,
|
|
71
|
+
];
|
|
72
|
+
|
|
73
|
+
const CURRENT_WORKFLOW_PATTERNS = [
|
|
74
|
+
/(?:right now|currently|today)[,:]?\s+(.{15,150})/i,
|
|
75
|
+
/(?:we|I)\s+(?:currently|already)\s+(.{10,100})/i,
|
|
76
|
+
/(?:the current|our current)\s+(.{10,100})/i,
|
|
77
|
+
];
|
|
78
|
+
|
|
79
|
+
const TARGET_WORKFLOW_PATTERNS = [
|
|
80
|
+
/(?:I want|we want|should be able to|the user should)\s+(.{10,150})/i,
|
|
81
|
+
/(?:instead of|rather than)\s+.{5,50}?,?\s*(.{10,100})/i,
|
|
82
|
+
];
|
|
83
|
+
|
|
84
|
+
const JOB_PATTERNS = [
|
|
85
|
+
/(?:the core outcome|the goal|the job|what I want)\s+(?:is|I want)[:\s]+(.{10,150})/i,
|
|
86
|
+
/(?:so that|in order to)\s+(.{10,100})/i,
|
|
87
|
+
];
|
|
88
|
+
|
|
89
|
+
export function buildWorkflowCanvas(raw: string, seed: SynthesizedSeed): WorkflowCanvas {
|
|
90
|
+
let primary_user = "";
|
|
91
|
+
for (const p of USER_PATTERNS) {
|
|
92
|
+
const m = raw.match(p);
|
|
93
|
+
if (m?.[1] && m[1].length > 5) { primary_user = compact(m[1]); break; }
|
|
94
|
+
}
|
|
95
|
+
if (!primary_user && seed.target_user !== "Solo builders shipping software.") {
|
|
96
|
+
primary_user = seed.target_user;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
let current_workflow = "";
|
|
100
|
+
for (const p of CURRENT_WORKFLOW_PATTERNS) {
|
|
101
|
+
const m = raw.match(p);
|
|
102
|
+
if (m?.[1]) { current_workflow = compact(m[1]).slice(0, 150); break; }
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
let target_workflow = "";
|
|
106
|
+
for (const p of TARGET_WORKFLOW_PATTERNS) {
|
|
107
|
+
const m = raw.match(p);
|
|
108
|
+
if (m?.[1]) { target_workflow = compact(m[1]).slice(0, 150); break; }
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
let job_to_be_done = seed.v1_outcome || "";
|
|
112
|
+
for (const p of JOB_PATTERNS) {
|
|
113
|
+
const m = raw.match(p);
|
|
114
|
+
if (m?.[1] && m[1].length > 15) { job_to_be_done = compact(m[1]).slice(0, 150); break; }
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
return { primary_user, current_workflow, target_workflow, job_to_be_done, edge_cases: [] };
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// ---------------------------------------------------------------------------
|
|
121
|
+
// 3. Non-functional gates
|
|
122
|
+
// ---------------------------------------------------------------------------
|
|
123
|
+
|
|
124
|
+
const NF_PATTERNS: { category: NonFunctionalGate["category"]; patterns: RegExp[]; reason: string }[] = [
|
|
125
|
+
{ category: "security", patterns: [/\bauth\b/i, /\bpassword\b/i, /\btoken\b/i, /\bOAuth\b/i, /\bencrypt/i, /\bAPI\s*key\b/i], reason: "Auth/security-related functionality detected." },
|
|
126
|
+
{ category: "privacy", patterns: [/\bPII\b/i, /\bpersonal\s+data\b/i, /\bGDPR\b/i, /\bemail\s+address/i, /\buser\s+data\b/i], reason: "Personal/user data handling detected." },
|
|
127
|
+
{ category: "compliance", patterns: [/\bcompliance\b/i, /\bregulatory\b/i, /\bHIPAA\b/i, /\bSOC\s*2\b/i, /\blegal\b/i], reason: "Compliance-relevant domain detected." },
|
|
128
|
+
{ category: "performance", patterns: [/\breal.?time\b/i, /\blatency\b/i, /\bscale\b/i, /\bconcurren/i, /\bstreaming\b/i], reason: "Performance-sensitive requirements detected." },
|
|
129
|
+
{ category: "observability", patterns: [/\blogging\b/i, /\bmonitoring\b/i, /\balert/i, /\bmetric/i, /\btrac(?:e|ing)\b/i], reason: "Observability-relevant functionality detected." },
|
|
130
|
+
];
|
|
131
|
+
|
|
132
|
+
export function checkNonFunctionalGates(raw: string, constraints: string): NonFunctionalGate[] {
|
|
133
|
+
const combined = `${raw} ${constraints}`;
|
|
134
|
+
const gates: NonFunctionalGate[] = [];
|
|
135
|
+
|
|
136
|
+
for (const nf of NF_PATTERNS) {
|
|
137
|
+
const triggered = nf.patterns.some(p => p.test(combined));
|
|
138
|
+
if (triggered) {
|
|
139
|
+
gates.push({
|
|
140
|
+
category: nf.category,
|
|
141
|
+
flagged: true,
|
|
142
|
+
reason: nf.reason,
|
|
143
|
+
severity: nf.category === "security" || nf.category === "privacy" ? "medium" : "low",
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
return gates;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
// ---------------------------------------------------------------------------
|
|
152
|
+
// 4. Dangerous gates
|
|
153
|
+
// ---------------------------------------------------------------------------
|
|
154
|
+
|
|
155
|
+
export function checkDangerousGates(raw: string, constraints: string, seed: SynthesizedSeed): DangerousGate[] {
|
|
156
|
+
const combined = compact(`${raw} ${constraints}`).toLowerCase();
|
|
157
|
+
const gates: DangerousGate[] = [];
|
|
158
|
+
|
|
159
|
+
// Privacy high-risk
|
|
160
|
+
if (/\b(medical|health|financial|banking|credit\s*card|SSN|social\s*security)\b/i.test(combined)) {
|
|
161
|
+
gates.push({ gate: "privacy-high-risk", triggered: true, reason: "Domain involves sensitive personal/financial/medical data." });
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
// Trust boundary uncertainty
|
|
165
|
+
if (seed.missing_inputs.some(m => /target user/i.test(m)) || seed.target_user === "Solo builders shipping software.") {
|
|
166
|
+
if (/\b(team|enterprise|organization|company|admin)\b/i.test(combined) && !/\bnot?\s+(?:a\s+)?(?:team|enterprise)/i.test(combined)) {
|
|
167
|
+
gates.push({ gate: "trust-boundary-uncertain", triggered: true, reason: "Multi-user/team context with unclear trust boundaries." });
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
// Production-critical
|
|
172
|
+
if (/\b(production|prod|live\s+system|critical\s+path|payment|billing)\b/i.test(combined)) {
|
|
173
|
+
if (!/\bno\s+billing\b/i.test(combined) && !/\bno\s+payment\b/i.test(combined)) {
|
|
174
|
+
gates.push({ gate: "production-critical", triggered: true, reason: "Production-critical or payment-adjacent functionality." });
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
// Overbroad + missing stop condition
|
|
179
|
+
const systemCount = (combined.match(/\b(slack|jira|github|linear|hubspot|notion|email|stripe|twilio)\b/gi) ?? []).length;
|
|
180
|
+
const hasStopCondition = /\bv1\b|\bfirst\s+slice\b|\bonly\b|\bjust\b|\bsimple\b|\bnarrow\b/i.test(combined);
|
|
181
|
+
if (systemCount >= 4 && !hasStopCondition) {
|
|
182
|
+
gates.push({ gate: "overbroad-no-stop", triggered: true, reason: `${systemCount} systems mentioned with no clear V1 narrowing.` });
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
return gates;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
// ---------------------------------------------------------------------------
|
|
189
|
+
// 5. Mode scoring
|
|
190
|
+
// ---------------------------------------------------------------------------
|
|
191
|
+
|
|
192
|
+
export function scoreMode(raw: string, constraints: string, seed: SynthesizedSeed): ModeScoring {
|
|
193
|
+
const combined = compact(`${raw} ${constraints}`).toLowerCase();
|
|
194
|
+
|
|
195
|
+
const surface_area = combined.length > 500 ? 2 : combined.length > 200 ? 1 : 0;
|
|
196
|
+
|
|
197
|
+
const integrations = (combined.match(/\b(slack|jira|github|linear|hubspot|notion|email|supabase|stripe|firebase|aws)\b/gi) ?? []);
|
|
198
|
+
const integration_count = Math.min(integrations.length, 3);
|
|
199
|
+
|
|
200
|
+
const user_clarity = seed.target_user !== "Solo builders shipping software." ? 0 : 2;
|
|
201
|
+
|
|
202
|
+
const outcome_concreteness = seed.v1_outcome && seed.v1_outcome.length > 20 ? 0 : seed.v1_outcome ? 1 : 3;
|
|
203
|
+
|
|
204
|
+
const coordination_complexity = /\b(team|across\s+teams|coordinate|orchestrat)\b/i.test(combined) ? 2 : 0;
|
|
205
|
+
|
|
206
|
+
const contradictions = seed.missing_inputs.filter(m => /contradict|conflicting/i.test(m)).length;
|
|
207
|
+
const contradiction_level = Math.min(contradictions, 3);
|
|
208
|
+
|
|
209
|
+
const appetite_mismatch = /\b(two\s+weeks|one\s+week|weekend)\b/i.test(combined) && integration_count >= 2 ? 2 : 0;
|
|
210
|
+
|
|
211
|
+
const total = surface_area + integration_count + user_clarity + outcome_concreteness +
|
|
212
|
+
coordination_complexity + contradiction_level + appetite_mismatch;
|
|
213
|
+
|
|
214
|
+
return { surface_area, integration_count, user_clarity, outcome_concreteness,
|
|
215
|
+
coordination_complexity, contradiction_level, appetite_mismatch, total };
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
// ---------------------------------------------------------------------------
|
|
219
|
+
// 6. Two-stage mode selection
|
|
220
|
+
// ---------------------------------------------------------------------------
|
|
221
|
+
|
|
222
|
+
export function selectModeV2(
|
|
223
|
+
dangerousGates: DangerousGate[],
|
|
224
|
+
scoring: ModeScoring,
|
|
225
|
+
): { mode: ProcessMode; reason: string } {
|
|
226
|
+
// Stage 1: Dangerous gates → governance
|
|
227
|
+
const triggered = dangerousGates.filter(g => g.triggered);
|
|
228
|
+
if (triggered.length > 0) {
|
|
229
|
+
return {
|
|
230
|
+
mode: "governance",
|
|
231
|
+
reason: `Dangerous gate(s): ${triggered.map(g => g.gate).join(", ")}.`,
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
// Stage 2: Scoring → simple vs standard
|
|
236
|
+
if (scoring.total <= 3) {
|
|
237
|
+
return { mode: "minimal", reason: `Low complexity score (${scoring.total}/21). Lightweight process.` };
|
|
238
|
+
}
|
|
239
|
+
if (scoring.total >= 10) {
|
|
240
|
+
return { mode: "governance", reason: `High complexity score (${scoring.total}/21). Careful review recommended.` };
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
return { mode: "structured", reason: `Standard complexity score (${scoring.total}/21).` };
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
// ---------------------------------------------------------------------------
|
|
247
|
+
// 7. Escalation triggers
|
|
248
|
+
// ---------------------------------------------------------------------------
|
|
249
|
+
|
|
250
|
+
export function checkEscalationTriggers(raw: string): string[] {
|
|
251
|
+
const triggers: string[] = [];
|
|
252
|
+
if (/\btrust\s+boundar/i.test(raw)) triggers.push("Trust boundaries appeared.");
|
|
253
|
+
if ((raw.match(/\b(slack|jira|github|linear|hubspot|notion|email|supabase|stripe)\b/gi) ?? []).length >= 3) {
|
|
254
|
+
triggers.push("Integration count materially increased.");
|
|
255
|
+
}
|
|
256
|
+
if (/\b(and also|plus|additionally)\s+(?:for|targeting)\s/i.test(raw)) triggers.push("Target users may have split.");
|
|
257
|
+
if (/\b(and also|plus|additionally)\s+(?:build|add|create)\s/i.test(raw)) triggers.push("Scope may have expanded materially.");
|
|
258
|
+
if (/\b(HIPAA|GDPR|SOC|PCI|encrypt|sensitive\s+data)\b/i.test(raw)) triggers.push("Privacy/security risk increased.");
|
|
259
|
+
return triggers;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
// ---------------------------------------------------------------------------
|
|
263
|
+
// Full Activation V2
|
|
264
|
+
// ---------------------------------------------------------------------------
|
|
265
|
+
|
|
266
|
+
export function activateV2(input: ActivationInput, seed: SynthesizedSeed): ActivationResult {
|
|
267
|
+
const assumptions = buildAssumptions(seed, input);
|
|
268
|
+
const workflow_canvas = buildWorkflowCanvas(input.raw_idea, seed);
|
|
269
|
+
const non_functional_gates = checkNonFunctionalGates(input.raw_idea, input.constraints);
|
|
270
|
+
const dangerous_gates = checkDangerousGates(input.raw_idea, input.constraints, seed);
|
|
271
|
+
const mode_scoring = scoreMode(input.raw_idea, input.constraints, seed);
|
|
272
|
+
const { mode } = selectModeV2(dangerous_gates, mode_scoring);
|
|
273
|
+
const escalation_triggers = checkEscalationTriggers(input.raw_idea);
|
|
274
|
+
|
|
275
|
+
return activationResultSchema.parse({
|
|
276
|
+
assumptions,
|
|
277
|
+
workflow_canvas,
|
|
278
|
+
non_functional_gates,
|
|
279
|
+
dangerous_gates,
|
|
280
|
+
mode_scoring,
|
|
281
|
+
selected_mode: mode,
|
|
282
|
+
mode_is_escalatable: true,
|
|
283
|
+
escalation_triggers,
|
|
284
|
+
});
|
|
285
|
+
}
|
|
@@ -0,0 +1,403 @@
|
|
|
1
|
+
import { randomBytes } from "crypto";
|
|
2
|
+
import type {
|
|
3
|
+
AuditedReceipt,
|
|
4
|
+
AuditResult,
|
|
5
|
+
CanonicalDelta,
|
|
6
|
+
ClaimAssessment,
|
|
7
|
+
ClaimDisposition,
|
|
8
|
+
GateState,
|
|
9
|
+
NextSlice,
|
|
10
|
+
NormalizedReturnEnvelope,
|
|
11
|
+
TrustPosture,
|
|
12
|
+
} from "./types";
|
|
13
|
+
import { auditedReceiptSchema } from "./types";
|
|
14
|
+
import { deriveControlFlags } from "./run-snapshot";
|
|
15
|
+
import type { TraceSummary } from "./execution-trace";
|
|
16
|
+
import type { BudgetSummary } from "./budget-ledger";
|
|
17
|
+
import type { OverflowSummary } from "./types";
|
|
18
|
+
|
|
19
|
+
// ---------------------------------------------------------------------------
|
|
20
|
+
// Audited Receipt — the official product-level receipt
|
|
21
|
+
// ---------------------------------------------------------------------------
|
|
22
|
+
//
|
|
23
|
+
// The audited receipt is what the system trusts. It is built from:
|
|
24
|
+
// - NormalizedReturnEnvelope (what the agent claimed)
|
|
25
|
+
// - CanonicalDelta (what actually changed, with evidence accounting)
|
|
26
|
+
// - GateState (the gate's verdict on the evidence)
|
|
27
|
+
// - NextSlice (what comes next, if anything)
|
|
28
|
+
//
|
|
29
|
+
// It explicitly distinguishes:
|
|
30
|
+
// - what was claimed
|
|
31
|
+
// - what was actually proven
|
|
32
|
+
// - what remains partial / inferred / weak
|
|
33
|
+
// - what cautions and residuals carry forward
|
|
34
|
+
// - whether closure is allowed
|
|
35
|
+
// - whether canonical state advanced, and on what basis
|
|
36
|
+
// ---------------------------------------------------------------------------
|
|
37
|
+
|
|
38
|
+
export interface BuildAuditedReceiptInput {
|
|
39
|
+
envelope: NormalizedReturnEnvelope;
|
|
40
|
+
delta: CanonicalDelta;
|
|
41
|
+
gate: GateState;
|
|
42
|
+
nextSlice: NextSlice | null;
|
|
43
|
+
projectId?: string;
|
|
44
|
+
/** Audit result, when available. Feeds explicit audit findings onto the receipt. */
|
|
45
|
+
audit?: AuditResult | null;
|
|
46
|
+
/** Trace summary from execution-trace module, when available. */
|
|
47
|
+
traceSummary?: TraceSummary | null;
|
|
48
|
+
/** Budget summary from budget-ledger module, when available. */
|
|
49
|
+
budgetSummary?: BudgetSummary | null;
|
|
50
|
+
/** Overflow summary from overflow-manifest module, when available. */
|
|
51
|
+
overflowSummary?: OverflowSummary | null;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// ---------------------------------------------------------------------------
|
|
55
|
+
// Claim assessment — classifies each significant claim by evidence strength
|
|
56
|
+
// ---------------------------------------------------------------------------
|
|
57
|
+
|
|
58
|
+
function assessClaims(
|
|
59
|
+
envelope: NormalizedReturnEnvelope,
|
|
60
|
+
delta: CanonicalDelta,
|
|
61
|
+
): ClaimAssessment[] {
|
|
62
|
+
const assessments: ClaimAssessment[] = [];
|
|
63
|
+
|
|
64
|
+
// Pool of structured evidence for matching
|
|
65
|
+
const verificationPool = new Set(
|
|
66
|
+
delta.verification_runs.map(v => v.toLowerCase()),
|
|
67
|
+
);
|
|
68
|
+
const evidencePool = new Set(
|
|
69
|
+
delta.evidence_items.map(e => e.toLowerCase()),
|
|
70
|
+
);
|
|
71
|
+
const criteriaPool = new Set(
|
|
72
|
+
(delta.evidence_accounting?.criteria_met ?? []).map(c => c.toLowerCase()),
|
|
73
|
+
);
|
|
74
|
+
|
|
75
|
+
function classify(text: string): { disposition: ClaimDisposition; basis: string } {
|
|
76
|
+
const lower = text.toLowerCase();
|
|
77
|
+
const words = lower.split(/\s+/).filter(w => w.length > 3);
|
|
78
|
+
const fullMatchThreshold = words.length <= 2 ? 1 : 2;
|
|
79
|
+
|
|
80
|
+
// Track best partial match across all pools for fallback to "partial"
|
|
81
|
+
let bestPartialLine = "";
|
|
82
|
+
let bestPartialScore = 0;
|
|
83
|
+
let bestPartialPool = "";
|
|
84
|
+
|
|
85
|
+
// Check verification runs
|
|
86
|
+
for (const v of verificationPool) {
|
|
87
|
+
const matchCount = words.filter(w => v.includes(w)).length;
|
|
88
|
+
if (matchCount >= fullMatchThreshold) {
|
|
89
|
+
return { disposition: "proven", basis: `Matched verification: ${v.slice(0, 80)}` };
|
|
90
|
+
}
|
|
91
|
+
if (matchCount > bestPartialScore) {
|
|
92
|
+
bestPartialScore = matchCount;
|
|
93
|
+
bestPartialLine = v;
|
|
94
|
+
bestPartialPool = "verification";
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// Check evidence items
|
|
99
|
+
for (const e of evidencePool) {
|
|
100
|
+
const matchCount = words.filter(w => e.includes(w)).length;
|
|
101
|
+
if (matchCount >= fullMatchThreshold) {
|
|
102
|
+
return { disposition: "supported", basis: `Matched evidence: ${e.slice(0, 80)}` };
|
|
103
|
+
}
|
|
104
|
+
if (matchCount > bestPartialScore) {
|
|
105
|
+
bestPartialScore = matchCount;
|
|
106
|
+
bestPartialLine = e;
|
|
107
|
+
bestPartialPool = "evidence";
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// Check criteria met
|
|
112
|
+
for (const c of criteriaPool) {
|
|
113
|
+
const matchCount = words.filter(w => c.includes(w)).length;
|
|
114
|
+
if (matchCount >= fullMatchThreshold) {
|
|
115
|
+
return { disposition: "supported", basis: `Matched criterion: ${c.slice(0, 80)}` };
|
|
116
|
+
}
|
|
117
|
+
if (matchCount > bestPartialScore) {
|
|
118
|
+
bestPartialScore = matchCount;
|
|
119
|
+
bestPartialLine = c;
|
|
120
|
+
bestPartialPool = "criterion";
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// Partial: at least 1 keyword matched but not enough for full supported/proven
|
|
125
|
+
if (bestPartialScore >= 1) {
|
|
126
|
+
return {
|
|
127
|
+
disposition: "partial",
|
|
128
|
+
basis: `Partial ${bestPartialPool} match (${bestPartialScore}/${words.length} keywords): ${bestPartialLine.slice(0, 80)}`,
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// Content mode from envelope — inferred items get "inferred" disposition
|
|
133
|
+
const envelopeItem = envelope.evidence_items.find(
|
|
134
|
+
ei => ei.text.toLowerCase() === lower,
|
|
135
|
+
);
|
|
136
|
+
if (envelopeItem && (envelopeItem.content_mode === "inferred" || envelopeItem.content_mode === "reconstructed")) {
|
|
137
|
+
return { disposition: "inferred", basis: `Content mode: ${envelopeItem.content_mode}` };
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
return { disposition: "unsubstantiated", basis: "No matching structured evidence found." };
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
// Assess the summary claim (the primary output statement)
|
|
144
|
+
if (envelope.summary) {
|
|
145
|
+
const result = classify(envelope.summary);
|
|
146
|
+
assessments.push({ claim: envelope.summary, ...result });
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// Assess each success criterion claimed
|
|
150
|
+
for (const criterion of envelope.criteria_met) {
|
|
151
|
+
const result = classify(criterion.text);
|
|
152
|
+
assessments.push({ claim: criterion.text, ...result });
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
// Assess each decision made
|
|
156
|
+
for (const decision of envelope.decisions) {
|
|
157
|
+
const result = classify(decision.text);
|
|
158
|
+
assessments.push({ claim: decision.text, ...result });
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
return assessments;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
// ---------------------------------------------------------------------------
|
|
165
|
+
// Trust posture — overall trust level derived from gate + evidence + residuals
|
|
166
|
+
// ---------------------------------------------------------------------------
|
|
167
|
+
|
|
168
|
+
function deriveTrustPosture(
|
|
169
|
+
gate: GateState,
|
|
170
|
+
residualCount: number,
|
|
171
|
+
): { posture: TrustPosture; basis: string } {
|
|
172
|
+
switch (gate.label) {
|
|
173
|
+
case "accepted":
|
|
174
|
+
if (residualCount === 0) {
|
|
175
|
+
return {
|
|
176
|
+
posture: "verified",
|
|
177
|
+
basis: `Gate accepted. ${gate.evidence_summary.verification_count} verification(s), ${gate.evidence_summary.evidence_count} evidence item(s). No residuals.`,
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
return {
|
|
181
|
+
posture: "cautioned",
|
|
182
|
+
basis: `Gate accepted but ${residualCount} residual(s) carry forward.`,
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
case "accepted-with-cautions":
|
|
186
|
+
return {
|
|
187
|
+
posture: "cautioned",
|
|
188
|
+
basis: gate.reason,
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
case "held-for-review":
|
|
192
|
+
return {
|
|
193
|
+
posture: "held",
|
|
194
|
+
basis: gate.reason,
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
case "blocked-missing-evidence":
|
|
198
|
+
return {
|
|
199
|
+
posture: "blocked",
|
|
200
|
+
basis: gate.reason,
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
case "pending":
|
|
204
|
+
case "not-checked":
|
|
205
|
+
return {
|
|
206
|
+
posture: "unknown",
|
|
207
|
+
basis: gate.reason,
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
// ---------------------------------------------------------------------------
|
|
213
|
+
// Closure basis — why closure is or isn't allowed
|
|
214
|
+
// ---------------------------------------------------------------------------
|
|
215
|
+
|
|
216
|
+
function deriveClosureBasis(
|
|
217
|
+
closureAllowed: boolean,
|
|
218
|
+
gate: GateState,
|
|
219
|
+
delta: CanonicalDelta,
|
|
220
|
+
): string {
|
|
221
|
+
if (closureAllowed) {
|
|
222
|
+
if (delta.objective_state === "met" && delta.unresolved.length === 0) {
|
|
223
|
+
return "Objective met, gate passed, no unresolved items.";
|
|
224
|
+
}
|
|
225
|
+
return `Gate: ${gate.label}. Closure permitted despite ${delta.unresolved.length} unresolved item(s).`;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
const reasons: string[] = [];
|
|
229
|
+
if (gate.label === "held-for-review") reasons.push("Gate held for review");
|
|
230
|
+
if (gate.label === "blocked-missing-evidence") reasons.push("Gate blocked — missing evidence");
|
|
231
|
+
if (delta.unresolved.length > 0) reasons.push(`${delta.unresolved.length} unresolved item(s)`);
|
|
232
|
+
if (reasons.length === 0) reasons.push("Pre-return phase — no return to close");
|
|
233
|
+
|
|
234
|
+
return reasons.join(". ") + ".";
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
// ---------------------------------------------------------------------------
|
|
238
|
+
// Advancement basis — what caused canonical state to advance
|
|
239
|
+
// ---------------------------------------------------------------------------
|
|
240
|
+
|
|
241
|
+
function deriveAdvancementBasis(delta: CanonicalDelta): { advanced: boolean; basis: string } {
|
|
242
|
+
const ea = delta.evidence_accounting;
|
|
243
|
+
if (!ea) {
|
|
244
|
+
// No evidence accounting — check state_fields_advanced
|
|
245
|
+
if (delta.state_fields_advanced.length > 0) {
|
|
246
|
+
return { advanced: true, basis: delta.state_fields_advanced.join("; ") };
|
|
247
|
+
}
|
|
248
|
+
return { advanced: false, basis: "No evidence accounting available." };
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
if (ea.consequence_type === "no-change") {
|
|
252
|
+
return { advanced: false, basis: ea.consequence_label };
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
return { advanced: true, basis: ea.consequence_label };
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
// ---------------------------------------------------------------------------
|
|
259
|
+
// Primary builder — assembles the audited receipt from component objects
|
|
260
|
+
// ---------------------------------------------------------------------------
|
|
261
|
+
|
|
262
|
+
export function buildAuditedReceipt(input: BuildAuditedReceiptInput): AuditedReceipt {
|
|
263
|
+
const { envelope, delta, gate, nextSlice, projectId = "", audit, traceSummary, budgetSummary, overflowSummary } = input;
|
|
264
|
+
|
|
265
|
+
// Claim assessments
|
|
266
|
+
const claim_assessments = assessClaims(envelope, delta);
|
|
267
|
+
|
|
268
|
+
// Evidence counts from delta's evidence accounting (single source of truth)
|
|
269
|
+
const ea = delta.evidence_accounting;
|
|
270
|
+
const verification_count = ea?.verification_run_count ?? delta.verification_runs.length;
|
|
271
|
+
const evidence_count = ea?.evidence_item_count ?? delta.evidence_items.length;
|
|
272
|
+
const criteria_met_count = ea?.criteria_met_count ?? 0;
|
|
273
|
+
const files_changed_count = ea?.file_change_count ?? delta.file_changes.length;
|
|
274
|
+
|
|
275
|
+
// --- Explicit audit findings (matches RunSnapshot pattern) ---
|
|
276
|
+
const audit_required = audit?.audit_required ?? false;
|
|
277
|
+
const audit_cautions: string[] = [];
|
|
278
|
+
const audit_blockers: string[] = [];
|
|
279
|
+
if (audit) {
|
|
280
|
+
for (const f of audit.findings) {
|
|
281
|
+
if (f.severity === "caution") {
|
|
282
|
+
audit_cautions.push(`[audit] ${f.detail}`);
|
|
283
|
+
} else if (f.severity === "blocker") {
|
|
284
|
+
audit_blockers.push(`[audit-blocker] ${f.detail}`);
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
const audit_finding_count = audit_cautions.length + audit_blockers.length;
|
|
289
|
+
|
|
290
|
+
// Residuals — delta cautions + audit cautions merged (single source of truth)
|
|
291
|
+
const cautions_on_record = [...delta.cautions, ...audit_cautions, ...audit_blockers];
|
|
292
|
+
const unresolved_on_record = delta.unresolved;
|
|
293
|
+
const residual_count = cautions_on_record.length + unresolved_on_record.length;
|
|
294
|
+
|
|
295
|
+
// Trust posture
|
|
296
|
+
const { posture: trust_posture, basis: trust_basis } = deriveTrustPosture(gate, residual_count);
|
|
297
|
+
|
|
298
|
+
// Closure — use shared control-flag logic
|
|
299
|
+
const phase = gate.label === "accepted" ? "accepted" as const
|
|
300
|
+
: gate.label === "accepted-with-cautions" ? "accepted_with_cautions" as const
|
|
301
|
+
: gate.label === "held-for-review" ? "held_for_review" as const
|
|
302
|
+
: gate.label === "blocked-missing-evidence" ? "blocked" as const
|
|
303
|
+
: "return_received" as const;
|
|
304
|
+
const { closureAllowed } = deriveControlFlags(phase, true);
|
|
305
|
+
const closure_basis = deriveClosureBasis(closureAllowed, gate, delta);
|
|
306
|
+
|
|
307
|
+
// Advancement
|
|
308
|
+
const { advanced: state_advanced, basis: advancement_basis } = deriveAdvancementBasis(delta);
|
|
309
|
+
const consequence_type = ea?.consequence_type ?? "no-change";
|
|
310
|
+
const consequence_label = ea?.consequence_label ?? "No evidence accounting available.";
|
|
311
|
+
|
|
312
|
+
return auditedReceiptSchema.parse({
|
|
313
|
+
// Identity
|
|
314
|
+
receipt_id: `aud-${randomBytes(8).toString("hex")}`,
|
|
315
|
+
receipt_version: 1,
|
|
316
|
+
created_at: new Date().toISOString(),
|
|
317
|
+
project_id: projectId || delta.project_id,
|
|
318
|
+
dispatch_id: envelope.dispatch_id,
|
|
319
|
+
return_id: envelope.return_id,
|
|
320
|
+
envelope_id: envelope.envelope_id,
|
|
321
|
+
delta_id: delta.delta_id,
|
|
322
|
+
|
|
323
|
+
// Claimed
|
|
324
|
+
objective_claimed: envelope.objective_used,
|
|
325
|
+
outcome_claimed: envelope.outcome_class,
|
|
326
|
+
summary_claimed: envelope.summary,
|
|
327
|
+
|
|
328
|
+
// Proven
|
|
329
|
+
verification_count,
|
|
330
|
+
evidence_count,
|
|
331
|
+
criteria_met_count,
|
|
332
|
+
files_changed_count,
|
|
333
|
+
claim_assessments,
|
|
334
|
+
|
|
335
|
+
// Gate
|
|
336
|
+
gate_label: gate.label,
|
|
337
|
+
gate_reason: gate.reason,
|
|
338
|
+
gate_honest: gate.honest,
|
|
339
|
+
|
|
340
|
+
// Provenance
|
|
341
|
+
provenance_posture: envelope.provenance_posture,
|
|
342
|
+
confidence_posture: envelope.confidence_posture,
|
|
343
|
+
|
|
344
|
+
// Closure
|
|
345
|
+
closure_allowed: closureAllowed,
|
|
346
|
+
closure_basis,
|
|
347
|
+
|
|
348
|
+
// Audit findings (explicit, not just reflected in gate)
|
|
349
|
+
audit_required,
|
|
350
|
+
audit_finding_count,
|
|
351
|
+
audit_cautions,
|
|
352
|
+
audit_blockers,
|
|
353
|
+
|
|
354
|
+
// Residuals
|
|
355
|
+
cautions_on_record,
|
|
356
|
+
unresolved_on_record,
|
|
357
|
+
residual_count,
|
|
358
|
+
|
|
359
|
+
// Advancement
|
|
360
|
+
state_advanced,
|
|
361
|
+
advancement_basis,
|
|
362
|
+
consequence_type,
|
|
363
|
+
consequence_label,
|
|
364
|
+
|
|
365
|
+
// Next slice (with basis)
|
|
366
|
+
next_slice_exists: !!nextSlice,
|
|
367
|
+
next_slice_id: nextSlice?.slice_id ?? "",
|
|
368
|
+
next_slice_title: nextSlice?.title ?? "",
|
|
369
|
+
next_slice_ready: nextSlice?.dispatch_ready ?? false,
|
|
370
|
+
next_slice_why: nextSlice?.why_next ?? "",
|
|
371
|
+
next_slice_blocking_reason: nextSlice?.blocking_reason ?? "",
|
|
372
|
+
|
|
373
|
+
// Execution trace summary
|
|
374
|
+
trace_step_count: traceSummary?.trace_step_count ?? 0,
|
|
375
|
+
trace_tool_use_count: traceSummary?.trace_tool_use_count ?? 0,
|
|
376
|
+
trace_failure_phase: traceSummary?.trace_failure_phase ?? "",
|
|
377
|
+
trace_error_category: traceSummary?.trace_error_category ?? "",
|
|
378
|
+
trace_duration_ms: traceSummary?.trace_duration_ms ?? 0,
|
|
379
|
+
trace_available: traceSummary?.trace_available ?? false,
|
|
380
|
+
|
|
381
|
+
// Budget breakdown
|
|
382
|
+
budget_task_steps: budgetSummary?.task_steps ?? 0,
|
|
383
|
+
budget_task_tool_uses: budgetSummary?.task_tool_uses ?? 0,
|
|
384
|
+
budget_verification_steps: budgetSummary?.verification_steps ?? 0,
|
|
385
|
+
budget_verification_tool_uses: budgetSummary?.verification_tool_uses ?? 0,
|
|
386
|
+
budget_correction_steps: budgetSummary?.correction_steps ?? 0,
|
|
387
|
+
budget_correction_tool_uses: budgetSummary?.correction_tool_uses ?? 0,
|
|
388
|
+
budget_overhead_ratio: budgetSummary?.overhead_ratio ?? 0,
|
|
389
|
+
budget_had_corrections: budgetSummary?.had_corrections ?? false,
|
|
390
|
+
budget_posture: budgetSummary?.budget_posture ?? "unknown",
|
|
391
|
+
budget_posture_basis: budgetSummary?.budget_posture_basis ?? "",
|
|
392
|
+
|
|
393
|
+
// Overflow / progressive disclosure
|
|
394
|
+
overflow_entry_count: overflowSummary?.overflow_entry_count ?? 0,
|
|
395
|
+
overflow_total_bytes: overflowSummary?.overflow_total_bytes ?? 0,
|
|
396
|
+
overflow_sources: overflowSummary?.overflow_sources ?? [],
|
|
397
|
+
overflow_available: overflowSummary?.overflow_available ?? false,
|
|
398
|
+
|
|
399
|
+
// Trust
|
|
400
|
+
trust_posture,
|
|
401
|
+
trust_basis,
|
|
402
|
+
});
|
|
403
|
+
}
|