@shrkcrft/inspector 0.1.0-alpha.2 → 0.1.0-alpha.21

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 (194) hide show
  1. package/dist/agent-brief.d.ts.map +1 -1
  2. package/dist/agent-brief.js +59 -10
  3. package/dist/agent-contract-gate.d.ts.map +1 -1
  4. package/dist/agent-contract-gate.js +25 -2
  5. package/dist/agent-instructions.d.ts.map +1 -1
  6. package/dist/agent-instructions.js +11 -0
  7. package/dist/agent-task-prep.d.ts.map +1 -1
  8. package/dist/agent-task-prep.js +1 -3
  9. package/dist/ai-readiness.d.ts +84 -9
  10. package/dist/ai-readiness.d.ts.map +1 -1
  11. package/dist/ai-readiness.js +181 -35
  12. package/dist/apply-dispatch-trace.d.ts +1 -2
  13. package/dist/apply-dispatch-trace.d.ts.map +1 -1
  14. package/dist/apply-dispatch-trace.js +0 -9
  15. package/dist/area-explore.d.ts.map +1 -1
  16. package/dist/area-explore.js +4 -6
  17. package/dist/area-map.d.ts +0 -5
  18. package/dist/area-map.d.ts.map +1 -1
  19. package/dist/area-map.js +0 -10
  20. package/dist/changed-preflight.d.ts +7 -0
  21. package/dist/changed-preflight.d.ts.map +1 -1
  22. package/dist/changed-preflight.js +56 -9
  23. package/dist/changes-summary.d.ts.map +1 -1
  24. package/dist/changes-summary.js +20 -6
  25. package/dist/check-guardrail-globs.d.ts +16 -0
  26. package/dist/check-guardrail-globs.d.ts.map +1 -0
  27. package/dist/check-guardrail-globs.js +38 -0
  28. package/dist/code-intelligence-doctor.d.ts +21 -0
  29. package/dist/code-intelligence-doctor.d.ts.map +1 -0
  30. package/dist/code-intelligence-doctor.js +985 -0
  31. package/dist/command-recommender.d.ts.map +1 -1
  32. package/dist/command-recommender.js +23 -0
  33. package/dist/compliance-profiles.js +1 -1
  34. package/dist/construct-adoption-diff.d.ts.map +1 -1
  35. package/dist/construct-adoption-diff.js +2 -1
  36. package/dist/construct-adoption.d.ts.map +1 -1
  37. package/dist/construct-adoption.js +10 -11
  38. package/dist/construct-inference.d.ts.map +1 -1
  39. package/dist/construct-inference.js +5 -2
  40. package/dist/construct-registry.d.ts.map +1 -1
  41. package/dist/construct-registry.js +2 -10
  42. package/dist/contract-file-rule.d.ts +8 -0
  43. package/dist/contract-file-rule.d.ts.map +1 -1
  44. package/dist/contract-file-rule.js +8 -3
  45. package/dist/contract-template-registry.d.ts.map +1 -1
  46. package/dist/contract-template-registry.js +2 -10
  47. package/dist/contradictions.d.ts +8 -1
  48. package/dist/contradictions.d.ts.map +1 -1
  49. package/dist/contradictions.js +37 -35
  50. package/dist/convention-registry.d.ts.map +1 -1
  51. package/dist/convention-registry.js +2 -10
  52. package/dist/coverage-report.d.ts.map +1 -1
  53. package/dist/coverage-report.js +14 -1
  54. package/dist/dashboard/dashboard-knowledge.d.ts +8 -0
  55. package/dist/dashboard/dashboard-knowledge.d.ts.map +1 -0
  56. package/dist/dashboard/dashboard-knowledge.js +259 -0
  57. package/dist/decision-records.d.ts.map +1 -1
  58. package/dist/decision-records.js +5 -10
  59. package/dist/delegate-catalog.d.ts +45 -0
  60. package/dist/delegate-catalog.d.ts.map +1 -0
  61. package/dist/delegate-catalog.js +50 -0
  62. package/dist/delegate-doctor.d.ts +15 -0
  63. package/dist/delegate-doctor.d.ts.map +1 -0
  64. package/dist/delegate-doctor.js +36 -0
  65. package/dist/delegate-pack-recipes.d.ts +29 -0
  66. package/dist/delegate-pack-recipes.d.ts.map +1 -0
  67. package/dist/delegate-pack-recipes.js +77 -0
  68. package/dist/demo-script.d.ts +0 -1
  69. package/dist/demo-script.d.ts.map +1 -1
  70. package/dist/demo-script.js +0 -43
  71. package/dist/docs-check.js +1 -1
  72. package/dist/drift-baseline.d.ts.map +1 -1
  73. package/dist/drift-baseline.js +5 -2
  74. package/dist/feedback-ingestion.d.ts.map +1 -1
  75. package/dist/feedback-ingestion.js +2 -16
  76. package/dist/git-helpers.d.ts +15 -0
  77. package/dist/git-helpers.d.ts.map +1 -1
  78. package/dist/git-helpers.js +51 -4
  79. package/dist/helper-registry.d.ts +27 -54
  80. package/dist/helper-registry.d.ts.map +1 -1
  81. package/dist/helper-registry.js +16 -517
  82. package/dist/impact-analysis.d.ts.map +1 -1
  83. package/dist/impact-analysis.js +14 -7
  84. package/dist/index.d.ts +8 -2
  85. package/dist/index.d.ts.map +1 -1
  86. package/dist/index.js +8 -2
  87. package/dist/ingest-drafts.js +8 -4
  88. package/dist/migration-profile-registry.d.ts.map +1 -1
  89. package/dist/migration-profile-registry.js +2 -10
  90. package/dist/monorepo-onboarding.js +2 -2
  91. package/dist/onboarding-report.d.ts.map +1 -1
  92. package/dist/onboarding-report.js +5 -1
  93. package/dist/onboarding.d.ts +1 -1
  94. package/dist/onboarding.d.ts.map +1 -1
  95. package/dist/onboarding.js +9 -66
  96. package/dist/ownership.js +2 -10
  97. package/dist/pack-contributions-inventory.d.ts +0 -1
  98. package/dist/pack-contributions-inventory.d.ts.map +1 -1
  99. package/dist/pack-contributions-inventory.js +17 -29
  100. package/dist/pack-helper-registry.d.ts.map +1 -1
  101. package/dist/pack-helper-registry.js +2 -10
  102. package/dist/pack-release-check.d.ts.map +1 -1
  103. package/dist/pack-release-check.js +4 -11
  104. package/dist/pack-signature-status.d.ts.map +1 -1
  105. package/dist/pack-signature-status.js +18 -2
  106. package/dist/pack-test-runner.js +2 -10
  107. package/dist/plan-review.d.ts.map +1 -1
  108. package/dist/plan-review.js +5 -10
  109. package/dist/plan-simulation.d.ts +13 -0
  110. package/dist/plan-simulation.d.ts.map +1 -1
  111. package/dist/plan-simulation.js +19 -28
  112. package/dist/playbook-registry.d.ts.map +1 -1
  113. package/dist/playbook-registry.js +2 -10
  114. package/dist/policy-engine.d.ts.map +1 -1
  115. package/dist/policy-engine.js +3 -11
  116. package/dist/policy-test.js +3 -11
  117. package/dist/profile-registry.d.ts +0 -1
  118. package/dist/profile-registry.d.ts.map +1 -1
  119. package/dist/profile-registry.js +4 -32
  120. package/dist/propose-knowledge.d.ts +15 -0
  121. package/dist/propose-knowledge.d.ts.map +1 -1
  122. package/dist/propose-knowledge.js +37 -4
  123. package/dist/quality-baseline.d.ts.map +1 -1
  124. package/dist/quality-baseline.js +3 -1
  125. package/dist/ranker-explainability.d.ts.map +1 -1
  126. package/dist/ranker-explainability.js +3 -9
  127. package/dist/registration-hint-registry.d.ts.map +1 -1
  128. package/dist/registration-hint-registry.js +2 -10
  129. package/dist/registry-lifecycle.d.ts +6 -0
  130. package/dist/registry-lifecycle.d.ts.map +1 -1
  131. package/dist/registry-lifecycle.js +137 -10
  132. package/dist/release-readiness.js +3 -3
  133. package/dist/repo-memory.d.ts.map +1 -1
  134. package/dist/repo-memory.js +3 -1
  135. package/dist/reposet.js +1 -1
  136. package/dist/repository-intelligence.d.ts.map +1 -1
  137. package/dist/repository-intelligence.js +7 -2
  138. package/dist/repository-knowledge-model.d.ts +1 -1
  139. package/dist/repository-knowledge-model.d.ts.map +1 -1
  140. package/dist/repository-stats.d.ts.map +1 -1
  141. package/dist/repository-stats.js +3 -1
  142. package/dist/resolve-verification-commands.d.ts +26 -0
  143. package/dist/resolve-verification-commands.d.ts.map +1 -0
  144. package/dist/resolve-verification-commands.js +55 -0
  145. package/dist/review-packet.d.ts.map +1 -1
  146. package/dist/review-packet.js +14 -17
  147. package/dist/rule-drift.d.ts.map +1 -1
  148. package/dist/rule-drift.js +24 -9
  149. package/dist/rule-scaffold.d.ts.map +1 -1
  150. package/dist/rule-scaffold.js +12 -4
  151. package/dist/scaffold-patterns.js +2 -10
  152. package/dist/schema-inventory.d.ts.map +1 -1
  153. package/dist/schema-inventory.js +3 -1
  154. package/dist/search-tuning-registry.d.ts.map +1 -1
  155. package/dist/search-tuning-registry.js +2 -10
  156. package/dist/self-config-doctor-v2.d.ts +1 -1
  157. package/dist/self-config-doctor-v2.d.ts.map +1 -1
  158. package/dist/self-config-doctor-v2.js +6 -10
  159. package/dist/self-config-doctor.d.ts.map +1 -1
  160. package/dist/self-config-doctor.js +7 -13
  161. package/dist/sharkcraft-inspector.d.ts +14 -0
  162. package/dist/sharkcraft-inspector.d.ts.map +1 -1
  163. package/dist/sharkcraft-inspector.js +103 -1
  164. package/dist/start-here.d.ts +2 -2
  165. package/dist/start-here.d.ts.map +1 -1
  166. package/dist/start-here.js +16 -1
  167. package/dist/synthesize-from-onboarding.d.ts +68 -0
  168. package/dist/synthesize-from-onboarding.d.ts.map +1 -0
  169. package/dist/synthesize-from-onboarding.js +508 -0
  170. package/dist/task-packet.d.ts +13 -0
  171. package/dist/task-packet.d.ts.map +1 -1
  172. package/dist/task-packet.js +59 -6
  173. package/dist/task-ranker.d.ts.map +1 -1
  174. package/dist/task-ranker.js +1 -31
  175. package/dist/task-routing-hint-registry.d.ts.map +1 -1
  176. package/dist/task-routing-hint-registry.js +2 -10
  177. package/dist/template-drift.d.ts +7 -0
  178. package/dist/template-drift.d.ts.map +1 -1
  179. package/dist/template-drift.js +14 -6
  180. package/dist/test-impact.d.ts.map +1 -1
  181. package/dist/test-impact.js +5 -2
  182. package/dist/test-runner.d.ts.map +1 -1
  183. package/dist/test-runner.js +12 -17
  184. package/dist/universal-search.d.ts +0 -1
  185. package/dist/universal-search.d.ts.map +1 -1
  186. package/dist/universal-search.js +0 -12
  187. package/dist/why-file.js +66 -22
  188. package/package.json +18 -18
  189. package/dist/plugin-lifecycle-profile-registry.d.ts +0 -52
  190. package/dist/plugin-lifecycle-profile-registry.d.ts.map +0 -1
  191. package/dist/plugin-lifecycle-profile-registry.js +0 -202
  192. package/dist/plugin-lifecycle.d.ts +0 -132
  193. package/dist/plugin-lifecycle.d.ts.map +0 -1
  194. package/dist/plugin-lifecycle.js +0 -477
