scip-query 0.23.0 → 0.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +491 -2
- package/README.md +111 -122
- package/dist/augment-vue-worker.js +1 -1
- package/dist/by-kind-PRVFAGTQ.js +2 -0
- package/dist/call-graph-DVPAQV2F.js +2 -0
- package/dist/call-graph-evidence-CUtj8V2I.d.ts +19 -0
- package/dist/chunk-2FSBGL5P.js +2 -0
- package/dist/chunk-2HLAFUCY.js +2 -0
- package/dist/chunk-2IWUT6CJ.js +3 -0
- package/dist/chunk-2KNN7GTQ.js +2 -0
- package/dist/chunk-2LHXRE2B.js +8 -0
- package/dist/{chunk-EG2CPZMJ.js → chunk-2YXE77TJ.js} +2 -2
- package/dist/chunk-36SGVCGX.js +2 -0
- package/dist/chunk-3ABBFPTP.js +2 -0
- package/dist/chunk-3IVFU4FD.js +3 -0
- package/dist/chunk-3JIQS44J.js +7 -0
- package/dist/chunk-3ZRB6DNK.js +7 -0
- package/dist/{chunk-6YTSKJJ3.js → chunk-42EOW5VI.js} +1 -1
- package/dist/{chunk-6I6L7Z62.js → chunk-4BHGBMNO.js} +2 -2
- package/dist/chunk-4BP3UBDG.js +2 -0
- package/dist/chunk-4D6RO7G4.js +2 -0
- package/dist/chunk-4FEWQ6RH.js +2 -0
- package/dist/chunk-4IGEOBG7.js +2 -0
- package/dist/chunk-4QZXBUKC.js +2 -0
- package/dist/chunk-4WBDEVX2.js +4 -0
- package/dist/chunk-4WCUBZU3.js +8 -0
- package/dist/chunk-4WTUBQ36.js +40 -0
- package/dist/chunk-4XQ4O6IM.js +3 -0
- package/dist/chunk-55UQAMZO.js +4 -0
- package/dist/chunk-5D2LVK7O.js +125 -0
- package/dist/chunk-5IYJ56TT.js +2 -0
- package/dist/chunk-5PLMJC7Q.js +2 -0
- package/dist/chunk-5TNQJUR2.js +5 -0
- package/dist/chunk-62BDNPMI.js +2 -0
- package/dist/chunk-64DZ5TXR.js +7 -0
- package/dist/chunk-65245JCM.js +2 -0
- package/dist/chunk-6FFVZZL4.js +2 -0
- package/dist/chunk-6KO5JHAR.js +2 -0
- package/dist/chunk-6LRXOOSX.js +2 -0
- package/dist/chunk-6LSEIIF7.js +2 -0
- package/dist/chunk-6YMNWD3H.js +6 -0
- package/dist/chunk-72AD6ZRR.js +5 -0
- package/dist/chunk-73AAKPUC.js +4 -0
- package/dist/chunk-76CZ77DF.js +2 -0
- package/dist/chunk-7VPEEAAG.js +2 -0
- package/dist/chunk-7WTPQ4NX.js +14 -0
- package/dist/chunk-7Y5T6XDP.js +2 -0
- package/dist/chunk-A2IIGFMJ.js +5 -0
- package/dist/chunk-AB5KCTEV.js +2 -0
- package/dist/chunk-AC566WBP.js +6 -0
- package/dist/chunk-AGWFSTXC.js +3 -0
- package/dist/chunk-AOSIYPTA.js +2 -0
- package/dist/chunk-AUVEWPIF.js +2 -0
- package/dist/chunk-B56T42J3.js +25 -0
- package/dist/chunk-BIQEF5NE.js +2 -0
- package/dist/chunk-BL6XJKTA.js +3 -0
- package/dist/chunk-BMKOQJRI.js +2 -0
- package/dist/chunk-BOZ4EXBB.js +3 -0
- package/dist/chunk-BUTWYEPH.js +2 -0
- package/dist/chunk-BZB4QPIP.js +2 -0
- package/dist/{chunk-ILTDAWEF.js → chunk-CE357GEE.js} +4 -4
- package/dist/chunk-CFN45HFP.js +2 -0
- package/dist/chunk-CFYMZFXT.js +368 -0
- package/dist/chunk-CN5EH7O3.js +2 -0
- package/dist/chunk-D254DNNQ.js +4 -0
- package/dist/chunk-D3FDISIC.js +2 -0
- package/dist/chunk-D3NX5XIE.js +3 -0
- package/dist/chunk-DA7RPPDF.js +3 -0
- package/dist/chunk-DDMC3FON.js +3 -0
- package/dist/chunk-DIO3FUSG.js +2 -0
- package/dist/chunk-DJ2NNSUK.js +3 -0
- package/dist/chunk-DKYQIM3C.js +18 -0
- package/dist/{chunk-JTQVMR42.js → chunk-DOOEL2IV.js} +2 -2
- package/dist/chunk-DVFP6PZI.js +2 -0
- package/dist/chunk-E3FDPXZK.js +2 -0
- package/dist/chunk-E7YNJLCB.js +2 -0
- package/dist/chunk-EFGW5JPH.js +2 -0
- package/dist/chunk-EJVTR244.js +13 -0
- package/dist/chunk-EOV7RTRZ.js +2 -0
- package/dist/chunk-ETOIKRHO.js +2 -0
- package/dist/chunk-EYK3ZAO2.js +3 -0
- package/dist/chunk-F2V2LPET.js +52 -0
- package/dist/chunk-F4LUHJTF.js +2 -0
- package/dist/chunk-F4PUT6IT.js +2 -0
- package/dist/chunk-F56GCXXS.js +5 -0
- package/dist/chunk-FC2EVQRM.js +2 -0
- package/dist/chunk-FL7NBMHP.js +3 -0
- package/dist/chunk-FMRN2TRL.js +3 -0
- package/dist/chunk-FVULPZDF.js +20 -0
- package/dist/chunk-GCKCF5FL.js +43 -0
- package/dist/chunk-GH2PYF46.js +2 -0
- package/dist/chunk-GHJAGXIP.js +2 -0
- package/dist/{chunk-WIWY3CRX.js → chunk-GMVSHUKZ.js} +2 -2
- package/dist/chunk-GS6KDO4R.js +2 -0
- package/dist/chunk-GUUBXNN7.js +2 -0
- package/dist/chunk-GVWX5T43.js +80 -0
- package/dist/chunk-GZKFETP5.js +2 -0
- package/dist/chunk-H4EQHO6J.js +9 -0
- package/dist/chunk-H73WY2RM.js +2 -0
- package/dist/chunk-H75GSPRV.js +60 -0
- package/dist/chunk-HDR3AHSV.js +61 -0
- package/dist/chunk-HQBSL74Y.js +2 -0
- package/dist/chunk-HRRFKWPZ.js +2 -0
- package/dist/chunk-HXENDJC6.js +2 -0
- package/dist/chunk-IIBAZNSW.js +21 -0
- package/dist/chunk-INLMWEUU.js +12 -0
- package/dist/chunk-IWQPAF4F.js +2 -0
- package/dist/chunk-IZJ6YUKP.js +35 -0
- package/dist/chunk-J2TMAIN5.js +60 -0
- package/dist/chunk-J5FJMODQ.js +142 -0
- package/dist/chunk-J7HZPIO3.js +2 -0
- package/dist/chunk-JEVRKFRL.js +2 -0
- package/dist/chunk-JFXSGAEB.js +30 -0
- package/dist/chunk-JVRTHGFS.js +3 -0
- package/dist/chunk-JYWEX7RR.js +360 -0
- package/dist/chunk-K3YL22N6.js +2 -0
- package/dist/chunk-K4CN7GXK.js +12 -0
- package/dist/chunk-K5TBVXU4.js +30 -0
- package/dist/chunk-KDDIE2DP.js +9 -0
- package/dist/chunk-KHWRRPV4.js +2 -0
- package/dist/chunk-KI6NBKDY.js +14 -0
- package/dist/chunk-KU3QRSTH.js +2 -0
- package/dist/chunk-KZBJWZJB.js +2 -0
- package/dist/chunk-L7GFM3NP.js +3 -0
- package/dist/chunk-LMO6PK3V.js +35 -0
- package/dist/chunk-LN4YXJJU.js +2 -0
- package/dist/chunk-LOVIZBJ4.js +43 -0
- package/dist/chunk-LPCRK4A2.js +11 -0
- package/dist/chunk-MMHZKBFA.js +2 -0
- package/dist/{chunk-M2O5NY6W.js → chunk-MOQQBQRD.js} +2 -2
- package/dist/chunk-N2WN6I3L.js +2 -0
- package/dist/chunk-N3ORQT7L.js +2 -0
- package/dist/chunk-NAZ3RAIW.js +2 -0
- package/dist/chunk-NDUNO5JQ.js +2 -0
- package/dist/chunk-NEIWRNAZ.js +4 -0
- package/dist/chunk-NJJMVD65.js +2 -0
- package/dist/chunk-NLOQOBXI.js +20 -0
- package/dist/chunk-NOLZOVCU.js +2 -0
- package/dist/chunk-NOWINRRN.js +2 -0
- package/dist/chunk-NZAXKGRL.js +16 -0
- package/dist/chunk-O2C4UILI.js +2 -0
- package/dist/chunk-O3RHA6ZT.js +3 -0
- package/dist/chunk-O4UZSPPI.js +3 -0
- package/dist/chunk-OGFV2BUX.js +2 -0
- package/dist/chunk-OZCJXZK6.js +499 -0
- package/dist/chunk-P6ODM7BY.js +2 -0
- package/dist/{chunk-XBGWL66K.js → chunk-PAVGPRHJ.js} +2 -2
- package/dist/chunk-PH52RA7D.js +2 -0
- package/dist/chunk-PKN354TH.js +3 -0
- package/dist/chunk-PWOASWEG.js +11 -0
- package/dist/chunk-QIWXRW72.js +2 -0
- package/dist/chunk-QJRMOK5N.js +2 -0
- package/dist/{chunk-YXPUP5G2.js → chunk-QOIXNWQR.js} +2 -2
- package/dist/chunk-QXEUDXBT.js +3 -0
- package/dist/chunk-QYUVVBMR.js +6 -0
- package/dist/chunk-QZ7KQZRN.js +2 -0
- package/dist/chunk-R6LQBUDH.js +2 -0
- package/dist/chunk-RBS42E55.js +20 -0
- package/dist/chunk-RSJKPCFX.js +26 -0
- package/dist/chunk-S6CZA3MV.js +2 -0
- package/dist/chunk-STMVAHJP.js +2 -0
- package/dist/chunk-SYVPTTVW.js +2 -0
- package/dist/chunk-T3I6NHBH.js +2 -0
- package/dist/chunk-T6DK3ZP7.js +2 -0
- package/dist/chunk-TKD34PHN.js +4 -0
- package/dist/chunk-TNNQFH7W.js +2 -0
- package/dist/chunk-TNV7SSUF.js +2 -0
- package/dist/chunk-TO7ZR3EH.js +8 -0
- package/dist/chunk-TOU3CHK4.js +2 -0
- package/dist/chunk-TRBI4UKT.js +2 -0
- package/dist/chunk-TZCVNCAN.js +4 -0
- package/dist/chunk-U4LZA5LL.js +3 -0
- package/dist/chunk-U5RIG3JP.js +3 -0
- package/dist/chunk-UP5KXN2I.js +2 -0
- package/dist/chunk-UQFR3NDH.js +5 -0
- package/dist/chunk-UXYXF7GV.js +2 -0
- package/dist/chunk-VB3GOKOS.js +2 -0
- package/dist/chunk-VF5JZICY.js +2 -0
- package/dist/chunk-VTY3VK6E.js +2 -0
- package/dist/chunk-VX2O4RIS.js +2 -0
- package/dist/chunk-WKPV2TDZ.js +2 -0
- package/dist/chunk-WOFQ5DTB.js +2 -0
- package/dist/chunk-WS4C6TCK.js +2 -0
- package/dist/chunk-WXU3DGPU.js +2 -0
- package/dist/chunk-X6RMKHJQ.js +81 -0
- package/dist/{chunk-4ILJCCXV.js → chunk-XHMN6ZX7.js} +2 -2
- package/dist/chunk-XHTVFLWW.js +2 -0
- package/dist/chunk-XKIDJCIK.js +2 -0
- package/dist/chunk-XTYTYZPT.js +2 -0
- package/dist/chunk-Y2JHHTTA.js +2 -0
- package/dist/chunk-YGVRMGYN.js +4 -0
- package/dist/chunk-YNQCGEQE.js +2 -0
- package/dist/chunk-YOQVEXVE.js +14 -0
- package/dist/chunk-YRT2WLYY.js +2 -0
- package/dist/chunk-YTAP5Y2G.js +2 -0
- package/dist/chunk-YTYWI7VB.js +2 -0
- package/dist/chunk-YULZRALL.js +2 -0
- package/dist/chunk-Z33WQG4Q.js +2 -0
- package/dist/chunk-ZGTYGDMF.js +16 -0
- package/dist/chunk-ZHMRSZFD.js +43 -0
- package/dist/chunk-ZHSP366W.js +10 -0
- package/dist/chunk-ZIBYCYKK.js +7 -0
- package/dist/{chunk-GAS2LJMP.js → chunk-ZLADLUE6.js} +3 -3
- package/dist/chunk-ZO4YXUT6.js +4 -0
- package/dist/{chunk-HYO3NP5Q.js → chunk-ZR4HBC2H.js} +2 -2
- package/dist/cli-main.js +6 -6
- package/dist/cli.js +1 -1
- package/dist/{code-B17qEMbt.d.ts → code-BNyrCF3_.d.ts} +3 -2
- package/dist/code-IL5WH3NZ.js +2 -0
- package/dist/code-result-json-ANTBEDFP.js +4 -0
- package/dist/command-descriptors-HEEMDHTU.js +222 -0
- package/dist/deps-EOWFC6FD.js +2 -0
- package/dist/direct-navigation-Y5B6OSIQ.js +3 -0
- package/dist/{exploration-topology-BG4v30HZ.d.ts → exploration-topology-CSgEyAz-.d.ts} +3 -1
- package/dist/files-K4AI3JUM.js +2 -0
- package/dist/frontend-profile-roles-D7eCum8P.d.ts +10 -0
- package/dist/{health-CPp2Jf1Z.d.ts → health-BtfmNrfa.d.ts} +58 -74
- package/dist/hierarchy-6W5NDIFI.js +2 -0
- package/dist/imports-WH365QY4.js +2 -0
- package/dist/index.d.ts +13 -1
- package/dist/index.js +1 -1
- package/dist/members-K3PHMF5S.js +2 -0
- package/dist/methods-E7KVMBX4.js +2 -0
- package/dist/output-continuation-command-BJSY67SN.js +3 -0
- package/dist/output-pagination-UZJ5ACIX.js +24 -0
- package/dist/postinstall.js +1 -1
- package/dist/project-reindex-EP24WT4X.js +3 -0
- package/dist/queries/affected.js +1 -1
- package/dist/queries/architecture.d.ts +15 -4
- package/dist/queries/architecture.js +1 -1
- package/dist/queries/bottlenecks.js +1 -1
- package/dist/queries/by-kind.js +1 -1
- package/dist/queries/call-graph.d.ts +3 -1
- package/dist/queries/call-graph.js +1 -1
- package/dist/queries/change-surface.d.ts +1 -0
- package/dist/queries/change-surface.js +1 -1
- package/dist/queries/cleanup-plan.d.ts +3 -3
- package/dist/queries/cleanup-plan.js +1 -1
- package/dist/queries/co-change.d.ts +20 -2
- package/dist/queries/co-change.js +1 -1
- package/dist/queries/code.d.ts +1 -1
- package/dist/queries/code.js +1 -1
- package/dist/queries/complexity.d.ts +6 -3
- package/dist/queries/complexity.js +1 -1
- package/dist/queries/context.d.ts +1 -7
- package/dist/queries/context.js +1 -1
- package/dist/queries/coupling.js +1 -1
- package/dist/queries/cycles.js +1 -1
- package/dist/queries/dead.d.ts +2 -0
- package/dist/queries/dead.js +1 -1
- package/dist/queries/decorative-checkers.js +1 -1
- package/dist/queries/dependence-slice.d.ts +46 -22
- package/dist/queries/dependence-slice.js +1 -1
- package/dist/queries/dependency-depth.d.ts +1 -7
- package/dist/queries/dependency-depth.js +1 -1
- package/dist/queries/deps.js +1 -1
- package/dist/queries/diff-impact.d.ts +3 -1
- package/dist/queries/diff-impact.js +1 -1
- package/dist/queries/doc-drift.js +1 -1
- package/dist/queries/drift.d.ts +1 -1
- package/dist/queries/drift.js +1 -1
- package/dist/queries/duplicate-bodies.d.ts +29 -2
- package/dist/queries/duplicate-bodies.js +1 -1
- package/dist/queries/entry-map.d.ts +2 -4
- package/dist/queries/entry-map.js +1 -1
- package/dist/queries/evidence.d.ts +121 -61
- package/dist/queries/evidence.js +1 -1
- package/dist/queries/fan.js +1 -1
- package/dist/queries/files.js +1 -1
- package/dist/queries/health.d.ts +1 -1
- 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 +1 -1
- package/dist/queries/hotspots.js +1 -1
- package/dist/queries/imports.d.ts +1 -0
- package/dist/queries/imports.js +1 -1
- package/dist/queries/incomplete-migration.d.ts +3 -3
- package/dist/queries/incomplete-migration.js +1 -1
- package/dist/queries/index.d.ts +17 -65
- package/dist/queries/index.js +1 -1
- package/dist/queries/locality-candidates.d.ts +4 -4
- 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.js +1 -1
- package/dist/queries/not-implemented.d.ts +2 -6
- package/dist/queries/not-implemented.js +1 -1
- package/dist/queries/outline.js +1 -1
- package/dist/queries/passthrough-candidates.d.ts +9 -1
- package/dist/queries/passthrough-candidates.js +1 -1
- package/dist/queries/react-component-duplicates.d.ts +19 -3
- package/dist/queries/react-component-duplicates.js +1 -1
- package/dist/queries/react-hook-candidates.d.ts +22 -3
- package/dist/queries/react-hook-candidates.js +1 -1
- package/dist/queries/react-large-component-pressure.d.ts +17 -3
- package/dist/queries/react-large-component-pressure.js +1 -1
- package/dist/queries/recent-duplicates.js +1 -1
- package/dist/queries/redundant-reexports.d.ts +4 -14
- package/dist/queries/redundant-reexports.js +1 -1
- package/dist/queries/refs.d.ts +4 -1
- package/dist/queries/refs.js +1 -1
- package/dist/queries/review.d.ts +188 -0
- package/dist/queries/review.js +2 -0
- package/dist/queries/similar-files.d.ts +7 -10
- package/dist/queries/similar-files.js +1 -1
- package/dist/queries/similar-signatures.js +1 -1
- package/dist/queries/similar.d.ts +19 -1
- package/dist/queries/similar.js +1 -1
- package/dist/queries/slice-cohesion.d.ts +205 -0
- package/dist/queries/slice-cohesion.js +2 -0
- package/dist/queries/source-inspection.d.ts +6 -202
- package/dist/queries/source-inspection.js +1 -1
- package/dist/queries/source-search.d.ts +2 -3
- package/dist/queries/source-search.js +1 -1
- package/dist/queries/stats.d.ts +1 -0
- package/dist/queries/stats.js +1 -1
- package/dist/queries/surface.js +1 -1
- package/dist/queries/symbols.js +1 -1
- package/dist/queries/system.d.ts +4 -2
- package/dist/queries/system.js +1 -1
- package/dist/queries/test-quality.d.ts +1 -1
- package/dist/queries/test-quality.js +1 -1
- package/dist/queries/twin-drift.d.ts +23 -7
- package/dist/queries/twin-drift.js +1 -1
- package/dist/queries/unused-imports.js +1 -1
- package/dist/queries/unused-params.d.ts +3 -15
- package/dist/queries/unused-params.js +1 -1
- package/dist/queries/vue-component-duplicates.js +1 -1
- package/dist/queries/vue-composable-candidates.js +1 -1
- package/dist/queries/vue-large-view-pressure.js +1 -1
- package/dist/query-service-fastpath.js +5 -5
- package/dist/query-service-server.js +4 -4
- package/dist/refs-CCBJG7WK.js +2 -0
- package/dist/refs-pagination-DRNLVU4S.js +2 -0
- package/dist/reindex-worker.js +79 -29
- package/dist/reindex.js +45 -45
- package/dist/repository-cache-worker.js +2 -0
- package/dist/runtime.d.ts +8 -8
- package/dist/runtime.js +3 -4
- 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/service-queries-2WAJI7R6.js +6 -0
- package/dist/source-inspection-91U9zdO3.d.ts +341 -0
- package/dist/{source-search-types-Dwz8KeuW.d.ts → source-search-types-DWGYNg8M.d.ts} +15 -2
- package/dist/stats-G7DIV6VU.js +2 -0
- package/dist/surface-IO55UALI.js +2 -0
- package/dist/system-ZBMSHJXU.js +2 -0
- package/dist/{queries/trace.d.ts → trace-BMjw3prn.d.ts} +1 -18
- package/dist/typescript-indexer.js +2 -0
- package/dist/typescript-mailbox-worker.js +1 -1
- package/dist/watch-server.js +3 -3
- package/docs/AGENT_GUIDE.md +19 -128
- package/docs/CLI_JSON_OUTPUT.md +21 -17
- package/docs/COMMAND_REFERENCE.md +34 -49
- package/docs/CURRENT_COMMANDS.md +123 -0
- package/docs/DETECTOR_EVIDENCE_CONTRACTS.md +0 -40
- package/docs/DETECTOR_GUIDE.md +55 -12
- package/docs/PRODUCT_VISION.md +135 -0
- package/docs/PROPERTY_TESTING.md +73 -0
- package/docs/REVIEW.md +76 -0
- package/docs/SKILLS.md +51 -0
- package/docs/WINDOWS_SIDECAR_RELEASE.md +12 -3
- package/docs/accuracy-audit-checklist.md +70 -13
- package/docs/analyzer-inventory.md +2 -2
- package/docs/locality-analyzer-design.md +9 -9
- package/package.json +18 -80
- package/scripts/evidence-product-contract.mjs +7 -3
- package/scripts/record-review-coverage.mjs +118 -0
- package/scripts/scip-windows-provenance.mjs +29 -19
- package/skills/scip-architecture-review/SKILL.md +57 -0
- package/skills/scip-architecture-review/agents/openai.yaml +4 -0
- package/skills/scip-architecture-review/references/design-checks.md +17 -0
- package/skills/scip-explore/SKILL.md +15 -59
- package/skills/scip-explore/agents/openai.yaml +3 -3
- package/skills/scip-explore/references/external-evidence.md +2 -2
- package/skills/scip-explore/references/information-model.md +26 -29
- package/skills/scip-explore/scripts/capture-evidence.mjs +68 -34
- package/skills/scip-integrity-audit/SKILL.md +53 -181
- package/skills/scip-integrity-audit/agents/openai.yaml +3 -3
- package/skills/scip-integrity-audit/references/integrity-probes.md +27 -0
- package/skills/scip-plan/SKILL.md +39 -65
- package/skills/scip-plan/agents/openai.yaml +2 -2
- package/skills/scip-query/SKILL.md +28 -81
- package/skills/scip-query/agents/openai.yaml +2 -2
- package/skills/scip-query/references/command-guide.md +169 -0
- package/skills/scip-setup/SKILL.md +4 -2
- package/skills/scip-setup/agents/openai.yaml +3 -3
- package/dist/by-kind-XI2CSWEY.js +0 -2
- package/dist/call-graph-UONR6JR5.js +0 -2
- package/dist/call-graph-evidence-lZa2dwQA.d.ts +0 -11
- package/dist/chunk-26CT72HM.js +0 -2
- package/dist/chunk-2E7CX53V.js +0 -2
- package/dist/chunk-2GRUZAQF.js +0 -43
- package/dist/chunk-2LDBDR6J.js +0 -29
- package/dist/chunk-2OOY75BW.js +0 -2
- package/dist/chunk-2R3V3PSD.js +0 -4
- package/dist/chunk-2WC2OEDO.js +0 -4
- package/dist/chunk-35NLDRZC.js +0 -2
- package/dist/chunk-3AF4TUFK.js +0 -3
- package/dist/chunk-3D3QG236.js +0 -2
- package/dist/chunk-3FHOF22C.js +0 -21
- package/dist/chunk-3JKSW6LJ.js +0 -2
- package/dist/chunk-3L2ZBPEX.js +0 -133
- package/dist/chunk-3PJABJSU.js +0 -2
- package/dist/chunk-3SVF22I5.js +0 -2
- package/dist/chunk-3WR4E3A3.js +0 -3
- package/dist/chunk-4FTZ4P5G.js +0 -2
- package/dist/chunk-4UX2F3JX.js +0 -2
- package/dist/chunk-4WNW27SX.js +0 -2
- package/dist/chunk-5ENOG4VP.js +0 -61
- package/dist/chunk-64BFSI5I.js +0 -2
- package/dist/chunk-66DVSJQG.js +0 -455
- package/dist/chunk-6HFCYNYE.js +0 -9
- package/dist/chunk-6PQNKL3G.js +0 -3
- package/dist/chunk-6V5CNXL6.js +0 -2
- package/dist/chunk-6VVV4WRR.js +0 -4
- package/dist/chunk-7BWFZPPZ.js +0 -2
- package/dist/chunk-7CYG22FH.js +0 -2
- package/dist/chunk-7F45LJKI.js +0 -2
- package/dist/chunk-7IWV2EG3.js +0 -3
- package/dist/chunk-7KCZELVM.js +0 -2
- package/dist/chunk-AFHTBORT.js +0 -2
- package/dist/chunk-AVRYW5OZ.js +0 -2
- package/dist/chunk-B3X6KU75.js +0 -2
- package/dist/chunk-B5D7QPBE.js +0 -4
- package/dist/chunk-BBCIS4DX.js +0 -16
- package/dist/chunk-BDUVI7TO.js +0 -3
- package/dist/chunk-BE7ZZTMC.js +0 -2
- package/dist/chunk-BHVUJOCQ.js +0 -3
- package/dist/chunk-BJT7LSPK.js +0 -3
- package/dist/chunk-BKVWUP7Y.js +0 -2
- package/dist/chunk-BQGB4HBD.js +0 -2
- package/dist/chunk-BRV7PIFF.js +0 -2
- package/dist/chunk-CEEZJXEF.js +0 -2
- package/dist/chunk-CIYLO6SI.js +0 -7
- package/dist/chunk-CJZXN4NU.js +0 -2
- package/dist/chunk-CNO7TOKL.js +0 -2
- package/dist/chunk-COF23M5F.js +0 -2
- package/dist/chunk-CWFP7GM5.js +0 -2
- package/dist/chunk-D2DHWI3D.js +0 -2
- package/dist/chunk-D4N5SQ2M.js +0 -4
- package/dist/chunk-DBRSYFXR.js +0 -2
- package/dist/chunk-DHUIOLDT.js +0 -2
- package/dist/chunk-DIRJWYBM.js +0 -6
- package/dist/chunk-DIUFNHRJ.js +0 -35
- package/dist/chunk-DRENNWRG.js +0 -2
- package/dist/chunk-DTZCKZEU.js +0 -4
- package/dist/chunk-DULC3QFP.js +0 -5
- package/dist/chunk-DYGHBZ2N.js +0 -16
- package/dist/chunk-E5R6AQ73.js +0 -40
- package/dist/chunk-E73UNJTF.js +0 -38
- package/dist/chunk-EKV5HX33.js +0 -2
- package/dist/chunk-EQHFIL6T.js +0 -3
- package/dist/chunk-ESIQ66Z7.js +0 -2
- package/dist/chunk-EVFUMY4R.js +0 -3
- package/dist/chunk-F7DY272B.js +0 -2
- package/dist/chunk-FBN2FGXG.js +0 -2
- package/dist/chunk-FDLOBR6P.js +0 -4
- package/dist/chunk-FESCRNVV.js +0 -5
- package/dist/chunk-FFRKR4EQ.js +0 -2
- package/dist/chunk-FGA2U4OR.js +0 -8
- package/dist/chunk-FIQRSHVM.js +0 -2
- package/dist/chunk-FPYLNQPT.js +0 -2
- package/dist/chunk-FRUSVINH.js +0 -2
- package/dist/chunk-GSP44ENC.js +0 -2
- package/dist/chunk-GUFSG5TX.js +0 -2
- package/dist/chunk-GYIZ4NXB.js +0 -2
- package/dist/chunk-GZIUDL6G.js +0 -2
- package/dist/chunk-H5EXS3HM.js +0 -2
- package/dist/chunk-HCXEQRFF.js +0 -18
- package/dist/chunk-HEHOQQKH.js +0 -2
- package/dist/chunk-HKGFPJ4T.js +0 -4
- package/dist/chunk-HLZTEXRA.js +0 -2
- package/dist/chunk-HOENASQM.js +0 -3
- package/dist/chunk-HVF5VBG6.js +0 -2
- package/dist/chunk-I55I7XXP.js +0 -2
- package/dist/chunk-IDFEUFKS.js +0 -2
- package/dist/chunk-IHGQTTVW.js +0 -2
- package/dist/chunk-IICPE7B2.js +0 -20
- package/dist/chunk-IL676XCC.js +0 -18
- package/dist/chunk-IW5XQG5G.js +0 -2
- package/dist/chunk-IZDPJ2QI.js +0 -2
- package/dist/chunk-J66VOFW6.js +0 -5
- package/dist/chunk-JFMEXGFE.js +0 -2
- package/dist/chunk-JGKUET5J.js +0 -3
- package/dist/chunk-JS4PGXMV.js +0 -3
- package/dist/chunk-JWTGMPIT.js +0 -80
- package/dist/chunk-JYR66JN5.js +0 -5
- package/dist/chunk-KFOYCQAJ.js +0 -9
- package/dist/chunk-KLFEXGQA.js +0 -2
- package/dist/chunk-KMVGRIO2.js +0 -2
- package/dist/chunk-KYSDI3GE.js +0 -5
- package/dist/chunk-L6PJPETJ.js +0 -29
- package/dist/chunk-LDVT66YM.js +0 -2
- package/dist/chunk-LEECKFCJ.js +0 -2
- package/dist/chunk-LMZ5PRUV.js +0 -2
- package/dist/chunk-LQRQN2XA.js +0 -2
- package/dist/chunk-LXABEJX3.js +0 -2
- package/dist/chunk-MNV5FSBW.js +0 -3
- package/dist/chunk-MPQ4OTBM.js +0 -2
- package/dist/chunk-MTDBHTSF.js +0 -2
- package/dist/chunk-MV3CDXPI.js +0 -38
- package/dist/chunk-MWN53KRN.js +0 -60
- package/dist/chunk-MXNGIEPU.js +0 -3
- package/dist/chunk-N2ZSIIGR.js +0 -117
- package/dist/chunk-N5B2NILC.js +0 -5
- package/dist/chunk-NJITK2GP.js +0 -2
- package/dist/chunk-NOGJXYFO.js +0 -2
- package/dist/chunk-NOYBFVJA.js +0 -554
- package/dist/chunk-NWQXSFFU.js +0 -3
- package/dist/chunk-ODDUPDP7.js +0 -13
- package/dist/chunk-OLIWTZI3.js +0 -3
- package/dist/chunk-OLNV6I6U.js +0 -2
- package/dist/chunk-OR2E3AGZ.js +0 -2
- package/dist/chunk-OSR2GEHQ.js +0 -2
- package/dist/chunk-OSSESPDX.js +0 -3
- package/dist/chunk-OWOOWNJ5.js +0 -7
- package/dist/chunk-P42EIXTA.js +0 -2
- package/dist/chunk-PJFGPYTU.js +0 -2
- package/dist/chunk-PP7KNN7L.js +0 -2
- package/dist/chunk-PU7T5QYQ.js +0 -2
- package/dist/chunk-PWWAJSKV.js +0 -74
- package/dist/chunk-PZL5T7SU.js +0 -73
- package/dist/chunk-QBE3YX64.js +0 -23
- package/dist/chunk-QGVTFRY2.js +0 -7
- package/dist/chunk-QOJONDS7.js +0 -2
- package/dist/chunk-QU5XRYB5.js +0 -4
- package/dist/chunk-QUU5OBVK.js +0 -11
- package/dist/chunk-RBLQNW26.js +0 -20
- package/dist/chunk-RTQ7NEKG.js +0 -81
- package/dist/chunk-SQXRS7BG.js +0 -4
- package/dist/chunk-SSK6LDPC.js +0 -2
- package/dist/chunk-SZHGTCPP.js +0 -7
- package/dist/chunk-T4N4P2K5.js +0 -16
- package/dist/chunk-TA3QKLLU.js +0 -2
- package/dist/chunk-TEBQMNVI.js +0 -43
- package/dist/chunk-TPFHAQ2G.js +0 -2
- package/dist/chunk-TQPCBMWT.js +0 -5
- package/dist/chunk-TQZV7KV4.js +0 -2
- package/dist/chunk-TRNAEQ6P.js +0 -3
- package/dist/chunk-TY7CRN3Z.js +0 -2
- package/dist/chunk-UHFYCMZO.js +0 -35
- package/dist/chunk-UICY4GTQ.js +0 -7
- package/dist/chunk-UVGEWT4Y.js +0 -26
- package/dist/chunk-UXW33INU.js +0 -29
- package/dist/chunk-VMPRET3I.js +0 -5
- package/dist/chunk-VNLGKHS6.js +0 -6
- package/dist/chunk-VQILFTEH.js +0 -2
- package/dist/chunk-VUPHCS7Y.js +0 -57
- package/dist/chunk-VVZSBTSU.js +0 -23
- package/dist/chunk-VZRNID6A.js +0 -2
- package/dist/chunk-W5OXRYGE.js +0 -7
- package/dist/chunk-W6STWDQI.js +0 -57
- package/dist/chunk-W7CXK74K.js +0 -2
- package/dist/chunk-WB3WYIRE.js +0 -4
- package/dist/chunk-WDNVY4E7.js +0 -20
- package/dist/chunk-WK46TNUM.js +0 -3
- package/dist/chunk-WNTFFKAX.js +0 -12
- package/dist/chunk-WOIKCX6A.js +0 -2
- package/dist/chunk-WUN6KBHV.js +0 -2
- package/dist/chunk-WYCTJDVR.js +0 -2
- package/dist/chunk-WYPL7GF7.js +0 -2
- package/dist/chunk-XDAUYDFT.js +0 -2
- package/dist/chunk-XDQMU3BT.js +0 -2
- package/dist/chunk-XFA4SSO3.js +0 -3
- package/dist/chunk-XGZEP6GR.js +0 -8
- package/dist/chunk-XPDPNWTQ.js +0 -368
- package/dist/chunk-XRYABF57.js +0 -8
- package/dist/chunk-YBGKCQIS.js +0 -2
- package/dist/chunk-YEN6CYC7.js +0 -16
- package/dist/chunk-YF5IB2LF.js +0 -2
- package/dist/chunk-YI2AWIHC.js +0 -3
- package/dist/chunk-YPWBKGFU.js +0 -2
- package/dist/chunk-YPWHBBIS.js +0 -2
- package/dist/chunk-YSH6U3L4.js +0 -3
- package/dist/chunk-YU5DZUZI.js +0 -10
- package/dist/chunk-YWO5DDRC.js +0 -16
- package/dist/chunk-Z4CDXYNQ.js +0 -2
- package/dist/chunk-ZF5KHH7C.js +0 -2
- package/dist/chunk-ZOHS7AQV.js +0 -21
- package/dist/chunk-ZTI4SBFV.js +0 -3
- package/dist/code-MI6F2TTU.js +0 -2
- package/dist/code-result-json-FXALY4HE.js +0 -2
- package/dist/command-descriptors-P34VABY5.js +0 -343
- package/dist/dataflow-4KEMJPC6.js +0 -2
- package/dist/dependence-slice-R7FPWD5M.js +0 -2
- package/dist/deps-7EMQUYUT.js +0 -2
- package/dist/direct-navigation-6YO234F2.js +0 -3
- package/dist/entry-map-KOOLR26E.js +0 -2
- package/dist/files-OPIPJIGZ.js +0 -2
- package/dist/graph-evidence-Bjyky2V4.d.ts +0 -126
- package/dist/hierarchy-QPD2CAER.js +0 -2
- package/dist/imports-M6HUXRXC.js +0 -2
- package/dist/members-I5MEFOCT.js +0 -2
- package/dist/methods-5JYGGHXA.js +0 -2
- package/dist/next-anchor-candidates-BwMczMvX.d.ts +0 -90
- package/dist/output-continuation-command-UPQAAKBP.js +0 -3
- package/dist/output-pagination-3OFL2MJV.js +0 -19
- package/dist/project-reindex-UKKQ5PLS.js +0 -3
- package/dist/queries/anchors.d.ts +0 -123
- package/dist/queries/anchors.js +0 -2
- package/dist/queries/complexity-hotspots.d.ts +0 -40
- package/dist/queries/complexity-hotspots.js +0 -2
- package/dist/queries/convergence.d.ts +0 -33
- package/dist/queries/convergence.js +0 -2
- package/dist/queries/dataflow.d.ts +0 -77
- package/dist/queries/dataflow.js +0 -2
- package/dist/queries/deep-chains.d.ts +0 -5
- package/dist/queries/deep-chains.js +0 -2
- package/dist/queries/extract-candidates.d.ts +0 -52
- package/dist/queries/extract-candidates.js +0 -2
- package/dist/queries/isolated.d.ts +0 -24
- package/dist/queries/isolated.js +0 -2
- package/dist/queries/plan-context.d.ts +0 -33
- package/dist/queries/plan-context.js +0 -2
- package/dist/queries/reference-neighborhood.d.ts +0 -4
- package/dist/queries/reference-neighborhood.js +0 -2
- package/dist/queries/reference-reachability.d.ts +0 -48
- package/dist/queries/reference-reachability.js +0 -2
- package/dist/queries/self-audit.d.ts +0 -63
- package/dist/queries/self-audit.js +0 -2
- package/dist/queries/similar-chains.d.ts +0 -48
- package/dist/queries/similar-chains.js +0 -2
- package/dist/queries/slice.d.ts +0 -4
- package/dist/queries/slice.js +0 -2
- package/dist/queries/stale-abstractions.d.ts +0 -72
- package/dist/queries/stale-abstractions.js +0 -2
- package/dist/queries/system-map.d.ts +0 -449
- package/dist/queries/system-map.js +0 -2
- package/dist/queries/trace.js +0 -2
- package/dist/queries/twin-ab.d.ts +0 -66
- package/dist/queries/twin-ab.js +0 -2
- package/dist/queries/value-flow.d.ts +0 -43
- package/dist/queries/value-flow.js +0 -2
- package/dist/queries/wrapper-candidates.d.ts +0 -34
- package/dist/queries/wrapper-candidates.js +0 -2
- package/dist/refs-PSU4JZZW.js +0 -2
- package/dist/refs-pagination-JG6CJMRC.js +0 -2
- package/dist/slice-HYRATV64.js +0 -2
- package/dist/source-snippet-_wrcgmZc.d.ts +0 -15
- package/dist/stats-OOJ74B32.js +0 -2
- package/dist/surface-VTGDYWF5.js +0 -2
- package/dist/symbol-resolution-WD5EU5JE.js +0 -2
- package/dist/system-LRQNFOR2.js +0 -2
- package/dist/trace-F4B6OLL4.js +0 -2
- package/dist/value-flow-VRPZY72V.js +0 -2
- package/skills/concrete-plan/SKILL.md +0 -8
- package/skills/concrete-plan/agents/openai.yaml +0 -4
package/README.md
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
# scip-query
|
|
2
2
|
|
|
3
|
-
scip-query
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
3
|
+
For the normal **explore → plan → implement → review** workflow, use `scip-query system --source` for a module inventory, `scip-query health` for cleanup candidates, and `scip-query review --base HEAD` after edits. These inspect current TS/JS source without an index. See [agent workflows and module evidence](docs/SKILLS.md), [review and coverage](docs/REVIEW.md), and the [product vision](docs/PRODUCT_VISION.md).
|
|
4
|
+
|
|
5
|
+
scip-query helps coding agents inspect code relationships and review changes.
|
|
6
|
+
It uses compiler-produced symbol identities to distinguish definitions that happen
|
|
7
|
+
to share a name, then attaches source locations and coverage to the relationships
|
|
8
|
+
it reports.
|
|
9
|
+
|
|
10
|
+
The core workflow is to locate the code, inspect the relationships relevant to a
|
|
11
|
+
change, make the change, and check its consumers and declared architectural rules.
|
|
12
|
+
The tool supplies evidence; design decisions still require understanding the
|
|
13
|
+
project's responsibilities and verifying behavior with tests.
|
|
14
|
+
|
|
15
|
+
| Question | Evidence to use |
|
|
16
|
+
| --- | --- |
|
|
17
|
+
| Which definition does this reference mean? | Search, outline, references, exact source |
|
|
18
|
+
| What can call this, or be called by it? | Execution relationships |
|
|
19
|
+
| Where does a value come from? | Value transfers and function-local dependence slices |
|
|
20
|
+
| What state or external boundary does this operation touch? | State and runtime relationships, with provider limits |
|
|
21
|
+
| Which dependencies are permitted? | Explicit architecture rules |
|
|
22
|
+
| What might my edit affect? | Changed symbols and downstream consumers from diff-impact |
|
|
23
|
+
| Which code warrants review? | Individual health findings, exclusions, and analysis coverage |
|
|
24
|
+
|
|
25
|
+
Containment identifies where a symbol is declared. Domain ownership identifies
|
|
26
|
+
which module is responsible for enforcing a rule or controlling a resource;
|
|
27
|
+
containment alone cannot establish that responsibility. Neither a dependency count
|
|
28
|
+
nor a detector finding establishes architectural quality.
|
|
29
29
|
|
|
30
30
|
## Install
|
|
31
31
|
|
|
@@ -49,7 +49,7 @@ allow-scripts=... --location=user` command npm prints; `--allow-scripts` is
|
|
|
49
49
|
rejected inside a project directory by design.
|
|
50
50
|
|
|
51
51
|
Setup detects supported languages, installs or checks their indexers, builds
|
|
52
|
-
the local index, installs the
|
|
52
|
+
the local index, installs the six agent workflows, and writes concise agent guidance.
|
|
53
53
|
When the repository declares valid architecture rules, setup also installs one
|
|
54
54
|
checkout-local Stop hook that checks those rules after indexed source changes.
|
|
55
55
|
It does not install a completion gate, pre-commit gate, or CI enforcement.
|
|
@@ -63,81 +63,36 @@ scip-query capabilities
|
|
|
63
63
|
|
|
64
64
|
## The normal workflow
|
|
65
65
|
|
|
66
|
-
Use
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
those facts. scip-query resolves identity, typed edges, evidence strength, provider
|
|
72
|
-
support, and bounded coverage; it does not decide which facts matter to the task.
|
|
66
|
+
Use ordinary file search and source reads for implementation details. Use
|
|
67
|
+
scip-query to inspect relationships, discover reuse opportunities, evaluate
|
|
68
|
+
module dependencies and review actual changes. For a substantial change, map
|
|
69
|
+
the existing central path and comparable features before choosing an extension
|
|
70
|
+
point; document what will be reused and which consumers are affected.
|
|
73
71
|
|
|
74
72
|
```bash
|
|
75
|
-
scip-query
|
|
76
|
-
scip-query evidence
|
|
77
|
-
--symbol 'appendWorkSessionStreamEvents' \
|
|
78
|
-
--edge execution \
|
|
79
|
-
--edge runtime \
|
|
80
|
-
--direction both \
|
|
81
|
-
--depth 2 \
|
|
82
|
-
--max-edges 32
|
|
73
|
+
scip-query system --source
|
|
74
|
+
scip-query evidence --at src/service.ts:42 --edge execution --direction incoming --depth 1 --max-edges 30
|
|
83
75
|
```
|
|
84
76
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
would exceed the active output budget, `code` emits no partial source and
|
|
105
|
-
prints exact complete-packet splits; narrow to the exact units still needed
|
|
106
|
-
before deciding whether every split remains necessary.
|
|
107
|
-
|
|
108
|
-
Start an unknown path with `search`; batch related text, symbol, and file-line
|
|
109
|
-
anchors with `inspect`; use `evidence` when one symbol and its real uses are the
|
|
110
|
-
center of the question. For tracked nonbinary repository content, keep
|
|
111
|
-
exploration on scip-query. Native tools are for applying edits, running checks,
|
|
112
|
-
binary content, or a specific unsupported gap that scip-query has explicitly
|
|
113
|
-
reported.
|
|
114
|
-
|
|
115
|
-
```bash
|
|
116
|
-
scip-query search work_session_stream_events
|
|
117
|
-
scip-query inspect --search sessionStreamEvents --search work_session_stream_events --view behavior
|
|
118
|
-
scip-query evidence appendWorkSessionStreamEvents --include definition,references,callers,callees
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
`inspect --view behavior` returns the cheapest faithful syntax-derived view of
|
|
122
|
-
each complete source unit. Compact units stay raw. Larger units become
|
|
123
|
-
hierarchical outlines only when that representation is materially smaller;
|
|
124
|
-
every source statement is represented, and unsupported or
|
|
125
|
-
compression-sensitive statements are copied verbatim. Coverage reports the
|
|
126
|
-
represented, copied, and omitted counts. Exact source can be requested for any
|
|
127
|
-
unit whose complete implementation matters. `inspect --symbol` includes definitions,
|
|
128
|
-
references, callers, callees, dependencies, and consumers by default.
|
|
129
|
-
|
|
130
|
-
Search, location, and relationship evidence is deduplicated into one ranked
|
|
131
|
-
packet. Exact locations and definitions rank first; later units must add new
|
|
132
|
-
file, role, scope, symbol, or behavior coverage. A default packet materializes
|
|
133
|
-
at most 12 matching lines per text selector, then applies a soft ceiling of 48
|
|
134
|
-
units or 60,000 displayed-evidence characters without clipping a returned
|
|
135
|
-
syntax unit. Its omission ledger groups everything withheld by scope and role,
|
|
136
|
-
reports what each group contains, and gives an exact command for drilling into
|
|
137
|
-
that group. Drill into several relevant groups together; use `--full` only when
|
|
138
|
-
all omitted evidence can change the decision. Large rendered output from other
|
|
139
|
-
commands can still use the universal byte-transport continuation printed by
|
|
140
|
-
every command.
|
|
77
|
+
The module inventory shows groups and dependencies; selecting a printed group
|
|
78
|
+
reveals its files, exports and import sites. The evidence command answers a
|
|
79
|
+
chosen relationship question. Use incoming/outgoing execution for callers and
|
|
80
|
+
callees, dataflow for values, runtime for handoffs and dependencies for imports.
|
|
81
|
+
Candidate edges require confirmation. Missing or bounded evidence cannot
|
|
82
|
+
establish absence. `evidence --detail` adds inventory and provider explanations
|
|
83
|
+
when their limitations matter.
|
|
84
|
+
|
|
85
|
+
`search`, `outline`, `entrypoints`, `code` and `inspect` remain optional tools
|
|
86
|
+
for compiler identity, nesting, external roots or grouped source reads. `code`
|
|
87
|
+
accepts exact symbols, file ranges or file paths; `--members all` selects a
|
|
88
|
+
complete file and `--local-calls` adds same-file callees of a selected range.
|
|
89
|
+
`inspect --view behavior` can provide a statement-accounted view of a selected
|
|
90
|
+
construct. Both source commands add external literal values only with
|
|
91
|
+
`--bindings`. Their machine results retain detailed evidence.
|
|
92
|
+
|
|
93
|
+
Load the relevant [workflow skill](docs/SKILLS.md), batch useful questions and
|
|
94
|
+
stop when the facts needed for the change are settled. There is no requirement
|
|
95
|
+
to exhaust the command catalogue, unrelated relationships or saved output.
|
|
141
96
|
|
|
142
97
|
Before a nonlocal change:
|
|
143
98
|
|
|
@@ -146,7 +101,7 @@ scip-query context RetryPolicy
|
|
|
146
101
|
```
|
|
147
102
|
|
|
148
103
|
`context` returns a bounded evidence packet for a symbol, file, or module. It
|
|
149
|
-
combines definitions, references,
|
|
104
|
+
combines definitions, references, call neighborhoods, dependencies, consumers,
|
|
150
105
|
change risk, history, suppressions, and possible reuse sites. A bounded packet
|
|
151
106
|
is a deliberately limited result: it is useful for a decision but does not
|
|
152
107
|
claim to contain every possible relationship.
|
|
@@ -221,7 +176,6 @@ scip-query incomplete-migration --full
|
|
|
221
176
|
scip-query doc-drift --full
|
|
222
177
|
scip-query unused-params --full
|
|
223
178
|
scip-query dead --full
|
|
224
|
-
scip-query isolated --full
|
|
225
179
|
scip-query cycles --full
|
|
226
180
|
scip-query co-change --full
|
|
227
181
|
```
|
|
@@ -244,14 +198,12 @@ still pass.
|
|
|
244
198
|
|
|
245
199
|
## Focused graph queries
|
|
246
200
|
|
|
247
|
-
|
|
248
|
-
focused query when one unresolved relationship can change the decision:
|
|
201
|
+
Choose a focused query when one unresolved relationship can change the decision:
|
|
249
202
|
|
|
250
203
|
```bash
|
|
251
204
|
scip-query refs SomeSymbol --full
|
|
252
|
-
scip-query trace SomeSymbol
|
|
253
205
|
scip-query call-graph SomeSymbol
|
|
254
|
-
scip-query
|
|
206
|
+
scip-query evidence --symbol SomeSymbol --edge dataflow --direction both --depth 2 --max-edges 48
|
|
255
207
|
scip-query affected SomeSymbol --full
|
|
256
208
|
scip-query system src/payments
|
|
257
209
|
scip-query surface src/payments
|
|
@@ -262,6 +214,43 @@ scip-query rdeps src/payments/service.ts
|
|
|
262
214
|
Do not repeat an unchanged query after context compaction. Re-run when source,
|
|
263
215
|
the index generation, the command input, or the required coverage changed.
|
|
264
216
|
|
|
217
|
+
## Value flow and slicing
|
|
218
|
+
|
|
219
|
+
A value transfer connects a particular value-producing occurrence to an occurrence
|
|
220
|
+
that receives it. `evidence --edge dataflow` reports supported static transfer relationships,
|
|
221
|
+
including argument-to-parameter and consumed return-value relationships. Each
|
|
222
|
+
edge distinguishes confirmed evidence from candidates and reports provider limits.
|
|
223
|
+
|
|
224
|
+
A backward slice identifies the source occurrences that can affect a chosen
|
|
225
|
+
variable occurrence through assignments, value use, or conditions governing
|
|
226
|
+
execution. A forward slice follows those dependencies toward affected occurrences.
|
|
227
|
+
`dependence-slice` computes these within one TypeScript or JavaScript callable:
|
|
228
|
+
|
|
229
|
+
```bash
|
|
230
|
+
scip-query dependence-slice src/payments/service.ts:42 --variable total
|
|
231
|
+
scip-query dependence-slice src/payments/service.ts:42 --variable total --column 10
|
|
232
|
+
scip-query dependence-slice src/payments/service.ts:12 --variable amount --forward
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
Lines and columns in command arguments are one-based. Ambiguous occurrences are
|
|
236
|
+
listed for refinement. The default traverses the local graph to completion;
|
|
237
|
+
`--depth` limits hops and `--max-edges` bounds rendered edges. Coverage distinguishes
|
|
238
|
+
output bounds from an incomplete analysis. Calls into other functions, general heap
|
|
239
|
+
aliasing (different references to the same stored object), closure invocation order,
|
|
240
|
+
and unsupported exception behavior require separate evidence. This is a dependency
|
|
241
|
+
slice, not a proof that extracting its statements into a function preserves behavior.
|
|
242
|
+
|
|
243
|
+
`slice-cohesion` compares slices for a function's different outputs to suggest
|
|
244
|
+
possible separations. Its suggestions require source confirmation and tests; partial
|
|
245
|
+
models cannot earn an extraction signal. Health reports retain the individual
|
|
246
|
+
findings and coverage without aggregate quality grades.
|
|
247
|
+
|
|
248
|
+
## Optional skills
|
|
249
|
+
|
|
250
|
+
Setup and `install-skills` install `scip-query` and `scip-explore` by default.
|
|
251
|
+
Use `scip-query install-skills --all` to install the shipped specialist workflows.
|
|
252
|
+
Existing specialist installations and user-owned skill directories are preserved.
|
|
253
|
+
|
|
265
254
|
## Suppressions
|
|
266
255
|
|
|
267
256
|
A suppression is a versioned repository record that says one detector finding
|
|
@@ -289,26 +278,26 @@ line numbers readable. Programmatic consumers can use:
|
|
|
289
278
|
scip-query context RetryPolicy --json --result-only
|
|
290
279
|
```
|
|
291
280
|
|
|
292
|
-
Search
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
batched drilldowns for selected owners. `search --full` expands every source
|
|
296
|
-
window and is not needed to establish complete text-match coverage.
|
|
281
|
+
Search displays selected matching windows once, with exact locations, optional
|
|
282
|
+
compiler owners and an honest total. Use `--scope` to narrow or `--full` to
|
|
283
|
+
expand all matching windows. The JSON result retains identity metadata.
|
|
297
284
|
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
`--reemit` force full evidence.
|
|
285
|
+
Oversized ordinary human output is saved to a private temporary file, with a
|
|
286
|
+
short preview and absolute path. Read or filter the file selectively using
|
|
287
|
+
normal tools; no automatic `continue` call is required. Saved previews expire
|
|
288
|
+
after one hour or can be reclaimed earlier under storage pressure. Redirect
|
|
289
|
+
stdout to your own file for durable output:
|
|
304
290
|
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
291
|
+
```bash
|
|
292
|
+
scip-query health --full > report.txt
|
|
293
|
+
scip-query health --json --json-output report.json
|
|
294
|
+
```
|
|
308
295
|
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
296
|
+
Small results, regular-file redirects and machine JSON contracts are preserved.
|
|
297
|
+
Explicit pagination remains a compatibility option. Cross-command evidence
|
|
298
|
+
receipts remain opt-in through `SCIP_QUERY_SESSION`; `--reemit` forces full
|
|
299
|
+
evidence. Material omissions and unsupported/stale evidence remain visible,
|
|
300
|
+
without routine successful coverage footers. See [output modes](docs/CLI_JSON_OUTPUT.md).
|
|
312
301
|
|
|
313
302
|
## Configuration
|
|
314
303
|
|
|
@@ -337,8 +326,8 @@ and focused use of the React, Vue, and general cleanup detectors.
|
|
|
337
326
|
```bash
|
|
338
327
|
npm install
|
|
339
328
|
npm run typecheck
|
|
340
|
-
npm test
|
|
341
329
|
npm run build
|
|
330
|
+
npm test
|
|
342
331
|
```
|
|
343
332
|
|
|
344
333
|
The React and Vue detector suites are part of the normal test surface and must
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{d as t}from"./chunk-
|
|
1
|
+
import{d as t}from"./chunk-YOQVEXVE.js";import"./chunk-O2C4UILI.js";import"./chunk-WXU3DGPU.js";import"./chunk-YUKYB54I.js";import"./chunk-H75GSPRV.js";import"./chunk-QOIXNWQR.js";import"./chunk-GZKFETP5.js";import"./chunk-YULZRALL.js";import"./chunk-TKD34PHN.js";import"./chunk-2HLAFUCY.js";import"./chunk-U5RIG3JP.js";import"./chunk-62BDNPMI.js";import{writeFileSync as s}from"fs";import{workerData as o}from"worker_threads";var r=o;try{let e=t({projectRoot:r.projectRoot,dbPath:r.dbPath,tsconfig:r.tsconfig,vueFiles:r.vueFiles,tasks:r.tasks});s(r.resultPath,JSON.stringify({version:1,runId:r.runId,workerId:r.workerId,taskIds:r.taskIds,ok:!0,result:e}))}catch(e){s(r.resultPath,JSON.stringify({version:1,runId:r.runId,workerId:r.workerId,taskIds:r.taskIds,ok:!1,error:e instanceof Error?e.message:String(e)}))}
|
|
2
2
|
//# sourceMappingURL=augment-vue-worker.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a,b}from"./chunk-QJRMOK5N.js";import"./chunk-DVFP6PZI.js";import"./chunk-J5FJMODQ.js";import"./chunk-WOFQ5DTB.js";import"./chunk-PH52RA7D.js";import"./chunk-7Y5T6XDP.js";import"./chunk-X6RMKHJQ.js";import"./chunk-JEVRKFRL.js";import"./chunk-QOIXNWQR.js";import"./chunk-GZKFETP5.js";import"./chunk-HRRFKWPZ.js";import"./chunk-YULZRALL.js";import"./chunk-HGFDYOVB.js";import"./chunk-TKD34PHN.js";import"./chunk-2HLAFUCY.js";import"./chunk-U5RIG3JP.js";import"./chunk-62BDNPMI.js";export{a as byKind,b as kindCounts};
|
|
2
|
+
//# sourceMappingURL=by-kind-PRVFAGTQ.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a}from"./chunk-VB3GOKOS.js";import"./chunk-BGBBVSH4.js";import"./chunk-7VPEEAAG.js";import"./chunk-S6CZA3MV.js";import"./chunk-65245JCM.js";import"./chunk-NJJMVD65.js";import"./chunk-ZHMRSZFD.js";import"./chunk-ZGTYGDMF.js";import"./chunk-WRQXLNYE.js";import"./chunk-DVFP6PZI.js";import"./chunk-QIWXRW72.js";import"./chunk-LOVIZBJ4.js";import"./chunk-QXEUDXBT.js";import"./chunk-O2C4UILI.js";import"./chunk-WXU3DGPU.js";import"./chunk-YUKYB54I.js";import"./chunk-TRBI4UKT.js";import"./chunk-WKPV2TDZ.js";import"./chunk-F4FNK44D.js";import"./chunk-ZLADLUE6.js";import"./chunk-6FFVZZL4.js";import"./chunk-4XQ4O6IM.js";import"./chunk-BZB4QPIP.js";import"./chunk-CN5EH7O3.js";import"./chunk-T3I6NHBH.js";import"./chunk-J5FJMODQ.js";import"./chunk-WOFQ5DTB.js";import"./chunk-PH52RA7D.js";import"./chunk-7Y5T6XDP.js";import"./chunk-X6RMKHJQ.js";import"./chunk-JEVRKFRL.js";import"./chunk-QOIXNWQR.js";import"./chunk-GZKFETP5.js";import"./chunk-3JIQS44J.js";import"./chunk-O4UZSPPI.js";import"./chunk-B3PYOSCX.js";import"./chunk-HRRFKWPZ.js";import"./chunk-YULZRALL.js";import"./chunk-HGFDYOVB.js";import"./chunk-QZ7KQZRN.js";import"./chunk-TKD34PHN.js";import"./chunk-2HLAFUCY.js";import"./chunk-U5RIG3JP.js";import"./chunk-62BDNPMI.js";export{a as callGraph};
|
|
2
|
+
//# sourceMappingURL=call-graph-DVPAQV2F.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where a callee edge came from. `scip-occurrence` is the indexer's own
|
|
3
|
+
* binding at the call line (compiler-resolved at index time); `ast-callsite`
|
|
4
|
+
* is a leaf-name resolution over imports and local receivers; the other two
|
|
5
|
+
* are the on-demand compiler and chunk co-occurrence paths.
|
|
6
|
+
*/
|
|
7
|
+
type CalleeEvidenceSource = 'scip-occurrence' | 'scip-declaration' | 'ast-callsite' | 'semantic-callee' | 'scip-chunk';
|
|
8
|
+
interface CalleeRow {
|
|
9
|
+
symbol: string;
|
|
10
|
+
file: string;
|
|
11
|
+
chunkId: number;
|
|
12
|
+
source: CalleeEvidenceSource;
|
|
13
|
+
/** Zero-based source line of the call expression when retained by the evidence source. */
|
|
14
|
+
callsiteLine?: number;
|
|
15
|
+
/** `jsx-render` when the edge is a rendered component element rather than a call expression. */
|
|
16
|
+
kind?: 'jsx-render';
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export type { CalleeRow as C, CalleeEvidenceSource as a };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var o=[{id:"general-interprocedural-value-flow",families:["dataflow"],capability:"Whole-program definition-use flow through arbitrary calls and returns is unavailable.",consequence:"Missing dataflow edges cannot establish that a value never crosses an unmodeled call.",recoverWith:["value-flow","dependence-slice","inspect","code"]},{id:"heap-aliasing",families:["dataflow","state"],capability:"Heap points-to and cross-instance alias analysis are unavailable.",consequence:"Missing field or state edges cannot establish that two references never reach the same object.",recoverWith:["value-flow","dependence-slice","inspect","code"]},{id:"exceptional-flow",families:["execution","dataflow","temporal"],capability:"Interprocedural exception propagation and finally completion flow are unavailable.",consequence:"Normal-path reachability and ordering do not establish behavior after a throw or rejection.",recoverWith:["dependence-slice","inspect","code"]},{id:"dynamic-callable-dispatch",families:["execution","dataflow"],capability:"General virtual dispatch and interprocedural replacement of callable values are unavailable.",consequence:"A static declaration target does not establish a unique runtime implementation or all possible overrides.",recoverWith:["hierarchy","inspect","code"]},{id:"reflection",families:["execution","runtime","identity","dependencies"],capability:"Reflective lookup, dynamic loading, and name-computed invocation are unavailable without exact evidence.",consequence:"Missing static edges cannot establish that a construct is unreachable through reflection.",recoverWith:["search","inspect","code"]},{id:"generated-dispatch",families:["execution","runtime","identity"],capability:"Dispatch tables or names created only by generated or unavailable source are unavailable.",consequence:"Missing dispatch edges cannot establish that no generated consumer exists.",recoverWith:["search","inspect","code"]},{id:"unsupported-framework-adapters",families:["runtime","dataflow","state","temporal"],capability:"Framework runtime crossings without a registered source adapter are unavailable.",consequence:"Missing boundary edges cannot establish that no producer, consumer, state effect, or ordering exists.",recoverWith:["search","inspect","code"]}];function s(t){let i=new Set(t);return o.filter(n=>n.families.some(r=>i.has(r)))}function u(t){return s(t).map(i=>`[${i.id}] ${i.capability} ${i.consequence} Recover selected paths with: ${i.recoverWith.map(n=>`scip-query ${n}`).join(", ")}.`)}var c=["incoming","outgoing","both"];function e(t,i,n,r={}){return{family:t,subtype:i,...r.match?{match:r.match}:{},directions:c,evidenceStrengths:r.strengths??["exact","derived","mixed"],supportCeiling:r.supportCeiling??"partial",establishes:n,nonClaims:r.nonClaims??[],recoverWith:r.recoverWith??["inspect","code"]}}var l=["predicate-consequence","predicate-alternative","predicate-fallthrough","predicate-case","predicate-default","predicate-return","predicate-throw","loop-iteration","loop-exit","exception-handler","finally-cleanup","handler-return","handler-throw"],d=["captured-value-to-state","constant-to-state","expression-to-state","property-to-state","return-to-state","value-to-state"],p=["await-completion-before","awaits-completion","inside-lock-scope","lexical-successor"],h=[{id:"indexed-program-identity",label:"SCIP/compiler identity and source ownership",requirements:["indexed-graph"],relations:[e("execution","call","The source construct may call the resolved target.",{strengths:["exact","derived","candidate","mixed"],nonClaims:["Static may-call reachability does not prove that an invocation occurred at runtime.","Compiler declaration identity does not resolve virtual dispatch, cross-file callable replacement, or runtime receiver identity.","Candidate call edges preserve declaration leads; consult the invocation frontier for implementation resolution. A declaration reference is not an established implementation target."],recoverWith:["call-graph","inspect","code"]}),e("execution","result-callback","The referenced callable can produce the result consumed by this path.",{nonClaims:["A callback relationship does not prove invocation order or runtime selection."],recoverWith:["call-graph","inspect","code"]}),e("contract","uses-contract-symbol","The source construct refers to the identified contract symbol.",{supportCeiling:"exact",nonClaims:["Contract identity does not prove runtime invocation or behavioral conformance."],recoverWith:["hierarchy","inspect","code"]}),e("identity","references","The occurrence resolves to the identified compiler-owned symbol.",{supportCeiling:"exact",nonClaims:["A reference does not establish execution or value transfer."],recoverWith:["refs","inspect"]}),e("ownership","contains","The owner contains the identified program construct.",{supportCeiling:"exact",nonClaims:["Structural containment does not establish runtime lifetime or sharing scope."],recoverWith:["outline","inspect"]}),e("ownership","contains-","The owner contains the identified program construct.",{match:"prefix",supportCeiling:"exact",nonClaims:["Structural containment does not establish runtime lifetime or sharing scope."],recoverWith:["outline","inspect"]}),e("ownership","owns-","The owner owns the identified source or runtime observation.",{match:"prefix",supportCeiling:"exact",nonClaims:["Observation ownership does not establish singleton lifetime or exclusive ownership."],recoverWith:["inspect","code"]}),e("dependencies","imports","The source file or module statically imports the indexed target.",{nonClaims:["An import does not establish that imported code executes."],recoverWith:["imports","deps","code"]}),e("dependencies","imports-external","The source region statically imports an external package.",{nonClaims:["An external import does not establish which package behavior executes."],recoverWith:["imports","code"]})]},{id:"runtime-boundary-join",label:"source-grounded runtime-boundary joins",requirements:["indexed-graph","source-facts"],relations:[e("runtime","runtime-handoff","A producer and consumer share a source-grounded runtime rendezvous.",{strengths:["exact","derived","candidate","mixed"],nonClaims:["A candidate or unresolved join does not prove a runtime handoff."],recoverWith:["evidence","inspect","code"]}),e("runtime","discriminator-dispatch","A serialized discriminator selects the reported consumer.",{strengths:["exact","derived","mixed"],nonClaims:["The dispatch edge does not prove delivery, retry, or successful handling."],recoverWith:["evidence","inspect","code"]}),e("dataflow","serialized-discriminator-transfer","The producer serializes the discriminator consumed by dispatch.",{strengths:["exact","derived","mixed"],nonClaims:["This edge does not establish the flow of every payload field."],recoverWith:["value-flow","inspect","code"]}),e("temporal","enqueue-before-consume","The reported enqueue precedes a possible consume through the queue.",{strengths:["exact","derived","mixed"],nonClaims:["Queue order does not establish delivery time, uniqueness, retry count, or durability."],recoverWith:["evidence","inspect","code"]})]},{id:"parser-control-dependence",label:"parser-proved intraprocedural control dependence",requirements:["indexed-graph","source-facts"],relations:[...l.map(t=>e("execution",t,"The outcome is control-dependent on the reported predicate or handler.",{strengths:["exact"],nonClaims:["Local control dependence does not establish that the containing function executes."],recoverWith:["dependence-slice","inspect","code"]})),e("execution","returns","The selected construct contains the reported return terminal.",{strengths:["exact"],nonClaims:["A local return terminal does not establish that the containing callable executes."],recoverWith:["inspect","code"]}),e("execution","throws","The selected construct contains the reported throw terminal.",{strengths:["exact"],nonClaims:["A local throw terminal does not establish propagation, handling, or callable execution."],recoverWith:["inspect","code"]})]},{id:"bounded-static-value-flow",label:"compiler callsites and bounded static value evaluation",requirements:["indexed-graph","source-facts"],relations:["argument-to-parameter","constant-to-parameter","property-to-parameter","return-to-parameter","return-to-call-result"].map(t=>e("dataflow",t,"The reported value may reach the target through the evidenced callsite transfer.",{strengths:["exact","derived","mixed"],nonClaims:["This provider does not establish general local definition-use, alias, field, or heap flow."],recoverWith:["value-flow","dependence-slice","inspect","code"]}))},{id:"typescript-local-dependence",label:"TypeScript compiler identities, control-flow graph, and reaching definitions",requirements:["typescript-semantic"],relations:[e("dataflow","definition-to-use","The definition reaches the reported read on a feasible local control-flow path.",{strengths:["exact"],nonClaims:["Local reaching definitions do not establish heap aliasing, exceptional flow, or the runtime order of closure invocation."],recoverWith:["value-flow","dependence-slice","inspect","code"]}),e("dataflow","value-to-definition","The reported right-hand-side read supplies the assigned local definition.",{strengths:["exact"],nonClaims:["A local assignment edge does not establish field or heap points-to flow."],recoverWith:["value-flow","dependence-slice","inspect","code"]}),e("dataflow","closure-capture","The nested callable reads the reported binding from an enclosing callable.",{strengths:["candidate"],supportCeiling:"candidate",nonClaims:["Closure capture does not establish whether or when the nested callable executes."],recoverWith:["call-graph","inspect","code"]}),e("dataflow","field-definition-to-use","The reported same-owner field definition can reach the field read.",{strengths:["exact","candidate"],nonClaims:["Field-name identity does not establish whole-program heap aliasing or cross-instance flow."],recoverWith:["value-flow","dependence-slice","inspect","code"]}),e("execution","control-dependence","Execution of the reported statement depends on the outcome of the predicate.",{strengths:["exact"],nonClaims:["Intraprocedural control dependence does not establish that the containing callable executes."],recoverWith:["dependence-slice","inspect","code"]})]},{id:"parser-state-temporal",label:"parser-proved local state and temporal facts",requirements:["indexed-graph","source-facts"],relations:[...d.map(t=>e("dataflow",t,"The reported source value is assigned into the identified state resource.",{strengths:["exact"],nonClaims:["The edge does not establish alias, heap, or later read flow."],recoverWith:["value-flow","inspect","code"]})),...["writes-resource","deletes-resource","reads-resource","enqueues-resource","consumes-resource"].map(t=>e("state",t,"The reported construct performs the named operation on the identified resource.",{strengths:["exact"],nonClaims:["A state operation does not establish transactionality, durability, or exclusive ownership."],recoverWith:["evidence","inspect","code"]})),...p.map(t=>e("temporal",t,"The reported source constructs have the named local ordering relationship.",{strengths:["exact"],nonClaims:["Local source order does not establish cross-process happens-before or durable completion."],recoverWith:["evidence","inspect","code"]}))]}];function m(t,i){let n=h.flatMap(r=>r.relations.filter(a=>a.family===t&&(a.match==="prefix"?i.startsWith(a.subtype):i===a.subtype)).map(a=>({provider:r,relation:a})));if(n.length>1)throw new Error(`Ambiguous graph relation provider for ${t}/${i}: ${n.map(r=>r.provider.id).join(", ")}`);return n[0]??null}export{u as a,m as b};
|
|
2
|
+
//# sourceMappingURL=chunk-2FSBGL5P.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
function f(o,r,e,i){let t=0;for(;t<r.length;){let n=e.writeFile(o,r,t,r.length-t);if(!Number.isSafeInteger(n)||n<=0||n>r.length-t)throw new Error(`${i} write did not make valid forward progress`);t+=n}}function l(o,r){if(r!=="win32")return!1;let e=o.code;return e==="EACCES"||e==="EBADF"||e==="EINVAL"||e==="EISDIR"||e==="EPERM"}export{f as a,l as b};
|
|
2
|
+
//# sourceMappingURL=chunk-2HLAFUCY.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{a as c}from"./chunk-T6DK3ZP7.js";function d(e,r,n){e!==void 0&&typeof e!="boolean"&&n.push({level:"error",path:r,message:"Must be a boolean."})}function $(e,r){if(e.architecture===void 0)return;if(!c(e.architecture)){r.push({level:"error",path:"architecture",message:"Must be an object."});return}let n=e.architecture,t=n.boundaries;if(!Array.isArray(t)||t.length===0){r.push({level:"error",path:"architecture.boundaries",message:"Must be a non-empty array."});return}let o={names:new Set,paths:new Set};for(let[i,s]of t.entries())g(s,`architecture.boundaries[${i}]`,o,r);y(n.allowedDependencies,o.names,r),b(n,r),P(n,o.names,r)}function g(e,r,n,t){if(!c(e)){t.push({level:"error",path:r,message:"Architecture boundary must be an object."});return}let o=e.name;typeof o!="string"||o.trim()===""?t.push({level:"error",path:`${r}.name`,message:"Boundary name is required."}):n.names.has(o)?t.push({level:"error",path:`${r}.name`,message:`Duplicate boundary name: ${o}`}):n.names.add(o);let i=e.subUnits;i!==void 0&&i!=="directory"&&i!=="file"&&t.push({level:"error",path:`${r}.subUnits`,message:"Must be 'directory' or 'file'."}),p(e.maxFiles,`${r}.maxFiles`,t),h(e.paths,`${r}.paths`,n.paths,t)}function h(e,r,n,t){if(!Array.isArray(e)||e.length===0){t.push({level:"error",path:r,message:"Boundary paths must be a non-empty array."});return}for(let[o,i]of e.entries()){let s=`${r}[${o}]`;if(typeof i!="string"||i.trim()===""){t.push({level:"error",path:s,message:"Boundary path must be a non-empty string."});continue}v(i)||t.push({level:"error",path:s,message:"Boundary path must be project-relative and may use only one trailing /* or /** glob."}),n.has(i)?t.push({level:"error",path:s,message:`Duplicate boundary path: ${i}`}):n.add(i)}}function y(e,r,n){if(e!==void 0){if(!c(e)){n.push({level:"error",path:"architecture.allowedDependencies",message:"Must be an object keyed by boundary name."});return}for(let[t,o]of Object.entries(e))C(t,o,r,n)}}function C(e,r,n,t){let o=`architecture.allowedDependencies.${e}`;if(n.has(e)||t.push({level:"error",path:o,message:`Unknown source boundary: ${e}`}),!Array.isArray(r)){t.push({level:"error",path:o,message:"Dependency row must be an array."});return}let i=new Set;for(let[s,a]of r.entries()){let l=`${o}[${s}]`;typeof a!="string"||a.trim()===""?t.push({level:"error",path:l,message:"Target boundary name is required."}):n.has(a)?i.has(a)?t.push({level:"error",path:l,message:`Duplicate target boundary: ${a}`}):i.add(a):t.push({level:"error",path:l,message:`Unknown target boundary: ${a}`})}}function b(e,r){for(let t of["requireAcyclic","requireCompleteCoverage","requireResolvedBoundaries","requireMinimalPolicy"])d(e[t],`architecture.${t}`,r);for(let t of["maxBoundaryFanOut","maxBoundaryFiles"])p(e[t],`architecture.${t}`,r);let n=e.testPaths;n!==void 0&&(!Array.isArray(n)||n.some(t=>typeof t!="string"))&&r.push({level:"error",path:"architecture.testPaths",message:"Must be an array of strings."})}function P(e,r,n){if(d(e.requireCompletePolicy,"architecture.requireCompletePolicy",n),e.requireCompletePolicy!==!0)return;let t=c(e.allowedDependencies)?e.allowedDependencies:{};for(let o of[...r].sort())Object.hasOwn(t,o)||n.push({level:"error",path:`architecture.allowedDependencies.${o}`,message:"A dependency row is required by architecture.requireCompletePolicy."})}function p(e,r,n){e!==void 0&&(typeof e!="number"||!Number.isInteger(e)||e<0)&&n.push({level:"error",path:r,message:"Must be a non-negative integer."})}function v(e){let r=e.replace(/\\/g,"/");if(/^(?:\/|[a-z]:)/i.test(r)||r==="."||r===".."||r.split("/").includes(".."))return!1;let n=r.replace(/\/\*\*?$/,"");return n.length>0&&!/[*?[\]]/.test(n)}var u=1,f=2,j="./node_modules/scip-query/docs/schemas/project-config.schema.json";function _(e){let r=e;if(typeof e=="string")try{r=JSON.parse(e)}catch(n){return{kind:"malformed",reason:`invalid JSON: ${n instanceof Error?n.message:String(n)}`}}return c(r)?w(r):{kind:"malformed",reason:"project config must be a JSON object"}}function w(e){let r=e.schemaVersion;if(r!==void 0&&!Number.isInteger(r))return{kind:"malformed",reason:"schemaVersion must be an integer"};let n=r===void 0?u:r;return n!==u&&n!==f?{kind:"unsupported",schemaVersion:n,direction:n<u?"older":"future"}:A(e,n)}function A(e,r){let n=e.$schema;if(n!==void 0&&(typeof n!="string"||n.trim()===""))return{kind:"malformed",reason:"$schema must be a non-empty string when present"};let t=m(e),o=r!==f||typeof e.$schema!="string";return r===u?{kind:"legacy",sourceVersion:u,config:t,needsMigration:o}:{kind:"supported",sourceVersion:f,config:t,needsMigration:o}}function m(e){let r=e,{$schema:n,schemaVersion:t,...o}=r;return{$schema:typeof n=="string"&&n.trim()!==""?n:j,schemaVersion:f,...o}}function E(e){return`${JSON.stringify(m(e),null,2)}
|
|
2
|
+
`}export{$ as a,u as b,f as c,_ as d,m as e,E as f};
|
|
3
|
+
//# sourceMappingURL=chunk-2IWUT6CJ.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as u,c as m}from"./chunk-NOLZOVCU.js";function x(e){let n=[],r=[],s=[];for(let t of e.primitiveGroups)t.values.length!==0&&g(t.bucket,r,s).push(`${t.reasonPrefix}: ${t.values.join(", ")}`);for(let t of e.nameGroups)f(t.names,t.label,e.genericWords,e.stripPrefixes??[],n,g(t.fallbackBucket,r,s));let o=v(n,r,s);return{actionTier:o==="domain-behavior"||o==="mixed"?"signal":"support",evidenceClass:o,reasons:[...n,...s,...r].slice(0,6),recommendation:e.recommendation(o)}}function b(e,n){if(e.size===0||n.size===0)return 0;let o=u(e,n).size/Math.min(e.size,n.size)*Math.min(1,Math.min(e.size,n.size)/(.35*Math.max(e.size,n.size)));return Math.max(m(e,n),o)}function y(e,n){let r=Object.fromEntries(e.map(s=>[s.name,s.count]));for(let s of n)if(Object.entries(s.min).every(([a,t])=>(r[a]??0)>=t))return{pass:!0,reason:s.reason,counts:r};return{pass:!1,reason:"shared tokens did not meet calibrated overlap thresholds",counts:r}}function A(e,n,r){let s=n.map(i=>{let l=i.value(e),d=i.weightedValue?i.weightedValue(e,l):l;return{axis:i,value:l,weighted:d,qualifies:i.qualifies?i.qualifies(e,l):l>0}}),o=s.filter(i=>i.qualifies&&i.axis.reason).map(i=>i.axis.reason(e,i.value)),a=s.filter(i=>i.qualifies&&i.axis.dominantEligible!==!1).sort((i,l)=>l.weighted-i.weighted)[0],t=a&&a.weighted>0?a.axis.axis:r,c=[...new Set(s.filter(i=>i.qualifies).map(i=>i.axis.axis).concat(o.length>0?[]:[t]))];return{dominantPressure:t,pressureKinds:c,reasons:o}}function P(e,n){return[...e].filter(r=>r.startsWith(n)).map(r=>r.slice(n.length)).sort()}function B(e){return[...e].sort()}function f(e,n,r,s,o,a){let t=[],c=[];for(let i of e)p(i,s).filter(d=>!r.has(d)).length>0?t.push(i):c.push(i);t.length&&o.push(`${n} has name(s) outside the generic vocabulary: ${t.slice(0,6).join(", ")}`),c.length&&a.push(`${n} matches the generic-name vocabulary: ${c.slice(0,6).join(", ")}`)}function p(e,n){let r=e.replace(/([A-Z])([A-Z][a-z])/g,"$1 $2").replace(/([a-z0-9])([A-Z])/g,"$1 $2");for(let s of n)r=r.replace(s,"");return r.toLowerCase().split(/[^a-z0-9]+/).filter(Boolean)}function g(e,n,r){return e==="generic"?n:r}function F(e,n){return+(e.actionTier!=="signal")-+(n.actionTier!=="signal")||n.similarity-e.similarity||e.fileA.localeCompare(n.fileA)||e.componentA.localeCompare(n.componentA)||e.fileB.localeCompare(n.fileB)||e.componentB.localeCompare(n.componentB)}function v(e,n,r){let s=e.length>0,o=n.length>0,a=r.length>0;return s?o||a?"mixed":"domain-behavior":a?"shared-abstraction":"generic-workflow-scaffolding"}export{x as a,b,y as c,A as d,P as e,B as f,F as g};
|
|
2
|
+
//# sourceMappingURL=chunk-2KNN7GTQ.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{a as F}from"./chunk-NJJMVD65.js";import{a as V,b as q}from"./chunk-6FFVZZL4.js";import{a as C}from"./chunk-JEVRKFRL.js";import{c as X}from"./chunk-BL6XJKTA.js";import{b as j,e as k,i as x}from"./chunk-HRRFKWPZ.js";import{d as z}from"./chunk-QZ7KQZRN.js";import{d as h,e as N,f as $,i as G}from"./chunk-62BDNPMI.js";var H=class extends Error{constructor(t){super(t),this.name="ReindexLockUnavailableError"}};import{existsSync as te,statSync as Ee}from"fs";import{dirname as ie,join as re}from"path";import{appendFileSync as me,existsSync as ye,mkdirSync as pe,renameSync as Re,rmSync as be,statSync as xe,truncateSync as Ae}from"fs";import{basename as Be,dirname as he}from"path";var v=".previous",ve=".rotation.lock",Te=2e3,J=class extends Error{constructor(n,i){super(`Timed out after ${i}ms waiting for rotating JSONL lock: ${n}`);this.lockPath=n;this.timeoutMs=i;this.name="RotatingJsonlLockTimeoutError"}lockPath;timeoutMs;code="ROTATING_JSONL_LOCK_TIMEOUT"},I=class extends Error{constructor(n){super(`Rotating JSONL lock ownership changed before release: ${n}`);this.lockPath=n;this.name="RotatingJsonlLockReleaseError"}lockPath;code="ROTATING_JSONL_LOCK_RELEASE_FAILED"},Y=Object.freeze({monotonicNow:z,wait(e){Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,e)},tryAcquireLock(e,t){let n=X(e,{kind:"rotating-jsonl",detail:{target:Be(t)}});return n.kind==="acquired"?{kind:"acquired",lock:n.lock}:{kind:"contended"}},makeDirectory(e){pe(e,{recursive:!0})},exists:ye,readBytes(e){return $(e,{maxBytes:h,inputKind:"rotating JSONL segment"})},size(e){return xe(e).size},truncate:Ae,remove(e){be(e,{force:!0})},rename:Re,append:me});function K(e,t,n){let i=n.runtime??Y,r=JSON.stringify(t);if(r===void 0)throw new TypeError("Rotating JSONL records must be JSON-serializable values.");let a=Buffer.from(`${r}
|
|
2
|
+
`),s=Math.max(1,Math.floor(n.maxSegmentBytes),a.length);return Q(e,n.lockTimeoutMs,i,()=>{i.makeDirectory(he(e));let l=Se(e,h,i);n.onPhase?.("tail-repaired");let o=`${e}${n.previousSuffix??v}`,c=!1,f=!1;return i.exists(e)&&i.size(e)+a.length>s&&(i.exists(o)&&(i.remove(o),f=!0),n.onPhase?.("previous-pruned"),i.rename(e,o),c=!0,n.onPhase?.("current-rotated")),i.append(e,a),n.onPhase?.("record-appended"),{lineBytes:a.length,segmentLimitBytes:s,repairedTailBytes:l,rotated:c,prunedPrevious:f}})}function Z(e,t={}){let n=t.runtime??Y,i=Le(t.maxSegmentBytes);return Q(e,t.lockTimeoutMs,n,()=>{let r=[],a=0,s=`${e}${t.previousSuffix??v}`;for(let l of[s,e]){if(!n.exists(l))continue;let o=Oe(ee(l,i,n));r.push(...o.lines),a+=o.partialTailBytes}return{lines:r,ignoredPartialTailBytes:a}})}function Q(e,t,n,i){let r=`${e}${ve}`,a=Math.max(0,t??Te),s=n.monotonicNow()+a,l;for(;;){let g=n.tryAcquireLock(r,e);if(g.kind==="acquired"){l=g.lock;break}let R=s-n.monotonicNow();if(R<=0)throw new J(r,a);n.wait(Math.min(5,R))}let o=!1,c,f;try{f=i()}catch(g){o=!0,c=g}let p=!1;try{p=l.release()}catch(g){if(!o)throw g}if(o)throw c;if(!p)throw new I(r);return f}function Se(e,t,n){if(!n.exists(e))return 0;let i=ee(e,t,n);if(i.length===0||i[i.length-1]===10)return 0;let r=i.lastIndexOf(10),a=r<0?0:r+1;return n.truncate(e,a),i.length-a}function Le(e){let t=e??h;if(!Number.isSafeInteger(t)||t<=0)throw new RangeError(`maxSegmentBytes must be a positive safe integer; received ${t}`);return t}function ee(e,t,n){let i=n.size(e);if(i>t)throw new N("rotating JSONL segment",e,"too-large",i,t);let r=n.readBytes(e),a=n.size(e);if(a!==i||r.byteLength!==i)throw new N("rotating JSONL segment",e,"changed-during-read",a,t);return r}function Oe(e){let t=e.lastIndexOf(10),n=t<0?0:t+1;return{lines:e.subarray(0,n).toString("utf8").split(`
|
|
3
|
+
`).filter(r=>r.length>0),partialTailBytes:e.length-n}}var Pe="reindex-activity.jsonl",T=v,we=1024*1024,_e=1440*60*1e3,ae=e=>G(e,"reindex activity segment");function S(e){return re(ie(e),Pe)}function se(e){if(e.reused)return 0;let n=(e.shards?.some(i=>!i.reused&&i.strategy==="incremental")??!1?0:M(e.indexPath))+M(e.dbPath);for(let i of e.shards??[]){if(i.reused)continue;let r=i.producedOutputBytes??i.outputBytes;r!==null&&(n+=r)}return n}function Ne(e){let t=se(e),n=e.writeTelemetry;return n?Math.max(0,t-n.reflinkedBytes)+n.fallbackCopiedBytes+(n.incrementalWrittenBytes??0):t}function Wt(e,t){let n=t.lastRefresh;if(!n)return{state:"failed",reason:"reindex result has no refresh metadata"};let i=se(t);return D(S(e),{version:1,event:"run",recordedAt:n.completedAt,trigger:n.trigger,result:n.result,durationMs:n.durationMs,estimatedLogicalOutputBytes:i,estimatedWriteBytes:Ne(t),reflinkedBytes:t.writeTelemetry?.reflinkedBytes??0,fallbackCopiedBytes:t.writeTelemetry?.fallbackCopiedBytes??0,incrementalWrittenBytes:t.writeTelemetry?.incrementalWrittenBytes??0,byLanguage:qe(t)})}function Ut(e,t){return D(S(e),{version:1,event:"run",recordedAt:t.completedAt,trigger:t.trigger,result:"failed",durationMs:t.durationMs,estimatedLogicalOutputBytes:0})}function Ft(e,t,n=new Date){return D(S(e),{version:1,event:"suppressed",recordedAt:n.toISOString(),trigger:t,reason:"completed-index-is-fresh"})}function ke(e,t,n=we,i){K(e,t,{maxSegmentBytes:n,previousSuffix:T,...i?{runtime:i}:{}})}function Ce(e,t=new Date,n=_e,i=ae){let r=t.getTime(),a=r-n,s=Je(a,t),l=Ie(S(e),i,s);if(l===null)return s;for(let o of l){let c=Me(o,a,r,s);if(!c)continue;let{record:f}=c;if(s.invalidLanguageDetails+=c.invalidLanguageDetails,s.byTrigger[f.trigger.kind]=(s.byTrigger[f.trigger.kind]??0)+1,f.event==="suppressed"){s.suppressed+=1;continue}De(s,c,f)}return s.ignoredPartialTailBytes>0&&s.confidence!=="unavailable"&&(s.confidence="partial"),s.languageAttribution=at(s),s}function Je(e,t){return{confidence:"complete",recordsRead:0,invalidRecords:0,skippedRecords:0,readErrors:0,ignoredPartialTailBytes:0,windowStartedAt:new Date(e).toISOString(),windowEndedAt:t.toISOString(),runs:0,rebuilt:0,fullRebuilds:0,reused:0,failed:0,suppressed:0,estimatedLogicalOutputBytes:0,estimatedWriteBytes:0,reflinkedBytes:0,fallbackCopiedBytes:0,languageAttribution:"complete",attributedRuns:0,unattributedRuns:0,invalidLanguageDetails:0,byLanguage:{},byTrigger:{},automatic:{runs:0,rebuilt:0,fullRebuilds:0,estimatedWriteBytes:0}}}function Ie(e,t,n){let i=[];if(t===ae){if(!te(e)&&!te(`${e}${T}`))return null;try{let r=Z(e,{previousSuffix:T});i=r.lines,n.ignoredPartialTailBytes=r.ignoredPartialTailBytes}catch{n.readErrors+=1,n.confidence="unavailable"}}else{let r=0;for(let a of[`${e}${T}`,e])try{i.push(...st(t(a))),r+=1}catch{n.readErrors+=1}r===0?n.confidence="unavailable":n.readErrors>0&&(n.confidence="partial")}return i}function Me(e,t,n,i){i.recordsRead+=1;let r=Fe(e);if(!r)return i.invalidRecords+=1,i.confidence!=="unavailable"&&(i.confidence="partial"),null;let{record:a}=r,s=Date.parse(a.recordedAt);return s<t||s>n?(i.skippedRecords+=1,null):r}function De(e,t,n){e.runs+=1,e[n.result]+=1,e.estimatedLogicalOutputBytes+=n.estimatedLogicalOutputBytes;let i=je(n);e.estimatedWriteBytes+=i,e.reflinkedBytes+=n.reflinkedBytes??0,e.fallbackCopiedBytes+=n.fallbackCopiedBytes??0,We(e,t,n);let r=Ve(n);r&&e.oldestRebuildAt===void 0&&(e.oldestRebuildAt=n.recordedAt),r&&(e.fullRebuilds+=1),i>0&&e.oldestWriteAt===void 0&&(e.oldestWriteAt=n.recordedAt),Ue(e.automatic,n,r,i)}function We(e,t,n){n.result!=="failed"&&(t.hasLanguageDetails?e.attributedRuns+=1:e.unattributedRuns+=1);for(let[i,r]of oe(n.byLanguage)){let a=e.byLanguage[i]??=rt();a.runs+=1,a[r.result]+=1,a.producedOutputBytes+=r.producedOutputBytes,a.durationMs+=r.durationMs}}function Ue(e,t,n,i){ze(t.trigger)&&(e.runs+=1,t.result==="rebuilt"&&(e.rebuilt+=1),n&&(e.fullRebuilds+=1,e.oldestRebuildAt??=t.recordedAt),e.estimatedWriteBytes+=i,i>0&&(e.oldestWriteAt??=t.recordedAt))}function D(e,t){try{return ke(e,t),{state:"recorded"}}catch(n){return{state:"failed",reason:n instanceof Error?n.message:String(n)}}}function Fe(e){try{let t=JSON.parse(e);if(!t||typeof t!="object")return null;let n=t;if(!$e(n))return null;if(n.event==="suppressed")return n.reason==="completed-index-is-fresh"?{record:n,hasLanguageDetails:!1,invalidLanguageDetails:0}:null;if(!Ge(n))return null;let i=n,{byLanguage:r,...a}=i,s=Qe(r);return{record:{...a,...s.byLanguage?{byLanguage:s.byLanguage}:{}},hasLanguageDetails:s.hasLanguageDetails,invalidLanguageDetails:s.invalidLanguageDetails}}catch{return null}}function $e(e){return e.version===1&&j(e.recordedAt)&&!!e.trigger&&F(e.trigger.kind)}function Ge(e){return e.event!=="run"||e.result!=="rebuilt"&&e.result!=="reused"&&e.result!=="failed"||!x(e.durationMs)||!x(e.estimatedLogicalOutputBytes)?!1:[e.estimatedWriteBytes,e.reflinkedBytes,e.fallbackCopiedBytes,e.incrementalWrittenBytes].every(t=>t===void 0||x(t))}function je(e){return e.reflinkedBytes===void 0?e.estimatedWriteBytes??e.estimatedLogicalOutputBytes:Math.max(0,e.estimatedLogicalOutputBytes-e.reflinkedBytes)+(e.fallbackCopiedBytes??0)+(e.incrementalWrittenBytes??0)}function $t(e,t,n=new Date){return t.enabled?Xe(Ce(e,n,t.windowMs),t,n.getTime()):{state:"allowed",rebuilt:0,estimatedWriteBytes:0}}function ze(e){return e.kind.startsWith("watch-")}function Xe(e,t,n){let i=e.automatic??{fullRebuilds:e.fullRebuilds??e.rebuilt,estimatedWriteBytes:e.estimatedWriteBytes??e.estimatedLogicalOutputBytes,oldestRebuildAt:e.oldestRebuildAt,oldestWriteAt:e.oldestWriteAt},r=i.estimatedWriteBytes,a=i.fullRebuilds,s={rebuilt:a,estimatedWriteBytes:r};return t.enabled?e.confidence!==void 0&&e.confidence!=="complete"?{state:"paused",reason:"activity-evidence",until:n+t.windowMs,...s,detail:`reindex activity evidence is ${e.confidence}`}:a>=t.maxRebuilds?{state:"paused",reason:"rebuild-count",until:ne(i.oldestRebuildAt,t.windowMs,n),...s,detail:`${a}/${t.maxRebuilds} expensive full rebuild slots consumed by automatic refreshes`}:r>=t.maxEstimatedWriteBytes?{state:"paused",reason:"estimated-write-bytes",until:ne(i.oldestWriteAt,t.windowMs,n),...s,detail:`${r}/${t.maxEstimatedWriteBytes} estimated write bytes consumed by automatic refreshes`}:{state:"allowed",...s}:{state:"allowed",...s}}function Ve(e){if(e.result!=="rebuilt")return!1;let t=oe(e.byLanguage);return t.length===0?!0:t.some(([,n])=>n.result==="rebuilt"&&n.strategy!=="incremental"&&n.strategy!=="reused")}function ne(e,t,n){let i=e?Date.parse(e):Number.NaN;return Number.isFinite(i)&&i+t>n?i+t:n+t}function M(e){try{return Ee(e).size}catch{return 0}}function qe(e){let t={};for(let n of e.languages)t[n]=He(e,n);return t}function He(e,t){let n=(e.shards??[]).filter(o=>o.language===t),i=n.find(o=>o.id===t),r=Ke(e.reused,n,i),a=M(re(ie(e.dbPath),"language-indexes",`${t}.scip`)),s=a>0?a:i?.outputBytes??a,l=Ze(r,n,i);return{result:r?"reused":"rebuilt",strategy:r?"reused":i?.strategy??"full",...Ye(i),outputBytes:s,producedOutputBytes:r?0:i?.producedOutputBytes??s,durationMs:l}}function Ye(e){return e?.strategy==="full"&&(e.fallbackReason??e.missReason)?{fallbackReason:e.fallbackReason??e.missReason}:{}}function Ke(e,t,n){return e||(n?n.reused:t.length>0&&t.every(i=>i.reused))}function Ze(e,t,n){return e?0:n?.durationMs??t.filter(i=>!i.reused).reduce((i,r)=>i+r.durationMs,0)}function Qe(e){if(e===void 0)return{hasLanguageDetails:!1,invalidLanguageDetails:0};if(!e||typeof e!="object"||Array.isArray(e))return{hasLanguageDetails:!1,invalidLanguageDetails:1};let t={},n=0;for(let[r,a]of Object.entries(e)){if(!it(r)||!et(a)){n+=1;continue}t[r]=a}let i=Object.keys(t).length>0;return{...i?{byLanguage:t}:{},hasLanguageDetails:i,invalidLanguageDetails:n}}function et(e){if(!e||typeof e!="object")return!1;let t=e;return tt(t)&&nt(t)}function tt(e){return(e.result==="rebuilt"||e.result==="reused")&&(e.strategy===void 0||e.strategy==="reused"||e.strategy==="incremental"||e.strategy==="full")&&(e.fallbackReason===void 0||typeof e.fallbackReason=="string")}function nt(e){return k(e.outputBytes)&&k(e.producedOutputBytes)&&x(e.durationMs)&&(e.result!=="reused"||e.producedOutputBytes===0&&e.durationMs===0)&&e.producedOutputBytes<=e.outputBytes}function it(e){return C.includes(e)}function oe(e){return e?C.flatMap(t=>{let n=e[t];return n?[[t,n]]:[]}):[]}function rt(){return{runs:0,rebuilt:0,reused:0,producedOutputBytes:0,durationMs:0}}function at(e){let t=e.invalidLanguageDetails??0,n=e.attributedRuns??0;return(e.unattributedRuns??0)===0&&t===0?"complete":n===0?"unavailable":"partial"}function st(e){return e.endsWith(`
|
|
4
|
+
`)||(e=e.slice(0,Math.max(0,e.lastIndexOf(`
|
|
5
|
+
`)+1))),e.split(`
|
|
6
|
+
`).filter(t=>t.length>0)}var ot=new Map([[8,"\u2408"],[9,"\u2409"],[10,"\u2424"],[13,"\u240D"]]);function ut(e,t={}){let n=t.allowNewlines??!0,i=t.allowTabs??!0,r="";for(let a=0;a<e.length;){let s=e.charCodeAt(a);if(s===27){a=ct(e,a);continue}if(s===155){a=ue(e,a+1);continue}if(dt(s)){a=de(e,a+1);continue}if(mt(s)){r+=lt(s,n,i),a+=1;continue}if(yt(s)){r+="\uFFFD",a+=1;continue}r+=e[a],a+=1}return r}function dt(e){return e===144||e===152||e===157||e===158||e===159}function lt(e,t,n){return e===10&&t?`
|
|
7
|
+
`:e===9&&n?" ":ot.get(e)??"\uFFFD"}function jt(e){return ut(e,{allowNewlines:!1,allowTabs:!1})}function ct(e,t){let n=e.charCodeAt(t+1);if(Number.isNaN(n))return e.length;if(n===91)return ue(e,t+2);if(pt.has(n))return de(e,t+2);let i=t+1;for(;i<e.length&&ft(e.charCodeAt(i));)i+=1;return i<e.length&>(e.charCodeAt(i))?i+1:t+1}function ue(e,t){let n=t;for(;n<e.length;){let i=e.charCodeAt(n);if(n+=1,i>=64&&i<=126)return n}return e.length}function de(e,t){let n=t;for(;n<e.length;){let i=e.charCodeAt(n);if(i===7||i===156)return n+1;if(i===27&&e.charCodeAt(n+1)===92)return n+2;n+=1}return e.length}function ft(e){return e>=32&&e<=47}function gt(e){return e>=48&&e<=126}function mt(e){return e<=31||e>=127&&e<=159}function yt(e){return e===1564||e===8206||e===8207||e>=8234&&e<=8238||e>=8294&&e<=8297}var pt=new Set([80,88,93,94,95]);function Xt(e){let t=JSON.stringify(e);return Buffer.byteLength(t)<=65536?t:void 0}function Vt(e){if(!(!e||Buffer.byteLength(e)>65536))try{return ht(JSON.parse(e))}catch{return}}function Rt(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;let t=e;return t.version===1&&(t.baseGeneration===null||typeof t.baseGeneration=="string")&&typeof t.complete=="boolean"&&bt(t.entries)&&(t.incompleteReason===void 0||typeof t.incompleteReason=="string")}function bt(e){return Array.isArray(e)&&e.length<=1024}function xt(e){if(!e||typeof e!="object"||Array.isArray(e))return;let t=e;if(!(typeof t.path!="string"||!vt(t.path))&&!(t.kind!=="add"&&t.kind!=="change"&&t.kind!=="delete"))return{path:t.path,kind:t.kind}}function At(e){let t=[],n=new Set;for(let i of e){let r=xt(i);if(!r||n.has(r.path))return;n.add(r.path),t.push(r)}return t}function Bt(e){return e.complete?e.incompleteReason===void 0:e.incompleteReason!==void 0&&e.incompleteReason.trim()!==""}function ht(e){if(!Rt(e))return;let t=At(e.entries);if(!(!t||!Bt(e)))return{version:1,baseGeneration:e.baseGeneration,complete:e.complete,...e.incompleteReason===void 0?{}:{incompleteReason:e.incompleteReason},entries:t}}function vt(e){return!e||e.includes("\0")||e.includes("\\")||e.startsWith("/")||/^[A-Za-z]:\//.test(e)?!1:e.split("/").every(t=>t!==""&&t!=="."&&t!=="..")}import{spawn as Tt}from"child_process";import{platform as le}from"os";import{performance as ce}from"perf_hooks";var Qt={probe:1e4,git:3e4,analysis:18e4,install:3e5,indexer:6e5},B=class extends Error{constructor(n,i,r,a={}){super(r,a.cause===void 0?void 0:{cause:a.cause});this.kind=n;this.label=i;this.name="BoundedProcessError",this.timedOut=a.timedOut??!1,this.reaped=a.reaped??!1,this.stdout=a.stdout??"",this.stderr=a.stderr??"",this.stdoutTruncated=a.stdoutTruncated??!1,this.stderrTruncated=a.stderrTruncated??!1}kind;label;timedOut;reaped;stdout;stderr;stdoutTruncated;stderrTruncated};function A(e,t){if(!Number.isFinite(e)||e<=0)throw new TypeError(`${t} must be a positive finite number.`)}function fe(e,t,n,i){let r=Math.max(0,i-n);r>0&&e.push(t.subarray(0,r))}function ge(e,t,n){let i=Buffer.concat([...e,t]);e.length=0,e.push(i.subarray(Math.max(0,i.length-n)))}function en(e){A(e.timeoutMs,"timeoutMs"),A(e.maxStdoutBytes,"maxStdoutBytes"),A(e.maxStderrBytes,"maxStderrBytes");let t=e.terminationGraceMs??1e3;A(t,"terminationGraceMs");let n=e.terminationForceMs??t;return A(n,"terminationForceMs"),new Promise((i,r)=>{let a=ce.now(),s=le()!=="win32"&&process.env.SCIP_REINDEX_PROCESS_GROUP_LEADER==="1",l=le()!=="win32"&&!s,o;try{o=Tt(e.command,[...e.args??[]],{cwd:e.cwd,env:e.env,detached:l?!0:e.detached,stdio:["pipe","pipe","pipe"]})}catch(u){let d=u instanceof Error?u.message:String(u);r(new B("spawn",e.label,`${e.label} could not start: ${d}`,{cause:u,reaped:!0}));return}let c=[],f=[],p=0,g=0,R=!1,L=!1,m=null,y=!1,W=o.pid===void 0?null:V(o.pid,l),O=()=>{clearTimeout(U),e.signal?.removeEventListener("abort",P)},E=u=>{if(y||!m)return;y=!0,O();let d=Buffer.concat(c).toString("utf8"),w=Buffer.concat(f).toString("utf8"),_=u.reaped||!u.detail?"":` Process-tree cleanup failed: ${u.detail}`;r(new B(m.kind,e.label,`${m.message}${_}`,{timedOut:m.timedOut,reaped:u.reaped,stdout:d,stderr:w,stdoutTruncated:R,stderrTruncated:L}))},b=u=>{if(!(m||y)){if(m=u,!W){E({reaped:o.pid===void 0,reason:o.pid===void 0?"terminated":"identity-unavailable"});return}q(W,{gracefulMs:t,forceMs:n}).then(E,d=>{E({reaped:!1,reason:"signal-failed",detail:d instanceof Error?d.message:String(d)})})}},U=setTimeout(()=>{b({kind:"timeout",timedOut:!0,message:`${e.label} timed out after ${e.timeoutMs}ms.`})},e.timeoutMs);U.unref();let P=()=>{b({kind:"aborted",timedOut:!1,message:`${e.label} was cancelled.`})};e.signal?.addEventListener("abort",P,{once:!0}),e.signal?.aborted&&P(),o.stdout.on("data",u=>{let d=Buffer.isBuffer(u)?u:Buffer.from(u);e.outputLimitBehavior==="truncate-tail"?ge(c,d,e.maxStdoutBytes):fe(c,d,p,e.maxStdoutBytes),p+=d.length,p>e.maxStdoutBytes&&(R=!0,e.outputLimitBehavior!=="truncate-tail"&&b({kind:"stdout-limit",timedOut:!1,message:`${e.label} exceeded stdout limit (${e.maxStdoutBytes} bytes).`}))}),o.stderr.on("data",u=>{let d=Buffer.isBuffer(u)?u:Buffer.from(u);e.outputLimitBehavior==="truncate-tail"?ge(f,d,e.maxStderrBytes):fe(f,d,g,e.maxStderrBytes),g+=d.length,g>e.maxStderrBytes&&(L=!0,e.outputLimitBehavior!=="truncate-tail"&&b({kind:"stderr-limit",timedOut:!1,message:`${e.label} exceeded stderr limit (${e.maxStderrBytes} bytes).`}))}),o.on("error",u=>{if(!y&&!m){if(o.pid===void 0){O(),y=!0,r(new B("spawn",e.label,`${e.label} could not start: ${u.message}`,{cause:u,reaped:!0}));return}b({kind:"spawn",timedOut:!1,message:`${e.label} failed after start: ${u.message}`})}}),o.on("close",(u,d)=>{if(y||m)return;y=!0,O();let w=Buffer.concat(c).toString("utf8"),_=Buffer.concat(f).toString("utf8");i({status:u,signal:d,stdout:w,stderr:_,timedOut:!1,durationMs:ce.now()-a,stdoutTruncated:R,stderrTruncated:L})}),e.input===void 0?o.stdin.end():o.stdin.end(e.input)})}export{Qt as a,B as b,en as c,H as d,v as e,K as f,Pe as g,Wt as h,Ut as i,Ft as j,Ce as k,$t as l,jt as m,Xt as n,Vt as o};
|
|
8
|
+
//# sourceMappingURL=chunk-2LHXRE2B.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as i}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as i}from"./chunk-OGFV2BUX.js";import{a as t}from"./chunk-LOVIZBJ4.js";function a(e,o){let r=i(e,o);return r?t(e,"forward",[r]).filter(s=>!e.isIgnored(s)).map(s=>({relativePath:s,edgeBasis:"symbol-references",evidence:"cross-file SCIP references plus resolved source imports"})):[]}function p(e,o){let r=i(e,o);return r?t(e,"reverse",[r]).filter(s=>!e.isIgnored(s)).map(s=>({relativePath:s,edgeBasis:"symbol-references",evidence:"cross-file SCIP references plus resolved source imports"})):[]}export{a,p as b};
|
|
2
|
+
//# sourceMappingURL=chunk-2YXE77TJ.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as $,b as T,c as D,e as E,f as B,h as J,k as N,l as O}from"./chunk-AGWFSTXC.js";import{t as U}from"./chunk-73AAKPUC.js";import{b as j}from"./chunk-GCKCF5FL.js";import{a as C}from"./chunk-A2IIGFMJ.js";import{c as v,d as S,m as A,o as P,q as L,t as u}from"./chunk-GVWX5T43.js";import{Ca as R}from"./chunk-5TNQJUR2.js";var ce={references:J,referenceMap:N,callerMap:(t,a)=>E(t).callerMap(a),calleeMap:q};function q(t,a){let r=L(),s=new Map,l=B(t,a),o=[],i=[],g=0,m=0,f=0,h=0,I=0,F=0,k=0;for(let{definition:e,callees:n}of l.hits)I+=1,n.length>0&&(F+=1,k+=n.length,s.set(e.symbolId,n));let d=K(t,l.hits);d.entries.length>0&&u("semantic.callees.prefetch-cache-write",()=>P(t,d.entries),()=>({entries:d.entries.length,sourceMissing:d.sourceMissing,skippedUnsupportedLanguage:d.skippedUnsupportedLanguage}));function z(e,n){if(!D(e)){r&&(g+=n.length);return}let c=C(t,e);if(!c){r&&(m+=n.length),i.push(...n);return}let y=S(t,e,c),p=_(t,e);if(!p){i.push(...n);return}let b=A(t,e,y,p);G(n,b,y,p)}function G(e,n,c,y){for(let p of e){let b=n.get(p.symbol)??null;Y(p,b)||o.push({def:p,contentHash:c,depsDigest:y})}}function Y(e,n){if(n===null)return!1;let c=V(n);return c?(r&&(f+=1),c.length>0&&s.set(e.symbolId,c),!0):(r&&(h+=1),!1)}if(u("semantic.callees.cache-scan",()=>{for(let[e,n]of $(l.misses))z(e,n)},()=>({definitions:a.length,skippedUnsupportedLanguage:g,sourceMissing:m,cacheHits:f,parseFailures:h,misses:o.length,unkeyed:i.length,inMemoryHits:I,inMemoryRows:F,inMemoryCalleeCount:k,resultRows:s.size,missSample:o.slice(0,8).map(e=>`${e.def.relativePath}#${e.def.symbol}`),unkeyedSample:i.slice(0,4).map(e=>`${e.relativePath}#${e.symbol}`)})),o.length===0&&i.length===0)return s;let w=[...i,...o.map(e=>e.def)],H=0,x=u("semantic.callees.compute-misses",()=>{let e=O(t,w);return H=e.size,e},()=>({definitions:w.length,misses:o.length,unkeyed:i.length,rows:H}));for(let[e,n]of x)s.set(e,n);let M=o.filter(e=>E(t).capability("semantic-callees",e.def.relativePath).available).map(e=>({relativePath:e.def.relativePath,symbol:e.def.symbol,contentHash:e.contentHash,depsDigest:e.depsDigest,payload:JSON.stringify(x.get(e.def.symbolId)??[])}));return M.length>0?u("semantic.callees.cache-write",()=>P(t,M),()=>({entries:M.length})):u("semantic.callees.cache-write-skip",()=>{},()=>({reason:"provider-unavailable",misses:o.length})),s}function K(t,a){let r=[],s=new Map,l=0,o=0;for(let{definition:i,callees:g}of a){if(!D(i.relativePath)){o+=1;continue}if(!s.has(i.relativePath)){let f=C(t,i.relativePath),h=f?_(t,i.relativePath):null;s.set(i.relativePath,f&&h?{contentHash:S(t,i.relativePath,f),depsDigest:h}:null)}let m=s.get(i.relativePath);if(!m){l+=1;continue}r.push({relativePath:i.relativePath,symbol:i.symbol,contentHash:m.contentHash,depsDigest:m.depsDigest,payload:JSON.stringify(g)})}return{entries:r,sourceMissing:l,skippedUnsupportedLanguage:o}}var Q="typescript-callees-v4-lexical-owner";function _(t,a){let r=D(a);if(r==="typescript")return U(t,a,Q)?.key??null;let s=X(t,a);return r==="rust"?v(JSON.stringify({kind:"semantic-callees",language:r,engine:T(t.config.projectRoot),positionMapping:"nearby-leaf-v2-callsite-line",depsDigest:s})):s}function V(t){try{return JSON.parse(t)}catch{return null}}var W=R("semantic-deps-digest",{clearGroups:["whole-project","source-file"]});function X(t,a){return W.get(t,a,()=>{let s=[...j(t).get(a)??[]].sort().map(l=>`${l}:${S(t,l,C(t,l))}`);return v(s.join("|"))})}export{ce as a};
|
|
2
|
+
//# sourceMappingURL=chunk-36SGVCGX.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as T,b as A}from"./chunk-E7YNJLCB.js";import{b as F}from"./chunk-6LSEIIF7.js";import{b as k}from"./chunk-FMRN2TRL.js";import{d as v}from"./chunk-5D2LVK7O.js";import{a as y}from"./chunk-FVULPZDF.js";import{b as p}from"./chunk-5TNQJUR2.js";import{posix as h}from"path";var O=20,_=1,G=new Map([["app","app"],["apps","app"],["component","component"],["components","component"],["composable","composable"],["composables","composable"],["contract","contract"],["contracts","contract"],["domain","domain"],["domains","domain"],["feature","feature"],["features","feature"],["hook","hook"],["hooks","hook"],["lib","library"],["module","module"],["modules","module"],["package","package"],["packages","package"],["page","page"],["pages","page"],["route","route"],["routes","route"],["screen","screen"],["screens","screen"],["service","service"],["services","service"],["shared","shared"],["src","source-root"],["store","state"],["stores","state"],["test","test"],["tests","test"],["util","utility"],["utils","utility"],["view","view"],["views","view"]]),q=new Set(["components","contracts","hooks","lib","services","shared","stores","utils"]),Y=new Set(["access","api","auth","config","db","effect","errors","hooks","lib","middleware","permissions","routes","schemas","servicetasks","services","startup","store","stores","test-utils","repository","repositories","tests","types","ui","utils","workflow","workflows"]);function Te(e,n={}){let t=w(n.limit,O),i=w(n.minConsumers,_),r=new F(e),o=r.fileDependencyGraph(),s=fe(y(e,{includeIgnored:!1})),a=ye(e.config.locality?.architecturalBoundarySegments,n.architecturalBoundarySegments);return(n.target?K(e,r,n.target):J(e,n.scope,n.scanLimit)).map(c=>Q(e,r,o,c,n,s,a)).filter(c=>c.consumerFiles.length>=i||n.target).sort(ge).slice(0,t)}function K(e,n,t){let i=Z(e,t);if(i)return[I(i)];let r=k(e,t);if(r.candidates.length>0)throw new Error(`Ambiguous symbol: ${t}. Use an exact symbol.`);let o=r.match;if(!o)return[];let s=n.definitionsForFile(o.relativePath).find(a=>a.symbolId===o.symbolId);return s?[ee(s)]:[{unit:{kind:"symbol",file:o.relativePath,shortName:v(o.symbol),symbol:o.symbol,startLine:o.startLine,endLine:o.endLine}}]}function J(e,n,t){let i=y(e,{scope:n,includeIgnored:!1}),r=w(t,i.length);return i.slice(0,r).map(o=>I(o))}function Q(e,n,t,i,r,o,s){let a=i.definition?V(e,n,i.definition,r.semantic):X(t,i.unit.file),d=i.definition?a.length>0?"symbol-observations":"none":a.length>0?"file-level":"none",f=i.unit.file,c=l(h.dirname(f)),u=te(a),B=ne(c),W=x([...C(c),...u?C(u):[]]),b=ie(i.unit,c,u,a),g=oe(b,i.unit,c,u,a,o,s),j=ue(i.unit,d,u,a,c,g.whyNoSuggestedHome),z=de(i.unit,c,u,a,g.suggestedHome,g.whyNoSuggestedHome);return{actionTier:"signal",sourceUnit:i.unit,candidatePath:f,currentDirectory:c,directoryAncestry:B,consumerFiles:a,consumerCoverage:d,nearestCommonDirectory:u,boundaryMarkers:W,recommendedTier:b,suggestedHome:g.suggestedHome,destinationConfidence:g.confidence,whyNoSuggestedHome:g.whyNoSuggestedHome,counterevidence:j,reasons:z,recommendation:me(b,g.suggestedHome,d)}}function V(e,n,t,i){let r=A(T(e,n).forDefinitions([t],{semantic:i!==!1,sourceFallback:!0}));return H(r.get(t.symbolId)??[])}function X(e,n){let t=[];for(let[i,r]of e.entries())i!==n&&r.has(n)&&t.push(i);return H(t)}function Z(e,n){let t=p(n),i=y(e,{includeIgnored:!1}),r=i.find(s=>s===t);if(r)return r;let o=i.filter(s=>s.endsWith(`/${t}`));return o.length===1?o[0]:null}function ee(e){return{definition:e,unit:{kind:"symbol",file:e.relativePath,shortName:v(e.symbol),symbol:e.symbol,startLine:e.startLine,endLine:e.endLine}}}function I(e){return{unit:{kind:"file",file:e,shortName:h.basename(e)}}}function ne(e){if(e===".")return[{path:".",depth:0,markers:[]}];let n=[],t=e.split("/").filter(Boolean);for(let i=0;i<t.length;i+=1){let r=t.slice(0,i+1).join("/");n.push({path:r,depth:i,markers:D(r)})}return n}function C(e){return e==="."?[]:$(e).map(({marker:n,prefix:t})=>`${n}: ${t}`)}function D(e){return x($(e).map(({marker:n})=>n))}function $(e){let n=e.split("/").filter(Boolean),t=[];for(let i=0;i<n.length;i+=1){let r=G.get(n[i]);r&&t.push({marker:r,prefix:n.slice(0,i+1).join("/")})}return t}function te(e){if(e.length===0)return null;let n=e.map(i=>l(h.dirname(i))),t=n[0].split("/").filter(Boolean);for(let i of n.slice(1)){let r=i.split("/").filter(Boolean),o=[],s=Math.min(t.length,r.length);for(let a=0;a<s&&t[a]===r[a];a+=1)o.push(t[a]);t=o}return t.length===0?".":t.join("/")}function ie(e,n,t,i){return t?e.kind==="symbol"&&i.length===1?i[0]===e.file?"same-file":"sibling-folder":t==="."||t==="src"?"repository-level-review":re(t,n):"no-observed-consumers"}function re(e,n){return U(e,"package")?"package-level-shared":U(e,"app")?"app-level-shared":N(e,["feature","domain","module"])||N(n,["feature","domain","module"])?"feature-local-shared":"sibling-folder"}function oe(e,n,t,i,r,o,s){let a=se(e,i);if(a)return m(a);let d=he(n.file),f=ae(e,t,d,r,s);if(f)return f;let c=i;if(l(t)===l(c))return m(`${t} is already the nearest common directory for its consumers.`);let u=ce(c,t,d,s);return u||le(c,t,d,o,s)}function se(e,n){return n?e==="no-observed-consumers"||e==="repository-level-review"?"The inferred owner is too broad or unsupported for an suggested destination.":null:"No shared consumer directory was observed in the current evidence."}function ae(e,n,t,i,r){if(e==="same-file"){let o=i[0]??null;return o?S(o):m("No same-file consumer path was available.")}if(e==="sibling-folder"&&i.length===1){let o=l(h.dirname(i[0])),s=E(n,t,o,r);return s?m(s):S(o)}return null}function ce(e,n,t,i){return ve(e)?P(e,n,t,i,`Nearest shared owner ${e} is outside source root ${t}.`):null}function le(e,n,t,i,r){if(e===".")return m("The nearest common directory is the repository root.");let o=`${e}/shared`,s=P(o,n,t,r,`Proposed home ${o} is outside source root ${t}.`);return s.confidence==="withheld"||i.has(o)?s:m(`${o} does not exist in the indexed project.`)}function P(e,n,t,i,r){if(!M(e,t))return m(r);let o=E(n,t,e,i);return o?m(o):S(e)}function S(e){return{suggestedHome:e,confidence:"candidate",whyNoSuggestedHome:null}}function m(e){return{suggestedHome:null,confidence:"withheld",whyNoSuggestedHome:e}}function ue(e,n,t,i,r,o){let s=["Path and observed-consumer heuristic; confirm conceptual ownership, complete consumers and behavior before moving files."];return n==="none"&&s.push("No consumers were found in the current index."),n==="file-level"&&s.push("File-level import evidence can hide which exported unit is actually used."),(t==="."||t==="src")&&s.push("Nearest common directory is broad, so this is not enough evidence for automatic placement."),i.length===1&&s.push("Only one consumer was found; inlining or same-folder placement may be better than shared extraction."),e.kind==="file"&&s.push("File targets describe module locality, not symbol-level usage."),t&&r.startsWith(`${t}/`)&&s.push("Candidate already lives under the nearest common directory."),o&&s.push(`No suggested home: ${o}`),s}function de(e,n,t,i,r,o){let s=[];return s.push(`${e.shortName} currently lives in ${n}.`),t?s.push(`${i.length} consumer file(s) share ${t} as their nearest common directory.`):s.push("No shared consumer directory was observed in the current evidence."),r?s.push(`Suggested home is ${r}.`):o&&s.push(`No suggested home: ${o}`),s}function me(e,n,t){return e==="no-observed-consumers"?"Review references before moving; no consumers were found.":e==="repository-level-review"?"Keep this as a broad locality signal; the inferred owner is too general for automatic relocation.":n?`Review whether ${t==="symbol-observations"?"symbol usage":"module import"} supports moving or extracting toward ${n}.`:"Review ownership manually before changing structure."}function ge(e,n){return R(n)-R(e)||e.candidatePath.localeCompare(n.candidatePath)}function R(e){let n=e.consumerFiles.length*10;return e.consumerCoverage==="symbol-observations"&&(n+=5),e.suggestedHome&&(n+=3),e.recommendedTier==="repository-level-review"&&(n*=.1),e.recommendedTier==="no-observed-consumers"&&(n*=.05),n}function fe(e){let n=new Set(["."]);for(let t of e){let i=l(h.dirname(t));for(;!n.has(i)&&(n.add(i),i!==".");)i=l(h.dirname(i))}return n}function he(e){let n=L(e),t=n.indexOf("src");return t>=0?n.slice(0,t+1).join("/"):n.length<=1?".":n[0]}function M(e,n){let t=l(e),i=l(n);return i==="."||t===i||t.startsWith(`${i}/`)}function pe(e,n,t){let i=L(e),r=L(n);return(M(e,n)?i.slice(r.length):i).some(s=>t.has(s.toLowerCase()))}function E(e,n,t,i){return l(e)===l(t)||!pe(e,n,i)?null:`${e} matches a protected directory-name marker; a move to ${t} needs human design.`}function ye(...e){let n=new Set(Y);for(let t of e)for(let i of t??[]){let r=be(i);r&&n.add(r)}return n}function be(e){let n=e.trim().toLowerCase();return n===""?null:n}function U(e,n){return D(e).includes(n)}function N(e,n){let t=D(e);return n.some(i=>t.includes(i))}function ve(e){let n=e.split("/").filter(Boolean),t=n[n.length-1];return t?q.has(t):!1}function l(e){let n=p(e);return n===""?".":n}function L(e){let n=p(e);return n==="."?[]:n.split("/").filter(Boolean)}function w(e,n){return!Number.isFinite(e)||e===void 0||e<1?n:Math.floor(e)}function H(e){return x([...e]).sort((n,t)=>n.localeCompare(t))}function x(e){return[...new Set(e)]}export{Te as a};
|
|
2
|
+
//# sourceMappingURL=chunk-3ABBFPTP.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{b as A}from"./chunk-KDDIE2DP.js";import{b as y}from"./chunk-BOJ5SVE2.js";import{c as k}from"./chunk-E3FDPXZK.js";import{d as E}from"./chunk-7WTPQ4NX.js";import{Z as T}from"./chunk-FVULPZDF.js";import{a as x}from"./chunk-A2IIGFMJ.js";import{ts as p}from"@ts-morph/common";var N=60;function rt(t,s={}){let{scope:n,limit:e=30,scanLimit:i,rotDays:r=N}=s,o=y(T(t,{extensions:[".ts",".tsx",".js",".jsx",".mjs",".cjs"]}).filter(l=>k(l)==="test").filter(l=>!n||l.includes(n)).filter(l=>!t.isIgnored(l)).sort(),i),c=[],a=[],d=[];for(let l of o)C(t,l,r,{assertionFree:c,skipped:a,mockEcho:d});return{assertionFree:e?c.slice(0,e):c,skipped:e?a.slice(0,e):a,mockEcho:e?d.slice(0,e):d}}function C(t,s,n,e){let{assertionFree:i,skipped:r,mockEcho:o}=e,c=x(t,s);if(!c)return;let a=E(c),d=P(c);for(let u of Q(a,d))d.add(u);let l=O(c,s);for(let u of l){if(u.skip){r.push(W(t,s,u,n));continue}if(u.kind==="describe")continue;let b=w(c,u.argsStart),m=a.slice(u.argsStart,u.callEnd),L=c.slice(u.argsStart,u.callEnd);F(m,d)||i.push({file:s,startLine:f(c,u.callStart),endLine:f(c,u.callEnd),title:b,severity:/\bawait\b/.test(m)?"low":"high"});let S=Y(m,L);S&&o.push({file:s,startLine:f(c,u.callStart),endLine:f(c,u.callEnd),title:b,echoedValue:S})}}function O(t,s){let n=[],e=p.createSourceFile(s,t,p.ScriptTarget.Latest,!0);function i(r){if(p.isCallExpression(r)){let o=_(r,e);o&&n.push(o)}p.forEachChild(r,i)}return i(e),n}function _(t,s){let n=v(t.expression);if(!n)return;let{kind:e,skip:i,skipKind:r}=n,o=t.arguments.at(-1);if(!(!i&&!D(o)))return{kind:e,skip:i,skipKind:r,callStart:t.getStart(s),argsStart:t.arguments.pos,callEnd:t.end}}function v(t){let s=t,n;if(p.isPropertyAccessExpression(t)&&(s=t.expression,n=t.name.text),!p.isIdentifier(s))return;let e=/^(x?)(it|test|describe)$/.exec(s.text);if(!e||n!==void 0&&!["skip","only","todo"].includes(n))return;let i=!!e[1]||n==="skip"||n==="todo";return{kind:e[2],skip:i,skipKind:n==="todo"?"todo":"skip"}}function D(t){return t!==void 0&&(p.isArrowFunction(t)||p.isFunctionExpression(t))}function g(t,s){let n=0;for(let e=s;e<t.length;e+=1){let i=t[e];if(i==="(")n+=1;else if(i===")"&&(n-=1,n===0))return e}return t.length-1}function f(t,s){let n=0;for(let e=0;e<s&&e<t.length;e+=1)t[e]===`
|
|
2
|
+
`&&(n+=1);return n}function w(t,s){let n=t.slice(s,s+400),e=/^\s*(['"`])((?:\\.|(?!\1)[\s\S])*)\1/.exec(n);return e?e[2]:"(anonymous)"}var K=new Set(["vitest","chai","jest","@jest/globals","assert","node:assert","node:assert/strict","assert/strict","uvu/assert","expect","chai-as-promised"]),R=new Set(["expect","assert","expectTypeOf","assertType","should"]),M=new Set(["vitest","jest","@jest/globals","chai","chai-as-promised"]);function P(t){let s=new Set(["expect","assert"]),n=p.createSourceFile("assertion-vocabulary.ts",t,p.ScriptTarget.Latest,!0);for(let e of n.statements){if(!p.isImportDeclaration(e)||!p.isStringLiteral(e.moduleSpecifier))continue;let i=e.moduleSpecifier.text,r=e.importClause;if(!(!K.has(i)||!r||r.isTypeOnly))for(let o of $(r,M.has(i)))s.add(o)}return s}function $(t,s){let n=[],e=r=>{if(s)for(let o of R)n.push(`${r}.${o}`);else n.push(r)};t.name&&e(t.name.text);let i=t.namedBindings;if(!i)return n;if(p.isNamespaceImport(i))return e(i.name.text),n;for(let r of i.elements){if(r.isTypeOnly)continue;let o=(r.propertyName??r.name).text;s&&!R.has(o)||["AssertionError","CallTracker"].includes(o)||n.push(r.name.text)}return n}function F(t,s){if(/\.should\b/.test(t)||/\bawait\s+(?:[\w$.]+\.)?findBy[A-Z]\w*\s*\(/.test(t)||/\bawait\s+\w*waitFor(?:Text|Value|Condition|Result|Event)\s*\(/.test(t)||/\bthrow\b/.test(t))return!0;for(let n of s){let e=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(new RegExp(`(?<![\\w$.])${e}\\s*(?:<[^<>]*>)?\\s*[.(]`).test(t))return!0}return!1}var j=/\bfunction\s+(\w+)\s*\(/g,U=/\b(?:const|let)\s+(\w+)\s*=\s*(?:async\s*)?\(/g,V=60;function Q(t,s){let n=new Set;for(let e of[j,U]){e.lastIndex=0;let i;for(;i=e.exec(t);){let r=i[1],o=i.index+i[0].length-1,c=g(t,o),a=t.indexOf("{",c+1);if(a===-1||a-c>V)continue;let d=B(t,a),l=t.slice(a+1,d);F(l,s)&&n.add(r)}}return n}function B(t,s){let n=0;for(let e=s;e<t.length;e+=1){let i=t[e];if(i==="{")n+=1;else if(i==="}"&&(n-=1,n===0))return e}return t.length-1}var q=/\bmock(?:ReturnValue|ResolvedValue)(?:Once)?\s*\(/g,h=/\bexpect\s*\(/g,G=/^\s*\.\s*(?:toBe|toEqual|toStrictEqual)\s*\(/,I=/^(?:-?\d+(?:\.\d+)?|(['"`]).+\1)$/;function Y(t,s){let n=H(t,s,q);if(n.length===0)return null;let e=X(t,s);for(let i of e)if(n.includes(i))return i;return null}function H(t,s,n){let e=[];n.lastIndex=0;let i;for(;i=n.exec(t);){let r=i.index+i[0].length-1,o=g(t,r),c=s.slice(r+1,o).trim();I.test(c)&&e.push(c),n.lastIndex=o+1}return e}function X(t,s){let n=[];h.lastIndex=0;let e;for(;e=h.exec(t);){let i=e.index+e[0].length-1,r=g(t,i),o=t.slice(r+1),c=G.exec(o);if(h.lastIndex=r+1,!c)continue;let a=r+1+c[0].length-1,d=g(t,a),l=s.slice(a+1,d).trim();I.test(l)&&n.push(l)}return n}function W(t,s,n,e){let i=x(t,s),r=w(i,n.argsStart),o=f(i,n.callStart),c=Z(t.config.projectRoot,s,o),a=c===null?"unknown":c>=e?"rot":"workflow";return{file:s,startLine:o,title:r,skipKind:n.skipKind,blockKind:n.kind,ageDays:c,rot:a}}function Z(t,s,n){let e=n+1;try{let i=A(t,["blame","-L",`${e},${e}`,"--porcelain","--",s]),r=/^author-time (\d+)$/m.exec(i);if(!r)return null;let o=Number(r[1]);return Number.isFinite(o)?Math.max(0,Math.round((Date.now()/1e3-o)/86400)):null}catch{return null}}export{rt as a};
|
|
3
|
+
//# sourceMappingURL=chunk-3IVFU4FD.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{b as L,c as Y,d as k}from"./chunk-O4UZSPPI.js";import{a as Q,b as $,d as P}from"./chunk-QZ7KQZRN.js";import{b as F,c as g,d as R}from"./chunk-TKD34PHN.js";import{e as V,h as G,i as S}from"./chunk-62BDNPMI.js";import{createHash as q,randomUUID as se}from"crypto";import{closeSync as Me,existsSync as p,fstatSync as pe,lstatSync as A,mkdirSync as xe,openSync as ge,readdirSync as h,readSync as he,renameSync as T,rmSync as f}from"fs";import{basename as I,dirname as _,join as u}from"path";function Z(e){return C(e,fe)}function Qe(e){return C(e,ye)}function C(e,n){return Array.isArray(e)?`[${e.map(t=>C(t,n)).join(",")}]`:e&&typeof e=="object"?`{${Object.entries(e).sort(([t],[i])=>n(t,i)).map(([t,i])=>`${JSON.stringify(t)}:${C(i,n)}`).join(",")}}`:JSON.stringify(e)}function fe(e,n){return e.localeCompare(n)}function ye(e,n){return e<n?-1:e>n?1:0}var j=1,we=Object.freeze({maxItems:1024,maxBytes:512*1024*1024,maxItemBytes:64*1024*1024,maxBatch:16,claimLeaseMs:5*6e4,responseRetentionMs:10*6e4,deadLetterRetentionMs:1440*6e4,temporaryRetentionMs:6e4,cleanupBatch:64}),M=class extends Error{constructor(t,i,r,o){let s=t==="item-too-large"?`request is ${o} bytes; per-item limit is ${r.maxItemBytes}`:t==="item-capacity"?`mailbox has ${i.totalItems} retained items; limit is ${r.maxItems}`:t==="byte-capacity"?`mailbox retains ${i.totalBytes} bytes and the request adds ${o}; limit is ${r.maxBytes}`:"another writer held the admission coordinator through the bounded wait";super(`Mailbox backpressure: ${s}. Retry after the service drains or expires retained work.`);this.code=t;this.status=i;this.limits=r;this.attemptedBytes=o;this.name="MailboxBackpressureError"}code;status;limits;attemptedBytes},ae=".owner.json",J={isProcessAlive:()=>!0,readProcessIdentity:()=>null};function un(e){return{rootDir:e,pendingDir:u(e,"pending"),inflightDir:u(e,"inflight"),responseDir:u(e,"responses"),deadLetterDir:u(e,"dead-letter"),legacyRequestDir:u(e,"requests")}}function D(e={}){let n={...we,...e};for(let[t,i]of Object.entries(n))if(!Number.isFinite(i)||i<=0||!Number.isInteger(i))throw new Error(`Mailbox limit ${t} must be a positive integer.`);return n}function N(e){let n=[e.pendingDir,e.inflightDir,e.responseDir,e.deadLetterDir,e.legacyRequestDir].map(t=>F(t));return R(...n)}function cn(e,n){return q("sha256").update(Z({namespace:e,payload:n})).digest("hex")}function de(e){if(!/^[a-f0-9]{64}$/.test(e))throw new Error("Mailbox operation keys must be lowercase SHA-256 identities.");return`op-${e}`}function mn(e,n,t={}){let i=D(t.limits),r=t.nowMs??Date.now(),o=N(e);return je(n),z(e,i,t.admissionLockTimeoutMs??2e3,t.monotonicNow??P,t.durability??"durable",()=>{K(e,r,i);let s=u(e.pendingDir,`${n.id}.json`),a=u(e.responseDir,`${n.id}.json`),d=ne(e,n.id);if(d){let c=te(d,n.operationKey,n.id);return{disposition:"duplicate",requestId:n.id,responsePath:a,authoritativeDeadlineAtMs:c.deadlineAtMs??n.deadlineAtMs}}let l=`${JSON.stringify(n)}
|
|
2
|
+
`,m=Buffer.byteLength(l);Ge(e,m,i),t.onBeforePublish?.();try{let c=t.durability??"durable",b=L(s,l,{durability:c}),y=c==="durable"?R(o,b.directorySync):"not-requested";return{disposition:"accepted",requestId:n.id,responsePath:a,authoritativeDeadlineAtMs:n.deadlineAtMs,achievedDurability:b.achievedDurability,directorySync:y}}catch(c){if(c.code!=="EEXIST")throw c;let b=ne(e,n.id);if(!b)throw c;let y=te(b,n.operationKey,n.id);return{disposition:"duplicate",requestId:n.id,responsePath:a,authoritativeDeadlineAtMs:y.deadlineAtMs??n.deadlineAtMs}}})}function Be(e,n){if(!n.ownerId.trim())throw new Error("Mailbox claim owner identity is required.");We(n.owner);let t=n.nowMs??Date.now(),i=D(n.limits),r=N(e);try{return z(e,i,2e3,n.monotonicNow??P,n.durability??"durable",()=>De(e,n.ownerId,t,i,n.liveness??J,n.owner??{pid:process.pid},r,n.durability??"durable",n.onClaimStage))}catch(o){if(o instanceof M&&o.code==="admission-busy")return[];throw o}}function bn(e,n){return!oe(e.pendingDir)&&!oe(e.legacyRequestDir)?[]:Be(e,n)}function Ie(e,n){let{paths:t,ownerId:i,ownerDirectory:r,nowMs:o,limits:s,ownerDirectorySync:a,durability:d,onClaimStage:l}=n,m=u(t.responseDir,`${e.header.id}.json`);if(p(m))return f(e.path,{force:!0}),null;let c=Math.max(o+s.claimLeaseMs,(e.header.deadlineAtMs??o)+5e3),b=`${O(e.originalFile)}.${c}.claim`,y=u(r,b);try{T(e.path,y)}catch(X){let W=X.code;if(W==="ENOENT"||W==="EEXIST")return null;throw X}l?.("after-claim-renamed");let w=d==="durable"?g(_(e.path)):"not-requested";l?.("after-source-directory-synced");let x=d==="durable"?g(r):"not-requested";l?.("after-destination-directory-synced");let be=R(a,w,x);return Ae(e,n,y,c,be)}function Ae(e,n,t,i,r){let{ownerId:o,nowMs:s}=n;return{requestId:e.header.id,ownerId:o,path:t,originalFile:e.originalFile,claimedAtMs:s,claimExpiresAtMs:i,byteLength:e.byteLength,...e.header.operationKey?{operationKey:e.header.operationKey}:{},...e.header.clientId?{clientId:e.header.clientId}:{},...e.header.enqueuedAtMs===void 0?{}:{enqueuedAtMs:e.header.enqueuedAtMs},...e.header.deadlineAtMs===void 0?{}:{deadlineAtMs:e.header.deadlineAtMs},legacy:e.legacy,directorySync:r}}function De(e,n,t,i,r,o,s,a,d){K(e,t,i,r);let l=u(e.inflightDir,O(n)),m=[...ie(e.pendingDir,!1),...ie(e.legacyRequestDir,!0)].sort((w,x)=>w.orderAtMs-x.orderAtMs||w.header.id.localeCompare(x.header.id)||w.path.localeCompare(x.path)),c=a==="durable"?s:"not-requested";m.length>0&&(a==="durable"?c=R(c,F(l)):xe(l,{recursive:!0}),d?.("after-owner-directory-durable"),Te(l,n,o,a),d?.("after-owner-record-published"));let b={paths:e,ownerId:n,ownerDirectory:l,nowMs:t,limits:i,ownerDirectorySync:c,durability:a,onClaimStage:d},y=[];for(let w of m){if(y.length>=i.maxBatch)break;let x=Ie(w,b);x&&y.push(x)}return y}function fn(e,n={}){let t=D(n);if(e.byteLength>t.maxItemBytes)throw new M("item-too-large",{pending:0,inflight:1,responses:0,deadLetters:0,invalid:0,totalItems:1,totalBytes:e.byteLength},t,e.byteLength);return G(e.path,{maxBytes:t.maxItemBytes,inputKind:"bounded mailbox item"})}function Se(e,n,t,i={}){let r=i.nowMs??Date.now(),o=D(i.limits),s=Re(n,t,r,o),a=Buffer.byteLength(`${JSON.stringify(s)}
|
|
3
|
+
`);Ee(e,n,a,o,r);let d=i.durability??"durable";if(Fe(e,n,s,d),i.onAfterResponsePublished?.(),f(n.path,{force:!0}),d==="durable"){let l=_(n.path);g(p(l)?l:e.inflightDir)}}function Re(e,n,t,i){let r=e.deadlineAtMs===void 0?t+i.responseRetentionMs:Math.min(t+i.responseRetentionMs,Math.max(e.deadlineAtMs,t)+le),o={mailboxVersion:j,operationKey:e.operationKey??`legacy-${e.requestId}`,clientId:e.clientId??"legacy",...e.deadlineAtMs===void 0?{}:{deadlineAtMs:e.deadlineAtMs},completedAtMs:t,expiresAtMs:r};return{...o,...n,...o}}function Ee(e,n,t,i,r){let o=E(e);if(t>i.maxItemBytes)throw new M("item-too-large",o,i,t);let s=Math.max(0,o.totalBytes-n.byteLength)+t;if(s>i.maxBytes&&s>o.totalBytes&&(Le(e,r).removed>0&&(o=E(e),s=Math.max(0,o.totalBytes-n.byteLength)+t),s>i.maxBytes&&s>o.totalBytes))throw new M("byte-capacity",o,i,t)}var le=3e4,ve=4096;function Le(e,n){let t={removed:0,bytesFreed:0},i;try{i=h(e.responseDir)}catch{return t}for(let r of i){if(!r.endsWith(".json"))continue;let o=u(e.responseDir,r),s,a;try{let c=ge(o,"r");try{a=pe(c).size;let b=Buffer.alloc(Math.min(ve,a));he(c,b,0,b.length,0),s=b.toString("utf8")}finally{Me(c)}}catch{continue}let d=ee(s,"expiresAtMs"),l=ee(s,"deadlineAtMs");if(d!==null&&d<=n||l!==null&&l+le<=n)try{f(o,{force:!0}),t.removed+=1,t.bytesFreed+=a}catch{}}return t}function ee(e,n){let t=new RegExp(`"${n}":(\\d+)`).exec(e);if(!t)return null;let i=Number(t[1]);return Number.isSafeInteger(i)?i:null}function yn(e,n,t,i,r={}){let o=r.nowMs??Date.now(),s=D(r.limits);if(Se(e,n,t,{...r,nowMs:o,limits:s}),!p(n.path)){let a=u(e.deadLetterDir,`${Xe(n.requestId)}.${o}.${q("sha256").update(i).digest("hex").slice(0,12)}.json`),d={mailboxVersion:j,requestId:n.requestId,ownerId:n.ownerId,rejectedAtMs:o,reason:i,originalFile:n.originalFile},l=Buffer.byteLength(`${JSON.stringify(d,null,2)}
|
|
4
|
+
`),m=E(e);m.totalItems<s.maxItems&&m.totalBytes+l<=s.maxBytes&&k(a,d,{spacing:2,trailingNewline:!0})}}function Mn(e,n={}){let t=n.nowMs??Date.now(),i=D(n.limits);return N(e),z(e,i,2e3,n.monotonicNow??P,"durable",()=>K(e,t,i,n.liveness??J))}function Pe(e,n,t,i,r){let o=u(e.responseDir,`${n.requestId}.json`);if(p(o))return f(n.path,{force:!0}),r.completedClaimsRemoved++,!0;if(n.claimExpiresAtMs>t||_e(e,n.ownerId,i)!=="dead")return!1;let s=u(e.pendingDir,n.originalFile);try{T(n.path,s),r.reclaimed++}catch(a){if(a.code!=="EEXIST")throw a;f(n.path,{force:!0})}return g(_(n.path)),g(e.pendingDir),!0}function Ce(e,n,t,i,r){for(let o of H(e.inflightDir)){if(t<=0)break;Pe(e,o,n,i,r)&&t--}return t}function Ne(e,n,t){if(!I(e).includes(".tmp-"))return!1;let i;try{i=A(e).mtimeMs}catch(r){if(r.code==="ENOENT")return!1;throw r}return i+t>n?!1:(f(e,{force:!0}),!0)}function Oe(e,n,t,i,r){for(let o of[e.pendingDir,e.inflightDir,e.responseDir,e.deadLetterDir,e.legacyRequestDir]){if(i<=0)break;for(let s of ce(o)){if(i<=0)break;Ne(s,n,t.temporaryRetentionMs)&&(r.temporaryFilesRemoved++,i--)}}}function K(e,n,t,i=J){let r={reclaimed:0,completedClaimsRemoved:0,responsesRemoved:0,deadLettersRemoved:0,temporaryFilesRemoved:0},o=t.cleanupBatch;return o=Ce(e,n,o,i,r),o=re(e.responseDir,o,(s,a)=>a+t.responseRetentionMs,n,()=>{r.responsesRemoved++}),o=re(e.deadLetterDir,o,(s,a)=>a+t.deadLetterRetentionMs,n,()=>{r.deadLettersRemoved++}),Oe(e,n,t,o,r),Ue(e.inflightDir),r}function E(e){N(e);let n=[...B(e.pendingDir).map(d=>({path:d,pending:!0})),...B(e.legacyRequestDir).map(d=>({path:d,pending:!0}))],t=H(e.inflightDir).map(d=>({path:d.path,pending:!1})),i=B(e.responseDir).map(d=>({path:d,pending:!1})),r=B(e.deadLetterDir).map(d=>({path:d,pending:!1})),o=[...n,...t,...i,...r],s=0,a;for(let d of n){let l=v(d.path);if(!l){s++;continue}let m=l.enqueuedAtMs;if(m===void 0)try{m=A(d.path).mtimeMs}catch(c){if(c.code==="ENOENT")continue;throw c}a=a===void 0?m:Math.min(a,m)}return{pending:n.length,inflight:t.length,responses:i.length,deadLetters:r.length,invalid:s,totalItems:o.length,totalBytes:o.reduce((d,l)=>d+He(l.path),0),...a===void 0?{}:{oldestPendingAt:new Date(a).toISOString()}}}function Fe(e,n,t,i){let r=u(e.responseDir,`${n.requestId}.json`),o=`${JSON.stringify(t)}
|
|
5
|
+
`;try{L(r,o,{durability:i})}catch(s){if(s.code!=="EEXIST")throw s;let a=v(r),d=n.operationKey??`legacy-${n.requestId}`;if(a?.operationKey!==d)throw new Error(`Mailbox completion ${n.requestId} conflicts with an existing operation.`,{cause:s})}}function z(e,n,t,i,r,o){let s=u(e.rootDir,".admission.lock"),a=`${process.pid}-${se()}`,d=i()+Math.max(0,t);for(;!ke(e.rootDir,s,a,r);){if($e(s),i()>=d)throw new M("admission-busy",E(e),n,0);Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,5)}try{return o()}finally{try{U(s).ownerToken===a&&(f(s,{recursive:!0,force:!0}),r==="durable"&&g(e.rootDir))}catch{}}}function ke(e,n,t,i){let r=`${JSON.stringify({ownerToken:t,pid:process.pid,acquiredAtMs:Date.now()})}
|
|
6
|
+
`;try{return L(n,r,{durability:i}),!0}catch(o){if(o.code==="EEXIST")return!1;try{U(n).ownerToken===t&&(f(n,{force:!0}),i==="durable"&&g(e))}catch{}throw o}}function $e(e){let n=null;try{let i=U(e);typeof i.ownerToken=="string"&&Number.isSafeInteger(i.pid)&&Number(i.pid)>0&&(n=Number(i.pid))}catch{}if(n===null||qe(n))return;let t=`${e}.stale-${se()}`;try{T(e,t)}catch(i){let r=i.code;if(r==="ENOENT"||r==="EEXIST")return;throw i}f(t,{recursive:!0,force:!0})}function U(e){try{return JSON.parse(S(e,"mailbox lock record"))}catch(n){if(n.code!=="EISDIR"&&!(n instanceof V&&n.reason==="not-regular"))throw n;return JSON.parse(S(u(e,"owner.json"),"mailbox lock owner record"))}}function qe(e){try{return process.kill(e,0),!0}catch(n){let t=n.code;return t==="EPERM"||t!=="ESRCH"}}function Te(e,n,t,i){let r=u(e,ae),o=t.processIdentity,s=ue(r);if(s&&s.ownerId===n&&s.pid===t.pid&&Ye(s.processIdentity,o))return;if(B(e).some(d=>d.endsWith(".claim")))throw new Error(`Mailbox owner identity ${n} collides with retained work from another process instance.`);let a={version:1,ownerId:n,pid:t.pid,...o?{processIdentity:o}:{}};i==="durable"?k(r,a):Y(r,a)}function _e(e,n,t){let i=ue(u(e.inflightDir,O(n),ae));if(!i)return"unknown";if(!t.isProcessAlive(i.pid))return"dead";if(!i.processIdentity)return"live";let r=t.readProcessIdentity(i.pid);return r?$(i.processIdentity,r)?"live":"dead":"unknown"}function ue(e){try{let n=JSON.parse(S(e,"mailbox owner record"));if(!Ve(n))return null;let t=n.processIdentity===void 0?null:Q(n.processIdentity);return n.processIdentity!==void 0&&(!t||t.pid!==n.pid)?null:{version:1,ownerId:n.ownerId,pid:n.pid,...t?{processIdentity:t}:{}}}catch{return null}}function ne(e,n){for(let t of[u(e.pendingDir,`${n}.json`),u(e.legacyRequestDir,`${n}.json`),u(e.responseDir,`${n}.json`)])if(p(t))return t;for(let t of H(e.inflightDir))if(t.requestId===n)return t.path;return null}function te(e,n,t){let i=v(e);if(i?.operationKey===n)return i;if(I(e)===`${de(n)}.json`)return{id:t,operationKey:n};throw new Error(`Mailbox operation ${t} conflicts with an existing retained record.`)}function je(e){if(e.mailboxVersion!==j||e.id!==de(e.operationKey)||!e.clientId.trim()||!Number.isFinite(e.enqueuedAtMs)||!Number.isFinite(e.deadlineAtMs)||e.deadlineAtMs<e.enqueuedAtMs)throw new Error("Mailbox request has an invalid lifecycle identity.")}function ie(e,n){return B(e).filter(t=>t.endsWith(".json")).map(t=>{let i=A(t),r=I(t,".json"),o=v(t)??{id:r};return{path:t,originalFile:I(t),header:o,byteLength:i.size,orderAtMs:o.enqueuedAtMs??i.mtimeMs,legacy:n}})}function Je(e){let n=/^(.*)\.(\d+)\.claim$/.exec(e);if(!n)return null;let t=me(n[1]),i=Number(n[2]);return t===null||I(t)!==t||!t.endsWith(".json")||!Number.isSafeInteger(i)?null:{originalFile:t,claimExpiresAtMs:i}}function Ke(e,n,t){let i=Je(t);if(!i)return null;let{originalFile:r,claimExpiresAtMs:o}=i,s=u(e,t),a=v(s)??{id:I(r,".json")},d;try{d=A(s)}catch(l){if(l.code==="ENOENT")return null;throw l}return{requestId:a.id,ownerId:n,path:s,originalFile:r,claimedAtMs:d.mtimeMs,claimExpiresAtMs:o,byteLength:d.size,...a.operationKey?{operationKey:a.operationKey}:{},...a.clientId?{clientId:a.clientId}:{},...a.enqueuedAtMs===void 0?{}:{enqueuedAtMs:a.enqueuedAtMs},...a.deadlineAtMs===void 0?{}:{deadlineAtMs:a.deadlineAtMs},legacy:a.operationKey===void 0}}function ze(e,n){let t=[];for(let i of h(e,{withFileTypes:!0})){if(!i.isFile()||!i.name.endsWith(".claim"))continue;let r=Ke(e,n,i.name);r&&t.push(r)}return t}function H(e){if(!p(e))return[];let n=[];for(let t of h(e,{withFileTypes:!0})){if(!t.isDirectory())continue;let i=me(t.name);i!==null&&n.push(...ze(u(e,t.name),i))}return n.sort((t,i)=>t.claimedAtMs-i.claimedAtMs||t.path.localeCompare(i.path))}function v(e){try{let n=JSON.parse(S(e,"mailbox record"));return typeof n.id!="string"||!n.id?null:{id:n.id,...typeof n.operationKey=="string"?{operationKey:n.operationKey}:{},...typeof n.clientId=="string"?{clientId:n.clientId}:{},...typeof n.enqueuedAtMs=="number"?{enqueuedAtMs:n.enqueuedAtMs}:{},...typeof n.deadlineAtMs=="number"?{deadlineAtMs:n.deadlineAtMs}:{}}}catch{return null}}function re(e,n,t,i,r){for(let o of B(e)){if(n<=0)break;let s;try{s=A(o)}catch(a){if(a.code==="ENOENT")continue;throw a}t(o,s.mtimeMs)>i||(f(o,{force:!0}),r(),n--)}return n}function B(e){return p(e)?h(e,{withFileTypes:!0}).filter(n=>n.isFile()).map(n=>u(e,n.name)).sort():[]}function oe(e){try{return h(e).some(n=>n.endsWith(".json"))}catch{return!1}}function ce(e){if(!p(e))return[];let n=[];for(let t of h(e,{withFileTypes:!0})){let i=u(e,t.name);t.isFile()?n.push(i):t.isDirectory()&&n.push(...ce(i))}return n.sort()}function Ue(e){if(p(e))for(let n of h(e,{withFileTypes:!0})){if(!n.isDirectory())continue;let t=u(e,n.name);h(t).some(i=>i.endsWith(".claim"))||f(t,{recursive:!0,force:!0})}}function He(e){try{return A(e).size}catch{return 0}}function O(e){return Buffer.from(e,"utf8").toString("base64url")}function me(e){try{let n=Buffer.from(e,"base64url").toString("utf8");return O(n)===e?n:null}catch{return null}}function Xe(e){return/^[a-z0-9][a-z0-9-]{0,127}$/i.test(e)?e:`invalid-${q("sha256").update(e).digest("hex")}`}function We(e){if(e&&(!Number.isSafeInteger(e.pid)||e.pid<=0||e.processIdentity!==void 0&&e.processIdentity.pid!==e.pid))throw new Error("Mailbox claim process identity is invalid.")}function Ve(e){return!(e.version!==1||typeof e.ownerId!="string"||!e.ownerId||typeof e.pid!="number"||!Number.isSafeInteger(e.pid)||e.pid<=0)}function Ge(e,n,t){let i=E(e);if(n>t.maxItemBytes)throw new M("item-too-large",i,t,n);if(i.totalItems+1>t.maxItems)throw new M("item-capacity",i,t,n);if(i.totalBytes+n>t.maxBytes)throw new M("byte-capacity",i,t,n)}function Ye(e,n){return!!(!e&&!n||e&&n&&$(e,n))}export{Z as a,Qe as b,j as c,M as d,un as e,N as f,cn as g,de as h,mn as i,bn as j,fn as k,Se as l,yn as m,Mn as n,E as o};
|
|
7
|
+
//# sourceMappingURL=chunk-3JIQS44J.js.map
|