projscan 2.2.0 → 2.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.
Files changed (99) hide show
  1. package/README.md +59 -21
  2. package/dist/cli/commands/agentBrief.d.ts +1 -0
  3. package/dist/cli/commands/agentBrief.js +68 -0
  4. package/dist/cli/commands/agentBrief.js.map +1 -0
  5. package/dist/cli/commands/bugHunt.d.ts +1 -0
  6. package/dist/cli/commands/bugHunt.js +59 -0
  7. package/dist/cli/commands/bugHunt.js.map +1 -0
  8. package/dist/cli/commands/evidencePack.d.ts +1 -0
  9. package/dist/cli/commands/evidencePack.js +70 -0
  10. package/dist/cli/commands/evidencePack.js.map +1 -0
  11. package/dist/cli/commands/init.js +46 -1
  12. package/dist/cli/commands/init.js.map +1 -1
  13. package/dist/cli/commands/preflight.js +16 -0
  14. package/dist/cli/commands/preflight.js.map +1 -1
  15. package/dist/cli/commands/qualityScorecard.d.ts +1 -0
  16. package/dist/cli/commands/qualityScorecard.js +61 -0
  17. package/dist/cli/commands/qualityScorecard.js.map +1 -0
  18. package/dist/cli/commands/recipes.d.ts +2 -0
  19. package/dist/cli/commands/recipes.js +94 -0
  20. package/dist/cli/commands/recipes.js.map +1 -0
  21. package/dist/cli/commands/regressionPlan.d.ts +1 -0
  22. package/dist/cli/commands/regressionPlan.js +77 -0
  23. package/dist/cli/commands/regressionPlan.js.map +1 -0
  24. package/dist/cli/commands/releaseTrain.d.ts +1 -0
  25. package/dist/cli/commands/releaseTrain.js +58 -0
  26. package/dist/cli/commands/releaseTrain.js.map +1 -0
  27. package/dist/cli/commands/workplan.d.ts +1 -0
  28. package/dist/cli/commands/workplan.js +136 -0
  29. package/dist/cli/commands/workplan.js.map +1 -0
  30. package/dist/cli/index.js +17 -0
  31. package/dist/cli/index.js.map +1 -1
  32. package/dist/core/adoption.d.ts +57 -0
  33. package/dist/core/adoption.js +392 -0
  34. package/dist/core/adoption.js.map +1 -0
  35. package/dist/core/agentBrief.d.ts +6 -0
  36. package/dist/core/agentBrief.js +192 -0
  37. package/dist/core/agentBrief.js.map +1 -0
  38. package/dist/core/bugHunt.d.ts +6 -0
  39. package/dist/core/bugHunt.js +278 -0
  40. package/dist/core/bugHunt.js.map +1 -0
  41. package/dist/core/qualityScorecard.d.ts +6 -0
  42. package/dist/core/qualityScorecard.js +220 -0
  43. package/dist/core/qualityScorecard.js.map +1 -0
  44. package/dist/core/regressionPlan.d.ts +7 -0
  45. package/dist/core/regressionPlan.js +226 -0
  46. package/dist/core/regressionPlan.js.map +1 -0
  47. package/dist/core/releaseEvidence.d.ts +7 -0
  48. package/dist/core/releaseEvidence.js +174 -0
  49. package/dist/core/releaseEvidence.js.map +1 -0
  50. package/dist/core/releaseTrain.d.ts +5 -0
  51. package/dist/core/releaseTrain.js +348 -0
  52. package/dist/core/releaseTrain.js.map +1 -0
  53. package/dist/core/workplan.d.ts +12 -0
  54. package/dist/core/workplan.js +440 -0
  55. package/dist/core/workplan.js.map +1 -0
  56. package/dist/index.d.ts +10 -1
  57. package/dist/index.js +8 -0
  58. package/dist/index.js.map +1 -1
  59. package/dist/mcp/tools/adoption.d.ts +2 -0
  60. package/dist/mcp/tools/adoption.js +35 -0
  61. package/dist/mcp/tools/adoption.js.map +1 -0
  62. package/dist/mcp/tools/agentBrief.d.ts +2 -0
  63. package/dist/mcp/tools/agentBrief.js +39 -0
  64. package/dist/mcp/tools/agentBrief.js.map +1 -0
  65. package/dist/mcp/tools/bugHunt.d.ts +2 -0
  66. package/dist/mcp/tools/bugHunt.js +31 -0
  67. package/dist/mcp/tools/bugHunt.js.map +1 -0
  68. package/dist/mcp/tools/evidencePack.d.ts +2 -0
  69. package/dist/mcp/tools/evidencePack.js +39 -0
  70. package/dist/mcp/tools/evidencePack.js.map +1 -0
  71. package/dist/mcp/tools/qualityScorecard.d.ts +2 -0
  72. package/dist/mcp/tools/qualityScorecard.js +26 -0
  73. package/dist/mcp/tools/qualityScorecard.js.map +1 -0
  74. package/dist/mcp/tools/regressionPlan.d.ts +2 -0
  75. package/dist/mcp/tools/regressionPlan.js +47 -0
  76. package/dist/mcp/tools/regressionPlan.js.map +1 -0
  77. package/dist/mcp/tools/releaseTrain.d.ts +2 -0
  78. package/dist/mcp/tools/releaseTrain.js +27 -0
  79. package/dist/mcp/tools/releaseTrain.js.map +1 -0
  80. package/dist/mcp/tools/workplan.d.ts +2 -0
  81. package/dist/mcp/tools/workplan.js +70 -0
  82. package/dist/mcp/tools/workplan.js.map +1 -0
  83. package/dist/mcp/tools.js +16 -0
  84. package/dist/mcp/tools.js.map +1 -1
  85. package/dist/projscan-sbom.cdx.json +6 -6
  86. package/dist/reporters/consoleReporter.js +4 -0
  87. package/dist/reporters/consoleReporter.js.map +1 -1
  88. package/dist/tool-manifest.json +222 -3
  89. package/dist/types.d.ts +240 -0
  90. package/dist/utils/formatSupport.d.ts +11 -0
  91. package/dist/utils/formatSupport.js +11 -0
  92. package/dist/utils/formatSupport.js.map +1 -1
  93. package/docs/PLUGIN-AUTHORING.md +4 -0
  94. package/docs/PLUGIN-GALLERY.md +61 -0
  95. package/docs/examples/plugins/release-readiness.mjs +26 -0
  96. package/docs/examples/plugins/release-readiness.projscan-plugin.json +8 -0
  97. package/docs/examples/plugins/security-radar.mjs +50 -0
  98. package/docs/examples/plugins/security-radar.projscan-plugin.json +8 -0
  99. package/package.json +5 -4
