@shrkcrft/inspector 0.1.0-alpha.2 → 0.1.0-alpha.20
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/agent-brief.d.ts.map +1 -1
- package/dist/agent-brief.js +59 -10
- package/dist/agent-contract-gate.d.ts.map +1 -1
- package/dist/agent-contract-gate.js +25 -2
- package/dist/agent-instructions.d.ts.map +1 -1
- package/dist/agent-instructions.js +11 -0
- package/dist/agent-task-prep.d.ts.map +1 -1
- package/dist/agent-task-prep.js +1 -3
- package/dist/ai-readiness.d.ts +84 -9
- package/dist/ai-readiness.d.ts.map +1 -1
- package/dist/ai-readiness.js +181 -35
- package/dist/apply-dispatch-trace.d.ts +1 -2
- package/dist/apply-dispatch-trace.d.ts.map +1 -1
- package/dist/apply-dispatch-trace.js +0 -9
- package/dist/area-explore.d.ts.map +1 -1
- package/dist/area-explore.js +4 -6
- package/dist/area-map.d.ts +0 -5
- package/dist/area-map.d.ts.map +1 -1
- package/dist/area-map.js +0 -10
- package/dist/changed-preflight.d.ts +7 -0
- package/dist/changed-preflight.d.ts.map +1 -1
- package/dist/changed-preflight.js +56 -9
- package/dist/changes-summary.d.ts.map +1 -1
- package/dist/changes-summary.js +10 -1
- package/dist/check-guardrail-globs.d.ts +16 -0
- package/dist/check-guardrail-globs.d.ts.map +1 -0
- package/dist/check-guardrail-globs.js +38 -0
- package/dist/code-intelligence-doctor.d.ts +21 -0
- package/dist/code-intelligence-doctor.d.ts.map +1 -0
- package/dist/code-intelligence-doctor.js +985 -0
- package/dist/command-recommender.d.ts.map +1 -1
- package/dist/command-recommender.js +23 -0
- package/dist/compliance-profiles.js +1 -1
- package/dist/construct-adoption-diff.d.ts.map +1 -1
- package/dist/construct-adoption-diff.js +2 -1
- package/dist/construct-adoption.d.ts.map +1 -1
- package/dist/construct-adoption.js +10 -11
- package/dist/construct-inference.d.ts.map +1 -1
- package/dist/construct-inference.js +5 -2
- package/dist/construct-registry.d.ts.map +1 -1
- package/dist/construct-registry.js +2 -10
- package/dist/contract-file-rule.d.ts +8 -0
- package/dist/contract-file-rule.d.ts.map +1 -1
- package/dist/contract-file-rule.js +8 -3
- package/dist/contract-template-registry.d.ts.map +1 -1
- package/dist/contract-template-registry.js +2 -10
- package/dist/contradictions.d.ts +8 -1
- package/dist/contradictions.d.ts.map +1 -1
- package/dist/contradictions.js +37 -35
- package/dist/convention-registry.d.ts.map +1 -1
- package/dist/convention-registry.js +2 -10
- package/dist/coverage-report.d.ts.map +1 -1
- package/dist/coverage-report.js +14 -1
- package/dist/dashboard/dashboard-knowledge.d.ts +8 -0
- package/dist/dashboard/dashboard-knowledge.d.ts.map +1 -0
- package/dist/dashboard/dashboard-knowledge.js +259 -0
- package/dist/decision-records.d.ts.map +1 -1
- package/dist/decision-records.js +5 -10
- package/dist/delegate-catalog.d.ts +45 -0
- package/dist/delegate-catalog.d.ts.map +1 -0
- package/dist/delegate-catalog.js +50 -0
- package/dist/delegate-doctor.d.ts +15 -0
- package/dist/delegate-doctor.d.ts.map +1 -0
- package/dist/delegate-doctor.js +36 -0
- package/dist/delegate-pack-recipes.d.ts +29 -0
- package/dist/delegate-pack-recipes.d.ts.map +1 -0
- package/dist/delegate-pack-recipes.js +77 -0
- package/dist/demo-script.d.ts +0 -1
- package/dist/demo-script.d.ts.map +1 -1
- package/dist/demo-script.js +0 -43
- package/dist/docs-check.js +1 -1
- package/dist/drift-baseline.d.ts.map +1 -1
- package/dist/drift-baseline.js +5 -2
- package/dist/feedback-ingestion.d.ts.map +1 -1
- package/dist/feedback-ingestion.js +2 -16
- package/dist/git-helpers.d.ts +15 -0
- package/dist/git-helpers.d.ts.map +1 -1
- package/dist/git-helpers.js +51 -4
- package/dist/helper-registry.d.ts +27 -54
- package/dist/helper-registry.d.ts.map +1 -1
- package/dist/helper-registry.js +16 -517
- package/dist/impact-analysis.d.ts.map +1 -1
- package/dist/impact-analysis.js +14 -7
- package/dist/index.d.ts +8 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -2
- package/dist/ingest-drafts.js +8 -4
- package/dist/migration-profile-registry.d.ts.map +1 -1
- package/dist/migration-profile-registry.js +2 -10
- package/dist/monorepo-onboarding.js +2 -2
- package/dist/onboarding-report.d.ts.map +1 -1
- package/dist/onboarding-report.js +5 -1
- package/dist/onboarding.d.ts +1 -1
- package/dist/onboarding.d.ts.map +1 -1
- package/dist/onboarding.js +9 -66
- package/dist/ownership.js +2 -10
- package/dist/pack-contributions-inventory.d.ts +0 -1
- package/dist/pack-contributions-inventory.d.ts.map +1 -1
- package/dist/pack-contributions-inventory.js +17 -29
- package/dist/pack-helper-registry.d.ts.map +1 -1
- package/dist/pack-helper-registry.js +2 -10
- package/dist/pack-release-check.d.ts.map +1 -1
- package/dist/pack-release-check.js +4 -11
- package/dist/pack-signature-status.d.ts.map +1 -1
- package/dist/pack-signature-status.js +18 -2
- package/dist/pack-test-runner.js +2 -10
- package/dist/plan-review.d.ts.map +1 -1
- package/dist/plan-review.js +5 -10
- package/dist/plan-simulation.d.ts +13 -0
- package/dist/plan-simulation.d.ts.map +1 -1
- package/dist/plan-simulation.js +4 -21
- package/dist/playbook-registry.d.ts.map +1 -1
- package/dist/playbook-registry.js +2 -10
- package/dist/policy-engine.d.ts.map +1 -1
- package/dist/policy-engine.js +3 -11
- package/dist/policy-test.js +3 -11
- package/dist/profile-registry.d.ts +0 -1
- package/dist/profile-registry.d.ts.map +1 -1
- package/dist/profile-registry.js +4 -32
- package/dist/propose-knowledge.d.ts +15 -0
- package/dist/propose-knowledge.d.ts.map +1 -1
- package/dist/propose-knowledge.js +37 -4
- package/dist/quality-baseline.d.ts.map +1 -1
- package/dist/quality-baseline.js +3 -1
- package/dist/ranker-explainability.d.ts.map +1 -1
- package/dist/ranker-explainability.js +3 -9
- package/dist/registration-hint-registry.d.ts.map +1 -1
- package/dist/registration-hint-registry.js +2 -10
- package/dist/registry-lifecycle.d.ts +6 -0
- package/dist/registry-lifecycle.d.ts.map +1 -1
- package/dist/registry-lifecycle.js +137 -10
- package/dist/release-readiness.js +3 -3
- package/dist/repo-memory.d.ts.map +1 -1
- package/dist/repo-memory.js +3 -1
- package/dist/reposet.js +1 -1
- package/dist/repository-intelligence.d.ts.map +1 -1
- package/dist/repository-intelligence.js +7 -2
- package/dist/repository-knowledge-model.d.ts +1 -1
- package/dist/repository-knowledge-model.d.ts.map +1 -1
- package/dist/repository-stats.d.ts.map +1 -1
- package/dist/repository-stats.js +3 -1
- package/dist/resolve-verification-commands.d.ts +26 -0
- package/dist/resolve-verification-commands.d.ts.map +1 -0
- package/dist/resolve-verification-commands.js +55 -0
- package/dist/review-packet.d.ts.map +1 -1
- package/dist/review-packet.js +14 -17
- package/dist/rule-drift.d.ts.map +1 -1
- package/dist/rule-drift.js +24 -9
- package/dist/rule-scaffold.d.ts.map +1 -1
- package/dist/rule-scaffold.js +12 -4
- package/dist/scaffold-patterns.js +2 -10
- package/dist/search-tuning-registry.d.ts.map +1 -1
- package/dist/search-tuning-registry.js +2 -10
- package/dist/self-config-doctor-v2.d.ts +1 -1
- package/dist/self-config-doctor-v2.d.ts.map +1 -1
- package/dist/self-config-doctor-v2.js +6 -10
- package/dist/self-config-doctor.d.ts.map +1 -1
- package/dist/self-config-doctor.js +7 -13
- package/dist/sharkcraft-inspector.d.ts +14 -0
- package/dist/sharkcraft-inspector.d.ts.map +1 -1
- package/dist/sharkcraft-inspector.js +103 -1
- package/dist/start-here.d.ts +2 -2
- package/dist/start-here.d.ts.map +1 -1
- package/dist/start-here.js +16 -1
- package/dist/synthesize-from-onboarding.d.ts +68 -0
- package/dist/synthesize-from-onboarding.d.ts.map +1 -0
- package/dist/synthesize-from-onboarding.js +508 -0
- package/dist/task-packet.d.ts +13 -0
- package/dist/task-packet.d.ts.map +1 -1
- package/dist/task-packet.js +59 -6
- package/dist/task-ranker.d.ts.map +1 -1
- package/dist/task-ranker.js +1 -31
- package/dist/task-routing-hint-registry.d.ts.map +1 -1
- package/dist/task-routing-hint-registry.js +2 -10
- package/dist/template-drift.d.ts +7 -0
- package/dist/template-drift.d.ts.map +1 -1
- package/dist/template-drift.js +14 -6
- package/dist/test-impact.d.ts.map +1 -1
- package/dist/test-impact.js +5 -2
- package/dist/test-runner.d.ts.map +1 -1
- package/dist/test-runner.js +12 -17
- package/dist/universal-search.d.ts +0 -1
- package/dist/universal-search.d.ts.map +1 -1
- package/dist/universal-search.js +0 -12
- package/dist/why-file.js +66 -22
- package/package.json +18 -18
- package/dist/plugin-lifecycle-profile-registry.d.ts +0 -52
- package/dist/plugin-lifecycle-profile-registry.d.ts.map +0 -1
- package/dist/plugin-lifecycle-profile-registry.js +0 -202
- package/dist/plugin-lifecycle.d.ts +0 -132
- package/dist/plugin-lifecycle.d.ts.map +0 -1
- package/dist/plugin-lifecycle.js +0 -477
package/dist/ai-readiness.js
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import { KnowledgeType, hasActionHints } from '@shrkcrft/knowledge';
|
|
2
|
+
import { WorkspaceProfile } from '@shrkcrft/workspace';
|
|
2
3
|
import { diagnoseActionHints } from "./action-hint-diagnostics.js";
|
|
3
4
|
import { runDoctor } from "./sharkcraft-inspector.js";
|
|
5
|
+
/**
|
|
6
|
+
* Entry types that describe a *location* or a *fact* rather than an action, so
|
|
7
|
+
* they are not expected to carry actionHints and are excluded from the
|
|
8
|
+
* action-hint coverage metric. Mirrors the skip set in
|
|
9
|
+
* `action-hint-diagnostics.ts` (keep the two in sync).
|
|
10
|
+
*/
|
|
11
|
+
const HINT_EXEMPT_TYPES = new Set(['path', 'overview', 'technical']);
|
|
4
12
|
function gradeOf(score) {
|
|
5
13
|
if (score >= 85)
|
|
6
14
|
return 'excellent';
|
|
@@ -37,17 +45,97 @@ function isCriticalOrHighWorkflow(entry) {
|
|
|
37
45
|
return p === 'critical' || p === 'high';
|
|
38
46
|
}
|
|
39
47
|
/**
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
48
|
+
* Classify the workspace from its profile flags. Used to mark dimensions
|
|
49
|
+
* core / advisory / n/a so the aggregate score reflects what actually
|
|
50
|
+
* matters for this repo.
|
|
51
|
+
*/
|
|
52
|
+
function classifyShape(profiles) {
|
|
53
|
+
const has = (p) => profiles.includes(p);
|
|
54
|
+
const isLibrary = has(WorkspaceProfile.IsLibrary);
|
|
55
|
+
const isService = has(WorkspaceProfile.IsService);
|
|
56
|
+
const isMonorepo = has(WorkspaceProfile.IsMonorepo) ||
|
|
57
|
+
has(WorkspaceProfile.HasNx) ||
|
|
58
|
+
has(WorkspaceProfile.HasTurborepo) ||
|
|
59
|
+
has(WorkspaceProfile.HasPackageWorkspaces);
|
|
60
|
+
const isApplication = !isLibrary &&
|
|
61
|
+
(has(WorkspaceProfile.IsFrontend) ||
|
|
62
|
+
has(WorkspaceProfile.IsBackend) ||
|
|
63
|
+
isService);
|
|
64
|
+
let label;
|
|
65
|
+
if (isMonorepo) {
|
|
66
|
+
label = isLibrary ? 'library monorepo' : 'monorepo';
|
|
67
|
+
}
|
|
68
|
+
else if (isLibrary) {
|
|
69
|
+
label = 'library';
|
|
70
|
+
}
|
|
71
|
+
else if (isService) {
|
|
72
|
+
label = 'service';
|
|
73
|
+
}
|
|
74
|
+
else if (has(WorkspaceProfile.IsFrontend)) {
|
|
75
|
+
label = 'frontend app';
|
|
76
|
+
}
|
|
77
|
+
else if (has(WorkspaceProfile.IsBackend)) {
|
|
78
|
+
label = 'backend app';
|
|
79
|
+
}
|
|
80
|
+
else if (has(WorkspaceProfile.HasTypeScript)) {
|
|
81
|
+
label = 'TypeScript project';
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
label = 'unclassified';
|
|
85
|
+
}
|
|
86
|
+
return { label, isLibrary, isService, isMonorepo, isApplication };
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Deterministic AI-readiness report.
|
|
90
|
+
*
|
|
91
|
+
* Replaces the original "single 0-100 score" UX with a shape-aware
|
|
92
|
+
* report. Each dimension is classified as:
|
|
93
|
+
*
|
|
94
|
+
* - `core` — counts in the aggregate score; produces a recommendation
|
|
95
|
+
* when below threshold.
|
|
96
|
+
* - `advisory` — shown but doesn't drag the score down; no
|
|
97
|
+
* recommendation. Used for dimensions that are nice-to-have but
|
|
98
|
+
* not load-bearing for the detected workspace shape (e.g. docs in
|
|
99
|
+
* a CLI library).
|
|
100
|
+
* - `n/a-for-shape` — irrelevant to this workspace; hidden by
|
|
101
|
+
* default. Lets a CLI library skip "add templates" without
|
|
102
|
+
* manually suppressing every release.
|
|
103
|
+
*
|
|
104
|
+
* Two binary verdicts ride alongside the score:
|
|
105
|
+
* - `readyForAgentWrites` — every gate an autonomous agent would need
|
|
106
|
+
* before issuing `shrk apply` (config + cli-only safety + clean
|
|
107
|
+
* doctor).
|
|
108
|
+
* - `readyForAgentReads` — every gate a read-only agent (e.g. an MCP
|
|
109
|
+
* context lookup) would need (knowledge entries loaded + doctor
|
|
110
|
+
* clean).
|
|
111
|
+
*
|
|
112
|
+
* Numerical penalties stay explicit:
|
|
113
|
+
* - Quantity-only "stuff a registry full of entries" is capped via softCap.
|
|
114
|
+
* - Duplicate-id warnings reduce data-quality dimension.
|
|
115
|
+
* - Placeholder docs (TODO / TBD / "fill in") reduce docs dimension.
|
|
116
|
+
* - Critical/high workflow entries missing actionHints reduce safety dim.
|
|
117
|
+
* - Doctor health stays a hard gate.
|
|
46
118
|
*/
|
|
47
119
|
export function buildAiReadinessReport(inspection) {
|
|
48
120
|
const dims = [];
|
|
49
121
|
const recs = [];
|
|
50
|
-
|
|
122
|
+
const shape = classifyShape(inspection.workspace.profiles);
|
|
123
|
+
// Reusable applies-to predicates.
|
|
124
|
+
const templatesApply = shape.isLibrary && !shape.isMonorepo
|
|
125
|
+
? 'n/a-for-shape'
|
|
126
|
+
: shape.isApplication
|
|
127
|
+
? 'core'
|
|
128
|
+
: 'advisory';
|
|
129
|
+
const pipelinesApply = shape.isLibrary && !shape.isMonorepo
|
|
130
|
+
? 'n/a-for-shape'
|
|
131
|
+
: 'advisory';
|
|
132
|
+
const pathsApply = shape.isMonorepo || shape.isApplication
|
|
133
|
+
? 'core'
|
|
134
|
+
: 'advisory';
|
|
135
|
+
const docsApply = shape.isApplication || shape.isMonorepo
|
|
136
|
+
? 'core'
|
|
137
|
+
: 'advisory';
|
|
138
|
+
// 1) Config present — always core (this is the "did you opt in?" signal).
|
|
51
139
|
dims.push({
|
|
52
140
|
id: 'config',
|
|
53
141
|
title: 'sharkcraft.config.ts present',
|
|
@@ -56,6 +144,7 @@ export function buildAiReadinessReport(inspection) {
|
|
|
56
144
|
note: inspection.configFile
|
|
57
145
|
? `loaded from ${inspection.configFile}`
|
|
58
146
|
: 'missing — using defaults',
|
|
147
|
+
applies: 'core',
|
|
59
148
|
});
|
|
60
149
|
if (!inspection.configFile) {
|
|
61
150
|
recs.push('Create sharkcraft/sharkcraft.config.ts to opt in to project-specific config.');
|
|
@@ -68,6 +157,7 @@ export function buildAiReadinessReport(inspection) {
|
|
|
68
157
|
weight: 1.0,
|
|
69
158
|
score: softCapScore(k, 15),
|
|
70
159
|
note: `${k} entries (softcap 15, full at 22)`,
|
|
160
|
+
applies: 'core',
|
|
71
161
|
});
|
|
72
162
|
if (k < 10)
|
|
73
163
|
recs.push('Add more structured knowledge entries (target: 10+).');
|
|
@@ -79,10 +169,11 @@ export function buildAiReadinessReport(inspection) {
|
|
|
79
169
|
weight: 1.0,
|
|
80
170
|
score: softCapScore(rules.length, 8),
|
|
81
171
|
note: `${rules.length} rules (softcap 8)`,
|
|
172
|
+
applies: 'core',
|
|
82
173
|
});
|
|
83
174
|
if (rules.length < 5)
|
|
84
175
|
recs.push('Add at least 5 rules describing coding/architecture conventions.');
|
|
85
|
-
// 4) Path conventions —
|
|
176
|
+
// 4) Path conventions — core for monorepos / applications, advisory otherwise.
|
|
86
177
|
const paths = inspection.pathService.list();
|
|
87
178
|
dims.push({
|
|
88
179
|
id: 'paths',
|
|
@@ -90,10 +181,16 @@ export function buildAiReadinessReport(inspection) {
|
|
|
90
181
|
weight: 0.8,
|
|
91
182
|
score: softCapScore(paths.length, 6),
|
|
92
183
|
note: `${paths.length} path conventions (softcap 6)`,
|
|
184
|
+
applies: pathsApply,
|
|
185
|
+
appliesReason: pathsApply === 'advisory'
|
|
186
|
+
? 'Path conventions matter most for monorepos and applications with explicit src/ layouts.'
|
|
187
|
+
: undefined,
|
|
93
188
|
});
|
|
94
|
-
if (paths.length < 4)
|
|
189
|
+
if (pathsApply === 'core' && paths.length < 4) {
|
|
95
190
|
recs.push('Add path conventions for src/, services/, utils/, tests/ etc.');
|
|
96
|
-
|
|
191
|
+
}
|
|
192
|
+
// 5) Templates — n/a for pure libraries; core for applications;
|
|
193
|
+
// advisory for monorepos (often useful but not load-bearing).
|
|
97
194
|
const t = inspection.templates.length;
|
|
98
195
|
dims.push({
|
|
99
196
|
id: 'templates',
|
|
@@ -101,10 +198,18 @@ export function buildAiReadinessReport(inspection) {
|
|
|
101
198
|
weight: 0.8,
|
|
102
199
|
score: softCapScore(t, 4),
|
|
103
200
|
note: `${t} templates (softcap 4)`,
|
|
201
|
+
applies: templatesApply,
|
|
202
|
+
appliesReason: templatesApply === 'n/a-for-shape'
|
|
203
|
+
? 'Libraries don\'t scaffold downstream code — templates are not load-bearing here.'
|
|
204
|
+
: templatesApply === 'advisory'
|
|
205
|
+
? 'Templates help generate consistent constructs, but the repo can be agent-ready without them.'
|
|
206
|
+
: undefined,
|
|
104
207
|
});
|
|
105
|
-
if (t < 3)
|
|
208
|
+
if (templatesApply === 'core' && t < 3) {
|
|
106
209
|
recs.push('Define templates for the constructs you generate most often.');
|
|
107
|
-
|
|
210
|
+
}
|
|
211
|
+
// 6) Pipelines — n/a for pure libraries; advisory for everything else.
|
|
212
|
+
// Pipelines are nice but rarely block agent workflows.
|
|
108
213
|
const p = inspection.pipelines.length;
|
|
109
214
|
dims.push({
|
|
110
215
|
id: 'pipelines',
|
|
@@ -112,21 +217,34 @@ export function buildAiReadinessReport(inspection) {
|
|
|
112
217
|
weight: 0.8,
|
|
113
218
|
score: softCapScore(p, 3),
|
|
114
219
|
note: `${p} pipelines (softcap 3)`,
|
|
220
|
+
applies: pipelinesApply,
|
|
221
|
+
appliesReason: pipelinesApply === 'n/a-for-shape'
|
|
222
|
+
? 'Libraries don\'t orchestrate feature pipelines — this dimension does not apply.'
|
|
223
|
+
: 'Pipelines describe preferred flows; a repo can be agent-ready with just rules + path conventions.',
|
|
115
224
|
});
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
// 7) Action-hint coverage — fraction of entries that carry
|
|
119
|
-
|
|
120
|
-
|
|
225
|
+
// No recommendation when pipelines is advisory — the old "add a pipeline"
|
|
226
|
+
// exhortation fired on libraries it shouldn't have.
|
|
227
|
+
// 7) Action-hint coverage — fraction of HINT-ELIGIBLE entries that carry
|
|
228
|
+
// hints. Path / overview / technical entries describe a location or a fact
|
|
229
|
+
// rather than an action, so the action-hint quality doctor deliberately
|
|
230
|
+
// doesn't grade them (see action-hint-diagnostics). Counting them in the
|
|
231
|
+
// denominator penalised the score for structural non-gaps — an entry that
|
|
232
|
+
// *can't* meaningfully carry action hints isn't a missing one — so they are
|
|
233
|
+
// excluded from both numerator and denominator here too.
|
|
234
|
+
const hintEligible = inspection.knowledgeEntries.filter((e) => !HINT_EXEMPT_TYPES.has(String(e.type).toLowerCase()));
|
|
235
|
+
const eligibleCount = hintEligible.length;
|
|
236
|
+
const withHints = hintEligible.filter((e) => hasActionHints(e)).length;
|
|
237
|
+
const hintsScore = eligibleCount === 0 ? 0 : Math.min(10, Math.round((withHints / eligibleCount) * 20));
|
|
121
238
|
dims.push({
|
|
122
239
|
id: 'action-hints',
|
|
123
240
|
title: 'Entries with action hints',
|
|
124
241
|
weight: 1.2,
|
|
125
242
|
score: hintsScore,
|
|
126
|
-
note: `${withHints} of ${
|
|
243
|
+
note: `${withHints} of ${eligibleCount} hint-eligible entries carry actionHints`,
|
|
244
|
+
applies: 'core',
|
|
127
245
|
});
|
|
128
246
|
if (hintsScore < 7)
|
|
129
|
-
recs.push('Add actionHints to high-priority
|
|
247
|
+
recs.push('Add actionHints to high-priority entries (commands, mcpTools, forbiddenActions, relatedKnowledge).');
|
|
130
248
|
// 8) Verification commands
|
|
131
249
|
const haveVerify = inspection.knowledgeEntries.some((e) => (e.actionHints?.verificationCommands?.length ?? 0) > 0);
|
|
132
250
|
dims.push({
|
|
@@ -135,6 +253,7 @@ export function buildAiReadinessReport(inspection) {
|
|
|
135
253
|
weight: 0.6,
|
|
136
254
|
score: haveVerify ? 10 : 0,
|
|
137
255
|
note: haveVerify ? 'at least one entry lists verification commands' : 'no entry lists verification commands',
|
|
256
|
+
applies: 'core',
|
|
138
257
|
});
|
|
139
258
|
if (!haveVerify)
|
|
140
259
|
recs.push('Add verificationCommands to safety/generation rules (e.g. typecheck + tests).');
|
|
@@ -146,10 +265,11 @@ export function buildAiReadinessReport(inspection) {
|
|
|
146
265
|
weight: 0.6,
|
|
147
266
|
score: haveForbidden ? 10 : 0,
|
|
148
267
|
note: haveForbidden ? 'at least one entry lists forbiddenActions' : 'no entry lists forbiddenActions',
|
|
268
|
+
applies: 'core',
|
|
149
269
|
});
|
|
150
270
|
if (!haveForbidden)
|
|
151
271
|
recs.push('Add forbiddenActions to clarify what agents must NOT do.');
|
|
152
|
-
// 10) Docs — softcap at 4. Penalize placeholder docs.
|
|
272
|
+
// 10) Docs — softcap at 4. Penalize placeholder docs. Advisory for libraries.
|
|
153
273
|
const docFiles = inspection.sourceFiles.filter((s) => s.endsWith('.md'));
|
|
154
274
|
let placeholderDocCount = 0;
|
|
155
275
|
for (const entry of inspection.knowledgeEntries) {
|
|
@@ -169,19 +289,17 @@ export function buildAiReadinessReport(inspection) {
|
|
|
169
289
|
note: placeholderDocCount > 0
|
|
170
290
|
? `${docFiles.length} markdown files (-${docsPenalty} for ${placeholderDocCount} placeholder markers)`
|
|
171
291
|
: `${docFiles.length} markdown files`,
|
|
292
|
+
applies: docsApply,
|
|
293
|
+
appliesReason: docsApply === 'advisory'
|
|
294
|
+
? 'Standalone libraries communicate via README + API docs more than per-task markdown.'
|
|
295
|
+
: undefined,
|
|
172
296
|
});
|
|
173
297
|
if (placeholderDocCount > 0) {
|
|
174
298
|
recs.push(`Replace TODO/placeholder markers in ${placeholderDocCount} doc/task file(s).`);
|
|
175
299
|
}
|
|
176
300
|
// 11) Doctor health — passes is a near-required gate.
|
|
177
|
-
//
|
|
178
|
-
// Action-hint quality warnings are also surfaced by the doctor, but the
|
|
179
|
-
// dedicated `hint-quality` dimension below already scores them. Counting
|
|
180
|
-
// them here too would punish the same warning twice and crush the score
|
|
181
|
-
// once a repo crosses ten hint warnings. Exclude them from this dimension.
|
|
182
301
|
const doctor = runDoctor(inspection);
|
|
183
|
-
const structuralWarnings = doctor.checks.filter((c) => c.severity === 'warning' &&
|
|
184
|
-
!c.id.startsWith('actionhints-')).length;
|
|
302
|
+
const structuralWarnings = doctor.checks.filter((c) => c.severity === 'warning' && !c.id.startsWith('actionhints-')).length;
|
|
185
303
|
const doctorScore = doctor.passed ? Math.max(0, 10 - structuralWarnings) : 0;
|
|
186
304
|
dims.push({
|
|
187
305
|
id: 'doctor',
|
|
@@ -191,13 +309,16 @@ export function buildAiReadinessReport(inspection) {
|
|
|
191
309
|
note: doctor.passed
|
|
192
310
|
? `passed (${structuralWarnings} structural warnings, ${doctor.summary.warnings} total)`
|
|
193
311
|
: `${doctor.summary.errors} errors`,
|
|
312
|
+
applies: 'core',
|
|
194
313
|
});
|
|
195
314
|
if (!doctor.passed)
|
|
196
315
|
recs.push('Fix doctor errors before relying on agent workflows.');
|
|
197
|
-
// 12) Pack discovery health
|
|
316
|
+
// 12) Pack discovery health — n/a when no packs are installed (don't
|
|
317
|
+
// reward inaction with a neutral 5).
|
|
198
318
|
const packs = inspection.packs;
|
|
319
|
+
const packsApply = packs.discoveredPacks.length === 0 ? 'n/a-for-shape' : 'core';
|
|
199
320
|
const packsScore = packs.discoveredPacks.length === 0
|
|
200
|
-
?
|
|
321
|
+
? 0 // would-be neutral 5 was masking how often this dim doesn't apply
|
|
201
322
|
: packs.invalidPacks.length === 0
|
|
202
323
|
? 10
|
|
203
324
|
: 4;
|
|
@@ -209,14 +330,17 @@ export function buildAiReadinessReport(inspection) {
|
|
|
209
330
|
note: packs.discoveredPacks.length === 0
|
|
210
331
|
? 'no packs discovered'
|
|
211
332
|
: `${packs.validPacks.length}/${packs.discoveredPacks.length} packs valid`,
|
|
333
|
+
applies: packsApply,
|
|
334
|
+
appliesReason: packsApply === 'n/a-for-shape'
|
|
335
|
+
? 'No SharkCraft packs installed — pack-discovery health does not apply.'
|
|
336
|
+
: undefined,
|
|
212
337
|
});
|
|
213
|
-
if (packs.invalidPacks.length > 0) {
|
|
338
|
+
if (packsApply === 'core' && packs.invalidPacks.length > 0) {
|
|
214
339
|
recs.push('Fix invalid pack manifests (see `shrk packs doctor`).');
|
|
215
340
|
}
|
|
216
341
|
// 13) Generation safety — flagship cli-only write policy rule required.
|
|
217
342
|
const hasDryRunDefault = inspection.knowledgeEntries.some((e) => e.actionHints?.writePolicy === 'cli-only' ||
|
|
218
343
|
(e.actionHints?.forbiddenActions ?? []).some((f) => /write through mcp/i.test(f)));
|
|
219
|
-
// Additionally penalize when any critical/high workflow entry lacks hints.
|
|
220
344
|
const workflowMissingHints = inspection.knowledgeEntries.filter((e) => isCriticalOrHighWorkflow(e) && !hasActionHints(e)).length;
|
|
221
345
|
let safetyScore = hasDryRunDefault ? 10 : 3;
|
|
222
346
|
if (workflowMissingHints > 0) {
|
|
@@ -232,6 +356,7 @@ export function buildAiReadinessReport(inspection) {
|
|
|
232
356
|
? `cli-only write policy present, but ${workflowMissingHints} critical/high workflow entry/entries lack actionHints`
|
|
233
357
|
: 'cli-only write policy + forbidden-actions present'
|
|
234
358
|
: 'no entry declares cli-only write policy',
|
|
359
|
+
applies: 'core',
|
|
235
360
|
});
|
|
236
361
|
if (!hasDryRunDefault) {
|
|
237
362
|
recs.push('Add a critical safety rule with writePolicy:"cli-only" and "do not write through MCP".');
|
|
@@ -251,6 +376,7 @@ export function buildAiReadinessReport(inspection) {
|
|
|
251
376
|
weight: 0.6,
|
|
252
377
|
score: hintIssueScore,
|
|
253
378
|
note: `${hintReport.issues.length} quality warnings across ${hintReport.evaluatedEntryCount} relevant entries`,
|
|
379
|
+
applies: 'core',
|
|
254
380
|
});
|
|
255
381
|
// 15) Data quality — duplicate ids surface as warnings.
|
|
256
382
|
const dupCount = inspection.validationIssues.filter((v) => v.code === 'duplicate-id').length;
|
|
@@ -263,17 +389,37 @@ export function buildAiReadinessReport(inspection) {
|
|
|
263
389
|
note: dupCount === 0
|
|
264
390
|
? 'no duplicate knowledge ids'
|
|
265
391
|
: `${dupCount} duplicate id(s) — first occurrence kept`,
|
|
392
|
+
applies: 'core',
|
|
266
393
|
});
|
|
267
394
|
if (dupCount > 0)
|
|
268
395
|
recs.push(`Resolve ${dupCount} duplicate knowledge id(s).`);
|
|
269
|
-
// Aggregate.
|
|
270
|
-
const
|
|
271
|
-
const
|
|
272
|
-
const
|
|
396
|
+
// Aggregate over `core` dimensions only — advisory + n/a do not count.
|
|
397
|
+
const coreDims = dims.filter((d) => d.applies === 'core');
|
|
398
|
+
const totalWeight = coreDims.reduce((sum, d) => sum + d.weight, 0);
|
|
399
|
+
const weightedSum = coreDims.reduce((sum, d) => sum + d.score * d.weight, 0);
|
|
400
|
+
const score = totalWeight > 0 ? Math.round((weightedSum / totalWeight) * 10) : 0;
|
|
401
|
+
// Binary verdicts — honest yes/no rather than a fuzzy score.
|
|
402
|
+
const blockers = [];
|
|
403
|
+
if (!doctor.passed)
|
|
404
|
+
blockers.push('doctor reports errors');
|
|
405
|
+
if (!inspection.configFile)
|
|
406
|
+
blockers.push('sharkcraft.config.ts missing');
|
|
407
|
+
if (!hasDryRunDefault)
|
|
408
|
+
blockers.push('no cli-only write policy rule');
|
|
409
|
+
if (k === 0)
|
|
410
|
+
blockers.push('no knowledge entries loaded');
|
|
411
|
+
const readyForAgentWrites = blockers.length === 0;
|
|
412
|
+
const readyForAgentReads = doctor.passed && k > 0;
|
|
273
413
|
return {
|
|
274
414
|
score,
|
|
275
415
|
grade: gradeOf(score),
|
|
276
416
|
dimensions: dims,
|
|
277
417
|
topRecommendations: recs.slice(0, 5),
|
|
418
|
+
verdicts: {
|
|
419
|
+
readyForAgentWrites,
|
|
420
|
+
readyForAgentReads,
|
|
421
|
+
blockers,
|
|
422
|
+
},
|
|
423
|
+
workspaceShape: shape,
|
|
278
424
|
};
|
|
279
425
|
}
|
|
@@ -15,12 +15,11 @@ export declare const APPLY_DISPATCH_TRACE_SCHEMA = "sharkcraft.apply-dispatch-tr
|
|
|
15
15
|
export declare enum DispatchKind {
|
|
16
16
|
Template = "template",
|
|
17
17
|
Helper = "helper",
|
|
18
|
-
PluginLifecycle = "plugin-lifecycle",
|
|
19
18
|
RegistrationHint = "registration-hint",
|
|
20
19
|
Synthetic = "synthetic",
|
|
21
20
|
Unknown = "unknown"
|
|
22
21
|
}
|
|
23
|
-
export type DispatchSource = 'registry/template' | 'registry/helper' | 'registry/
|
|
22
|
+
export type DispatchSource = 'registry/template' | 'registry/helper' | 'registry/registration-hint' | 'synthetic' | 'unknown';
|
|
24
23
|
export interface IDispatchFileOpCounts {
|
|
25
24
|
readonly create: number;
|
|
26
25
|
readonly update: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply-dispatch-trace.d.ts","sourceRoot":"","sources":["../src/apply-dispatch-trace.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAAE,UAAU,EAAsB,MAAM,qBAAqB,CAAC;AAC1E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAEvE,eAAO,MAAM,2BAA2B,uCAAuC,CAAC;AAEhF,oBAAY,YAAY;IACtB,QAAQ,aAAa;IACrB,MAAM,WAAW;IACjB,
|
|
1
|
+
{"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C1B,sEAAsE;IACtE,QAAQ,CAAC,UAAU,EAAE,qBAAqB,CAAC;IAC3C,8DAA8D;IAC9D,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B,uDAAuD;IACvD,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IAClC,0DAA0D;IAC1D,QAAQ,CAAC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IACrC,uDAAuD;IACvD,QAAQ,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC;IACnC,wEAAwE;IACxE,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,yEAAyE;IACzE,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,gBAAgB,CAAC;CAC5D;AAiHD,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,0BAA0B,GAClC,mBAAmB,CAwIrB;AAED,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,mBAAmB,GAAG,MAAM,CA2B/E"}
|
|
@@ -3,13 +3,11 @@ export var DispatchKind;
|
|
|
3
3
|
(function (DispatchKind) {
|
|
4
4
|
DispatchKind["Template"] = "template";
|
|
5
5
|
DispatchKind["Helper"] = "helper";
|
|
6
|
-
DispatchKind["PluginLifecycle"] = "plugin-lifecycle";
|
|
7
6
|
DispatchKind["RegistrationHint"] = "registration-hint";
|
|
8
7
|
DispatchKind["Synthetic"] = "synthetic";
|
|
9
8
|
DispatchKind["Unknown"] = "unknown";
|
|
10
9
|
})(DispatchKind || (DispatchKind = {}));
|
|
11
10
|
const TEMPLATE_PREFIX_HELPER = '__helper__';
|
|
12
|
-
const TEMPLATE_PREFIX_PLUGIN_LIFECYCLE = '__plugin-lifecycle__';
|
|
13
11
|
const TEMPLATE_PREFIX_REGISTRATION_HINT = '__registration-hint__';
|
|
14
12
|
function classifyTemplate(templateId) {
|
|
15
13
|
if (templateId.startsWith(TEMPLATE_PREFIX_HELPER)) {
|
|
@@ -19,13 +17,6 @@ function classifyTemplate(templateId) {
|
|
|
19
17
|
handler: '@shrkcrft/inspector/helper-registry + @shrkcrft/generator/synthetic-plan.evaluateSavedPlanInPlace',
|
|
20
18
|
};
|
|
21
19
|
}
|
|
22
|
-
if (templateId.startsWith(TEMPLATE_PREFIX_PLUGIN_LIFECYCLE)) {
|
|
23
|
-
return {
|
|
24
|
-
kind: DispatchKind.PluginLifecycle,
|
|
25
|
-
source: 'registry/plugin-lifecycle-profile',
|
|
26
|
-
handler: '@shrkcrft/inspector/plugin-lifecycle + @shrkcrft/generator/synthetic-plan.evaluateSavedPlanInPlace',
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
20
|
if (templateId.startsWith(TEMPLATE_PREFIX_REGISTRATION_HINT)) {
|
|
30
21
|
return {
|
|
31
22
|
kind: DispatchKind.RegistrationHint,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"area-explore.d.ts","sourceRoot":"","sources":["../src/area-explore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AACvE,OAAO,EAAE,QAAQ,EAAgB,MAAM,eAAe,CAAC;AAEvD,eAAO,MAAM,mBAAmB,+BAA+B,CAAC;AAEhE,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,GAAG,KAAK,GAAG,WAAW,GAAG,QAAQ,GAAG,OAAO,CAAC;CAC7E;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,IAAI,EACT,iBAAiB,GACjB,aAAa,GACb,cAAc,GACd,cAAc,GACd,gBAAgB,GAChB,mBAAmB,GACnB,UAAU,CAAC;IACf,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,Q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CAAC;IACjD,QAAQ,CAAC,gBAAgB,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IACjD,QAAQ,CAAC,eAAe,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAChD,QAAQ,CAAC,iBAAiB,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAClD,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC,qBAAqB,CAAC,CAAC;IACrD,QAAQ,CAAC,YAAY,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;CAC9C;AA6LD,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,qBAAqB,CAAC;IAClC,wEAAwE;IACxE,IAAI,EAAE,MAAM,CAAC;IACb,gFAAgF;IAChF,cAAc,CAAC,EAAE,aAAa,CAAC;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACpD,mDAAmD;IACnD,YAAY,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IACrC,8CAA8C;IAC9C,eAAe,CAAC,EAAE,aAAa,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACjF,mCAAmC;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,iBAAiB,GAAG,kBAAkB,CAiJxE;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,kBAAkB,GAAG,MAAM,CAoDxE;AAED,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,kBAAkB,GAAG,MAAM,CAuC5E"}
|
package/dist/area-explore.js
CHANGED
|
@@ -123,17 +123,13 @@ function describeRole(relPath, kind) {
|
|
|
123
123
|
}
|
|
124
124
|
switch (kind) {
|
|
125
125
|
case AreaKind.Core:
|
|
126
|
-
return 'Core building blocks (Result, errors, ids)
|
|
126
|
+
return 'Core building blocks (Result, errors, ids).';
|
|
127
127
|
case AreaKind.Tests:
|
|
128
128
|
return 'Tests.';
|
|
129
129
|
case AreaKind.Docs:
|
|
130
130
|
return 'Documentation.';
|
|
131
131
|
case AreaKind.Generated:
|
|
132
132
|
return 'Generated output — do not hand-edit.';
|
|
133
|
-
case AreaKind.Adapter:
|
|
134
|
-
return 'Framework / runtime adapter glue.';
|
|
135
|
-
case AreaKind.Plugin:
|
|
136
|
-
return 'Plugin / pack code.';
|
|
137
133
|
default:
|
|
138
134
|
return `${kind} area.`;
|
|
139
135
|
}
|
|
@@ -250,7 +246,9 @@ export function exploreArea(input) {
|
|
|
250
246
|
kind: classifyFileKind(relPath),
|
|
251
247
|
});
|
|
252
248
|
}
|
|
253
|
-
|
|
249
|
+
// Secondary key makes the order TOTAL: same-size files near the cutoff would
|
|
250
|
+
// otherwise be ranked by filesystem order (non-deterministic).
|
|
251
|
+
files.sort((a, b) => b.sizeBytes - a.sizeBytes || a.relPath.localeCompare(b.relPath));
|
|
254
252
|
const areaMap = buildAreaMap(input.inspection);
|
|
255
253
|
const inferredKind = inferKindForPath(relPath, areaMap);
|
|
256
254
|
const role = describeRole(relPath, inferredKind);
|
package/dist/area-map.d.ts
CHANGED
|
@@ -2,11 +2,6 @@ import type { ISharkcraftInspection } from './sharkcraft-inspector.js';
|
|
|
2
2
|
export declare const AREA_MAP_SCHEMA = "sharkcraft.area-map/v1";
|
|
3
3
|
export declare enum AreaKind {
|
|
4
4
|
Core = "core",
|
|
5
|
-
Common = "common",
|
|
6
|
-
Runtime = "runtime",
|
|
7
|
-
Kernel = "kernel",
|
|
8
|
-
Plugin = "plugin",
|
|
9
|
-
Adapter = "adapter",
|
|
10
5
|
Ui = "ui",
|
|
11
6
|
App = "app",
|
|
12
7
|
Api = "api",
|
package/dist/area-map.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"area-map.d.ts","sourceRoot":"","sources":["../src/area-map.ts"],"names":[],"mappings":"AAEA,OAAO,KA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AgB,qBAAqB,CAAC,GAAG,EAAE,QAAQ,GAAG,MAAM,CAc3D"}
|
package/dist/area-map.js
CHANGED
|
@@ -4,11 +4,6 @@ export const AREA_MAP_SCHEMA = 'sharkcraft.area-map/v1';
|
|
|
4
4
|
export var AreaKind;
|
|
5
5
|
(function (AreaKind) {
|
|
6
6
|
AreaKind["Core"] = "core";
|
|
7
|
-
AreaKind["Common"] = "common";
|
|
8
|
-
AreaKind["Runtime"] = "runtime";
|
|
9
|
-
AreaKind["Kernel"] = "kernel";
|
|
10
|
-
AreaKind["Plugin"] = "plugin";
|
|
11
|
-
AreaKind["Adapter"] = "adapter";
|
|
12
7
|
AreaKind["Ui"] = "ui";
|
|
13
8
|
AreaKind["App"] = "app";
|
|
14
9
|
AreaKind["Api"] = "api";
|
|
@@ -20,11 +15,6 @@ export var AreaKind;
|
|
|
20
15
|
})(AreaKind || (AreaKind = {}));
|
|
21
16
|
const AREA_PATTERNS = [
|
|
22
17
|
{ kind: AreaKind.Core, match: [/^packages\/core(\/|$)/, /^src\/core(\/|$)/], idHint: 'core' },
|
|
23
|
-
{ kind: AreaKind.Common, match: [/^packages\/(common|shared)(\/|$)/, /^src\/(common|shared)(\/|$)/], idHint: 'common' },
|
|
24
|
-
{ kind: AreaKind.Runtime, match: [/^packages\/runtime(\/|$)/, /^src\/runtime(\/|$)/], idHint: 'runtime' },
|
|
25
|
-
{ kind: AreaKind.Kernel, match: [/^packages\/kernel(\/|$)/, /^src\/kernel(\/|$)/], idHint: 'kernel' },
|
|
26
|
-
{ kind: AreaKind.Plugin, match: [/plugins?(\/|$)/, /^packages\/plugin-/], idHint: 'plugin' },
|
|
27
|
-
{ kind: AreaKind.Adapter, match: [/adapters?(\/|$)/, /^packages\/adapter-/], idHint: 'adapter' },
|
|
28
18
|
{ kind: AreaKind.Ui, match: [/^packages\/(ui|dashboard|web)(\/|$)/, /^(src|app)\/(ui|components|pages|views)(\/|$)/], idHint: 'ui' },
|
|
29
19
|
{ kind: AreaKind.App, match: [/^apps?\//, /^packages\/app(\/|$)/], idHint: 'app' },
|
|
30
20
|
{ kind: AreaKind.Api, match: [/^packages\/api(\/|$)/, /\/api\//, /\/routes\//, /\/controllers\//], idHint: 'api' },
|
|
@@ -54,6 +54,13 @@ export declare function planChangedPreflight(options: {
|
|
|
54
54
|
readonly projectRoot: string;
|
|
55
55
|
readonly changedFiles: ReadonlyArray<string>;
|
|
56
56
|
readonly profile?: PreflightProfile;
|
|
57
|
+
/** Override the test gate command (defaults to `bun test`). Grounded in the
|
|
58
|
+
* project's declared verification commands by the CLI caller. */
|
|
59
|
+
readonly testCommand?: string;
|
|
60
|
+
/** Override the typecheck gate command (defaults to the base-tsconfig run). */
|
|
61
|
+
readonly typecheckCommand?: string;
|
|
62
|
+
/** Extra path prefixes that count as engine source (e.g. config-declared). */
|
|
63
|
+
readonly sourceGlobs?: readonly string[];
|
|
57
64
|
}): IChangedPreflightPlan;
|
|
58
65
|
export declare function renderChangedPreflightText(plan: IChangedPreflightPlan): string;
|
|
59
66
|
//# sourceMappingURL=changed-preflight.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"changed-preflight.d.ts","sourceRoot":"","sources":["../src/changed-preflight.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"changed-preflight.d.ts","sourceRoot":"","sources":["../src/changed-preflight.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,wBAAwB,oCAAoC,CAAC;AA6B1E,oBAAY,gBAAgB;IAC1B,KAAK,UAAU;IACf,QAAQ,aAAa;IACrB,MAAM,WAAW;CAClB;AAED,oBAAY,eAAe;IACzB,GAAG,QAAQ;IACX,IAAI,SAAS;IACb,SAAS,cAAc;CACxB;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,C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