@shrkcrft/cli 0.1.0-alpha.22 → 0.1.0-alpha.24
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.
- package/dist/command-registry.d.ts +9 -0
- package/dist/command-registry.d.ts.map +1 -1
- package/dist/command-registry.js +15 -0
- package/dist/commands/ai-status.command.d.ts.map +1 -1
- package/dist/commands/ai-status.command.js +10 -0
- package/dist/commands/apply.command.d.ts.map +1 -1
- package/dist/commands/apply.command.js +9 -2
- package/dist/commands/ask.command.d.ts.map +1 -1
- package/dist/commands/ask.command.js +2 -1
- package/dist/commands/changes.command.d.ts.map +1 -1
- package/dist/commands/changes.command.js +14 -4
- package/dist/commands/check.command.d.ts.map +1 -1
- package/dist/commands/check.command.js +139 -7
- package/dist/commands/command-catalog.d.ts +11 -0
- package/dist/commands/command-catalog.d.ts.map +1 -1
- package/dist/commands/command-catalog.js +291 -0
- package/dist/commands/commands.command.d.ts +15 -0
- package/dist/commands/commands.command.d.ts.map +1 -1
- package/dist/commands/commands.command.js +162 -3
- package/dist/commands/compress.command.d.ts.map +1 -1
- package/dist/commands/compress.command.js +39 -4
- package/dist/commands/context.command.d.ts.map +1 -1
- package/dist/commands/context.command.js +3 -1
- package/dist/commands/daily.commands.d.ts.map +1 -1
- package/dist/commands/daily.commands.js +48 -5
- package/dist/commands/diff-check.command.d.ts.map +1 -1
- package/dist/commands/diff-check.command.js +6 -2
- package/dist/commands/feedback.command.d.ts.map +1 -1
- package/dist/commands/feedback.command.js +4 -0
- package/dist/commands/finish.command.d.ts +3 -0
- package/dist/commands/finish.command.d.ts.map +1 -0
- package/dist/commands/finish.command.js +70 -0
- package/dist/commands/framework.command.d.ts.map +1 -1
- package/dist/commands/framework.command.js +20 -3
- package/dist/commands/gate.command.d.ts.map +1 -1
- package/dist/commands/gate.command.js +98 -13
- package/dist/commands/graph-code-subverbs.d.ts.map +1 -1
- package/dist/commands/graph-code-subverbs.js +215 -81
- package/dist/commands/graph.command.d.ts.map +1 -1
- package/dist/commands/graph.command.js +6 -0
- package/dist/commands/help.command.d.ts.map +1 -1
- package/dist/commands/help.command.js +20 -2
- package/dist/commands/impact.command.d.ts.map +1 -1
- package/dist/commands/impact.command.js +86 -1
- package/dist/commands/knowledge.command.d.ts.map +1 -1
- package/dist/commands/knowledge.command.js +21 -1
- package/dist/commands/onboard.command.d.ts.map +1 -1
- package/dist/commands/onboard.command.js +11 -2
- package/dist/commands/orchestrate.command.d.ts.map +1 -1
- package/dist/commands/orchestrate.command.js +6 -1
- package/dist/commands/pack-author.command.d.ts.map +1 -1
- package/dist/commands/pack-author.command.js +13 -1
- package/dist/commands/packs.command.d.ts.map +1 -1
- package/dist/commands/packs.command.js +95 -17
- package/dist/commands/paths.command.d.ts.map +1 -1
- package/dist/commands/paths.command.js +8 -1
- package/dist/commands/pipelines.command.d.ts.map +1 -1
- package/dist/commands/pipelines.command.js +2 -1
- package/dist/commands/plan-context.command.d.ts.map +1 -1
- package/dist/commands/plan-context.command.js +6 -3
- package/dist/commands/plan-simulate.command.js +1 -1
- package/dist/commands/policy-lint.command.d.ts.map +1 -1
- package/dist/commands/policy-lint.command.js +20 -7
- package/dist/commands/recommend.command.d.ts.map +1 -1
- package/dist/commands/recommend.command.js +10 -2
- package/dist/commands/registry.command.d.ts.map +1 -1
- package/dist/commands/registry.command.js +117 -9
- package/dist/commands/report.command.js +1 -1
- package/dist/commands/reuse.command.d.ts.map +1 -1
- package/dist/commands/reuse.command.js +17 -5
- package/dist/commands/review.command.d.ts.map +1 -1
- package/dist/commands/review.command.js +20 -2
- package/dist/commands/rule-graph-subverbs.d.ts.map +1 -1
- package/dist/commands/rule-graph-subverbs.js +31 -4
- package/dist/commands/search-structural.command.d.ts.map +1 -1
- package/dist/commands/search-structural.command.js +2 -2
- package/dist/commands/search.command.d.ts.map +1 -1
- package/dist/commands/search.command.js +19 -1
- package/dist/commands/simulate.command.d.ts.map +1 -1
- package/dist/commands/simulate.command.js +6 -1
- package/dist/commands/smart-context.command.d.ts.map +1 -1
- package/dist/commands/smart-context.command.js +101 -41
- package/dist/commands/spec.command.d.ts.map +1 -1
- package/dist/commands/spec.command.js +73 -13
- package/dist/commands/task-context.command.d.ts.map +1 -1
- package/dist/commands/task-context.command.js +26 -2
- package/dist/commands/test.command.d.ts.map +1 -1
- package/dist/commands/test.command.js +17 -0
- package/dist/commands/trace.command.d.ts.map +1 -1
- package/dist/commands/trace.command.js +87 -4
- package/dist/commands/wiring.command.d.ts +12 -0
- package/dist/commands/wiring.command.d.ts.map +1 -0
- package/dist/commands/wiring.command.js +384 -0
- package/dist/diff/collect-changed-paths.d.ts +5 -3
- package/dist/diff/collect-changed-paths.d.ts.map +1 -1
- package/dist/diff/collect-changed-paths.js +73 -36
- package/dist/diff/deleted-orphans.d.ts +42 -0
- package/dist/diff/deleted-orphans.d.ts.map +1 -0
- package/dist/diff/deleted-orphans.js +46 -0
- package/dist/finish/run-finish.d.ts +62 -0
- package/dist/finish/run-finish.d.ts.map +1 -0
- package/dist/finish/run-finish.js +239 -0
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +19 -1
- package/dist/status/freshness.d.ts +30 -0
- package/dist/status/freshness.d.ts.map +1 -0
- package/dist/status/freshness.js +81 -0
- package/package.json +33 -33
|
@@ -149,6 +149,15 @@ export declare function resolveCwd(args: ParsedArgs): string;
|
|
|
149
149
|
export declare function flagString(args: ParsedArgs, name: string): string | undefined;
|
|
150
150
|
export declare function flagBool(args: ParsedArgs, name: string): boolean;
|
|
151
151
|
export declare function flagNumber(args: ParsedArgs, name: string): number | undefined;
|
|
152
|
+
/**
|
|
153
|
+
* Parse a `--limit`/`--depth`-style flag as a positive integer, falling back to
|
|
154
|
+
* `fallback` when the flag is absent OR malformed (non-numeric, NaN, <= 0,
|
|
155
|
+
* non-integer). Guards the `Number(flagString(...))` footgun where a
|
|
156
|
+
* fat-fingered `--limit abc` becomes NaN and silently yields empty-or-unbounded
|
|
157
|
+
* results (`[].slice(0, NaN) === []`, `x >= NaN === false`). Use everywhere a
|
|
158
|
+
* count/cap is read from a flag.
|
|
159
|
+
*/
|
|
160
|
+
export declare function flagPositiveInt(args: ParsedArgs, name: string, fallback: number): number;
|
|
152
161
|
/**
|
|
153
162
|
* Canonical multi-value flag parser.
|
|
154
163
|
*
|
|
@@ -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,MAAM,GAAG,OAAO,CAAC,CAAC;IACrC,0EAA0E;IAC1E,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAClC,4EAA4E;IAC5E,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACnC,GAAG,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;CACjD;AAED;;;;;GAKG;AACH,UAAU,gBAAgB;IACxB,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IACjD,QAAQ,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACvC;AAMD,mDAAmD;AACnD,MAAM,WAAW,kBAAkB;IACjC,mFAAmF;IACnF,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,sEAAsE;IACtE,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,0EAA0E;IAC1E,IAAI,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;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,gBAAgB;IAC/B,0EAA0E;IAC1E,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,qEAAqE;IACrE,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1B;;;;;;;;;OASG;IACH,KAAK,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;CACrC;AAED,wBAAgB,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"}
|
package/dist/command-registry.js
CHANGED
|
@@ -396,6 +396,21 @@ export function flagNumber(args, name) {
|
|
|
396
396
|
const n = Number(v);
|
|
397
397
|
return Number.isFinite(n) ? n : undefined;
|
|
398
398
|
}
|
|
399
|
+
/**
|
|
400
|
+
* Parse a `--limit`/`--depth`-style flag as a positive integer, falling back to
|
|
401
|
+
* `fallback` when the flag is absent OR malformed (non-numeric, NaN, <= 0,
|
|
402
|
+
* non-integer). Guards the `Number(flagString(...))` footgun where a
|
|
403
|
+
* fat-fingered `--limit abc` becomes NaN and silently yields empty-or-unbounded
|
|
404
|
+
* results (`[].slice(0, NaN) === []`, `x >= NaN === false`). Use everywhere a
|
|
405
|
+
* count/cap is read from a flag.
|
|
406
|
+
*/
|
|
407
|
+
export function flagPositiveInt(args, name, fallback) {
|
|
408
|
+
const v = args.flags.get(name);
|
|
409
|
+
if (typeof v !== 'string')
|
|
410
|
+
return fallback;
|
|
411
|
+
const n = Number(v);
|
|
412
|
+
return Number.isFinite(n) && n > 0 ? Math.floor(n) : fallback;
|
|
413
|
+
}
|
|
399
414
|
export function flagList(args, name, options = {}) {
|
|
400
415
|
const split = options.split ?? 'always';
|
|
401
416
|
const raw = args.multiFlags.get(name) ?? [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-status.command.d.ts","sourceRoot":"","sources":["../../src/commands/ai-status.command.ts"],"names":[],"mappings":"AAOA,OAAO,EAIL,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;AAGhC;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,eAAe,EAAE,
|
|
1
|
+
{"version":3,"file":"ai-status.command.d.ts","sourceRoot":"","sources":["../../src/commands/ai-status.command.ts"],"names":[],"mappings":"AAOA,OAAO,EAIL,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;AAGhC;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,eAAe,EAAE,eA+D7B,CAAC"}
|
|
@@ -34,9 +34,15 @@ export const aiStatusCommand = {
|
|
|
34
34
|
? await pingProvider(selection.provider, pingTimeoutMs)
|
|
35
35
|
: { ok: false, reason: 'no provider reachable — nothing to ping', elapsedMs: 0 };
|
|
36
36
|
}
|
|
37
|
+
// Freshness-shaped signal, consistent with the other status commands:
|
|
38
|
+
// the LLM wiring is `fresh` when a provider is reachable (and the optional
|
|
39
|
+
// ping succeeded), else `stale` — i.e. shrk is on the deterministic
|
|
40
|
+
// baseline and the setup hints apply.
|
|
41
|
+
const state = ai.reachable && (!ping || ping.ok) ? 'fresh' : 'stale';
|
|
37
42
|
if (json) {
|
|
38
43
|
process.stdout.write(asJson({
|
|
39
44
|
ai,
|
|
45
|
+
state,
|
|
40
46
|
...(ping ? { ping } : {}),
|
|
41
47
|
}) + '\n');
|
|
42
48
|
return ai.reachable && (!ping || ping.ok) ? 0 : 1;
|
|
@@ -45,6 +51,10 @@ export const aiStatusCommand = {
|
|
|
45
51
|
process.stdout.write(kv('reachable', ai.reachable ? 'yes' : 'no') + '\n');
|
|
46
52
|
process.stdout.write(kv('requested provider', ai.requestedProvider) + '\n');
|
|
47
53
|
process.stdout.write(kv('resolved provider', ai.providerId ?? '(none)') + '\n');
|
|
54
|
+
process.stdout.write(kv('state', state) + '\n');
|
|
55
|
+
if (state === 'stale') {
|
|
56
|
+
process.stdout.write('! stale — no AI provider reachable; running on the deterministic baseline. See the setup hints below.\n');
|
|
57
|
+
}
|
|
48
58
|
if (ping) {
|
|
49
59
|
process.stdout.write(kv('ping', ping.ok
|
|
50
60
|
? `ok in ${ping.elapsedMs}ms` + (ping.model ? ` (model: ${ping.model})` : '')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply.command.d.ts","sourceRoot":"","sources":["../../src/commands/apply.command.ts"],"names":[],"mappings":"AAqDA,OAAO,EAKL,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;AAyLhC,eAAO,MAAM,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"apply.command.d.ts","sourceRoot":"","sources":["../../src/commands/apply.command.ts"],"names":[],"mappings":"AAqDA,OAAO,EAKL,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;AAyLhC,eAAO,MAAM,YAAY,EAAE,eAwsB1B,CAAC"}
|
|
@@ -407,7 +407,12 @@ export const applyCommand = {
|
|
|
407
407
|
livePlan = result.value.plan;
|
|
408
408
|
}
|
|
409
409
|
const diff = diffPlanChanges(saved, livePlan);
|
|
410
|
-
|
|
410
|
+
// Divergence acceptance is decoupled from the overwrite strategy: only the
|
|
411
|
+
// explicit --allow-divergent waives a divergence refusal. --force selects
|
|
412
|
+
// the overwrite strategy and must NOT double as a silent divergence bypass
|
|
413
|
+
// (a signed-but-drifted plan would otherwise apply while printing
|
|
414
|
+
// "Signature: verified"). A user who wants both passes --force --allow-divergent.
|
|
415
|
+
if (diff.length > 0 && !allowDivergent) {
|
|
411
416
|
if (!wantJson) {
|
|
412
417
|
process.stdout.write('Plan diverged from the saved version:\n');
|
|
413
418
|
for (const d of diff) {
|
|
@@ -462,7 +467,9 @@ export const applyCommand = {
|
|
|
462
467
|
// continue to carry their structured folderOps verbatim.
|
|
463
468
|
const liveFolderOps = plannedFolderOps;
|
|
464
469
|
const folderOpDiff = diffPlanFolderOps(saved, liveFolderOps);
|
|
465
|
-
|
|
470
|
+
// Same decoupling as the file-op divergence gate above: --force is the
|
|
471
|
+
// overwrite strategy only; --allow-divergent is the explicit waiver.
|
|
472
|
+
if (folderOpDiff.length > 0 && !allowDivergent) {
|
|
466
473
|
if (!wantJson) {
|
|
467
474
|
process.stdout.write('Folder-op set diverged from the saved version:\n');
|
|
468
475
|
for (const d of folderOpDiff) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ask.command.d.ts","sourceRoot":"","sources":["../../src/commands/ask.command.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ask.command.d.ts","sourceRoot":"","sources":["../../src/commands/ask.command.ts"],"names":[],"mappings":"AAYA,OAAO,EAKL,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;AAIhC,eAAO,MAAM,UAAU,EAAE,eA8DxB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { inspectSharkcraft, buildProjectOverview, renderOverviewText } from '@shrkcrft/inspector';
|
|
1
|
+
import { inspectSharkcraft, buildProjectOverview, renderOverviewText, contextTuningBoostFor, } from '@shrkcrft/inspector';
|
|
2
2
|
import { buildContext } from '@shrkcrft/context';
|
|
3
3
|
import { AiMessageRole, buildPromptMessages, selectAiProvider, } from '@shrkcrft/ai';
|
|
4
4
|
import { flagBool, flagNumber, flagString, resolveCwd, } from "../command-registry.js";
|
|
@@ -24,6 +24,7 @@ export const askCommand = {
|
|
|
24
24
|
task: question,
|
|
25
25
|
maxTokens,
|
|
26
26
|
projectOverview: renderOverviewText(overview),
|
|
27
|
+
boostFor: contextTuningBoostFor(inspection, question),
|
|
27
28
|
});
|
|
28
29
|
const messages = buildPromptMessages({
|
|
29
30
|
systemPreamble: 'You are an AI engineer working in a SharkCraft-instrumented repository. Use the supplied repository context as authoritative ground truth. Quote knowledge entry ids you used.',
|
|
@@ -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;
|
|
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"}
|
|
@@ -14,7 +14,11 @@ async function runChangesSummary(args) {
|
|
|
14
14
|
const inspection = await inspectSharkcraft({ cwd });
|
|
15
15
|
const since = flagString(args, 'since');
|
|
16
16
|
const staged = flagBool(args, 'staged');
|
|
17
|
-
|
|
17
|
+
// `--files a,b` OR bare positional args after the subverb
|
|
18
|
+
// (`shrk changes summary a.ts b.ts`). Positionals were dropped silently
|
|
19
|
+
// before, yielding a confident full-diff / "0 files" with exit 0.
|
|
20
|
+
const filesFlag = flagList(args, 'files');
|
|
21
|
+
const files = filesFlag.length ? filesFlag : args.positional;
|
|
18
22
|
// Optional round / label propagated into the report.
|
|
19
23
|
const roundLabel = flagString(args, 'round') ?? flagString(args, 'label');
|
|
20
24
|
const opts = {};
|
|
@@ -79,7 +83,9 @@ async function runChangesAcceptanceReplay(args) {
|
|
|
79
83
|
const inspection = await inspectSharkcraft({ cwd });
|
|
80
84
|
const since = flagString(args, 'since');
|
|
81
85
|
const staged = flagBool(args, 'staged');
|
|
82
|
-
|
|
86
|
+
// `--files a,b` OR bare positional args after the subverb (see above).
|
|
87
|
+
const filesFlag = flagList(args, 'files');
|
|
88
|
+
const files = filesFlag.length ? filesFlag : args.positional;
|
|
83
89
|
const roundLabel = flagString(args, 'round') ?? flagString(args, 'label');
|
|
84
90
|
const profileRaw = flagString(args, 'profile') ?? 'changed-only';
|
|
85
91
|
const profile = (() => {
|
|
@@ -136,12 +142,16 @@ async function runChangesAcceptanceReplay(args) {
|
|
|
136
142
|
export const changesCommand = {
|
|
137
143
|
name: 'changes',
|
|
138
144
|
description: 'Changes summary — grouped diff over --since/--staged/--files. Supports --round label and `changes acceptance-replay`. Read-only.',
|
|
139
|
-
usage: 'shrk changes <summary|impact|report|acceptance-replay> [--since <ref>] [--staged] [--
|
|
145
|
+
usage: 'shrk changes <summary|impact|report|acceptance-replay> [files... | --files a,b,c] [--since <ref>] [--staged] [--round <name>] [--profile changed-only|standard|strict] [--format text|markdown|json] [--output <file>]',
|
|
146
|
+
booleanFlags: new Set(['json', 'staged']),
|
|
140
147
|
async run(args) {
|
|
141
148
|
const sub = args.positional[0];
|
|
142
149
|
const sliced = { ...args, positional: args.positional.slice(1) };
|
|
150
|
+
// Always dispatch on the sliced args so positionals AFTER the subverb
|
|
151
|
+
// become the file list (handled in the runners). Passing the un-sliced
|
|
152
|
+
// `args` here used to leak the subverb token (e.g. "summary") forward.
|
|
143
153
|
if (sub === 'summary' || sub === undefined)
|
|
144
|
-
return runChangesSummary(sliced
|
|
154
|
+
return runChangesSummary(sliced);
|
|
145
155
|
if (sub === 'report')
|
|
146
156
|
return runChangesSummary(sliced);
|
|
147
157
|
if (sub === 'impact')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check.command.d.ts","sourceRoot":"","sources":["../../src/commands/check.command.ts"],"names":[],"mappings":"
|
|
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,13 +1,14 @@
|
|
|
1
|
-
import { buildAiReadinessReport, buildImportHygieneReport, buildPackDoctorReport, ChangedScopeMode, diagnoseActionHints, emitImportHygieneAllowlistDraft, filterViolationsToChangedScope, ImportHygieneFindingKind, inspectSharkcraft, isTodoReason, renderImportHygieneText, resolveChangedFiles, runDoctor, suggestBoundaryFixes, } from '@shrkcrft/inspector';
|
|
1
|
+
import { buildAiReadinessReport, buildImportHygieneReport, buildPackDoctorReport, ChangedScopeMode, diagnoseActionHints, emitImportHygieneAllowlistDraft, filterViolationsToChangedScope, ImportHygieneFindingKind, inspectSharkcraft, isTodoReason, renderImportHygieneText, resolveChangedFiles, resolveProjectConfig, runDoctor, suggestBoundaryFixes, } from '@shrkcrft/inspector';
|
|
2
2
|
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
6
|
import { maybeRunInWatchMode } from "../output/watch-loop.js";
|
|
7
|
+
import { computeDeletedOrphans } from "../diff/deleted-orphans.js";
|
|
8
|
+
import { renderWiringExplain } from "./wiring.command.js";
|
|
7
9
|
import { validateTemplateVariables } from '@shrkcrft/templates';
|
|
8
10
|
import { FileChangeType, planGeneration } from '@shrkcrft/generator';
|
|
9
|
-
import { evaluateBoundaries, loadTsconfigPaths, runWiring, scanImports, summarizeImports, } from '@shrkcrft/boundaries';
|
|
10
|
-
import { loadProjectConfig } from '@shrkcrft/config';
|
|
11
|
+
import { evaluateBoundaries, explainWiring, loadTsconfigPaths, runWiring, scanImports, summarizeImports, } from '@shrkcrft/boundaries';
|
|
11
12
|
function knowledgeGroup(inspection) {
|
|
12
13
|
const dup = inspection.validationIssues.filter((i) => i.code === 'duplicate-id');
|
|
13
14
|
const missing = inspection.validationIssues.filter((i) => i.code !== 'duplicate-id');
|
|
@@ -530,7 +531,7 @@ async function checkWiring(args) {
|
|
|
530
531
|
// Distinguish "config is invalid" from "config valid with no wiring rules":
|
|
531
532
|
// an invalid config (e.g. a malformed wiringRule) must NOT fail open with a
|
|
532
533
|
// misleading "no rules configured" + exit 0.
|
|
533
|
-
const loaded = await
|
|
534
|
+
const loaded = await resolveProjectConfig(cwd);
|
|
534
535
|
if (!loaded.ok) {
|
|
535
536
|
const msg = loaded.error.message;
|
|
536
537
|
if (wantJson) {
|
|
@@ -542,6 +543,28 @@ async function checkWiring(args) {
|
|
|
542
543
|
return 1;
|
|
543
544
|
}
|
|
544
545
|
const rules = loaded.value.config.wiringRules ?? [];
|
|
546
|
+
const planeDiagnostics = loaded.value.planeDiagnostics;
|
|
547
|
+
// `--explain <ruleId>`: dry-run ONE rule and print the declared + registered
|
|
548
|
+
// sets it extracts (file:line), the set-difference, and the verdict — the
|
|
549
|
+
// author-loop view of what the gate sees, without re-running the whole gate.
|
|
550
|
+
if (args.flags.has('explain')) {
|
|
551
|
+
const explainId = flagString(args, 'explain');
|
|
552
|
+
if (!explainId) {
|
|
553
|
+
process.stderr.write('Usage: shrk check wiring --explain <ruleId> [--json]\n');
|
|
554
|
+
return 2;
|
|
555
|
+
}
|
|
556
|
+
const rule = rules.find((r) => r.id === explainId);
|
|
557
|
+
if (!rule) {
|
|
558
|
+
const ids = rules.map((r) => r.id);
|
|
559
|
+
if (wantJson) {
|
|
560
|
+
process.stdout.write(asJson({ ok: false, error: 'not-found', ruleId: explainId, available: ids }) + '\n');
|
|
561
|
+
return 2;
|
|
562
|
+
}
|
|
563
|
+
process.stderr.write(`No wiring rule "${explainId}". Configured rules: ${ids.length > 0 ? ids.join(', ') : '(none)'}\n`);
|
|
564
|
+
return 2;
|
|
565
|
+
}
|
|
566
|
+
return renderWiringExplain(explainWiring(cwd, rule), wantJson);
|
|
567
|
+
}
|
|
545
568
|
if (rules.length === 0) {
|
|
546
569
|
if (wantJson) {
|
|
547
570
|
process.stdout.write(asJson({ schema: 'sharkcraft.wiring/v1', rules: [], violations: [], verdict: 'pass' }) + '\n');
|
|
@@ -561,16 +584,29 @@ async function checkWiring(args) {
|
|
|
561
584
|
});
|
|
562
585
|
changedFiles = changed.files;
|
|
563
586
|
}
|
|
564
|
-
const
|
|
587
|
+
const reportRaw = runWiring(cwd, rules, {
|
|
565
588
|
...(changedOnly || since ? { changedOnly: true, changedFiles: changedFiles ?? [] } : {}),
|
|
566
589
|
...(only ? { only: only.split(',').map((s) => s.trim()).filter(Boolean) } : {}),
|
|
567
590
|
});
|
|
591
|
+
// Surface pack-plane merge notes (missing/invalid pack rule files, dropped
|
|
592
|
+
// collisions) alongside the rule engine's own misconfiguration diagnostics.
|
|
593
|
+
const report = planeDiagnostics.length > 0
|
|
594
|
+
? { ...reportRaw, diagnostics: [...reportRaw.diagnostics, ...planeDiagnostics] }
|
|
595
|
+
: reportRaw;
|
|
568
596
|
if (wantJson) {
|
|
569
597
|
process.stdout.write(asJson(report) + '\n');
|
|
570
598
|
return report.verdict === 'errors' ? 1 : 0;
|
|
571
599
|
}
|
|
572
600
|
process.stdout.write(header('Wiring check'));
|
|
573
|
-
|
|
601
|
+
// `evaluated` counts rules that actually ran a comparison (globs matched >0
|
|
602
|
+
// 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;
|
|
608
|
+
}
|
|
609
|
+
process.stdout.write(kv('rules evaluated', `${report.evaluated} of ${report.rules.length}`) + '\n');
|
|
574
610
|
const errors = report.violations.filter((v) => v.severity === 'error').length;
|
|
575
611
|
const warnings = report.violations.filter((v) => v.severity === 'warning').length;
|
|
576
612
|
process.stdout.write(kv('violations', `${errors} error(s), ${warnings} warning(s)`) + '\n');
|
|
@@ -606,14 +642,108 @@ async function checkWiring(args) {
|
|
|
606
642
|
}
|
|
607
643
|
return report.verdict === 'errors' ? 1 : 0;
|
|
608
644
|
}
|
|
645
|
+
/**
|
|
646
|
+
* `shrk check orphans [--since <ref>] [--staged]`: first-class, diff-robust
|
|
647
|
+
* reverse-closure over REMOVED files. Reads the deleted files from the diff
|
|
648
|
+
* (vs `--since`, or the staged index with `--staged`) and queries the
|
|
649
|
+
* code-graph snapshot for surviving files that still import them or reference a
|
|
650
|
+
* symbol they declared — alias-resolved, incl. barrel re-exports. Each survivor
|
|
651
|
+
* is an error with `file:line`; the type checker misses a deleted barrel
|
|
652
|
+
* re-export or string-keyed registration, so this is a write-safety guard an
|
|
653
|
+
* agent can't replicate natively. Generalizes `impact --deleted`; pairs with
|
|
654
|
+
* the composite `finish` gate.
|
|
655
|
+
*/
|
|
656
|
+
async function checkOrphans(args) {
|
|
657
|
+
const cwd = resolveCwd(args);
|
|
658
|
+
const wantJson = flagBool(args, 'json');
|
|
659
|
+
const since = flagString(args, 'since');
|
|
660
|
+
const staged = flagBool(args, 'staged');
|
|
661
|
+
const scan = await computeDeletedOrphans(cwd, {
|
|
662
|
+
...(since ? { since } : {}),
|
|
663
|
+
...(staged ? { staged: true } : {}),
|
|
664
|
+
});
|
|
665
|
+
if (!scan.ok) {
|
|
666
|
+
if (wantJson) {
|
|
667
|
+
process.stdout.write(asJson({
|
|
668
|
+
schema: 'sharkcraft.deleted-orphans/v1',
|
|
669
|
+
error: scan.error,
|
|
670
|
+
reason: scan.reason,
|
|
671
|
+
orphans: [],
|
|
672
|
+
}) + '\n');
|
|
673
|
+
return 2;
|
|
674
|
+
}
|
|
675
|
+
process.stdout.write(header('Orphan check'));
|
|
676
|
+
process.stdout.write(scan.reason === 'diff-unavailable'
|
|
677
|
+
? ` ✗ Cannot resolve diff: ${scan.error ?? 'unknown'}\n`
|
|
678
|
+
: ` ✗ ${scan.error ?? 'orphan check unavailable'}\n`);
|
|
679
|
+
return 2;
|
|
680
|
+
}
|
|
681
|
+
const scopeLabel = staged ? 'staged' : `vs ${scan.ref}`;
|
|
682
|
+
// Nothing deleted → there is nothing to check. Report a LOUD skip, not a
|
|
683
|
+
// green "no orphans" — "checked nothing" must never read as "verified clean".
|
|
684
|
+
if (scan.deleted.length === 0) {
|
|
685
|
+
if (wantJson) {
|
|
686
|
+
process.stdout.write(asJson({
|
|
687
|
+
schema: 'sharkcraft.deleted-orphans/v1',
|
|
688
|
+
skipped: true,
|
|
689
|
+
ref: scan.ref,
|
|
690
|
+
resolvedDeleted: [],
|
|
691
|
+
unresolvedDeleted: [],
|
|
692
|
+
orphans: [],
|
|
693
|
+
diagnostics: [`no deleted files (${scopeLabel}) — nothing to check`],
|
|
694
|
+
}) + '\n');
|
|
695
|
+
return 0;
|
|
696
|
+
}
|
|
697
|
+
process.stdout.write(header('Orphan check'));
|
|
698
|
+
process.stdout.write(` ! Nothing deleted (${scopeLabel}) — orphan check skipped.\n`);
|
|
699
|
+
return 0;
|
|
700
|
+
}
|
|
701
|
+
const report = scan.report;
|
|
702
|
+
if (wantJson) {
|
|
703
|
+
process.stdout.write(asJson(report) + '\n');
|
|
704
|
+
return report.orphans.length > 0 ? 1 : 0;
|
|
705
|
+
}
|
|
706
|
+
process.stdout.write(header('Orphan check'));
|
|
707
|
+
process.stdout.write(kv('deleted files', `${scan.deleted.length} (${scopeLabel})`) + '\n');
|
|
708
|
+
if (report.orphans.length === 0) {
|
|
709
|
+
process.stdout.write('\nNo orphaned importers — nothing still references the deleted code. ✓\n');
|
|
710
|
+
for (const d of report.diagnostics.slice(0, 5))
|
|
711
|
+
process.stdout.write(` ! ${d}\n`);
|
|
712
|
+
return 0;
|
|
713
|
+
}
|
|
714
|
+
process.stdout.write(`\n${report.orphans.length} surviving importer(s) still reference deleted code:\n`);
|
|
715
|
+
for (const o of report.orphans.slice(0, 100)) {
|
|
716
|
+
const loc = o.path ? `${o.path}${o.line ? `:${o.line}` : ''}` : o.id;
|
|
717
|
+
const detail = o.via === 'reference' && o.symbol ? `references \`${o.symbol}\`` : 'imports';
|
|
718
|
+
process.stdout.write(` ✗ ${loc} ${detail} from deleted ${o.deletedFile}\n`);
|
|
719
|
+
}
|
|
720
|
+
if (report.orphans.length > 100) {
|
|
721
|
+
process.stdout.write(` … (${report.orphans.length - 100} more)\n`);
|
|
722
|
+
}
|
|
723
|
+
for (const d of report.diagnostics.slice(0, 5))
|
|
724
|
+
process.stdout.write(` ! ${d}\n`);
|
|
725
|
+
return 1;
|
|
726
|
+
}
|
|
609
727
|
// Main shrk check + subcommands
|
|
610
728
|
// ────────────────────────────────────────────────────────────────────────
|
|
611
729
|
export const checkCommand = {
|
|
612
730
|
name: 'check',
|
|
613
731
|
description: 'Run SharkCraft-level validation across knowledge / rules / templates / pipelines / packs / action hints / doctor. `check boundaries [--watch [--paths a,b] [--debounce N] [--once]]` re-runs the boundary scan on file changes.',
|
|
614
|
-
usage: 'shrk [--cwd <dir>] check [packs|pipelines|knowledge|generation|boundaries|imports|wiring] [--strict] [--min-score <0-100>] [--changed-only] [--since <ref>] [--only <ids>] [--json] [--watch [--paths <list>] [--debounce N] [--once]]',
|
|
732
|
+
usage: 'shrk [--cwd <dir>] check [packs|pipelines|knowledge|generation|boundaries|imports|wiring|orphans] [--strict] [--min-score <0-100>] [--changed-only] [--since <ref>] [--staged] [--only <ids>] [--json] [--watch [--paths <list>] [--debounce N] [--once]]',
|
|
615
733
|
async run(args) {
|
|
616
734
|
const sub = args.positional[0];
|
|
735
|
+
// `check generation <id> <name>` legitimately takes extra positionals;
|
|
736
|
+
// every other subverb (boundaries/imports/wiring/…) and the full sweep are
|
|
737
|
+
// flag-driven. Reject stray positional file args instead of silently
|
|
738
|
+
// dropping them and reporting a confident green — pass files via --files.
|
|
739
|
+
if (sub !== 'generation') {
|
|
740
|
+
const extras = args.positional.slice(1);
|
|
741
|
+
if (extras.length > 0) {
|
|
742
|
+
process.stderr.write(`Unexpected positional argument(s): ${extras.join(', ')}. ` +
|
|
743
|
+
`Use --files a.ts,b.ts (or --changed-only) instead of passing files positionally.\n`);
|
|
744
|
+
return 2;
|
|
745
|
+
}
|
|
746
|
+
}
|
|
617
747
|
if (sub === 'generation')
|
|
618
748
|
return checkGeneration(args);
|
|
619
749
|
if (sub === 'boundaries')
|
|
@@ -622,6 +752,8 @@ export const checkCommand = {
|
|
|
622
752
|
return checkImports(args);
|
|
623
753
|
if (sub === 'wiring')
|
|
624
754
|
return checkWiring(args);
|
|
755
|
+
if (sub === 'orphans')
|
|
756
|
+
return checkOrphans(args);
|
|
625
757
|
if (sub === 'registry-lifecycle') {
|
|
626
758
|
const cwd = resolveCwd(args);
|
|
627
759
|
const { buildRegistryLifecycleReport, renderRegistryLifecycleReportText } = await import('@shrkcrft/inspector');
|
|
@@ -245,6 +245,17 @@ export declare function commandLifecycle(e: ICommandCatalogEntry): CommandLifecy
|
|
|
245
245
|
* membership.
|
|
246
246
|
*/
|
|
247
247
|
export declare function defaultShowInHelp(e: ICommandCatalogEntry): boolean;
|
|
248
|
+
/**
|
|
249
|
+
* The "explain / dry-run" command family: entries that show you what a gate,
|
|
250
|
+
* ranker, or graph *sees* before you act (`search tuning explain`, `wiring
|
|
251
|
+
* explain`/`wiring test`, `boundaries explain`, `surface explain`, …). Several
|
|
252
|
+
* carry an Advanced surface, so {@link defaultShowInHelp} hides them despite
|
|
253
|
+
* being high-value — which is exactly why an agent finds them only by guessing.
|
|
254
|
+
* `shrk --full-help` lists this family in a dedicated section so they stop
|
|
255
|
+
* being hidden. Returns callable entries only (retired/deprecated/alias and
|
|
256
|
+
* R46-pruned are excluded), sorted by command.
|
|
257
|
+
*/
|
|
258
|
+
export declare function listExplainFamily(): readonly ICommandCatalogEntry[];
|
|
248
259
|
/**
|
|
249
260
|
* Short "Use this when…" line derived from `surface`, `taskRole`,
|
|
250
261
|
* `preferredCommand`, `replacedBy`, and `machineOnly`. Empty string when
|
|
@@ -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;CACnC;AAED;;;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EAAE,CAAC;IAC9C,kCAAkC;IAClC,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;;OAIG;IACH,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,6DAA6D;IAC7D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAC7B,0DAA0D;IAC1D,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,+DAA+D;IAC/D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;;;;;;;;;;OAWG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC;CACpB;AAED;;;;;GAKG;AACH,eAAO,MAAM,eAAe,EAAE,SAAS,oBAAoB,
|
|
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;CACnC;AAED;;;;;;GAMG;AACH,oBAAY,cAAc;IACxB,OAAO,YAAY;IACnB,MAAM,WAAW;IACjB,QAAQ,aAAa;IACrB,OAAO,YAAY;IACnB,QAAQ,aAAa;IACrB,MAAM,WAAW;CAClB;AAED,8BAA8B;AAC9B,oBAAY,eAAe;IACzB,KAAK,UAAU;IACf,KAAK,UAAU;IACf,EAAE,OAAO;IACT,UAAU,gBAAgB;IAC1B,UAAU,eAAe;CAC1B;AAED;;;;;;GAMG;AACH,oBAAY,eAAe;IACz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