@@ -0,0 +1,440 @@
1
+ import { computePreflight } from './preflight.js';
2
+ import { buildRiskNow } from './sessionResources.js';
3
+ const DEFAULT_MAX_TASKS = 8;
4
+ const MAX_TOP_RISKS = 8;
5
+ const MAX_COORDINATION_FILES = 20;
6
+ const HANDOFF_LIMIT = 320;
7
+ const WORKPLAN_MODES = [
8
+ 'before_edit',
9
+ 'before_commit',
10
+ 'before_merge',
11
+ 'refactor',
12
+ 'release',
13
+ 'bug_hunt',
14
+ 'hardening',
15
+ ];
16
+ export function isWorkplanMode(value) {
17
+ return WORKPLAN_MODES.includes(value);
18
+ }
19
+ export async function computeWorkplan(rootPath, options = {}) {
20
+ const mode = options.mode ?? 'before_edit';
21
+ const preflightMode = modeToPreflightMode(mode);
22
+ const preflight = await computePreflight(rootPath, {
23
+ mode: preflightMode,
24
+ baseRef: options.baseRef,
25
+ headRef: options.headRef,
26
+ maxChangedFiles: options.maxChangedFiles,
27
+ enablePlugins: options.enablePlugins,
28
+ });
29
+ const riskNow = await safeRiskNow(rootPath);
30
+ const coordination = buildCoordination(preflight.verdict, riskNow.touchedFiles, riskNow.conflicts);
31
+ const tasks = rankWorkplanTasks([
32
+ ...tasksFromPreflight(preflight.reasons),
33
+ ...tasksFromCoordination(coordination),
34
+ ...modeTasks(mode, preflight.verdict, coordination.touchedFiles),
35
+ ]);
36
+ const maxTasks = normalizeMaxTasks(options.maxTasks);
37
+ const limitedTasks = tasks.slice(0, maxTasks);
38
+ const topRisks = buildTopRisks(preflight.reasons, coordination.conflicts);
39
+ const truncated = tasks.length > limitedTasks.length ||
40
+ preflight.truncated === true ||
41
+ riskNow.truncated === true ||
42
+ coordination.touchedFiles.length > MAX_COORDINATION_FILES;
43
+ return {
44
+ schemaVersion: 1,
45
+ mode,
46
+ verdict: preflight.verdict,
47
+ summary: summarizeWorkplan(mode, preflight.verdict, limitedTasks, topRisks),
48
+ topRisks,
49
+ tasks: limitedTasks,
50
+ coordination,
51
+ suggestedNextActions: dedupeActions([
52
+ ...preflight.suggestedNextActions,
53
+ ...limitedTasks.flatMap((task) => taskToSuggestedActions(task)),
54
+ ]),
55
+ ...(truncated ? { truncated: true } : {}),
56
+ };
57
+ }
58
+ function modeToPreflightMode(mode) {
59
+ if (mode === 'before_commit' || mode === 'before_merge' || mode === 'before_edit')
60
+ return mode;
61
+ if (mode === 'release')
62
+ return 'before_merge';
63
+ return 'before_edit';
64
+ }
65
+ async function safeRiskNow(rootPath) {
66
+ try {
67
+ return await buildRiskNow(rootPath);
68
+ }
69
+ catch (err) {
70
+ return {
71
+ conflicts: [
72
+ {
73
+ kind: 'same-file',
74
+ files: [],
75
+ message: `coordination signals unavailable: ${err instanceof Error ? err.message : String(err)}`,
76
+ severity: 'warning',
77
+ },
78
+ ],
79
+ touchedFiles: [],
80
+ };
81
+ }
82
+ }
83
+ function buildCoordination(verdict, touchedFiles, conflicts) {
84
+ const visibleTouched = touchedFiles.slice(0, MAX_COORDINATION_FILES);
85
+ let recommendedNextAgent = 'preflight agent: run the safety gate, then pick the first p0/p1 task';
86
+ if (verdict === 'block') {
87
+ recommendedNextAgent = 'hardening agent: resolve p0 blockers before feature work continues';
88
+ }
89
+ else if (conflicts.length > 0) {
90
+ recommendedNextAgent = 'coordination agent: inspect touched-file overlap before parallel edits continue';
91
+ }
92
+ else if (visibleTouched.length > 0) {
93
+ recommendedNextAgent = 'handoff/preflight agent: continue from touched-file context, then confirm the safety gate before editing';
94
+ }
95
+ return {
96
+ touchedFiles: visibleTouched,
97
+ conflicts,
98
+ recommendedNextAgent,
99
+ };
100
+ }
101
+ function tasksFromPreflight(reasons) {
102
+ const tasks = [];
103
+ const bySource = new Map();
104
+ for (const reason of reasons) {
105
+ const key = `${reason.source}:${reason.severity}`;
106
+ const group = bySource.get(key) ?? [];
107
+ group.push(reason);
108
+ bySource.set(key, group);
109
+ }
110
+ const supplyChain = reasons.filter((reason) => reason.source === 'supply-chain');
111
+ if (supplyChain.length > 0) {
112
+ tasks.push(makeTask({
113
+ id: 'wp-supply-chain-1',
114
+ priority: supplyChain.some((reason) => reason.severity === 'error') ? 'p0' : 'p1',
115
+ title: 'Resolve supply-chain trust blockers',
116
+ why: 'Supply-chain findings can mean install-time compromise, unsafe dependency provenance, or hidden persistence hooks. Handle these before continuing with normal product work.',
117
+ evidence: supplyChain.map(reasonToEvidence),
118
+ files: filesFromReasons(supplyChain),
119
+ suggestedTools: ['projscan_doctor', 'projscan_preflight'],
120
+ commands: ['projscan preflight --format json', 'projscan doctor --format json'],
121
+ expected: 'No supply-chain errors remain, and preflight no longer blocks on supply-chain evidence.',
122
+ }));
123
+ }
124
+ const review = reasons.filter((reason) => reason.source === 'review' || reason.source === 'taint');
125
+ if (review.length > 0) {
126
+ tasks.push(makeTask({
127
+ id: 'wp-review-gate',
128
+ priority: review.some((reason) => reason.severity === 'error') ? 'p0' : 'p1',
129
+ title: 'Inspect review and taint blockers',
130
+ why: 'Review and taint findings describe merge safety, new risky flows, and structural changes that need explicit handling before handoff.',
131
+ evidence: review.map(reasonToEvidence),
132
+ files: filesFromReasons(review),
133
+ suggestedTools: ['projscan_review', 'projscan_taint'],
134
+ commands: ['projscan review --format json', 'projscan preflight --mode before_merge --format json'],
135
+ expected: 'The review verdict is ok or the remaining review items are intentionally documented.',
136
+ }));
137
+ }
138
+ const doctor = reasons.filter((reason) => reason.source === 'doctor' || reason.source === 'plugin');
139
+ if (doctor.length > 0) {
140
+ tasks.push(makeTask({
141
+ id: 'wp-health-policy',
142
+ priority: doctor.some((reason) => reason.severity === 'error') ? 'p0' : 'p1',
143
+ title: 'Fix health and plugin-policy findings',
144
+ why: 'Health and local policy findings are the fastest path from diagnosis to concrete fixes because they point at files, issue ids, and existing fix suggestions.',
145
+ evidence: doctor.map(reasonToEvidence),
146
+ files: filesFromReasons(doctor),
147
+ suggestedTools: ['projscan_doctor', 'projscan_fix_suggest'],
148
+ commands: ['projscan doctor --format json', 'npm test'],
149
+ expected: 'The relevant issue ids disappear from projscan doctor and the focused test command passes.',
150
+ }));
151
+ }
152
+ const hotspots = reasons.filter((reason) => reason.source === 'hotspots');
153
+ if (hotspots.length > 0) {
154
+ tasks.push(makeTask({
155
+ id: 'wp-touched-hotspots',
156
+ priority: 'p1',
157
+ title: 'Review touched high-risk hotspots',
158
+ why: 'Touched hotspots combine churn, complexity, and issue density. They are where small mistakes most often become expensive regressions.',
159
+ evidence: hotspots.map(reasonToEvidence),
160
+ files: filesFromReasons(hotspots),
161
+ suggestedTools: ['projscan_hotspots', 'projscan_file'],
162
+ commands: ['projscan hotspots --format json', 'projscan file <path> --format json'],
163
+ expected: 'The touched hotspot has a clear owner, test target, and reduced or accepted risk.',
164
+ }));
165
+ }
166
+ const changed = reasons.filter((reason) => reason.source === 'changed-files' || reason.source === 'git');
167
+ if (changed.length > 0) {
168
+ tasks.push(makeTask({
169
+ id: 'wp-git-scope',
170
+ priority: 'p1',
171
+ title: 'Stabilize git scope for review',
172
+ why: 'A workplan is only useful when changed-file and base-ref evidence are reliable. Pin the base ref before trusting merge decisions.',
173
+ evidence: changed.map(reasonToEvidence),
174
+ files: [],
175
+ suggestedTools: ['projscan_preflight', 'projscan_review'],
176
+ commands: ['projscan preflight --base-ref main --format json'],
177
+ expected: 'Changed-file evidence is available and review can compare the intended base/head refs.',
178
+ }));
179
+ }
180
+ return tasks;
181
+ }
182
+ function tasksFromCoordination(coordination) {
183
+ if (coordination.touchedFiles.length === 0 && coordination.conflicts.length === 0)
184
+ return [];
185
+ const evidence = [
186
+ ...coordination.touchedFiles.slice(0, 5).map((file) => ({
187
+ source: 'coordination',
188
+ file,
189
+ message: `session touched ${file}`,
190
+ })),
191
+ ...coordination.conflicts.map((conflict) => ({
192
+ source: 'coordination',
193
+ severity: conflict.severity,
194
+ file: conflict.files[0],
195
+ message: conflict.message,
196
+ })),
197
+ ];
198
+ return [
199
+ makeTask({
200
+ id: 'wp-session-handoff',
201
+ priority: coordination.conflicts.some((conflict) => conflict.severity === 'error') ? 'p0' : 'p1',
202
+ title: 'Coordinate touched files before parallel work continues',
203
+ why: 'Session evidence tells the next agent what changed recently and which files may collide across agents.',
204
+ evidence,
205
+ files: coordination.touchedFiles,
206
+ suggestedTools: ['projscan_session', 'projscan://handoff', 'projscan://risk-now'],
207
+ commands: ['projscan session touched --format json', 'projscan handoff'],
208
+ expected: 'The next agent can name touched files, current overlap risks, and the first safe task.',
209
+ }),
210
+ ];
211
+ }
212
+ function modeTasks(mode, verdict, touchedFiles) {
213
+ const tasks = [];
214
+ if (mode === 'bug_hunt') {
215
+ tasks.push(makeTask({
216
+ id: 'wp-bug-hunt-hotspots',
217
+ priority: verdict === 'block' ? 'p1' : 'p0',
218
+ title: 'Hunt bugs in the highest-risk files',
219
+ why: 'The fastest polish pass starts where churn, complexity, and current issues overlap instead of scanning the whole repository equally.',
220
+ evidence: [{ source: 'verification', message: 'bug_hunt mode prioritizes hotspots, doctor issues, and focused tests' }],
221
+ files: touchedFiles,
222
+ suggestedTools: ['projscan_hotspots', 'projscan_file', 'projscan_doctor'],
223
+ commands: ['projscan hotspots --format json', 'projscan doctor --format json', 'npm test'],
224
+ expected: 'At least one high-risk file or issue is either fixed, covered by a focused test, or explicitly deferred with evidence.',
225
+ }));
226
+ tasks.push(makeTask({
227
+ id: 'wp-bug-hunt-regression-tests',
228
+ priority: 'p1',
229
+ title: 'Add or run regression tests for the risky change path',
230
+ why: 'Polish work only sticks when the exact failure mode is covered by a repeatable command.',
231
+ evidence: [{ source: 'verification', message: 'every bug hunt task should end with a reproducible verification command' }],
232
+ files: touchedFiles,
233
+ suggestedTools: ['projscan_review', 'projscan_coverage'],
234
+ commands: ['npm test', 'npm run lint'],
235
+ expected: 'The focused regression test fails before the fix, passes after the fix, and lint stays clean.',
236
+ }));
237
+ }
238
+ if (mode === 'release') {
239
+ tasks.push(makeTask({
240
+ id: 'wp-release-readiness',
241
+ priority: 'p0',
242
+ title: 'Run the local release-readiness gate',
243
+ why: 'Release work needs one local command that checks version metadata, changelog, tag state, release gates, SBOM, and packed install smoke before any publish action.',
244
+ evidence: [{ source: 'release', message: 'release mode requires release:check before tagging or dispatching workflows' }],
245
+ files: ['package.json', 'CHANGELOG.md', '.github/mcp-registry/server.json'],
246
+ suggestedTools: ['release:check', 'projscan_preflight'],
247
+ commands: ['npm run release:check'],
248
+ expected: 'release:check reports no blockers and prints the next release action.',
249
+ }));
250
+ tasks.push(makeTask({
251
+ id: 'wp-release-website',
252
+ priority: 'p2',
253
+ title: 'Prepare the website update handoff',
254
+ why: 'The website pins the release manifest and must be updated after the package, GitHub Release assets, and MCP Registry agree on the same version.',
255
+ evidence: [{ source: 'release', message: 'website follow-up consumes GitHub Release assets and registry metadata' }],
256
+ files: ['docs/WEBSITE-UPDATE-PROMPT.md'],
257
+ suggestedTools: ['GitHub Release assets', 'MCP Registry', 'npm view'],
258
+ commands: ['npm view projscan version', 'gh release view vX.Y.Z --json assets'],
259
+ expected: 'Website prompt references the shipped tag, manifest asset, SBOM asset, npm version, and MCP Registry latest version.',
260
+ }));
261
+ }
262
+ if (mode === 'refactor') {
263
+ tasks.push(makeTask({
264
+ id: 'wp-refactor-impact',
265
+ priority: verdict === 'block' ? 'p1' : 'p0',
266
+ title: 'Pick one hotspot and inspect blast radius',
267
+ why: 'A safe refactor starts with one high-risk file and an impact map, not a broad cleanup pass.',
268
+ evidence: [{ source: 'verification', message: 'refactor mode composes hotspots with impact before edits' }],
269
+ files: touchedFiles,
270
+ suggestedTools: ['projscan_hotspots', 'projscan_impact'],
271
+ commands: ['projscan hotspots --format json', 'projscan impact <file> --format json'],
272
+ expected: 'The chosen refactor target has importers, tests, and rollback scope identified before edits begin.',
273
+ }));
274
+ }
275
+ if (mode === 'hardening') {
276
+ tasks.push(makeTask({
277
+ id: 'wp-hardening-gate',
278
+ priority: verdict === 'block' ? 'p1' : 'p0',
279
+ title: 'Run security and supply-chain hardening checks',
280
+ why: 'Hardening mode should prove the repo can reject compromised dependencies, unsafe scripts, and known audit findings.',
281
+ evidence: [{ source: 'supply-chain', message: 'hardening mode pairs preflight evidence with release security gates' }],
282
+ files: ['package.json', 'package-lock.json'],
283
+ suggestedTools: ['projscan_preflight', 'projscan_doctor', 'npm audit'],
284
+ commands: ['projscan preflight --format json', 'npm audit --audit-level=moderate'],
285
+ expected: 'Preflight has no supply-chain blockers and npm audit reports no moderate-or-higher vulnerabilities.',
286
+ }));
287
+ }
288
+ if (mode === 'before_edit') {
289
+ tasks.push(makeTask({
290
+ id: 'wp-before-edit-orient',
291
+ priority: verdict === 'block' ? 'p1' : 'p0',
292
+ title: 'Orient before editing',
293
+ why: 'Before editing, the agent needs a compact safety verdict, touched-file context, and the first target file.',
294
+ evidence: [{ source: 'verification', message: 'before_edit mode starts from preflight and session context' }],
295
+ files: touchedFiles,
296
+ suggestedTools: ['projscan_preflight', 'projscan_session', 'projscan_hotspots'],
297
+ commands: ['projscan preflight --format json'],
298
+ expected: 'The agent can explain whether it may proceed and which evidence supports the next edit.',
299
+ }));
300
+ }
301
+ if (mode === 'before_commit' || mode === 'before_merge') {
302
+ tasks.push(makeTask({
303
+ id: 'wp-merge-readiness',
304
+ priority: verdict === 'block' ? 'p1' : 'p0',
305
+ title: 'Prove commit and merge readiness',
306
+ why: 'Commit and merge gates should be based on changed-file evidence, review verdict, taint status, and focused verification commands.',
307
+ evidence: [{ source: 'review', message: `${mode} mode composes review, preflight, and changed-file checks` }],
308
+ files: touchedFiles,
309
+ suggestedTools: ['projscan_preflight', 'projscan_review'],
310
+ commands: [`projscan preflight --mode ${mode} --format json`, 'npm test', 'npm run lint'],
311
+ expected: 'Preflight is proceed or the remaining caution/block reasons are fixed before handoff.',
312
+ }));
313
+ }
314
+ return tasks;
315
+ }
316
+ function makeTask(input) {
317
+ const files = unique(input.files.filter(Boolean)).slice(0, 12);
318
+ const handoffText = compact(`${input.priority.toUpperCase()} ${input.title}: ${input.why} Verify with ${input.commands.join(' && ')}.${files.length > 0 ? ` Files: ${files.join(', ')}.` : ''}`, HANDOFF_LIMIT);
319
+ return {
320
+ id: input.id,
321
+ priority: input.priority,
322
+ title: input.title,
323
+ why: input.why,
324
+ evidence: input.evidence,
325
+ files,
326
+ suggestedTools: unique(input.suggestedTools),
327
+ verification: {
328
+ commands: input.commands,
329
+ expected: input.expected,
330
+ },
331
+ handoffText,
332
+ };
333
+ }
334
+ export function rankWorkplanTasks(tasks) {
335
+ const seen = new Set();
336
+ return tasks
337
+ .filter((task) => {
338
+ if (seen.has(task.id))
339
+ return false;
340
+ seen.add(task.id);
341
+ return true;
342
+ })
343
+ .sort((a, b) => {
344
+ const priority = priorityRank(a.priority) - priorityRank(b.priority);
345
+ if (priority !== 0)
346
+ return priority;
347
+ const evidence = strongestEvidenceRank(a.evidence) - strongestEvidenceRank(b.evidence);
348
+ if (evidence !== 0)
349
+ return evidence;
350
+ return a.id.localeCompare(b.id);
351
+ });
352
+ }
353
+ function strongestEvidenceRank(evidence) {
354
+ if (evidence.some((item) => item.severity === 'error'))
355
+ return 0;
356
+ if (evidence.some((item) => item.severity === 'warning'))
357
+ return 1;
358
+ return 2;
359
+ }
360
+ function priorityRank(priority) {
361
+ if (priority === 'p0')
362
+ return 0;
363
+ if (priority === 'p1')
364
+ return 1;
365
+ return 2;
366
+ }
367
+ function reasonToEvidence(reason) {
368
+ return {
369
+ source: reason.source,
370
+ message: reason.message,
371
+ severity: reason.severity,
372
+ ...(reason.file ? { file: reason.file } : {}),
373
+ ...(reason.issueId ? { issueId: reason.issueId } : {}),
374
+ ...(reason.tool ? { tool: reason.tool } : {}),
375
+ };
376
+ }
377
+ function filesFromReasons(reasons) {
378
+ return unique(reasons.map((reason) => reason.file).filter((file) => typeof file === 'string'));
379
+ }
380
+ function buildTopRisks(reasons, conflicts) {
381
+ const reasonRisks = reasons.map((reason) => ({
382
+ ...reasonToEvidence(reason),
383
+ priority: reason.severity === 'error' ? 'p0' : 'p1',
384
+ }));
385
+ const conflictRisks = conflicts.map((conflict) => ({
386
+ source: 'coordination',
387
+ message: conflict.message,
388
+ severity: conflict.severity,
389
+ file: conflict.files[0],
390
+ priority: conflict.severity === 'error' ? 'p0' : 'p1',
391
+ }));
392
+ return [...reasonRisks, ...conflictRisks]
393
+ .sort((a, b) => {
394
+ const priority = priorityRank(a.priority) - priorityRank(b.priority);
395
+ if (priority !== 0)
396
+ return priority;
397
+ return a.message.localeCompare(b.message);
398
+ })
399
+ .slice(0, MAX_TOP_RISKS);
400
+ }
401
+ function summarizeWorkplan(mode, verdict, tasks, risks) {
402
+ if (tasks.length === 0)
403
+ return `${verdict}: ${mode} workplan has no recommended tasks`;
404
+ const riskText = risks.length > 0 ? `${risks.length} top risk(s)` : 'no top risks';
405
+ return `${verdict}: ${mode} workplan has ${tasks.length} task(s), starting with ${tasks[0]?.title}; ${riskText}`;
406
+ }
407
+ function taskToSuggestedActions(task) {
408
+ return task.suggestedTools.slice(0, 3).map((tool) => ({
409
+ label: `Use ${tool} for ${task.title}`,
410
+ tool: tool.startsWith('projscan_') ? tool : undefined,
411
+ command: task.verification.commands[0],
412
+ }));
413
+ }
414
+ function dedupeActions(actions) {
415
+ const seen = new Set();
416
+ const out = [];
417
+ for (const action of actions) {
418
+ const key = `${action.label}:${action.command ?? ''}:${action.tool ?? ''}`;
419
+ if (seen.has(key))
420
+ continue;
421
+ seen.add(key);
422
+ out.push(action);
423
+ }
424
+ return out.slice(0, 12);
425
+ }
426
+ function normalizeMaxTasks(value) {
427
+ if (typeof value !== 'number' || !Number.isFinite(value))
428
+ return DEFAULT_MAX_TASKS;
429
+ return Math.max(1, Math.min(20, Math.floor(value)));
430
+ }
431
+ function unique(values) {
432
+ return [...new Set(values)];
433
+ }
434
+ function compact(value, maxLength) {
435
+ const oneLine = value.replace(/\s+/g, ' ').trim();
436
+ if (oneLine.length <= maxLength)
437
+ return oneLine;
438
+ return `${oneLine.slice(0, maxLength - 3).trimEnd()}...`;
439
+ }
440
+ //# sourceMappingURL=workplan.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workplan.js","sourceRoot":"","sources":["../../src/core/workplan.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAgC,MAAM,gBAAgB,CAAC;AAChF,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAyBrD,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAC5B,MAAM,aAAa,GAAG,CAAC,CAAC;AACxB,MAAM,sBAAsB,GAAG,EAAE,CAAC;AAClC,MAAM,aAAa,GAAG,GAAG,CAAC;AAE1B,MAAM,cAAc,GAA4B;IAC9C,aAAa;IACb,eAAe;IACf,cAAc;IACd,UAAU;IACV,SAAS;IACT,UAAU;IACV,WAAW;CACZ,CAAC;AAEF,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AAM,CAAC,CAAC,CAAC;AAC9B,CAAC;AAED,SAAS,OAAO,CAAC,KAAa,EAAE,SAAiB;IAC/C,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;IAClD,IAAI,OAAO,CAAC,MAAM,IAAI,SAAS;QAAE,OAAO,OAAO,CAAC;IAChD,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,GAAG,CAAC,CAAC,CAAC,OAAO,EAAE,KAAK,CAAC;AAC3D,CAAC"}
package/dist/index.d.ts CHANGED
@@ -31,6 +31,15 @@ export { loadConfig, applyConfigToIssues } from './utils/config.js';
31
31
  export { getChangedFiles } from './utils/changedFiles.js';
