@quolu/lattice 0.1.0
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/LICENSE +25 -0
- package/README.md +20 -0
- package/bin/lattice-mcp.mjs +134 -0
- package/bin/lattice.mjs +78 -0
- package/package.json +47 -0
- package/sensor/LICENSE +21 -0
- package/sensor/NOTICE +30 -0
- package/sensor/dist/bin/codegraph.d.ts +26 -0
- package/sensor/dist/bin/codegraph.d.ts.map +1 -0
- package/sensor/dist/bin/codegraph.js +2279 -0
- package/sensor/dist/bin/codegraph.js.map +1 -0
- package/sensor/dist/bin/command-supervision.d.ts +49 -0
- package/sensor/dist/bin/command-supervision.d.ts.map +1 -0
- package/sensor/dist/bin/command-supervision.js +95 -0
- package/sensor/dist/bin/command-supervision.js.map +1 -0
- package/sensor/dist/bin/fatal-handler.d.ts +20 -0
- package/sensor/dist/bin/fatal-handler.d.ts.map +1 -0
- package/sensor/dist/bin/fatal-handler.js +118 -0
- package/sensor/dist/bin/fatal-handler.js.map +1 -0
- package/sensor/dist/bin/node-version-check.d.ts +37 -0
- package/sensor/dist/bin/node-version-check.d.ts.map +1 -0
- package/sensor/dist/bin/node-version-check.js +79 -0
- package/sensor/dist/bin/node-version-check.js.map +1 -0
- package/sensor/dist/bin/uninstall.d.ts +14 -0
- package/sensor/dist/bin/uninstall.d.ts.map +1 -0
- package/sensor/dist/bin/uninstall.js +36 -0
- package/sensor/dist/bin/uninstall.js.map +1 -0
- package/sensor/dist/context/formatter.d.ts +30 -0
- package/sensor/dist/context/formatter.d.ts.map +1 -0
- package/sensor/dist/context/formatter.js +263 -0
- package/sensor/dist/context/formatter.js.map +1 -0
- package/sensor/dist/context/index.d.ts +119 -0
- package/sensor/dist/context/index.d.ts.map +1 -0
- package/sensor/dist/context/index.js +1326 -0
- package/sensor/dist/context/index.js.map +1 -0
- package/sensor/dist/context/markers.d.ts +19 -0
- package/sensor/dist/context/markers.d.ts.map +1 -0
- package/sensor/dist/context/markers.js +22 -0
- package/sensor/dist/context/markers.js.map +1 -0
- package/sensor/dist/db/index.d.ts +264 -0
- package/sensor/dist/db/index.d.ts.map +1 -0
- package/sensor/dist/db/index.js +603 -0
- package/sensor/dist/db/index.js.map +1 -0
- package/sensor/dist/db/migrations.d.ts +44 -0
- package/sensor/dist/db/migrations.d.ts.map +1 -0
- package/sensor/dist/db/migrations.js +241 -0
- package/sensor/dist/db/migrations.js.map +1 -0
- package/sensor/dist/db/queries.d.ts +563 -0
- package/sensor/dist/db/queries.d.ts.map +1 -0
- package/sensor/dist/db/queries.js +2179 -0
- package/sensor/dist/db/queries.js.map +1 -0
- package/sensor/dist/db/schema.sql +196 -0
- package/sensor/dist/db/sqlite-adapter.d.ts +55 -0
- package/sensor/dist/db/sqlite-adapter.d.ts.map +1 -0
- package/sensor/dist/db/sqlite-adapter.js +135 -0
- package/sensor/dist/db/sqlite-adapter.js.map +1 -0
- package/sensor/dist/db/wal-valve.d.ts +106 -0
- package/sensor/dist/db/wal-valve.d.ts.map +1 -0
- package/sensor/dist/db/wal-valve.js +208 -0
- package/sensor/dist/db/wal-valve.js.map +1 -0
- package/sensor/dist/directory.d.ts +183 -0
- package/sensor/dist/directory.d.ts.map +1 -0
- package/sensor/dist/directory.js +797 -0
- package/sensor/dist/directory.js.map +1 -0
- package/sensor/dist/errors.d.ts +136 -0
- package/sensor/dist/errors.d.ts.map +1 -0
- package/sensor/dist/errors.js +219 -0
- package/sensor/dist/errors.js.map +1 -0
- package/sensor/dist/extraction/astro-extractor.d.ts +79 -0
- package/sensor/dist/extraction/astro-extractor.d.ts.map +1 -0
- package/sensor/dist/extraction/astro-extractor.js +320 -0
- package/sensor/dist/extraction/astro-extractor.js.map +1 -0
- package/sensor/dist/extraction/cfml-extractor.d.ts +107 -0
- package/sensor/dist/extraction/cfml-extractor.d.ts.map +1 -0
- package/sensor/dist/extraction/cfml-extractor.js +494 -0
- package/sensor/dist/extraction/cfml-extractor.js.map +1 -0
- package/sensor/dist/extraction/dfm-extractor.d.ts +31 -0
- package/sensor/dist/extraction/dfm-extractor.d.ts.map +1 -0
- package/sensor/dist/extraction/dfm-extractor.js +151 -0
- package/sensor/dist/extraction/dfm-extractor.js.map +1 -0
- package/sensor/dist/extraction/dynamic-import.d.ts +82 -0
- package/sensor/dist/extraction/dynamic-import.d.ts.map +1 -0
- package/sensor/dist/extraction/dynamic-import.js +313 -0
- package/sensor/dist/extraction/dynamic-import.js.map +1 -0
- package/sensor/dist/extraction/extraction-version.d.ts +25 -0
- package/sensor/dist/extraction/extraction-version.d.ts.map +1 -0
- package/sensor/dist/extraction/extraction-version.js +28 -0
- package/sensor/dist/extraction/extraction-version.js.map +1 -0
- package/sensor/dist/extraction/function-ref.d.ts +118 -0
- package/sensor/dist/extraction/function-ref.d.ts.map +1 -0
- package/sensor/dist/extraction/function-ref.js +727 -0
- package/sensor/dist/extraction/function-ref.js.map +1 -0
- package/sensor/dist/extraction/generated-detection.d.ts +30 -0
- package/sensor/dist/extraction/generated-detection.d.ts.map +1 -0
- package/sensor/dist/extraction/generated-detection.js +83 -0
- package/sensor/dist/extraction/generated-detection.js.map +1 -0
- package/sensor/dist/extraction/grammars.d.ts +138 -0
- package/sensor/dist/extraction/grammars.d.ts.map +1 -0
- package/sensor/dist/extraction/grammars.js +648 -0
- package/sensor/dist/extraction/grammars.js.map +1 -0
- package/sensor/dist/extraction/index.d.ts +251 -0
- package/sensor/dist/extraction/index.d.ts.map +1 -0
- package/sensor/dist/extraction/index.js +2563 -0
- package/sensor/dist/extraction/index.js.map +1 -0
- package/sensor/dist/extraction/kernel/decode.d.ts +9 -0
- package/sensor/dist/extraction/kernel/decode.d.ts.map +1 -0
- package/sensor/dist/extraction/kernel/decode.js +156 -0
- package/sensor/dist/extraction/kernel/decode.js.map +1 -0
- package/sensor/dist/extraction/kernel/index.d.ts +62 -0
- package/sensor/dist/extraction/kernel/index.d.ts.map +1 -0
- package/sensor/dist/extraction/kernel/index.js +165 -0
- package/sensor/dist/extraction/kernel/index.js.map +1 -0
- package/sensor/dist/extraction/kernel/layout.d.ts +92 -0
- package/sensor/dist/extraction/kernel/layout.d.ts.map +1 -0
- package/sensor/dist/extraction/kernel/layout.js +95 -0
- package/sensor/dist/extraction/kernel/layout.js.map +1 -0
- package/sensor/dist/extraction/kernel/loader.d.ts +61 -0
- package/sensor/dist/extraction/kernel/loader.d.ts.map +1 -0
- package/sensor/dist/extraction/kernel/loader.js +146 -0
- package/sensor/dist/extraction/kernel/loader.js.map +1 -0
- package/sensor/dist/extraction/languages/arkts.d.ts +3 -0
- package/sensor/dist/extraction/languages/arkts.d.ts.map +1 -0
- package/sensor/dist/extraction/languages/arkts.js +127 -0
- package/sensor/dist/extraction/languages/arkts.js.map +1 -0
- package/sensor/dist/extraction/languages/c-cpp.d.ts +111 -0
- package/sensor/dist/extraction/languages/c-cpp.d.ts.map +1 -0
- package/sensor/dist/extraction/languages/c-cpp.js +878 -0
- package/sensor/dist/extraction/languages/c-cpp.js.map +1 -0
- package/sensor/dist/extraction/languages/cfquery.d.ts +12 -0
- package/sensor/dist/extraction/languages/cfquery.d.ts.map +1 -0
- package/sensor/dist/extraction/languages/cfquery.js +28 -0
- package/sensor/dist/extraction/languages/cfquery.js.map +1 -0
- package/sensor/dist/extraction/languages/cfscript.d.ts +3 -0
- package/sensor/dist/extraction/languages/cfscript.d.ts.map +1 -0
- package/sensor/dist/extraction/languages/cfscript.js +73 -0
- package/sensor/dist/extraction/languages/cfscript.js.map +1 -0
- package/sensor/dist/extraction/languages/cobol.d.ts +33 -0
- package/sensor/dist/extraction/languages/cobol.d.ts.map +1 -0
- package/sensor/dist/extraction/languages/cobol.js +499 -0
- package/sensor/dist/extraction/languages/cobol.js.map +1 -0
- package/sensor/dist/extraction/languages/csharp.d.ts +25 -0
- package/sensor/dist/extraction/languages/csharp.d.ts.map +1 -0
- package/sensor/dist/extraction/languages/csharp.js +175 -0
- package/sensor/dist/extraction/languages/csharp.js.map +1 -0
- package/sensor/dist/extraction/languages/dart.d.ts +3 -0
- package/sensor/dist/extraction/languages/dart.d.ts.map +1 -0
- package/sensor/dist/extraction/languages/dart.js +374 -0
- package/sensor/dist/extraction/languages/dart.js.map +1 -0
- package/sensor/dist/extraction/languages/erlang.d.ts +3 -0
- package/sensor/dist/extraction/languages/erlang.d.ts.map +1 -0
- package/sensor/dist/extraction/languages/erlang.js +350 -0
- package/sensor/dist/extraction/languages/erlang.js.map +1 -0
- package/sensor/dist/extraction/languages/go.d.ts +3 -0
- package/sensor/dist/extraction/languages/go.d.ts.map +1 -0
- package/sensor/dist/extraction/languages/go.js +111 -0
- package/sensor/dist/extraction/languages/go.js.map +1 -0
- package/sensor/dist/extraction/languages/index.d.ts +10 -0
- package/sensor/dist/extraction/languages/index.d.ts.map +1 -0
- package/sensor/dist/extraction/languages/index.js +71 -0
- package/sensor/dist/extraction/languages/index.js.map +1 -0
- package/sensor/dist/extraction/languages/java.d.ts +3 -0
- package/sensor/dist/extraction/languages/java.d.ts.map +1 -0
- package/sensor/dist/extraction/languages/java.js +315 -0
- package/sensor/dist/extraction/languages/java.js.map +1 -0
- package/sensor/dist/extraction/languages/javascript.d.ts +3 -0
- package/sensor/dist/extraction/languages/javascript.d.ts.map +1 -0
- package/sensor/dist/extraction/languages/javascript.js +106 -0
- package/sensor/dist/extraction/languages/javascript.js.map +1 -0
- package/sensor/dist/extraction/languages/kotlin.d.ts +3 -0
- package/sensor/dist/extraction/languages/kotlin.d.ts.map +1 -0
- package/sensor/dist/extraction/languages/kotlin.js +379 -0
- package/sensor/dist/extraction/languages/kotlin.js.map +1 -0
- package/sensor/dist/extraction/languages/lua.d.ts +3 -0
- package/sensor/dist/extraction/languages/lua.d.ts.map +1 -0
- package/sensor/dist/extraction/languages/lua.js +150 -0
- package/sensor/dist/extraction/languages/lua.js.map +1 -0
- package/sensor/dist/extraction/languages/luau.d.ts +3 -0
- package/sensor/dist/extraction/languages/luau.d.ts.map +1 -0
- package/sensor/dist/extraction/languages/luau.js +37 -0
- package/sensor/dist/extraction/languages/luau.js.map +1 -0
- package/sensor/dist/extraction/languages/nix.d.ts +3 -0
- package/sensor/dist/extraction/languages/nix.d.ts.map +1 -0
- package/sensor/dist/extraction/languages/nix.js +294 -0
- package/sensor/dist/extraction/languages/nix.js.map +1 -0
- package/sensor/dist/extraction/languages/objc.d.ts +3 -0
- package/sensor/dist/extraction/languages/objc.d.ts.map +1 -0
- package/sensor/dist/extraction/languages/objc.js +175 -0
- package/sensor/dist/extraction/languages/objc.js.map +1 -0
- package/sensor/dist/extraction/languages/pascal.d.ts +3 -0
- package/sensor/dist/extraction/languages/pascal.d.ts.map +1 -0
- package/sensor/dist/extraction/languages/pascal.js +77 -0
- package/sensor/dist/extraction/languages/pascal.js.map +1 -0
- package/sensor/dist/extraction/languages/php.d.ts +3 -0
- package/sensor/dist/extraction/languages/php.d.ts.map +1 -0
- package/sensor/dist/extraction/languages/php.js +196 -0
- package/sensor/dist/extraction/languages/php.js.map +1 -0
- package/sensor/dist/extraction/languages/python.d.ts +3 -0
- package/sensor/dist/extraction/languages/python.d.ts.map +1 -0
- package/sensor/dist/extraction/languages/python.js +56 -0
- package/sensor/dist/extraction/languages/python.js.map +1 -0
- package/sensor/dist/extraction/languages/r.d.ts +3 -0
- package/sensor/dist/extraction/languages/r.d.ts.map +1 -0
- package/sensor/dist/extraction/languages/r.js +314 -0
- package/sensor/dist/extraction/languages/r.js.map +1 -0
- package/sensor/dist/extraction/languages/ruby.d.ts +3 -0
- package/sensor/dist/extraction/languages/ruby.d.ts.map +1 -0
- package/sensor/dist/extraction/languages/ruby.js +149 -0
- package/sensor/dist/extraction/languages/ruby.js.map +1 -0
- package/sensor/dist/extraction/languages/rust.d.ts +3 -0
- package/sensor/dist/extraction/languages/rust.d.ts.map +1 -0
- package/sensor/dist/extraction/languages/rust.js +142 -0
- package/sensor/dist/extraction/languages/rust.js.map +1 -0
- package/sensor/dist/extraction/languages/scala.d.ts +3 -0
- package/sensor/dist/extraction/languages/scala.d.ts.map +1 -0
- package/sensor/dist/extraction/languages/scala.js +209 -0
- package/sensor/dist/extraction/languages/scala.js.map +1 -0
- package/sensor/dist/extraction/languages/solidity.d.ts +3 -0
- package/sensor/dist/extraction/languages/solidity.d.ts.map +1 -0
- package/sensor/dist/extraction/languages/solidity.js +293 -0
- package/sensor/dist/extraction/languages/solidity.js.map +1 -0
- package/sensor/dist/extraction/languages/swift.d.ts +3 -0
- package/sensor/dist/extraction/languages/swift.d.ts.map +1 -0
- package/sensor/dist/extraction/languages/swift.js +152 -0
- package/sensor/dist/extraction/languages/swift.js.map +1 -0
- package/sensor/dist/extraction/languages/terraform.d.ts +3 -0
- package/sensor/dist/extraction/languages/terraform.d.ts.map +1 -0
- package/sensor/dist/extraction/languages/terraform.js +641 -0
- package/sensor/dist/extraction/languages/terraform.js.map +1 -0
- package/sensor/dist/extraction/languages/typescript.d.ts +16 -0
- package/sensor/dist/extraction/languages/typescript.d.ts.map +1 -0
- package/sensor/dist/extraction/languages/typescript.js +167 -0
- package/sensor/dist/extraction/languages/typescript.js.map +1 -0
- package/sensor/dist/extraction/languages/vbnet.d.ts +11 -0
- package/sensor/dist/extraction/languages/vbnet.d.ts.map +1 -0
- package/sensor/dist/extraction/languages/vbnet.js +141 -0
- package/sensor/dist/extraction/languages/vbnet.js.map +1 -0
- package/sensor/dist/extraction/liquid-extractor.d.ts +59 -0
- package/sensor/dist/extraction/liquid-extractor.d.ts.map +1 -0
- package/sensor/dist/extraction/liquid-extractor.js +357 -0
- package/sensor/dist/extraction/liquid-extractor.js.map +1 -0
- package/sensor/dist/extraction/mybatis-extractor.d.ts +68 -0
- package/sensor/dist/extraction/mybatis-extractor.d.ts.map +1 -0
- package/sensor/dist/extraction/mybatis-extractor.js +300 -0
- package/sensor/dist/extraction/mybatis-extractor.js.map +1 -0
- package/sensor/dist/extraction/parse-pool.d.ts +160 -0
- package/sensor/dist/extraction/parse-pool.d.ts.map +1 -0
- package/sensor/dist/extraction/parse-pool.js +402 -0
- package/sensor/dist/extraction/parse-pool.js.map +1 -0
- package/sensor/dist/extraction/parse-worker.d.ts +8 -0
- package/sensor/dist/extraction/parse-worker.d.ts.map +1 -0
- package/sensor/dist/extraction/parse-worker.js +138 -0
- package/sensor/dist/extraction/parse-worker.js.map +1 -0
- package/sensor/dist/extraction/razor-extractor.d.ts +42 -0
- package/sensor/dist/extraction/razor-extractor.d.ts.map +1 -0
- package/sensor/dist/extraction/razor-extractor.js +285 -0
- package/sensor/dist/extraction/razor-extractor.js.map +1 -0
- package/sensor/dist/extraction/spawn-invokes.d.ts +101 -0
- package/sensor/dist/extraction/spawn-invokes.d.ts.map +1 -0
- package/sensor/dist/extraction/spawn-invokes.js +327 -0
- package/sensor/dist/extraction/spawn-invokes.js.map +1 -0
- package/sensor/dist/extraction/store-worker.d.ts +24 -0
- package/sensor/dist/extraction/store-worker.d.ts.map +1 -0
- package/sensor/dist/extraction/store-worker.js +110 -0
- package/sensor/dist/extraction/store-worker.js.map +1 -0
- package/sensor/dist/extraction/store-writer.d.ts +63 -0
- package/sensor/dist/extraction/store-writer.d.ts.map +1 -0
- package/sensor/dist/extraction/store-writer.js +174 -0
- package/sensor/dist/extraction/store-writer.js.map +1 -0
- package/sensor/dist/extraction/svelte-extractor.d.ts +56 -0
- package/sensor/dist/extraction/svelte-extractor.d.ts.map +1 -0
- package/sensor/dist/extraction/svelte-extractor.js +275 -0
- package/sensor/dist/extraction/svelte-extractor.js.map +1 -0
- package/sensor/dist/extraction/tree-sitter-helpers.d.ts +28 -0
- package/sensor/dist/extraction/tree-sitter-helpers.d.ts.map +1 -0
- package/sensor/dist/extraction/tree-sitter-helpers.js +153 -0
- package/sensor/dist/extraction/tree-sitter-helpers.js.map +1 -0
- package/sensor/dist/extraction/tree-sitter-types.d.ts +258 -0
- package/sensor/dist/extraction/tree-sitter-types.d.ts.map +1 -0
- package/sensor/dist/extraction/tree-sitter-types.js +10 -0
- package/sensor/dist/extraction/tree-sitter-types.js.map +1 -0
- package/sensor/dist/extraction/tree-sitter.d.ts +724 -0
- package/sensor/dist/extraction/tree-sitter.d.ts.map +1 -0
- package/sensor/dist/extraction/tree-sitter.js +6721 -0
- package/sensor/dist/extraction/tree-sitter.js.map +1 -0
- package/sensor/dist/extraction/vue-extractor.d.ts +51 -0
- package/sensor/dist/extraction/vue-extractor.d.ts.map +1 -0
- package/sensor/dist/extraction/vue-extractor.js +254 -0
- package/sensor/dist/extraction/vue-extractor.js.map +1 -0
- package/sensor/dist/extraction/wasm/tree-sitter-arkts.wasm +0 -0
- package/sensor/dist/extraction/wasm/tree-sitter-c_sharp.wasm +0 -0
- package/sensor/dist/extraction/wasm/tree-sitter-cfml.wasm +0 -0
- package/sensor/dist/extraction/wasm/tree-sitter-cfquery.wasm +0 -0
- package/sensor/dist/extraction/wasm/tree-sitter-cfscript.wasm +0 -0
- package/sensor/dist/extraction/wasm/tree-sitter-cobol.wasm +0 -0
- package/sensor/dist/extraction/wasm/tree-sitter-erlang.wasm +0 -0
- package/sensor/dist/extraction/wasm/tree-sitter-go.wasm +0 -0
- package/sensor/dist/extraction/wasm/tree-sitter-java.wasm +0 -0
- package/sensor/dist/extraction/wasm/tree-sitter-javascript.wasm +0 -0
- package/sensor/dist/extraction/wasm/tree-sitter-lua.wasm +0 -0
- package/sensor/dist/extraction/wasm/tree-sitter-luau.wasm +0 -0
- package/sensor/dist/extraction/wasm/tree-sitter-nix.wasm +0 -0
- package/sensor/dist/extraction/wasm/tree-sitter-pascal.wasm +0 -0
- package/sensor/dist/extraction/wasm/tree-sitter-python.wasm +0 -0
- package/sensor/dist/extraction/wasm/tree-sitter-r.wasm +0 -0
- package/sensor/dist/extraction/wasm/tree-sitter-scala.wasm +0 -0
- package/sensor/dist/extraction/wasm/tree-sitter-terraform.wasm +0 -0
- package/sensor/dist/extraction/wasm/tree-sitter-tsx.wasm +0 -0
- package/sensor/dist/extraction/wasm/tree-sitter-typescript.wasm +0 -0
- package/sensor/dist/extraction/wasm/tree-sitter-vbnet.wasm +0 -0
- package/sensor/dist/extraction/wasm-runtime-flags.d.ts +53 -0
- package/sensor/dist/extraction/wasm-runtime-flags.d.ts.map +1 -0
- package/sensor/dist/extraction/wasm-runtime-flags.js +130 -0
- package/sensor/dist/extraction/wasm-runtime-flags.js.map +1 -0
- package/sensor/dist/graph/index.d.ts +8 -0
- package/sensor/dist/graph/index.d.ts.map +1 -0
- package/sensor/dist/graph/index.js +13 -0
- package/sensor/dist/graph/index.js.map +1 -0
- package/sensor/dist/graph/queries.d.ts +106 -0
- package/sensor/dist/graph/queries.d.ts.map +1 -0
- package/sensor/dist/graph/queries.js +339 -0
- package/sensor/dist/graph/queries.js.map +1 -0
- package/sensor/dist/graph/traversal.d.ts +127 -0
- package/sensor/dist/graph/traversal.d.ts.map +1 -0
- package/sensor/dist/graph/traversal.js +599 -0
- package/sensor/dist/graph/traversal.js.map +1 -0
- package/sensor/dist/index.d.ts +653 -0
- package/sensor/dist/index.d.ts.map +1 -0
- package/sensor/dist/index.js +1646 -0
- package/sensor/dist/index.js.map +1 -0
- package/sensor/dist/installer/beta-signup.d.ts +54 -0
- package/sensor/dist/installer/beta-signup.d.ts.map +1 -0
- package/sensor/dist/installer/beta-signup.js +178 -0
- package/sensor/dist/installer/beta-signup.js.map +1 -0
- package/sensor/dist/installer/config-writer.d.ts +28 -0
- package/sensor/dist/installer/config-writer.d.ts.map +1 -0
- package/sensor/dist/installer/config-writer.js +91 -0
- package/sensor/dist/installer/config-writer.js.map +1 -0
- package/sensor/dist/installer/index.d.ts +142 -0
- package/sensor/dist/installer/index.d.ts.map +1 -0
- package/sensor/dist/installer/index.js +622 -0
- package/sensor/dist/installer/index.js.map +1 -0
- package/sensor/dist/installer/instructions-template.d.ts +41 -0
- package/sensor/dist/installer/instructions-template.d.ts.map +1 -0
- package/sensor/dist/installer/instructions-template.js +53 -0
- package/sensor/dist/installer/instructions-template.js.map +1 -0
- package/sensor/dist/installer/targets/antigravity.d.ts +57 -0
- package/sensor/dist/installer/targets/antigravity.d.ts.map +1 -0
- package/sensor/dist/installer/targets/antigravity.js +308 -0
- package/sensor/dist/installer/targets/antigravity.js.map +1 -0
- package/sensor/dist/installer/targets/claude.d.ts +62 -0
- package/sensor/dist/installer/targets/claude.d.ts.map +1 -0
- package/sensor/dist/installer/targets/claude.js +454 -0
- package/sensor/dist/installer/targets/claude.js.map +1 -0
- package/sensor/dist/installer/targets/codex.d.ts +18 -0
- package/sensor/dist/installer/targets/codex.d.ts.map +1 -0
- package/sensor/dist/installer/targets/codex.js +185 -0
- package/sensor/dist/installer/targets/codex.js.map +1 -0
- package/sensor/dist/installer/targets/cursor.d.ts +35 -0
- package/sensor/dist/installer/targets/cursor.d.ts.map +1 -0
- package/sensor/dist/installer/targets/cursor.js +254 -0
- package/sensor/dist/installer/targets/cursor.js.map +1 -0
- package/sensor/dist/installer/targets/gemini.d.ts +26 -0
- package/sensor/dist/installer/targets/gemini.d.ts.map +1 -0
- package/sensor/dist/installer/targets/gemini.js +165 -0
- package/sensor/dist/installer/targets/gemini.js.map +1 -0
- package/sensor/dist/installer/targets/hermes.d.ts +18 -0
- package/sensor/dist/installer/targets/hermes.d.ts.map +1 -0
- package/sensor/dist/installer/targets/hermes.js +359 -0
- package/sensor/dist/installer/targets/hermes.js.map +1 -0
- package/sensor/dist/installer/targets/kiro.d.ts +27 -0
- package/sensor/dist/installer/targets/kiro.d.ts.map +1 -0
- package/sensor/dist/installer/targets/kiro.js +178 -0
- package/sensor/dist/installer/targets/kiro.js.map +1 -0
- package/sensor/dist/installer/targets/opencode.d.ts +38 -0
- package/sensor/dist/installer/targets/opencode.d.ts.map +1 -0
- package/sensor/dist/installer/targets/opencode.js +288 -0
- package/sensor/dist/installer/targets/opencode.js.map +1 -0
- package/sensor/dist/installer/targets/registry.d.ts +35 -0
- package/sensor/dist/installer/targets/registry.d.ts.map +1 -0
- package/sensor/dist/installer/targets/registry.js +91 -0
- package/sensor/dist/installer/targets/registry.js.map +1 -0
- package/sensor/dist/installer/targets/shared.d.ts +101 -0
- package/sensor/dist/installer/targets/shared.d.ts.map +1 -0
- package/sensor/dist/installer/targets/shared.js +264 -0
- package/sensor/dist/installer/targets/shared.js.map +1 -0
- package/sensor/dist/installer/targets/toml.d.ts +52 -0
- package/sensor/dist/installer/targets/toml.d.ts.map +1 -0
- package/sensor/dist/installer/targets/toml.js +147 -0
- package/sensor/dist/installer/targets/toml.js.map +1 -0
- package/sensor/dist/installer/targets/types.d.ts +108 -0
- package/sensor/dist/installer/targets/types.d.ts.map +1 -0
- package/sensor/dist/installer/targets/types.js +16 -0
- package/sensor/dist/installer/targets/types.js.map +1 -0
- package/sensor/dist/mcp/daemon-manager.d.ts +42 -0
- package/sensor/dist/mcp/daemon-manager.d.ts.map +1 -0
- package/sensor/dist/mcp/daemon-manager.js +129 -0
- package/sensor/dist/mcp/daemon-manager.js.map +1 -0
- package/sensor/dist/mcp/daemon-paths.d.ts +73 -0
- package/sensor/dist/mcp/daemon-paths.d.ts.map +1 -0
- package/sensor/dist/mcp/daemon-paths.js +170 -0
- package/sensor/dist/mcp/daemon-paths.js.map +1 -0
- package/sensor/dist/mcp/daemon-registry.d.ts +54 -0
- package/sensor/dist/mcp/daemon-registry.d.ts.map +1 -0
- package/sensor/dist/mcp/daemon-registry.js +241 -0
- package/sensor/dist/mcp/daemon-registry.js.map +1 -0
- package/sensor/dist/mcp/daemon.d.ts +290 -0
- package/sensor/dist/mcp/daemon.d.ts.map +1 -0
- package/sensor/dist/mcp/daemon.js +867 -0
- package/sensor/dist/mcp/daemon.js.map +1 -0
- package/sensor/dist/mcp/dynamic-boundaries.d.ts +41 -0
- package/sensor/dist/mcp/dynamic-boundaries.d.ts.map +1 -0
- package/sensor/dist/mcp/dynamic-boundaries.js +360 -0
- package/sensor/dist/mcp/dynamic-boundaries.js.map +1 -0
- package/sensor/dist/mcp/early-ppid.d.ts +26 -0
- package/sensor/dist/mcp/early-ppid.d.ts.map +1 -0
- package/sensor/dist/mcp/early-ppid.js +29 -0
- package/sensor/dist/mcp/early-ppid.js.map +1 -0
- package/sensor/dist/mcp/engine.d.ts +130 -0
- package/sensor/dist/mcp/engine.d.ts.map +1 -0
- package/sensor/dist/mcp/engine.js +375 -0
- package/sensor/dist/mcp/engine.js.map +1 -0
- package/sensor/dist/mcp/index.d.ts +113 -0
- package/sensor/dist/mcp/index.d.ts.map +1 -0
- package/sensor/dist/mcp/index.js +551 -0
- package/sensor/dist/mcp/index.js.map +1 -0
- package/sensor/dist/mcp/liveness-watchdog.d.ts +35 -0
- package/sensor/dist/mcp/liveness-watchdog.d.ts.map +1 -0
- package/sensor/dist/mcp/liveness-watchdog.js +267 -0
- package/sensor/dist/mcp/liveness-watchdog.js.map +1 -0
- package/sensor/dist/mcp/ppid-watchdog.d.ts +62 -0
- package/sensor/dist/mcp/ppid-watchdog.d.ts.map +1 -0
- package/sensor/dist/mcp/ppid-watchdog.js +64 -0
- package/sensor/dist/mcp/ppid-watchdog.js.map +1 -0
- package/sensor/dist/mcp/proxy.d.ts +99 -0
- package/sensor/dist/mcp/proxy.d.ts.map +1 -0
- package/sensor/dist/mcp/proxy.js +737 -0
- package/sensor/dist/mcp/proxy.js.map +1 -0
- package/sensor/dist/mcp/query-pool.d.ts +108 -0
- package/sensor/dist/mcp/query-pool.d.ts.map +1 -0
- package/sensor/dist/mcp/query-pool.js +315 -0
- package/sensor/dist/mcp/query-pool.js.map +1 -0
- package/sensor/dist/mcp/query-worker.d.ts +24 -0
- package/sensor/dist/mcp/query-worker.d.ts.map +1 -0
- package/sensor/dist/mcp/query-worker.js +87 -0
- package/sensor/dist/mcp/query-worker.js.map +1 -0
- package/sensor/dist/mcp/server-instructions.d.ts +34 -0
- package/sensor/dist/mcp/server-instructions.d.ts.map +1 -0
- package/sensor/dist/mcp/server-instructions.js +106 -0
- package/sensor/dist/mcp/server-instructions.js.map +1 -0
- package/sensor/dist/mcp/session.d.ts +92 -0
- package/sensor/dist/mcp/session.d.ts.map +1 -0
- package/sensor/dist/mcp/session.js +355 -0
- package/sensor/dist/mcp/session.js.map +1 -0
- package/sensor/dist/mcp/startup-handshake.d.ts +44 -0
- package/sensor/dist/mcp/startup-handshake.d.ts.map +1 -0
- package/sensor/dist/mcp/startup-handshake.js +73 -0
- package/sensor/dist/mcp/startup-handshake.js.map +1 -0
- package/sensor/dist/mcp/stdin-teardown.d.ts +27 -0
- package/sensor/dist/mcp/stdin-teardown.d.ts.map +1 -0
- package/sensor/dist/mcp/stdin-teardown.js +49 -0
- package/sensor/dist/mcp/stdin-teardown.js.map +1 -0
- package/sensor/dist/mcp/tools.d.ts +651 -0
- package/sensor/dist/mcp/tools.d.ts.map +1 -0
- package/sensor/dist/mcp/tools.js +4574 -0
- package/sensor/dist/mcp/tools.js.map +1 -0
- package/sensor/dist/mcp/transport.d.ts +188 -0
- package/sensor/dist/mcp/transport.d.ts.map +1 -0
- package/sensor/dist/mcp/transport.js +377 -0
- package/sensor/dist/mcp/transport.js.map +1 -0
- package/sensor/dist/mcp/version.d.ts +30 -0
- package/sensor/dist/mcp/version.d.ts.map +1 -0
- package/sensor/dist/mcp/version.js +85 -0
- package/sensor/dist/mcp/version.js.map +1 -0
- package/sensor/dist/project-config.d.ts +94 -0
- package/sensor/dist/project-config.d.ts.map +1 -0
- package/sensor/dist/project-config.js +374 -0
- package/sensor/dist/project-config.js.map +1 -0
- package/sensor/dist/resolution/c-fnptr-synthesizer.d.ts +6 -0
- package/sensor/dist/resolution/c-fnptr-synthesizer.d.ts.map +1 -0
- package/sensor/dist/resolution/c-fnptr-synthesizer.js +1070 -0
- package/sensor/dist/resolution/c-fnptr-synthesizer.js.map +1 -0
- package/sensor/dist/resolution/callback-synthesizer.d.ts +59 -0
- package/sensor/dist/resolution/callback-synthesizer.d.ts.map +1 -0
- package/sensor/dist/resolution/callback-synthesizer.js +3961 -0
- package/sensor/dist/resolution/callback-synthesizer.js.map +1 -0
- package/sensor/dist/resolution/cooperative-yield.d.ts +40 -0
- package/sensor/dist/resolution/cooperative-yield.d.ts.map +1 -0
- package/sensor/dist/resolution/cooperative-yield.js +44 -0
- package/sensor/dist/resolution/cooperative-yield.js.map +1 -0
- package/sensor/dist/resolution/frameworks/astro.d.ts +9 -0
- package/sensor/dist/resolution/frameworks/astro.d.ts.map +1 -0
- package/sensor/dist/resolution/frameworks/astro.js +169 -0
- package/sensor/dist/resolution/frameworks/astro.js.map +1 -0
- package/sensor/dist/resolution/frameworks/cargo-workspace.d.ts +18 -0
- package/sensor/dist/resolution/frameworks/cargo-workspace.d.ts.map +1 -0
- package/sensor/dist/resolution/frameworks/cargo-workspace.js +225 -0
- package/sensor/dist/resolution/frameworks/cargo-workspace.js.map +1 -0
- package/sensor/dist/resolution/frameworks/cics.d.ts +20 -0
- package/sensor/dist/resolution/frameworks/cics.d.ts.map +1 -0
- package/sensor/dist/resolution/frameworks/cics.js +90 -0
- package/sensor/dist/resolution/frameworks/cics.js.map +1 -0
- package/sensor/dist/resolution/frameworks/csharp.d.ts +8 -0
- package/sensor/dist/resolution/frameworks/csharp.d.ts.map +1 -0
- package/sensor/dist/resolution/frameworks/csharp.js +241 -0
- package/sensor/dist/resolution/frameworks/csharp.js.map +1 -0
- package/sensor/dist/resolution/frameworks/drupal.d.ts +51 -0
- package/sensor/dist/resolution/frameworks/drupal.d.ts.map +1 -0
- package/sensor/dist/resolution/frameworks/drupal.js +367 -0
- package/sensor/dist/resolution/frameworks/drupal.js.map +1 -0
- package/sensor/dist/resolution/frameworks/expo-modules.d.ts +3 -0
- package/sensor/dist/resolution/frameworks/expo-modules.d.ts.map +1 -0
- package/sensor/dist/resolution/frameworks/expo-modules.js +148 -0
- package/sensor/dist/resolution/frameworks/expo-modules.js.map +1 -0
- package/sensor/dist/resolution/frameworks/express.d.ts +8 -0
- package/sensor/dist/resolution/frameworks/express.d.ts.map +1 -0
- package/sensor/dist/resolution/frameworks/express.js +308 -0
- package/sensor/dist/resolution/frameworks/express.js.map +1 -0
- package/sensor/dist/resolution/frameworks/fabric.d.ts +3 -0
- package/sensor/dist/resolution/frameworks/fabric.d.ts.map +1 -0
- package/sensor/dist/resolution/frameworks/fabric.js +354 -0
- package/sensor/dist/resolution/frameworks/fabric.js.map +1 -0
- package/sensor/dist/resolution/frameworks/go.d.ts +8 -0
- package/sensor/dist/resolution/frameworks/go.d.ts.map +1 -0
- package/sensor/dist/resolution/frameworks/go.js +184 -0
- package/sensor/dist/resolution/frameworks/go.js.map +1 -0
- package/sensor/dist/resolution/frameworks/goframe.d.ts +41 -0
- package/sensor/dist/resolution/frameworks/goframe.d.ts.map +1 -0
- package/sensor/dist/resolution/frameworks/goframe.js +112 -0
- package/sensor/dist/resolution/frameworks/goframe.js.map +1 -0
- package/sensor/dist/resolution/frameworks/index.d.ts +50 -0
- package/sensor/dist/resolution/frameworks/index.d.ts.map +1 -0
- package/sensor/dist/resolution/frameworks/index.js +175 -0
- package/sensor/dist/resolution/frameworks/index.js.map +1 -0
- package/sensor/dist/resolution/frameworks/java.d.ts +8 -0
- package/sensor/dist/resolution/frameworks/java.d.ts.map +1 -0
- package/sensor/dist/resolution/frameworks/java.js +517 -0
- package/sensor/dist/resolution/frameworks/java.js.map +1 -0
- package/sensor/dist/resolution/frameworks/laravel.d.ts +13 -0
- package/sensor/dist/resolution/frameworks/laravel.d.ts.map +1 -0
- package/sensor/dist/resolution/frameworks/laravel.js +257 -0
- package/sensor/dist/resolution/frameworks/laravel.js.map +1 -0
- package/sensor/dist/resolution/frameworks/nestjs.d.ts +26 -0
- package/sensor/dist/resolution/frameworks/nestjs.d.ts.map +1 -0
- package/sensor/dist/resolution/frameworks/nestjs.js +698 -0
- package/sensor/dist/resolution/frameworks/nestjs.js.map +1 -0
- package/sensor/dist/resolution/frameworks/play.d.ts +19 -0
- package/sensor/dist/resolution/frameworks/play.d.ts.map +1 -0
- package/sensor/dist/resolution/frameworks/play.js +111 -0
- package/sensor/dist/resolution/frameworks/play.js.map +1 -0
- package/sensor/dist/resolution/frameworks/python.d.ts +10 -0
- package/sensor/dist/resolution/frameworks/python.d.ts.map +1 -0
- package/sensor/dist/resolution/frameworks/python.js +400 -0
- package/sensor/dist/resolution/frameworks/python.js.map +1 -0
- package/sensor/dist/resolution/frameworks/react-native.d.ts +3 -0
- package/sensor/dist/resolution/frameworks/react-native.d.ts.map +1 -0
- package/sensor/dist/resolution/frameworks/react-native.js +410 -0
- package/sensor/dist/resolution/frameworks/react-native.js.map +1 -0
- package/sensor/dist/resolution/frameworks/react.d.ts +8 -0
- package/sensor/dist/resolution/frameworks/react.d.ts.map +1 -0
- package/sensor/dist/resolution/frameworks/react.js +334 -0
- package/sensor/dist/resolution/frameworks/react.js.map +1 -0
- package/sensor/dist/resolution/frameworks/ruby.d.ts +8 -0
- package/sensor/dist/resolution/frameworks/ruby.d.ts.map +1 -0
- package/sensor/dist/resolution/frameworks/ruby.js +302 -0
- package/sensor/dist/resolution/frameworks/ruby.js.map +1 -0
- package/sensor/dist/resolution/frameworks/rust.d.ts +8 -0
- package/sensor/dist/resolution/frameworks/rust.d.ts.map +1 -0
- package/sensor/dist/resolution/frameworks/rust.js +304 -0
- package/sensor/dist/resolution/frameworks/rust.js.map +1 -0
- package/sensor/dist/resolution/frameworks/svelte.d.ts +9 -0
- package/sensor/dist/resolution/frameworks/svelte.d.ts.map +1 -0
- package/sensor/dist/resolution/frameworks/svelte.js +253 -0
- package/sensor/dist/resolution/frameworks/svelte.js.map +1 -0
- package/sensor/dist/resolution/frameworks/swift-objc.d.ts +37 -0
- package/sensor/dist/resolution/frameworks/swift-objc.d.ts.map +1 -0
- package/sensor/dist/resolution/frameworks/swift-objc.js +252 -0
- package/sensor/dist/resolution/frameworks/swift-objc.js.map +1 -0
- package/sensor/dist/resolution/frameworks/swift.d.ts +10 -0
- package/sensor/dist/resolution/frameworks/swift.d.ts.map +1 -0
- package/sensor/dist/resolution/frameworks/swift.js +400 -0
- package/sensor/dist/resolution/frameworks/swift.js.map +1 -0
- package/sensor/dist/resolution/frameworks/terraform.d.ts +38 -0
- package/sensor/dist/resolution/frameworks/terraform.d.ts.map +1 -0
- package/sensor/dist/resolution/frameworks/terraform.js +277 -0
- package/sensor/dist/resolution/frameworks/terraform.js.map +1 -0
- package/sensor/dist/resolution/frameworks/vue.d.ts +9 -0
- package/sensor/dist/resolution/frameworks/vue.d.ts.map +1 -0
- package/sensor/dist/resolution/frameworks/vue.js +303 -0
- package/sensor/dist/resolution/frameworks/vue.js.map +1 -0
- package/sensor/dist/resolution/go-module.d.ts +26 -0
- package/sensor/dist/resolution/go-module.d.ts.map +1 -0
- package/sensor/dist/resolution/go-module.js +78 -0
- package/sensor/dist/resolution/go-module.js.map +1 -0
- package/sensor/dist/resolution/goframe-synthesizer.d.ts +29 -0
- package/sensor/dist/resolution/goframe-synthesizer.d.ts.map +1 -0
- package/sensor/dist/resolution/goframe-synthesizer.js +163 -0
- package/sensor/dist/resolution/goframe-synthesizer.js.map +1 -0
- package/sensor/dist/resolution/import-resolver.d.ts +84 -0
- package/sensor/dist/resolution/import-resolver.d.ts.map +1 -0
- package/sensor/dist/resolution/import-resolver.js +2172 -0
- package/sensor/dist/resolution/import-resolver.js.map +1 -0
- package/sensor/dist/resolution/index.d.ts +309 -0
- package/sensor/dist/resolution/index.d.ts.map +1 -0
- package/sensor/dist/resolution/index.js +2050 -0
- package/sensor/dist/resolution/index.js.map +1 -0
- package/sensor/dist/resolution/lru-cache.d.ts +24 -0
- package/sensor/dist/resolution/lru-cache.d.ts.map +1 -0
- package/sensor/dist/resolution/lru-cache.js +62 -0
- package/sensor/dist/resolution/lru-cache.js.map +1 -0
- package/sensor/dist/resolution/name-matcher.d.ts +126 -0
- package/sensor/dist/resolution/name-matcher.d.ts.map +1 -0
- package/sensor/dist/resolution/name-matcher.js +1968 -0
- package/sensor/dist/resolution/name-matcher.js.map +1 -0
- package/sensor/dist/resolution/path-aliases.d.ts +68 -0
- package/sensor/dist/resolution/path-aliases.d.ts.map +1 -0
- package/sensor/dist/resolution/path-aliases.js +238 -0
- package/sensor/dist/resolution/path-aliases.js.map +1 -0
- package/sensor/dist/resolution/resolver-pool.d.ts +66 -0
- package/sensor/dist/resolution/resolver-pool.d.ts.map +1 -0
- package/sensor/dist/resolution/resolver-pool.js +244 -0
- package/sensor/dist/resolution/resolver-pool.js.map +1 -0
- package/sensor/dist/resolution/resolver-worker.d.ts +17 -0
- package/sensor/dist/resolution/resolver-worker.d.ts.map +1 -0
- package/sensor/dist/resolution/resolver-worker.js +114 -0
- package/sensor/dist/resolution/resolver-worker.js.map +1 -0
- package/sensor/dist/resolution/strip-comments.d.ts +27 -0
- package/sensor/dist/resolution/strip-comments.d.ts.map +1 -0
- package/sensor/dist/resolution/strip-comments.js +492 -0
- package/sensor/dist/resolution/strip-comments.js.map +1 -0
- package/sensor/dist/resolution/swift-objc-bridge.d.ts +134 -0
- package/sensor/dist/resolution/swift-objc-bridge.d.ts.map +1 -0
- package/sensor/dist/resolution/swift-objc-bridge.js +256 -0
- package/sensor/dist/resolution/swift-objc-bridge.js.map +1 -0
- package/sensor/dist/resolution/types.d.ts +265 -0
- package/sensor/dist/resolution/types.d.ts.map +1 -0
- package/sensor/dist/resolution/types.js +8 -0
- package/sensor/dist/resolution/types.js.map +1 -0
- package/sensor/dist/resolution/workspace-packages.d.ts +58 -0
- package/sensor/dist/resolution/workspace-packages.d.ts.map +1 -0
- package/sensor/dist/resolution/workspace-packages.js +346 -0
- package/sensor/dist/resolution/workspace-packages.js.map +1 -0
- package/sensor/dist/search/identifier-segments.d.ts +60 -0
- package/sensor/dist/search/identifier-segments.d.ts.map +1 -0
- package/sensor/dist/search/identifier-segments.js +176 -0
- package/sensor/dist/search/identifier-segments.js.map +1 -0
- package/sensor/dist/search/query-parser.d.ts +57 -0
- package/sensor/dist/search/query-parser.d.ts.map +1 -0
- package/sensor/dist/search/query-parser.js +177 -0
- package/sensor/dist/search/query-parser.js.map +1 -0
- package/sensor/dist/search/query-utils.d.ts +87 -0
- package/sensor/dist/search/query-utils.d.ts.map +1 -0
- package/sensor/dist/search/query-utils.js +449 -0
- package/sensor/dist/search/query-utils.js.map +1 -0
- package/sensor/dist/sync/git-hooks.d.ts +45 -0
- package/sensor/dist/sync/git-hooks.d.ts.map +1 -0
- package/sensor/dist/sync/git-hooks.js +227 -0
- package/sensor/dist/sync/git-hooks.js.map +1 -0
- package/sensor/dist/sync/index.d.ts +19 -0
- package/sensor/dist/sync/index.d.ts.map +1 -0
- package/sensor/dist/sync/index.js +35 -0
- package/sensor/dist/sync/index.js.map +1 -0
- package/sensor/dist/sync/watch-policy.d.ts +48 -0
- package/sensor/dist/sync/watch-policy.d.ts.map +1 -0
- package/sensor/dist/sync/watch-policy.js +124 -0
- package/sensor/dist/sync/watch-policy.js.map +1 -0
- package/sensor/dist/sync/watcher.d.ts +372 -0
- package/sensor/dist/sync/watcher.d.ts.map +1 -0
- package/sensor/dist/sync/watcher.js +879 -0
- package/sensor/dist/sync/watcher.js.map +1 -0
- package/sensor/dist/sync/worktree.d.ts +63 -0
- package/sensor/dist/sync/worktree.d.ts.map +1 -0
- package/sensor/dist/sync/worktree.js +182 -0
- package/sensor/dist/sync/worktree.js.map +1 -0
- package/sensor/dist/telemetry/index.d.ts +157 -0
- package/sensor/dist/telemetry/index.d.ts.map +1 -0
- package/sensor/dist/telemetry/index.js +556 -0
- package/sensor/dist/telemetry/index.js.map +1 -0
- package/sensor/dist/types.d.ts +458 -0
- package/sensor/dist/types.d.ts.map +1 -0
- package/sensor/dist/types.js +117 -0
- package/sensor/dist/types.js.map +1 -0
- package/sensor/dist/ui/color.d.ts +21 -0
- package/sensor/dist/ui/color.d.ts.map +1 -0
- package/sensor/dist/ui/color.js +42 -0
- package/sensor/dist/ui/color.js.map +1 -0
- package/sensor/dist/ui/glyphs.d.ts +67 -0
- package/sensor/dist/ui/glyphs.d.ts.map +1 -0
- package/sensor/dist/ui/glyphs.js +125 -0
- package/sensor/dist/ui/glyphs.js.map +1 -0
- package/sensor/dist/ui/shimmer-progress.d.ts +11 -0
- package/sensor/dist/ui/shimmer-progress.d.ts.map +1 -0
- package/sensor/dist/ui/shimmer-progress.js +164 -0
- package/sensor/dist/ui/shimmer-progress.js.map +1 -0
- package/sensor/dist/ui/shimmer-worker.d.ts +2 -0
- package/sensor/dist/ui/shimmer-worker.d.ts.map +1 -0
- package/sensor/dist/ui/shimmer-worker.js +126 -0
- package/sensor/dist/ui/shimmer-worker.js.map +1 -0
- package/sensor/dist/ui/types.d.ts +15 -0
- package/sensor/dist/ui/types.d.ts.map +1 -0
- package/sensor/dist/ui/types.js +3 -0
- package/sensor/dist/ui/types.js.map +1 -0
- package/sensor/dist/upgrade/index.d.ts +171 -0
- package/sensor/dist/upgrade/index.d.ts.map +1 -0
- package/sensor/dist/upgrade/index.js +659 -0
- package/sensor/dist/upgrade/index.js.map +1 -0
- package/sensor/dist/upgrade/remove-binary.d.ts +87 -0
- package/sensor/dist/upgrade/remove-binary.d.ts.map +1 -0
- package/sensor/dist/upgrade/remove-binary.js +289 -0
- package/sensor/dist/upgrade/remove-binary.js.map +1 -0
- package/sensor/dist/upgrade/update-check.d.ts +92 -0
- package/sensor/dist/upgrade/update-check.d.ts.map +1 -0
- package/sensor/dist/upgrade/update-check.js +258 -0
- package/sensor/dist/upgrade/update-check.js.map +1 -0
- package/sensor/dist/utils.d.ts +224 -0
- package/sensor/dist/utils.d.ts.map +1 -0
- package/sensor/dist/utils.js +583 -0
- package/sensor/dist/utils.js.map +1 -0
- package/sensor/package.json +61 -0
- package/src/artifact-contracts-v2.mjs +325 -0
- package/src/artifact-contracts.mjs +895 -0
- package/src/bootstrap.mjs +88 -0
- package/src/boundary-compiler.mjs +712 -0
- package/src/boundary-observation-compiler-v2.mjs +339 -0
- package/src/codegraph-adapter.mjs +422 -0
- package/src/control-compiler.mjs +532 -0
- package/src/factory-diagnostics.mjs +187 -0
- package/src/isolation-runner.mjs +333 -0
- package/src/node-version-guard.mjs +43 -0
- package/src/rc1-black-box-oracle.mjs +906 -0
- package/src/rc1-comparison.mjs +154 -0
- package/src/rc1-evidence-bundle.mjs +456 -0
- package/src/rc1-v4-campaign.mjs +707 -0
- package/src/rc1-v4-transform.mjs +467 -0
- package/src/rc1-v5-artifact-set.mjs +855 -0
- package/src/rc1-v5-behavior-evidence.mjs +594 -0
- package/src/rc1-v5-campaign.mjs +796 -0
- package/src/rc1-v5-transform.mjs +421 -0
- package/src/rc1-v6-artifact-set.mjs +807 -0
- package/src/rc1-v6-behavior-evidence.mjs +273 -0
- package/src/rc1-v6-campaign.mjs +623 -0
- package/src/rc1-v6-causal-binding.mjs +471 -0
- package/src/rc1-v6-measurement.mjs +331 -0
- package/src/rc2-artifact-set.mjs +1579 -0
- package/src/rc2-campaign.mjs +1520 -0
- package/src/rc2-delivery-policy-front-end.mjs +1079 -0
- package/src/rc2-delivery-policy-oracle.mjs +134 -0
- package/src/rc2-delivery-policy-transform.mjs +1127 -0
- package/src/rc2-rc1-transfer-front-end.mjs +511 -0
- package/src/rc3-actual-dogfood.mjs +648 -0
- package/src/rc3-dogfood-scaffold.mjs +310 -0
- package/src/rc3-scripted-campaign.mjs +1301 -0
- package/src/rc4-stage1-dogfood.mjs +652 -0
- package/src/runtime-cli.mjs +504 -0
- package/src/runtime-contracts.mjs +631 -0
- package/src/runtime-decision-verifier.mjs +607 -0
- package/src/runtime-diff-observer.mjs +265 -0
- package/src/runtime-engine.mjs +674 -0
- package/src/runtime-errors.mjs +356 -0
- package/src/runtime-event-store.mjs +217 -0
- package/src/runtime-front-end.mjs +764 -0
- package/src/runtime-hold-recompile.mjs +606 -0
- package/src/runtime-projection.mjs +180 -0
- package/src/runtime-scripted-executor.mjs +163 -0
- package/src/runtime-worktree-executor.mjs +199 -0
- package/src/schedulability-compiler-v2.mjs +303 -0
- package/src/schedulability-verifier-v2.mjs +317 -0
- package/src/seam-transform.mjs +554 -0
- package/src/treatment-compiler.mjs +728 -0
- package/src/treatment-runner.mjs +658 -0
|
@@ -0,0 +1,895 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
|
|
3
|
+
const MAX_DEPTH = 32;
|
|
4
|
+
const MAX_NODES = 10_000;
|
|
5
|
+
const MAX_COLLECTION_ITEMS = 256;
|
|
6
|
+
const MAX_STRING_BYTES = 16_384;
|
|
7
|
+
const MAX_TEXT_BYTES = 4_096;
|
|
8
|
+
const MAX_PATH_BYTES = 1_024;
|
|
9
|
+
const MAX_CANONICAL_BYTES = 1_048_576;
|
|
10
|
+
|
|
11
|
+
const SHA256 = /^[0-9a-f]{64}$/;
|
|
12
|
+
const SHA1 = /^[0-9a-f]{40}$/;
|
|
13
|
+
const IDENTIFIER = /^[0-9A-Za-z](?:[0-9A-Za-z._-]{0,127})$/;
|
|
14
|
+
const CONTROL_CHARACTER = /[\u0000-\u001f\u007f]/;
|
|
15
|
+
|
|
16
|
+
const RESOURCE_KINDS = new Set([
|
|
17
|
+
'symbol',
|
|
18
|
+
'path',
|
|
19
|
+
'state',
|
|
20
|
+
'effect',
|
|
21
|
+
'semantic',
|
|
22
|
+
'dynamic',
|
|
23
|
+
]);
|
|
24
|
+
const GRAPH_OPERATIONS = new Set([
|
|
25
|
+
'status',
|
|
26
|
+
'query',
|
|
27
|
+
'callers',
|
|
28
|
+
'callees',
|
|
29
|
+
'impact',
|
|
30
|
+
'affected',
|
|
31
|
+
]);
|
|
32
|
+
const GRAPH_STATUSES = new Set([
|
|
33
|
+
'ready',
|
|
34
|
+
'absent',
|
|
35
|
+
'symbol_absent',
|
|
36
|
+
'empty',
|
|
37
|
+
'command_failure',
|
|
38
|
+
'invalid_json',
|
|
39
|
+
'stale',
|
|
40
|
+
'unresolved',
|
|
41
|
+
'unsupported',
|
|
42
|
+
]);
|
|
43
|
+
const GRAPH_STATUS_BY_OPERATION = new Map([
|
|
44
|
+
['status', new Set([
|
|
45
|
+
'ready',
|
|
46
|
+
'absent',
|
|
47
|
+
'command_failure',
|
|
48
|
+
'invalid_json',
|
|
49
|
+
'stale',
|
|
50
|
+
'unresolved',
|
|
51
|
+
'unsupported',
|
|
52
|
+
])],
|
|
53
|
+
['query', new Set(['ready', 'symbol_absent', 'command_failure', 'invalid_json', 'unresolved'])],
|
|
54
|
+
['callers', new Set(['ready', 'symbol_absent', 'command_failure', 'invalid_json', 'unresolved'])],
|
|
55
|
+
['callees', new Set(['ready', 'symbol_absent', 'command_failure', 'invalid_json', 'unresolved'])],
|
|
56
|
+
['impact', new Set(['ready', 'symbol_absent', 'command_failure', 'invalid_json', 'unresolved'])],
|
|
57
|
+
['affected', new Set(['ready', 'empty', 'unresolved'])],
|
|
58
|
+
]);
|
|
59
|
+
const VERDICTS = new Set([
|
|
60
|
+
'parallel_ready',
|
|
61
|
+
'seam_candidate',
|
|
62
|
+
'intentional_serial',
|
|
63
|
+
'unknown_requires_evidence',
|
|
64
|
+
]);
|
|
65
|
+
const EDGE_KINDS = new Set([
|
|
66
|
+
'hard_need',
|
|
67
|
+
'write_conflict',
|
|
68
|
+
'state_conflict',
|
|
69
|
+
'effect_conflict',
|
|
70
|
+
'semantic_conflict',
|
|
71
|
+
'dynamic_unknown',
|
|
72
|
+
]);
|
|
73
|
+
const INVALIDATION_KINDS = new Set([
|
|
74
|
+
'old_plan',
|
|
75
|
+
'agent_context',
|
|
76
|
+
'partial_patch',
|
|
77
|
+
'interface_assumption',
|
|
78
|
+
]);
|
|
79
|
+
const TRANSFORM_STATUSES = new Set(['accepted', 'rejected']);
|
|
80
|
+
const VERIFICATION_STATUSES = new Set(['passed', 'failed', 'not_run']);
|
|
81
|
+
const RECEIPT_OUTCOMES = new Set(['passed', 'failed']);
|
|
82
|
+
const CLEANUP_STATUSES = new Set(['passed', 'failed', 'unresolved']);
|
|
83
|
+
const SOURCE_STATUSES = new Set(['unchanged', 'changed', 'unresolved']);
|
|
84
|
+
const TRANSFORM_REJECTION_KINDS = new Set([
|
|
85
|
+
'scope_violation',
|
|
86
|
+
'behavior_verification_failed',
|
|
87
|
+
'snapshot_mutation',
|
|
88
|
+
'source_invariant_violation',
|
|
89
|
+
'cleanup_failure',
|
|
90
|
+
'execution_failure',
|
|
91
|
+
]);
|
|
92
|
+
|
|
93
|
+
function invalidArtifact(reason) {
|
|
94
|
+
throw new TypeError(`artifact契約違反: ${reason}`);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function byteLength(value) {
|
|
98
|
+
return Buffer.byteLength(value, 'utf8');
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function requireBoundedString(value, label = 'string') {
|
|
102
|
+
if (byteLength(value) > MAX_STRING_BYTES) {
|
|
103
|
+
invalidArtifact(`${label}が上限を超えている`);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function inspectArray(value, state, depth) {
|
|
108
|
+
if (Object.getPrototypeOf(value) !== Array.prototype) {
|
|
109
|
+
invalidArtifact('array prototypeが不正');
|
|
110
|
+
}
|
|
111
|
+
if (value.length > MAX_COLLECTION_ITEMS) {
|
|
112
|
+
invalidArtifact('array item数が上限を超えている');
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
const ownKeys = Reflect.ownKeys(value);
|
|
116
|
+
if (ownKeys.some((key) => typeof key !== 'string')) {
|
|
117
|
+
invalidArtifact('arrayにsymbol keyがある');
|
|
118
|
+
}
|
|
119
|
+
const expectedKeys = new Set([
|
|
120
|
+
...Array.from({ length: value.length }, (_, index) => String(index)),
|
|
121
|
+
'length',
|
|
122
|
+
]);
|
|
123
|
+
if (ownKeys.length !== expectedKeys.size || ownKeys.some((key) => !expectedKeys.has(key))) {
|
|
124
|
+
invalidArtifact('arrayがsparseまたはextra propertyを持つ');
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
const parts = [];
|
|
128
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
129
|
+
const descriptor = Object.getOwnPropertyDescriptor(value, String(index));
|
|
130
|
+
if (descriptor === undefined || !descriptor.enumerable || !('value' in descriptor)) {
|
|
131
|
+
invalidArtifact('array itemがdata propertyではない');
|
|
132
|
+
}
|
|
133
|
+
parts.push(canonicalPart(descriptor.value, state, depth + 1));
|
|
134
|
+
}
|
|
135
|
+
return `[${parts.join(',')}]`;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
function inspectObject(value, state, depth) {
|
|
139
|
+
if (Object.getPrototypeOf(value) !== Object.prototype) {
|
|
140
|
+
invalidArtifact('plain objectではない');
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
const ownKeys = Reflect.ownKeys(value);
|
|
144
|
+
if (ownKeys.length > MAX_COLLECTION_ITEMS) {
|
|
145
|
+
invalidArtifact('object key数が上限を超えている');
|
|
146
|
+
}
|
|
147
|
+
if (ownKeys.some((key) => typeof key !== 'string')) {
|
|
148
|
+
invalidArtifact('objectにsymbol keyがある');
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
const entries = [];
|
|
152
|
+
for (const key of ownKeys.sort()) {
|
|
153
|
+
requireBoundedString(key, 'object key');
|
|
154
|
+
const descriptor = Object.getOwnPropertyDescriptor(value, key);
|
|
155
|
+
if (descriptor === undefined || !descriptor.enumerable || !('value' in descriptor)) {
|
|
156
|
+
invalidArtifact('object propertyがenumerable data propertyではない');
|
|
157
|
+
}
|
|
158
|
+
entries.push(`${JSON.stringify(key)}:${canonicalPart(descriptor.value, state, depth + 1)}`);
|
|
159
|
+
}
|
|
160
|
+
return `{${entries.join(',')}}`;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
function canonicalPart(value, state, depth) {
|
|
164
|
+
state.nodes += 1;
|
|
165
|
+
if (state.nodes > MAX_NODES) {
|
|
166
|
+
invalidArtifact('node数が上限を超えている');
|
|
167
|
+
}
|
|
168
|
+
if (depth > MAX_DEPTH) {
|
|
169
|
+
invalidArtifact('nestingが上限を超えている');
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
if (value === null) return 'null';
|
|
173
|
+
if (typeof value === 'boolean') return value ? 'true' : 'false';
|
|
174
|
+
if (typeof value === 'string') {
|
|
175
|
+
requireBoundedString(value);
|
|
176
|
+
return JSON.stringify(value);
|
|
177
|
+
}
|
|
178
|
+
if (typeof value === 'number') {
|
|
179
|
+
if (!Number.isFinite(value) || Object.is(value, -0)) {
|
|
180
|
+
invalidArtifact('numberがfiniteでないかnegative zero');
|
|
181
|
+
}
|
|
182
|
+
return JSON.stringify(value);
|
|
183
|
+
}
|
|
184
|
+
if (typeof value !== 'object') {
|
|
185
|
+
invalidArtifact('JSON valueではない');
|
|
186
|
+
}
|
|
187
|
+
if (state.seen.has(value)) {
|
|
188
|
+
invalidArtifact('循環参照がある');
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
state.seen.add(value);
|
|
192
|
+
try {
|
|
193
|
+
return Array.isArray(value)
|
|
194
|
+
? inspectArray(value, state, depth)
|
|
195
|
+
: inspectObject(value, state, depth);
|
|
196
|
+
} finally {
|
|
197
|
+
state.seen.delete(value);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* JSON互換payloadをobject keyの辞書順でUTF-8 canonical JSONへ変換する。
|
|
203
|
+
* @param {unknown} value
|
|
204
|
+
* @returns {string}
|
|
205
|
+
*/
|
|
206
|
+
export function canonicalizeArtifact(value) {
|
|
207
|
+
const canonical = canonicalPart(value, { nodes: 0, seen: new Set() }, 0);
|
|
208
|
+
if (byteLength(canonical) > MAX_CANONICAL_BYTES) {
|
|
209
|
+
invalidArtifact('canonical byte列が上限を超えている');
|
|
210
|
+
}
|
|
211
|
+
return canonical;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* canonical payload byte列のSHA-256をlowercase hexで返す。
|
|
216
|
+
* @param {unknown} value
|
|
217
|
+
* @returns {string}
|
|
218
|
+
*/
|
|
219
|
+
export function digestArtifact(value) {
|
|
220
|
+
return createHash('sha256')
|
|
221
|
+
.update(Buffer.from(canonicalizeArtifact(value), 'utf8'))
|
|
222
|
+
.digest('hex');
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
function exactRecord(value, keys) {
|
|
226
|
+
if (value === null || typeof value !== 'object' || Array.isArray(value)
|
|
227
|
+
|| Object.getPrototypeOf(value) !== Object.prototype) {
|
|
228
|
+
return false;
|
|
229
|
+
}
|
|
230
|
+
const actual = Object.keys(value).sort();
|
|
231
|
+
const expected = [...keys].sort();
|
|
232
|
+
return actual.length === expected.length
|
|
233
|
+
&& actual.every((key, index) => key === expected[index]);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
function boundedText(value, maxBytes = MAX_TEXT_BYTES) {
|
|
237
|
+
return typeof value === 'string'
|
|
238
|
+
&& value.length > 0
|
|
239
|
+
&& value === value.trim()
|
|
240
|
+
&& !CONTROL_CHARACTER.test(value)
|
|
241
|
+
&& byteLength(value) <= maxBytes;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
function identifier(value) {
|
|
245
|
+
return typeof value === 'string' && IDENTIFIER.test(value);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
function digest(value) {
|
|
249
|
+
return typeof value === 'string' && SHA256.test(value);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
function nonNegativeInteger(value) {
|
|
253
|
+
return Number.isSafeInteger(value) && value >= 0;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
function positiveInteger(value) {
|
|
257
|
+
return Number.isSafeInteger(value) && value >= 1;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
function repoPath(value, { allowDot = false } = {}) {
|
|
261
|
+
if (allowDot && value === '.') return true;
|
|
262
|
+
if (!boundedText(value, MAX_PATH_BYTES)
|
|
263
|
+
|| value.startsWith('/')
|
|
264
|
+
|| value.endsWith('/')
|
|
265
|
+
|| value.includes('\\')
|
|
266
|
+
|| /^[A-Za-z]:/.test(value)) {
|
|
267
|
+
return false;
|
|
268
|
+
}
|
|
269
|
+
const segments = value.split('/');
|
|
270
|
+
return segments.length > 0
|
|
271
|
+
&& segments.every((segment) => segment !== '' && segment !== '.' && segment !== '..');
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
function boundedArray(value, validator, { min = 0, max = MAX_COLLECTION_ITEMS } = {}) {
|
|
275
|
+
return Array.isArray(value)
|
|
276
|
+
&& value.length >= min
|
|
277
|
+
&& value.length <= max
|
|
278
|
+
&& value.every((entry) => validator(entry));
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
function uniqueStrings(value, validator = boundedText, options = {}) {
|
|
282
|
+
return boundedArray(value, validator, options) && new Set(value).size === value.length;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
function disjoint(...arrays) {
|
|
286
|
+
const seen = new Set();
|
|
287
|
+
for (const array of arrays) {
|
|
288
|
+
for (const value of array) {
|
|
289
|
+
if (seen.has(value)) return false;
|
|
290
|
+
seen.add(value);
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
return true;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
function resource(value, allowedKinds = RESOURCE_KINDS) {
|
|
297
|
+
return exactRecord(value, ['kind', 'target'])
|
|
298
|
+
&& allowedKinds.has(value.kind)
|
|
299
|
+
&& (value.kind === 'path' ? repoPath(value.target) : boundedText(value.target, 512));
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
function resources(value, { min = 0, allowedKinds = RESOURCE_KINDS } = {}) {
|
|
303
|
+
return boundedArray(value, (entry) => resource(entry, allowedKinds), { min })
|
|
304
|
+
&& new Set(value.map((entry) => `${entry.kind}\u0000${entry.target}`)).size === value.length;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
function resourceKey(value) {
|
|
308
|
+
return `${value.kind}\u0000${value.target}`;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
function validateSafely(value, validator) {
|
|
312
|
+
try {
|
|
313
|
+
canonicalizeArtifact(value);
|
|
314
|
+
return validator(value) === true;
|
|
315
|
+
} catch {
|
|
316
|
+
return false;
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
function planTodo(value) {
|
|
321
|
+
return exactRecord(value, ['id', 'outcome', 'concern', 'anchor'])
|
|
322
|
+
&& identifier(value.id)
|
|
323
|
+
&& boundedText(value.outcome)
|
|
324
|
+
&& identifier(value.concern)
|
|
325
|
+
&& exactRecord(value.anchor, ['symbol', 'path'])
|
|
326
|
+
&& boundedText(value.anchor.symbol, 512)
|
|
327
|
+
&& repoPath(value.anchor.path);
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
/** @param {unknown} value @returns {boolean} */
|
|
331
|
+
export function validatePlanInput(value) {
|
|
332
|
+
return validateSafely(value, (input) => {
|
|
333
|
+
if (!exactRecord(input, [
|
|
334
|
+
'schema',
|
|
335
|
+
'project',
|
|
336
|
+
'plan_version',
|
|
337
|
+
'capacity',
|
|
338
|
+
'todos',
|
|
339
|
+
'manual_evidence_ref',
|
|
340
|
+
'query_set_ref',
|
|
341
|
+
]) || input.schema !== 'lattice.plan_input.v1') {
|
|
342
|
+
return false;
|
|
343
|
+
}
|
|
344
|
+
if (!exactRecord(input.project, ['root', 'fixture_entry'])
|
|
345
|
+
|| !repoPath(input.project.root, { allowDot: true })
|
|
346
|
+
|| !repoPath(input.project.fixture_entry)) {
|
|
347
|
+
return false;
|
|
348
|
+
}
|
|
349
|
+
if (!identifier(input.plan_version)
|
|
350
|
+
|| !exactRecord(input.capacity, ['writers'])
|
|
351
|
+
|| !positiveInteger(input.capacity.writers)
|
|
352
|
+
|| input.capacity.writers > 64
|
|
353
|
+
|| !boundedArray(input.todos, planTodo, { min: 1 })) {
|
|
354
|
+
return false;
|
|
355
|
+
}
|
|
356
|
+
const todoIds = input.todos.map((todo) => todo.id);
|
|
357
|
+
return new Set(todoIds).size === todoIds.length
|
|
358
|
+
&& repoPath(input.manual_evidence_ref)
|
|
359
|
+
&& repoPath(input.query_set_ref);
|
|
360
|
+
});
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
function graphEvidence(value) {
|
|
364
|
+
return exactRecord(value, ['id', 'operation', 'status', 'result_digest'])
|
|
365
|
+
&& identifier(value.id)
|
|
366
|
+
&& GRAPH_OPERATIONS.has(value.operation)
|
|
367
|
+
&& GRAPH_STATUSES.has(value.status)
|
|
368
|
+
&& GRAPH_STATUS_BY_OPERATION.get(value.operation).has(value.status)
|
|
369
|
+
&& digest(value.result_digest);
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
function manualEvidence(value) {
|
|
373
|
+
return exactRecord(value, ['id', 'todo_id', 'result_digest'])
|
|
374
|
+
&& identifier(value.id)
|
|
375
|
+
&& identifier(value.todo_id)
|
|
376
|
+
&& digest(value.result_digest);
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
function manifestTodo(value) {
|
|
380
|
+
const ownedKinds = new Set(['symbol', 'path']);
|
|
381
|
+
return exactRecord(value, [
|
|
382
|
+
'id',
|
|
383
|
+
'owns',
|
|
384
|
+
'reads',
|
|
385
|
+
'writes',
|
|
386
|
+
'hard_needs',
|
|
387
|
+
'conflict_ids',
|
|
388
|
+
'unknowns',
|
|
389
|
+
'tests',
|
|
390
|
+
'evidence_refs',
|
|
391
|
+
])
|
|
392
|
+
&& identifier(value.id)
|
|
393
|
+
&& resources(value.owns, { min: 1, allowedKinds: ownedKinds })
|
|
394
|
+
&& resources(value.reads)
|
|
395
|
+
&& resources(value.writes, { min: 1 })
|
|
396
|
+
&& uniqueStrings(value.hard_needs, identifier)
|
|
397
|
+
&& uniqueStrings(value.conflict_ids, identifier)
|
|
398
|
+
&& uniqueStrings(value.unknowns)
|
|
399
|
+
&& uniqueStrings(value.tests, (entry) => repoPath(entry), { min: 1 })
|
|
400
|
+
&& uniqueStrings(value.evidence_refs, identifier, { min: 1 });
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
function manifestConflict(value) {
|
|
404
|
+
return exactRecord(value, ['id', 'kind', 'todo_ids', 'resource', 'evidence_refs'])
|
|
405
|
+
&& identifier(value.id)
|
|
406
|
+
&& new Set([
|
|
407
|
+
'write_boundary',
|
|
408
|
+
'state',
|
|
409
|
+
'effect',
|
|
410
|
+
'semantic',
|
|
411
|
+
'dynamic_unknown',
|
|
412
|
+
]).has(value.kind)
|
|
413
|
+
&& uniqueStrings(value.todo_ids, identifier, { min: 2, max: 2 })
|
|
414
|
+
&& resource(value.resource)
|
|
415
|
+
&& uniqueStrings(value.evidence_refs, identifier, { min: 1 });
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
/** @param {unknown} value @returns {boolean} */
|
|
419
|
+
export function validateBoundaryManifest(value) {
|
|
420
|
+
return validateSafely(value, (manifest) => {
|
|
421
|
+
if (!exactRecord(manifest, [
|
|
422
|
+
'schema',
|
|
423
|
+
'plan_input_digest',
|
|
424
|
+
'source',
|
|
425
|
+
'graph_evidence',
|
|
426
|
+
'manual_evidence',
|
|
427
|
+
'todos',
|
|
428
|
+
'conflicts',
|
|
429
|
+
'unknowns',
|
|
430
|
+
]) || manifest.schema !== 'lattice.boundary_manifest.v1'
|
|
431
|
+
|| !digest(manifest.plan_input_digest)) {
|
|
432
|
+
return false;
|
|
433
|
+
}
|
|
434
|
+
if (!exactRecord(manifest.source, [
|
|
435
|
+
'code_snapshot_digest',
|
|
436
|
+
'query_set_digest',
|
|
437
|
+
'manual_evidence_digest',
|
|
438
|
+
'codegraph_version',
|
|
439
|
+
])
|
|
440
|
+
|| !digest(manifest.source.code_snapshot_digest)
|
|
441
|
+
|| !digest(manifest.source.query_set_digest)
|
|
442
|
+
|| !digest(manifest.source.manual_evidence_digest)
|
|
443
|
+
|| !boundedText(manifest.source.codegraph_version, 128)) {
|
|
444
|
+
return false;
|
|
445
|
+
}
|
|
446
|
+
if (!boundedArray(manifest.graph_evidence, graphEvidence, { min: 1 })
|
|
447
|
+
|| !boundedArray(manifest.manual_evidence, manualEvidence, { min: 1 })
|
|
448
|
+
|| !boundedArray(manifest.todos, manifestTodo, { min: 1 })
|
|
449
|
+
|| !boundedArray(manifest.conflicts, manifestConflict)
|
|
450
|
+
|| !uniqueStrings(manifest.unknowns)) {
|
|
451
|
+
return false;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
const graphEvidenceIds = new Set(manifest.graph_evidence.map((entry) => entry.id));
|
|
455
|
+
const manualEvidenceIds = new Set(manifest.manual_evidence.map((entry) => entry.id));
|
|
456
|
+
const evidenceIds = new Set([...graphEvidenceIds, ...manualEvidenceIds]);
|
|
457
|
+
const todoIds = new Set(manifest.todos.map((todo) => todo.id));
|
|
458
|
+
const conflictIds = new Set(manifest.conflicts.map((conflict) => conflict.id));
|
|
459
|
+
const manualTodoIds = new Set(manifest.manual_evidence.map((entry) => entry.todo_id));
|
|
460
|
+
if (graphEvidenceIds.size !== manifest.graph_evidence.length
|
|
461
|
+
|| manualEvidenceIds.size !== manifest.manual_evidence.length
|
|
462
|
+
|| evidenceIds.size !== graphEvidenceIds.size + manualEvidenceIds.size
|
|
463
|
+
|| todoIds.size !== manifest.todos.length
|
|
464
|
+
|| conflictIds.size !== manifest.conflicts.length
|
|
465
|
+
|| manualTodoIds.size !== manifest.manual_evidence.length
|
|
466
|
+
|| manualTodoIds.size !== todoIds.size
|
|
467
|
+
|| manifest.manual_evidence.some((entry) => !todoIds.has(entry.todo_id))) {
|
|
468
|
+
return false;
|
|
469
|
+
}
|
|
470
|
+
const manualByTodo = new Map(manifest.manual_evidence
|
|
471
|
+
.map((entry) => [entry.todo_id, entry.id]));
|
|
472
|
+
for (const todo of manifest.todos) {
|
|
473
|
+
if (todo.hard_needs.some((id) => id === todo.id || !todoIds.has(id))
|
|
474
|
+
|| todo.conflict_ids.some((id) => !conflictIds.has(id))
|
|
475
|
+
|| todo.evidence_refs.some((id) => !evidenceIds.has(id))
|
|
476
|
+
|| !todo.evidence_refs.includes(manualByTodo.get(todo.id))) {
|
|
477
|
+
return false;
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
for (const conflict of manifest.conflicts) {
|
|
481
|
+
const conflictResource = resourceKey(conflict.resource);
|
|
482
|
+
const requiresManualEvidence = conflict.kind === 'state'
|
|
483
|
+
|| conflict.kind === 'effect'
|
|
484
|
+
|| conflict.kind === 'dynamic_unknown';
|
|
485
|
+
if (conflict.todo_ids.some((id) => !todoIds.has(id))
|
|
486
|
+
|| conflict.evidence_refs.some((id) => !evidenceIds.has(id))
|
|
487
|
+
|| (conflict.kind === 'write_boundary'
|
|
488
|
+
&& !conflict.evidence_refs.some((id) => graphEvidenceIds.has(id)))
|
|
489
|
+
|| (requiresManualEvidence && conflict.todo_ids
|
|
490
|
+
.some((id) => !conflict.evidence_refs.includes(manualByTodo.get(id))))
|
|
491
|
+
|| conflict.todo_ids.some((id) => {
|
|
492
|
+
const todo = manifest.todos.find((entry) => entry.id === id);
|
|
493
|
+
const relevantResources = conflict.kind === 'write_boundary'
|
|
494
|
+
? todo.writes
|
|
495
|
+
: [...todo.owns, ...todo.reads, ...todo.writes];
|
|
496
|
+
return !todo.conflict_ids.includes(conflict.id)
|
|
497
|
+
|| !relevantResources.some((entry) => resourceKey(entry) === conflictResource);
|
|
498
|
+
})) {
|
|
499
|
+
return false;
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
return true;
|
|
503
|
+
});
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
function seamCandidate(value, todoIds) {
|
|
507
|
+
const ownedKinds = new Set(['symbol', 'path']);
|
|
508
|
+
if (!exactRecord(value, ['id', 'proposed_owns', 'preconditions'])
|
|
509
|
+
|| !identifier(value.id)
|
|
510
|
+
|| !boundedArray(value.proposed_owns, (entry) => exactRecord(entry, ['todo_id', 'resources'])
|
|
511
|
+
&& identifier(entry.todo_id)
|
|
512
|
+
&& resources(entry.resources, { min: 1, allowedKinds: ownedKinds }), { min: 1 })
|
|
513
|
+
|| !uniqueStrings(value.preconditions, boundedText, { min: 1 })) {
|
|
514
|
+
return false;
|
|
515
|
+
}
|
|
516
|
+
const proposedIds = value.proposed_owns.map((entry) => entry.todo_id);
|
|
517
|
+
const proposedResources = value.proposed_owns
|
|
518
|
+
.flatMap((entry) => entry.resources.map(resourceKey));
|
|
519
|
+
return new Set(proposedIds).size === proposedIds.length
|
|
520
|
+
&& proposedIds.length === todoIds.length
|
|
521
|
+
&& proposedIds.every((id) => todoIds.includes(id))
|
|
522
|
+
&& new Set(proposedResources).size === proposedResources.length;
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
function verdict(value) {
|
|
526
|
+
if (!exactRecord(value, [
|
|
527
|
+
'id',
|
|
528
|
+
'todo_ids',
|
|
529
|
+
'verdict',
|
|
530
|
+
'conflict_ids',
|
|
531
|
+
'seam_candidate',
|
|
532
|
+
'reasons',
|
|
533
|
+
'unknowns',
|
|
534
|
+
])
|
|
535
|
+
|| !identifier(value.id)
|
|
536
|
+
|| !uniqueStrings(value.todo_ids, identifier, { min: 2, max: 2 })
|
|
537
|
+
|| !VERDICTS.has(value.verdict)
|
|
538
|
+
|| !uniqueStrings(value.conflict_ids, identifier)
|
|
539
|
+
|| !uniqueStrings(value.reasons, boundedText, { min: 1 })
|
|
540
|
+
|| !uniqueStrings(value.unknowns)) {
|
|
541
|
+
return false;
|
|
542
|
+
}
|
|
543
|
+
if (value.verdict === 'seam_candidate') {
|
|
544
|
+
return value.conflict_ids.length > 0 && seamCandidate(value.seam_candidate, value.todo_ids);
|
|
545
|
+
}
|
|
546
|
+
if (value.seam_candidate !== null) return false;
|
|
547
|
+
if (value.verdict === 'parallel_ready') {
|
|
548
|
+
return value.conflict_ids.length === 0 && value.unknowns.length === 0;
|
|
549
|
+
}
|
|
550
|
+
return value.verdict !== 'unknown_requires_evidence' || value.unknowns.length > 0;
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
/** @param {unknown} value @returns {boolean} */
|
|
554
|
+
export function validateBoundaryVerdict(value) {
|
|
555
|
+
return validateSafely(value, (artifact) => exactRecord(artifact, [
|
|
556
|
+
'schema',
|
|
557
|
+
'boundary_manifest_digest',
|
|
558
|
+
'verdicts',
|
|
559
|
+
])
|
|
560
|
+
&& artifact.schema === 'lattice.boundary_verdict.v1'
|
|
561
|
+
&& digest(artifact.boundary_manifest_digest)
|
|
562
|
+
&& boundedArray(artifact.verdicts, verdict, { min: 1 })
|
|
563
|
+
&& new Set(artifact.verdicts.map((entry) => entry.id)).size === artifact.verdicts.length);
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
function planNode(value) {
|
|
567
|
+
const ownedKinds = new Set(['symbol', 'path']);
|
|
568
|
+
return exactRecord(value, ['id', 'outcome', 'owned_boundaries'])
|
|
569
|
+
&& identifier(value.id)
|
|
570
|
+
&& boundedText(value.outcome)
|
|
571
|
+
&& resources(value.owned_boundaries, { min: 1, allowedKinds: ownedKinds });
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
function planEdge(value) {
|
|
575
|
+
return exactRecord(value, ['id', 'from', 'to', 'kind', 'evidence_refs'])
|
|
576
|
+
&& identifier(value.id)
|
|
577
|
+
&& identifier(value.from)
|
|
578
|
+
&& identifier(value.to)
|
|
579
|
+
&& value.from !== value.to
|
|
580
|
+
&& EDGE_KINDS.has(value.kind)
|
|
581
|
+
&& uniqueStrings(value.evidence_refs, identifier, { min: 1 });
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
function planJoin(value) {
|
|
585
|
+
return exactRecord(value, ['id', 'after', 'before'])
|
|
586
|
+
&& identifier(value.id)
|
|
587
|
+
&& uniqueStrings(value.after, identifier, { min: 1 })
|
|
588
|
+
&& identifier(value.before)
|
|
589
|
+
&& !value.after.includes(value.before);
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
/** @param {unknown} value @returns {boolean} */
|
|
593
|
+
export function validatePlanGraph(value) {
|
|
594
|
+
return validateSafely(value, (graph) => {
|
|
595
|
+
if (!exactRecord(graph, [
|
|
596
|
+
'schema',
|
|
597
|
+
'plan_version',
|
|
598
|
+
'source_manifest_digest',
|
|
599
|
+
'capacity',
|
|
600
|
+
'nodes',
|
|
601
|
+
'edges',
|
|
602
|
+
'joins',
|
|
603
|
+
'waves',
|
|
604
|
+
'minimum_feasible_waves',
|
|
605
|
+
])
|
|
606
|
+
|| graph.schema !== 'lattice.plan_graph.v1'
|
|
607
|
+
|| !identifier(graph.plan_version)
|
|
608
|
+
|| !digest(graph.source_manifest_digest)
|
|
609
|
+
|| !exactRecord(graph.capacity, ['writers'])
|
|
610
|
+
|| !positiveInteger(graph.capacity.writers)
|
|
611
|
+
|| graph.capacity.writers > 64
|
|
612
|
+
|| !boundedArray(graph.nodes, planNode, { min: 1 })
|
|
613
|
+
|| !boundedArray(graph.edges, planEdge)
|
|
614
|
+
|| !boundedArray(graph.joins, planJoin)
|
|
615
|
+
|| !boundedArray(graph.waves, (wave) => exactRecord(wave, ['index', 'todo_ids'])
|
|
616
|
+
&& nonNegativeInteger(wave.index)
|
|
617
|
+
&& uniqueStrings(wave.todo_ids, identifier, { min: 1 }))
|
|
618
|
+
|| !positiveInteger(graph.minimum_feasible_waves)) {
|
|
619
|
+
return false;
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
const nodeIds = new Set(graph.nodes.map((node) => node.id));
|
|
623
|
+
if (nodeIds.size !== graph.nodes.length
|
|
624
|
+
|| new Set(graph.edges.map((edge) => edge.id)).size !== graph.edges.length
|
|
625
|
+
|| new Set(graph.joins.map((join) => join.id)).size !== graph.joins.length
|
|
626
|
+
|| graph.edges.some((edge) => !nodeIds.has(edge.from) || !nodeIds.has(edge.to))
|
|
627
|
+
|| graph.joins.some((join) => !nodeIds.has(join.before)
|
|
628
|
+
|| join.after.some((id) => !nodeIds.has(id)))) {
|
|
629
|
+
return false;
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
const scheduled = [];
|
|
633
|
+
const waveByTodo = new Map();
|
|
634
|
+
for (let index = 0; index < graph.waves.length; index += 1) {
|
|
635
|
+
const wave = graph.waves[index];
|
|
636
|
+
if (wave.index !== index
|
|
637
|
+
|| wave.todo_ids.length > graph.capacity.writers
|
|
638
|
+
|| wave.todo_ids.some((id) => !nodeIds.has(id))) {
|
|
639
|
+
return false;
|
|
640
|
+
}
|
|
641
|
+
scheduled.push(...wave.todo_ids);
|
|
642
|
+
for (const id of wave.todo_ids) waveByTodo.set(id, index);
|
|
643
|
+
}
|
|
644
|
+
if (graph.minimum_feasible_waves !== graph.waves.length
|
|
645
|
+
|| scheduled.length !== graph.nodes.length
|
|
646
|
+
|| new Set(scheduled).size !== scheduled.length
|
|
647
|
+
|| graph.edges.some((edge) => waveByTodo.get(edge.from) >= waveByTodo.get(edge.to))
|
|
648
|
+
|| graph.joins.some((join) => join.after
|
|
649
|
+
.some((id) => waveByTodo.get(id) >= waveByTodo.get(join.before)))) {
|
|
650
|
+
return false;
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
const ownedByTodo = new Map(graph.nodes.map((node) => [
|
|
654
|
+
node.id,
|
|
655
|
+
new Set(node.owned_boundaries.map(resourceKey)),
|
|
656
|
+
]));
|
|
657
|
+
for (let leftIndex = 0; leftIndex < graph.nodes.length; leftIndex += 1) {
|
|
658
|
+
for (let rightIndex = leftIndex + 1; rightIndex < graph.nodes.length; rightIndex += 1) {
|
|
659
|
+
const left = graph.nodes[leftIndex].id;
|
|
660
|
+
const right = graph.nodes[rightIndex].id;
|
|
661
|
+
const overlaps = [...ownedByTodo.get(left)].some((key) => ownedByTodo.get(right).has(key));
|
|
662
|
+
const hasConflictEdge = graph.edges.some((edge) => edge.kind === 'write_conflict'
|
|
663
|
+
&& ((edge.from === left && edge.to === right)
|
|
664
|
+
|| (edge.from === right && edge.to === left)));
|
|
665
|
+
if (overlaps !== hasConflictEdge) return false;
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
return true;
|
|
669
|
+
});
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
function planDescriptor(value) {
|
|
673
|
+
return exactRecord(value, ['version', 'digest'])
|
|
674
|
+
&& identifier(value.version)
|
|
675
|
+
&& digest(value.digest);
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
function sortedPaths(value, { min = 0 } = {}) {
|
|
679
|
+
return uniqueStrings(value, (entry) => repoPath(entry), { min })
|
|
680
|
+
&& value.every((entry, index) => index === 0 || value[index - 1] < entry);
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
function transformSource(value) {
|
|
684
|
+
return exactRecord(value, [
|
|
685
|
+
'base_sha',
|
|
686
|
+
'boundary_manifest_digest',
|
|
687
|
+
'boundary_verdict_digest',
|
|
688
|
+
'control_plan_digest',
|
|
689
|
+
'query_set_digest',
|
|
690
|
+
'code_snapshot_digest',
|
|
691
|
+
])
|
|
692
|
+
&& typeof value.base_sha === 'string'
|
|
693
|
+
&& SHA1.test(value.base_sha)
|
|
694
|
+
&& digest(value.boundary_manifest_digest)
|
|
695
|
+
&& digest(value.boundary_verdict_digest)
|
|
696
|
+
&& digest(value.control_plan_digest)
|
|
697
|
+
&& digest(value.query_set_digest)
|
|
698
|
+
&& digest(value.code_snapshot_digest);
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
function verificationReceipt(value) {
|
|
702
|
+
return exactRecord(value, [
|
|
703
|
+
'id',
|
|
704
|
+
'command',
|
|
705
|
+
'args',
|
|
706
|
+
'outcome',
|
|
707
|
+
'exit_code',
|
|
708
|
+
'stdout_digest',
|
|
709
|
+
'stderr_digest',
|
|
710
|
+
])
|
|
711
|
+
&& identifier(value.id)
|
|
712
|
+
&& boundedText(value.command, 512)
|
|
713
|
+
&& boundedArray(value.args, (entry) => boundedText(entry, 1_024))
|
|
714
|
+
&& RECEIPT_OUTCOMES.has(value.outcome)
|
|
715
|
+
&& nonNegativeInteger(value.exit_code)
|
|
716
|
+
&& digest(value.stdout_digest)
|
|
717
|
+
&& digest(value.stderr_digest);
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
function transformVerification(value) {
|
|
721
|
+
if (!exactRecord(value, ['status', 'digest', 'receipts'])
|
|
722
|
+
|| !VERIFICATION_STATUSES.has(value.status)
|
|
723
|
+
|| !digest(value.digest)
|
|
724
|
+
|| !boundedArray(value.receipts, verificationReceipt)
|
|
725
|
+
|| new Set(value.receipts.map(({ id }) => id)).size !== value.receipts.length
|
|
726
|
+
|| value.digest !== digestArtifact({ status: value.status, receipts: value.receipts })) {
|
|
727
|
+
return false;
|
|
728
|
+
}
|
|
729
|
+
if (value.status === 'passed') {
|
|
730
|
+
return value.receipts.length > 0
|
|
731
|
+
&& value.receipts.every((receipt) => receipt.outcome === 'passed' && receipt.exit_code === 0);
|
|
732
|
+
}
|
|
733
|
+
if (value.status === 'not_run') return value.receipts.length === 0;
|
|
734
|
+
return value.receipts.length > 0;
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
function outputFile(value) {
|
|
738
|
+
return exactRecord(value, ['path', 'content_digest'])
|
|
739
|
+
&& repoPath(value.path)
|
|
740
|
+
&& digest(value.content_digest);
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
function transformOutput(value, changedPaths) {
|
|
744
|
+
if (!exactRecord(value, ['snapshot_digest', 'files'])
|
|
745
|
+
|| !boundedArray(value.files, outputFile)
|
|
746
|
+
|| new Set(value.files.map(({ path }) => path)).size !== value.files.length
|
|
747
|
+
|| value.files.some((entry, index) => index > 0 && value.files[index - 1].path >= entry.path)) {
|
|
748
|
+
return false;
|
|
749
|
+
}
|
|
750
|
+
if (value.files.length === 0) return value.snapshot_digest === null;
|
|
751
|
+
return digest(value.snapshot_digest)
|
|
752
|
+
&& value.snapshot_digest === digestArtifact({ files: value.files })
|
|
753
|
+
&& value.files.length === changedPaths.length
|
|
754
|
+
&& value.files.every((entry, index) => entry.path === changedPaths[index]);
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
function transformRejection(value) {
|
|
758
|
+
return exactRecord(value, ['kind', 'reasons', 'evidence_digest'])
|
|
759
|
+
&& TRANSFORM_REJECTION_KINDS.has(value.kind)
|
|
760
|
+
&& uniqueStrings(value.reasons, boundedText, { min: 1 })
|
|
761
|
+
&& digest(value.evidence_digest)
|
|
762
|
+
&& value.evidence_digest === digestArtifact({ kind: value.kind, reasons: value.reasons });
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
/** @param {unknown} value @returns {boolean} */
|
|
766
|
+
export function validateTransformArtifact(value) {
|
|
767
|
+
return validateSafely(value, (artifact) => {
|
|
768
|
+
if (!exactRecord(artifact, [
|
|
769
|
+
'schema',
|
|
770
|
+
'candidate_id',
|
|
771
|
+
'status',
|
|
772
|
+
'source',
|
|
773
|
+
'scope',
|
|
774
|
+
'patch',
|
|
775
|
+
'verification',
|
|
776
|
+
'output',
|
|
777
|
+
'cleanup',
|
|
778
|
+
'rejection',
|
|
779
|
+
'unknowns',
|
|
780
|
+
])
|
|
781
|
+
|| artifact.schema !== 'lattice.transform_artifact.v1'
|
|
782
|
+
|| !identifier(artifact.candidate_id)
|
|
783
|
+
|| !TRANSFORM_STATUSES.has(artifact.status)
|
|
784
|
+
|| !transformSource(artifact.source)
|
|
785
|
+
|| !exactRecord(artifact.scope, ['allowed_paths', 'changed_paths'])
|
|
786
|
+
|| !sortedPaths(artifact.scope.allowed_paths, { min: 1 })
|
|
787
|
+
|| !sortedPaths(artifact.scope.changed_paths)
|
|
788
|
+
|| artifact.scope.changed_paths.some((entry) => !artifact.scope.allowed_paths.includes(entry))
|
|
789
|
+
|| !exactRecord(artifact.patch, ['digest', 'bytes'])
|
|
790
|
+
|| !((artifact.patch.digest === null && artifact.patch.bytes === 0)
|
|
791
|
+
|| (digest(artifact.patch.digest) && positiveInteger(artifact.patch.bytes)))
|
|
792
|
+
|| !transformVerification(artifact.verification)
|
|
793
|
+
|| !transformOutput(artifact.output, artifact.scope.changed_paths)
|
|
794
|
+
|| !exactRecord(artifact.cleanup, ['status', 'source_status'])
|
|
795
|
+
|| !CLEANUP_STATUSES.has(artifact.cleanup.status)
|
|
796
|
+
|| !SOURCE_STATUSES.has(artifact.cleanup.source_status)
|
|
797
|
+
|| !uniqueStrings(artifact.unknowns)) {
|
|
798
|
+
return false;
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
if (artifact.status === 'accepted') {
|
|
802
|
+
return artifact.rejection === null
|
|
803
|
+
&& artifact.scope.changed_paths.length > 0
|
|
804
|
+
&& digest(artifact.patch.digest)
|
|
805
|
+
&& positiveInteger(artifact.patch.bytes)
|
|
806
|
+
&& artifact.verification.status === 'passed'
|
|
807
|
+
&& artifact.output.files.length === artifact.scope.changed_paths.length
|
|
808
|
+
&& artifact.cleanup.status === 'passed'
|
|
809
|
+
&& artifact.cleanup.source_status === 'unchanged';
|
|
810
|
+
}
|
|
811
|
+
return transformRejection(artifact.rejection)
|
|
812
|
+
&& artifact.verification.status !== 'passed';
|
|
813
|
+
});
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
function changeSet(value, keys) {
|
|
817
|
+
return exactRecord(value, keys)
|
|
818
|
+
&& keys.every((key) => uniqueStrings(value[key], identifier));
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
function invalidatedContext(value) {
|
|
822
|
+
return exactRecord(value, ['kind', 'ref', 'reason'])
|
|
823
|
+
&& INVALIDATION_KINDS.has(value.kind)
|
|
824
|
+
&& boundedText(value.ref, 512)
|
|
825
|
+
&& boundedText(value.reason);
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
function metricSet(value) {
|
|
829
|
+
const keys = [
|
|
830
|
+
'write_conflicts_before',
|
|
831
|
+
'write_conflicts_after',
|
|
832
|
+
'hard_precedence_before',
|
|
833
|
+
'hard_precedence_after',
|
|
834
|
+
'minimum_feasible_waves_before',
|
|
835
|
+
'minimum_feasible_waves_after',
|
|
836
|
+
];
|
|
837
|
+
return exactRecord(value, keys)
|
|
838
|
+
&& keys.every((key) => nonNegativeInteger(value[key]))
|
|
839
|
+
&& value.minimum_feasible_waves_before >= 1
|
|
840
|
+
&& value.minimum_feasible_waves_after >= 1;
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
/** @param {unknown} value @returns {boolean} */
|
|
844
|
+
export function validatePlanDiff(value) {
|
|
845
|
+
return validateSafely(value, (diff) => {
|
|
846
|
+
if (!exactRecord(diff, [
|
|
847
|
+
'schema',
|
|
848
|
+
'old_plan',
|
|
849
|
+
'new_plan',
|
|
850
|
+
'transform',
|
|
851
|
+
'query_set_digest',
|
|
852
|
+
'snapshots',
|
|
853
|
+
'nodes',
|
|
854
|
+
'edges',
|
|
855
|
+
'invalidated_contexts',
|
|
856
|
+
'metrics',
|
|
857
|
+
])
|
|
858
|
+
|| diff.schema !== 'lattice.plan_diff.v1'
|
|
859
|
+
|| !planDescriptor(diff.old_plan)
|
|
860
|
+
|| !planDescriptor(diff.new_plan)
|
|
861
|
+
|| diff.old_plan.version === diff.new_plan.version
|
|
862
|
+
|| diff.old_plan.digest === diff.new_plan.digest
|
|
863
|
+
|| !exactRecord(diff.transform, [
|
|
864
|
+
'status',
|
|
865
|
+
'artifact_digest',
|
|
866
|
+
'patch_digest',
|
|
867
|
+
'verification_digest',
|
|
868
|
+
'changed_paths',
|
|
869
|
+
])
|
|
870
|
+
|| diff.transform.status !== 'accepted'
|
|
871
|
+
|| !digest(diff.transform.artifact_digest)
|
|
872
|
+
|| !digest(diff.transform.patch_digest)
|
|
873
|
+
|| !digest(diff.transform.verification_digest)
|
|
874
|
+
|| !uniqueStrings(diff.transform.changed_paths, (entry) => repoPath(entry), { min: 1 })
|
|
875
|
+
|| !digest(diff.query_set_digest)
|
|
876
|
+
|| !exactRecord(diff.snapshots, ['before_digest', 'after_digest'])
|
|
877
|
+
|| !digest(diff.snapshots.before_digest)
|
|
878
|
+
|| !digest(diff.snapshots.after_digest)
|
|
879
|
+
|| diff.snapshots.before_digest === diff.snapshots.after_digest
|
|
880
|
+
|| !changeSet(diff.nodes, ['added', 'removed', 'changed'])
|
|
881
|
+
|| !changeSet(diff.edges, ['added', 'removed'])
|
|
882
|
+
|| !disjoint(diff.nodes.added, diff.nodes.removed, diff.nodes.changed)
|
|
883
|
+
|| !disjoint(diff.edges.added, diff.edges.removed)
|
|
884
|
+
|| !boundedArray(diff.invalidated_contexts, invalidatedContext, { min: 1 })
|
|
885
|
+
|| new Set(diff.invalidated_contexts
|
|
886
|
+
.map((entry) => `${entry.kind}\u0000${entry.ref}`)).size !== diff.invalidated_contexts.length
|
|
887
|
+
|| !diff.invalidated_contexts.some((entry) => entry.kind === 'old_plan'
|
|
888
|
+
&& entry.ref === diff.old_plan.version)
|
|
889
|
+
|| !metricSet(diff.metrics)) {
|
|
890
|
+
return false;
|
|
891
|
+
}
|
|
892
|
+
return diff.nodes.added.length + diff.nodes.removed.length + diff.nodes.changed.length
|
|
893
|
+
+ diff.edges.added.length + diff.edges.removed.length > 0;
|
|
894
|
+
});
|
|
895
|
+
}
|