projscan 1.8.0 → 1.9.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.
@@ -5,7 +5,7 @@ const MIN_INTERVAL_S = 5;
5
5
  const MAX_INTERVAL_S = 600;
6
6
  export const reviewWatchTool = {
7
7
  name: 'projscan_review_watch',
8
- description: 'Long-running PR review. Polls a base+head ref pair on an interval and emits a notifications/projscan/pr_changed notification whenever the review verdict, SHAs, flow count, or risky-function set changes. Pairs with projscan_review (one-shot) — use this when an agent wants to react to pushes on a PR without re-asking. Actions: start (returns initial review + watchId) / stop / list.',
8
+ description: 'Long-running PR review. Polls a base+head ref pair on an interval and emits a notifications/projscan/pr_changed notification whenever the review verdict, SHAs, cycle set, dep changes, taint flows, or risky-function set changes. 1.9+: the notification carries a structured `delta` describing exactly which buckets moved (verdict/baseSha/headSha/changedFiles/cycles/risky/taint/deps) and counts of newly-appearing items per bucket, so agents can skip work they do not need. Pairs with projscan_review (one-shot) — use this when an agent wants to react to pushes on a PR without re-asking. Actions: start (returns initial review + watchId) / stop / list.',
9
9
  inputSchema: {
10
10
  type: 'object',
11
11
  properties: {
@@ -54,7 +54,8 @@ async function startWatch(args, rootPath, context) {
54
54
  // Initial review — synchronous, returned with the response so the agent
55
55
  // gets a useful payload right away and can react before the first tick.
56
56
  const initial = await computeReview(rootPath, { base, head });
57
- const initialSignature = signatureOf(initial);
57
+ const initialSnapshot = snapshotOf(initial);
58
+ const initialSignature = signatureOf(initialSnapshot);
58
59
  if (!context?.registerWatch || !context.notify) {
59
60
  // Caller is in a transport without a notify channel (CLI smoke,
60
61
  // tests). Return the initial review with a clear note that no
@@ -95,6 +96,7 @@ async function startWatch(args, rootPath, context) {
95
96
  startedAt: new Date().toISOString(),
96
97
  ticks: 0,
97
98
  lastSignature: initialSignature,
99
+ lastSnapshot: initialSnapshot,
98
100
  lastReportAt: new Date().toISOString(),
99
101
  inFlight: false,
100
102
  });
@@ -141,10 +143,17 @@ async function runTick(rootPath, watchId, base, head, context) {
141
143
  context.notify?.('notifications/projscan/pr_review_error', { watchId, error: message });
142
144
  return;
143
145
  }
144
- const sig = signatureOf(report);
146
+ const snapshot = snapshotOf(report);
147
+ const sig = signatureOf(snapshot);
145
148
  if (sig === state.lastSignature)
146
149
  return; // unchanged — silent
150
+ // 1.9+ — diff against the previous snapshot so the notification
151
+ // tells the agent *what kind* of change triggered it. Lets the
152
+ // agent skip work it doesn't need: e.g. dep-only changes don't
153
+ // need a full review re-read; verdict changes do.
154
+ const delta = diffSnapshots(state.lastSnapshot, snapshot);
147
155
  state.lastSignature = sig;
156
+ state.lastSnapshot = snapshot;
148
157
  state.lastReportAt = new Date().toISOString();
149
158
  context.notify?.('notifications/projscan/pr_changed', {
150
159
  watchId,
@@ -152,6 +161,7 @@ async function runTick(rootPath, watchId, base, head, context) {
152
161
  head: report.head?.ref ?? head ?? null,
153
162
  baseSha: report.base?.resolvedSha ?? null,
154
163
  headSha: report.head?.resolvedSha ?? null,
164
+ delta,
155
165
  report,
156
166
  });
157
167
  }
@@ -197,21 +207,136 @@ function listWatches() {
197
207
  };
198
208
  }
199
209
  /**
200
- * A change-detection signature: tracks the bits of the review the
201
- * agent cares about (verdict, SHAs, flow / risky-fn counts and names).
202
- * Two ticks with identical signatures are silent; a delta on any of
203
- * these triggers a `pr_changed` notification with the full report.
210
+ * 1.9+ — Capture the change-detection-relevant slice of a review.
211
+ * Replaces 1.8's `signatureOf(report) string` so we can both compare
212
+ * ticks for equality AND compute a structured delta when they differ.
213
+ *
214
+ * Cycles use a sorted-files fingerprint, dependency changes are split
215
+ * into adds / removes / bumps. Risky-function keys carry both file and
216
+ * name so renames in unchanged files surface, and so two functions
217
+ * with the same anonymous name in different files don't collapse.
204
218
  */
205
- function signatureOf(report) {
206
- const parts = [];
207
- parts.push(report.verdict ?? '');
208
- parts.push(report.base?.resolvedSha ?? '');
209
- parts.push(report.head?.resolvedSha ?? '');
210
- parts.push(String(report.changedFiles?.length ?? 0));
211
- parts.push(String(report.newTaintFlows?.length ?? 0));
212
- const risky = (report.riskyFunctions ?? []).map((f) => f.name).sort().join(',');
213
- parts.push(risky);
214
- return parts.join('|');
219
+ function snapshotOf(report) {
220
+ const cycleKeys = (report.newCycles ?? [])
221
+ .map((c) => [...c.files].sort().join('|'))
222
+ .sort();
223
+ const taintFlowKeys = (report.newTaintFlows ?? [])
224
+ .map((f) => `${f.sourceFn}::${f.sinkFn}`)
225
+ .sort();
226
+ const riskyFunctionKeys = (report.riskyFunctions ?? [])
227
+ .map((f) => `${f.file}::${f.name}`)
228
+ .sort();
229
+ const depAdds = [];
230
+ const depRemoves = [];
231
+ const depBumps = [];
232
+ for (const change of report.dependencyChanges ?? []) {
233
+ for (const a of change.added) {
234
+ depAdds.push(`${change.manifestFile}::${a.name}::${a.kind}::${a.version}`);
235
+ }
236
+ for (const r of change.removed) {
237
+ depRemoves.push(`${change.manifestFile}::${r.name}::${r.kind}::${r.version}`);
238
+ }
239
+ for (const b of change.bumped) {
240
+ depBumps.push(`${change.manifestFile}::${b.name}::${b.kind}::${b.from}->${b.to}`);
241
+ }
242
+ }
243
+ depAdds.sort();
244
+ depRemoves.sort();
245
+ depBumps.sort();
246
+ return {
247
+ verdict: report.verdict ?? '',
248
+ baseSha: report.base?.resolvedSha ?? null,
249
+ headSha: report.head?.resolvedSha ?? null,
250
+ changedFilesCount: report.changedFiles?.length ?? 0,
251
+ taintFlowKeys,
252
+ riskyFunctionKeys,
253
+ cycleKeys,
254
+ depAdds,
255
+ depRemoves,
256
+ depBumps,
257
+ };
258
+ }
259
+ /**
260
+ * Serialize a snapshot into a stable comparison key. Used only for
261
+ * the fast "did anything change?" check — the structured delta is
262
+ * computed separately via diffSnapshots.
263
+ */
264
+ function signatureOf(snapshot) {
265
+ return JSON.stringify(snapshot);
266
+ }
267
+ /**
268
+ * 1.9+ — Structured diff between two watch snapshots. Counts items
269
+ * that moved into or out of each bucket, and records which buckets
270
+ * had any change at all. Caller embeds this in the `delta` field of
271
+ * the `notifications/projscan/pr_changed` payload so agents can react
272
+ * to a specific dimension without re-reading the full report.
273
+ *
274
+ * `prev` may be null for the very first emitted notification — in
275
+ * that case every non-empty bucket is reported as an "added" delta
276
+ * against an empty baseline.
277
+ */
278
+ function diffSnapshots(prev, next) {
279
+ const prevCycles = new Set(prev?.cycleKeys ?? []);
280
+ const nextCycles = new Set(next.cycleKeys);
281
+ const prevTaint = new Set(prev?.taintFlowKeys ?? []);
282
+ const nextTaint = new Set(next.taintFlowKeys);
283
+ const prevRisky = new Set(prev?.riskyFunctionKeys ?? []);
284
+ const nextRisky = new Set(next.riskyFunctionKeys);
285
+ const prevDepAdds = new Set(prev?.depAdds ?? []);
286
+ const nextDepAdds = new Set(next.depAdds);
287
+ const prevDepRemoves = new Set(prev?.depRemoves ?? []);
288
+ const nextDepRemoves = new Set(next.depRemoves);
289
+ const prevDepBumps = new Set(prev?.depBumps ?? []);
290
+ const nextDepBumps = new Set(next.depBumps);
291
+ const cycles = setDiffCounts(prevCycles, nextCycles);
292
+ const taint = setDiffCounts(prevTaint, nextTaint);
293
+ const risky = setDiffCounts(prevRisky, nextRisky);
294
+ const depAddsDiff = setDiffCounts(prevDepAdds, nextDepAdds);
295
+ const depRemovesDiff = setDiffCounts(prevDepRemoves, nextDepRemoves);
296
+ const depBumpsDiff = setDiffCounts(prevDepBumps, nextDepBumps);
297
+ // Each dep-bucket counter reports records that NEWLY appeared. We
298
+ // intentionally don't roll up reverts (records that vanished from a
299
+ // bucket since last tick); they fire `changeKinds.push('deps')` so
300
+ // the agent knows a dep-bucket moved, but counting them would
301
+ // conflate "PR newly adds foo" with "PR no longer removes foo",
302
+ // which mean different things to the reviewer.
303
+ const deps = {
304
+ added: depAddsDiff.added,
305
+ removed: depRemovesDiff.added,
306
+ bumped: depBumpsDiff.added,
307
+ };
308
+ const depsChanged = depAddsDiff.added + depAddsDiff.removed +
309
+ depRemovesDiff.added + depRemovesDiff.removed +
310
+ depBumpsDiff.added + depBumpsDiff.removed > 0;
311
+ const changeKinds = [];
312
+ if (!prev || prev.verdict !== next.verdict)
313
+ changeKinds.push('verdict');
314
+ if (!prev || prev.baseSha !== next.baseSha)
315
+ changeKinds.push('baseSha');
316
+ if (!prev || prev.headSha !== next.headSha)
317
+ changeKinds.push('headSha');
318
+ if (!prev || prev.changedFilesCount !== next.changedFilesCount)
319
+ changeKinds.push('changedFiles');
320
+ if (cycles.added + cycles.removed > 0)
321
+ changeKinds.push('cycles');
322
+ if (risky.added + risky.removed > 0)
323
+ changeKinds.push('risky');
324
+ if (taint.added + taint.removed > 0)
325
+ changeKinds.push('taint');
326
+ if (depsChanged)
327
+ changeKinds.push('deps');
328
+ return { changeKinds, cycles, risky, taint, deps };
329
+ }
330
+ function setDiffCounts(prev, next) {
331
+ let added = 0;
332
+ let removed = 0;
333
+ for (const k of next)
334
+ if (!prev.has(k))
335
+ added++;
336
+ for (const k of prev)
337
+ if (!next.has(k))
338
+ removed++;
339
+ return { added, removed };
215
340
  }
216
341
  function clamp(n, lo, hi) {
217
342
  if (!Number.isFinite(n))
@@ -225,4 +350,15 @@ function clamp(n, lo, hi) {
225
350
  export function __resetReviewWatchesForTests() {
226
351
  watches.clear();
227
352
  }
353
+ /**
354
+ * Test-only exports: snapshot + diff helpers for the 1.9 signature
355
+ * deepening. Keeping these accessible avoids over-loading the public
356
+ * tool surface with internals while still letting tests assert on the
357
+ * specific shape and per-bucket counts the agent will see.
358
+ */
359
+ export const __internal = {
360
+ snapshotOf,
361
+ signatureOf,
362
+ diffSnapshots,
363
+ };
228
364
  //# sourceMappingURL=reviewWatch.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"reviewWatch.js","sourceRoot":"","sources":["../../../src/mcp/tools/reviewWatch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAuDrD,MAAM,OAAO,GAAG,IAAI,GAAG,EAAsB,CAAC;AAC9C,MAAM,kBAAkB,GAAG,EAAE,CAA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;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,UAAU;IACV,WAAW;IACX,aAAa;CACd,CAAC"}
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "projscan",
3
- "version": "1.8.0",
3
+ "version": "1.9.0",
4
4
  "mcpProtocolVersion": "2025-03-26",
5
- "generatedAt": "2026-05-07T22:25:02.535Z",
5
+ "generatedAt": "2026-05-12T21:05:38.638Z",
6
6
  "toolCount": 27,
7
7
  "tools": [
8
8
  {
@@ -334,7 +334,7 @@
334
334
  },
335
335
  {
336
336
  "name": "projscan_review",
337
- "description": "One-call PR review. Combines projscan_pr_diff + per-changed-file risk score + new/expanded import cycles + risky function additions + dependency changes, plus a verdict (\"ok\" | \"review\" | \"block\") with a one-line summary. Use when an agent is asked \"is this PR safe to merge?\" Defaults: base=origin/main (falls back to main/master/HEAD~1), head=HEAD. Pass `max_cost_tokens` (1.5+) to get a budget-shaped response: <3000 returns verdict-only, <7000 returns a summary, otherwise the full review.",
337
+ "description": "One-call PR review. Combines projscan_pr_diff + per-changed-file risk score + new/expanded import cycles + risky function additions + dependency changes, plus a verdict (\"ok\" | \"review\" | \"block\") with a one-line summary. Use when an agent is asked \"is this PR safe to merge?\" Defaults: base=origin/main (falls back to main/master/HEAD~1), head=HEAD. Pass `max_cost_tokens` (1.5+) to get a budget-shaped response: <3000 returns verdict-only, <7000 returns a summary, otherwise the full review. 1.9+: pass `intent` (a free-text PR description like \"refactor auth middleware\" or \"docs: fix codex setup\") to get an intent-grounded review — each finding is labelled expected / unexpected / out-of-scope against the stated intent. Verdict is unchanged; this is an extra narration layer.",
338
338
  "inputSchema": {
339
339
  "type": "object",
340
340
  "properties": {
@@ -357,6 +357,10 @@
357
357
  "package": {
358
358
  "type": "string",
359
359
  "description": "Optional. Workspace package name to scope all sections of the review to a single package."
360
+ },
361
+ "intent": {
362
+ "type": "string",
363
+ "description": "1.9+ — free-text description of what the PR is trying to do. projscan parses this into an action (feature / fix / refactor / perf / test / docs / chore / remove) plus scope tokens, then labels every finding as expected / unexpected / out-of-scope against that intent. Returns an `intent` echo and an `intentAnalysis` summary; per-finding labels appear as `intentAlignment` on each changedFile / riskyFunction / newCycle / newTaintFlow / dependencyChange. Does NOT change the verdict (verdict stays structural)."
360
364
  }
361
365
  }
362
366
  }
@@ -548,7 +552,7 @@
548
552
  "forget",
549
553
  "forget-hotspot"
550
554
  ],
551
- "description": "Subaction. \"current\" returns aggregate counts. \"stable\" returns long-running rules with a config-snippet suggestion. \"runs\" returns every tracked rule. \"accepted\" (1.5+) returns files Project Memory marks as accepted load-bearing debt (top-K hotspot for ≥ 5 runs over ≥ 7 days without improving). \"confidence\" (1.7+) returns each tracked rule labelled high/medium/low based on observed fix-rate — high = user has fixed instances; low = persistently ignored. \"forget\" drops one rule. \"forget-hotspot\" drops one file from hotspot memory."
555
+ "description": "Subaction. \"current\" returns aggregate counts. \"stable\" returns long-running rules with a config-snippet suggestion. \"runs\" returns every tracked rule. \"accepted\" (1.5+) returns files Project Memory marks as accepted load-bearing debt (top-K hotspot for ≥ 5 runs over ≥ 7 days without improving). \"confidence\" (1.7+) returns each tracked rule labelled high/medium/low based on observed fix-rate — high = user has fixed instances; low = persistently ignored. 1.9+: each rule also carries a `drift` label (stable / noisy / cry-wolf) so the agent can deprioritize rules the user has effectively classified as false positives. \"forget\" drops one rule. \"forget-hotspot\" drops one file from hotspot memory."
552
556
  },
553
557
  "rule": {
554
558
  "type": "string",
@@ -658,7 +662,7 @@
658
662
  },
659
663
  {
660
664
  "name": "projscan_review_watch",
661
- "description": "Long-running PR review. Polls a base+head ref pair on an interval and emits a notifications/projscan/pr_changed notification whenever the review verdict, SHAs, flow count, or risky-function set changes. Pairs with projscan_review (one-shot) — use this when an agent wants to react to pushes on a PR without re-asking. Actions: start (returns initial review + watchId) / stop / list.",
665
+ "description": "Long-running PR review. Polls a base+head ref pair on an interval and emits a notifications/projscan/pr_changed notification whenever the review verdict, SHAs, cycle set, dep changes, taint flows, or risky-function set changes. 1.9+: the notification carries a structured `delta` describing exactly which buckets moved (verdict/baseSha/headSha/changedFiles/cycles/risky/taint/deps) and counts of newly-appearing items per bucket, so agents can skip work they do not need. Pairs with projscan_review (one-shot) — use this when an agent wants to react to pushes on a PR without re-asking. Actions: start (returns initial review + watchId) / stop / list.",
662
666
  "inputSchema": {
663
667
  "type": "object",
664
668
  "properties": {
package/dist/types.d.ts CHANGED
@@ -551,6 +551,8 @@ export interface ReviewFile {
551
551
  importsAdded: number;
552
552
  /** Number of imports removed. */
553
553
  importsRemoved: number;
554
+ /** 1.9+ — set when `projscan_review` was called with an `intent` arg. Absent otherwise. */
555
+ intentAlignment?: 'expected' | 'unexpected' | 'out-of-scope' | 'unknown';
554
556
  }
555
557
  /**
556
558
  * A circular import that exists at head and either didn't exist at base or
@@ -565,6 +567,8 @@ export interface ReviewCycle {
565
567
  * file added to an existing cycle.
566
568
  */
567
569
  classification: 'new' | 'expanded';
570
+ /** 1.9+ — set when `projscan_review` was called with an `intent` arg. Absent otherwise. */
571
+ intentAlignment?: 'expected' | 'unexpected' | 'out-of-scope' | 'unknown';
568
572
  }
569
573
  /**
570
574
  * A function whose CC newly crossed a worry threshold (>= 10) at head, or
@@ -580,6 +584,8 @@ export interface ReviewFunction {
580
584
  baseCc: number | null;
581
585
  /** Why this function shows up. */
582
586
  reason: 'added' | 'jumped' | 'crossed-threshold';
587
+ /** 1.9+ — set when `projscan_review` was called with an `intent` arg. Absent otherwise. */
588
+ intentAlignment?: 'expected' | 'unexpected' | 'out-of-scope' | 'unknown';
583
589
  }
584
590
  /**
585
591
  * 1.6+ — A taint flow that is NEW at head (not present at base). Mirrors
@@ -596,6 +602,8 @@ export interface ReviewTaintFlow {
596
602
  pathLength: number;
597
603
  /** First and last files in the path; same value when length = 1. */
598
604
  files: string[];
605
+ /** 1.9+ — set when `projscan_review` was called with an `intent` arg. Absent otherwise. */
606
+ intentAlignment?: 'expected' | 'unexpected' | 'out-of-scope' | 'unknown';
599
607
  }
600
608
  /** Workspace-package-scoped dependency change. Aggregates root + workspaces. */
601
609
  export interface ReviewDependencyChange {
@@ -618,6 +626,8 @@ export interface ReviewDependencyChange {
618
626
  to: string;
619
627
  kind: 'dep' | 'dev';
620
628
  }>;
629
+ /** 1.9+ — set when `projscan_review` was called with an `intent` arg. Absent otherwise. */
630
+ intentAlignment?: 'expected' | 'unexpected' | 'out-of-scope' | 'unknown';
621
631
  }
622
632
  /**
623
633
  * 1.5+ — `projscan_review` can shape its response at three tiers based
@@ -664,6 +674,31 @@ export interface ReviewReport {
664
674
  * report is returned without budget shaping.
665
675
  */
666
676
  tier?: ReviewTier;
677
+ /**
678
+ * 1.9+ — the parsed intent the agent passed (if any). Echo of the
679
+ * raw string + the parser's classified action + extracted scope
680
+ * tokens. Absent when `intent` arg wasn't provided.
681
+ */
682
+ intent?: {
683
+ raw: string;
684
+ action: 'feature' | 'fix' | 'refactor' | 'perf' | 'test' | 'docs' | 'chore' | 'remove' | 'unknown';
685
+ scopeTokens: string[];
686
+ };
687
+ /**
688
+ * 1.9+ — per-alignment totals across all findings + a small sample
689
+ * of "notable" (unexpected / out-of-scope) findings. Absent when
690
+ * no intent was provided. Verdict is NOT affected by intent —
691
+ * verdict stays structural.
692
+ */
693
+ intentAnalysis?: {
694
+ totals: Record<'expected' | 'unexpected' | 'out-of-scope' | 'unknown', number>;
695
+ notable: Array<{
696
+ kind: 'file' | 'function' | 'cycle' | 'taint' | 'dependency';
697
+ label: string;
698
+ alignment: 'expected' | 'unexpected' | 'out-of-scope' | 'unknown';
699
+ reason: string;
700
+ }>;
701
+ };
667
702
  }
668
703
  /**
669
704
  * One reachable file in an impact analysis. `distance` is BFS-hops from the
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "projscan",
3
3
  "mcpName": "io.github.abhiyoheswaran1/projscan",
4
- "version": "1.8.0",
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++; 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, one-call PR review (projscan_review) and long-running PR-watch mode (projscan_review_watch), 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 + cost-summary analytics (projscan_cost_summary), 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.",
4
+ "version": "1.9.0",
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++; 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) and long-running PR-watch mode with structured per-bucket deltas (projscan_review_watch), 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 (projscan_cost_summary), 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",
8
8
  "types": "./dist/index.d.ts",