scip-query 0.19.6 → 0.19.10
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 +116 -0
- package/README.md +156 -44
- package/dist/augment-vue-worker.js +1 -1
- package/dist/chunk-26QA6FAI.js +8 -0
- package/dist/{chunk-J7VT2CRB.js → chunk-2HPVVXM5.js} +2 -2
- package/dist/chunk-2KAZEZ6M.js +2 -0
- package/dist/chunk-32LVLCLN.js +40 -0
- package/dist/{chunk-2CVXCGL4.js → chunk-3CLX5EOX.js} +2 -2
- package/dist/{chunk-5OC3HWP5.js → chunk-3G66UZBH.js} +2 -2
- package/dist/{chunk-S2GP3CU3.js → chunk-3ORVDL3H.js} +2 -2
- package/dist/chunk-46XGSFNI.js +2 -0
- package/dist/chunk-4MAK2HOY.js +6 -0
- package/dist/chunk-4TURLRL5.js +16 -0
- package/dist/chunk-4UQVNCQE.js +2 -0
- package/dist/chunk-55Q3WLZX.js +2 -0
- package/dist/{chunk-OQ2A4G2G.js → chunk-5E4WNAVD.js} +2 -2
- package/dist/{chunk-YGQN3XGZ.js → chunk-5I5G2QOX.js} +2 -2
- package/dist/chunk-6LDJQXAH.js +2 -0
- package/dist/{chunk-WXAAURU7.js → chunk-6O5TICIZ.js} +2 -2
- package/dist/{chunk-OBKDTVZ3.js → chunk-6SHPK5ZE.js} +2 -2
- package/dist/chunk-7BAVHKMJ.js +49 -0
- package/dist/chunk-7O5IKBTZ.js +16 -0
- package/dist/chunk-7PIO7NKH.js +60 -0
- package/dist/chunk-7S5E7KWT.js +2 -0
- package/dist/{chunk-GK3GRUJX.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-AQOFWNQJ.js +1 -0
- package/dist/{chunk-MGBJHRFB.js → chunk-AZJQQKDD.js} +2 -2
- package/dist/{chunk-IYAOX36F.js → chunk-B2PX5I6M.js} +2 -2
- package/dist/{chunk-EVOC5I5I.js → chunk-B7PBSLZN.js} +2 -2
- package/dist/{chunk-ZLJLE6LK.js → chunk-BBW6JFHN.js} +2 -2
- package/dist/{chunk-NBRUH7OE.js → chunk-BDCC2NPY.js} +2 -2
- package/dist/{chunk-DD5BOU5I.js → chunk-BNXCIFVY.js} +2 -2
- package/dist/{chunk-FHCTEANE.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-QBYYWGAT.js → chunk-CJST5ETY.js} +2 -2
- package/dist/chunk-DAFAHMNB.js +42 -0
- package/dist/chunk-DHEQMPLW.js +2 -0
- package/dist/{chunk-336DC5NJ.js → chunk-DQGFVPUV.js} +2 -2
- package/dist/chunk-DQLPXMH6.js +8 -0
- package/dist/chunk-EKZTZXHZ.js +117 -0
- package/dist/{chunk-KLVJABXA.js → chunk-EN3O7VJA.js} +2 -2
- package/dist/{chunk-U5CNPPTZ.js → chunk-EW2NTSFA.js} +2 -2
- package/dist/chunk-F3Z4OUDS.js +8 -0
- package/dist/chunk-FJH2NW7J.js +66 -0
- package/dist/{chunk-3OIKRYU5.js → chunk-FKSELJQF.js} +2 -2
- package/dist/chunk-FTFP6O3L.js +11 -0
- package/dist/chunk-FYLK2DEJ.js +2 -0
- package/dist/chunk-GH74ASD6.js +11 -0
- package/dist/{chunk-NQLSSVOB.js → chunk-GMXWZP2B.js} +2 -2
- package/dist/chunk-GOUBFH5O.js +3 -0
- package/dist/{chunk-RJHCPSZ7.js → chunk-HLF2TX6R.js} +2 -2
- package/dist/{chunk-PC44K7RF.js → chunk-HX4GQPZP.js} +2 -2
- package/dist/chunk-HX7M4BDI.js +30 -0
- package/dist/chunk-HZ72SESS.js +128 -0
- package/dist/{chunk-YTUD45PU.js → chunk-IB2N4FIY.js} +2 -2
- package/dist/chunk-ILMHV3KM.js +2 -0
- package/dist/chunk-IZYYAFN5.js +2 -0
- package/dist/{chunk-A43URCQ3.js → chunk-JAYYFEQY.js} +2 -2
- package/dist/{chunk-RWRLUZ6U.js → chunk-JDOEX4E6.js} +2 -2
- package/dist/chunk-JFGGXWQF.js +947 -0
- package/dist/chunk-JN4NMBEX.js +8 -0
- package/dist/{chunk-JELJLXEE.js → chunk-JVYA47YU.js} +2 -2
- package/dist/{chunk-F42A3AKG.js → chunk-JW56N3KI.js} +2 -2
- package/dist/{chunk-FQTPPXNA.js → chunk-JZ2OXNWB.js} +2 -2
- package/dist/chunk-KFZNKUNT.js +2 -0
- package/dist/chunk-KMKTIO2G.js +8 -0
- package/dist/chunk-L5GJNV2T.js +8 -0
- package/dist/{chunk-RBFFD4V2.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-MLGTCX56.js → chunk-MKCDWWGV.js} +2 -2
- package/dist/chunk-MNE7YG56.js +2 -0
- package/dist/{chunk-YWB2EBNB.js → chunk-MRXBEXSY.js} +2 -2
- package/dist/chunk-MV7OWDUX.js +2 -0
- package/dist/{chunk-2GSQR6YA.js → chunk-N5W4YZMK.js} +2 -2
- package/dist/chunk-NGEXCJJW.js +11 -0
- package/dist/{chunk-CYJM7CYF.js → chunk-NIW6JDC5.js} +2 -2
- package/dist/{chunk-YHXBD52M.js → chunk-O64IZ6UX.js} +2 -2
- package/dist/chunk-PBUQFCNB.js +16 -0
- package/dist/{chunk-UQK5CRUK.js → chunk-POAVPHH7.js} +2 -2
- package/dist/{chunk-TYQ76QHQ.js → chunk-PQCI4SQX.js} +2 -2
- package/dist/chunk-PXY7F6Y4.js +5 -0
- package/dist/chunk-RDO52JGY.js +2 -0
- package/dist/chunk-RJT3TUUZ.js +2 -0
- package/dist/{chunk-OHWZKLVA.js → chunk-RUJURYSV.js} +2 -2
- package/dist/{chunk-CSTYYXKC.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-QQWOFXNW.js → chunk-SRAFT254.js} +2 -2
- package/dist/{chunk-6XHTISLI.js → chunk-SXP2MBJH.js} +2 -2
- package/dist/chunk-T7YQSHPQ.js +3 -0
- package/dist/{chunk-2EZSOTSY.js → chunk-TFRAYKN6.js} +2 -2
- package/dist/{chunk-XVJ3V7LM.js → chunk-UJCOIXDY.js} +2 -2
- package/dist/{chunk-7LABSJSR.js → chunk-UJPRPGCO.js} +5 -5
- package/dist/chunk-W4ETQAXM.js +2 -0
- package/dist/chunk-WCCFZ7V7.js +113 -0
- package/dist/chunk-WUPW3UN3.js +3 -0
- package/dist/{chunk-VP542C25.js → chunk-WXZLAAWK.js} +2 -2
- package/dist/{chunk-LMFVTUW2.js → chunk-X54AGLVX.js} +2 -2
- package/dist/chunk-XKWKXZKW.js +20 -0
- package/dist/{chunk-OP3MTFJR.js → chunk-XSRF6Q77.js} +2 -2
- package/dist/chunk-Y2MVPNKY.js +5 -0
- package/dist/{chunk-6XFC7PQ5.js → chunk-YKUU5AIC.js} +2 -2
- package/dist/chunk-YLCJLTPL.js +2 -0
- package/dist/{chunk-47X75ZKH.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-ZK26BAQL.js +2 -0
- package/dist/{chunk-UUJBLG6J.js → chunk-ZTETIQ35.js} +2 -2
- package/dist/cli.js +3 -3
- package/dist/command-descriptors-4A4HWV4F.js +642 -0
- package/dist/{config-types-BWQ5xPGI.d.ts → config-types-jVM3D7MA.d.ts} +72 -2
- package/dist/{db-B0r1o7Vt.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-CFnlCiTz.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 +26 -25
- package/dist/reindex.d.ts +7 -3
- package/dist/reindex.js +34 -33
- package/dist/runtime.d.ts +5 -10
- 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-DCvnlZCu.d.ts → scip-cli-BnEwZRLJ.d.ts} +2 -2
- 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 +28 -5
- package/docs/CLI_JSON_OUTPUT.md +176 -3
- package/docs/COMMAND_REFERENCE.md +89 -87
- 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 +146 -0
- package/docs/TELEMETRY_RETENTION.md +16 -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/cli-output-page.schema.json +104 -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 +9 -8
- package/skills/_shared/SKILL.md +5 -3
- 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 +9 -8
- 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 +4 -4
- 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 +3 -3
- 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 +16 -11
- package/skills/scip-verify/references/calibrate-detectors.md +7 -7
- package/dist/chunk-24QNP7MN.js +0 -2
- package/dist/chunk-26X7KCJR.js +0 -5
- package/dist/chunk-273W2U4Y.js +0 -40
- package/dist/chunk-2OXVAGGT.js +0 -3
- package/dist/chunk-2ZOCHAL2.js +0 -8
- package/dist/chunk-35SQLYCQ.js +0 -2
- package/dist/chunk-4CGVLUDP.js +0 -18
- package/dist/chunk-4RI4BJGT.js +0 -8
- package/dist/chunk-52HQTTPB.js +0 -2
- package/dist/chunk-64MNV6AB.js +0 -8
- package/dist/chunk-7E3TH5ZN.js +0 -33
- package/dist/chunk-7Q6VYYCH.js +0 -2
- package/dist/chunk-A63U2W3P.js +0 -3
- package/dist/chunk-ADFSIJP2.js +0 -16
- package/dist/chunk-AOLE4DYM.js +0 -6
- package/dist/chunk-APMMR5Y2.js +0 -2
- package/dist/chunk-B5MHCHP3.js +0 -107
- package/dist/chunk-DGAGY7RJ.js +0 -60
- package/dist/chunk-DGMCFMPG.js +0 -11
- package/dist/chunk-E2ZXPB7J.js +0 -38
- package/dist/chunk-FKGN4A4E.js +0 -61
- package/dist/chunk-G4UQL4CP.js +0 -2
- package/dist/chunk-GA64UPMI.js +0 -6
- package/dist/chunk-HEBAY673.js +0 -2
- package/dist/chunk-HELS7KFF.js +0 -2
- package/dist/chunk-IPDCSB6N.js +0 -6
- package/dist/chunk-JERWGHQT.js +0 -16
- package/dist/chunk-JJJCO4QC.js +0 -945
- package/dist/chunk-JZNLMHWY.js +0 -56
- package/dist/chunk-K42M2KWT.js +0 -2
- package/dist/chunk-KP4KBDVF.js +0 -3
- package/dist/chunk-LRTP3DKL.js +0 -3
- package/dist/chunk-N3SE646F.js +0 -2
- package/dist/chunk-NN4ZIRPK.js +0 -8
- package/dist/chunk-P6HBYNBE.js +0 -5
- package/dist/chunk-QHKUY4FW.js +0 -2
- package/dist/chunk-QHRL4LKM.js +0 -2
- package/dist/chunk-SHKZ7OVJ.js +0 -35
- package/dist/chunk-TFUU5MQQ.js +0 -2
- package/dist/chunk-UXP636P5.js +0 -144
- package/dist/chunk-VEVBIAOJ.js +0 -16
- package/dist/chunk-VKRQDBW5.js +0 -9
- package/dist/chunk-VOQFGC2W.js +0 -67
- package/dist/chunk-WMXRRBII.js +0 -8
- package/dist/chunk-X3NLZHPA.js +0 -20
- package/dist/chunk-XF3KLXN3.js +0 -11
- package/dist/chunk-YCPASUCX.js +0 -2
- package/dist/chunk-YLVE3SXZ.js +0 -20
- package/dist/chunk-Z2LHPIOM.js +0 -2
- package/dist/chunk-Z5QQPJ3U.js +0 -30
- package/dist/chunk-ZTTISZ7J.js +0 -112
- package/dist/command-descriptors-SJDZ7QGR.js +0 -617
- package/dist/direct-navigation-HTKOZEOM.js +0 -3
|
@@ -6,7 +6,7 @@ commands:
|
|
|
6
6
|
when: "Anchor the current flow, consumers, reuse options, and change risks."
|
|
7
7
|
- template: "scip-query refs <symbol>"
|
|
8
8
|
when: "Complete or narrow the direct consumer set for a planned symbol change."
|
|
9
|
-
- template: "scip-query affected <symbol>
|
|
9
|
+
- template: "scip-query affected <symbol>"
|
|
10
10
|
when: "Measure transitive impact when the change is not consumer-local."
|
|
11
11
|
---
|
|
12
12
|
|
|
@@ -19,7 +19,7 @@ commands:
|
|
|
19
19
|
| --- | --- | --- | --- | --- |
|
|
20
20
|
| `scip-query plan-context <target>` | Pre-edit planning context for a symbol, file, or module | definitions and references; callers and callees; dataflow producers and consumers; backward and forward slices; affected symbols; change-surface risk; dependencies and reverse dependencies; module files and exports; external surface use; complexity; churn; co-change partners; active suppressions | `bounded` | Anchor the current flow, consumers, reuse options, and change risks. |
|
|
21
21
|
| `scip-query refs <symbol>` | Find all files referencing a symbol | referencing file paths; reference line numbers grouped by file | `bounded` | Complete or narrow the direct consumer set for a planned symbol change. |
|
|
22
|
-
| `scip-query affected <symbol
|
|
22
|
+
| `scip-query affected <symbol>` | Transitive closure of symbols that could break if this symbol changes | affected symbol identities, files, and traversal depths | `bounded` | Measure transitive impact when the change is not consumer-local. |
|
|
23
23
|
|
|
24
24
|
Use this shortlist first. Open [`../_shared/SKILL.md`](../_shared/SKILL.md) only when it is insufficient.
|
|
25
25
|
<!-- END GENERATED SKILL COMMANDS -->
|
|
@@ -45,7 +45,7 @@ Picking the mode matters: running the high-assurance certificate on routine work
|
|
|
45
45
|
|
|
46
46
|
## Scenario: plan a single non-trivial change (ordinary mode, the default)
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
Apply `_shared`'s freshness gate once before citing the first graph fact; let an active watcher handle refreshes and use manual reindex only as the documented fallback. Then run `scip-query plan-context <target>` — the single anchoring call for planning. Its composite return already includes definitions, references, callers, callees, dataflow producers/consumers, forward and backward slices, affected symbols, change-surface risk, dependencies and reverse dependencies, module exports, external surface use, complexity, churn, co-change partners, and active suppressions, so the job is to interpret this composite rather than rebuild a proof system on top of it.
|
|
49
49
|
|
|
50
50
|
Reach for a second command only when a section `plan-context` returned came back bounded (not complete) or the target wasn't indexed: `scip-query refs <symbol>` to enumerate consumers in full, `scip-query affected <symbol>` for the transitive blast radius when the change isn't consumer-local, `scip-query code <symbol>` to read the source behind a behavior claim before writing it into the plan.
|
|
51
51
|
|
|
@@ -4,15 +4,15 @@ Use before changing anything another process or person depends on: a callable, e
|
|
|
4
4
|
|
|
5
5
|
## Scenario: assess what breaks before editing a public surface
|
|
6
6
|
|
|
7
|
-
**Step 1 — identify the actual surface.** Run `scip-query surface <module-or-package>`, `scip-query outline <file>`, `scip-query trace <symbol-or-command>`, `scip-query code <symbol-or-command>`, and `scip-query hierarchy <symbol
|
|
7
|
+
**Step 1 — identify the actual surface.** Run `scip-query surface <module-or-package>`, `scip-query outline <file>`, `scip-query trace <symbol-or-command>`, `scip-query code <symbol-or-command>`, and `scip-query hierarchy <symbol>`. Done only when the real surface is named as one of: member, class, module, package, route, schema, command, or config field.
|
|
8
8
|
|
|
9
|
-
**Step 2 — find consumers.** Run `scip-query refs <symbol>`, `scip-query fan-in <symbol>`, `scip-query rdeps <file>`, `scip-query affected <symbol
|
|
9
|
+
**Step 2 — find consumers.** Run `scip-query refs <symbol>`, `scip-query fan-in <symbol>`, `scip-query rdeps <file>`, `scip-query affected <symbol>`, and `scip-query change-surface <file> --full`. Record direct consumers separately from transitive consumers. Done only when direct breakage and regression blast radius are both known.
|
|
10
10
|
|
|
11
|
-
**Step 3 — find hidden partners.** Run `scip-query co-change <file> --
|
|
11
|
+
**Step 3 — find hidden partners.** Run `scip-query co-change <file> --full` (files historically coupled without a dependency edge), `scip-query doc-drift --full` (docs describing the surface), `scip-query similar <symbol> --full`, and `scip-query similar-files <file> --full`. Docs, generated files, tests, and config count as part of the API when they describe or enforce the surface. Done only when docs, generated files, fixtures, sibling APIs, and hand-synchronized partners are accounted for or ruled out.
|
|
12
12
|
|
|
13
|
-
**Step 4 — choose the migration shape.** Pick one of: compatible extension, two-step migration, breaking coordinated change, or an adapter shim for external consumers/compatibility windows. Prefer backward-compatible migrations when consumers are broad or external. Reject speculative new parameters or empty wrappers using `scip-query unused-params --
|
|
13
|
+
**Step 4 — choose the migration shape.** Pick one of: compatible extension, two-step migration, breaking coordinated change, or an adapter shim for external consumers/compatibility windows. Prefer backward-compatible migrations when consumers are broad or external. Reject speculative new parameters or empty wrappers using `scip-query unused-params --full`, `scip-query wrapper-candidates --full`, and `scip-query passthrough-candidates --full`. Done only when the migration shape explains deploy order, rollback, and compatibility risk.
|
|
14
14
|
|
|
15
|
-
**Step 5 — write the plan and verify.** Plan template: Surface; a Consumer dispositions table (Consumer | Kind: direct/transitive/doc/config/test | Disposition: unchanged-safe/update/shim/defer); Required co-changes; Migration; Verification (targeted tests, `scip-query diff-impact
|
|
15
|
+
**Step 5 — write the plan and verify.** Plan template: Surface; a Consumer dispositions table (Consumer | Kind: direct/transitive/doc/config/test | Disposition: unchanged-safe/update/shim/defer); Required co-changes; Migration; Verification (targeted tests, `scip-query diff-impact`, `scip-verify`, `scip-query doc-drift --full` if docs changed, `scip-query config-validate` if config changed). Every consumer returned by refs/affected must appear as a row — a blank disposition means the analysis is unfinished. Non-indexed consumers (SQL, fixtures, dynamic strings, external callers) must be checked with `rg` and rowed the same way as indexed consumers.
|
|
16
16
|
|
|
17
17
|
After editing, run the routed checks from `_shared` and invoke `scip-verify`. The workflow is complete only when direct consumers, docs/config partners, and scip-verify have all been checked.
|
|
18
18
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
This governs running a program of work — planning, delegation, review, closure — across multiple steps, not how to write a single change plan (use the main SKILL.md's ordinary-mode scenario, or `references/high-assurance.md`, for that). Act like a skeptical principal engineer.
|
|
4
4
|
|
|
5
|
-
Key commands: `scip-query plan-context <target>` anchors each phase's step before delegating it; `scip-query diff-gate
|
|
5
|
+
Key commands: `scip-query plan-context <target>` anchors each phase's step before delegating it; `scip-query diff-gate` verifies a handoff before accepting it and before closing the program; `scip-query health` pre-registers or checks a program-level health benchmark.
|
|
6
6
|
|
|
7
7
|
## The three laws
|
|
8
8
|
|
|
@@ -24,7 +24,7 @@ Working agreement to include in the plan: ONE COMMIT PER STEP — bisectability
|
|
|
24
24
|
|
|
25
25
|
Delegate breadth, keep judgment: fan out mechanical/scoped work to subagents, but personally own anything requiring taste, cross-cutting context, or the final word on "is this real." Concurrent agents must get disjoint write scopes, named in their briefs; if a collision happens anyway, stop racing, apply-verify-commit atomically in one action, and re-sequence to a single writer.
|
|
26
26
|
|
|
27
|
-
Never accept a report at face value — reproduce its evidence. On every handoff, choose the minimal discriminating probe (the one command most likely to expose the report being wrong: a mutation input, a hand count, the benchmark number) and run it yourself; a report verified only by reading it is not verified. Loop until `scip-query diff-gate
|
|
27
|
+
Never accept a report at face value — reproduce its evidence. On every handoff, choose the minimal discriminating probe (the one command most likely to expose the report being wrong: a mutation input, a hand count, the benchmark number) and run it yourself; a report verified only by reading it is not verified. Loop until `scip-query diff-gate` is quiet: fix, re-run the discriminating probe, re-run the gate, and only then move on.
|
|
28
28
|
|
|
29
29
|
Verify your verifier: a gate check that cannot fail is no gate (e.g. a lint grep that only matches one linter's output, a diff-gate run on a clean tree, a test suite that skips the new path) — prove the check catches a planted failure once before trusting its green. After any "all green," ask what that check does NOT cover (eslint vs prettier; unit vs integration; clean-tree vacuity).
|
|
30
30
|
|
|
@@ -33,7 +33,7 @@ QUICK mode skips this and goes straight to tracing behavior, using the single ru
|
|
|
33
33
|
|
|
34
34
|
## Scenario: trace behavior
|
|
35
35
|
|
|
36
|
-
Run `scip-query plan-context`, `trace`, `call-graph`, `code`, `dataflow`, and `complexity` on the entry/hot symbol — `call-graph <entry-symbol>` returns callers/callees, `complexity <hot-symbol>` returns LOC, branch, complexity, callee, fan-in/out counts — then `scip-query change-surface <touched-file> --
|
|
36
|
+
Run `scip-query plan-context`, `trace`, `call-graph`, `code`, `dataflow`, and `complexity` on the entry/hot symbol — `call-graph <entry-symbol>` returns callers/callees, `complexity <hot-symbol>` returns LOC, branch, complexity, callee, fan-in/out counts — then `scip-query change-surface <touched-file> --full` to verify blast radius. Record input parsing, option resolution, subprocesses, lookups, database queries, graph traversal, source scans, semantic calls, cache reads/writes, rendering, serialization, and verification. Done only when each major pipeline step can be timed as a profile span.
|
|
37
37
|
|
|
38
38
|
Before adding profiling spans, check whether the target app already has an instrumentation layer — a bespoke profiling harness competes with the one the codebase already trusts. When the optimization target is scip-query itself, its instrumentation is `src/instrumentation/profile.ts` (`profileSpan`/`profileAsyncSpan`), env-gated by `SCIP_QUERY_PROFILE` and `SCIP_QUERY_PROFILE_OUT`, with `SCIP_QUERY_PROFILE_CACHE_STATE` for cache-state labels and inherited workload/subsystem identities — use it instead of adding a parallel harness.
|
|
39
39
|
|
|
@@ -17,6 +17,16 @@ insufficient. The shared reference contains the complete command vocabulary,
|
|
|
17
17
|
coverage rules, and evidence contract; loading it before a route is selected
|
|
18
18
|
adds choices without adding direction.
|
|
19
19
|
|
|
20
|
+
Run commands normally for agent reading: the human renderer preserves
|
|
21
|
+
hierarchy, whitespace, and line numbers without transport metadata. Select
|
|
22
|
+
`--json` only when a program will parse the response; add `--result-only` when
|
|
23
|
+
that program needs only the command result rather than the stable public
|
|
24
|
+
envelope. Do not select `--compact` or `--output-page-size` for readability.
|
|
25
|
+
Follow an emitted continuation command only when the command itself says the
|
|
26
|
+
output is incomplete. The final transport-complete footer means every rendered
|
|
27
|
+
character was retrieved; inspect command coverage separately before claiming
|
|
28
|
+
the logical result is exhaustive.
|
|
29
|
+
|
|
20
30
|
## Routes
|
|
21
31
|
|
|
22
32
|
| The request starts from… | Owning skill | Completion criterion |
|
|
@@ -62,11 +72,11 @@ Top commands per routed skill, generated from each skill's own `commands:` front
|
|
|
62
72
|
|
|
63
73
|
| Skill | Top commands |
|
|
64
74
|
| --- | --- |
|
|
65
|
-
| `scip-audit` | `scip-query health
|
|
75
|
+
| `scip-audit` | `scip-query health`, `scip-query decorative-checkers --full`, `scip-query doc-drift --full` |
|
|
66
76
|
| `scip-diagnose` | `scip-query files <feature-or-error-term>`, `scip-query trace <candidate-symbol>`, `scip-query call-graph <entry-symbol>` |
|
|
67
|
-
| `scip-explore` | `scip-query system <module-or-scope>`, `scip-query trace <entry-symbol>`, `scip-query affected <symbol
|
|
68
|
-
| `scip-improve` | `scip-query cleanup-plan --verify
|
|
69
|
-
| `scip-plan` | `scip-query plan-context <target>`, `scip-query refs <symbol>`, `scip-query affected <symbol
|
|
77
|
+
| `scip-explore` | `scip-query system <module-or-scope>`, `scip-query trace <entry-symbol>`, `scip-query affected <symbol>` |
|
|
78
|
+
| `scip-improve` | `scip-query cleanup-plan --verify`, `scip-query cleanup-apply --verified --batch <n> --dry-run`, `scip-query diff-gate` |
|
|
79
|
+
| `scip-plan` | `scip-query plan-context <target>`, `scip-query refs <symbol>`, `scip-query affected <symbol>` |
|
|
70
80
|
| `scip-setup` | `scip-query setup --json`, `scip-query doctor`, `scip-query status --capabilities` |
|
|
71
|
-
| `scip-verify` | `scip-query doctor`, `scip-query diff-impact
|
|
81
|
+
| `scip-verify` | `scip-query doctor`, `scip-query diff-impact`, `scip-query diff-gate` |
|
|
72
82
|
<!-- END GENERATED ROUTER COMMAND PREVIEW -->
|
|
@@ -58,15 +58,14 @@ every written, skipped, or blocked artifact.
|
|
|
58
58
|
|
|
59
59
|
```bash
|
|
60
60
|
scip-query doctor
|
|
61
|
-
scip-query status
|
|
61
|
+
scip-query status
|
|
62
62
|
scip-query capabilities --matrix
|
|
63
|
-
scip-query config-validate
|
|
63
|
+
scip-query config-validate
|
|
64
64
|
```
|
|
65
65
|
|
|
66
|
-
`doctor`
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
capabilities are available. `config-validate --json` validates
|
|
66
|
+
`doctor` reports config, index freshness, and dependency readiness. `status`
|
|
67
|
+
reports freshness and config. `capabilities --matrix` reports which
|
|
68
|
+
evidence/verification capabilities are available. `config-validate` validates
|
|
70
69
|
`.scipquery.json`.
|
|
71
70
|
|
|
72
71
|
Fix missing indexers, stale indexes, invalid config, or unavailable
|
|
@@ -84,8 +83,8 @@ language and how to interpret `stopped`/idle service states.
|
|
|
84
83
|
|
|
85
84
|
```bash
|
|
86
85
|
scip-query status --capabilities
|
|
87
|
-
scip-query reindex
|
|
88
|
-
scip-query watch --status
|
|
86
|
+
scip-query reindex
|
|
87
|
+
scip-query watch --status
|
|
89
88
|
```
|
|
90
89
|
|
|
91
90
|
Complete only when every selected language has an explicit
|
|
@@ -4,7 +4,7 @@ New repos surface standing findings that are intentional. Encode them once so
|
|
|
4
4
|
every later gate run is precise, instead of re-litigating the same findings
|
|
5
5
|
every time `diff-gate` runs.
|
|
6
6
|
|
|
7
|
-
1. Sweep initial findings with `health
|
|
7
|
+
1. Sweep initial findings with `health` and `diff-gate`. For
|
|
8
8
|
each accepted finding, run `suppress <id> --reason <why>` — reasons are
|
|
9
9
|
required and audited.
|
|
10
10
|
2. Declare files that legitimately change together in `.scipquery.json`
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: scip-verify
|
|
3
|
-
description: Use after finishing a change and before committing:
|
|
3
|
+
description: Use after finishing a change and before committing: ensure the watcher has produced a fresh index generation, run the postchecks matching what you edited, diff-gate, and try to refute your own PASS — including verifying that a React or Vue refactor actually achieved the reuse it claimed. Also use to calibrate detector precision once a repo is already set up and its findings look too noisy or too clean. For an existing status claim with no just-finished diff, use scip-audit instead. Distinct from the `review` skill: that one reviews a branch against coding standards and the originating spec; this one runs freshness, routed postchecks and diff-gate checks on a change you just made.
|
|
4
4
|
commands:
|
|
5
5
|
- template: "scip-query doctor"
|
|
6
6
|
when: "Prove the workspace and configuration are usable before trusting evidence."
|
|
7
|
-
- template: "scip-query diff-impact
|
|
7
|
+
- template: "scip-query diff-impact"
|
|
8
8
|
when: "Compare changed files, symbols, and affected consumers with the intended diff."
|
|
9
|
-
- template: "scip-query diff-gate
|
|
9
|
+
- template: "scip-query diff-gate"
|
|
10
10
|
when: "Run the complete finished-diff gate without blind line truncation."
|
|
11
11
|
---
|
|
12
12
|
|
|
@@ -32,8 +32,8 @@ Load shared mechanics — command syntax, the evidence contract, diff-gate's
|
|
|
32
32
|
| Command | Purpose | Returns | Coverage | When |
|
|
33
33
|
| --- | --- | --- | --- | --- |
|
|
34
34
|
| `scip-query doctor` | Diagnose config, index freshness, dependency readiness, and project capabilities | config, freshness, dependency, and capability diagnostics | `complete` | Prove the workspace and configuration are usable before trusting evidence. |
|
|
35
|
-
| `scip-query diff-impact
|
|
36
|
-
| `scip-query diff-gate
|
|
35
|
+
| `scip-query diff-impact` | Compute changed symbols and downstream consumers from current git diff | changed symbols, downstream consumer identities, and impact paths | `bounded` | Compare changed files, symbols, and affected consumers with the intended diff. |
|
|
36
|
+
| `scip-query diff-gate` | Runtime-bounded, single-flight gate for the current diff: architecture regressions plus echo, migration, coordination, doc-drift, unused-param, and new-dead candidates; exit 1 on blocking findings | blocking findings with check id, message, and remediation; advisory findings; root-cause groups; changed file and symbol counts; process exit status (1 when blocking findings exist) | `bounded` | Run the complete finished-diff gate without blind line truncation. |
|
|
37
37
|
|
|
38
38
|
Use this shortlist first. Open [`../_shared/SKILL.md`](../_shared/SKILL.md) only when it is insufficient.
|
|
39
39
|
<!-- END GENERATED SKILL COMMANDS -->
|
|
@@ -55,6 +55,11 @@ scip-query doctor
|
|
|
55
55
|
scip-query status --capabilities
|
|
56
56
|
```
|
|
57
57
|
|
|
58
|
+
Apply `_shared`'s freshness gate here: if the watcher is already refreshing or
|
|
59
|
+
has accepted a refresh request, wait and check once more rather than launching
|
|
60
|
+
a parallel reindex. Use manual `scip-query reindex` only when the index is
|
|
61
|
+
stale, missing, or unknown and the watcher is disabled, unavailable, or failed.
|
|
62
|
+
|
|
58
63
|
Complete only when missing indexers, invalid config, stale indexes, or
|
|
59
64
|
unavailable relevant capabilities are fixed or reported as blockers. Verify
|
|
60
65
|
environment and index freshness before trusting any graph fact that follows.
|
|
@@ -62,7 +67,7 @@ environment and index freshness before trusting any graph fact that follows.
|
|
|
62
67
|
### 2. Assess the diff
|
|
63
68
|
|
|
64
69
|
```bash
|
|
65
|
-
scip-query diff-impact
|
|
70
|
+
scip-query diff-impact
|
|
66
71
|
```
|
|
67
72
|
|
|
68
73
|
Compare changed files, changed symbols, and downstream consumers against the
|
|
@@ -86,8 +91,8 @@ you expected to need going in:
|
|
|
86
91
|
| Changed React components or hooks | the React commands in `_shared` |
|
|
87
92
|
| Changed Vue SFCs or composables | the Vue commands in `_shared` |
|
|
88
93
|
|
|
89
|
-
Add `--
|
|
90
|
-
|
|
94
|
+
Add `--full` to any of these when an unbounded result is needed rather than
|
|
95
|
+
the bounded default. This table is authoritative — the
|
|
91
96
|
shared reference links here instead of duplicating it, so don't assume a
|
|
92
97
|
different mapping. Complete only when each applicable postcheck has a result
|
|
93
98
|
and every actionable finding is fixed, accepted with evidence, or blocked by
|
|
@@ -103,7 +108,7 @@ scip-query config-validate
|
|
|
103
108
|
### 4. Run the gate
|
|
104
109
|
|
|
105
110
|
```bash
|
|
106
|
-
scip-query diff-gate
|
|
111
|
+
scip-query diff-gate
|
|
107
112
|
```
|
|
108
113
|
|
|
109
114
|
This is the primary blocker for diff-specific risk: architecture regressions
|
|
@@ -137,7 +142,7 @@ when a committed baseline exists. If docs, AGENTS.md, CLAUDE.md, command
|
|
|
137
142
|
docs, generated docs, or skill instructions changed, run
|
|
138
143
|
|
|
139
144
|
```bash
|
|
140
|
-
scip-query doc-drift --
|
|
145
|
+
scip-query doc-drift --full
|
|
141
146
|
```
|
|
142
147
|
|
|
143
148
|
and read the returned stale-doc candidates against the diff.
|
|
@@ -197,7 +202,7 @@ Postchecks:
|
|
|
197
202
|
- <command>: <result>
|
|
198
203
|
|
|
199
204
|
Gate:
|
|
200
|
-
- `scip-query diff-gate
|
|
205
|
+
- `scip-query diff-gate`: <result>
|
|
201
206
|
|
|
202
207
|
Health/docs/self-audit:
|
|
203
208
|
- <commands and results>
|
|
@@ -43,10 +43,10 @@ Run the full detector battery and don't react to any of the numbers yet —
|
|
|
43
43
|
big counts here are sampling frames, not findings:
|
|
44
44
|
|
|
45
45
|
```bash
|
|
46
|
-
scip-query health
|
|
47
|
-
scip-query dead
|
|
46
|
+
scip-query health
|
|
47
|
+
scip-query dead
|
|
48
48
|
scip-query similar <symbol>
|
|
49
|
-
scip-query twin-drift -s <scope>
|
|
49
|
+
scip-query twin-drift -s <scope>
|
|
50
50
|
```
|
|
51
51
|
|
|
52
52
|
Complete only when every detector's finding count is recorded.
|
|
@@ -57,7 +57,7 @@ Replay the gate against the last 15-20 real commits, using a worktree per
|
|
|
57
57
|
commit — never the user's live tree:
|
|
58
58
|
|
|
59
59
|
```bash
|
|
60
|
-
scip-query diff-gate --base <commit>
|
|
60
|
+
scip-query diff-gate --base <commit>
|
|
61
61
|
```
|
|
62
62
|
|
|
63
63
|
This is the stage that exposes finding WALLS: one hub file or one convention
|
|
@@ -114,7 +114,7 @@ until it's fixed.
|
|
|
114
114
|
Confirm the repair:
|
|
115
115
|
|
|
116
116
|
```bash
|
|
117
|
-
scip-query diff-gate
|
|
117
|
+
scip-query diff-gate
|
|
118
118
|
```
|
|
119
119
|
|
|
120
120
|
run before and after, to check it worked.
|
|
@@ -147,11 +147,11 @@ Each of these has been observed in a real calibration:
|
|
|
147
147
|
|
|
148
148
|
The finding-outcome ledger keeps calibrating automatically. Once the repo
|
|
149
149
|
uses `diff-gate`, per-detector precision is recomputed from real outcomes as
|
|
150
|
-
`detectorPrecision` in `health
|
|
150
|
+
`detectorPrecision` in `health`. The committed event ledger under
|
|
151
151
|
`.scipquery/events/*.json` makes those outcomes durable and queryable:
|
|
152
152
|
|
|
153
153
|
```bash
|
|
154
|
-
scip-query effectiveness --since 30d
|
|
154
|
+
scip-query effectiveness --since 30d
|
|
155
155
|
```
|
|
156
156
|
|
|
157
157
|
reports, per check, caught / comparison-verified-fixed / suppressed / open /
|
package/dist/chunk-24QNP7MN.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as f,b as m}from"./chunk-QZ4JVECJ.js";import{a as u}from"./chunk-7LABSJSR.js";import{B as g,E as d}from"./chunk-DGMCFMPG.js";import{H as l}from"./chunk-B5MHCHP3.js";import{readFileSync as E,readdirSync as h}from"fs";import{basename as k,join as c}from"path";function S(t,e,r={}){let a=new Set(t),n=new Set(e),o=[...n].filter(i=>!a.has(i)).sort(),s=r.allowExtra?[]:[...a].filter(i=>!n.has(i)).sort();return{missing:o,extra:s}}function b(t,e){let r=N(t,e.file,e.keys);if(!r.ok)return{name:e.name,file:e.file,status:"unavailable",missing:[],extra:[],unavailableReason:r.reason};let a=L(t.config.projectRoot,e.mustEqual),n=S(r.keys,a,{allowExtra:e.allowExtra??!1}),o=n.missing.length>0||n.extra.length>0?"violated":"ok";return{name:e.name,file:e.file,status:o,missing:n.missing,extra:n.extra}}function O(t,e){return e.map(r=>b(t,r))}function G(t,e){if(e.has(t.file))return!0;let r=t.mustEqual;switch(r.type){case"top-level-dirs":return[...e].some(a=>a===r.path||a.startsWith(`${r.path}/`));case"file-glob":return[...e].some(a=>f(r.pattern,a));case"registered-commands":return e.has("docs/COMMAND_REFERENCE.md");case"builtin-skills":return[...e].some(a=>a.startsWith("skills/"))}}function I(t){if(t.status==="unavailable")return`[coverage-contract] ${t.name}: DISCLOSED \u2014 could not evaluate (${t.unavailableReason})`;let e=[];return t.missing.length>0&&e.push(`missing ${t.missing.join(", ")}`),t.extra.length>0&&e.push(`extra ${t.extra.join(", ")}`),`[coverage-contract] ${t.name}: ${e.join("; ")}`}function N(t,e,r){return r.type==="markdown-list"?T(t,e,r.marker):R(t,e,r)}function R(t,e,r){if(!l(t,e))return{ok:!1,reason:`file not found: ${e}`};let n=g(e);if(!n)return{ok:!1,reason:`unsupported file type for ${r.type} extraction: ${e}`};let o=d(t,e);if(!o)return{ok:!1,reason:`tree-sitter parser unavailable for ${n} (${e}) \u2014 contract skipped, not silently passed`,disclosedUnavailable:{language:n,reason:"parser-unavailable"}};let s=r.type==="object-literal-keys"?D(o,r.identifier):w(o,r.identifier);return s===null?{ok:!1,reason:`no ${r.type==="object-literal-keys"?"object literal":"string array"} named "${r.identifier}" found in ${e}`}:{ok:!0,keys:s}}function y(t){let e=t.childForFieldName("value");return e?e.type==="as_expression"||e.type==="satisfies_expression"?e.namedChild(0):e:null}function D(t,e){for(let r of t.rootNode.descendantsOfType("variable_declarator")){if(r.childForFieldName("name")?.text!==e)continue;let n=y(r);if(n?.type==="object")return $(n)}return null}function $(t){let e=new Set;for(let r of t.namedChildren)if(r.type==="pair"){let a=r.childForFieldName("key");a&&e.add(C(a.text))}else r.type==="shorthand_property_identifier"&&e.add(r.text);return[...e].sort()}function w(t,e){for(let r of t.rootNode.descendantsOfType("variable_declarator")){if(r.childForFieldName("name")?.text!==e)continue;let n=y(r);if(n?.type!=="array")continue;let o=new Set;for(let s of n.namedChildren)s.type==="string"&&o.add(C(s.text));return[...o].sort()}return null}function C(t){return t.length>=2&&(t[0]==="'"&&t.endsWith("'")||t[0]==='"'&&t.endsWith('"'))?t.slice(1,-1):t}function T(t,e,r){let a=l(t,e);if(!a)return{ok:!1,reason:`file not found: ${e}`};let n=v(a,r);return n===null?{ok:!1,reason:`no <!-- BEGIN GENERATED ${r} --> ... <!-- END GENERATED ${r} --> block in ${e}`}:{ok:!0,keys:x(n)}}function v(t,e){let r=u(e),n=new RegExp(`<!--\\s*BEGIN GENERATED ${r}\\s*-->([\\s\\S]*?)<!--\\s*END GENERATED ${r}\\s*-->`).exec(t);return n?n[1]:null}function x(t){let e=new Set;for(let r of t.matchAll(/`([a-z][a-z0-9-]*)`/g))e.add(r[1]);for(let r of t.matchAll(/\[([a-z][a-z0-9-]*)\]\([^)]*\)/g))e.add(r[1]);return[...e].sort()}function L(t,e){switch(e.type){case"top-level-dirs":return p(c(t,e.path));case"file-glob":return[...new Set(m(t,e.pattern).map(r=>k(r)))].sort();case"registered-commands":return A(t);case"builtin-skills":return p(c(t,"skills"))}}function p(t){let e;try{e=h(t,{withFileTypes:!0})}catch{return[]}return e.filter(r=>r.isDirectory()&&!r.name.startsWith(".")).map(r=>r.name).sort()}function A(t){let e;try{e=E(c(t,"docs/COMMAND_REFERENCE.md"),"utf-8")}catch{return[]}let r=v(e,"COMMAND REFERENCE");return r?x(r):[]}var z={dead:{minLoc:3,skipBarrels:!0,deadCodeOnly:!0},isolated:{minLoc:3},similar:{minSimilarity:.6,limit:50,minCallees:4},duplicateBodies:{maxLoc:15,limit:50},extract:{minLoc:15,minCallees:5,limit:50},wrappers:{maxLoc:15,limit:50},passthroughs:{maxLoc:15,limit:50},stale:{minLoc:3,limit:50},drift:{},twinDrift:{minSimilarity:.3}};export{b as a,O as b,G as c,I as d,z as e};
|
|
2
|
-
//# sourceMappingURL=chunk-24QNP7MN.js.map
|
package/dist/chunk-26X7KCJR.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{a as te,b as N,e as V,f as j,g as E,h as re,i as se}from"./chunk-KMVGRIO2.js";import{c as q}from"./chunk-XVJ3V7LM.js";import{b as _}from"./chunk-B75HZHUP.js";import{a as ne}from"./chunk-E2ZXPB7J.js";import{n as ie}from"./chunk-JERWGHQT.js";import{a as D}from"./chunk-2OXVAGGT.js";import{d as I,e as K,h as $}from"./chunk-ZTTISZ7J.js";import{a as B}from"./chunk-7LABSJSR.js";import{B as y,E as Q,G as ee,H as U,I as H,m as z,q as J,z as A}from"./chunk-B5MHCHP3.js";import{a as Y}from"./chunk-64MNV6AB.js";function ve(e,n,t={}){let{minSimilarity:i=.4,limit:r=20}=t,s=ze(e,n,{semantic:t.semantic!==!1});if(!s)return[];if(!$(s.symbol))return[];if(s.callees.size===0)return ae(e,n,{minSimilarity:i,limit:r,scanLimit:t.scanLimit,candidateMode:t.sourceCandidateMode??"full"});let a=Me(e,s,i,{scanLimit:t.scanLimit,semantic:t.semantic!==!1});return a.length>0?a.slice(0,r):ae(e,n,{minSimilarity:i,limit:r,scanLimit:t.scanLimit,candidateMode:t.sourceCandidateMode??"full"})}function Mn(e,n,t,i={}){let r=D(e,n),s=D(e,t);if(!r||!s)return null;let a=ve(e,r.symbol,{minSimilarity:0,limit:Number.POSITIVE_INFINITY,semantic:i.semantic,scanLimit:i.scanLimit}).find(m=>m.symbolB===s.symbol||m.symbolA===s.symbol);if(!a)return null;let l=r.endLine-r.startLine+1,c=s.endLine-s.startLine+1;return{symbolA:{symbol:r.symbol,shortName:I(r.symbol),file:r.relativePath,loc:l},symbolB:{symbol:s.symbol,shortName:I(s.symbol),file:s.relativePath,loc:c},similarity:a.similarity,similarityBasis:a.similarityBasis??"callees",sharedEvidence:a.sharedCallees,uniqueToA:a.uniqueToA,uniqueToB:a.uniqueToB,evidenceClass:a.evidenceClass,actionTier:a.actionTier,recommendation:a.recommendation,consolidationStrategy:we(a)}}function we(e){let n=e.similarityBasis==="source-tokens"?"source-token":"tracked callee";return e.sharedCallees.length===0?`No shared ${n} evidence survived similar's weighting. Inspect the source before attempting consolidation.`:e.uniqueToA.length===0&&e.uniqueToB.length===0?`The functions have identical ${n} evidence under similar's weighting. Verify signatures, guards, and return values before consolidating.`:e.uniqueToA.length===0?`A's ${n} evidence is a subset of B's. B may subsume part of A's structure, but verify signatures, guards, and non-call logic first.`:e.uniqueToB.length===0?`B's ${n} evidence is a subset of A's. A may subsume part of B's structure, but verify signatures, guards, and non-call logic first.`:e.uniqueToA.length<=2&&e.uniqueToB.length<=2?`Create a shared helper around the ${e.sharedCallees.length} shared ${n}(s). Pass the ${e.uniqueToA.length+e.uniqueToB.length} divergent point(s) as parameters or callbacks.`:`Extract the ${e.sharedCallees.length} shared ${n}(s) into a common helper. Keep each function's unique logic outside that helper (${e.uniqueToA.length} item(s) in A, ${e.uniqueToB.length} in B).`}function Me(e,n,t,i){let r=G(e).calleeIndex({minCallees:3,scanLimit:i.scanLimit,semantic:i.semantic}),s=je(n,r.corpus),a=Oe(s,r),l=Te(s,r),c=j(l),m=E(s.callees,l),g=[];for(let f of a){if(f.callees.size<3)continue;let o=E(f.callees,l),u=ue(s,f,l,{minSimilarity:t,requireSignificantShared:1,requireSharedCount:0,medianIdf:c,magnitudeA:m,magnitudeB:o});u&&g.push(u)}return g.sort((f,o)=>o.similarity-f.similarity),g}function Te(e,n){let t=new Map(n.docFreq);for(let i of e.callees)t.set(i,(t.get(i)??0)+1);return V(t,n.corpus.length+1)}function ue(e,n,t,i){let r=Re(e,n,t,i);if(!Ae(r,i))return null;let{similarity:s,significantShared:a,trivialShared:l}=r,c=a.length>0?a:l,m=Se(c,"callees");return{symbolA:e.symbol,shortNameA:I(e.symbol),fileA:e.file,symbolB:n.symbol,shortNameB:I(n.symbol),fileB:n.file,similarity:s,similarityBasis:"callees",sharedCallees:c.map(I),uniqueToA:[...N(e.callees,n.callees)].map(I),uniqueToB:[...N(n.callees,e.callees)].map(I),...m}}function Le(e,n,t,i){let r=i.magnitudeA??E(e.callees,t),s=i.magnitudeB??E(n.callees,t),a=0,l=0,c=0,m=i.medianIdf??j(t);for(let o of e.callees){if(!n.callees.has(o))continue;let u=t.get(o)??0;a+=u*u,c+=1,u>=m&&(l+=1)}if(c===0)return!1;let g=r*s;return(g>0?a/g:0)<i.minSimilarity?!1:l>=i.requireSignificantShared||c>=i.requireSharedCount}function Re(e,n,t,i){return i.magnitudeA===void 0||i.magnitudeB===void 0?re(e.callees,n.callees,t,{medianIdf:i.medianIdf}):se(e.callees,n.callees,t,{medianIdf:i.medianIdf,magnitudeA:i.magnitudeA,magnitudeB:i.magnitudeB})}function Ae(e,n){if(e.similarity<n.minSimilarity)return!1;let t=e.significantShared.length+e.trivialShared.length;return e.significantShared.length>=n.requireSignificantShared||t>=n.requireSharedCount}function Tn(e,n={}){let{minSimilarity:t=.5,limit:i=20,scope:r,minCallees:s=4,crossFileOnly:a=!1,scanLimit:l}=n,c=n.semantic!==!1,m=A(),g=0,f=0,o=0,u=0,d=0,p=0,S=0;return y("similar.all",()=>{let b=G(e).calleeIndex({minCallees:s,scope:r,scanLimit:l,semantic:c}),C=b.corpus;g=C.length;let v=n.focusFiles,k=[],P=0;return y("similar.all.pair-scan",()=>{for(let x=0;x<C.length;x+=1){let F=C[x],T=v?.has(F.file)??!1,w=b.weightedMagnitudes[x],M=new Set;for(let O of F.callees){let L=b.candidateIndexesByCallee.get(O);if(L)for(let R of L)R<=x||v&&!T&&!v.has(C[R].file)||M.add(R)}m&&(o+=M.size,M.size>0&&(f+=1));for(let O of M){let L=C[O];if(a&&F.file===L.file){m&&(d+=1);continue}if(me(F,L)){m&&(p+=1);continue}m&&(u+=1);let R=ue(F,L,b.idfWeights,{minSimilarity:t,requireSignificantShared:2,requireSharedCount:4,medianIdf:b.medianIdf,magnitudeA:w,magnitudeB:b.weightedMagnitudes[O]});R&&(Be(k,R,i,P),m&&(S+=1),P+=1)}}},()=>({corpusSize:g,candidateSets:f,candidatePairs:o,comparedPairs:u,crossFileSkips:d,signatureSkips:p,insertedResults:S,topResults:k.length})),y("similar.all.sort-project",()=>(k.sort((x,F)=>F.result.similarity-x.result.similarity||x.order-F.order),k.map(x=>x.result)),()=>({topResults:k.length}))},()=>({minSimilarity:t,limit:i,scope:r,minCallees:s,crossFileOnly:a,scanLimit:l,semantic:c,corpusSize:g,candidateSets:f,candidatePairs:o,comparedPairs:u,crossFileSkips:d,signatureSkips:p,insertedResults:S}))}function Ln(e,n={}){let{minSimilarity:t=.5,scope:i,minCallees:r=4,crossFileOnly:s=!1,scanLimit:a}=n,l=n.semantic!==!1,c=A(),m=0,g=0,f=0,o=0,u=0,d=0,p=0;return y("similar.all-count",()=>{let h=G(e).calleeIndex({minCallees:r,scope:i,scanLimit:a,semantic:l}),b=h.corpus;m=b.length;let C=n.focusFiles;return y("similar.all-count.pair-scan",()=>{for(let v=0;v<b.length;v+=1){let k=b[v],P=C?.has(k.file)??!1,x=h.weightedMagnitudes[v],F=new Set;for(let T of k.callees){let w=h.candidateIndexesByCallee.get(T);if(w)for(let M of w)M<=v||C&&!P&&!C.has(b[M].file)||F.add(M)}c&&(f+=F.size,F.size>0&&(g+=1));for(let T of F){let w=b[T];if(s&&k.file===w.file){c&&(u+=1);continue}if(me(k,w)){c&&(d+=1);continue}c&&(o+=1),Le(k,w,h.idfWeights,{minSimilarity:t,requireSignificantShared:2,requireSharedCount:4,medianIdf:h.medianIdf,magnitudeA:x,magnitudeB:h.weightedMagnitudes[T]})&&(p+=1)}}},()=>({corpusSize:m,candidateSets:g,candidatePairs:f,comparedPairs:o,crossFileSkips:u,signatureSkips:d,insertedResults:p})),p},()=>({minSimilarity:t,scope:i,minCallees:r,crossFileOnly:s,scanLimit:a,semantic:l,corpusSize:m,candidateSets:g,candidatePairs:f,comparedPairs:o,crossFileSkips:u,signatureSkips:d,insertedResults:p}))}function me(e,n){if(e.paramCount<0||n.paramCount<0)return!1;let t=Math.abs(e.paramCount-n.paramCount),i=Math.max(2,Math.ceil(Math.max(e.paramCount,n.paramCount)*.5));return t>i}var de=Q({kind:"source-fingerprints",invalidation:ee("source-fingerprints"),serialize:cn,deserialize:ln});function Be(e,n,t,i){if(t<=0)return;if(e.length<t){e.push({result:n,order:i});return}let r=0;for(let a=1;a<e.length;a+=1){let l=e[a],c=e[r];(l.result.similarity<c.result.similarity||l.result.similarity===c.result.similarity&&l.order>c.order)&&(r=a)}let s=e[r];n.similarity<=s.result.similarity||(e[r]={result:n,order:i})}var Ee=["ScipDatabase#all","ScipDatabase#get","ScipDatabase#prepare","ScipDatabase#pathExclusionsFor","ScipDatabase#isIgnored","ScipDatabase#symbolNoiseFor","PerDbValue#get","PerDbValue#has",":storage:db:ScipDatabase:all",":storage:db:ScipDatabase:get",":storage:db:ScipDatabase:prepare",":storage:db:ScipDatabase:pathExclusionsFor",":storage:db:ScipDatabase:isIgnored",":storage:db:ScipDatabase:symbolNoiseFor",":storage:per-db-cache:PerDbValue:get",":storage:per-db-cache:PerDbValue:has"];function ze(e,n,t){let i=D(e,n);if(!i||!$(i.symbol))return null;let r=new q(e),s=ne(e,i,{semantic:t.semantic,semanticEvidence:ie});return{symbol:i.symbol,file:i.relativePath,callees:pe(s.map(a=>a.symbol)),paramCount:r.callableSignature(i)?.paramCount??-1}}var De=z("callee-fingerprint-corpus",{clearGroups:["whole-project","definition-catalog"]}),qe=z("callee-fingerprint-index",{clearGroups:["whole-project","definition-catalog"]});function fe(e,n){let{minCallees:t,scope:i,excludeSymbol:r,scanLimit:s}=n,a=n.semantic!==!1,l=De.get(e,()=>new Map),c=`${t}|${i??""}|${s??""}|${a}`,m=!0,g=0,f=0;return y("similar.callee-fingerprints.resolve",()=>{let o=l.get(c);if(m=o!==void 0,o||(o=$e(e,{minCallees:t,scope:i,scanLimit:s,semantic:a}),l.set(c,o)),g=o.length,r===void 0)return o;let u=o.filter(d=>d.symbol!==r);return f=o.length-u.length,u},()=>({minCallees:t,scope:i,scanLimit:s,semantic:a,cacheHit:m,corpusSize:g,excludeSymbol:r!==void 0,excludedSymbols:f}))}function Ne(e,n){let{minCallees:t,scope:i,scanLimit:r}=n,s=n.semantic!==!1,a=qe.get(e,()=>new Map),l=`${t}|${i??""}|${r??""}|${s}`,c=!0,m=0,g=0,f=0;return y("similar.callee-index.resolve",()=>{let o=a.get(l);return c=o!==void 0,o||(o=Pe(fe(e,{minCallees:t,scope:i,scanLimit:r,semantic:s})),a.set(l,o)),m=o.corpus.length,g=o.docFreq.size,f=o.candidateIndexesByCallee.size,o},()=>({minCallees:t,scope:i,scanLimit:r,semantic:s,cacheHit:c,corpusSize:m,indexedCallees:g,candidateBuckets:f}))}function G(e){return{calleeCorpus:n=>fe(e,n),calleeIndex:n=>Ne(e,n),sourceCorpus:(n={})=>Fe(e,n),sourceIndex:(n={})=>ce(e,n),sourceCandidates:(n,t)=>(t.candidateMode??"full")==="target-pruned"?Qe(e,n,{minSimilarity:t.minSimilarity,scanLimit:t.scanLimit}):Ye(n,ce(e,{scanLimit:t.scanLimit}))}}function Pe(e){let n=A(),t=0,i=y("similar.callee-index.doc-frequency",()=>{let o=new Map;for(let u of e)for(let d of u.callees)o.set(d,(o.get(d)??0)+1);return t=o.size,o},()=>({corpusSize:e.length,uniqueCallees:t})),r=Math.max(8,Math.ceil(Math.sqrt(e.length))),s=y("similar.callee-index.idf-weights",()=>V(i,e.length),()=>({corpusSize:e.length,uniqueCallees:i.size})),a=y("similar.callee-index.weighted-magnitudes",()=>e.map(o=>E(o.callees,s)),()=>({corpusSize:e.length})),l=0,c=0,m=0,g=y("similar.callee-index.candidate-buckets",()=>{let o=new Map;for(let u=0;u<e.length;u+=1){let d=e[u];for(let p of d.callees){if((i.get(p)??0)>r){n&&(c+=1);continue}let S=o.get(p);S||(S=[],o.set(p,S)),S.push(u),n&&(l+=1)}}return n&&(m=o.size),o},()=>({corpusSize:e.length,buckets:m,candidateRefs:l,ubiquitousSkips:c,ubiquityThreshold:r})),f=y("similar.callee-index.median-idf",()=>j(s),()=>({uniqueCallees:s.size}));return{corpus:e,candidateIndexesByCallee:g,docFreq:i,idfWeights:s,weightedMagnitudes:a,medianIdf:f,ubiquityThreshold:r}}function Oe(e,n){let t=new Map;for(let i of e.callees)for(let r of n.candidateIndexesByCallee.get(i)??[]){let s=n.corpus[r];s.symbol!==e.symbol&&t.set(s.symbol,s)}return t.size>0?[...t.values()]:n.corpus.filter(i=>i.symbol!==e.symbol)}function $e(e,n){let{minCallees:t,scope:i,scanLimit:r,semantic:s}=n,a=A(),l=new q(e),c=0,m=y("similar.callee-fingerprints.candidates",()=>{let p=_(l.productionCallableDefinitions({scope:i,minLoc:5,sortByLocDesc:typeof r=="number"&&r>0}),r);return c=p.length,p},()=>({scope:i,scanLimit:r,candidateCount:c})),g=0,f=y("similar.callee-fingerprints.callee-map",()=>{let p=l.calleeMap(m,{semantic:s});if(a)for(let S of p.values())g+=S.length;return p},()=>({candidateCount:c,semantic:s,calleeEdges:g})),o=0,u=0,d=0;return y("similar.callee-fingerprints.shape",()=>{let p=m.map(b=>({symbol:b.symbol,file:b.relativePath,callees:pe((f.get(b.symbolId)??[]).map(C=>C.symbol)),paramCount:l.callableSignature(b)?.paramCount??-1})),S=_e(p);a&&(d=S.filter((b,C)=>b.callees.size!==p[C].callees.size).length);let h=S.filter(b=>b.callees.size>=t);return o=h.length,a&&(u=h.reduce((b,C)=>b+C.callees.size,0)),h},()=>({candidateCount:c,fingerprintCount:o,retainedCalleeCount:u,minCallees:t,siblingSaturatedFingerprints:d}))}var ge=5;function _e(e){let n=new Map;for(let t of e){let i=n.get(t.file);i||(i=new Map,n.set(t.file,i));for(let r of t.callees)i.set(r,(i.get(r)??0)+1)}return e.map(t=>{let i=n.get(t.file);if(!i)return t;let r=[...t.callees].filter(a=>(i.get(a)??0)>=ge);if(r.length===0)return t;let s=new Set(t.callees);for(let a of r)s.delete(a);return{...t,callees:s}})}function je(e,n){let t=new Map;for(let s of n)if(!(s.file!==e.file||s.symbol===e.symbol))for(let a of s.callees)t.set(a,(t.get(a)??0)+1);let i=[...e.callees].filter(s=>(t.get(s)??0)+1>=ge);if(i.length===0)return e;let r=new Set(e.callees);for(let s of i)r.delete(s);return{...e,callees:r}}function pe(e){return new Set([...e].filter(n=>!Ge(n)))}function Ge(e){return Ee.some(n=>e.includes(n))}function ae(e,n,t){let i=Ve(e,n);if(!i||i.tokens.size<3)return[];let r=t.minSimilarity>=.5?t.minSimilarity:.3,s=[],a=t.candidateMode??"full",l=0,c=0,m=0,g=0;return y("similar.source-shape",()=>{let o=G(e).sourceCandidates(i,{minSimilarity:r,scanLimit:t.scanLimit,candidateMode:a});l=o.length;for(let u of o){if(u.symbol===i.symbol||u.tokens.size<3)continue;c+=1;let d=te(i.tokens,u.tokens);if(d.size<2){m+=1;continue}let p=new Set([...i.tokens,...u.tokens]),S=p.size>0?d.size/p.size:0;if(S<r){g+=1;continue}s.push({symbolA:i.symbol,shortNameA:I(i.symbol),fileA:i.file,symbolB:u.symbol,shortNameB:I(u.symbol),fileB:u.file,similarity:S,similarityBasis:"source-tokens",sharedCallees:[...d].sort(),uniqueToA:[...N(i.tokens,u.tokens)].sort(),uniqueToB:[...N(u.tokens,i.tokens)].sort(),...Se([...d],"source-tokens")})}return s.sort((u,d)=>d.similarity-u.similarity||u.shortNameB.localeCompare(d.shortNameB)),s.slice(0,t.limit)},()=>({symbol:i.symbol,file:i.file,targetTokens:i.tokens.size,candidateMode:a,candidates:l,comparedPairs:c,sharedSkips:m,similaritySkips:g,results:s.length}))}function Se(e,n){let t=e.flatMap(W),i=e.flatMap(S=>oe(S,n)),r=Z(t,be),s=Z(t,ye),a=Z(i,X),l=[...new Set(i.filter(le))],c=e.filter(S=>{let h=oe(S,n);return h.some(b=>X.has(b))&&h.some(le)}).length,m=[];r.length>0&&m.push(`access/query scaffolding: ${r.slice(0,5).join(", ")}`),s.length>0&&m.push(`framework/generic scaffolding: ${s.slice(0,5).join(", ")}`),a.length>0&&m.push(`domain behavior verbs: ${a.slice(0,5).join(", ")}`),a.length>0&&l.length>0&&m.push(`domain-specific terms: ${l.slice(0,5).join(", ")}`);let g=n==="source-tokens"&&t.length>0&&t.every(S=>he.has(S));g&&m.push("shared source tokens are generic scaffolding");let f=a.length>0&&l.length>0,o=r.length+s.length>0,u=n==="callees"&&f&&e.length>=4&&l.length>=4&&c>=2,d=u?"domain-behavior":f?o?"mixed":"domain-behavior":r.length>0?"access-query-scaffolding":s.length>0||g?"framework-scaffolding":"structural-overlap";d==="structural-overlap"&&e.length>0&&m.push(`shared ${n} overlap has no recognized domain or scaffolding category`);let p=d==="domain-behavior"&&(e.length>=3||u)?"direct":"signal";return{evidenceClass:d,actionTier:p,evidenceClassReasons:m,recommendation:Ue(d,p)}}function Ue(e,n){return n==="direct"?"Shared domain behavior looks concrete; review for an extract/reuse opportunity.":e==="mixed"?"Shared evidence mixes domain behavior with scaffolding; review semantics before extracting anything.":e==="access-query-scaffolding"?"Shared evidence is mostly access/query scaffolding; compare product semantics before reusing code.":e==="structural-overlap"?"Shared structure has no domain or scaffolding classification; inspect names and behavior before reusing code.":"Shared evidence is mostly framework or generic scaffolding; treat as a contextual signal."}function Z(e,n){return[...new Set(e.filter(t=>n.has(t)))]}function W(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().split(/[^a-z0-9]+/).filter(n=>n.length>1)}function oe(e,n){if(n==="source-tokens")return W(e);let t=K(e);return W(t.length>0?t:He(e))}function He(e){return e.replace(/[()`]/g," ").replace(/\.[a-z][a-z0-9]+(?=\s|$)/gi," ").split(/[:/\\\s]+/).map(i=>i.trim()).filter(i=>/[A-Za-z]/.test(i)).at(-1)?.replace(/\.$/,"")??e}function le(e){return e.length>3&&!X.has(e)&&!be.has(e)&&!ye.has(e)&&!he.has(e)&&!Ke.has(e)}var X=new Set(["archive","assign","book","cancel","create","delete","ensure","export","import","notify","persist","publish","restore","schedule","send","set","submit","sync","update","upload","validate","write"]),be=new Set(["access","auth","authorize","cache","context","db","find","get","guard","list","permission","permissions","prisma","query","request","response","role","route","session","sql","where"]),ye=new Set(["bytes","computed","crypto","describe","effect","expect","fetch","filter","hex","hook","json","map","mounted","on","promise","random","react","reduce","ref","render","state","test","token","trim","uuid","vue","watch"]),he=new Set(["bytes","crypto","data","false","get","hex","id","key","map","name","num","random","result","secret","set","string","to","token","true","type","value"]),Ke=new Set(["best","backend","conflict","database","effect","effects","error","errors","frontend","found","helpers","javascript","module","modules","scip","shared","source","typescript","utils","with","workflow","workflows"]);function Ve(e,n){let t=D(e,n);if(!t||!$(t.symbol))return null;let i=Ze(e,t);return i?{symbol:t.symbol,file:t.relativePath,tokens:i}:null}function Ze(e,n){let t=K(n.symbol),i=sn(e,n.relativePath,n.startLine,n.endLine,t),r=Ie(i,t);return r.size>0?r:null}var We=z("source-fingerprint-corpus",{clearGroups:["whole-project","definition-catalog"]}),Xe=z("source-fingerprint-index",{clearGroups:["whole-project","definition-catalog"]});function Ce(e){return`${e.scanLimit??""}`}function Fe(e,n={}){let t=We.get(e,()=>new Map),i=Ce(n),r=t.get(i);return r||(r=rn(e,n),t.set(i,r)),r}function ce(e,n={}){let t=Xe.get(e,()=>new Map),i=Ce(n),r=t.get(i);return r||(r=Je(Fe(e,n)),t.set(i,r)),r}function Je(e){let n=new Map;for(let r of e)for(let s of r.tokens)n.set(s,(n.get(s)??0)+1);let t=Math.max(8,Math.ceil(Math.sqrt(e.length))),i=new Map;for(let r of e)for(let s of r.tokens){if((n.get(s)??0)>t)continue;let a=i.get(s);a||(a=[],i.set(s,a)),a.push(r)}return{corpus:e,candidateByToken:i,docFreq:n,ubiquityThreshold:t}}function Ye(e,n){let t=new Map;for(let i of e.tokens)for(let r of n.candidateByToken.get(i)??[])r.symbol!==e.symbol&&t.set(r.symbol,r);return t.size>0?[...t.values()]:n.corpus.filter(i=>i.symbol!==e.symbol)}function Qe(e,n,t){let i=A(),r=new q(e),s=en(n.tokens.size,t.minSimilarity),a=0,l=0,c=0,m=y("similar.source-shape.target-files",()=>{let d=[...n.tokens],p=[];for(let S of Y(e,{includeIgnored:!1})){a+=1;let h=U(e,S);h&&(l+=1,nn(h,d,s)&&p.push(S))}return c=p.length,p},()=>({symbol:n.symbol,targetTokens:n.tokens.size,requiredSharedTokens:s,scannedFiles:a,readableFiles:l,candidateFiles:c})),g=0,f=y("similar.source-shape.target-definitions",()=>{let d=_(r.productionCallableDefinitions({files:m,sortByLocDesc:typeof t.scanLimit=="number"&&t.scanLimit>0}),t.scanLimit);return g=d.length,d},()=>({symbol:n.symbol,candidateFiles:c,scanLimit:t.scanLimit,definitionCount:g})),o=0;return y("similar.source-shape.target-fingerprints",()=>{let d=xe(e,f);return i&&(o=d.length),d},()=>({symbol:n.symbol,definitionCount:g,fingerprintCount:o})).filter(d=>d.symbol!==n.symbol)}function en(e,n){return Math.max(2,Math.ceil(e*n))}function nn(e,n,t){if(n.length<t)return!1;let i=e.toLowerCase(),r=0;for(let s of n)if(tn(i,s)&&(r+=1,r>=t))return!0;return!1}function tn(e,n){return n==="num"?/\b\d+\b/.test(e):e.includes(n)}function rn(e,n={}){let t=new q(e),{scanLimit:i}=n,r=_(t.productionCallableDefinitions({sortByLocDesc:typeof i=="number"&&i>0}),i);return xe(e,r)}function xe(e,n){let t=new Map;for(let r of n){let s=t.get(r.relativePath)??[];s.push(r),t.set(r.relativePath,s)}let i=new Map;for(let[r,s]of t){let a=U(e,r);if(!a)continue;let l=J(e,r,a),c=on(e,r,l),m=!1,g=null;for(let f of s){let o=an(f),u=c.get(o),d=u?new Set(u.tokens):null;d||(g??=H(e,r),d=Ie(ke(g,f.startLine,f.endLine,f.leaf),f.leaf),c.set(o,{key:o,symbol:f.symbol,startLine:f.startLine,endLine:f.endLine,leaf:f.leaf,tokens:[...d].sort()}),m=!0),d.size>0&&i.set(f.symbol,{symbol:f.symbol,file:f.relativePath,tokens:d})}m&&un(e,r,l,c)}return n.map(r=>i.get(r.symbol)).filter(r=>!!r)}function sn(e,n,t,i,r){let s=H(e,n);return s.length===0?"":ke(s,t,i,r)}function ke(e,n,t,i){if(t>=n&&t-n<=12)return e.slice(n,t+1).join(`
|
|
2
|
-
`);let r=[new RegExp(`\\bdef\\s+${B(i)}\\b`),new RegExp(`\\bfun\\s+${B(i)}\\b`),new RegExp(`\\bfn\\s+${B(i)}\\b`),new RegExp(`\\bfunction\\s+${B(i)}\\b`),new RegExp(`\\b${B(i)}\\s*\\(`)],s=e.findIndex(a=>r.some(l=>l.test(a)));if(s>=0){let a=s;for(let l=s+1;l<e.length&&l<=s+8;l++){let c=e[l]??"";if(l>s&&dn(c)||(a=l,c.trim()===""&&l>s+1))break}return e.slice(s,a+1).join(`
|
|
3
|
-
`)}return e.slice(n,Math.min(e.length,n+8)).join(`
|
|
4
|
-
`)}function an(e){return`${e.symbol}\0${e.startLine}\0${e.endLine}\0${e.leaf}`}function on(e,n,t){return de.read(e,n,t)??new Map}function ln(e){try{let n=JSON.parse(e);if(!Array.isArray(n.entries))return null;let t=new Map;for(let i of n.entries){if(!i||typeof i.key!="string"||typeof i.symbol!="string"||typeof i.startLine!="number"||typeof i.endLine!="number"||typeof i.leaf!="string"||!Array.isArray(i.tokens)||!i.tokens.every(r=>typeof r=="string"))return null;t.set(i.key,i)}return t}catch{return null}}function cn(e){let n={entries:[...e.values()].sort((t,i)=>t.key.localeCompare(i.key))};return JSON.stringify(n)}function un(e,n,t,i){de.write(e,n,t,new Map(i))}function Ie(e,n){if(!e)return new Set;let t=new Set(["public","private","protected","final","static","class","def","fun","fn","function","return","string","bool","boolean","void","unit","self","this","new","const","let","var","end","pub"]),i=mn(n),s=e.replace(/["'`]/g," ").replace(/\b\d+\b/g," NUM ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[^A-Za-z0-9_]+/g," ").replace(/_/g," ").toLowerCase().split(/\s+/).map(a=>a.trim()).filter(a=>a.length>1).filter(a=>!t.has(a)).filter(a=>!i.has(a));return new Set(s)}function mn(e){return new Set(e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").split(/[^A-Za-z0-9_]+|_/).map(n=>n.toLowerCase()).filter(n=>n.length>1))}function dn(e){return/^\s*(?:def|fun|fn|function|class|trait|module|object|enum|interface|public|private|protected)\b/.test(e)}export{ve as a,Mn as b,Te as c,ue as d,Tn as e,Ln as f,Be as g,fe as h,Ne as i,G as j,Pe as k,Oe as l,ge as m,_e as n,pe as o,Se as p};
|
|
5
|
-
//# sourceMappingURL=chunk-26X7KCJR.js.map
|
package/dist/chunk-273W2U4Y.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import{b as w}from"./chunk-WXAAURU7.js";import{b as g}from"./chunk-2OXVAGGT.js";import{c as h,d as f}from"./chunk-MTDBHTSF.js";import{d as c,e as u,h as m,p as b,q as p}from"./chunk-ZTTISZ7J.js";import{dirname as $,relative as T,resolve as k}from"path";var A=new Set(f());function O(t,n){return`tests/generated/twin-ab/${y(t)}-vs-${y(n)}.test.ts`}function y(t){return(t.split(/[/#]/).pop()||t).replace(/[^A-Za-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"")||"symbol"}function I(t,n,a,e){let o=d(t,n);if(!o.ok)return o;let i=d(t,a);if(!i.ok)return i;let r=o.symbol.paramCount===null||i.symbol.paramCount===null?null:o.symbol.paramCount===i.symbol.paramCount,s=v(o.symbol,i.symbol,t.config.projectRoot,e,r);return{ok:!0,a:o.symbol,b:i.symbol,signatureCompatible:r,testSource:s}}function d(t,n){let e=g(t,n).match;if(!e)return{ok:!1,reason:`${n} does not resolve to an indexed symbol.`};let i=t.get("SELECT kind FROM global_symbols WHERE id = ?",e.symbolId)?.kind??null;if(!(i!==null?A.has(i):m(e.symbol)))return{ok:!1,reason:`${n} resolves to ${c(e.symbol)}${i!==null?` with SCIP kind ${h(i)}`:""} \u2014 twin-ab compares call outputs, so both referents must be functions or methods.`};if(!w(t,e))return{ok:!1,reason:`${n} (${c(e.symbol)} at ${e.relativePath}:${e.startLine+1}) is not exported \u2014 twin-ab needs an importable named binding for both twins.`};let s=t.get("SELECT documentation FROM global_symbols WHERE id = ?",e.symbolId),l=b(p(s?.documentation??null));return{ok:!0,symbol:{ref:n,symbol:e.symbol,shortName:u(e.symbol)||c(e.symbol),file:e.relativePath,startLine:e.startLine,signature:l,paramCount:l?x(l):null}}}function x(t){let n=t.indexOf("(");if(n===-1)return null;let a=0,e=-1;for(let s=n;s<t.length;s+=1){let l=t[s];if(l==="(")a+=1;else if(l===")"&&(a-=1,a===0)){e=s;break}}if(e===-1)return null;let o=t.slice(n+1,e).trim();if(!o)return 0;let i=1,r=0;for(let s of o)s==="("||s==="["||s==="{"?r+=1:s===")"||s==="]"||s==="}"?r=Math.max(0,r-1):s===","&&r===0&&(i+=1);return i}function S(t,n,a){let e=$(n),o=k(t,a),r=T(e,o).replace(/\\/g,"/").replace(/\.tsx?$/,".js");return r.startsWith(".")?r:`./${r}`}function v(t,n,a,e,o){let i=S(a,e,t.file),r=S(a,e,n.file),s=o===null?"Signature comparison: unknown (one or both signatures unavailable in the index) \u2014 check by hand.":o?"Signature comparison: param counts match.":"Signature comparison: param counts DIFFER \u2014 twins may not be directly comparable; check by hand.";return`/**
|
|
2
|
-
* Generated by 'scip-query twin-ab'. scip-audit integrity scenario.
|
|
3
|
-
* ("cross-examine same-concept twins"): where one concept is computed in
|
|
4
|
-
* more than one place, feed both the same input and require the same
|
|
5
|
-
* answer. Disagreement between twins means at least one is wrong \u2014
|
|
6
|
-
* determine which before consolidating.
|
|
7
|
-
*
|
|
8
|
-
* Twin A: ${t.shortName} (${t.file}:${t.startLine+1})
|
|
9
|
-
* ${t.signature??"(signature unavailable)"}
|
|
10
|
-
* Twin B: ${n.shortName} (${n.file}:${n.startLine+1})
|
|
11
|
-
* ${n.signature??"(signature unavailable)"}
|
|
12
|
-
* ${s}
|
|
13
|
-
*
|
|
14
|
-
* Fill in the TODO input table below with inputs both twins should agree
|
|
15
|
-
* on, then run this file with vitest.
|
|
16
|
-
*/
|
|
17
|
-
import { describe, expect, it } from 'vitest';
|
|
18
|
-
import { ${t.shortName} as twinA } from '${i}';
|
|
19
|
-
import { ${n.shortName} as twinB } from '${r}';
|
|
20
|
-
|
|
21
|
-
// TODO: fill in shared inputs both twins should agree on \u2014 one arg array per call.
|
|
22
|
-
const inputs: any[][] = [
|
|
23
|
-
// [/* arg1, arg2, ... */],
|
|
24
|
-
];
|
|
25
|
-
|
|
26
|
-
// Cast to a variadic signature so the input table can hold any arg shape \u2014
|
|
27
|
-
// the real twins have fixed, non-rest parameter lists, and TS rejects
|
|
28
|
-
// spreading a generic args array into those (TS2556) even when the array
|
|
29
|
-
// itself is 'any'; casting the callee's signature, not the args, satisfies
|
|
30
|
-
// the checker without weakening the twins' real exported types elsewhere.
|
|
31
|
-
const callA = twinA as (...callArgs: any[]) => any;
|
|
32
|
-
const callB = twinB as (...callArgs: any[]) => any;
|
|
33
|
-
|
|
34
|
-
describe.skipIf(inputs.length === 0)('twin-ab: ${t.shortName} vs ${n.shortName}', () => {
|
|
35
|
-
it.each(inputs)('agrees on input %#', (...args) => {
|
|
36
|
-
expect(callA(...args)).toEqual(callB(...args));
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
`}export{O as a,I as b};
|
|
40
|
-
//# sourceMappingURL=chunk-273W2U4Y.js.map
|
package/dist/chunk-2OXVAGGT.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{A as C,c as M,d as L,e as Q,g as I,h as K,i as O,n as y,o as d,r as b}from"./chunk-ZTTISZ7J.js";import{l as E}from"./chunk-B5MHCHP3.js";var W=E("symbol-resolution",{clearGroups:[]});function ue(e,n){return j(e,n).match}function j(e,n){return W.get(e,n,()=>{let t=z(e,n.trim()).filter(r=>!e.isIgnored(r.relative_path));if(t.length>0)return S(e,t);let o=Y(e,n);if(o&&!e.isIgnored(o.relative_path))return S(e,[o]);let i=q(e,n);return i.length>0?S(e,i):U(e,n)})}function q(e,n){let t=N(n),o=x(t);if(!o)return[];let i=`%${o.path}%`,r=o.leaf;return T(e,i,r,t)}function T(e,n,t,o){let i=b([],[...G(e,n,t),...H(e,n,t)]).filter(r=>!e.isIgnored(r.relative_path)).filter(r=>f(r,o)>1);return i.sort((r,a)=>f(a,o)-f(r,o)||r.end_line-r.start_line-(a.end_line-a.start_line)||r.start_line-a.start_line||r.symbol.localeCompare(a.symbol)),i}function G(e,n,t){return y(e,{where:"d.relative_path LIKE ? AND (gs.display_name = ? OR gs.symbol LIKE ?)",params:[n,t,`%/${t}.%`]})}function H(e,n,t){return d(e,{where:"d.relative_path LIKE ? AND (gs.display_name = ? OR gs.symbol LIKE ?)",params:[n,t,`%/${t}.%`]})}function U(e,n){let t=N(n),o=te(n),i=P(e,o),r=ne(i,n,t).filter(s=>!e.isIgnored(s.relative_path));if(r.length>0)return S(e,r);let a=[];for(let s of i){if(e.isIgnored(s.relative_path))continue;let c=ee(s,n,t,o);c<=0||a.push({row:s,score:c})}return a.sort((s,c)=>c.score-s.score||s.row.end_line-s.row.start_line-(c.row.end_line-c.row.start_line)||s.row.relative_path.localeCompare(c.row.relative_path)||s.row.symbol.localeCompare(c.row.symbol)),S(e,a.map(s=>s.row))}function S(e,n){let t=n.map(i=>C(e,i)),o=t[0]??null;return{match:o,candidates:o?X(t,o):[],total:t.length}}function X(e,n){let t=new Set([`${n.symbolId}:${n.relativePath}:${n.startLine}`]),o=[];for(let i of e){let r=`${i.symbolId}:${i.relativePath}:${i.startLine}`;if(!t.has(r)&&(t.add(r),o.push({symbol:i.symbol,shortName:L(i.symbol),relativePath:i.relativePath,startLine:i.startLine}),o.length>=5))break}return o}function Y(e,n){let t=n.match(/^(.+):(\d+)-(\d+)$/);if(!t)return;let[,o,i,r]=t,a=Math.max(0,parseInt(i,10)-1),s=Math.max(a,parseInt(r,10)-1);return Z(e,o,a,s)??J(e,o,a,s)}function Z(e,n,t,o){return y(e,{where:"d.relative_path LIKE ? AND der.start_line <= ? AND der.end_line >= ?",params:[`%${n}%`,t,o],orderBy:"(der.end_line - der.start_line) ASC",limit:1})[0]}function J(e,n,t,o){return d(e,{where:"d.relative_path LIKE ? AND c.start_line <= ? AND c.end_line >= ?",params:[`%${n}%`,t,o],orderBy:"(MAX(c.end_line) - MIN(c.start_line)) ASC",limit:1})[0]}function me(e,n){let t=z(e,n).find(o=>!e.isIgnored(o.relative_path));return t?C(e,t):null}function z(e,n){let t=y(e,{where:"gs.symbol = ?",params:[n],orderBy:"d.relative_path, der.start_line"}),o=t.length>0?[]:d(e,{where:"gs.symbol = ?",params:[n],orderBy:"d.relative_path, start_line"});return b(t,o)}function pe(e,n){if("symbol"in n&&"relativePath"in n)return n;let t=V(e,n.symbolId)[0];return t?C(e,t):null}function V(e,n){let t=y(e,{where:"gs.id = ?",params:[n],orderBy:"der.start_line, der.end_line"}),o=d(e,{where:"gs.id = ?",params:[n],orderBy:"start_line, end_line"});return b(t,o)}function P(e,n){let t=n.map(()=>"(gs.symbol LIKE ? OR d.relative_path LIKE ? OR COALESCE(gs.display_name, '') LIKE ?)"),o=n.flatMap(s=>{let c=`%${s}%`;return[c,c,c]}),i=t.join(`
|
|
2
|
-
AND `),r=y(e,{where:i,params:o,limit:200}),a=d(e,{where:i,params:o,limit:200});return b(r,a)}function ee(e,n,t,o){let i=n.trim(),r=t,a=r.replace(/\(\)$/,""),s=n.toLowerCase(),c=t.toLowerCase(),h=c.replace(/\(\)$/,""),k=e.symbol,v=L(e.symbol),g=Q(e.symbol),A=e.display_name??"",_=e.symbol.toLowerCase(),u=v.toLowerCase(),m=g.toLowerCase(),D=A.toLowerCase(),p=e.relative_path.toLowerCase(),B=/[/:.]/.test(t),$=x(t),w=$?.leaf.toLowerCase(),l=0;return(k===i||k===r)&&(l+=1150),(v===i||v===r)&&(l+=1100),A===a&&(l+=1180),g===a&&(l+=1160),(`${g}()`===i||`${g}()`===r)&&(l+=955),(_===s||_===c)&&(l+=1e3),(u===s||u===c)&&(l+=950),(p===s||p===c)&&(l+=925),(p.endsWith(`/${c}`)||p.endsWith(`/${s}`))&&(l+=875),D===h&&(l+=850),m===h&&(l+=825),(`${m}()`===s||`${m}()`===c)&&(l+=820),(u.endsWith(`:${c}`)||u.endsWith(`:${h}`)||u.endsWith(`:${h}()`))&&(l+=800),_.includes(c)&&(l+=120),u.includes(c)&&(l+=140),p.includes(c)&&(l+=140),D.includes(c)&&(l+=110),o.every(F=>{let R=F.toLowerCase();return _.includes(R)||u.includes(R)||p.includes(R)||D.includes(R)})&&(l+=100+o.length*15),$&&p.includes($.path.toLowerCase())&&(l+=360,w&&(m===w||`${m}()`===w||`${m}()`==`${w}()`)&&(l+=700),I(e.symbol)&&(l+=180)),K(e.symbol)&&m===h&&(l+=60),!B&&O(e.symbol)&&(l-=160),l-=Math.min(50,Math.max(0,e.end_line-e.start_line)),l}function x(e){let n=e.trim().replace(/\\/g,"/"),t=n.lastIndexOf("/");if(t<=0||t===n.length-1)return null;let o=n.slice(t+1).replace(/\(\)$/,"");return!o||o.includes(".")?null:{path:n.slice(0,t),leaf:o}}function N(e){return e.trim().replace(/\(\)$/,"").replace(/\(.*$/,"")}function te(e){let n=N(e),t=n.split(/[^A-Za-z0-9_]+/).map(o=>o.trim()).filter(o=>o.length>0);return t.length>0?[...new Set(t)]:[n]}function ne(e,n,t){let o=n.trim(),i=e.filter(r=>{let a=L(r.symbol),s=(r.display_name??"").trim();return r.symbol===o||a===o||a===t||s===o||s===t||`${s}()`===o||f(r,t)>1||r.relative_path===o});return i.length===0?[]:(i.sort((r,a)=>f(a,t)-f(r,t)||r.end_line-r.start_line-(a.end_line-a.start_line)||r.relative_path.localeCompare(a.relative_path)||r.symbol.localeCompare(a.symbol)),i)}function f(e,n){let t=x(n);if(!t)return 0;let o=e.relative_path.toLowerCase(),i=Q(e.symbol).toLowerCase(),r=t.path.toLowerCase(),a=t.leaf.toLowerCase();return o.includes(r)?i!==a?1:I(e.symbol)?M(e.symbol)===null?5:4:M(e.symbol)===null?3:2:0}export{ue as a,j as b,me as c,pe as d};
|
|
3
|
-
//# sourceMappingURL=chunk-2OXVAGGT.js.map
|
package/dist/chunk-2ZOCHAL2.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{a as x,d as z,e as K,f as k,g as S,h as j,i as H,j as F}from"./chunk-A63U2W3P.js";import{execFileSync as T}from"child_process";import{createRequire as me}from"module";import{existsSync as pe}from"fs";import{platform as v,arch as V}from"os";var X="v0.8.1",B="https://github.com/sourcegraph/scip",Y="SCIP_QUERY_SCIP_BIN";function ge(e){if(e.isOnPath("scip"))return{source:"path",path:"scip"};let t=e.env[Y];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 ye(e){let t=me(import.meta.url);for(let r of e==="arm64"?["arm64","x64"]:[e])try{return t.resolve(`scip-query-scip-windows/scip-win32-${r}.exe`)}catch{}return null}function W(e=process.env){return ge({platform:v(),arch:V(),env:e,isOnPath:x,fileExists:pe,resolveSidecar:ye})?.path??null}function pt(){return W()!==null}function gt(){let e=W();if(!e)return null;try{return T(e,["--version"],{stdio:"pipe",timeout:1e4,killSignal:"SIGKILL"}).toString().trim()}catch{return null}}function Re(){let e=v(),t=V(),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:`${B}/releases/download/${X}/${i}`,filename:i}}function yt(){let e=Re();console.log("\nThe `scip` CLI is required but not found on PATH.\n"),v()==="darwin"?(console.log("Install via Homebrew:"),console.log(` brew install sourcegraph/scip/scip
|
|
2
|
-
`),console.log("Or download manually:")):v()==="win32"?(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 scip-query-scip-windows"),console.log(`Or set ${Y} to a local scip.exe path.
|
|
3
|
-
`),console.log("Upstream release page:")):console.log("Download from:"),console.log(e?` ${e.url}
|
|
4
|
-
`:` ${B}/releases/tag/${X}
|
|
5
|
-
`),console.log("After installing, ensure `scip` is on your PATH and run `scip-query reindex`.")}function Rt(e){if(v()==="darwin"&&x("brew")){e("Installing scip CLI via Homebrew...");try{if(T("brew",["install","sourcegraph/scip/scip"],{stdio:"inherit",timeout:3e5,env:process.env}),x("scip"))return e("Successfully installed scip CLI via Homebrew"),!0}catch(t){let r=t instanceof Error?t.message:String(t);e(`Homebrew install failed: ${r}`)}}if(x("go")){e("Installing scip CLI via go install...");try{if(T("go",["install","github.com/sourcegraph/scip/cmd/scip@latest"],{stdio:"inherit",timeout:3e5,env:process.env}),x("scip"))return e("Successfully installed scip CLI via go install"),!0}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: ${B}/releases`),!1}import{randomUUID as xe}from"crypto";import{closeSync as he,fsyncSync as be,linkSync as ke,mkdirSync as Se,openSync as ve,readFileSync as Pe,statSync as Le,unlinkSync as we,writeSync as Ie}from"fs";import{dirname as C}from"path";var E="scip-query-process-lock",_=1;var w=Object.freeze({wallNow:()=>Date.now(),isProcessAlive:z,readProcessIdentity:S,randomToken:()=>xe(),makeDirectory:e=>Se(e,{recursive:!0}),openFile:(e,t,r)=>ve(e,t,r),writeFile:(e,t,r,n)=>Ie(e,t,r,n),syncFile:e=>be(e),closeFile:e=>he(e),linkFile:(e,t)=>ke(e,t),readFile:e=>Pe(e,"utf8"),statFile:e=>{let t=Le(e);return{dev:t.dev,ino:t.ino,size:t.size,mtimeMs:t.mtimeMs}},removeFile:e=>we(e)});function Z(e,t){let r=t.runtime??w;r.makeDirectory(C(e));let n;for(let o=0;o<2;o+=1)try{return{kind:"acquired",lock:ee(e,t,r),...n?{reclaimed:n}:{}}}catch(i){if(i.code!=="EEXIST")throw i;let s=h(e,{parseLegacy:t.parseLegacy,runtime:r});if(o===0&&Fe(e,s,{creationGraceMs:t.creationGraceMs,parseLegacy:t.parseLegacy,runtime:r})){n=s;continue}return{kind:"contended",observation:s}}return{kind:"contended",observation:h(e,{parseLegacy:t.parseLegacy,runtime:r})}}function h(e,t={}){let r=t.runtime??w,n,o;try{n=r.statFile(e),o=r.readFile(e)}catch(c){return c.code==="ENOENT"?{state:"missing"}:{state:"malformed"}}let i;try{i=JSON.parse(o)}catch{return{state:"malformed",raw:o,identity:n}}let s=Oe(i);if(s)return{state:"valid",raw:o,identity:n,record:s,owner:Be(s),parsed:i};let a=t.parseLegacy?.(i)??null;return a?{state:"legacy",raw:o,identity:n,owner:a,parsed:i}:{state:"malformed",raw:o,identity:n,parsed:i}}function Oe(e){if(!e||typeof e!="object"||Array.isArray(e))return null;let t=e;if(t.protocol!==E||t.version!==_||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:K(t.processIdentity);return t.processIdentity!==void 0&&(!r||r.pid!==t.pid)?null:{protocol:E,version:_,kind:t.kind,pid:t.pid,token:t.token,...r?{processIdentity:r}:{},startedAt:t.startedAt,...t.detail?{detail:t.detail}:{}}}function Fe(e,t,r={}){let n=r.runtime??w;if(!N(t,n))return!1;let o=Te(`${e}.reclaim`,n);if(!o)return!1;try{let i=h(e,{parseLegacy:r.parseLegacy,runtime:n});return!te(t,i)||!N(i,n)?!1:M(e,n)}finally{o.release()}}function ee(e,t,r){let n=t.pid??process.pid,o=r.randomToken(),i=t.processIdentity===void 0?r.readProcessIdentity(n):t.processIdentity,s={protocol:E,version:_,kind:t.kind,pid:n,token:o,...i?{processIdentity:i}:{},startedAt:new Date(r.wallNow()).toISOString(),...t.detail?{detail:t.detail}:{}},a=`${e}.${o}.candidate`,c=r.openFile(a,"wx",384),d;try{H(c,Buffer.from(`${JSON.stringify(s)}
|
|
6
|
-
`),r,"process lock"),r.syncFile(c)}catch(u){d=u}try{r.closeFile(c)}catch(u){d??=u}if(d!==void 0)throw A(a,r),d;try{r.linkFile(a,e)}catch(u){throw A(a,r),u}A(a,r);try{re(C(e),r)}catch(u){throw Q(e,s,r),u}let m=!1;return{path:e,record:s,release:()=>m?!1:(m=!0,Q(e,s,r))}}function Q(e,t,r=w){let n=h(e,{runtime:r});return n.state!=="valid"||!n.record||n.record.pid!==t.pid||n.record.token!==t.token||t.processIdentity&&(!n.record.processIdentity||!k(t.processIdentity,n.record.processIdentity))?!1:M(e,r)}function Te(e,t){for(let r=0;r<2;r+=1)try{return ee(e,{kind:"reclaim-guard",runtime:t},t)}catch(n){if(n.code!=="EEXIST")return null;let o=h(e,{runtime:t});if(r>0||!N(o,t))return null;let i=h(e,{runtime:t});if(!te(o,i)||!M(e,t))return null}return null}function N(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&&!k(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 Be(e){return{pid:e.pid,...e.processIdentity?{processIdentity:e.processIdentity}:{}}}function re(e,t){let r;try{r=t.openFile(e,"r")}catch(n){if(F(n,process.platform))return;throw n}try{t.syncFile(r)}catch(n){if(!F(n,process.platform))throw n}finally{t.closeFile(r)}}function M(e,t){try{return t.removeFile(e),re(C(e),t),!0}catch{return!1}}function A(e,t){try{t.removeFile(e)}catch{}}import{readFileSync as Et,statSync as He}from"fs";import{dirname as Ve,join as Xe}from"path";import{appendFileSync as Ae,existsSync as Ee,mkdirSync as _e,readFileSync as Ne,renameSync as Ce,rmSync as Me,statSync as Je,truncateSync as De}from"fs";import{basename as $e,dirname as qe}from"path";var $=".previous",Ue=".rotation.lock",Ge=2e3,J=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"},D=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"},ze=Object.freeze({monotonicNow:j,wait(e){Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,e)},tryAcquireLock(e,t){let r=Z(e,{kind:"rotating-jsonl",detail:{target:$e(t)}});return r.kind==="acquired"?{kind:"acquired",lock:r.lock}:{kind:"contended"}},makeDirectory(e){_e(e,{recursive:!0})},exists:Ee,readBytes(e){return Ne(e)},size(e){return Je(e).size},truncate:De,remove(e){Me(e,{force:!0})},rename:Ce,append:Ae});function ne(e,t,r){let n=r.runtime??ze,o=JSON.stringify(t);if(o===void 0)throw new TypeError("Rotating JSONL records must be JSON-serializable values.");let i=Buffer.from(`${o}
|
|
7
|
-
`),s=Math.max(1,Math.floor(r.maxSegmentBytes),i.length);return Ke(e,r.lockTimeoutMs,n,()=>{n.makeDirectory(qe(e));let a=je(e,n);r.onPhase?.("tail-repaired");let c=`${e}${r.previousSuffix??$}`,d=!1,m=!1;return n.exists(e)&&n.size(e)+i.length>s&&(n.exists(c)&&(n.remove(c),m=!0),r.onPhase?.("previous-pruned"),n.rename(e,c),d=!0,r.onPhase?.("current-rotated")),n.append(e,i),r.onPhase?.("record-appended"),{lineBytes:i.length,segmentLimitBytes:s,repairedTailBytes:a,rotated:d,prunedPrevious:m}})}function Ke(e,t,r,n){let o=`${e}${Ue}`,i=Math.max(0,t??Ge),s=r.monotonicNow()+i,a;for(;;){let f=r.tryAcquireLock(o,e);if(f.kind==="acquired"){a=f.lock;break}let p=s-r.monotonicNow();if(p<=0)throw new J(o,i);r.wait(Math.min(5,p))}let c=!1,d,m;try{m=n()}catch(f){c=!0,d=f}let u=!1;try{u=a.release()}catch(f){if(!c)throw f}if(c)throw d;if(!u)throw new D(o);return m}function je(e,t){if(!t.exists(e))return 0;let r=t.readBytes(e);if(r.length===0||r[r.length-1]===10)return 0;let n=r.lastIndexOf(10),o=n<0?0:n+1;return t.truncate(e,o),r.length-o}var Ye="reindex-activity.jsonl",We=$,Qe=1024*1024,Ct=1440*60*1e3;function oe(e){return Xe(Ve(e),Ye)}function Ze(e){if(e.reused)return 0;let t=ie(e.indexPath)+ie(e.dbPath);for(let r of e.shards??[])!r.reused&&r.outputBytes!==null&&(t+=r.outputBytes);return t}function Mt(e,t){let r=t.lastRefresh;r&&se(oe(e),{version:1,event:"run",recordedAt:r.completedAt,trigger:r.trigger,result:r.result,durationMs:r.durationMs,estimatedLogicalOutputBytes:Ze(t)})}function Jt(e,t){se(oe(e),{version:1,event:"run",recordedAt:t.completedAt,trigger:t.trigger,result:"failed",durationMs:t.durationMs,estimatedLogicalOutputBytes:0})}function et(e,t,r=Qe,n){ne(e,t,{maxSegmentBytes:r,previousSuffix:We,...n?{runtime:n}:{}})}function se(e,t){try{et(e,t)}catch{}}function ie(e){try{return He(e).size}catch{return 0}}import{createHash as tt}from"crypto";import{mkdirSync as rt,realpathSync as nt}from"fs";import{homedir as it}from"os";import{join as y,resolve as ae}from"path";function ot(e,t){let r=process.env.SCIP_QUERY_CACHE_DIR;if(r)return q(r);if(t?.dbPath)return q(ae(e,t.dbPath));let n=st(e);return q(n)}function ce(){let e=process.env.XDG_CACHE_HOME;return y(e||y(it(),".cache"),"scip-query")}function st(e){let t=ae(e);try{t=nt(t)}catch{}let r=tt("sha256").update(t).digest("hex").slice(0,12);return y(ce(),"projects",r)}function zt(e){if(!/^[a-f0-9]{24}$/.test(e))throw new Error(`invalid repository cache identity: ${e}`);return y(ce(),"repositories",e)}function Kt(e){return process.env.SCIP_QUERY_SHARED_CACHE!=="0"&&!process.env.SCIP_QUERY_CACHE_DIR&&!process.env.SCIP_QUERY_INDEX_DB&&!e?.dbPath}function jt(e,t){let r=ot(e,t);return{cacheDir:r,dbPath:y(r,"index.db"),indexPath:y(r,"index.scip"),metaPath:y(r,"meta.json")}}function q(e){return rt(e,{recursive:!0}),e}import{spawn as at}from"child_process";import{performance as le}from"perf_hooks";var Wt={probe:1e4,git:3e4,analysis:18e4,install:3e5,indexer:6e5},P=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 I(e,t){if(!Number.isFinite(e)||e<=0)throw new TypeError(`${t} must be a positive finite number.`)}function de(e,t,r,n){let o=Math.max(0,n-r);o>0&&e.push(t.subarray(0,o))}function ue(e,t,r){let n=Buffer.concat([...e,t]);e.length=0,e.push(n.subarray(Math.max(0,n.length-r)))}function ct(e,t){if(e.exitCode!==null||e.signalCode!==null||e.pid===void 0)return!1;if(!t)return!0;let r=S(e.pid);return r!==null&&k(t,r)}function Qt(e){I(e.timeoutMs,"timeoutMs"),I(e.maxStdoutBytes,"maxStdoutBytes"),I(e.maxStderrBytes,"maxStderrBytes");let t=e.terminationGraceMs??1e3;return I(t,"terminationGraceMs"),new Promise((r,n)=>{let o=le.now(),i;try{i=at(e.command,[...e.args??[]],{cwd:e.cwd,env:e.env,detached:e.detached,stdio:["pipe","pipe","pipe"]})}catch(l){n(new P("spawn",e.label,`${e.label} could not start.`,{cause:l,reaped:!0}));return}let s=[],a=[],c=0,d=0,m=!1,u=!1,f=null,p=!1,R=null,fe=i.pid===void 0?null:S(i.pid),b=l=>{f||p||(f=l,i.kill("SIGTERM"),R=setTimeout(()=>{!p&&ct(i,fe)&&i.kill("SIGKILL")},t),R.unref())},O=setTimeout(()=>{b({kind:"timeout",timedOut:!0,message:`${e.label} timed out after ${e.timeoutMs}ms.`})},e.timeoutMs);O.unref();let L=()=>{b({kind:"aborted",timedOut:!1,message:`${e.label} was cancelled.`})};e.signal?.addEventListener("abort",L,{once:!0}),e.signal?.aborted&&L(),i.stdout.on("data",l=>{let g=Buffer.isBuffer(l)?l:Buffer.from(l);e.outputLimitBehavior==="truncate-tail"?ue(s,g,e.maxStdoutBytes):de(s,g,c,e.maxStdoutBytes),c+=g.length,c>e.maxStdoutBytes&&(m=!0,e.outputLimitBehavior!=="truncate-tail"&&b({kind:"stdout-limit",timedOut:!1,message:`${e.label} exceeded stdout limit (${e.maxStdoutBytes} bytes).`}))}),i.stderr.on("data",l=>{let g=Buffer.isBuffer(l)?l:Buffer.from(l);e.outputLimitBehavior==="truncate-tail"?ue(a,g,e.maxStderrBytes):de(a,g,d,e.maxStderrBytes),d+=g.length,d>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",l=>{if(!p&&!f){if(i.pid===void 0){clearTimeout(O),R&&clearTimeout(R),e.signal?.removeEventListener("abort",L),p=!0,n(new P("spawn",e.label,`${e.label} could not start: ${l.message}`,{cause:l,reaped:!0}));return}b({kind:"spawn",timedOut:!1,message:`${e.label} failed after start: ${l.message}`})}}),i.on("close",(l,g)=>{if(p)return;p=!0,clearTimeout(O),R&&clearTimeout(R),e.signal?.removeEventListener("abort",L);let U=Buffer.concat(s).toString("utf8"),G=Buffer.concat(a).toString("utf8");if(f){n(new P(f.kind,e.label,f.message,{timedOut:f.timedOut,reaped:!0,stdout:U,stderr:G,stdoutTruncated:m,stderrTruncated:u}));return}r({status:l,signal:g,stdout:U,stderr:G,timedOut:!1,durationMs:le.now()-o,stdoutTruncated:m,stderrTruncated:u})}),e.input===void 0?i.stdin.end():i.stdin.end(e.input)})}export{W as a,pt as b,gt as c,yt as d,Rt as e,Z as f,h as g,Fe as h,$ as i,ne as j,Ye as k,Mt as l,Jt as m,st as n,zt as o,Kt as p,jt as q,Wt as r,P as s,Qt as t};
|
|
8
|
-
//# sourceMappingURL=chunk-2ZOCHAL2.js.map
|
package/dist/chunk-35SQLYCQ.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
function r(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function t(e){return typeof e=="string"&&Number.isFinite(Date.parse(e))}function n(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>=0}var o=["typescript","javascript","java","scala","kotlin","rust","python","ruby","go","cpp","c","csharp","vb","dart","php","clojure"];export{r as a,t as b,n as c,o as d};
|
|
2
|
-
//# sourceMappingURL=chunk-35SQLYCQ.js.map
|
package/dist/chunk-4CGVLUDP.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import{a as v}from"./chunk-QOKYJ33H.js";import{a as M,c as _}from"./chunk-XVJ3V7LM.js";import{l as N}from"./chunk-Z5QQPJ3U.js";import{d as w,g as y,i as x}from"./chunk-ZTTISZ7J.js";import{E as R}from"./chunk-DGMCFMPG.js";import{execFileSync as g}from"child_process";import{existsSync as j,readFileSync as U}from"fs";import{basename as A}from"path";var q="Unable to compute git diff.";function Ne(e,n={}){let i=n.plan??H(e,n);return i.note?Y(i.note,i.changedFileLines):i.changedFiles.length===0?V(i.changedFileLines):Z(i.changedFiles,[J(e,i.changedFiles,i.changedFiles,i.changedRanges)])}function H(e,n={}){let{base:i="HEAD"}=n;try{let t=K(e.config.projectRoot,i),r=t.changedFileLines,s=ie(e,r),a=re(e,t.changedRanges);return{changedFileLines:r,changedFiles:s,changedRanges:a,renamedFiles:ee(e.config.projectRoot,i,s,t),note:r.length===0?"No changed files found.":void 0}}catch{return{changedFileLines:[],changedFiles:[],changedRanges:[],renamedFiles:[],note:q}}}function J(e,n,i,t=[]){let r=new _(e),s=new Set(i),a=v(t),o=[],c=new Map,u=n.flatMap(f=>r.definitionsForFile(f)).filter(be),d=u.filter(f=>oe(f,a)),l=le(e,u,d,a),m=fe([...d,...l.definitions]).sort((f,h)=>f.relativePath.localeCompare(h.relativePath)||f.startLine-h.startLine),p=m.map(f=>f.symbolId),F=pe(e,p),z=he(e,p,i),C=m.filter(f=>(F.get(f.symbolId)??0)===0),I=E(()=>N(e,C)),W=C.filter(f=>(I.get(f.symbolId)?.size??0)===0),G=E(()=>M(e,W));for(let f of m)ge(e,f,s,o,c,I.get(f.symbolId)??new Set,G.get(f.symbolId)??new Set,F.get(f.symbolId)??0,z.get(f.symbolId)??new Set);return{changedSymbols:o,consumerEntries:[...c.entries()].map(([f,h])=>({file:f,symbols:[...h].sort()})),attributionNotes:l.notes}}function Z(e,n){let i=new Map,t=n.flatMap(a=>a.changedSymbols),r=n.flatMap(a=>a.attributionNotes??[]);for(let a of n)for(let o of a.consumerEntries){let c=i.get(o.file);c||(c=new Set,i.set(o.file,c));for(let u of o.symbols)c.add(u)}let s=ye(i);return{changedFiles:[...e],changedSymbols:t,affectedConsumers:s,attributionNotes:r,summary:{totalChangedFiles:e.length,totalChangedSymbols:t.length,totalAffectedFiles:s.length}}}function Y(e,n=[]){return{changedFiles:n,changedSymbols:[],affectedConsumers:[],attributionNotes:[],summary:{totalChangedFiles:n.length,totalChangedSymbols:0,totalAffectedFiles:0,note:e}}}function V(e){return{changedFiles:e,changedSymbols:[],affectedConsumers:[],attributionNotes:[],summary:{totalChangedFiles:e.length,totalChangedSymbols:0,totalAffectedFiles:0,note:"Changed files are not present in the current SCIP index."}}}function K(e,n){let i=g("git",["diff","--name-status","--find-renames",n],{encoding:"utf-8",cwd:e,timeout:3e4,maxBuffer:67108864}),t=g("git",["diff","--name-status","--find-renames","--cached",n],{encoding:"utf-8",cwd:e,timeout:3e4,maxBuffer:64*1024*1024}),r=g("git",["ls-files","--others","--exclude-standard"],{encoding:"utf-8",cwd:e,timeout:3e4,maxBuffer:64*1024*1024}),s=g("git",["diff","--unified=0",n],{encoding:"utf-8",cwd:e,timeout:3e4,maxBuffer:64*1024*1024}),a=g("git",["diff","--unified=0","--cached",n],{encoding:"utf-8",cwd:e,timeout:3e4,maxBuffer:64*1024*1024}),o=ne([i,t]);return{changedFileLines:[...new Set([...o.changedFiles,...T(r)])],changedRanges:O([...P(s),...P(a)]),renamedFiles:o.renamedFiles,deletedFiles:o.deletedFiles}}function L(e,n,i){try{return g("git",["show",`${n}:./${i}`],{encoding:"utf-8",cwd:e,timeout:1e4,stdio:["ignore","pipe","ignore"]})}catch{return null}}function _e(e,n,i=[]){let t=Q(e,n,i);return r=>(t.has(r)||t.set(r,L(e,n,r)),t.get(r)??null)}function ve(e,n=e.changedFiles){let i=new Map(e.renamedFiles.map(t=>[t.to,t.from]));return[...new Set(n.map(t=>i.get(t)??t))]}function Q(e,n,i){let t=[...new Set(i)],r=new Map;if(t.length===0)return r;try{let s=t.map(o=>`${n}:./${o}
|
|
2
|
-
`).join(""),a=g("git",["cat-file","--batch"],{cwd:e,input:s,maxBuffer:256*1024*1024,timeout:1e4,stdio:["pipe","pipe","ignore"]});return X(a,t)}catch{for(let s of t)r.set(s,L(e,n,s));return r}}function X(e,n){let i=new Map,t=0;for(let r of n){let s=e.indexOf(10,t);if(s<0)throw new Error("git cat-file batch output ended before object header");let a=e.subarray(t,s).toString("utf-8");if(t=s+1,a.endsWith(" missing")){i.set(r,null);continue}let o=/^[0-9a-f]+ ([^ ]+) (\d+)$/.exec(a);if(!o)throw new Error(`unexpected git cat-file batch header: ${a}`);let[,c,u]=o,d=Number(u);if(!Number.isFinite(d)||d<0)throw new Error(`unexpected git cat-file batch size: ${a}`);if(t+d>e.length)throw new Error("git cat-file batch output ended before blob payload");let l=e.subarray(t,t+d);i.set(r,c==="blob"?l.toString("utf-8"):null),t+=d,e[t]===10&&(t+=1)}return i}function ee(e,n,i,t){if(i.length===0)return[];let r=new Map,s=new Set;for(let o of t.renamedFiles)i.includes(o.to)&&(r.set(o.to,o),s.add(o.from));let a=t.deletedFiles;if(a.length===0)return[...r.values()].sort((o,c)=>o.to.localeCompare(c.to));for(let o of i){if(r.has(o)||!j(`${e}/${o}`))continue;let c=a.filter(l=>!s.has(l)).filter(l=>A(l)===A(o));if(c.length===0)continue;let u=U(`${e}/${o}`,"utf-8"),d=c.map(l=>({from:l,to:o,similarity:te(L(e,n,l)??"",u)})).sort((l,m)=>m.similarity-l.similarity)[0];d&&d.similarity>=.45&&(r.set(o,d),s.add(d.from))}return[...r.values()].sort((o,c)=>o.to.localeCompare(c.to))}function ne(e){let n=new Set,i=new Map,t=new Set;for(let r of e.flatMap(s=>T(s))){let[s,a,o]=r.split(" ");if(!(!s||!a)){if(s.startsWith("R")&&o){n.add(o),i.set(o,{from:a,to:o,similarity:Number(s.slice(1))/100});continue}n.add(a),s.startsWith("D")&&t.add(a)}}return{changedFiles:[...n],renamedFiles:[...i.values()],deletedFiles:[...t]}}function te(e,n){let i=new Set(B(e)),t=new Set(B(n));if(i.size===0&&t.size===0)return 1;if(i.size===0||t.size===0)return 0;let r=0;for(let s of i)t.has(s)&&(r+=1);return 2*r/(i.size+t.size)}function B(e){return e.match(/[A-Za-z_$][\w$]*|[{}()[\].,]/g)??[]}function T(e){return e.split(`
|
|
3
|
-
`).map(n=>n.trim()).filter(n=>n.length>0)}function ie(e,n){let i=$(e),t=[];for(let r of n){let s=i(r);s&&!e.isIgnored(s)&&t.push(s)}return t}function re(e,n){let i=$(e),t=[];for(let r of n){let s=i(r.file);s&&!e.isIgnored(s)&&t.push({...r,file:s})}return O(t)}function $(e){let n=e.all(`SELECT relative_path FROM documents
|
|
4
|
-
ORDER BY id`).map(t=>t.relative_path),i=new Map(n.map(t=>[t,t]));return t=>{let r=t.replace(/\\/g,"/"),s=i.get(r);return s||(n.find(a=>a.endsWith(r))??null)}}function P(e){let n=[],i=null;for(let t of e.split(`
|
|
5
|
-
`)){if(t.startsWith("+++ ")){i=se(t.slice(4).trim());continue}if(!i||!t.startsWith("@@ "))continue;let r=/@@ -\d+(?:,\d+)? \+(\d+)(?:,(\d+))? @@/.exec(t);if(!r)continue;let s=Math.max(0,Number(r[1])-1),a=r[2]===void 0?1:Number(r[2]);n.push({file:i,startLine:s,endLine:Math.max(s,s+Math.max(a,1)-1)})}return n}function se(e){return e==="/dev/null"?null:e.startsWith("a/")||e.startsWith("b/")?e.slice(2):e}function O(e){let n=new Set,i=[];for(let t of e){let r=`${t.file}:${t.startLine}:${t.endLine}`;n.has(r)||(n.add(r),i.push(t))}return i}function oe(e,n){let i=n.get(e.relativePath);return!i||i.length===0?!0:i.some(t=>D(e.startLine,e.endLine,t.startLine,t.endLine))}function ae(e,n,i){let t=new Map,r=[],s=k(e),a=ue(i);for(let o of n){let c=s.get(o.file)??[];if(c.some(l=>D(l.startLine,l.endLine,o.startLine,o.endLine)))continue;let u=a.get(o.file)??[],d=me(u,o);if(d){let l=c.find(m=>m.startLine>=d.startLine&&m.startLine<=d.endLine);if(l){t.set(l.symbolId,l),r.push(b(o,"ast-widened"));continue}}if(u.length===0){let l=[...c].filter(m=>m.startLine<=o.startLine).sort((m,p)=>p.startLine-m.startLine||m.endLine-p.endLine)[0];if(l){t.set(l.symbolId,l),r.push(b(o,"nearest-preceding"));continue}}r.push(b(o,"unattributed"))}return{definitions:[...t.values()],notes:r}}function le(e,n,i,t){let r=k(i),s=[],a=[],o=[...new Set(n.map(c=>c.relativePath))];for(let c of o){let u=t.get(c)??[];if(u.length===0)continue;let d=r.get(c)??[];for(let l of u)d.some(m=>D(m.startLine,m.endLine,l.startLine,l.endLine))||s.push(l);s.some(l=>l.file===c)&&a.push(...ce(e,c))}return ae(n,s,a)}function ce(e,n){let i=R(e,n);return i?i.rootNode.namedChildren.filter(de).map(t=>({file:n,startLine:t.startPosition.row,endLine:t.endPosition.row})).filter(t=>t.endLine>=t.startLine):[]}function de(e){return e.endPosition.row<e.startPosition.row?!1:!new Set(["import_statement","comment"]).has(e.type)}function fe(e){let n=new Map;for(let i of e)n.set(i.symbolId,i);return[...n.values()]}function k(e){let n=new Map;for(let i of e){let t=n.get(i.relativePath)??[];t.push(i),n.set(i.relativePath,t)}return n}function ue(e){let n=new Map;for(let i of e){let t=n.get(i.file)??[];t.push(i),n.set(i.file,t)}return n}function me(e,n){return e.filter(i=>i.startLine<=n.startLine&&i.endLine>=n.endLine).sort((i,t)=>i.endLine-i.startLine-(t.endLine-t.startLine))[0]}function b(e,n){return{file:e.file,startLine:e.startLine,endLine:e.endLine,method:n}}function D(e,n,i,t){return e<=t&&i<=n}function ge(e,n,i,t,r,s,a,o,c){let u=Math.max(o,s.size,a.size);if(!Se(n,u))return;let d=w(n.symbol);t.push({symbol:n.symbol,shortName:d,file:n.relativePath,startLine:n.startLine,endLine:n.endLine,fanIn:u});for(let l of c)S(e,i,r,l,d);for(let l of s)S(e,i,r,l,d);for(let l of a)S(e,i,r,l,d)}function E(e){try{return e()}catch(n){return console.error(`warning: diff-impact enrichment scan failed, continuing without it: ${n instanceof Error?n.message:n}`),new Map}}function pe(e,n){if(n.length===0)return new Map;let i=e.all(`SELECT m.symbol_id, COUNT(DISTINCT c.document_id) AS fan_in
|
|
6
|
-
FROM mentions m
|
|
7
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
8
|
-
WHERE m.symbol_id IN (${n.map(()=>"?").join(",")})
|
|
9
|
-
AND m.role != 1
|
|
10
|
-
GROUP BY m.symbol_id`,...n);return new Map(i.map(t=>[t.symbol_id,t.fan_in]))}function he(e,n,i){if(n.length===0||i.length===0)return new Map;let t=e.all(`SELECT DISTINCT m.symbol_id, ref_d.relative_path
|
|
11
|
-
FROM mentions m
|
|
12
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
13
|
-
JOIN documents ref_d ON c.document_id = ref_d.id
|
|
14
|
-
WHERE m.symbol_id IN (${n.map(()=>"?").join(",")})
|
|
15
|
-
AND m.role != 1
|
|
16
|
-
AND ref_d.relative_path NOT IN (${i.map(()=>"?").join(",")})
|
|
17
|
-
${e.pathExclusionsFor("ref_d")}`,...n,...i),r=new Map;for(let s of t){let a=r.get(s.symbol_id);a||(a=new Set,r.set(s.symbol_id,a)),a.add(s.relative_path)}return r}function S(e,n,i,t,r){if(e.isIgnored(t)||n.has(t))return;let s=i.get(t);s||(s=new Set,i.set(t,s)),s.add(r)}function ye(e){return[...e.entries()].map(([n,i])=>({file:n,consumedSymbols:i.size})).sort((n,i)=>i.consumedSymbols-n.consumedSymbols)}function be(e){return!(x(e.symbol)||e.parentTypeName!==null&&!y(e.symbol))}function Se(e,n){return y(e.symbol)||e.isTypeLike?!0:e.parentTypeName===null&&n>0}export{q as a,Ne as b,H as c,J as d,Z as e,L as f,_e as g,ve as h,Q as i,ae as j};
|
|
18
|
-
//# sourceMappingURL=chunk-4CGVLUDP.js.map
|