@stsepelin/checktrail 0.1.0-alpha.1
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/CONTRIBUTING.md +42 -0
- package/LICENSE +21 -0
- package/README.md +355 -0
- package/SECURITY.md +46 -0
- package/dist/src/actionlint-evidence.d.ts +2 -0
- package/dist/src/actionlint-evidence.js +166 -0
- package/dist/src/actionlint-inputs.d.ts +5 -0
- package/dist/src/actionlint-inputs.js +123 -0
- package/dist/src/actionlint-runner.d.ts +1 -0
- package/dist/src/actionlint-runner.js +122 -0
- package/dist/src/actionlint.d.ts +19 -0
- package/dist/src/actionlint.js +80 -0
- package/dist/src/adapters.d.ts +49 -0
- package/dist/src/adapters.js +430 -0
- package/dist/src/architecture.d.ts +107 -0
- package/dist/src/architecture.js +230 -0
- package/dist/src/clang-evidence.d.ts +2 -0
- package/dist/src/clang-evidence.js +194 -0
- package/dist/src/clang-protocol.d.ts +3 -0
- package/dist/src/clang-protocol.js +25 -0
- package/dist/src/clang-runner.d.ts +1 -0
- package/dist/src/clang-runner.js +159 -0
- package/dist/src/clang.d.ts +44 -0
- package/dist/src/clang.js +197 -0
- package/dist/src/cli.d.ts +2 -0
- package/dist/src/cli.js +338 -0
- package/dist/src/config.d.ts +33 -0
- package/dist/src/config.js +140 -0
- package/dist/src/contract-schema.d.ts +85 -0
- package/dist/src/contract-schema.js +56 -0
- package/dist/src/contract-worker.d.ts +1 -0
- package/dist/src/contract-worker.js +123 -0
- package/dist/src/contracts.d.ts +22 -0
- package/dist/src/contracts.js +123 -0
- package/dist/src/django-evidence.d.ts +2 -0
- package/dist/src/django-evidence.js +100 -0
- package/dist/src/django-runner.d.ts +1 -0
- package/dist/src/django-runner.js +80 -0
- package/dist/src/django.d.ts +9 -0
- package/dist/src/django.js +50 -0
- package/dist/src/dotnet-compiler.d.ts +1 -0
- package/dist/src/dotnet-compiler.js +87 -0
- package/dist/src/dotnet-evidence.d.ts +2 -0
- package/dist/src/dotnet-evidence.js +127 -0
- package/dist/src/dotnet-runner.d.ts +1 -0
- package/dist/src/dotnet-runner.js +167 -0
- package/dist/src/dotnet.d.ts +65 -0
- package/dist/src/dotnet.js +120 -0
- package/dist/src/engine.d.ts +19 -0
- package/dist/src/engine.js +239 -0
- package/dist/src/environment.d.ts +6 -0
- package/dist/src/environment.js +36 -0
- package/dist/src/eslint-evidence.d.ts +2 -0
- package/dist/src/eslint-evidence.js +98 -0
- package/dist/src/eslint-runner.d.ts +1 -0
- package/dist/src/eslint-runner.js +61 -0
- package/dist/src/eslint.d.ts +2 -0
- package/dist/src/eslint.js +40 -0
- package/dist/src/evidence.d.ts +2 -0
- package/dist/src/evidence.js +313 -0
- package/dist/src/external-adapter.d.ts +164 -0
- package/dist/src/external-adapter.js +265 -0
- package/dist/src/external-evidence.d.ts +2 -0
- package/dist/src/external-evidence.js +127 -0
- package/dist/src/external-runner.d.ts +1 -0
- package/dist/src/external-runner.js +122 -0
- package/dist/src/fastapi-evidence.d.ts +2 -0
- package/dist/src/fastapi-evidence.js +126 -0
- package/dist/src/fastapi-runner.d.ts +1 -0
- package/dist/src/fastapi-runner.js +84 -0
- package/dist/src/fastapi.d.ts +10 -0
- package/dist/src/fastapi.js +52 -0
- package/dist/src/fetch-pack.d.ts +16 -0
- package/dist/src/fetch-pack.js +154 -0
- package/dist/src/finding-policy-schema.d.ts +146 -0
- package/dist/src/finding-policy-schema.js +70 -0
- package/dist/src/finding-policy.d.ts +62 -0
- package/dist/src/finding-policy.js +206 -0
- package/dist/src/git-selection.d.ts +3 -0
- package/dist/src/git-selection.js +229 -0
- package/dist/src/go-directives.d.ts +1 -0
- package/dist/src/go-directives.js +32 -0
- package/dist/src/go-scope.d.ts +11 -0
- package/dist/src/go-scope.js +122 -0
- package/dist/src/golangci-evidence.d.ts +2 -0
- package/dist/src/golangci-evidence.js +92 -0
- package/dist/src/golangci-runner.d.ts +1 -0
- package/dist/src/golangci-runner.js +124 -0
- package/dist/src/golangci.d.ts +2 -0
- package/dist/src/golangci.js +35 -0
- package/dist/src/guidance.d.ts +98 -0
- package/dist/src/guidance.js +247 -0
- package/dist/src/index.d.ts +31 -0
- package/dist/src/index.js +16 -0
- package/dist/src/inventory.d.ts +4 -0
- package/dist/src/inventory.js +94 -0
- package/dist/src/java-compiler.d.ts +1 -0
- package/dist/src/java-compiler.js +110 -0
- package/dist/src/java-evidence.d.ts +2 -0
- package/dist/src/java-evidence.js +114 -0
- package/dist/src/java-runner.d.ts +1 -0
- package/dist/src/java-runner.js +79 -0
- package/dist/src/java.d.ts +25 -0
- package/dist/src/java.js +102 -0
- package/dist/src/jest-evidence.d.ts +2 -0
- package/dist/src/jest-evidence.js +117 -0
- package/dist/src/jest-runner.d.ts +1 -0
- package/dist/src/jest-runner.js +46 -0
- package/dist/src/jest.d.ts +2 -0
- package/dist/src/jest.js +36 -0
- package/dist/src/junit.d.ts +18 -0
- package/dist/src/junit.js +157 -0
- package/dist/src/laravel-evidence.d.ts +2 -0
- package/dist/src/laravel-evidence.js +175 -0
- package/dist/src/laravel-runner.d.ts +1 -0
- package/dist/src/laravel-runner.js +168 -0
- package/dist/src/laravel.d.ts +8 -0
- package/dist/src/laravel.js +50 -0
- package/dist/src/local-tool.d.ts +1 -0
- package/dist/src/local-tool.js +19 -0
- package/dist/src/mcp.d.ts +14 -0
- package/dist/src/mcp.js +362 -0
- package/dist/src/mutation.d.ts +118 -0
- package/dist/src/mutation.js +370 -0
- package/dist/src/mypy-evidence.d.ts +2 -0
- package/dist/src/mypy-evidence.js +63 -0
- package/dist/src/mypy.d.ts +2 -0
- package/dist/src/mypy.js +59 -0
- package/dist/src/node-reporter.d.ts +1 -0
- package/dist/src/node-reporter.js +28 -0
- package/dist/src/nuxt-evidence.d.ts +2 -0
- package/dist/src/nuxt-evidence.js +160 -0
- package/dist/src/nuxt-protocol.d.ts +52 -0
- package/dist/src/nuxt-protocol.js +29 -0
- package/dist/src/nuxt-runner.d.ts +1 -0
- package/dist/src/nuxt-runner.js +165 -0
- package/dist/src/nuxt.d.ts +24 -0
- package/dist/src/nuxt.js +105 -0
- package/dist/src/output.d.ts +3 -0
- package/dist/src/output.js +48 -0
- package/dist/src/phpstan-evidence.d.ts +2 -0
- package/dist/src/phpstan-evidence.js +81 -0
- package/dist/src/phpstan.d.ts +2 -0
- package/dist/src/phpstan.js +51 -0
- package/dist/src/phpunit-evidence.d.ts +2 -0
- package/dist/src/phpunit-evidence.js +53 -0
- package/dist/src/phpunit.d.ts +2 -0
- package/dist/src/phpunit.js +58 -0
- package/dist/src/pint-evidence.d.ts +2 -0
- package/dist/src/pint-evidence.js +79 -0
- package/dist/src/pint-runner.d.ts +1 -0
- package/dist/src/pint-runner.js +53 -0
- package/dist/src/pint.d.ts +2 -0
- package/dist/src/pint.js +37 -0
- package/dist/src/playwright-evidence.d.ts +2 -0
- package/dist/src/playwright-evidence.js +127 -0
- package/dist/src/playwright-reporter.d.ts +10 -0
- package/dist/src/playwright-reporter.js +37 -0
- package/dist/src/playwright-runner.d.ts +1 -0
- package/dist/src/playwright-runner.js +61 -0
- package/dist/src/playwright.d.ts +2 -0
- package/dist/src/playwright.js +35 -0
- package/dist/src/policy-pack.d.ts +21 -0
- package/dist/src/policy-pack.js +41 -0
- package/dist/src/pytest-evidence.d.ts +2 -0
- package/dist/src/pytest-evidence.js +116 -0
- package/dist/src/pytest-runner.d.ts +1 -0
- package/dist/src/pytest-runner.js +48 -0
- package/dist/src/pytest.d.ts +2 -0
- package/dist/src/pytest.js +25 -0
- package/dist/src/report-validation.d.ts +129 -0
- package/dist/src/report-validation.js +27 -0
- package/dist/src/review.d.ts +270 -0
- package/dist/src/review.js +349 -0
- package/dist/src/ruby.d.ts +2 -0
- package/dist/src/ruby.js +25 -0
- package/dist/src/ruff-evidence.d.ts +2 -0
- package/dist/src/ruff-evidence.js +99 -0
- package/dist/src/ruff.d.ts +2 -0
- package/dist/src/ruff.js +40 -0
- package/dist/src/runner.d.ts +8 -0
- package/dist/src/runner.js +117 -0
- package/dist/src/runtime-inventory.d.ts +112 -0
- package/dist/src/runtime-inventory.js +200 -0
- package/dist/src/rust-dep-info.d.ts +1 -0
- package/dist/src/rust-dep-info.js +46 -0
- package/dist/src/rust-evidence.d.ts +2 -0
- package/dist/src/rust-evidence.js +157 -0
- package/dist/src/rust-runner.d.ts +1 -0
- package/dist/src/rust-runner.js +161 -0
- package/dist/src/rust.d.ts +7 -0
- package/dist/src/rust.js +39 -0
- package/dist/src/sarif.d.ts +86 -0
- package/dist/src/sarif.js +113 -0
- package/dist/src/schemas.d.ts +393 -0
- package/dist/src/schemas.js +222 -0
- package/dist/src/staticcheck-evidence.d.ts +2 -0
- package/dist/src/staticcheck-evidence.js +75 -0
- package/dist/src/swift.d.ts +2 -0
- package/dist/src/swift.js +20 -0
- package/dist/src/task-store.d.ts +37 -0
- package/dist/src/task-store.js +349 -0
- package/dist/src/tool-versions.d.ts +3 -0
- package/dist/src/tool-versions.js +260 -0
- package/dist/src/types.d.ts +157 -0
- package/dist/src/types.js +37 -0
- package/dist/src/typescript-build-evidence.d.ts +2 -0
- package/dist/src/typescript-build-evidence.js +86 -0
- package/dist/src/typescript-build-runner.d.ts +1 -0
- package/dist/src/typescript-build-runner.js +132 -0
- package/dist/src/typescript-build.d.ts +2 -0
- package/dist/src/typescript-build.js +41 -0
- package/dist/src/typescript.d.ts +2 -0
- package/dist/src/typescript.js +54 -0
- package/dist/src/validation-task-worker.d.ts +1 -0
- package/dist/src/validation-task-worker.js +205 -0
- package/dist/src/validation-tasks-protocol.d.ts +69 -0
- package/dist/src/validation-tasks-protocol.js +57 -0
- package/dist/src/validation-tasks.d.ts +11 -0
- package/dist/src/validation-tasks.js +144 -0
- package/dist/src/vitest-evidence.d.ts +2 -0
- package/dist/src/vitest-evidence.js +112 -0
- package/dist/src/vitest-runner.d.ts +1 -0
- package/dist/src/vitest-runner.js +48 -0
- package/dist/src/vitest.d.ts +2 -0
- package/dist/src/vitest.js +36 -0
- package/dist/src/vue-router-capture.d.ts +42 -0
- package/dist/src/vue-router-capture.js +87 -0
- package/dist/src/vue-router-evidence.d.ts +2 -0
- package/dist/src/vue-router-evidence.js +126 -0
- package/dist/src/vue-router-protocol.d.ts +63 -0
- package/dist/src/vue-router-protocol.js +44 -0
- package/dist/src/vue-router-runner.d.ts +1 -0
- package/dist/src/vue-router-runner.js +88 -0
- package/dist/src/vue-router.d.ts +23 -0
- package/dist/src/vue-router.js +108 -0
- package/dist/src/vue-tsc-runner.d.ts +1 -0
- package/dist/src/vue-tsc-runner.js +24 -0
- package/dist/src/workspace.d.ts +7 -0
- package/dist/src/workspace.js +53 -0
- package/docs/ACCEPTANCE.md +56 -0
- package/docs/ACTIONLINT.md +112 -0
- package/docs/ARCHITECTURE-POLICY.md +82 -0
- package/docs/ARCHITECTURE.md +122 -0
- package/docs/CLANG.md +113 -0
- package/docs/CLIENTS.md +109 -0
- package/docs/CONTRACTS.md +73 -0
- package/docs/DEPENDENCIES.md +42 -0
- package/docs/DJANGO.md +70 -0
- package/docs/DOTNET.md +114 -0
- package/docs/ENVIRONMENTS.md +52 -0
- package/docs/ESLINT.md +68 -0
- package/docs/EVALUATION.md +124 -0
- package/docs/EXECUTION.md +250 -0
- package/docs/EXTERNAL-ADAPTERS.md +170 -0
- package/docs/EXTERNAL-EVALUATION.md +155 -0
- package/docs/EXTERNAL-RUFF-EVALUATION.md +85 -0
- package/docs/FASTAPI.md +73 -0
- package/docs/FINDING-POLICY.md +67 -0
- package/docs/GO-RACE.md +19 -0
- package/docs/GO-SCOPE.md +63 -0
- package/docs/GOLANGCI-LINT.md +64 -0
- package/docs/GUIDANCE.md +46 -0
- package/docs/IMPACT-MEASUREMENT.md +97 -0
- package/docs/INSTALLATION.md +102 -0
- package/docs/JAVA.md +79 -0
- package/docs/JEST.md +36 -0
- package/docs/JUNIT.md +31 -0
- package/docs/LANGUAGES.md +113 -0
- package/docs/LARAVEL.md +111 -0
- package/docs/MCP-COMPATIBILITY.md +68 -0
- package/docs/MUTATIONS.md +93 -0
- package/docs/MYPY.md +37 -0
- package/docs/NATIVE-CI.md +96 -0
- package/docs/NUXT.md +123 -0
- package/docs/PACK-DISTRIBUTION.md +98 -0
- package/docs/PERFORMANCE.md +71 -0
- package/docs/PEST.md +36 -0
- package/docs/PHPSTAN.md +48 -0
- package/docs/PHPUNIT.md +32 -0
- package/docs/PINT.md +41 -0
- package/docs/PLAN.md +265 -0
- package/docs/PLAYWRIGHT.md +73 -0
- package/docs/POLICY-PACKS.md +106 -0
- package/docs/PRIOR-WORKFLOW-EVALUATION.md +116 -0
- package/docs/PUBLICATION.md +28 -0
- package/docs/PYTEST.md +51 -0
- package/docs/RELEASE.md +115 -0
- package/docs/RENAMING.md +55 -0
- package/docs/REVIEW-EXCHANGE.md +136 -0
- package/docs/RUBY.md +50 -0
- package/docs/RUFF.md +39 -0
- package/docs/RUNTIME-INVENTORY.md +56 -0
- package/docs/RUST.md +74 -0
- package/docs/SARIF.md +64 -0
- package/docs/STATUS.md +530 -0
- package/docs/SWIFT.md +48 -0
- package/docs/TASK-STORAGE.md +141 -0
- package/docs/TOOL-IDENTITY.md +30 -0
- package/docs/TYPESCRIPT-BUILD.md +55 -0
- package/docs/VALIDATION-TASKS.md +119 -0
- package/docs/VITEST.md +36 -0
- package/docs/VUE-ROUTER.md +130 -0
- package/docs/VUE-TSC.md +26 -0
- package/docs/WORKSPACES.md +81 -0
- package/docs/licenses/nodable-entities-3.0.0.txt +21 -0
- package/docs/measurements/client-claude-before-schema-fix-darwin-arm64-node26.json +60 -0
- package/docs/measurements/client-claude-darwin-arm64-node26.json +55 -0
- package/docs/measurements/client-codex-darwin-arm64-node26.json +175 -0
- package/docs/measurements/evaluation-corpus-repo-verifier.json +332 -0
- package/docs/measurements/evaluation-darwin-arm64-node26.json +1236 -0
- package/docs/measurements/evaluation-linux-arm64-node22.json +1236 -0
- package/docs/measurements/external-eslint-darwin-arm64-node26.json +11866 -0
- package/docs/measurements/external-eslint-linux-arm64-node22.json +11866 -0
- package/docs/measurements/external-eslint-preservation.json +1527 -0
- package/docs/measurements/external-ruff-darwin-arm64-node26.json +1031 -0
- package/docs/measurements/external-ruff-linux-arm64-node22.json +1031 -0
- package/docs/measurements/hosted-ci-52ba415.json +1005 -0
- package/docs/measurements/impact-darwin-arm64-node26.json +6685 -0
- package/docs/measurements/impact-linux-arm64-node22.json +6690 -0
- package/docs/measurements/performance-darwin-arm64-node26.json +845 -0
- package/docs/measurements/performance-linux-arm64-node22.json +845 -0
- package/docs/measurements/required-native-profiles.json +500 -0
- package/package.json +72 -0
- package/packs/actionlint.json +8 -0
- package/packs/cpp.json +8 -0
- package/packs/dotnet.json +8 -0
- package/packs/go.json +7 -0
- package/packs/java.json +8 -0
- package/packs/javascript-node.json +7 -0
- package/packs/nuxt.json +7 -0
- package/packs/php-pest.json +7 -0
- package/packs/php-phpunit.json +7 -0
- package/packs/python-pytest.json +7 -0
- package/packs/ruby.json +7 -0
- package/packs/rust.json +7 -0
- package/packs/swift.json +7 -0
- package/packs/vue-router.json +7 -0
- package/packs/vue.json +11 -0
- package/schemas/actionlint-config.schema.json +19 -0
- package/schemas/architecture-policy.schema.json +51 -0
- package/schemas/architecture-report.schema.json +123 -0
- package/schemas/architecture-summary.schema.json +82 -0
- package/schemas/clang-database.schema.json +23 -0
- package/schemas/config.schema.json +69 -0
- package/schemas/contract-bundle.schema.json +78 -0
- package/schemas/contract-report.schema.json +114 -0
- package/schemas/contract-summary.schema.json +72 -0
- package/schemas/dependency-graph.schema.json +65 -0
- package/schemas/django-config.schema.json +16 -0
- package/schemas/dotnet-config.schema.json +60 -0
- package/schemas/external-manifest.schema.json +97 -0
- package/schemas/external-reference.schema.json +10 -0
- package/schemas/external-request.schema.json +56 -0
- package/schemas/external-result.schema.json +111 -0
- package/schemas/fastapi-config.schema.json +27 -0
- package/schemas/finding-baseline.schema.json +92 -0
- package/schemas/finding-comparison-summary.schema.json +95 -0
- package/schemas/finding-comparison.schema.json +121 -0
- package/schemas/guidance-context.schema.json +34 -0
- package/schemas/guidance-report.schema.json +176 -0
- package/schemas/guidance-summary.schema.json +68 -0
- package/schemas/java-config.schema.json +24 -0
- package/schemas/junit.schema.json +69 -0
- package/schemas/laravel-config.schema.json +11 -0
- package/schemas/mutation-recipe.schema.json +31 -0
- package/schemas/mutation-report.schema.json +238 -0
- package/schemas/mutation-summary.schema.json +98 -0
- package/schemas/nuxt-config.schema.json +51 -0
- package/schemas/plan-summary.schema.json +63 -0
- package/schemas/plan.schema.json +244 -0
- package/schemas/policy-pack.schema.json +41 -0
- package/schemas/report-summary.schema.json +100 -0
- package/schemas/report.schema.json +463 -0
- package/schemas/review-assessment.schema.json +133 -0
- package/schemas/review-context-summary.schema.json +31 -0
- package/schemas/review-context.schema.json +254 -0
- package/schemas/review-receipt-summary.schema.json +104 -0
- package/schemas/review-receipt.schema.json +271 -0
- package/schemas/review-selection.schema.json +30 -0
- package/schemas/runtime-comparison-summary.schema.json +68 -0
- package/schemas/runtime-comparison.schema.json +127 -0
- package/schemas/runtime-inventory.schema.json +99 -0
- package/schemas/vue-router-config.schema.json +67 -0
- package/server.json +47 -0
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import { externalIdentitySchema } from "./external-adapter.js";
|
|
2
|
+
export { externalManifestSchema, externalReferenceSchema, externalRequestSchema, externalResultSchema, } from "./external-adapter.js";
|
|
3
|
+
export { actionlintConfigSchema } from "./actionlint.js";
|
|
4
|
+
export { dotnetConfigSchema } from "./dotnet.js";
|
|
5
|
+
export { javaConfigSchema } from "./java.js";
|
|
6
|
+
export { clangDatabaseSchema } from "./clang.js";
|
|
7
|
+
import { PARSERS } from "./types.js";
|
|
8
|
+
export { dependencyGraphSchema, architecturePolicySchema, architectureReportSchema, architectureSummarySchema, } from "./architecture.js";
|
|
9
|
+
export { laravelConfigSchema } from "./laravel.js";
|
|
10
|
+
import { z } from "zod";
|
|
11
|
+
import { runtimeInventorySchema } from "./runtime-inventory.js";
|
|
12
|
+
export { fastapiConfigSchema } from "./fastapi.js";
|
|
13
|
+
export { djangoConfigSchema } from "./django.js";
|
|
14
|
+
export { vueRouterConfigSchema } from "./vue-router.js";
|
|
15
|
+
export { contractBundleSchema, contractReportSchema, contractSummarySchema, } from "./contract-schema.js";
|
|
16
|
+
export { runtimeInventorySchema, runtimeComparisonSchema, runtimeComparisonSummarySchema, } from "./runtime-inventory.js";
|
|
17
|
+
export { configSchema } from "./config.js";
|
|
18
|
+
export { policyPackSchema } from "./policy-pack.js";
|
|
19
|
+
import { workspaceSchema } from "./config.js";
|
|
20
|
+
const count = z.number().int().nonnegative();
|
|
21
|
+
const strings = z.array(z.string());
|
|
22
|
+
const status = z.enum([
|
|
23
|
+
"passed",
|
|
24
|
+
"failed",
|
|
25
|
+
"unavailable",
|
|
26
|
+
"skipped",
|
|
27
|
+
"error",
|
|
28
|
+
"inconclusive",
|
|
29
|
+
]);
|
|
30
|
+
const outcome = z.enum(["passed", "failed", "incomplete"]);
|
|
31
|
+
const kind = z.enum(["format", "analysis", "test", "syntax", "unsupported"]);
|
|
32
|
+
const tests = z.strictObject({
|
|
33
|
+
total: count,
|
|
34
|
+
passed: count,
|
|
35
|
+
failed: count,
|
|
36
|
+
skipped: count,
|
|
37
|
+
});
|
|
38
|
+
const command = z.strictObject({
|
|
39
|
+
temporaryDirectory: z.boolean().optional(),
|
|
40
|
+
executable: z.string(),
|
|
41
|
+
args: strings,
|
|
42
|
+
cwd: z.string(),
|
|
43
|
+
env: z.record(z.string(), z.string()).optional(),
|
|
44
|
+
});
|
|
45
|
+
const toolSpec = z.discriminatedUnion("source", [
|
|
46
|
+
z.strictObject({
|
|
47
|
+
name: z.literal("node"),
|
|
48
|
+
source: z.literal("engine-runtime"),
|
|
49
|
+
}),
|
|
50
|
+
z.strictObject({
|
|
51
|
+
name: z.string(),
|
|
52
|
+
source: z.literal("package-metadata"),
|
|
53
|
+
path: z.string().nullable(),
|
|
54
|
+
}),
|
|
55
|
+
z.strictObject({
|
|
56
|
+
name: z.string(),
|
|
57
|
+
source: z.literal("version-command"),
|
|
58
|
+
command,
|
|
59
|
+
}),
|
|
60
|
+
]);
|
|
61
|
+
const processResult = z.strictObject({
|
|
62
|
+
command,
|
|
63
|
+
exitCode: z.number().int().nullable(),
|
|
64
|
+
signal: z.string().nullable(),
|
|
65
|
+
stdout: z.string(),
|
|
66
|
+
stderr: z.string(),
|
|
67
|
+
durationMs: count,
|
|
68
|
+
timedOut: z.boolean(),
|
|
69
|
+
cancelled: z.boolean(),
|
|
70
|
+
truncated: z.boolean(),
|
|
71
|
+
errorCode: z.string().optional(),
|
|
72
|
+
});
|
|
73
|
+
const selection = z.strictObject({
|
|
74
|
+
mode: z.enum(["full", "affected"]),
|
|
75
|
+
reason: z.string(),
|
|
76
|
+
changedFiles: strings,
|
|
77
|
+
selectedProjects: strings,
|
|
78
|
+
git: z
|
|
79
|
+
.strictObject({
|
|
80
|
+
baseCommit: z.string(),
|
|
81
|
+
headCommit: z.string(),
|
|
82
|
+
version: z.string(),
|
|
83
|
+
worktreeId: z.string(),
|
|
84
|
+
indexFingerprint: z.string(),
|
|
85
|
+
})
|
|
86
|
+
.optional(),
|
|
87
|
+
});
|
|
88
|
+
const selectionSummary = z.strictObject({
|
|
89
|
+
mode: z.enum(["full", "affected"]),
|
|
90
|
+
reason: z.string(),
|
|
91
|
+
projectCount: count,
|
|
92
|
+
changedFileCount: count,
|
|
93
|
+
});
|
|
94
|
+
const metadata = { schemaVersion: z.literal(1), engineVersion: z.string() };
|
|
95
|
+
const reportMetadata = {
|
|
96
|
+
...metadata,
|
|
97
|
+
runId: z.string().uuid(),
|
|
98
|
+
outcome,
|
|
99
|
+
durationMs: count,
|
|
100
|
+
sourceChanged: z.boolean(),
|
|
101
|
+
sourceError: z.boolean(),
|
|
102
|
+
};
|
|
103
|
+
export const reportSchema = z.strictObject({
|
|
104
|
+
...reportMetadata,
|
|
105
|
+
selection: selection.optional(),
|
|
106
|
+
startedAt: z.iso.datetime(),
|
|
107
|
+
sourceFingerprint: z.string(),
|
|
108
|
+
finalSourceFingerprint: z.string().nullable(),
|
|
109
|
+
policyFingerprint: z.string(),
|
|
110
|
+
excluded: strings,
|
|
111
|
+
checks: z.array(z.strictObject({
|
|
112
|
+
external: externalIdentitySchema
|
|
113
|
+
.extend({
|
|
114
|
+
tools: z
|
|
115
|
+
.array(z.strictObject({
|
|
116
|
+
name: z.string(),
|
|
117
|
+
version: z.string(),
|
|
118
|
+
source: z.literal("adapter-reported"),
|
|
119
|
+
}))
|
|
120
|
+
.optional(),
|
|
121
|
+
})
|
|
122
|
+
.optional(),
|
|
123
|
+
id: z.string(),
|
|
124
|
+
adapter: z.string(),
|
|
125
|
+
project: z.string(),
|
|
126
|
+
scope: strings,
|
|
127
|
+
status,
|
|
128
|
+
reason: z.string(),
|
|
129
|
+
processes: z.array(processResult),
|
|
130
|
+
tests: tests.optional(),
|
|
131
|
+
findingsComplete: z.boolean().optional(),
|
|
132
|
+
runtime: runtimeInventorySchema.optional(),
|
|
133
|
+
findings: z
|
|
134
|
+
.array(z.strictObject({
|
|
135
|
+
ruleId: z.string().min(1),
|
|
136
|
+
level: z.enum(["error", "warning", "note"]),
|
|
137
|
+
message: z.string(),
|
|
138
|
+
file: z.string().min(1).optional(),
|
|
139
|
+
line: z.number().int().positive().optional(),
|
|
140
|
+
}))
|
|
141
|
+
.optional(),
|
|
142
|
+
environment: z
|
|
143
|
+
.strictObject({ names: strings, fingerprint: z.string() })
|
|
144
|
+
.optional(),
|
|
145
|
+
tools: z
|
|
146
|
+
.array(z.strictObject({
|
|
147
|
+
name: z.string(),
|
|
148
|
+
source: z.enum([
|
|
149
|
+
"engine-runtime",
|
|
150
|
+
"package-metadata",
|
|
151
|
+
"version-command",
|
|
152
|
+
]),
|
|
153
|
+
version: z.string().nullable(),
|
|
154
|
+
status: z.enum(["identified", "unavailable", "inconclusive"]),
|
|
155
|
+
process: processResult.optional(),
|
|
156
|
+
path: z.string().optional(),
|
|
157
|
+
}))
|
|
158
|
+
.optional(),
|
|
159
|
+
})),
|
|
160
|
+
});
|
|
161
|
+
export const reportSummarySchema = z.strictObject({
|
|
162
|
+
...reportMetadata,
|
|
163
|
+
selection: selectionSummary.optional(),
|
|
164
|
+
checks: z.array(z.strictObject({ id: z.string(), status, tests: tests.optional() })),
|
|
165
|
+
});
|
|
166
|
+
export const planSchema = z.strictObject({
|
|
167
|
+
...metadata,
|
|
168
|
+
selection: selection.optional(),
|
|
169
|
+
workspace: workspaceSchema.optional(),
|
|
170
|
+
sourceFingerprint: z.string(),
|
|
171
|
+
policyFingerprint: z.string(),
|
|
172
|
+
excluded: strings,
|
|
173
|
+
projects: z.array(z.strictObject({
|
|
174
|
+
path: z.string(),
|
|
175
|
+
adapter: z.string(),
|
|
176
|
+
markers: strings,
|
|
177
|
+
files: strings,
|
|
178
|
+
})),
|
|
179
|
+
checks: z.array(z.strictObject({
|
|
180
|
+
external: externalIdentitySchema.optional(),
|
|
181
|
+
id: z.string(),
|
|
182
|
+
adapter: z.string(),
|
|
183
|
+
project: z.string(),
|
|
184
|
+
scope: strings,
|
|
185
|
+
kind,
|
|
186
|
+
parser: z.enum(PARSERS),
|
|
187
|
+
commands: z.array(command),
|
|
188
|
+
reason: z.string(),
|
|
189
|
+
unavailableReason: z.string().optional(),
|
|
190
|
+
tools: z.array(toolSpec).optional(),
|
|
191
|
+
environment: strings.optional(),
|
|
192
|
+
})),
|
|
193
|
+
});
|
|
194
|
+
export const planSummarySchema = z.strictObject({
|
|
195
|
+
...metadata,
|
|
196
|
+
selection: selectionSummary.optional(),
|
|
197
|
+
projectCount: count,
|
|
198
|
+
adapters: strings,
|
|
199
|
+
excludedCount: count,
|
|
200
|
+
checks: z.array(z.strictObject({ id: z.string(), kind, ready: z.boolean() })),
|
|
201
|
+
});
|
|
202
|
+
export const junitImportSchema = z.strictObject({
|
|
203
|
+
...metadata,
|
|
204
|
+
format: z.literal("junit"),
|
|
205
|
+
provenance: z.literal("imported-report"),
|
|
206
|
+
outcome,
|
|
207
|
+
reason: z.string(),
|
|
208
|
+
tests: tests.optional(),
|
|
209
|
+
cases: z
|
|
210
|
+
.array(z.strictObject({
|
|
211
|
+
name: z.string(),
|
|
212
|
+
file: z.string().optional(),
|
|
213
|
+
status: z.enum(["passed", "failed", "skipped"]),
|
|
214
|
+
assertions: count.optional(),
|
|
215
|
+
}))
|
|
216
|
+
.optional(),
|
|
217
|
+
});
|
|
218
|
+
export { findingBaselineSchema, findingComparisonSchema, findingComparisonSummarySchema, } from "./finding-policy-schema.js";
|
|
219
|
+
export { guidanceContextSchema, guidanceReportSchema, guidanceSummarySchema, } from "./guidance.js";
|
|
220
|
+
export { mutationRecipeSchema, mutationReportSchema, mutationSummarySchema, } from "./mutation.js";
|
|
221
|
+
export { nuxtConfigSchema } from "./nuxt.js";
|
|
222
|
+
export { reviewSelectionSchema, reviewContextSchema, reviewContextSummarySchema, reviewAssessmentSchema, reviewReceiptSchema, reviewReceiptSummarySchema, } from "./review.js";
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { goScopeComplete } from "./go-scope.js";
|
|
4
|
+
const diagnostic = z.object({
|
|
5
|
+
code: z.string().min(1),
|
|
6
|
+
severity: z.enum(["error", "warning", "ignored"]),
|
|
7
|
+
message: z.string().min(1),
|
|
8
|
+
location: z.object({
|
|
9
|
+
file: z.string(),
|
|
10
|
+
line: z.number().int().nonnegative(),
|
|
11
|
+
column: z.number().int().nonnegative(),
|
|
12
|
+
}),
|
|
13
|
+
});
|
|
14
|
+
export function staticcheckEvidence(check, processes, root) {
|
|
15
|
+
const incomplete = {
|
|
16
|
+
status: "inconclusive",
|
|
17
|
+
reason: "Staticcheck evidence is malformed, unaccounted source was excluded, or the native run was incomplete.",
|
|
18
|
+
};
|
|
19
|
+
if (!root || processes.length !== 2)
|
|
20
|
+
return incomplete;
|
|
21
|
+
const process = processes[1];
|
|
22
|
+
if (![0, 1].includes(process.exitCode ?? -1))
|
|
23
|
+
return { status: "error", reason: "Staticcheck could not run normally." };
|
|
24
|
+
try {
|
|
25
|
+
const rows = process.stdout
|
|
26
|
+
.split(/\r?\n/)
|
|
27
|
+
.filter(Boolean)
|
|
28
|
+
.map((line) => diagnostic.parse(JSON.parse(line)));
|
|
29
|
+
const expected = new Set(check.scope.map((file) => path.resolve(root, check.project, file)));
|
|
30
|
+
const findings = [];
|
|
31
|
+
let compileError = false;
|
|
32
|
+
for (const row of rows) {
|
|
33
|
+
if (row.code === "compile") {
|
|
34
|
+
compileError = true;
|
|
35
|
+
continue;
|
|
36
|
+
}
|
|
37
|
+
const file = path.resolve(root, check.project, row.location.file);
|
|
38
|
+
if (!expected.has(file) || row.location.line < 1)
|
|
39
|
+
return incomplete;
|
|
40
|
+
findings.push({
|
|
41
|
+
ruleId: row.code,
|
|
42
|
+
level: row.severity === "ignored" ? "note" : row.severity,
|
|
43
|
+
message: row.message,
|
|
44
|
+
file: path.relative(root, file).split(path.sep).join("/"),
|
|
45
|
+
line: row.location.line,
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
if (findings.length || compileError)
|
|
49
|
+
return {
|
|
50
|
+
status: "failed",
|
|
51
|
+
reason: "Staticcheck reported diagnostics, including explicitly surfaced native suppressions.",
|
|
52
|
+
findings,
|
|
53
|
+
findingsComplete: !compileError &&
|
|
54
|
+
process.exitCode === 1 &&
|
|
55
|
+
!process.stderr.trim() &&
|
|
56
|
+
goScopeComplete(check, processes[0], root),
|
|
57
|
+
};
|
|
58
|
+
if (process.exitCode !== 0 || process.stderr.trim())
|
|
59
|
+
return {
|
|
60
|
+
status: "error",
|
|
61
|
+
reason: "Staticcheck reported a loading, configuration or runtime error.",
|
|
62
|
+
};
|
|
63
|
+
if (!goScopeComplete(check, processes[0], root))
|
|
64
|
+
return incomplete;
|
|
65
|
+
return {
|
|
66
|
+
status: "passed",
|
|
67
|
+
reason: "Staticcheck completed all-rule analysis of the inventoried native Go scope.",
|
|
68
|
+
findings,
|
|
69
|
+
findingsComplete: true,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
catch {
|
|
73
|
+
return incomplete;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export function swiftCheck(project) {
|
|
2
|
+
const files = project.files.filter((file) => file.endsWith(".swift"));
|
|
3
|
+
return {
|
|
4
|
+
id: "swift.syntax",
|
|
5
|
+
adapter: project.adapter,
|
|
6
|
+
project: project.path,
|
|
7
|
+
scope: files,
|
|
8
|
+
kind: "syntax",
|
|
9
|
+
parser: "silent-syntax",
|
|
10
|
+
commands: files.map((file) => ({
|
|
11
|
+
executable: "swiftc",
|
|
12
|
+
args: ["-frontend", "-parse", "-no-color-diagnostics", `./${file}`],
|
|
13
|
+
cwd: project.path,
|
|
14
|
+
})),
|
|
15
|
+
reason: "Parse inventoried Swift files directly without evaluating the SwiftPM manifest; this does not type-check, resolve dependencies or run tests.",
|
|
16
|
+
...(!files.length
|
|
17
|
+
? { unavailableReason: "No Swift source was inventoried." }
|
|
18
|
+
: {}),
|
|
19
|
+
};
|
|
20
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { DatabaseSync } from "node:sqlite";
|
|
2
|
+
import type { Report } from "./types.js";
|
|
3
|
+
export interface StoredValidationTask {
|
|
4
|
+
taskId: string;
|
|
5
|
+
status: "working" | "completed" | "cancelled";
|
|
6
|
+
createdAt: string;
|
|
7
|
+
lastUpdatedAt: string;
|
|
8
|
+
ttlMs: number;
|
|
9
|
+
result?: Record<string, unknown>;
|
|
10
|
+
}
|
|
11
|
+
export type TaskTransition = "updated" | "terminal" | "cancellation-requested";
|
|
12
|
+
export interface TaskStoreOptions {
|
|
13
|
+
directory: string;
|
|
14
|
+
root: string;
|
|
15
|
+
detailed?: boolean;
|
|
16
|
+
}
|
|
17
|
+
/** Bounded validation-result persistence; this component does not execute or stop workers. */
|
|
18
|
+
export declare class ValidationTaskStore {
|
|
19
|
+
private readonly database;
|
|
20
|
+
private readonly ownership;
|
|
21
|
+
private readonly detailed;
|
|
22
|
+
private closed;
|
|
23
|
+
constructor(database: DatabaseSync, ownership: DatabaseSync, detailed: boolean);
|
|
24
|
+
private active;
|
|
25
|
+
private prune;
|
|
26
|
+
private row;
|
|
27
|
+
create(sourceFingerprint: string, ttlMs?: number): StoredValidationTask;
|
|
28
|
+
get(taskId: string): StoredValidationTask;
|
|
29
|
+
complete(taskId: string, report: Report): TaskTransition;
|
|
30
|
+
interrupt(taskId: string): TaskTransition;
|
|
31
|
+
requestCancellation(taskId: string): TaskTransition;
|
|
32
|
+
/** Call only after the executor has confirmed its workers have stopped. */
|
|
33
|
+
finishCancellation(taskId: string): TaskTransition;
|
|
34
|
+
close(): void;
|
|
35
|
+
}
|
|
36
|
+
/** Open an exclusively owned, root- and disclosure-bound local validation store. */
|
|
37
|
+
export declare function openTaskStore(options: TaskStoreOptions): Promise<ValidationTaskStore>;
|