scip-query 0.20.0 → 0.21.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +81 -0
- package/README.md +255 -884
- package/dist/augment-vue-worker.js +1 -1
- package/dist/by-kind-XXGZGNZ6.js +2 -0
- package/dist/call-graph-VGY3R4L3.js +2 -0
- package/dist/call-graph-evidence-lZa2dwQA.d.ts +11 -0
- package/dist/change-analysis-types-CCtoCHbC.d.ts +9 -0
- package/dist/chunk-26CT72HM.js +2 -0
- package/dist/chunk-27OUNZW5.js +3 -0
- package/dist/chunk-2LJLEM5B.js +2 -0
- package/dist/chunk-3KXFB2FM.js +2 -0
- package/dist/chunk-3T5U2EQ2.js +2 -0
- package/dist/chunk-3TNRNKAT.js +2 -0
- package/dist/{chunk-PXY7F6Y4.js → chunk-3XQLJG7V.js} +5 -5
- package/dist/chunk-3XZELASU.js +2 -0
- package/dist/chunk-3YETOKNO.js +4 -0
- package/dist/chunk-47WX6UC4.js +2 -0
- package/dist/{chunk-7SQQWSY3.js → chunk-4HQYNZ3P.js} +2 -2
- package/dist/chunk-4IASLUOP.js +3 -0
- package/dist/{chunk-KMKTIO2G.js → chunk-4KIPF45P.js} +2 -2
- package/dist/chunk-4SZJF4GK.js +2 -0
- package/dist/chunk-4TOU7HHQ.js +2 -0
- package/dist/chunk-4ZCLDH6T.js +11 -0
- package/dist/{chunk-DQGFVPUV.js → chunk-527HV7JY.js} +3 -3
- package/dist/{chunk-ZTETIQ35.js → chunk-5BJPJUXF.js} +2 -2
- package/dist/chunk-5J3A6RBZ.js +16 -0
- package/dist/chunk-5KIJMEPC.js +2 -0
- package/dist/{chunk-JDOEX4E6.js → chunk-5QM7QT5B.js} +2 -2
- package/dist/chunk-5Z2H76VD.js +11 -0
- package/dist/chunk-63TFRBMB.js +2 -0
- package/dist/chunk-67FK5KGV.js +3 -0
- package/dist/chunk-6DO3VBLV.js +2 -0
- package/dist/chunk-6LS3IG2I.js +13 -0
- package/dist/chunk-6QN4FYQW.js +2 -0
- package/dist/chunk-6X4KO5A7.js +11 -0
- package/dist/chunk-743MEVFJ.js +8 -0
- package/dist/chunk-7G2WIVIX.js +2 -0
- package/dist/chunk-7KCZELVM.js +2 -0
- package/dist/chunk-7MUHSZGN.js +3 -0
- package/dist/chunk-7YZGSLW6.js +3 -0
- package/dist/chunk-7Z4GMCHM.js +117 -0
- package/dist/{chunk-32LVLCLN.js → chunk-AAOEROT3.js} +3 -3
- package/dist/chunk-AFRS7WJU.js +26 -0
- package/dist/chunk-ANCHW2R4.js +57 -0
- package/dist/{chunk-SXP2MBJH.js → chunk-AQF35NGT.js} +2 -2
- package/dist/chunk-ARGPDW2Y.js +6 -0
- package/dist/chunk-B3AREUQK.js +16 -0
- package/dist/chunk-BCTCADNB.js +2 -0
- package/dist/chunk-BM4OTGSY.js +3 -0
- package/dist/chunk-BMKTDJI6.js +16 -0
- package/dist/chunk-BOJ5SVE2.js +2 -0
- package/dist/{chunk-WXZLAAWK.js → chunk-BVR44XXB.js} +2 -2
- package/dist/{chunk-RUJURYSV.js → chunk-BYXWXLKM.js} +2 -2
- package/dist/chunk-BZCRHP46.js +3 -0
- package/dist/chunk-BZYSGZRK.js +2 -0
- package/dist/chunk-C52Q3JEQ.js +2 -0
- package/dist/chunk-C7WSQA6A.js +21 -0
- package/dist/{chunk-BDCC2NPY.js → chunk-CNT4ND5O.js} +2 -2
- package/dist/chunk-CQVDALWQ.js +2 -0
- package/dist/chunk-CTO3TRX7.js +2 -0
- package/dist/chunk-CXT3GZSQ.js +2 -0
- package/dist/{chunk-JVYA47YU.js → chunk-DGM2RJ3I.js} +2 -2
- package/dist/{chunk-7PIO7NKH.js → chunk-DK6MB565.js} +2 -2
- package/dist/chunk-DNPETNXT.js +2 -0
- package/dist/chunk-DRENNWRG.js +2 -0
- package/dist/chunk-DUDUIT5P.js +2 -0
- package/dist/chunk-DXEJ4FLZ.js +21 -0
- package/dist/chunk-DXYMTQZ4.js +2 -0
- package/dist/chunk-DZA7MQMU.js +6 -0
- package/dist/{chunk-ZHXX42OH.js → chunk-DZNWXJN2.js} +4 -4
- package/dist/{chunk-CJST5ETY.js → chunk-E6N6YTVM.js} +2 -2
- package/dist/chunk-E7CJ6O72.js +2 -0
- package/dist/chunk-EJHNTAEE.js +2 -0
- package/dist/chunk-EPLE5O5O.js +2 -0
- package/dist/chunk-F4FNK44D.js +2 -0
- package/dist/chunk-FCGMQETU.js +2 -0
- package/dist/chunk-FIO44MVK.js +3 -0
- package/dist/chunk-FLSVYEPL.js +2 -0
- package/dist/chunk-FOP7HD6H.js +3 -0
- package/dist/chunk-FSPENGSU.js +4 -0
- package/dist/chunk-FUUDUAKM.js +2 -0
- package/dist/chunk-FYCH2EYQ.js +2 -0
- package/dist/{chunk-5E4WNAVD.js → chunk-G47MFF47.js} +2 -2
- package/dist/chunk-G6VV7ROY.js +2 -0
- package/dist/chunk-GBZCVYWA.js +2 -0
- package/dist/chunk-GSHTVE56.js +3 -0
- package/dist/chunk-GTZFKDP3.js +2 -0
- package/dist/{chunk-2HPVVXM5.js → chunk-H2RBDP5S.js} +2 -2
- package/dist/chunk-H5EXS3HM.js +2 -0
- package/dist/chunk-HR5JYLVV.js +4 -0
- package/dist/chunk-HW7FASEL.js +2 -0
- package/dist/chunk-HYU4W353.js +10 -0
- package/dist/{chunk-FKSELJQF.js → chunk-I2LY3KN7.js} +2 -2
- package/dist/chunk-IGBQVEHE.js +2 -0
- package/dist/{chunk-3G66UZBH.js → chunk-IH3K5J6K.js} +2 -2
- package/dist/chunk-IHGK3SZ7.js +29 -0
- package/dist/chunk-IM23CSG5.js +2 -0
- package/dist/chunk-IQMGNIGY.js +2 -0
- package/dist/chunk-ITF3CWS5.js +2 -0
- package/dist/chunk-IZKJQQCQ.js +3 -0
- package/dist/chunk-J4HUBIVF.js +5 -0
- package/dist/{chunk-AZJQQKDD.js → chunk-JGMD6JGB.js} +2 -2
- package/dist/chunk-JLZWYDCZ.js +4 -0
- package/dist/chunk-JO6FK3Q5.js +2 -0
- package/dist/chunk-JSHDCVUM.js +81 -0
- package/dist/chunk-K2DZCH2K.js +2 -0
- package/dist/chunk-K63CAPS2.js +23 -0
- package/dist/chunk-KBIC6JHJ.js +2 -0
- package/dist/chunk-KFFQURUZ.js +2 -0
- package/dist/chunk-KFOYCQAJ.js +9 -0
- package/dist/chunk-KGKCJFWZ.js +6 -0
- package/dist/chunk-KK7GPALL.js +28 -0
- package/dist/chunk-L7WRUNKJ.js +2 -0
- package/dist/{chunk-W4ETQAXM.js → chunk-LFWB7TOJ.js} +2 -2
- package/dist/chunk-LGVTIZPV.js +61 -0
- package/dist/chunk-LIWIV26I.js +29 -0
- package/dist/chunk-LJMWILX6.js +3 -0
- package/dist/{chunk-BPAPWKP6.js → chunk-LXMW6ZAX.js} +8 -8
- package/dist/chunk-MFBVUQJZ.js +2 -0
- package/dist/{chunk-O64IZ6UX.js → chunk-MLTKGHD2.js} +2 -2
- package/dist/chunk-MLTSTKXD.js +5 -0
- package/dist/chunk-MR4ZKWO6.js +57 -0
- package/dist/{chunk-EN3O7VJA.js → chunk-MRXBLYRE.js} +2 -2
- package/dist/chunk-MXNGIEPU.js +3 -0
- package/dist/chunk-N4EFQIRX.js +20 -0
- package/dist/chunk-ND3BWIVN.js +7 -0
- package/dist/chunk-NODZYYGC.js +2 -0
- package/dist/chunk-NP4JFCLE.js +133 -0
- package/dist/chunk-NQXWWE6S.js +8 -0
- package/dist/chunk-NSDPPUDY.js +7 -0
- package/dist/chunk-NT4NVEHU.js +18 -0
- package/dist/chunk-O2VY47Y5.js +325 -0
- package/dist/chunk-O3EX5STE.js +5 -0
- package/dist/chunk-O4PZFAXA.js +3 -0
- package/dist/chunk-OA2BO4DR.js +2 -0
- package/dist/chunk-OFZVFIDF.js +3 -0
- package/dist/{chunk-PQCI4SQX.js → chunk-OG5UK2K7.js} +2 -2
- package/dist/chunk-OMVNRPST.js +2 -0
- package/dist/{chunk-7BAVHKMJ.js → chunk-OU6SDWAM.js} +9 -9
- package/dist/{chunk-LY4WC4AD.js → chunk-OY7PCALC.js} +2 -2
- package/dist/{chunk-A73XVBCR.js → chunk-P3UFF22M.js} +2 -2
- package/dist/chunk-PAZSBPJR.js +3 -0
- package/dist/chunk-PJBYDCBQ.js +38 -0
- package/dist/chunk-PRLU3I7G.js +79 -0
- package/dist/chunk-PU6XDQ2X.js +16 -0
- package/dist/{chunk-3CLX5EOX.js → chunk-PWEQ6CZZ.js} +2 -2
- package/dist/{chunk-XSRF6Q77.js → chunk-PX6QNUYF.js} +2 -2
- package/dist/chunk-Q4MRRB3C.js +3 -0
- package/dist/chunk-QGVUPYBC.js +35 -0
- package/dist/chunk-QH5Q6M5C.js +2 -0
- package/dist/chunk-QLWZUFDT.js +2 -0
- package/dist/chunk-QN2AI3D2.js +3 -0
- package/dist/{chunk-JAYYFEQY.js → chunk-QZCACNV5.js} +2 -2
- package/dist/chunk-RNKRYK6B.js +4 -0
- package/dist/chunk-RSUH7G5T.js +29 -0
- package/dist/chunk-RZWBTKXO.js +5 -0
- package/dist/chunk-SBFDPHKH.js +4 -0
- package/dist/{chunk-HX4GQPZP.js → chunk-SGSPCEFC.js} +3 -3
- package/dist/chunk-SIGVQT43.js +2 -0
- package/dist/chunk-SRIZDEWX.js +4 -0
- package/dist/chunk-SV2LEFVM.js +2 -0
- package/dist/chunk-T2PBOVDI.js +3 -0
- package/dist/chunk-TP2X2C2Y.js +3 -0
- package/dist/chunk-U2MNECDU.js +2 -0
- package/dist/chunk-U7DOYZDH.js +2 -0
- package/dist/chunk-UAQQR55F.js +2 -0
- package/dist/chunk-UBETC3Q2.js +2 -0
- package/dist/chunk-UEQORB2A.js +2 -0
- package/dist/chunk-UM56ZET4.js +38 -0
- package/dist/chunk-UXNXOMXJ.js +2 -0
- package/dist/{chunk-6SHPK5ZE.js → chunk-V6XENWOF.js} +2 -2
- package/dist/chunk-VJAD5WX5.js +2 -0
- package/dist/chunk-VRJG7N3I.js +453 -0
- package/dist/chunk-W7HN6V4E.js +7 -0
- package/dist/chunk-WCIKJ2E3.js +3 -0
- package/dist/chunk-WEXQYJY3.js +5 -0
- package/dist/chunk-WOPZX5GM.js +2 -0
- package/dist/chunk-WRQXLNYE.js +9 -0
- package/dist/{chunk-XKWKXZKW.js → chunk-WV6R37XV.js} +2 -2
- package/dist/{chunk-N5W4YZMK.js → chunk-WZ7V4BQV.js} +2 -2
- package/dist/chunk-WZRNEVYC.js +2 -0
- package/dist/chunk-X5MWO4DM.js +7 -0
- package/dist/chunk-XDAUYDFT.js +2 -0
- package/dist/{chunk-L7AW2QB5.js → chunk-XDOEHEET.js} +2 -2
- package/dist/chunk-XDQX6LDT.js +4 -0
- package/dist/chunk-XFRHBAIT.js +2 -0
- package/dist/chunk-XIPGCT3D.js +5 -0
- package/dist/chunk-XKM5D2XS.js +16 -0
- package/dist/chunk-XNF5T4T2.js +4 -0
- package/dist/chunk-Y2S4YNLH.js +3 -0
- package/dist/chunk-YA72ZUKO.js +2 -0
- package/dist/chunk-YBWE6J32.js +43 -0
- package/dist/chunk-YCXQQ3YB.js +2 -0
- package/dist/chunk-YDTK77JP.js +43 -0
- package/dist/chunk-YF25RQER.js +4 -0
- package/dist/chunk-YKHL4J3G.js +2 -0
- package/dist/chunk-YLNCTPOI.js +4 -0
- package/dist/chunk-YR7VRWNX.js +2 -0
- package/dist/chunk-YT4IQBET.js +3 -0
- package/dist/chunk-YUKYB54I.js +1 -0
- package/dist/chunk-Z2KGMIL4.js +2 -0
- package/dist/chunk-Z2QB75BS.js +3 -0
- package/dist/chunk-Z67JOKRE.js +554 -0
- package/dist/chunk-ZGDHC5AT.js +2 -0
- package/dist/chunk-ZMS4YCY7.js +2 -0
- package/dist/chunk-ZNW5A5VX.js +3 -0
- package/dist/{chunk-TFRAYKN6.js → chunk-ZP2WUVZ5.js} +2 -2
- package/dist/chunk-ZQUNCTEZ.js +2 -0
- package/dist/cli-main.js +8 -0
- package/dist/cli.js +1 -3
- package/dist/code-AXLJBZ6T.js +2 -0
- package/dist/code-B17qEMbt.d.ts +121 -0
- package/dist/code-result-json-CTZHAQXJ.js +2 -0
- package/dist/command-descriptors-6INSCKLW.js +342 -0
- package/dist/{config-types-jVM3D7MA.d.ts → config-types-B9B60MiR.d.ts} +199 -23
- package/dist/dataflow-AFXY423Q.js +2 -0
- package/dist/{db-B5PM5yNk.d.ts → db-BwIVAYNB.d.ts} +1 -1
- package/dist/dependence-slice-2G4X6VSJ.js +2 -0
- package/dist/deps-LMCAV5DO.js +2 -0
- package/dist/direct-navigation-2ONV22Y2.js +3 -0
- package/dist/entry-map-ZOC3VXO5.js +2 -0
- package/dist/exploration-topology-BG4v30HZ.d.ts +256 -0
- package/dist/file-dep-graph-Bqg3t3Px.d.ts +4 -0
- package/dist/file-kind-BKCVMNUf.d.ts +10 -0
- package/dist/files-WJQJLHMH.js +2 -0
- package/dist/graph-evidence-Bjyky2V4.d.ts +126 -0
- package/dist/graph-exploration-contract-CqDsnPQL.d.ts +7 -0
- package/dist/{health-Do5TKSJI.d.ts → health-CPp2Jf1Z.d.ts} +33 -34
- package/dist/hierarchy-ASNIHAX4.js +2 -0
- package/dist/imports-JICEKDKK.js +2 -0
- package/dist/index.d.ts +4 -31
- package/dist/index.js +1 -1
- package/dist/members-C5H2K3MS.js +2 -0
- package/dist/methods-KZOZHSD4.js +2 -0
- package/dist/next-anchor-candidates-BwMczMvX.d.ts +90 -0
- package/dist/output-continuation-command-NX3RH3TP.js +3 -0
- package/dist/output-pagination-3OFL2MJV.js +19 -0
- package/dist/postinstall.js +1 -1
- package/dist/project-reindex-A2SXUH2H.js +3 -0
- package/dist/queries/affected.d.ts +22 -4
- package/dist/queries/affected.js +1 -1
- package/dist/queries/anchors.d.ts +123 -0
- package/dist/queries/anchors.js +2 -0
- package/dist/queries/architecture.d.ts +3 -2
- package/dist/queries/architecture.js +1 -1
- package/dist/queries/bottlenecks.d.ts +26 -7
- package/dist/queries/bottlenecks.js +1 -1
- package/dist/queries/by-kind.d.ts +2 -2
- package/dist/queries/by-kind.js +1 -1
- package/dist/queries/call-graph.d.ts +17 -3
- package/dist/queries/call-graph.js +1 -1
- package/dist/queries/change-surface.d.ts +2 -2
- package/dist/queries/change-surface.js +1 -1
- package/dist/queries/cleanup-plan.d.ts +2 -2
- package/dist/queries/cleanup-plan.js +1 -1
- package/dist/queries/co-change.d.ts +2 -2
- package/dist/queries/co-change.js +1 -1
- package/dist/queries/code.d.ts +5 -26
- package/dist/queries/code.js +1 -1
- package/dist/queries/complexity-hotspots.d.ts +2 -2
- package/dist/queries/complexity-hotspots.js +1 -1
- package/dist/queries/complexity.d.ts +2 -2
- package/dist/queries/complexity.js +1 -1
- package/dist/queries/context.d.ts +145 -0
- package/dist/queries/context.js +2 -0
- package/dist/queries/convergence.d.ts +2 -2
- package/dist/queries/convergence.js +1 -1
- package/dist/queries/coupling.d.ts +8 -3
- package/dist/queries/coupling.js +1 -1
- package/dist/queries/cycles.d.ts +34 -7
- package/dist/queries/cycles.js +1 -1
- package/dist/queries/dataflow.d.ts +40 -14
- package/dist/queries/dataflow.js +1 -1
- package/dist/queries/dead.d.ts +2 -2
- package/dist/queries/dead.js +1 -1
- package/dist/queries/decorative-checkers.d.ts +3 -3
- package/dist/queries/decorative-checkers.js +1 -1
- package/dist/queries/deep-chains.d.ts +4 -38
- package/dist/queries/deep-chains.js +1 -1
- package/dist/queries/dependence-slice.d.ts +47 -0
- package/dist/queries/dependence-slice.js +2 -0
- package/dist/queries/dependency-depth.d.ts +49 -0
- package/dist/queries/dependency-depth.js +2 -0
- package/dist/queries/deps.d.ts +4 -2
- package/dist/queries/deps.js +1 -1
- package/dist/queries/diff-impact.d.ts +3 -3
- package/dist/queries/diff-impact.js +1 -1
- package/dist/queries/doc-drift.d.ts +4 -4
- package/dist/queries/doc-drift.js +1 -1
- package/dist/queries/drift.d.ts +2 -2
- package/dist/queries/drift.js +1 -1
- package/dist/queries/duplicate-bodies.d.ts +2 -2
- package/dist/queries/duplicate-bodies.js +1 -1
- package/dist/queries/entry-map.d.ts +121 -0
- package/dist/queries/entry-map.js +2 -0
- package/dist/queries/evidence.d.ts +70 -0
- package/dist/queries/evidence.js +2 -0
- package/dist/queries/extract-candidates.d.ts +2 -2
- package/dist/queries/extract-candidates.js +1 -1
- package/dist/queries/fan.d.ts +18 -5
- package/dist/queries/fan.js +1 -1
- package/dist/queries/files.d.ts +2 -2
- package/dist/queries/files.js +1 -1
- package/dist/queries/health.d.ts +4 -3
- package/dist/queries/health.js +1 -1
- package/dist/queries/hierarchy.d.ts +5 -3
- package/dist/queries/hierarchy.js +1 -1
- package/dist/queries/hotspots.d.ts +11 -5
- package/dist/queries/hotspots.js +1 -1
- package/dist/queries/imports.d.ts +2 -2
- package/dist/queries/imports.js +1 -1
- package/dist/queries/incomplete-migration.d.ts +4 -4
- package/dist/queries/incomplete-migration.js +1 -1
- package/dist/queries/index.d.ts +56 -136
- package/dist/queries/index.js +1 -1
- package/dist/queries/isolated.d.ts +2 -2
- package/dist/queries/isolated.js +1 -1
- package/dist/queries/locality-candidates.d.ts +2 -2
- package/dist/queries/locality-candidates.js +1 -1
- package/dist/queries/members.d.ts +2 -2
- package/dist/queries/members.js +1 -1
- package/dist/queries/methods.d.ts +2 -2
- package/dist/queries/methods.js +1 -1
- package/dist/queries/not-implemented.d.ts +3 -3
- package/dist/queries/not-implemented.js +1 -1
- package/dist/queries/outline.d.ts +2 -2
- package/dist/queries/outline.js +1 -1
- package/dist/queries/passthrough-candidates.d.ts +5 -9
- package/dist/queries/passthrough-candidates.js +1 -1
- package/dist/queries/plan-context.d.ts +27 -64
- package/dist/queries/plan-context.js +1 -1
- package/dist/queries/react-component-duplicates.d.ts +2 -2
- package/dist/queries/react-component-duplicates.js +1 -1
- package/dist/queries/react-hook-candidates.d.ts +2 -2
- package/dist/queries/react-hook-candidates.js +1 -1
- package/dist/queries/react-large-component-pressure.d.ts +2 -2
- package/dist/queries/react-large-component-pressure.js +1 -1
- package/dist/queries/recent-duplicates.d.ts +2 -2
- package/dist/queries/recent-duplicates.js +1 -1
- package/dist/queries/redundant-reexports.d.ts +2 -2
- package/dist/queries/redundant-reexports.js +1 -1
- package/dist/queries/reference-neighborhood.d.ts +4 -0
- package/dist/queries/reference-neighborhood.js +2 -0
- package/dist/queries/reference-reachability.d.ts +48 -0
- package/dist/queries/reference-reachability.js +2 -0
- package/dist/queries/refs.d.ts +2 -2
- package/dist/queries/refs.js +1 -1
- package/dist/queries/self-audit.d.ts +2 -2
- package/dist/queries/self-audit.js +1 -1
- package/dist/queries/similar-chains.d.ts +2 -2
- package/dist/queries/similar-chains.js +1 -1
- package/dist/queries/similar-files.d.ts +2 -2
- package/dist/queries/similar-files.js +1 -1
- package/dist/queries/similar-signatures.d.ts +2 -2
- package/dist/queries/similar-signatures.js +1 -1
- package/dist/queries/similar.d.ts +2 -2
- package/dist/queries/similar.js +1 -1
- package/dist/queries/slice.d.ts +3 -36
- package/dist/queries/slice.js +1 -1
- package/dist/queries/source-inspection.d.ts +209 -0
- package/dist/queries/source-inspection.js +2 -0
- package/dist/queries/source-search.d.ts +13 -0
- package/dist/queries/source-search.js +2 -0
- package/dist/queries/stale-abstractions.d.ts +2 -2
- package/dist/queries/stale-abstractions.js +1 -1
- package/dist/queries/stats.d.ts +2 -2
- package/dist/queries/surface.d.ts +13 -4
- package/dist/queries/surface.js +1 -1
- package/dist/queries/symbols.d.ts +2 -2
- package/dist/queries/symbols.js +1 -1
- package/dist/queries/system-map.d.ts +449 -0
- package/dist/queries/system-map.js +2 -0
- package/dist/queries/system.d.ts +5 -3
- package/dist/queries/system.js +1 -1
- package/dist/queries/test-quality.d.ts +2 -2
- package/dist/queries/test-quality.js +1 -1
- package/dist/queries/trace.d.ts +47 -3
- package/dist/queries/trace.js +1 -1
- package/dist/queries/twin-ab.d.ts +3 -3
- package/dist/queries/twin-ab.js +1 -1
- package/dist/queries/twin-drift.d.ts +3 -3
- package/dist/queries/twin-drift.js +1 -1
- package/dist/queries/unused-imports.d.ts +2 -2
- package/dist/queries/unused-imports.js +1 -1
- package/dist/queries/unused-params.d.ts +2 -2
- package/dist/queries/unused-params.js +1 -1
- package/dist/queries/value-flow.d.ts +43 -0
- package/dist/queries/value-flow.js +2 -0
- package/dist/queries/vue-component-duplicates.d.ts +2 -2
- package/dist/queries/vue-component-duplicates.js +1 -1
- package/dist/queries/vue-composable-candidates.d.ts +2 -2
- package/dist/queries/vue-composable-candidates.js +1 -1
- package/dist/queries/vue-large-view-pressure.d.ts +2 -2
- package/dist/queries/vue-large-view-pressure.js +1 -1
- package/dist/queries/wrapper-candidates.d.ts +2 -2
- package/dist/queries/wrapper-candidates.js +1 -1
- package/dist/query-service-fastpath.js +6 -0
- package/dist/query-service-server.js +5 -0
- package/dist/refs-ZOORVRQC.js +2 -0
- package/dist/refs-pagination-SRCUOYRD.js +2 -0
- package/dist/reindex-worker.js +85 -86
- package/dist/reindex.d.ts +64 -42
- package/dist/reindex.js +93 -77
- package/dist/repository-text-C0Q8VYdN.d.ts +19 -0
- package/dist/runtime.d.ts +287 -8
- package/dist/runtime.js +4 -3
- package/dist/rust-semantic-session-server.js +1 -1
- package/dist/rust-semantic-session-worker.js +1 -1
- package/dist/rust-semantic-worker.js +1 -1
- package/dist/{scip-cli-BnEwZRLJ.d.ts → scip-cli-H-n59izO.d.ts} +33 -2
- package/dist/slice-NOTBWA7S.js +2 -0
- package/dist/source-search-types-Dwz8KeuW.d.ts +79 -0
- package/dist/source-snippet-_wrcgmZc.d.ts +15 -0
- package/dist/stats-OOJ74B32.js +2 -0
- package/dist/surface-BTBCLKNA.js +2 -0
- package/dist/symbol-resolution-SVSMX4RN.js +2 -0
- package/dist/system-2EIUFP6B.js +2 -0
- package/dist/trace-BB2GHQPG.js +2 -0
- package/dist/typescript-mailbox-worker.js +1 -1
- package/dist/value-flow-OA7AHSUG.js +2 -0
- package/dist/watch-server.js +3 -2
- package/docs/AGENT_GUIDE.md +133 -476
- package/docs/AI_FAILURE_MODES.md +30 -301
- package/docs/API.md +1 -1
- package/docs/API_EVOLUTION.md +6 -0
- package/docs/CLI_JSON_OUTPUT.md +207 -29
- package/docs/COMMAND_REFERENCE.md +255 -154
- package/docs/CONFIGURATION_WRITE_SAFETY.md +14 -13
- package/docs/DETECTOR_EVIDENCE_CONTRACTS.md +84 -0
- package/docs/DETECTOR_GUIDE.md +46 -138
- package/docs/DURABILITY.md +7 -1
- package/docs/INDEX_GENERATIONS.md +6 -0
- package/docs/LOCK_PROTOCOL.md +8 -0
- package/docs/REINDEX_METADATA_COMPATIBILITY.md +13 -3
- package/docs/SECURITY_MODEL.md +39 -42
- package/docs/accuracy-audit-checklist.md +4 -0
- package/docs/accuracy-hardening-goal.md +9 -2
- package/docs/analyzer-inventory.md +59 -264
- package/docs/analyzer-validation-protocol.md +62 -170
- package/docs/architecture-coherence-vision.md +18 -12
- package/docs/locality-analyzer-design.md +1 -1
- package/docs/schemas/cli-json-envelope.schema.json +212 -27
- package/docs/schemas/cli-json-export-receipt.schema.json +25 -0
- package/docs/schemas/cli-output-page.schema.json +1 -1
- package/docs/schemas/observation-receipt.schema.json +164 -0
- package/docs/schemas/project-config.schema.json +37 -45
- package/docs/schemas/suppression-record.schema.json +1 -34
- package/package.json +69 -11
- package/skills/concrete-plan/SKILL.md +8 -0
- package/skills/concrete-plan/agents/openai.yaml +4 -0
- package/skills/scip-explore/SKILL.md +49 -61
- package/skills/scip-explore/agents/openai.yaml +3 -3
- package/skills/scip-explore/references/delegated-exploration.md +51 -0
- package/skills/scip-explore/references/external-evidence.md +72 -0
- package/skills/scip-explore/references/information-model.md +51 -0
- package/skills/scip-explore/scripts/capture-evidence.mjs +666 -0
- package/skills/scip-integrity-audit/SKILL.md +185 -0
- package/skills/scip-integrity-audit/agents/openai.yaml +4 -0
- package/skills/scip-plan/SKILL.md +67 -49
- package/skills/scip-plan/agents/openai.yaml +3 -3
- package/skills/scip-query/SKILL.md +98 -77
- package/skills/scip-query/agents/openai.yaml +3 -3
- package/skills/scip-setup/SKILL.md +10 -102
- package/skills/scip-setup/agents/openai.yaml +3 -3
- package/dist/chunk-26QA6FAI.js +0 -8
- package/dist/chunk-2KAZEZ6M.js +0 -2
- package/dist/chunk-3ORVDL3H.js +0 -2
- package/dist/chunk-46XGSFNI.js +0 -2
- package/dist/chunk-4MAK2HOY.js +0 -6
- package/dist/chunk-4TURLRL5.js +0 -16
- package/dist/chunk-4UQVNCQE.js +0 -2
- package/dist/chunk-55Q3WLZX.js +0 -2
- package/dist/chunk-5I5G2QOX.js +0 -3
- package/dist/chunk-6LDJQXAH.js +0 -2
- package/dist/chunk-6O5TICIZ.js +0 -3
- package/dist/chunk-7O5IKBTZ.js +0 -16
- package/dist/chunk-7S5E7KWT.js +0 -2
- package/dist/chunk-7WPLAODU.js +0 -5
- package/dist/chunk-AFHORGLH.js +0 -42
- package/dist/chunk-AIE7TFJW.js +0 -9
- package/dist/chunk-AQOFWNQJ.js +0 -1
- package/dist/chunk-B2PX5I6M.js +0 -2
- package/dist/chunk-B75HZHUP.js +0 -2
- package/dist/chunk-B7PBSLZN.js +0 -2
- package/dist/chunk-BBW6JFHN.js +0 -2
- package/dist/chunk-BNXCIFVY.js +0 -2
- package/dist/chunk-BS2NMXQZ.js +0 -4
- package/dist/chunk-C3KV2II6.js +0 -2
- package/dist/chunk-C43RDDP4.js +0 -20
- package/dist/chunk-DAFAHMNB.js +0 -42
- package/dist/chunk-DQLPXMH6.js +0 -8
- package/dist/chunk-EKZTZXHZ.js +0 -117
- package/dist/chunk-EW2NTSFA.js +0 -18
- package/dist/chunk-F3Z4OUDS.js +0 -8
- package/dist/chunk-FJH2NW7J.js +0 -66
- package/dist/chunk-FTFP6O3L.js +0 -11
- package/dist/chunk-FYLK2DEJ.js +0 -2
- package/dist/chunk-GH74ASD6.js +0 -11
- package/dist/chunk-GMXWZP2B.js +0 -2
- package/dist/chunk-GOUBFH5O.js +0 -3
- package/dist/chunk-HLF2TX6R.js +0 -2
- package/dist/chunk-HX7M4BDI.js +0 -30
- package/dist/chunk-HZ72SESS.js +0 -128
- package/dist/chunk-IB2N4FIY.js +0 -10
- package/dist/chunk-IZYYAFN5.js +0 -2
- package/dist/chunk-JFGGXWQF.js +0 -947
- package/dist/chunk-JN4NMBEX.js +0 -8
- package/dist/chunk-JW56N3KI.js +0 -4
- package/dist/chunk-JZ2OXNWB.js +0 -2
- package/dist/chunk-KFZNKUNT.js +0 -2
- package/dist/chunk-L5GJNV2T.js +0 -8
- package/dist/chunk-L7JDSCDF.js +0 -4
- package/dist/chunk-LU47HG23.js +0 -14
- package/dist/chunk-LVY7NPF7.js +0 -2
- package/dist/chunk-MKCDWWGV.js +0 -4
- package/dist/chunk-MNE7YG56.js +0 -2
- package/dist/chunk-MRXBEXSY.js +0 -26
- package/dist/chunk-MV7OWDUX.js +0 -2
- package/dist/chunk-NGEXCJJW.js +0 -11
- package/dist/chunk-NIW6JDC5.js +0 -29
- package/dist/chunk-PBUQFCNB.js +0 -16
- package/dist/chunk-POAVPHH7.js +0 -2
- package/dist/chunk-QZ4JVECJ.js +0 -2
- package/dist/chunk-RDO52JGY.js +0 -2
- package/dist/chunk-RJT3TUUZ.js +0 -2
- package/dist/chunk-RVLDN63O.js +0 -4
- package/dist/chunk-RXOXSKY3.js +0 -2
- package/dist/chunk-S7OYBOCK.js +0 -2
- package/dist/chunk-SMNXQT5Z.js +0 -3
- package/dist/chunk-SRAFT254.js +0 -2
- package/dist/chunk-T7YQSHPQ.js +0 -3
- package/dist/chunk-UJCOIXDY.js +0 -2
- package/dist/chunk-UJPRPGCO.js +0 -13
- package/dist/chunk-WCCFZ7V7.js +0 -113
- package/dist/chunk-WUPW3UN3.js +0 -3
- package/dist/chunk-X54AGLVX.js +0 -2
- package/dist/chunk-Y2MVPNKY.js +0 -5
- package/dist/chunk-YKUU5AIC.js +0 -3
- package/dist/chunk-YLCJLTPL.js +0 -2
- package/dist/chunk-YTQVETEO.js +0 -2
- package/dist/chunk-Z4N3MZYA.js +0 -38
- package/dist/chunk-ZJOOT3BG.js +0 -2
- package/dist/chunk-ZK26BAQL.js +0 -2
- package/dist/command-descriptors-DSS46KXI.js +0 -642
- package/dist/diff-gate-types-B0QYpDv1.d.ts +0 -11
- package/dist/direct-navigation-6YHV6IB5.js +0 -3
- package/dist/queries/diff-gate.d.ts +0 -253
- package/dist/queries/diff-gate.js +0 -2
- package/docs/COMMITTED_RECORD_COMPATIBILITY.md +0 -154
- package/docs/analyzer-validation-ledger.md +0 -516
- package/docs/schemas/outcome-event-record.schema.json +0 -95
- package/skills/_shared/SKILL.md +0 -101
- package/skills/_shared/agents/openai.yaml +0 -4
- package/skills/_shared/references/agent-contract-catalog.md +0 -105
- package/skills/_shared/references/command-catalog.md +0 -118
- package/skills/_shared/references/detector-precision-and-diffgate.md +0 -59
- package/skills/_shared/references/evidence-and-dead-code.md +0 -25
- package/skills/scip-audit/SKILL.md +0 -77
- package/skills/scip-audit/agents/openai.yaml +0 -4
- package/skills/scip-audit/references/claims.md +0 -98
- package/skills/scip-audit/references/cleanup.md +0 -100
- package/skills/scip-audit/references/directory.md +0 -222
- package/skills/scip-audit/references/frontend.md +0 -130
- package/skills/scip-audit/references/integrity.md +0 -154
- package/skills/scip-audit/references/maintainability.md +0 -162
- package/skills/scip-audit/references/twin-drift.md +0 -104
- package/skills/scip-diagnose/SKILL.md +0 -52
- package/skills/scip-diagnose/agents/openai.yaml +0 -4
- package/skills/scip-diagnose/references/debug.md +0 -117
- package/skills/scip-diagnose/references/probe-reachability.md +0 -77
- package/skills/scip-diagnose/references/root-cause.md +0 -145
- package/skills/scip-diagnose/references/triage.md +0 -119
- package/skills/scip-explore/references/diagrams.md +0 -40
- package/skills/scip-explore/references/language-playbook.md +0 -49
- package/skills/scip-improve/SKILL.md +0 -56
- package/skills/scip-improve/agents/openai.yaml +0 -4
- package/skills/scip-improve/references/cleanup-batches.md +0 -53
- package/skills/scip-improve/references/directory-moves.md +0 -53
- package/skills/scip-improve/references/doc-reconcile.md +0 -30
- package/skills/scip-improve/references/frontend-extraction.md +0 -39
- package/skills/scip-improve/references/maintainability-mechanism.md +0 -43
- package/skills/scip-improve/references/twin-drift.md +0 -35
- package/skills/scip-plan/references/api-impact.md +0 -19
- package/skills/scip-plan/references/conductor.md +0 -41
- package/skills/scip-plan/references/high-assurance.md +0 -43
- package/skills/scip-plan/references/hyper-optimization.md +0 -50
- package/skills/scip-plan/references/tla-model.md +0 -88
- package/skills/scip-setup/references/bootstrap-workflow.md +0 -119
- package/skills/scip-setup/references/language-verification.md +0 -61
- package/skills/scip-setup/references/lifecycle-commands.md +0 -119
- package/skills/scip-setup/references/per-repo-triage.md +0 -24
- package/skills/scip-verify/SKILL.md +0 -229
- package/skills/scip-verify/agents/openai.yaml +0 -4
- package/skills/scip-verify/references/calibrate-detectors.md +0 -170
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import{a as un,b as pn}from"./chunk-7YZGSLW6.js";import{a as se}from"./chunk-3TNRNKAT.js";import{a as ht,b as xt}from"./chunk-GBZCVYWA.js";import{a as cn}from"./chunk-Z2QB75BS.js";import{b as dn}from"./chunk-KGKCJFWZ.js";import{a as sn,b as St,c as an,e as ln}from"./chunk-L7WRUNKJ.js";import{b as nn,c as on,d as rn}from"./chunk-FSPENGSU.js";import{a as bt,b as Xt,c as Zt,d as en,i as tn}from"./chunk-ANCHW2R4.js";import{a as Jt}from"./chunk-U2MNECDU.js";import{d as $e}from"./chunk-BOJ5SVE2.js";import{c as Yt}from"./chunk-NODZYYGC.js";import{t as Vt,u as Qt}from"./chunk-XDQX6LDT.js";import{a as gt}from"./chunk-B3AREUQK.js";import{b as yt}from"./chunk-7MUHSZGN.js";import{g as Ht,i as Wt}from"./chunk-743MEVFJ.js";import{b as We}from"./chunk-HW7FASEL.js";import{A as Me,d as V,i as Y,t as fe}from"./chunk-7Z4GMCHM.js";import{l as ce,w as ft,y as Gt}from"./chunk-6LS3IG2I.js";import{C as he,I as He,a as qt,b as Ut}from"./chunk-C7WSQA6A.js";import{C as mt,c as jt,z as zt}from"./chunk-JSHDCVUM.js";import{d as pt}from"./chunk-WEXQYJY3.js";function Ne(e){return e.includes("symbol-anchor")?0:e.includes("literal-owner")?1:e.some(t=>t.startsWith("boundary-import:"))?2:e.includes("reference-owner")?3:4}function mn(e,t){return Ne(e.origins)-Ne(t.origins)||e.depth-t.depth||e.startLine-t.startLine||e.shortName.localeCompare(t.shortName)}var fn=["call","contract-symbol","import","reference","runtime-boundary"],Mo={call:[{family:"control",subtype:"call"}],"contract-symbol":[{family:"contract",subtype:"uses-contract-symbol"}],import:[{family:"identity",subtype:"imports"}],reference:[{family:"identity",subtype:"references"}]},No={"structural-membership":[{family:"identity",subtype:"contains"}],"boundary-observation":[{family:"identity",subtype:"owns-runtime-observation"}],"external-import":[{family:"identity",subtype:"imports-external"}]};function gn(e){if(e.kind!=="runtime-boundary")return yn(Mo[e.kind]);let t=e.fromBoundaryParticipant?.protocol??e.toBoundaryParticipant?.protocol,n={crossesRuntimeBoundary:!0,...t?{protocol:t}:{},...e.runtimeBoundaryKey?{runtimeKey:e.runtimeBoundaryKey}:{}},o=[{family:"control",subtype:"runtime-handoff",context:n}];return e.evidence==="runtime-boundary:carrier.discriminator"&&(o.push({family:"control",subtype:"discriminator-dispatch",context:{...n},attributes:{joinRule:"carrier.discriminator",...e.fromBoundaryParticipant?.action?{producerAction:e.fromBoundaryParticipant.action}:{},...e.toBoundaryParticipant?.action?{consumerAction:e.toBoundaryParticipant.action}:{}}}),o.push({family:"data",subtype:"serialized-discriminator-transfer",context:{...n},attributes:{joinRule:"carrier.discriminator"}})),e.evidence==="runtime-boundary:queue.address"&&e.fromBoundaryParticipant?.action==="queue.send"&&e.toBoundaryParticipant?.action==="queue.consume"&&o.push({family:"temporal",subtype:"enqueue-before-consume",context:{...n},attributes:{producerAction:e.fromBoundaryParticipant.action,consumerAction:e.toBoundaryParticipant.action,retryPolicy:"unknown"}}),o}function Ve(e){return yn(No[e])}function yn(e){return e.map(t=>({...t,...t.context?{context:{...t.context}}:{},...t.attributes?{attributes:{...t.attributes}}:{}}))}import{join as er}from"path";import{createRequire as Ro}from"module";import{resolve as De}from"path";var Fo=Ro(import.meta.url),Ae;function Sn(e,t,n){let o=To();if(!o)return vt("The TypeScript compiler runtime is unavailable.");let i=Po(o,e,t),s=i.getSourceFile(De(t))??i.getSourceFile(t);if(!s)return vt(`The TypeScript compiler did not materialize ${t}.`);let r={ts:o,sourceFile:s,checker:i.getTypeChecker(),points:new Map,edges:new Map,unsupported:new Set,nextCfgId:0},a=$o(o,s,n);if(a.length===0)return vt("No function-like construct intersects the selected source range.");let d=new Map(a.map(u=>[u,Ao(s,u)])),c=a.map(u=>Bo(r,u,Do(o,u,d),d.get(u)));for(let u of c)Oo(r,u),qo(r,u),Go(r,u);Wo(r,c);let l=[...r.unsupported].sort();return{points:[...r.points.values()].map(({node:u,...f})=>f).sort(Zo),edges:[...r.edges.values()].sort((u,f)=>u.id.localeCompare(f.id)),coverage:{status:l.length===0?"complete":"partial",basis:"typescript-compiler-cfg-reaching-definitions",unsupported:l}}}function To(){if(Ae!==void 0)return Ae;try{Ae=Fo("typescript")}catch{Ae=Qt()?.ts??null}return Ae}function Po(e,t,n){let o=De(n),i={target:e.ScriptTarget.ESNext,module:e.ModuleKind.NodeNext,moduleResolution:e.ModuleResolutionKind.NodeNext,skipLibCheck:!0,noResolve:!0},s=e.createSourceFile(o,t,i.target,!0,ko(e,o)),r=e.createCompilerHost(i,!0),a=r.getSourceFile.bind(r),d=r.readFile.bind(r),c=r.fileExists.bind(r);return r.getSourceFile=(l,u,f,m)=>De(l)===o?s:a(l,u,f,m),r.readFile=l=>De(l)===o?t:d(l),r.fileExists=l=>De(l)===o||c(l),e.createProgram([o],i,r)}function ko(e,t){return/\.tsx$/iu.test(t)?e.ScriptKind.TSX:/\.[cm]?js$/iu.test(t)?e.ScriptKind.JS:/\.jsx$/iu.test(t)?e.ScriptKind.JSX:e.ScriptKind.TS}function $o(e,t,n){let o=[],i=s=>{if(hn(e,s)){let r=t.getLineAndCharacterOfPosition(s.getStart(t)).line,a=t.getLineAndCharacterOfPosition(s.getEnd()).line;(!n||r<=n.endLine&&a>=n.startLine)&&o.push(s)}s.forEachChild(i)};return t.forEachChild(i),o.sort((s,r)=>s.getStart(t)-r.getStart(t))}function hn(e,t){return e.isFunctionLike(t)&&"body"in t&&t.body!==void 0}function Ao(e,t){return`callable:${encodeURIComponent(e.fileName)}:${t.getStart(e)}:${t.getEnd()}`}function Do(e,t,n){for(let o=t.parent;o;o=o.parent)if(hn(e,o)&&n.has(o))return n.get(o);return null}function Bo(e,t,n,o){let i=new Map,s=G(e,i,"exit",null),r=t.body,a=s.id;if(r&&e.ts.isBlock(r))a=Et(e,i,[...r.statements],s.id,{breakTarget:null,continueTarget:null});else if(r){let c=G(e,i,"statement",r);j(i,c.id,s.id),a=c.id}let d=G(e,i,"entry",t);return j(i,d.id,a),{id:o,node:t,parentId:n,cfg:i,entryId:d.id,exitId:s.id}}function Et(e,t,n,o,i){let s=o;for(let r=n.length-1;r>=0;r-=1)s=xe(e,t,n[r],s,i);return s}function xe(e,t,n,o,i){let s=e.ts;if(s.isBlock(n))return Et(e,t,[...n.statements],o,i);if(s.isIfStatement(n)){let a=G(e,t,"predicate",n.expression),d=xe(e,t,n.thenStatement,o,i),c=n.elseStatement?xe(e,t,n.elseStatement,o,i):o;return j(t,a.id,d),j(t,a.id,c),a.id}if(s.isWhileStatement(n)){let a=G(e,t,"predicate",n.expression),d=xe(e,t,n.statement,a.id,{breakTarget:o,continueTarget:a.id});return j(t,a.id,d),j(t,a.id,o),a.id}if(s.isDoStatement(n)){let a=G(e,t,"predicate",n.expression),d=xe(e,t,n.statement,a.id,{breakTarget:o,continueTarget:a.id});return j(t,a.id,d),j(t,a.id,o),d}if(s.isForStatement(n)){let a=G(e,t,"predicate",n.condition??n),d=n.incrementor?G(e,t,"statement",n.incrementor):null;d&&j(t,d.id,a.id);let c=d?.id??a.id,l=xe(e,t,n.statement,c,{breakTarget:o,continueTarget:c});if(j(t,a.id,l),n.condition&&j(t,a.id,o),!n.initializer)return a.id;let u=G(e,t,"statement",n.initializer);return j(t,u.id,a.id),u.id}if(s.isForInStatement(n)||s.isForOfStatement(n)){e.unsupported.add("for-in/for-of iterator assignment is conservatively represented without iterable element flow.");let a=G(e,t,"predicate",n.expression),d=G(e,t,"statement",n.initializer),c=xe(e,t,n.statement,a.id,{breakTarget:o,continueTarget:a.id});return j(t,a.id,d.id),j(t,a.id,o),j(t,d.id,c),a.id}if(s.isSwitchStatement(n)){e.unsupported.add("switch fallthrough is represented conservatively; discriminant-to-case value refinement is unsupported.");let a=G(e,t,"predicate",n.expression),d=o,c=[];for(let l=n.caseBlock.clauses.length-1;l>=0;l-=1){let u=n.caseBlock.clauses[l];d=Et(e,t,[...u.statements],d,{...i,breakTarget:o}),c.push(d)}for(let l of c)j(t,a.id,l);return j(t,a.id,o),a.id}if(s.isReturnStatement(n)||s.isThrowStatement(n)){let a=G(e,t,"statement",n),d=[...t.values()].find(c=>c.kind==="exit");return j(t,a.id,d.id),a.id}if(s.isBreakStatement(n)){let a=G(e,t,"statement",n);return i.breakTarget||e.unsupported.add("A break statement could not be attached to a structured target."),j(t,a.id,i.breakTarget??o),a.id}if(s.isContinueStatement(n)){let a=G(e,t,"statement",n);return i.continueTarget||e.unsupported.add("A continue statement could not be attached to a structured target."),j(t,a.id,i.continueTarget??o),a.id}if(s.isTryStatement(n)){e.unsupported.add("Exceptional control-flow and finally completion are not included in the local compiler CFG.");let a=G(e,t,"statement",n);return a.invalidatesAllDefinitions=!0,j(t,a.id,o),a.id}let r=G(e,t,"statement",n);return j(t,r.id,o),r.id}function G(e,t,n,o){let i={id:`cfg:${e.nextCfgId++}`,kind:n,ast:o,successors:new Set,predecessors:new Set,definitions:[],uses:[],displayPoint:null,invalidatesAllDefinitions:!1};return t.set(i.id,i),i}function j(e,t,n){e.get(t).successors.add(n),e.get(n).predecessors.add(t)}function Oo(e,t){let n=t.cfg.get(t.entryId);for(let o of t.node.parameters){let i=ve(e,o.name);if(!i){e.unsupported.add("Destructured parameter definition-use is not implemented.");continue}n.definitions.push({point:Ee(e,i.node,"parameter-definition",i.symbolKey,i.name,t.id),rhsUseIds:[]})}for(let o of t.cfg.values())!o.ast||o.kind==="entry"||o.kind==="exit"||(o.kind==="predicate"&&(o.displayPoint=Ee(e,o.ast,"predicate",null,"predicate",t.id)),_o(e,t,o,o.ast),!o.displayPoint&&o.definitions.length===0&&o.uses.length===0&&(o.displayPoint=Ee(e,o.ast,"statement",null,Qo(e,o.ast),t.id)))}function _o(e,t,n,o){let i=e.ts;if(i.isTryStatement(o))return;let s=r=>{if(!(r!==o&&i.isFunctionLike(r))){if(i.isVariableDeclaration(r)){let a=r.initializer?Qe(e,t.id,r.initializer,n):[];n.uses.push(...a);let d=ve(e,r.name);d?n.definitions.push({point:Ee(e,d.node,"definition",d.symbolKey,d.name,t.id),rhsUseIds:a.map(c=>c.point.id)}):(n.invalidatesAllDefinitions=!0,e.unsupported.add("Destructured variable reaching definitions are not implemented."));return}if(i.isBinaryExpression(r)&&En(i,r.operatorToken.kind)){let a=Qe(e,t.id,r.right,n);r.operatorToken.kind!==i.SyntaxKind.EqualsToken&&a.push(...Qe(e,t.id,r.left,n)),n.uses.push(...a);let d=ve(e,r.left);d?n.definitions.push({point:Ee(e,d.node,"definition",d.symbolKey,d.name,t.id),rhsUseIds:a.map(c=>c.point.id)}):(n.invalidatesAllDefinitions=!0,e.unsupported.add("Dynamic or destructured assignment targets are not included in reaching definitions."));return}if((i.isPrefixUnaryExpression(r)||i.isPostfixUnaryExpression(r))&&(r.operator===i.SyntaxKind.PlusPlusToken||r.operator===i.SyntaxKind.MinusMinusToken)){let a=Qe(e,t.id,r.operand,n);n.uses.push(...a);let d=ve(e,r.operand);d&&n.definitions.push({point:Ee(e,d.node,"definition",d.symbolKey,d.name,t.id),rhsUseIds:a.map(c=>c.point.id)});return}if(!(i.isFunctionDeclaration(r)||i.isClassDeclaration(r)||i.isInterfaceDeclaration(r))){if(xn(e,r)){let a=vn(e,t.id,r);a&&n.uses.push(a),i.isPropertyAccessExpression(r)&&s(r.expression);return}r.forEachChild(s)}}};s(o),n.uses=In(n.uses)}function Qe(e,t,n,o){let i=[],s=r=>{if(!e.ts.isFunctionLike(r)){if(e.ts.isBinaryExpression(r)&&En(e.ts,r.operatorToken.kind)){o.invalidatesAllDefinitions=!0,e.unsupported.add("Nested assignment expressions are not included in ordered local definition-use flow."),r.operatorToken.kind!==e.ts.SyntaxKind.EqualsToken&&s(r.left),s(r.right);return}if(xn(e,r)){let a=vn(e,t,r);a&&i.push(a),e.ts.isPropertyAccessExpression(r)&&s(r.expression);return}r.forEachChild(s)}};return s(n),In(i)}function xn(e,t){if(e.ts.isPropertyAccessExpression(t))return!0;if(!e.ts.isIdentifier(t))return!1;let n=t.parent;return!(e.ts.isPropertyAccessExpression(n)&&n.name===t||"name"in n&&n.name===t&&Ko(e.ts,n)||e.ts.isPropertyAssignment(n)&&n.name===t||e.ts.isBindingElement(n)&&n.propertyName===t||e.ts.isLabeledStatement(n)||e.ts.isBreakOrContinueStatement(n)||jo(e.ts,t))}function Ko(e,t){return e.isVariableDeclaration(t)||e.isParameter(t)||e.isFunctionDeclaration(t)||e.isFunctionExpression(t)||e.isClassDeclaration(t)||e.isMethodDeclaration(t)||e.isPropertyDeclaration(t)||e.isInterfaceDeclaration(t)||e.isTypeAliasDeclaration(t)||e.isImportSpecifier(t)||e.isImportClause(t)||e.isNamespaceImport(t)}function jo(e,t){for(let n=t.parent;n;n=n.parent){if(e.isExpression(n)||e.isStatement(n)||e.isSourceFile(n))return!1;if(e.isTypeNode(n))return!0}return!1}function vn(e,t,n){let o=ve(e,n);return o?{point:Ee(e,o.node,"use",o.symbolKey,o.name,t),property:e.ts.isPropertyAccessExpression(n)}:null}function ve(e,t){let n=e.ts;if(n.isIdentifier(t)){let o=bn(e,t);return o?{node:t,symbolKey:o,name:t.text}:null}if(n.isPropertyAccessExpression(t)){let o=bn(e,t.name);return o?{node:t,symbolKey:o,name:t.getText(e.sourceFile)}:null}return n.isParenthesizedExpression(t)||n.isAsExpression(t)||n.isTypeAssertionExpression(t)||n.isNonNullExpression(t)?ve(e,t.expression):((n.isArrayLiteralExpression(t)||n.isObjectLiteralExpression(t))&&e.unsupported.add("Heap aggregate identity and destructured assignment are not included in local points-to flow."),null)}function bn(e,t){let n=e.checker.getSymbolAtLocation(t);if(!n)return null;if((n.flags&e.ts.SymbolFlags.Alias)!==0)try{n=e.checker.getAliasedSymbol(n)}catch{}let o=n.valueDeclaration??n.declarations?.[0];return o?`symbol:${encodeURIComponent(o.getSourceFile().fileName)}:${o.getStart()}:${n.getName()}`:`symbol:${n.getName()}`}function Ee(e,t,n,o,i,s){let r=t.getStart(e.sourceFile),a=t.getEnd(),d=e.sourceFile.getLineAndCharacterOfPosition(r),c=`flow-point:${encodeURIComponent(e.sourceFile.fileName)}:${r}:${a}:${n}:${encodeURIComponent(o??i)}`,l=e.points.get(c);if(l)return l;let u={id:c,kind:n,name:i,symbolKey:o,callableId:s,start:r,end:a,line:d.line,column:d.character,node:t};return e.points.set(c,u),u}function qo(e,t){let n=[...t.cfg.values()].flatMap(d=>d.definitions),o=new Map(n.map(d=>[d.point.id,d])),i=Uo(n),s=new Map,r=new Map;for(let d of t.cfg.values())s.set(d.id,new Set),r.set(d.id,new Set);let a=!0;for(;a;){a=!1;for(let d of t.cfg.values()){let c=Jo([...d.predecessors].map(f=>r.get(f))),l=new Set(c);d.invalidatesAllDefinitions&&l.clear();let u=zo(d.definitions);for(let f of u){for(let m of i.get(f.point.symbolKey)??[])l.delete(m.point.id);l.add(f.point.id)}It(s.get(d.id),c)||(s.set(d.id,c),a=!0),It(r.get(d.id),l)||(r.set(d.id,l),a=!0)}}for(let d of t.cfg.values()){let c=s.get(d.id);for(let l of d.uses){let u=d.definitions.filter(m=>m.point.symbolKey===l.point.symbolKey&&m.point.start<l.point.start&&!m.rhsUseIds.includes(l.point.id)).sort((m,p)=>p.point.start-m.point.start)[0],f=u?[u.point.id]:c;for(let m of f){let p=o.get(m);p.point.symbolKey===l.point.symbolKey&&Be(e,"reaching-definition",p.point.id,l.point.id,"exact","A CFG path reaches this use without an intervening definition.")}}for(let l of d.definitions)for(let u of l.rhsUseIds)Be(e,"value-source",u,l.point.id,"exact","This right-hand-side use supplies the new definition.")}}function Uo(e){let t=new Map;for(let n of e){if(!n.point.symbolKey)continue;let o=t.get(n.point.symbolKey)??[];o.push(n),t.set(n.point.symbolKey,o)}return t}function zo(e){let t=new Map;for(let n of e)n.point.symbolKey&&t.set(n.point.symbolKey,n);return[...t.values()]}function Go(e,t){let n=Ho(t);for(let o of t.cfg.values()){if(o.successors.size<2||!o.displayPoint)continue;let i=n.get(o.id);for(let s of o.successors)for(let r of n.get(s)??[]){if(i.has(r)||r===t.exitId)continue;let a=t.cfg.get(r),d=[...a.definitions.map(c=>c.point),...a.uses.map(c=>c.point),...a.displayPoint?[a.displayPoint]:[]];for(let c of Yo(d))Be(e,"control-dependence",o.displayPoint.id,c.id,"exact","The target postdominates a branch successor but does not postdominate the predicate.")}}}function Ho(e){let t=[...e.cfg.keys()],n=new Set(t),o=new Map;for(let s of t)o.set(s,s===e.exitId?new Set([s]):new Set(n));let i=!0;for(;i;){i=!1;for(let s of e.cfg.values()){if(s.id===e.exitId)continue;let r=[...s.successors].map(d=>o.get(d)),a=new Set([s.id,...Xo(r)]);It(o.get(s.id),a)||(o.set(s.id,a),i=!0)}}return o}function Wo(e,t){let n=new Map(t.map(r=>[r.id,r.parentId])),o=t.flatMap(r=>[...r.cfg.values()].flatMap(a=>a.definitions.map(d=>d.point))),i=new Map;for(let r of o){if(!r.symbolKey)continue;let a=i.get(r.symbolKey)??[];a.push(r),i.set(r.symbolKey,a)}let s=new Set([...e.edges.values()].filter(r=>r.kind==="reaching-definition").map(r=>r.toPointId));for(let r of t)for(let a of[...r.cfg.values()].flatMap(d=>d.uses)){if(!a.point.symbolKey||s.has(a.point.id))continue;let d=i.get(a.point.symbolKey)??[];for(let c of d)Vo(c.callableId,a.point.callableId,n)?Be(e,"closure-capture",c.id,a.point.id,"candidate","Compiler identity proves the captured binding, but invocation order can select among outer definitions."):a.property&&Be(e,"field-definition-to-use",c.id,a.point.id,"candidate","Compiler identity matches the field; cross-callable receiver and execution order remain unresolved.")}[...e.edges.values()].some(r=>r.kind==="closure-capture")&&e.unsupported.add("Closure capture identity is known, but invocation order and intervening writes remain candidate flow."),[...e.edges.values()].some(r=>r.kind==="field-definition-to-use")&&e.unsupported.add("Cross-callable field flow lacks receiver points-to and invocation-order analysis.")}function Vo(e,t,n){for(let o=n.get(t)??null;o;o=n.get(o)??null)if(o===e)return!0;return!1}function Be(e,t,n,o,i,s){let r=`local-flow-edge:${t}:${encodeURIComponent(n)}:${encodeURIComponent(o)}`;e.edges.set(r,{id:r,kind:t,fromPointId:n,toPointId:o,strength:i,reason:s})}function En(e,t){return t>=e.SyntaxKind.FirstAssignment&&t<=e.SyntaxKind.LastAssignment}function Qo(e,t){let n=t.getText(e.sourceFile).replace(/\s+/gu," ").trim();return n.length>80?`${n.slice(0,77)}...`:n||e.ts.SyntaxKind[t.kind]||"statement"}function In(e){return[...new Map(e.map(t=>[t.point.id,t])).values()]}function Yo(e){return[...new Map(e.map(t=>[t.id,t])).values()]}function Jo(e){return new Set(e.flatMap(t=>[...t]))}function Xo(e){return e.length===0?new Set:new Set([...e[0]].filter(t=>e.slice(1).every(n=>n.has(t))))}function It(e,t){return e.size===t.size&&[...e].every(n=>t.has(n))}function Zo(e,t){return e.start-t.start||e.kind.localeCompare(t.kind)||e.id.localeCompare(t.id)}function vt(e){return{points:[],edges:[],coverage:{status:"unsupported",basis:"typescript-compiler-cfg-reaching-definitions",unsupported:[e]}}}var tr=jt("typescript-local-flow",{clearGroups:["whole-project","source-file","semantic-provider"]});function Ct(e,t,n,o){if(!Vt(t))return null;let i=`${t}\0${n}\0${o}`;return tr.get(e,i,()=>{let s=zt(e,t);return s?Sn(s,er(e.config.projectRoot,t),{startLine:n,endLine:o}):{points:[],edges:[],coverage:{status:"unsupported",basis:"typescript-compiler-cfg-reaching-definitions",unsupported:[`Current source is unavailable for ${t}.`]}}})}function nr(e,t=new Map){let n=new Map,o=new Map,i=[];for(let s of e.transfers){if(!e.caller)continue;let r=Ye(e.caller,s.callerPosition),a=Ye(e.callee,s.calleePosition);Oe(n,r),Oe(n,a),wt(o,e.caller,r),wt(o,e.callee,a);let d=Q("edge","data-transfer",s.proof.file,String(s.proof.startLine),String(s.callerPosition),String(s.calleePosition));o.set(d,{id:d,kind:"data-transfer",fromNodeId:r.id,toNodeId:a.id,directed:!0,disposition:"folded",semantics:[{family:"data",subtype:"argument-to-parameter",attributes:{argumentText:s.argumentText,callerPosition:s.callerPosition,calleePosition:s.calleePosition}}],evidence:[{method:"compiler-callsite-direct-parameter-transfer",strength:"exact",identity:`${e.caller.symbol}:${s.callerPosition} -> ${e.callee.symbol}:${s.calleePosition}`,location:{file:s.proof.file,line:s.proof.startLine,endLine:s.proof.endLine}}]})}return e.unknown.forEach((s,r)=>{let a=Ye(e.callee,s.calleePosition);Oe(n,a),wt(o,e.callee,a);let d=t.get(s.calleePosition);if(d&&mr(d)){pr(o,n,e,s.calleePosition,s.argumentText,d);return}let c=cr(e,s.calleePosition,s.argumentText);Oe(n,c);let l=Q("edge","data-transfer-unsupported",s.proof.file,String(s.proof.startLine),String(s.calleePosition),String(r));o.set(l,{id:l,kind:"data-transfer",fromNodeId:c.id,toNodeId:a.id,directed:!0,disposition:"unsupported",semantics:[{family:"data",subtype:"argument-to-parameter",attributes:{argumentText:s.argumentText,calleePosition:s.calleePosition}}],evidence:[{method:"compiler-callsite-argument-expression",strength:"exact",identity:s.argumentText,location:{file:s.proof.file,line:s.proof.startLine,endLine:s.proof.endLine}}]}),i.push({id:Q("frontier","data-transfer",l),kind:"data-transfer",direction:"unresolved",fromNodeIds:[c.id],edgeIds:[l],memberNodeIds:[a.id],memberCount:1,disposition:"unsupported",reason:d?.derivation.rule??s.reason,expansion:null})}),{nodes:[...n.values()],edges:[...o.values()],frontiers:i,blindSpots:[]}}function Ln(e,t,n=[]){let o=wn(),i=new Map,s=new Set;for(let r of t){if(r.kind!=="call"||!r.fromSymbol||!r.toSymbol||r.line===null)continue;let a=dr(i,e,r.toFile,r.toSymbol);if(!a)continue;let d=Zt(e,a),c=d.sites.filter(b=>b.file===r.fromFile&&b.startLine<=r.line&&b.endLine>=r.line&&b.caller?.symbol===r.fromSymbol);if(c.length!==1){let b=d.unresolved.find(S=>S.file===r.fromFile&&S.line===r.line);b&&o.blindSpots.push(`Parameter flow unresolved at ${r.fromFile}:${r.line+1}: ${b.reason}.`);continue}let l=c[0],u=`${l.file}\0${l.callNode.startIndex}\0${l.callNode.endIndex}\0${a.symbol}`;if(s.has(u))continue;s.add(u);let f=en(e,l),m=he(e,l.file)?.rootNode,p=new Map;if(m)for(let b of f.unknown){let S=Xt({db:e,file:l.file,root:m},l.arguments[b.calleePosition]);S&&p.set(b.calleePosition,S)}Cn(o,nr(f,p)),f.caller&&ar(l.callNode)&&lr(o,f,l.callNode)}for(let r of n){if(!r.location||!["source-construct","symbol"].includes(r.kind))continue;let a=r.location.endLine??r.location.line,d=Ct(e,r.location.file,r.location.line,a);if(d){Cn(o,or(r,d.points,d.edges));for(let c of d.coverage.unsupported)o.blindSpots.push(`TypeScript local flow is partial for ${r.location.file}:${r.location.line+1}-${a+1}: ${c} Recover with: scip-query inspect --at '${r.location.file}:${r.location.line+1}-${a+1}' --view behavior.`)}}return o.blindSpots=[...new Set(o.blindSpots)].sort(),o}function or(e,t,n){let o=wn(),i=new Map,s=new Map,r=new Map,a=e.location.file;for(let d of t){let c=rr(e,a,d);r.set(d.id,c.id),i.set(c.id,c),ir(s,e,c)}for(let d of n){let c=r.get(d.fromPointId),l=r.get(d.toPointId);if(!c||!l)continue;let u=sr(d),f=Q("edge","typescript-local-flow",a,d.id);s.set(f,{id:f,kind:d.kind==="control-dependence"?"control-dependence":"data-transfer",fromNodeId:c,toNodeId:l,directed:!0,disposition:"folded",semantics:[u],evidence:[{method:"typescript-compiler-cfg-reaching-definitions",strength:d.strength,identity:d.reason,location:i.get(c)?.location??e.location}]})}return o.nodes=[...i.values()],o.edges=[...s.values()],o}function rr(e,t,n){return{id:Q("local-flow-point",t,String(n.start),String(n.end),n.kind,n.symbolKey??n.name),kind:n.kind==="parameter-definition"||n.kind==="definition"?"local-definition":n.kind==="use"?"local-use":n.kind==="predicate"?"control-predicate":"local-statement",label:n.name,disposition:"folded",location:{file:t,line:n.line,endLine:n.line},anchorIds:[],attributes:{ownerNodeId:e.id,pointKind:n.kind,callableId:n.callableId,symbolKey:n.symbolKey,column:n.column}}}function ir(e,t,n){let o=Q("edge","local-flow-owner",t.id,n.id);e.has(o)||e.set(o,{id:o,kind:"local-flow-owner",fromNodeId:t.id,toNodeId:n.id,directed:!0,disposition:"folded",semantics:[{family:"identity",subtype:"contains"}],evidence:[{method:"typescript-compiler-local-flow-owner",strength:"exact",identity:t.id,location:n.location}]})}function sr(e){switch(e.kind){case"reaching-definition":return{family:"data",subtype:"definition-to-use"};case"value-source":return{family:"data",subtype:"value-to-definition"};case"closure-capture":return{family:"data",subtype:"closure-capture"};case"field-definition-to-use":return{family:"data",subtype:"field-definition-to-use"};case"control-dependence":return{family:"control",subtype:"control-dependence"}}}function ar(e){let t=e;for(;t.parent&&["await_expression","yield_expression","parenthesized_expression","as_expression","type_assertion"].includes(t.parent.type);)t=t.parent;return t.parent!==null&&t.parent.type!=="expression_statement"}function lr(e,t,n){if(!t.caller)return;let o={id:Q("call-result",t.call.file,String(n.startIndex),String(n.endIndex),t.callee.symbol),kind:"call-result",label:`result of ${t.callee.leaf}`,disposition:"folded",location:{file:t.call.file,line:t.call.startLine,endLine:t.call.endLine},anchorIds:[],attributes:{calleeSymbol:t.callee.symbol,callerSymbol:t.caller.symbol}},i=Q("edge","return-to-call-result",t.callee.symbol,o.id),s=Q("edge","call-result-owner",t.caller.symbol,o.id);e.nodes.push(o),e.edges.push({id:i,kind:"data-transfer",fromNodeId:Mt(t.callee.symbol),toNodeId:o.id,directed:!0,disposition:"folded",semantics:[{family:"data",subtype:"return-to-call-result"}],evidence:[{method:"compiler-callsite-used-result",strength:"exact",identity:`${t.callee.symbol} -> ${t.caller.symbol}`,location:o.location}]},{id:s,kind:"call-result-owner",fromNodeId:Mt(t.caller.symbol),toNodeId:o.id,directed:!0,disposition:"folded",semantics:[{family:"identity",subtype:"contains-call-result"}],evidence:[{method:"compiler-call-result-owner",strength:"exact",identity:t.caller.symbol,location:o.location}]})}function wn(){return{nodes:[],edges:[],frontiers:[],blindSpots:[]}}function Cn(e,t){Lt(e.nodes,t.nodes),Lt(e.edges,t.edges),Lt(e.frontiers,t.frontiers),e.blindSpots.push(...t.blindSpots)}function Lt(e,t){let n=new Set(e.map(o=>o.id));for(let o of t)n.has(o.id)||(n.add(o.id),e.push(o))}function dr(e,t,n,o){let i=`${n}\0${o}`,s=e.get(i);if(s!==void 0)return s;let r=fe(t,n).find(a=>a.symbol===o)??null;return e.set(i,r),r}function Ye(e,t){return{id:yr(e.symbol,t),kind:"parameter",label:`${e.leaf} parameter ${t}`,disposition:"folded",location:{file:e.relativePath,line:e.startLine,endLine:e.endLine},anchorIds:[],attributes:{ownerSymbol:e.symbol,position:t}}}function cr(e,t,n){return{id:Q("argument-expression",e.call.file,String(e.call.startLine),String(e.call.endLine),String(t)),kind:"argument-expression",label:n,disposition:"unsupported",location:{file:e.call.file,line:e.call.startLine,endLine:e.call.endLine},anchorIds:[],attributes:{calleeSymbol:e.callee.symbol,position:t}}}function ur(e,t,n){return{id:Q("static-value",e.call.file,String(e.call.startLine),String(e.call.endLine),String(t)),kind:"static-value",label:n.value,disposition:"folded",location:{file:e.call.file,line:e.call.startLine,endLine:e.call.endLine},anchorIds:[],attributes:{value:n.value,precision:n.precision,evidence:n.evidence,termKind:n.term.kind,derivationRule:n.derivation.rule}}}function pr(e,t,n,o,i,s){let r=ur(n,o,s),a=Ye(n.callee,o);Oe(t,r);let d=Q("edge","static-value-transfer",n.call.file,String(n.call.startLine),String(o));e.set(d,{id:d,kind:"data-transfer",fromNodeId:r.id,toNodeId:a.id,directed:!0,disposition:"folded",semantics:[{family:"data",subtype:fr(s),attributes:{argumentText:i,calleePosition:o,value:s.value,precision:s.precision,derivationRule:s.derivation.rule}}],evidence:gr(s,n)})}function mr(e){return e.derivation.kind!=="heuristic"&&e.precision!=="symbolic"&&e.precision!=="unknown"}function fr(e){return e.derivation.rule==="bounded-call-return"?"return-to-parameter":e.derivation.rule==="member-constant"||e.term.kind==="property"?"property-to-parameter":"constant-to-parameter"}function gr(e,t){return(e.derivation.sourceSpans.length>0?e.derivation.sourceSpans:[t.call]).map(o=>({method:`static-value:${e.derivation.rule}`,strength:e.derivation.kind==="direct"?"exact":"derived",identity:e.derivation.inputFactIds.join(",")||e.value,location:{file:o.file,line:o.startLine,endLine:o.endLine}}))}function Oe(e,t){e.has(t.id)||e.set(t.id,t)}function wt(e,t,n){let o=Q("edge","parameter-owner",t.symbol,n.id);e.has(o)||e.set(o,{id:o,kind:"parameter-owner",fromNodeId:Mt(t.symbol),toNodeId:n.id,directed:!0,disposition:"folded",semantics:[{family:"identity",subtype:"contains"}],evidence:[{method:"compiler-parameter-owner",strength:"exact",identity:t.symbol,location:{file:t.relativePath,line:t.startLine,endLine:t.endLine}}]})}function yr(e,t){return Q("parameter",e,String(t))}function Mt(e){return Q("symbol",e)}function Q(...e){return e.map(t=>encodeURIComponent(t)).join(":")}function Mn(e,t){let n=new Map,o=new Map,i=new Map,s=new Set;for(let r of t){if(!r.location||!["source-construct","symbol"].includes(r.kind))continue;let a=r.location.endLine??r.location.line,d=on(e,r.location.file,r.location.line,a);if(!d){s.add(`Control dependence unavailable for ${r.location.file}:${r.location.line+1}-${a+1}: no supported syntax tree or covering construct.`);continue}for(let c of d.facts){let l=Nt(r,c.controller),u=Nt(r,c.outcome);n.set(l.id,l),n.set(u.id,u),br(o,r,l);let f=Ie("edge","control-dependence",l.id,u.id,c.subtype);o.set(f,{id:f,kind:"control-dependence",fromNodeId:l.id,toNodeId:u.id,directed:!0,disposition:"folded",semantics:[{family:"control",subtype:c.subtype,attributes:{...c.attributes}}],evidence:[{method:"parser-control-dependence",strength:"exact",identity:`${r.location.file}:${c.controller.startLine+1}-${c.outcome.startLine+1}`,location:{file:r.location.file,line:c.controller.startLine,endLine:c.controller.endLine}}]})}for(let c of d.terminals){let l=Nt(r,c);n.set(l.id,l);let u=c.label.startsWith("throw")||c.label.startsWith("raise")?"throw":"return",f=Ie("edge","control-terminal",r.id,l.id,u);o.set(f,{id:f,kind:"control-terminal",fromNodeId:r.id,toNodeId:l.id,directed:!0,disposition:"folded",semantics:[{family:"control",subtype:u==="throw"?"throws":"returns"}],evidence:[{method:"parser-terminal-statement",strength:"exact",identity:c.label,location:{file:r.location.file,line:c.startLine,endLine:c.endLine}}]})}for(let c of d.unsupported){let l=Ie("control-unsupported",r.location.file,String(c.startLine),String(c.endLine),c.reason);n.set(l,{id:l,kind:"control-unsupported",label:c.reason,disposition:"unsupported",location:{file:r.location.file,line:c.startLine,endLine:c.endLine},anchorIds:[],attributes:{ownerNodeId:r.id}});let u=Ie("edge","control-unsupported",r.id,l);o.set(u,{id:u,kind:"control-dependence",fromNodeId:r.id,toNodeId:l,directed:!0,disposition:"unsupported",semantics:[{family:"control",subtype:"unresolved-control-construct"}],evidence:[{method:"parser-control-construct",strength:"exact",identity:c.reason,location:{file:r.location.file,line:c.startLine,endLine:c.endLine}}]});let f=Ie("frontier","control-dependence",l);i.set(f,{id:f,kind:"control-dependence",direction:"unresolved",fromNodeIds:[r.id],edgeIds:[u],memberNodeIds:[l],memberCount:1,disposition:"unsupported",reason:c.reason,expansion:null})}}return{nodes:[...n.values()],edges:[...o.values()],frontiers:[...i.values()],blindSpots:[...s].sort()}}function Nt(e,t){let n=e.location.file;return{id:Ie(`control-${t.kind}`,n,String(t.startLine),String(t.endLine),t.label),kind:`control-${t.kind}`,label:t.label,disposition:"folded",location:{file:n,line:t.startLine,endLine:t.endLine},anchorIds:[],attributes:{ownerNodeId:e.id,constructKind:t.kind,implicit:t.implicit}}}function br(e,t,n){let o=Ie("edge","control-owner",t.id,n.id);e.has(o)||e.set(o,{id:o,kind:"control-owner",fromNodeId:t.id,toNodeId:n.id,directed:!0,disposition:"folded",semantics:[{family:"identity",subtype:"contains-control"}],evidence:[{method:"parser-control-owner",strength:"exact",identity:t.id,location:t.location}]})}function Ie(...e){return e.map(t=>encodeURIComponent(t)).join(":")}var Je=new Set(["arrow_function","constructor_declaration","function_declaration","function_definition","function_expression","generator_function","generator_function_declaration","function_item","lambda","lambda_expression","method","method_declaration","method_definition"]),Ke=new Set(["block","body","compound_statement","declaration_list","statement_block"]),Sr=new Set(["assignment","assignment_expression","augmented_assignment_expression"]),Ft=new Set(["update_expression"]),Tn=new Set(["array_access","element_access_expression","subscript_expression"]),Pn=new Set(["attribute","field_access","field_expression","member_access_expression","member_expression","selector_expression"]),hr=new Set(["false","null","null_literal","number","number_literal","string","string_literal","template_string","true"]),xr=new Set(["call_expression","method_invocation","object_creation_expression"]),vr=new Set(["comment","else_clause","formal_parameters","parameters","type_parameters"]);function kn(e,t,n,o){let i=he(e,t);if(!i)return null;let s=Rr(i.rootNode,n,o);if(!s)return null;let r=[],a=[],d=[];return Ce(s,c=>{if(Sr.has(c.type)||Ft.has(c.type)||An(c)){let l=Er(c);l?r.push(l):d.push({family:"state",startLine:c.startPosition.row,endLine:c.endPosition.row,reason:`Mutation target ${le(c.text)} could not be resolved to an exact source resource.`})}}),Ce(s,c=>{if(!Ke.has(c.type))return;let l=Mr(c);for(let u=0;u<l.length-1;u+=1)a.push({from:_e(l[u]),to:_e(l[u+1]),subtype:"lexical-successor",synchronizationScope:null,attributes:{sameScope:!0,executionConditional:!0}});for(let u=0;u<l.length;u+=1){let f=l[u],m=Tr(f).filter(p=>p.type==="await_expression");for(let p of m){let b=je("event",`await ${le(p.text.replace(/^await\s+/u,""))}`,p);a.push({from:_e(f),to:b,subtype:"awaits-completion",synchronizationScope:null,attributes:{completionRequired:!0}});let S=l[u+1];S&&a.push({from:b,to:_e(S),subtype:"await-completion-before",synchronizationScope:null,attributes:{continuationOnly:!0}})}}}),Ce(s,c=>{if(c.type!=="synchronized_statement")return;let l=c.childForFieldName("object")??c.childForFieldName("condition")??c.namedChildren.find(b=>!Ke.has(b.type)),u=c.childForFieldName("body")??c.namedChildren.find(b=>Ke.has(b.type));if(!l||!u){d.push({family:"temporal",startLine:c.startPosition.row,endLine:c.endPosition.row,reason:"Synchronized scope has no structurally resolved monitor or body."});return}let f=le(l.text).replace(/^\(|\)$/gu,""),m=je("lock",f,l),p=Fr(u).filter(b=>b.parent!==null&&Dn(b));for(let b of Nr(p))a.push({from:m,to:_e(b),subtype:"inside-lock-scope",synchronizationScope:f,attributes:{syntaxNative:!0}})}),{mutations:r,temporal:a,unsupported:d}}function Er(e){let t=An(e),n=e.childForFieldName("left")??e.childForFieldName("argument")??(t?e.namedChildren.at(-1)??null:e.namedChildren[0]??null);if(!n)return null;let o=Ir(n);if(!o)return null;let i=t?"delete":Ft.has(e.type)||!wr(e,n).startsWith("=")?"update":"assign",s=t||Ft.has(e.type)?null:e.childForFieldName("right");return{event:je("event",le(e.text),e),resource:{kind:"resource",label:o.name,startLine:n.startPosition.row,endLine:n.endPosition.row},operation:i,durabilityClass:"in-memory",recordIdentity:o.recordIdentity,value:s?je("value",le(s.text),s):null,dataSubtype:s?Cr(s,e):null}}function Ir(e){if(Tn.has(e.type)){let t=e.childForFieldName("object")??e.childForFieldName("array")??e.namedChildren[0]??null,n=e.childForFieldName("index")??e.childForFieldName("subscript")??e.namedChildren[1]??null;return!t||!n?null:{name:`${le(t.text)}[]`,recordIdentity:le(n.text)}}return Pn.has(e.type)?{name:le(e.text),recordIdentity:null}:/^(?:identifier|property_identifier|field_identifier)$/u.test(e.type)?{name:le(e.text),recordIdentity:null}:null}function Cr(e,t){return hr.has(e.type)||/(?:integer|float|decimal|boolean|character)_literal$/u.test(e.type)?"constant-to-state":xr.has(e.type)?"return-to-state":Pn.has(e.type)||Tn.has(e.type)?"property-to-state":/identifier$/u.test(e.type)?Lr(e.text,t)?"captured-value-to-state":"value-to-state":"expression-to-state"}function Lr(e,t){let n=Rt(t.parent);if(!n||Nn(n,e))return!1;let o=Rt(n.parent);for(;o;){if(Nn(o,e))return!0;o=Rt(o.parent)}return!1}function Rt(e){let t=e;for(;t;){if(Je.has(t.type))return t;t=t.parent}return null}function Nn(e,t){let n=e.childForFieldName("parameters")??e.namedChildren.find(s=>["formal_parameters","parameters"].includes(s.type));if(n&&Rn(n,t))return!0;let o=e.childForFieldName("body")??e.namedChildren.find(s=>Ke.has(s.type));if(!o)return!1;let i=!1;return $n(o,e,s=>{if(i||!/(?:declarator|declaration|parameter)$/u.test(s.type))return;let r=s.childForFieldName("name")??s.childForFieldName("pattern")??s.namedChildren[0];r&&Rn(r,t)&&(i=!0)}),i}function Rn(e,t){let n=!1;return Ce(e,o=>{/identifier$/u.test(o.type)&&o.text===t&&(n=!0)}),n}function $n(e,t,n){n(e);for(let o of e.namedChildren)o!==t&&Je.has(o.type)||$n(o,t,n)}function wr(e,t){let n=e.childForFieldName("right"),o=Math.max(0,t.endIndex-e.startIndex),i=n?Math.max(o,n.startIndex-e.startIndex):e.text.length;return e.text.slice(o,i).trim()}function An(e){return(e.type==="delete_expression"||e.type==="unary_expression")&&/^delete\b/u.test(e.text.trim())}function Mr(e){return e.namedChildren.filter(t=>Dn(t))}function Dn(e){return vr.has(e.type)||Ke.has(e.type)?!1:/(?:statement|declaration)$/u.test(e.type)||e.type==="expression_statement"||e.type==="local_variable_declaration"}function Nr(e){let t=new Set(e);return e.filter(n=>{let o=n.parent;for(;o;){if(t.has(o))return!1;o=o.parent}return!0})}function _e(e){return je("event",le(e.text),e)}function je(e,t,n){return{kind:e,label:t,startLine:n.startPosition.row,endLine:n.endPosition.row}}function Rr(e,t,n){let o=[];return Ce(e,s=>{s.startPosition.row<=t&&s.endPosition.row>=n&&o.push(s)}),o.filter(s=>Je.has(s.type)).sort(Fn)[0]??o.sort(Fn)[0]??null}function Fn(e,t){return e.endIndex-e.startIndex-(t.endIndex-t.startIndex)||e.startIndex-t.startIndex}function Fr(e){let t=[];return Ce(e,n=>t.push(n)),t}function Tr(e){let t=[],n=o=>{t.push(o);for(let i of o.namedChildren)i!==e&&Je.has(i.type)||n(i)};return n(e),t}function Ce(e,t){t(e);for(let n of e.namedChildren)Ce(n,t)}function le(e){return e.trim().replace(/\s+/gu," ")}function _n(e,t,n=[]){let o=new Map,i=new Map,s=new Map,r=new Set;for(let a of t){if(!a.location||!["source-construct","symbol"].includes(a.kind))continue;let d=a.location.endLine??a.location.line,c=kn(e,a.location.file,a.location.line,d);if(!c){r.add(`State and temporal analysis unavailable for ${a.location.file}:${a.location.line+1}-${d+1}: no supported syntax tree or covering construct.`);continue}for(let l of c.mutations){let u=Ze(a,l.event),f=Br(a,l.resource,l.durabilityClass);if(o.set(u.id,u),o.set(f.id,f),et(i,a,u,"contains-state-effect"),tt(i,{kind:"state-resource",from:u,to:f,semantics:[{family:"state",subtype:l.operation==="delete"?"deletes-resource":"writes-resource",attributes:{operation:l.operation,durabilityClass:l.durabilityClass,resource:l.resource.label,recordIdentity:l.recordIdentity,transactionMembership:"unknown"}}],method:"parser-state-mutation",identity:l.event.label}),l.value&&l.dataSubtype){let m=Ze(a,l.value);o.set(m.id,m),tt(i,{kind:"data-to-state",from:m,to:f,semantics:[{family:"data",subtype:l.dataSubtype,attributes:{operation:l.operation,resource:l.resource.label,recordIdentity:l.recordIdentity,value:l.value.label}}],method:"parser-assignment-value",identity:`${l.value.label} -> ${l.resource.label}`})}}for(let l of c.temporal){let u=Ze(a,l.from),f=Ze(a,l.to);o.set(u.id,u),o.set(f.id,f),et(i,a,u,l.from.kind==="lock"?"contains-lock-scope":"contains-event"),et(i,a,f,"contains-event"),tt(i,{kind:"temporal-order",from:u,to:f,semantics:[{family:"temporal",subtype:l.subtype,context:l.synchronizationScope?{synchronizationScope:l.synchronizationScope}:void 0,attributes:{...l.attributes}}],method:l.subtype==="inside-lock-scope"?"parser-synchronized-scope":"parser-program-order",identity:`${l.from.label} -> ${l.to.label}`})}for(let l of c.unsupported){let u=ue(`${l.family}-unsupported`,a.location.file,String(l.startLine),String(l.endLine),l.reason);o.set(u,{id:u,kind:`${l.family}-unsupported`,label:l.reason,disposition:"unsupported",location:{file:a.location.file,line:l.startLine,endLine:l.endLine},anchorIds:[],attributes:{ownerNodeId:a.id}});let f=ue("edge",`${l.family}-unsupported`,a.id,u);i.set(f,{id:f,kind:`${l.family}-unsupported`,fromNodeId:a.id,toNodeId:u,directed:!0,disposition:"unsupported",semantics:[{family:l.family,subtype:`unresolved-${l.family}-construct`}],evidence:[{method:`parser-${l.family}-construct`,strength:"exact",identity:l.reason,location:{file:a.location.file,line:l.startLine,endLine:l.endLine}}]});let m=ue("frontier",l.family,u);s.set(m,{id:m,kind:l.family,direction:"unresolved",fromNodeIds:[a.id],edgeIds:[f],memberNodeIds:[u],memberCount:1,disposition:"unsupported",reason:l.reason,expansion:null})}}for(let a of t.filter(d=>d.kind==="runtime-boundary-participant")){let d=Xe(a,"protocol"),c=Xe(a,"action"),l=Xe(a,"address")??a.label;!d||!c||!On(d,c)||Bn(o,i,a,{observationId:a.id,action:c,strength:"exact",file:a.location?.file??"",line:a.location?.line??0,address:l,protocol:d,role:Xe(a,"role")??void 0,resolution:"locally-linked"})}for(let a of n){if(!a.protocol||!On(a.protocol,a.action))continue;let d=Ar(t,a.file,a.line,a.ownerShortName??null);if(!d){r.add(`State observation ${a.observationId} at ${a.file}:${a.line+1} has no materialized owner node.`);continue}Bn(o,i,d,a)}return{nodes:[...o.values()],edges:[...i.values()],frontiers:[...s.values()],blindSpots:[...r].sort()}}function Bn(e,t,n,o){let i=kr(o),r={id:ue("runtime-state-event",o.observationId),kind:"runtime-state-event",label:`${o.action} ${i}`,disposition:"folded",location:{file:o.file,line:o.line},anchorIds:[],attributes:{action:o.action,protocol:o.protocol??null,modality:o.modality??null,resolution:o.resolution??null}},a=o.protocol==="database"?"external-durable-intent":"external",d={id:ue("runtime-state-resource",o.protocol??"unknown",i),kind:"runtime-state-resource",label:i,disposition:"folded",location:{file:o.file,line:o.line},anchorIds:[],attributes:{protocol:o.protocol??null,durabilityClass:a}};e.set(r.id,r),e.set(d.id,d),et(t,n,r,"contains-runtime-state-effect");let c=Pr(o.action);tt(t,{kind:"runtime-state-resource",from:r,to:d,semantics:[{family:"state",subtype:c,context:{crossesRuntimeBoundary:!0,protocol:o.protocol},attributes:{operation:o.action,durabilityClass:a,resource:i,recordIdentity:$r(o),modality:o.modality??null,resolution:o.resolution??null,transactionMembership:"unknown",commitState:o.protocol==="database"?"unknown":null}}],method:`runtime-boundary-${o.strength}`,identity:o.observationId})}function Pr(e){return e==="database.read"?"reads-resource":e==="queue.send"?"enqueues-resource":e==="queue.consume"?"consumes-resource":"writes-resource"}function kr(e){return(e.keyParts?.find(n=>["address","resource"].includes(n.name))?.value??e.address)||e.observationId}function $r(e){return e.keyParts?.find(n=>/^(?:id|key|record)$/u.test(n.name))?.value??null}function On(e,t){return e==="database"&&["database.read","database.write"].includes(t)||e==="queue"&&["queue.consume","queue.send"].includes(t)}function Xe(e,t){let n=e.attributes[t];return typeof n=="string"?n:null}function Ar(e,t,n,o){let i=e.filter(r=>r.location?.file===t&&["source-construct","symbol"].includes(r.kind)),s=i.filter(r=>r.location.line<=n&&(r.location.endLine??r.location.line)>=n).sort(Dr)[0];if(s)return s;if(o){let r=i.find(a=>a.label===o||a.label.endsWith(`.${o}`)||a.label.includes(o));if(r)return r}return i.length===1?i[0]:null}function Dr(e,t){let n=(e.location?.endLine??e.location?.line??0)-(e.location?.line??0),o=(t.location?.endLine??t.location?.line??0)-(t.location?.line??0);return n-o}function Ze(e,t){let n=e.location.file;return{id:ue(`program-${t.kind}`,n,String(t.startLine),String(t.endLine),t.label),kind:`program-${t.kind}`,label:t.label,disposition:"folded",location:{file:n,line:t.startLine,endLine:t.endLine},anchorIds:[],attributes:{ownerNodeId:e.id,constructKind:t.kind}}}function Br(e,t,n){let o=e.location.file;return{id:ue("program-resource",o,e.id,t.label,n),kind:"program-resource",label:t.label,disposition:"folded",location:{file:o,line:t.startLine,endLine:t.endLine},anchorIds:[],attributes:{ownerNodeId:e.id,durabilityClass:n}}}function et(e,t,n,o){let i=ue("edge","program-owner",t.id,n.id,o);e.has(i)||e.set(i,{id:i,kind:"program-owner",fromNodeId:t.id,toNodeId:n.id,directed:!0,disposition:"folded",semantics:[{family:"identity",subtype:o}],evidence:[{method:"parser-program-owner",strength:"exact",identity:t.id,location:n.location}]})}function tt(e,t){let n=ue("edge",t.kind,t.from.id,t.to.id,t.semantics[0].subtype);e.set(n,{id:n,kind:t.kind,fromNodeId:t.from.id,toNodeId:t.to.id,directed:!0,disposition:"folded",semantics:t.semantics,evidence:[{method:t.method,strength:"exact",identity:t.identity,location:t.from.location}]})}function ue(...e){return e.map(t=>encodeURIComponent(t)).join(":")}var Or=new Set(["control","data","state","temporal"]),nt=new Set(["contains-control","contains-event","contains-lock-scope","contains-state-effect","contains-runtime-state-effect","contains","owns-parameter","owns-runtime-observation"]),Un=new Set(["discriminator-dispatch","result-callback","returns","runtime-handoff","throws"]);function zn(e,t={}){let n=new Map(e.nodes.map(v=>[v.id,v])),o=Gr(e.nodes,t.focusLocations),i=Hr(e.edges,t.focusLocations),s=Wr(e.edges,i),r=new Set(e.paths.flatMap(v=>v.edgeIds)),a=pe(e.anchors.filter(v=>v.status==="matched").flatMap(v=>v.nodeIds)),c=e.edges.filter(qn).filter(v=>_r(v,o,i,r)),l=c.filter(v=>Ur(v,o,i,s,n,r)),u=Kn(a,l,"forward"),f=qr(u,l),m=Kn(f,l,"backward"),p=new Set([...u].filter(v=>m.has(v)));for(let v of a)p.add(v);let b=new Set(l.filter(v=>p.has(v.fromNodeId)&&p.has(v.toNodeId)).map(v=>v.id)),S=new Set(p),w=new Set(b);Kr(c,S,w,o,i);let I=e.frontiers.filter(v=>Qr(v,S)),L=pe(I.filter(v=>v.disposition==="unsupported").map(v=>v.id)),N=pe(e.edges.filter(v=>!qn(v)&&Hn(v)&&Vr(v,S)).map(v=>v.id)),y=pe(I.map(v=>v.id)),E=[];a.length===0&&E.push("No matched anchor node starts the corridor."),f.length===0&&E.push("No proved mechanical outcome is reachable from a matched anchor."),L.length>0&&E.push(`${L.length} unsupported frontier(s) touch the protected corridor.`),N.length>0&&E.push(`${N.length} candidate or unknown edge(s) touch the protected corridor.`);let C=E.length===0?"complete":"incomplete";return{schemaVersion:1,status:C,startNodeIds:a,outcomeNodeIds:f,baseNodeIds:pe([...p]),baseEdgeIds:pe([...b]),nodeIds:pe([...S]),edgeIds:pe([...w]),accountedFrontierIds:y,unresolvedFrontierIds:L,unresolvedEdgeIds:N,coverage:{protectedNodes:S.size,protectedEdges:w.size,baseNodes:p.size,baseEdges:b.size,accountedFrontiers:y.length,unresolvedFrontiers:L.length,unresolvedEdges:N.length},explanation:C==="complete"?"Every proved anchor-to-outcome path is closed over its material causal facts within reported coverage.":E.join(" ")}}function _r(e,t,n,o){return t===null||e.disposition==="emitted"||o.has(e.id)||n?.has(e.id)===!0?!0:(e.semantics??[]).some(i=>{if(i.family==="identity"&&nt.has(i.subtype))return t.has(e.toNodeId);if(i.family==="contract")return t.has(e.fromNodeId)&&t.has(e.toNodeId);if(i.family==="state")return t.has(e.fromNodeId);if(i.family==="data"||i.family==="temporal")return t.has(e.fromNodeId)||t.has(e.toNodeId);if(i.family==="control"){if(Wn(i))return t.has(e.fromNodeId);if(["returns","throws"].includes(i.subtype))return t.has(e.toNodeId);if(i.subtype==="completion-callback")return t.has(e.fromNodeId)||t.has(e.toNodeId)}return!1})}function Kr(e,t,n,o,i){let s=!0;for(;s;){s=!1;for(let r of e)jr(r,t,o,i)&&(n.has(r.id)||(n.add(r.id),s=!0),t.has(r.fromNodeId)||(t.add(r.fromNodeId),s=!0),t.has(r.toNodeId)||(t.add(r.toNodeId),s=!0))}}function jr(e,t,n,o){let i=t.has(e.fromNodeId),s=t.has(e.toNodeId);return!i&&!s?!1:(e.semantics??[]).some(r=>r.family==="identity"?nt.has(r.subtype)&&(s||n===null||n.has(e.toNodeId)):r.family==="contract"?!0:r.family==="state"?i&&(n===null||n.has(e.fromNodeId)):r.family==="temporal"?r.subtype==="lexical-successor"?i&&s:!0:r.family==="data"?s&&(i||n===null||n.has(e.fromNodeId)||o?.has(e.id)===!0):r.family==="control"?Gn(r)||["returns","throws"].includes(r.subtype)&&!s&&n!==null&&!n.has(e.toNodeId)?!1:Un.has(r.subtype)||Wn(r)||r.subtype==="completion-callback":!1)}function qr(e,t){let n=new Set,o=new Map,i=new Map;for(let s of t)!e.has(s.fromNodeId)||!e.has(s.toNodeId)||(o.set(s.fromNodeId,(o.get(s.fromNodeId)??0)+1),i.set(s.toNodeId,(i.get(s.toNodeId)??0)+1),(s.semantics??[]).some(r=>r.family==="state"||r.family==="control"&&Un.has(r.subtype))&&n.add(s.toNodeId));for(let s of e)(i.get(s)??0)>0&&(o.get(s)??0)===0&&n.add(s);return pe([...n])}function Kn(e,t,n){let o=new Map;for(let r of t){let a=n==="forward"?r.fromNodeId:r.toNodeId,d=n==="forward"?r.toNodeId:r.fromNodeId,c=o.get(a)??[];c.push(d),o.set(a,c)}let i=new Set(e),s=[...e];for(;s.length>0;){let r=s.shift();for(let a of o.get(r)??[])i.has(a)||(i.add(a),s.push(a))}return i}function Ur(e,t,n,o,i,s){return(e.semantics??[]).some(r=>e.disposition==="emitted"||s.has(e.id)?!0:r.family==="identity"&&nt.has(r.subtype)?t===null||t.has(e.toNodeId)||o?.has(e.toNodeId)===!0:!Or.has(r.family)||Gn(r)?!1:r.family==="control"&&["returns","throws"].includes(r.subtype)&&t!==null?t.has(e.toNodeId):t===null?!0:r.family==="state"?t.has(e.fromNodeId):r.family==="data"?t.has(e.fromNodeId)||t.has(e.toNodeId)||n?.has(e.id)===!0:r.family==="temporal"?r.subtype==="lexical-successor"?t.has(e.fromNodeId)&&t.has(e.toNodeId):t.has(e.fromNodeId)||t.has(e.toNodeId):r.family==="control"?zr(e,i)&&(t.has(e.fromNodeId)||t.has(e.toNodeId)):!1)}function Gn(e){return e.family==="control"&&["call","discriminator-dispatch","result-callback","runtime-handoff"].includes(e.subtype)}function zr(e,t){let n=t.get(e.fromNodeId),o=t.get(e.toNodeId);if(!n||!o)return!1;let i=jn(n,"ownerNodeId")??(n.kind==="symbol"?n.id:null),s=jn(o,"ownerNodeId")??(o.kind==="symbol"?o.id:null);return i!==null&&i===s}function Gr(e,t){if(!t)return null;let n=new Map;for(let o of t){let i=n.get(o.file)??[];i.push(o.line),n.set(o.file,i)}return new Set(e.filter(o=>{if(!o.location||o.kind==="parameter")return!1;let i=n.get(o.location.file)??[],s=o.location.endLine??o.location.line;return i.some(r=>r>=o.location.line&&r<=s)}).map(o=>o.id))}function Hr(e,t){if(!t)return null;let n=new Map;for(let o of t){let i=n.get(o.file)??[];i.push(o.line),n.set(o.file,i)}return new Set(e.filter(o=>o.evidence.some(i=>{if(!i.location)return!1;let s=n.get(i.location.file)??[],r=i.location.endLine??i.location.line;return s.some(a=>a>=i.location.line&&a<=r)})).map(o=>o.id))}function Wr(e,t){return t===null?null:new Set(e.filter(n=>t.has(n.id)).flatMap(n=>[n.fromNodeId,n.toNodeId]))}function jn(e,t){let n=e.attributes[t];return typeof n=="string"?n:null}function qn(e){return e.disposition==="excluded"||e.disposition==="unsupported"||!Hn(e)?!1:e.evidence.some(t=>t.strength==="exact"||t.strength==="derived")}function Hn(e){return(e.semantics??[]).some(t=>t.family!=="identity"||nt.has(t.subtype))}function Wn(e){return e.subtype.startsWith("predicate-")||e.subtype.startsWith("loop-")||e.subtype.startsWith("exception-")||e.subtype.startsWith("finally-")||e.subtype.startsWith("handler-")}function Vr(e,t){return t.has(e.fromNodeId)||t.has(e.toNodeId)}function Qr(e,t){return[...e.fromNodeIds,...e.memberNodeIds].some(n=>t.has(n))}function pe(e){return[...new Set(e)].sort()}import{createHash as Yr}from"crypto";var ot=["identity","contract","control","data","state","temporal"],Jr=new Set(ot);function it(e){let t=Fe(e.anchors,"anchor"),n=Fe(e.nodes,"node"),o=Fe(e.edges,"edge"),i=Fe(e.paths??[],"path"),s=Fe(e.frontiers??[],"frontier"),r=new Set(t.map(m=>m.id)),a=new Set(n.map(m=>m.id)),d=new Set(o.map(m=>m.id)),c=e.routeCatalog?{...e.routeCatalog,routes:Fe(e.routeCatalog.routes,"route"),selectedRouteIds:J(e.routeCatalog.selectedRouteIds)}:void 0;for(let m of t)Z(`anchor ${m.id}`,[...m.nodeIds,...m.candidateNodeIds],a,"node");for(let m of n)Z(`node ${m.id}`,m.anchorIds,r,"anchor");for(let m of o){if(Z(`edge ${m.id}`,[m.fromNodeId,m.toNodeId],a,"node"),m.evidence.length===0)throw new Error(`Exploration edge ${m.id} has no evidence source.`);ei(m)}for(let m of i)Z(`path ${m.id}`,[m.fromAnchorId,m.toAnchorId],r,"anchor"),Z(`path ${m.id}`,m.nodeIds,a,"node"),Z(`path ${m.id}`,m.edgeIds,d,"edge");for(let m of s)if(Z(`frontier ${m.id}`,m.fromNodeIds,a,"node"),Z(`frontier ${m.id}`,m.edgeIds,d,"edge"),Z(`frontier ${m.id}`,m.memberNodeIds,a,"node"),m.memberCount!==m.memberNodeIds.length)throw new Error(`Exploration frontier ${m.id} reports ${m.memberCount} member(s) but identifies ${m.memberNodeIds.length}.`);for(let m of c?.routes??[])Z(`route ${m.id}`,m.nodeIds,a,"node"),Z(`route ${m.id}`,m.edgeIds,d,"edge"),Z(`route ${m.id}`,[m.anchorNodeId,m.endpointNodeId],a,"node");c&&Z("route catalog selection",c.selectedRouteIds,new Set(c.routes.map(m=>m.id)),"route");let l=J(e.incompleteReasons??[]),u=l.length===0?"accounted":"incomplete",f=t.reduce((m,p)=>m+p.omittedCandidates,0);return{schemaVersion:1,anchors:t,nodes:n,edges:o,paths:i,frontiers:s,coverage:{status:u,scope:e.scope,nodes:no(n),edges:no(o),matchedAnchors:t.filter(m=>m.status==="matched").length,ambiguousAnchors:t.filter(m=>m.status==="ambiguous").length,missingAnchors:t.filter(m=>m.status==="missing").length,omittedCandidates:f,frontierGroups:s.length,programEdges:Zr(o),blindSpots:J(e.blindSpots??[]),explanation:u==="accounted"?"Every node and edge discovered within the declared query scope is emitted, folded with recoverable identity, explicitly excluded, or reported unsupported.":`The declared query scope is not fully accounted for: ${l.join("; ")}`},completion:oi(u,i,e.scope),...c?{routeCatalog:c}:{}}}function Xr(e){return e.flatMap(t=>ti(t.semantics??[]).map(n=>({id:ni(t.id,n),sourceEdgeId:t.id,sourceKind:t.kind,fromNodeId:t.fromNodeId,toNodeId:t.toNodeId,directed:!0,disposition:t.disposition,evidence:[...t.evidence],family:n.family,subtype:n.subtype,...n.context?{context:{...n.context}}:{},...n.attributes?{attributes:{...n.attributes}}:{}}))).sort((t,n)=>t.id.localeCompare(n.id))}function Zr(e){let t=Xr(e),n=new Set(t.map(r=>r.sourceEdgeId)),o=new Map(ot.map(r=>[r,new Set])),i=new Map(ot.map(r=>[r,new Set])),s=new Map(ot.map(r=>[r,0]));for(let r of t)o.get(r.family).add(r.sourceEdgeId),i.get(r.family).add(r.subtype),s.set(r.family,s.get(r.family)+1);return{sourceEdges:e.length,mappedSourceEdges:n.size,projectedEdges:t.length,unmappedSourceEdges:e.length-n.size,unsupportedSourceEdges:e.filter(r=>r.disposition==="unsupported").length,unmappedKinds:J(e.filter(r=>!n.has(r.id)).map(r=>r.kind)),families:{identity:Re("identity",o,s,i),contract:Re("contract",o,s,i),control:Re("control",o,s,i),data:Re("data",o,s,i),state:Re("state",o,s,i),temporal:Re("temporal",o,s,i)}}}function Re(e,t,n,o){return{sourceEdges:t.get(e)?.size??0,projectedEdges:n.get(e)??0,subtypes:[...o.get(e)??[]].sort()}}function ei(e){let t=new Set;for(let n of e.semantics??[]){if(!Jr.has(n.family))throw new Error(`Exploration edge ${e.id} has unknown program edge family: ${n.family}.`);if(n.subtype.trim().length===0)throw new Error(`Exploration edge ${e.id} has an empty program edge subtype.`);let o=Tt(n);if(t.has(o))throw new Error(`Exploration edge ${e.id} repeats program edge semantic ${o}.`);t.add(o)}}function ti(e){return[...e].sort((t,n)=>Tt(t).localeCompare(Tt(n)))}function Tt(e){return`${e.family}:${e.subtype}`}function ni(e,t){return`program:${encodeURIComponent(e)}:${t.family}:${encodeURIComponent(t.subtype)}`}function oi(e,t,n){return e==="incomplete"||t.some(o=>o.status!=="connected")?{status:"coverage-incomplete",scope:n,explanation:"The declared graph query has an ambiguous, missing, candidate-only, or disconnected anchor relationship."}:t.length>0?{status:"connector-complete",scope:n,explanation:"Every requested anchor pair has a selected path supported by proved repository relationships."}:{status:"frontier-accounted",scope:n,explanation:"Every discovered direction in the declared graph query is emitted or represented by an exact frontier."}}function oo(e,t={}){let n=t.maxSelectedNodes??24;if(!Number.isSafeInteger(n)||n<=0)throw new RangeError(`maxSelectedNodes must be a positive safe integer; received ${n}`);let o=new Set(e.anchors.flatMap(g=>[...g.nodeIds,...g.candidateNodeIds])),i=[],s=e.anchors.filter(g=>g.status!=="missing"&&g.nodeIds.length+g.candidateNodeIds.length>0);for(let g=0;g<s.length;g+=1)for(let R=g+1;R<s.length;R+=1){let $=s[g],B=s[R],A=Xn(e,$,B,!1),h=A??Xn(e,$,B,!0);h?(h.nodeIds.forEach(k=>o.add(k)),i.push({id:rt("path",$.id,B.id),fromAnchorId:$.id,toAnchorId:B.id,status:!A||$.status==="ambiguous"||B.status==="ambiguous"?"candidate":"connected",nodeIds:h.nodeIds,edgeIds:h.edgeIds})):i.push({id:rt("path",$.id,B.id),fromAnchorId:$.id,toAnchorId:B.id,status:"partial",nodeIds:[],edgeIds:[]})}let r=J(t.routeIds??[]),a=ri(e,r),d=new Set(a.routes.map(g=>g.id)),c=r.filter(g=>!d.has(g));if(c.length>0)throw new Error(`Unknown exploration route id(s): ${c.join(", ")}`);let u=a.routes.filter(g=>r.includes(g.id)).map(g=>({anchorNodeId:g.anchorNodeId,endpointNodeId:g.endpointNodeId,endpointKind:g.endpointKind,endpointPriority:2,nodeIds:[...g.nodeIds].reverse(),edgeIds:[...g.edgeIds].reverse()}));for(let g of u)g.nodeIds.forEach(R=>o.add(R));let f=i.length===0||i.some(g=>g.edgeIds.length>0);f&&eo(e,o,n);let m=to(e,o),p=new Set(t.expandedFrontierIds??[]),b=new Set(m.map(g=>g.id)),S=[...p].filter(g=>!b.has(g)).sort();if(S.length>0)throw new Error(`Unknown exploration frontier id(s): ${S.join(", ")}`);for(let g of m)p.has(g.id)&&g.memberNodeIds.forEach(R=>o.add(R));f&&eo(e,o,n);let w=new Map(u.map(g=>[g.endpointNodeId,g.endpointKind])),I=new Set(u.flatMap(g=>g.nodeIds)),L=new Map;for(let g of u)for(let R=0;R<g.nodeIds.length;R+=1){let $=g.nodeIds[R],B=R;L.set($,Math.max(L.get($)??0,B))}let N=e.nodes.map(g=>{let R=w.get(g.id),$=I.has(g.id)?{upstreamCausalPath:!0,upstreamCausalDistance:L.get(g.id)??0,...R?{upstreamCausalEndpoint:R}:{}}:{};return{...g,attributes:{...g.attributes,...$},disposition:g.disposition==="excluded"||g.disposition==="unsupported"?g.disposition:o.has(g.id)?"emitted":"folded"}}),y=new Set([...i.flatMap(g=>g.edgeIds),...u.flatMap(g=>g.edgeIds)]),E=e.edges.map(g=>({...g,disposition:g.disposition==="excluded"||g.disposition==="unsupported"?g.disposition:y.has(g.id)||o.has(g.fromNodeId)&&o.has(g.toNodeId)?"emitted":"folded"})),C=it({anchors:e.anchors,nodes:N,edges:E,paths:i,frontiers:[...e.frontiers.filter(g=>g.disposition!=="folded"),...to({...e,nodes:N,edges:E},o)],scope:e.coverage.scope,blindSpots:e.coverage.blindSpots,incompleteReasons:e.coverage.status==="incomplete"?[e.coverage.explanation]:[],routeCatalog:a}),v=new Set(C.frontiers.flatMap(g=>g.edgeIds)),F=C.edges.filter(g=>g.disposition==="folded"&&!v.has(g.id)).map(g=>g.id);if(F.length>0)throw new Error(`Folded exploration edge(s) are not frontier-accounted: ${F.sort().join(", ")}`);return C}var Vn=10;function ri(e,t=[]){let n=new Map(e.nodes.map(S=>[S.id,S])),o=new Map(e.edges.map(S=>[S.id,S])),i=new Map;for(let S of e.edges){if(!ii(S))continue;let w=i.get(S.toNodeId)??[];w.push(S),i.set(S.toNodeId,w)}for(let S of i.values())S.sort((w,I)=>Number(qe(I))-Number(qe(w))||Jn(I)-Jn(w)||w.fromNodeId.localeCompare(I.fromNodeId)||w.id.localeCompare(I.id));let s=J(e.anchors.filter(S=>S.status==="matched").flatMap(S=>S.nodeIds)),r=new Map,a=new Set,d=(S,w,I)=>{let L=w.nodeIds[w.nodeIds.length-1],N=n.get(L),y=n.get(S);if(!N?.location||!y)return;let E=[...w.nodeIds].reverse(),C=[...w.edgeIds].reverse(),v=new Set(E),F=C.flatMap(A=>{let H=o.get(A);return H?[H]:[]}),g=e.edges.filter(A=>A.disposition!=="excluded"&&A.disposition!=="unsupported"&&(v.has(A.fromNodeId)||v.has(A.toNodeId))),R={id:rt("route",S,L,I,...C),status:"proved",anchorNodeId:S,anchorLabel:y.label,endpointNodeId:L,endpointLabel:N.label,endpointLocation:{...N.location},endpointKind:I,nodeIds:E,edgeIds:C,evidenceStrengths:J(F.flatMap(A=>A.evidence.map(H=>H.strength))),spineEdgeFamilies:Qn(F,!0),relatedEdgeFamilies:Qn(g,!1),crossesRuntimeBoundary:F.some(qe)},$=`${S}\0${L}\0${I}`,B=r.get($);(!B||Yn(R,B)<0)&&r.set($,R)};for(let S of s){n.get(S)?.attributes.publicEntry===!0&&d(S,{nodeIds:[S],edgeIds:[]},"public-entry");let w=[{nodeIds:[S],edgeIds:[]}],I=new Map([[S,0]]);for(let L=0;L<w.length;L+=1){let N=w[L],y=N.nodeIds[N.nodeIds.length-1];N.edgeIds.length>0&&n.get(y)?.location&&n.get(y)?.attributes.publicEntry===!0&&d(S,N,"public-entry");let E=i.get(y)??[];if(N.edgeIds.length>=Vn){E.some(C=>!N.nodeIds.includes(C.fromNodeId))&&a.add(S);continue}for(let C of E){if(N.nodeIds.includes(C.fromNodeId))continue;let v=N.edgeIds.length+1,F=I.get(C.fromNodeId);if(F!==void 0&&F<=v)continue;let g={nodeIds:[...N.nodeIds,C.fromNodeId],edgeIds:[...N.edgeIds,C.id]};if(I.set(C.fromNodeId,v),qe(C)&&n.get(C.fromNodeId)?.location){d(S,g,"runtime-boundary");continue}w.push(g)}}}let c=[...r.values()].sort(Yn),l=new Set(c.map(S=>S.id)),u=J(t.filter(S=>l.has(S))),f=J(c.map(S=>S.anchorNodeId)),m=s.filter(S=>!f.includes(S)),p=[...a].sort(),b=e.coverage.status==="accounted"&&p.length===0?"accounted":"incomplete";return{schemaVersion:1,routes:c,selectedRouteIds:u,coverage:{status:b,scope:"Distinct proved public-entry and runtime-boundary endpoints reachable upstream in the supplied topology.",enumeration:"one-shortest-proved-path-per-endpoint",maximumDepth:Vn,anchorNodeIds:s,anchorsWithRoutes:f,anchorsWithoutRoutes:m,depthLimitedAnchorNodeIds:p,routeCount:c.length,explanation:b==="accounted"?"Every distinct proved upstream public/runtime endpoint in the supplied topology has one stable shortest route.":"Route enumeration is incomplete because the supplied topology has incomplete coverage or a traversal reached the route-depth bound."}}}function Qn(e,t){let n=e.flatMap(o=>o.semantics?.map(i=>i.family)??[]);return t&&e.length>0&&n.length===0&&n.push("control"),J(n)}function Yn(e,t){return e.anchorNodeId.localeCompare(t.anchorNodeId)||e.edgeIds.length-t.edgeIds.length||e.endpointKind.localeCompare(t.endpointKind)||e.endpointNodeId.localeCompare(t.endpointNodeId)||e.id.localeCompare(t.id)}function ii(e){return e.disposition!=="excluded"&&e.disposition!=="unsupported"&&si(e)&&e.evidence.some(t=>["exact","derived","mixed"].includes(t.strength))}function si(e){return qe(e)||e.kind==="boundary-observation"||e.kind==="call"||e.kind==="compiler:call"}function qe(e){return e.kind==="runtime-boundary"||e.kind.startsWith("runtime:")}function Jn(e){let t={exact:5,derived:4,mixed:3,candidate:1,unknown:0};return Math.max(0,...e.evidence.map(n=>t[n.strength]))}function Xn(e,t,n,o){return Zn(e,t,n,o)??Zn(e,n,t,o)}function Zn(e,t,n,o){let i=[...t.nodeIds,...t.candidateNodeIds].sort(),s=new Set([...n.nodeIds,...n.candidateNodeIds]);if(i.some(l=>s.has(l)))return{nodeIds:[i.find(u=>s.has(u))],edgeIds:[]};let r=new Set(e.nodes.filter(l=>l.kind==="structural-region").map(l=>l.id)),a=new Map;for(let l of e.edges)l.disposition==="excluded"||l.disposition==="unsupported"||l.kind==="structural-membership"||r.has(l.fromNodeId)||r.has(l.toNodeId)||l.evidence.every(f=>["candidate","unknown"].includes(f.strength))&&!o||ai(a,l.fromNodeId,l.toNodeId,l.id);for(let l of a.values())l.sort((u,f)=>u.nodeId.localeCompare(f.nodeId)||u.edgeId.localeCompare(f.edgeId));let d=i.map(l=>({nodeId:l,nodeIds:[l],edgeIds:[]})),c=new Set(i);for(let l=0;l<d.length;l+=1){let u=d[l];for(let f of a.get(u.nodeId)??[]){if(c.has(f.nodeId))continue;let m={nodeId:f.nodeId,nodeIds:[...u.nodeIds,f.nodeId],edgeIds:[...u.edgeIds,f.edgeId]};if(s.has(f.nodeId))return m;c.add(f.nodeId),d.push(m)}}return null}function ai(e,t,n,o){let i=e.get(t)??[];i.push({nodeId:n,edgeId:o}),e.set(t,i)}function li(e,t,n){let o=new Map;for(let a of e.edges){let d=o.get(a.fromNodeId)??{incoming:0,outgoing:0},c=o.get(a.toNodeId)??{incoming:0,outgoing:0};d.outgoing+=1,c.incoming+=1,o.set(a.fromNodeId,d),o.set(a.toNodeId,c)}let i=new Set,s=new Map;for(let a of e.edges){let d=t.has(a.fromNodeId),c=t.has(a.toNodeId);if(d===c)continue;let l=d?a.toNodeId:a.fromNodeId,u=d?a.fromNodeId:a.toNodeId,f=e.nodes.find(b=>b.id===l);if(f?.kind==="structural-region")continue;let m=s.get(l)??new Set;m.add(u),s.set(l,m),(/(?:runtime-boundary|external)/u.test(a.kind)||f&&/(?:frontier|external)/u.test(f.kind))&&i.add(l)}let r=[...s].filter(([a,d])=>{if(i.has(a))return!0;let c=o.get(a)??{incoming:0,outgoing:0};return(c.incoming>1||c.outgoing>1)&&d.size>1}).sort(([a,d],[c,l])=>Number(i.has(c))-Number(i.has(a))||l.size-d.size||a.localeCompare(c)).map(([a])=>a);for(let a of r){if(t.size>=n)break;t.add(a)}}function eo(e,t,n){let o=-1;for(;t.size!==o&&t.size<n;)o=t.size,li(e,t,n)}function to(e,t){let n=new Set(e.nodes.filter(r=>!t.has(r.id)&&r.disposition!=="excluded"&&r.disposition!=="unsupported").map(r=>r.id)),o=new Map;for(let r of e.edges){if(!n.has(r.fromNodeId)||!n.has(r.toNodeId))continue;let a=o.get(r.fromNodeId)??new Set,d=o.get(r.toNodeId)??new Set;a.add(r.toNodeId),d.add(r.fromNodeId),o.set(r.fromNodeId,a),o.set(r.toNodeId,d)}let i=[],s=new Set;for(let r of[...n].sort()){if(s.has(r))continue;let a=[],d=[r];s.add(r);for(let c=0;c<d.length;c+=1){let l=d[c];a.push(l);for(let u of[...o.get(l)??[]].sort())s.has(u)||(s.add(u),d.push(u))}i.push(a.sort())}return i.map(r=>{let a=new Set(r),d=e.edges.filter(p=>a.has(p.fromNodeId)||a.has(p.toNodeId)),c=d.filter(p=>a.has(p.fromNodeId)!==a.has(p.toNodeId)),l=J(c.map(p=>a.has(p.fromNodeId)?p.toNodeId:p.fromNodeId)),u=new Set(c.map(p=>a.has(p.toNodeId)?"outgoing":"incoming")),f=J(d.map(p=>p.id)),m=J(c.map(p=>p.kind));return{id:rt("frontier",...r,...f),kind:m.join("+")||"disconnected",direction:u.size===1?[...u][0]:"undirected",fromNodeIds:l,edgeIds:f,memberNodeIds:r,memberCount:r.length,disposition:"folded",reason:c.length>0?"Connected evidence is folded beyond the first edge leaving the selected connector graph.":"Discovered evidence is disconnected from every selected anchor connector under the declared relation scope.",expansion:null}})}function rt(e,...t){let n=Yr("sha256").update(t.join("\0")).digest("hex").slice(0,16);return`${e}:${n}`}function Fe(e,t){let n=[...e].sort((o,i)=>o.id.localeCompare(i.id));for(let o=1;o<n.length;o+=1)if(n[o-1].id===n[o].id)throw new Error(`Duplicate exploration ${t} id: ${n[o].id}`);return n}function Z(e,t,n,o){let i=J(t.filter(s=>!n.has(s)));if(i.length>0)throw new Error(`Exploration ${e} references missing ${o}(s): ${i.join(", ")}`)}function no(e){return{total:e.length,emitted:e.filter(t=>t.disposition==="emitted").length,folded:e.filter(t=>t.disposition==="folded").length,excluded:e.filter(t=>t.disposition==="excluded").length,unsupported:e.filter(t=>t.disposition==="unsupported").length}}function J(e){return[...new Set(e)].sort()}var di=5,ci=12,ui=8,pi=3,ro=8,mi=6,fi=12,io=12,gi=12,yi=2,bi=new Set(["branch","loop","call","await","return","throw","mutation","catch","finally"]),Si=9e3,so=fn,ao=new WeakMap;function Ua(e,t){return So(e,t,"full")}function za(e,t){return So(e,t,"topology")}function hi(e,t,n,o,i,s=!1){let r=e.get(t);if(r)return r.depth=Math.min(r.depth,n),r.primary||=i,r.promoteBoundaryImports||=s,r.origins.add(o),r;let a={file:t,depth:n,primary:i,promoteBoundaryImports:s,origins:new Set([o]),processed:!1};return e.set(t,a),a}function xi(e,t,n,o,i,s,r="none",a=!1){let d=e.get(n.symbol);if(d)return d.depth=Math.min(d.depth,o),d.origins.add(i),s&&d.anchorQueries.add(s),d.referenceScope=Ss(d.referenceScope,r),t(n.relativePath,o,i,!0,a),d;let c={definition:n,depth:o,origins:new Set([i]),anchorQueries:new Set(s?[s]:[]),referenceScope:r,processed:!1};return e.set(n.symbol,c),t(n.relativePath,o,i,!0,a),c}function vi(e,t,n,o,i,s,r=!1,a=!0){let d=de(n),c=e.get(d);if(c)return c.depth=Math.min(c.depth,o),c.origins.add(i),s&&c.anchorQueries.add(s),c.reverseCallExpansion||=r,c.traversalEligible||=a,t(n.file,o,i,c.traversalEligible,!0),c;let l={...n,depth:o,origins:new Set([i]),anchorQueries:new Set(s?[s]:[]),reverseCallExpansion:r,traversalEligible:a};return e.set(d,l),t(n.file,o,i,a,!0),l}function Ei(e){let{db:t,index:n,pendingRelations:o,addFile:i,addSymbol:s,addSourceConstruct:r,observation:a,depth:d,origin:c}=e;i(a.source.file,d,c,!0,!0),a.owner.file!==a.source.file&&i(a.owner.file,d,`${c}:owner`,!0,!0);let l=fe(t,a.owner.file),u=a.owner.symbol?ye(t,n,a.owner.symbol).matches.find(p=>p.relativePath===a.owner.file):null,f=(u&&!Y(u.symbol)?u:null)??Me(l,a.source.startLine);if(f&&!Y(f.symbol))return s(f,d,c,void 0,"none",!0),f.symbol;a.owner.name&&r({file:a.owner.file,name:a.owner.name,startLine:a.owner.startLine,endLine:a.owner.endLine},d,`${c}:source-owner`,void 0,!0);let m=e.index.definitionsForFile(a.source.file).filter(p=>!!p.leaf&>(t,a.source.file,p.leaf).some(b=>b>=a.source.startLine&&b<=a.source.endLine));if(m.length===1){let p=m[0];s(p,d,`${c}:handler-identifier`,void 0,"none",!0),ne(o,{kind:"runtime-boundary",evidence:"runtime-boundary:handler-identifier",fromFile:a.source.file,fromSymbol:null,toFile:p.relativePath,toSymbol:p.symbol,fromBoundaryParticipant:Pe(a),line:a.source.startLine,strength:"derived"})}return null}function Ii(e){let t=0,n=0,o=0;for(let i of e.searches){let s=ts(e.db,e.index,i,e.boundaryObservationLocations),r=s.filter(l=>ss(l,e.sourceAllowed)),a=!e.opts.fullLiteralTraversal&&(s.length>ci||r.length>ui),d=a?[]:s,c=new Set((a?[]:e.opts.fullLiteralTraversal?r:[...r].sort(ns).slice(0,pi)).map(mo));a&&(n+=1,o+=s.length);for(let l of d){let u=c.has(mo(l)),f=u&&!l.ownerSymbol&&l.ownerStartLine!==null&&l.ownerEndLine!==null;if(e.addFile(l.relativePath,0,`${u?"literal-anchor":"literal-match"}:${i}`,f,f),f&&e.addSourceConstruct({file:l.relativePath,name:l.ownerShortName??`${l.relativePath}:${l.ownerStartLine+1}`,startLine:l.ownerStartLine,endLine:l.ownerEndLine},0,`literal-source-owner:${i}`,i,!0),u&&l.ownerSymbol){let m=ye(e.db,e.index,l.ownerSymbol).matches[0];m&&!Y(m.symbol)&&e.addSymbol(m,0,"literal-owner",i,"all",!0)}e.literalHits.push({query:i,file:l.relativePath,line:l.line,ownerSymbol:l.ownerSymbol,ownerShortName:l.ownerShortName,ownerStartLine:l.ownerStartLine,ownerEndLine:l.ownerEndLine,sourceLine:l.sourceLine.trim(),matchKind:l.matchKind,traversalSeed:u})}e.anchors.push({kind:"literal",query:i,status:s.length>0?"matched":"missing",matchedRegionIds:[],matchingLines:s.length,seedMatchingLines:a?0:c.size,matchOnlyLines:s.length-c.size,eligibleSeedMatchingLines:r.length,materializedMatchingLines:d.length,withheldMatchingLines:a?s.length:0,literalTraversal:a?"withheld-broad":"materialized",representativeMatches:a?as(i,s):void 0,narrowingCommands:a?ds(i,s):void 0,exhaustiveTraversalCommand:a||c.size<r.length?`scip-query system-map --search ${O(i)} --full-literal-traversal`:void 0,seedRegionIds:[],matchOnlyRegionIds:[]})}for(let i of e.symbolQueries){let s=ye(e.db,e.index,i);t+=s.omitted;let r=os(e.db,i),a=s.matches.filter(f=>!Y(f.symbol)),d=r!==null&&a.length===0;d&&e.addSourceConstruct(r,0,"source-construct-anchor",i,!0);let c=d?a:s.matches;for(let f of c)e.addSymbol(f,0,"symbol-anchor",i,"all",!0);let l=d?rs(r):null,u=d?1:s.total;e.anchors.push({kind:"symbol",query:i,status:u===0?"missing":u===1?"matched":"ambiguous",matchedRegionIds:[],symbolCandidates:[...l?[l]:[],...c.map(fs)],totalSymbolCandidates:u,omittedSymbolCandidates:s.omitted})}return{omittedSymbolCandidates:t,broadLiteralAnchors:n,withheldLiteralMatches:o}}function Ci(e){let{db:t,opts:n,mode:o,searches:i,symbolQueries:s,maxDepth:r,maxTopologyCharacters:a,requestedRelationKinds:d,evidenceFloor:c,includedSourceScopes:l,workspaces:u,runtimeBoundaries:f,boundaryObservations:m,representedBoundaryLinkIds:p,files:b,symbols:S,sourceConstructs:w,literalHits:I,pendingRelations:L,externalImports:N,anchors:y,omittedSymbolCandidates:E,broadLiteralAnchors:C,withheldLiteralMatches:v,filteredUnverifiedCallEdges:F,memberCallCandidateEdges:g,unresolvedMemberCallsites:R,sourceAllowed:$}=e,B=new Set(d),A=new Map;for(let x of b.keys())A.set(x,Ue(x,u));let H=[...L.values()].filter(x=>A.has(x.fromFile)&&A.has(x.toFile)).map(x=>({...x,fromRegionId:A.get(x.fromFile).id,toRegionId:A.get(x.toFile).id})).sort(Eo),h=Ms(H),k=new Set(n.expand??[]),M=Is(b,S,I,H,h,A,k),_=new Set([...b.values()].filter(x=>[...x.origins].some(P=>P.startsWith("literal-anchor:")||P==="literal-owner"||P==="symbol-anchor")).map(x=>A.get(x.file).id)),W=Xi(M),q=new Set(M.map(x=>x.id)),U=[...k].filter(x=>!q.has(x)).sort();for(let x of y)if(x.matchedRegionIds=Rs(x,I,S,A),x.kind==="literal"){let P=I.filter(z=>z.query===x.query);x.seedRegionIds=D(P.filter(z=>z.traversalSeed).map(z=>A.get(z.file).id)),x.matchOnlyRegionIds=D(P.filter(z=>!z.traversalSeed).map(z=>A.get(z.file).id))}let K=[...S.values()].filter(x=>!x.processed).length,ae=[...b.values()].filter(x=>x.primary&&!x.processed).length,Le=[...b.values()].filter(x=>!x.primary&&!x.processed).length,ze=[...S.values()].filter(x=>x.processed),we=(f?.frontiers??[]).flatMap(x=>{let P=m.get(x.observationId);return!P&&x.source&&x.action&&x.strength?!B.has("runtime-boundary")||!$(x.source.file)||c==="exact"||!b.has(x.source.file)?[]:[{observationId:x.observationId,action:x.action,strength:x.strength,file:x.source.file,line:x.source.startLine,ownerShortName:x.ownerShortName??null,address:x.address??x.missingKeyParts.join(", "),reason:x.reason}]:!B.has("runtime-boundary")||!P||!$(P.source.file)||c==="exact"&&P.strength!=="exact"||!b.has(P.source.file)?[]:[{observationId:P.id,action:P.action,strength:P.strength,file:P.source.file,line:P.source.startLine,ownerShortName:P.owner.name,address:vo(P),reason:x.reason,protocol:P.protocol,role:P.role,modality:P.modality,resolution:P.resolution,sourceScope:P.sourceScope,keyParts:P.keyParts.map(z=>({name:z.name,value:z.value,evidence:z.evidence}))}]}).sort((x,P)=>x.file.localeCompare(P.file)||x.line-P.line),me=(f?.links??[]).filter(x=>{if(!B.has("runtime-boundary")||c==="exact"&&x.strength!=="exact")return!1;let P=m.get(x.from),z=m.get(x.to);return!!(P&&z&&$(P.source.file)&&$(z.source.file)&&(b.has(P.source.file)||b.has(z.source.file)))}),T=me.filter(x=>x.strength==="exact").length,oe=me.filter(x=>x.strength==="derived").length,re=me.filter(x=>x.strength==="candidate").length,be=f?.links.filter(x=>x.strength==="exact").length??0,Se=f?.links.filter(x=>x.strength==="derived").length??0,ke=f?.links.filter(x=>x.strength==="candidate").length??0,ct=Ns(N,A),ut=E===0?"accounted":"incomplete",Bt=[...C>0?[`${C} broad literal anchor(s) withheld ${v} exact match(es) before graph traversal; representative identities and scoped search commands preserve recovery without treating every textual occurrence as relevant.`]:[],`Literal matches outside the included source scopes (${l.join(", ")}) remain visible as match-only evidence and do not seed traversal.`,f?"Built-in runtime-boundary extractors traverse direct and replayably derived links; heuristic candidates, unsupported frameworks, reflection, generated names, and dependency wiring not recoverable from compiler occurrences or constructor assignments remain disclosed frontiers.":"Runtime-boundary evidence is unavailable for this index; run scip-query reindex with this build to extract supported HTTP, event, registry, and persistence observations.","Reverse references do not recursively expand from discovered callers or callees.","Member calls use compiler occurrences, exact constructor-assigned fields, bounded unique service providers, direct factory-return members, and compiler-resolved object-literal callbacks when available. Ambiguous providers remain candidate frontiers; callback values routed through mutation, reflection, or unsupported dependency containers remain unrepresented.","Literal traversal is bounded to the smallest parser-delimited source construct; parser gaps may reduce an owner to one source line and leave its continuation untraversed.","Schema consumers stay within forward-flow regions; cross-workspace contracts may discover consumers in other workspaces. Add an explicit symbol anchor to widen either scope.",`Traversal stops after depth ${r}; nonzero frontier counts identify evidence that was discovered but not traversed.`,"Region labels are structural path groupings, not inferred runtime or architectural boundaries."],ie=ji({db:t,anchors:y,regions:M,symbolStates:S,sourceConstructStates:w,literalHits:I,relations:H,externalBoundaries:ct,boundaryFrontiers:we,regionForFile:A,closureStatus:ut,omittedSymbolCandidates:E,maxDepth:r,requestedRelationKinds:d,evidenceFloor:c,includedSourceScopes:l,blindSpots:Bt,topologyFrontiers:n.topologyFrontiers??[],routeIds:n.routeIds??[],expandedRegionIds:[...k],maxTopologyCharacters:a,fullLiteralTraversal:n.fullLiteralTraversal??!1});if(o==="topology")return ie;let Ot=(n.behaviorFocusLocations?.length??0)>0?new Set([...ie.anchors.flatMap(x=>x.nodeIds),...ie.paths.flatMap(x=>x.nodeIds)]).size:void 0,Ge=dn(t,ie,{focusLocations:n.behaviorFocusLocations,...Ot?{maxSteps:Ot}:{}});pn(t,ie,Ge);let Co=Ri(t,ie,Ge,n.behaviorFocusLocations??[]);ie.corridor=zn(ie,{focusLocations:Co});let _t=un(t,ie,Ge,{sourceAllowed:$,selectionTerms:n.selectionTerms}),Kt=Hi(ie),Lo=Yi(i,s,r,d,c,l,n.fullLiteralTraversal??!1,a,M,h,_,k,Kt),wo=Qi(i,s,r,M.filter(x=>Kt.has(x.id)),_,d,c,l,n.fullLiteralTraversal??!1,a);return{anchors:y,regions:M,regionRelations:h,externalBoundaries:ct,boundaryFrontiers:we,unmatchedExpansions:U,expansion:wo,drilldown:W,presentation:Lo,topology:ie,behavior:Ge,nextAnchors:_t,closure:{status:ut,emitted:{regions:M.length,relations:H.length,runtimeLinks:p.size},withheld:{symbols:K,files:ae+Le,regions:ie.nodes.filter(x=>x.kind==="structural-region"&&x.disposition==="folded").length,drillAnchors:(W?.omittedAnchors??0)+_t.omittedAnchors,literalMatches:v},ambiguous:{anchors:y.filter(x=>x.status==="ambiguous").length,omittedSymbolCandidates:E},external:ct.length,unresolved:we.length,explanation:ut==="accounted"?"Every fact reached under the declared anchors, relations, depth, evidence floor, source scopes, and installed analyzers is accounted for as emitted, withheld, ambiguous, external, or unresolved.":"Some ambiguous symbol candidates were not identified, so the declared query is not fully accounted for."},coverage:{explicitAnchorCount:y.length,requestedRelationKinds:d,evidenceFloor:c,includedSourceScopes:l,matchedAnchorCount:y.filter(x=>x.status!=="missing").length,literalSearchesComplete:!0,broadLiteralAnchors:C,withheldLiteralMatches:v,symbolCandidateSetsComplete:E===0,omittedSymbolCandidates:E,maxTraversalDepth:r,frontierSymbols:K,frontierFiles:ae,supportFilesNotTraversed:Le,filteredUnverifiedCallEdges:F,memberCallCandidateEdges:g,unresolvedMemberCallsites:R,runtimeBoundaryEvidenceAvailable:f!==null,runtimeBoundaryObservations:f?.observations.length??0,runtimeBoundaryExactLinks:T,runtimeBoundaryDerivedLinks:oe,runtimeBoundaryCandidateLinks:re,repositoryRuntimeBoundaryExactLinks:be,repositoryRuntimeBoundaryDerivedLinks:Se,repositoryRuntimeBoundaryCandidateLinks:ke,runtimeBoundaryTraversedLinks:p.size,runtimeBoundaryFrontiers:we.length,referenceExpansionEligibleSymbols:ze.filter(x=>x.referenceScope!=="none").length,referenceExpansionSkippedSymbols:ze.filter(x=>x.referenceScope==="none").length,dynamicDispatchRepresented:f?.links.some(x=>x.joinRule==="carrier.discriminator"&&p.has(x.id))??!1,runtimeGeneratedLinksRepresented:f!==null,regionBoundariesAreStructural:!0,relationFamilies:{"literal-anchor":{evidence:"exact-source",scope:"all indexed documents for each explicit literal",completeWithinScope:!0},reference:{evidence:"compiler-graph",scope:"all cross-file indexed/source-attributed sites for explicit anchors and promoted non-module boundary symbols",completeWithinScope:!0},call:{evidence:"mixed",scope:"static callees plus exact SCIP call occurrences in traversed source ranges, exact constructor-assigned member receivers, and uniquely attributed direct-import member candidates",completeWithinScope:!0},"contract-symbol":{evidence:"compiler-graph",scope:"compiler-resolved symbol identities referenced across inferred workspace boundaries",completeWithinScope:!0},import:{evidence:"compiler-graph",scope:"all indexed or source-resolved imports of traversed primary files",completeWithinScope:!0},"runtime-boundary":{evidence:"exact-source",scope:"direct and mechanically derived links produced by grounded runtime adapters and factorized relation groups",completeWithinScope:!0}},blindSpots:Bt}}}function Li(e,t){let{db:n,relationPolicy:o,sourceConstructs:i,reverseExpandedSourceConstructs:s,pendingRelations:r,reverseFileGraph:a,serviceCallerFilesBySourceConstruct:d,sourceAllowed:c,memberCallTargetsForWholeFile:l,addSymbol:u,addSourceConstruct:f}=e;if(o.has("call")){let m=[...i.values()].filter(p=>p.traversalEligible&&p.reverseCallExpansion&&p.depth<=t&&!s.has(de(p)));for(let p of m){s.add(de(p));let b=ce(n,p.file);if((b?.callables??[]).filter(I=>I.name===p.name&&I.startLine<=p.endLine&&I.endLine>=p.startLine).length===1){let I=(b?.callSites??[]).filter(L=>L.calleeLeaf===p.name&&!L.memberAccess);for(let L of I){let N=t+1,y=Me(fe(n,p.file),L.line),E=null,C=null;if(y&&!Y(y.symbol)){if(y.relativePath===p.file&&y.startLine<=p.endLine&&y.endLine>=p.startLine)continue;u(y,N,"reverse-local-call-owner",void 0,"forward-regions",!0),E=y.symbol}else{let v=Pt(n,p.file,L.line);v&&de(v)!==de(p)&&(C=f(v,N,"reverse-local-call-source-owner",void 0,!0))}!E&&!C||ne(r,{kind:"call",evidence:"ast-callsite",fromFile:p.file,fromSymbol:E,toFile:p.file,toSymbol:null,fromSourceConstruct:C?X(C):void 0,toSourceConstruct:X(p),line:L.line,strength:"derived"})}}let w=new Set([...a.get(p.file)??[],...d.get(de(p))??[],...sn(n,p.file).flatMap(I=>[...a.get(I)??[]])]);for(let I of w){if(!c(I))continue;let N=l(I).targets.filter(y=>y.targetFile===p.file&&y.targetStartLine<=p.endLine&&y.targetEndLine>=p.startLine);for(let y of N){let E=t+1,C=Me(fe(n,I),y.line),v=null,F=null;if(C&&!Y(C.symbol))u(C,E,"reverse-member-call-owner",void 0,"cross-workspace-or-forward",!0),v=C.symbol;else{let g=Pt(n,I,y.line);g&&(F=f(g,E,"reverse-member-call-source-owner",void 0,!0))}!v&&!F||ne(r,{kind:"call",evidence:"ast-service-member-callsite",fromFile:I,fromSymbol:v,toFile:p.file,toSymbol:null,fromSourceConstruct:F?X(F):void 0,toSourceConstruct:X(p),line:y.line,strength:y.strength==="exact"?"exact":"derived"})}}}}}function wi(e,t){let{db:n,index:o,relationPolicy:i,symbols:s,sourceAllowed:r,files:a,workspaces:d,addFile:c,addSymbol:l,addSourceConstruct:u,pendingRelations:f,fileGraph:m,traversalMetrics:p}=e,b=[...s.values()].filter(w=>!w.processed&&w.depth<=t),S=i.has("call")?o.calleeMap(b.map(w=>w.definition),{additive:!1,semantic:!1}):new Map;for(let w of b){w.processed=!0;let I=w.definition;if(w.referenceScope!=="none"&&(i.has("call")||i.has("reference")||i.has("contract-symbol"))){let L=us(n,o,I).filter(y=>r(y.file)&&bs(w,y.file,a,d)),N=new Set(L.flatMap(y=>{if(!(i.has("call")&&ce(n,y.file)?.callSites.some(v=>v.line===y.line&&lo(n,y.file,v,I))===!0)||!y.enclosingSymbol)return[];let C=ye(n,o,y.enclosingSymbol).matches[0];return C&&!Y(C.symbol)?[{owner:C,site:y}]:[]}).sort((y,E)=>{let C=ee(I.relativePath,d).relativeDir,v=ee(y.owner.relativePath,d).relativeDir===C,F=ee(E.owner.relativePath,d).relativeDir===C,g=co(n,y.owner),R=co(n,E.owner),$=y.owner.endLine-y.owner.startLine,B=E.owner.endLine-E.owner.startLine;return Number(F)-Number(v)||R-g||$-B||y.owner.symbol.localeCompare(E.owner.symbol)}).filter((y,E,C)=>C.findIndex(v=>v.owner.symbol===y.owner.symbol)===E).reduce((y,E)=>{if(y.length>=yi)return y;let C=ee(E.owner.relativePath,d).relativeDir;return y.some(v=>v.workspace===C)||y.push({symbol:E.owner.symbol,workspace:C}),y},[]).map(y=>y.symbol));for(let y of L){let E=t+1;c(y.file,E,`reference:${V(I.symbol)}`,!0);let C=i.has("call")&&ce(n,y.file)?.callSites.some(g=>g.line===y.line&&lo(n,y.file,g,I))===!0,v=null,F=null;if(y.enclosingSymbol){let g=ye(n,o,y.enclosingSymbol).matches[0];g&&!Y(g.symbol)&&(l(g,E,"reference-owner",void 0,C&&N.has(g.symbol)?w.referenceScope:"none"),v=g.symbol)}if(!v&&y.line!==null){let g=Pt(n,y.file,y.line);g&&(F=u(g,E,"reference-source-owner",void 0,C))}i.has("reference")&&ne(f,{kind:"reference",evidence:"indexed-or-source-reference",fromFile:y.file,fromSymbol:v,toFile:I.relativePath,toSymbol:I.symbol,fromSourceConstruct:F?X(F):void 0,line:y.line,strength:"mixed"}),C&&ne(f,{kind:"call",evidence:"ast-callsite",fromFile:y.file,fromSymbol:v,toFile:I.relativePath,toSymbol:I.symbol,fromSourceConstruct:F?X(F):void 0,line:y.line,strength:"derived"}),i.has("contract-symbol")&&ee(y.file,d).relativeDir!==ee(I.relativePath,d).relativeDir&&ne(f,{kind:"contract-symbol",evidence:"compiler-cross-workspace-symbol",fromFile:y.file,fromSymbol:v,toFile:I.relativePath,toSymbol:I.symbol,fromSourceConstruct:F?X(F):void 0,line:y.line,strength:"exact"})}}for(let L of S.get(I.symbolId)??[]){let N=ye(n,o,L.symbol).matches.find(E=>E.relativePath===L.file);if(!N||!r(N.relativePath))continue;if(!(N.relativePath===I.relativePath||(m.get(I.relativePath)??new Set).has(N.relativePath))){p.filteredUnverifiedCallEdges+=1;continue}l(N,t+1,`call:${V(I.symbol)}`,void 0,"none",!0),ne(f,{kind:"call",evidence:L.source,fromFile:I.relativePath,fromSymbol:I.symbol,toFile:N.relativePath,toSymbol:N.symbol,line:null,strength:Vi(L.source)})}}}function Mi(e,t){let{db:n,index:o,relationPolicy:i,files:s,sourceConstructs:r,symbols:a,boundaryObservations:d,boundaryObservationDepths:c,sourceAllowed:l,addSymbol:u,pendingRelations:f,traversalMetrics:m,addSourceConstruct:p,serviceCallerFilesBySourceConstruct:b,reverseFileGraph:S,externalImports:w,addFile:I,workspaces:L}=e,N=[...s.values()].filter(y=>!y.processed&&y.primary&&y.depth<=t);for(let y of N){y.processed=!0;let E=[...r.values()].filter(h=>h.traversalEligible&&h.file===y.file&&h.depth<=t),C=[...a.values()].filter(h=>h.definition.relativePath===y.file&&h.depth<=t).map(h=>{let k=ht(n,y.file,h.definition.startLine);return{startLine:k?.startLine??h.definition.startLine,endLine:k?.endLine??h.definition.endLine}}),v=h=>[...a.values()].filter(k=>k.definition.relativePath===y.file&&k.definition.startLine<=h&&k.definition.endLine>=h).sort((k,M)=>k.definition.endLine-k.definition.startLine-(M.definition.endLine-M.definition.startLine)||k.definition.startLine-M.definition.startLine)[0],F=[...d.values()].filter(h=>h.source.file===y.file&&c.has(h.id)),g=[...E.map(h=>({startLine:h.startLine,endLine:h.endLine})),...F.map(h=>({...st(n,h)}))],R=[...C,...g],$=(ce(n,y.file)?.callSites??[]).filter(h=>R.some(k=>h.line>=k.startLine&&h.line<=k.endLine)),B=new Set;if(i.has("call"))for(let h of R){let k=an(n,y.file,h.startLine,h.endLine);for(let M of k.targets){if(!l(M.definition.relativePath))continue;let _=v(M.sourceLine),W=E.find(U=>U.startLine<=M.sourceLine&&U.endLine>=M.sourceLine),q=F.find(U=>{let K=st(n,U);return K.startLine<=M.sourceLine&&K.endLine>=M.sourceLine});u(M.definition,t+1,`scip-occurrence-call:${y.file}:${M.sourceLine+1}`,void 0,"none",!0),ne(f,{kind:"call",evidence:"scip-occurrence-callsite",fromFile:y.file,fromSymbol:_?.definition.symbol??null,toFile:M.definition.relativePath,toSymbol:M.definition.symbol,fromBoundaryParticipant:q?Pe(q):void 0,fromSourceConstruct:W?X(W):void 0,line:M.sourceLine,strength:"exact"}),B.add(`${M.sourceLine}\0${M.calleeLeaf}`)}}if(i.has("reference"))for(let h of R){let k=ln(n,y.file,h.startLine,h.endLine);for(let M of k.targets){if(!l(M.definition.relativePath)||B.has(`${M.sourceLine}\0${M.calleeLeaf}`))continue;let _=v(M.sourceLine);if(_?.definition.symbol===M.definition.symbol)continue;let W=E.find(U=>U.startLine<=M.sourceLine&&U.endLine>=M.sourceLine),q=F.find(U=>{let K=st(n,U);return K.startLine<=M.sourceLine&&K.endLine>=M.sourceLine});u(M.definition,t+1,`scip-occurrence-reference:${y.file}:${M.sourceLine+1}`,void 0,"none",!0),ne(f,{kind:"reference",evidence:"scip-occurrence-reference",fromFile:y.file,fromSymbol:_?.definition.symbol??null,toFile:M.definition.relativePath,toSymbol:M.definition.symbol,fromBoundaryParticipant:q?Pe(q):void 0,fromSourceConstruct:W?X(W):void 0,line:M.sourceLine,strength:"exact"})}}let A=i.has("call")?St(n,y.file,{ranges:R,excludeIndexedTargets:!1}):{targets:[],unresolvedCallsites:0};m.unresolvedMemberCallsites+=A.unresolvedCallsites;let H=A.targets.filter(h=>!B.has(`${h.line}\0${h.calleeLeaf}`));m.memberCallCandidateEdges+=H.filter(h=>h.strength!=="exact"&&(h.resolution!=="imported-service-object-member"||(h.resolutionAlternativeCount??0)>1)).length;for(let h of H){let k=(h.resolutionAlternativeCount??1)===1,M=h.targetSymbol?fe(n,h.targetFile).find(K=>K.symbol===h.targetSymbol):void 0,_=M?null:p({file:h.targetFile,name:h.calleeLeaf,startLine:h.targetStartLine,endLine:h.targetEndLine},t+1,`member-call:${y.file}`,void 0,h.resolution==="imported-service-object-member"&&k,k);if(_&&h.serviceFile){let K=de(_),ae=b.get(K)??new Set;for(let Le of S.get(h.serviceFile)??[])ae.add(Le);b.set(K,ae)}M&&u(M,t+1,`member-call:${y.file}`,void 0,"none",!0);let W=E.find(K=>K.startLine<=h.line&&K.endLine>=h.line),q=v(h.line),U=F.find(K=>{let ae=st(n,K);return ae.startLine<=h.line&&ae.endLine>=h.line});ne(f,{kind:"call",evidence:h.resolution==="constructed-member-receiver"?"ast-constructed-member-callsite":h.resolution==="factory-callback-member"?"ast-factory-callback-callsite":h.resolution==="imported-service-object-member"?"ast-service-member-callsite":"ast-member-import-candidate",fromFile:y.file,fromSymbol:q?.definition.symbol??null,toFile:h.targetFile,toSymbol:M?.symbol??null,fromBoundaryParticipant:U?Pe(U):void 0,fromSourceConstruct:W?X(W):void 0,toSourceConstruct:_?X(_):void 0,line:h.line,strength:h.resolution==="imported-service-object-member"?(h.resolutionAlternativeCount??0)===1?"derived":"candidate":h.strength??"candidate"})}for(let h of i.has("import")||i.has("call")?ps(n,y.file):[]){if(!h.fromFile){if(i.has("import")){let M=w.get(h.shortName)??{name:h.shortName,fromFiles:new Set};M.fromFiles.add(y.file),w.set(h.shortName,M)}continue}if(!l(h.fromFile))continue;if(i.has("import")&&(I(h.fromFile,t+1,`import:${y.file}`,!1),ne(f,{kind:"import",evidence:"indexed-or-source-import",fromFile:y.file,fromSymbol:null,toFile:h.fromFile,toSymbol:h.symbol,line:null,strength:"mixed"})),i.has("call")&&$.length>0){let M=(h.source==="compiler"?ye(n,o,h.symbol).matches:Jt(n,h.fromFile,h.importedName)).filter(_=>!Y(_.symbol));for(let _ of M){let W=$.filter(q=>q.calleeLeaf===h.localName).map(q=>q.line);if(W.length!==0){u(_,t+1,`source-call:${y.file}`,void 0,"none",!0);for(let q of W)ne(f,{kind:"call",evidence:"ast-callsite",fromFile:y.file,fromSymbol:null,toFile:_.relativePath,toSymbol:_.symbol,line:q,strength:"derived"})}}}if(!y.promoteBoundaryImports||!gs(y.file,h.fromFile,L))continue;let k=ye(n,o,h.symbol);for(let M of k.matches)if(ys(M.relativePath,h.fromFile,L)&&!Y(M.symbol)){let _=ee(y.file,L).relativeDir!==ee(M.relativePath,L).relativeDir;u(M,t+1,`boundary-import:${y.file}`,void 0,_?"cross-workspace-or-forward":"forward-regions")}}}}function Ni(e,t){let{relationPolicy:n,runtimeBoundaries:o,evidenceFloor:i,representedBoundaryLinkIds:s,boundaryObservations:r,sourceAllowed:a,boundaryObservationDepths:d,symbols:c,sourceConstructs:l,addBoundaryObservation:u,pendingRelations:f}=e;for(let m of n.has("runtime-boundary")?o?.links??[]:[]){if(m.strength==="candidate"||i==="exact"&&m.strength!=="exact"||s.has(m.id))continue;let p=r.get(m.from),b=r.get(m.to);if(!p||!b||!a(p.source.file)||!a(b.source.file))continue;let S=yo(p,t,d,c,l),w=yo(b,t,d,c,l);if(S===null&&w===null)continue;let I=t+1,L=u(p,S??I,`runtime-boundary:${m.joinRule}`),N=u(b,w??I,`runtime-boundary:${m.joinRule}`),y=L?null:go(l,p),E=N?null:go(l,b);d.set(p.id,S??I),d.set(b.id,w??I),ne(f,{kind:"runtime-boundary",evidence:`runtime-boundary:${m.joinRule}`,fromFile:p.source.file,fromSymbol:L,toFile:b.source.file,toSymbol:N,fromBoundaryParticipant:Pe(p),toBoundaryParticipant:Pe(b),fromSourceConstruct:y?X(y):void 0,toSourceConstruct:E?X(E):void 0,runtimeBoundaryKey:m.matchedKeyParts.map(C=>`${C.name}=${C.value}`).join(" "),line:p.source.startLine,strength:m.strength}),s.add(m.id)}}function So(e,t,n){let o=$e(t.searches??[]),i=$e(t.symbols??[]),s=$e(t.relations&&t.relations.length>0?t.relations:so),r=s.filter(T=>!so.includes(T));if(r.length>0)throw new Error(`Unsupported system-map relation kind(s): ${r.join(", ")}`);let a=new Set(s),d=t.evidenceFloor??"derived";if(d!=="exact"&&d!=="derived")throw new Error(`Unsupported system-map evidence floor: ${d}`);let c=$e(t.sourceScopes&&t.sourceScopes.length>0?t.sourceScopes:["production"]),l=["production","test","fixture","example","generated","script","unknown"],u=c.filter(T=>!l.includes(T));if(u.length>0)throw new Error(`Unsupported system-map source scope(s): ${u.join(", ")}`);let f=new Set(c),m=T=>f.has(bt(T));if(o.length===0&&i.length===0)throw new Error("system-map requires at least one --search or --symbol anchor.");let p=t.maxDepth??di;if(!Number.isSafeInteger(p)||p<0)throw new RangeError(`maxDepth must be a non-negative safe integer; received ${p}`);let b=t.maxTopologyCharacters??Si;if(!Number.isSafeInteger(b)||b<=0)throw new RangeError(`maxTopologyCharacters must be a positive safe integer; received ${b}`);let S=new Yt(e),{fileGraph:w,reverseFileGraph:I,workspaces:L,runtimeBoundaries:N}=hs(e,S),y=new Map((N?.observations??[]).map(T=>[T.id,T])),E=new Set((N?.observations??[]).map(T=>`${T.source.file}\0${T.source.startLine}`)),C=new Set,v=new Map,F=new Map,g=new Map,R=new Map,$=[],B=new Map,A=new Map,H=[],h={filteredUnverifiedCallEdges:0,memberCallCandidateEdges:0,unresolvedMemberCallsites:0},k=new Set,M=new Map,_=new Map,W=T=>{let oe=_.get(T);if(oe)return oe;let re=St(e,T,{excludeIndexedTargets:!1});return _.set(T,re),re},q=(T,oe,re,be,Se=!1)=>hi(F,T,oe,re,be,Se),U=(T,oe,re,be,Se="none",ke=!1)=>xi(g,q,T,oe,re,be,Se,ke),K=(T,oe,re,be,Se=!1,ke=!0)=>vi(R,q,T,oe,re,be,Se,ke),ae=(T,oe,re)=>Ei({db:e,index:S,pendingRelations:B,addFile:q,addSymbol:U,addSourceConstruct:K,observation:T,depth:oe,origin:re}),{omittedSymbolCandidates:Le,broadLiteralAnchors:ze,withheldLiteralMatches:we}=Ii({db:e,index:S,searches:o,symbolQueries:i,opts:t,boundaryObservationLocations:E,sourceAllowed:m,addFile:q,addSymbol:U,addSourceConstruct:K,literalHits:$,anchors:H}),me={db:e,index:S,relationPolicy:a,evidenceFloor:d,sourceAllowed:m,fileGraph:w,reverseFileGraph:I,workspaces:L,runtimeBoundaries:N,boundaryObservations:y,boundaryObservationDepths:v,representedBoundaryLinkIds:C,files:F,symbols:g,sourceConstructs:R,pendingRelations:B,externalImports:A,reverseExpandedSourceConstructs:k,serviceCallerFilesBySourceConstruct:M,traversalMetrics:h,memberCallTargetsForWholeFile:W,addFile:q,addSymbol:U,addSourceConstruct:K,addBoundaryObservation:ae};for(let T=0;T<p;T+=1)Li(me,T),wi(me,T),Mi(me,T),Ni(me,T);return Ci({db:e,opts:t,mode:n,searches:o,symbolQueries:i,maxDepth:p,maxTopologyCharacters:b,requestedRelationKinds:s,evidenceFloor:d,includedSourceScopes:c,workspaces:L,runtimeBoundaries:N,boundaryObservations:y,representedBoundaryLinkIds:C,files:F,symbols:g,sourceConstructs:R,literalHits:$,pendingRelations:B,externalImports:A,anchors:H,omittedSymbolCandidates:Le,broadLiteralAnchors:ze,withheldLiteralMatches:we,filteredUnverifiedCallEdges:h.filteredUnverifiedCallEdges,memberCallCandidateEdges:h.memberCallCandidateEdges,unresolvedMemberCallsites:h.unresolvedMemberCallsites,sourceAllowed:m})}function Ri(e,t,n,o){let i=new Map,s=d=>{i.set(`${d.file}\0${d.line}`,d)};for(let d of o)s(d);let r=new Set(t.anchors.filter(d=>d.status==="matched").flatMap(d=>d.nodeIds));for(let d of n.steps)if(!(!d.location||!r.has(d.nodeId)||(d.behavior?.rawCharacters??1/0)>3e3))for(let c of d.behavior?.lines??[])c.signals.some(l=>bi.has(l))&&s({file:d.location.file,line:c.line,endLine:c.endLine});let a=t.edges.filter(d=>d.disposition==="emitted").flatMap(d=>d.evidence.flatMap(c=>c.location?[c.location]:[]));for(let d of a){s(d);let c=t.nodes.filter(u=>u.location?.file===d.file&&["symbol","source-construct","runtime-boundary-participant"].includes(u.kind)&&u.location.line<=d.line&&(u.location.endLine??u.location.line)>=d.line).sort((u,f)=>(u.location.endLine??u.location.line)-u.location.line-((f.location.endLine??f.location.line)-f.location.line)||u.id.localeCompare(f.id))[0];if(!c?.location)continue;let l=nn(e,d.file,c.location.line,c.location.endLine??c.location.line,[d.line]);for(let u of l)s({file:d.file,line:u.line,endLine:u.endLine})}return[...i.values()].sort((d,c)=>d.file.localeCompare(c.file)||d.line-c.line)}function Fi(e){if(e.ownerStartLine===null||e.ownerStartLine===void 0)throw new Error(`Literal hit ${e.file}:${e.line+1} has no source-owner start line.`);if(e.ownerEndLine===null||e.ownerEndLine===void 0)throw new Error(`Literal hit ${e.file}:${e.line+1} has no source-owner end line.`);return{file:e.file,name:e.ownerShortName??`${e.file}:${e.ownerStartLine+1}`,startLine:e.ownerStartLine,endLine:e.ownerEndLine}}function de(e){return`${e.file}\0${e.startLine}\0${e.endLine}\0${e.name}`}function X(e){return{file:e.file,name:e.name,startLine:e.startLine,endLine:e.endLine}}function lo(e,t,n,o){if(n.calleeLeaf===o.leaf)return!0;let i=Gt(e,t,n.calleeLeaf);return i!==null&&i.importedName===o.leaf&&i.sourcePath!==null&&pt(i.sourcePath,o.relativePath)}function at(e,t){let n=He(ce(e,t.file)?.callables??[],t.startLine);if(n&&n.endLine>=t.endLine)return{file:t.file,name:/^source@\d+$/u.test(n.name)&&!/^source@\d+$/u.test(t.name)?t.name:n.name,startLine:n.startLine,endLine:n.endLine};let o=xo(e,t.file,t.startLine);return o&&o.endLine>=t.endLine?{file:t.file,name:o.name,startLine:o.startLine,endLine:o.endLine}:X(t)}function Te(e){return te("source-construct",e.file,String(e.startLine),String(e.endLine),e.name)}function lt(e,t){let n=Ht(e,t.symbol,t.relativePath),o=new Set(["package-surface-file","transitive-package-surface"]),i=n.filter(r=>!o.has(r)||cn(e,t)),s=i.some(r=>!o.has(r));return{evidence:i,priority:s||Wt(e,t.symbol,t.relativePath)?2:1}}function co(e,t){let n=lt(e,t);return n.evidence.length>0?n.priority:0}function Ti(e,t){let n=fe(e,t.file),o=n.filter(i=>i.startLine<=t.startLine&&i.endLine>=t.startLine).sort((i,s)=>i.endLine-i.startLine-(s.endLine-s.startLine)||i.startLine-s.startLine);for(let i of o){let s=lt(e,i);if(s.evidence.length>0)return s}for(let i of Pi(e,t.file,t.startLine)){let s=n.filter(r=>r.leaf===i.name).sort((r,a)=>Math.abs(r.startLine-i.startLine)-Math.abs(a.startLine-i.startLine)||r.symbol.localeCompare(a.symbol));for(let r of s){let a=lt(e,r);if(a.evidence.length>0)return a}return{evidence:[],priority:0}}return{evidence:[],priority:0}}function Pi(e,t,n){let o=he(e,t)?.rootNode;if(!o||o.startPosition.row>n||o.endPosition.row<n)return[];let i=[],s=At(o,n);for(;s;){if(s.type==="variable_declarator"||s.type==="function_declaration"||s.type==="generator_function_declaration"||s.type==="class_declaration"){let r=s.childForFieldName("name")??s.namedChild(0);(r?.type==="identifier"||r?.type==="type_identifier")&&i.push({name:r.text,startLine:s.startPosition.row})}s=s.parent}return i}function ki(e){return[...new Map([...e.sourceConstructStates.values()].map(t=>at(e.db,t)).map(t=>[de(t),t])).values()].sort((t,n)=>t.file.localeCompare(n.file)||t.startLine-n.startLine||t.endLine-n.endLine)}function $i(e,t){return e.anchors.map((n,o)=>{let i=te("anchor",String(o),n.kind,n.query),s=[...e.symbolStates.values()].filter(l=>l.anchorQueries.has(n.query)).flatMap(l=>{if(!Y(l.definition.symbol))return[ge(l.definition.symbol)];let u=t.filter(f=>f.file===l.definition.relativePath).map(f=>Te(f));return u.length>0?u:[ge(l.definition.symbol)]}),r=[...e.sourceConstructStates.values()].filter(l=>l.anchorQueries.has(n.query)).map(l=>Te(at(e.db,l))),a=e.literalHits.filter(l=>l.query===n.query&&l.traversalSeed===!0&&l.ownerSymbol&&e.symbolStates.has(l.ownerSymbol)).map(l=>ge(l.ownerSymbol)),d=e.literalHits.filter(l=>l.query===n.query&&l.traversalSeed===!0&&!l.ownerSymbol&&l.ownerStartLine!==null&&l.ownerStartLine!==void 0&&l.ownerEndLine!==null&&l.ownerEndLine!==void 0).map(l=>Te(at(e.db,Fi(l)))),c=D(n.kind==="symbol"?[...s,...r]:a.length+d.length>0?[...a,...d]:n.seedRegionIds??[]);return{id:i,kind:n.kind,query:n.query,status:n.status,nodeIds:n.status==="ambiguous"?[]:c,candidateNodeIds:n.status==="ambiguous"?c:[],omittedCandidates:n.omittedSymbolCandidates??0}})}function Ai(e){let t=new Map;for(let n of e)for(let o of[...n.nodeIds,...n.candidateNodeIds]){let i=t.get(o)??[];i.push(n.id),t.set(o,i)}return t}function Di(e,t,n){let o=e.relations.flatMap(r=>[r.fromBoundaryParticipant,r.toBoundaryParticipant].flatMap(a=>a?.ownerName?[a]:[])),i=e.regions.map(r=>({id:r.id,kind:"structural-region",label:r.label,disposition:"folded",location:null,anchorIds:D(n.get(r.id)??[]),attributes:{workspace:r.workspace,structuralPath:r.structuralPath,minimumDepth:r.minDepth,files:r.fileCount,symbols:r.symbolCount,expanded:r.expanded}}));for(let r of e.symbolStates.values()){let a=e.regionForFile.get(r.definition.relativePath)?.id;if(!a)throw new Error(`System-map symbol ${r.definition.symbol} has no structural region.`);let d=ge(r.definition.symbol),c=lt(e.db,r.definition);i.push({id:d,kind:"symbol",label:V(r.definition.symbol),disposition:(n.get(d)?.length??0)>0?"emitted":"folded",location:{file:r.definition.relativePath,line:r.definition.startLine,endLine:r.definition.endLine},anchorIds:D(n.get(d)??[]),attributes:{regionId:a,depth:r.depth,leaf:r.definition.leaf??V(r.definition.symbol),referenceScope:r.referenceScope,...c.evidence.length>0?{publicEntry:!0,publicEntryPriority:c.priority,publicEntryEvidence:c.evidence.join(",")}:{}}})}for(let r of t){let a=e.regionForFile.get(r.file)?.id;if(!a)throw new Error(`Source construct ${r.name} has no structural region.`);let d=Te(r),l=o.find(f=>f.file===r.file&&f.line>=r.startLine&&f.line<=r.endLine)?.ownerName??r.name,u=Ti(e.db,r);i.push({id:d,kind:"source-construct",label:l,disposition:(n.get(d)?.length??0)>0?"emitted":"folded",location:{file:r.file,line:r.startLine,endLine:r.endLine},anchorIds:D(n.get(d)??[]),attributes:{regionId:a,leaf:l,sourceOwned:!0,...u.evidence.length>0?{publicEntry:!0,publicEntryPriority:u.priority,publicEntryEvidence:u.evidence.join(",")}:{}}})}let s=new Map;for(let r of e.relations)r.fromBoundaryParticipant&&s.set(r.fromBoundaryParticipant.observationId,r.fromBoundaryParticipant),r.toBoundaryParticipant&&s.set(r.toBoundaryParticipant.observationId,r.toBoundaryParticipant);for(let r of[...s.values()].sort((a,d)=>a.observationId.localeCompare(d.observationId))){let a=e.regionForFile.get(r.file)?.id;if(!a)throw new Error(`Runtime-boundary participant ${r.observationId} has no structural region.`);i.push({id:Dt(r.observationId),kind:"runtime-boundary-participant",label:r.address||r.ownerName||`${r.role} ${r.action}`,disposition:"folded",location:{file:r.file,line:r.line,endLine:r.endLine},anchorIds:[],attributes:{regionId:a,action:r.action,protocol:r.protocol,role:r.role,...r.address?{address:r.address}:{},ownerSymbol:r.ownerSymbol}})}return i}function Bi(e,t,n,o,i,s,r,a,d,c=!1){let l=o?ge(o):null;if(l&&t.has(l)&&!Y(o))return l;let u=i?Dt(i.observationId):null;if(c&&u&&t.has(u))return u;let f=s?Te(at(e,s)):null;if(f&&t.has(f))return f;if(u&&t.has(u))return u;let m=d===null?null:(n.get(a)??[]).filter(p=>p.startLine<=d&&p.endLine>=d).sort((p,b)=>p.endLine-p.startLine-(b.endLine-b.startLine)||p.startLine-b.startLine)[0]??null;return m?Te(m):l&&t.has(l)?l:r}function Oi(e,t,n){let o=new Set(t.map(c=>c.id)),i=se(n,c=>c.file),s=(c,l,u,f,m,p,b=!1)=>Bi(e.db,o,i,c,l,u,f,m,p,b),r=[];for(let c of e.symbolStates.values()){let l=e.regionForFile.get(c.definition.relativePath)?.id;if(!l)continue;let u=ge(c.definition.symbol);r.push({id:te("edge","structural-membership",l,u),kind:"structural-membership",fromNodeId:l,toNodeId:u,directed:!0,disposition:"folded",semantics:Ve("structural-membership"),evidence:[{method:"indexed-definition-file",strength:"exact",identity:c.definition.symbol,location:{file:c.definition.relativePath,line:c.definition.startLine,endLine:c.definition.endLine}}]})}let a=se(e.relations,c=>`${s(c.fromSymbol,c.fromBoundaryParticipant,c.fromSourceConstruct,c.fromRegionId,c.fromFile,c.line,c.kind==="runtime-boundary")}\0${s(c.toSymbol,c.toBoundaryParticipant,c.toSourceConstruct,c.toRegionId,c.toFile,null)}\0${c.kind}`),d=new Set;for(let c of a.values()){let l=c[0],u=s(l.fromSymbol,l.fromBoundaryParticipant,l.fromSourceConstruct,l.fromRegionId,l.fromFile,l.line,l.kind==="runtime-boundary"),f=s(l.toSymbol,l.toBoundaryParticipant,l.toSourceConstruct,l.toRegionId,l.toFile,null);if(l.kind==="runtime-boundary"&&l.fromBoundaryParticipant){let p=Dt(l.fromBoundaryParticipant.observationId),b=s(l.fromSymbol,void 0,l.fromSourceConstruct,l.fromRegionId,l.fromFile,l.line);b!==p&&!d.has(p)&&(d.add(p),r.push({id:te("edge","boundary-observation",b,p),kind:"boundary-observation",fromNodeId:b,toNodeId:p,directed:!0,disposition:"folded",semantics:Ve("boundary-observation"),evidence:[{method:"runtime-boundary-observation-owner",strength:l.strength??"unknown",identity:l.fromBoundaryParticipant.observationId,location:{file:l.fromBoundaryParticipant.file,line:l.fromBoundaryParticipant.line,endLine:l.fromBoundaryParticipant.endLine}}]}))}(u===f?t.find(p=>p.id===u):null)?.kind!=="structural-region"&&r.push({id:te("edge",l.kind,u,f),kind:l.kind,fromNodeId:u,toNodeId:f,directed:!0,disposition:"folded",semantics:gn(l),evidence:Wi(c.map(p=>({method:p.evidence,strength:p.strength??"unknown",identity:p.kind==="runtime-boundary"&&p.runtimeBoundaryKey?p.runtimeBoundaryKey:`${p.fromSymbol??p.fromFile} -> ${p.toSymbol??p.toFile}`,location:p.line===null?null:{file:p.fromFile,line:p.line}})))})}return r}function _i(e,t,n){for(let i of e.externalBoundaries){let s=te("external",i.kind,i.name),r=D(i.fromRegionIds);t.push({id:s,kind:i.kind,label:i.name,disposition:"folded",location:null,anchorIds:[],attributes:{}});for(let a of r)n.push({id:te("edge",i.kind,a,s),kind:i.kind,fromNodeId:a,toNodeId:s,directed:!0,disposition:"folded",semantics:Ve("external-import"),evidence:[{method:"indexed-or-source-import",strength:"mixed",identity:`${a} -> ${i.name}`,location:null}]})}let o=[];return e.boundaryFrontiers.forEach((i,s)=>{let r=e.regionForFile.get(i.file)?.id;if(!r)throw new Error(`Runtime-boundary frontier ${i.observationId} has no system-map region.`);let a=te("unsupported","runtime-boundary",i.observationId,String(s)),d=te("edge","runtime-boundary-frontier",r,a);t.push({id:a,kind:"runtime-boundary-frontier",label:i.address,disposition:"unsupported",location:{file:i.file,line:i.line},anchorIds:[],attributes:{action:i.action,strength:i.strength,owner:i.ownerShortName}}),n.push({id:d,kind:"runtime-boundary-frontier",fromNodeId:r,toNodeId:a,directed:!0,disposition:"unsupported",evidence:[{method:"runtime-boundary-extractor",strength:i.strength,identity:i.observationId,location:{file:i.file,line:i.line}}]}),o.push({id:te("frontier","runtime-boundary",i.observationId,String(s)),kind:"runtime-boundary",direction:"unresolved",fromNodeIds:[r],edgeIds:[d],memberNodeIds:[a],memberCount:1,disposition:"unsupported",reason:i.reason,expansion:null})}),o}function Ki(e,t){let n=t.topologyFrontiers.some(p=>p==="frontier:program-facts"),o=oo(e,{expandedFrontierIds:t.topologyFrontiers.filter(p=>p!=="frontier:program-facts"),routeIds:t.routeIds}),i=o.nodes.filter(p=>p.disposition==="emitted"||o.anchors.some(b=>b.status==="matched"&&b.nodeIds.includes(p.id))),s=t.relations.filter(p=>i.some(b=>qi(p,b))),r=t.boundaryFrontiers.filter(p=>i.some(b=>Ui(p,b))),a=Ln(t.db,s,i),d=Mn(t.db,i),c=_n(t.db,i,r),l=[...a.nodes,...d.nodes,...c.nodes].map(p=>n&&p.disposition==="folded"?{...p,disposition:"emitted"}:p),u=[...a.edges,...d.edges,...c.edges].map(p=>n&&p.disposition==="folded"?{...p,disposition:"emitted"}:p),f=n?null:zi(i,l,u),m=it({anchors:o.anchors,nodes:[...o.nodes,...l],edges:[...o.edges,...u],paths:o.paths,frontiers:[...o.frontiers,...a.frontiers,...d.frontiers,...c.frontiers,...f?[f]:[]],scope:o.coverage.scope,blindSpots:[...o.coverage.blindSpots,...a.blindSpots,...d.blindSpots,...c.blindSpots],incompleteReasons:o.coverage.status==="incomplete"?[o.coverage.explanation]:[],...o.routeCatalog?{routeCatalog:o.routeCatalog}:{}});m.completion=o.completion;for(let p of m.frontiers)p.disposition==="folded"&&(p.id.startsWith("frontier:program-facts:")||(p.expansion=Gi(t,p.id)));return m}function ji(e){let t=ki(e),n=$i(e,t),o=Di(e,t,Ai(n)),i=Oi(e,o,t),s=_i(e,o,i);return Ki(it({anchors:n,nodes:o,edges:i,paths:[],frontiers:s,scope:`explicit anchors; relations ${e.requestedRelationKinds.join(", ")}; depth ${e.maxDepth}; evidence floor ${e.evidenceFloor}; source scopes ${e.includedSourceScopes.join(", ")}`,blindSpots:[...e.blindSpots],incompleteReasons:e.closureStatus==="incomplete"?[`${e.omittedSymbolCandidates} ambiguous symbol candidate(s) were omitted`]:[]}),e)}function qi(e,t){if(e.fromSymbol&&t.id===ge(e.fromSymbol)||e.toSymbol&&t.id===ge(e.toSymbol))return!0;if(!t.location)return!1;let n=t.location.endLine??t.location.line;return t.location.file===e.fromFile&&e.line!==null&&e.line>=t.location.line&&e.line<=n||t.location.file===e.toFile}function Ui(e,t){if(!t.location||t.location.file!==e.file)return!1;let n=t.location.endLine??t.location.line;return e.line>=t.location.line&&e.line<=n||t.label===e.ownerShortName||typeof e.ownerShortName=="string"&&t.label.includes(e.ownerShortName)}function zi(e,t,n){let o=D(t.filter(s=>s.disposition==="folded").map(s=>s.id)),i=D(n.filter(s=>s.disposition==="folded").map(s=>s.id));return o.length===0&&i.length===0?null:{id:te("frontier","program-facts"),kind:"program-facts",direction:"outgoing",fromNodeIds:D(e.map(s=>s.id)),edgeIds:i,memberNodeIds:o,memberCount:o.length,disposition:"folded",reason:"Control, data, state, and temporal facts are folded beneath the selected high-level owners.",expansion:null}}function Gi(e,t){return`scip-query system-map ${[...e.anchors.flatMap(o=>o.kind==="literal"?[`--search ${O(o.query)}`]:[`--symbol ${O(o.query)}`]),`--depth ${e.maxDepth}`,...e.requestedRelationKinds.map(o=>`--relation ${O(o)}`),`--evidence-floor ${O(e.evidenceFloor)}`,...e.includedSourceScopes.map(o=>`--source-scope ${O(o)}`),...e.fullLiteralTraversal?["--full-literal-traversal"]:[],`--topology-characters ${e.maxTopologyCharacters}`,...e.expandedRegionIds.map(o=>`--expand ${O(o)}`),...e.topologyFrontiers.map(o=>`--frontier ${O(o)}`),...e.routeIds.map(o=>`--route ${O(o)}`),`--frontier ${O(t)}`].join(" ")}`}function Hi(e){let t=new Set;for(let n of e.nodes){if(n.disposition!=="emitted")continue;n.kind==="structural-region"&&t.add(n.id);let o=n.attributes.regionId;typeof o=="string"&&t.add(o)}return t}function Wi(e){let t=new Map;for(let n of e){let o=n.location?`${n.location.file}:${n.location.line}`:"";t.set(`${n.method}\0${n.strength}\0${n.identity??""}\0${o}`,n)}return[...t.values()].sort((n,o)=>n.method.localeCompare(o.method)||(n.identity??"").localeCompare(o.identity??"")||(n.location?.file??"").localeCompare(o.location?.file??"")||(n.location?.line??0)-(o.location?.line??0))}function te(...e){return e.map(t=>encodeURIComponent(t)).join(":")}function ge(e){return te("symbol",e)}function Vi(e){return e==="semantic-callee"||e==="scip-chunk"?"exact":"derived"}function Qi(e,t,n,o,i,s,r,a,d,c){let l=[...o].sort((b,S)=>ho(b,S,i)),f=l.slice(0,io).map(b=>b.id),m=l.slice(io).map(b=>b.id),p=[...e.map(b=>`--search ${O(b)}`),...t.map(b=>`--symbol ${O(b)}`),`--depth ${n}`,...s.map(b=>`--relation ${O(b)}`),`--evidence-floor ${O(r)}`,...a.map(b=>`--source-scope ${O(b)}`),...d?["--full-literal-traversal"]:[],`--topology-characters ${c}`,...f.map(b=>`--expand ${O(b)}`)];return{command:f.length===0?null:`scip-query system-map ${p.join(" ")}`,regionCount:f.length,regionIds:f,candidateRegionCount:o.length,omittedRegionIds:m}}function Yi(e,t,n,o,i,s,r,a,d,c,l,u,f){let m=[...d].sort((g,R)=>ho(g,R,l)).filter(g=>!f||f.has(g.id)||u.has(g.id)),p=c.length>0?Math.floor(a*.4):0,b=a-p,S=new Set,w=0;for(let g of m){let R=uo(g);!u.has(g.id)&&S.size>0&&w+R>b||(S.add(g.id),w+=R)}let I=c.filter(g=>S.has(g.fromRegionId)&&S.has(g.toRegionId)).sort(Ji),L=[];for(let g of I){let R=po(g);L.length>0&&w+R>a||(L.push(dt(g)),w+=R)}let N=d.filter(g=>!S.has(g.id)).map(g=>g.id).sort(),y=new Set(L),E=c.filter(g=>!y.has(dt(g))).length,C=d.reduce((g,R)=>g+uo(R),0)+c.reduce((g,R)=>g+po(R),0),v=m.every(g=>S.has(g.id))&&L.length===I.length,F=[...e.map(g=>`--search ${O(g)}`),...t.map(g=>`--symbol ${O(g)}`),`--depth ${n}`,...o.map(g=>`--relation ${O(g)}`),`--evidence-floor ${O(i)}`,...s.map(g=>`--source-scope ${O(g)}`),...r?["--full-literal-traversal"]:[],`--topology-characters ${Math.max(a,C)}`];return{maxCharacters:a,estimatedCharacters:w,totalEstimatedCharacters:C,regionIds:[...S],omittedRegionIds:N,relationKeys:L,omittedRelations:E,complete:v,expansionCommand:v?null:`scip-query system-map ${F.join(" ")}`}}function uo(e){return 120+e.id.length+e.anchorQueries.join(",").length+e.relationKinds.join(",").length+e.notableSymbols.slice(0,2).reduce((t,n)=>t+n.shortName.length+n.file.length,0)}function po(e){return 70+e.fromRegionId.length+e.toRegionId.length+e.kinds.join(",").length+e.evidence.join(",").length}function Ji(e,t){let n=o=>o.kinds.includes("runtime-boundary")?0:o.kinds.includes("contract-symbol")?1:2;return n(e)-n(t)||t.relationCount-e.relationCount||dt(e).localeCompare(dt(t))}function dt(e){return`${e.fromRegionId}\0${e.toRegionId}`}function ho(e,t,n){let o=a=>n.has(a.id)?0:1,i=a=>a.sourceFileCount===0?1:0,s=a=>a.symbolCount+a.literalHitCount>0?0:1,r=a=>[...a.incomingRegionIds,...a.outgoingRegionIds].filter(d=>n.has(d)).length;return o(e)-o(t)||s(e)-s(t)||i(e)-i(t)||e.minDepth-t.minDepth||r(t)-r(e)||t.literalHitCount-e.literalHitCount||e.testFileCount-t.testFileCount||e.label.localeCompare(t.label)}function Xi(e){let t=[],n=new Set;for(let i of e.filter(s=>s.expanded)){for(let d of i.symbols)d.origins.includes("symbol-anchor")&&n.add(d.file);let s=se(i.symbols,d=>d.file),r=se(i.literalHits,d=>d.file),a=[...i.files].sort((d,c)=>es(d,c,s,r));for(let d of a){let c=(s.get(d.file)??[]).sort(mn)[0];if(c){t.push({kind:"symbol",regionId:i.id,file:c.file,line:c.startLine,endLine:c.endLine,label:c.shortName});continue}let l=(r.get(d.file)??[]).sort(Io)[0];l&&t.push({kind:"literal",regionId:i.id,file:l.file,line:l.line,endLine:null,label:l.ownerShortName??l.query})}}let o=Zi(t,n);return{command:o.length===0?null:`scip-query inspect ${o.map(i=>`--at ${O(`${i.file}:${i.line+1}`)}`).join(" ")} --view behavior`,definitionCommand:null,candidateAnchors:t.length,selectedAnchors:o.length,omittedAnchors:t.length-o.length,anchors:o}}function Zi(e,t){let n=[...se(e,r=>r.regionId).values()],o=[],i=new Set,s=Math.min(gi,24);for(let r of e)if(!(!t.has(r.file)||i.has(r.file))&&(o.push(r),i.add(r.file),o.length===s))return o;for(let r=0;o.length<s;r+=1){let a=!1;for(let d of n){let c=d[r];if(c&&(a=!0,!i.has(c.file)&&(o.push(c),i.add(c.file),o.length===s)))break}if(!a)break}return o}function es(e,t,n,o){let i=a=>a.kind==="test"?2:a.kind==="barrel"?1:0,s=a=>(o.get(a.file)??[]).some(d=>d.traversalSeed)?0:1,r=a=>{let d=n.get(a.file)??[];return Math.min(5,...d.map(c=>Ne(c.origins)))};return i(e)-i(t)||s(e)-s(t)||r(e)-r(t)||e.depth-t.depth||e.file.localeCompare(t.file)}function O(e){return`'${e.replaceAll("'","'\\''")}'`}function ts(e,t,n,o){let i=[];for(let s of qt(e,{includeIgnored:!1})){let r=mt(e,s);if(r.length===0)continue;let a=[];for(let l=0;l<r.length;l+=1){let u=r[l]??"";u.includes(n)&&a.push({line:l,sourceLine:u})}if(a.length===0)continue;let d=t.definitionsForFile(s),c=ce(e,s)?.callables??[];for(let{line:l,sourceLine:u}of a){let f=Me(d,l),m=He(c,l),p=f&&!Y(f.symbol)?f:null,b=p?.startLine??m?.startLine??f?.startLine??l,S=p?.endLine??m?.endLine??f?.endLine??l,w=xt(e,s,l,b,S),I=o.has(`${s}\0${l}`),L=!!(p?.isFunctionLike||m);i.push({relativePath:s,line:l,sourceLine:u,ownerSymbol:p?.symbol??null,ownerShortName:p?V(p.symbol):m?.name??(f?V(f.symbol):null),ownerStartLine:w.startLine,ownerEndLine:w.endLine,matchKind:is(u,n),seedPriority:I?0:L?1:2})}}return i}function ns(e,t){let n={"exact-value":0,boundary:1,embedded:2};return e.seedPriority-t.seedPriority||n[e.matchKind]-n[t.matchKind]||e.relativePath.localeCompare(t.relativePath)||e.line-t.line}function mo(e){return`${e.relativePath}\0${e.line}`}function Pt(e,t,n){let i=He(ce(e,t)?.callables??[],n)??xo(e,t,n);if(!i)return null;let s=xt(e,t,n,i.startLine,i.endLine);return{file:t,name:i.name,startLine:s.startLine,endLine:s.endLine}}function xo(e,t,n){let o=he(e,t)?.rootNode;if(!o||o.startPosition.row>n||o.endPosition.row<n)return null;let i=At(o,n);for(;i;){if(i.type==="variable_declarator"){let r=i.childForFieldName("name")??i.namedChild(0),a=i.childForFieldName("value")??i.namedChild(1);if(r?.type==="identifier"&&a&&kt(a,n))return{name:r.text,startLine:i.startPosition.row,endLine:i.endPosition.row}}if(i.type==="pair"){let r=i.childForFieldName("key")??i.namedChild(0),a=i.childForFieldName("value")??i.namedChild(1),d=r?.text.replace(/^(?:['"])(.*)(?:['"])$/u,"$1");if(d&&a&&/^[A-Za-z_$][\w$]*$/u.test(d)&&kt(a,n))return{name:d,startLine:i.startPosition.row,endLine:i.endPosition.row}}i=i.parent}let s=ht(e,t,n);return s?{name:`source@${n+1}`,startLine:s.startLine,endLine:s.endLine}:null}function kt(e,t){return["arrow_function","function_expression","generator_function","generator_function_declaration"].includes(e.type)&&e.startPosition.row<=t&&e.endPosition.row>=t?!0:e.namedChildren.some(n=>n.startPosition.row<=t&&n.endPosition.row>=t&&kt(n,t))}function At(e,t){let n=e.namedChildren.filter(o=>o.startPosition.row<=t&&o.endPosition.row>=t).sort((o,i)=>o.endIndex-o.startIndex-(i.endIndex-i.startIndex)||o.startPosition.row-i.startPosition.row)[0];return n?At(n,t):e}function os(e,t){let n=t.match(/^(.+):(\d+)(?:-(\d+))?$/u);if(!n)return null;let o=Ut(e,n[1],{allowMultiple:!1})[0]?.relativePath;if(!o)return null;let i=Math.max(0,Number.parseInt(n[2],10)-1),s=n[3]?Math.max(i,Number.parseInt(n[3],10)-1):i,r=(ce(e,o)?.callables??[]).filter(a=>a.startLine<=i&&a.endLine>=s).sort((a,d)=>a.endLine-a.startLine-(d.endLine-d.startLine)||a.startLine-d.startLine)[0];return r?{file:o,name:r.name,startLine:r.startLine,endLine:r.endLine}:null}function rs(e){return{symbol:`source-construct:${e.file}:${e.startLine}:${e.endLine}:${e.name}`,shortName:e.name,relativePath:e.file,startLine:e.startLine,endLine:e.endLine}}function is(e,t){let n=/[\p{L}\p{N}_$]/u,o=e.indexOf(t);for(;o>=0;){let i=e[o-1]??"",s=e[o+t.length]??"";if((i==="'"||i==='"'||i==="`")&&s===i)return"exact-value";if(!n.test(i)&&!n.test(s))return"boundary";o=e.indexOf(t,o+Math.max(1,t.length))}return"embedded"}function $t(e){return We(e)==="test"?!1:!/(?:^|[/._-])(?:fixtures?|mocks?|previews?|demos?|examples?|stories)(?:[/._-]|$)/iu.test(e)}function ss(e,t){return e.matchKind!=="embedded"&&t(e.relativePath)&&(bt(e.relativePath)!=="production"||$t(e.relativePath))}function as(e,t){let n=[...t].sort(ls),o=[],i=new Set;for(let s of n)if(!i.has(s.relativePath)&&(o.push(s),i.add(s.relativePath),o.length>=ro))break;for(let s of n){if(o.length>=ro)break;o.includes(s)||o.push(s)}return o.map(s=>({query:e,file:s.relativePath,line:s.line,ownerSymbol:s.ownerSymbol,ownerShortName:s.ownerShortName,ownerStartLine:s.ownerStartLine,ownerEndLine:s.ownerEndLine,sourceLine:s.sourceLine.trim(),matchKind:s.matchKind,traversalSeed:!1}))}function ls(e,t){let n={"exact-value":0,boundary:1,embedded:2};return n[e.matchKind]-n[t.matchKind]||+(t.ownerSymbol!==null)-+(e.ownerSymbol!==null)||+!$t(e.relativePath)-+!$t(t.relativePath)||e.relativePath.localeCompare(t.relativePath)||e.line-t.line}function ds(e,t){let n=new Map;for(let o of t){let i=cs(o.relativePath);n.set(i,(n.get(i)??0)+1)}return[...n].sort(([o,i],[s,r])=>r-i||o.localeCompare(s)).slice(0,mi).map(([o])=>`scip-query search ${O(e)} --scope ${O(o)}`)}function cs(e){let t=e.split("/").filter(Boolean);if(t.length<=1)return e;let n=t.slice(0,-1),o=n.lastIndexOf("src");return o>=0?n.slice(0,Math.min(n.length,o+3)).join("/"):n.slice(0,Math.min(n.length,3)).join("/")}function us(e,t,n){let o=t.callerFileMap([n],{semantic:!1}).get(n.symbolId)??new Set,i=[];for(let s of[...o].sort()){let r=ft(e,s).filter(l=>l.importedName===n.leaf&&l.sourcePath!==null&&pt(l.sourcePath,n.relativePath)),a=new Set;if(r.length>0)for(let l of r)a.add(l.localName??l.importedName);else n.leaf&&a.add(n.leaf);let d=[...new Set([...a].flatMap(l=>gt(e,s,l)))].sort((l,u)=>l-u);if(d.length===0){i.push({file:s,line:null,enclosingSymbol:null});continue}let c=t.definitionsForFile(s);for(let l of d)i.push({file:s,line:l,enclosingSymbol:Me(c,l)?.symbol??null})}return i}function ps(e,t){let n=e.all(`SELECT DISTINCT gs.symbol, def_d.relative_path AS from_file
|
|
2
|
+
FROM mentions m
|
|
3
|
+
JOIN chunks c ON m.chunk_id = c.id
|
|
4
|
+
JOIN documents imp_d ON c.document_id = imp_d.id
|
|
5
|
+
JOIN global_symbols gs ON m.symbol_id = gs.id
|
|
6
|
+
LEFT JOIN (
|
|
7
|
+
SELECT m2.symbol_id, c2.document_id
|
|
8
|
+
FROM mentions m2
|
|
9
|
+
JOIN chunks c2 ON m2.chunk_id = c2.id
|
|
10
|
+
WHERE m2.role = 1
|
|
11
|
+
GROUP BY m2.symbol_id
|
|
12
|
+
) sym_def ON sym_def.symbol_id = gs.id
|
|
13
|
+
LEFT JOIN documents def_d ON sym_def.document_id = def_d.id
|
|
14
|
+
WHERE imp_d.relative_path = ? AND m.role = 2
|
|
15
|
+
ORDER BY def_d.relative_path, gs.symbol`,t);return n.length>0?n.map(o=>({symbol:o.symbol,shortName:V(o.symbol),importedName:fo(V(o.symbol)),localName:fo(V(o.symbol)),fromFile:o.from_file,source:"compiler"})):ft(e,t).map(o=>{let i=ms(o.importedName,o.localName,o.kind),s=o.localName??o.importedName,r=o.importedName==="default"?s:o.importedName;return{symbol:i,shortName:i,importedName:r,localName:s,fromFile:o.sourcePath,source:"parsed-source"}})}function fo(e){return e.slice(e.lastIndexOf(":")+1).replace(/\(\)$/u,"")||e}function ms(e,t,n){return n==="namespace"&&e==="*"&&t?`* as ${t}`:n==="default"&&t?`default as ${t}`:n==="side-effect"?"(side effect import)":t&&t!==e?`${e} as ${t}`:e}function ye(e,t,n){let o=yt(e,n);if(!o.match)return{matches:[],total:0,omitted:0};let i=[o.match,...o.candidates.map(r=>yt(e,r.symbol).match)].filter(r=>r!==null),s=new Map;for(let r of i){let a=t.definitionsForFile(r.relativePath).find(d=>d.symbol===r.symbol);a&&s.set(a.symbol,a)}return{matches:[...s.values()],total:o.total,omitted:Math.max(0,o.total-s.size)}}function fs(e){return{symbol:e.symbol,shortName:V(e.symbol),relativePath:e.relativePath,startLine:e.startLine,endLine:e.endLine}}function ne(e,t){let n=[t.kind,t.fromFile,t.fromSymbol??"",t.toFile,t.toSymbol??"",t.fromBoundaryParticipant?.observationId??"",t.toBoundaryParticipant?.observationId??"",t.fromSourceConstruct?de(t.fromSourceConstruct):"",t.toSourceConstruct?de(t.toSourceConstruct):"",t.runtimeBoundaryKey??"",t.line??""].join("\0");e.set(n,t)}function Pe(e){return{observationId:e.id,action:e.action,protocol:e.protocol,role:e.role,address:vo(e),file:e.source.file,line:e.source.startLine,endLine:e.source.endLine,ownerName:e.owner.name,ownerSymbol:e.owner.symbol}}function st(e,t){let n=mt(e,t.source.file);return rn(e,t.source.file,0,Math.max(0,n.length-1),[t.source.startLine])}function go(e,t){let n=[...e.values()];for(let o of[t.owner,t.source]){let i=n.filter(s=>s.file===o.file&&s.startLine<=o.startLine&&s.endLine>=o.startLine).sort((s,r)=>s.endLine-s.startLine-(r.endLine-r.startLine)||s.startLine-r.startLine)[0];if(i)return i}return null}function yo(e,t,n,o,i){let s=[],r=n.get(e.id);r!==void 0&&r<=t&&s.push(r);for(let a of o.values()){if(a.depth>t)continue;let d=a.definition;bo(d,e)&&s.push(a.depth)}for(let a of i.values())a.depth>t||bo(a,e)&&s.push(a.depth);return s.length>0?Math.min(...s):null}function bo(e,t){let n=e.relativePath??e.file;return[t.owner,t.source].some(o=>n===o.file&&e.startLine<=o.startLine&&e.endLine>=o.startLine)}function Dt(e){return te("runtime-boundary-participant",e)}function gs(e,t,n){let o=ee(e,n),i=ee(t,n);return o.relativeDir!==i.relativeDir?!0:/(?:^|\/)(?:contracts?|schemas?|db\/schema)(?:\/|$)/u.test(t)}function ys(e,t,n){return Ue(e,n).id===Ue(t,n).id}function bs(e,t,n,o){if(e.referenceScope==="all")return!0;let i=Ue(t,o).id;return[...n.values()].some(r=>r.promoteBoundaryImports&&Ue(r.file,o).id===i)?!0:e.referenceScope!=="cross-workspace-or-forward"?!1:ee(t,o).relativeDir!==ee(e.definition.relativePath,o).relativeDir}function Ss(e,t){let n={none:0,"forward-regions":1,"cross-workspace-or-forward":2,all:3};return n[e]>=n[t]?e:t}function hs(e,t){let n=ao.get(e);if(n)return n;let o=t.fileDependencyGraph(),i={fileGraph:o,reverseFileGraph:xs(o),workspaces:vs(t.sourceFiles()),runtimeBoundaries:tn(e)};return ao.set(e,i),i}function xs(e){let t=new Map;for(let[n,o]of e)for(let i of o){let s=t.get(i)??new Set;s.add(n),t.set(i,s)}return t}function ee(e,t){return t.find(n=>e===n.relativeDir||e.startsWith(`${n.relativeDir}/`))??{name:"root",relativeDir:""}}function vs(e){let t=new Set(["apps","packages","services","crates","libs","tools"]),n=new Map;for(let o of e){let i=o.split("/").filter(Boolean);if(i.length<3||!t.has(i[0]))continue;let s=`${i[0]}/${i[1]}`;n.set(s,{name:i[1],relativeDir:s})}return[...n.values()].sort((o,i)=>i.relativeDir.length-o.relativeDir.length)}function Ue(e,t){let n=ee(e,t),i=(n.relativeDir?e.slice(n.relativeDir.length+1):e).split("/").filter(Boolean);i[0]==="src"&&i.shift();let s=Es(i);return{id:`region:${n.relativeDir||"root"}:${s}`,label:`${n.name}:${s}`,workspace:n.name,structuralPath:s}}function Es(e){if(e.length<=1)return"root";let t=e[0],n=e[1];return["components","features","modules"].includes(t)?`${t}/${n}`:t==="db"?`${t}/${n}`:["contracts","routes","services"].includes(t)?t:t==="tests"||t==="__tests__"?"tests":t}function Is(e,t,n,o,i,s,r){let a=se([...e.values()],m=>s.get(m.file).id),d=se([...t.values()],m=>s.get(m.definition.relativePath).id),c=se(n,m=>s.get(m.file).id),l=new Map;for(let m of o)for(let p of new Set([m.fromRegionId,m.toRegionId])){let b=l.get(p)??[];b.push(m),l.set(p,b)}let u=se(i,m=>m.toRegionId),f=se(i,m=>m.fromRegionId);return[...a.entries()].map(([m,p])=>{let b=s.get(p[0].file),S=d.get(m)??[],w=c.get(m)??[],I=l.get(m)??[],L=r.has(m),N=S.map(ws).sort(Fs).slice(0,fi),y=p.filter(E=>We(E.file)==="test").length;return{id:m,label:b.label,workspace:b.workspace,structuralPath:b.structuralPath,minDepth:Math.min(...p.map(E=>E.depth)),fileCount:p.length,sourceFileCount:p.length-y,testFileCount:y,symbolCount:S.length,literalHitCount:w.length,anchorQueries:D([...w.map(E=>E.query),...S.flatMap(E=>[...E.anchorQueries])]),relationKinds:D(I.map(E=>E.kind)),incomingRegionIds:D((u.get(m)??[]).map(E=>E.fromRegionId)),outgoingRegionIds:D((f.get(m)??[]).map(E=>E.toRegionId)),memberCallCandidateRelationCount:I.filter(E=>E.evidence==="ast-member-import-candidate").length,notableSymbols:N,omittedNotableSymbols:Math.max(0,S.length-N.length),expanded:L,files:L?p.map(Cs).sort(Ts):[],symbols:L?S.map(Ls).sort(Ps):[],literalHits:L?[...w].sort(Io):[],relations:L?[...I].sort(Eo):[]}}).sort((m,p)=>m.minDepth-p.minDepth||m.label.localeCompare(p.label))}function Cs(e){return{file:e.file,kind:We(e.file),depth:e.depth,origins:D([...e.origins])}}function Ls(e){return{symbol:e.definition.symbol,shortName:V(e.definition.symbol),file:e.definition.relativePath,startLine:e.definition.startLine,endLine:e.definition.endLine,depth:e.depth,origins:D([...e.origins]),anchorQueries:D([...e.anchorQueries]),referenceExpansion:e.referenceScope!=="none",referenceScope:e.referenceScope}}function ws(e){return{shortName:V(e.definition.symbol),file:e.definition.relativePath,origins:D([...e.origins])}}function Ms(e){return[...se(e.filter(n=>n.fromRegionId!==n.toRegionId),n=>`${n.fromRegionId}\0${n.toRegionId}`).values()].map(n=>({fromRegionId:n[0].fromRegionId,toRegionId:n[0].toRegionId,kinds:D(n.map(o=>o.kind)),relationCount:n.length,fromFiles:D(n.map(o=>o.fromFile)),toFiles:D(n.map(o=>o.toFile)),fromSymbols:D(n.flatMap(o=>o.fromSymbol?[V(o.fromSymbol)]:[])),toSymbols:D(n.flatMap(o=>o.toSymbol?[V(o.toSymbol)]:[])),evidence:D(n.map(o=>o.evidence)),strengths:D(n.map(o=>o.strength??"unknown"))})).sort((n,o)=>n.fromRegionId.localeCompare(o.fromRegionId)||n.toRegionId.localeCompare(o.toRegionId))}function Ns(e,t){return[...e.values()].map(n=>({kind:"external-import",name:n.name,fromRegionIds:D([...n.fromFiles].flatMap(o=>{let i=t.get(o);return i?[i.id]:[]})),fromFiles:D([...n.fromFiles])})).sort((n,o)=>n.name.localeCompare(o.name))}function Rs(e,t,n,o){let i=e.kind==="literal"?t.filter(s=>s.query===e.query).map(s=>s.file):[...n.values()].filter(s=>s.anchorQueries.has(e.query)).map(s=>s.definition.relativePath);return D(i.map(s=>o.get(s)?.id).filter(s=>!!s))}function vo(e){return e.keyParts.map(t=>`${t.name}=${t.value}`).join(" ")}function D(e){return[...new Set(e)].sort()}function Eo(e,t){return e.fromRegionId.localeCompare(t.fromRegionId)||e.toRegionId.localeCompare(t.toRegionId)||e.kind.localeCompare(t.kind)||e.fromFile.localeCompare(t.fromFile)||e.toFile.localeCompare(t.toFile)||(e.line??-1)-(t.line??-1)}function Fs(e,t){return Ne(e.origins)-Ne(t.origins)||e.shortName.localeCompare(t.shortName)}function Ts(e,t){return e.depth-t.depth||e.file.localeCompare(t.file)}function Ps(e,t){return e.depth-t.depth||e.file.localeCompare(t.file)||e.symbol.localeCompare(t.symbol)}function Io(e,t){return e.file.localeCompare(t.file)||e.line-t.line||e.query.localeCompare(t.query)}export{Ua as a,za as b,dt as c};
|
|
16
|
+
//# sourceMappingURL=chunk-BMKTDJI6.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as o}from"./chunk-BGBBVSH4.js";function f(e,n){return o(e)-o(n)||e.relativePath.localeCompare(n.relativePath)}function l(e,n){return typeof n!="number"||n<=0||e.length<=n?e:e.slice(0,n)}function a(e){let n=new Set,r=[];for(let t of e){let i=`${t.symbol}|${t.file}`;n.has(i)||(n.add(i),r.push(t))}return r}function d(e){return[...new Set((e??[]).map(n=>n.trim()).filter(Boolean))]}function p(e){return e.replace(/^#/u,"").replace(/\(\)$/u,"")}export{f as a,l as b,a as c,d,p as e};
|
|
2
|
+
//# sourceMappingURL=chunk-BOJ5SVE2.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as R,b as F}from"./chunk-JGMD6JGB.js";import{a as k,b as C,c as V,e as o,f as v}from"./chunk-B3X6KU75.js";import{a as B,b as g}from"./chunk-KMVGRIO2.js";import{O as y}from"./chunk-C7WSQA6A.js";function j(e,s={}){let{minSimilarity:m=.45,minSharedBehaviors:t=6,limit:i=20,scope:l,scanLimit:c,filePattern:d,focusFiles:h}=s,u=y(e).vueProfiles({scope:l,minBehaviorTokens:Math.max(3,t),scanLimit:c}).map(r=>({file:r.file,tokens:r.behaviorTokens,profile:r})),n=R(u,r=>r.tokens);return F({profiles:u,limit:i,filePattern:d,focusFiles:h,candidateIndex:n,profile:{name:"vue-composable-candidates"},compare:(r,a)=>T(r,a,m,t),sort:(r,a)=>a.similarity-r.similarity||r.fileA.localeCompare(a.fileA)||r.fileB.localeCompare(a.fileB)})}function T(e,s,m,t){let i=B(e.tokens,s.tokens);if(i.size<t||!P(i))return null;let l=C(e.tokens,s.tokens);if(l<m)return null;let c=o(i,"composable:"),d=o(i,"store:"),h=o(i,"reactivity:"),u=o(i,"lifecycle:"),n=o(i,"request:"),r=o(i,"function:"),a=o(i,"function-verb:"),b=o(i,"template-binding:"),p=o(i,"template-event:"),f=q({sharedComposables:c,sharedStores:d,sharedReactivity:h,sharedLifecycle:u,sharedRequests:n,sharedFunctions:r,sharedFunctionVerbs:a,sharedBindings:b,sharedTemplateEvents:p});return{fileA:e.file,fileB:s.file,similarity:l,tokenCountA:e.tokens.size,tokenCountB:s.tokens.size,sharedTokens:v(i),sharedComposables:c,sharedStores:d,sharedReactivity:h,sharedLifecycle:u,sharedRequests:n,sharedFunctions:r,sharedFunctionVerbs:a,sharedBindings:b,sharedTemplateEvents:p,evidenceClass:f.evidenceClass,actionTier:f.actionTier,evidenceClassReasons:f.reasons,recommendation:f.recommendation,uniqueToA:v(g(e.tokens,s.tokens)).slice(0,25),uniqueToB:v(g(s.tokens,e.tokens)).slice(0,25),reason:S({sharedComposables:c,sharedStores:d,sharedRequests:n,sharedLifecycle:u,sharedFunctions:r,sharedFunctionVerbs:a,sharedBindings:b}),locA:e.profile.totalLines,locB:s.profile.totalLines}}function q(e){return k({genericWords:A,primitiveGroups:[{values:e.sharedReactivity,reasonPrefix:"shared reactivity primitive",bucket:"generic"},{values:e.sharedLifecycle,reasonPrefix:"shared lifecycle primitive",bucket:"generic"}],nameGroups:[{names:e.sharedComposables,label:"shared composable",fallbackBucket:"shared-abstraction"},{names:e.sharedStores,label:"shared store",fallbackBucket:"shared-abstraction"},{names:e.sharedRequests,label:"shared request",fallbackBucket:"generic"},{names:e.sharedFunctions,label:"shared function",fallbackBucket:"generic"},{names:e.sharedFunctionVerbs,label:"shared action verb",fallbackBucket:"generic"},{names:e.sharedBindings,label:"shared binding",fallbackBucket:"generic"},{names:e.sharedTemplateEvents,label:"shared template event",fallbackBucket:"generic"}],recommendation:w})}function w(e){switch(e){case"domain-behavior":return"Review for a shared composable, store, or feature module around the named domain behavior.";case"mixed":return"Separate generic Vue mechanics from domain-specific behavior before extracting a composable.";case"shared-abstraction":return"Review the existing composable/store usage first; extract only if duplicated behavior remains outside it.";case"generic-workflow-scaffolding":return"Treat as support evidence for a repeated workflow shape, not direct composable-extraction evidence."}}function P(e){let s=0,m=0,t=0,i=0,l=0,c=0,d=0;for(let n of e)n.startsWith("composable:")?s+=1:n.startsWith("store:")?m+=1:n.startsWith("request:")?t+=1:n.startsWith("lifecycle:")?i+=1:n.startsWith("function:")?l+=1:n.startsWith("reactivity:")?c+=1:(n.startsWith("function-verb:")||n.startsWith("template-binding:")||n.startsWith("template-event:"))&&(d+=1);let h=s+m,u=h+t+i+l+d;return V([{name:"requests",count:t},{name:"lifecycle",count:i},{name:"functions",count:l},{name:"reusableHooks",count:h},{name:"reactivity",count:c},{name:"namedBehavior",count:u}],[{min:{requests:1,namedBehavior:4},reason:"shared request workflow"},{min:{lifecycle:1,functions:2,namedBehavior:4},reason:"shared lifecycle workflow"},{min:{reusableHooks:2,requests:1,namedBehavior:5},reason:"shared reusable Vue hooks and requests"},{min:{reusableHooks:2,functions:2,namedBehavior:5},reason:"shared reusable Vue hooks and functions"},{min:{functions:2,reactivity:1,namedBehavior:4},reason:"shared reactive functions"}]).pass}function S(e){let s=[];return e.sharedComposables.length&&s.push(`shared composables: ${e.sharedComposables.join(", ")}`),e.sharedStores.length&&s.push(`shared stores: ${e.sharedStores.join(", ")}`),e.sharedRequests.length&&s.push(`shared request helpers: ${e.sharedRequests.join(", ")}`),e.sharedLifecycle.length&&s.push(`shared lifecycle: ${e.sharedLifecycle.join(", ")}`),e.sharedFunctions.length&&s.push(`shared functions: ${e.sharedFunctions.slice(0,6).join(", ")}`),e.sharedFunctionVerbs.length&&s.push(`shared action verbs: ${e.sharedFunctionVerbs.slice(0,6).join(", ")}`),e.sharedBindings.length&&s.push(`shared template bindings: ${e.sharedBindings.slice(0,6).join(", ")}`),s.join("; ")||"shared Vue behavior profile"}var A=new Set(["add","apply","cancel","change","clear","close","composable","create","data","delete","draft","edit","error","fetch","filter","form","item","items","load","loading","name","open","reactive","ref","refresh","remove","request","reset","resource","row","rows","save","saving","search","select","selected","store","submit","toggle","update","use","value","watch"]);export{j as a};
|
|
2
|
+
//# sourceMappingURL=chunk-BVR44XXB.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as _}from"./chunk-P5XHIJHI.js";import{
|
|
1
|
+
import{a as _}from"./chunk-P5XHIJHI.js";import{d as P,w as E,y as M}from"./chunk-JSHDCVUM.js";import{execFileSync as U}from"child_process";var L=2e3,S=50,J=64,Y=8,V=3,W=2160*60*60,X=/\b(?:fix(?:es|ed)?|bug|regression|hotfix)\b/i,Z=3,Q=/#\d+|\b[A-Z][A-Z0-9]+-\d+\b/g,q=/^([a-z][a-z0-9-]+)(?:\([^)]+\))?!?:/i;function tt(t){let e=P(t,{clearGroups:["whole-project"]});return(i,n,r)=>{let o=r??H(i.config.projectRoot);if(!o)return null;let s=e.has(i)?e.get(i,()=>({head:"",value:null})):null;return s&&s.head===o?s.value:(e.invalidate(i),e.get(i,()=>({head:o,value:n(i.config.projectRoot,o)})).value)}}function F(t){let e=P(t,{clearGroups:["whole-project"]});return(i,n,r,o)=>{let s=o??H(i.config.projectRoot);if(!s)return null;let c=e.has(i)?e.get(i,()=>({head:"",values:new Map})):null;(!c||c.head!==s)&&e.invalidate(i);let l=e.get(i,()=>({head:s,values:new Map}));if(l.values.has(n))return l.values.get(n)??null;let d=r(i.config.projectRoot,s);return l.values.set(n,d),d}}var et=F("git-commit-history");function nt(t,e={}){let i=e.historyMode??"bounded",n=e.head;return{capability:r=>it(t,r,n),commitHistory:()=>x(t,i,n),fileChurn:()=>st(t,i,n),changeAmplification:()=>at(t,i,n),trackedFiles:()=>lt(t,n),fileAddRecords:()=>dt(t,i,n),coChangePairs:(r={})=>bt(t,r,i,n),coChangePairsForFiles:(r,o={})=>z(t,r,o,i,n),directionalCoChangePairsForFiles:(r,o={})=>yt(t,r,o,i,n)}}function x(t,e="bounded",i){return et(t,y(e),(n,r)=>rt(n,r,e),i)}function it(t,e,i){let n=i??H(t.config.projectRoot);return n?{slot:e,available:!0,head:n}:{slot:e,available:!1,head:null,reason:"git history is unavailable for this project"}}function H(t){try{return C(t,["rev-parse","HEAD"]).trim()||null}catch{return null}}function C(t,e){return U("git",["-C",t,...e],{encoding:"utf-8",maxBuffer:64*1024*1024,stdio:["ignore","pipe","ignore"],timeout:3e4,killSignal:"SIGKILL"})}function rt(t,e,i){let n;try{n=C(t,["log","--no-merges","--name-only",...R(i),"--pretty=format:%x01%H%x00%ct%x00%s"])}catch{return null}return{head:e,...w(n,S)}}function ot(t){return X.test(t.subject)}function st(t,e,i){let n=x(t,e,i);if(!n)return null;let r=new Map;for(let o of n.commits){let s=ot(o);for(let c of o.files){let l=r.get(c)??{changes:0,fixChanges:0,lastChangedAt:0};l.changes+=1,s&&(l.fixChanges+=1),o.timestamp>l.lastChangedAt&&(l.lastChangedAt=o.timestamp),r.set(c,l)}}return r}function at(t,e,i){let n=x(t,e,i);if(!n||n.commits.length===0)return null;let r=n.commits.map(o=>o.files.length).filter(o=>o>0).sort((o,s)=>o-s);return r.length===0?null:{medianFilesPerCommit:O(r,.5),p90FilesPerCommit:O(r,.9),commitsAnalyzed:r.length}}function O(t,e){let i=Math.min(t.length-1,Math.floor(t.length*e));return t[i]}var ct=tt("git-tracked-files");function lt(t,e){return ct(t,i=>{try{let n=C(i,["ls-files"]);return new Set(n.split(`
|
|
2
2
|
`).map(r=>r.trim()).filter(r=>r!==""))}catch{return null}},e)}var ut=F("git-file-adds"),D="__git__/file-adds",k=E({kind:"git-file-adds",invalidation:M("git-file-adds"),serialize:gt,deserialize:ft});function _t(t){return nt(t).fileAddRecords()}function dt(t,e,i){let n=y(e);return ut(t,n,(r,o)=>mt(t,r,o,e),i)}function mt(t,e,i,n){let r=k.read(t,I(n),i);if(r)return r;let o=ht(e,n);return o&&k.write(t,I(n),i,o),o}function gt(t){return JSON.stringify([...t.entries()])}function ft(t){if(!t)return null;try{let e=JSON.parse(t);if(!Array.isArray(e))return null;let i=new Map;for(let n of e){if(!Array.isArray(n)||n.length!==2||typeof n[0]!="string")return null;let r=n[1];if(!r||typeof r.commitsAgo!="number"||!Number.isFinite(r.commitsAgo)||typeof r.addedAt!="number"||!Number.isFinite(r.addedAt))return null;i.set(n[0],{commitsAgo:r.commitsAgo,addedAt:r.addedAt})}return i}catch{return null}}function ht(t,e){let i;try{i=C(t,["log","--no-merges","--find-renames","--name-status",...R(e),"--pretty=format:%x01%H%x00%ct%x00%s"])}catch{return null}let n=new Map,r=new Map,o=-1;for(let s of i.split("")){if(s.trim()==="")continue;o+=1;let c=s.indexOf(`
|
|
3
3
|
`),l=c>=0?s.slice(0,c):s,[,d]=l.split("\0"),f=Number(d)||0;if(!(c<0))for(let u of s.slice(c+1).split(`
|
|
4
4
|
`)){let a=pt(u);if(!a)continue;if(a.status==="R"&&a.from&&a.to){let p=r.get(a.to)??new Set([a.to]);r.set(a.from,p);continue}if(a.status!=="A"||!a.to)continue;let m={commitsAgo:o,addedAt:f};n.set(a.to,m);for(let p of r.get(a.to)??[])n.set(p,m)}}return n}function pt(t){let e=t.trim().split(" "),i=e[0]??"";if(!i)return null;let n=i[0]??"";if(n==="R"){let o=e[1],s=e[2];return o&&s?{status:n,from:o,to:s}:null}let r=e[1];return r?{status:n,to:r}:null}var j=F("git-co-change-pairs"),Ct=F("git-directional-co-change-pairs");function bt(t,e,i,n){let r=`all\0${y(i)}\0${T(e)}`,o=j(t,r,()=>{let s=x(t,i,n);return s?G(s,e):null},n);return o&&[...o]}function z(t,e,i,n,r){if(e.size===0)return[];let o=`files\0${y(n)}\0${N(e)}\0${T(i)}`,s=j(t,o,()=>{let c=x(t,n,r);return c?G(c,i,e):null},r);return s&&[...s]}function yt(t,e,i,n,r){if(e.size===0)return[];let o=i.maxFilesPerCommit??S;if(e.size>J)return z(t,e,i,n,r);let s=`directional\0${y(n)}\0${N(e)}\0${T({...i,maxFilesPerCommit:o})}`,c=Ct(t,s,(l,d)=>{let f=At(l,d,e,o,n);return f?G(f,i,e):null},r);return c&&[...c]}function T(t){let e=t.minTogether??4,i=t.minConfidence??.6,n=t.maxFilesPerCommit??S;return`${e}\0${i}\0${n}`}function N(t){return[...t].sort().join("\0")}function G(t,e,i){let{minTogether:n=4,minConfidence:r=.6,maxFilesPerCommit:o=S}=e,s=new Map,c=new Map,l=t.newestAnalyzedAt??0;for(let u of t.commits){let a=[...new Set(u.files)].sort();if(a.length>o)continue;t.newestAnalyzedAt===void 0&&u.timestamp>l&&(l=u.timestamp);let m=Ft(a),p=i===void 0||a.some(g=>i.has(g));for(let g of a)s.set(g,(s.get(g)??0)+1);if(p)for(let g=0;g<a.length;g++)for(let b=g+1;b<a.length;b++){if(i&&!i.has(a[g])&&!i.has(a[b]))continue;let A=`${a[g]}\0${a[b]}`,h=c.get(A)??{together:0,focusedTogether:0,broadTogether:0,lastTogetherAt:0,timestamps:[],subjects:[]};h.together+=1,m?h.broadTogether+=1:h.focusedTogether+=1,u.timestamp>h.lastTogetherAt&&(h.lastTogetherAt=u.timestamp),h.timestamps.push(u.timestamp),h.subjects.push(u.subject),c.set(A,h)}}let d=[],f=l-W;for(let[u,a]of c){let m=a.together;if(m<n)continue;let[p,g]=u.split("\0"),b=s.get(p)??m,A=s.get(g)??m,h=Math.max(m/b,m/A);if(h<r)continue;let $=a.broadTogether/m,v=a.timestamps.filter(K=>K>=f).length;d.push({fileA:p,fileB:g,together:m,confidence:h,changesA:b,changesB:A,focusedTogether:a.focusedTogether,broadTogether:a.broadTogether,broadCommitRatio:$,lastTogetherAt:a.lastTogetherAt,recentTogether:v,commitScope:Pt(a.broadTogether,m),recency:v>0?"recent":"stale",subjectContext:Ht(a.subjects)})}return d.sort((u,a)=>a.together-u.together||a.confidence-u.confidence||u.fileA.localeCompare(a.fileA)),d}function At(t,e,i,n,r){let o;try{o=xt(t,r)}catch{return null}if(o.length===0)return{head:e,commits:[],skippedBulkCommits:0,newestAnalyzedAt:0};let s;try{s=C(t,["log","--no-merges","--format=%H",...R(r),"--",...[...i].sort()])}catch{return null}let c=new Set(o.map(a=>a.hash)),l=s.split(`
|
|
@@ -6,4 +6,4 @@ import{a as _}from"./chunk-P5XHIJHI.js";import{A as M,y as E}from"./chunk-WCCFZ7
|
|
|
6
6
|
`).map(n=>n.trim()).filter(n=>n!=="").map(n=>{let[r,o]=n.split("\0");return{hash:r??"",timestamp:Number(o)||0}}).filter(n=>n.hash!=="")}function R(t){return t==="full"?[]:["-n",String(B())]}function B(){return _(process.env.SCIP_QUERY_GIT_HISTORY_MAX_COMMITS)??L}function y(t){return t==="full"?"full":`bounded:${B()}`}function I(t){let e=y(t);return e===`bounded:${L}`?D:`${D}:${e}`}function St(t,e,i){for(let r=0;r<e.length;r+=20){let o=e.slice(r,r+20),s;try{s=C(t,["show","--no-walk=unsorted","--name-only","--pretty=format:%x01%H%x00%ct%x00%s",...o.map(l=>l.hash)])}catch{return e[0]?.timestamp??0}let c=w(s,i);if(c.commits.length>0)return c.commits[0].timestamp}return 0}function w(t,e){let i=[],n=0;for(let r of t.split("")){if(r.trim()==="")continue;let o=r.indexOf(`
|
|
7
7
|
`),s=o>=0?r.slice(0,o):r,[c,l,d]=s.split("\0");if(!c||!l)continue;let f=o>=0?r.slice(o+1).split(`
|
|
8
8
|
`).map(u=>u.trim()).filter(u=>u!==""):[];if(f.length>e){n+=1;continue}i.push({hash:c,timestamp:Number(l)||0,subject:d??"",files:f})}return{commits:i,skippedBulkCommits:n}}function Ft(t){return t.length>=Y?!0:Rt(t).size>=V}function Rt(t){let e=new Set;for(let i of t){let n=i.indexOf("/");e.add(n>=0?i.slice(0,n):".")}return e}function Pt(t,e){return t===0?"focused":t/e>=.5?"broad-sweep":"mixed"}function Ht(t){let e=new Set,i=[],n=[];for(let r of t){!n.includes(r)&&n.length<Z&&n.push(r);for(let o of Tt(r))e.add(o);for(let o of r.match(Q)??[])i.includes(o)||i.push(o)}return{subjectLabels:[...e].sort(),issueRefs:i,sampleSubjects:n,externalIssueLabelStatus:"unavailable"}}function Tt(t){let e=new Set,i=q.exec(t)?.[1]?.toLowerCase();return i&&e.add(Gt(i)),/\b(?:feat|feature)\b/i.test(t)&&e.add("feature"),/\b(?:fix(?:es|ed)?|bug|regression|hotfix)\b/i.test(t)&&e.add("fix"),/\b(?:docs?|documentation|guide|readme)\b/i.test(t)&&e.add("docs"),/\brefactor(?:ing|ed)?\b/i.test(t)&&e.add("refactor"),/\btests?\b/i.test(t)&&e.add("test"),/\b(?:release|version|v\d+\.\d+)\b/i.test(t)&&e.add("release"),/\bchore\b/i.test(t)&&e.add("chore"),/\bbuild\b/i.test(t)&&e.add("build"),/\bci\b/i.test(t)&&e.add("ci"),/\bperf(?:ormance)?\b/i.test(t)&&e.add("perf"),[...e]}function Gt(t){return t==="feat"?"feature":t}export{nt as a,C as b,_t as c};
|
|
9
|
-
//# sourceMappingURL=chunk-
|
|
9
|
+
//# sourceMappingURL=chunk-BYXWXLKM.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{a as b}from"./chunk-3TNRNKAT.js";import{a as D}from"./chunk-Z2QB75BS.js";import{c as C}from"./chunk-NODZYYGC.js";import{a as I}from"./chunk-G6VV7ROY.js";import{c as P}from"./chunk-UM56ZET4.js";import{b as F}from"./chunk-7MUHSZGN.js";import{f as M,g as S}from"./chunk-743MEVFJ.js";import{d as g}from"./chunk-7Z4GMCHM.js";function re(e,n={}){let t=new C(e).productionCallableDefinitions({scope:n.scope,requireCallableSymbol:!0,includeSuppressed:!0}),r=L(e,t),l=n.search?.trim().toLocaleLowerCase();return t.map(s=>j(e,s,r.get(s.symbolId)??[])).filter(s=>s!==null).map(s=>s.result).filter(s=>!l||T(s).includes(l)).sort(G)}function ie(e,n,o={}){let t=F(e,n);if(!t.match)return{kind:"missing",query:n};if(t.total>1)return{kind:"ambiguous",query:n,total:t.total,candidates:[{symbol:t.match.symbol,shortName:g(t.match.symbol),relativePath:t.match.relativePath,startLine:t.match.startLine},...t.candidates]};let r=new C(e),l=r.definitionsForFile(t.match.relativePath).find(a=>a.symbol===t.match.symbol);if(!l?.isFunctionLike)return{kind:"not-entry",query:n,symbol:t.match.symbol,shortName:g(t.match.symbol),file:t.match.relativePath,reason:"The resolved symbol is not a callable definition."};let s=L(e,[l]),f=j(e,l,s.get(l.symbolId)??[]);if(!f)return{kind:"not-entry",query:n,symbol:l.symbol,shortName:g(l.symbol),file:l.relativePath,reason:"The callable is neither an external root nor an uncalled callable on a detected entry surface."};let m=K(e,r,l),i=new Set(o.expand??[]),c=z(m,i),d=new Set(c.regions.filter(a=>a.expanded).map(a=>a.id)),p=[...i].filter(a=>!d.has(a)).sort();return{kind:"matched",query:n,entry:f.result,regions:c.regions,regionEdges:c.regionEdges,unmatchedExpansions:p,coverage:{completeWithinIndexedStaticCallEdges:!0,completeWithinSelectedStaticEvidence:!0,candidateReachabilityIncluded:m.edges.some(a=>a.evidenceStrength==="candidate"),dynamicDispatchRepresented:!1,symbolCount:m.symbols.length,symbolEdgeCount:m.edges.length,exactSymbolEdgeCount:m.edges.filter(a=>a.evidenceStrength==="exact").length,candidateSymbolEdgeCount:m.edges.filter(a=>a.evidenceStrength==="candidate").length,regionCount:c.regions.length,regionEdgeCount:c.regionEdges.length,externalCallCount:m.externalCalls.length}}}function L(e,n){let o=n.filter(t=>B(e,t.relativePath)||S(e,t.symbol,t.relativePath).length>0);return P(e,o,{semantic:!1,semanticEvidence:I})}function j(e,n,o){let t=$(e,n),r=t.length>0,l=B(e,n.relativePath)&&o.length===0;if(!r&&!l)return null;let s=[...t];return l&&s.push("entry-surface-without-indexed-caller"),{definition:n,result:{symbol:n.symbol,shortName:g(n.symbol),file:n.relativePath,startLine:n.startLine,endLine:n.endLine,documentation:n.documentation,confidence:r?"root":"candidate",evidence:s,indexedCallerCount:o.length}}}function B(e,n){return M(e,n)||/(?:^|\/)entry\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(n)}function $(e,n){let o=S(e,n.symbol,n.relativePath),t=[];return w(o,["package-surface-file","transitive-package-surface"])&&D(e,n)&&t.push("package-public-export"),o.includes("rust-public-library")&&t.push("rust-public-library"),o.includes("framework-entrypoint")&&t.push("framework-dispatched-export"),w(o,["configured-file","configured-path-prefix","configured-qualified-var","configured-symbol-pattern"])&&t.push("configured-entry-root"),t}function w(e,n){return n.some(o=>e.includes(o))}function T(e){return[e.symbol,e.shortName,e.file,e.documentation??"",...e.evidence].join(`
|
|
2
|
+
`).toLocaleLowerCase()}function G(e,n){return N(e.confidence)-N(n.confidence)||e.file.localeCompare(n.file)||e.startLine-n.startLine||e.symbol.localeCompare(n.symbol)}function N(e){return e==="root"?0:1}function K(e,n,o){let t=new Map([[o.symbol,0]]),r=new Map,l=new Map([[o.symbol,o]]),s=new Map,f=new Map,m=[o];for(;m.length>0;){let i=n.calleeMap(m,{additive:!1,semantic:!1}),c=[];for(let d of m){let p=t.get(d.symbol)??0;r.set(d.symbol,k(d,p));for(let a of i.get(d.symbolId)??[]){let y=W(n,a,l);if(!y){let R=O(d,a);f.set(J(R),R);continue}let u=p+1,h=t.get(y.symbol);(h===void 0||u<h)&&t.set(y.symbol,u),r.set(y.symbol,k(y,Math.min(u,h??u)));let v=q(d,y,a);s.set(H(v),v),h===void 0&&c.push(y)}}m=c}return{symbols:[...r.values()].sort(Q),edges:[...s.values()].sort(U),externalCalls:[...f.values()].sort(V)}}function W(e,n,o){let t=o.get(n.symbol);if(t)return t;let r=e.definitionsForFile(n.file).find(l=>l.symbol===n.symbol)??null;return r&&o.set(r.symbol,r),r}function k(e,n){return{symbol:e.symbol,shortName:g(e.symbol),file:e.relativePath,depth:n}}function q(e,n,o){return{fromSymbol:e.symbol,fromShortName:g(e.symbol),fromFile:e.relativePath,toSymbol:n.symbol,toShortName:g(n.symbol),toFile:n.relativePath,source:o.source,evidenceStrength:o.source==="scip-chunk"?"candidate":"exact"}}function O(e,n){return{fromSymbol:e.symbol,fromShortName:g(e.symbol),fromFile:e.relativePath,toSymbol:n.symbol,toShortName:g(n.symbol),reportedFile:n.file,source:n.source,evidenceStrength:n.source==="scip-chunk"?"candidate":"exact"}}function z(e,n){let o=b(e.symbols,i=>i.file),t=b(e.edges.filter(i=>i.fromFile===i.toFile),i=>i.fromFile),r=b(e.externalCalls,i=>i.fromFile),l=A(e.edges.filter(i=>i.fromFile!==i.toFile)),s=b(l,i=>i.toRegionId),f=b(l,i=>i.fromRegionId);return{regions:[...o.entries()].map(([i,c])=>{let d=x(i),p=n.has(d),a=t.get(i)??[],y=r.get(i)??[];return{id:d,file:i,minDepth:Math.min(...c.map(u=>u.depth)),symbolCount:c.length,internalEdgeCount:a.length,externalCallCount:y.length,incomingRegionIds:E((s.get(d)??[]).map(u=>u.fromRegionId)),outgoingRegionIds:E((f.get(d)??[]).map(u=>u.toRegionId)),expanded:p,symbols:p?c:[],internalEdges:p?a:[],externalCalls:p?y:[]}}).sort((i,c)=>i.minDepth-c.minDepth||i.file.localeCompare(c.file)),regionEdges:l}}function A(e){let n=new Map;for(let o of e){let t=`${o.fromFile}\0${o.toFile}`,r=n.get(t)??[];r.push(o),n.set(t,r)}return[...n.values()].map(o=>{let t=o[0];return{fromRegionId:x(t.fromFile),fromFile:t.fromFile,toRegionId:x(t.toFile),toFile:t.toFile,callCount:o.length,exactCallCount:o.filter(r=>r.evidenceStrength==="exact").length,candidateCallCount:o.filter(r=>r.evidenceStrength==="candidate").length,fromSymbols:E(o.map(r=>r.fromShortName)),toSymbols:E(o.map(r=>r.toShortName)),evidence:E(o.map(r=>r.source))}}).sort((o,t)=>o.fromFile.localeCompare(t.fromFile)||o.toFile.localeCompare(t.toFile))}function x(e){return`file:${e}`}function E(e){return[...new Set(e)].sort()}function H(e){return`${e.fromSymbol}\0${e.toSymbol}`}function J(e){return`${e.fromSymbol}\0${e.toSymbol}`}function Q(e,n){return e.depth-n.depth||e.file.localeCompare(n.file)||e.symbol.localeCompare(n.symbol)}function U(e,n){return e.fromFile.localeCompare(n.fromFile)||e.fromSymbol.localeCompare(n.fromSymbol)||e.toSymbol.localeCompare(n.toSymbol)}function V(e,n){return e.fromFile.localeCompare(n.fromFile)||e.fromSymbol.localeCompare(n.fromSymbol)||e.toSymbol.localeCompare(n.toSymbol)}export{re as a,ie as b};
|
|
3
|
+
//# sourceMappingURL=chunk-BZCRHP46.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as i,c as s}from"./chunk-F4FNK44D.js";import{execFileSync as l}from"child_process";import{createRequire as c}from"module";import{existsSync as u}from"fs";import{platform as p,arch as d}from"os";var t="v0.8.1",g="https://github.com/sourcegraph/scip",o=`github.com/sourcegraph/scip/cmd/scip@${t}`,f=c(import.meta.url),m="SCIP_QUERY_SCIP_BIN";function h(e){if(e.isOnPath("scip"))return{source:"path",path:"scip"};let n=e.env[m];if(n&&e.fileExists(n))return{source:"env",path:n};if(e.platform==="win32"){let r=e.resolveSidecar(e.arch);if(r&&e.fileExists(r))return{source:"sidecar",path:r}}return null}function v(e){for(let n of e==="arm64"?["arm64","x64"]:[e])try{return f.resolve(`scip-query-scip-windows/scip-win32-${n}.exe`)}catch{}return null}function a(e=process.env){let n=h({platform:p(),arch:d(),env:e,isOnPath:i,fileExists:u,resolveSidecar:v});return n?.source==="path"?s("scip")??n.path:n?.path??null}function x(){let e=a();if(!e)return null;try{return l(e,["--version"],{stdio:"pipe",timeout:1e4,killSignal:"SIGKILL"}).toString().trim()}catch{return null}}function I(e){if(i("go")){e(`Installing immutable ${o} via go install into the Go bin directory (GOBIN or GOPATH/bin); expected executable: scip.`);try{if(l("go",["install",o],{stdio:"inherit",timeout:3e5,env:process.env}),i("scip")){let n=a(),r=x();if(n&&r&&r.includes(t))return e(`Successfully installed ${o}; resolved executable: ${n}; reported version: ${r}.`),!0;e(`go install completed, but the resolved scip executable did not report ${t} (executable: ${n??"unresolved"}; version: ${r??"unavailable"}).`)}}catch(n){let r=n instanceof Error?n.message:String(n);e(`go install failed: ${r}`)}}return e("Could not auto-install scip CLI."),e(`Install manually from: ${g}/releases`),!1}export{a,I as b};
|
|
2
|
+
//# sourceMappingURL=chunk-BZYSGZRK.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as y}from"./chunk-WZ7V4BQV.js";import{a as d}from"./chunk-Z2QB75BS.js";import{a as P}from"./chunk-5BJPJUXF.js";import{a as v}from"./chunk-BOJ5SVE2.js";import{c as b}from"./chunk-NODZYYGC.js";import{a as p}from"./chunk-BGBBVSH4.js";import{a as g,h}from"./chunk-743MEVFJ.js";import{d as l,h as u}from"./chunk-7Z4GMCHM.js";import{n as f,o as m}from"./chunk-6LS3IG2I.js";import{basename as x,extname as L}from"path";function z(i,e){let{scope:r,maxLoc:n=15,limit:o=30,scanLimit:s}=e??{},a=new b(i);return P({candidates:()=>E(i,a,r,n),orderCandidates:v,scanLimit:s,profile:{name:"passthrough-candidates"},prepare:t=>a.calleeMap(t,{semantic:e?.semantic!==!1}),evaluate:(t,c)=>S(i,t,c.get(t.symbolId)??[]),orderResults:(t,c)=>t.loc-c.loc||t.file.localeCompare(c.file),limit:o})}function S(i,e,r){let n=w(r);if(n.size!==1||!f(i,e.relativePath,e.startLine,e.endLine))return null;let[,o]=[...n.entries()][0],s=D(i,e,o),a=T(i,e),t=s.length>0||a.length>0?"signal":"direct";return{symbol:e.symbol,shortName:l(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:p(e),forwardsTo:o.symbol,forwardsToShort:l(o.symbol),forwardsToFile:o.file,actionTier:t,boundaryEvidence:s,publicFacadeEvidence:a,recommendation:I(t,s,a)}}function D(i,e,r){return y(i,e.relativePath,e.startLine,"passthrough","explicit ignore-passthrough comment",[{label:"passthrough name",value:l(e.symbol)},{label:"callee name",value:l(r.symbol)},{label:"passthrough module",value:x(e.relativePath,L(e.relativePath))},{label:"callee module",value:x(r.file,L(r.file))}])}function I(i,e,r){if(i==="signal"){if(r.length>0)return`Review the public API before inlining; public-facade evidence: ${r.slice(0,2).join("; ")}.`;let n=e.filter(C);return n.length>0?`Review the public API before inlining; public-surface evidence: ${n.slice(0,2).join("; ")}.`:`Review the boundary before inlining; boundary evidence: ${e.slice(0,2).join("; ")}.`}return"Inline or remove this passthrough unless an external API or runtime registration depends on the forwarding name."}function T(i,e){return d(i,e)?g(i,e.relativePath)?["exported passthrough is declared on the package public surface"]:h(i,e.symbol,e.relativePath)?["exported passthrough matches configured or framework public entry surface"]:[]:[]}function C(i){return i.includes("public surface")}function w(i){let e=i.some(n=>u(n.symbol))?i.filter(n=>u(n.symbol)):i,r=new Map;for(let n of e)r.has(n.symbol)||r.set(n.symbol,n);return r}function E(i,e,r,n){return e.productionCallableDefinitions({scope:r,minLoc:3,maxLoc:n,requireFunctionLikeSymbol:!0,excludeRustTraitImplMembers:!0}).filter(o=>!m(i,o))}export{z as a};
|
|
2
|
+
//# sourceMappingURL=chunk-C52Q3JEQ.js.map
|