32
32
  export { issuesToSarif } from './reporters/sarifReporter.js';
33
33
  export { computeReview } from './core/review.js';
34
+ export { computeWorkplan } from './core/workplan.js';
35
+ export { computeReleaseTrain } from './core/releaseTrain.js';
36
+ export { computeBugHunt } from './core/bugHunt.js';
37
+ export { computeEvidencePack } from './core/releaseEvidence.js';
38
+ export { computeRegressionPlan } from './core/regressionPlan.js';
39
+ export { computeAgentBrief } from './core/agentBrief.js';
40
+ export { computeQualityScorecard } from './core/qualityScorecard.js';
41
+ export { computeFirstRunDiagnostics, getMcpConfigGuide, getWorkflowRecipes } from './core/adoption.js';
42
+ export type { AgentWorkflowRecipe, FirstRunDiagnostic, FirstRunReport, McpConfigCatalog, McpConfigGuide, McpClientId, WorkflowRecipeCatalog, } from './core/adoption.js';
34
43
  export { suggestFixForIssue, previewSuggestionForIssue, syntheticIssue, findIssue } from './core/fixSuggest.js';
35
44
  export { explainIssue } from './core/explainIssue.js';
36
45
  export { computeImpact } from './core/impact.js';
@@ -42,4 +51,4 @@ export { getPromptDefinitions } from './mcp/prompts.js';
42
51
  export { getResourceDefinitions } from './mcp/resources.js';
