@shrkcrft/cli 0.1.0-alpha.16 → 0.1.0-alpha.18

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 (45) hide show
  1. package/dist/command-registry.d.ts +28 -0
  2. package/dist/command-registry.d.ts.map +1 -1
  3. package/dist/command-registry.js +91 -1
  4. package/dist/commands/apply.command.d.ts.map +1 -1
  5. package/dist/commands/apply.command.js +10 -2
  6. package/dist/commands/command-catalog.d.ts.map +1 -1
  7. package/dist/commands/command-catalog.js +14 -0
  8. package/dist/commands/compress.command.d.ts +0 -7
  9. package/dist/commands/compress.command.d.ts.map +1 -1
  10. package/dist/commands/compress.command.js +35 -13
  11. package/dist/commands/delegate.command.d.ts +65 -0
  12. package/dist/commands/delegate.command.d.ts.map +1 -0
  13. package/dist/commands/delegate.command.js +657 -0
  14. package/dist/commands/deps-audit.command.js +5 -1
  15. package/dist/commands/dev.command.d.ts.map +1 -1
  16. package/dist/commands/dev.command.js +5 -1
  17. package/dist/commands/doctor.command.d.ts.map +1 -1
  18. package/dist/commands/doctor.command.js +24 -3
  19. package/dist/commands/graph-code-subverbs.d.ts +22 -0
  20. package/dist/commands/graph-code-subverbs.d.ts.map +1 -1
  21. package/dist/commands/graph-code-subverbs.js +450 -54
  22. package/dist/commands/graph.command.d.ts.map +1 -1
  23. package/dist/commands/graph.command.js +9 -3
  24. package/dist/commands/move-plan.command.js +1 -1
  25. package/dist/commands/smart-context.command.d.ts +26 -17
  26. package/dist/commands/smart-context.command.d.ts.map +1 -1
  27. package/dist/commands/smart-context.command.js +113 -16
  28. package/dist/commands/tests.command.d.ts.map +1 -1
  29. package/dist/commands/tests.command.js +13 -2
  30. package/dist/dashboard/code-intelligence-data.d.ts.map +1 -1
  31. package/dist/dashboard/code-intelligence-data.js +25 -3
  32. package/dist/main.d.ts.map +1 -1
  33. package/dist/main.js +21 -3
  34. package/dist/output/ccr-store-config.d.ts +18 -0
  35. package/dist/output/ccr-store-config.d.ts.map +1 -0
  36. package/dist/output/ccr-store-config.js +41 -0
  37. package/dist/output/output-compression.d.ts +15 -0
  38. package/dist/output/output-compression.d.ts.map +1 -0
  39. package/dist/output/output-compression.js +60 -0
  40. package/dist/output/resolve-compress-type.d.ts +22 -0
  41. package/dist/output/resolve-compress-type.d.ts.map +1 -0
  42. package/dist/output/resolve-compress-type.js +21 -0
  43. package/dist/validation/run-validation-loop.d.ts.map +1 -1
  44. package/dist/validation/run-validation-loop.js +5 -1
  45. package/package.json +33 -33
