scip-query 0.19.4 → 0.19.6
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 +75 -1
- package/README.md +242 -49
- package/dist/augment-vue-worker.js +1 -1
- package/dist/{chunk-2YU7I3QO.js → chunk-24QNP7MN.js} +2 -2
- package/dist/{chunk-CNKAGUPL.js → chunk-26X7KCJR.js} +2 -2
- package/dist/{chunk-GPBBJ5Y4.js → chunk-273W2U4Y.js} +3 -3
- package/dist/{chunk-7GXM52MI.js → chunk-2CVXCGL4.js} +2 -2
- package/dist/{chunk-ABMYA4TN.js → chunk-2EZSOTSY.js} +2 -2
- package/dist/{chunk-HKEHS2AS.js → chunk-2GSQR6YA.js} +2 -2
- package/dist/{chunk-FECYOO5O.js → chunk-2OXVAGGT.js} +2 -2
- package/dist/chunk-2ZOCHAL2.js +8 -0
- package/dist/{chunk-QGXBRIM5.js → chunk-336DC5NJ.js} +2 -2
- package/dist/chunk-35SQLYCQ.js +2 -0
- package/dist/{chunk-VXQNNXJE.js → chunk-3OIKRYU5.js} +2 -2
- package/dist/{chunk-52ZYCAEO.js → chunk-47X75ZKH.js} +2 -2
- package/dist/{chunk-NPKYOIFM.js → chunk-4CGVLUDP.js} +2 -2
- package/dist/chunk-4RI4BJGT.js +8 -0
- package/dist/{chunk-P2PC2WGR.js → chunk-52HQTTPB.js} +2 -2
- package/dist/{chunk-YNRNA5LK.js → chunk-5OC3HWP5.js} +2 -2
- package/dist/{chunk-STOL2BTL.js → chunk-6XFC7PQ5.js} +2 -2
- package/dist/{chunk-J77UIT3I.js → chunk-6XHTISLI.js} +2 -2
- package/dist/chunk-6YTSKJJ3.js +2 -0
- package/dist/{chunk-BTEE5NZQ.js → chunk-7E3TH5ZN.js} +2 -2
- package/dist/{chunk-X6D5IC6I.js → chunk-7LABSJSR.js} +2 -2
- package/dist/chunk-7Q6VYYCH.js +2 -0
- package/dist/{chunk-FWUUZTIO.js → chunk-A43URCQ3.js} +2 -2
- package/dist/chunk-A63U2W3P.js +3 -0
- package/dist/{chunk-3MJ5YA4Y.js → chunk-ADFSIJP2.js} +2 -2
- package/dist/chunk-AOLE4DYM.js +6 -0
- package/dist/chunk-APMMR5Y2.js +2 -0
- package/dist/chunk-B5MHCHP3.js +107 -0
- package/dist/{chunk-4RSI5EMG.js → chunk-CSTYYXKC.js} +2 -2
- package/dist/{chunk-25LPM4DG.js → chunk-CYJM7CYF.js} +2 -2
- package/dist/{chunk-S44IULR6.js → chunk-DD5BOU5I.js} +2 -2
- package/dist/{chunk-YGAGTIDK.js → chunk-DGMCFMPG.js} +7 -7
- package/dist/{chunk-UOAV44HR.js → chunk-E2ZXPB7J.js} +2 -2
- package/dist/{chunk-IZKFSVBV.js → chunk-EVOC5I5I.js} +2 -2
- package/dist/{chunk-XTX6QHOF.js → chunk-F42A3AKG.js} +2 -2
- package/dist/{chunk-Q4IIEGXJ.js → chunk-FHCTEANE.js} +2 -2
- package/dist/{chunk-3SVWW4PN.js → chunk-FKGN4A4E.js} +2 -2
- package/dist/{chunk-IG7N5ZIK.js → chunk-FQTPPXNA.js} +2 -2
- package/dist/{chunk-F6O7AAC3.js → chunk-G4UQL4CP.js} +2 -2
- package/dist/chunk-GA64UPMI.js +6 -0
- package/dist/{chunk-ZXJYMGD3.js → chunk-GK3GRUJX.js} +2 -2
- package/dist/chunk-HEBAY673.js +2 -0
- package/dist/chunk-HELS7KFF.js +2 -0
- package/dist/{chunk-B5NLK2B3.js → chunk-IPDCSB6N.js} +2 -2
- package/dist/{chunk-M7MTH5NR.js → chunk-IYAOX36F.js} +2 -2
- package/dist/{chunk-YVVCVR2L.js → chunk-J7VT2CRB.js} +2 -2
- package/dist/{chunk-4333ETTV.js → chunk-JELJLXEE.js} +2 -2
- package/dist/{chunk-LBMJEAEW.js → chunk-JERWGHQT.js} +2 -2
- package/dist/chunk-JJJCO4QC.js +945 -0
- package/dist/{chunk-6E7UTQY7.js → chunk-JZNLMHWY.js} +2 -2
- package/dist/{chunk-R4FQGQ4X.js → chunk-K42M2KWT.js} +2 -2
- package/dist/{chunk-H7UKLTWJ.js → chunk-KLVJABXA.js} +2 -2
- package/dist/chunk-KP4KBDVF.js +3 -0
- package/dist/{chunk-RV2FQIX3.js → chunk-LMFVTUW2.js} +2 -2
- package/dist/chunk-LRTP3DKL.js +3 -0
- package/dist/{chunk-U6WNH5GC.js → chunk-MGBJHRFB.js} +2 -2
- package/dist/{chunk-QDV6RDCP.js → chunk-MLGTCX56.js} +2 -2
- package/dist/{chunk-54HA4ZXH.js → chunk-N3SE646F.js} +2 -2
- package/dist/{chunk-KP6XRY5Z.js → chunk-NBRUH7OE.js} +2 -2
- package/dist/{chunk-M7AIS73L.js → chunk-NN4ZIRPK.js} +2 -2
- package/dist/{chunk-I5RJM53C.js → chunk-NQLSSVOB.js} +2 -2
- package/dist/{chunk-4SALD7RU.js → chunk-OBKDTVZ3.js} +2 -2
- package/dist/{chunk-GBQ5NYPR.js → chunk-OHWZKLVA.js} +6 -6
- package/dist/{chunk-6NSFJYRC.js → chunk-OP3MTFJR.js} +2 -2
- package/dist/{chunk-EOOJGLDU.js → chunk-OQ2A4G2G.js} +2 -2
- package/dist/{chunk-DLWR3NUU.js → chunk-P6HBYNBE.js} +2 -2
- package/dist/{chunk-QVWS2VWZ.js → chunk-PC44K7RF.js} +2 -2
- package/dist/{chunk-A2EZV2UM.js → chunk-QBYYWGAT.js} +2 -2
- package/dist/{chunk-QRGV2F7L.js → chunk-QHKUY4FW.js} +2 -2
- package/dist/chunk-QHRL4LKM.js +2 -0
- package/dist/{chunk-I5AWSI2G.js → chunk-QQWOFXNW.js} +2 -2
- package/dist/{chunk-WQTAC523.js → chunk-RBFFD4V2.js} +2 -2
- package/dist/{chunk-SOAT6NLA.js → chunk-RJHCPSZ7.js} +2 -2
- package/dist/{chunk-VGRICIQI.js → chunk-RWRLUZ6U.js} +2 -2
- package/dist/{chunk-4T3LTWUS.js → chunk-S2GP3CU3.js} +2 -2
- package/dist/{chunk-HEXVUYFQ.js → chunk-SHKZ7OVJ.js} +2 -2
- package/dist/{chunk-NSS46APD.js → chunk-TFUU5MQQ.js} +2 -2
- package/dist/{chunk-IUFDSKGG.js → chunk-TYQ76QHQ.js} +2 -2
- package/dist/{chunk-NRCXJDHL.js → chunk-U5CNPPTZ.js} +2 -2
- package/dist/{chunk-MITTUCEH.js → chunk-UQK5CRUK.js} +2 -2
- package/dist/{chunk-XLTP42QA.js → chunk-UUJBLG6J.js} +2 -2
- package/dist/chunk-UXP636P5.js +144 -0
- package/dist/{chunk-64RFXJT5.js → chunk-VEVBIAOJ.js} +6 -6
- package/dist/chunk-VKRQDBW5.js +9 -0
- package/dist/{chunk-C7NIYIQ4.js → chunk-VOQFGC2W.js} +4 -4
- package/dist/{chunk-DZ74OMG6.js → chunk-VP542C25.js} +2 -2
- package/dist/{chunk-Q3AFUTGB.js → chunk-WMXRRBII.js} +2 -2
- package/dist/{chunk-ZGZUZ7XE.js → chunk-WXAAURU7.js} +2 -2
- package/dist/chunk-X3NLZHPA.js +20 -0
- package/dist/{chunk-WER3B7MI.js → chunk-XF3KLXN3.js} +2 -2
- package/dist/{chunk-NH5ALKPW.js → chunk-XVJ3V7LM.js} +2 -2
- package/dist/{chunk-4XTA5OMB.js → chunk-YGQN3XGZ.js} +2 -2
- package/dist/{chunk-CFMXJPHH.js → chunk-YHXBD52M.js} +2 -2
- package/dist/{chunk-7B3UPBVA.js → chunk-YLVE3SXZ.js} +2 -2
- package/dist/{chunk-YIJ7ZAA4.js → chunk-YTUD45PU.js} +2 -2
- package/dist/{chunk-VTKGCT3V.js → chunk-YWB2EBNB.js} +2 -2
- package/dist/{chunk-UKZBVX4U.js → chunk-Z2LHPIOM.js} +2 -2
- package/dist/chunk-Z5QQPJ3U.js +30 -0
- package/dist/{chunk-NZL2DBT7.js → chunk-ZLJLE6LK.js} +2 -2
- package/dist/{chunk-XYADIZHU.js → chunk-ZTTISZ7J.js} +2 -2
- package/dist/cli.js +3 -3
- package/dist/command-descriptors-SJDZ7QGR.js +617 -0
- package/dist/{config-types-D20KuvvZ.d.ts → config-types-BWQ5xPGI.d.ts} +4 -0
- package/dist/{db-G_II8yXU.d.ts → db-B0r1o7Vt.d.ts} +18 -1
- package/dist/direct-navigation-HTKOZEOM.js +3 -0
- package/dist/{health-oblXYgkF.d.ts → health-CFnlCiTz.d.ts} +1 -1
- package/dist/index.d.ts +2 -2
- 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 +2 -2
- package/dist/queries/change-surface.js +1 -1
- package/dist/queries/cleanup-plan.d.ts +2 -2
- package/dist/queries/cleanup-plan.js +1 -1
- package/dist/queries/co-change.d.ts +2 -2
- package/dist/queries/co-change.js +1 -1
- package/dist/queries/code.d.ts +2 -2
- package/dist/queries/code.js +1 -1
- package/dist/queries/complexity-hotspots.d.ts +2 -2
- package/dist/queries/complexity-hotspots.js +1 -1
- package/dist/queries/complexity.d.ts +2 -2
- package/dist/queries/complexity.js +1 -1
- package/dist/queries/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 +3 -3
- 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 +30 -2
- package/dist/queries/diff-gate.js +1 -1
- package/dist/queries/diff-impact.d.ts +2 -2
- package/dist/queries/diff-impact.js +1 -1
- package/dist/queries/doc-drift.d.ts +2 -2
- package/dist/queries/doc-drift.js +1 -1
- package/dist/queries/drift.d.ts +2 -2
- package/dist/queries/drift.js +1 -1
- package/dist/queries/duplicate-bodies.d.ts +2 -2
- package/dist/queries/duplicate-bodies.js +1 -1
- package/dist/queries/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 +2 -2
- 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 +2 -2
- package/dist/queries/incomplete-migration.js +1 -1
- package/dist/queries/index.d.ts +17 -3
- package/dist/queries/index.js +1 -1
- package/dist/queries/isolated.d.ts +2 -2
- package/dist/queries/isolated.js +1 -1
- package/dist/queries/locality-candidates.d.ts +2 -2
- package/dist/queries/locality-candidates.js +1 -1
- package/dist/queries/members.d.ts +2 -2
- package/dist/queries/members.js +1 -1
- package/dist/queries/methods.d.ts +2 -2
- package/dist/queries/methods.js +1 -1
- package/dist/queries/not-implemented.d.ts +3 -3
- package/dist/queries/not-implemented.js +1 -1
- package/dist/queries/outline.d.ts +2 -2
- package/dist/queries/outline.js +1 -1
- package/dist/queries/passthrough-candidates.d.ts +2 -2
- package/dist/queries/passthrough-candidates.js +1 -1
- package/dist/queries/plan-context.d.ts +2 -2
- 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/stats.js +1 -1
- 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 +3 -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 +23 -24
- package/dist/reindex.d.ts +10 -4
- package/dist/reindex.js +33 -38
- package/dist/runtime.d.ts +167 -11
- package/dist/runtime.js +3 -2
- 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-kRpaexVJ.d.ts → scip-cli-DCvnlZCu.d.ts} +5 -1
- package/dist/watch-server.js +5 -5
- package/docs/AGENT_GUIDE.md +1 -1
- package/docs/AI_FAILURE_MODES.md +18 -18
- package/docs/API_EVOLUTION.md +71 -0
- package/docs/CLI_JSON_OUTPUT.md +83 -0
- package/docs/COMMAND_REFERENCE.md +10 -8
- package/docs/COMMITTED_RECORD_COMPATIBILITY.md +117 -0
- package/docs/CONFIGURATION_WRITE_SAFETY.md +130 -0
- package/docs/DETECTOR_GUIDE.md +47 -47
- package/docs/DURABILITY.md +103 -0
- package/docs/INDEX_GENERATIONS.md +121 -0
- package/docs/LOCK_PROTOCOL.md +133 -0
- package/docs/MAILBOX_LIFECYCLE.md +197 -0
- package/docs/REINDEX_METADATA_COMPATIBILITY.md +84 -0
- package/docs/RUST_DURABLE_SESSION_PROTOCOL.md +126 -0
- package/docs/TELEMETRY_RETENTION.md +72 -0
- package/docs/TIME_SEMANTICS.md +77 -0
- package/docs/WATCH_REFRESH_REQUESTS.md +110 -0
- package/docs/WINDOWS_SIDECAR_RELEASE.md +298 -0
- package/docs/analyzer-validation-ledger.md +24 -23
- package/docs/schemas/cli-json-envelope.schema.json +53 -0
- package/docs/schemas/npm-release-state.schema.json +146 -0
- package/docs/schemas/outcome-event-record.schema.json +39 -0
- package/docs/schemas/project-config.schema.json +247 -0
- package/docs/schemas/suppression-record.schema.json +31 -0
- package/docs/schemas/windows-sidecar-provenance.schema.json +137 -0
- package/package.json +15 -5
- package/scripts/build-scip-windows.mjs +180 -61
- package/scripts/scip-windows-provenance.mjs +364 -0
- package/scripts/verify-scip-windows.mjs +29 -0
- package/skills/_shared/SKILL.md +91 -242
- package/skills/_shared/agents/openai.yaml +1 -1
- package/skills/_shared/references/agent-contract-catalog.md +105 -0
- package/skills/_shared/references/command-catalog.md +118 -0
- package/skills/_shared/references/detector-precision-and-diffgate.md +59 -0
- package/skills/_shared/references/evidence-and-dead-code.md +25 -0
- package/skills/scip-audit/SKILL.md +76 -0
- package/skills/scip-audit/agents/openai.yaml +4 -0
- package/skills/scip-audit/references/claims.md +98 -0
- package/skills/scip-audit/references/cleanup.md +101 -0
- package/skills/scip-audit/references/directory.md +222 -0
- package/skills/scip-audit/references/frontend.md +130 -0
- package/skills/scip-audit/references/integrity.md +154 -0
- package/skills/scip-audit/references/maintainability.md +162 -0
- package/skills/scip-audit/references/twin-drift.md +104 -0
- package/skills/scip-diagnose/SKILL.md +52 -0
- package/skills/scip-diagnose/agents/openai.yaml +4 -0
- package/skills/scip-diagnose/references/debug.md +117 -0
- package/skills/{scip-probe-reachability/SKILL.md → scip-diagnose/references/probe-reachability.md} +12 -27
- package/skills/scip-diagnose/references/root-cause.md +145 -0
- package/skills/scip-diagnose/references/triage.md +119 -0
- package/skills/scip-explore/SKILL.md +53 -84
- package/skills/scip-explore/agents/openai.yaml +2 -2
- package/skills/scip-explore/references/diagrams.md +40 -0
- package/skills/scip-explore/references/language-playbook.md +49 -0
- package/skills/scip-improve/SKILL.md +56 -0
- package/skills/scip-improve/agents/openai.yaml +4 -0
- package/skills/scip-improve/references/cleanup-batches.md +53 -0
- package/skills/scip-improve/references/directory-moves.md +53 -0
- package/skills/scip-improve/references/doc-reconcile.md +30 -0
- package/skills/scip-improve/references/frontend-extraction.md +39 -0
- package/skills/scip-improve/references/maintainability-mechanism.md +43 -0
- package/skills/scip-improve/references/twin-drift.md +35 -0
- package/skills/scip-plan/SKILL.md +68 -0
- package/skills/scip-plan/agents/openai.yaml +4 -0
- package/skills/scip-plan/references/api-impact.md +19 -0
- package/skills/scip-plan/references/conductor.md +41 -0
- package/skills/scip-plan/references/high-assurance.md +43 -0
- package/skills/scip-plan/references/hyper-optimization.md +50 -0
- package/skills/scip-plan/references/tla-model.md +88 -0
- package/skills/scip-query/SKILL.md +52 -97
- package/skills/scip-query/agents/openai.yaml +2 -2
- package/skills/scip-setup/SKILL.md +65 -176
- package/skills/scip-setup/agents/openai.yaml +3 -3
- package/skills/scip-setup/references/bootstrap-workflow.md +120 -0
- package/skills/scip-setup/references/language-verification.md +61 -0
- package/skills/scip-setup/references/lifecycle-commands.md +119 -0
- package/skills/scip-setup/references/per-repo-triage.md +24 -0
- package/skills/scip-verify/SKILL.md +123 -70
- package/skills/scip-verify/agents/openai.yaml +2 -2
- package/skills/scip-verify/references/calibrate-detectors.md +170 -0
- package/dist/chunk-2CTX5CMX.js +0 -4
- package/dist/chunk-2Y373BDD.js +0 -2
- package/dist/chunk-C2QSK7E7.js +0 -2
- package/dist/chunk-D4U5Q3FT.js +0 -7
- package/dist/chunk-K2ERX4UT.js +0 -3
- package/dist/chunk-KHE7J5ZN.js +0 -3
- package/dist/chunk-L7SPDE73.js +0 -84
- package/dist/chunk-LHMNRHGV.js +0 -3
- package/dist/chunk-LM72NQ7T.js +0 -3
- package/dist/chunk-MSWVMDAH.js +0 -122
- package/dist/chunk-NH7WNNQC.js +0 -20
- package/dist/chunk-OMPZHGHO.js +0 -2
- package/dist/chunk-SVLTAG5O.js +0 -927
- package/dist/chunk-U7DSEKOM.js +0 -30
- package/dist/chunk-V27BEQJN.js +0 -7
- package/dist/chunk-VMNZB6WI.js +0 -4
- package/dist/chunk-XBN5VO53.js +0 -2
- package/dist/chunk-ZAIILQNP.js +0 -5
- package/dist/command-descriptors-MFU4BCJ7.js +0 -612
- package/dist/direct-navigation-MRMQFIRB.js +0 -3
- package/skills/scip-api-impact/SKILL.md +0 -139
- package/skills/scip-api-impact/agents/openai.yaml +0 -4
- package/skills/scip-calibrate/SKILL.md +0 -131
- package/skills/scip-calibrate/agents/openai.yaml +0 -4
- package/skills/scip-claim-audit/SKILL.md +0 -106
- package/skills/scip-claim-audit/agents/openai.yaml +0 -4
- package/skills/scip-cleanup-audit/SKILL.md +0 -126
- package/skills/scip-cleanup-audit/agents/openai.yaml +0 -4
- package/skills/scip-cleanup-improve/SKILL.md +0 -84
- package/skills/scip-cleanup-improve/agents/openai.yaml +0 -4
- package/skills/scip-concrete-plan/SKILL.md +0 -262
- package/skills/scip-concrete-plan/agents/openai.yaml +0 -4
- package/skills/scip-conductor/SKILL.md +0 -133
- package/skills/scip-conductor/agents/openai.yaml +0 -4
- package/skills/scip-debug/SKILL.md +0 -130
- package/skills/scip-debug/agents/openai.yaml +0 -4
- package/skills/scip-diagram/SKILL.md +0 -110
- package/skills/scip-diagram/agents/openai.yaml +0 -4
- package/skills/scip-directory-architecture/SKILL.md +0 -254
- package/skills/scip-directory-architecture/agents/openai.yaml +0 -4
- package/skills/scip-doc-reconcile/SKILL.md +0 -89
- package/skills/scip-doc-reconcile/agents/openai.yaml +0 -4
- package/skills/scip-hyper-optimization/SKILL.md +0 -156
- package/skills/scip-hyper-optimization/agents/openai.yaml +0 -4
- package/skills/scip-integrity-audit/SKILL.md +0 -152
- package/skills/scip-integrity-audit/agents/openai.yaml +0 -4
- package/skills/scip-language-playbook/SKILL.md +0 -106
- package/skills/scip-language-playbook/agents/openai.yaml +0 -4
- package/skills/scip-maintainability/SKILL.md +0 -158
- package/skills/scip-maintainability/agents/openai.yaml +0 -4
- package/skills/scip-probe-reachability/agents/openai.yaml +0 -4
- package/skills/scip-react-maintainability/SKILL.md +0 -101
- package/skills/scip-react-maintainability/agents/openai.yaml +0 -4
- package/skills/scip-root-cause/SKILL.md +0 -150
- package/skills/scip-root-cause/agents/openai.yaml +0 -4
- package/skills/scip-tla-model-system/SKILL.md +0 -148
- package/skills/scip-tla-model-system/agents/openai.yaml +0 -4
- package/skills/scip-triage-issue/SKILL.md +0 -126
- package/skills/scip-triage-issue/agents/openai.yaml +0 -4
- package/skills/scip-twin-drift/SKILL.md +0 -107
- package/skills/scip-twin-drift/agents/openai.yaml +0 -4
- package/skills/scip-vue-maintainability/SKILL.md +0 -107
- package/skills/scip-vue-maintainability/agents/openai.yaml +0 -4
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as Ne}from"./chunk-3OIKRYU5.js";import{a as Ge}from"./chunk-NN4ZIRPK.js";import{a as pe,b as D,e as he}from"./chunk-P6HBYNBE.js";import{a as be,c as Se,d as Ce,e as F}from"./chunk-24QNP7MN.js";import{a as Ee}from"./chunk-PC44K7RF.js";import{a as Te}from"./chunk-MLGTCX56.js";import{a as Ie}from"./chunk-6YTSKJJ3.js";import{a as ve}from"./chunk-WXAAURU7.js";import{a as De}from"./chunk-KLVJABXA.js";import{a as Fe}from"./chunk-U5CNPPTZ.js";import{a as Re}from"./chunk-GK3GRUJX.js";import{a as we}from"./chunk-TFUU5MQQ.js";import{b as ye}from"./chunk-IYAOX36F.js";import{a as me,b as ge}from"./chunk-JELJLXEE.js";import{a as de,b as fe,c as ue,g as z,h as V}from"./chunk-4CGVLUDP.js";import{b as ke}from"./chunk-LRTP3DKL.js";import{a as H,c as ae,d as ce,e as le}from"./chunk-QHKUY4FW.js";import{a as se}from"./chunk-OHWZKLVA.js";import{a as Ae,e as xe}from"./chunk-26X7KCJR.js";import{a as N,c as j,d as B,e as $e}from"./chunk-47X75ZKH.js";import{c as oe}from"./chunk-XVJ3V7LM.js";import{f as I,g as E}from"./chunk-WMXRRBII.js";import{e as ne}from"./chunk-JERWGHQT.js";import{u as re}from"./chunk-GA64UPMI.js";import{d as _,e as v,f as ie,g as O}from"./chunk-ZTTISZ7J.js";import{a as te}from"./chunk-7LABSJSR.js";import{e as Q}from"./chunk-DGMCFMPG.js";import{B as ee}from"./chunk-B5MHCHP3.js";import{createHash as St}from"crypto";import{existsSync as L}from"fs";function U(e){let[i,t]=A(e,":"),r=i||"unknown",n=(s={})=>{let a=s.actionTier??Ze(r);return{sourceAnalyzer:r,actionTier:a,rootCauseKey:s.rootCauseKey??(t||e),label:s.label??`${r} finding`,relatedFiles:s.relatedFiles??[],why:s.why??[],remediation:s.remediation??Qe(a,r),file:s.file}};if(!t)return n({rootCauseKey:e,why:["Baseline identity did not include analyzer payload."]});if(["dead","isolated","extract","wrapper","passthrough","stale"].includes(r)){let[s,a]=A(t,":");return n({file:s,relatedFiles:s?[s]:[],rootCauseKey:a?`${s}:${a}`:t,label:`${r} finding`,why:a?[`Baseline subject: ${a}.`]:[]})}if(r==="cycle"){let s=t.split(">").filter(Boolean);return n({relatedFiles:s,rootCauseKey:t,label:"cycle finding",why:s.length>0?[`Cycle path: ${s.join(" > ")}.`]:[]})}if(r==="similar"){let s=t.split("|").filter(Boolean);return n({relatedFiles:[],rootCauseKey:t,label:"similarity finding",why:s.length>0?[`Similar symbols: ${s.join(" | ")}.`]:[]})}if(r==="architecture"){let[s,a]=A(t,":");if(s==="forbidden-edge"){let[c,l]=A(a,":"),o=P(c),f=P(l);return n({actionTier:"direct",rootCauseKey:t,label:"architecture boundary violation",why:[`Declared boundary rule rejects ${o} -> ${f}.`],remediation:`Move the dependency behind an allowed boundary, or deliberately update the ${o} dependency rule and baseline.`})}if(s==="cycle"){let c=a.split("|").filter(Boolean).map(P);return n({actionTier:"direct",rootCauseKey:t,label:"forbidden architecture cycle",why:[`requireAcyclic rejects the connected boundary group: ${c.join(", ")}.`],remediation:"Break the boundary cycle, or deliberately revise the acyclicity rule and baseline."})}if(s==="missing-policy-row"){let c=P(a);return n({actionTier:"direct",rootCauseKey:t,label:"incomplete architecture policy",why:[`requireCompletePolicy rejects the missing outgoing dependency row for ${c}.`],remediation:`Declare the allowed outgoing dependencies for ${c}, including an empty row when it must depend on nothing.`})}}if(r==="drift"){let[s,a]=A(t,":"),[c,l]=A(a,":");return n({actionTier:s==="unused-import"?"direct":"signal",file:c,relatedFiles:[...new Set([c,l].filter(Boolean))],rootCauseKey:t,label:`${s||"drift"} finding`,why:[...s?[`Drift kind: ${s}.`]:[],...l?[`Related dependency: ${l}.`]:[]]})}return n({why:["Baseline analyzer prefix is not recognized by this diff-gate version."]})}function Ze(e){switch(e){case"dead":case"isolated":case"cycle":case"passthrough":case"architecture":return"direct";case"similar":case"extract":case"wrapper":case"stale":return"signal";default:return"signal"}}function Qe(e,i){return e==="direct"?`Fix the new ${i} baseline finding, or knowingly accept it via health --write-baseline.`:`Review the new ${i} baseline signal; fix it if it reflects real debt, or knowingly accept it via health --write-baseline.`}function A(e,i){let t=e.indexOf(i);return t<0?[e,""]:[e.slice(0,t),e.slice(t+i.length)]}function P(e){try{return decodeURIComponent(e)}catch{return e}}import{existsSync as et,readFileSync as tt}from"fs";import{isAbsolute as it,join as nt}from"path";var rt=".scipquery-baseline.json";function q(e){if(e.startsWith("similar:")){let i=e.slice(8).split("|");return i.length!==2?e:`similar:${i.map(_).sort().join("|")}`}if(e.startsWith("duplicate-bodies:")){let i=e.slice(17),t=i.indexOf(":");if(t<0)return e;let r=i.slice(0,t),n=i.slice(t+1).split("|");return n.length<2?e:`duplicate-bodies:${r}:${n.map(_).sort().join("|")}`}return e}function x(e,i){return i&&it(i)?i:nt(e.config.projectRoot,i??rt)}function K(e,i,t={}){let r=x(e,t.path);if(!et(r))throw new Error(`No baseline found at ${r}. Create one with: scip-query health --write-baseline`);let s=(JSON.parse(tt(r,"utf-8")).findings??[]).map(q),a=new Set(t.accept?s.filter(t.accept):s),c=new Set(i);return{baselinePath:r,baselineCount:a.size,current:[...i],newFindings:i.filter(l=>!a.has(l)),fixedFindings:[...a].filter(l=>!c.has(l))}}var ot=25e3,st=2500,at=2500;function ct(e){let i=Ie(e);return i.symbols>=ot||i.documents>=st?at:void 0}function je(e,i={}){let{scope:t}=i,r=ct(e),n=[],s=ke(e,{scope:t,...F.dead,scanLimit:r});for(let a of s.symbols)I(e,a.relativePath)||E(e,a.symbol,a.relativePath)||a.kind==="dead-code"&&n.push(`dead:${a.relativePath}:${a.shortName}`);for(let a of De(e,{scope:t,...F.isolated,scanLimit:r}))I(e,a.relativePath)||E(e,a.symbol,a.relativePath)||n.push(`isolated:${a.relativePath}:${a.shortName}`);for(let a of we(e,{scope:t}))a.kind==="real"&&n.push(`cycle:${lt(a.path)}`);for(let a of xe(e,{scope:t,...F.similar,scanLimit:r}))n.push(`similar:${[a.symbolA,a.symbolB].sort().join("|")}`);for(let a of me(e,{scope:t,...F.duplicateBodies,scanLimit:r}))n.push(`duplicate-bodies:${a.hash}:${a.functions.map(c=>c.symbol).sort().join("|")}`);for(let a of Re(e,{scope:t,...F.extract,scanLimit:r}))n.push(`extract:${a.relativePath}:${a.shortName}`);for(let a of Ee(e,{scope:t,...F.wrappers,scanLimit:r}))n.push(`wrapper:${a.file}:${a.shortName}`);for(let a of ve(e,{scope:t,...F.passthroughs,scanLimit:r}))n.push(`passthrough:${a.file}:${a.shortName}`);for(let a of Te(e,{scope:t,...F.stale,scanLimit:r}))n.push(`stale:${a.file}:${a.shortName}`);for(let a of Fe(e,{scope:t,...F.drift,includePatternDeviations:!1,limit:Number.POSITIVE_INFINITY}).results)a.kind!=="architecture-violation"&&n.push(`drift:${a.kind}:${a.file}:${a.dep}`);return n.push(...B(j(e,{scope:t}))),[...new Set(n.map(q))].sort()}function lt(e){if(e.length===0)return"";let i=0;for(let t=1;t<e.length;t++)e[t]<e[i]&&(i=t);return[...e.slice(i),...e.slice(0,i)].join(">")}function yi(e,i={}){let t=je(e,{scope:i.scope}),r=x(e,i.path);return re(r,{version:1,findings:t},{spacing:2,trailingNewline:!0}),{path:r,findingCount:t.length}}function Be(e,i={}){return K(e,je(e,{scope:i.scope}),{path:i.path})}function Pe(e,i={}){let t=B(j(e,{scope:i.scope}));return K(e,t,{path:i.path,accept:r=>r.startsWith(N)})}import{existsSync as dt,readdirSync as ft,readFileSync as ut}from"fs";import{createHash as pt}from"crypto";import{join as X}from"path";function J(e){let i=0,t=0,r=0,n=0,s=0,a=[];for(let o of e)switch(o.state){case"legacy":i+=1;break;case"current":t+=1;break;case"unsupported-older":r+=1,a.push(W(o));break;case"unsupported-future":n+=1,a.push(W(o));break;case"malformed":s+=1,a.push(W(o));break}let c=i+t,l=r+n+s;return{complete:l===0,total:e.length,accepted:c,legacy:i,current:t,unsupportedOlder:r,unsupportedFuture:n,malformed:s,omitted:l,issues:a}}function W(e){if(e.state==="legacy"||e.state==="current")throw new Error(`accepted record ${e.path} cannot become a compatibility issue`);return{path:e.path,state:e.state,reason:e.reason??e.state}}var Me=X(".scipquery","suppressions"),Ke="scip-query-suppression",Y=1;function ht(e){return X(e,Me)}function mt(e){if(e.id&&e.id.trim()!=="")return`${e.id.trim()}.json`;let i=`${e.check??""}\0${e.file??""}`;return`CHECK-${pt("sha256").update(i).digest("hex").slice(0,12).toUpperCase()}.json`}function gt(e){return mt(e).slice(0,-5)}function yt(e,i){if(typeof e!="object"||e===null||Array.isArray(e))return{state:"malformed",error:"not a suppression object"};let t=e;if(t.schemaVersion===void 0&&(t.kind!==void 0||t.suppressionIdentity!==void 0||t.writer!==void 0))return{state:"malformed",error:"suppression envelope metadata requires schemaVersion"};if(t.schemaVersion!==void 0){if(!Number.isSafeInteger(t.schemaVersion))return{state:"malformed",error:"schemaVersion must be a positive safe integer"};if(t.schemaVersion!==Y)return{state:t.schemaVersion>Y?"unsupported-future":"unsupported-older",error:`unsupported schemaVersion ${String(t.schemaVersion)}`};if(t.kind!==void 0&&t.kind!==Ke)return{state:"malformed",error:`kind must be ${Ke}`}}if(typeof t.reason!="string"||t.reason.trim()==="")return{state:"malformed",error:"missing reason"};if(!t.id&&!t.check)return{state:"malformed",error:"needs an id or a check"};let r=bt(t);if(t.schemaVersion===void 0)return{state:"legacy",suppression:r,record:t,schemaVersion:0};let n=gt(r);return t.suppressionIdentity!==n||i!==void 0&&t.suppressionIdentity!==i?{state:"malformed",error:"suppressionIdentity does not match the suppression target or filename"}:!t.writer||t.writer.tool!=="scip-query"||typeof t.writer.version!="string"||t.writer.version.trim()===""?{state:"malformed",error:"missing valid writer metadata"}:typeof t.createdAt!="string"||!Number.isFinite(Date.parse(t.createdAt))?{state:"malformed",error:"missing valid createdAt timestamp"}:t.updatedAt!==void 0&&(typeof t.updatedAt!="string"||!Number.isFinite(Date.parse(t.updatedAt)))?{state:"malformed",error:"invalid updatedAt timestamp"}:{state:"current",suppression:r,record:t,schemaVersion:Y}}function Le(e){let i=ht(e);if(!dt(i))return{suppressions:[],compatibility:J([]),warnings:[]};let t=[],r=[];for(let s of ft(i).sort()){if(!s.endsWith(".json"))continue;let a=X(i,s),c=`${Me}/${s}`,l;try{l=JSON.parse(ut(a,"utf-8"))}catch{r.push({path:c,state:"malformed",reason:"malformed JSON"});continue}let o=yt(l,s.slice(0,-5));if("error"in o){r.push({path:c,state:o.state,reason:o.error});continue}r.push({path:c,state:o.state}),t.push(o.suppression)}let n=J(r);return{suppressions:t,compatibility:n,warnings:n.issues.map(s=>`${s.path}: ${s.reason} \u2014 ignored`)}}function bt(e){return{...typeof e.id=="string"?{id:e.id}:{},...typeof e.check=="string"?{check:e.check}:{},...typeof e.file=="string"?{file:e.file}:{},reason:e.reason,...typeof e.expiresAt=="string"?{expiresAt:e.expiresAt}:{},...typeof e.createdAt=="string"?{createdAt:e.createdAt}:{}}}var en=["echo","incomplete-migration","co-change-partner","twin-partner","coverage-contract","architecture","doc-reference","unused-params","new-dead","baseline"];function tn(e,i={}){let t=i.base??"HEAD",{minTogether:r=6,minConfidence:n=.6,maxEchoChecks:s=Number.POSITIVE_INFINITY,maxHelpers:a=Number.POSITIVE_INFINITY,minSimilarity:c=.8,includeBaseline:l=!1,scanLimit:o}=i,f=i.semantic!==!1,h=i.historyMode??"bounded",u=new Set(i.skip??[]),p=Le(e.config.projectRoot),m=ue(e,{base:t}),y=fe(e,{base:t,plan:m}),S=y.changedFiles,d=new Set(S),w=new Set(m.changedFileLines),$=new Set([...d,...w]),C=z(e.config.projectRoot,t,V(m,S)),T=Ut(e.config.projectRoot,t,m,C),g={base:t,changedFiles:S,changedSymbols:y.changedSymbols.length,checksRun:[],skipped:[],suppressed:[],findings:[],attributionNotes:y.attributionNotes,rootCauseGroups:[],recordCompatibility:{suppressions:p.compatibility},note:y.summary.note};if(S.length===0)return g;let k=(G,We)=>{if(u.has(G)){g.skipped.push({check:G,reason:"skipped via --skip"});return}let Je=g.findings.length,Ye=g.skipped.length,Xe=g.checksRun.length;ee(`diff-gate.check.${G}`,We,()=>({check:G,changedFiles:S.length,changedSymbols:y.changedSymbols.length,findingsAdded:g.findings.length-Je,skippedAdded:g.skipped.length-Ye,checksRunAdded:g.checksRun.length-Xe}))};return k("echo",()=>kt(e,y.changedSymbols,d,T,s,c,o,f,g)),k("incomplete-migration",()=>xt(e,t,m,a,o,f,C,g)),k("co-change-partner",()=>Tt(e,$,r,n,h,g)),k("twin-partner",()=>It(e,y.changedSymbols,d,o,g)),k("coverage-contract",()=>Et(e,$,g)),k("architecture",()=>Jt(e,g)),k("doc-reference",()=>Pt(e,d,w,m.changedRanges,m.renamedFiles,g)),k("unused-params",()=>_t(e,S,g)),k("new-dead",()=>Ot(e,y.changedSymbols,T,g)),l&&k("baseline",()=>Wt(e,g)),$t(g,[...e.config.suppressions??[],...p.suppressions]),g.rootCauseGroups=Ct(g.findings),g}function nn(e){return e.checksRun.length===0&&e.note===de}function rn(e){return e.filter(i=>!i.advisory)}function Ct(e){let i=new Map;for(let t of e){let r=t.groupKey??`${t.check}:${t.id}`,n=i.get(r);n||(n={groupKey:r,check:t.check,severity:t.severity,actionTier:t.actionTier,sourceAnalyzer:t.sourceAnalyzer,rootCauseKey:t.rootCauseKey,count:0,findingIds:[],files:new Set,relatedFiles:new Set,message:t.message,remediation:t.remediation},i.set(r,n)),n.count+=1,n.findingIds.push(t.id),n.severity=Ue(n.severity,t.severity),n.actionTier=qe(n.actionTier,t.actionTier),t.file&&n.files.add(t.file);for(let s of t.relatedFiles??[])n.relatedFiles.add(s)}return[...i.values()].map(t=>({...t,files:[...t.files].sort(),relatedFiles:[...t.relatedFiles].sort()})).sort((t,r)=>r.count-t.count||M(r.severity)-M(t.severity)||t.groupKey.localeCompare(r.groupKey))}function Ue(e,i){return M(i)>M(e)?i:e}function M(e){return e==="error"?2:e==="warning"?1:0}function qe(e,i){return e?i&&_e(i)>_e(e)?i:e:i}function _e(e){return e==="direct"?2:e==="signal"?1:0}function $t(e,i){if(i.length===0||e.findings.length===0)return;let t=[];for(let r of e.findings){let n=i.find(s=>wt(s,r));n?e.suppressed.push({finding:r,suppression:n}):t.push(r)}e.findings=t}function wt(e,i){return!e.reason||e.reason.trim()===""||e.expiresAt&&Date.parse(e.expiresAt)<=Date.now()||e.id&&e.id!==i.id&&!i.legacySuppressionIds?.includes(e.id)||e.check&&e.check!==i.check||e.file&&e.file!==i.file?!1:!!(e.id||e.check)}function R(e,i){e.findings.push({...i,suppressionHint:`scip-query: ignore ${i.check} ${i.id} -- <reason>`})}function kt(e,i,t,r,n,s,a,c,l){l.checksRun.push("echo");for(let o of i.slice(0,n)){if(!O(o.symbol)||r(o))continue;let f=ge(e,o.symbol,{maxLoc:15,scanLimit:a}).filter(d=>!t.has(d.file)).slice(0,5).map(d=>({otherFile:d.file,otherShort:d.shortName,otherSymbol:d.symbol,similarity:1,similarityBasis:"exact-body",sharedEvidence:[`exact normalized body (${d.loc} LOC)`]}));if(f.length>0){let d=b("echo",o.symbol,o.file),w=b("echo",o.symbol,o.file,...f.map(C=>`${C.otherSymbol}|${C.otherFile}`).sort()),$=f[0];R(l,{id:d,legacySuppressionIds:w===d?void 0:[w],groupKey:d,actionTier:"direct",check:"echo",severity:"warning",evidence:"heuristic",confidence:1,file:o.file,symbol:o.symbol,relatedFiles:[...new Set(f.map(C=>C.otherFile))].sort(),sourceAnalyzer:"duplicate-bodies",rootCauseKey:`${o.symbol}:${$.otherSymbol}`,message:He(o,f),why:ze(o,f),remediation:Ve("direct",o.shortName,$.otherShort)});continue}let h=Ae(e,o.symbol,{minSimilarity:s,limit:5,scanLimit:a,semantic:c,sourceCandidateMode:"target-pruned"}),u=[];for(let d of h){let w=d.fileA===o.file?d.fileB:d.fileA,$=d.fileA===o.file?d.shortNameB:d.shortNameA,C=d.fileA===o.file?d.symbolB:d.symbolA;t.has(w)||u.push({otherFile:w,otherShort:$,otherSymbol:C,similarity:d.similarity,similarityBasis:d.similarityBasis??"callees",sharedEvidence:d.sharedCallees})}if(u.length===0)continue;let p=u[0],m=b("echo",o.symbol,o.file,...u.map(d=>`${d.otherSymbol}|${d.otherFile}`).sort()),y=b("echo",o.symbol,o.file),S=Ft(o,u);R(l,{id:y,legacySuppressionIds:m===y?void 0:[m],groupKey:y,actionTier:S,check:"echo",severity:"warning",evidence:"heuristic",confidence:p.similarity,file:o.file,symbol:o.symbol,relatedFiles:[...new Set(u.map(d=>d.otherFile))].sort(),message:He(o,u),why:ze(o,u),remediation:Ve(S,o.shortName,p.otherShort)})}i.length>n&&l.skipped.push({check:"echo",reason:`echo check capped at ${n} of ${i.length} changed symbols`})}function Ft(e,i){return i.some(r=>Rt(e.symbol,r))?"direct":"signal"}function Rt(e,i){if(i.similarityBasis==="exact-body")return!0;if(i.similarityBasis!=="source-tokens"||i.similarity<.98||i.sharedEvidence.length>8)return!1;let t=v(e),r=v(i.otherSymbol);return!t||!r?!1:t===r?!0:At(i.sharedEvidence)?!1:Dt(t,r)}function Dt(e,i){let t=Oe(e),r=Oe(i);if(t.length===0||r.length===0)return!1;let n=new Set(r),s=t.filter(a=>n.has(a)).length;return s>=2&&s/Math.min(t.length,r.length)>=.5}function Oe(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").split(/[^A-Za-z0-9]+/).map(i=>i.toLowerCase()).filter(i=>i.length>=2)}var vt=new Set(["bytes","crypto","hex","num","random","secret","to","token"]);function At(e){return e.length>=3&&e.every(i=>vt.has(i.toLowerCase()))}function He(e,i){let t=i[0],r=Math.round(t.similarity*100);return i.length===1?`${e.shortName} (${e.file}) is ${r}% similar to established ${t.otherShort} (${t.otherFile})`:`${e.shortName} (${e.file}) resembles ${i.length} established symbol(s); strongest is ${r}% similar to ${t.otherShort} (${t.otherFile})`}function ze(e,i){let t=[`${e.shortName} was changed in this diff.`];for(let r of i.slice(0,3))t.push(`${r.otherShort} is outside this diff and scored ${Math.round(r.similarity*100)}% similar by ${r.similarityBasis} evidence.`),t.push(`Shared evidence: ${r.sharedEvidence.slice(0,5).join(", ")||"(none listed)"}.`);return i.length>3&&t.push(`${i.length-3} additional similar match(es) grouped into this finding.`),t}function Ve(e,i,t){return e==="direct"?`Extract or reuse the shared behavior with ${t}, or keep the duplicate with a suppression reason.`:`Review whether ${i} is intentionally parallel to the established implementation(s); extract shared behavior only if the product semantics match.`}function xt(e,i,t,r,n,s,a,c){let l=Ge(e,{base:i,maxHelpers:r,diffPlan:t,scanLimit:n,semantic:s,baseContentAt:a});if(!l.available){c.skipped.push({check:"incomplete-migration",reason:"no git history"});return}c.checksRun.push("incomplete-migration"),l.note&&c.skipped.push({check:"incomplete-migration",reason:l.note});for(let o of l.findings){let f=o.leftovers.map(d=>`${d.shortName} (${d.file}, ${Math.round(d.containment*100)}% helper / ${Math.round(d.siteCoverage*100)}% site, ${d.migrationScope})`).join(", "),h=o.leftovers.map(d=>`${d.shortName}: ${d.migrationScope} (${d.migrationScopeReasons[0]})`).join("; "),u=[...o.migratedFiles,...o.leftovers.map(d=>d.file)],p=o.leftovers.length===0?void 0:Math.max(...o.leftovers.map(d=>Math.min(d.containment,d.siteCoverage))),m=o.leftovers.some(d=>d.migrationScope==="possible-subtype"),y=b("incomplete-migration",o.helperSymbol,o.helperFile,u.join("|")),S=b("incomplete-migration",o.helperSymbol,o.helperFile);R(c,{id:S,legacySuppressionIds:y===S?void 0:[y],check:"incomplete-migration",severity:"warning",evidence:"heuristic",confidence:p,file:o.helperFile,symbol:o.helperSymbol,relatedFiles:u,message:`new helper ${o.helperShortName} (${o.helperFile}) is wired into ${o.migratedFiles.length} file(s), but ${o.leftovers.length} similar un-migrated site(s) remain: ${f}`,why:[`${o.helperShortName} is new in this diff and already referenced by ${o.migratedFiles.join(", ")}.`,`Helper shape: ${o.helperShape}; ${o.specificHelperCalleeCount}/${o.helperCalleeCount} helper callees are specific enough to score.`,`Unchanged site(s) still contain the helper's callee pattern: ${f}.`,`Migration scope hints: ${h}.`],remediation:m?`Migrate same-scope sites to ${o.helperShortName}; review possible subtype/variant sites before applying the helper.`:`Migrate the remaining sites to ${o.helperShortName}, or confirm they are intentionally different.`})}}function Tt(e,i,t,r,n,s){let a=se(e,{historyMode:n}).directionalCoChangePairsForFiles(i,{minTogether:t,minConfidence:0,maxFilesPerCommit:20});if(!a){s.skipped.push({check:"co-change-partner",reason:"no git history"});return}s.checksRun.push("co-change-partner");let c=new Set,l;for(let o of a){let f=i.has(o.fileA),h=i.has(o.fileB);if(f===h)continue;let u=f?o.fileA:o.fileB,p=f?o.fileB:o.fileA,m=f?o.changesA:o.changesB,y=m>0?o.together/m:0;if(y<r||H(p)||H(u)||!L(`${e.config.projectRoot}/${p}`))continue;let S=`${u}|${p}`;if(c.has(S))continue;c.add(S);let d=b("co-change-partner",u,p,String(o.together)),w=b("co-change-partner",u,p),$=ae(u,p),C=ce({fileA:u,fileB:p,together:o.together,confidence:y,commitScope:o.commitScope,recency:o.recency,subjectContext:o.subjectContext},$,(l??=le(e))(u,p)),T=[u,p].sort().join("|");s.findings.push({id:w,legacySuppressionIds:d===w?void 0:[d],check:"co-change-partner",severity:"warning",evidence:"change-graph",actionTier:"signal",groupKey:`co-change-partner:${T}`,confidence:y,file:u,relatedFiles:[p],sourceAnalyzer:"co-change",rootCauseKey:T,partnerClass:$.partnerClass,partnerClassReasons:$.reasons,commitScope:o.commitScope,recency:o.recency,focusedTogether:o.focusedTogether,broadTogether:o.broadTogether,broadCommitRatio:o.broadCommitRatio,lastTogetherAt:o.lastTogetherAt,recentTogether:o.recentTogether,subjectContext:o.subjectContext,...C?{declaredCouplingSuggestion:C}:{},message:`${u} changed, but ${p} did not \u2014 they change together ${o.together}x (${Math.round(y*100)}% of the time)`,why:[`${u} is in this diff and ${p} is not.`,`Git history shows ${o.together} co-change(s), which is ${Math.round(y*100)}% of changes to the edited side.`,`History context: ${Gt(o)}.`,`Subject context: ${Nt(o.subjectContext)}.`,...jt(o),`Partner class: ${$.partnerClass} (${$.reasons.join("; ")}).`],remediation:C?`Update ${p} alongside this change, declare the coupling "${C.name}", or confirm the coupling no longer holds.`:`Update ${p} alongside this change, or confirm the coupling no longer holds.`})}}function It(e,i,t,r,n){n.checksRun.push("twin-partner");let s=ye(e,{scanLimit:r}).filter(l=>l.relationship==="divergent"||l.relationship==="identical");if(s.length===0)return;let a=new Map;for(let l of s)for(let o of l.members)a.set(o.symbol,l);let c=new Set;for(let l of i){if(!O(l.symbol))continue;let o=a.get(l.symbol);if(!o)continue;let f=o.members.filter(m=>m.symbol!==l.symbol&&!t.has(m.file));if(f.length===0)continue;let h=[l.symbol,...f.map(m=>m.symbol)].sort().join("|");if(c.has(h))continue;c.add(h);let u=f[0],p=b("twin-partner",l.symbol,l.file,u.symbol);R(n,{id:p,groupKey:`twin-partner:${h}`,check:"twin-partner",severity:"warning",evidence:"heuristic",actionTier:"signal",advisory:!0,confidence:o.relationship==="identical"?1:Math.max(0,1-o.maxDivergence),file:l.file,symbol:l.symbol,relatedFiles:f.map(m=>m.file).sort(),sourceAnalyzer:"twin-drift",rootCauseKey:h,message:`${l.shortName} (${l.file}) changed but its same-name twin ${u.shortName} (${u.file}) did not \u2014 verify the change shouldn't apply to both, or consolidate them.`,why:[`${l.symbol} is in this diff.`,`${u.symbol} shares its (near-)name and is classified '${o.relationship}' with it, but ${u.file} is not in this diff.`,o.relationship==="divergent"?`The two bodies already diverge (~${Math.round(o.maxDivergence*100)}% token difference) \u2014 this diff may widen or narrow that drift.`:"The two bodies were byte-identical before this diff.","Advisory: twin-partner never fails the gate by itself \u2014 see the twin-partner entry in the diff-gate checks table."],remediation:`Update ${u.file} alongside this change, consolidate ${l.shortName}/${u.shortName} into one helper, or confirm the twin should diverge on purpose.`})}}function Et(e,i,t){t.checksRun.push("coverage-contract");let r=e.config.coverageContracts??[];for(let n of r){if(!Se(n,i))continue;let s=be(e,n);if(s.status==="ok")continue;let a=b("coverage-contract",n.name,n.file);R(t,{id:a,groupKey:`coverage-contract:${n.name}`,check:"coverage-contract",severity:s.status==="unavailable"?"warning":"error",evidence:"graph-fact",actionTier:"direct",file:n.file,sourceAnalyzer:"coverage-contracts",rootCauseKey:n.name,message:Ce(s),why:[`Contract "${n.name}" declares that ${n.file} (${n.keys.type}) must track ${n.mustEqual.type}.`,s.status==="unavailable"?`The declared side could not be evaluated: ${s.unavailableReason}.`:`Missing: ${s.missing.join(", ")||"none"}. Extra: ${s.extra.join(", ")||"none"}.`,"Either side of this contract changed in this diff."],remediation:s.status==="unavailable"?"Investigate why the declared key set could not be parsed (see the reason above) \u2014 do not treat this as a pass.":`Update ${n.file} so its ${n.keys.type==="object-literal-keys"||n.keys.type==="string-array"?n.keys.identifier:n.keys.marker} matches ${n.mustEqual.type}, or fix the ground-truth source if the declared set is right.`})}}function Gt(e){return`${e.commitScope}/${e.recency}; ${e.focusedTogether} focused, ${e.broadTogether} broad-sweep (${Math.round(e.broadCommitRatio*100)}% broad), ${e.recentTogether} recent, last ${Bt(e.lastTogetherAt)}`}function Nt(e){let i=e.subjectLabels.length>0?e.subjectLabels.slice(0,5).join(", "):"none inferred",t=e.issueRefs.length>0?e.issueRefs.slice(0,5).join(", "):"none",r=e.sampleSubjects.length>0?e.sampleSubjects.slice(0,3).map(n=>`"${n}"`).join("; "):"none";return`labels ${i}; refs ${t}; samples ${r}; external issue/PR labels ${e.externalIssueLabelStatus}`}function jt(e){let i=[];return e.commitScope==="broad-sweep"&&i.push("Broad-sweep history is weaker than focused co-edits; confirm this is a real coordination contract."),e.recency==="stale"&&i.push("The pair has no co-change in the recent history window; confirm the coupling still holds."),i}function Bt(e){return e<=0?"unknown":new Date(e*1e3).toISOString().slice(0,10)}var Z=3;function Pt(e,i,t,r,n,s){s.checksRun.push("doc-reference");let a=D.referenceTargets(e,i,r);if(a.size===0)return;let c=new Set(n.map(o=>o.from)),l=[];for(let o of he(e,a))t.has(o.doc)||pe(e,o.doc)||l.push(Kt(e,o,c));for(let o of Mt(l))R(s,o)}function Kt(e,i,t){let r=i.citedClaims.length>0?i.citedClaims:D.citationContexts(e,i.doc,i.cited),n=D.classifyCitation(r),s=D.hasLineAnchoredCitation(i.citations),a=i.cited.some(h=>t.has(h)||!L(`${e.config.projectRoot}/${h}`)),c=!(s||a),l=i.cited[0]??"",o=b("doc-reference",i.doc,i.cited.join("|")),f=b("doc-reference",i.doc,l);return{id:f,legacySuppressionIds:o===f?void 0:[o],check:"doc-reference",severity:"warning",evidence:"change-graph",actionTier:n.actionTier,groupKey:`doc-reference:${l}`,rootCauseKey:l,confidence:1,file:i.doc,relatedFiles:i.cited,citationKind:n.citationKind,citationKindReasons:n.reasons,citedClaims:r,...c?{advisory:!0}:{},message:`${i.doc} cites ${i.cited.join(", ")} as ${D.citationKindLabel(n.citationKind)} \u2014 changed in this diff, doc untouched`,why:[`${i.cited.join(", ")} changed in this diff.`,`${i.doc} cites the changed file(s) but was not updated in the same diff.`,...n.reasons.map(h=>`Citation kind evidence: ${h}`),c?"Advisory: bare file-mention citation (no line anchor, cited file still present under the same path) \u2014 21.2 calibration found this citation shape low-precision; verify at your leisure.":s?"Blocking: citation includes a line anchor that may now point at the wrong lines.":"Blocking: the cited file was deleted or renamed in this diff \u2014 the citation almost certainly needs an update."],remediation:D.citationRemediation(n.citationKind,i.doc)}}function Mt(e){let i=new Map;for(let r of e){let n=r.rootCauseKey??"",s=i.get(n);s?s.push(r):i.set(n,[r])}let t=[];for(let[r,n]of i)n.length<=Z?t.push(...n):t.push(Lt(r,n));return t}function Lt(e,i){let t=[...i].sort((f,h)=>(f.file??"").localeCompare(h.file??"")),r=t.slice(0,Z).map(f=>({doc:f.file??"",citedClaims:f.citedClaims??[]})),n=t.length-r.length,s=t.every(f=>f.advisory===!0),a=t.reduce((f,h)=>Ue(f,h.severity),"info"),c=t.reduce((f,h)=>qe(f,h.actionTier),void 0),l=t.map(f=>f.file??"").filter(f=>f.length>0),o=[...new Set(t.flatMap(f=>[f.id,...f.legacySuppressionIds??[]]))];return{id:b("doc-reference","hub-cluster",e),memberFindingIds:o,check:"doc-reference",severity:a,evidence:"change-graph",actionTier:c,groupKey:`doc-reference:${e}`,rootCauseKey:e,confidence:1,file:r[0]?.doc,relatedFiles:[e],citationCount:t.length,citationExemplars:r,suppressedCount:n,...s?{advisory:!0}:{},message:`${e} is cited by ${t.length} doc(s) changed in this diff, doc(s) untouched \u2014 showing ${r.length} example(s), ${n} more damped`,why:[`${e} changed in this diff.`,`${t.length} doc(s) cite it but were not updated in the same diff: ${l.join(", ")}.`,...r.map(f=>`Example \u2014 ${f.doc}: ${f.citedClaims[0]??"(no captured citation text)"}`),`${n} additional doc(s) also cite this file, past the per-hub-file cascade cap (${Z}) \u2014 not silently dropped: counted in citationCount/suppressedCount and individually addressable via memberFindingIds.`,s?"Advisory: every citation in this cluster is a bare file-mention (no line anchor, cited file still present).":"Blocking: at least one citation in this cluster is line-anchored or cites a deleted/renamed file."],remediation:`Review the ${r.length} example doc(s) above; ${t.length} total doc(s) cite ${e} the same way \u2014 see citationExemplars and memberFindingIds in --json for the complete list.`}}function _t(e,i,t){t.checksRun.push("unused-params");for(let r of Ne(e,{files:i,limit:50})){let n=b("unused-params",r.symbol,r.file,r.unusedTrailing.join("|")),s=b("unused-params",r.symbol,r.file);R(t,{id:s,legacySuppressionIds:n===s?void 0:[n],check:"unused-params",severity:"warning",evidence:"heuristic",confidence:.85,file:r.file,startLine:r.startLine,endLine:r.endLine,symbol:r.symbol,message:`${r.shortName} (${r.file}) has trailing unused parameter(s): ${r.unusedTrailing.join(", ")}`,why:[`${r.shortName} is in a changed file.`,`The trailing parameter(s) ${r.unusedTrailing.join(", ")} are not referenced in the function body.`],remediation:"Drop the unused trailing parameters and their call-site arguments."})}}function Ot(e,i,t,r){r.checksRun.push("new-dead");let n=new oe(e),s=Q(e.config.projectRoot),a=s.length>1;for(let c of i){if(t(c)||c.fanIn>0||n.fileKind(c.file)==="test"||I(e,c.file)||E(e,c.symbol,c.file)||Vt(c.symbol))continue;let l=b("new-dead",c.symbol,c.file),o=a&&Ht(s,c.file)&&zt(e,c.symbol);R(r,{id:l,check:"new-dead",severity:"warning",evidence:o?"heuristic":"graph-fact",confidence:o?.4:.9,file:c.file,symbol:c.symbol,message:o?`${c.shortName} (${c.file}) unconfirmed (cross-package ambiguous-name resolution gap): zero indexed consumers found, but this name is ambiguous project-wide and lives in a workspace package \u2014 verify manually before treating as dead`:`${c.shortName} (${c.file}) was changed but has zero indexed consumers`,why:o?[`${c.shortName} is a changed production symbol in a workspace package.`,"The index, semantic, and source-fallback layers all report zero consumers for this symbol.","Its leaf name is ambiguous project-wide (a same-named definition exists elsewhere), and cross-package consumers reached only through a re-exporting barrel are a known unresolvable shape for this tool \u2014 see docs/plans/2026-07-02-followups.md item 2."]:[`${c.shortName} is a changed production symbol.`,"The index reports zero consumers for this symbol.","The symbol is not in a detected entry surface or configured live root."],remediation:o?"Verify with a direct code search before deleting; this tool cannot confidently resolve this symbol.":"Wire it up, or remove it before it becomes permanent dead code."})}}function Ht(e,i){return e.some(t=>i===t.relativeDir||i.startsWith(`${t.relativeDir}/`))}function zt(e,i){let t=v(i);return t?(ne(e).get(t)?.length??0)>1:!1}function Vt(e){if(ie(e)!=="type")return!1;let i=v(e);return i.startsWith("_Assert")||i.startsWith("Assert")}function Ut(e,i,t,r){let n=new Map(t.renamedFiles.map(a=>[a.to,a.from])),s=r??z(e,i,V(t));return a=>{let c=n.get(a.file)??a.file,l=v(a.symbol);if(!l)return!1;let o=s(c);return o!==null&&qt(o,l)}}function qt(e,i){return new RegExp(`\\b${te(i)}\\b`).test(e)}function Wt(e,i){if(!L(x(e))){i.skipped.push({check:"baseline",reason:"no .scipquery-baseline.json \u2014 run health --write-baseline to enable"});return}i.checksRun.push("baseline");let t=Be(e);for(let r of t.newFindings.filter(n=>!n.startsWith(N))){let n=U(r),s=b("baseline",r);R(i,{id:s,groupKey:`baseline:${n.sourceAnalyzer}:${n.rootCauseKey}`,check:"baseline",severity:"error",evidence:"baseline",actionTier:n.actionTier,confidence:1,file:n.file,relatedFiles:n.relatedFiles.length>0?n.relatedFiles:void 0,sourceAnalyzer:n.sourceAnalyzer,rootCauseKey:n.rootCauseKey,message:`new ${n.label} vs committed baseline: ${r}`,why:["A committed health baseline exists.","The current health result contains a finding not present in that baseline.",`Underlying analyzer: ${n.sourceAnalyzer}.`,`Inherited action tier: ${n.actionTier}.`,`Root cause key: ${n.rootCauseKey}.`,...n.why],remediation:n.remediation})}}function Jt(e,i){if(!$e(e.config.architecture)){i.skipped.push({check:"architecture",reason:"no closed architecture dependency rows, requireCompletePolicy rule, or requireAcyclic rule configured"});return}if(!L(x(e))){i.skipped.push({check:"architecture",reason:"no .scipquery-baseline.json \u2014 run health --write-baseline to enable"});return}i.checksRun.push("architecture");let t=Pe(e);for(let r of t.newFindings){let n=U(r),s=b("architecture",r);R(i,{id:s,groupKey:`architecture:${n.rootCauseKey}`,check:"architecture",severity:"error",evidence:"baseline",actionTier:"direct",confidence:1,sourceAnalyzer:"architecture",rootCauseKey:n.rootCauseKey,message:`new ${n.label} vs committed baseline: ${r}`,why:["The project declares an enforceable architecture rule.","The current boundary graph contains a violation not present in the committed baseline.",...n.why],remediation:n.remediation})}}function b(e,...i){return`SQ${St("sha256").update([e,...i].join("\0")).digest("hex").slice(0,12).toUpperCase()}`}export{je as a,yi as b,Be as c,Pe as d,en as e,tn as f,nn as g,rn as h,Ut as i};
|
|
2
|
+
//# sourceMappingURL=chunk-HEBAY673.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{execFileSync as l,spawnSync as P}from"child_process";import{platform as g}from"os";var a=g()==="win32";function i(e){let n=a?"where":"which";try{return l(n,[e],{stdio:"pipe",timeout:1e4,killSignal:"SIGKILL"}),!0}catch{return!1}}var m=/\.(?:c|m)?js$/i,f=/\.(?:exe|com)$/i;function E(e,n){return m.test(e)?{binary:process.execPath,args:[e,...n]}:{binary:e,args:[...n]}}function d(e,n){return l(e,n,{stdio:["ignore","pipe","ignore"],encoding:"utf8",timeout:1e4,killSignal:"SIGKILL"})}function _(e,n={}){let r=n.isWindows??a,p=n.lookup??d,o;try{o=p(r?"where":"which",[e])}catch{return null}let s=o.split(/\r?\n/).map(t=>t.trim()).filter(Boolean);return r?s.find(t=>f.test(t))??null:s[0]??null}import{execFileSync as c}from"child_process";import{createRequire as h}from"module";import{existsSync as S}from"fs";import{platform as u,arch as w}from"os";var y="https://github.com/sourcegraph/scip",v="SCIP_QUERY_SCIP_BIN";function x(e){if(e.isOnPath("scip"))return{source:"path",path:"scip"};let n=e.env[v];if(n&&e.fileExists(n))return{source:"env",path:n};if(e.platform==="win32"){let r=e.resolveSidecar(e.arch);if(r&&e.fileExists(r))return{source:"sidecar",path:r}}return null}function b(e){let n=h(import.meta.url);for(let r of e==="arm64"?["arm64","x64"]:[e])try{return n.resolve(`scip-query-scip-windows/scip-win32-${r}.exe`)}catch{}return null}function k(e=process.env){return x({platform:u(),arch:w(),env:e,isOnPath:i,fileExists:S,resolveSidecar:b})?.path??null}function O(e){if(u()==="darwin"&&i("brew")){e("Installing scip CLI via Homebrew...");try{if(c("brew",["install","sourcegraph/scip/scip"],{stdio:"inherit",timeout:3e5,env:process.env}),i("scip"))return e("Successfully installed scip CLI via Homebrew"),!0}catch(n){let r=n instanceof Error?n.message:String(n);e(`Homebrew install failed: ${r}`)}}if(i("go")){e("Installing scip CLI via go install...");try{if(c("go",["install","github.com/sourcegraph/scip/cmd/scip@latest"],{stdio:"inherit",timeout:3e5,env:process.env}),i("scip"))return e("Successfully installed scip CLI via go install"),!0}catch(n){let r=n instanceof Error?n.message:String(n);e(`go install failed: ${r}`)}}return e("Could not auto-install scip CLI."),e(`Install manually from: ${y}/releases`),!1}export{i as a,E as b,_ as c,k as d,O as e};
|
|
2
|
+
//# sourceMappingURL=chunk-HELS7KFF.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{a as m}from"./chunk-
|
|
1
|
+
import{a as m}from"./chunk-N3SE646F.js";import{a as h}from"./chunk-2OXVAGGT.js";import{d as g}from"./chunk-ZTTISZ7J.js";import{readFileSync as f}from"fs";import{extname as y,join as d}from"path";function M(t,e,a={}){let{context:s=0}=a,r=L(e);if(r)return j(t,r.filePath,r.startLine,r.endLine,s);let i=h(t,e);return i?R(t,i,s):null}function L(t){let e=t.match(/^(.+\.\w+):(\d+)-(\d+)$/);return e?{filePath:e[1],startLine:parseInt(e[2],10),endLine:parseInt(e[3],10)}:null}function R(t,e,a){let s=t.get("SELECT language FROM documents WHERE relative_path = ?",e.relativePath),r=d(t.config.projectRoot,e.relativePath),i;try{i=f(r,"utf-8")}catch{return null}let n=i.split(`
|
|
2
2
|
`),c=Math.max(0,e.startLine-a),l=Math.min(n.length-1,e.endLine+a),u=n.slice(c,l+1).join(`
|
|
3
3
|
`);return{symbol:e.symbol,shortName:g(e.symbol),relativePath:e.relativePath,startLine:c,endLine:l,language:s?.language??v(e.relativePath),source:u}}function j(t,e,a,s,r){let i=m(t,e);if(!i)return null;let n=t.get("SELECT relative_path, language FROM documents WHERE relative_path = ?",i);if(!n)return null;let c=d(t.config.projectRoot,n.relative_path),l;try{l=f(c,"utf-8")}catch{return null}let u=l.split(`
|
|
4
4
|
`),o=Math.max(0,a-1-r),p=Math.min(u.length-1,s-1+r),b=u.slice(o,p+1).join(`
|
|
5
5
|
`);return{symbol:`${n.relative_path}:${a}-${s}`,shortName:`${n.relative_path}:${a}-${s}`,relativePath:n.relative_path,startLine:o,endLine:p,language:n.language??v(n.relative_path),source:b}}function v(t){switch(y(t).toLowerCase()){case".ts":case".tsx":case".mts":case".cts":return"typescript";case".js":case".jsx":case".mjs":case".cjs":return"javascript";case".py":case".pyi":return"python";case".rs":return"rust";case".go":return"go";case".java":return"java";case".kt":case".kts":return"kotlin";case".scala":return"scala";case".rb":return"ruby";case".php":return"php";case".cs":return"csharp";case".vb":return"vb";case".dart":return"dart";case".c":case".h":return"c";case".cc":case".cpp":case".cxx":case".hpp":case".hh":case".hxx":return"cpp";case".vue":return"vue";default:return null}}export{M as a};
|
|
6
|
-
//# sourceMappingURL=chunk-
|
|
6
|
+
//# sourceMappingURL=chunk-IPDCSB6N.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{f as B,g as S}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{f as B,g as S}from"./chunk-JELJLXEE.js";import{b as L,c as k}from"./chunk-WMXRRBII.js";import{b as O}from"./chunk-B75HZHUP.js";import{a as E}from"./chunk-BGBBVSH4.js";import{d as P}from"./chunk-MTDBHTSF.js";import{d as I,g as z,j as D,t as $}from"./chunk-ZTTISZ7J.js";import{b as T,k as v,p as A}from"./chunk-7LABSJSR.js";import{c as b}from"./chunk-DGMCFMPG.js";import{B as p,L as _}from"./chunk-B5MHCHP3.js";var U=new Set(P());function $e(e,t={}){let{includeHomonyms:n=!1,limit:i}=t,s=X(e,t).filter(r=>r.relationship==="divergent"||n&&r.relationship==="homonym");return i?s.slice(0,i):s}function X(e,t={}){let{scope:n,minSimilarity:i=.3,scanLimit:s}=t,r=Q(e,{scope:n,scanLimit:s});return Y(r,{minSimilarity:i,isDelegatePair:De(e)}).filter(a=>!a.members.some(o=>_(e,o.file,o.startLine,"twin")))}function Y(e,t={}){let n=t.minSimilarity??.3,i=t.isDelegatePair,s=e.filter(c=>!V(c.leaf)&&!fe(c.leaf)&&L(c.file)!=="test"&&!D(c.symbol)&&!Z(c.symbol)&&!j(c.symbol,c.leaf)),{recordsByLeaf:r,recordOrder:a}=p("twin-drift.group-by-leaf",()=>q(s),()=>({records:s.length})),o=p("twin-drift.cluster-leaf-names",()=>W([...r.keys()]),()=>({leaves:r.size}));return p("twin-drift.compare-clusters",()=>{let c=[];for(let h of o){let u=J(h,r,a);if(u.length<2||new Set(u.map(f=>f.file)).size<2)continue;let m=null,R=!1,C=!1,y=new Set;for(let f=0;f<u.length;f+=1)for(let w=f+1;w<u.length;w+=1){let d=u[f],g=u[w];if(d.file===g.file||!ge(d,g)||i?.(d,g,u)||i?.(g,d,u))continue;if(R=!0,y.add(d.symbol),y.add(g.symbol),d.normalizedBody===g.normalizedBody){C=!0;continue}let M=oe(d.tokens,g.tokens);(!m||M>m.similarity)&&(m={a:d,b:g,similarity:M})}if(!R)continue;let x=u.filter(f=>y.has(f.symbol)).sort((f,w)=>f.file.localeCompare(w.file)||f.startLine-w.startLine).map(se);if(!m){c.push({leaf:G(h),relationship:C?"identical":"homonym",maxDivergence:0,members:x});continue}let N=m.similarity>=n?"divergent":"homonym";c.push({leaf:G(h),relationship:N,maxDivergence:Math.round((1-m.similarity)*1e3)/1e3,members:x,...N==="divergent"?{firstDivergentTokens:ae(m.a.tokens,m.b.tokens)}:{}})}return c},()=>({clusters:o.length,records:s.length})).sort((c,h)=>h.members.length-c.members.length||h.maxDivergence-c.maxDivergence||c.leaf.localeCompare(h.leaf))}function q(e){let t=new Map,n=new Map;for(let[i,s]of e.entries()){let r=t.get(s.leaf)??[];r.push(s),t.set(s.leaf,r),n.set(s,i)}return{recordsByLeaf:t,recordOrder:n}}function J(e,t,n){let i=[...e].flatMap(s=>t.get(s)??[]);return e.size>1&&i.sort((s,r)=>(n.get(s)??0)-(n.get(r)??0)),i}function Q(e,t){let n=p("twin-drift.load-definitions",()=>$(e,{scope:t.scope}).filter(r=>ee(r)&&!e.isIgnored(r.relativePath)).filter(r=>!k(r.relativePath)));p("twin-drift.sort-definitions",()=>n.sort((r,a)=>r.relativePath.localeCompare(a.relativePath)||r.startLine-a.startLine),()=>({definitions:n.length}));let i=O(n,t.scanLimit),s=p("twin-drift.select-candidates",()=>te(i),()=>({scanned:i.length}));return p("twin-drift.build-records",()=>{let r=[];for(let a of s){let o=ne(e,a);o&&r.push(o)}return r},()=>({candidates:s.length,scanned:i.length}))}function ee(e){return e.isFunctionLike?e.symbol.startsWith("rust-analyzer ")?typeof e.kind=="number"&&U.has(e.kind):!0:!1}function te(e){let t=e.filter(r=>r.leaf&&!V(r.leaf)&&!D(r.symbol)&&!Z(r.symbol)&&!j(r.symbol,r.leaf)),n=new Map;for(let r of t){let a=n.get(r.leaf)??[];a.push(r),n.set(r.leaf,a)}let i=W([...n.keys()]),s=new Set;for(let r of i){let a=[...r].flatMap(o=>n.get(o)??[]);if(!(a.length<2)&&!(new Set(a.map(o=>o.relativePath)).size<2)&&!a.every(o=>L(o.relativePath)==="test"))for(let o of a)s.add(o)}return e.filter(r=>s.has(r))}function ne(e,t){if(!t.leaf)return null;let n=B(e,t);if(!n||!z(t.symbol)&&!re(n,t.leaf))return null;let i=T(S(n)),s=i.replace(/\s+/g,"");if(!s||s.length<8)return null;let r=i.match(ie)??[];return r.length===0?null:{leaf:t.leaf,symbol:t.symbol,shortName:I(t.symbol),file:t.relativePath,startLine:t.startLine,endLine:t.endLine,loc:E(t),normalizedBody:s,tokens:r,isThinForwarder:H(i)}}function re(e,t){let n=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp(`\\b(?:const|let|var)\\s+${n}(?:\\s*:[^=]+)?\\s*=\\s*(?:async\\s*)?(?:\\([^)]*\\)|[A-Za-z_$][\\w$]*)\\s*=>`,"s").test(e)}var ie=/[A-Za-z_$][A-Za-z0-9_$]*|\d+(?:\.\d+)?|[^\sA-Za-z0-9_$]/g;function se(e){return{symbol:e.symbol,shortName:e.shortName,file:e.file,startLine:e.startLine,endLine:e.endLine,loc:e.loc}}function oe(e,t){let n=new Set(e),i=new Set(t);if(n.size===0&&i.size===0)return 1;if(n.size===0||i.size===0)return 0;let s=0;for(let a of n)i.has(a)&&(s+=1);let r=n.size+i.size-s;return r===0?0:s/r}function ae(e,t){let n=Math.min(e.length,t.length),i=0;for(;i<n&&e[i]===t[i];)i+=1;let s=e.slice(i,i+6).join(" "),r=t.slice(i,i+6).join(" ");return!s&&!r?"(bodies differ only in trailing length)":`A: ${s||"(end)"} | B: ${r||"(end)"}`}function W(e){let t=new Map;for(let a of e)t.set(a,a);let n=a=>{let o=a;for(;t.get(o)!==o;)o=t.get(o);let l=a;for(;t.get(l)!==o;){let c=t.get(l);t.set(l,o),l=c}return o},i=(a,o)=>{let l=n(a),c=n(o);l!==c&&t.set(l,c)},s=new Map;for(let a of e){let o=a.slice(0,2).toLowerCase(),l=s.get(o)??[];l.push(a),s.set(o,l)}for(let a of s.values())for(let o=0;o<a.length;o+=1)for(let l=o+1;l<a.length;l+=1)le(a[o],a[l])&&i(a[o],a[l]);let r=new Map;for(let a of e){let o=n(a),l=r.get(o)??new Set;l.add(a),r.set(o,l)}return[...r.values()]}function le(e,t){return e===t||e.toLowerCase()===t.toLowerCase()?!0:e.length<8||t.length<8||Math.abs(e.length-t.length)>2||ce(e.toLowerCase(),t.toLowerCase())/Math.max(e.length,t.length)<.8?!1:pe(e.toLowerCase(),t.toLowerCase(),2)}function ce(e,t){let n=Math.min(e.length,t.length),i=0;for(;i<n&&e[i]===t[i];)i+=1;return i}function fe(e){return/^[A-Z][A-Z0-9_]*$/.test(e)||/^__[^_].*__$/.test(e)||ue.has(e.toLowerCase())}var ue=new Set(["main","row"]),me=new Set(["app","component","components","feature","features","impl","index","lib","route","routes","shared","src","tsx","typescript","ui"]);function Z(e){return e.startsWith("rust-analyzer ")&&/\/(?:tests?|benches?)\//.test(e)}var de=new Set(["default","new","reset"]);function j(e,t){return e.startsWith("rust-analyzer ")&&de.has(t.toLowerCase())}function ge(e,t){if(e.leaf.toLowerCase()!==t.leaf.toLowerCase()||e.leaf.length>4)return!0;let n=F(e);return[...F(t)].some(i=>n.has(i))}function F(e){let t=e.leaf.toLowerCase();return new Set(`${e.file}/${e.shortName}`.replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().split(/[^a-z0-9]+/).filter(n=>n.length>2&&n!==t&&!me.has(n)))}function pe(e,t,n){if(Math.abs(e.length-t.length)>n)return!1;let i=Array.from({length:t.length+1},(s,r)=>r);for(let s=1;s<=e.length;s+=1){let r=[s],a=r[0];for(let o=1;o<=t.length;o+=1){let l=e[s-1]===t[o-1]?0:1,c=Math.min(i[o]+1,r[o-1]+1,i[o-1]+l);r.push(c),a=Math.min(a,c)}if(a>n)return!1;i=r}return i[t.length]<=n}function ke(e){return H(T(S(e)))}function H(e){let t=e.trim();if(!t||he.test(t))return!1;let n=be(t);return n.length===0||n.length>2?!1:ye(n[n.length-1])}var he=/\b(?:if|else|for|while|switch|try|catch|do)\b/,we=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\[[^[\]]*\])*\((?:[^()]|\([^()]*\))*\)$/;function ye(e){let t=e.trim().replace(/^return\s+/,"").replace(/^await\s+/,"").replace(/;\s*$/,"").trim();return we.test(t)}function be(e){let t=[],n=0,i="";for(let s of e){if(s==="("||s==="["||s==="{"?n+=1:(s===")"||s==="]"||s==="}")&&(n=Math.max(0,n-1)),s===";"&&n===0){t.push(i),i="";continue}i+=s}return i.trim()&&t.push(i),t.map(s=>s.trim()).filter(s=>s.length>0)}var Te=3;function De(e){let t=new Map;return(n,i,s)=>{if(!n.isThinForwarder)return!1;let r=`${n.symbol}\0${i.symbol}`,a=t.get(r);if(a!==void 0)return a;let o=K(e,n,i,s,Te,new Set);return t.set(r,o),o}}function K(e,t,n,i,s,r){if(s<=0||r.has(t.symbol)||(r.add(t.symbol),(v(e,t.file)??[]).filter(l=>l.line>=t.startLine&&l.line<=t.endLine&&l.calleeLeaf===n.leaf).length===0))return!1;let o=new Set(A(e,t.file).filter(l=>l.sourcePath&&(l.kind!=="namespace"||l.usedMembers.includes(n.leaf))).map(l=>l.sourcePath));if([...o].some(l=>b(l,n.file)))return!0;for(let l of i)if(!(l.symbol===t.symbol||l.symbol===n.symbol||!l.isThinForwarder)&&[...o].some(c=>b(c,l.file))&&K(e,l,n,i,s-1,r))return!0;return!1}function V(e){return e.startsWith("<")&&e.endsWith(">")}function G(e){return[...e].sort()[0]}export{$e as a,X as b,Y as c,ke as d,be as e};
|
|
2
|
+
//# sourceMappingURL=chunk-IYAOX36F.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as A}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as A}from"./chunk-WXAAURU7.js";import{a as _}from"./chunk-52HQTTPB.js";import{f as R,g as L}from"./chunk-JELJLXEE.js";import{c as E}from"./chunk-XVJ3V7LM.js";import{f as x,g as I}from"./chunk-WMXRRBII.js";import{b as D}from"./chunk-B75HZHUP.js";import{a as w}from"./chunk-BGBBVSH4.js";import{d as N}from"./chunk-ZTTISZ7J.js";import{b as T,c as h}from"./chunk-7LABSJSR.js";import{H as S}from"./chunk-B5MHCHP3.js";import{a as g}from"./chunk-64MNV6AB.js";var F={caller:3,"entry-surface":2,rooted:1},O=/not\s*yet\s*implement|not\s*implement|unimplement|\bnyi\b|\btodo\b|\bstub\b|not\s*supported|coming\s*soon/i,P=/^throw\s+new\s+[\w.]*Error\s*\(([\s\S]*)\)\s*;?$/,C=/^return(\s+(null|undefined|false|0|''|""|``|\[\]|\{\}))?\s*;?$/,v=/\/\/\s*TODO\b|\/\*\s*TODO\b/i,K=/(?:=>|\))\s*(?::\s*[^{;=]+)?\s*\{\s*\}\s*;?\s*$/;function et(e,n={}){let{scope:o,limit:r=30,scanLimit:l,semantic:a=!0}=n,s=new E(e),t=D(s.productionCallableDefinitions({scope:o,minLoc:1,requireFunctionLikeSymbol:!0,excludeTypesFiles:!0}),l),c=[];for(let i of t){let m=M(e,i);m&&c.push(m)}if(c.length===0)return[];let d=j(e,c,t),f=c.filter(i=>!d.has(i.def.symbol));if(f.length===0)return[];let p=_(e,s).forDefinitions(f.map(i=>i.def),{semantic:a}),u=[];for(let i of f){let b=p.get(i.def.symbolId)?.realConsumers.length??0,y=B(e,i.def,b);y&&u.push({symbol:i.def.symbol,shortName:N(i.def.symbol),file:i.def.relativePath,startLine:i.def.startLine,endLine:i.def.endLine,loc:w(i.def),stubKind:i.stubKind,reachability:y,callerFanIn:b,stubText:i.stubText})}return u.sort((i,m)=>F[m.reachability]-F[i.reachability]||m.callerFanIn-i.callerFanIn||i.file.localeCompare(m.file)||i.startLine-m.startLine),r?u.slice(0,r):u}function B(e,n,o){return o>0?"caller":I(e,n.symbol,n.relativePath)?"rooted":x(e,n.relativePath)?"entry-surface":null}function M(e,n){let o=R(e,n);if(!o)return null;let r=L(o),l=r.trim();if(l==="")return!z(o)||!A(e,n)?null:{def:n,stubKind:"empty-body",stubText:"(empty body)"};let a=h(r),s=T(r),t=$(a,s);if(t.length!==1)return null;let c=t[0];return U(c)?{def:n,stubKind:"throw-stub",stubText:c.trim()}:v.test(r)&&C.test(c.trim())?{def:n,stubKind:"todo-return-default",stubText:l}:null}function $(e,n){let o=[],r=0,l="";for(let a=0;a<n.length;a+=1){let s=n[a];if(s==="("||s==="["||s==="{"?r+=1:(s===")"||s==="]"||s==="}")&&(r=Math.max(0,r-1)),s===";"&&r===0){o.push(l),l="";continue}l+=e[a]??""}return l.trim()&&o.push(l),o.map(a=>a.trim()).filter(a=>a.length>0)}function U(e){let n=P.exec(e.trim());return n?O.test(n[1]??""):!1}function z(e){return K.test(e.trimEnd())}function j(e,n,o){let r=new Set,l=new Set(n.map(t=>t.def.parentTypeName).filter(t=>t!==null));if(l.size===0)return r;let a=k(e,l),s=new Map;for(let t of o){if(!t.parentTypeName)continue;let c=s.get(t.leaf)??new Set;c.add(t.parentTypeName),s.set(t.leaf,c)}for(let t of n){let c=t.def.parentTypeName;if(!c)continue;let d=a.get(c);if(!d||d.size===0)continue;let f=s.get(t.def.leaf)??new Set;[...d].every(u=>f.has(u))&&r.add(t.def.symbol)}return r}var Y=/\bclass\s+([A-Za-z_$][\w$]*)\s+extends\s+([A-Za-z_$][\w$]*)/g;function k(e,n){let o=new Map;for(let r of g(e,{includeIgnored:!1})){let l=S(e,r);if(l)for(let a of l.matchAll(Y)){let s=a[1],t=a[2];if(!s||!t||!n.has(t))continue;let c=o.get(t)??new Set;c.add(s),o.set(t,c)}}return o}export{et as a};
|
|
2
|
+
//# sourceMappingURL=chunk-J7VT2CRB.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{c as p}from"./chunk-
|
|
1
|
+
import{c as p}from"./chunk-OHWZKLVA.js";import{b as D}from"./chunk-B75HZHUP.js";import{a as m}from"./chunk-BGBBVSH4.js";import{d as g,t as B}from"./chunk-ZTTISZ7J.js";import{b as f}from"./chunk-7LABSJSR.js";import{I as y,L as d}from"./chunk-B5MHCHP3.js";import{createHash as A}from"crypto";var h=3;function H(e,t={}){let{scope:o,maxLoc:n=15,minLoc:i=h,limit:r,scanLimit:s}=t,l=p(e),u=L(e,{scope:o,maxLoc:n,scanLimit:s}).map(a=>x(e,a,l,i)).filter(a=>a!==null),c=v(u);return r?c.slice(0,r):c}function M(e,t,o={}){let{scope:n,maxLoc:i=15,minLoc:r=h,scanLimit:s}=o,l=p(e),u=L(e,{scope:n,maxLoc:i,scanLimit:s}).map(a=>x(e,a,l,r)).filter(a=>a!==null),c=u.find(a=>a.symbol===t);return c?u.filter(a=>a.symbol!==c.symbol&&a.normalizedBody===c.normalizedBody&&a.file!==c.file).sort(z).map(({normalizedBody:a,...C})=>C):[]}function I(e){let t=S(e);return f(t).replace(/\s+/g,"")}function v(e){let t=new Map;for(let n of e){if(n.normalizedBody.length<8)continue;let i=F(n.normalizedBody),r=t.get(i)??[];r.push(n),t.set(i,r)}let o=[];for(let[n,i]of t){let r=new Set(i.map(l=>l.file));if(i.length<2||r.size<2)continue;let s=[...i].sort(z).map(({normalizedBody:l,...u})=>u);o.push({hash:n,canonical:s[0],functions:s})}return o.sort((n,i)=>{let r=i.functions.length-n.functions.length;if(r!==0)return r;let s=b(i)-b(n);return s!==0?s:n.canonical.file.localeCompare(i.canonical.file)}),o}function L(e,t){let o=B(e,{scope:t.scope}).filter(n=>n.isFunctionLike&&!e.isIgnored(n.relativePath)).filter(n=>!d(e,n.relativePath,n.startLine,"similar")).filter(n=>m(n)<=t.maxLoc);return o.sort((n,i)=>m(i)-m(n)||n.relativePath.localeCompare(i.relativePath)),D(o,t.scanLimit)}function x(e,t,o,n){let i=E(e,t);if(!i||W(i)<n)return null;let r=P(e,t);return r?{symbol:t.symbol,shortName:g(t.symbol),file:t.relativePath,startLine:t.startLine,endLine:t.endLine,loc:m(t),ageCommits:o?.get(t.relativePath)?.commitsAgo??null,normalizedBody:r}:null}function P(e,t){let o=E(e,t);return o&&I(o)||null}function E(e,t){let o=y(e,t.relativePath);return o.length===0?null:o.slice(t.startLine,t.endLine+1).join(`
|
|
2
2
|
`)}function S(e){let t=e.indexOf("{"),o=e.lastIndexOf("}");if(t>=0&&o>t)return e.slice(t+1,o);let n=e.indexOf("=>");return n>=0?e.slice(n+2).replace(/;+\s*$/,""):e}function W(e){return S(e).split(/\r?\n/).map(o=>o.trim()).filter(o=>o.length>0).length}function F(e){return A("sha256").update(e).digest("hex").slice(0,16)}function z(e,t){let o=e.ageCommits??-1;return(t.ageCommits??-1)-o||e.file.localeCompare(t.file)||e.startLine-t.startLine}function b(e){return e.functions.reduce((t,o)=>t+o.loc,0)}export{H as a,M as b,I as c,v as d,P as e,E as f,S as g};
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
3
|
+
//# sourceMappingURL=chunk-JELJLXEE.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{d as re,e as oe,f as se,g as M,h as T,i as ce,k as le,n as fe,o as me}from"./chunk-
|
|
1
|
+
import{d as re,e as oe,f as se,g as M,h as T,i as ce,k as le,n as fe,o as me}from"./chunk-Z5QQPJ3U.js";import{d as R}from"./chunk-2OXVAGGT.js";import{M as ae}from"./chunk-GA64UPMI.js";import{a as te}from"./chunk-YLVE3SXZ.js";import{e as S,s as ne,z as ie}from"./chunk-ZTTISZ7J.js";import{a as K,b as Q,f as L,p as v}from"./chunk-7LABSJSR.js";import{B as ee,L as A,a as X,c as I}from"./chunk-DGMCFMPG.js";import{B as y,H as p,l as d,m as W,p as w,q as E,s as V,u as F,z as q}from"./chunk-B5MHCHP3.js";function D(e,i,n,t={}){if(!n)return[];let r=p(e,i);return r?r.indexOf(n)===-1?[]:(O(e,i).get(n)??[]).filter(o=>!Le(o,t)):[]}function Le(e,i){return typeof i.excludeStartLine=="number"&&typeof i.excludeEndLine=="number"&&e>=i.excludeStartLine&&e<=i.excludeEndLine}var ve=d("file-identifiers",{clearGroups:["whole-project","source-file"]});function ue(e,i){let n=L(e,i);return n?n.fileIdentifiers:ve.get(e,i,()=>new Set(O(e,i).keys()))}var Re=d("file-ident-lines",{clearGroups:["whole-project","source-file"]});function O(e,i){let n=L(e,i);return n?n.identifierLineMap:Re.get(e,i,()=>De(e,i))}var Me=d("file-idents-by-line",{clearGroups:["whole-project","source-file"]});function qe(e,i){let n=L(e,i);return n?n.identifiersByLine:Me.get(e,i,()=>{let t=O(e,i),r=0;for(let o of t.values()){let c=o[o.length-1];c!==void 0&&c>r&&(r=c)}let s=new Array(r+1);for(let o=0;o<=r;o+=1)s[o]=new Set;for(let[o,c]of t)for(let a of c)s[a].add(o);return s})}function De(e,i){let n=new Map,t=(c,a)=>{let l=n.get(c);if(!l){n.set(c,[a]);return}l[l.length-1]!==a&&l.push(a)},r=p(e,i);if(!r)return n;let s=Q(r).split(/\r?\n/),o=/\b([A-Za-z_$][\w$]*)\b/g;for(let c=0;c<s.length;c+=1){let a=s[c]??"";for(let l of a.matchAll(o))l[1]&&t(l[1],c)}return n}function rt(e,i){let n=pe(e);return n?i.filter(t=>pe(t.file)===n):i}function ot(e,i,n,t){let r=n.find(s=>s.file===i);if(r)return r;if(t){let s=new Set(v(e,i).map(o=>o.sourcePath).filter(o=>!!o));for(let o of n)for(let c of s)if(I(c,o.file))return o;return null}return n.length===1?n[0]:null}function pe(e){let i=ee(e);return i?i==="typescript"||i==="tsx"||i==="javascript"?"javascript-family":i:null}var _e=W("global-leaf-index",{clearGroups:["whole-project"]});function j(e){return _e.get(e,()=>{let i=e.all(`SELECT gs.id, gs.symbol,
|
|
2
2
|
COALESCE(der_doc.relative_path, mention_doc.relative_path) AS relative_path
|
|
3
3
|
FROM global_symbols gs
|
|
4
4
|
LEFT JOIN defn_enclosing_ranges der ON der.symbol_id = gs.id
|
|
@@ -13,4 +13,4 @@ import{d as re,e as oe,f as se,g as M,h as T,i as ce,k as le,n as fe,o as me}fro
|
|
|
13
13
|
) mention_doc ON mention_doc.symbol_id = gs.id
|
|
14
14
|
WHERE 1 = 1
|
|
15
15
|
${e.symbolNoiseFor("gs")}`),n=new Map;for(let t of i){if(!t.relative_path||e.isIgnored(t.relative_path))continue;let r=S(t.symbol);if(!r)continue;let s=n.get(r);s||(s=[],n.set(r,s)),s.some(o=>o.symbolId===t.id)||s.push({symbol:t.symbol,symbolId:t.id,file:t.relative_path})}return n})}var xe=d("source-import-paths-by-local-name",{clearGroups:["whole-project","source-file"]});function ge(e,i){let n=X(i);return xe.get(e,n,()=>Pe(e,n))}function Pe(e,i){let n=new Map;for(let t of v(e,i)){if(!t.sourcePath)continue;let r=t.localName??t.importedName;if(r&&de(n,r,t.sourcePath),t.kind==="namespace")for(let s of t.usedMembers)de(n,s,t.sourcePath)}return n}function de(e,i,n){let t=e.get(i);t||(t=new Set,e.set(i,t)),t.add(n)}var he=/[A-Za-z_$][A-Za-z0-9_$]*/g,ye=/^[A-Za-z_$][A-Za-z0-9_$]*$/,Ne=512;function H(e){let i=[],n=!1;for(let t of e)t&&(n=!0,ye.test(t)||i.push(t));return{candidateNames:e,hasUsableCandidate:n,nonIdentifierNames:i}}function Se(e,i){let n=ke(i)?i:H(i);if(n.candidateNames.size===0||!n.hasUsableCandidate)return!0;if(n.candidateNames.size<=Ne){for(let r of n.candidateNames)if(r){if(ye.test(r)){if(we(r).test(e))return!0;continue}if(e.includes(r))return!0}return!1}he.lastIndex=0;let t;for(;(t=he.exec(e))!==null;)if(n.candidateNames.has(t[0]))return!0;for(let r of n.nonIdentifierNames)if(e.includes(r))return!0;return!1}function ke(e){return"candidateNames"in e}function we(e){return new RegExp(`(?<![A-Za-z_$0-9])${K(e)}(?![A-Za-z_$0-9])`)}function z(e,i,n){let t=j(e).get(n);if(!t||t.length===0)return[];if(t.length===1)return[C(t[0])];let r=t.filter(a=>a.file===i);if(r.length>0)return r.map(C);let s=ge(e,i),o=s.get(n);if(o)for(let a of o){let l=t.filter(m=>I(a,m.file));if(l.length>0)return l.map(C)}let c=new Set;for(let a of s.values())for(let l of a)c.add(l);for(let a of c){let l=t.filter(m=>I(a,m.file));if(l.length>0&&l.length===t.length)return l.map(C)}return[]}function Lt(e,i,n){let t=z(e,i,n);if(t.length>0)return t;let r=j(e).get(n);return!r||r.length===0?[]:r.map(C)}function be(e,i,n={}){let t=R(e,i);if(!t)return[];let r=S(t.symbol);if(!r)return[];if(n.semantic!==!1&&n.semanticEvidence){let o=n.semanticEvidence.references(e,{...t,leaf:r,parentTypeName:null,isFunctionLike:!1,isTypeLike:!1,kind:null,documentation:null,enclosingSymbol:null});if(o.length>0){let c=new Map;for(let a of o){let l=c.get(a.file)??[];l.push(a.line),c.set(a.file,l)}return _(e,c)}}let s=new Map;for(let o of A(e)){let c=p(e,o);if(!c||c.indexOf(r)===-1||o!==t.relativePath&&!z(e,o,r).some(m=>m.symbolId===t.symbolId))continue;let a=D(e,o,r,o===t.relativePath?{excludeStartLine:t.startLine,excludeEndLine:t.endLine}:{});a.length>0&&s.set(o,a)}return _(e,s)}function vt(e,i,n={}){let t=new Map;for(let a of i){if(!a.leaf)continue;let l=t.get(a.leaf)??[];l.push(a),t.set(a.leaf,l)}if(t.size===0)return new Map;let r=new Set(i.map(a=>a.symbolId)),s=new Set(t.keys()),o=H(s),c=new Map;for(let a of A(e)){if(n.skipPath?.(a)||!Se(p(e,a),o))continue;let l=ue(e,a);if(l.size!==0){for(let m of l)if(t.has(m))for(let g of z(e,a,m)){if(!r.has(g.symbolId)||a===g.relativePath)continue;let h=c.get(g.symbolId);h||(h=new Set,c.set(g.symbolId,h)),h.add(a)}}}return c}function C(e){return{symbolId:e.symbolId,symbol:e.symbol,relativePath:e.file}}function _(e,i){let n=[],t=new Set;for(let[r,s]of i){let o=ne(e,r);for(let c of s){let a=ie(o,c),l=`${r}|${c}|${a?.symbol??""}`;t.has(l)||(t.add(l),n.push({file:r,line:c,enclosingSymbol:a?.symbol??null}))}}return n}function Fe(e,i){let n=ze(e,i);return n?_(e,Te(e,n.match,n.identifier)):[]}function Nt(e,i,n={}){return Ae(e,i,n).map(t=>({file:t.file,line:t.line,enclosingSymbol:t.enclosingSymbol}))}function Ae(e,i,n={}){let t=be(e,i,{semantic:n.semantic,semanticEvidence:n.semanticEvidence}),r=t.length>0?Ie(t,"source-attribution"):Ie(Fe(e,i),"scip-reference-chunk");return n.includeIgnored===!0?r:r.filter(s=>!e.isIgnored(s.file))}function Ie(e,i){return e.map(n=>({...n,provenance:i}))}function Te(e,i,n){let t=new Map;for(let[r,s]of Oe(e,i.symbolId))t.set(r,je(e,r,s,i,n));return t}function Oe(e,i){let n=new Map;for(let t of re(e,[i])){if(e.isIgnored(t.relative_path))continue;let r=n.get(t.relative_path);r||(r=[],n.set(t.relative_path,r)),r.push({start_line:t.chunk_start,end_line:t.chunk_end})}return n}function je(e,i,n,t,r){let s=i===t.relativePath?{excludeStartLine:t.startLine,excludeEndLine:t.endLine}:{},o=r?D(e,i,r,s):[];return n.flatMap(c=>He(o,c))}function He(e,i){let n=e.filter(t=>t>=i.start_line&&t<=i.end_line);return n.length>0?n:[i.start_line]}function ze(e,i){let n=R(e,i);return n?{match:n,identifier:S(n.symbol)||null}:null}var $t={references:le,referenceMap:fe,callerMap:(e,i)=>T(e).callerMap(i),calleeMap:Be};function Be(e,i){let n=q(),t=new Map,r=ce(e,i),s=[],o=[],c=0,a=0,l=0,m=0,g=0,h=0,B=0;for(let{definition:f,callees:u}of r.hits)g+=1,u.length>0&&(h+=1,B+=u.length,t.set(f.symbolId,u));let b=Ge(e,r.hits);if(b.entries.length>0&&y("semantic.callees.prefetch-cache-write",()=>F(e,b.entries),()=>({entries:b.entries.length,sourceMissing:b.sourceMissing,skippedUnsupportedLanguage:b.skippedUnsupportedLanguage})),y("semantic.callees.cache-scan",()=>{for(let[f,u]of oe(r.misses)){if(!M(f)){n&&(c+=u.length);continue}let J=p(e,f);if(!J){n&&(a+=u.length),o.push(...u);continue}let Z=E(e,f,J),P=Ce(e,f);if(!P){o.push(...u);continue}let Ee=V(e,f,Z,P);for(let N of u){let Y=Ee.get(N.symbol)??null;if(Y!==null){let k=Ue(Y);if(k){n&&(l+=1),k.length>0&&t.set(N.symbolId,k);continue}n&&(m+=1)}s.push({def:N,contentHash:Z,depsDigest:P})}}},()=>({definitions:i.length,skippedUnsupportedLanguage:c,sourceMissing:a,cacheHits:l,parseFailures:m,misses:s.length,unkeyed:o.length,inMemoryHits:g,inMemoryRows:h,inMemoryCalleeCount:B,resultRows:t.size})),s.length===0&&o.length===0)return t;let G=[...o,...s.map(f=>f.def)],$=0,U=y("semantic.callees.compute-misses",()=>{let f=me(e,G);return $=f.size,f},()=>({definitions:G.length,misses:s.length,unkeyed:o.length,rows:$}));for(let[f,u]of U)t.set(f,u);let x=s.filter(f=>T(e).capability("semantic-callees",f.def.relativePath).available).map(f=>({relativePath:f.def.relativePath,symbol:f.def.symbol,contentHash:f.contentHash,depsDigest:f.depsDigest,payload:JSON.stringify(U.get(f.def.symbolId)??[])}));return x.length>0?y("semantic.callees.cache-write",()=>F(e,x),()=>({entries:x.length})):y("semantic.callees.cache-write-skip",()=>{},()=>({reason:"provider-unavailable",misses:s.length})),t}function Ge(e,i){let n=[],t=new Map,r=0,s=0;for(let{definition:o,callees:c}of i){if(!M(o.relativePath)){s+=1;continue}if(!t.has(o.relativePath)){let l=p(e,o.relativePath),m=l?Ce(e,o.relativePath):null;t.set(o.relativePath,l&&m?{contentHash:E(e,o.relativePath,l),depsDigest:m}:null)}let a=t.get(o.relativePath);if(!a){r+=1;continue}n.push({relativePath:o.relativePath,symbol:o.symbol,contentHash:a.contentHash,depsDigest:a.depsDigest,payload:JSON.stringify(c)})}return{entries:n,sourceMissing:r,skippedUnsupportedLanguage:s}}var $e="typescript-callees-v1";function Ce(e,i){let n=M(i);if(n==="typescript")return ae(e,i,$e)?.key??null;let t=Ze(e,i);return n==="rust"?w(JSON.stringify({kind:"semantic-callees",language:n,engine:se(e.config.projectRoot),positionMapping:"nearby-leaf-v1",depsDigest:t})):t}function Ue(e){try{return JSON.parse(e)}catch{return null}}var Je=d("semantic-deps-digest",{clearGroups:["whole-project","source-file"]});function Ze(e,i){return Je.get(e,i,()=>{let t=[...te(e).get(i)??[]].sort().map(r=>`${r}:${E(e,r,p(e,r))}`);return w(t.join("|"))})}export{O as a,qe as b,rt as c,ot as d,j as e,H as f,Se as g,ge as h,z as i,Lt as j,vt as k,Fe as l,Nt as m,$t as n};
|
|
16
|
-
//# sourceMappingURL=chunk-
|
|
16
|
+
//# sourceMappingURL=chunk-JERWGHQT.js.map
|