43
52
  export { BUILTIN_LANGUAGE_IDS } from './core/languages/LanguageAdapter.js';
44
53
  export type { BuiltinLanguageId, LanguageId, LanguageAdapter } from './core/languages/LanguageAdapter.js';
45
- export type { ScanResult, FileEntry, DirectoryNode, LanguageBreakdown, LanguageStat, FrameworkResult, DetectedFramework, DependencyReport, DependencyRisk, Issue, IssueLocation, IssueSeverity, Fix, FixResult, FileExplanation, FileInspection, FunctionDetail, ImportInfo, ExportInfo, ArchitectureLayer, AnalysisReport, ReportFormat, FileHotspot, HotspotReport, AuthorShare, BaselineHotspot, HotspotDelta, HotspotDiffSummary, McpToolDefinition, McpPromptDefinition, McpResourceDefinition, ProjscanConfig, LoadedConfig, SemverDrift, OutdatedPackage, OutdatedReport, AuditSeverity, AuditFinding, AuditReport, UpgradePreview, CoverageSource, FileCoverage, CoverageReport, CoverageJoinedHotspot, CoverageJoinedReport, ReviewReport, ReviewFile, ReviewCycle, ReviewFunction, ReviewDependencyChange, FixSuggestion, IssueExplanation, ImportPolicyRule, ImpactReport, ImpactNode, } from './types.js';
54
+ export type { ScanResult, FileEntry, DirectoryNode, LanguageBreakdown, LanguageStat, FrameworkResult, DetectedFramework, DependencyReport, DependencyRisk, Issue, IssueLocation, IssueSeverity, Fix, FixResult, FileExplanation, FileInspection, FunctionDetail, ImportInfo, ExportInfo, ArchitectureLayer, AnalysisReport, AgentBriefGuardrail, AgentBriefIntent, AgentBriefItem, AgentBriefReport, ReportFormat, FileHotspot, HotspotReport, AuthorShare, BaselineHotspot, HotspotDelta, HotspotDiffSummary, McpToolDefinition, McpPromptDefinition, McpResourceDefinition, ProjscanConfig, LoadedConfig, SemverDrift, OutdatedPackage, OutdatedReport, AuditSeverity, AuditFinding, AuditReport, UpgradePreview, CoverageSource, FileCoverage, CoverageReport, CoverageJoinedHotspot, CoverageJoinedReport, ReviewReport, ReviewFile, ReviewCycle, ReviewFunction, ReviewDependencyChange, FixSuggestion, IssueExplanation, ImportPolicyRule, ImpactReport, ImpactNode, BugHuntFinding, BugHuntReport, BugHuntVerdict, EvidencePackArtifact, EvidencePackArtifactStatus, EvidencePackReport, EvidencePackVerdict, RegressionPlanLevel, RegressionPlanReport, RegressionPlanTarget, RegressionPlanVerdict, QualityScorecardDimension, QualityScorecardReport, QualityScorecardRisk, QualityScorecardStatus, QualityScorecardVerdict, ReleaseTrainReport, ReleaseTrainTask, ReleaseTrainTrack, WorkplanCoordination, WorkplanEvidence, WorkplanMode, WorkplanPriority, WorkplanReport, WorkplanTask, WorkplanTopRisk, WorkplanVerification, } from './types.js';
package/dist/index.js CHANGED
@@ -29,6 +29,14 @@ export { loadConfig, applyConfigToIssues } from './utils/config.js';
29
29
  export { getChangedFiles } from './utils/changedFiles.js';