@@ -672,7 +672,11 @@ async function validateSession(args) {
672
672
  const allVerifications = flagBool(args, 'all-verifications');
673
673
  const allowPackCommands = flagBool(args, 'allow-pack-commands');
674
674
  const wantStrict = flagBool(args, 'strict');
675
- const wantReport = flagBool(args, 'report') !== false; // default: write report
675
+ // flagBool is two-valued (absent → false), so `flagBool(...) !== false` is
676
+ // false when the flag is absent — the opposite of the intended default. Read
677
+ // the raw value: write the report by default, opt out only via --report=false.
678
+ const reportFlag = args.flags.get('report');
679
+ const wantReport = reportFlag !== false && reportFlag !== 'false';
676
680
  const wantJson = flagBool(args, 'json');
677
681
  const startedAt = new Date().toISOString();
678
682
  const reportFileName = `validate-${startedAt.replace(/[:.]/g, '-')}.json`;
@@ -1 +1 @@
1
- {"version":3,"file":"doctor.command.d.ts","sourceRoot":"","sources":["../../src/commands/doctor.command.ts"],"names":[],"mappings":"AAqBA,OAAO,EAML,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;AA8OhC,eAAO,MAAM,aAAa,EAAE,eAW3B,CAAC;AA4eF,eAAO,MAAM,qBAAqB,EAAE,eAmCnC,CAAC;AAuDF,eAAO,MAAM,yBAAyB,EAAE,eAavC,CAAC;AAIF,eAAO,MAAM,wBAAwB,EAAE,eA2CtC,CAAC;AAgCF,eAAO,MAAM,6BAA6B,EAAE,eAa3C,CAAC"}
1
+ {"version":3,"file":"doctor.command.d.ts","sourceRoot":"","sources":["../../src/commands/doctor.command.ts"],"names":[],"mappings":"AAqBA,OAAO,EAML,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;AA6PhC,eAAO,MAAM,aAAa,EAAE,eAW3B,CAAC;AAwfF,eAAO,MAAM,qBAAqB,EAAE,eAmCnC,CAAC;AAuDF,eAAO,MAAM,yBAAyB,EAAE,eAavC,CAAC;AAIF,eAAO,MAAM,wBAAwB,EAAE,eA2CtC,CAAC;AAgCF,eAAO,MAAM,6BAA6B,EAAE,eAa3C,CAAC"}
@@ -179,7 +179,6 @@ function renderSemanticIndexCheck(report) {
179
179
  };
180
180
  }
181
181
  const driftCount = report.stale + report.missing + report.untracked;
