@stsepelin/checktrail 0.1.0-alpha.2 → 0.1.0-alpha.4

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 (49) hide show
  1. package/README.md +14 -6
  2. package/dist/src/adapters.js +3 -1
  3. package/dist/src/architecture.d.ts +1 -1
  4. package/dist/src/contract-schema.d.ts +1 -1
  5. package/dist/src/contracts.d.ts +1 -1
  6. package/dist/src/evidence.js +2 -1
  7. package/dist/src/finding-policy-schema.d.ts +1 -1
  8. package/dist/src/go-scope-policy.d.ts +11 -0
  9. package/dist/src/go-scope-policy.js +50 -0
  10. package/dist/src/go-scope.d.ts +1 -1
  11. package/dist/src/go-scope.js +42 -5
  12. package/dist/src/output.js +6 -0
  13. package/dist/src/report-validation.d.ts +7 -0
  14. package/dist/src/runtime-inventory.d.ts +2 -2
  15. package/dist/src/schemas.d.ts +17 -0
  16. package/dist/src/schemas.js +16 -2
  17. package/dist/src/types.d.ts +4 -1
  18. package/dist/src/types.js +1 -1
  19. package/dist/src/typescript-arguments.d.ts +4 -0
  20. package/dist/src/typescript-arguments.js +10 -0
  21. package/dist/src/typescript-runner.d.ts +1 -0
  22. package/dist/src/typescript-runner.js +19 -0
  23. package/dist/src/typescript.js +3 -9
  24. package/dist/src/vue-tsc-runner.js +2 -1
  25. package/docs/ACCEPTANCE.md +24 -13
  26. package/docs/CLIENTS.md +6 -4
  27. package/docs/GO-RACE.md +4 -2
  28. package/docs/GO-SCOPE.md +70 -5
  29. package/docs/INSTALLATION.md +6 -6
  30. package/docs/LANGUAGES.md +16 -1
  31. package/docs/MCP-COMPATIBILITY.md +6 -0
  32. package/docs/NATIVE-CI.md +4 -0
  33. package/docs/ONBOARDING.md +8 -2
  34. package/docs/PUBLIC-ADOPTION.md +118 -0
  35. package/docs/RELEASE.md +77 -20
  36. package/docs/SETUP-SCOPES.md +107 -0
  37. package/docs/STATUS.md +33 -11
  38. package/docs/TYPESCRIPT.md +78 -0
  39. package/docs/measurements/go-scope-policy-replay.json +91 -0
  40. package/docs/measurements/public-adoption-alpha2.json +2034 -0
  41. package/docs/measurements/release-alpha3.json +362 -0
  42. package/docs/measurements/typescript-legacy-replay.json +39 -0
  43. package/package.json +1 -1
  44. package/schemas/go-scope-policy.schema.json +31 -0
  45. package/schemas/plan-summary.schema.json +6 -1
  46. package/schemas/plan.schema.json +30 -0
  47. package/schemas/report-summary.schema.json +5 -0
  48. package/schemas/report.schema.json +30 -0
  49. package/server.json +2 -2
package/README.md CHANGED
@@ -4,22 +4,30 @@ Local code validation with a CLI, MCP tools, and evidence of what actually ran.
4
4
 
5
5
  Formerly Repo Verifier. See the [rename guide](docs/RENAMING.md) for existing source checkouts.
6
6
 
