@shrkcrft/cli 0.1.0-alpha.24 → 0.1.0-alpha.26

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 (52) hide show
  1. package/dist/command-registry.d.ts +10 -0
  2. package/dist/command-registry.d.ts.map +1 -1
  3. package/dist/command-registry.js +16 -0
  4. package/dist/commands/changelog-data.d.ts +25 -0
  5. package/dist/commands/changelog-data.d.ts.map +1 -0
  6. package/dist/commands/changelog-data.js +94 -0
  7. package/dist/commands/changelog.command.d.ts +3 -0
  8. package/dist/commands/changelog.command.d.ts.map +1 -0
  9. package/dist/commands/changelog.command.js +100 -0
  10. package/dist/commands/changes.command.d.ts.map +1 -1
  11. package/dist/commands/changes.command.js +4 -0
  12. package/dist/commands/check.command.d.ts.map +1 -1
  13. package/dist/commands/check.command.js +134 -19
  14. package/dist/commands/command-catalog.d.ts.map +1 -1
  15. package/dist/commands/command-catalog.js +8 -0
  16. package/dist/commands/compress.command.d.ts.map +1 -1
  17. package/dist/commands/compress.command.js +46 -2
  18. package/dist/commands/constructs.command.d.ts.map +1 -1
  19. package/dist/commands/constructs.command.js +49 -14
  20. package/dist/commands/context.command.d.ts.map +1 -1
  21. package/dist/commands/context.command.js +31 -19
  22. package/dist/commands/gate.command.d.ts.map +1 -1
  23. package/dist/commands/gate.command.js +63 -3
  24. package/dist/commands/gen.command.d.ts.map +1 -1
  25. package/dist/commands/gen.command.js +65 -9
  26. package/dist/commands/graph-code-subverbs.d.ts.map +1 -1
  27. package/dist/commands/graph-code-subverbs.js +14 -2
  28. package/dist/commands/graph.command.d.ts.map +1 -1
  29. package/dist/commands/graph.command.js +68 -1
  30. package/dist/commands/policy-lint.command.d.ts.map +1 -1
  31. package/dist/commands/policy-lint.command.js +46 -8
  32. package/dist/commands/registry-resolve.d.ts +41 -0
  33. package/dist/commands/registry-resolve.d.ts.map +1 -0
  34. package/dist/commands/registry-resolve.js +89 -0
  35. package/dist/commands/registry.command.d.ts.map +1 -1
  36. package/dist/commands/registry.command.js +86 -13
  37. package/dist/commands/reuse.command.d.ts +20 -0
  38. package/dist/commands/reuse.command.d.ts.map +1 -1
  39. package/dist/commands/reuse.command.js +156 -20
  40. package/dist/commands/smart-context.command.d.ts.map +1 -1
  41. package/dist/commands/smart-context.command.js +20 -5
  42. package/dist/commands/task.command.d.ts.map +1 -1
  43. package/dist/commands/task.command.js +33 -16
  44. package/dist/exit-codes.d.ts +49 -0
  45. package/dist/exit-codes.d.ts.map +1 -0
  46. package/dist/exit-codes.js +61 -0
  47. package/dist/main.d.ts.map +1 -1
  48. package/dist/main.js +26 -1
  49. package/dist/validation/typecheck-emitted.d.ts +36 -0
  50. package/dist/validation/typecheck-emitted.d.ts.map +1 -0
  51. package/dist/validation/typecheck-emitted.js +109 -0
  52. package/package.json +33 -33
@@ -191,5 +191,15 @@ export interface IFlagListOptions {
191
191
  }
192
192
  export declare function flagList(args: ParsedArgs, name: string, options?: IFlagListOptions): string[];
193
193
  export declare function flagVars(args: ParsedArgs): Record<string, string>;
194
+ /**
195
+ * Return the first parsed flag whose name is NOT in `allowed`, or `undefined`
196
+ * when every flag is recognized. The parser does not reject unknown flags on its
197
+ * own — without a per-command allow-list a typo'd flag (`--no-such-flag`) parses
198
+ * as `true`, reads as a confident opt-in, and the verb runs the bare command at
199
+ * exit `0`. A verb that opts into strict flag handling calls this with its known
200
+ * set and rejects the result loudly, so a mistyped/renamed flag can never read
201
+ * as success (see docs/exit-codes.md · a25 §2.1).
202
+ */
203
+ export declare function firstUnknownFlag(args: ParsedArgs, allowed: ReadonlySet<string>): string | undefined;
194
204
  export {};
195
205
  //# sourceMappingURL=command-registry.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"command-registry.d.ts","sourceRoot":"","sources":["../src/command-registry.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,UAAU;IACzB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,M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QAAQ,CACtB,IAAI,EAAE,UAAU,EAChB,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,gBAAqB,GAC7B,MAAM,EAAE,CAkCV;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAQjE;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,UAAU,EAChB,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,GAC3B,MAAM,GAAG,SAAS,CAKpB"}