182
- const driftPct = report.indexed > 0 ? (driftCount * 100) / report.indexed : 0;
183
182
  if (driftCount === 0) {
184
183
  return {
185
184
  id: 'semantic-index-fresh',
@@ -189,12 +188,26 @@ function renderSemanticIndexCheck(report) {
189
188
  category: 'semantic-index',
190
189
  };
191
190
  }
192
- const severity = driftPct >= 10 ? DoctorSeverity.Warning : DoctorSeverity.Info;
191
+ // Severity is driven only by *rot* indexed entries that changed (stale)
192
+ // or were deleted (missing), as a fraction of the indexed set. Newly added
193
+ // files (`untracked`) are benign growth, not drift: they aren't in the
194
+ // index yet so they can't return wrong hits, and they don't belong in a
195
+ // ratio whose denominator is the indexed set. The old fused "% drift"
196
+ // (stale+missing+untracked over indexed) tripped a yellow WARN purely on
197
+ // repo growth — exactly the "scary number" noise. The index is a derived
198
+ // cache, so this is always `advisory` (folds into the calm "N advisory"
199
+ // line and nudges a refresh) rather than a code-health defect; a deleted
200
+ // file can no longer reach a caller either, because searchFiles prunes
201
+ // on-disk-missing paths at query time.
202
+ const rotPct = report.indexed > 0 ? ((report.stale + report.missing) * 100) / report.indexed : 0;
203
+ const severity = rotPct >= 10 ? DoctorSeverity.Warning : DoctorSeverity.Info;
193
204
  return {
194
205
  id: 'semantic-index-stale',
195
206
  title: 'Semantic embedding index',
196
207
  severity,
197
- message: `${report.indexed} indexed; ${report.stale} stale, ${report.missing} deleted, ${report.untracked} new on disk (≈ ${Math.round(driftPct)}% drift).`,
208
+ advisory: true,
209
+ message: `Index drifted from disk — ${report.untracked} new, ${report.missing} deleted, ${report.stale} changed ` +
210
+ `(${report.indexed} indexed; ${Math.round(rotPct)}% stale/deleted).`,
198
211
  fix: 'shrk smart-context embeddings-build',
199
212
  category: 'semantic-index',
200
213
  };
@@ -478,6 +491,11 @@ async function doctorCommandImpl(args) {
478
491
  process.stdout.write('\n' + summary);
479
492
  }
480
493
  process.stdout.write('\n');
494
+ // How many of the warnings are routine index/cache maintenance (advisory
495
+ // staleness) rather than code-health defects. Surfaced as an additive
496
+ // sub-line so the headline count isn't misread as N real problems —
497
+ // these fold out under --show-advisory.
498
+ const maintenanceWarnings = visibleChecks.filter((c) => c.severity === DoctorSeverity.Warning && c.advisory).length;
481
499
  if (filtered) {
482
500
  const s = filtered.summary;
483
501
  process.stdout.write(`Summary: ${s.ok} ok, ${s.info} info, ${s.warnings} active warnings, ${s.errors} errors\n`);
@@ -491,6 +509,9 @@ async function doctorCommandImpl(args) {
491
509
  else {
492
510
  process.stdout.write(`Summary: ${result.summary.ok} ok, ${result.summary.info} info, ${result.summary.warnings} warnings, ${result.summary.errors} errors\n`);
493
511
  }
512
+ if (maintenanceWarnings > 0) {
513
+ process.stdout.write(` (${maintenanceWarnings} ${maintenanceWarnings === 1 ? 'warning is' : 'warnings are'} routine index/cache maintenance, not code-health defects — fold-out via --show-advisory)\n`);
514
+ }
494
515
  void buildSuppressionEntry;
495
516
  void doctorSuppressionsFile;
496
517
  void saveDoctorSuppressions;
@@ -7,5 +7,27 @@ export declare function runGraphStatus(args: ParsedArgs): Promise<number>;
7
7
  export declare function runGraphSearch(args: ParsedArgs): Promise<number>;
8
8
  export declare function runGraphContext(args: ParsedArgs): Promise<number>;
9
9
  export declare function runGraphImpact(args: ParsedArgs): Promise<number>;
10
+ /**
11
+ * `shrk graph hubs` — the most-depended-on code: symbols ranked by how many
12
+ * DISTINCT files reference them, files by how many import them. The
13
+ * "load-bearing code" an agent should change most carefully and a human should
14
+ * understand first — the natural companion to `graph impact` (impact = blast
15
+ * radius of ONE node; hubs = the nodes with the biggest blast radius).
16
+ */
17
+ export declare function runGraphHubs(args: ParsedArgs): Promise<number>;
10
18
  export declare function runGraphCallers(args: ParsedArgs): Promise<number>;
19
+ /**
20
+ * `shrk graph path <from> <to>` — does code A actually reach code B?
21
+ *
22
+ * The question the original feedback fell back to grep for ("is billing
23
+ * actually WIRED to checkout?"). `callers` = direct callers, `impact` =
24
+ * reverse closure, `graph why` = the KNOWLEDGE graph — none answers the
25
+ * forward CODE path between two symbols/files. This BFS does, over the
26
+ * import/call/reference/declare/re-export/extends/implements edges, and
27
+ * prints each hop with its edge kind (and call-site line) so the answer
28
+ * shows HOW they are wired, not just that they are. When A→B has no path it
29
+ * also checks B→A so "the dependency runs the other way" is reported instead
30
+ * of a bare "no".
31
+ */
32
+ export declare function runGraphPath(args: ParsedArgs): Promise<number>;
11
33
  //# sourceMappingURL=graph-code-subverbs.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"graph-code-subverbs.d.ts","sourceRoot":"","sources":["../../src/commands/graph-code-subverbs.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAoC,KAAK,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAQ3F,wBAAsB,aAAa,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAgBrE;AA4FD,wBAAsB,cAAc,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CA+DtE;AAiBD,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAwF1E;AAID,wBAAsB,YAAY,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAmEpE;AAID,wBAAsB,cAAc,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAiEtE;AAID,wBAAsB,cAAc,CA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