@vyuhlabs/dxkit 2.4.2 → 2.4.3
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 +151 -0
- package/README.md +9 -1
- package/dist/analyzers/tools/coverage.d.ts +4 -15
- package/dist/analyzers/tools/coverage.d.ts.map +1 -1
- package/dist/analyzers/tools/coverage.js +9 -201
- package/dist/analyzers/tools/coverage.js.map +1 -1
- package/dist/analyzers/tools/generic.d.ts.map +1 -1
- package/dist/analyzers/tools/generic.js +21 -4
- package/dist/analyzers/tools/generic.js.map +1 -1
- package/dist/analyzers/tools/graphify.js +2 -2
- package/dist/analyzers/tools/grep-secrets.d.ts.map +1 -1
- package/dist/analyzers/tools/grep-secrets.js +10 -1
- package/dist/analyzers/tools/grep-secrets.js.map +1 -1
- package/dist/analyzers/tools/tool-registry.d.ts.map +1 -1
- package/dist/analyzers/tools/tool-registry.js +6 -20
- package/dist/analyzers/tools/tool-registry.js.map +1 -1
- package/dist/constants.d.ts +3 -3
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +41 -17
- package/dist/constants.js.map +1 -1
- package/dist/detect.d.ts.map +1 -1
- package/dist/detect.js +15 -16
- package/dist/detect.js.map +1 -1
- package/dist/doctor.d.ts.map +1 -1
- package/dist/doctor.js +10 -16
- package/dist/doctor.js.map +1 -1
- package/dist/generator.d.ts.map +1 -1
- package/dist/generator.js +41 -75
- package/dist/generator.js.map +1 -1
- package/dist/languages/csharp.d.ts.map +1 -1
- package/dist/languages/csharp.js +18 -0
- package/dist/languages/csharp.js.map +1 -1
- package/dist/languages/go.d.ts +10 -0
- package/dist/languages/go.d.ts.map +1 -1
- package/dist/languages/go.js +89 -1
- package/dist/languages/go.js.map +1 -1
- package/dist/languages/index.d.ts +42 -1
- package/dist/languages/index.d.ts.map +1 -1
- package/dist/languages/index.js +55 -0
- package/dist/languages/index.js.map +1 -1
- package/dist/languages/python.d.ts +3 -0
- package/dist/languages/python.d.ts.map +1 -1
- package/dist/languages/python.js +55 -1
- package/dist/languages/python.js.map +1 -1
- package/dist/languages/rust.d.ts.map +1 -1
- package/dist/languages/rust.js +8 -0
- package/dist/languages/rust.js.map +1 -1
- package/dist/languages/types.d.ts +69 -1
- package/dist/languages/types.d.ts.map +1 -1
- package/dist/languages/typescript.d.ts +5 -0
- package/dist/languages/typescript.d.ts.map +1 -1
- package/dist/languages/typescript.js +72 -2
- package/dist/languages/typescript.js.map +1 -1
- package/dist/project-yaml.d.ts.map +1 -1
- package/dist/project-yaml.js +19 -15
- package/dist/project-yaml.js.map +1 -1
- package/dist/types.d.ts +33 -8
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,157 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [2.4.3] - 2026-04-26
|
|
11
|
+
|
|
12
|
+
Phase 10i.0-LP — language-pack architectural refactor. Two user-visible
|
|
13
|
+
fixes (graphify + dotnet auto-discovery), one developer-experience win
|
|
14
|
+
(test suite from 30 min flaky to 2 min deterministic), and an
|
|
15
|
+
architectural cleanup that makes adding a new language pack a one-command
|
|
16
|
+
scaffold (`npm run new-lang <id> "<displayName>"`) instead of a
|
|
17
|
+
13-file scavenger hunt. Closes audit items #1–#7 and #9–#14 (12 items)
|
|
18
|
+
plus **D009** and a doctor-check gap that had no D-id.
|
|
19
|
+
|
|
20
|
+
No breaking changes for end users. Internal architecture only — every
|
|
21
|
+
analyzer command (`health`, `vulnerabilities`, `bom`, etc.) produces
|
|
22
|
+
identical output before and after.
|
|
23
|
+
|
|
24
|
+
### Fixed
|
|
25
|
+
|
|
26
|
+
- **`graphify` "failed to run" in `health` and `quality` reports.** The
|
|
27
|
+
graphifyy@0.5.0 release renamed the result-dict key of `god_nodes()`
|
|
28
|
+
from `"edges"` to `"degree"` (same NetworkX node-degree semantic). The
|
|
29
|
+
Python script in `buildGraphifyScript` raised `KeyError: 'edges'`,
|
|
30
|
+
suppressed by the runner's `2>/dev/null`, surfacing only as
|
|
31
|
+
`Unavailable: graphify (failed to run)` in every health/quality
|
|
32
|
+
report — degrading complexity/cohesion/maintainability scoring
|
|
33
|
+
silently. One-line key rename. (`src/analyzers/tools/graphify.ts`)
|
|
34
|
+
|
|
35
|
+
- **`~/.dotnet` missing from `getSystemPaths()` auto-discovery.**
|
|
36
|
+
Microsoft's recommended non-sudo path is
|
|
37
|
+
`dotnet-install.sh --install-dir $HOME/.dotnet`. Without this entry
|
|
38
|
+
in the system-paths probe list, contributors and customers had to
|
|
39
|
+
manually export `PATH=$HOME/.dotnet:$PATH` before dxkit detected
|
|
40
|
+
dotnet. Added alongside the existing `~/.cargo/bin`, `~/go/bin`
|
|
41
|
+
entries. (`src/analyzers/tools/tool-registry.ts`)
|
|
42
|
+
|
|
43
|
+
- **`vyuh-dxkit doctor` was silently skipping all C# toolchain checks.**
|
|
44
|
+
The pre-LP toolchain-check section in `doctor.ts` had explicit
|
|
45
|
+
branches for python/go/node/rust but **no `if (manifest.config.languages.csharp)` clause** — so .NET
|
|
46
|
+
projects ran `doctor` and saw a clean bill of health regardless of
|
|
47
|
+
whether dotnet was installed. Pack-driven iteration (LP.1) auto-fixes
|
|
48
|
+
this: csharp pack now declares `cliBinaries: ['dotnet']` and doctor
|
|
49
|
+
surfaces missing dotnet on .NET projects. No D-id (discovered + fixed
|
|
50
|
+
in the same commit). (`src/doctor.ts`)
|
|
51
|
+
|
|
52
|
+
- **`cross-ecosystem.test.ts` was unusable on resource-constrained
|
|
53
|
+
developer machines** — 30 min wall-clock with 15 spurious failures
|
|
54
|
+
per run, blocking the progressive-regression workflow. Three root
|
|
55
|
+
causes:
|
|
56
|
+
|
|
57
|
+
1. Vitest 3.x's `pool: 'threads'` birpc channel between worker and
|
|
58
|
+
main starves under heavy concurrent subprocess fan-out (this suite
|
|
59
|
+
spawns ~22 network-bound child processes); workers can't ack
|
|
60
|
+
`onTaskUpdate` within 60s and vitest emits `Timeout calling
|
|
61
|
+
onTaskUpdate`, **failing completed-and-passing tests as a side
|
|
62
|
+
effect** (vitest #8164). 13 of the 15 prior "failures" were this
|
|
63
|
+
spurious RPC bug, not real assertion failures. Switched to
|
|
64
|
+
`pool: 'forks'` — each test file in its own child Node process,
|
|
65
|
+
no shared birpc channel.
|
|
66
|
+
2. `testTimeout: 60000` was tight on cold-cache machines; both real
|
|
67
|
+
non-spurious failures were `pip-audit` and `cargo-audit`
|
|
68
|
+
exceeding 60s on first run. Bumped to 180s.
|
|
69
|
+
3. The 22 subprocess invocations were redundant — multiple `it()`
|
|
70
|
+
blocks across the file invoked the same `node dxkit <report>
|
|
71
|
+
<fixture>` command. Added a per-(command, fixture) Promise-cache
|
|
72
|
+
so each fixture's vulnerability/quality/test-gaps report runs
|
|
73
|
+
once and is shared by all assertions; concurrent racing tests
|
|
74
|
+
receive the same in-flight promise. Cuts subprocess count ~50%.
|
|
75
|
+
|
|
76
|
+
Combined effect: full suite runs from **30 min with 15 spurious
|
|
77
|
+
failures** to **2:30 with zero**. (`vitest.config.ts`,
|
|
78
|
+
`test/integration/cross-ecosystem.test.ts`)
|
|
79
|
+
|
|
80
|
+
### Added
|
|
81
|
+
|
|
82
|
+
- **`npm run new-lang <id> "<displayName>"`** — language-pack
|
|
83
|
+
scaffolder. Generates the 7 recipe files (pack stub, test stub,
|
|
84
|
+
fixture skeleton, Claude rule file, template-config dir) and
|
|
85
|
+
updates `src/types.ts` (extends `LanguageId` union) plus
|
|
86
|
+
`src/languages/index.ts` (registers in `LANGUAGES`). Generated code
|
|
87
|
+
is type-safe by construction — no casts. Prints a next-steps
|
|
88
|
+
checklist for the work scaffolding can't automate (detect logic,
|
|
89
|
+
capability providers, fixture content, CI toolchain install,
|
|
90
|
+
CONTRIBUTING.md row). (`scripts/scaffold-language.js`,
|
|
91
|
+
`package.json`)
|
|
92
|
+
|
|
93
|
+
- **`scripts/check-architecture.sh`** — three new pre-commit + CI
|
|
94
|
+
rules enforcing pack-coupling discipline:
|
|
95
|
+
- LP-A1: no hardcoded `IF_<LANG>` references outside the
|
|
96
|
+
constants→generator pipeline
|
|
97
|
+
- LP-A2: no direct `config.languages.<id>` lookups outside the
|
|
98
|
+
registry-bridge files
|
|
99
|
+
- LP-A3: no hardcoded `<lang>.md` rule-file strings outside packs
|
|
100
|
+
- **`test/languages-contract.test.ts`** — five new per-pack tests:
|
|
101
|
+
metadata completeness (`permissions`, `cliBinaries`,
|
|
102
|
+
`defaultVersion`, `projectYamlBlock`) plus the **D009 reverse-direction
|
|
103
|
+
contract test** (every declared tool either invoked via TOOL_DEFS, by
|
|
104
|
+
shell-command literal, by `node_modules/.bin/<binary>` path, or on
|
|
105
|
+
the artifact-generating allowlist).
|
|
106
|
+
- **`test/recipe-playbook.test.ts`** — synthetic 6th-pack injection
|
|
107
|
+
test. Defines a mock `kotlin` pack, mutates the `LANGUAGES` registry
|
|
108
|
+
to include it, and asserts every pack-iterating consumer
|
|
109
|
+
(generator, doctor, detect, project-yaml, constants, coverage,
|
|
110
|
+
generic, grep-secrets, tool-registry) picks up its contributions.
|
|
111
|
+
Empirical guarantee that the architecture is pack-driven.
|
|
112
|
+
|
|
113
|
+
- **5 new `LanguageSupport` capabilities** for pack metadata that
|
|
114
|
+
consumers iterate (no per-language if-chains):
|
|
115
|
+
`permissions: string[]`, `ruleFile?: string`,
|
|
116
|
+
`templateFiles?: { template; output }[]`, `cliBinaries: string[]`,
|
|
117
|
+
`defaultVersion: string`, `versionKey?: keyof DetectedStack['versions']`,
|
|
118
|
+
`projectYamlBlock?: (ctx) => string`. Plus a coverage-parser capability
|
|
119
|
+
via direct ownership: per-language parsers (Istanbul, coverage.py,
|
|
120
|
+
Go cover-profile) moved out of `src/analyzers/tools/coverage.ts`
|
|
121
|
+
into their respective pack modules.
|
|
122
|
+
|
|
123
|
+
### Changed
|
|
124
|
+
|
|
125
|
+
- **`DetectedStack.languages`** — refactored from a fixed-shape
|
|
126
|
+
interface (`{ python, go, node, nextjs, rust, csharp }`) to
|
|
127
|
+
`Record<LanguageId, boolean>`. The `nextjs` flag moves out of
|
|
128
|
+
`languages` and is now exclusively the framework signal under the
|
|
129
|
+
top-level `framework: 'nextjs'` field — preserved in the legacy
|
|
130
|
+
`IF_NEXTJS` template variable for backwards compatibility.
|
|
131
|
+
|
|
132
|
+
Adding a 6th language pack now extends the `LanguageId` union once
|
|
133
|
+
and registers in `LANGUAGES`; **no fixed-shape interface to edit**.
|
|
134
|
+
This is the missing piece that makes the LP "7-file recipe" actually
|
|
135
|
+
7 files.
|
|
136
|
+
|
|
137
|
+
Programmatic consumers of the `detect()` function should note that
|
|
138
|
+
`stack.languages.node` and `stack.languages.nextjs` no longer exist;
|
|
139
|
+
instead, `stack.languages.typescript` is `true` for both Node and
|
|
140
|
+
Next.js projects (typescript pack matches any `package.json`), and
|
|
141
|
+
`stack.framework === 'nextjs'` distinguishes Next.js. The published
|
|
142
|
+
template variables `IF_NODE`, `IF_NEXTJS`, `NODE_VERSION` are
|
|
143
|
+
unchanged.
|
|
144
|
+
|
|
145
|
+
- **`generator.ts`, `doctor.ts`, `detect.ts`, `coverage.ts`,
|
|
146
|
+
`generic.ts`, `grep-secrets.ts`, `project-yaml.ts`, `constants.ts`,
|
|
147
|
+
`tool-registry.ts`** — all per-language if-chains replaced with
|
|
148
|
+
iteration over the `LANGUAGES` registry. 12 of the 14 LP-audit
|
|
149
|
+
items closed across these files (the audit doc lives in `tmp/` if
|
|
150
|
+
curious).
|
|
151
|
+
|
|
152
|
+
### Internal
|
|
153
|
+
|
|
154
|
+
- Phase 10i.0-LP closed audit items #1–#7, #9–#13 (the per-pack
|
|
155
|
+
if-chain cluster + the medium-structural cluster).
|
|
156
|
+
- Phase 10f.4 closed audit item #14 (`DetectedStack.languages`
|
|
157
|
+
interface refactor — the type-system surgery).
|
|
158
|
+
- D009 (declared-vs-used tool drift contract test) closed via the
|
|
159
|
+
reverse-direction test in `languages-contract.test.ts`.
|
|
160
|
+
|
|
10
161
|
## [2.4.2] - 2026-04-25
|
|
11
162
|
|
|
12
163
|
Phase 10i.0 — cross-ecosystem matrix completion. Establishes the
|
package/README.md
CHANGED
|
@@ -157,7 +157,15 @@ When present (typically written by `@vyuhlabs/create-devstack`), `dxkit init` re
|
|
|
157
157
|
|
|
158
158
|
## Language Support
|
|
159
159
|
|
|
160
|
-
Each language is a single `LanguageSupport` implementation in `src/languages/`.
|
|
160
|
+
Each language is a single `LanguageSupport` implementation in `src/languages/`. Detection, tools, coverage parsing, import extraction, and lint severity mapping live in one place per language.
|
|
161
|
+
|
|
162
|
+
Adding a new language is a single command followed by filling in TODO markers:
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
npm run new-lang kotlin "Kotlin (Android)"
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
This scaffolds the 7 recipe files (pack module, test stub, fixture skeleton, Claude rule file, template-config dir, plus `LanguageId` union extension and `LANGUAGES` registration). See [CONTRIBUTING.md](./CONTRIBUTING.md) for the full walkthrough. Recipe enforcement (architecture greps + contract tests + synthetic 6th-pack playbook) runs in pre-commit so packs that miss required metadata fail CI.
|
|
161
169
|
|
|
162
170
|
| Language | Detection | Coverage import | Import-graph | Native tools | Lint severity tiers | Vuln severity tiers |
|
|
163
171
|
| -------- | ------------------------------------ | ------------------- | -------------------------------------- | ----------------------------------- | ---------------------- | ----------------------------------- |
|
|
@@ -51,19 +51,8 @@ export interface Coverage {
|
|
|
51
51
|
* now (would need per-language file weighting).
|
|
52
52
|
*/
|
|
53
53
|
export declare function loadCoverage(cwd: string): Promise<Coverage | null>;
|
|
54
|
-
/**
|
|
55
|
-
export declare function
|
|
56
|
-
/**
|
|
57
|
-
export declare function
|
|
58
|
-
/** coverage.py JSON: `{ "totals": {...}, "files": { "path": { summary: {...} } } }`. */
|
|
59
|
-
export declare function parseCoveragePy(raw: string, sourceFile: string, cwd: string): Coverage;
|
|
60
|
-
/**
|
|
61
|
-
* Go coverprofile:
|
|
62
|
-
* mode: set
|
|
63
|
-
* pkg/path/file.go:5.2,10.1 3 1
|
|
64
|
-
*
|
|
65
|
-
* Each line: file:startLine.col,endLine.col numStatements count.
|
|
66
|
-
* A block is covered iff count > 0.
|
|
67
|
-
*/
|
|
68
|
-
export declare function parseGoCoverProfile(raw: string, sourceFile: string, cwd: string): Coverage;
|
|
54
|
+
/** Round to one decimal place. Used by every coverage parser for the linePercent contract. */
|
|
55
|
+
export declare function round1(n: number): number;
|
|
56
|
+
/** Turn an absolute or prefixed coverage path into a project-relative path. */
|
|
57
|
+
export declare function toRelative(p: string, cwd: string): string;
|
|
69
58
|
//# sourceMappingURL=coverage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coverage.d.ts","sourceRoot":"","sources":["../../../src/analyzers/tools/coverage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;
|
|
1
|
+
{"version":3,"file":"coverage.d.ts","sourceRoot":"","sources":["../../../src/analyzers/tools/coverage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAQH,MAAM,MAAM,cAAc,GACtB,kBAAkB,GAClB,gBAAgB,GAChB,aAAa,GACb,IAAI,GACJ,WAAW,GACX,MAAM,CAAC;AAEX,MAAM,WAAW,YAAY;IAC3B,6DAA6D;IAC7D,IAAI,EAAE,MAAM,CAAC;IACb,mCAAmC;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,4CAA4C;IAC5C,KAAK,EAAE,MAAM,CAAC;IACd,2DAA2D;IAC3D,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,QAAQ;IACvB,8BAA8B;IAC9B,MAAM,EAAE,cAAc,CAAC;IACvB,6CAA6C;IAC7C,UAAU,EAAE,MAAM,CAAC;IACnB,2DAA2D;IAC3D,WAAW,EAAE,MAAM,CAAC;IACpB,yDAAyD;IACzD,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;CAClC;AAED;;;;;;;;;GASG;AACH,wBAAsB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAQxE;AAUD,8FAA8F;AAC9F,wBAAgB,MAAM,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAExC;AAED,+EAA+E;AAC/E,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAUzD"}
|
|
@@ -20,47 +20,10 @@
|
|
|
20
20
|
* artifact exists or parsing fails; callers (tests analyzer) should
|
|
21
21
|
* treat a null return as "fall back to filename matching."
|
|
22
22
|
*/
|
|
23
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
24
|
-
if (k2 === undefined) k2 = k;
|
|
25
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
26
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
27
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
28
|
-
}
|
|
29
|
-
Object.defineProperty(o, k2, desc);
|
|
30
|
-
}) : (function(o, m, k, k2) {
|
|
31
|
-
if (k2 === undefined) k2 = k;
|
|
32
|
-
o[k2] = m[k];
|
|
33
|
-
}));
|
|
34
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
35
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
36
|
-
}) : function(o, v) {
|
|
37
|
-
o["default"] = v;
|
|
38
|
-
});
|
|
39
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
40
|
-
var ownKeys = function(o) {
|
|
41
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
42
|
-
var ar = [];
|
|
43
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
44
|
-
return ar;
|
|
45
|
-
};
|
|
46
|
-
return ownKeys(o);
|
|
47
|
-
};
|
|
48
|
-
return function (mod) {
|
|
49
|
-
if (mod && mod.__esModule) return mod;
|
|
50
|
-
var result = {};
|
|
51
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
52
|
-
__setModuleDefault(result, mod);
|
|
53
|
-
return result;
|
|
54
|
-
};
|
|
55
|
-
})();
|
|
56
23
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
57
24
|
exports.loadCoverage = loadCoverage;
|
|
58
|
-
exports.
|
|
59
|
-
exports.
|
|
60
|
-
exports.parseCoveragePy = parseCoveragePy;
|
|
61
|
-
exports.parseGoCoverProfile = parseGoCoverProfile;
|
|
62
|
-
const fs = __importStar(require("fs"));
|
|
63
|
-
const path = __importStar(require("path"));
|
|
25
|
+
exports.round1 = round1;
|
|
26
|
+
exports.toRelative = toRelative;
|
|
64
27
|
const languages_1 = require("../../languages");
|
|
65
28
|
const descriptors_1 = require("../../languages/capabilities/descriptors");
|
|
66
29
|
const dispatcher_1 = require("../dispatcher");
|
|
@@ -85,151 +48,14 @@ async function loadCoverage(cwd) {
|
|
|
85
48
|
const envelope = await dispatcher_1.defaultDispatcher.gather(cwd, descriptors_1.COVERAGE, providers);
|
|
86
49
|
return envelope?.coverage ?? null;
|
|
87
50
|
}
|
|
88
|
-
// ─── Parsers ────────────────────────────────────────────────────────────────
|
|
89
|
-
/** Istanbul coverage-summary.json: `{ "total": {...}, "/abs/path": {...} }`. */
|
|
90
|
-
function parseIstanbulSummary(raw, sourceFile, cwd) {
|
|
91
|
-
const data = JSON.parse(raw);
|
|
92
|
-
const files = new Map();
|
|
93
|
-
let totalCovered = 0;
|
|
94
|
-
let totalLines = 0;
|
|
95
|
-
for (const [key, entry] of Object.entries(data)) {
|
|
96
|
-
if (key === 'total')
|
|
97
|
-
continue;
|
|
98
|
-
const lines = entry?.lines;
|
|
99
|
-
if (!lines || typeof lines.covered !== 'number' || typeof lines.total !== 'number')
|
|
100
|
-
continue;
|
|
101
|
-
const rel = toRelative(key, cwd);
|
|
102
|
-
const fc = {
|
|
103
|
-
path: rel,
|
|
104
|
-
covered: lines.covered,
|
|
105
|
-
total: lines.total,
|
|
106
|
-
pct: round1(lines.total > 0 ? (lines.covered / lines.total) * 100 : 0),
|
|
107
|
-
};
|
|
108
|
-
files.set(rel, fc);
|
|
109
|
-
totalCovered += lines.covered;
|
|
110
|
-
totalLines += lines.total;
|
|
111
|
-
}
|
|
112
|
-
const total = data.total?.lines;
|
|
113
|
-
const linePercent = total && typeof total.pct === 'number'
|
|
114
|
-
? round1(total.pct)
|
|
115
|
-
: round1(totalLines > 0 ? (totalCovered / totalLines) * 100 : 0);
|
|
116
|
-
return { source: 'istanbul-summary', sourceFile, linePercent, files };
|
|
117
|
-
}
|
|
118
|
-
/** Istanbul coverage-final.json: `{ "/abs/path": { s: { "0": 1, "1": 0, ... }, statementMap: {...} } }`. */
|
|
119
|
-
function parseIstanbulFinal(raw, sourceFile, cwd) {
|
|
120
|
-
const data = JSON.parse(raw);
|
|
121
|
-
const files = new Map();
|
|
122
|
-
let totalCovered = 0;
|
|
123
|
-
let totalStatements = 0;
|
|
124
|
-
for (const [key, entry] of Object.entries(data)) {
|
|
125
|
-
const s = entry?.s;
|
|
126
|
-
if (!s || typeof s !== 'object')
|
|
127
|
-
continue;
|
|
128
|
-
const counts = Object.values(s);
|
|
129
|
-
const total = counts.length;
|
|
130
|
-
const covered = counts.filter((n) => typeof n === 'number' && n > 0).length;
|
|
131
|
-
const rel = toRelative(entry.path || key, cwd);
|
|
132
|
-
files.set(rel, {
|
|
133
|
-
path: rel,
|
|
134
|
-
covered,
|
|
135
|
-
total,
|
|
136
|
-
pct: round1(total > 0 ? (covered / total) * 100 : 0),
|
|
137
|
-
});
|
|
138
|
-
totalCovered += covered;
|
|
139
|
-
totalStatements += total;
|
|
140
|
-
}
|
|
141
|
-
return {
|
|
142
|
-
source: 'istanbul-final',
|
|
143
|
-
sourceFile,
|
|
144
|
-
linePercent: round1(totalStatements > 0 ? (totalCovered / totalStatements) * 100 : 0),
|
|
145
|
-
files,
|
|
146
|
-
};
|
|
147
|
-
}
|
|
148
|
-
/** coverage.py JSON: `{ "totals": {...}, "files": { "path": { summary: {...} } } }`. */
|
|
149
|
-
function parseCoveragePy(raw, sourceFile, cwd) {
|
|
150
|
-
const data = JSON.parse(raw);
|
|
151
|
-
const files = new Map();
|
|
152
|
-
let totalCovered = 0;
|
|
153
|
-
let totalStatements = 0;
|
|
154
|
-
for (const [key, entry] of Object.entries(data.files ?? {})) {
|
|
155
|
-
const summary = entry?.summary;
|
|
156
|
-
if (!summary)
|
|
157
|
-
continue;
|
|
158
|
-
const total = typeof summary.num_statements === 'number' ? summary.num_statements : 0;
|
|
159
|
-
const missing = typeof summary.missing_lines === 'number' ? summary.missing_lines : 0;
|
|
160
|
-
const covered = typeof summary.covered_lines === 'number'
|
|
161
|
-
? summary.covered_lines
|
|
162
|
-
: Math.max(0, total - missing);
|
|
163
|
-
const rel = toRelative(key, cwd);
|
|
164
|
-
files.set(rel, {
|
|
165
|
-
path: rel,
|
|
166
|
-
covered,
|
|
167
|
-
total,
|
|
168
|
-
pct: round1(typeof summary.percent_covered === 'number'
|
|
169
|
-
? summary.percent_covered
|
|
170
|
-
: total > 0
|
|
171
|
-
? (covered / total) * 100
|
|
172
|
-
: 0),
|
|
173
|
-
});
|
|
174
|
-
totalCovered += covered;
|
|
175
|
-
totalStatements += total;
|
|
176
|
-
}
|
|
177
|
-
const linePercent = typeof data.totals?.percent_covered === 'number'
|
|
178
|
-
? round1(data.totals.percent_covered)
|
|
179
|
-
: round1(totalStatements > 0 ? (totalCovered / totalStatements) * 100 : 0);
|
|
180
|
-
return { source: 'coverage-py', sourceFile, linePercent, files };
|
|
181
|
-
}
|
|
182
|
-
/**
|
|
183
|
-
* Go coverprofile:
|
|
184
|
-
* mode: set
|
|
185
|
-
* pkg/path/file.go:5.2,10.1 3 1
|
|
186
|
-
*
|
|
187
|
-
* Each line: file:startLine.col,endLine.col numStatements count.
|
|
188
|
-
* A block is covered iff count > 0.
|
|
189
|
-
*/
|
|
190
|
-
function parseGoCoverProfile(raw, sourceFile, cwd) {
|
|
191
|
-
const perFile = new Map();
|
|
192
|
-
let totalCovered = 0;
|
|
193
|
-
let totalStatements = 0;
|
|
194
|
-
for (const line of raw.split('\n')) {
|
|
195
|
-
if (!line || line.startsWith('mode:'))
|
|
196
|
-
continue;
|
|
197
|
-
// file:startLine.col,endLine.col numStatements count
|
|
198
|
-
const m = line.match(/^(.+):\d+\.\d+,\d+\.\d+\s+(\d+)\s+(\d+)$/);
|
|
199
|
-
if (!m)
|
|
200
|
-
continue;
|
|
201
|
-
const file = m[1];
|
|
202
|
-
const stmts = parseInt(m[2], 10);
|
|
203
|
-
const count = parseInt(m[3], 10);
|
|
204
|
-
const bucket = perFile.get(file) ?? { covered: 0, total: 0 };
|
|
205
|
-
bucket.total += stmts;
|
|
206
|
-
if (count > 0)
|
|
207
|
-
bucket.covered += stmts;
|
|
208
|
-
perFile.set(file, bucket);
|
|
209
|
-
totalStatements += stmts;
|
|
210
|
-
if (count > 0)
|
|
211
|
-
totalCovered += stmts;
|
|
212
|
-
}
|
|
213
|
-
const files = new Map();
|
|
214
|
-
for (const [key, { covered, total }] of perFile) {
|
|
215
|
-
// Go coverprofile uses module-relative paths (e.g. github.com/user/repo/pkg/foo.go).
|
|
216
|
-
// Strip the module prefix if it resolves to a real file in cwd.
|
|
217
|
-
const rel = resolveGoPath(key, cwd);
|
|
218
|
-
files.set(rel, {
|
|
219
|
-
path: rel,
|
|
220
|
-
covered,
|
|
221
|
-
total,
|
|
222
|
-
pct: round1(total > 0 ? (covered / total) * 100 : 0),
|
|
223
|
-
});
|
|
224
|
-
}
|
|
225
|
-
return {
|
|
226
|
-
source: 'go',
|
|
227
|
-
sourceFile,
|
|
228
|
-
linePercent: round1(totalStatements > 0 ? (totalCovered / totalStatements) * 100 : 0),
|
|
229
|
-
files,
|
|
230
|
-
};
|
|
231
|
-
}
|
|
232
51
|
// ─── Helpers ────────────────────────────────────────────────────────────────
|
|
52
|
+
//
|
|
53
|
+
// Per-language parsers (Istanbul/coverage.py/Go cover-profile/lcov/cobertura)
|
|
54
|
+
// moved into their respective `src/languages/<id>.ts` packs in Phase
|
|
55
|
+
// 10i.0-LP.4. coverage.ts now hosts only the shared types + small
|
|
56
|
+
// utilities the parsers depend on. Adding a 6th language's coverage
|
|
57
|
+
// format is a pack-local change — no edits to this file required.
|
|
58
|
+
/** Round to one decimal place. Used by every coverage parser for the linePercent contract. */
|
|
233
59
|
function round1(n) {
|
|
234
60
|
return Math.round(n * 10) / 10;
|
|
235
61
|
}
|
|
@@ -247,22 +73,4 @@ function toRelative(p, cwd) {
|
|
|
247
73
|
out = out.slice(2);
|
|
248
74
|
return out;
|
|
249
75
|
}
|
|
250
|
-
/**
|
|
251
|
-
* Go coverprofile paths look like `github.com/user/repo/pkg/foo.go`. If that
|
|
252
|
-
* file doesn't exist at cwd, try stripping leading segments until we find one
|
|
253
|
-
* that does. Fall back to the original string if nothing resolves.
|
|
254
|
-
*/
|
|
255
|
-
function resolveGoPath(p, cwd) {
|
|
256
|
-
const norm = p.replace(/\\/g, '/');
|
|
257
|
-
// Already relative and exists?
|
|
258
|
-
if (fs.existsSync(path.join(cwd, norm)))
|
|
259
|
-
return norm;
|
|
260
|
-
const parts = norm.split('/');
|
|
261
|
-
for (let i = 1; i < parts.length; i++) {
|
|
262
|
-
const candidate = parts.slice(i).join('/');
|
|
263
|
-
if (fs.existsSync(path.join(cwd, candidate)))
|
|
264
|
-
return candidate;
|
|
265
|
-
}
|
|
266
|
-
return norm;
|
|
267
|
-
}
|
|
268
76
|
//# sourceMappingURL=coverage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coverage.js","sourceRoot":"","sources":["../../../src/analyzers/tools/coverage.ts"],"names":[],"mappings":";AAAA;;;;;;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AAG,CAAC,UAAU,CAAC,OAAO,GAAG,GAAG,CAAC,EAAE,CAAC;QAClC,GAAG,GAAG,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACtC,CAAC;SAAM,IAAI,GAAG,KAAK,OAAO,EAAE,CAAC;QAC3B,GAAG,GAAG,EAAE,CAAC;IACX,CAAC;IACD,IAAI,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC;QAAE,GAAG,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAC7C,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generic.d.ts","sourceRoot":"","sources":["../../../src/analyzers/tools/generic.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"generic.d.ts","sourceRoot":"","sources":["../../../src/analyzers/tools/generic.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAqDzC,qDAAqD;AACrD,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CA4KxE"}
|
|
@@ -42,6 +42,7 @@ exports.gatherGenericMetrics = gatherGenericMetrics;
|
|
|
42
42
|
const fs = __importStar(require("fs"));
|
|
43
43
|
const runner_1 = require("./runner");
|
|
44
44
|
const exclusions_1 = require("./exclusions");
|
|
45
|
+
const languages_1 = require("../../languages");
|
|
45
46
|
// grepCount uses a narrow filter (node_modules, dist, __pycache__, .d.ts) to
|
|
46
47
|
// preserve pre-refactor byte-equality. The broader EXCLUDED_DIRS list from
|
|
47
48
|
// exclusions.ts is used for find-based counts. Widening this filter would
|
|
@@ -63,10 +64,26 @@ function grepCount(cwd, pattern, includes) {
|
|
|
63
64
|
}
|
|
64
65
|
// EXCLUDE moved inside gatherGenericMetrics() — must be computed per-cwd now
|
|
65
66
|
// so it picks up project-specific .gitignore / .dxkit-ignore entries.
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
67
|
+
// Pack-driven find expressions (Phase 10i.0-LP.3). Replaces the
|
|
68
|
+
// pre-LP hardcoded extension/pattern lists with iteration over the
|
|
69
|
+
// language registry. Adding a 6th pack auto-extends both expressions.
|
|
70
|
+
//
|
|
71
|
+
// Behavior expansions vs pre-LP.3 (both more correct than before):
|
|
72
|
+
// - `.mjs`/`.cjs` now counted as source files (TypeScript pack
|
|
73
|
+
// declared them in `sourceExtensions`; the legacy hardcoded list
|
|
74
|
+
// missed them).
|
|
75
|
+
// - Rust integration tests under `tests/*.rs` now counted as test
|
|
76
|
+
// files (Rust pack declared `tests/*.rs` as a path-anchored
|
|
77
|
+
// pattern; the legacy used only `-name` and skipped path patterns).
|
|
78
|
+
const SOURCE_EXTS = `\\( ${(0, languages_1.allSourceExtensions)()
|
|
79
|
+
.map((e) => `-name "*${e}"`)
|
|
80
|
+
.join(' -o ')} \\)`;
|
|
81
|
+
const TEST_PATTERNS = (() => {
|
|
82
|
+
const { nameOnly, pathAnchored } = (0, languages_1.splitTestFilePatterns)();
|
|
83
|
+
const nameClauses = nameOnly.map((p) => `-name "${p}"`);
|
|
84
|
+
const pathClauses = pathAnchored.map((p) => `-path "*/${p}"`);
|
|
85
|
+
return `\\( ${[...nameClauses, ...pathClauses].join(' -o ')} \\)`;
|
|
86
|
+
})();
|
|
70
87
|
/** Gather metrics using only built-in Unix tools. */
|
|
71
88
|
function gatherGenericMetrics(cwd) {
|
|
72
89
|
const EXCLUDE = (0, exclusions_1.getFindExcludeFlags)(cwd);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generic.js","sourceRoot":"","sources":["../../../src/analyzers/tools/generic.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"generic.js","sourceRoot":"","sources":["../../../src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AAW;QACX,MAAM;QACN,WAAW;QACX,aAAa;QACb,iBAAiB;QACjB,oBAAoB;QACpB,cAAc;QACd,gBAAgB;QAChB,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC;QACxC,gBAAgB,EAAE,EAAE;KACrB,CAAC;AACJ,CAAC"}
|
|
@@ -114,9 +114,9 @@ for n, d in functions:
|
|
|
114
114
|
|
|
115
115
|
max_file = file_funcs.most_common(1)[0] if file_funcs else ("", 0)
|
|
116
116
|
|
|
117
|
-
# God nodes
|
|
117
|
+
# God nodes: graphifyy@0.5.0 renamed the result key "edges" → "degree".
|
|
118
118
|
gods = god_nodes(G, top_n=50)
|
|
119
|
-
god_count = sum(1 for g in gods if g["
|
|
119
|
+
god_count = sum(1 for g in gods if g["degree"] > 15)
|
|
120
120
|
|
|
121
121
|
# Cohesion
|
|
122
122
|
scores = score_all(G, communities) if communities else {}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grep-secrets.d.ts","sourceRoot":"","sources":["../../../src/analyzers/tools/grep-secrets.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"grep-secrets.d.ts","sourceRoot":"","sources":["../../../src/analyzers/tools/grep-secrets.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAChF,OAAO,KAAK,EAAiB,aAAa,EAAE,MAAM,oCAAoC,CAAC;AA0BvF,4FAA4F;AAC5F,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CAyDzE;AAED,eAAO,MAAM,mBAAmB,EAAE,kBAAkB,CAAC,aAAa,CAKjE,CAAC"}
|
|
@@ -55,6 +55,7 @@ const tool_registry_1 = require("./tool-registry");
|
|
|
55
55
|
const exclusions_1 = require("./exclusions");
|
|
56
56
|
const paths_1 = require("./paths");
|
|
57
57
|
const suppressions_1 = require("./suppressions");
|
|
58
|
+
const languages_1 = require("../../languages");
|
|
58
59
|
/**
|
|
59
60
|
* Seven patterns that catch the most common hardcoded-secret shapes.
|
|
60
61
|
* Mirrors the set that lived in `generic.ts` pre-C.7, with identical
|
|
@@ -81,7 +82,15 @@ function gatherGrepSecretsResult(cwd) {
|
|
|
81
82
|
if (gitleaks.available)
|
|
82
83
|
return null;
|
|
83
84
|
const excludes = (0, exclusions_1.getGrepExcludeDirFlags)(cwd);
|
|
84
|
-
|
|
85
|
+
// Pack-driven include flags (Phase 10i.0-LP.3). Replaces the prior
|
|
86
|
+
// hardcoded `.ts/.tsx/.js/.py/.go` set with all packs'
|
|
87
|
+
// `sourceExtensions`. Behavior expansion: `.cs` and `.rs` files are
|
|
88
|
+
// now scanned for secrets when gitleaks is unavailable. The legacy
|
|
89
|
+
// hardcoded set was a subset oversight — gitleaks (the primary
|
|
90
|
+
// scanner) covers all file types, so the fallback should too.
|
|
91
|
+
const includeFlags = (0, languages_1.allSourceExtensions)()
|
|
92
|
+
.map((e) => `--include='*${e}'`)
|
|
93
|
+
.join(' ');
|
|
85
94
|
const raw = [];
|
|
86
95
|
for (const sp of PATTERNS) {
|
|
87
96
|
// Single-quoted pattern + -E for extended regex. Per the feedback memory.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grep-secrets.js","sourceRoot":"","sources":["../../../src/analyzers/tools/grep-secrets.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"grep-secrets.js","sourceRoot":"","sources":["../../../src/analyzers/tools/grep-secrets.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiDA,0DAyDC;AA1GD;;;;;;;;;;;;;GAaG;AACH,2CAA6B;AAC7B,qCAA+B;AAC/B,mDAAsD;AACtD,6CAAsE;AACtE,mCAA4C;AAC5C,iDAAqE;AACrE,+CAAsD;AAStD;;;;GAIG;AACH,MAAM,QAAQ,G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AC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CACd,CAAC;IAEF,OAAO;QACL,aAAa,EAAE,CAAC;QAChB,IAAI,EAAE,cAAc;QACpB,QAAQ,EAAE,IAAI;QACd,eAAe,EAAE,UAAU,CAAC,MAAM;KACnC,CAAC;AACJ,CAAC;AAEY,QAAA,mBAAmB,GAAsC;IACpE,MAAM,EAAE,cAAc;IACtB,KAAK,CAAC,MAAM,CAAC,GAAG;QACd,OAAO,uBAAuB,CAAC,GAAG,CAAC,CAAC;IACtC,CAAC;CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-registry.d.ts","sourceRoot":"","sources":["../../../src/analyzers/tools/tool-registry.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tool-registry.d.ts","sourceRoot":"","sources":["../../../src/analyzers/tools/tool-registry.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE7D;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,UAAU,QAA2D,CAAC;AA2BnF,MAAM,WAAW,cAAe,SAAQ,eAAe;IACrD,4DAA4D;IAC5D,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,mEAAmE;IACnE,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0CAA0C;IAC1C,eAAe,EAAE;QACf,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,oEAAoE;IACpE,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,OAAO,CAAC;IACnB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,OAAO,E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