30
30
  export { issuesToSarif } from './reporters/sarifReporter.js';
31
31
  export { computeReview } from './core/review.js';
32
+ export { computeWorkplan } from './core/workplan.js';
33
+ export { computeReleaseTrain } from './core/releaseTrain.js';
34
+ export { computeBugHunt } from './core/bugHunt.js';
35
+ export { computeEvidencePack } from './core/releaseEvidence.js';
36
+ export { computeRegressionPlan } from './core/regressionPlan.js';
37
+ export { computeAgentBrief } from './core/agentBrief.js';
38
+ export { computeQualityScorecard } from './core/qualityScorecard.js';
39
+ export { computeFirstRunDiagnostics, getMcpConfigGuide, getWorkflowRecipes } from './core/adoption.js';
32
40
  export { suggestFixForIssue, previewSuggestionForIssue, syntheticIssue, findIssue } from './core/fixSuggest.js';
33
41
  export { explainIssue } from './core/explainIssue.js';
34
42
  export { computeImpact } from './core/impact.js';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAA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BAAoB,CAAC;AAUvG,OAAO,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAChH,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { McpTool } from './_shared.js';
2
+ export declare const adoptionTool: McpTool;
@@ -0,0 +1,35 @@
1
+ import { computeFirstRunDiagnostics, getMcpConfigGuide, getWorkflowRecipes, isMcpClientId, } from '../../core/adoption.js';
2
+ export const adoptionTool = {
3
+ name: 'projscan_adoption',
4
+ description: 'Adoption helper for new projscan users and agents. Returns ready-to-paste MCP client configs, workflow recipes, or first-run diagnostics without mutating the repo.',
5
+ inputSchema: {
6
+ type: 'object',
7
+ properties: {
8
+ action: {
9
+ type: 'string',
10
+ enum: ['mcp_config', 'recipes', 'first_run'],
11
+ description: 'What to return. mcp_config returns client snippets, recipes returns agent workflow recipes, first_run checks setup diagnostics. Default: recipes.',
12
+ },
13
+ client: {
14
+ type: 'string',
15
+ description: 'For action=mcp_config: all, claude-desktop, claude-code, cursor, codex, continue, windsurf, cline, zed, or gemini. Default: all.',
16
+ },
17
+ max_tokens: {
18
+ type: 'number',
19
+ description: 'Cap the response to roughly this many tokens.',
20
+ },
21
+ },
22
+ },
23
+ handler: async (args, rootPath) => {
24
+ const action = typeof args.action === 'string' ? args.action : 'recipes';
25
+ if (action === 'mcp_config') {
26
+ const client = isMcpClientId(args.client) ? args.client : 'all';
27
+ return { config: getMcpConfigGuide(client) };
28
+ }
29
+ if (action === 'first_run') {
30
+ return { firstRun: await computeFirstRunDiagnostics(rootPath) };
31
+ }
32
+ return { recipes: getWorkflowRecipes() };
33
+ },
34
+ };
35
+ //# sourceMappingURL=adoption.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adoption.js","sourceRoot":"","sources":["../../../src/mcp/tools/adoption.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,0BAA0B,EAC1B,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,GACd,MAAM,wBAAwB,CAAC;AAGhC,MAAM,CAAC,MAAM,YAAY,GAAY;IACnC,IAAI,EAAE,mBAAmB;IACzB,WAAW,EACT,qKAAqK;IACvK,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,CAAC,YAAY,EAAE,SAAS,EAAE,WAAW,CAAC;gBAC5C,WAAW,EACT,mJAAmJ;aACtJ;YACD,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,kIAAkI;aACrI;YACD,UAAU,EAAE;gBACV,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,+CAA+C;aAC7D;SACF;KACF;IACD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;QAChC,MAAM,MAAM,GAAG,OAAO,IAAI,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;QACzE,IAAI,MAAM,KAAK,YAAY,EAAE,CAAC;YAC5B,MAAM,MAAM,GAAG,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC;YAChE,OAAO,EAAE,MAAM,EAAE,iBAAiB,CAAC,MAAM,CAAC,EAAE,CAAC;QAC/C,CAAC;QACD,IAAI,MAAM,KAAK,WAAW,EAAE,CAAC;YAC3B,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC,QAAQ,CAAC,EAAE,CAAC;QAClE,CAAC;QACD,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,EAAE,CAAC;IAC3C,CAAC;CACF,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { McpTool } from './_shared.js';
2
+ export declare const agentBriefTool: McpTool;
@@ -0,0 +1,39 @@
1
+ import { computeAgentBrief } from '../../core/agentBrief.js';
2
+ const INTENTS = ['next_agent', 'bug_hunt', 'release', 'refactor', 'hardening'];
3
+ export const agentBriefTool = {
4
+ name: 'projscan_agent_brief',
5
+ description: 'Create a compact next-agent context packet with prioritized focus items, repo context, guardrails, and suggested next actions.',
6
+ inputSchema: {
7
+ type: 'object',
8
+ properties: {
9
+ intent: {
10
+ type: 'string',
11
+ enum: INTENTS,
12
+ description: 'Brief intent. Default: next_agent.',
13
+ },
14
+ max_items: {
15
+ type: 'number',
16
+ description: 'Maximum focus items to return. Default: 6, max: 20.',
17
+ },
18
+ max_tokens: {
19
+ type: 'number',
20
+ description: 'Cap the response to roughly this many tokens.',
21
+ },
22
+ },
23
+ },
24
+ handler: async (args, rootPath) => ({
25
+ agentBrief: await computeAgentBrief(rootPath, {
26
+ intent: readIntent(args.intent),
27
+ maxItems: typeof args.max_items === 'number' && Number.isFinite(args.max_items)
28
+ ? args.max_items
29
+ : undefined,
30
+ }),
31
+ }),
32
+ };
33
+ function readIntent(value) {
34
+ if (typeof value === 'string' && INTENTS.includes(value)) {
35
+ return value;
36
+ }
37
+ return undefined;
38
+ }
39
+ //# sourceMappingURL=agentBrief.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agentBrief.js","sourceRoot":"","sources":["../../../src/mcp/tools/agentBrief.ts"],"names":[],"mappings":"AA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