projscan 3.0.0 → 3.0.2
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 +24 -24
- package/dist/cli/commands/dataflow.js +6 -1
- package/dist/cli/commands/dataflow.js.map +1 -1
- package/dist/core/agentBrief.js +31 -1
- package/dist/core/agentBrief.js.map +1 -1
- package/dist/core/dataflow.d.ts +4 -0
- package/dist/core/dataflow.js +91 -8
- package/dist/core/dataflow.js.map +1 -1
- package/dist/core/dataflowFilters.d.ts +10 -0
- package/dist/core/dataflowFilters.js +46 -0
- package/dist/core/dataflowFilters.js.map +1 -0
- package/dist/core/graphCorpus.d.ts +5 -0
- package/dist/core/graphCorpus.js +46 -0
- package/dist/core/graphCorpus.js.map +1 -0
- package/dist/core/impact.d.ts +3 -0
- package/dist/core/impact.js +46 -2
- package/dist/core/impact.js.map +1 -1
- package/dist/core/issueEngine.js +25 -1
- package/dist/core/issueEngine.js.map +1 -1
- package/dist/core/ownership.d.ts +3 -0
- package/dist/core/ownership.js +84 -0
- package/dist/core/ownership.js.map +1 -0
- package/dist/core/plugins.d.ts +10 -3
- package/dist/core/plugins.js +2 -2
- package/dist/core/plugins.js.map +1 -1
- package/dist/core/preflight.js +75 -6
- package/dist/core/preflight.js.map +1 -1
- package/dist/core/releaseTrain.js +68 -0
- package/dist/core/releaseTrain.js.map +1 -1
- package/dist/core/review.js +29 -20
- package/dist/core/review.js.map +1 -1
- package/dist/core/reviewDataflow.d.ts +6 -0
- package/dist/core/reviewDataflow.js +21 -0
- package/dist/core/reviewDataflow.js.map +1 -0
- package/dist/core/taint.js +35 -6
- package/dist/core/taint.js.map +1 -1
- package/dist/core/watcher.d.ts +2 -2
- package/dist/core/watcher.js +103 -17
- package/dist/core/watcher.js.map +1 -1
- package/dist/core/workplan.js +6 -6
- package/dist/core/workplan.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/mcp/tools/dataflow.js +12 -1
- package/dist/mcp/tools/dataflow.js.map +1 -1
- package/dist/mcp/tools/impact.js +12 -7
- package/dist/mcp/tools/impact.js.map +1 -1
- package/dist/projscan-sbom.cdx.json +6 -6
- package/dist/tool-manifest.json +10 -2
- package/dist/types.d.ts +50 -2
- package/docs/PLUGIN-AUTHORING.md +11 -3
- package/docs/PLUGIN-GALLERY.md +8 -0
- package/docs/examples/plugins/graph-context.mjs +27 -0
- package/docs/examples/plugins/graph-context.projscan-plugin.json +8 -0
- package/package.json +3 -2
package/dist/types.d.ts
CHANGED
|
@@ -212,7 +212,7 @@ export interface HealthScore {
|
|
|
212
212
|
}
|
|
213
213
|
export type PreflightMode = 'before_edit' | 'before_commit' | 'before_merge';
|
|
214
214
|
export type PreflightVerdict = 'proceed' | 'caution' | 'block';
|
|
215
|
-
export type PreflightReasonSource = 'doctor' | 'review' | 'taint' | 'session' | 'plugin' | 'supply-chain' | 'memory' | 'changed-files' | 'hotspots' | 'git' | 'format';
|
|
215
|
+
export type PreflightReasonSource = 'doctor' | 'review' | 'taint' | 'session' | 'plugin' | 'supply-chain' | 'memory' | 'changed-files' | 'hotspots' | 'git' | 'format' | 'release';
|
|
216
216
|
export interface PreflightReason {
|
|
217
217
|
severity: IssueSeverity;
|
|
218
218
|
source: PreflightReasonSource;
|
|
@@ -232,6 +232,15 @@ export interface PreflightSuggestedAction {
|
|
|
232
232
|
tool?: string;
|
|
233
233
|
args?: Record<string, unknown>;
|
|
234
234
|
}
|
|
235
|
+
export interface PreflightReleaseScaleEvidence {
|
|
236
|
+
detected: boolean;
|
|
237
|
+
changedFiles: number;
|
|
238
|
+
threshold: number;
|
|
239
|
+
reviewVerdict?: ReviewReport['verdict'];
|
|
240
|
+
reviewSummary?: string;
|
|
241
|
+
concreteBlockers: string[];
|
|
242
|
+
explanation: string;
|
|
243
|
+
}
|
|
235
244
|
export interface PreflightEvidence {
|
|
236
245
|
health?: {
|
|
237
246
|
score: number;
|
|
@@ -274,6 +283,7 @@ export interface PreflightEvidence {
|
|
|
274
283
|
errorIssues: number;
|
|
275
284
|
warningIssues: number;
|
|
276
285
|
};
|
|
286
|
+
releaseScale?: PreflightReleaseScaleEvidence;
|
|
277
287
|
}
|
|
278
288
|
export interface PreflightReport {
|
|
279
289
|
schemaVersion: 1;
|
|
@@ -290,7 +300,7 @@ export interface PreflightReport {
|
|
|
290
300
|
export type WorkplanMode = PreflightMode | 'refactor' | 'release' | 'bug_hunt' | 'hardening';
|
|
291
301
|
export type WorkplanPriority = 'p0' | 'p1' | 'p2';
|
|
292
302
|
export interface WorkplanEvidence {
|
|
293
|
-
source: PreflightReasonSource | 'coordination' | 'release' | 'verification';
|
|
303
|
+
source: PreflightReasonSource | 'coordination' | 'release' | 'verification' | 'graph';
|
|
294
304
|
message: string;
|
|
295
305
|
severity?: IssueSeverity;
|
|
296
306
|
file?: string;
|
|
@@ -477,6 +487,16 @@ export interface AgentBriefGuardrail {
|
|
|
477
487
|
reason: string;
|
|
478
488
|
command: string;
|
|
479
489
|
}
|
|
490
|
+
export interface GraphEvidenceSummary {
|
|
491
|
+
schemaVersion: 1;
|
|
492
|
+
changedFiles?: number;
|
|
493
|
+
changedFunctions?: number;
|
|
494
|
+
totalFunctions: number;
|
|
495
|
+
totalPackages: number;
|
|
496
|
+
totalCallEdges: number;
|
|
497
|
+
dataflowRisks: number;
|
|
498
|
+
topPackages: string[];
|
|
499
|
+
}
|
|
480
500
|
export interface AgentBriefReport {
|
|
481
501
|
schemaVersion: 1;
|
|
482
502
|
intent: AgentBriefIntent;
|
|
@@ -491,12 +511,29 @@ export interface AgentBriefReport {
|
|
|
491
511
|
}>;
|
|
492
512
|
touchedFiles: string[];
|
|
493
513
|
conflicts: number;
|
|
514
|
+
graph?: GraphEvidenceSummary;
|
|
494
515
|
};
|
|
495
516
|
focus: AgentBriefItem[];
|
|
496
517
|
guardrails: AgentBriefGuardrail[];
|
|
497
518
|
suggestedNextActions: PreflightSuggestedAction[];
|
|
498
519
|
truncated?: boolean;
|
|
499
520
|
}
|
|
521
|
+
export interface GraphCorpusFixtureMetrics {
|
|
522
|
+
name: string;
|
|
523
|
+
fixture: string;
|
|
524
|
+
files: number;
|
|
525
|
+
functions: number;
|
|
526
|
+
packages: number;
|
|
527
|
+
symbols: number;
|
|
528
|
+
importEdges: number;
|
|
529
|
+
callEdges: number;
|
|
530
|
+
dataflowRisks: number;
|
|
531
|
+
}
|
|
532
|
+
export interface GraphCorpusReport {
|
|
533
|
+
schemaVersion: 1;
|
|
534
|
+
fixtures: GraphCorpusFixtureMetrics[];
|
|
535
|
+
totals: Omit<GraphCorpusFixtureMetrics, 'name' | 'fixture'>;
|
|
536
|
+
}
|
|
500
537
|
export type QualityScorecardVerdict = 'excellent' | 'healthy' | 'needs_attention' | 'blocked';
|
|
501
538
|
export type QualityScorecardStatus = 'pass' | 'watch' | 'fail';
|
|
502
539
|
export interface QualityScorecardDimension {
|
|
@@ -1139,6 +1176,8 @@ export interface ReviewReport {
|
|
|
1139
1176
|
* legacy source-to-sink taint flow list. Empty when unavailable or clean.
|
|
1140
1177
|
*/
|
|
1141
1178
|
newDataflowRisks: ReviewDataflowRisk[];
|
|
1179
|
+
/** 3.5+ — compact graph/dataflow evidence for review consumers. */
|
|
1180
|
+
graphEvidence?: GraphEvidenceSummary;
|
|
1142
1181
|
/** 'ok' = ship it; 'review' = needs careful look; 'block' = strongly suggests rework. */
|
|
1143
1182
|
verdict: 'ok' | 'review' | 'block';
|
|
1144
1183
|
/** One-line bullets explaining the verdict. */
|
|
@@ -1189,6 +1228,13 @@ export interface ImpactNode {
|
|
|
1189
1228
|
*/
|
|
1190
1229
|
repo?: string;
|
|
1191
1230
|
}
|
|
1231
|
+
export interface ImpactBoundarySummary {
|
|
1232
|
+
repo: string;
|
|
1233
|
+
packageName: string;
|
|
1234
|
+
owner: string;
|
|
1235
|
+
files: string[];
|
|
1236
|
+
reachableFiles: number;
|
|
1237
|
+
}
|
|
1192
1238
|
export interface ImpactReport {
|
|
1193
1239
|
available: boolean;
|
|
1194
1240
|
reason?: string;
|
|
@@ -1219,6 +1265,8 @@ export interface ImpactReport {
|
|
|
1219
1265
|
* was false or the workspace had no siblings.
|
|
1220
1266
|
*/
|
|
1221
1267
|
totalReachableByRepo?: Record<string, number>;
|
|
1268
|
+
/** 3.5+ — cross-repo package/ownership boundaries that mention the target. */
|
|
1269
|
+
boundarySummary?: ImpactBoundarySummary[];
|
|
1222
1270
|
/**
|
|
1223
1271
|
* True when traversal hit `maxDistance` before exhausting the graph.
|
|
1224
1272
|
* Items beyond the limit are omitted from `reachable`.
|
package/docs/PLUGIN-AUTHORING.md
CHANGED
|
@@ -65,7 +65,7 @@ The machine-readable manifest schema lives at
|
|
|
65
65
|
[`docs/examples/plugins/`](examples/plugins/) are tested in CI.
|
|
66
66
|
|
|
67
67
|
For packaged examples you can copy into a repo, see the
|
|
68
|
-
[Plugin Gallery](PLUGIN-GALLERY.md). It includes policy, team health, security,
|
|
68
|
+
[Plugin Gallery](PLUGIN-GALLERY.md). It includes policy, graph-context, team health, security,
|
|
69
69
|
and release-readiness examples.
|
|
70
70
|
|
|
71
71
|
## Scaffold
|
|
@@ -84,8 +84,8 @@ It refuses to overwrite existing files.
|
|
|
84
84
|
|
|
85
85
|
## Analyzer Module
|
|
86
86
|
|
|
87
|
-
The module must export a `check(rootPath, files)` function, either as the
|
|
88
|
-
default export or a named export.
|
|
87
|
+
The module must export a `check(rootPath, files, context?)` function, either as the
|
|
88
|
+
default export or a named export. The optional third argument exposes lazy read-only graph helpers for analyzers that need deeper context.
|
|
89
89
|
|
|
90
90
|
```js
|
|
91
91
|
export default {
|
|
@@ -117,6 +117,14 @@ Required issue fields:
|
|
|
117
117
|
|
|
118
118
|
Malformed issues are dropped so one bad plugin cannot poison the issue stream.
|
|
119
119
|
|
|
120
|
+
The analyzer `context` argument currently exposes:
|
|
121
|
+
|
|
122
|
+
- `getCodeGraph()`: the underlying code graph used by core analysis.
|
|
123
|
+
- `getSemanticGraph()`: the stable v3 semantic graph payload.
|
|
124
|
+
- `getDataflow()`: the focused dataflow report.
|
|
125
|
+
|
|
126
|
+
The packaged `graph-context` example under `docs/examples/plugins/` demonstrates the pattern without requiring a manifest schema bump.
|
|
127
|
+
|
|
120
128
|
## Reporter Module
|
|
121
129
|
|
|
122
130
|
Reporter plugins are CLI-only. The module must export a
|
package/docs/PLUGIN-GALLERY.md
CHANGED
|
@@ -32,6 +32,14 @@ Files:
|
|
|
32
32
|
- `docs/examples/plugins/security-radar.projscan-plugin.json`
|
|
33
33
|
- `docs/examples/plugins/security-radar.mjs`
|
|
34
34
|
|
|
35
|
+
### `graph-context`
|
|
36
|
+
|
|
37
|
+
Demonstrates analyzer access to the optional graph/dataflow context. It reads the semantic graph and dataflow report through `context.getSemanticGraph()` and `context.getDataflow()` and emits a compact architecture summary issue.
|
|
38
|
+
|
|
39
|
+
Files:
|
|
40
|
+
- `docs/examples/plugins/graph-context.projscan-plugin.json`
|
|
41
|
+
- `docs/examples/plugins/graph-context.mjs`
|
|
42
|
+
|
|
35
43
|
## Reporter Plugins
|
|
36
44
|
|
|
37
45
|
### `team-radar`
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
check: async (_rootPath, files, context) => {
|
|
3
|
+
if (!context) return [];
|
|
4
|
+
|
|
5
|
+
const [semanticGraph, dataflow] = await Promise.all([
|
|
6
|
+
context.getSemanticGraph(),
|
|
7
|
+
context.getDataflow(),
|
|
8
|
+
]);
|
|
9
|
+
|
|
10
|
+
const severity = dataflow.riskCount > 0 ? 'warning' : 'info';
|
|
11
|
+
const fileCount = files.length;
|
|
12
|
+
const functionCount = semanticGraph.metrics.totalFunctions;
|
|
13
|
+
const callEdges = semanticGraph.metrics.totalEdges;
|
|
14
|
+
|
|
15
|
+
return [
|
|
16
|
+
{
|
|
17
|
+
id: 'graph-context-summary',
|
|
18
|
+
title: 'Graph context available',
|
|
19
|
+
description:
|
|
20
|
+
`Plugin received ${fileCount} file(s), ${functionCount} function(s), ${callEdges} semantic edge(s), and ${dataflow.riskCount} dataflow risk(s).`,
|
|
21
|
+
severity,
|
|
22
|
+
category: 'architecture',
|
|
23
|
+
fixAvailable: false,
|
|
24
|
+
},
|
|
25
|
+
];
|
|
26
|
+
},
|
|
27
|
+
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "projscan",
|
|
3
3
|
"mcpName": "io.github.abhiyoheswaran1/projscan",
|
|
4
|
-
"version": "3.0.
|
|
4
|
+
"version": "3.0.2",
|
|
5
5
|
"description": "Agent-first code intelligence. MCP server (2025-03-26) with AST parsing for JavaScript, TypeScript, Python, Go, Java, Ruby, Rust, PHP, C#, Kotlin, Swift, and C++; stable v3 semantic graph (projscan_semantic_graph), dataflow risk engine with bridge-helper detection (projscan_dataflow), code graph, file + per-function AST cyclomatic complexity, per-function fan-in + fan-out, coupling + cycle detection, structural PR diff with HTML reporter, coverage report with HTML reporter, intent-grounded one-call PR review (projscan_review with optional `intent` arg, new taint flows, contract changes, and newDataflowRisks) and long-running PR-watch mode with structured per-bucket deltas (projscan_review_watch), agent workplans (projscan_workplan), bug-hunt queues (projscan_bug_hunt), product-line planning (projscan_release_train), evidence packs (projscan_evidence_pack), regression planning (projscan_regression_plan), agent briefs (projscan_agent_brief), quality scorecards (projscan_quality_scorecard), and preflight with supply-chain IOC evidence, rule-driven fix suggestions + mechanical apply layer with rollback (projscan_apply_fix, projscan_fix_suggest, projscan_explain_issue), source-to-sink taint analysis (projscan_taint) with truncation reporting, transitive blast-radius analysis with cross-repo mode (projscan_impact for files and symbols), cross-repo workspace registration + intelligence (projscan_workspace_graph), per-function semantic search chunks (sub-file embeddings), per-rule confidence + severity drift + cost-summary analytics with live streaming (projscan_cost_summary), stable local analyzer + reporter plugin API (projscan_plugin, CLI --reporter, opt-in via PROJSCAN_PLUGINS_PREVIEW=1), monorepo workspace awareness with cross-package import policy + per-package dependencies / outdated / audit, BM25 + optional semantic search, cursor pagination, progress notifications, context-budgeted output, and a stable-surface CI guard. CLI on the side.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./dist/index.js",
|
|
@@ -32,7 +32,8 @@
|
|
|
32
32
|
"release:check": "node scripts/release-check.mjs",
|
|
33
33
|
"security:release-gate": "node scripts/release-gate.mjs",
|
|
34
34
|
"sbom:generate": "node scripts/generate-sbom.mjs",
|
|
35
|
-
"prepare": "npm run build"
|
|
35
|
+
"prepare": "npm run build",
|
|
36
|
+
"check:graph-corpus": "node scripts/check-graph-corpus.mjs"
|
|
36
37
|
},
|
|
37
38
|
"keywords": [
|
|
38
39
|
"cli",
|