scip-query 0.12.0 → 0.13.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/README.md +1 -0
- package/dist/{chunk-ECVXWZ4Q.js → chunk-27HMTUJE.js} +2 -2
- package/dist/{chunk-2LQWMYG4.js → chunk-27XEGMCT.js} +2 -2
- package/dist/{chunk-NKT5EMEX.js → chunk-2TPCIPYA.js} +2 -2
- package/dist/{chunk-ZOIPAYRP.js → chunk-2XRXEIRK.js} +2 -2
- package/dist/{chunk-Q3B3FNCU.js → chunk-3AMWF6V5.js} +2 -2
- package/dist/{chunk-BVNO67DB.js → chunk-3H5OSDF7.js} +2 -2
- package/dist/{chunk-D64L53WX.js → chunk-43GKP6LI.js} +2 -2
- package/dist/{chunk-F5BJSNU5.js → chunk-44P4SJFN.js} +2 -2
- package/dist/{chunk-T7VQG55Q.js → chunk-5JRMZMLM.js} +2 -2
- package/dist/{chunk-72MFTCU5.js → chunk-5VY3RIEI.js} +2 -2
- package/dist/{chunk-D7J6GZAG.js → chunk-6JUAGXR4.js} +2 -2
- package/dist/{chunk-NQ75OVUU.js → chunk-6KDOYKCB.js} +2 -2
- package/dist/chunk-6KMTPNZL.js +3 -0
- package/dist/{chunk-TTMKELT7.js → chunk-72FR7KEZ.js} +2 -2
- package/dist/{chunk-FXG3PHVW.js → chunk-7COVQPQQ.js} +6 -6
- package/dist/{chunk-MBKJ7GHT.js → chunk-7TVFPOD7.js} +2 -2
- package/dist/{chunk-M72ZFN6E.js → chunk-A6KSEIRN.js} +2 -2
- package/dist/{chunk-52Q4JFDW.js → chunk-AAMURYOK.js} +2 -2
- package/dist/{chunk-XEMQUN3Z.js → chunk-BP7S6V3M.js} +2 -2
- package/dist/{chunk-ETU2I5JM.js → chunk-BRBF3E5X.js} +2 -2
- package/dist/{chunk-V7CVBPWX.js → chunk-BUNDZ6K2.js} +2 -2
- package/dist/{chunk-NAH5EAZS.js → chunk-BZXE3HO4.js} +2 -2
- package/dist/{chunk-AZLKLZ5S.js → chunk-CXQQOXSI.js} +2 -2
- package/dist/{chunk-RIQED5OU.js → chunk-EDSD3VJK.js} +2 -2
- package/dist/chunk-EVZSAR3S.js +2 -0
- package/dist/{chunk-L2CX5GHZ.js → chunk-GMOEX7EV.js} +2 -2
- package/dist/{chunk-O3WDE26W.js → chunk-GUDKRIGW.js} +2 -2
- package/dist/{chunk-MKM7NBZK.js → chunk-GULVO6NF.js} +2 -2
- package/dist/{chunk-V3Z3IOWO.js → chunk-GY3HAWUA.js} +2 -2
- package/dist/{chunk-G2UBOONK.js → chunk-HV27H2V2.js} +2 -2
- package/dist/chunk-HZZQKNVE.js +2 -0
- package/dist/{chunk-T6NGEV5I.js → chunk-I4R3SNMR.js} +2 -2
- package/dist/{chunk-UAHZ57BR.js → chunk-IMQFJ53K.js} +2 -2
- package/dist/{chunk-NJJ7AS4F.js → chunk-IUSSGHJO.js} +2 -2
- package/dist/{chunk-OVMUVXKQ.js → chunk-JJUX2OAP.js} +2 -2
- package/dist/chunk-JZBGTSAB.js +13 -0
- package/dist/{chunk-YPKBZ77R.js → chunk-K5N5RNGM.js} +2 -2
- package/dist/{chunk-OSWF3HSF.js → chunk-K7SPOJHZ.js} +2 -2
- package/dist/{chunk-BCNT6ODA.js → chunk-KSJ544IV.js} +2 -2
- package/dist/{chunk-HSU3M25J.js → chunk-KYB7FPXT.js} +2 -2
- package/dist/{chunk-ORBRX2QJ.js → chunk-LY7NMOBW.js} +2 -2
- package/dist/{chunk-CW3KZ7UF.js → chunk-M7EEHYSU.js} +2 -2
- package/dist/{chunk-U7I373V4.js → chunk-N23FT4EZ.js} +2 -2
- package/dist/{chunk-ZRIOGL7F.js → chunk-N2OTJWC2.js} +2 -2
- package/dist/{chunk-PH7ZFK6L.js → chunk-NCVFKOLB.js} +2 -2
- package/dist/{chunk-2QGE5AEP.js → chunk-NOKUZU56.js} +2 -2
- package/dist/{chunk-BP2NAIAZ.js → chunk-OXTM2RX3.js} +2 -2
- package/dist/{chunk-RA5MTIOO.js → chunk-PEHDARNC.js} +2 -2
- package/dist/chunk-PESEPWZO.js +2 -0
- package/dist/{chunk-LFM3O5KX.js → chunk-PMY4UFGV.js} +2 -2
- package/dist/{chunk-H7NSJ7L2.js → chunk-Q7PWDXL5.js} +2 -2
- package/dist/{chunk-FBCOFKEC.js → chunk-QVGFVRKD.js} +2 -2
- package/dist/{chunk-Q7S2DADC.js → chunk-QYOPMTZ6.js} +2 -2
- package/dist/{chunk-VYF5HA76.js → chunk-QZOAOLLZ.js} +2 -2
- package/dist/{chunk-NLMRJ7SI.js → chunk-R7U2I55B.js} +2 -2
- package/dist/{chunk-64PRNLKP.js → chunk-RLB6SG25.js} +2 -2
- package/dist/{chunk-MJKJMWIM.js → chunk-SFDVBARK.js} +2 -2
- package/dist/{chunk-B4VYXRCQ.js → chunk-TYCZ7S4I.js} +2 -2
- package/dist/{chunk-4D54JIU3.js → chunk-U3VMUDXJ.js} +2 -2
- package/dist/chunk-UHPWZCYQ.js +3 -0
- package/dist/{chunk-OPE5YXFE.js → chunk-V5W7H7V4.js} +2 -2
- package/dist/{chunk-YDDGCJJG.js → chunk-WMO2VZZK.js} +2 -2
- package/dist/chunk-WPZPB42I.js +2 -0
- package/dist/{chunk-EXKLAEB4.js → chunk-X3DTIEMU.js} +2 -2
- package/dist/chunk-X5C43YVI.js +2 -0
- package/dist/{chunk-IRJDYTNZ.js → chunk-XC2PJOVM.js} +2 -2
- package/dist/{chunk-Z3IPJKJP.js → chunk-XDESMVOL.js} +2 -2
- package/dist/{chunk-KSUZS77X.js → chunk-XZBLZHXL.js} +2 -2
- package/dist/{chunk-7ITCOJGD.js → chunk-YQKECTPV.js} +2 -2
- package/dist/chunk-YTVKPJXW.js +2 -0
- package/dist/{chunk-75X52JTA.js → chunk-ZEO4CXQR.js} +2 -2
- package/dist/cli.js +256 -244
- package/dist/index.js +1 -1
- package/dist/queries/affected.js +1 -1
- package/dist/queries/bottlenecks.js +1 -1
- package/dist/queries/by-kind.js +1 -1
- package/dist/queries/call-graph.js +1 -1
- package/dist/queries/change-surface.js +1 -1
- package/dist/queries/cleanup-plan.js +1 -1
- package/dist/queries/co-change.js +1 -1
- package/dist/queries/code.js +1 -1
- package/dist/queries/complexity-hotspots.js +1 -1
- package/dist/queries/complexity.js +1 -1
- package/dist/queries/convergence.js +1 -1
- package/dist/queries/coupling.js +1 -1
- package/dist/queries/cycles.js +1 -1
- package/dist/queries/dataflow.js +1 -1
- package/dist/queries/dead.js +1 -1
- package/dist/queries/decorative-checkers.d.ts +34 -0
- package/dist/queries/decorative-checkers.js +2 -0
- package/dist/queries/deep-chains.js +1 -1
- package/dist/queries/deps.js +1 -1
- package/dist/queries/diff-gate.js +1 -1
- package/dist/queries/diff-impact.js +1 -1
- package/dist/queries/doc-drift.js +1 -1
- package/dist/queries/drift.js +1 -1
- package/dist/queries/duplicate-bodies.js +1 -1
- package/dist/queries/extract-candidates.js +1 -1
- package/dist/queries/fan.js +1 -1
- package/dist/queries/health.js +1 -1
- package/dist/queries/hierarchy.js +1 -1
- package/dist/queries/hotspots.js +1 -1
- package/dist/queries/imports.js +1 -1
- package/dist/queries/incomplete-migration.js +1 -1
- package/dist/queries/index.d.ts +3 -0
- package/dist/queries/index.js +1 -1
- package/dist/queries/isolated.js +1 -1
- package/dist/queries/locality-candidates.js +1 -1
- package/dist/queries/members.js +1 -1
- package/dist/queries/methods.js +1 -1
- package/dist/queries/not-implemented.d.ts +33 -0
- package/dist/queries/not-implemented.js +2 -0
- package/dist/queries/outline.js +1 -1
- package/dist/queries/passthrough-candidates.js +1 -1
- package/dist/queries/plan-context.js +1 -1
- package/dist/queries/recent-duplicates.js +1 -1
- package/dist/queries/redundant-reexports.js +1 -1
- package/dist/queries/refs.js +1 -1
- package/dist/queries/self-audit.js +1 -1
- package/dist/queries/similar-chains.js +1 -1
- package/dist/queries/similar-files.js +1 -1
- package/dist/queries/similar-signatures.js +1 -1
- package/dist/queries/similar.js +1 -1
- package/dist/queries/slice.js +1 -1
- package/dist/queries/stale-abstractions.js +1 -1
- package/dist/queries/surface.js +1 -1
- package/dist/queries/symbols.js +1 -1
- package/dist/queries/system.js +1 -1
- package/dist/queries/test-quality.d.ts +56 -0
- package/dist/queries/test-quality.js +2 -0
- package/dist/queries/trace.js +1 -1
- package/dist/queries/twin-ab.js +1 -1
- package/dist/queries/twin-drift.d.ts +23 -1
- package/dist/queries/twin-drift.js +1 -1
- package/dist/queries/unused-imports.js +1 -1
- package/dist/queries/unused-params.js +1 -1
- package/dist/queries/wrapper-candidates.js +1 -1
- package/dist/runtime.js +1 -1
- package/docs/COMMAND_REFERENCE.md +4 -1
- package/docs/analyzer-inventory.md +16 -0
- package/package.json +14 -2
- package/skills/_shared/SKILL.md +4 -1
- package/skills/scip-calibrate/SKILL.md +124 -0
- package/skills/scip-calibrate/agents/openai.yaml +4 -0
- package/skills/scip-integrity-audit/SKILL.md +32 -0
- package/skills/scip-tla-model-system/SKILL.md +7 -9
- package/dist/chunk-EDB7Y442.js +0 -2
- package/dist/chunk-EZ5WDZ2Q.js +0 -3
- package/dist/chunk-H2NMIZFD.js +0 -2
- package/dist/chunk-HXXMPYEF.js +0 -2
- package/dist/chunk-PXHPCWX5.js +0 -2
- package/dist/chunk-T2FQ4GHD.js +0 -9
package/dist/queries/symbols.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-EVZSAR3S.js";import"../chunk-K7SPOJHZ.js";import"../chunk-27HMTUJE.js";import"../chunk-7TVFPOD7.js";import"../chunk-X5C43YVI.js";import"../chunk-JZBGTSAB.js";import"../chunk-ISLWJ4PY.js";import"../chunk-WS3Z6W3M.js";import"../chunk-GNG622H3.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{a as symbols};
|
|
2
2
|
//# sourceMappingURL=symbols.js.map
|
package/dist/queries/system.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-YQKECTPV.js";import"../chunk-K7SPOJHZ.js";import"../chunk-27HMTUJE.js";import"../chunk-7TVFPOD7.js";import"../chunk-X5C43YVI.js";import"../chunk-JZBGTSAB.js";import"../chunk-ISLWJ4PY.js";import"../chunk-WS3Z6W3M.js";import"../chunk-GNG622H3.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{a as system};
|
|
2
2
|
//# sourceMappingURL=system.js.map
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { S as ScipDatabase } from '../db-_Bdx0E1W.js';
|
|
2
|
+
import 'better-sqlite3';
|
|
3
|
+
import '../config-types-BrHl3Bge.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* test-quality (D3): the biggest uncovered surface — test files are not
|
|
7
|
+
* SCIP-indexed (house convention), so this detector works entirely from the
|
|
8
|
+
* source-facts layer (raw source text + `classifyFile`'s test-file
|
|
9
|
+
* classification), never the graph. Three independently reportable
|
|
10
|
+
* sub-checks:
|
|
11
|
+
* - assertion-free: `it`/`test` bodies with no reachable assertion call.
|
|
12
|
+
* - skipped: `it.skip`/`describe.skip`/`xit`/`.todo` inventory with
|
|
13
|
+
* git-blame age on the skip line.
|
|
14
|
+
* - mock-echo: a test asserting the same literal it stubbed into a mock.
|
|
15
|
+
*/
|
|
16
|
+
type AssertionFreeSeverity = 'high' | 'low';
|
|
17
|
+
type SkippedTestKind = 'skip' | 'todo';
|
|
18
|
+
type SkipRot = 'rot' | 'workflow' | 'unknown';
|
|
19
|
+
interface AssertionFreeFinding {
|
|
20
|
+
file: string;
|
|
21
|
+
startLine: number;
|
|
22
|
+
endLine: number;
|
|
23
|
+
title: string;
|
|
24
|
+
severity: AssertionFreeSeverity;
|
|
25
|
+
}
|
|
26
|
+
interface SkippedTestFinding {
|
|
27
|
+
file: string;
|
|
28
|
+
startLine: number;
|
|
29
|
+
title: string;
|
|
30
|
+
skipKind: SkippedTestKind;
|
|
31
|
+
blockKind: 'it' | 'test' | 'describe';
|
|
32
|
+
ageDays: number | null;
|
|
33
|
+
rot: SkipRot;
|
|
34
|
+
}
|
|
35
|
+
interface MockEchoFinding {
|
|
36
|
+
file: string;
|
|
37
|
+
startLine: number;
|
|
38
|
+
endLine: number;
|
|
39
|
+
title: string;
|
|
40
|
+
echoedValue: string;
|
|
41
|
+
}
|
|
42
|
+
interface TestQualityReport {
|
|
43
|
+
assertionFree: AssertionFreeFinding[];
|
|
44
|
+
skipped: SkippedTestFinding[];
|
|
45
|
+
mockEcho: MockEchoFinding[];
|
|
46
|
+
}
|
|
47
|
+
interface TestQualityOptions {
|
|
48
|
+
scope?: string;
|
|
49
|
+
limit?: number;
|
|
50
|
+
scanLimit?: number;
|
|
51
|
+
/** Skips older than this many days are reported as 'rot' rather than 'workflow'. Default 60. */
|
|
52
|
+
rotDays?: number;
|
|
53
|
+
}
|
|
54
|
+
declare function testQuality(db: ScipDatabase, opts?: TestQualityOptions): TestQualityReport;
|
|
55
|
+
|
|
56
|
+
export { type AssertionFreeFinding, type AssertionFreeSeverity, type MockEchoFinding, type SkipRot, type SkippedTestFinding, type SkippedTestKind, type TestQualityOptions, type TestQualityReport, testQuality };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a}from"../chunk-UHPWZCYQ.js";import"../chunk-7COVQPQQ.js";import"../chunk-B75HZHUP.js";import"../chunk-BZXE3HO4.js";import"../chunk-BGBBVSH4.js";import"../chunk-BP7S6V3M.js";import"../chunk-X5C43YVI.js";import"../chunk-JZBGTSAB.js";import"../chunk-ISLWJ4PY.js";import"../chunk-WS3Z6W3M.js";import"../chunk-GNG622H3.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{a as testQuality};
|
|
2
|
+
//# sourceMappingURL=test-quality.js.map
|
package/dist/queries/trace.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-AAMURYOK.js";import"../chunk-GULVO6NF.js";import"../chunk-WMO2VZZK.js";import"../chunk-27HMTUJE.js";import"../chunk-7TVFPOD7.js";import"../chunk-X5C43YVI.js";import"../chunk-JZBGTSAB.js";import"../chunk-ISLWJ4PY.js";import"../chunk-WS3Z6W3M.js";import"../chunk-GNG622H3.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{a as trace};
|
|
2
2
|
//# sourceMappingURL=trace.js.map
|
package/dist/queries/twin-ab.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a,b}from"../chunk-
|
|
1
|
+
import{a,b}from"../chunk-6KDOYKCB.js";import"../chunk-6KMTPNZL.js";import"../chunk-QARYU7R3.js";import"../chunk-K6UI6EBZ.js";import"../chunk-B75HZHUP.js";import"../chunk-IMQFJ53K.js";import"../chunk-BZXE3HO4.js";import"../chunk-BGBBVSH4.js";import"../chunk-5VY3RIEI.js";import"../chunk-GULVO6NF.js";import"../chunk-WMO2VZZK.js";import"../chunk-27HMTUJE.js";import"../chunk-BP7S6V3M.js";import"../chunk-MTDBHTSF.js";import"../chunk-7TVFPOD7.js";import"../chunk-X5C43YVI.js";import"../chunk-JZBGTSAB.js";import"../chunk-ISLWJ4PY.js";import"../chunk-WS3Z6W3M.js";import"../chunk-GNG622H3.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{a as defaultTwinAbOutPath,b as twinAb};
|
|
2
2
|
//# sourceMappingURL=twin-ab.js.map
|
|
@@ -93,5 +93,27 @@ declare function groupTwins(records: readonly TwinDriftRecord[], opts?: {
|
|
|
93
93
|
*/
|
|
94
94
|
isDelegatePair?: (from: TwinDriftRecord, to: TwinDriftRecord, clusterMembers: readonly TwinDriftRecord[]) => boolean;
|
|
95
95
|
}): TwinGroup[];
|
|
96
|
+
/**
|
|
97
|
+
* Structural (source-text-only) check for a thin forwarding body: at most
|
|
98
|
+
* two top-level statements, no branching/looping, and the last statement is
|
|
99
|
+
* nothing more than a single call expression (optionally `return`ed and/or
|
|
100
|
+
* `await`ed). This is the shape a controller/service/storage delegate has —
|
|
101
|
+
* `return this.service.jsonHandler(req, res);` — as opposed to a body that
|
|
102
|
+
* actually implements the behavior. Purely structural; whether the call
|
|
103
|
+
* target is actually the other twin is a separate, DB-backed check (see
|
|
104
|
+
* `buildDelegationChecker`). Exported so other detectors that need the same
|
|
105
|
+
* "is this body just a forwarding call?" shape (decorative-checkers'
|
|
106
|
+
* one-hop delegate resolution) reuse it instead of re-deriving the same
|
|
107
|
+
* statement-count/control-flow/call-shape check.
|
|
108
|
+
*/
|
|
109
|
+
declare function isThinForwarderBody(rawSnippet: string): boolean;
|
|
110
|
+
/**
|
|
111
|
+
* Split a statement block on top-level `;` (ignoring `;` nested inside
|
|
112
|
+
* `()`/`[]`/`{}`). Exported so other detectors that need a body's top-level
|
|
113
|
+
* statement shape (not-implemented's throw-stub check, decorative-checkers'
|
|
114
|
+
* single-statement body check) reuse this instead of re-deriving the same
|
|
115
|
+
* depth-tracked splitter.
|
|
116
|
+
*/
|
|
117
|
+
declare function splitTopLevelStatements(body: string): string[];
|
|
96
118
|
|
|
97
|
-
export { type TwinDriftRecord, type TwinGroup, type TwinMember, type TwinRelationship, allTwinGroups, groupTwins, twinDrift };
|
|
119
|
+
export { type TwinDriftRecord, type TwinGroup, type TwinMember, type TwinRelationship, allTwinGroups, groupTwins, isThinForwarderBody, splitTopLevelStatements, twinDrift };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a,b,c}from"../chunk-
|
|
1
|
+
import{a,b,c,d,e}from"../chunk-HZZQKNVE.js";import"../chunk-3AMWF6V5.js";import"../chunk-7COVQPQQ.js";import"../chunk-B75HZHUP.js";import"../chunk-BZXE3HO4.js";import"../chunk-BGBBVSH4.js";import"../chunk-BP7S6V3M.js";import"../chunk-7TVFPOD7.js";import"../chunk-X5C43YVI.js";import"../chunk-JZBGTSAB.js";import"../chunk-ISLWJ4PY.js";import"../chunk-WS3Z6W3M.js";import"../chunk-GNG622H3.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{b as allTwinGroups,c as groupTwins,d as isThinForwarderBody,e as splitTopLevelStatements,a as twinDrift};
|
|
2
2
|
//# sourceMappingURL=twin-drift.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a,b,c}from"../chunk-
|
|
1
|
+
import{a,b,c}from"../chunk-BRBF3E5X.js";import"../chunk-K7SPOJHZ.js";import"../chunk-WMO2VZZK.js";import"../chunk-27HMTUJE.js";import"../chunk-7TVFPOD7.js";import"../chunk-X5C43YVI.js";import"../chunk-JZBGTSAB.js";import"../chunk-ISLWJ4PY.js";import"../chunk-WS3Z6W3M.js";import"../chunk-GNG622H3.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{b as importedBy,a as imports,c as unusedImports};
|
|
2
2
|
//# sourceMappingURL=unused-imports.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-M7EEHYSU.js";import"../chunk-K6UI6EBZ.js";import"../chunk-B75HZHUP.js";import"../chunk-IMQFJ53K.js";import"../chunk-BZXE3HO4.js";import"../chunk-BGBBVSH4.js";import"../chunk-5VY3RIEI.js";import"../chunk-GULVO6NF.js";import"../chunk-WMO2VZZK.js";import"../chunk-27HMTUJE.js";import"../chunk-BP7S6V3M.js";import"../chunk-MTDBHTSF.js";import"../chunk-7TVFPOD7.js";import"../chunk-X5C43YVI.js";import"../chunk-JZBGTSAB.js";import"../chunk-ISLWJ4PY.js";import"../chunk-WS3Z6W3M.js";import"../chunk-GNG622H3.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{a as unusedParams};
|
|
2
2
|
//# sourceMappingURL=unused-params.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-27XEGMCT.js";import"../chunk-QARYU7R3.js";import"../chunk-I4R3SNMR.js";import"../chunk-K6UI6EBZ.js";import"../chunk-B75HZHUP.js";import"../chunk-IMQFJ53K.js";import"../chunk-BZXE3HO4.js";import"../chunk-BGBBVSH4.js";import"../chunk-5VY3RIEI.js";import"../chunk-GULVO6NF.js";import"../chunk-WMO2VZZK.js";import"../chunk-27HMTUJE.js";import"../chunk-BP7S6V3M.js";import"../chunk-MTDBHTSF.js";import"../chunk-7TVFPOD7.js";import"../chunk-X5C43YVI.js";import"../chunk-JZBGTSAB.js";import"../chunk-ISLWJ4PY.js";import"../chunk-WS3Z6W3M.js";import"../chunk-GNG622H3.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{a as wrapperCandidates};
|
|
2
2
|
//# sourceMappingURL=wrapper-candidates.js.map
|
package/dist/runtime.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import{c as $,d as M,e as A}from"./chunk-WIBFXSYB.js";import{a as k}from"./chunk-YZXV3CU3.js";import{readFileSync as O,writeFileSync as D,existsSync as P,mkdirSync as N}from"fs";import{isAbsolute as de,join as u,relative as he,resolve as R}from"path";import{createHash as G}from"crypto";import{homedir as F}from"os";var f=".scipquery.json",W={enabled:!1,debounceMs:3e4,cooldownMs:6e4,gitPollMs:2e3,autoRefresh:!0,ignore:[]},U=["typescript","javascript","java","scala","kotlin","rust","python","ruby","go","cpp","c","csharp","vb","dart","php","clojure"];var me=new Set(U);function y(r){let e=u(r,f);if(!P(e))return{};try{let t=O(e,"utf-8");return JSON.parse(t)}catch(t){let i=t instanceof Error?t.message:String(t);throw t instanceof SyntaxError?new Error(`invalid ${f} at ${e}: ${i}`,{cause:t}):new Error(`unable to read ${f} at ${e}: ${i}`,{cause:t})}}function E(r){return{...W,...r.watch}}function L(r,e){let t=process.env.SCIP_QUERY_CACHE_DIR;if(t)return m(t);if(e?.dbPath)return m(R(r,e.dbPath));let s=process.env.XDG_CACHE_HOME||u(F(),".cache"),o=G("sha256").update(R(r)).digest("hex").slice(0,12),n=u(s,"scip-query","projects",o);return m(n)}function S(r,e){let t=L(r,e);return{cacheDir:t,dbPath:u(t,"index.db"),indexPath:u(t,"index.scip"),metaPath:u(t,"meta.json")}}function q(r,e){let t=u(r,f);return P(t)||D(t,JSON.stringify({languages:e,watch:{enabled:!1,debounceMs:3e4,cooldownMs:6e4,gitPollMs:2e3,autoRefresh:!0}},null,2)+`
|
|
2
|
-
`),t}function m(r){return N(r,{recursive:!0}),r}import{execFileSync as Y,fork as K}from"child_process";import{statSync as H,watch as X}from"fs";import{join as B,relative as V}from"path";import z from"ignore";var C=class{projectRoot;config;watchConfig;languages;pnpmWorkspaces;typescriptProjectMode;typescriptProjects;clojureConfigPath;indexerConcurrency;onStatus;onReindexComplete;onError;status={state:"idle"};debounceTimer=null;cooldownTimer=null;dirty=!1;changedFiles=0;pendingTrigger=null;reindexInFlight=!1;lastReindexEnd=0;fsWatchers=[];gitPollTimer=null;lastGitState=null;gitignoreFilter;extraIgnore;stopped=!1;constructor(e){this.projectRoot=e.projectRoot,this.config=e.config,this.watchConfig=E(e.config),this.languages=e.languages,this.pnpmWorkspaces=e.config.indexer?.typescript?.pnpmWorkspaces??!1,this.typescriptProjectMode=e.config.indexer?.typescript?.projectMode,this.typescriptProjects=e.config.indexer?.typescript?.projects,this.clojureConfigPath=e.config.indexer?.clojure?.configPath,this.indexerConcurrency=e.config.indexerConcurrency,this.onStatus=e.onStatus??(()=>{}),this.onReindexComplete=e.onReindexComplete??(()=>{}),this.onError=e.onError??(t=>console.error(t.message)),this.gitignoreFilter=k(e.projectRoot),this.extraIgnore=z(),this.watchConfig.ignore.length>0&&this.extraIgnore.add(this.watchConfig.ignore)}start(){this.stopped=!1,this.setStatus({state:"idle"}),this.startGitStatePolling();try{let e=X(this.projectRoot,{recursive:!0},(t,i)=>{i&&!this.stopped&&this.handleFileChange(i)});this.fsWatchers.push(e)}catch{this.onError(new Error("Failed to start file watcher. On Linux, you may need to increase inotify limits: sysctl -w fs.inotify.max_user_watches=524288"))}}stop(){this.stopped=!0;for(let e of this.fsWatchers)e.close();this.fsWatchers=[],this.clearDebounceTimer(),this.clearCooldownTimer(),this.clearGitPollTimer(),this.setStatus({state:"idle"})}handleFileChange(e){let t=V(this.projectRoot,B(this.projectRoot,e));t===".git"||t.startsWith(".git/")||this.gitignoreFilter.isIgnored(t)||this.extraIgnore.ignores(t)||e.endsWith("index.db")||e.endsWith("index.scip")||e.endsWith("index.db.tmp")||this.scheduleReindex({kind:"watch-source",detail:t})}scheduleReindex(e){if(this.pendingTrigger=J(this.pendingTrigger,e),this.changedFiles++,this.reindexInFlight){this.dirty=!0,this.setStatus({state:"indexing",startedAt:this.status.startedAt});return}if(this.status.state==="cooldown"){this.dirty=!0,this.setStatus({state:"cooldown",until:this.status.until,dirty:!0});return}this.clearDebounceTimer();let t=Date.now()+this.watchConfig.debounceMs;this.setStatus({state:"waiting",changedFiles:this.changedFiles,reindexAt:t}),this.debounceTimer=setTimeout(()=>{this.debounceTimer=null,this.triggerReindex()},this.watchConfig.debounceMs)}triggerReindex(){if(this.reindexInFlight||this.stopped)return;let e=Date.now()-this.lastReindexEnd;if(this.lastReindexEnd>0&&e<this.watchConfig.cooldownMs){let s=this.watchConfig.cooldownMs-e;this.dirty=!0;let o=Date.now()+s;this.setStatus({state:"cooldown",until:o,dirty:!0}),this.cooldownTimer=setTimeout(()=>{this.cooldownTimer=null,this.dirty&&!this.stopped&&(this.dirty=!1,this.triggerReindex())},s);return}this.reindexInFlight=!0,this.dirty=!1,this.changedFiles=0;let t=this.pendingTrigger??{kind:"watch-source"};this.pendingTrigger=null;let i=Date.now();this.setStatus({state:"indexing",startedAt:i}),this.runReindex(t).then(s=>{if(this.reindexInFlight=!1,this.lastReindexEnd=Date.now(),this.onReindexComplete(s),this.dirty&&!this.stopped){let o=Date.now()+this.watchConfig.cooldownMs;this.setStatus({state:"cooldown",until:o,dirty:!0}),this.cooldownTimer=setTimeout(()=>{this.cooldownTimer=null,this.dirty&&!this.stopped?(this.dirty=!1,this.triggerReindex()):this.setStatus({state:"idle"})},this.watchConfig.cooldownMs)}else this.setStatus({state:"idle"})}).catch(s=>{this.reindexInFlight=!1,this.lastReindexEnd=Date.now(),this.onError(s instanceof Error?s:new Error(String(s))),this.setStatus({state:"idle"})})}runReindex(e){return new Promise((t,i)=>{let s=Date.now(),o=y(this.projectRoot),n=Object.keys(o).length>0?o:this.config,c=S(this.projectRoot,n),a=n.indexer?.typescript,l=n.indexer?.clojure,d=K(new URL("./reindex-worker.js",import.meta.url).pathname,[],{detached:!0,env:{...process.env,SCIP_REINDEX_PROJECT_ROOT:this.projectRoot,SCIP_REINDEX_OUTPUT_SCIP:c.indexPath,SCIP_REINDEX_OUTPUT_DB:c.dbPath,SCIP_REINDEX_LANGUAGES:(n.languages??this.languages)?.join(",")??"",SCIP_REINDEX_INDEXER_CONCURRENCY:String(n.indexerConcurrency??this.indexerConcurrency??""),SCIP_REINDEX_PNPM_WORKSPACES:a?.pnpmWorkspaces??this.pnpmWorkspaces?"1":"",SCIP_REINDEX_TYPESCRIPT_CONFIG:JSON.stringify({projectMode:a?.projectMode??this.typescriptProjectMode,projects:a?.projects??this.typescriptProjects??[]}),SCIP_REINDEX_CLOJURE_CONFIG_PATH:l?.configPath??this.clojureConfigPath??"",SCIP_REINDEX_TRIGGER_KIND:e.kind,SCIP_REINDEX_TRIGGER_DETAIL:e.detail??""},stdio:"pipe"});d.on("exit",p=>{p===0?t(Date.now()-s):i(new Error(`Reindex worker exited with code ${p}`))}),d.on("error",i)})}setStatus(e){this.status=e,this.onStatus(e)}clearDebounceTimer(){this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null)}clearCooldownTimer(){this.cooldownTimer&&(clearTimeout(this.cooldownTimer),this.cooldownTimer=null)}startGitStatePolling(){this.lastGitState=this.readGitState(),this.lastGitState&&(this.gitPollTimer=setInterval(()=>this.pollGitState(),this.watchConfig.gitPollMs),this.gitPollTimer.unref?.())}pollGitState(){let e=this.lastGitState,t=this.readGitState();if(!e||!t||this.stopped){this.lastGitState=t;return}this.lastGitState=t;let i=e.head!==t.head,s=e.indexPath!==t.indexPath||e.indexMtimeMs!==t.indexMtimeMs||e.indexSize!==t.indexSize;i&&s?this.scheduleReindex({kind:"watch-git-state",detail:"HEAD and index changed"}):i?this.scheduleReindex({kind:"watch-git-head",detail:"HEAD changed"}):s&&this.scheduleReindex({kind:"watch-git-index",detail:t.indexPath??"index changed"})}readGitState(){let e=j(this.projectRoot,["rev-parse","--git-path","index"]);if(!e)return null;let t={head:j(this.projectRoot,["rev-parse","--verify","HEAD"]),indexPath:e};try{let i=H(e);t.indexMtimeMs=i.mtimeMs,t.indexSize=i.size}catch{t.indexMtimeMs=void 0,t.indexSize=void 0}return t}clearGitPollTimer(){this.gitPollTimer&&(clearInterval(this.gitPollTimer),this.gitPollTimer=null)}};function j(r,e){try{return Y("git",["-C",r,...e],{encoding:"utf-8",stdio:["ignore","pipe","ignore"]}).trim()}catch{return}}function J(r,e){return r?r.kind===e.kind?r.detail===e.detail?r:{kind:r.kind,detail:"multiple changes"}:{kind:"watch-git-state",detail:`${r.kind}, ${e.kind}`}:e}import{existsSync as v,mkdirSync as Q,symlinkSync as Z,readlinkSync as b,unlinkSync as T,readdirSync as ee}from"fs";import{join as h,dirname as w,resolve as g,relative as te,isAbsolute as re}from"path";import{homedir as x,platform as ie}from"os";import{fileURLToPath as se}from"url";var ne=ie()==="win32",_=["_shared","scip-query","scip-setup","scip-cleanup-audit","scip-cleanup-improve","scip-integrity-audit","scip-twin-drift","scip-claim-audit","scip-probe-reachability","scip-hyper-optimization","scip-api-impact","scip-concrete-plan","scip-conductor","scip-debug","scip-explore","scip-triage-issue","scip-diagram","scip-doc-reconcile","scip-directory-architecture","scip-maintainability","scip-react-maintainability","scip-vue-maintainability","scip-verify","scip-language-playbook","scip-tla-model-system"];function oe(r={}){let e=r.quiet?()=>{}:console.log,t=se(import.meta.url),i=g(w(t),"..","skills"),s=[h(x(),".claude","skills"),h(x(),".codex","skills"),h(x(),".agents","skills")],o={installed:[],skipped:[],alreadyLinked:[],pruned:[]};for(let n of s){let c=w(n);if(!v(c))continue;Q(n,{recursive:!0});let a=ce(n);ae(n,i,a,o,e);for(let l of _){let d=h(i,l),p=h(n,l);if(!v(d)){o.skipped.push(`${a}/${l}`);continue}if(v(p)){try{let I=b(p);if(g(I)===g(d)){o.alreadyLinked.push(`${a}/${l}`),e(` ok: ${l} \u2192 ${a} (already linked)`);continue}}catch{o.skipped.push(`${a}/${l}`),e(` skip: ${l} \u2192 ${a} (exists, not a symlink)`);continue}T(p)}Z(d,p,ne?"junction":"dir"),o.installed.push(`${a}/${l}`),e(` done: ${l} \u2192 ${a}`)}}return o}function ae(r,e,t,i,s){let o=new Set(_);for(let n of ee(r)){if(o.has(n))continue;let c=h(r,n),a;try{a=g(w(c),b(c))}catch{continue}le(a,e)&&(T(c),i.pruned.push(`${t}/${n}`),s(` prune: ${n} \u2192 ${t} (removed stale scip-query skill link)`))}}function le(r,e){let t=te(g(e),g(r));return t===""||!t.startsWith("..")&&!re(t)}function ce(r){return r.includes(".codex")?"Codex":r.includes(".agents")?"Agents":"Claude"}export{C as Watcher,M as getScipVersion,q as initProjectConfig,oe as installSkills,$ as isScipInstalled,y as loadProjectConfig,A as printScipInstallInstructions,S as resolveIndexStoragePaths};
|
|
2
|
+
`),t}function m(r){return N(r,{recursive:!0}),r}import{execFileSync as Y,fork as K}from"child_process";import{statSync as H,watch as X}from"fs";import{join as B,relative as V}from"path";import z from"ignore";var C=class{projectRoot;config;watchConfig;languages;pnpmWorkspaces;typescriptProjectMode;typescriptProjects;clojureConfigPath;indexerConcurrency;onStatus;onReindexComplete;onError;status={state:"idle"};debounceTimer=null;cooldownTimer=null;dirty=!1;changedFiles=0;pendingTrigger=null;reindexInFlight=!1;lastReindexEnd=0;fsWatchers=[];gitPollTimer=null;lastGitState=null;gitignoreFilter;extraIgnore;stopped=!1;constructor(e){this.projectRoot=e.projectRoot,this.config=e.config,this.watchConfig=E(e.config),this.languages=e.languages,this.pnpmWorkspaces=e.config.indexer?.typescript?.pnpmWorkspaces??!1,this.typescriptProjectMode=e.config.indexer?.typescript?.projectMode,this.typescriptProjects=e.config.indexer?.typescript?.projects,this.clojureConfigPath=e.config.indexer?.clojure?.configPath,this.indexerConcurrency=e.config.indexerConcurrency,this.onStatus=e.onStatus??(()=>{}),this.onReindexComplete=e.onReindexComplete??(()=>{}),this.onError=e.onError??(t=>console.error(t.message)),this.gitignoreFilter=k(e.projectRoot),this.extraIgnore=z(),this.watchConfig.ignore.length>0&&this.extraIgnore.add(this.watchConfig.ignore)}start(){this.stopped=!1,this.setStatus({state:"idle"}),this.startGitStatePolling();try{let e=X(this.projectRoot,{recursive:!0},(t,i)=>{i&&!this.stopped&&this.handleFileChange(i)});this.fsWatchers.push(e)}catch{this.onError(new Error("Failed to start file watcher. On Linux, you may need to increase inotify limits: sysctl -w fs.inotify.max_user_watches=524288"))}}stop(){this.stopped=!0;for(let e of this.fsWatchers)e.close();this.fsWatchers=[],this.clearDebounceTimer(),this.clearCooldownTimer(),this.clearGitPollTimer(),this.setStatus({state:"idle"})}handleFileChange(e){let t=V(this.projectRoot,B(this.projectRoot,e));t===".git"||t.startsWith(".git/")||this.gitignoreFilter.isIgnored(t)||this.extraIgnore.ignores(t)||e.endsWith("index.db")||e.endsWith("index.scip")||e.endsWith("index.db.tmp")||this.scheduleReindex({kind:"watch-source",detail:t})}scheduleReindex(e){if(this.pendingTrigger=J(this.pendingTrigger,e),this.changedFiles++,this.reindexInFlight){this.dirty=!0,this.setStatus({state:"indexing",startedAt:this.status.startedAt});return}if(this.status.state==="cooldown"){this.dirty=!0,this.setStatus({state:"cooldown",until:this.status.until,dirty:!0});return}this.clearDebounceTimer();let t=Date.now()+this.watchConfig.debounceMs;this.setStatus({state:"waiting",changedFiles:this.changedFiles,reindexAt:t}),this.debounceTimer=setTimeout(()=>{this.debounceTimer=null,this.triggerReindex()},this.watchConfig.debounceMs)}triggerReindex(){if(this.reindexInFlight||this.stopped)return;let e=Date.now()-this.lastReindexEnd;if(this.lastReindexEnd>0&&e<this.watchConfig.cooldownMs){let s=this.watchConfig.cooldownMs-e;this.dirty=!0;let o=Date.now()+s;this.setStatus({state:"cooldown",until:o,dirty:!0}),this.cooldownTimer=setTimeout(()=>{this.cooldownTimer=null,this.dirty&&!this.stopped&&(this.dirty=!1,this.triggerReindex())},s);return}this.reindexInFlight=!0,this.dirty=!1,this.changedFiles=0;let t=this.pendingTrigger??{kind:"watch-source"};this.pendingTrigger=null;let i=Date.now();this.setStatus({state:"indexing",startedAt:i}),this.runReindex(t).then(s=>{if(this.reindexInFlight=!1,this.lastReindexEnd=Date.now(),this.onReindexComplete(s),this.dirty&&!this.stopped){let o=Date.now()+this.watchConfig.cooldownMs;this.setStatus({state:"cooldown",until:o,dirty:!0}),this.cooldownTimer=setTimeout(()=>{this.cooldownTimer=null,this.dirty&&!this.stopped?(this.dirty=!1,this.triggerReindex()):this.setStatus({state:"idle"})},this.watchConfig.cooldownMs)}else this.setStatus({state:"idle"})}).catch(s=>{this.reindexInFlight=!1,this.lastReindexEnd=Date.now(),this.onError(s instanceof Error?s:new Error(String(s))),this.setStatus({state:"idle"})})}runReindex(e){return new Promise((t,i)=>{let s=Date.now(),o=y(this.projectRoot),n=Object.keys(o).length>0?o:this.config,c=S(this.projectRoot,n),a=n.indexer?.typescript,l=n.indexer?.clojure,d=K(new URL("./reindex-worker.js",import.meta.url).pathname,[],{detached:!0,env:{...process.env,SCIP_REINDEX_PROJECT_ROOT:this.projectRoot,SCIP_REINDEX_OUTPUT_SCIP:c.indexPath,SCIP_REINDEX_OUTPUT_DB:c.dbPath,SCIP_REINDEX_LANGUAGES:(n.languages??this.languages)?.join(",")??"",SCIP_REINDEX_INDEXER_CONCURRENCY:String(n.indexerConcurrency??this.indexerConcurrency??""),SCIP_REINDEX_PNPM_WORKSPACES:a?.pnpmWorkspaces??this.pnpmWorkspaces?"1":"",SCIP_REINDEX_TYPESCRIPT_CONFIG:JSON.stringify({projectMode:a?.projectMode??this.typescriptProjectMode,projects:a?.projects??this.typescriptProjects??[]}),SCIP_REINDEX_CLOJURE_CONFIG_PATH:l?.configPath??this.clojureConfigPath??"",SCIP_REINDEX_TRIGGER_KIND:e.kind,SCIP_REINDEX_TRIGGER_DETAIL:e.detail??""},stdio:"pipe"});d.on("exit",p=>{p===0?t(Date.now()-s):i(new Error(`Reindex worker exited with code ${p}`))}),d.on("error",i)})}setStatus(e){this.status=e,this.onStatus(e)}clearDebounceTimer(){this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null)}clearCooldownTimer(){this.cooldownTimer&&(clearTimeout(this.cooldownTimer),this.cooldownTimer=null)}startGitStatePolling(){this.lastGitState=this.readGitState(),this.lastGitState&&(this.gitPollTimer=setInterval(()=>this.pollGitState(),this.watchConfig.gitPollMs),this.gitPollTimer.unref?.())}pollGitState(){let e=this.lastGitState,t=this.readGitState();if(!e||!t||this.stopped){this.lastGitState=t;return}this.lastGitState=t;let i=e.head!==t.head,s=e.indexPath!==t.indexPath||e.indexMtimeMs!==t.indexMtimeMs||e.indexSize!==t.indexSize;i&&s?this.scheduleReindex({kind:"watch-git-state",detail:"HEAD and index changed"}):i?this.scheduleReindex({kind:"watch-git-head",detail:"HEAD changed"}):s&&this.scheduleReindex({kind:"watch-git-index",detail:t.indexPath??"index changed"})}readGitState(){let e=j(this.projectRoot,["rev-parse","--git-path","index"]);if(!e)return null;let t={head:j(this.projectRoot,["rev-parse","--verify","HEAD"]),indexPath:e};try{let i=H(e);t.indexMtimeMs=i.mtimeMs,t.indexSize=i.size}catch{t.indexMtimeMs=void 0,t.indexSize=void 0}return t}clearGitPollTimer(){this.gitPollTimer&&(clearInterval(this.gitPollTimer),this.gitPollTimer=null)}};function j(r,e){try{return Y("git",["-C",r,...e],{encoding:"utf-8",stdio:["ignore","pipe","ignore"]}).trim()}catch{return}}function J(r,e){return r?r.kind===e.kind?r.detail===e.detail?r:{kind:r.kind,detail:"multiple changes"}:{kind:"watch-git-state",detail:`${r.kind}, ${e.kind}`}:e}import{existsSync as v,mkdirSync as Q,symlinkSync as Z,readlinkSync as b,unlinkSync as T,readdirSync as ee}from"fs";import{join as h,dirname as w,resolve as g,relative as te,isAbsolute as re}from"path";import{homedir as x,platform as ie}from"os";import{fileURLToPath as se}from"url";var ne=ie()==="win32",_=["_shared","scip-query","scip-setup","scip-calibrate","scip-cleanup-audit","scip-cleanup-improve","scip-integrity-audit","scip-twin-drift","scip-claim-audit","scip-probe-reachability","scip-hyper-optimization","scip-api-impact","scip-concrete-plan","scip-conductor","scip-debug","scip-explore","scip-triage-issue","scip-diagram","scip-doc-reconcile","scip-directory-architecture","scip-maintainability","scip-react-maintainability","scip-vue-maintainability","scip-verify","scip-language-playbook","scip-tla-model-system"];function oe(r={}){let e=r.quiet?()=>{}:console.log,t=se(import.meta.url),i=g(w(t),"..","skills"),s=[h(x(),".claude","skills"),h(x(),".codex","skills"),h(x(),".agents","skills")],o={installed:[],skipped:[],alreadyLinked:[],pruned:[]};for(let n of s){let c=w(n);if(!v(c))continue;Q(n,{recursive:!0});let a=ce(n);ae(n,i,a,o,e);for(let l of _){let d=h(i,l),p=h(n,l);if(!v(d)){o.skipped.push(`${a}/${l}`);continue}if(v(p)){try{let I=b(p);if(g(I)===g(d)){o.alreadyLinked.push(`${a}/${l}`),e(` ok: ${l} \u2192 ${a} (already linked)`);continue}}catch{o.skipped.push(`${a}/${l}`),e(` skip: ${l} \u2192 ${a} (exists, not a symlink)`);continue}T(p)}Z(d,p,ne?"junction":"dir"),o.installed.push(`${a}/${l}`),e(` done: ${l} \u2192 ${a}`)}}return o}function ae(r,e,t,i,s){let o=new Set(_);for(let n of ee(r)){if(o.has(n))continue;let c=h(r,n),a;try{a=g(w(c),b(c))}catch{continue}le(a,e)&&(T(c),i.pruned.push(`${t}/${n}`),s(` prune: ${n} \u2192 ${t} (removed stale scip-query skill link)`))}}function le(r,e){let t=te(g(e),g(r));return t===""||!t.startsWith("..")&&!re(t)}function ce(r){return r.includes(".codex")?"Codex":r.includes(".agents")?"Agents":"Claude"}export{C as Watcher,M as getScipVersion,q as initProjectConfig,oe as installSkills,$ as isScipInstalled,y as loadProjectConfig,A as printScipInstallInstructions,S as resolveIndexStoragePaths};
|
|
3
3
|
//# sourceMappingURL=runtime.js.map
|
|
@@ -74,6 +74,9 @@ This syntax summary is generated from the CLI command descriptors. Keep workflow
|
|
|
74
74
|
| `duplicate-bodies` | Find exact duplicate small-body candidates across files | `-s, --scope <path>`<br>`--max-loc <n>`<br>`--min-loc <n>`<br>`-n, --limit <n>`<br>`--full`<br>`--json` |
|
|
75
75
|
| `twin-drift` | Twin drift candidates: same-name (or near-name) functions across files with diverged bodies | `-s, --scope <path>`<br>`--min-similarity <n>`<br>`--include-homonyms`<br>`-n, --limit <n>`<br>`--full`<br>`--json` |
|
|
76
76
|
| `twin-ab <symbolA> <symbolB>` | Generate a behavioral A/B scaffold comparing two same-concept twins (scip-integrity-audit drill 5) — a ready-to-fill vitest file, not an auto-executor | `--out <path>`<br>`--force`<br>`--json` |
|
|
77
|
+
| `not-implemented` | Reachable placeholder stub candidates (throw-stub, TODO+return-default, empty body) — production callers can actually reach these; an unreachable stub is dead's job, not this one's | `-s, --scope <path>`<br>`-n, --limit <n>`<br>`--full`<br>`--json` |
|
|
78
|
+
| `decorative-checkers` | Decorative checker candidates: validate*/verify*/check*/assert*/is*/has* callables with no reachable failure exit anywhere in their body | `-s, --scope <path>`<br>`-n, --limit <n>`<br>`--full`<br>`--json` |
|
|
79
|
+
| `test-quality` | Test-quality candidates: assertion-free it/test bodies, a skipped-test ledger with git-blame age, and mock-echo tests that assert the same literal they stubbed into a mock | `-s, --scope <path>`<br>`-n, --limit <n>`<br>`--rot-days <n>`<br>`--full`<br>`--json` |
|
|
77
80
|
| `similar-signatures` | Find functions with near-identical type signatures (same shape) | `-s, --scope <path>`<br>`--min-loc <n>`<br>`--max-shape-frequency <n>`<br>`-n, --limit <n>`<br>`--full`<br>`--json` |
|
|
78
81
|
|
|
79
82
|
### Graph
|
|
@@ -125,7 +128,7 @@ This syntax summary is generated from the CLI command descriptors. Keep workflow
|
|
|
125
128
|
| Command | Description | Options |
|
|
126
129
|
|---|---|---|
|
|
127
130
|
| `bench` | Benchmark indexing and command runtimes for this repository | `--json`<br>`--cold-index`<br>`--include-heavy`<br>`--command <cmd>`<br>`--timeout-ms <n>`<br>`--progress`<br>`--profile`<br>`--profile-out <path>` |
|
|
128
|
-
| `install-skills` | Install skills (_shared, scip-query, scip-setup, scip-cleanup-audit, scip-cleanup-improve, scip-integrity-audit, scip-twin-drift, scip-claim-audit, scip-probe-reachability, scip-hyper-optimization, scip-api-impact, scip-concrete-plan, scip-conductor, scip-debug, scip-explore, scip-triage-issue, scip-diagram, scip-doc-reconcile, scip-directory-architecture, scip-maintainability, scip-react-maintainability, scip-vue-maintainability, scip-verify, scip-language-playbook, scip-tla-model-system) into Claude Code, Codex, and shared agent roots | - |
|
|
131
|
+
| `install-skills` | Install skills (_shared, scip-query, scip-setup, scip-calibrate, scip-cleanup-audit, scip-cleanup-improve, scip-integrity-audit, scip-twin-drift, scip-claim-audit, scip-probe-reachability, scip-hyper-optimization, scip-api-impact, scip-concrete-plan, scip-conductor, scip-debug, scip-explore, scip-triage-issue, scip-diagram, scip-doc-reconcile, scip-directory-architecture, scip-maintainability, scip-react-maintainability, scip-vue-maintainability, scip-verify, scip-language-playbook, scip-tla-model-system) into Claude Code, Codex, and shared agent roots | - |
|
|
129
132
|
| `setup-hooks` | Install or refresh project-local Codex and Claude Code lifecycle hooks | `--shared`<br>`--remove`<br>`--force`<br>`--json` |
|
|
130
133
|
| `check-deps` | Check whether scip-query and the detected language indexers are actually runnable | - |
|
|
131
134
|
| `capabilities` | Report which evidence and verification capabilities are available in this project | `--matrix`<br>`--json` |
|
|
@@ -238,3 +238,19 @@ dimension), and the public command surface gained `twin-ab` (behavioral A/B
|
|
|
238
238
|
scaffold generator for scip-integrity-audit drill 5) in `queryCommandOrder`
|
|
239
239
|
and `PUBLIC_QUERY_ENTRIES`. All three files still own their respective
|
|
240
240
|
canonical lists; only the list contents grew.
|
|
241
|
+
|
|
242
|
+
## 2026-07-03 Integrity Detectors
|
|
243
|
+
|
|
244
|
+
The public command surface gained three integrity detectors (calibrated
|
|
245
|
+
against Vega_2.0 and Stable_Management before wiring — see
|
|
246
|
+
`docs/validation/2026-07-03-integrity-detector-calibration.md`):
|
|
247
|
+
`not-implemented` (placeholder stubs reachable from production entry
|
|
248
|
+
surfaces; mechanizes scip-integrity-audit drill 3's fallback autopsy),
|
|
249
|
+
`decorative-checkers` (checker-named callables with no reachable failure
|
|
250
|
+
exit; mechanizes drill 1), and `test-quality` (assertion-free tests,
|
|
251
|
+
aged skips, mock-echo). All three are standalone commands only — none are
|
|
252
|
+
wired into `HEALTH_PHASES` or `DIFF_GATE_CHECKS` per the calibration's
|
|
253
|
+
wiring decisions (test-quality's health eligibility is ledgered as a
|
|
254
|
+
followup). Registration files (`queryCommandOrder`,
|
|
255
|
+
`PUBLIC_QUERY_ENTRIES`, `query-command-specs.ts`) still own their
|
|
256
|
+
canonical lists; only the list contents grew.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "scip-query",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"description": "Evidence and verification for AI coding agents: map code, reuse concepts, finish migrations, and gate diffs.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -89,6 +89,10 @@
|
|
|
89
89
|
"import": "./dist/queries/dead.js",
|
|
90
90
|
"types": "./dist/queries/dead.d.ts"
|
|
91
91
|
},
|
|
92
|
+
"./queries/decorative-checkers": {
|
|
93
|
+
"import": "./dist/queries/decorative-checkers.js",
|
|
94
|
+
"types": "./dist/queries/decorative-checkers.d.ts"
|
|
95
|
+
},
|
|
92
96
|
"./queries/deep-chains": {
|
|
93
97
|
"import": "./dist/queries/deep-chains.js",
|
|
94
98
|
"types": "./dist/queries/deep-chains.d.ts"
|
|
@@ -169,6 +173,10 @@
|
|
|
169
173
|
"import": "./dist/queries/methods.js",
|
|
170
174
|
"types": "./dist/queries/methods.d.ts"
|
|
171
175
|
},
|
|
176
|
+
"./queries/not-implemented": {
|
|
177
|
+
"import": "./dist/queries/not-implemented.js",
|
|
178
|
+
"types": "./dist/queries/not-implemented.d.ts"
|
|
179
|
+
},
|
|
172
180
|
"./queries/outline": {
|
|
173
181
|
"import": "./dist/queries/outline.js",
|
|
174
182
|
"types": "./dist/queries/outline.d.ts"
|
|
@@ -261,6 +269,10 @@
|
|
|
261
269
|
"import": "./dist/queries/system.js",
|
|
262
270
|
"types": "./dist/queries/system.d.ts"
|
|
263
271
|
},
|
|
272
|
+
"./queries/test-quality": {
|
|
273
|
+
"import": "./dist/queries/test-quality.js",
|
|
274
|
+
"types": "./dist/queries/test-quality.d.ts"
|
|
275
|
+
},
|
|
264
276
|
"./queries/trace": {
|
|
265
277
|
"import": "./dist/queries/trace.js",
|
|
266
278
|
"types": "./dist/queries/trace.d.ts"
|
|
@@ -346,7 +358,7 @@
|
|
|
346
358
|
"optionalDependencies": {
|
|
347
359
|
"@sourcegraph/scip-typescript": "^0.4.0",
|
|
348
360
|
"scip-python-plus": "^0.7.4",
|
|
349
|
-
"scip-query-scip-windows": "0.
|
|
361
|
+
"scip-query-scip-windows": "0.13.0",
|
|
350
362
|
"tree-sitter": "0.21.1",
|
|
351
363
|
"tree-sitter-c": "0.23.2",
|
|
352
364
|
"tree-sitter-c-sharp": "0.23.1",
|
package/skills/_shared/SKILL.md
CHANGED
|
@@ -120,6 +120,9 @@ scip-query redundant-reexports # Find barrel re-exports that nobody imports thro
|
|
|
120
120
|
scip-query duplicate-bodies # Find exact duplicate small-body candidates across files
|
|
121
121
|
scip-query twin-drift # Twin drift candidates: same-name (or near-name) functions across files with diverged bodies
|
|
122
122
|
scip-query twin-ab <symbolA> <symbolB> # Generate a behavioral A/B scaffold comparing two same-concept twins (scip-integrity-audit drill 5) — a ready-to-fill vitest file, not an auto-executor
|
|
123
|
+
scip-query not-implemented # Reachable placeholder stub candidates (throw-stub, TODO+return-default, empty body) — production callers can actually reach these; an unreachable stub is dead's job, not this one's
|
|
124
|
+
scip-query decorative-checkers # Decorative checker candidates: validate*/verify*/check*/assert*/is*/has* callables with no reachable failure exit anywhere in their body
|
|
125
|
+
scip-query test-quality # Test-quality candidates: assertion-free it/test bodies, a skipped-test ledger with git-blame age, and mock-echo tests that assert the same literal they stubbed into a mock
|
|
123
126
|
scip-query similar-signatures # Find functions with near-identical type signatures (same shape)
|
|
124
127
|
```
|
|
125
128
|
|
|
@@ -171,7 +174,7 @@ scip-query complexity <symbol> # Per-symbol complexity: branches, cyclomatic est
|
|
|
171
174
|
|
|
172
175
|
```bash
|
|
173
176
|
scip-query bench # Benchmark indexing and command runtimes for this repository
|
|
174
|
-
scip-query install-skills # Install skills (_shared, scip-query, scip-setup, scip-cleanup-audit, scip-cleanup-improve, scip-integrity-audit, scip-twin-drift, scip-claim-audit, scip-probe-reachability, scip-hyper-optimization, scip-api-impact, scip-concrete-plan, scip-conductor, scip-debug, scip-explore, scip-triage-issue, scip-diagram, scip-doc-reconcile, scip-directory-architecture, scip-maintainability, scip-react-maintainability, scip-vue-maintainability, scip-verify, scip-language-playbook, scip-tla-model-system) into Claude Code, Codex, and shared agent roots
|
|
177
|
+
scip-query install-skills # Install skills (_shared, scip-query, scip-setup, scip-calibrate, scip-cleanup-audit, scip-cleanup-improve, scip-integrity-audit, scip-twin-drift, scip-claim-audit, scip-probe-reachability, scip-hyper-optimization, scip-api-impact, scip-concrete-plan, scip-conductor, scip-debug, scip-explore, scip-triage-issue, scip-diagram, scip-doc-reconcile, scip-directory-architecture, scip-maintainability, scip-react-maintainability, scip-vue-maintainability, scip-verify, scip-language-playbook, scip-tla-model-system) into Claude Code, Codex, and shared agent roots
|
|
175
178
|
scip-query setup-hooks # Install or refresh project-local Codex and Claude Code lifecycle hooks
|
|
176
179
|
scip-query check-deps # Check whether scip-query and the detected language indexers are actually runnable
|
|
177
180
|
scip-query capabilities # Report which evidence and verification capabilities are available in this project
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: scip-calibrate
|
|
3
|
+
description: Calibrate scip-query's detectors against a repo before trusting them. Use when adopting scip-query in a new or foreign codebase, after major detector changes, when a health score or gate output seems too noisy or too clean, or before letting diff-gate block anyone's work.
|
|
4
|
+
commands:
|
|
5
|
+
- scip-query health --json
|
|
6
|
+
- scip-query diff-gate --base <commit> --json
|
|
7
|
+
- scip-query twin-drift -s <scope> --json
|
|
8
|
+
- scip-query dead --json
|
|
9
|
+
- scip-query similar <symbol>
|
|
10
|
+
- scip-query config-validate
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# scip-calibrate
|
|
14
|
+
|
|
15
|
+
Use this skill to measure whether scip-query's detectors tell the truth about a
|
|
16
|
+
specific repository before believing anything they say about it. A detector
|
|
17
|
+
tuned on one codebase's conventions can be precise there and noisy elsewhere;
|
|
18
|
+
calibration is how you find out which you have — and it converts every noise
|
|
19
|
+
archetype you find into either a repo-side knob or an upstream detector bug.
|
|
20
|
+
|
|
21
|
+
Load shared mechanics from [`../_shared/SKILL.md`](../_shared/SKILL.md).
|
|
22
|
+
|
|
23
|
+
## The Stance
|
|
24
|
+
|
|
25
|
+
A health score you have not calibrated is a number, not a fact. Never present
|
|
26
|
+
detector output from an uncalibrated repo as findings — present it as
|
|
27
|
+
candidate findings pending classification. The score must EARN trust the same
|
|
28
|
+
way a checker earns it in `scip-integrity-audit`: by being witnessed telling
|
|
29
|
+
the truth on samples you verified yourself.
|
|
30
|
+
|
|
31
|
+
## Protocol
|
|
32
|
+
|
|
33
|
+
Run all five stages. Each has a checkable exit.
|
|
34
|
+
|
|
35
|
+
### 1. Index and inventory
|
|
36
|
+
|
|
37
|
+
`scip-query reindex`, then `scip-query status --capabilities`. Record which
|
|
38
|
+
languages got which evidence tier (SCIP-indexed vs source-fallback vs regex) —
|
|
39
|
+
a detector's expected precision differs per tier, and a repo that is 80%
|
|
40
|
+
fallback-tier must be judged against fallback expectations. Note monorepo
|
|
41
|
+
shape (workspaces, cross-package imports): historically the single largest
|
|
42
|
+
false-positive source (dead/new-dead on cross-package consumers).
|
|
43
|
+
Complete when: languages, tiers, and workspace shape are written down.
|
|
44
|
+
|
|
45
|
+
### 2. Battery sweep
|
|
46
|
+
|
|
47
|
+
Run the full detector battery and `health --json`. Do not react to anything
|
|
48
|
+
yet — big numbers are not findings, they are sampling frames.
|
|
49
|
+
Complete when: every detector's finding count is recorded.
|
|
50
|
+
|
|
51
|
+
### 3. Retro-gate replay
|
|
52
|
+
|
|
53
|
+
Replay `diff-gate` against the last 15–20 real commits (worktree per commit,
|
|
54
|
+
never the user's live tree). This is the stage that exposes finding WALLS —
|
|
55
|
+
one hub file or one convention mismatch generating dozens of near-identical
|
|
56
|
+
findings per commit. A wall is always either a missing repo knob or a detector
|
|
57
|
+
bug; it is never "the repo is just bad."
|
|
58
|
+
Complete when: per-commit finding counts and every wall are recorded.
|
|
59
|
+
|
|
60
|
+
### 4. Sample and classify — the actual calibration
|
|
61
|
+
|
|
62
|
+
For each detector with findings: sample about 10 (all of them if fewer),
|
|
63
|
+
READ THE CODE at each site, and classify actionable vs noise. Two rules make
|
|
64
|
+
this real calibration instead of theater:
|
|
65
|
+
|
|
66
|
+
- Classify from the code, never from the finding text. A finding that sounds
|
|
67
|
+
plausible and a finding that is true are different things; the difference is
|
|
68
|
+
only visible at the cited file and line.
|
|
69
|
+
- For every noise finding, name the ARCHETYPE (e.g. "type-only import
|
|
70
|
+
invisible to indexer", "delegation chain flagged as twin", "generic shared
|
|
71
|
+
helpers saturating similarity"). Archetypes are the deliverable: a noise
|
|
72
|
+
rate without archetypes cannot be fixed.
|
|
73
|
+
|
|
74
|
+
Then give each detector a verdict: **keep** (precision acceptable), **retune**
|
|
75
|
+
(name the threshold and the value), or **demote to advisory** for this repo.
|
|
76
|
+
Complete when: every detector has sampled precision, named archetypes, and a
|
|
77
|
+
verdict.
|
|
78
|
+
|
|
79
|
+
### 5. Tune the knobs, file the bugs
|
|
80
|
+
|
|
81
|
+
Apply repo-side fixes for what belongs to the repo, and file upstream for what
|
|
82
|
+
belongs to the detector:
|
|
83
|
+
|
|
84
|
+
- `.scipquery.json` suppressions — one per accepted finding, WITH a reason;
|
|
85
|
+
a reasonless suppression is hiding, not tuning.
|
|
86
|
+
- `docs.snapshotPaths` — dated/archival docs that must never generate
|
|
87
|
+
doc-reference findings.
|
|
88
|
+
- Coverage contracts — enumerations the gate should police.
|
|
89
|
+
- `commandAnalysisBudget` — cap analysis honestly on very large indexes.
|
|
90
|
+
- Detector bugs (noise archetypes no knob can express) go to the tool's
|
|
91
|
+
followup ledger with the archetype, a concrete example, and the sampled
|
|
92
|
+
rate. Never tune a threshold to hide an archetype — that trades visible
|
|
93
|
+
noise for invisible blindness.
|
|
94
|
+
|
|
95
|
+
Complete when: the gate replay from stage 3 re-runs materially quieter, and
|
|
96
|
+
every remaining finding class is either actionable, suppressed-with-reason, or
|
|
97
|
+
filed upstream.
|
|
98
|
+
|
|
99
|
+
## Failure Modes (each observed in a real calibration)
|
|
100
|
+
|
|
101
|
+
- **Sampling too few.** One good finding does not make a detector precise;
|
|
102
|
+
one bad finding does not make it noise. Ten per detector is the floor.
|
|
103
|
+
- **Classifying from the finding text.** The finding always sounds right —
|
|
104
|
+
it was generated to. Only the code knows.
|
|
105
|
+
- **Tuning to green.** Raising a threshold until the noise disappears also
|
|
106
|
+
disappears the real findings. If the archetype is a detector bug, file it
|
|
107
|
+
and live with the noise until it is fixed.
|
|
108
|
+
- **Trusting a clean run.** Zero findings on a detector can mean precision or
|
|
109
|
+
can mean the detector cannot see this repo's conventions at all (wrong
|
|
110
|
+
import style, unindexed language). Verify at least one known-true positive
|
|
111
|
+
per major detector — plant one if none exists.
|
|
112
|
+
- **Calibrating the wrong tree.** Clones or worktrees for anything that
|
|
113
|
+
mutates; the target repo is read-only unless its owner said otherwise.
|
|
114
|
+
|
|
115
|
+
## After Calibration
|
|
116
|
+
|
|
117
|
+
The finding-outcome ledger keeps calibrating for you: once the repo uses
|
|
118
|
+
diff-gate, per-detector precision is recomputed from real outcomes
|
|
119
|
+
(`detectorPrecision` in `health --json`). Re-run this protocol only after
|
|
120
|
+
major detector upgrades or when the ledger's precision numbers drift from
|
|
121
|
+
what you measured. Write the calibration report to
|
|
122
|
+
`docs/validation/YYYY-MM-DD-external-calibration-<repo>.md` in the shape of
|
|
123
|
+
the exemplars this skill was distilled from — battery table, retro-gate
|
|
124
|
+
walls, per-detector verdicts, noise archetypes, caps and deviations.
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
interface:
|
|
2
|
+
display_name: "scip calibrate"
|
|
3
|
+
short_description: "Measure scip-query's detector precision on a repo before trusting scores or gating anyone."
|
|
4
|
+
default_prompt: "Run the scip-calibrate protocol against this repository: battery sweep, retro-gate replay, sample-and-classify each detector from the code, then tune repo knobs and file detector bugs."
|
|
@@ -9,6 +9,9 @@ commands:
|
|
|
9
9
|
- scip-query twin-drift -s <scope> --json
|
|
10
10
|
- scip-query twin-ab <symbolA> <symbolB>
|
|
11
11
|
- scip-query outline <file> --signatures
|
|
12
|
+
- scip-query decorative-checkers -s <scope> --json
|
|
13
|
+
- scip-query not-implemented -s <scope> --json
|
|
14
|
+
- scip-query test-quality -s <scope> --json
|
|
12
15
|
---
|
|
13
16
|
|
|
14
17
|
# scip-integrity-audit
|
|
@@ -43,6 +46,13 @@ decorative: file it as a defect, not a note.
|
|
|
43
46
|
Complete only when every checker in scope has been witnessed rejecting a
|
|
44
47
|
constructed should-fail input, or is listed with a reason it cannot be.
|
|
45
48
|
|
|
49
|
+
Mechanized by: `scip-query decorative-checkers` finds `validate*`/`verify*`/
|
|
50
|
+
`check*`/`assert*`/`is*`/`has*` callables with no reachable failure exit
|
|
51
|
+
anywhere in their body (calibrated 2026-07-03 against two external repos —
|
|
52
|
+
standalone-only; noise archetypes past one-hop delegation in
|
|
53
|
+
`docs/validation/2026-07-03-integrity-detector-calibration.md`). Run it first
|
|
54
|
+
to shortlist candidates before hand-constructing should-fail inputs.
|
|
55
|
+
|
|
46
56
|
### 2. Diff every adapter against captured reality
|
|
47
57
|
|
|
48
58
|
For each parser/adapter of an external format (tool output, XML/JSON
|
|
@@ -65,6 +75,15 @@ feature above it is dead — date of death: birth.
|
|
|
65
75
|
Complete only when every fallback's primary path has a witness or a filed
|
|
66
76
|
defect.
|
|
67
77
|
|
|
78
|
+
Mechanized by: `scip-query not-implemented` finds reachable placeholder
|
|
79
|
+
stubs (`throw new Error('not implemented')`, TODO-comment + return-default,
|
|
80
|
+
empty bodies) that a real caller, entry surface, or package-surface export
|
|
81
|
+
can actually reach — the graph fact that separates "primary path never
|
|
82
|
+
built" from `dead`'s "primary path built but unreferenced." Standalone-only
|
|
83
|
+
(calibrated 2026-07-03; 0 live findings on two external repos post-fix, see
|
|
84
|
+
the calibration report) — treat a clean run as "nothing this shape found,"
|
|
85
|
+
not as "every fallback's primary path is proven live."
|
|
86
|
+
|
|
68
87
|
### 4. Hand-compute every metric twice
|
|
69
88
|
|
|
70
89
|
For each number the system reports (scores, counts, estimates): pick two
|
|
@@ -101,3 +120,16 @@ the drill that exposed it, the should-fail input or real sample used, and
|
|
|
101
120
|
the fix. The audit is complete only when every drill's exit criterion is
|
|
102
121
|
met for the scope, and every defect found has a regression artifact — a
|
|
103
122
|
test, fixture, or model that fails on the pre-fix behavior.
|
|
123
|
+
|
|
124
|
+
A regression artifact that doesn't actually assert anything, or asserts the
|
|
125
|
+
same literal it stubbed into its own mock, is a fake witness — the same
|
|
126
|
+
"reports success without doing the work" failure mode this skill hunts in
|
|
127
|
+
production code, just relocated to the test suite. Run `scip-query
|
|
128
|
+
test-quality -s <scope>` over the audit's own regression artifacts (and,
|
|
129
|
+
periodically, over the suite at large) to catch this: assertion-free test
|
|
130
|
+
bodies, a skipped-test ledger with git-blame age (a skip with no fix date
|
|
131
|
+
attached is a claim nobody is checking), and mock-echo (a test that only
|
|
132
|
+
proves its own stub). Standalone-only, mixed precision by sub-check
|
|
133
|
+
(calibrated 2026-07-03): assertion-free and skipped are high-precision;
|
|
134
|
+
mock-echo is intentionally low-precision (syntactic same-literal matching,
|
|
135
|
+
not dataflow) — treat its output as a reviewed candidate list, not a verdict.
|
|
@@ -21,19 +21,17 @@ Use this skill when a TypeScript system needs a TLA+ model tied to code evidence
|
|
|
21
21
|
Load shared mechanics from [`../_shared/SKILL.md`](../_shared/SKILL.md).
|
|
22
22
|
|
|
23
23
|
<!-- BEGIN GENERATED SKILL COMMANDS -->
|
|
24
|
-
|
|
25
24
|
## Commands for this skill
|
|
26
25
|
|
|
27
|
-
| Command
|
|
28
|
-
|
|
|
29
|
-
| `scip-query tla scaffold <file>`
|
|
30
|
-
| `scip-query tla verify <spec>`
|
|
31
|
-
| `scip-query tla instrument <spec>`
|
|
32
|
-
| `scip-query tla trace-check <spec> --trace <file>` | TLA+ model workflow: verify a model and mapping contract, scaffold a draft model from indexed code, generate a trace recorder, or check a recorded trace against the next-state relation | Semantic conformance: check a recorded execution against the model's Next relation.
|
|
33
|
-
| `scip-query tla fetch-tools`
|
|
26
|
+
| Command | Purpose | When |
|
|
27
|
+
| --- | --- | --- |
|
|
28
|
+
| `scip-query tla scaffold <file>` | TLA+ model workflow: verify a model and mapping contract, scaffold a draft model from indexed code, generate a trace recorder, or check a recorded trace against the next-state relation | Start here for a new model: derive a draft spec, config, and mapping from indexed code. |
|
|
29
|
+
| `scip-query tla verify <spec>` | TLA+ model workflow: verify a model and mapping contract, scaffold a draft model from indexed code, generate a trace recorder, or check a recorded trace against the next-state relation | Mechanical conformance: referents, reads/writes, calls, and the model checker. |
|
|
30
|
+
| `scip-query tla instrument <spec>` | TLA+ model workflow: verify a model and mapping contract, scaffold a draft model from indexed code, generate a trace recorder, or check a recorded trace against the next-state relation | Generate a trace recorder plus wiring sites for each mapped action. |
|
|
31
|
+
| `scip-query tla trace-check <spec> --trace <file>` | TLA+ model workflow: verify a model and mapping contract, scaffold a draft model from indexed code, generate a trace recorder, or check a recorded trace against the next-state relation | Semantic conformance: check a recorded execution against the model's Next relation. |
|
|
32
|
+
| `scip-query tla fetch-tools` | TLA+ model workflow: verify a model and mapping contract, scaffold a draft model from indexed code, generate a trace recorder, or check a recorded trace against the next-state relation | Download the pinned tla2tools.jar into the cache when the checker is unavailable. |
|
|
34
33
|
|
|
35
34
|
Use this shortlist first. Open [`../_shared/SKILL.md`](../_shared/SKILL.md) only when it is insufficient.
|
|
36
|
-
|
|
37
35
|
<!-- END GENERATED SKILL COMMANDS -->
|
|
38
36
|
|
|
39
37
|
## Choose the Slice
|
package/dist/chunk-EDB7Y442.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as x,f as C,g as w}from"./chunk-Q3B3FNCU.js";import{b as k}from"./chunk-B75HZHUP.js";import{b as A,c as M}from"./chunk-NAH5EAZS.js";import{a as N}from"./chunk-BGBBVSH4.js";import{g as z}from"./chunk-MBKJ7GHT.js";import{d as v}from"./chunk-HXXMPYEF.js";import{b as h,i as S,m as R}from"./chunk-T2FQ4GHD.js";import{c as p}from"./chunk-GNG622H3.js";function fe(t,e={}){let{includeHomonyms:i=!1,limit:s}=e,r=F(t,e).filter(o=>o.relationship==="divergent"||i&&o.relationship==="homonym");return s?r.slice(0,s):r}function F(t,e={}){let{scope:i,minSimilarity:s=.3,scanLimit:r}=e,o=B(t,{scope:i,scanLimit:r});return $(o,{minSimilarity:s,isDelegatePair:Y(t)})}function $(t,e={}){let i=e.minSimilarity??.3,s=e.isDelegatePair,r=t.filter(n=>!ee(n.leaf)),o=[...new Set(r.map(n=>n.leaf))],a=H(o),l=[];for(let n of a){let c=r.filter(f=>n.has(f.leaf));if(c.length<2||new Set(c.map(f=>f.file)).size<2||c.every(f=>A(f.file)==="test"))continue;let m=null,b=!1,y=!1;for(let f=0;f<c.length;f+=1)for(let u=f+1;u<c.length;u+=1){let g=c[f],d=c[u];if(g.file===d.file||s?.(g,d,c)||s?.(d,g,c))continue;if(b=!0,g.normalizedBody===d.normalizedBody){y=!0;continue}let L=E(g.tokens,d.tokens);(!m||L>m.similarity)&&(m={a:g,b:d,similarity:L})}if(!b)continue;let T=[...c].sort((f,u)=>f.file.localeCompare(u.file)||f.startLine-u.startLine).map(O);if(!m){l.push({leaf:P(n),relationship:y?"identical":"homonym",maxDivergence:0,members:T});continue}let D=m.similarity>=i?"divergent":"homonym";l.push({leaf:P(n),relationship:D,maxDivergence:Math.round((1-m.similarity)*1e3)/1e3,members:T,...D==="divergent"?{firstDivergentTokens:Z(m.a.tokens,m.b.tokens)}:{}})}return l.sort((n,c)=>c.members.length-n.members.length||c.maxDivergence-n.maxDivergence||n.leaf.localeCompare(c.leaf))}function B(t,e){let i=z(t,{scope:e.scope}).filter(o=>o.isFunctionLike&&!t.isIgnored(o.relativePath)).filter(o=>!M(o.relativePath));i.sort((o,a)=>o.relativePath.localeCompare(a.relativePath)||o.startLine-a.startLine);let s=k(i,e.scanLimit),r=[];for(let o of s){let a=I(t,o);a&&r.push(a)}return r}function I(t,e){if(!e.leaf)return null;let i=C(t,e);if(!i)return null;let s=x(i);if(!s||s.length<8)return null;let r=G(i);return r.length===0?null:{leaf:e.leaf,symbol:e.symbol,shortName:v(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:N(e),normalizedBody:s,tokens:r,isThinForwarder:X(i)}}var j=/[A-Za-z_$][A-Za-z0-9_$]*|\d+(?:\.\d+)?|[^\sA-Za-z0-9_$]/g;function G(t){let e=w(t);return h(e).match(j)??[]}function O(t){return{symbol:t.symbol,shortName:t.shortName,file:t.file,startLine:t.startLine,endLine:t.endLine,loc:t.loc}}function E(t,e){let i=new Set(t),s=new Set(e);if(i.size===0&&s.size===0)return 1;if(i.size===0||s.size===0)return 0;let r=0;for(let a of i)s.has(a)&&(r+=1);let o=i.size+s.size-r;return o===0?0:r/o}function Z(t,e){let i=Math.min(t.length,e.length),s=0;for(;s<i&&t[s]===e[s];)s+=1;let r=t.slice(s,s+6).join(" "),o=e.slice(s,s+6).join(" ");return!r&&!o?"(bodies differ only in trailing length)":`A: ${r||"(end)"} | B: ${o||"(end)"}`}function H(t){let e=new Map;for(let a of t)e.set(a,a);let i=a=>{let l=a;for(;e.get(l)!==l;)l=e.get(l);let n=a;for(;e.get(n)!==l;){let c=e.get(n);e.set(n,l),n=c}return l},s=(a,l)=>{let n=i(a),c=i(l);n!==c&&e.set(n,c)},r=new Map;for(let a of t){let l=a.slice(0,1).toLowerCase(),n=r.get(l)??[];n.push(a),r.set(l,n)}for(let a of r.values())for(let l=0;l<a.length;l+=1)for(let n=l+1;n<a.length;n+=1)W(a[l],a[n])&&s(a[l],a[n]);let o=new Map;for(let a of t){let l=i(a),n=o.get(l)??new Set;n.add(a),o.set(l,n)}return[...o.values()]}function W(t,e){return t===e||t.toLowerCase()===e.toLowerCase()?!0:t.length<8||e.length<8||Math.abs(t.length-e.length)>2?!1:K(t.toLowerCase(),e.toLowerCase(),2)}function K(t,e,i){if(Math.abs(t.length-e.length)>i)return!1;let s=Array.from({length:e.length+1},(r,o)=>o);for(let r=1;r<=t.length;r+=1){let o=[r],a=o[0];for(let l=1;l<=e.length;l+=1){let n=t[r-1]===e[l-1]?0:1,c=Math.min(s[l]+1,o[l-1]+1,s[l-1]+n);o.push(c),a=Math.min(a,c)}if(a>i)return!1;s=o}return s[e.length]<=i}function X(t){let e=h(w(t)).trim();if(!e||q.test(e))return!1;let i=U(e);return i.length===0||i.length>2?!1:Q(i[i.length-1])}var q=/\b(?:if|else|for|while|switch|try|catch|do)\b/,J=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\[[^[\]]*\])*\((?:[^()]|\([^()]*\))*\)$/;function Q(t){let e=t.trim().replace(/^return\s+/,"").replace(/^await\s+/,"").replace(/;\s*$/,"").trim();return J.test(e)}function U(t){let e=[],i=0,s="";for(let r of t){if(r==="("||r==="["||r==="{"?i+=1:(r===")"||r==="]"||r==="}")&&(i=Math.max(0,i-1)),r===";"&&i===0){e.push(s),s="";continue}s+=r}return s.trim()&&e.push(s),e.map(r=>r.trim()).filter(r=>r.length>0)}var V=3;function Y(t){let e=new Map;return(i,s,r)=>{if(!i.isThinForwarder)return!1;let o=`${i.symbol}\0${s.symbol}`,a=e.get(o);if(a!==void 0)return a;let l=_(t,i,s,r,V,new Set);return e.set(o,l),l}}function _(t,e,i,s,r,o){if(r<=0||o.has(e.symbol)||(o.add(e.symbol),(S(t,e.file)??[]).filter(n=>n.line>=e.startLine&&n.line<=e.endLine&&n.calleeLeaf===i.leaf).length===0))return!1;let l=new Set(R(t,e.file).filter(n=>n.sourcePath&&(n.kind!=="namespace"||n.usedMembers.includes(i.leaf))).map(n=>n.sourcePath));if([...l].some(n=>p(n,i.file)))return!0;for(let n of s)if(!(n.symbol===e.symbol||n.symbol===i.symbol||!n.isThinForwarder)&&[...l].some(c=>p(c,n.file))&&_(t,n,i,s,r-1,o))return!0;return!1}function ee(t){return t.startsWith("<")&&t.endsWith(">")}function P(t){return[...t].sort()[0]}export{fe as a,F as b,$ as c};
|
|
2
|
-
//# sourceMappingURL=chunk-EDB7Y442.js.map
|
package/dist/chunk-EZ5WDZ2Q.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{a as S}from"./chunk-QARYU7R3.js";import{a as y}from"./chunk-K6UI6EBZ.js";import{a as P}from"./chunk-B75HZHUP.js";import{a as x}from"./chunk-UAHZ57BR.js";import{a as h,g as b}from"./chunk-NAH5EAZS.js";import{a as v}from"./chunk-BGBBVSH4.js";import{d as l,e as p,h as u}from"./chunk-HXXMPYEF.js";import{a as f,f as m,g}from"./chunk-T2FQ4GHD.js";import{q as d}from"./chunk-WS3Z6W3M.js";import{basename as L,extname as D}from"path";function H(i,e){let{scope:n,maxLoc:t=15,limit:o=30,scanLimit:s}=e??{},a=new x(i);return y({candidates:()=>A(i,a,n,t),orderCandidates:P,scanLimit:s,profile:{name:"passthrough-candidates"},prepare:r=>a.calleeMap(r,{semantic:e?.semantic!==!1}),evaluate:(r,c)=>I(i,r,c.get(r.symbolId)??[]),orderResults:(r,c)=>r.loc-c.loc||r.file.localeCompare(c.file),limit:o})}function I(i,e,n){let t=j(n);if(t.size!==1||!m(i,e.relativePath,e.startLine,e.endLine))return null;let[,o]=[...t.entries()][0],s=T(i,e,o),a=w(i,e),r=s.length>0||a.length>0?"signal":"direct";return{symbol:e.symbol,shortName:l(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:v(e),forwardsTo:o.symbol,forwardsToShort:l(o.symbol),forwardsToFile:o.file,actionTier:r,boundaryEvidence:s,publicFacadeEvidence:a,recommendation:E(r,s,a)}}function T(i,e,n){return S(i,e.relativePath,e.startLine,"passthrough","explicit ignore-passthrough comment",[{label:"passthrough name",value:l(e.symbol)},{label:"callee name",value:l(n.symbol)},{label:"passthrough module",value:L(e.relativePath,D(e.relativePath))},{label:"callee module",value:L(n.file,D(n.file))}])}function E(i,e,n){if(i==="signal"){if(n.length>0)return`Review the public API before inlining; public-facade evidence: ${n.slice(0,2).join("; ")}.`;let t=e.filter(F);return t.length>0?`Review the public API before inlining; public-surface evidence: ${t.slice(0,2).join("; ")}.`:`Review the boundary before inlining; boundary evidence: ${e.slice(0,2).join("; ")}.`}return"Inline or remove this passthrough unless an external API or runtime registration depends on the forwarding name."}function w(i,e){return C(i,e)?h(i,e.relativePath)?["exported passthrough is declared on the package public surface"]:b(i,e.symbol,e.relativePath)?["exported passthrough matches configured or framework public entry surface"]:[]:[]}function C(i,e){let n=d(i,e.relativePath);if(n.length===0)return!1;let t=n.slice(Math.max(0,e.startLine-2),e.startLine+1).join(`
|
|
2
|
-
`);return M.test(t)?!0:R(n,p(e.symbol))}function R(i,e){if(!e)return!1;let n=new RegExp(`^\\s*export\\s*\\{[^}\\n]*\\b${f(e)}\\b`);return i.some(t=>n.test(t))}function F(i){return i.includes("public surface")}function j(i){let e=i.some(t=>u(t.symbol))?i.filter(t=>u(t.symbol)):i,n=new Map;for(let t of e)n.has(t.symbol)||n.set(t.symbol,t);return n}function A(i,e,n,t){return e.productionCallableDefinitions({scope:n,minLoc:3,maxLoc:t,requireFunctionLikeSymbol:!0,excludeRustTraitImplMembers:!0}).filter(o=>!g(i,o))}var M=/^\s*export\s+(?:default\s+)?(?:(?:async\s+)?function\b|(?:const|let|var)\b)/m;export{H as a,C as b};
|
|
3
|
-
//# sourceMappingURL=chunk-EZ5WDZ2Q.js.map
|
package/dist/chunk-H2NMIZFD.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as f}from"./chunk-UAHZ57BR.js";import{a as h}from"./chunk-ECVXWZ4Q.js";import{e as s,g as u}from"./chunk-HXXMPYEF.js";import{d}from"./chunk-T2FQ4GHD.js";import{x as c}from"./chunk-ISLWJ4PY.js";import{basename as p}from"path";function N(r,o){let t=h(r,o);if(!t)return[];let e=s(t.symbol),a=new f(r).definitionsForFile(t.relativePath).filter(n=>u(n.symbol)),l=a.filter(n=>n.parentTypeName===e||n.symbol.includes(e)),m=(l.length>0?l:L(p(t.relativePath))===e?a.filter(n=>n.symbol.includes("<invalid-global-code>")):[]).map(n=>({startLine:n.startLine,endLine:n.endLine,name:s(n.symbol)}));return c(t.relativePath)!=="clojure"?m:b(m,M(r,t))}function L(r){return r.replace(/\.[^.]+$/,"")}function M(r,o){let t=s(o.symbol);return t?(d(r,o.relativePath)?.clojureMembers??[]).filter(e=>e.ownerName===t).map(e=>({startLine:e.startLine,endLine:e.endLine,name:e.memberName})):[]}function b(r,o){let t=new Map;for(let e of[...r,...o])t.set(`${e.name}:${e.startLine}:${e.endLine}`,e);return[...t.values()].sort((e,i)=>e.startLine-i.startLine||e.endLine-i.endLine)}export{N as a};
|
|
2
|
-
//# sourceMappingURL=chunk-H2NMIZFD.js.map
|
package/dist/chunk-HXXMPYEF.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{e as g,l as S,m as x}from"./chunk-T2FQ4GHD.js";import{A as m}from"./chunk-ISLWJ4PY.js";import{p as u,q as d}from"./chunk-WS3Z6W3M.js";var y={"/":"namespace","#":"type",".":"term","[":"type-param",":":"meta","!":"macro"};function a(e){if(e.startsWith("local "))return{kind:"local",id:e.slice(6),raw:e};let s=e.split(" ");if(s.length<4)return{scheme:s[0]??"",manager:s[1]??"",packageName:s[2]??"",version:"",descriptors:[],raw:e};let t=s[0],r=s[1],n=e.slice(t.length+1+r.length+1),i;if(n.startsWith("`")){let f=n.indexOf("`",1);f===-1?(i=n.slice(1),n=""):(i=n.slice(1,f),n=n.slice(f+2))}else{let f=n.indexOf(" ");f===-1?(i=n,n=""):(i=n.slice(0,f),n=n.slice(f+1))}let o,c=n.indexOf(" ");c===-1?(o=n,n=""):(o=n.slice(0,c),n=n.slice(c+1));let l=v(n);return{scheme:t,manager:r,packageName:i,version:o,descriptors:l,raw:e}}function M(e){let s=a(e);if("kind"in s)return null;for(let t=s.descriptors.length-2;t>=0;t--){let r=s.descriptors[t];if(r?.suffix==="type")return r.name}return null}function v(e){let s=[],t=0;for(;t<e.length;){if(e[t]==="["){let i=e.indexOf("]",t+1);if(i===-1){s.push({name:e.slice(t+1),suffix:"type-param"});break}s.push({name:e.slice(t+1,i),suffix:"type-param"}),t=i+1;continue}if(e[t]==="("&&(s.length===0||t===0||h(e[t-1]))){let i=e.indexOf(")",t+1);if(i!==-1&&e[i+1]!=="."){s.push({name:e.slice(t+1,i),suffix:"parameter"}),t=i+1;continue}}let r;if(e[t]==="`"){let i=e.indexOf("`",t+1);if(i===-1){r=e.slice(t+1),s.push({name:r,suffix:"term"});break}r=e.slice(t+1,i),t=i+1}else{let i=t;for(;t<e.length&&!h(e[t]);)t++;r=e.slice(i,t)}if(t>=e.length){r&&s.push({name:r,suffix:"term"});break}let n=e[t];if(n==="("){let i=e.indexOf(")",t+1);i!==-1&&e[i+1]==="."?(s.push({name:r,suffix:"method"}),t=i+2):i!==-1?(s.push({name:r,suffix:"method"}),t=i+1):(s.push({name:r,suffix:"term"}),t++)}else{let i=y[n];i&&s.push({name:r,suffix:i}),t+=1}}return s}function h(e){return e==="/"||e==="#"||e==="."||e==="("||e==="["||e===":"||e==="!"}function R(e){let s=a(e);if("kind"in s&&s.kind==="local")return`local:${s.id}`;let t=s;if(t.descriptors.length===0)return t.raw;let r=[];for(let n of t.descriptors){let i=k(n);i&&r.push(i)}return r.join(":")}function k(e){let s=e.suffix==="namespace"?F(e.name):e.name;return s?e.suffix==="method"?`${s}()`:s:""}function F(e){return e.replace(/\.(ts|tsx|js|jsx|mjs|cjs)$/,"").replace(/\.(py|pyi)$/,"").replace(/\.(rs)$/,"").replace(/\.(java|scala|kt|kts)$/,"").replace(/\.(rb)$/,"").replace(/\.(go)$/,"").replace(/\.(cs|vb)$/,"").replace(/\.(dart)$/,"").replace(/\.(php)$/,"").replace(/\.(c|cc|cpp|cxx|h|hpp)$/,"")}function $(e){let s=a(e);if("kind"in s&&s.kind==="local")return s.id;let t=s;return t.descriptors.length===0?"":t.descriptors[t.descriptors.length-1].name}function p(e){let s=a(e);if("kind"in s&&s.kind==="local")return null;let t=s;return t.descriptors[t.descriptors.length-1]?.suffix??null}function T(e){return e.endsWith("().")||p(e)==="method"}function j(e){let s=p(e);return s==="method"?!0:s!=="term"?!1:e.endsWith("().")||!e.startsWith("scip-typescript ")?!0:!/#[A-Za-z0-9_$]+\.$/.test(e)}function I(e){return p(e)==="namespace"}var D=/^rust-analyzer\b.*[\s/]impl#\[[^\]]+\]\[[^\]]+\]/;function L(e){return D.test(e)}var E=new Set(["test","tests","_tests"]);function O(e){let s=a(e);if("kind"in s)return!1;for(let t=0;t<s.descriptors.length-1;t+=1){let r=s.descriptors[t];if(r?.suffix==="namespace"&&r.name&&E.has(r.name))return!0}return!1}function P(e,s){let t=a(e),r=a(s);if("kind"in t||"kind"in r)return!1;let n=t.descriptors,i=r.descriptors;if(i.length!==n.length+1)return!1;for(let o=0;o<n.length;o++){let c=n[o],l=i[o];if(c.name!==l.name||c.suffix!==l.suffix)return!1}return!0}function _(e,s){let t=a(e),r=a(s);if("kind"in t||"kind"in r)return!1;let n=t.descriptors,i=r.descriptors;if(i.length<=n.length)return!1;for(let o=0;o<n.length;o++){let c=n[o],l=i[o];if(c.name!==l.name||c.suffix!==l.suffix)return!1}return!0}function z(e){return{forFile(s,t){return b(e,s,t)},forFiles(s,t){let r=new Map;for(let n of s)r.set(n,b(e,n,t));return r}}}function b(e,s,t){let r={file:s},n=t.facts||t.identifiers;if(t.text&&(r.text=u(e,s)),t.lines&&(r.lines=d(e,s)),t.ast&&(r.ast=m(e,s)),t.imports&&(r.imports=x(e,s)),t.reexports&&(r.reexports=S(e,s)),n){let i=g(e,s),o=i.facts;t.facts&&(r.facts=o),i.unavailable&&(r.sourceFactsUnavailable=i.unavailable),t.identifiers&&o&&(r.identifiers=o.fileIdentifiers,r.identifierLineMap=o.identifierLineMap)}return r}export{z as a,a as b,M as c,R as d,$ as e,p as f,T as g,j as h,I as i,L as j,O as k,P as l,_ as m};
|
|
2
|
-
//# sourceMappingURL=chunk-HXXMPYEF.js.map
|
package/dist/chunk-PXHPCWX5.js
DELETED