scip-query 0.19.8 → 0.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +97 -0
- package/README.md +158 -48
- package/dist/augment-vue-worker.js +1 -1
- package/dist/chunk-26QA6FAI.js +8 -0
- package/dist/{chunk-KJ2IIBZN.js → chunk-2HPVVXM5.js} +2 -2
- package/dist/chunk-2KAZEZ6M.js +2 -0
- package/dist/chunk-32LVLCLN.js +40 -0
- package/dist/{chunk-24GTWJ3N.js → chunk-3CLX5EOX.js} +2 -2
- package/dist/{chunk-QGGLL3UH.js → chunk-3G66UZBH.js} +2 -2
- package/dist/{chunk-AA4UWRNL.js → chunk-3ORVDL3H.js} +2 -2
- package/dist/chunk-4MAK2HOY.js +6 -0
- package/dist/{chunk-QIQ63BHW.js → chunk-4TURLRL5.js} +2 -2
- package/dist/chunk-4UQVNCQE.js +2 -0
- package/dist/chunk-55Q3WLZX.js +2 -0
- package/dist/{chunk-CTF2GDEX.js → chunk-5E4WNAVD.js} +2 -2
- package/dist/{chunk-ZCEJ63SP.js → chunk-5I5G2QOX.js} +2 -2
- package/dist/chunk-6LDJQXAH.js +2 -0
- package/dist/{chunk-3EDFLQ6A.js → chunk-6O5TICIZ.js} +2 -2
- package/dist/{chunk-ACAM6O5R.js → chunk-6SHPK5ZE.js} +2 -2
- package/dist/chunk-7BAVHKMJ.js +49 -0
- package/dist/chunk-7O5IKBTZ.js +16 -0
- package/dist/{chunk-WJL2L6MV.js → chunk-7PIO7NKH.js} +2 -2
- package/dist/chunk-7S5E7KWT.js +2 -0
- package/dist/{chunk-YLFORA5G.js → chunk-7SQQWSY3.js} +2 -2
- package/dist/chunk-7WPLAODU.js +5 -0
- package/dist/chunk-A73XVBCR.js +20 -0
- package/dist/chunk-AFHORGLH.js +42 -0
- package/dist/chunk-AIE7TFJW.js +9 -0
- package/dist/{chunk-TWMJ3Y3G.js → chunk-AZJQQKDD.js} +2 -2
- package/dist/{chunk-BDOIKGDI.js → chunk-B2PX5I6M.js} +2 -2
- package/dist/{chunk-DQBCO2UY.js → chunk-B7PBSLZN.js} +2 -2
- package/dist/chunk-BBW6JFHN.js +2 -0
- package/dist/{chunk-YTVWB7YJ.js → chunk-BDCC2NPY.js} +2 -2
- package/dist/{chunk-O23I56NA.js → chunk-BNXCIFVY.js} +2 -2
- package/dist/{chunk-MLFZP76A.js → chunk-BPAPWKP6.js} +2 -2
- package/dist/chunk-BS2NMXQZ.js +4 -0
- package/dist/chunk-C3KV2II6.js +2 -0
- package/dist/chunk-C43RDDP4.js +20 -0
- package/dist/{chunk-K2WO7XY7.js → chunk-CJST5ETY.js} +2 -2
- package/dist/chunk-DAFAHMNB.js +42 -0
- package/dist/{chunk-KKME5ZAI.js → chunk-DQGFVPUV.js} +2 -2
- package/dist/chunk-DQLPXMH6.js +8 -0
- package/dist/chunk-EKZTZXHZ.js +117 -0
- package/dist/{chunk-FJ5UDTQF.js → chunk-EN3O7VJA.js} +2 -2
- package/dist/{chunk-HZYDQPNY.js → chunk-EW2NTSFA.js} +2 -2
- package/dist/chunk-F3Z4OUDS.js +8 -0
- package/dist/chunk-FJH2NW7J.js +66 -0
- package/dist/{chunk-MSBDMFER.js → chunk-FKSELJQF.js} +2 -2
- package/dist/chunk-FTFP6O3L.js +11 -0
- package/dist/chunk-FYLK2DEJ.js +2 -0
- package/dist/{chunk-WUW7YUAH.js → chunk-GH74ASD6.js} +2 -2
- package/dist/{chunk-464PLI5O.js → chunk-GMXWZP2B.js} +2 -2
- package/dist/chunk-GOUBFH5O.js +3 -0
- package/dist/{chunk-FIJCV235.js → chunk-HLF2TX6R.js} +2 -2
- package/dist/{chunk-WWKWUPSU.js → chunk-HX4GQPZP.js} +2 -2
- package/dist/chunk-HX7M4BDI.js +30 -0
- package/dist/chunk-HZ72SESS.js +128 -0
- package/dist/{chunk-SERUIGV5.js → chunk-IB2N4FIY.js} +2 -2
- package/dist/chunk-ILMHV3KM.js +2 -0
- package/dist/chunk-IZYYAFN5.js +2 -0
- package/dist/{chunk-GNC4JVAN.js → chunk-JAYYFEQY.js} +2 -2
- package/dist/{chunk-QJIVBYEK.js → chunk-JDOEX4E6.js} +2 -2
- package/dist/chunk-JFGGXWQF.js +947 -0
- package/dist/chunk-JN4NMBEX.js +8 -0
- package/dist/{chunk-6M7RONVB.js → chunk-JVYA47YU.js} +2 -2
- package/dist/{chunk-7KYNAMMH.js → chunk-JW56N3KI.js} +2 -2
- package/dist/{chunk-OUBAF226.js → chunk-JZ2OXNWB.js} +2 -2
- package/dist/chunk-KMKTIO2G.js +8 -0
- package/dist/chunk-L5GJNV2T.js +8 -0
- package/dist/{chunk-MNSTUIDD.js → chunk-L7AW2QB5.js} +2 -2
- package/dist/chunk-L7JDSCDF.js +4 -0
- package/dist/chunk-LU47HG23.js +14 -0
- package/dist/chunk-LVY7NPF7.js +2 -0
- package/dist/chunk-LY4WC4AD.js +74 -0
- package/dist/{chunk-7FT5Y65S.js → chunk-MKCDWWGV.js} +2 -2
- package/dist/chunk-MNE7YG56.js +2 -0
- package/dist/{chunk-7QHY3H7P.js → chunk-MRXBEXSY.js} +2 -2
- package/dist/chunk-MV7OWDUX.js +2 -0
- package/dist/{chunk-ZJ5CBXK3.js → chunk-N5W4YZMK.js} +2 -2
- package/dist/chunk-NGEXCJJW.js +11 -0
- package/dist/{chunk-7SWJEWJF.js → chunk-NIW6JDC5.js} +2 -2
- package/dist/{chunk-O3O4XXO6.js → chunk-O64IZ6UX.js} +2 -2
- package/dist/{chunk-3ZSJ3PWF.js → chunk-PBUQFCNB.js} +2 -2
- package/dist/{chunk-7RAG65VK.js → chunk-POAVPHH7.js} +2 -2
- package/dist/{chunk-A3QXWFBK.js → chunk-PQCI4SQX.js} +2 -2
- package/dist/{chunk-4BV4QAZJ.js → chunk-PXY7F6Y4.js} +2 -2
- package/dist/chunk-RDO52JGY.js +2 -0
- package/dist/chunk-RJT3TUUZ.js +2 -0
- package/dist/{chunk-S4S2WOIX.js → chunk-RUJURYSV.js} +2 -2
- package/dist/{chunk-JAY7YWS3.js → chunk-RVLDN63O.js} +2 -2
- package/dist/chunk-RXOXSKY3.js +2 -0
- package/dist/chunk-S7OYBOCK.js +2 -0
- package/dist/chunk-SMNXQT5Z.js +3 -0
- package/dist/{chunk-NE3TZUCI.js → chunk-SRAFT254.js} +2 -2
- package/dist/{chunk-ELLMY7XJ.js → chunk-SXP2MBJH.js} +2 -2
- package/dist/chunk-T7YQSHPQ.js +3 -0
- package/dist/{chunk-WY45BHKQ.js → chunk-TFRAYKN6.js} +2 -2
- package/dist/{chunk-2SNGN6U4.js → chunk-UJCOIXDY.js} +2 -2
- package/dist/{chunk-MZZBAITE.js → chunk-UJPRPGCO.js} +2 -2
- package/dist/chunk-W4ETQAXM.js +2 -0
- package/dist/chunk-WCCFZ7V7.js +113 -0
- package/dist/chunk-WUPW3UN3.js +3 -0
- package/dist/{chunk-7LSVMFX7.js → chunk-WXZLAAWK.js} +2 -2
- package/dist/{chunk-5ML2BNRH.js → chunk-X54AGLVX.js} +2 -2
- package/dist/chunk-XKWKXZKW.js +20 -0
- package/dist/{chunk-5YLUDDAF.js → chunk-XSRF6Q77.js} +2 -2
- package/dist/chunk-Y2MVPNKY.js +5 -0
- package/dist/{chunk-JHF3E4YM.js → chunk-YKUU5AIC.js} +2 -2
- package/dist/{chunk-E3HYEQO7.js → chunk-YLCJLTPL.js} +2 -2
- package/dist/{chunk-7VCOXZH3.js → chunk-YTQVETEO.js} +2 -2
- package/dist/chunk-Z4N3MZYA.js +38 -0
- package/dist/chunk-ZHXX42OH.js +18 -0
- package/dist/chunk-ZJOOT3BG.js +2 -0
- package/dist/{chunk-P3UO3EH3.js → chunk-ZK26BAQL.js} +2 -2
- package/dist/{chunk-33KUO7CG.js → chunk-ZTETIQ35.js} +2 -2
- package/dist/cli.js +3 -8
- package/dist/command-descriptors-DSS46KXI.js +642 -0
- package/dist/{config-types-B6MEoRNy.d.ts → config-types-jVM3D7MA.d.ts} +68 -2
- package/dist/{db-DYLKr9Wn.d.ts → db-B5PM5yNk.d.ts} +20 -2
- package/dist/{diff-gate-types-C9BoYwYD.d.ts → diff-gate-types-B0QYpDv1.d.ts} +2 -1
- package/dist/direct-navigation-6YHV6IB5.js +3 -0
- package/dist/{health-DgxIDXJC.d.ts → health-Do5TKSJI.d.ts} +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -1
- package/dist/postinstall.js +1 -1
- package/dist/queries/affected.d.ts +2 -2
- package/dist/queries/affected.js +1 -1
- package/dist/queries/architecture.d.ts +2 -2
- package/dist/queries/architecture.js +1 -1
- package/dist/queries/bottlenecks.d.ts +2 -2
- 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 +2 -2
- package/dist/queries/call-graph.js +1 -1
- package/dist/queries/change-surface.d.ts +22 -3
- 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 +2 -2
- package/dist/queries/code.js +1 -1
- package/dist/queries/complexity-hotspots.d.ts +3 -3
- package/dist/queries/complexity-hotspots.js +1 -1
- package/dist/queries/complexity.d.ts +3 -3
- package/dist/queries/complexity.js +1 -1
- package/dist/queries/convergence.d.ts +2 -2
- package/dist/queries/convergence.js +1 -1
- package/dist/queries/coupling.d.ts +2 -2
- package/dist/queries/coupling.js +1 -1
- package/dist/queries/cycles.d.ts +2 -2
- package/dist/queries/cycles.js +1 -1
- package/dist/queries/dataflow.d.ts +2 -2
- 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 +2 -2
- package/dist/queries/decorative-checkers.js +1 -1
- package/dist/queries/deep-chains.d.ts +2 -2
- package/dist/queries/deep-chains.js +1 -1
- package/dist/queries/deps.d.ts +2 -2
- package/dist/queries/deps.js +1 -1
- package/dist/queries/diff-gate.d.ts +40 -7
- package/dist/queries/diff-gate.js +1 -1
- package/dist/queries/diff-impact.d.ts +84 -6
- package/dist/queries/diff-impact.js +1 -1
- package/dist/queries/doc-drift.d.ts +3 -3
- 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 +3 -3
- package/dist/queries/duplicate-bodies.js +1 -1
- package/dist/queries/extract-candidates.d.ts +2 -2
- package/dist/queries/extract-candidates.js +1 -1
- package/dist/queries/fan.d.ts +2 -2
- package/dist/queries/fan.js +1 -1
- package/dist/queries/files.d.ts +12 -3
- package/dist/queries/files.js +1 -1
- package/dist/queries/health.d.ts +3 -3
- package/dist/queries/health.js +1 -1
- package/dist/queries/hierarchy.d.ts +2 -2
- package/dist/queries/hierarchy.js +1 -1
- package/dist/queries/hotspots.d.ts +2 -2
- 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 +8 -6
- package/dist/queries/incomplete-migration.js +1 -1
- package/dist/queries/index.d.ts +141 -10
- 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 +34 -3
- package/dist/queries/methods.js +1 -1
- package/dist/queries/not-implemented.d.ts +2 -2
- 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 +3 -3
- package/dist/queries/passthrough-candidates.js +1 -1
- package/dist/queries/plan-context.d.ts +3 -3
- 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/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 +2 -2
- package/dist/queries/slice.js +1 -1
- 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 +2 -2
- 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.d.ts +2 -2
- 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 +2 -2
- package/dist/queries/trace.js +1 -1
- package/dist/queries/twin-ab.d.ts +14 -3
- package/dist/queries/twin-ab.js +1 -1
- package/dist/queries/twin-drift.d.ts +2 -2
- 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/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/reindex-worker.js +21 -21
- package/dist/reindex.d.ts +3 -3
- package/dist/reindex.js +33 -33
- package/dist/runtime.d.ts +5 -3
- package/dist/runtime.js +3 -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-Cc6c00-a.d.ts → scip-cli-BnEwZRLJ.d.ts} +1 -1
- package/dist/{symbol-types-BgWU6lhL.d.ts → symbol-types-BIQwfoAx.d.ts} +7 -1
- package/dist/typescript-mailbox-worker.js +2 -0
- package/dist/watch-server.js +2 -42
- package/docs/AGENT_GUIDE.md +13 -6
- package/docs/CLI_JSON_OUTPUT.md +110 -22
- package/docs/COMMAND_REFERENCE.md +88 -88
- package/docs/COMMITTED_RECORD_COMPATIBILITY.md +55 -18
- package/docs/DURABILITY.md +88 -38
- package/docs/INDEX_GENERATIONS.md +65 -19
- package/docs/MAILBOX_LIFECYCLE.md +28 -1
- package/docs/REINDEX_METADATA_COMPATIBILITY.md +18 -8
- package/docs/SECURITY_MODEL.md +31 -14
- package/docs/TELEMETRY_RETENTION.md +11 -4
- package/docs/WATCH_REFRESH_REQUESTS.md +34 -21
- package/docs/WINDOWS_SIDECAR_RELEASE.md +9 -4
- package/docs/analyzer-inventory.md +31 -22
- package/docs/analyzer-validation-ledger.md +8 -0
- package/docs/schemas/outcome-event-record.schema.json +57 -1
- package/docs/schemas/project-config.schema.json +82 -1
- package/docs/schemas/suppression-record.schema.json +84 -3
- package/package.json +5 -5
- package/skills/_shared/SKILL.md +2 -2
- package/skills/_shared/references/agent-contract-catalog.md +1 -1
- package/skills/_shared/references/detector-precision-and-diffgate.md +1 -1
- package/skills/scip-audit/SKILL.md +6 -6
- package/skills/scip-audit/references/claims.md +1 -1
- package/skills/scip-audit/references/cleanup.md +19 -20
- package/skills/scip-audit/references/directory.md +4 -4
- package/skills/scip-audit/references/frontend.md +10 -10
- package/skills/scip-audit/references/twin-drift.md +2 -2
- package/skills/scip-diagnose/references/debug.md +8 -8
- package/skills/scip-diagnose/references/root-cause.md +3 -3
- package/skills/scip-diagnose/references/triage.md +10 -10
- package/skills/scip-explore/SKILL.md +3 -3
- package/skills/scip-improve/SKILL.md +10 -10
- package/skills/scip-improve/references/cleanup-batches.md +3 -3
- package/skills/scip-improve/references/directory-moves.md +3 -3
- package/skills/scip-improve/references/doc-reconcile.md +1 -1
- package/skills/scip-improve/references/frontend-extraction.md +2 -2
- package/skills/scip-improve/references/twin-drift.md +3 -3
- package/skills/scip-plan/SKILL.md +2 -2
- package/skills/scip-plan/references/api-impact.md +5 -5
- package/skills/scip-plan/references/conductor.md +2 -2
- package/skills/scip-plan/references/hyper-optimization.md +1 -1
- package/skills/scip-query/SKILL.md +15 -5
- package/skills/scip-setup/references/bootstrap-workflow.md +7 -8
- package/skills/scip-setup/references/language-verification.md +2 -2
- package/skills/scip-setup/references/per-repo-triage.md +1 -1
- package/skills/scip-verify/SKILL.md +10 -10
- package/skills/scip-verify/references/calibrate-detectors.md +7 -7
- package/dist/chunk-2465DLHK.js +0 -3
- package/dist/chunk-2U3OLUNJ.js +0 -61
- package/dist/chunk-33XTHFKR.js +0 -2
- package/dist/chunk-43KC6EQZ.js +0 -2
- package/dist/chunk-47BU5Z4T.js +0 -8
- package/dist/chunk-4YTUWQ6M.js +0 -18
- package/dist/chunk-64MNV6AB.js +0 -8
- package/dist/chunk-67QRR5YC.js +0 -6
- package/dist/chunk-6GXYN7YA.js +0 -40
- package/dist/chunk-A2TNXAXO.js +0 -8
- package/dist/chunk-APMMR5Y2.js +0 -2
- package/dist/chunk-AZFUMCQB.js +0 -2
- package/dist/chunk-BNXICU42.js +0 -33
- package/dist/chunk-C5Q44Q5D.js +0 -3
- package/dist/chunk-DQGSM7RZ.js +0 -20
- package/dist/chunk-E2LAW7SL.js +0 -30
- package/dist/chunk-E4NFOAD4.js +0 -6
- package/dist/chunk-E5HNT4X2.js +0 -3
- package/dist/chunk-FD3HFKXR.js +0 -5
- package/dist/chunk-GHKEJTCE.js +0 -35
- package/dist/chunk-GLZTVKAB.js +0 -16
- package/dist/chunk-HIB452NU.js +0 -949
- package/dist/chunk-IF6FP6B2.js +0 -66
- package/dist/chunk-JORHF5AL.js +0 -108
- package/dist/chunk-KSGTULOS.js +0 -9
- package/dist/chunk-KXDJAG4N.js +0 -38
- package/dist/chunk-L4S2A7BV.js +0 -2
- package/dist/chunk-LP3ARJKF.js +0 -8
- package/dist/chunk-LSOR3LQG.js +0 -3
- package/dist/chunk-NTUMF2X3.js +0 -56
- package/dist/chunk-QOXBSI6G.js +0 -20
- package/dist/chunk-QXK6UUSM.js +0 -2
- package/dist/chunk-RA3AYNWP.js +0 -112
- package/dist/chunk-RJMDJR3A.js +0 -2
- package/dist/chunk-RLH5VUMG.js +0 -2
- package/dist/chunk-SMQWE25B.js +0 -3
- package/dist/chunk-TAVELHYR.js +0 -2
- package/dist/chunk-VAXNI5NE.js +0 -146
- package/dist/chunk-VVY2G5ET.js +0 -2
- package/dist/chunk-W3DBTGL4.js +0 -11
- package/dist/chunk-WANA4KAQ.js +0 -5
- package/dist/chunk-X4FR5BZF.js +0 -9
- package/dist/chunk-X6RKPDY7.js +0 -2
- package/dist/chunk-YCPASUCX.js +0 -2
- package/dist/chunk-ZL2OGDCD.js +0 -2
- package/dist/command-descriptors-ZW5J4ZEM.js +0 -631
- package/dist/direct-navigation-42YHQPOI.js +0 -3
package/dist/chunk-IF6FP6B2.js
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import{a as b,g as v}from"./chunk-46XGSFNI.js";import y from"ignore";import{existsSync as m,readdirSync as V}from"fs";import{dirname as g,isAbsolute as D,join as u,relative as x,resolve as P}from"path";function k(t){let e=y();return A(t,e)||e.add(G),{isIgnored:s=>f(e,t,s),filter:s=>s.filter(n=>!f(e,t,n))}}function A(t,e){let r=new Set,s=(a,o)=>{if(!(r.has(a)||!m(a)))try{let c=v(a,{maxBytes:b,inputKind:"gitignore file"});e.add(o?F(c,o):c),r.add(a)}catch{}},n=g(t),i=0;for(;n!==g(n)&&i<5&&(s(u(n,".gitignore"),""),!m(u(n,".git")));)n=g(n),i++;return C(t,"",e,s),r.size>0}function C(t,e,r,s){let n=e?u(t,e):t;s(u(n,".gitignore"),e);let i;try{i=V(n,{withFileTypes:!0})}catch{return}for(let a of i){if(!a.isDirectory()||a.name===".git")continue;let o=e?`${e}/${a.name}`:a.name;f(r,t,`${o}/`)||C(t,o,r,s)}}function F(t,e){let r=e.replaceAll("\\","/").replace(/\/+$/,"");return t.split(/\r?\n/).map(s=>_(s,r)).join(`
|
|
2
|
-
`)}function _(t,e){let r=t.trimStart();if(!r||r.startsWith("#"))return t;let s=t.slice(0,t.length-r.length),n=r.startsWith("!"),i=n?r.slice(1):r;if(!i||i.startsWith("#"))return t;let a=i.startsWith("/"),o=a?i.slice(1):i,d=(o.endsWith("/")?o.slice(0,-1):o).includes("/")||a?`${e}/${o}`:`${e}/**/${o}`;return`${s}${n?"!":""}${d}`}var G=`
|
|
3
|
-
# Dependencies
|
|
4
|
-
node_modules/
|
|
5
|
-
vendor/
|
|
6
|
-
.bundle/
|
|
7
|
-
|
|
8
|
-
# Build output
|
|
9
|
-
dist/
|
|
10
|
-
build/
|
|
11
|
-
out/
|
|
12
|
-
target/
|
|
13
|
-
bin/
|
|
14
|
-
obj/
|
|
15
|
-
|
|
16
|
-
# Python
|
|
17
|
-
__pycache__/
|
|
18
|
-
*.pyc
|
|
19
|
-
*.pyo
|
|
20
|
-
.venv/
|
|
21
|
-
venv/
|
|
22
|
-
.env/
|
|
23
|
-
env/
|
|
24
|
-
*.egg-info/
|
|
25
|
-
|
|
26
|
-
# Rust
|
|
27
|
-
target/
|
|
28
|
-
|
|
29
|
-
# Java / Kotlin / Scala
|
|
30
|
-
*.class
|
|
31
|
-
.gradle/
|
|
32
|
-
.mvn/
|
|
33
|
-
|
|
34
|
-
# C# / .NET
|
|
35
|
-
bin/
|
|
36
|
-
obj/
|
|
37
|
-
packages/
|
|
38
|
-
|
|
39
|
-
# Go
|
|
40
|
-
vendor/
|
|
41
|
-
|
|
42
|
-
# Dart
|
|
43
|
-
.dart_tool/
|
|
44
|
-
build/
|
|
45
|
-
|
|
46
|
-
# PHP
|
|
47
|
-
vendor/
|
|
48
|
-
|
|
49
|
-
# IDE / OS
|
|
50
|
-
.idea/
|
|
51
|
-
.vscode/
|
|
52
|
-
*.swp
|
|
53
|
-
*.swo
|
|
54
|
-
.DS_Store
|
|
55
|
-
Thumbs.db
|
|
56
|
-
|
|
57
|
-
# Type definitions (often noise in queries)
|
|
58
|
-
*.d.ts
|
|
59
|
-
`;function f(t,e,r){let s=K(e,r);if(!s)return!1;try{return t.ignores(s)}catch{return!1}}function K(t,e){if(!e||e===".")return null;if(!D(e)&&!e.startsWith(".."))return e.replaceAll("\\","/");let r=D(e)?e:P(t,e),s=x(t,r).replaceAll("\\","/");return!s||s==="."||s.startsWith("..")?null:s}var E=[];function p(t){t.groups.length>0&&E.push(t)}function S(){let t=new WeakMap;return{cache:t,ensure(e){let r=t.get(e);return r||(r=new Map,t.set(e,r)),r}}}function B(t,e){let{cache:r,ensure:s}=S(),n={get(i,a,o){let c=s(i);if(c.has(a))return c.get(a);let l=o();return c.set(a,l),l},invalidate(i,a){r.get(i)?.delete(a)},invalidateAll(i){r.delete(i)},size(i){return r.get(i)?.size??0}};return p({name:t,groups:e.clearGroups,clearAll:i=>n.invalidateAll(i),clearFile:(i,a)=>n.invalidate(i,a)}),n}function z(t,e){let r=new WeakMap,s={get(n,i){let a=r.get(n);if(a)return a.value;let o=i();return r.set(n,{value:o}),o},invalidate(n){r.delete(n)},has(n){return r.has(n)}};return p({name:t,groups:e.clearGroups,clearAll:n=>s.invalidate(n)}),s}var I={clearGroups:["whole-project","source-file"]};function N(t){return w(t,I)}function w(t,e){let{cache:r,ensure:s}=S(),n={get(i,a,o,c){let l=s(i),d=l.get(a);if(d&&d.source===o)return d.value;let h=c();return l.set(a,{source:o,value:h}),h},invalidate(i,a){r.get(i)?.delete(a)},invalidateAll(i){r.delete(i)}};return p({name:t,groups:e.clearGroups,clearAll:i=>n.invalidateAll(i),clearFile:(i,a)=>n.invalidate(i,a)}),n}function H(t,e={}){let r=e.scope?"AND relative_path LIKE ?":"",s=e.like?"AND relative_path LIKE ?":"",n=[...e.scope?[`%${e.scope}%`]:[],...e.like?[e.like]:[]],i=t.all(`SELECT relative_path
|
|
60
|
-
FROM documents
|
|
61
|
-
WHERE 1 = 1
|
|
62
|
-
${t.pathExclusionsFor("documents")}
|
|
63
|
-
${r}
|
|
64
|
-
${s}
|
|
65
|
-
ORDER BY relative_path`,...n).map(o=>o.relative_path),a=e.extensions?i.filter(o=>e.extensions.some(c=>o.toLowerCase().endsWith(c.toLowerCase()))):i;return e.includeIgnored===!1?a.filter(o=>!t.isIgnored(o)):a}export{p as a,B as b,z as c,N as d,w as e,H as f,k as g};
|
|
66
|
-
//# sourceMappingURL=chunk-IF6FP6B2.js.map
|
package/dist/chunk-JORHF5AL.js
DELETED
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import{a as y,e as D,f as $,g as m,h as H,j as X,u as G}from"./chunk-VVY2G5ET.js";function Ne(e,t){let n=e.split("/").at(-1)??e;if(q.has(n)||n===".scipquery.json"||/^tsconfig(?:\..+)?\.json$/.test(n))return"config";if(/\.d\.(?:ts|mts|cts)$/.test(e.toLowerCase()))return"ambient";let i=e.includes(".")?`.${e.split(".").at(-1).toLowerCase()}`:"";return t.some(r=>(Z[r]??[]).includes(i))?"source":"other"}function Q(e,t,n){let i=e.split("/").at(-1)??e;if(n?.includes(e)||n?.includes(i)||q.has(i))return!0;let r=e.includes(".")?`.${e.split(".").at(-1).toLowerCase()}`:"";return(Z[t]??[]).includes(r)}function Lt(e){if(typeof e!="object"||e===null)return null;let t=e;return typeof t.version!="number"||!z(t.languages)||typeof t.pnpmWorkspaces!="boolean"||typeof t.typescriptProjectMode!="string"||!z(t.typescriptProjects)||t.clojureConfigPath!==void 0&&typeof t.clojureConfigPath!="string"||!Array.isArray(t.files)||!t.files.every(N)?null:t}function kt(e,t){let n=new Map((e?.files??[]).map(s=>[s.path,s])),i=new Map(t.files.map(s=>[s.path,s])),r=new Set([...n.keys(),...i.keys()]),a=[];for(let s of[...r].sort()){let c=n.get(s),d=i.get(s),u=Ne(s,t.languages);!c&&d?a.push({kind:"added",path:s,inputKind:u,after:d}):c&&!d?a.push({kind:"deleted",path:s,inputKind:u,before:c}):c&&d&&(c.hash!==d.hash||c.size!==d.size)&&a.push({kind:"modified",path:s,inputKind:u,before:c,after:d})}let o=new Set;return e||o.add("prior-snapshot-unavailable"),e&&e.version!==t.version&&o.add("snapshot-version-changed"),(Y(e?.files??[])||Y(t.files))&&o.add("duplicate-input-path"),[...e?.files??[],...t.files].some(xe)&&o.add("unreadable-input"),{version:1,changes:a,projectIdentityChanged:e?!Le(e,t):!0,uncertainty:[...o].sort()}}function z(e){return Array.isArray(e)&&e.every(t=>typeof t=="string")}function Y(e){return new Set(e.map(t=>t.path)).size!==e.length}function N(e){if(typeof e!="object"||e===null)return!1;let t=e;return typeof t.path=="string"&&typeof t.size=="number"&&Number.isFinite(t.size)&&typeof t.hash=="string"}function xe(e){return e.hash==="unreadable"||e.size<0}function Le(e,t){return J(e.languages,t.languages)&&e.pnpmWorkspaces===t.pnpmWorkspaces&&e.typescriptProjectMode===t.typescriptProjectMode&&J(e.typescriptProjects,t.typescriptProjects)&&e.clojureConfigPath===t.clojureConfigPath}function J(e,t){if(e.length!==t.length)return!1;let n=[...e].sort(),i=[...t].sort();return n.every((r,a)=>r===i[a])}var q=new Set(["package.json","package-lock.json","pnpm-lock.yaml","yarn.lock","bun.lockb","tsconfig.json","tsconfig.base.json","pyproject.toml","setup.py","setup.cfg","Cargo.toml","Cargo.lock","go.mod","go.sum","pom.xml","build.gradle","build.gradle.kts","build.sbt","compile_commands.json","CMakeLists.txt","Makefile","Gemfile","Gemfile.lock","composer.json","composer.lock","pubspec.yaml","pubspec.lock","deps.edn","project.clj","bb.edn","shadow-cljs.edn"]),Z={typescript:[".ts",".tsx",".mts",".cts"],javascript:[".js",".jsx",".mjs",".cjs"],java:[".java"],scala:[".scala"],kotlin:[".kt",".kts"],rust:[".rs"],python:[".py",".pyi"],ruby:[".rb"],go:[".go"],cpp:[".cc",".cpp",".cxx",".hpp",".hh",".hxx"],c:[".c",".h"],csharp:[".cs"],vb:[".vb"],dart:[".dart"],php:[".php"],clojure:[".clj",".cljs",".cljc"]};var x=2,P=3;var L=new Set(X);function ee(e){let t=e;if(typeof e=="string")try{t=JSON.parse(e)}catch(o){return{kind:"malformed",reason:`invalid JSON: ${Ke(o)}`}}if(!m(t))return{kind:"malformed",reason:"metadata must be a JSON object"};let n=t.version;if(!Number.isInteger(n))return{kind:"malformed",reason:"version must be an integer"};if(n!==x&&n!==P)return{kind:"unsupported",version:n,direction:n<x?"older":"future"};let i=Ie(t,n);if(i)return{kind:"malformed",reason:i};let r=t,a={metadata:r,capabilities:ke(r)};return n===x?{kind:"legacy",...a,metadata:r}:{kind:"supported",...a,metadata:r}}function Ut(e){return e.kind==="legacy"||e.kind==="supported"?e.metadata:null}function Kt(e){if(e.kind!=="legacy"&&e.kind!=="supported"||!e.capabilities.stableGenerationIdentity)return null;let t=e.metadata;return JSON.stringify({version:t.version,status:t.status,updatedAt:t.updatedAt,fingerprint:t.fingerprint,indexedLanguages:t.indexedLanguages,scipCompanion:t.scipCompanion})}function ke(e){let t=e.fingerprint!==void 0,n=m(e.fingerprint),i=e.indexedLanguages!==void 0,r=e.status==="complete",a=e.version===P?e:null;return{usableForQuery:i,usableForEvidenceCache:t,publishableGeneration:r&&n&&i,stableGenerationIdentity:r&&t&&typeof e.updatedAt=="string",languageShardReuse:!!a?.languageFingerprints,typescriptProjectShardReuse:!!a?.typescriptProjectShards}}function Ie(e,t){if(e.status!=="complete"&&e.status!=="partial")return"status must be complete or partial";if(e.updatedAt!==void 0&&!H(e.updatedAt))return"updatedAt must be a valid timestamp";for(let n of["requestedLanguages","indexedLanguages"])if(e[n]!==void 0&&!Ae(e[n]))return`${n} must contain unique supported languages`;return e.skipped!==void 0&&!Me(e.skipped)?"skipped must contain supported language/reason pairs":e.scipCompanion!==void 0&&e.scipCompanion!=="current"&&e.scipCompanion!=="deferred"?"scipCompanion must be current or deferred":t===P&&e.languageFingerprints!==void 0&&!Ve(e.languageFingerprints)?"languageFingerprints must map supported languages to fingerprint objects":t===P&&e.typescriptProjectShards!==void 0&&!Ue(e.typescriptProjectShards)?"typescriptProjectShards must map project names to file fingerprints":null}function Ae(e){return!Array.isArray(e)||!e.every(t=>typeof t=="string"&&L.has(t))?!1:new Set(e).size===e.length}function Me(e){return Array.isArray(e)&&e.every(t=>m(t)&&typeof t.language=="string"&&L.has(t.language)&&typeof t.reason=="string")}function Ve(e){return m(e)&&Object.entries(e).every(([t,n])=>L.has(t)&&m(n))}function Ue(e){return m(e)&&Object.values(e).every(t=>m(t)&&Array.isArray(t.files)&&t.files.every(N))}function Ke(e){return e instanceof Error?e.message:String(e)}var te=[];function R(e){e.groups.length>0&&te.push(e)}function Bt(e,t){let n=new Set(t.groups);for(let i of te)i.groups.some(r=>n.has(r))&&(t.file!==void 0&&i.clearFile?i.clearFile(e,t.file):i.clearAll(e))}function ne(){let e=new WeakMap;return{cache:e,ensure(t){let n=e.get(t);return n||(n=new Map,e.set(t,n)),n}}}function E(e,t){let{cache:n,ensure:i}=ne(),r={get(a,o,s){let c=i(a);if(c.has(o))return c.get(o);let d=s();return c.set(o,d),d},invalidate(a,o){n.get(a)?.delete(o)},invalidateAll(a){n.delete(a)},size(a){return n.get(a)?.size??0}};return R({name:e,groups:t.clearGroups,clearAll:a=>r.invalidateAll(a),clearFile:(a,o)=>r.invalidate(a,o)}),r}function Xt(e,t){let n=new WeakMap,i={get(r,a){let o=n.get(r);if(o)return o.value;let s=a();return n.set(r,{value:s}),s},invalidate(r){n.delete(r)},has(r){return n.has(r)}};return R({name:e,groups:t.clearGroups,clearAll:r=>i.invalidate(r)}),i}var We={clearGroups:["whole-project","source-file"]};function Gt(e){return Be(e,We)}function Be(e,t){let{cache:n,ensure:i}=ne(),r={get(a,o,s,c){let d=i(a),u=d.get(o);if(u&&u.source===s)return u.value;let B=c();return d.set(o,{source:s,value:B}),B},invalidate(a,o){n.get(a)?.delete(o)},invalidateAll(a){n.delete(a)}};return R({name:e,groups:t.clearGroups,clearAll:a=>r.invalidateAll(a),clearFile:(a,o)=>r.invalidate(a,o)}),r}import{createHash as $e}from"crypto";import{existsSync as Qt,mkdirSync as He}from"fs";import{dirname as re,join as Xe}from"path";import ie from"better-sqlite3";var Ge="evidence.db";var ze=["source-facts","definition-exclusions","doc-path-tokens","react-component-behavior-profiles"],k=new Set(ze);var nn=512*1024*1024;var T=new WeakMap,Ye=E("evidence-content-hash",{clearGroups:["whole-project","source-file"]}),Je=E("evidence-project-fingerprint",{clearGroups:["whole-project"]}),p="evidence-v1",v="version NOT LIKE 'evidence-%'";function ae(e){return $e("sha256").update(e).digest("hex")}function rn(e,t,n){return Ye.get(e,t,()=>ae(n))}function oe(e){return Je.get(e,"current",()=>{try{if(!e.generation.metadataRaw)return null;let t=ee(e.generation.metadataRaw);if(t.kind!=="legacy"&&t.kind!=="supported"||!t.capabilities.usableForEvidenceCache)return null;let n=t.metadata,i=[...n.indexedLanguages??[]].sort();return ae(JSON.stringify({fingerprint:n.fingerprint,indexedLanguages:i,status:n.status}))}catch(t){return b("project fingerprint unavailable",t),null}})}function b(e,t){process.env.SCIP_QUERY_DEBUG&&console.error(`evidence-cache: ${e}: ${t instanceof Error?t.message:String(t)}`)}function g(e){if(T.has(e))return T.get(e)??null;let t=null;try{let n=new ie(Xe(re(e.config.dbPath),Ge));n.pragma("journal_mode = WAL"),n.pragma("busy_timeout = 5000"),n.pragma("synchronous = NORMAL"),n.exec(`
|
|
2
|
-
CREATE TABLE IF NOT EXISTS file_evidence (
|
|
3
|
-
kind TEXT NOT NULL,
|
|
4
|
-
relative_path TEXT NOT NULL,
|
|
5
|
-
content_hash TEXT NOT NULL,
|
|
6
|
-
version TEXT NOT NULL,
|
|
7
|
-
payload TEXT NOT NULL,
|
|
8
|
-
PRIMARY KEY (kind, relative_path)
|
|
9
|
-
);
|
|
10
|
-
CREATE TABLE IF NOT EXISTS project_evidence (
|
|
11
|
-
kind TEXT NOT NULL,
|
|
12
|
-
cache_key TEXT NOT NULL,
|
|
13
|
-
project_fingerprint TEXT NOT NULL,
|
|
14
|
-
version TEXT NOT NULL,
|
|
15
|
-
payload TEXT NOT NULL,
|
|
16
|
-
PRIMARY KEY (kind, cache_key)
|
|
17
|
-
);
|
|
18
|
-
CREATE TABLE IF NOT EXISTS semantic_callees (
|
|
19
|
-
relative_path TEXT NOT NULL,
|
|
20
|
-
symbol TEXT NOT NULL,
|
|
21
|
-
content_hash TEXT NOT NULL,
|
|
22
|
-
deps_digest TEXT NOT NULL,
|
|
23
|
-
version TEXT NOT NULL,
|
|
24
|
-
payload TEXT NOT NULL,
|
|
25
|
-
PRIMARY KEY (relative_path, symbol)
|
|
26
|
-
);
|
|
27
|
-
CREATE TABLE IF NOT EXISTS semantic_references (
|
|
28
|
-
relative_path TEXT NOT NULL,
|
|
29
|
-
symbol TEXT NOT NULL,
|
|
30
|
-
project_fingerprint TEXT NOT NULL,
|
|
31
|
-
version TEXT NOT NULL,
|
|
32
|
-
payload TEXT NOT NULL,
|
|
33
|
-
PRIMARY KEY (relative_path, symbol)
|
|
34
|
-
);
|
|
35
|
-
CREATE TABLE IF NOT EXISTS finding_outcome_ledger (
|
|
36
|
-
check_name TEXT NOT NULL,
|
|
37
|
-
finding_id TEXT NOT NULL,
|
|
38
|
-
first_seen INTEGER NOT NULL,
|
|
39
|
-
last_seen INTEGER NOT NULL,
|
|
40
|
-
times_shown INTEGER NOT NULL,
|
|
41
|
-
outcome TEXT NOT NULL,
|
|
42
|
-
PRIMARY KEY (check_name, finding_id)
|
|
43
|
-
);
|
|
44
|
-
CREATE TABLE IF NOT EXISTS finding_outcome_observations (
|
|
45
|
-
observation_id TEXT PRIMARY KEY,
|
|
46
|
-
fingerprint TEXT NOT NULL,
|
|
47
|
-
observed_at INTEGER NOT NULL
|
|
48
|
-
);
|
|
49
|
-
`),t={evidence:n,shared:Qe(e.config.sharedEvidenceDbPath),readFileEvidence:n.prepare("SELECT payload FROM file_evidence WHERE kind = ? AND relative_path = ? AND content_hash = ? AND version = ?"),readLegacyFileEvidence:n.prepare(`SELECT payload FROM file_evidence
|
|
50
|
-
WHERE kind = ? AND relative_path = ? AND content_hash = ? AND ${v}
|
|
51
|
-
ORDER BY version DESC
|
|
52
|
-
LIMIT 1`),writeFileEvidence:n.prepare("INSERT OR REPLACE INTO file_evidence (kind, relative_path, content_hash, version, payload) VALUES (?, ?, ?, ?, ?)"),readProjectEvidence:n.prepare("SELECT payload FROM project_evidence WHERE kind = ? AND cache_key = ? AND project_fingerprint = ? AND version = ?"),readLegacyProjectEvidence:n.prepare(`SELECT payload FROM project_evidence
|
|
53
|
-
WHERE kind = ? AND cache_key = ? AND project_fingerprint = ? AND ${v}
|
|
54
|
-
ORDER BY version DESC
|
|
55
|
-
LIMIT 1`),writeProjectEvidence:n.prepare("INSERT OR REPLACE INTO project_evidence (kind, cache_key, project_fingerprint, version, payload) VALUES (?, ?, ?, ?, ?)"),readCallees:n.prepare(`SELECT payload FROM semantic_callees
|
|
56
|
-
WHERE relative_path = ? AND symbol = ? AND content_hash = ? AND deps_digest = ? AND version = ?`),readLegacyCallees:n.prepare(`SELECT payload FROM semantic_callees
|
|
57
|
-
WHERE relative_path = ? AND symbol = ? AND content_hash = ? AND deps_digest = ? AND ${v}
|
|
58
|
-
ORDER BY version DESC
|
|
59
|
-
LIMIT 1`),readCalleesForFile:n.prepare(`SELECT symbol, payload FROM semantic_callees
|
|
60
|
-
WHERE relative_path = ? AND content_hash = ? AND deps_digest = ? AND version = ?`),readLegacyCalleesForFile:n.prepare(`SELECT symbol, payload FROM semantic_callees
|
|
61
|
-
WHERE relative_path = ? AND content_hash = ? AND deps_digest = ? AND ${v}
|
|
62
|
-
ORDER BY symbol, version DESC`),writeCallees:n.prepare(`INSERT OR REPLACE INTO semantic_callees
|
|
63
|
-
(relative_path, symbol, content_hash, deps_digest, version, payload) VALUES (?, ?, ?, ?, ?, ?)`),dropStaleCallees:n.prepare("DELETE FROM semantic_callees WHERE relative_path = ? AND content_hash != ?"),readReferences:n.prepare(`SELECT payload FROM semantic_references
|
|
64
|
-
WHERE relative_path = ? AND symbol = ? AND project_fingerprint = ? AND version = ?`),readLegacyReferences:n.prepare(`SELECT payload FROM semantic_references
|
|
65
|
-
WHERE relative_path = ? AND symbol = ? AND project_fingerprint = ? AND ${v}
|
|
66
|
-
ORDER BY version DESC
|
|
67
|
-
LIMIT 1`),readReferencesForFile:n.prepare(`SELECT symbol, payload FROM semantic_references
|
|
68
|
-
WHERE relative_path = ? AND project_fingerprint = ? AND version = ?`),readLegacyReferencesForFile:n.prepare(`SELECT symbol, payload FROM semantic_references
|
|
69
|
-
WHERE relative_path = ? AND project_fingerprint = ? AND ${v}
|
|
70
|
-
ORDER BY symbol, version DESC`),writeReferences:n.prepare(`INSERT OR REPLACE INTO semantic_references
|
|
71
|
-
(relative_path, symbol, project_fingerprint, version, payload) VALUES (?, ?, ?, ?, ?)`),dropStaleReferences:n.prepare("DELETE FROM semantic_references WHERE relative_path = ? AND project_fingerprint != ?"),readFindingOutcomeLedger:n.prepare("SELECT check_name, finding_id, first_seen, last_seen, times_shown, outcome FROM finding_outcome_ledger"),claimFindingOutcomeObservation:n.prepare(`INSERT OR IGNORE INTO finding_outcome_observations
|
|
72
|
-
(observation_id, fingerprint, observed_at) VALUES (?, ?, ?)`),readFindingOutcomeObservation:n.prepare("SELECT fingerprint FROM finding_outcome_observations WHERE observation_id = ?"),upsertFindingOutcomeLedgerRow:n.prepare(`INSERT INTO finding_outcome_ledger
|
|
73
|
-
(check_name, finding_id, first_seen, last_seen, times_shown, outcome)
|
|
74
|
-
VALUES (?, ?, ?, ?, ?, ?)
|
|
75
|
-
ON CONFLICT(check_name, finding_id) DO UPDATE SET
|
|
76
|
-
first_seen = MIN(finding_outcome_ledger.first_seen, excluded.first_seen),
|
|
77
|
-
last_seen = MAX(finding_outcome_ledger.last_seen, excluded.last_seen),
|
|
78
|
-
times_shown = finding_outcome_ledger.times_shown + excluded.times_shown,
|
|
79
|
-
outcome = excluded.outcome`),updateFindingOutcomeLedgerRow:n.prepare(`UPDATE finding_outcome_ledger
|
|
80
|
-
SET first_seen = MIN(first_seen, ?),
|
|
81
|
-
last_seen = MAX(last_seen, ?),
|
|
82
|
-
outcome = ?
|
|
83
|
-
WHERE check_name = ? AND finding_id = ?`),trimFindingOutcomeLedgerCheck:n.prepare(`DELETE FROM finding_outcome_ledger
|
|
84
|
-
WHERE rowid IN (
|
|
85
|
-
SELECT rowid
|
|
86
|
-
FROM finding_outcome_ledger
|
|
87
|
-
WHERE check_name = ?
|
|
88
|
-
ORDER BY last_seen DESC, first_seen DESC, finding_id DESC
|
|
89
|
-
LIMIT -1 OFFSET ?
|
|
90
|
-
)`)}}catch(n){b("disabled (open failed)",n)}return T.set(e,t),t}function f(e,t,n){b(`disabled (${t})`,n),T.set(e,null)}function Qe(e){if(!e)return null;try{He(re(e),{recursive:!0});let t=new ie(e);return t.pragma("journal_mode = WAL"),t.pragma("busy_timeout = 250"),t.pragma("synchronous = NORMAL"),t.exec(`
|
|
91
|
-
CREATE TABLE IF NOT EXISTS file_evidence (
|
|
92
|
-
kind TEXT NOT NULL,
|
|
93
|
-
relative_path TEXT NOT NULL,
|
|
94
|
-
content_hash TEXT NOT NULL,
|
|
95
|
-
version TEXT NOT NULL,
|
|
96
|
-
payload TEXT NOT NULL,
|
|
97
|
-
last_accessed_at INTEGER NOT NULL,
|
|
98
|
-
PRIMARY KEY (kind, relative_path, content_hash, version)
|
|
99
|
-
);
|
|
100
|
-
`),{evidence:t,readFileEvidence:t.prepare("SELECT payload FROM file_evidence WHERE kind = ? AND relative_path = ? AND content_hash = ? AND version = ?"),writeFileEvidence:t.prepare(`INSERT INTO file_evidence (kind, relative_path, content_hash, version, payload, last_accessed_at)
|
|
101
|
-
VALUES (?, ?, ?, ?, ?, ?)
|
|
102
|
-
ON CONFLICT(kind, relative_path, content_hash, version)
|
|
103
|
-
DO UPDATE SET payload = excluded.payload, last_accessed_at = excluded.last_accessed_at`)}}catch(t){return b("shared cache disabled (open failed)",t),null}}function I(e,t,n){b(`shared cache disabled (${t})`,n);try{e.shared?.evidence.close()}catch{}e.shared=null}function se(e,t,n,i){let r=g(e);if(!r)return null;try{let a=r.readFileEvidence.get(t,n,i,p)??r.readLegacyFileEvidence.get(t,n,i);if(a?.payload!==void 0)return a.payload;if(!k.has(t)||!r.shared)return null;try{return r.shared.readFileEvidence.get(t,n,i,p)?.payload??null}catch(o){return I(r,"file_evidence read",o),null}}catch(a){return f(e,"file_evidence read",a),null}}function ce(e,t,n,i,r){let a=g(e);if(a)try{if(a.writeFileEvidence.run(t,n,i,p,r),k.has(t)&&a.shared)try{a.shared.writeFileEvidence.run(t,n,i,p,r,Date.now())}catch(o){I(a,"file_evidence write",o)}}catch(o){f(e,"file_evidence write",o)}}function de(e,t){if(t.length===0)return;let n=g(e);if(n)try{n.evidence.transaction(()=>{for(let r of t)n.writeFileEvidence.run(r.kind,r.relativePath,r.contentHash,p,r.payload)})();let i=t.filter(r=>k.has(r.kind));if(i.length>0&&n.shared)try{n.shared.evidence.transaction(()=>{for(let r of i)n.shared.writeFileEvidence.run(r.kind,r.relativePath,r.contentHash,p,r.payload,Date.now())})()}catch(r){I(n,"file_evidence batch write",r)}}catch(i){f(e,"file_evidence batch write",i)}}function le(e,t,n,i){let r=g(e);if(!r)return null;try{return(r.readProjectEvidence.get(t,n,i,p)??r.readLegacyProjectEvidence.get(t,n,i))?.payload??null}catch(a){return f(e,"project_evidence read",a),null}}function pe(e,t,n,i,r){let a=g(e);if(a)try{a.writeProjectEvidence.run(t,n,i,p,r)}catch(o){f(e,"project_evidence write",o)}}function an(e,t,n,i){let r=g(e);if(!r)return new Map;try{let a=r.readCalleesForFile.all(t,n,i,p),o=r.readLegacyCalleesForFile.all(t,n,i);return ue([...o,...a])}catch(a){return f(e,"semantic_callees bulk read",a),new Map}}function on(e,t,n){let i=g(e);if(!i)return new Map;try{let r=i.readReferencesForFile.all(t,n,p),a=i.readLegacyReferencesForFile.all(t,n);return ue([...a,...r])}catch(r){return f(e,"semantic_references bulk read",r),new Map}}function ue(e){let t=new Map;for(let n of e)t.set(n.symbol,n.payload);return t}function sn(e,t){if(t.length===0)return;let n=g(e);if(n)try{n.evidence.transaction(()=>{let i=new Set;for(let r of t){let a=`${r.relativePath}\0${r.contentHash}`;i.has(a)||(i.add(a),n.dropStaleCallees.run(r.relativePath,r.contentHash)),n.writeCallees.run(r.relativePath,r.symbol,r.contentHash,r.depsDigest,p,r.payload)}})()}catch(i){f(e,"semantic_callees write",i)}}function cn(e,t){if(t.length===0)return;let n=g(e);if(n)try{n.evidence.transaction(()=>{let i=new Set;for(let r of t){let a=`${r.relativePath}\0${r.projectFingerprint}`;i.has(a)||(i.add(a),n.dropStaleReferences.run(r.relativePath,r.projectFingerprint)),n.writeReferences.run(r.relativePath,r.symbol,r.projectFingerprint,p,r.payload)}})()}catch(i){f(e,"semantic_references write",i)}}function dn(e){let t=g(e);if(!t)return[];try{return qe(t)}catch(n){return f(e,"finding_outcome_ledger read",n),[]}}function qe(e){return e.readFindingOutcomeLedger.all().map(n=>({check:n.check_name,findingId:n.finding_id,firstSeen:n.first_seen,lastSeen:n.last_seen,timesShown:n.times_shown,outcome:n.outcome}))}function pn(e){return typeof e=="object"&&e!==null}function un(e){return Array.isArray(e)&&e.every(t=>typeof t=="string")?e:null}import{appendFileSync as Ze,mkdirSync as et}from"fs";import{createHash as tt,randomUUID as nt}from"crypto";import{dirname as rt}from"path";import{performance as S}from"perf_hooks";var he="SCIP_QUERY_PROFILE",ye="SCIP_QUERY_PROFILE_OUT",Ee="SCIP_QUERY_PROFILE_COMMAND",ve="SCIP_QUERY_PROFILE_CACHE_STATE",A="SCIP_QUERY_PROFILE_RUN_ID",M="SCIP_QUERY_PROFILE_WORKLOAD_IDENTITY",V="SCIP_QUERY_PROFILE_WORKLOAD_IDENTITY_KIND",Se=[he,ye,Ee,ve,A,M,V],En=new Set(Se),ge=new Set,fe=new Map,me=!1;function h(){let e=process.env[he];return e==="1"||e==="true"}function it(){return process.env[ye]}function be(){return process.env[Ee]}function at(){return process.env[ve]}function _e(){let e=process.env[A];if(e)return e;if(!h())return;let t=nt();return process.env[A]=t,t}function Pe(){return process.env[M]}function ot(e){let t=Pe();if(t)return t;if(!h())return;let n=_e();if(!n)return;let i=e.projectFingerprint?"published-project":"run-only",r=_(["profile-workload-v1",e.toolVersion,e.command,e.projectFingerprint??n]);return process.env[M]=r,process.env[V]=i,r}function _(e){return tt("sha256").update(JSON.stringify(e)).digest("hex").slice(0,24)}function vn(){return Object.fromEntries(Se.flatMap(e=>{let t=process.env[e];return t===void 0?[]:[[e,t]]}))}function U(e,t,n){if(!h())return t();let i=S.now();try{let r=t();return F({type:"span",name:e,durationMs:Math.round(S.now()-i),ok:!0,...C(n)??{}}),r}catch(r){throw F({type:"span",name:e,durationMs:Math.round(S.now()-i),ok:!1,error:r instanceof Error?r.message:String(r),...C(n)??{}}),r}}async function Sn(e,t,n){if(!h())return t();let i=S.now();try{let r=await t();return F({type:"span",name:e,durationMs:Math.round(S.now()-i),ok:!0,...C(n)??{}}),r}catch(r){throw F({type:"span",name:e,durationMs:Math.round(S.now()-i),ok:!1,error:r instanceof Error?r.message:String(r),...C(n)??{}}),r}}function F(e,t=it()){let n=st(e),i={timestamp:new Date().toISOString(),pid:process.pid,runId:_e(),command:be(),cacheState:at(),...n,...e},r=`${JSON.stringify(i)}
|
|
104
|
-
`;if(t)try{let a=rt(t);ge.has(a)||(et(a,{recursive:!0}),ge.add(a)),Ze(t,r);return}catch(a){me||(me=!0,process.stderr.write(`[profile] failed to write ${t}: ${a instanceof Error?a.message:String(a)}
|
|
105
|
-
`));return}h()&&process.stderr.write(r)}function st(e){let t=Pe()??ot({command:be()??"unknown",toolVersion:"unknown",projectFingerprint:null});if(!t)return{};let n=process.env[V],i=typeof e.name=="string"?e.name:void 0;if(!i)return{workloadIdentity:t,workloadIdentityKind:n};let r=i.split(/[.:]/,1)[0]??i,a=`${t}\0${i}`,o=fe.get(a);return o||(o=_(["profile-subsystem-v1",t,i]),fe.set(a,o)),{workloadIdentity:t,workloadIdentityKind:n,subsystem:r,subsystemWorkIdentity:o}}function C(e){return typeof e=="function"?e():e}var ct=[l("source-facts",{dependsOn:["content-hash","tool-version"],keyParts:["kind","relativePath","contentHash","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/source/source-facts.ts"}),l("file-definitions",{dependsOn:["content-hash","project-fingerprint","indexed-language-set","tool-version"],keyParts:["kind","relativePath","contentHash","projectFingerprint","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/symbols/definition-catalog.ts"}),l("definition-exclusions",{dependsOn:["content-hash","tool-version"],keyParts:["kind","relativePath","contentHash","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/analysis/framework-patterns.ts"}),l("doc-path-tokens",{dependsOn:["content-hash","tool-version"],keyParts:["kind","relativePath","contentHash","payloadVersion"],stalenessTest:"tests/storage/evidence-products.test.ts",owner:"tests/storage/evidence-cache.test.ts"}),l("doc-path-evidence",{dependsOn:["content-hash","git-history","git-head","tool-version"],keyParts:["kind","relativePath","contentHash","trackedFiles","historyWindow","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/queries/cleanup/doc-drift.ts"}),l("source-imports",{dependsOn:["content-hash","import-resolution-fingerprint","config","tool-version"],keyParts:["kind","relativePath","contentHash","importResolutionFingerprint","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/language-parsers/index.ts"}),l("source-reexports",{dependsOn:["content-hash","import-resolution-fingerprint","config","tool-version"],keyParts:["kind","relativePath","contentHash","importResolutionFingerprint","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/language-parsers/index.ts"}),l("source-fingerprints",{dependsOn:["content-hash","project-fingerprint","indexed-language-set","tool-version"],keyParts:["kind","relativePath","contentHash","projectFingerprint","payloadVersion"],stalenessTest:"tests/symbols/definition-catalog.test.ts",owner:"src/queries/cleanup/similar.ts"}),l("consumer-file-usage",{dependsOn:["content-hash","project-fingerprint","indexed-language-set","tool-version"],keyParts:["kind","relativePath","contentHash","projectFingerprint","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/queries/internal/consumer-evidence.ts"}),l("react-component-behavior-profiles",{dependsOn:["content-hash","tool-version"],keyParts:["kind","relativePath","contentHash","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/source/react-profile.ts"}),l("git-file-adds",{dependsOn:["git-head","git-history","tool-version"],keyParts:["kind","cacheKey","head","historyWindow","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/analysis/git-history.ts"}),l("typescript-reference-fragments",{dependsOn:["content-hash","transitive-deps-digest","config","tool-version"],keyParts:["kind","relativePath","semanticIdentity","payloadVersion"],stalenessTest:"tests/semantic/typescript/typescript-reference-fragments.test.ts",owner:"src/semantic/typescript/reference-fragment-shadow.ts"}),l("typescript-import-usage",{dependsOn:["content-hash","transitive-deps-digest","config","tool-version"],keyParts:["kind","relativePath","semanticIdentity","payloadVersion"],stalenessTest:"tests/semantic/typescript/typescript-semantic-provider.test.ts",owner:"src/semantic/shared-primitives.ts"}),l("typescript-signatures",{dependsOn:["content-hash","transitive-deps-digest","config","tool-version"],keyParts:["kind","relativePath","semanticIdentity","payloadVersion"],stalenessTest:"tests/semantic/typescript/typescript-semantic-provider.test.ts",owner:"src/semantic/shared-primitives.ts"}),O("file-dependency-graph",{dependsOn:["project-fingerprint","indexed-language-set","import-resolution-fingerprint","tool-version"],keyParts:["kind","scope","projectFingerprint","payloadVersion"],stalenessTest:"tests/symbols/file-dep-graph.test.ts",owner:"src/symbols/graph/file-dep-graph.ts"}),O("semantic-import-usage",{dependsOn:["project-fingerprint","indexed-language-set","import-resolution-fingerprint","tool-version"],keyParts:["kind","relativePath","projectFingerprint","language","semanticEngine","payloadVersion"],stalenessTest:"tests/semantic/rust/rust-semantic-cache-gate.test.ts",owner:"src/semantic/shared-primitives.ts"}),O("semantic-signatures",{dependsOn:["project-fingerprint","indexed-language-set","tool-version"],keyParts:["kind","relativePath","symbol","projectFingerprint","language","semanticEngine","payloadVersion"],stalenessTest:"tests/semantic/rust/rust-semantic-cache-gate.test.ts",owner:"src/semantic/shared-primitives.ts"}),O("health-semantic-prewarm",{dependsOn:["project-fingerprint","indexed-language-set","tool-version"],keyParts:["kind","scope","cliVersion","projectFingerprint","payloadVersion"],stalenessTest:"tests/runtime/cli-support.test.ts",owner:"src/runtime/cli-support.ts"})];function Fn(e){let t=new Map;return{kind:e.kind,read(n,i,r){let a=!1,o=0,s;if(h()){let c=oe(n);if(c){let d=`${c}\0${i}\0${r}`;s=t.get(d),s||(s=_(["evidence-product-file-read-v1",e.kind,c,i,r]),t.set(d,s))}}return U("evidence-product.file.read",()=>{let c=se(n,e.kind,i,r);if(c===null)return null;o=c.length;try{let d=e.deserialize(c);return a=d!==null,d}catch{return null}},()=>({...s?{workIdentity:s,workOutcome:"computed"}:{},scope:"file",kind:e.kind,available:!0,hit:a,payloadBytes:o}))},write(n,i,r,a){ce(n,e.kind,i,r,e.serialize(a))},writeBatch(n,i){de(n,i.map(r=>({kind:e.kind,relativePath:r.relativePath,contentHash:r.contentHash,payload:e.serialize(r.value)})))}}}function Cn(e){let t=new Map;return{kind:e.kind,read(n,i,r){let a=!1,o=0,s;if(h()){let c=`${r}\0${i}`;s=t.get(c),s||(s=_(["evidence-product-project-read-v1",e.kind,r,i]),t.set(c,s))}return U("evidence-product.project.read",()=>{let c=le(n,e.kind,i,r);if(c===null)return null;o=c.length;try{let d=e.deserialize(c);return a=d!==null,d}catch{return null}},()=>({...s?{workIdentity:s,workOutcome:"computed"}:{},scope:"project",kind:e.kind,available:!0,hit:a,payloadBytes:o}))},write(n,i,r,a){pe(n,e.kind,i,r,e.serialize(a))}}}function On(e){let t=ct.find(n=>n.kind===e);if(!t)throw new Error(`missing evidence product manifest entry for ${e}`);return t.invalidation}function l(e,t){return{scope:"file",kind:e,invalidation:{scope:"file",...t}}}function O(e,t){return{scope:"project",kind:e,invalidation:{scope:"project",...t}}}import{execFileSync as dt}from"child_process";import{createHash as Re}from"crypto";import{closeSync as lt,fstatSync as Te,lstatSync as Fe,openSync as pt,readdirSync as ut,readFileSync as gt,readlinkSync as ft,realpathSync as w}from"fs";import{isAbsolute as mt,join as Ce,relative as ht,resolve as yt,sep as Et}from"path";var K=64*1024*1024,j=class extends Error{constructor(n,i,r,a){super(`${n} ${JSON.stringify(i)} is ${r} bytes; the safety limit is ${a} bytes`);this.inputKind=n;this.inputPath=i;this.observedBytes=r;this.limitBytes=a;this.name="InputTooLargeError"}inputKind;inputPath;observedBytes;limitBytes;code="SCIP_QUERY_INPUT_TOO_LARGE"};function vt(e){return[...new Set((e??[]).map(t=>t.trim()).filter(Boolean))].sort((t,n)=>t.localeCompare(n))}function Oe(e,t,n={}){let i=$(t),r=w(e),a=yt(r,...i.split("/"));if(!D(r,a)||a===r)throw new y(t,"outside-project");let o=w(a);if(!D(r,o)||o===r)throw new y(t,"outside-project");let s=Fe(o);if(!s.isFile())throw new y(t,"not-a-file");let c={projectRoot:r,relativePath:i,absolutePath:o,size:s.size,mtimeMs:s.mtimeMs,device:s.dev,inode:s.ino},d=n.maxBytes??K;if(bt(d),c.size>d)throw new j(n.inputKind??"project file",c.relativePath,c.size,d);return c}function St(e,t,n={}){let i=Oe(e,t,n),r=n.maxBytes??K,a=pt(i.absolutePath,"r");try{let o=Te(a);if(!o.isFile()||o.dev!==i.device||o.ino!==i.inode||o.size!==i.size)throw new y(t,"changed-during-read");if(o.size>r)throw new j(n.inputKind??"project file",i.relativePath,o.size,r);let s=gt(a),c=Te(a);if(c.dev!==o.dev||c.ino!==o.ino||c.size!==o.size||s.byteLength!==o.size)throw new y(t,"changed-during-read");return s}finally{lt(a)}}function we(e,t,n={}){return St(e,t,n).toString("utf8")}function W(e){return typeof e=="object"&&e!==null&&"code"in e&&(e.code==="ENOENT"||e.code==="ENOTDIR")}function An(e,t){try{return Oe(e,t),!0}catch(n){if(W(n))return!1;throw n}}function bt(e){if(!Number.isSafeInteger(e)||e<0)throw new RangeError(`maxBytes must be a non-negative safe integer; received ${e}`)}function _t(e){return(Tt(e)??Ft(e)).filter(t=>t&&!je(t)).sort()}function Pt(e,t={}){let n=_t(e).filter(r=>!t.language||Q(r,t.language,t.markerFiles)).filter(r=>!t.includePath||t.includePath(r)),i=w(e);return n.map(r=>{let a=Ce(e,r);try{if(Fe(a).isSymbolicLink()){let c=w(a),d=ht(i,c);if(d===".."||d.startsWith(`..${Et}`)||mt(d))throw new Error("external symlink");let u=ft(a);return{path:r,size:Buffer.byteLength(u),hash:Re("sha256").update("symlink\0").update(u).digest("hex")}}let o=Re("sha256"),s=G(a,{inputKind:"project fingerprint input",maxBytes:K},c=>o.update(c));return{path:r,size:s,hash:o.digest("hex")}}catch{return{path:r,size:-1,hash:"unreadable"}}})}function Mn(e,t,n){return{version:2,languages:[...t].sort(),pnpmWorkspaces:n.typescriptProjectMode!=="workspace"&&n.pnpmWorkspaces===!0,typescriptProjectMode:n.typescriptProjectMode??"single",typescriptProjects:vt(n.typescriptProjects),clojureConfigPath:Rt(n.clojureConfigPath),files:Pt(e)}}function Rt(e){return e?.trim()||void 0}function Tt(e){try{return dt("git",["-C",e,"ls-files","-co","--exclude-standard","--","."],{encoding:"utf-8",maxBuffer:50*1024*1024,stdio:["ignore","pipe","ignore"],timeout:3e4,killSignal:"SIGKILL"}).split(`
|
|
106
|
-
`).filter(Boolean)}catch{return null}}function Ft(e){let t=[],n=[""];for(;n.length>0;){let i=n.pop(),r=i?Ce(e,i):e,a;try{a=ut(r,{withFileTypes:!0})}catch{continue}for(let o of a){let s=i?`${i}/${o.name}`:o.name;if(o.isDirectory()){je(s)||n.push(s);continue}t.push(s)}}return t}function je(e){let t=e.split("/");return e==="meta.json"||t.some(n=>Ct.has(n))||e.endsWith(".db")||e.endsWith(".db-wal")||e.endsWith(".db-shm")||e.endsWith(".scip")}var Ct=new Set([".git","node_modules",".scipquery-cache",".scipquery-generations",".stryker-tmp","dist","build","coverage",".next",".nuxt","target"]);var Ot=E("source-text",{clearGroups:["whole-project","source-file"]}),wt=E("source-lines",{clearGroups:["whole-project","source-file"]});function jt(e,t){let n=t.replace(/\\/g,"/");return Ot.get(e,n,()=>{try{return we(e.config.projectRoot,n,{inputKind:"indexed source file"})}catch(i){if(W(i))return"";throw i}})}function Dt(e,t){let n=t.replace(/\\/g,"/");return wt.get(e,n,()=>{let i=jt(e,n);return i?i.split(`
|
|
107
|
-
`):[]})}var Nt=/^\s*(?:\/\/|#|\/\*+|\*)\s*scip-query[\s:-]*ignore(?:[\s:-]+(dead(?:-code)?|stale|wrapper|passthrough|drift|extract|similar|twin))?\b/i;function xt(e){let t=Nt.exec(e);return t?t[1]??"":null}function Wn(e,t,n){return De(e,t,n).length>0}function Bn(e,t,n,i){let r=i.toLowerCase();return De(e,t,n).some(a=>a.toLowerCase()===r)}function De(e,t,n){if(n<=0)return[];let i=Dt(e,t);if(i.length===0)return[];let r=[];for(let a=n-1;a>=0&&a>=n-5;a-=1){let o=(i[a]??"").trim();if(o==="")continue;let s=xt(o);if(s!==null){r.push(s);continue}if(!o.startsWith("//")&&!o.startsWith("*")&&!o.startsWith("/*")&&!o.startsWith("@")&&!o.startsWith("#"))return r}return r}export{Ne as a,Lt as b,kt as c,P as d,ee as e,Ut as f,Kt as g,ke as h,R as i,Bt as j,E as k,Xt as l,Gt as m,Be as n,ae as o,rn as p,oe as q,an as r,on as s,sn as t,cn as u,dn as v,pn as w,un as x,h as y,vn as z,U as A,Sn as B,F as C,Fn as D,Cn as E,On as F,vt as G,Oe as H,St as I,we as J,W as K,An as L,Pt as M,Mn as N,jt as O,Dt as P,xt as Q,Wn as R,Bn as S};
|
|
108
|
-
//# sourceMappingURL=chunk-JORHF5AL.js.map
|
package/dist/chunk-KSGTULOS.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{a as F,c as le,d as ue,e as fe,f as v,g as P,h as me,i as pe,j as U}from"./chunk-LSOR3LQG.js";import{a as ce,e as D,f as ae,n as j,o as q,p as de,r as A}from"./chunk-VVY2G5ET.js";import{createHash as xe}from"crypto";import{chmodSync as we,closeSync as Ge,existsSync as R,fsyncSync as He,lstatSync as B,mkdirSync as Ve,openSync as Ke,readdirSync as H,realpathSync as y,unlinkSync as We,writeSync as Xe}from"fs";import{homedir as Ye}from"os";import{basename as Qe,dirname as Re,isAbsolute as ye,join as m,resolve as _}from"path";import{createRequire as qe}from"module";var Ue=qe(import.meta.url),ge=ze().version;function ze(){for(let e of["../package.json","../../package.json"])try{return Ue(e)}catch{}return{version:"0.0.0"}}var Se=1,C=".scip-query-cache-owner.json",Ze=16*1024;function T(e,t){return Object.assign(new Error(`refusing unsafe project dbPath ${JSON.stringify(e)} (${t}); use a repository-relative directory that remains inside the checkout`),{name:"UnsafeCachePathError",code:"SCIP_QUERY_UNSAFE_CACHE_PATH",configuredPath:e,reason:t})}function g(e,t){return Object.assign(new Error(`refusing unowned cache directory ${JSON.stringify(e)} (${t}); move unrelated data elsewhere or choose a new empty dbPath`),{name:"CacheOwnershipError",code:"SCIP_QUERY_CACHE_OWNERSHIP",cacheDir:e,reason:t})}function et(e,t){let r=y(e),n=process.env.SCIP_QUERY_CACHE_DIR;return n?z(r,_(n)):t?.dbPath?z(r,rt(r,t.dbPath)):z(r,tt(r))}function be(){let e=process.env.XDG_CACHE_HOME;return m(e||m(Ye(),".cache"),"scip-query")}function tt(e){let t=_(e);try{t=y(t)}catch{}let r=xe("sha256").update(t).digest("hex").slice(0,12);return m(be(),"projects",r)}function ur(e){if(!/^[a-f0-9]{24}$/.test(e))throw new Error(`invalid repository cache identity: ${e}`);let t=m(be(),"repositories",e);return Pe(t),y(t)}function fr(e){return process.env.SCIP_QUERY_SHARED_CACHE!=="0"&&!process.env.SCIP_QUERY_CACHE_DIR&&!process.env.SCIP_QUERY_INDEX_DB&&!e?.dbPath}function mr(e,t){let r=et(e,t);return{cacheDir:r,dbPath:m(r,"index.db"),indexPath:m(r,"index.scip"),metaPath:m(r,"meta.json")}}function z(e,t){let r=y(e);R(t)||Pe(t);let n=y(t),o=m(n,C);if(R(o))return G(r,n),V(o),k(n),n;he(n);let s=`${JSON.stringify({schemaVersion:Se,canonicalProjectRoot:r,canonicalCacheDir:n,creatorVersion:ge},null,2)}
|
|
2
|
-
`;try{at(o,s)}catch(c){if(lt(c))return G(r,n),n;throw c}try{he(n),ct(n)}catch(c){throw We(o),c}return n}function G(e,t){let r=y(e),n=y(t);return it(n,r,n)}function pr(e,t){return R(m(t,C))?(G(e,t),ve(t),!0):!1}function rt(e,t){let r;try{r=ae(t)}catch(s){throw s instanceof ce?T(t,s.reason):s}let n=_(e,...r.split("/"));if(n===e||!D(e,n))throw T(t,"outside-project");let o=nt(n),i=y(o);if(!D(e,i)&&i!==e)throw T(t,"symlink-escape");return n}function nt(e){let t=e;for(;!R(t);){let r=Re(t);if(r===t)throw T(e,"no-existing-ancestor");t=r}return t}function it(e,t,r){let n=m(e,C);if(!R(n)||B(n).isSymbolicLink())throw g(e,"missing regular ownership record");let o=B(n);if(!o.isFile()||o.size>Ze)throw g(e,"invalid ownership record file");let i=A(n,"cache ownership record"),s=ot(i,e);if(s.canonicalProjectRoot!==t)throw g(e,"ownership record belongs to a different project");if(s.canonicalCacheDir!==r)throw g(e,"ownership record names a different cache directory");return{record:s,ownerSha256:xe("sha256").update(i).digest("hex"),physicalCacheDir:e}}function ot(e,t){try{let r=JSON.parse(e);if(r.schemaVersion!==Se||typeof r.canonicalProjectRoot!="string"||typeof r.canonicalCacheDir!="string"||typeof r.creatorVersion!="string"||!ye(r.canonicalProjectRoot)||!ye(r.canonicalCacheDir))throw new Error("invalid fields");return r}catch(r){throw g(t,`malformed ownership record: ${r instanceof Error?r.message:String(r)}`)}}function he(e){let t=H(e).filter(r=>r!==C&&!st(r));if(t.length>0)throw g(e,`unrecognized existing entries: ${t.slice(0,3).join(", ")}`)}function st(e){return[".scipquery-generations","affected-shadow-latest.json","affected-shadow.jsonl","agent-hooks","augment-vue-meta.json","cache-lifecycle.lock","evidence.db","evidence.db-shm","evidence.db-wal","health-report-cache.json","index.db","index.db-shm","index.db-wal","index.lock","index.scip","language-indexes","meta.json","reindex-activity.jsonl","shared-cache.json","typescript-index","typescript-scip-fragments","typescript-scip-overlays","typescript-semantic","watch-activity.json","watch-refresh-requests","watch-state.json","watch.lock"].includes(e)?!0:/^(?:reindex-|rust-|typescript-)/.test(e)}function ct(e){for(let t of H(e)){let r=m(e,t),n=B(r);if(n.isSymbolicLink())throw g(e,`legacy cache entry ${t} is a symlink`);if(n.isDirectory())k(r);else if(n.isFile())V(r);else throw g(e,`legacy cache entry ${t} is not a file or directory`)}k(e)}function ve(e){let t=B(e);if(t.isSymbolicLink())throw g(e,"managed cache tree contains a symlink");if(t.isFile()){V(e);return}if(!t.isDirectory())throw g(e,"managed cache tree contains a special file");k(e);for(let r of H(e))ve(m(e,r))}function Pe(e){Ve(e,{recursive:!0,mode:448}),k(e)}function at(e,t){let r=Ke(e,"wx",384);try{Xe(r,t),He(r)}finally{Ge(r)}}function k(e){process.platform!=="win32"&&we(e,448)}function V(e){process.platform!=="win32"&&we(e,384)}function dt(e){if(R(e))return y(e);let t=y(Re(e));return m(t,Qe(e))}function gr(e){return dt(_(e))}function lt(e){return typeof e=="object"&&e!==null&&"code"in e&&e.code==="EEXIST"}import{execFileSync as ke}from"child_process";import{createRequire as ut}from"module";import{existsSync as ft}from"fs";import{platform as L,arch as Le}from"os";var O="v0.8.1",K="https://github.com/sourcegraph/scip",N=`github.com/sourcegraph/scip/cmd/scip@${O}`,Oe=ut(import.meta.url),Ie="SCIP_QUERY_SCIP_BIN";function mt(e){if(e.isOnPath("scip"))return{source:"path",path:"scip"};let t=e.env[Ie];if(t&&e.fileExists(t))return{source:"env",path:t};if(e.platform==="win32"){let r=e.resolveSidecar(e.arch);if(r&&e.fileExists(r))return{source:"sidecar",path:r}}return null}function pt(e){for(let t of e==="arm64"?["arm64","x64"]:[e])try{return Oe.resolve(`scip-query-scip-windows/scip-win32-${t}.exe`)}catch{}return null}function W(e=process.env){let t=mt({platform:L(),arch:Le(),env:e,isOnPath:F,fileExists:ft,resolveSidecar:pt});return t?.source==="path"?le("scip")??t.path:t?.path??null}function br(){return W()!==null}function gt(){let e=W();if(!e)return null;try{return ke(e,["--version"],{stdio:"pipe",timeout:1e4,killSignal:"SIGKILL"}).toString().trim()}catch{return null}}function yt(){let e=L(),t=Le(),r,n,o;switch(e){case"darwin":r="darwin",o="tar.gz";break;case"linux":r="linux",o="tar.gz";break;default:return null}switch(t){case"arm64":n="arm64";break;case"x64":n="amd64";break;default:return null}let i=`scip-${r}-${n}.${o}`;return{url:`${K}/releases/download/${O}/${i}`,filename:i}}function vr(){let e=yt();if(console.log("\nThe `scip` CLI is required but not found on PATH.\n"),L()==="darwin"||L()==="linux")console.log("Install the reviewed version with Go:"),console.log(` go install ${N}
|
|
3
|
-
`),console.log("Or download that exact release manually:");else if(L()==="win32"){let t=ht();console.log("On Windows the scip binary ships via the npm sidecar package scip-query-scip-windows,"),console.log("installed automatically with scip-query. If it is missing:"),console.log(` npm install -g ${t}`),console.log(`Or set ${Ie} to a local scip.exe path.
|
|
4
|
-
`),console.log("Upstream release page:")}else console.log("Download from:");console.log(e?` ${e.url}
|
|
5
|
-
`:` ${K}/releases/tag/${O}
|
|
6
|
-
`),console.log("After installing, ensure `scip` is on your PATH and run `scip-query reindex`.")}function ht(){let t=Oe("../../package.json").optionalDependencies?.["scip-query-scip-windows"];if(!t||!/^\d+\.\d+\.\d+(?:[-+][0-9A-Za-z.-]+)?$/.test(t))throw new Error("scip-query package metadata does not declare an exact Windows sidecar version.");return`scip-query-scip-windows@${t}`}function Pr(e){if(F("go")){e(`Installing immutable ${N} via go install into the Go bin directory (GOBIN or GOPATH/bin); expected executable: scip.`);try{if(ke("go",["install",N],{stdio:"inherit",timeout:3e5,env:process.env}),F("scip")){let t=W(),r=gt();if(t&&r&&r.includes(O))return e(`Successfully installed ${N}; resolved executable: ${t}; reported version: ${r}.`),!0;e(`go install completed, but the resolved scip executable did not report ${O} (executable: ${t??"unresolved"}; version: ${r??"unavailable"}).`)}}catch(t){let r=t instanceof Error?t.message:String(t);e(`go install failed: ${r}`)}}return e("Could not auto-install scip CLI."),e(`Install manually from: ${K}/releases`),!1}import{randomUUID as xt}from"crypto";import{closeSync as wt,fsyncSync as Rt,linkSync as St,mkdirSync as bt,openSync as vt,statSync as Pt,unlinkSync as kt,writeSync as Lt}from"fs";import{dirname as ee}from"path";var Y="scip-query-process-lock",Q=1;var $=Object.freeze({wallNow:()=>Date.now(),isProcessAlive:ue,readProcessIdentity:P,randomToken:()=>xt(),makeDirectory:e=>bt(e,{recursive:!0}),openFile:(e,t,r)=>vt(e,t,r),writeFile:(e,t,r,n)=>Lt(e,t,r,n),syncFile:e=>Rt(e),closeFile:e=>wt(e),linkFile:(e,t)=>St(e,t),readFile:e=>A(e,"process lock record"),statFile:e=>{let t=Pt(e);return{dev:t.dev,ino:t.ino,size:t.size,mtimeMs:t.mtimeMs}},removeFile:e=>kt(e)});function Ae(e,t){let r=t.runtime??$;r.makeDirectory(ee(e));let n;for(let o=0;o<2;o+=1)try{return{kind:"acquired",lock:Fe(e,t,r),...n?{reclaimed:n}:{}}}catch(i){if(i.code!=="EEXIST")throw i;let s=S(e,{parseLegacy:t.parseLegacy,runtime:r});if(o===0&&It(e,s,{creationGraceMs:t.creationGraceMs,parseLegacy:t.parseLegacy,runtime:r})){n=s;continue}return{kind:"contended",observation:s}}return{kind:"contended",observation:S(e,{parseLegacy:t.parseLegacy,runtime:r})}}function S(e,t={}){let r=t.runtime??$,n,o;try{n=r.statFile(e),o=r.readFile(e)}catch(a){return a.code==="ENOENT"?{state:"missing"}:{state:"malformed"}}let i;try{i=JSON.parse(o)}catch{return{state:"malformed",raw:o,identity:n}}let s=Ot(i);if(s)return{state:"valid",raw:o,identity:n,record:s,owner:At(s),parsed:i};let c=t.parseLegacy?.(i)??null;return c?{state:"legacy",raw:o,identity:n,owner:c,parsed:i}:{state:"malformed",raw:o,identity:n,parsed:i}}function Ot(e){if(!e||typeof e!="object"||Array.isArray(e))return null;let t=e;if(t.protocol!==Y||t.version!==Q||typeof t.kind!="string"||t.kind.trim()===""||typeof t.pid!="number"||!Number.isSafeInteger(t.pid)||t.pid<=0||typeof t.token!="string"||t.token.trim()===""||typeof t.startedAt!="string"||!Number.isFinite(Date.parse(t.startedAt))||t.detail!==void 0&&(typeof t.detail!="object"||t.detail===null||Array.isArray(t.detail)))return null;let r=t.processIdentity===void 0?null:fe(t.processIdentity);return t.processIdentity!==void 0&&(!r||r.pid!==t.pid)?null:{protocol:Y,version:Q,kind:t.kind,pid:t.pid,token:t.token,...r?{processIdentity:r}:{},startedAt:t.startedAt,...t.detail?{detail:t.detail}:{}}}function It(e,t,r={}){let n=r.runtime??$;if(!Z(t,n))return!1;let o=Et(`${e}.reclaim`,n);if(!o)return!1;try{let i=S(e,{parseLegacy:r.parseLegacy,runtime:n});return!Te(t,i)||!Z(i,n)?!1:te(e,n)}finally{o.release()}}function Fe(e,t,r){let n=t.pid??process.pid,o=r.randomToken(),i=t.processIdentity===void 0?r.readProcessIdentity(n):t.processIdentity,s={protocol:Y,version:Q,kind:t.kind,pid:n,token:o,...i?{processIdentity:i}:{},startedAt:new Date(r.wallNow()).toISOString(),...t.detail?{detail:t.detail}:{}},c=`${e}.${o}.candidate`,a=r.openFile(c,"wx",384),l;try{pe(a,Buffer.from(`${JSON.stringify(s)}
|
|
7
|
-
`),r,"process lock"),r.syncFile(a)}catch(u){l=u}try{r.closeFile(a)}catch(u){l??=u}if(l!==void 0)throw X(c,r),l;try{r.linkFile(c,e)}catch(u){throw X(c,r),u}X(c,r);try{Be(ee(e),r)}catch(u){throw Ee(e,s,r),u}let p=!1;return{path:e,record:s,release:()=>p?!1:(p=!0,Ee(e,s,r))}}function Ee(e,t,r=$){let n=S(e,{runtime:r});return n.state!=="valid"||!n.record||n.record.pid!==t.pid||n.record.token!==t.token||t.processIdentity&&(!n.record.processIdentity||!v(t.processIdentity,n.record.processIdentity))?!1:te(e,r)}function Et(e,t){for(let r=0;r<2;r+=1)try{return Fe(e,{kind:"reclaim-guard",runtime:t},t)}catch(n){if(n.code!=="EEXIST")return null;let o=S(e,{runtime:t});if(r>0||!Z(o,t))return null;let i=S(e,{runtime:t});if(!Te(o,i)||!te(e,t))return null}return null}function Z(e,t){if(e.state==="missing")return!1;if(e.owner){if(!t.isProcessAlive(e.owner.pid))return!0;if(!e.owner.processIdentity)return!1;let r=t.readProcessIdentity(e.owner.pid);return r!==null&&!v(e.owner.processIdentity,r)}return!1}function Te(e,t){return e.state===t.state&&e.raw===t.raw&&e.identity!==void 0&&t.identity!==void 0&&e.identity.dev===t.identity.dev&&e.identity.ino===t.identity.ino&&e.identity.size===t.identity.size&&e.identity.mtimeMs===t.identity.mtimeMs}function At(e){return{pid:e.pid,...e.processIdentity?{processIdentity:e.processIdentity}:{}}}function Be(e,t){let r;try{r=t.openFile(e,"r")}catch(n){if(U(n,process.platform))return;throw n}try{t.syncFile(r)}catch(n){if(!U(n,process.platform))throw n}finally{t.closeFile(r)}}function te(e,t){try{return t.removeFile(e),Be(ee(e),t),!0}catch{return!1}}function X(e,t){try{t.removeFile(e)}catch{}}import{statSync as Ht}from"fs";import{dirname as Vt,join as Kt}from"path";import{appendFileSync as Ft,existsSync as Tt,mkdirSync as Bt,renameSync as _t,rmSync as Ct,statSync as Nt,truncateSync as $t}from"fs";import{basename as Jt,dirname as Mt}from"path";var ie=".previous",Dt=".rotation.lock",jt=2e3,re=class extends Error{constructor(r,n){super(`Timed out after ${n}ms waiting for rotating JSONL lock: ${r}`);this.lockPath=r;this.timeoutMs=n;this.name="RotatingJsonlLockTimeoutError"}lockPath;timeoutMs;code="ROTATING_JSONL_LOCK_TIMEOUT"},ne=class extends Error{constructor(r){super(`Rotating JSONL lock ownership changed before release: ${r}`);this.lockPath=r;this.name="RotatingJsonlLockReleaseError"}lockPath;code="ROTATING_JSONL_LOCK_RELEASE_FAILED"},qt=Object.freeze({monotonicNow:me,wait(e){Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,e)},tryAcquireLock(e,t){let r=Ae(e,{kind:"rotating-jsonl",detail:{target:Jt(t)}});return r.kind==="acquired"?{kind:"acquired",lock:r.lock}:{kind:"contended"}},makeDirectory(e){Bt(e,{recursive:!0})},exists:Tt,readBytes(e){return de(e,{maxBytes:j,inputKind:"rotating JSONL segment"})},size(e){return Nt(e).size},truncate:$t,remove(e){Ct(e,{force:!0})},rename:_t,append:Ft});function _e(e,t,r){let n=r.runtime??qt,o=JSON.stringify(t);if(o===void 0)throw new TypeError("Rotating JSONL records must be JSON-serializable values.");let i=Buffer.from(`${o}
|
|
8
|
-
`),s=Math.max(1,Math.floor(r.maxSegmentBytes),i.length);return Ut(e,r.lockTimeoutMs,n,()=>{n.makeDirectory(Mt(e));let c=zt(e,j,n);r.onPhase?.("tail-repaired");let a=`${e}${r.previousSuffix??ie}`,l=!1,p=!1;return n.exists(e)&&n.size(e)+i.length>s&&(n.exists(a)&&(n.remove(a),p=!0),r.onPhase?.("previous-pruned"),n.rename(e,a),l=!0,r.onPhase?.("current-rotated")),n.append(e,i),r.onPhase?.("record-appended"),{lineBytes:i.length,segmentLimitBytes:s,repairedTailBytes:c,rotated:l,prunedPrevious:p}})}function Ut(e,t,r,n){let o=`${e}${Dt}`,i=Math.max(0,t??jt),s=r.monotonicNow()+i,c;for(;;){let f=r.tryAcquireLock(o,e);if(f.kind==="acquired"){c=f.lock;break}let h=s-r.monotonicNow();if(h<=0)throw new re(o,i);r.wait(Math.min(5,h))}let a=!1,l,p;try{p=n()}catch(f){a=!0,l=f}let u=!1;try{u=c.release()}catch(f){if(!a)throw f}if(a)throw l;if(!u)throw new ne(o);return p}function zt(e,t,r){if(!r.exists(e))return 0;let n=Gt(e,t,r);if(n.length===0||n[n.length-1]===10)return 0;let o=n.lastIndexOf(10),i=o<0?0:o+1;return r.truncate(e,i),n.length-i}function Gt(e,t,r){let n=r.size(e);if(n>t)throw new q("rotating JSONL segment",e,"too-large",n,t);let o=r.readBytes(e),i=r.size(e);if(i!==n||o.byteLength!==n)throw new q("rotating JSONL segment",e,"changed-during-read",i,t);return o}var Wt="reindex-activity.jsonl",Xt=ie,Yt=1024*1024,zr=1440*60*1e3;function Ne(e){return Kt(Vt(e),Wt)}function Qt(e){if(e.reused)return 0;let t=Ce(e.indexPath)+Ce(e.dbPath);for(let r of e.shards??[])!r.reused&&r.outputBytes!==null&&(t+=r.outputBytes);return t}function Gr(e,t){let r=t.lastRefresh;r&&$e(Ne(e),{version:1,event:"run",recordedAt:r.completedAt,trigger:r.trigger,result:r.result,durationMs:r.durationMs,estimatedLogicalOutputBytes:Qt(t)})}function Hr(e,t){$e(Ne(e),{version:1,event:"run",recordedAt:t.completedAt,trigger:t.trigger,result:"failed",durationMs:t.durationMs,estimatedLogicalOutputBytes:0})}function Zt(e,t,r=Yt,n){_e(e,t,{maxSegmentBytes:r,previousSuffix:Xt,...n?{runtime:n}:{}})}function $e(e,t){try{Zt(e,t)}catch{}}function Ce(e){try{return Ht(e).size}catch{return 0}}import{spawn as er}from"child_process";import{performance as Je}from"perf_hooks";var Yr={probe:1e4,git:3e4,analysis:18e4,install:3e5,indexer:6e5},I=class extends Error{constructor(r,n,o,i={}){super(o,i.cause===void 0?void 0:{cause:i.cause});this.kind=r;this.label=n;this.name="BoundedProcessError",this.timedOut=i.timedOut??!1,this.reaped=i.reaped??!1,this.stdout=i.stdout??"",this.stderr=i.stderr??"",this.stdoutTruncated=i.stdoutTruncated??!1,this.stderrTruncated=i.stderrTruncated??!1}kind;label;timedOut;reaped;stdout;stderr;stdoutTruncated;stderrTruncated};function J(e,t){if(!Number.isFinite(e)||e<=0)throw new TypeError(`${t} must be a positive finite number.`)}function Me(e,t,r,n){let o=Math.max(0,n-r);o>0&&e.push(t.subarray(0,o))}function De(e,t,r){let n=Buffer.concat([...e,t]);e.length=0,e.push(n.subarray(Math.max(0,n.length-r)))}function tr(e,t){if(e.exitCode!==null||e.signalCode!==null||e.pid===void 0)return!1;if(!t)return!0;let r=P(e.pid);return r!==null&&v(t,r)}function Qr(e){J(e.timeoutMs,"timeoutMs"),J(e.maxStdoutBytes,"maxStdoutBytes"),J(e.maxStderrBytes,"maxStderrBytes");let t=e.terminationGraceMs??1e3;return J(t,"terminationGraceMs"),new Promise((r,n)=>{let o=Je.now(),i;try{i=er(e.command,[...e.args??[]],{cwd:e.cwd,env:e.env,detached:e.detached,stdio:["pipe","pipe","pipe"]})}catch(d){n(new I("spawn",e.label,`${e.label} could not start.`,{cause:d,reaped:!0}));return}let s=[],c=[],a=0,l=0,p=!1,u=!1,f=null,h=!1,w=null,je=i.pid===void 0?null:P(i.pid),b=d=>{f||h||(f=d,i.kill("SIGTERM"),w=setTimeout(()=>{!h&&tr(i,je)&&i.kill("SIGKILL")},t),w.unref())},M=setTimeout(()=>{b({kind:"timeout",timedOut:!0,message:`${e.label} timed out after ${e.timeoutMs}ms.`})},e.timeoutMs);M.unref();let E=()=>{b({kind:"aborted",timedOut:!1,message:`${e.label} was cancelled.`})};e.signal?.addEventListener("abort",E,{once:!0}),e.signal?.aborted&&E(),i.stdout.on("data",d=>{let x=Buffer.isBuffer(d)?d:Buffer.from(d);e.outputLimitBehavior==="truncate-tail"?De(s,x,e.maxStdoutBytes):Me(s,x,a,e.maxStdoutBytes),a+=x.length,a>e.maxStdoutBytes&&(p=!0,e.outputLimitBehavior!=="truncate-tail"&&b({kind:"stdout-limit",timedOut:!1,message:`${e.label} exceeded stdout limit (${e.maxStdoutBytes} bytes).`}))}),i.stderr.on("data",d=>{let x=Buffer.isBuffer(d)?d:Buffer.from(d);e.outputLimitBehavior==="truncate-tail"?De(c,x,e.maxStderrBytes):Me(c,x,l,e.maxStderrBytes),l+=x.length,l>e.maxStderrBytes&&(u=!0,e.outputLimitBehavior!=="truncate-tail"&&b({kind:"stderr-limit",timedOut:!1,message:`${e.label} exceeded stderr limit (${e.maxStderrBytes} bytes).`}))}),i.on("error",d=>{if(!h&&!f){if(i.pid===void 0){clearTimeout(M),w&&clearTimeout(w),e.signal?.removeEventListener("abort",E),h=!0,n(new I("spawn",e.label,`${e.label} could not start: ${d.message}`,{cause:d,reaped:!0}));return}b({kind:"spawn",timedOut:!1,message:`${e.label} failed after start: ${d.message}`})}}),i.on("close",(d,x)=>{if(h)return;h=!0,clearTimeout(M),w&&clearTimeout(w),e.signal?.removeEventListener("abort",E);let oe=Buffer.concat(s).toString("utf8"),se=Buffer.concat(c).toString("utf8");if(f){n(new I(f.kind,e.label,f.message,{timedOut:f.timedOut,reaped:!0,stdout:oe,stderr:se,stdoutTruncated:p,stderrTruncated:u}));return}r({status:d,signal:x,stdout:oe,stderr:se,timedOut:!1,durationMs:Je.now()-o,stdoutTruncated:p,stderrTruncated:u})}),e.input===void 0?i.stdin.end():i.stdin.end(e.input)})}export{ge as a,tt as b,ur as c,fr as d,mr as e,pr as f,gr as g,W as h,br as i,gt as j,vr as k,Pr as l,Ae as m,S as n,It as o,ie as p,_e as q,Wt as r,Gr as s,Hr as t,Yr as u,I as v,Qr as w};
|
|
9
|
-
//# sourceMappingURL=chunk-KSGTULOS.js.map
|
package/dist/chunk-KXDJAG4N.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import{b as B,c as W,d as G,e as J,l as K}from"./chunk-GLZTVKAB.js";import{d as Q,e as U}from"./chunk-MTDBHTSF.js";import{e as T,g as x,s as F,t as j,y as $,z as H}from"./chunk-RA3AYNWP.js";import{k as v,p as P}from"./chunk-MZZBAITE.js";import{x as L}from"./chunk-WUW7YUAH.js";import{l as O}from"./chunk-JORHF5AL.js";import{d as N}from"./chunk-VVY2G5ET.js";function Me(t,n,e={}){let o=Y(t,[n],{additive:e.additive,semantic:e.semantic,semanticEvidence:e.semanticEvidence}),l=e.callableOnly?(o.get(n.symbolId)??[]).filter(a=>x(a.symbol)||a.source==="ast-callsite"):o.get(n.symbolId)??[];return typeof e.limit=="number"?l.slice(0,e.limit):l}function Ie(t,n,e){return X(t,[n],e).get(n.symbolId)??[]}function X(t,n,e){let o=te(t)?ie(t,n,{semantic:e.semantic!==!1,semanticEvidence:e.semanticEvidence}):oe(t,e.semanticEvidence);return typeof e.limit!="number"?new Map(n.map(l=>[l.symbolId,o.get(l.symbolId)??[]])):new Map(n.map(l=>[l.symbolId,(o.get(l.symbolId)??[]).slice(0,e.limit)]))}var ee=O("caller-rows",{clearGroups:["whole-project"]}),ne=2e4;function te(t){return(t.get("SELECT COUNT(*) AS count FROM global_symbols")?.count??0)>ne}function oe(t,n){return ee.get(t,()=>{let e=j(t),o=Y(t,e,{semanticEvidence:n}),l=new Map;for(let s of e)l.set(s.symbol,s.symbolId);let a=new Map,c=new Map;for(let s of e){let d=o.get(s.symbolId);if(!(!d||d.length===0))for(let b of d){let r=l.get(b.symbol);if(r===void 0||r===s.symbolId)continue;let u=a.get(r);u||(u=[],a.set(r,u),c.set(r,new Set));let m=`${s.symbol}|${s.relativePath}`;c.get(r).has(m)||(c.get(r).add(m),u.push({symbol:s.symbol,file:s.relativePath,source:"caller-map-inversion"}))}}return a})}function ie(t,n,e){let o=e.semantic&&e.semanticEvidence?n.flatMap(s=>{let d=le(t,s);return d?[d]:[]}):[],l=new Map(o.map(s=>[s.symbolId,s])),a=e.semanticEvidence?.referenceMap(t,o)??new Map,c=new Map;for(let s of n){let d=[],b=new Set,r=m=>{if(m.symbol===s.symbol)return;let i=`${m.symbol}|${m.file}`;b.has(i)||(b.add(i),d.push(m))};for(let m of K(t,s))m.file!==s.relativePath&&r({symbol:m.enclosingSymbol??m.file,file:m.file,source:"resolved-reference"});let u=l.get(s.symbolId);if(u)for(let m of a.get(u.symbolId)??[]){if(m.file===s.relativePath||t.isIgnored(m.file))continue;let i=H(F(t,m.file),m.line);r({symbol:i?.symbol??m.file,file:m.file,source:"semantic-reference"})}c.set(s.symbolId,d)}return c}function le(t,n){let e=Q().join(", "),o=U().join(", ");return t.get(`SELECT
|
|
2
|
-
d.id AS documentId,
|
|
3
|
-
gs.id AS symbolId,
|
|
4
|
-
gs.symbol,
|
|
5
|
-
d.relative_path AS relativePath,
|
|
6
|
-
COALESCE(der.start_line, c.start_line) AS startLine,
|
|
7
|
-
COALESCE(der.end_line, c.end_line) AS endLine,
|
|
8
|
-
COALESCE(gs.display_name, '') AS leaf,
|
|
9
|
-
NULL AS parentTypeName,
|
|
10
|
-
CASE WHEN gs.kind IN (${e}) OR gs.symbol LIKE '%().' THEN 1 ELSE 0 END AS isFunctionLike,
|
|
11
|
-
CASE WHEN gs.kind IN (${o}) THEN 1 ELSE 0 END AS isTypeLike,
|
|
12
|
-
gs.kind AS kind,
|
|
13
|
-
gs.documentation AS documentation,
|
|
14
|
-
gs.enclosing_symbol AS enclosingSymbol
|
|
15
|
-
FROM global_symbols gs
|
|
16
|
-
LEFT JOIN defn_enclosing_ranges der ON der.symbol_id = gs.id
|
|
17
|
-
LEFT JOIN chunks c ON c.document_id = der.document_id
|
|
18
|
-
JOIN documents d ON d.id = COALESCE(der.document_id, c.document_id)
|
|
19
|
-
WHERE gs.id = ?
|
|
20
|
-
LIMIT 1`,n.symbolId)??null}function Y(t,n,e={}){if(n.length===0)return new Map;let o=e.additive??!1,l=[],a=[];for(let r of n)L(r.relativePath)&&v(t,r.relativePath)!==null?l.push(r):a.push(r);let c=new Map,s=new Map,d=r=>{for(let[u,m]of r){let i=c.get(u);i||(i=[],c.set(u,i));let p=s.get(u);p||(p=new Set,s.set(u,p));for(let _ of m){let h=`${_.symbol}|${_.chunkId}`;p.has(h)||(p.add(h),i.push(_))}}};l.length>0&&d(se(t,l)),e.semantic!==!1&&e.semanticEvidence&&d(ue(e.semanticEvidence.calleeMap(t,n)));let b=o?n:a;return b.length>0&&d(me(t,b)),c}function se(t,n){let e=new Map,o=ae(n,e),l=J(t);for(let[a,c]of o){let s=v(t,a);if(!s)continue;let d=$(c);for(let b of s){let r=d.get(b.line);if(!r)continue;let u=ce(t,a,l,b);u&&u.symbol!==r.symbol&&e.get(r.symbolId).push({symbol:u.symbol,file:u.file,chunkId:b.line,source:"ast-callsite"})}}return e}function ae(t,n){let e=new Map;for(let o of t){let l=e.get(o.relativePath);l?l.push(o):e.set(o.relativePath,[o]),n.set(o.symbolId,[])}for(let o of e.values())o.sort((l,a)=>l.endLine-l.startLine-(a.endLine-a.startLine));return e}function ce(t,n,e,o){let l=W(n,e.get(o.calleeLeaf)??[]);if(l.length===0)return null;let a=re(t,n,l,o.calleeQualifier);return a||G(t,n,l,o.memberAccess)}function re(t,n,e,o){if(!o||L(n)!=="clojure")return null;let a=P(t,n).filter(c=>c.kind==="namespace"&&c.localName===o&&c.sourcePath).map(c=>c.sourcePath);for(let c of a){let s=e.find(d=>N(c,d.file));if(s)return s}return e.find(c=>/`([^`]+)`\//.exec(c.symbol)?.[1]===o)??null}function me(t,n){if(n.length===0)return new Map;let o=k(n.map(i=>i.documentId)).flatMap(i=>t.all(`SELECT c.document_id, c.id AS chunk_id, c.start_line, c.end_line, m.symbol_id
|
|
21
|
-
FROM mentions m
|
|
22
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
23
|
-
WHERE m.role != 1
|
|
24
|
-
AND c.document_id IN (${i.map(()=>"?").join(",")})`,...i)),l=new Map;for(let i of o)l.has(i.document_id)||l.set(i.document_id,[]),l.get(i.document_id).push(i);let c=k(o.map(i=>i.symbol_id)).flatMap(i=>t.all(`SELECT gs.id AS symbol_id, gs.symbol,
|
|
25
|
-
COALESCE(der.document_id, def_chunk.document_id) AS document_id
|
|
26
|
-
FROM global_symbols gs
|
|
27
|
-
LEFT JOIN defn_enclosing_ranges der ON der.symbol_id = gs.id
|
|
28
|
-
LEFT JOIN (
|
|
29
|
-
SELECT m.symbol_id, MIN(c.document_id) AS document_id
|
|
30
|
-
FROM mentions m
|
|
31
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
32
|
-
WHERE m.role = 1
|
|
33
|
-
AND m.symbol_id IN (${i.map(()=>"?").join(",")})
|
|
34
|
-
GROUP BY m.symbol_id
|
|
35
|
-
) def_chunk ON def_chunk.symbol_id = gs.id
|
|
36
|
-
WHERE gs.id IN (${i.map(()=>"?").join(",")})`,...i,...i)),s=k([...n.map(i=>i.documentId),...c.flatMap(i=>i.document_id===null?[]:[i.document_id])]),d=new Map(s.flatMap(i=>t.all(`SELECT id, relative_path FROM documents
|
|
37
|
-
WHERE id IN (${i.map(()=>"?").join(",")})`,...i).map(p=>[p.id,p.relative_path]))),b=new Map;for(let i of c)b.has(i.symbol_id)||b.set(i.symbol_id,{symbol:i.symbol,file:i.document_id!==null?d.get(i.document_id)??"":""});let r=new Map,u=d,m=de(n);for(let[i,p]of m){let h=[...l.get(i)??[]].sort((f,g)=>f.start_line-g.start_line||f.end_line-g.end_line),Z=[...p].sort((f,g)=>f.startLine-g.startLine||f.endLine-g.endLine),C=new Set,M=0;for(let f of Z){for(;M<h.length&&h[M].start_line<=f.endLine;)C.add(h[M]),M+=1;for(let y of C)y.end_line<f.startLine&&C.delete(y);let g=new Set,A=[],R=null,q=()=>{if(R)return R;let y=u.get(f.documentId)??"",S=new Set;if(y){let w=B(t,y),I=Math.max(0,f.startLine),D=Math.min(w.length-1,f.endLine);for(let E=I;E<=D;E+=1)for(let z of w[E])S.add(z)}return R=S,S};for(let y of C){if(y.symbol_id===f.symbolId)continue;let S=b.get(y.symbol_id);if(!S)continue;if(!(y.start_line>=f.startLine&&y.end_line<=f.endLine)){if(!(y.start_line<=f.endLine&&y.end_line>=f.startLine))continue;let E=T(S.symbol);if(!E||!q().has(E))continue}let I=`${S.symbol}|${y.chunk_id}`;g.has(I)||(g.add(I),A.push({...S,chunkId:y.chunk_id,source:"scip-chunk"}))}r.set(f.symbolId,A)}}return r}var V=500;function k(t){let n=[...new Set(t)],e=[];for(let o=0;o<n.length;o+=V)e.push(n.slice(o,o+V));return e}function de(t){let n=new Map;for(let e of t){let o=n.get(e.documentId);o?o.push(e):n.set(e.documentId,[e])}return n}function ue(t){let n=new Map;for(let[e,o]of t){let l=[];for(let a of o)l.push({symbol:a.symbol,file:a.file,chunkId:-1,source:"semantic-callee"});n.set(e,l)}return n}export{Me as a,Ie as b,X as c,Y as d};
|
|
38
|
-
//# sourceMappingURL=chunk-KXDJAG4N.js.map
|
package/dist/chunk-L4S2A7BV.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as d}from"./chunk-2SNGN6U4.js";import{b as g}from"./chunk-B75HZHUP.js";import{a as p,b as u}from"./chunk-KXDJAG4N.js";import{n as b}from"./chunk-GLZTVKAB.js";import{d as f}from"./chunk-RA3AYNWP.js";function F(i,t={}){let{limit:l=20,scope:a,minFanIn:s=2,minFanOut:m=2,scanLimit:o}=t,r=new d(i);return g(r.productionCallableDefinitions({scope:a,requireCallableSymbol:!0,includeSuppressed:!0,sortByLocDesc:typeof o=="number"&&o>0}),o).map(e=>h(i,e,t.semantic!==!1)).filter(e=>e.fanIn>=s&&e.fanOut>=m).sort((e,y)=>y.score-e.score||y.fanIn-e.fanIn).slice(0,l)}function h(i,t,l){let a=[...new Set(u(i,t,{limit:500,semantic:l,semanticEvidence:b}).map(n=>n.file))].sort(),s=new Map;for(let n of p(i,t,{limit:500,semantic:l,semanticEvidence:b})){if(n.file===t.relativePath)continue;let e=`${n.symbol}|${n.file}`;s.has(e)||s.set(e,{symbol:n.symbol,shortName:f(n.symbol),file:n.file})}let m=[...s.values()].sort((n,e)=>n.file.localeCompare(e.file)||n.symbol.localeCompare(e.symbol)),o=a.length,r=m.length,c=o*r;return{symbol:t.symbol,shortName:f(t.symbol),fanIn:o,fanOut:r,callerFiles:a,externalCallees:m,score:c,definedIn:t.relativePath,actionTier:"signal",riskKind:"coordination-hotspot",evidenceReasons:[`${o} incoming file(s) reference this symbol`,`${r} distinct cross-file callee symbol(s) are reached from it`,`centrality score is ${c} (fan-in * fan-out)`],recommendation:"Review ownership, API stability, and caller groups before changing this central symbol; do not refactor solely from graph centrality."}}export{F as a};
|
|
2
|
-
//# sourceMappingURL=chunk-L4S2A7BV.js.map
|
package/dist/chunk-LP3ARJKF.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{a as w}from"./chunk-DHEQMPLW.js";import{a as $}from"./chunk-DQGSM7RZ.js";import{a as A,e as P,s as D}from"./chunk-RA3AYNWP.js";import{o as R}from"./chunk-MZZBAITE.js";import{J as S,K as k,L as T,P as j,l}from"./chunk-JORHF5AL.js";import{a as d}from"./chunk-64MNV6AB.js";import{c as f}from"./chunk-VVY2G5ET.js";import{existsSync as h,readdirSync as O}from"fs";import{join as p}from"path";var q={files:new Set,pathPrefixes:[]},x=/^(?:dist|build|lib|out|output|esm|cjs|umd)\//,J=/\.(?:d\.ts|d\.mts|d\.cts|ts|tsx|mts|cts|js|jsx|mjs|cjs)$/,N=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs"],Q=new Set([".git",".next",".turbo","build","coverage","dist","node_modules","out"]),Z=4,z=l("package-surface",{clearGroups:["whole-project"]});function tt(t){return z.get(t,()=>et(t.config.projectRoot))}function y(t,e){let r=tt(t);return r.files.has(e)?!0:r.pathPrefixes.some(s=>e.startsWith(s))}function et(t){let e=new Set,r=[];for(let{manifest:s,packageRoot:i}of rt(t))for(let n of st(s))nt(t,i,n,e,r);return e.size===0&&r.length===0?q:{files:e,pathPrefixes:r}}function rt(t){let e=[],r=L(t,"");return r&&e.push({manifest:r,packageRoot:""}),C(t,"",e,0),e}function C(t,e,r,s){if(s>=Z)return;let i=p(t,e);if(h(i))for(let n of O(i,{withFileTypes:!0})){if(!n.isDirectory()||Q.has(n.name))continue;let o=e?`${e}/${n.name}`:n.name,a=L(t,o);a&&r.push({manifest:a,packageRoot:o}),C(t,o,r,s+1)}}function L(t,e){let r;try{r=S(t,p(e,"package.json"),{maxBytes:8*1024*1024,inputKind:"package manifest"})}catch(s){if(!k(s))throw s;return null}try{let s=JSON.parse(r);return s&&typeof s=="object"?s:null}catch{return null}}function st(t){let e=[];for(let s of["main","module","types","browser"])typeof t[s]=="string"&&e.push(t[s]);let r=t.bin;if(typeof r=="string")e.push(r);else if(r&&typeof r=="object")for(let s of Object.values(r))typeof s=="string"&&e.push(s);return M(t.exports,e),e}function M(t,e){if(typeof t=="string"){e.push(t);return}if(!(!t||typeof t!="object"))for(let r of Object.values(t))M(r,e)}function nt(t,e,r,s,i){let n=r.replace(/\\/g,"/").replace(/^\.\//,"");if(n===""||n.startsWith(".."))return;let o=n.indexOf("*");if(o>=0){let c=n.slice(0,o);for(let g of F(c))g!==""&&i.push(u(e,g));return}let a=n.replace(J,"");for(let c of F(a)){c===a&&c===n&&s.add(u(e,n));for(let g of N)it(t,s,e,c+g)}s.add(u(e,n))}function F(t){let e=[t];return x.test(t)&&(e.push(t.replace(x,"src/")),e.push(t.replace(x,""))),e}function it(t,e,r,s){let i=u(r,s);if(e.add(i),!s.startsWith("src/")||h(p(t,i)))return;let n=N.find(m=>s.endsWith(m));if(!n)return;let o=s.slice(0,-n.length);ot(t,e,r,o,n);let a=o.lastIndexOf("/");if(a<=4)return;let c=o.slice(0,a),g=o.slice(a+1);for(let m of I(t,r,c,`${g}${n}`))e.add(m)}function ot(t,e,r,s,i){let n=u(r,`${s}/index${i}`);h(p(t,n))&&e.add(n)}function I(t,e,r,s){let i=p(t,e,r);if(!h(i))return[];let n=[];for(let o of O(i,{withFileTypes:!0})){let a=`${r}/${o.name}`;o.isDirectory()?n.push(...I(t,e,a,s)):o.isFile()&&o.name===s&&n.push(u(e,a))}return n}function u(t,e){return t?`${t}/${e}`:e}import{existsSync as E,readdirSync as at}from"fs";import{dirname as ct,join as _}from"path";var ut={rootFiles:new Set,sourcePrefixes:[]},ft=new Set([".git",".scipquery","node_modules","target"]),lt=6,gt=l("rust-library-surface",{clearGroups:["whole-project"]});function v(t,e,r){if(!r.endsWith(".rs")||!St(pt(t),r))return!1;let s=D(t,r).find(i=>i.symbol===e);return s?ht(j(t,r)[s.startLine]??""):!1}function pt(t){return gt.get(t,()=>dt(t.config.projectRoot))}function dt(t){let e=new Set,r=new Set;for(let s of bt(t)){let i=S(t,_(s,"Cargo.toml"),{maxBytes:8388608,inputKind:"Cargo manifest"}),n=mt(i),o=u(s,"src/lib.rs"),a=n?u(s,n):!Pt(i)&&T(t,o)?o:null;if(!a)continue;e.add(a);let c=ct(a).replaceAll("\\","/");r.add(c==="."?"":`${c}/`)}return e.size===0?ut:{rootFiles:e,sourcePrefixes:[...r].sort()}}function St(t,e){return e.endsWith(".rs")?t.rootFiles.has(e)?!0:xt(e)?!1:t.sourcePrefixes.some(r=>e.startsWith(r)):!1}function ht(t){return/^\s*pub\s+(?!\()/.test(t)}function bt(t){if(!E(t))return[];let e=[];return V(t,"",e,0),e}function V(t,e,r,s){let i=_(t,e);if(E(i)&&(E(_(i,"Cargo.toml"))&&r.push(e),!(s>=lt)))for(let n of at(i,{withFileTypes:!0})){if(!n.isDirectory()||ft.has(n.name))continue;let o=e?`${e}/${n.name}`:n.name;V(t,o,r,s+1)}}function mt(t){let e=!1;for(let r of t.split(`
|
|
2
|
-
`)){let s=r.replace(/\s+#.*$/,"").trim(),i=/^\[([^\]]+)\]$/.exec(s);if(i){e=i[1]==="lib";continue}if(!e)continue;let n=/^path\s*=\s*["']([^"']+)["']/.exec(s)?.[1];if(n)return n.replaceAll("\\","/").replace(/^\.\//,"")}return null}function Pt(t){let e=!1;for(let r of t.split(`
|
|
3
|
-
`)){let s=r.replace(/\s+#.*$/,"").trim(),i=/^\[([^\]]+)\]$/.exec(s);if(i){e=i[1]==="package";continue}if(e&&/^autolib\s*=\s*false\b/.test(s))return!0}return!1}function xt(t){return/(?:^|\/)src\/main\.rs$/.test(t)||/(?:^|\/)src\/bin\//.test(t)||/(?:^|\/)(?:examples|tests|benches)\//.test(t)}function b(t){let e=f(t);return vt(e)?"test":Vt(e)?"worker":Xt(e)?"entry":Wt(e)?"barrel":"source"}function yt(t){return b(t)==="barrel"}function W(t){return Et.get(t,()=>{let r=d(t,{includeIgnored:!1}).filter(o=>{let a=b(o);return a==="entry"||a==="worker"});if(r.length===0)return new Set;let s=$(t),i=new Set,n=new Set;for(;r.length>0;){let o=r.shift();if(!i.has(o)){i.add(o),b(o)==="barrel"&&n.add(o);for(let a of s.get(o)??[])i.has(a)||r.push(a)}}return n})}var Et=l("live-barrels",{clearGroups:["whole-project"]});function _t(t,e){return W(t).has(f(e))}function pe(t){let e=W(t);return d(t,{includeIgnored:!1}).filter(r=>yt(r)&&!e.has(r)&&!wt(t,r))}function wt(t,e){let r=f(e),s=A(t).forFile(r,{facts:!0}).facts?.callables;return s&&s.length>0?!0:(t.get(`SELECT COUNT(*) AS n
|
|
4
|
-
FROM defn_enclosing_ranges der
|
|
5
|
-
JOIN documents d ON d.id = der.document_id
|
|
6
|
-
WHERE d.relative_path = ?
|
|
7
|
-
AND der.end_line - der.start_line >= 2`,r)?.n??0)>0}function de(t,e){let r=f(e),s=b(e);return s==="entry"||s==="worker"||Lt(r)||_t(t,r)}function Se(t,e,r){let s=f(r);if(y(t,s)||Tt(t,e,s)||v(t,e,s)||Ct(e,s))return!0;let i=t.config.entryRoots;return i?!!(i.files?.some(n=>f(n)===s)||i.pathPrefixes?.some(n=>s.startsWith(f(n)))||i.qualifiedVars?.some(n=>Bt(e,n))||i.symbolPatterns?.some(n=>{try{return w(n,"entryRoots.symbolPatterns entry").test(e)}catch{return!1}})):!1}var kt=l("package-surface-reachability",{clearGroups:["whole-project"]});function Tt(t,e,r){let s=jt(t).get(r);return s===void 0?!1:s===null||s.has(P(e))}function jt(t){return kt.get(t,()=>{let e=new Map,r=[];for(let s of d(t,{includeIgnored:!1}))y(t,s)&&(e.set(s,null),r.push(s));for(;r.length>0;){let s=r.shift(),i=e.get(s);if(i!==void 0)for(let n of R(t,s)){if(!n.sourcePath||t.isIgnored(n.sourcePath))continue;let o=Rt(i,n);o!==void 0&&$t(e,n.sourcePath,o)&&r.push(n.sourcePath)}}return e})}function Rt(t,e){if(t===null)return e.kind==="named"?new Set(e.names):null;if(e.kind==="star")return new Set(t);if(e.kind==="star-as")return;let r=e.names.filter(s=>t.has(s));return r.length>0?new Set(r):void 0}function $t(t,e,r){if(!t.has(e))return t.set(e,r),!0;let s=t.get(e);if(s===void 0)return!1;if(s===null||r===null)return s===null?!1:(t.set(e,null),!0);let i=!1;for(let n of r)s.has(n)||(s.add(n),i=!0);return i}var B=new Set(["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]),At=new Set(["default","generateMetadata","generateStaticParams"]),Dt=new Set(["default","getStaticProps","getServerSideProps","getStaticPaths","config"]),Ft=new Set(["default","loader","action","clientLoader","clientAction","headers","links","meta","shouldRevalidate","ErrorBoundary","HydrateFallback"]),Ot=new Set(["load","actions","entries",...B]),Nt=new Set(["default"]);function Ct(t,e){let r=P(t);return r===""?!1:G(e)?B.has(r):U(e)?At.has(r):H(e)?Dt.has(r):K(e)?Ft.has(r):Y(e)?Ot.has(r):It(e)?Nt.has(r):!1}function Lt(t){return G(t)||U(t)||H(t)||Mt(t)||K(t)||Y(t)}function G(t){return/(?:^|\/)app(?:\/[^/]+)*\/route\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function U(t){return/(?:^|\/)app(?:\/[^/]+)*\/(?:page|layout|template|loading|error|not-found|global-error|head|default)\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function H(t){return/(?:^|\/)pages\/.+\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function Mt(t){let e="(?:middleware|proxy|instrumentation)\\.(?:ts|js|mts|mjs)";return new RegExp(`^(?:src/)?${e}$`).test(t)||new RegExp(`(?:^|/)src/${e}$`).test(t)||new RegExp(`(?:^|/)(?:apps|services|packages)/[^/]+/(?:src/)?${e}$`).test(t)}function K(t){return/(?:^|\/)app\/routes\/.+\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function Y(t){return/(?:^|\/)src\/routes\/(?:.*\/)?\+(?:page|page\.server|layout|layout\.server|server)\.(?:ts|js)$/.test(t)}function It(t){return/(?:^|\/)src\/(?:pages|views|routes)\/.+\.(?:ts|tsx|js|jsx|vue)$/.test(t)}function vt(t){return!!(/\.(?:test|spec)\.[a-z0-9]+$/i.test(t)||/(?:^|\/)(?:_)?test_[^/]+$/i.test(t)||/(?:^|\/)spec_[^/]+$/i.test(t)||/(?:^|\/)[^/]+_test\.[a-z0-9]+$/i.test(t)||/(?:^|\/)[^/]+_tests\.rs$/i.test(t)||/(?:^|\/)tests\.rs$/i.test(t)||/(?:^|\/)[^/]+_spec\.[a-z0-9]+$/i.test(t)||/(?:^|\/)__tests__\//i.test(t)||/(?:^|\/)test\//i.test(t)||/(?:^|\/)tests\//i.test(t)||/(?:^|\/)__fixtures__\//i.test(t)||/(?:^|\/)__mocks__\//i.test(t)||/(?:^|\/)test-support\//i.test(t)||/(?:^|\/)test-utils\//i.test(t)||/(?:^|\/)testing\//i.test(t))}function Vt(t){return/(?:^|\/)[^/]*worker\.(?:ts|tsx|js|mjs|cjs|rs|py|go)$/.test(t)}function Xt(t){let e=t.split("/"),r=e[e.length-1]??t;return r==="cli.ts"||r==="cli.js"||r==="postinstall.ts"||r==="postinstall.js"||r==="main.ts"||r==="main.js"||r==="main.rs"||r==="main.go"||r==="main.py"||r==="build.rs"||r==="lib.rs"||/\bsrc\/bin\/[^/]+\.rs$/.test(t)||/(?:^|\/)examples\/[^/]+\.rs$/.test(t)||/(?:^|\/)tests\/[^/]+\.rs$/.test(t)||/(?:^|\/)benches\/[^/]+\.rs$/.test(t)?!0:r==="index.ts"||r==="index.js"?/(?:^|\/)(?:apps|services)\/[^/]+\/src\/index\.(?:ts|js)$/.test(t)?!0:e.length<=2:!1}function Wt(t){return t==="index.ts"||t==="index.js"||t.endsWith("/index.ts")||t.endsWith("/index.js")||t.endsWith("/mod.rs")||t.endsWith("/__init__.py")}function Bt(t,e){let r=e.lastIndexOf("/");if(r<0)return!1;let s=e.slice(0,r),i=e.slice(r+1);return t.includes(X(s)+"/")&&t.includes(X(i)+".")}function X(t){return/^[A-Za-z0-9_$+-]+$/.test(t)?t:"`"+t.replace(/`/g,"``")+"`"}export{y as a,b,yt as c,_t as d,pe as e,de as f,Se as g};
|
|
8
|
-
//# sourceMappingURL=chunk-LP3ARJKF.js.map
|
package/dist/chunk-LSOR3LQG.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{t as h}from"./chunk-VVY2G5ET.js";import{execFileSync as w,spawnSync as fe}from"child_process";import{platform as G}from"os";var S=G()==="win32";function pe(t){let e=S?"where":"which";try{return w(e,[t],{stdio:"pipe",timeout:1e4,killSignal:"SIGKILL"}),!0}catch{return!1}}var C=/\.(?:c|m)?js$/i,T=/\.(?:exe|com)$/i;function ye(t,e){return C.test(t)?{binary:process.execPath,args:[t,...e]}:{binary:t,args:[...e]}}function P(t,e){return w(t,e,{stdio:["ignore","pipe","ignore"],encoding:"utf8",timeout:1e4,killSignal:"SIGKILL"})}function ge(t,e={}){let r=e.isWindows??S,i=e.lookup??P,n;try{n=i(r?"where":"which",[t])}catch{return null}let o=n.split(/\r?\n/).map(s=>s.trim()).filter(Boolean);return r?o.find(s=>T.test(s))??null:o[0]??null}function be(t){try{return process.kill(t,0),!0}catch(e){return typeof e=="object"&&e!==null&&"code"in e&&e.code==="EPERM"}}var A=new Set(["aix","android","darwin","freebsd","haiku","linux","openbsd","sunos","win32","cygwin","netbsd"]);function N(t){if(!t||typeof t!="object"||Array.isArray(t))return null;let e=t;return e.version!==1||typeof e.pid!="number"||!Number.isSafeInteger(e.pid)||e.pid<=0||typeof e.platform!="string"||!A.has(e.platform)||typeof e.startToken!="string"||e.startToken.trim()===""?null:{version:1,pid:e.pid,platform:e.platform,startToken:e.startToken}}function O(t,e){return t.version===e.version&&t.pid===e.pid&&t.platform===e.platform&&t.startToken===e.startToken}import{execFileSync as W}from"child_process";import{platform as _}from"os";var M=1e3,I=16*1024;function Ee(t,e=$){if(!Number.isSafeInteger(t)||t<=0)return null;try{let r=L(t,e);return r?{version:1,pid:t,platform:e.platform,startToken:r}:null}catch{return null}}function L(t,e){if(e.platform==="linux"||e.platform==="android")return B(e.readFile(`/proc/${t}/stat`));if(e.platform==="win32"){let r=`([DateTimeOffset](Get-Process -Id ${t} -ErrorAction Stop).StartTime).ToUnixTimeMilliseconds()`;return E(e.run("powershell.exe",["-NoProfile","-NonInteractive","-Command",r]))}return e.platform==="darwin"||e.platform==="freebsd"||e.platform==="openbsd"||e.platform==="netbsd"?E(e.run("ps",["-p",String(t),"-o","lstart="])):null}function B(t){let e=t.lastIndexOf(")");if(e<0)return null;let i=t.slice(e+1).trim().split(/\s+/)[19];return i&&/^\d+$/.test(i)?i:null}function E(t){let e=t.trim();return e===""?null:e}var $={platform:_(),readFile(t){return h(t,{maxBytes:I,inputKind:"process identity pseudo-file"})},run(t,e){return W(t,[...e],{encoding:"utf8",timeout:M,maxBuffer:I,env:{...process.env,LC_ALL:"C",LANG:"C"},stdio:["ignore","pipe","ignore"]})}};function Fe(){return performance.now()}import{spawnSync as J}from"child_process";import{createHash as U}from"crypto";import{existsSync as j,lstatSync as H,realpathSync as q}from"fs";import{dirname as K,isAbsolute as z,join as Y,resolve as f}from"path";var m={run(t,e){let r=R(t,e);return r.kind==="success"?r.output:void 0},runResult:R},X=["rev-parse","--show-toplevel","--absolute-git-dir","--git-common-dir","HEAD","HEAD^{tree}"],p=/^[0-9a-f]{40,64}$/;function Ae(t,e,r=m){if(!e||e.startsWith("-")||/[\0\r\n]/.test(e))throw new Error(`Invalid Git revision ${JSON.stringify(e)}.`);let i=r.runResult(t,["rev-parse","--verify","--end-of-options",`${e}^{commit}`]);if(i.kind!=="success"||!p.test(i.output))throw new Error(`Git revision ${JSON.stringify(e)} does not resolve to exactly one commit.`);return i.output}function Ne(t,e=m){let r=e.runResult(t,X);if(r.kind==="success"){let i=V(r.output);if(i)return Q(i,e)}return Z(t,e)}function V(t){let e=t.split(`
|
|
2
|
-
`).map(u=>u.trim());if(e.length!==5)return;let[r,i,n,o,s]=e;if(!r||!i||!n||!o||!s||!p.test(o)||!p.test(s))return;let c=a(r);return{root:c,gitDir:a(d(c,i)),commonDir:a(d(c,n)),headCommit:o,treeOid:s}}function Q(t,e){let r=e.run(t.root,["status","--porcelain=v1","-z","--untracked-files=all"]);return r===void 0?void 0:{...v(t.root,t.gitDir),commonDir:t.commonDir,repositoryId:g("repository",t.commonDir),headCommit:t.headCommit,treeOid:t.treeOid,clean:r.length===0}}function Z(t,e){let r=ee(t,e);if(r.kind!=="worktree")return;let i=r.identity,n=i.projectRoot,o=e.run(n,["rev-parse","--git-common-dir"])?.trim();if(!o)return;let s=a(d(n,o)),c=y(e.run(n,["rev-parse","--verify","HEAD"])),u=y(e.run(n,["rev-parse","--verify","HEAD^{tree}"])),l=e.run(n,["status","--porcelain=v1","-z","--untracked-files=all"]);if(l!==void 0)return{...i,commonDir:s,repositoryId:g("repository",s),headCommit:c,treeOid:u,clean:l.length===0}}function ee(t,e=m){let r=e.runResult(t,["rev-parse","--show-toplevel"]);if(r.kind==="not-repository")return{kind:"non-git"};if(r.kind==="error")return r;let i=r.output.trim();if(!i)return{kind:"error",message:"Git returned an empty worktree root."};let n=a(i),o=e.run(n,["rev-parse","--absolute-git-dir"])?.trim();if(!o)return{kind:"error",message:"Git did not return an absolute worktree directory."};let s=a(d(n,o));return{kind:"worktree",identity:v(n,s)}}function v(t,e){return{projectRoot:t,gitDir:e,worktreeId:g("worktree",`${t}\0${e}`)}}function Oe(t,e,r=m){return y(r.run(t,e))}function d(t,e){return z(e)?e:f(t,e)}function a(t){try{return q(t)}catch{return f(t)}}function g(t,e){return U("sha256").update(`${t}\0${e}`).digest("hex").slice(0,24)}function y(t){return t?.trim()||void 0}function R(t,e){let r=J("git",["-C",t,...e],{encoding:"utf-8",env:{...process.env,LC_ALL:"C"},maxBuffer:52428800,stdio:["ignore","pipe","pipe"],timeout:3e4,killSignal:"SIGKILL"});if(r.status===0)return{kind:"success",output:r.stdout.trimEnd()};let n=(typeof r.stderr=="string"?r.stderr.trim():"")||r.error?.message||`git exited with status ${r.status??"unknown"}`,o=r.error?.code;return(/not a git repository/i.test(n)||o==="ENOENT"&&j(f(t)))&&!te(t)?{kind:"not-repository"}:{kind:"error",message:n}}function te(t){if(process.env.GIT_DIR||process.env.GIT_COMMON_DIR)return!0;let e=f(t);for(;;){try{return H(Y(e,".git")),!0}catch(i){let n=i.code;if(n!=="ENOENT"&&n!=="ENOTDIR")return!0}let r=K(e);if(r===e)return!1;e=r}}function k(t,e,r,i){let n=0;for(;n<e.length;){let o=r.writeFile(t,e,n,e.length-n);if(!Number.isSafeInteger(o)||o<=0||o>e.length-n)throw new Error(`${i} write did not make valid forward progress`);n+=o}}function b(t,e){if(e!=="win32")return!1;let r=t.code;return r==="EACCES"||r==="EBADF"||r==="EINVAL"||r==="EISDIR"||r==="EPERM"}import{randomUUID as re}from"crypto";import{closeSync as ne,fsyncSync as ie,linkSync as oe,mkdirSync as se,openSync as ue,renameSync as le,unlinkSync as ce,writeSync as ae}from"fs";import{dirname as F}from"path";var x=Object.freeze({platform:process.platform,randomToken:()=>re(),makeDirectory:t=>se(t,{recursive:!0}),openFile:(t,e,r)=>ue(t,e,r),writeFile:(t,e,r,i)=>ae(t,e,r,i),syncFile:t=>ie(t),closeFile:t=>ne(t),renameFile:(t,e)=>le(t,e),linkFile:(t,e)=>oe(t,e),removeFile:t=>ce(t)});function Je(t,e,r={}){let i=r.durability??"visibility",n=r.runtime??x,o=F(t);n.makeDirectory(o);let s=`${t}.tmp-${n.randomToken()}`,c=typeof e=="string"?Buffer.from(e):e,u,l=!1;try{return u=n.openFile(s,"wx",r.mode??384),l=!0,k(u,c,n,"atomic file"),i==="durable"&&n.syncFile(u),n.closeFile(u),u=void 0,n.renameFile(s,t),l=!1,{durability:i,directorySync:i==="durable"?D(o,n):"not-requested"}}finally{if(u!==void 0)try{n.closeFile(u)}catch{}if(l)try{n.removeFile(s)}catch{}}}function Ue(t,e,r={}){let i=r.durability??"visibility",n=r.runtime??x;if(!n.linkFile)throw new Error("Exclusive atomic file publication requires hard-link support.");let o=F(t);n.makeDirectory(o);let s=`${t}.tmp-${n.randomToken()}`,c=typeof e=="string"?Buffer.from(e):e,u,l=!1;try{return u=n.openFile(s,"wx",r.mode??384),l=!0,k(u,c,n,"exclusive atomic file"),i==="durable"&&n.syncFile(u),n.closeFile(u),u=void 0,n.linkFile(s,t),n.removeFile(s),l=!1,{durability:i,directorySync:i==="durable"?D(o,n):"not-requested"}}finally{if(u!==void 0)try{n.closeFile(u)}catch{}if(l)try{n.removeFile(s)}catch{}}}function D(t,e=x){let r;try{r=e.openFile(t,"r")}catch(i){if(b(i,e.platform))return"unsupported";throw i}try{return e.syncFile(r),"synced"}catch(i){if(b(i,e.platform))return"unsupported";throw i}finally{e.closeFile(r)}}export{pe as a,ye as b,ge as c,be as d,N as e,O as f,Ee as g,Fe as h,k as i,b as j,Je as k,Ue as l,D as m,Ae as n,Ne as o,Oe as p,d as q,a as r};
|
|
3
|
-
//# sourceMappingURL=chunk-LSOR3LQG.js.map
|
package/dist/chunk-NTUMF2X3.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import{a as r}from"./chunk-33XTHFKR.js";function _(e,n,d){let i=r(e,n)??n,o=r(e,d)??d,t=e.get(`SELECT COUNT(DISTINCT gs.id) AS shared
|
|
2
|
-
FROM global_symbols gs
|
|
3
|
-
WHERE (
|
|
4
|
-
-- Defined in file1, referenced in file2
|
|
5
|
-
EXISTS (
|
|
6
|
-
SELECT 1
|
|
7
|
-
FROM mentions def_m
|
|
8
|
-
JOIN chunks def_c ON def_m.chunk_id = def_c.id
|
|
9
|
-
JOIN documents d ON def_c.document_id = d.id
|
|
10
|
-
WHERE def_m.symbol_id = gs.id AND def_m.role = 1 AND d.relative_path = ?
|
|
11
|
-
)
|
|
12
|
-
AND EXISTS (
|
|
13
|
-
SELECT 1 FROM mentions m
|
|
14
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
15
|
-
JOIN documents d ON c.document_id = d.id
|
|
16
|
-
WHERE m.symbol_id = gs.id AND m.role != 1 AND d.relative_path = ?
|
|
17
|
-
)
|
|
18
|
-
) OR (
|
|
19
|
-
-- Defined in file2, referenced in file1
|
|
20
|
-
EXISTS (
|
|
21
|
-
SELECT 1
|
|
22
|
-
FROM mentions def_m
|
|
23
|
-
JOIN chunks def_c ON def_m.chunk_id = def_c.id
|
|
24
|
-
JOIN documents d ON def_c.document_id = d.id
|
|
25
|
-
WHERE def_m.symbol_id = gs.id AND def_m.role = 1 AND d.relative_path = ?
|
|
26
|
-
)
|
|
27
|
-
AND EXISTS (
|
|
28
|
-
SELECT 1 FROM mentions m
|
|
29
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
30
|
-
JOIN documents d ON c.document_id = d.id
|
|
31
|
-
WHERE m.symbol_id = gs.id AND m.role != 1 AND d.relative_path = ?
|
|
32
|
-
)
|
|
33
|
-
)`,i,o,o,i);return{...c(i,o,t?.shared??0)}}function a(e,n={}){let{limit:d=20,scope:i}=n,o=i?"AND def_d.relative_path LIKE ? AND ref_d.relative_path LIKE ?":"",t=i?[`%${i}%`,`%${i}%`]:[];return e.all(`SELECT
|
|
34
|
-
def_d.relative_path AS file1,
|
|
35
|
-
ref_d.relative_path AS file2,
|
|
36
|
-
COUNT(DISTINCT gs.id) AS shared
|
|
37
|
-
FROM mentions m
|
|
38
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
39
|
-
JOIN documents ref_d ON c.document_id = ref_d.id
|
|
40
|
-
JOIN global_symbols gs ON m.symbol_id = gs.id
|
|
41
|
-
JOIN (
|
|
42
|
-
SELECT m2.symbol_id, c2.document_id
|
|
43
|
-
FROM mentions m2
|
|
44
|
-
JOIN chunks c2 ON m2.chunk_id = c2.id
|
|
45
|
-
WHERE m2.role = 1
|
|
46
|
-
GROUP BY m2.symbol_id
|
|
47
|
-
) sym_def ON sym_def.symbol_id = gs.id
|
|
48
|
-
JOIN documents def_d ON sym_def.document_id = def_d.id
|
|
49
|
-
WHERE m.role != 1
|
|
50
|
-
AND def_d.id != ref_d.id
|
|
51
|
-
${e.pathExclusionsFor("def_d","ref_d")}
|
|
52
|
-
${o}
|
|
53
|
-
GROUP BY def_d.id, ref_d.id
|
|
54
|
-
ORDER BY shared DESC
|
|
55
|
-
LIMIT ?`,...t,d).filter(s=>!e.isIgnored(s.file1)&&!e.isIgnored(s.file2)).map(s=>c(s.file1,s.file2,s.shared))}function c(e,n,d){return{file1:e,file2:n,sharedSymbols:d,actionTier:"signal",couplingKind:"shared-symbol-coupling",evidenceReasons:[`${d} symbol(s) are defined in one file and referenced by the other`],recommendation:"Review whether the shared symbol surface is an intentional boundary or hidden coordination pressure before moving code."}}export{_ as a,a as b};
|
|
56
|
-
//# sourceMappingURL=chunk-NTUMF2X3.js.map
|
package/dist/chunk-QOXBSI6G.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import{i,k as s}from"./chunk-FD3HFKXR.js";import{f as o}from"./chunk-VVY2G5ET.js";import c from"better-sqlite3";var d=["node_modules",".git","dist","build","out","coverage","target",".next",".nuxt",".cache",".turbo",".nbb",".cpcache",".shadow-cljs",".scipquery-cache","__pycache__",".venv","venv"],l=class{db;config;generation;pathFilter;statementCache=new Map;constructor(t,e){this.config=t,this.pathFilter=e??null;let a=h(t);this.generation=a.generation,this.db=a.db,this.db.pragma("busy_timeout = 5000"),this.db.pragma("query_only = ON"),this.db.pragma("temp_store = MEMORY"),this.db.pragma("cache_size = -64000"),this.db.pragma("mmap_size = 268435456");try{u(this.db)}catch(n){throw this.db.close(),n}}isIgnored(t){return this.pathFilter?.isIgnored(t)??!1}get localSymbolPredicate(){return`(
|
|
2
|
-
EXISTS (
|
|
3
|
-
SELECT 1
|
|
4
|
-
FROM defn_enclosing_ranges local_der
|
|
5
|
-
JOIN documents local_d ON local_der.document_id = local_d.id
|
|
6
|
-
WHERE local_der.symbol_id = gs.id
|
|
7
|
-
${this.pathExclusionsFor("local_d").trimStart()}
|
|
8
|
-
)
|
|
9
|
-
OR EXISTS (
|
|
10
|
-
SELECT 1
|
|
11
|
-
FROM mentions local_m
|
|
12
|
-
JOIN chunks local_c ON local_m.chunk_id = local_c.id
|
|
13
|
-
JOIN documents local_d ON local_c.document_id = local_d.id
|
|
14
|
-
WHERE local_m.symbol_id = gs.id
|
|
15
|
-
AND local_m.role = 1
|
|
16
|
-
${this.pathExclusionsFor("local_d").trimStart()}
|
|
17
|
-
)
|
|
18
|
-
)`}get pathExclusions(){return this.pathExclusionsFor("d")}get symbolNoise(){return this.symbolNoiseFor("gs")}pathExclusionsFor(...t){return t.flatMap(e=>d.flatMap(a=>[`AND ${e}.relative_path NOT LIKE '${a}/%'`,`AND ${e}.relative_path NOT LIKE '%/${a}/%'`])).join(`
|
|
19
|
-
`)}symbolNoiseFor(t){return`AND ${t}.symbol NOT LIKE '%().(%' AND ${t}.symbol NOT LIKE '%typeLiteral%'`}all(t,...e){return this.statement(t).all(...e)}get(t,...e){return this.statement(t).get(...e)}close(){this.statementCache.clear(),this.db.close()}statement(t){let e=this.statementCache.get(t);return e||(e=this.db.prepare(t),this.statementCache.set(t,e)),e}};function u(r){if(!r.prepare("SELECT 1 AS present FROM sqlite_master WHERE type = 'table' AND name = 'documents'").get())return;let e=r.prepare("SELECT relative_path FROM documents").iterate();for(let a of e)o(a.relative_path)}function h(r){for(let t=0;t<4;t+=1){let e=i(r),a=new c(e.databasePath,{readonly:!0,fileMustExist:!0});if(e.source==="immutable")return{db:a,generation:e};try{let n=i(r);if(e.databaseFileIdentity===s(e.databasePath)&&n.source==="legacy"&&n.identity===e.identity&&n.databaseFileIdentity===e.databaseFileIdentity&&n.metadataRaw===e.metadataRaw)return{db:a,generation:e}}catch(n){throw a.close(),n}a.close()}throw new Error("SQLite index publication changed repeatedly while opening a coherent generation.")}export{l as a};
|
|
20
|
-
//# sourceMappingURL=chunk-QOXBSI6G.js.map
|
package/dist/chunk-QXK6UUSM.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as se}from"./chunk-A3QXWFBK.js";import{a as ce}from"./chunk-7LSVMFX7.js";import{a as oe}from"./chunk-DQBCO2UY.js";import{a as ae}from"./chunk-43KC6EQZ.js";import{a as re}from"./chunk-O3O4XXO6.js";import{a as ie}from"./chunk-O23I56NA.js";import{a as ne}from"./chunk-5YLUDDAF.js";import{b as G,e as m}from"./chunk-E3HYEQO7.js";import{a as te}from"./chunk-WWKWUPSU.js";import{a as Z}from"./chunk-7FT5Y65S.js";import{a as ee}from"./chunk-6YTSKJJ3.js";import{a as J}from"./chunk-3EDFLQ6A.js";import{a as X}from"./chunk-FJ5UDTQF.js";import{a as K}from"./chunk-HZYDQPNY.js";import{a as Y}from"./chunk-YLFORA5G.js";import{a as W}from"./chunk-RLH5VUMG.js";import{b as j}from"./chunk-BDOIKGDI.js";import{a as U}from"./chunk-6M7RONVB.js";import{a as A,b as q}from"./chunk-E5HNT4X2.js";import{b as N}from"./chunk-P3UO3EH3.js";import{a as z}from"./chunk-S4S2WOIX.js";import{a as ue}from"./chunk-7KYNAMMH.js";import{f as Q}from"./chunk-WANA4KAQ.js";import{f as E,g as M}from"./chunk-LP3ARJKF.js";import{v as _}from"./chunk-JORHF5AL.js";import{createHash as At,randomUUID as Bt}from"crypto";function de(e,r){let t=new Map;for(let n of e){let o=t.get(n.check)??[];o.push(n),t.set(n.check,o)}let i=[];for(let[n,o]of t){let c=o.filter(d=>d.outcome==="resolved").length,s=o.filter(d=>d.outcome==="suppressed").length,l=o.filter(d=>d.outcome==="still-open").length,h=o.length,C=o.filter(d=>d.outcome==="still-open").sort((d,b)=>d.firstSeen-b.firstSeen)[0];i.push({check:n,seen:h,resolved:c,suppressed:s,stillOpen:l,resolutionRate:h>0?c/h:0,suppressionRate:h>0?s/h:0,oldestOpenAgeDays:C?Math.floor((r-C.firstSeen)/$e):null})}return i.sort((n,o)=>n.check.localeCompare(o.check))}var $e=864e5;function le(e){return _(e).map(Ie)}function Ie(e){return{check:e.check,findingId:e.findingId,firstSeen:e.firstSeen,lastSeen:e.lastSeen,timesShown:e.timesShown,outcome:e.outcome}}function f(e){return e.scoreCount??e.count}function B(e){let r=Ne(e),{breakdown:t,pressure:i}=Ue(e),n=me(t,"risk"),o=me(t,"hygiene");return{score:Math.min(n,o),riskScore:n,hygieneScore:o,scoreBreakdown:t,overview:{documents:e.statsResult.documents,symbols:e.statsResult.symbols,indexSizeBytes:e.statsResult.indexSizeBytes},findings:{deadSymbols:e.dead.count,deadLoc:e.dead.loc,isolatedSymbols:e.isolated.count,isolatedLoc:e.isolated.loc,cycles:e.realCycleCount,similarPairs:e.similarCount,duplicateBodyGroups:e.duplicateBodies.count,duplicateBodyLoc:e.duplicateBodies.loc,twinDriftGroups:e.twinDrift.count,twinDriftLoc:e.twinDrift.loc,reactComponentDuplicatePairs:e.reactComponentDuplicates.count,reactHookCandidatePairs:e.reactHookCandidates.count,reactHookCandidateScoreCount:f(e.reactHookCandidates),reactLargeComponentPressureFiles:e.reactLargeComponentPressure.count,vueComponentDuplicatePairs:e.vueComponentDuplicates.count,vueComposableCandidatePairs:e.vueComposableCandidates.count,vueComposableCandidateScoreCount:f(e.vueComposableCandidates),vueLargeViewPressureFiles:e.vueLargeViewPressure.count,extractionCandidates:e.extractCount,wrappers:e.wrappers.count,wrapperScoreCount:f(e.wrappers),passthroughs:e.passthroughs.count,staleTypes:e.stale.count,driftedFiles:e.drift.count,complexityHotspotCount:e.complexity.extremeCount,hiddenCouplingPairs:e.gitEvidence?.hiddenCoupling.pairCount??null,hiddenCouplingScoreCount:e.gitEvidence?.hiddenCoupling.scoreCount??null,coverageContractViolations:e.coverageContracts.count},axes:Ve(e),validation:ze(e),suppressions:e.suppressions,actions:r,pressure:i,topComplexity:e.complexity.top,warnings:e.warnings.length>0?e.warnings:void 0,detectorPrecision:[]}}function Ve(e){return{deletable:{loc:e.dead.loc+e.isolated.loc,symbols:e.dead.count+e.isolated.count},cycles:{count:e.realCycleCount},changeAmplification:e.gitEvidence?.amplification??null,hiddenCoupling:e.gitEvidence?.hiddenCoupling??null,churnWeightedComplexity:_e(e),evidenceQuality:{graphFindings:e.dead.count+e.isolated.count+e.realCycleCount,heuristicFindings:e.similarCount+e.duplicateBodies.count+e.twinDrift.count+e.reactComponentDuplicates.count+e.reactHookCandidates.count+e.reactLargeComponentPressure.count+e.vueComponentDuplicates.count+e.vueComposableCandidates.count+e.vueLargeViewPressure.count+e.extractCount+e.wrappers.count+e.passthroughs.count+e.stale.count+e.drift.count,userSuppressed:e.suppressions?.total??0}}}function _e(e){let r=e.gitEvidence?.fileStats;return r?e.complexity.top.map(t=>{let i=t.file?r[t.file]?.changes??0:0;return{...t,changes:i,weighted:g(t.score*Math.log2(1+i))}}).sort((t,i)=>i.weighted-t.weighted):null}function ze(e){let r=e.gitEvidence?.fileStats;if(!r)return null;let t={dead:e.dead.files??[],isolated:e.isolated.files??[],twinDrift:e.twinDrift.files??[],wrappers:e.wrappers.files??[],passthroughs:e.passthroughs.files??[],stale:e.stale.files??[],reactComponents:e.reactComponentDuplicates.files??[],reactHooks:e.reactHookCandidates.files??[],reactLargeComponents:e.reactLargeComponentPressure.files??[],vueComponents:e.vueComponentDuplicates.files??[],vueComposables:e.vueComposableCandidates.files??[],vueLargeViews:e.vueLargeViewPressure.files??[]},i=new Set(Object.values(t).flat()),n=0,o=0,c=0;for(let[C,d]of Object.entries(r))i.has(C)?n+=d.fixChanges:(o+=d.fixChanges,c+=1);let s=i.size>0?g(n/i.size):0,l=c>0?g(o/c):0,h={};for(let[C,d]of Object.entries(t)){let b=new Set(d);if(b.size===0)continue;let S=0;for(let D of b)S+=r[D]?.fixChanges??0;let y=g(S/b.size);h[C]={flaggedFiles:b.size,fixDensity:y,lift:l>0?g(y/l):null}}return{flaggedFiles:i.size,flaggedFixDensity:s,baselineFixDensity:l,ratio:i.size>0&&l>0?g(s/l):null,byCategory:h,validationBasis:{method:"subject-regex",commitsScanned:e.gitEvidence?.commitsScanned??0}}}function g(e){return Math.round(e*100)/100}function he(e){return Number.isInteger(e)?String(e):e.toFixed(2).replace(/0+$/,"").replace(/\.$/,"")}function L(e,r="existing shared infrastructure discount"){let t=f(e);return Math.abs(t-e.count)<.01?"":` (${he(t)} score-weighted after ${r})`}function w(e,r){let t=f(e),i=`${e.count} ${r}`;return Math.abs(t-e.count)<.01?i:`${i} (${he(t)} score-weighted)`}function Ne(e){let r=[];if(e.dead.count>0&&r.push({category:"Dead code",evidence:"graph-fact",description:`${e.dead.count} indexed symbols with no visible repository references \u2014 review runtime/framework roots and the capability disclosure, then verify any deletion with cleanup-plan --verify`,effort:"low",impact:"high",count:e.dead.count,locRecoverable:e.dead.loc}),e.isolated.count>0&&r.push({category:"Isolated symbols",evidence:"graph-fact",description:`${e.isolated.count} symbols completely disconnected from the codebase graph`,effort:"low",impact:"medium",count:e.isolated.count,locRecoverable:e.isolated.loc}),e.realCycleCount>0&&r.push({category:"Circular dependencies",evidence:"graph-fact",description:`${e.realCycleCount} indexed dependency cycle(s) \u2014 inspect ownership and runtime order before choosing whether or how to break them`,effort:"medium",impact:"high",count:e.realCycleCount,locRecoverable:0}),e.similarCount>0&&r.push({category:"Similar functions",evidence:"heuristic",description:`${e.similarCount} pairs share disclosed call or source-token evidence beyond imports \u2014 review domain identity before considering consolidation`,effort:"medium",impact:"medium",count:e.similarCount,locRecoverable:0}),e.duplicateBodies.count>0&&r.push({category:"Duplicate function bodies",evidence:"heuristic",description:`${e.duplicateBodies.count} exact small-body group(s) across files \u2014 consolidate only when the domain concept matches`,effort:"low",impact:"medium",count:e.duplicateBodies.count,locRecoverable:e.duplicateBodies.loc}),e.twinDrift.count>0&&r.push({category:"Drifted twin implementations",evidence:"heuristic",description:`${e.twinDrift.count} same-name (or near-name) function group(s) across files with diverged or identical bodies \u2014 determine whether they represent the same concept before acting`,effort:"medium",impact:"medium",count:e.twinDrift.count,locRecoverable:0}),e.reactComponentDuplicates.count>0&&r.push({category:"Duplicated React components",evidence:"heuristic",description:`${e.reactComponentDuplicates.count} React component pair(s) share JSX structure \u2014 review whether local product intent justifies reuse`,effort:"medium",impact:"medium",count:e.reactComponentDuplicates.count,locRecoverable:e.reactComponentDuplicates.loc}),e.reactHookCandidates.count>0&&r.push({category:"Duplicated React hook behavior",evidence:"heuristic",description:`${e.reactHookCandidates.count} React component pair(s) share state/effect/request behavior${L(e.reactHookCandidates)} \u2014 review whether a common hook would preserve ownership and lifecycle semantics`,effort:"medium",impact:"medium",count:e.reactHookCandidates.count,locRecoverable:e.reactHookCandidates.loc}),e.reactLargeComponentPressure.count>0&&r.push({category:"Large React components",evidence:"heuristic",description:`${e.reactLargeComponentPressure.count} React component(s) concentrate JSX/behavior pressure \u2014 split by reason to change`,effort:"medium",impact:"medium",count:e.reactLargeComponentPressure.count,locRecoverable:0}),e.vueComponentDuplicates.count>0&&r.push({category:"Duplicated Vue components",evidence:"heuristic",description:`${e.vueComponentDuplicates.count} Vue component pair(s) share template structure \u2014 review whether local product intent justifies reuse`,effort:"medium",impact:"medium",count:e.vueComponentDuplicates.count,locRecoverable:e.vueComponentDuplicates.loc}),e.vueComposableCandidates.count>0&&r.push({category:"Duplicated Vue behavior",evidence:"heuristic",description:`${e.vueComposableCandidates.count} Vue component pair(s) share state/effect/request behavior${L(e.vueComposableCandidates)} \u2014 review whether a common composable would preserve ownership and lifecycle semantics`,effort:"medium",impact:"medium",count:e.vueComposableCandidates.count,locRecoverable:e.vueComposableCandidates.loc}),e.vueLargeViewPressure.count>0&&r.push({category:"Large Vue views",evidence:"heuristic",description:`${e.vueLargeViewPressure.count} Vue file(s) concentrate template/script/style pressure \u2014 split by reason to change`,effort:"medium",impact:"medium",count:e.vueLargeViewPressure.count,locRecoverable:0}),e.extractCount>0&&r.push({category:"Extraction candidates",evidence:"heuristic",description:`${e.extractCount} large functions with isolated callee clusters \u2014 review same-file or feature-local extraction seams`,effort:"medium",impact:"medium",count:e.extractCount,locRecoverable:0}),e.wrappers.count>0&&r.push({category:"Wrapper functions",evidence:"heuristic",description:`${e.wrappers.count} single-consumer symbols${L(e.wrappers,"boundary-evidence discount")} \u2014 inspect whether each is indirection or an intentional API, framework, or ownership boundary`,effort:"low",impact:"low",count:e.wrappers.count,locRecoverable:e.wrappers.loc}),e.passthroughs.count>0&&r.push({category:"Passthrough functions",evidence:"heuristic",description:`${e.passthroughs.count} functions that literally forward to one callee \u2014 inspect whether each is unnecessary indirection or an intentional boundary`,effort:"low",impact:"low",count:e.passthroughs.count,locRecoverable:e.passthroughs.loc}),e.stale.count>0){let n=[];e.stale.unused>0&&n.push(`${e.stale.unused} unused`),e.stale.singleUse>0&&n.push(`${e.stale.singleUse} single-consumer (not in types file)`),r.push({category:"Stale abstractions",evidence:"heuristic",description:`${n.join(", ")} \u2014 review public, runtime-registration, and ownership evidence before removing, moving, or inlining`,effort:"low",impact:"medium",count:e.stale.count,locRecoverable:e.stale.loc})}if(e.drift.count>0){let n=[];e.drift.unusedImports>0&&n.push(`${e.drift.unusedImports} unused imports`),e.drift.architectureViolations>0&&n.push(`${e.drift.architectureViolations} declared architecture violations`),r.push({category:"Structural drift",evidence:"heuristic",description:`${n.join(", ")} \u2014 repair direct dependency-rule breaks; inspect boundary signals with \`drift --architecture\``,effort:e.drift.architectureViolations>0?"medium":"low",impact:e.drift.architectureViolations>0?"medium":"low",count:e.drift.count,locRecoverable:0})}if(e.coverageContracts.count>0&&r.push({category:"Coverage contract drift",evidence:"graph-fact",description:`${e.coverageContracts.count} configured coverage contract(s) drifted from their ground-truth source (enumeration rot) \u2014 run \`scip-query diff-gate\` or \`scip-query health --json\` for the missing/extra keys`,effort:"low",impact:"medium",count:e.coverageContracts.count,locRecoverable:0}),e.gitEvidence&&e.gitEvidence.hiddenCoupling.pairCount>0){let n=e.gitEvidence.hiddenCoupling.top[0];r.push({category:"Hidden coupling",evidence:"change-graph",description:`${e.gitEvidence.hiddenCoupling.pairCount} file pair(s) co-change without a structural link`+L({count:e.gitEvidence.hiddenCoupling.pairCount,scoreCount:e.gitEvidence.hiddenCoupling.scoreCount},"broad/stale-history discount")+(n?` (e.g. ${n.fileA} \u2194 ${n.fileB})`:"")+" \u2014 inspect whether a shared concept, generated artifact, or coordinated contract explains the history",effort:"medium",impact:"high",count:e.gitEvidence.hiddenCoupling.pairCount,locRecoverable:0})}let t={high:3,medium:2,low:1},i={low:3,medium:2,high:1};return r.sort((n,o)=>{let c=t[n.impact]*i[n.effort];return t[o.impact]*i[o.effort]-c}),r}var pe={"dead-code":"risk",isolated:"risk",cycles:"risk",complexity:"risk","hidden-coupling":"risk","cycles-pressure":"risk","complexity-pressure":"risk","hidden-coupling-pressure":"risk",similar:"hygiene","duplicate-bodies":"hygiene","twin-drift":"hygiene","react-component-duplicates":"hygiene","react-hook-candidates":"hygiene","react-large-component-pressure":"hygiene","vue-component-duplicates":"hygiene","vue-composable-candidates":"hygiene","vue-large-view-pressure":"hygiene",extract:"hygiene",wrappers:"hygiene",passthroughs:"hygiene","stale-abstractions":"hygiene",drift:"hygiene","similar-pressure":"hygiene","duplicate-bodies-pressure":"hygiene","twin-drift-pressure":"hygiene","react-component-duplicates-pressure":"hygiene","react-hook-candidates-pressure":"hygiene","react-large-component-pressure-pressure":"hygiene","vue-component-duplicates-pressure":"hygiene","vue-composable-candidates-pressure":"hygiene","vue-large-view-pressure-pressure":"hygiene","extract-pressure":"hygiene","wrappers-pressure":"hygiene","passthroughs-pressure":"hygiene","stale-abstractions-pressure":"hygiene","drift-pressure":"hygiene"};function me(e,r){let t=e.filter(i=>i.kind===r).reduce((i,n)=>i+n.points,0);return Math.max(0,Math.min(100,100-t))}function Ue(e){let r=Math.max(e.statsResult.documents,1),t=Math.max(e.statsResult.symbols,1),i=[],n=[],o=(p,H,v)=>{H>0&&i.push({axis:p,points:H,detail:v,kind:pe[p]??"hygiene"})},c=(p,H,v,Ae,Be,Te,Fe)=>{let x=Math.max(Ae,1);if(v<=x)return;let P=v/x,k=Math.min(Be,Math.ceil(Math.log2(P)*Te));if(k<=0)return;let Oe=pe[p]??"hygiene";n.push({axis:p,category:H,kind:Oe,count:v,threshold:g(x),ratio:g(P),extraPenalty:k}),o(p,k,`${v} ${Fe} exceed pressure threshold ${g(x)} (${g(P)}x)`)},s=e.dead.count/t;o("dead-code",Math.min(20,Math.round(s*200)),`${e.dead.count} dead symbols (${e.dead.loc} LOC deletable)`);let l=e.isolated.count/t;o("isolated",Math.min(10,Math.round(l*200)),`${e.isolated.count} isolated symbols (${e.isolated.loc} LOC deletable)`),o("cycles",Math.min(15,e.realCycleCount*5),`${e.realCycleCount} real dependency cycle(s)`);let h=e.similarCount/t*1e3;o("similar",Math.min(10,Math.round(h)),`${e.similarCount} similar function pair(s)`);let C=e.duplicateBodies.count/t*1e3;o("duplicate-bodies",Math.min(10,Math.round(C*2)),`${e.duplicateBodies.count} exact duplicate small-body group(s) (${e.duplicateBodies.loc} duplicate LOC)`);let d=e.twinDrift.count/t*1e3;o("twin-drift",Math.min(10,Math.round(d*2)),`${e.twinDrift.count} drifted twin implementation group(s) (same or near-same name, diverged or identical bodies)`);let b=e.reactComponentDuplicates.count/r*1e3;o("react-component-duplicates",Math.min(10,Math.round(b)),`${e.reactComponentDuplicates.count} duplicated React component pair(s)`);let S=f(e.reactHookCandidates),y=S/r*1e3;o("react-hook-candidates",Math.min(10,Math.round(y)),w(e.reactHookCandidates,"duplicated React behavior pair(s)"));let D=e.reactLargeComponentPressure.count/r*1e3;o("react-large-component-pressure",Math.min(5,Math.round(D/2)),`${e.reactLargeComponentPressure.count} large React component pressure file(s)`);let Pe=e.vueComponentDuplicates.count/r*1e3;o("vue-component-duplicates",Math.min(10,Math.round(Pe)),`${e.vueComponentDuplicates.count} duplicated Vue component pair(s)`);let $=f(e.vueComposableCandidates),ke=$/r*1e3;o("vue-composable-candidates",Math.min(10,Math.round(ke)),w(e.vueComposableCandidates,"duplicated Vue behavior pair(s)"));let Ee=e.vueLargeViewPressure.count/r*1e3;o("vue-large-view-pressure",Math.min(5,Math.round(Ee/2)),`${e.vueLargeViewPressure.count} large Vue view pressure file(s)`);let I=f(e.wrappers);o("wrappers",Math.min(3,I),w(e.wrappers,"wrapper candidate(s)"));let V=f(e.passthroughs);o("passthroughs",Math.min(3,V),w(e.passthroughs,"passthrough candidate(s)")),o("stale-abstractions",Math.min(8,e.stale.unused),`${e.stale.unused} unused stale abstraction(s); ${e.stale.singleUse} single-consumer signal(s)`);let Me=e.drift.direct/r;if(o("drift",Math.min(5,Math.round(Me*50)),`${e.drift.direct} direct drift finding(s); ${e.drift.signal} signal drift finding(s)`),o("complexity",Math.min(5,e.complexity.extremeCount*2),`${e.complexity.extremeCount} extreme complexity hotspot(s)`),e.gitEvidence){let p=e.gitEvidence.hiddenCoupling.scoreCount;o("hidden-coupling",Math.min(5,Math.ceil(p/10)),w({count:e.gitEvidence.hiddenCoupling.pairCount,scoreCount:p},"co-changing pair(s) without a structural link"))}if(c("cycles-pressure","Circular dependencies",e.realCycleCount,3,10,3,"cycle(s)"),c("complexity-pressure","Extreme complexity",e.complexity.extremeCount,3,5,2,"extreme complexity hotspot(s)"),e.gitEvidence){let p=e.gitEvidence.hiddenCoupling.scoreCount;c("hidden-coupling-pressure","Hidden coupling",p,50,10,4,"score-weighted co-changing pair(s)")}return c("similar-pressure","Similar functions",e.similarCount,Math.max(50,t*.01),8,4,"similar function pair(s)"),c("duplicate-bodies-pressure","Duplicate function bodies",e.duplicateBodies.count,Math.max(20,t*.005),8,4,"exact duplicate small-body group(s)"),c("twin-drift-pressure","Drifted twin implementations",e.twinDrift.count,Math.max(20,t*.005),8,4,"drifted twin implementation group(s)"),c("react-component-duplicates-pressure","Duplicated React components",e.reactComponentDuplicates.count,Math.max(10,r*.01),8,4,"duplicated React component pair(s)"),c("react-hook-candidates-pressure","Duplicated React hook behavior",S,Math.max(10,r*.01),8,4,"duplicated React behavior pair(s)"),c("react-large-component-pressure-pressure","Large React components",e.reactLargeComponentPressure.count,Math.max(10,r*.01),4,2,"large React component pressure file(s)"),c("vue-component-duplicates-pressure","Duplicated Vue components",e.vueComponentDuplicates.count,Math.max(10,r*.01),8,4,"duplicated Vue component pair(s)"),c("vue-composable-candidates-pressure","Duplicated Vue behavior",$,Math.max(10,r*.01),8,4,"duplicated Vue behavior pair(s)"),c("vue-large-view-pressure-pressure","Large Vue views",e.vueLargeViewPressure.count,Math.max(10,r*.01),4,2,"large Vue view pressure file(s)"),c("extract-pressure","Extraction candidates",e.extractCount,Math.max(50,t*.01),4,2,"extraction candidate(s)"),c("wrappers-pressure","Wrapper functions",I,50,4,2,"wrapper candidate(s)"),c("passthroughs-pressure","Passthrough functions",V,50,4,2,"passthrough candidate(s)"),c("stale-abstractions-pressure","Single-consumer stale abstraction signals",e.stale.singleUse,Math.max(50,t*.02),4,2,"single-consumer stale abstraction signal(s)"),c("drift-pressure","Structural drift signals",e.drift.signal,Math.max(10,r*.1),4,2,"signal drift finding(s)"),{breakdown:i,pressure:n}}import{getHeapStatistics as je}from"v8";var Ge=64*1024*1024;function T(){let e=globalThis.gc;if(!e)return;let r=je();r.heap_size_limit-r.used_heap_size<Ge||e()}var We=50,qe=25e3,Ke=2500,ge=2500,fe=50,Ye=10,Xe=["overview","dead","isolated","cycles","similar","duplicate-bodies","twin-drift","react-component-duplicates","react-hook-candidates","react-large-component-pressure","vue-component-duplicates","vue-composable-candidates","vue-large-view-pressure","extract-candidates","wrapper-candidates","passthrough-candidates","stale-abstractions","drift","complexity-hotspots","git-evidence","suppressions","coverage-contracts"],ve={overview:(e,r,t,i)=>({phase:"overview",statsResult:i,warnings:t.warnings}),dead:(e,r,t)=>({phase:"dead",dead:Ze(e,r,t)}),isolated:(e,r,t)=>({phase:"isolated",isolated:et(e,r,t)}),cycles:(e,r,t)=>({phase:"cycles",realCycleCount:tt(e,r,t)}),similar:(e,r,t)=>({phase:"similar",similarCount:rt(e,r,t)}),"duplicate-bodies":(e,r,t)=>({phase:"duplicate-bodies",duplicateBodies:nt(e,r,t)}),"twin-drift":(e,r,t)=>({phase:"twin-drift",twinDrift:ot(e,r,t)}),"react-component-duplicates":(e,r,t)=>({phase:"react-component-duplicates",reactComponentDuplicates:ct(e,r,t)}),"react-hook-candidates":(e,r,t)=>({phase:"react-hook-candidates",reactHookCandidates:st(e,r,t)}),"react-large-component-pressure":(e,r,t)=>({phase:"react-large-component-pressure",reactLargeComponentPressure:at(e,r,t)}),"vue-component-duplicates":(e,r,t)=>({phase:"vue-component-duplicates",vueComponentDuplicates:ut(e,r,t)}),"vue-composable-candidates":(e,r,t)=>({phase:"vue-composable-candidates",vueComposableCandidates:dt(e,r,t)}),"vue-large-view-pressure":(e,r,t)=>({phase:"vue-large-view-pressure",vueLargeViewPressure:lt(e,r,t)}),"extract-candidates":(e,r,t)=>({phase:"extract-candidates",extractCount:it(e,r,t)}),"wrapper-candidates":(e,r,t)=>({phase:"wrapper-candidates",wrappers:pt(e,r,t)}),"passthrough-candidates":(e,r,t)=>({phase:"passthrough-candidates",passthroughs:mt(e,r,t)}),"stale-abstractions":(e,r,t)=>({phase:"stale-abstractions",stale:ht(e,r,t)}),drift:(e,r,t)=>({phase:"drift",drift:bt(e,r,t)}),"complexity-hotspots":(e,r,t)=>({phase:"complexity-hotspots",complexity:vt(e,r,t)}),"git-evidence":(e,r,t)=>({phase:"git-evidence",gitEvidence:gt(e,t)}),suppressions:(e,r,t)=>({phase:"suppressions",suppressions:ft(e,t)}),"coverage-contracts":(e,r,t)=>({phase:"coverage-contracts",coverageContracts:Ct(e,t)})};function hr(e,r={}){return Se(e,r.full!==!1,(t,i)=>{let n=Qe(e,r.scope,t,i),o=B(n);return o.detectorPrecision=de(le(e),Date.now()),o})}function gr(e,r,t={}){return Je(e,[r],t)[0]}function Je(e,r,t={}){return Se(e,t.full!==!1,(i,n)=>{let o={...n,releaseCachesBetweenPhases:!1};return r.map(c=>ve[c](e,t.scope,o,i))})}function Se(e,r,t){let i=ee(e),n=St(i,r);try{return t(i,n)}finally{A(e,{semanticProvider:!0}),T()}}function fr(e){return B(we(e))}function we(e){let r=u(e,"overview");return{statsResult:r.statsResult,warnings:r.warnings,dead:u(e,"dead").dead,isolated:u(e,"isolated").isolated,realCycleCount:u(e,"cycles").realCycleCount,similarCount:u(e,"similar").similarCount,duplicateBodies:u(e,"duplicate-bodies").duplicateBodies,twinDrift:u(e,"twin-drift").twinDrift,reactComponentDuplicates:u(e,"react-component-duplicates").reactComponentDuplicates,reactHookCandidates:u(e,"react-hook-candidates").reactHookCandidates,reactLargeComponentPressure:u(e,"react-large-component-pressure").reactLargeComponentPressure,vueComponentDuplicates:u(e,"vue-component-duplicates").vueComponentDuplicates,vueComposableCandidates:u(e,"vue-composable-candidates").vueComposableCandidates,vueLargeViewPressure:u(e,"vue-large-view-pressure").vueLargeViewPressure,extractCount:u(e,"extract-candidates").extractCount,wrappers:u(e,"wrapper-candidates").wrappers,passthroughs:u(e,"passthrough-candidates").passthroughs,stale:u(e,"stale-abstractions").stale,drift:u(e,"drift").drift,complexity:u(e,"complexity-hotspots").complexity,gitEvidence:Ce(e,"git-evidence")?.gitEvidence??null,suppressions:Ce(e,"suppressions")?.suppressions??null,coverageContracts:u(e,"coverage-contracts").coverageContracts}}function Ce(e,r){return e.find(t=>t.phase===r)}function u(e,r){let t=e.find(i=>i.phase===r);if(!t)throw new Error(`Missing health phase result: ${r}`);return t}function Qe(e,r,t,i){return we(Xe.map(n=>ve[n](e,r,i,t)))}function Ze(e,r,t){return a(e,t,"dead",()=>{let i=q(e,{scope:r,...m.dead,scanLimit:t.candidateScanLimit,semantic:t.semantic});return R(Ht(e,i.symbols))})}function et(e,r,t){return a(e,t,"isolated",()=>{let i=X(e,{scope:r,...m.isolated,scanLimit:t.candidateScanLimit,semantic:t.semantic});return R(xt(e,i))})}function tt(e,r,t){return a(e,t,"cycles",()=>W(e,{scope:r}).filter(n=>n.kind==="real").length)}function rt(e,r,t){let i=a(e,t,"similar",()=>Q(e,{scope:r,...m.similar,scanLimit:t.candidateScanLimit,semantic:t.semantic}));return Math.min(i,t.candidateResultLimit)}function it(e,r,t){return a(e,t,"extract-candidates",()=>Y(e,{scope:r,...m.extract,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit,semantic:t.semantic}).length)}function nt(e,r,t){return a(e,t,"duplicate-bodies",()=>{let i=U(e,{scope:r,...m.duplicateBodies,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit}),n=new Set,o=0;for(let c of i)for(let s of c.functions.slice(1))n.add(s.file),o+=s.loc;return{count:i.length,loc:o,files:[...n]}})}function ot(e,r,t){return a(e,t,"twin-drift",()=>{let i=j(e,{scope:r,...m.twinDrift,scanLimit:t.candidateScanLimit}).filter(c=>c.relationship==="divergent"||c.relationship==="identical"),n=new Set,o=0;for(let c of i)for(let s of c.members)n.add(s.file),o+=s.loc;return{count:i.length,loc:o,files:[...n].sort()}})}function ct(e,r,t){return a(e,t,"react-component-duplicates",()=>{let i=re(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return F(i)})}function st(e,r,t){return a(e,t,"react-hook-candidates",()=>{let i=ie(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return He(i,Rt)})}function at(e,r,t){return a(e,t,"react-large-component-pressure",()=>{let i=ne(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return Lt(i)})}function ut(e,r,t){return a(e,t,"vue-component-duplicates",()=>{let i=oe(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return F(i)})}function dt(e,r,t){return a(e,t,"vue-composable-candidates",()=>{let i=ce(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return He(i,Dt)})}function lt(e,r,t){return a(e,t,"vue-large-view-pressure",()=>{let i=se(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return R(i)})}function pt(e,r,t){return a(e,t,"wrapper-candidates",()=>{let i=te(e,{scope:r,...m.wrappers,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit,semantic:t.semantic});return ye(i,Pt)})}function mt(e,r,t){return a(e,t,"passthrough-candidates",()=>{let i=J(e,{scope:r,...m.passthroughs,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit,semantic:t.semantic});return ye(i,kt)})}function ht(e,r,t){return a(e,t,"stale-abstractions",()=>{let i=Z(e,{scope:r,...m.stale,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit,semantic:t.semantic}),n=i.filter(o=>o.consumers===0).length;return{count:i.length,loc:i.reduce((o,c)=>o+c.loc,0),files:[...new Set(i.map(o=>o.file))],unused:n,singleUse:i.length-n}})}function gt(e,r){return a(e,r,"git-evidence",()=>{let t=z(e,{historyMode:r.gitHistoryMode}),i=t.fileChurn();if(!i)return null;let n=t.commitHistory(),o=N(e,void 0,{limit:r.candidateResultLimit,historyMode:r.gitHistoryMode}),c={};for(let[s,l]of i)c[s]={changes:l.changes,fixChanges:l.fixChanges};return{amplification:t.changeAmplification(),hiddenCoupling:{pairCount:o.findings.length,scoreCount:O(o.findings.reduce((s,l)=>s+be(l),0)),top:o.findings.slice(0,5).map(s=>({fileA:s.fileA,fileB:s.fileB,together:s.together,confidence:s.confidence,focusedTogether:s.focusedTogether,broadTogether:s.broadTogether,broadCommitRatio:s.broadCommitRatio,lastTogetherAt:s.lastTogetherAt,recentTogether:s.recentTogether,commitScope:s.commitScope,recency:s.recency,scoreWeight:be(s),subjectContext:s.subjectContext}))},fileStats:c,commitsScanned:n?.commits.length??0}})}function ft(e,r){return a(e,r,"suppressions",()=>{let t=ae(e);return{total:t.total,byCategory:{...t.byCategory}}})}function Ct(e,r){return a(e,r,"coverage-contracts",()=>{let t=e.config.coverageContracts??[],n=G(e,t).filter(o=>o.status!=="ok");return{count:n.length,loc:0,files:[...new Set(n.map(o=>o.file))].sort()}})}function bt(e,r,t){return a(e,t,"drift",()=>{let i=K(e,{scope:r,...m.drift,includePatternDeviations:!1,limit:Number.POSITIVE_INFINITY,semantic:t.semantic}),n=i.results.filter(s=>s.kind!=="pattern-deviation"),o=n.filter(s=>s.actionTier==="direct").length,c=n.length-o;return{count:n.length,unusedImports:i.unusedImports,architectureViolations:i.architectureViolations,layerViolations:i.layerViolations,direct:o,signal:c}})}function vt(e,r,t){return a(e,t,"complexity-hotspots",()=>{let i=ue(e,{scope:r,minLoc:10,limit:t.complexityResultLimit,scanLimit:t.candidateScanLimit,semantic:t.semantic});return{top:i.slice(0,5).map(n=>({symbol:n.shortName,score:n.score,file:n.file})),extremeCount:i.filter(n=>n.score>We).length}})}function St(e,r){let t=e.symbols>=qe||e.documents>=Ke,i=r?Number.POSITIVE_INFINITY:fe,n=r?Number.POSITIVE_INFINITY:Ye;return!t||r?{candidateScanLimit:void 0,candidateResultLimit:i,complexityResultLimit:n,semantic:!0,gitHistoryMode:r?"full":"bounded",releaseCachesBetweenPhases:!0,warnings:r&&t?["Large index detected; running health without candidate scan or result caps because full mode is enabled."]:[]}:{candidateScanLimit:ge,candidateResultLimit:i,complexityResultLimit:n,semantic:!1,gitHistoryMode:"bounded",releaseCachesBetweenPhases:!0,warnings:[`Large index detected; candidate-style health checks scanned their highest-priority ${ge} symbols and reported their top ${fe} findings. Enable full mode for unbounded candidate counts.`]}}function wt(e,r){r.releaseCachesBetweenPhases&&(A(e),T())}function a(e,r,t,i){yt(t);try{return i()}finally{wt(e,r)}}function yt(e){process.env.SCIP_QUERY_HEALTH_TRACE==="1"&&console.error(`[health] ${e}`)}function Ht(e,r){return r.filter(t=>!E(e,t.relativePath)&&!M(e,t.symbol,t.relativePath)&&t.kind==="dead-code")}function xt(e,r){return r.filter(t=>!E(e,t.relativePath)&&!M(e,t.symbol,t.relativePath))}function R(e){let r=new Set;for(let t of e){let i=t.relativePath??t.file;i&&r.add(i)}return{count:e.length,loc:e.reduce((t,i)=>t+i.loc,0),files:[...r]}}function ye(e,r){return{...R(e),scoreCount:O(e.reduce((i,n)=>i+r(n),0))}}function Lt(e){let r=new Map;for(let t of e)r.set(t.file,Math.max(r.get(t.file)??0,t.loc));return{count:r.size,loc:[...r.values()].reduce((t,i)=>t+i,0),files:[...r.keys()]}}function F(e){let r=new Map;for(let t of e)r.set(t.fileA,Math.max(r.get(t.fileA)??0,t.locA)),r.set(t.fileB,Math.max(r.get(t.fileB)??0,t.locB));return{count:e.length,loc:[...r.values()].reduce((t,i)=>t+i,0),files:[...r.keys()]}}function He(e,r){return{...F(e),scoreCount:O(e.reduce((i,n)=>i+r(n),0))}}function Rt(e){let r=e.sharedHooks.length>0,t=xe({namedState:e.sharedState,requests:e.sharedRequests,lifecycle:e.sharedEffects,functions:e.sharedHandlers});return r&&t<=2?0:r?.5:Le(e.sharedState,e.sharedHandlers,e.sharedHandlerVerbs)?.25:t>=2?1:.5}function Dt(e){let r=e.sharedComposables.length+e.sharedStores.length>0,t=xe({namedState:e.sharedBindings,requests:e.sharedRequests,lifecycle:e.sharedLifecycle,functions:e.sharedFunctions});return r&&t<=2?0:r?.5:Le(e.sharedBindings,e.sharedFunctions,e.sharedFunctionVerbs)?.25:t>=2?1:.5}function xe(e){return e.requests.length*2+e.lifecycle.length+e.namedState.filter(r=>!De.has(Re(r))).length+Math.min(e.functions.length,3)}function Le(e,r,t){let i=[...e,...r,...t].map(Re);return i.length>0&&i.every(n=>De.has(n))}function Re(e){return e.replace(/^handle/,"").replace(/^is/,"").replace(/^has/,"").toLowerCase()}function Pt(e){return e.actionTier==="signal"?.25:1}function kt(e){return e.actionTier==="signal"?.25:1}function be(e){return e.commitScope==="broad-sweep"?e.recency==="recent"?.25:0:e.commitScope==="mixed"?e.recency==="recent"?.5:.25:e.recency==="recent"?1:.5}function O(e){return Math.round(e*100)/100}var De=new Set(["add","apply","cancel","change","clear","close","create","delete","draft","edit","error","filter","form","load","loading","name","open","refresh","remove","reset","save","saving","search","select","selected","submit","toggle","update","value"]);export{Xe as a,hr as b,gr as c,Je as d,fr as e};
|
|
2
|
-
//# sourceMappingURL=chunk-QXK6UUSM.js.map
|