@@ -1 +1 @@
1
- {"version":3,"file":"agent-brief.d.ts","sourceRoot":"","sources":["../src/agent-brief.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAS3E,OAAO,EAAuB,KAAK,eAAe,EAAE,MAAM,g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EAAkE;IAClE,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,oDAAoD;IACpD,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B,8CAA8C;IAC9C,MAAM,EAAE;QACN,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;QACzB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;QACrB,MAAM,EAAE,OAAO,CAAC;QAChB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;QACxB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;KAC1B,CAAC;IACF,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B,sEAAsE;IACtE,kBAAkB,EAAE,MAAM,CAAC;IAC3B,iDAAiD;IACjD,MAAM,CAAC,EAAE,SAAS,gBAAgB,EAAE,CAAC;CACtC;AA+XD,wBAAsB,eAAe,CACnC,UAAU,EAAE,qBAAqB,EACjC,KAAK,EAAE,gBAAgB,GACtB,OAAO,CAAC,WAAW,CAAC,CAyItB"}
@@ -149,15 +149,23 @@ function pipelineSection(packet) {
149
149
  function actionHintsSection(packet) {
150
150
  const lines = [];
151
151
  const h = packet.actionHints;
152
+ // h.commands is IActionHintCommand[] (objects with .command + optional
153
+ // .purpose); h.mcpTools is IActionHintMcpTool[] (.tool + .purpose).
154
+ // Earlier versions string-interpolated the whole object, producing
155
+ // `- [object Object]` in the rendered brief.
152
156
  if (h.commands.length > 0) {
153
157
  lines.push('**Commands:**');
154
- for (const c of h.commands.slice(0, 5))
155
- lines.push(`- \`${c}\``);
158
+ for (const c of h.commands.slice(0, 5)) {
159
+ const purpose = c.purpose ? ` — ${c.purpose}` : '';
160
+ lines.push(`- \`${c.command}\`${purpose}`);
161
+ }
156
162
  }
157
163
  if (h.mcpTools.length > 0) {
158
164
  lines.push('**MCP tools:**');
159
- for (const m of h.mcpTools.slice(0, 5))
160
- lines.push(`- \`${m}\``);
165
+ for (const m of h.mcpTools.slice(0, 5)) {
166
+ const purpose = m.purpose ? ` — ${m.purpose}` : '';
167
+ lines.push(`- \`${m.tool}\`${purpose}`);
168
+ }
161
169
  }
162
170
  if (h.verificationCommands.length > 0) {
163
171
  lines.push('**Verification:**');
@@ -233,8 +241,14 @@ function boundarySection(impact) {
233
241
  }
234
242
  return section('boundary', 'Boundary concerns', lines.join('\n'));
235
243
  }
244
+ /**
245
+ * Compute the deduplicated suggested-commands list. The result lands
246
+ * in `IAgentBrief.suggestedCommands` (JSON contract preserved); a
247
+ * markdown section is rendered ONLY if the list isn't already
248
+ * covered by action-hints + verification (which it usually is — the
249
+ * duplication was a major source of the ~100-line brief bloat).
250
+ */
236
251
  function suggestedCommandsSection(impact, packet) {
237
- const lines = [];
238
252
  const commands = new Set();
239
253
  for (const c of impact?.suggestedTestCommands ?? [])
240
254
  commands.add(c);
@@ -242,10 +256,21 @@ function suggestedCommandsSection(impact, packet) {
242
256
  commands.add(c);
243
257
  for (const c of packet.recommendedCliCommands ?? [])
244
258
  commands.add(c);
245
- for (const c of [...commands].slice(0, 10))
246
- lines.push(`- \`${c}\``);
259
+ // Already-shown set: verification commands + action-hint commands
260
+ // that are about to render in the actionHintsSection. Anything in
261
+ // that set should NOT also appear in "Suggested commands".
262
+ const alreadyShown = new Set();
263
+ for (const v of packet.actionHints.verificationCommands ?? [])
264
+ alreadyShown.add(v);
265
+ for (const c of packet.actionHints.commands ?? [])
266
+ alreadyShown.add(c.command);
267
+ const uniqueNew = [...commands].filter((c) => !alreadyShown.has(c));
268
+ if (uniqueNew.length === 0) {
269
+ return { section: null, commands: [...commands] };
270
+ }
271
+ const lines = uniqueNew.slice(0, 10).map((c) => `- \`${c}\``);
247
272
  return {
248
- section: section('suggested-commands', 'Suggested commands', lines.join('\n') || '_None._'),
273
+ section: section('suggested-commands', 'Suggested commands (not already listed above)', lines.join('\n')),
249
274
  commands: [...commands],
250
275
  };
251
276
  }
@@ -313,12 +338,31 @@ async function qualitySection(inspection, baselineFile) {
313
338
  ];
314
339
  return section('quality', 'Quality baseline', lines.join('\n'));
315
340
  }
341
+ /**
342
+ * Empty-section detector. A section is "empty" when its body is just
343
+ * an italicized placeholder like `_None._` / `_No impact analysis
344
+ * available._` / `_No ownership data._`. Suppressing these compresses
345
+ * the typical brief from ~100 lines to ~40 — Claude doesn't need to
346
+ * read "Policy concerns: _None detected._" to make a decision.
347
+ */
348
+ function isEmptyBody(body) {
349
+ const trimmed = body.trim();
350
+ if (!trimmed)
351
+ return true;
352
+ // Pure single-line italicized placeholder, e.g. `_None._` / `_No X data._`.
353
+ return /^_[^_]+_$/.test(trimmed);
354
+ }
316
355
  function sectionsToMarkdown(task, mode, sections) {
317
356
  const lines = [];
318
357
  lines.push(`# SharkCraft brief: ${task || '(no task)'}`);
319
358
  lines.push('');
320
- lines.push(`_Mode: \`${mode}\`${new Date().toISOString()}_`);
359
+ // Mode only timestamp adds noise to a "single page Claude reads
360
+ // first" doc. The IAgentBrief.generatedAt field still carries it
361
+ // for tooling that needs the timestamp.
362
+ lines.push(`_Mode: \`${mode}\`_`);
321
363
  for (const s of sections) {
364
+ if (isEmptyBody(s.body))
365
+ continue;
322
366
  lines.push('');
323
367
  lines.push(`## ${s.title}`);
324
368
  lines.push('');
@@ -398,7 +442,12 @@ export async function buildAgentBrief(inspection, input) {
398
442
  }
399
443
  // Always include suggested commands + safety.
400
444
  const { section: cmdSection, commands } = suggestedCommandsSection(impact, packet);
401
- sections.push(cmdSection);
445
+ // Only push when the section returns one — most briefs no longer
446
+ // include this section because everything it would list is already
447
+ // in action-hints / verification. The `commands` array still ships
448
+ // in IAgentBrief.suggestedCommands for tooling that consumes it.
449
+ if (cmdSection)
450
+ sections.push(cmdSection);
402
451
  sections.push(safetySection());
403
452
  // Apply per-section budgets when requested.
404
453
  const trimmedSections = input.sectionBudgets && Object.keys(input.sectionBudgets).length > 0
@@ -1 +1 @@
1
- {"version":3,"file":"agent-contract-gate.d.ts","sourceRoot":"","sources":["../src/agent-contract-gate.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,cAAc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MAAM,CAAC;IACf,aAAa,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sFAAsF;IACtF,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,mBAAmB,GAAG,sBAAsB,CAchF;AAeD;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,GAAE,IAAiB,GAAG,MAAM,GAAG,IAAI,CAazF;AA4ED,wBAAsB,kBAAkB,CACtC,UAAU,EAAE,qBAAqB,EACjC,QAAQ,EAAE,cAAc,EACxB,OAAO,GAAE,qBAA0B,GAClC,OAAO,CAAC,oBAAoB,CAAC,CAiR/B;AAED,wBAAgB,uBAAuB,CAAC,CAAC,EAAE,oBAAoB,GAAG,MAAM,CAoBvE;AAED,wBAAgB,2BAA2B,CAAC,CAAC,EAAE,oBAAoB,GAAG,MAAM,CAmB3E"}
@@ -31,12 +31,35 @@ export var ContractApprovalExpiryStatus;
31
31
  ContractApprovalExpiryStatus["Absent"] = "absent";
32
32
  })(ContractApprovalExpiryStatus || (ContractApprovalExpiryStatus = {}));
33
33
  const APPROVAL_SECRET_ENV_DEFAULT = 'SHARKCRAFT_CONTRACT_SECRET';
34
+ /**
35
+ * Deterministic JSON: keys sorted at EVERY depth, keys/values JSON-quoted.
36
+ * Critically NOT `JSON.stringify(obj, keysArray)` — an array replacer is a key
37
+ * ALLOWLIST applied at every nesting level, which silently DROPS nested-object
38
+ * keys (e.g. `forbiddenFilesDetailed` rule fields) from the hash input, letting
39
+ * a contract be tampered in a nested field without changing its hash and
40
+ * bypassing approval binding.
41
+ */
42
+ function canonicalJson(value) {
43
+ if (value === null || typeof value !== 'object')
44
+ return JSON.stringify(value);
45
+ if (Array.isArray(value))
46
+ return '[' + value.map((v) => canonicalJson(v)).join(',') + ']';
47
+ const keys = Object.keys(value).sort();
48
+ const parts = [];
49
+ for (const k of keys) {
50
+ const v = value[k];
51
+ if (v === undefined)
52
+ continue;
53
+ parts.push(JSON.stringify(k) + ':' + canonicalJson(v));
54
+ }
55
+ return '{' + parts.join(',') + '}';
56
+ }
34
57
  function canonicalContractJson(contract) {
35
58
  // Deterministic JSON for hashing — exclude `generatedAt` so hashes stay
36
59
  // stable across re-builds of the same task.
37
60
  const { generatedAt: _drop, ...rest } = contract;
38
61
  void _drop;
39
- return JSON.stringify(rest, Object.keys(rest).sort());
62
+ return canonicalJson(rest);
40
63
  }
41
64
  export function computeContractHash(contract) {
42
65
  const h = createHash('sha256');
@@ -46,7 +69,7 @@ export function computeContractHash(contract) {
46
69
  function canonicalApprovalJson(a) {
47
70
  const { signature: _drop, ...rest } = a;
48
71
  void _drop;
49
- return JSON.stringify(rest, Object.keys(rest).sort());
72
+ return canonicalJson(rest);
50
73
  }
51
74
  export function signApproval(a, secret) {
52
75
  const hmac = createHmac('sha256', secret);
@@ -1 +1 @@
1
- {"version":3,"file":"agent-instructions.d.ts","sourceRoot":"","sources":["../src/agent-instructions.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,QAoBvB,CAAC"}
1
+ {"version":3,"file":"agent-instructions.d.ts","sourceRoot":"","sources":["../src/agent-instructions.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,QA+BvB,CAAC"}
@@ -9,6 +9,17 @@ Default behavior:
9
9
  - For generation, list_templates → get_template → create_generation_plan (dry-run by default).
10
10
  - Respect path conventions (list_path_conventions, get_path_convention).
11
11
 
12
+ Understand existing code before you edit (prefer the graph over grep — it returns path:line truth):
13
+ - Who calls / where is a symbol used? call get_graph_callers or code_find_usages (returns path:line).
14
+ - What breaks if I change this file/symbol? call get_graph_impact.
15
+ - What is the load-bearing code (change carefully / understand first)? call get_graph_hubs — most-referenced symbols + most-imported files.
16
+ - Is code A actually wired to code B? call get_graph_path (shortest import/call/implements path between two files or symbols — the deterministic "is X wired to Y").
17
+ - Is X wired / how does this file connect (incl. subtypes/supertypes)? call get_graph_context (get_graph_search to locate it first).
18
+ - These read an index; if a graph tool reports it's missing or stale, run \`shrk graph index\` once.
19
+
20
+ Save your tokens on MECHANICAL edits — delegate them to a local worker:
21
+ - For a repetitive, deterministically-verifiable edit (add a barrel export, ensure an import, a glob-scoped rename) call delegate_task to get a compact brief + the exact \`shrk delegate run\` command, then run it. The local model produces the edit, the engine verifies it (and auto-reverts on failure), and you pay for the brief + result — not for reading the whole file and writing the edit yourself. \`shrk delegate list\` shows what's delegatable.
22
+
12
23
  Safety:
13
24
  - Never write files unless the user explicitly asks; always prefer dry-run first.
14
25
  - Never overwrite existing files unless the plan resolves all conflicts.
@@ -1 +1 @@
1
- {"version":3,"file":"agent-task-prep.d.ts","sourceRoot":"","sources":["../src/agent-task-prep.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAEvE,eAAO,MAAM,sBAAsB,kCAAkC,CAAC;AAEtE,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,MAAM,EAAE,OAAO,sBAAsB,CAAC;IAC/C,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;IACxC,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC;IAC/C,QAAQ,CAAC,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3C,QAAQ,CAAC,eAAe,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5C,QAAQ,CAAC,kBAAkB,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/C,QAAQ,CAAC,kBAAkB,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/C,QAAQ,CAAC,kBAAkB,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/C,QAAQ,CAAC,gBAAgB,EAAE,SAAS;QA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CAAC,kBAAkB,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/C,QAAQ,CAAC,kBAAkB,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/C,QAAQ,CAAC,gBAAgB,EAAE,SAAS;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACpE,QAAQ,CAAC,mBAAmB,EAAE,SAAS;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACvE,QAAQ,CAAC,YAAY,EAAE,SAAS;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAA;KAAE,EAAE,CAAC;IAC5F,QAAQ,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;IACxC,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;CACjC;AAED,wBAAsB,gBAAgB,CACpC,UAAU,EAAE,qBAAqB,EACjC,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,oBAAoB,CAAC,CAoD/B"}
@@ -13,7 +13,6 @@
13
13
  * Read-only. Never writes; never executes commands.
14
14
  */
15
15
  import { buildTaskPacket } from "./task-packet.js";
16
- import { listPluginLifecycleProfiles } from "./plugin-lifecycle-profile-registry.js";
17
16
  import { listConventions } from "./convention-registry.js";
18
17
  import { listTaskRoutingHints, explainTaskRouting } from "./task-routing-hint-registry.js";
19
18
  import { buildUncertaintySummary } from "./uncertainty.js";
@@ -21,7 +20,6 @@ export const AGENT_TASK_PREP_SCHEMA = 'sharkcraft.agent-task-prep/v1';
21
20
  export async function prepareAgentTask(inspection, task) {
22
21
  const packet = buildTaskPacket(inspection, task);
23
22
  const uncertaintyReport = buildUncertaintySummary(packet);
24
- const lifecycle = await listPluginLifecycleProfiles(inspection);
25
23
  const conventions = await listConventions(inspection);
26
24
  const routing = await explainTaskRouting(inspection, task);
27
25
  await listTaskRoutingHints(inspection); // warm cache
@@ -60,7 +58,7 @@ export async function prepareAgentTask(inspection, task) {
60
58
  inspectionCommands,
61
59
  generationCommands,
62
60
  validationCommands,
63
- relevantProfiles: lifecycle.slice(0, 5).map((e) => ({ id: e.profile.id, title: e.profile.title })),
61
+ relevantProfiles: [],
64
62
  relevantConventions: conventions.slice(0, 5).map((e) => ({ id: e.convention.id, title: e.convention.title })),
65
63
  routingHints: routing.slice(0, 5).map((m) => ({ id: m.hint.id, title: m.hint.title, reasons: m.reasons })),
66
64
  safetyNotes: [
@@ -1,30 +1,105 @@
1
1
  import type { ISharkcraftInspection } from './sharkcraft-inspector.js';
2
+ /**
3
+ * Per-dimension applies-to status.
4
+ *
5
+ * - `core` — dimension applies to this workspace shape; counted in the
6
+ * aggregate score.
7
+ * - `advisory` — dimension applies but is not load-bearing for the
8
+ * shape; shown in output, NOT counted in the aggregate, and does NOT
9
+ * produce a recommendation. Lets the user see "you could add this"
10
+ * without dragging the score down for a perfectly-shaped repo.
11
+ * - `n/a-for-shape` — dimension is irrelevant to this workspace shape
12
+ * (e.g. "templates" for a CLI library that doesn't scaffold
13
+ * anything). Hidden from default output, NOT counted, NO
14
+ * recommendation. Surfaced with `--show-na`.
15
+ */
16
+ export type DimensionAppliesTo = 'core' | 'advisory' | 'n/a-for-shape';
2
17
  export interface IReadinessDimension {
3
18
  id: string;
4
19
  title: string;
5
20
  /** 0–10 score. */
6
21
  score: number;
7
- /** Weight applied to the score in the final aggregate. */
22
+ /** Weight applied to the score in the final aggregate (only used when applies === 'core'). */
8
23
  weight: number;
9
24
  /** Free-form note explaining the score. */
10
25
  note: string;
26
+ /** Does this dimension apply to the detected workspace shape? */
27
+ applies: DimensionAppliesTo;
28
+ /** When applies !== 'core', a one-line reason the dimension was skipped. */
29
+ appliesReason?: string;
11
30
  }
12
31
  export type ReadinessGrade = 'excellent' | 'good' | 'partial' | 'poor';
32
+ /**
33
+ * One of four binary verdicts surfaced in the doctor output. Replaces
34
+ * the older "look at the 0-100 score" UX with a clear yes/no for the
35
+ * two questions users actually want answered.
36
+ */
37
+ export interface IReadinessVerdicts {
38
+ /** Can an AI agent rely on shrk to apply changes safely? */
39
+ readyForAgentWrites: boolean;
40
+ /** Can an AI agent use shrk's read-only surface (context / task)? */
41
+ readyForAgentReads: boolean;
42
+ /** Concrete things blocking `readyForAgentWrites`. */
43
+ blockers: readonly string[];
44
+ }
13
45
  export interface IReadinessReport {
14
- /** 0..100 weighted score. */
46
+ /** 0..100 weighted score, counting only `core` dimensions. */
15
47
  score: number;
16
48
  grade: ReadinessGrade;
17
49
  dimensions: IReadinessDimension[];
18
- /** Up to 5 prioritized actions to improve the score. */
50
+ /** Up to 5 prioritized actions to improve the score (only from core dims). */
19
51
  topRecommendations: string[];
52
+ /** Honest binary verdicts that don't depend on softcap scoring. */
53
+ verdicts: IReadinessVerdicts;
54
+ /** Detected workspace shape — drives which dimensions count as core. */
55
+ workspaceShape: IWorkspaceShape;
56
+ }
57
+ /**
58
+ * Coarse classification of the workspace, used to decide which readiness
59
+ * dimensions are load-bearing. Derived from `WorkspaceProfile[]`.
60
+ */
61
+ export interface IWorkspaceShape {
62
+ /** Best-effort one-line description of the shape. */
63
+ label: string;
64
+ /** True if the workspace publishes a library (no user-facing scaffolding). */
65
+ isLibrary: boolean;
66
+ /** True if the workspace runs a service (HTTP / queue / daemon). */
67
+ isService: boolean;
68
+ /** True if the workspace is a monorepo (Nx / Turborepo / pnpm-workspaces). */
69
+ isMonorepo: boolean;
70
+ /** True if the workspace owns end-user code (Angular app / Next.js app / Nest service / generic frontend / backend). */
71
+ isApplication: boolean;
20
72
  }
21
73
  /**
22
- * Deterministic 0..100 AI-readiness score. Penalties are explicit:
23
- * - Quantity-only "stuff a registry full of entries" is capped via softCap.
24
- * - Duplicate-id warnings reduce data-quality dimension.
25
- * - Placeholder docs (TODO / TBD / "fill in") reduce docs dimension.
26
- * - Critical/high workflow entries missing actionHints reduce safety dim.
27
- * - Doctor health stays a hard gate.
74
+ * Deterministic AI-readiness report.
75
+ *
76
+ * Replaces the original "single 0-100 score" UX with a shape-aware
77
+ * report. Each dimension is classified as:
78
+ *
79
+ * - `core` counts in the aggregate score; produces a recommendation
80
+ * when below threshold.
81
+ * - `advisory` — shown but doesn't drag the score down; no
82
+ * recommendation. Used for dimensions that are nice-to-have but
83
+ * not load-bearing for the detected workspace shape (e.g. docs in
84
+ * a CLI library).
85
+ * - `n/a-for-shape` — irrelevant to this workspace; hidden by
86
+ * default. Lets a CLI library skip "add templates" without
87
+ * manually suppressing every release.
88
+ *
89
+ * Two binary verdicts ride alongside the score:
90
+ * - `readyForAgentWrites` — every gate an autonomous agent would need
91
+ * before issuing `shrk apply` (config + cli-only safety + clean
92
+ * doctor).
93
+ * - `readyForAgentReads` — every gate a read-only agent (e.g. an MCP
94
+ * context lookup) would need (knowledge entries loaded + doctor
95
+ * clean).
96
+ *
97
+ * Numerical penalties stay explicit:
98
+ * - Quantity-only "stuff a registry full of entries" is capped via softCap.
99
+ * - Duplicate-id warnings reduce data-quality dimension.
100
+ * - Placeholder docs (TODO / TBD / "fill in") reduce docs dimension.
101
+ * - Critical/high workflow entries missing actionHints reduce safety dim.
102
+ * - Doctor health stays a hard gate.
28
103
  */
29
104
  export declare function buildAiReadinessReport(inspection: ISharkcraftInspection): IReadinessReport;
30
105
  //# sourceMappingURL=ai-readiness.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ai-readiness.d.ts","sourceRoot":"","sources":["../src/ai-readiness.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAIvE,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,kBAAkB;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,0DAA0D;IAC1D,MAAM,EAAE,MAAM,CAAC;IACf,2CAA2C;IAC3C,IAAI,EAAE,MAAM,CAAC;C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