@@ -451,3 +451,19 @@ export function flagVars(args) {
451
451
  }
452
452
  return out;
453
453
  }
454
+ /**
455
+ * Return the first parsed flag whose name is NOT in `allowed`, or `undefined`
456
+ * when every flag is recognized. The parser does not reject unknown flags on its
457
+ * own — without a per-command allow-list a typo'd flag (`--no-such-flag`) parses
458
+ * as `true`, reads as a confident opt-in, and the verb runs the bare command at
459
+ * exit `0`. A verb that opts into strict flag handling calls this with its known
460
+ * set and rejects the result loudly, so a mistyped/renamed flag can never read
461
+ * as success (see docs/exit-codes.md · a25 §2.1).
462
+ */
463
+ export function firstUnknownFlag(args, allowed) {
464
+ for (const key of args.flags.keys()) {
465
+ if (!allowed.has(key))
466
+ return key;
467
+ }
468
+ return undefined;
469
+ }
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Machine-readable command-SURFACE delta, shipped inside the binary so
3
+ * `shrk changelog` is authoritative for the exact build in use and works
4
+ * offline. This is NOT the full human CHANGELOG.md — it records only the delta
5
+ * an agent needs to re-orient after an upgrade: which verbs/flags were added,
6
+ * which changed behavior, which were removed. Keep it in sync with CHANGELOG.md
7
+ * when a release lands; the version keys must match `SHARKCRAFT_VERSION`.
8
+ *
9
+ * Ordered oldest → newest; the renderer sorts as needed.
10
+ */
11
+ /** One version's command-surface delta. */
12
+ export interface IReleaseSurfaceDelta {
13
+ /** Exact release version, e.g. `0.1.0-alpha.24`. */
14
+ readonly version: string;
15
+ /** One-line headline for the release. */
16
+ readonly title: string;
17
+ /** New verbs / flags this version introduced. */
18
+ readonly added: readonly string[];
19
+ /** Verbs / flags whose behavior or defaults changed. */
20
+ readonly changed: readonly string[];
21
+ /** Verbs / flags removed or renamed away. */
22
+ readonly removed: readonly string[];
23
+ }
24
+ export declare const RELEASE_SURFACE_DELTAS: readonly IReleaseSurfaceDelta[];
25
+ //# sourceMappingURL=changelog-data.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"changelog-data.d.ts","sourceRoot":"","sources":["../../src/commands/changelog-data.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,2CAA2C;AAC3C,MAAM,WAAW,oBAAoB;IACnC,oDAAoD;IACpD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,yCAAyC;IACzC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,iDAAiD;IACjD,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,wDAAwD;IACxD,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,6CAA6C;IAC7C,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;CACrC;AAED,eAAO,MAAM,sBAAsB,EAAE,SAAS,oBAAoB,EAmFjE,CAAC"}
@@ -0,0 +1,94 @@
1
+ /**
2
+ * Machine-readable command-SURFACE delta, shipped inside the binary so
3
+ * `shrk changelog` is authoritative for the exact build in use and works
4
+ * offline. This is NOT the full human CHANGELOG.md — it records only the delta
5
+ * an agent needs to re-orient after an upgrade: which verbs/flags were added,
6
+ * which changed behavior, which were removed. Keep it in sync with CHANGELOG.md
7
+ * when a release lands; the version keys must match `SHARKCRAFT_VERSION`.
8
+ *
9
+ * Ordered oldest → newest; the renderer sorts as needed.
10
+ */
11
+ export const RELEASE_SURFACE_DELTAS = [
12
+ {
13
+ version: '0.1.0-alpha.23',
14
+ title: 'Correctness, gate trust, security & pack-distributable invariants',
15
+ added: [
16
+ '`shrk registry <name> list | exists <id> | where <id>` — declarable registry inventory (pack-distributable).',
17
+ '`shrk policy run --changed-only` / `--since` — finding-diff-scoped policy runs.',
18
+ '`shrk search tuning explain` — why a query ranked the way it did.',
19
+ ],
20
+ changed: [
21
+ '`graph context`/`search`/`callers`/`impact` report a true `total` + `truncated` instead of a silent per-file cap.',
22
+ 'Incremental reindex no longer drops inbound edges; renamed barrel re-exports (`export { X as Y }`) now resolve.',
23
+ ],
24
+ removed: [],
25
+ },
26
+ {
27
+ version: '0.1.0-alpha.24',
28
+ title: 'Runtime wiring, write-safety & the author loop',
29
+ added: [
30
+ '`shrk wiring chain | unprovided | orphans` — the registration/DI graph beside the import graph.',
31
+ '`shrk wiring test <candidate>` / `shrk check wiring --explain <ruleId>` — declared vs registered set, no config write.',
32
+ '`shrk trace "<literal>"` — generalize registry tracing to any cross-layer string contract.',
33
+ '`shrk check orphans [--since <ref>] [--staged]` — first-class diff-robust reverse-closure.',
34
+ '`shrk finish` (a.k.a. `review --run`) — one changed-only "safe to finish?" verdict.',
35
+ '`--limit N` (`--limit 0` = all) on graph read commands (default 50).',
36
+ ],
37
+ changed: [
38
+ '`shrk impact --deleted` no longer ENOBUFS — the git diff is streamed via a shared `runGitLines`.',
39
+ 'Pack-health scores quality (resolved cross-refs, runnable verification), not mere presence.',
40
+ '`compress --type code` is a real strategy (was markdown-only).',
41
+ ],
42
+ removed: [],
43
+ },
44
+ {
45
+ version: '0.1.0-alpha.25',
46
+ title: 'Earned & change-attributable verdicts',
47
+ added: [
48
+ '`shrk changelog [--since <version>] [--all] [--json]` — the command-surface delta of the running build.',
49
+ '`shrk registry <name> exists <id> --fail-if-taken | --fail-if-missing` — guard-mode exit codes for pre-author checks.',
50
+ '`shrk registry <name> exists <id> --resolve` — map a synonym to the canonical id (registry `aliases`) before the test.',
51
+ '`shrk check registry-lifecycle --changed-only` — diff-scoped lifecycle check that terminates in seconds.',
52
+ '`shrk gen --typecheck` — compile the emitted file set against the detected tsconfig as a PRE-WRITE gate (a template bug fails at generation and REFUSES the write; nothing lands on disk).',
53
+ '`shrk gen --print` — inspect the rendered file bodies in one step (alias of `--show-content`).',
54
+ '`shrk graph cycles --include-type-edges` — opt back into counting type-only import edges.',
55
+ '`shrk context` / `shrk task --summary` (`--brief`) — the terse orientation view (now opt-in).',
56
+ ],
57
+ changed: [
58
+ '`shrk check wiring --changed-only` never renders a green verdict over 0 evaluated rules; reports `M of N (K skipped)`.',
59
+ '`shrk check registry-lifecycle` no longer hangs — bounded scan + wall-clock budget + partial-result flush; skip-dirs are configurable via `registryLifecycle.skipDirs`.',
60
+ 'Cycle detection excludes type-only import edges by default (clears phantom architecture reds).',
61
+ '`shrk gate` is change-scoped by default — reds only on change-introduced findings; baseline debt is a non-blocking bucket.',
62
+ '`shrk context` / `shrk task` render the FULL body by default (parity with why/reuse/knowledge get).',
63
+ '`shrk reuse` applies a confidence floor (weak keyword collisions → did-you-mean, score exposed) and shows the consumer total.',
64
+ '`compress --type code` labels its lossy fidelity (banner + JSON `fidelity`).',
65
+ '`changes summary` attributes areas from the declared layer/area taxonomy instead of bucketing to `unknown`.',
66
+ '`smart-context "<task>"` accepts `--task`, and fails loud (banner) when the local model is degraded instead of returning a stale guide dump.',
67
+ ],
68
+ removed: [],
69
+ },
70
+ {
71
+ version: '0.1.0-alpha.26',
72
+ title: 'Honest exit codes',
73
+ added: [
74
+ 'A unified exit-code contract across every gate/verify/check verb: `0` verified pass, `1` failure, `2` NOT-verified (empty scope / degraded / timeout). See docs/exit-codes.md.',
75
+ 'Global `--strict` — promote a NOT-verified (`2`) verdict to a failure-class nonzero (`1`) across every gate, for a hard CI gate in one switch.',
76
+ '`shrk gate baseline --refreeze` — re-freeze the architecture baseline to the current state (operational reset).',
77
+ '`shrk check wiring --base <ref>` (synonym of `--since`); `check wiring` now shows the rule ids selected by footprint under a scoped run.',
78
+ '`shrk reuse … --all` — the full candidate catalog (default is now a scored top-K did-you-mean).',
79
+ ],
80
+ changed: [
81
+ '`shrk check wiring` (0 rules evaluated) and `shrk registry lifecycle` / `check registry-lifecycle` (0 registrations, or wall-clock timeout) now exit `2` (NOT verified), not a green `0` a chained `&& next` would march past.',
82
+ 'The graph/query family (`graph cycles|hubs|callers|impact|search|context|…`) rejects an unknown/misspelled flag (`unknown option --x`, exit `2`) instead of silently swallowing it as a confident success.',
83
+ 'Piping any streaming list (`… | head`, `| grep`) no longer crashes with `write EPIPE` — a downstream early-close is swallowed and the real exit code is preserved.',
84
+ '`shrk check wiring --help` documents its own scoping flags instead of running the bare check.',
85
+ '`shrk reuse "<intent>"` returns a scored top-K did-you-mean (score per row) on a weak/no-match intent instead of dumping the whole catalog.',
86
+ '`shrk registry <name> exists <id> --resolve` also normalizes (case-fold, singular/plural, suffix strip/append), not just the declared `aliases` map.',
87
+ '`shrk compress` prints a `fidelity: lossy|lossless|passthrough` banner on the human text path (parity with `--json`).',
88
+ '`shrk changes summary` ships a built-in config/tooling area for non-lib paths — only genuinely unclassifiable files stay `unknown`.',
89
+ '`shrk gen` saved plans persist the rendered file `body` + a per-entry `sha256` digest (reviewable/diffable/re-appliable), not just `sizeBytes`.',
90
+ '`shrk gate` counts only change-attributable (diff-vs-HEAD) architecture errors as blocking; stale-baseline drift in untouched files is informational.',
91
+ ],
92
+ removed: [],
93
+ },
94
+ ];
@@ -0,0 +1,3 @@
1
+ import { type ICommandHandler } from '../command-registry.js';
2
+ export declare const changelogCommand: ICommandHandler;
3
+ //# sourceMappingURL=changelog.command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"changelog.command.d.ts","sourceRoot":"","sources":["../../src/commands/changelog.command.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;AA4ChC,eAAO,MAAM,gBAAgB,EAAE,eA4D9B,CAAC"}
@@ -0,0 +1,100 @@
1
+ import { SHARKCRAFT_VERSION } from '@shrkcrft/shared';
2
+ import { flagBool, flagString, } from "../command-registry.js";
3
+ import { asJson, header } from "../output/format-output.js";
4
+ import { RELEASE_SURFACE_DELTAS } from "./changelog-data.js";
5
+ /** Parse `X.Y.Z[-alpha.N]` into a comparable tuple. A release outranks its prerelease. */
6
+ function parseVersion(v) {
7
+ const [coreStr, preStr] = v.replace(/^v/, '').split('-');
8
+ const parts = (coreStr ?? '').split('.').map((n) => Number(n) || 0);
9
+ const core = [parts[0] ?? 0, parts[1] ?? 0, parts[2] ?? 0];
10
+ // No prerelease sorts ABOVE any prerelease of the same core; a prerelease
11
+ // sorts by its trailing number (alpha.24 < alpha.25).
12
+ let pre = Number.POSITIVE_INFINITY;
13
+ if (preStr) {
14
+ const m = preStr.match(/(\d+)/);
15
+ pre = m ? Number(m[1]) : 0;
16
+ }
17
+ return { core, pre };
18
+ }
19
+ /** -1 / 0 / 1 comparator over version strings. */
20
+ function compareVersions(a, b) {
21
+ const pa = parseVersion(a);
22
+ const pb = parseVersion(b);
23
+ for (let i = 0; i < 3; i += 1) {
24
+ const d = (pa.core[i] ?? 0) - (pb.core[i] ?? 0);
25
+ if (d !== 0)
26
+ return d < 0 ? -1 : 1;
27
+ }
28
+ if (pa.pre === pb.pre)
29
+ return 0;
30
+ return pa.pre < pb.pre ? -1 : 1;
31
+ }
32
+ function renderDeltaText(d) {
33
+ const lines = [`\n${d.version} — ${d.title}`];
34
+ const section = (label, items) => {
35
+ if (items.length === 0)
36
+ return;
37
+ lines.push(` ${label}:`);
38
+ for (const it of items)
39
+ lines.push(` • ${it}`);
40
+ };
41
+ section('Added', d.added);
42
+ section('Changed', d.changed);
43
+ section('Removed', d.removed);
44
+ return lines.join('\n') + '\n';
45
+ }
46
+ export const changelogCommand = {
47
+ name: 'changelog',
48
+ description: "The shrk command-surface delta of the running build — which verbs/flags were added, changed, or removed. Sourced from an in-binary release-notes asset (offline, authoritative for this exact build). `--since <version>` shows the cumulative delta since a prior version.",
49
+ usage: 'shrk changelog [--since <version>] [--all] [--json]',
50
+ booleanFlags: new Set(['all', 'json']),
51
+ run(args) {
52
+ const wantJson = flagBool(args, 'json');
53
+ const since = flagString(args, 'since');
54
+ const all = flagBool(args, 'all');
55
+ const current = SHARKCRAFT_VERSION;
56
+ // Newest-first for display.
57
+ const sorted = [...RELEASE_SURFACE_DELTAS].sort((a, b) => compareVersions(b.version, a.version));
58
+ let selected;
59
+ let scope;
60
+ if (all) {
61
+ selected = sorted;
62
+ scope = 'all recorded versions';
63
+ }
64
+ else if (since) {
65
+ // Cumulative delta: every recorded version strictly newer than `since`.
66
+ selected = sorted.filter((d) => compareVersions(d.version, since) > 0);
67
+ scope = `since ${since}`;
68
+ }
69
+ else {
70
+ // Default: the entry matching the running build, else the newest recorded.
71
+ const exact = sorted.find((d) => compareVersions(d.version, current) === 0);
72
+ selected = exact ? [exact] : sorted.slice(0, 1);
73
+ scope = exact ? `running build (${current})` : `latest recorded (running build ${current} has no recorded surface delta)`;
74
+ }
75
+ if (wantJson) {
76
+ process.stdout.write(asJson({
77
+ schema: 'sharkcraft.changelog/v1',
78
+ runningVersion: current,
79
+ scope,
80
+ ...(since ? { since } : {}),
81
+ count: selected.length,
82
+ versions: selected,
83
+ }) + '\n');
84
+ return 0;
85
+ }
86
+ process.stdout.write(header(`shrk changelog — ${scope}`));
87
+ if (selected.length === 0) {
88
+ process.stdout.write(since
89
+ ? ` No recorded surface changes since ${since}.\n`
90
+ : ' No recorded surface changes.\n');
91
+ return 0;
92
+ }
93
+ for (const d of selected)
94
+ process.stdout.write(renderDeltaText(d));
95
+ if (!all && !since) {
96
+ process.stdout.write('\n(pass --since <version> for the cumulative delta, or --all for every recorded version.)\n');
97
+ }
98
+ return 0;
99
+ },
100
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"changes.command.d.ts","sourceRoot":"","sources":["../../src/commands/changes.command.ts"],"names":[],"mappings":"AAiBA,OAAO,EAKL,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;AA2HhC,eAAO,MAAM,cAAc,EAAE,eAwB5B,CAAC"}
1
+ {"version":3,"file":"changes.command.d.ts","sourceRoot":"","sources":["../../src/commands/changes.command.ts"],"names":[],"mappings":"AAiBA,OAAO,EAKL,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;AAiIhC,eAAO,MAAM,cAAc,EAAE,eAwB5B,CAAC"}
@@ -59,6 +59,10 @@ async function runChangesSummary(args) {
59
59
  for (const [area, list] of Object.entries(report.filesByArea)) {
60
60
  process.stdout.write(` ${area.padEnd(20)} (${list.length})\n`);
61
61
  }
62
+ if (report.unknownFiles > 0) {
63
+ process.stdout.write(` ! ${report.unknownFiles}/${report.totalFiles} file(s) (${Math.round(report.unknownRate * 100)}%) matched no declared area — ` +
64
+ 'the layer/area taxonomy may be missing globs (classifier diagnostic, not a low-risk signal).\n');
65
+ }
62
66
  if (report.touchedMcpTools.length > 0) {
63
67
  process.stdout.write('\nMCP tools touched (verify read-only invariant):\n');
64
68
  for (const m of report.touchedMcpTools)
@@ -1 +1 @@
1
- {"version":3,"file":"check.command.d.ts","sourceRoot":"","sources":["../../src/commands/check.command.ts"],"names":[],"mappings":"AAoBA,OAAO,EAML,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;AAkzBhC,eAAO,MAAM,YAAY,EAAE,eA0E1B,CAAC"}
1
+ {"version":3,"file":"check.command.d.ts","sourceRoot":"","sources":["../../src/commands/check.command.ts"],"names":[],"mappings":"AAoBA,OAAO,EAML,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;AAu4BhC,eAAO,MAAM,YAAY,EAAE,eA+G1B,CAAC"}
@@ -3,6 +3,7 @@ import { mkdirSync, writeFileSync, readFileSync, existsSync } from 'node:fs';
3
3
  import * as nodePath from 'node:path';
4
4
  import { flagBool, flagNumber, flagString, flagVars, resolveCwd, } from "../command-registry.js";
5
5
  import { asJson, header, kv } from "../output/format-output.js";
6
+ import { ExitCode } from "../exit-codes.js";
6
7
  import { maybeRunInWatchMode } from "../output/watch-loop.js";
7
8
  import { computeDeletedOrphans } from "../diff/deleted-orphans.js";
8
9
  import { renderWiringExplain } from "./wiring.command.js";
@@ -522,11 +523,29 @@ async function checkBoundariesOnce(args) {
522
523
  // ────────────────────────────────────────────────────────────────────────
523
524
  // Subcommand: wiring — "declared but not wired" completeness checks
524
525
  // ────────────────────────────────────────────────────────────────────────
526
+ const WIRING_CHECK_USAGE = 'shrk check wiring [--changed-only] [--since <ref>] [--base <ref>] [--only <ids>] [--explain <ruleId>] [--json] [--strict]\n' +
527
+ ' Cross-file "declared but not wired" completeness gate. Scope flags select rules by\n' +
528
+ ' FOOTPRINT — a rule fires when the diff touches EITHER its declared or its registered\n' +
529
+ ' side (so a registration edited in file B fires a rule declared in file A).\n' +
530
+ ' --changed-only run only rules whose footprint intersects the working diff\n' +
531
+ ' --since <ref> scope the diff to changes since <ref> (--base is a synonym)\n' +
532
+ ' --only <ids> run only these rule ids (comma-separated)\n' +
533
+ ' --explain <id> dry-run ONE rule and print the declared/registered sets it extracts\n' +
534
+ ' Exit: 0 verified pass · 1 violations · 2 not-verified (0 rules evaluated in scope).';
525
535
  async function checkWiring(args) {
526
536
  const cwd = resolveCwd(args);
537
+ // `--help`/`-h` on the subverb documents its own scoping flags instead of
538
+ // silently running the bare check (a25 §3.2). The check dispatcher doesn't
539
+ // intercept a subverb-level `--help`, so handle it here.
540
+ if (flagBool(args, 'help') || flagBool(args, 'h')) {
541
+ process.stdout.write(WIRING_CHECK_USAGE + '\n');
542
+ return 0;
543
+ }
527
544
  const wantJson = flagBool(args, 'json');
528
545
  const changedOnly = flagBool(args, 'changed-only');
529
- const since = flagString(args, 'since');
546
+ // `--base <ref>` is an accepted synonym for `--since <ref>` (a25 §3.2)
547
+ // scope the footprint diff to changes since an arbitrary ref.
548
+ const since = flagString(args, 'since') ?? flagString(args, 'base');
530
549
  const only = flagString(args, 'only');
531
550
  // Distinguish "config is invalid" from "config valid with no wiring rules":
532
551
  // an invalid config (e.g. a malformed wiringRule) must NOT fail open with a
@@ -593,20 +612,70 @@ async function checkWiring(args) {
593
612
  const report = planeDiagnostics.length > 0
594
613
  ? { ...reportRaw, diagnostics: [...reportRaw.diagnostics, ...planeDiagnostics] }
595
614
  : reportRaw;
615
+ // Truthful evaluation accounting so a subset run never reads as a full green.
616
+ // configured — every wiring rule declared (the honest denominator).
617
+ // selected — rules that survived --changed-only / --only narrowing.
618
+ // evaluated — rules that actually ran a comparison (globs matched >0 files).
619
+ // skippedByScope — configured − selected (dropped by the diff/only narrowing).
620
+ // matchedNothing — selected − evaluated (in scope but matched 0 files).
621
+ const configured = rules.length;
622
+ const selected = report.rules.length;
623
+ const evaluated = report.evaluated;
624
+ const skippedByScope = Math.max(0, configured - selected);
625
+ const matchedNothing = Math.max(0, selected - evaluated);
626
+ const notVerified = Math.max(0, configured - evaluated);
627
+ const allEvaluated = evaluated === configured;
628
+ const scopeNote = changedOnly || since ? ' by --changed-only' : '';
629
+ const parts = [];
630
+ if (skippedByScope > 0)
631
+ parts.push(`${skippedByScope} skipped${scopeNote}`);
632
+ if (matchedNothing > 0)
633
+ parts.push(`${matchedNothing} matched no files`);
634
+ const breakdown = parts.length > 0 ? ` (${parts.join(', ')})` : '';
635
+ // Rule ids selected by footprint (declared OR registered side intersecting the
636
+ // diff) — positive evidence the gate ran the RIGHT rules for the change's
637
+ // blast radius, not just the rules whose literal files were edited (a25 §3.2).
638
+ const selectedRuleIds = report.rules.map((r) => r.ruleId);
639
+ const scoped = changedOnly || since !== undefined;
596
640
  if (wantJson) {
597
- process.stdout.write(asJson(report) + '\n');
598
- return report.verdict === 'errors' ? 1 : 0;
641
+ // Carry the honest counts so a machine consumer can tell "0 evaluated" from
642
+ // a real green, and see how many rules the scope skipped + which fired.
643
+ process.stdout.write(asJson({
644
+ ...report,
645
+ configured,
646
+ selected,
647
+ evaluated,
648
+ skippedByScope,
649
+ matchedNothing,
650
+ notVerified,
651
+ selectedRuleIds,
652
+ // Distinguish verified-pass / failure / not-verified for a chained gate.
653
+ exitCode: evaluated === 0 ? ExitCode.NotVerified : report.verdict === 'errors' ? ExitCode.Failure : ExitCode.VerifiedPass,
654
+ }) + '\n');
655
+ // `evaluated === 0` = nothing checked in scope → NOT verified (`2`), never a
656
+ // silent `0` an agent's `&& next` would march past (a25 §1.1).
657
+ return evaluated === 0
658
+ ? ExitCode.NotVerified
659
+ : report.verdict === 'errors'
660
+ ? ExitCode.Failure
661
+ : ExitCode.VerifiedPass;
599
662
  }
600
663
  process.stdout.write(header('Wiring check'));
601
664
  // `evaluated` counts rules that actually ran a comparison (globs matched >0
602
665
  // files). When 0 rules evaluated but rules ARE configured, say so loudly —
603
- // "checked nothing" must never read as the green "every token is wired" pass.
604
- if (report.evaluated === 0) {
605
- process.stdout.write(` ! Nothing evaluated ${report.rules.length} rule(s) configured but none matched files in scope` +
606
- (changedOnly || since ? ' (changed-only).\n' : '.\n'));
607
- return 0;
666
+ // "checked nothing" must never read as the green "every token is wired" pass,
667
+ // and the exit code must say NOT verified (`2`) too, not a lying `0`.
668
+ if (evaluated === 0) {
669
+ process.stdout.write(` ! 0 rules evaluated NOT verified. ${configured} rule(s) configured${breakdown}; ` +
670
+ 'none ran a comparison in scope. Wiring was not checked — this is not a pass.\n');
671
+ return ExitCode.NotVerified;
672
+ }
673
+ process.stdout.write(kv('rules evaluated', `${evaluated} of ${configured}${breakdown}`) + '\n');
674
+ if (scoped && selectedRuleIds.length > 0) {
675
+ // Show WHICH rules the diff's footprint selected so the scoping is provable,
676
+ // not indistinguishable from plain changed-file scoping.
677
+ process.stdout.write(kv('selected by footprint', selectedRuleIds.join(', ')) + '\n');
608
678
  }
609
- process.stdout.write(kv('rules evaluated', `${report.evaluated} of ${report.rules.length}`) + '\n');
610
679
  const errors = report.violations.filter((v) => v.severity === 'error').length;
611
680
  const warnings = report.violations.filter((v) => v.severity === 'warning').length;
612
681
  process.stdout.write(kv('violations', `${errors} error(s), ${warnings} warning(s)`) + '\n');
@@ -618,7 +687,16 @@ async function checkWiring(args) {
618
687
  process.stdout.write(` ! ${d}\n`);
619
688
  }
620
689
  if (report.violations.length === 0 && report.diagnostics.length === 0) {
621
- process.stdout.write('\nNo wiring violations — every declared token is registered. ✓\n');
690
+ if (allEvaluated) {
691
+ // Every configured rule ran — the earned full green.
692
+ process.stdout.write('\nNo wiring violations — every declared token is registered. ✓\n');
693
+ }
694
+ else {
695
+ // A subset ran: no violations AMONG WHAT RAN, but not a full green. Never
696
+ // print the unqualified "every declared token is wired" success sentence.
697
+ process.stdout.write(`\nNo wiring violations among the ${evaluated} rule(s) evaluated — ` +
698
+ `${notVerified} of ${configured} NOT verified${breakdown}. Not a full green.\n`);
699
+ }
622
700
  return 0;
623
701
  }
624
702
  if (report.violations.length === 0) {
@@ -756,21 +834,58 @@ export const checkCommand = {
756
834
  return checkOrphans(args);
757
835
  if (sub === 'registry-lifecycle') {
758
836
  const cwd = resolveCwd(args);
837
+ const changedOnly = flagBool(args, 'changed-only');
838
+ const since = flagString(args, 'since');
839
+ const scope = flagString(args, 'scope');
759
840
  const { buildRegistryLifecycleReport, renderRegistryLifecycleReportText } = await import('@shrkcrft/inspector');
760
- // The scan is a single synchronous pass with no streamed output; on a
761
- // large repo it can run for tens of seconds. Without a heartbeat that
762
- // silence reads as a hang, so announce the work first (human path only —
763
- // JSON consumers want a clean stdout).
764
- if (!flagBool(args, 'json')) {
765
- process.stderr.write('⏳ Scanning source + registries for lifecycle coverage (can take a while on large repos)…\n');
841
+ // `--changed-only` scopes the scan to the diff (tracked + untracked), so it
842
+ // runs inline in seconds; the full-tree scan is bounded by a wall-clock
843
+ // budget and flushes partial results on timeout instead of hanging.
844
+ let files;
845
+ if (changedOnly || since) {
846
+ const changed = resolveChangedFiles({
847
+ projectRoot: cwd,
848
+ ...(since ? { since } : {}),
849
+ ...(changedOnly && !since ? { includeWorktree: true } : {}),
850
+ });
851
+ files = changed.files;
852
+ }
853
+ // Full-tree walk honors the project's skipDirs override (so a repo that
854
+ // registers code under tools/ etc. isn't blinded by the default set).
855
+ let skipDirs;
856
+ if (files === undefined) {
857
+ const loaded = await resolveProjectConfig(cwd);
858
+ if (loaded.ok)
859
+ skipDirs = loaded.value.config.registryLifecycle?.skipDirs;
860
+ }
861
+ // Only the slow full-tree path needs the heartbeat (JSON keeps stdout clean).
862
+ if (!flagBool(args, 'json') && files === undefined) {
863
+ process.stderr.write('⏳ Scanning source + registries for lifecycle coverage (bounded by a wall-clock budget)…\n');
766
864
  }
767
- const report = buildRegistryLifecycleReport({ projectRoot: cwd });
865
+ const report = buildRegistryLifecycleReport({
866
+ projectRoot: cwd,
867
+ ...(files !== undefined ? { files } : {}),
868
+ ...(scope ? { scope } : {}),
869
+ ...(skipDirs ? { skipDirs } : {}),
870
+ });
871
+ // Honest exit-code contract (a25 §1 / §2.5):
872
+ // timedOut → NOT verified (2): the budget flushed partial results.
873
+ // registersFound=0 → NOT verified (2): nothing to check in scope — a
874
+ // "nothing to verify" run must never read as a green
875
+ // pass (an agent's `&& next` would march past it).
876
+ // missingRemovers>0 → failure (1).
877
+ // otherwise → verified pass (0).
878
+ const exit = report.timedOut || report.registersFound === 0
879
+ ? ExitCode.NotVerified
880
+ : report.missingRemovers.length === 0
881
+ ? ExitCode.VerifiedPass
882
+ : ExitCode.Failure;
768
883
  if (flagBool(args, 'json')) {
769
884
  process.stdout.write(asJson(report) + '\n');
770
- return report.missingRemovers.length === 0 ? 0 : 1;
885
+ return exit;
771
886
  }
772
887
  process.stdout.write(renderRegistryLifecycleReportText(report));
773
- return report.missingRemovers.length === 0 ? 0 : 1;
888
+ return exit;
774
889
  }
775
890
  const inspection = await inspectSharkcraft({ cwd: resolveCwd(args) });
776
891
  const readiness = buildAiReadinessReport(inspection);
@@ -1 +1 @@
1
- {"version":3,"file":"command-catalog.d.ts","sourceRoot":"","sources":["../../src/commands/command-catalog.ts"],"names":[],"mappings":"AAAA,oBAAY,WAAW;IACrB,QAAQ,cAAc;IACtB,iBAAiB,mBAAmB;IACpC,gBAAgB,kBAAkB;IAClC,YAAY,kBAAkB;IAC9B,SAAS,eAAe;IACxB,cAAc,oBAAoB;CAC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/C,IAAI,EAAE,SAAS,uBAAuB,EAAE,GACvC,MAAM,CAaR;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,IAAI,GAAG,CAAC,MAAM,CAAC,CAW/C"}
@@ -1160,6 +1160,14 @@ export const COMMAND_CATALOG = Object.freeze([
1160
1160
  safetyLevel: SafetyLevel.ReadOnly,
1161
1161
  surface: CommandSurface.Common,
1162
1162
  }),
1163
+ entry({
1164
+ command: 'changelog',
1165
+ description: 'The shrk command-surface delta of the running build (added / changed / removed verbs & flags). `--since <version>` for the cumulative delta; offline, authoritative for this exact build.',
1166
+ category: 'meta',
1167
+ safetyLevel: SafetyLevel.ReadOnly,
1168
+ surface: CommandSurface.Common,
1169
+ intendedAudience: [CommandAudience.Human, CommandAudience.Agent],
1170
+ }),
1163
1171
  entry({
1164
1172
  command: 'completion',
1165
1173
  description: 'Print a sourcable shell-completion script for the `shrk` CLI (bash | zsh | fish). Pipe into your shell rc.',
@@ -1 +1 @@
1
- {"version":3,"file":"compress.command.d.ts","sourceRoot":"","sources":["../../src/commands/compress.command.ts"],"names":[],"mappings":"AAQA,OAAO,EAKL,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;AAqEhC,eAAO,MAAM,eAAe,EAAE,eAoG7B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,eA4B3B,CAAC"}
1
+ {"version":3,"file":"compress.command.d.ts","sourceRoot":"","sources":["../../src/commands/compress.command.ts"],"names":[],"mappings":"AASA,OAAO,EAKL,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;AA8FhC,eAAO,MAAM,eAAe,EAAE,eA0H7B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,eA4B3B,CAAC"}