7
- **Published preview: 0.1.0-alpha.1; alpha.2 is in preparation.** Public source is available at
7
+ **Published preview: 0.1.0-alpha.3.** Public source is available at
8
8
  [stsepelin/checktrail](https://github.com/stsepelin/checktrail).
9
9
  See [implementation status](docs/STATUS.md), the [plan](docs/PLAN.md) and the
10
10
  [language matrix](docs/LANGUAGES.md) before relying on an adapter.
11
11
  [Installation](docs/INSTALLATION.md) covers the CLI, Claude Code and Codex.
12
12
  [Agent skills](docs/SKILLS.md) provides setup, validation and review workflows
13
13
  installable with `npx skills add stsepelin/checktrail`.
14
- [Project setup](docs/ONBOARDING.md) covers the alpha.2 candidate's `init`, `doctor`
14
+ [Project setup](docs/ONBOARDING.md) covers `init`, `doctor`
15
15
  and MCP configuration generator.
16
16
  [Release preparation](docs/RELEASE.md) records publication and verification gates. The
17
17
  [milestone audit](docs/ACCEPTANCE.md) separates implemented profiles from open
18
18
  acceptance work; [client checks](docs/CLIENTS.md) record actual application coverage.
19
-
20
- The [hosted matrix](https://github.com/stsepelin/checktrail/actions/runs/35585998184)
21
- passed at `bfc8cc4` on Linux and macOS. That result predates the alpha.2 candidate;
22
- new release changes require their own CI run and package verification.
19
+ [Public adoption](docs/PUBLIC-ADOPTION.md) records the published package on five
20
+ pinned libraries, including setup friction and compatibility gaps.
21
+ Alpha.3 fixes the recorded [TypeScript 4.9.5 incompatibility](docs/TYPESCRIPT.md).
22
+ The [setup scope guide](docs/SETUP-SCOPES.md) explains language, documentation and workflow coverage.
23
+ The local checkout prepares **0.1.0-alpha.4**, adding explicit [Go scope exclusions](docs/GO-SCOPE.md)
24
+ and matching race-test package discovery. Alpha.4 is not published yet.
25
+
26
+ The [hosted matrix](https://github.com/stsepelin/checktrail/actions/runs/35597877167)
27
+ passed at release commit `b0b447d` on Linux and macOS. The exact npm tarball and
28
+ fresh CLI/MCP installations were verified. The
29
+ [MCP Registry entry](https://registry.modelcontextprotocol.io/v0.1/servers/io.github.stsepelin%2Fchecktrail/versions/0.1.0-alpha.3)
30
+ is active; execution remains disabled by default.
23
31
 
24
32
  Checktrail discovers projects, plans registered checks, invokes native tools
25
33
  when explicitly trusted, and reports results without turning skipped or empty
@@ -1,3 +1,4 @@
1
+ import { applyGoScopePolicy } from "./go-scope-policy.js";
1
2
  import { actionlintCheck, workflowRoot } from "./actionlint.js";
2
3
  import { clangCheck } from "./clang.js";
3
4
  import { javaCheck } from "./java.js";
@@ -312,7 +313,7 @@ export async function checksFor(source, project, requested) {
312
313
  ...env,
313
314
  CGO_ENABLED: "1",
314
315
  GORACE: "exitcode=66 log_path=stderr",
315
- }),
316
+ }, true),
316
317
  {
317
318
  executable: "go",
318
319
  args: ["test", "-race", "-json", "-count=1", "./..."],
@@ -354,6 +355,7 @@ export async function checksFor(source, project, requested) {
354
355
  });
355
356
  if (explicit)
356
357
  checks.push(await golangciCheck(source, project));
358
+ await applyGoScopePolicy(source, project, checks);
357
359
  return checks;
358
360
  }
359
361
  if (project.adapter === "infrastructure") {
@@ -78,6 +78,7 @@ export declare const architectureReportSchema: z.ZodObject<{
78
78
  }, z.core.$strict>;
79
79
  export declare const architectureSummarySchema: z.ZodObject<{
80
80
  schemaVersion: z.ZodLiteral<1>;
81
+ reason: z.ZodString;
81
82
  engineVersion: z.ZodString;
82
83
  provenance: z.ZodLiteral<"imported-dependency-graph">;
83
84
  outcome: z.ZodEnum<{
@@ -85,7 +86,6 @@ export declare const architectureSummarySchema: z.ZodObject<{
85
86
  failed: "failed";
86
87
  incomplete: "incomplete";
87
88
  }>;
88
- reason: z.ZodString;
89
89
  counts: z.ZodObject<{
90
90
  projects: z.ZodNumber;
91
91
  verifiedProjects: z.ZodNumber;
@@ -64,6 +64,7 @@ export declare const contractReportSchema: z.ZodObject<{
64
64
  export type ContractReport = z.infer<typeof contractReportSchema>;
65
65
  export declare const contractSummarySchema: z.ZodObject<{
66
66
  schemaVersion: z.ZodLiteral<1>;
67
+ reason: z.ZodString;
67
68
  engineVersion: z.ZodString;
68
69
  provenance: z.ZodLiteral<"imported-contract-samples">;
69
70
  outcome: z.ZodEnum<{
@@ -71,7 +72,6 @@ export declare const contractSummarySchema: z.ZodObject<{
71
72
  failed: "failed";
72
73
  incomplete: "incomplete";
73
74
  }>;
74
- reason: z.ZodString;
75
75
  counts: z.ZodObject<{
76
76
  contracts: z.ZodNumber;
77
77
  passed: z.ZodNumber;
@@ -5,10 +5,10 @@ export declare function validateContracts(input: unknown, options?: {
5
5
  }): Promise<ContractReport>;
6
6
  export declare function projectContractReport(result: ContractReport, detailed: boolean): {
7
7
  schemaVersion: 1;
8
+ reason: string;
8
9
  engineVersion: string;
9
10
  provenance: "imported-contract-samples";
10
11
  outcome: "passed" | "failed" | "incomplete";
11
- reason: string;
12
12
  counts: {
13
13
  contracts: number;
14
14
  passed: number;
@@ -172,6 +172,7 @@ function goTests(text, allowPackageFailures = false) {
172
172
  }
173
173
  export function evaluate(check, processes, root) {
174
174
  const result = {
175
+ ...(check.goScope ? { goScope: check.goScope } : {}),
175
176
  ...(check.external ? { external: check.external } : {}),
176
177
  id: check.id,
177
178
  adapter: check.adapter,
@@ -223,7 +224,7 @@ export function evaluate(check, processes, root) {
223
224
  ...(native.tests ? { tests: native.tests } : {}),
224
225
  };
225
226
  if (!goScopeComplete(check, processes[0], root, check.kind === "test" ? processes[1]?.stdout : undefined))
226
- return set("inconclusive", "Native Go selection omitted inventoried source, a package has no passing test, or scope could not be established.");
227
+ return set("inconclusive", "Native Go selection or declared exclusions did not reconcile, a package has no passing test, or scope could not be established.");
227
228
  return { ...result, ...(native.tests ? { tests: native.tests } : {}) };
228
229
  }
229
230
  if (check.parser === "eslint-json")
@@ -115,6 +115,7 @@ export declare const findingComparisonSchema: z.ZodObject<{
115
115
  export type FindingComparison = z.infer<typeof findingComparisonSchema>;
116
116
  export declare const findingComparisonSummarySchema: z.ZodObject<{
117
117
  schemaVersion: z.ZodLiteral<1>;
118
+ reason: z.ZodString;
118
119
  engineVersion: z.ZodString;
119
120
  provenance: z.ZodLiteral<"finding-comparison">;
120
121
  outcome: z.ZodEnum<{
@@ -122,7 +123,6 @@ export declare const findingComparisonSummarySchema: z.ZodObject<{
122
123
  failed: "failed";
123
124
  incomplete: "incomplete";
124
125
  }>;
125
- reason: z.ZodString;
126
126
  counts: z.ZodObject<{
127
127
  current: z.ZodNumber;
128
128
  new: z.ZodNumber;
@@ -0,0 +1,11 @@
1
+ import { z } from "zod";
2
+ import type { Check, Inventory, Project } from "./types.js";
3
+ export declare const goScopePolicySchema: z.ZodObject<{
4
+ schemaVersion: z.ZodLiteral<1>;
5
+ excludedFiles: z.ZodArray<z.ZodObject<{
6
+ path: z.ZodString;
7
+ reason: z.ZodString;
8
+ }, z.core.$strict>>;
9
+ }, z.core.$strict>;
10
+ export type GoScopePolicy = z.infer<typeof goScopePolicySchema>;
11
+ export declare function applyGoScopePolicy(source: Inventory, project: Project, checks: Check[]): Promise<void>;
@@ -0,0 +1,50 @@
1
+ import { lstat } from "node:fs/promises";
2
+ import path from "node:path";
3
+ import { z } from "zod";
4
+ import { readProjectFile } from "./inventory.js";
5
+ export const goScopePolicySchema = z.strictObject({
6
+ schemaVersion: z.literal(1),
7
+ excludedFiles: z
8
+ .array(z.strictObject({
9
+ path: z
10
+ .string()
11
+ .max(4096)
12
+ .regex(/^(?!\/)(?!.*(?:^|\/)\.{1,2}(?:\/|$))(?!.*\/\/)(?!.*[\\*?[\]{}])[\u0020-\u007e\u0080-\uffff]+\.go$/),
13
+ reason: z.string().min(1).max(1000).regex(/\S/),
14
+ }))
15
+ .max(1000),
16
+ });
17
+ export async function applyGoScopePolicy(source, project, checks) {
18
+ const file = path.posix.join(project.path, "checktrail.go-scope.json");
19
+ const scoped = checks.filter((check) => check.id !== "go.format");
20
+ try {
21
+ let entry;
22
+ try {
23
+ entry = await lstat(path.join(source.root, file));
24
+ }
25
+ catch (error) {
26
+ if (error.code === "ENOENT")
27
+ return;
28
+ throw error;
29
+ }
30
+ if (!entry.isFile() ||
31
+ entry.isSymbolicLink() ||
32
+ source.excluded.includes(file))
33
+ throw new Error("Go scope policy must be an inventoried regular file");
34
+ if (!source.files.includes(file))
35
+ throw new Error("Go scope policy is not inventoried");
36
+ const policy = goScopePolicySchema.parse(JSON.parse(await readProjectFile(source.root, file)));
37
+ const paths = policy.excludedFiles.map((entry) => entry.path);
38
+ if (new Set(paths).size !== paths.length)
39
+ throw new Error("Duplicate Go scope exclusion");
40
+ if (paths.some((file) => !project.files.includes(file)))
41
+ throw new Error("Go scope exclusions must name inventoried project files");
42
+ for (const check of scoped)
43
+ check.goScope = policy;
44
+ }
45
+ catch (error) {
46
+ for (const check of scoped)
47
+ check.unavailableReason =
48
+ error instanceof Error ? error.message : "Invalid Go scope policy";
49
+ }
50
+ }
@@ -7,5 +7,5 @@ export declare const goEnvironment: {
7
7
  GOENV: string;
8
8
  GOCACHEPROG: string;
9
9
  };
10
- export declare function goScopeCommand(project: string, env?: Record<string, string>): Command;
10
+ export declare function goScopeCommand(project: string, env?: Record<string, string>, race?: boolean): Command;
11
11
  export declare function goScopeComplete(check: Check, process: ProcessResult | undefined, root: string | undefined, testOutput?: string): boolean;
@@ -1,3 +1,4 @@
1
+ import { goScopePolicySchema } from "./go-scope-policy.js";
1
2
  import path from "node:path";
2
3
  import { z } from "zod";
3
4
  export const goEnvironment = {
@@ -8,10 +9,10 @@ export const goEnvironment = {
8
9
  GOENV: "off",
9
10
  GOCACHEPROG: "",
10
11
  };
11
- export function goScopeCommand(project, env = goEnvironment) {
12
+ export function goScopeCommand(project, env = goEnvironment, race = false) {
12
13
  return {
13
14
  executable: "go",
14
- args: ["list", "-json", "./..."],
15
+ args: ["list", "-json", ...(race ? ["-race"] : []), "./..."],
15
16
  cwd: project,
16
17
  env,
17
18
  };
@@ -60,6 +61,7 @@ const packageSchema = z.object({
60
61
  CgoFiles: names,
61
62
  TestGoFiles: names,
62
63
  XTestGoFiles: names,
64
+ IgnoredGoFiles: names,
63
65
  Error: z.unknown().optional(),
64
66
  DepsErrors: z.array(z.unknown()).optional(),
65
67
  });
@@ -68,11 +70,26 @@ export function goScopeComplete(check, process, root, testOutput) {
68
70
  !process ||
69
71
  process.exitCode !== 0 ||
70
72
  process.stderr.trim() ||
73
+ process.timedOut ||
74
+ process.cancelled ||
75
+ process.truncated ||
76
+ process.signal !== null ||
77
+ process.errorCode !== undefined ||
71
78
  !check.scope.length)
72
79
  return false;
73
80
  try {
74
81
  const packages = objects(process.stdout).map((value) => packageSchema.parse(value));
75
82
  const expected = new Set(check.scope.map((file) => path.resolve(root, check.project, file)));
83
+ if (expected.size !== check.scope.length)
84
+ return false;
85
+ const policy = check.goScope === undefined
86
+ ? undefined
87
+ : goScopePolicySchema.parse(check.goScope);
88
+ const exclusions = new Set((policy?.excludedFiles ?? []).map((entry) => path.resolve(root, check.project, entry.path)));
89
+ if (exclusions.size !== (policy?.excludedFiles.length ?? 0) ||
90
+ [...exclusions].some((file) => !expected.has(file)))
91
+ return false;
92
+ const ignored = new Set();
76
93
  const seen = new Set();
77
94
  const ids = new Set();
78
95
  for (const item of packages) {
@@ -88,13 +105,30 @@ export function goScopeComplete(check, process, root, testOutput) {
88
105
  ...item.TestGoFiles,
89
106
  ...item.XTestGoFiles,
90
107
  ]) {
91
- if (path.basename(file) !== file || !file.endsWith(".go"))
108
+ if (path.basename(file) !== file ||
109
+ file.includes("\\") ||
110
+ !file.endsWith(".go"))
92
111
  return false;
93
112
  const resolved = path.resolve(item.Dir, file);
94
- if (!expected.has(resolved) || seen.has(resolved))
113
+ if (!expected.has(resolved) ||
114
+ exclusions.has(resolved) ||
115
+ seen.has(resolved) ||
116
+ ignored.has(resolved))
95
117
  return false;
96
118
  seen.add(resolved);
97
119
  }
120
+ for (const file of item.IgnoredGoFiles) {
121
+ if (path.basename(file) !== file ||
122
+ file.includes("\\") ||
123
+ !file.endsWith(".go"))
124
+ return false;
125
+ const resolved = path.resolve(item.Dir, file);
126
+ if (!exclusions.has(resolved) ||
127
+ ignored.has(resolved) ||
128
+ seen.has(resolved))
129
+ return false;
130
+ ignored.add(resolved);
131
+ }
98
132
  }
99
133
  if (testOutput !== undefined) {
100
134
  const tested = new Set();
@@ -114,7 +148,10 @@ export function goScopeComplete(check, process, root, testOutput) {
114
148
  if (tested.size !== ids.size)
115
149
  return false;
116
150
  }
117
- return ids.size > 0 && seen.size === expected.size;
151
+ return (ids.size > 0 &&
152
+ seen.size > 0 &&
153
+ ignored.size === exclusions.size &&
154
+ seen.size + ignored.size === expected.size);
118
155
  }
119
156
  catch {
120
157
  return false;
@@ -22,6 +22,9 @@ export function projectPlan(plan, detailed) {
22
22
  excludedCount: plan.excluded.length,
23
23
  checks: plan.checks.map((check) => ({
24
24
  id: check.id,
25
+ ...(check.goScope
26
+ ? { goExcludedFileCount: check.goScope.excludedFiles.length }
27
+ : {}),
25
28
  kind: check.kind,
26
29
  ready: !check.unavailableReason,
27
30
  })),
@@ -41,6 +44,9 @@ export function projectReport(report, detailed) {
41
44
  sourceError: report.sourceError,
42
45
  checks: report.checks.map((check) => ({
43
46
  id: check.id,
47
+ ...(check.goScope
48
+ ? { goExcludedFileCount: check.goScope.excludedFiles.length }
49
+ : {}),
44
50
  status: check.status,
45
51
  ...(check.tests ? { tests: check.tests } : {}),
46
52
  })),
@@ -39,6 +39,13 @@ export declare function validatedReport(input: unknown): {
39
39
  source: "adapter-reported";
40
40
  }[] | undefined;
41
41
  } | undefined;
42
+ goScope?: {
43
+ schemaVersion: 1;
44
+ excludedFiles: {
45
+ path: string;
46
+ reason: string;
47
+ }[];
48
+ } | undefined;
42
49
  tests?: {
43
50
  total: number;
44
51
  passed: number;
@@ -72,6 +72,7 @@ export declare const runtimeComparisonSchema: z.ZodObject<{
72
72
  }, z.core.$strict>;
73
73
  export declare const runtimeComparisonSummarySchema: z.ZodObject<{
74
74
  schemaVersion: z.ZodLiteral<1>;
75
+ reason: z.ZodString;
75
76
  engineVersion: z.ZodString;
76
77
  provenance: z.ZodLiteral<"imported-runtime-comparison">;
77
78
  outcome: z.ZodEnum<{
@@ -79,7 +80,6 @@ export declare const runtimeComparisonSummarySchema: z.ZodObject<{
79
80
  failed: "failed";
80
81
  incomplete: "incomplete";
81
82
  }>;
82
- reason: z.ZodString;
83
83
  beforeFingerprint: z.ZodString;
84
84
  afterFingerprint: z.ZodString;
85
85
  counts: z.ZodObject<{
@@ -95,10 +95,10 @@ export type RuntimeComparison = z.infer<typeof runtimeComparisonSchema>;
95
95
  export declare function compareRuntimeInventories(beforeInput: unknown, afterInput: unknown): RuntimeComparison;
96
96
  export declare function projectRuntimeComparison(result: RuntimeComparison, detailed: boolean): {
97
97
  schemaVersion: 1;
98
+ reason: string;
98
99
  engineVersion: string;
99
100
  provenance: "imported-runtime-comparison";
100
101
  outcome: "passed" | "failed" | "incomplete";
101
- reason: string;
102
102
  beforeFingerprint: string;
103
103
  afterFingerprint: string;
104
104
  counts: {
@@ -1,3 +1,4 @@
1
+ export { goScopePolicySchema } from "./go-scope-policy.js";
1
2
  export { externalManifestSchema, externalReferenceSchema, externalRequestSchema, externalResultSchema, } from "./external-adapter.js";
2
3
  export { actionlintConfigSchema } from "./actionlint.js";
3
4
  export { dotnetConfigSchema } from "./dotnet.js";
@@ -50,6 +51,13 @@ export declare const reportSchema: z.ZodObject<{
50
51
  adapter: z.ZodString;
51
52
  project: z.ZodString;
52
53
  scope: z.ZodArray<z.ZodString>;
54
+ goScope: z.ZodOptional<z.ZodObject<{
55
+ schemaVersion: z.ZodLiteral<1>;
56
+ excludedFiles: z.ZodArray<z.ZodObject<{
57
+ path: z.ZodString;
58
+ reason: z.ZodString;
59
+ }, z.core.$strict>>;
60
+ }, z.core.$strict>>;
53
61
  status: z.ZodEnum<{
54
62
  error: "error";
55
63
  passed: "passed";
@@ -200,6 +208,7 @@ export declare const reportSummarySchema: z.ZodObject<{
200
208
  failed: z.ZodNumber;
201
209
  skipped: z.ZodNumber;
202
210
  }, z.core.$strict>>;
211
+ goExcludedFileCount: z.ZodOptional<z.ZodNumber>;
203
212
  }, z.core.$strict>>;
204
213
  runId: z.ZodString;
205
214
  outcome: z.ZodEnum<{
@@ -256,6 +265,13 @@ export declare const planSchema: z.ZodObject<{
256
265
  adapter: z.ZodString;
257
266
  project: z.ZodString;
258
267
  scope: z.ZodArray<z.ZodString>;
268
+ goScope: z.ZodOptional<z.ZodObject<{
269
+ schemaVersion: z.ZodLiteral<1>;
270
+ excludedFiles: z.ZodArray<z.ZodObject<{
271
+ path: z.ZodString;
272
+ reason: z.ZodString;
273
+ }, z.core.$strict>>;
274
+ }, z.core.$strict>>;
259
275
  kind: z.ZodEnum<{
260
276
  format: "format";
261
277
  analysis: "analysis";
@@ -354,6 +370,7 @@ export declare const planSummarySchema: z.ZodObject<{
354
370
  unsupported: "unsupported";
355
371
  }>;
356
372
  ready: z.ZodBoolean;
373
+ goExcludedFileCount: z.ZodOptional<z.ZodNumber>;
357
374
  }, z.core.$strict>>;
358
375
  schemaVersion: z.ZodLiteral<1>;
359
376
  engineVersion: z.ZodString;
@@ -1,3 +1,5 @@
1
+ import { goScopePolicySchema } from "./go-scope-policy.js";
2
+ export { goScopePolicySchema } from "./go-scope-policy.js";
1
3
  import { externalIdentitySchema } from "./external-adapter.js";
2
4
  export { externalManifestSchema, externalReferenceSchema, externalRequestSchema, externalResultSchema, } from "./external-adapter.js";
3
5
  export { actionlintConfigSchema } from "./actionlint.js";
@@ -124,6 +126,7 @@ export const reportSchema = z.strictObject({
124
126
  adapter: z.string(),
125
127
  project: z.string(),
126
128
  scope: strings,
129
+ goScope: goScopePolicySchema.optional(),
127
130
  status,
128
131
  reason: z.string(),
129
132
  processes: z.array(processResult),
@@ -161,7 +164,12 @@ export const reportSchema = z.strictObject({
161
164
  export const reportSummarySchema = z.strictObject({
162
165
  ...reportMetadata,
163
166
  selection: selectionSummary.optional(),
164
- checks: z.array(z.strictObject({ id: z.string(), status, tests: tests.optional() })),
167
+ checks: z.array(z.strictObject({
168
+ id: z.string(),
169
+ status,
170
+ tests: tests.optional(),
171
+ goExcludedFileCount: count.optional(),
172
+ })),
165
173
  });
166
174
  export const planSchema = z.strictObject({
167
175
  ...metadata,
@@ -182,6 +190,7 @@ export const planSchema = z.strictObject({
182
190
  adapter: z.string(),
183
191
  project: z.string(),
184
192
  scope: strings,
193
+ goScope: goScopePolicySchema.optional(),
185
194
  kind,
186
195
  parser: z.enum(PARSERS),
187
196
  commands: z.array(command),
@@ -197,7 +206,12 @@ export const planSummarySchema = z.strictObject({
197
206
  projectCount: count,
198
207
  adapters: strings,
199
208
  excludedCount: count,
200
- checks: z.array(z.strictObject({ id: z.string(), kind, ready: z.boolean() })),
209
+ checks: z.array(z.strictObject({
210
+ id: z.string(),
211
+ kind,
212
+ ready: z.boolean(),
213
+ goExcludedFileCount: count.optional(),
214
+ })),
201
215
  });
202
216
  export const junitImportSchema = z.strictObject({
203
217
  ...metadata,
@@ -1,6 +1,7 @@
1
+ import type { GoScopePolicy } from "./go-scope-policy.js";
1
2
  import type { ExternalIdentity } from "./external-adapter.js";
2
3
  import type { RuntimeInventory } from "./runtime-inventory.js";
3
- export declare const VERSION = "0.1.0-alpha.2";
4
+ export declare const VERSION = "0.1.0-alpha.4";
4
5
  export declare const PARSERS: readonly ["vue-router-json", "nuxt-json", "exit", "empty", "node-events", "unittest", "go-scope-test", "go-scope-analysis", "golangci-json", "staticcheck-json", "go-json", "typescript-build-json", "tsc-files", "eslint-json", "vitest-json", "playwright-json", "jest-json", "pytest-json", "fastapi-json", "django-json", "laravel-json", "rust-json", "clang-json", "java-json", "dotnet-json", "actionlint-json", "external-json", "ruby-syntax", "silent-syntax", "ruff-json", "mypy-json", "phpstan-json", "phpunit-junit", "pint-json"];
5
6
  export type Status = "passed" | "failed" | "unavailable" | "skipped" | "error" | "inconclusive";
6
7
  export type Outcome = "passed" | "failed" | "incomplete";
@@ -44,6 +45,7 @@ export interface ToolEvidence {
44
45
  path?: string;
45
46
  }
46
47
  export interface Check {
48
+ goScope?: GoScopePolicy;
47
49
  external?: ExternalIdentity;
48
50
  id: string;
49
51
  adapter: string;
@@ -115,6 +117,7 @@ export interface Finding {
115
117
  line?: number;
116
118
  }
117
119
  export interface CheckResult {
120
+ goScope?: GoScopePolicy;
118
121
  external?: ExternalIdentity & {
119
122
  tools?: {
120
123
  name: string;
package/dist/src/types.js CHANGED
@@ -1,4 +1,4 @@
1
- export const VERSION = "0.1.0-alpha.2";
1
+ export const VERSION = "0.1.0-alpha.4";
2
2
  export const PARSERS = [
3
3
  "vue-router-json",
4
4
  "nuxt-json",
@@ -0,0 +1,4 @@
1
+ import type { parseCommandLine } from "typescript";
2
+ export declare function typecheckArguments(compiler: {
3
+ parseCommandLine: typeof parseCommandLine;
4
+ }, args: string[]): string[];
@@ -0,0 +1,10 @@
1
+ export function typecheckArguments(compiler, args) {
2
+ const probe = compiler.parseCommandLine(["--noCheck", "false"]);
3
+ if (probe.errors.length === 0 && probe.options.noCheck === false)
4
+ return [...args, "--noCheck", "false"];
5
+ if (probe.errors.length === 1 &&
6
+ probe.errors[0].code === 5023 &&
7
+ probe.options.noCheck === undefined)
8
+ return args;
9
+ throw new Error("Cannot establish the compiler's noCheck option support");
10
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,19 @@
1
+ import { createRequire } from "node:module";
2
+ import path from "node:path";
3
+ import { withinRoot } from "./inventory.js";
4
+ import { typecheckArguments } from "./typescript-arguments.js";
5
+ async function main() {
6
+ const [entry, root, ...args] = process.argv.slice(2);
7
+ if (!entry || !root)
8
+ throw new Error("Invalid TypeScript compiler arguments");
9
+ const tool = await withinRoot(root, path.relative(root, entry));
10
+ const api = await withinRoot(root, path.relative(root, path.resolve(path.dirname(tool), "../lib/typescript.js")));
11
+ const load = createRequire(tool);
12
+ const ts = load(api);
13
+ process.argv = [process.execPath, tool, ...typecheckArguments(ts, args)];
14
+ load(tool);
15
+ }
16
+ main().catch((error) => {
17
+ process.stderr.write(`${error instanceof Error ? error.message : "TypeScript checking failed"}\n`);
18
+ process.exitCode = 2;
19
+ });
@@ -16,18 +16,12 @@ export async function typescriptCheck(source, project, vue = false) {
16
16
  {
17
17
  executable: process.execPath,
18
18
  args: [
19
- ...(vue
20
- ? [
21
- fileURLToPath(new URL("./vue-tsc-runner.js", import.meta.url)),
22
- compiler,
23
- source.root,
24
- ]
25
- : [compiler]),
19
+ fileURLToPath(new URL(vue ? "./vue-tsc-runner.js" : "./typescript-runner.js", import.meta.url)),
20
+ compiler,
21
+ source.root,
26
22
  "--project",
27
23
  "./tsconfig.json",
28
24
  "--noEmit",
29
- "--noCheck",
30
- "false",
31
25
  "--pretty",
32
26
  "false",
33
27
  "--incremental",
@@ -1,5 +1,6 @@
1
1
  import { createRequire } from "node:module";
2
2
  import path from "node:path";
3
+ import { typecheckArguments } from "./typescript-arguments.js";
3
4
  import { withinRoot } from "./inventory.js";
4
5
  async function main() {
5
6
  const [entry, root, ...args] = process.argv.slice(2);
@@ -15,7 +16,7 @@ async function main() {
15
16
  throw new Error("Vue template checking is disabled by skipTemplateCodegen");
16
17
  const compiler = load(tool);
17
18
  const tsc = await resolve("typescript/lib/tsc.js");
18
- process.argv = [process.execPath, tool, ...args];
19
+ process.argv = [process.execPath, tool, ...typecheckArguments(ts, args)];
19
20
  compiler.run(tsc);
20
21
  }
21
22
  main().catch((error) => {