@hailstails/hone 0.1.0-pre.7 → 0.1.0-pre.9
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/ADOPTING.md +27 -11
- package/CHANGELOG.md +136 -0
- package/MIGRATING.md +55 -16
- package/README.md +10 -9
- package/api/audit.js +0 -1
- package/api/testing.js +8 -9
- package/chunks/chunk-5X2BR42Y.js +117 -0
- package/chunks/{chunk-NRXSM7BY.js → chunk-LHVFZMXD.js} +10 -7
- package/chunks/{chunk-5LCLBXP7.js → chunk-NILRE23T.js} +1 -1
- package/chunks/{chunk-P3NLETF5.js → chunk-OKQHVZLO.js} +1 -1
- package/chunks/{chunk-POZL7G62.js → chunk-OVEQ37JQ.js} +40 -37
- package/chunks/chunk-RNXPEK2U.js +77 -0
- package/chunks/{chunk-3LCKBX5T.js → chunk-XE6RNNZB.js} +205 -148
- package/chunks/{chunk-WPRR2MPJ.js → chunk-YL6WR3QW.js} +5 -5
- package/core/check/tool-command.js +57 -36
- package/docs/extending.md +2 -0
- package/docs/output-contract.md +4 -4
- package/mechanisms/audit/CD-1/any-cast.js +0 -1
- package/mechanisms/audit/CD-10/throws-in-tests.js +0 -1
- package/mechanisms/audit/CD-14/class-syntax.js +0 -1
- package/mechanisms/audit/CD-15/loops.js +0 -1
- package/mechanisms/audit/CD-17/clock-sources.js +0 -1
- package/mechanisms/audit/CD-19/import-boundaries.js +3 -4
- package/mechanisms/audit/CD-2/cast-expressions.js +0 -1
- package/mechanisms/audit/CD-23/export-test-sibling.js +0 -1
- package/mechanisms/audit/CD-25/dependency-isolation.js +0 -1
- package/mechanisms/audit/CD-26/module-mocking.js +0 -1
- package/mechanisms/audit/CD-27/test-body-logic.js +0 -1
- package/mechanisms/audit/CD-3/compiler-overrides.js +2 -861
- package/mechanisms/audit/CD-43/boolean-signatures.js +0 -1
- package/mechanisms/audit/CD-44/parameter-mutation.js +0 -1
- package/mechanisms/audit/CD-47/hermetic-git-spawns.js +0 -1
- package/mechanisms/audit/CD-5/comments-directives.js +3 -4
- package/mechanisms/audit/CD-6/identifier-names.js +0 -1
- package/mechanisms/audit/CD-7/categorical-paths.js +0 -1
- package/mechanisms/audit/CD-7a/factory-return-types.js +0 -1
- package/mechanisms/audit/CD-8/switch-defaults.js +0 -1
- package/mechanisms/audit/runner/README.md +2 -2
- package/mechanisms/audit/runner/runner.js +31 -27
- package/mechanisms/eslint/CD-1/cd1/cd1.eslint-plugin.js +0 -1
- package/mechanisms/eslint/CD-10/cd10/cd10.eslint-plugin.js +0 -2
- package/mechanisms/eslint/CD-14/cd14/cd14.eslint-plugin.js +0 -1
- package/mechanisms/eslint/CD-2/cd2/cd2.eslint-plugin.js +0 -1
- package/mechanisms/eslint/CD-27/cd27/cd27.eslint-plugin.js +0 -2
- package/mechanisms/eslint/CD-40/cd40/cd40.eslint-plugin.js +0 -1
- package/mechanisms/eslint/CD-41/cd41/cd41.eslint-plugin.js +0 -2
- package/mechanisms/eslint/CD-42/cd42/cd42.eslint-plugin.js +0 -2
- package/mechanisms/eslint/CD-44/cd44/cd44.eslint-plugin.js +0 -1
- package/mechanisms/eslint/CD-6/cd6/cd6.eslint-plugin.js +0 -1
- package/mechanisms/eslint/CD-7/cd7/cd7.eslint-plugin.js +0 -2
- package/mechanisms/eslint/runner/README.md +1 -1
- package/mechanisms/eslint/runner/runner.js +58 -2532
- package/package.json +7 -2
- package/rules/CD-10/CHECKS.md +2 -2
- package/rules/CD-14/CHECKS.md +2 -2
- package/rules/CD-15/CHECKS.md +2 -2
- package/rules/CD-17/CHECKS.md +2 -2
- package/rules/CD-19/CHECKS.md +2 -2
- package/rules/CD-2/CHECKS.md +2 -2
- package/rules/CD-23/CHECKS.md +2 -2
- package/rules/CD-25/CHECKS.md +2 -2
- package/rules/CD-26/CHECKS.md +2 -2
- package/rules/CD-27/CHECKS.md +2 -2
- package/rules/CD-3/CHECKS.md +2 -2
- package/rules/CD-40/CHECKS.md +2 -2
- package/rules/CD-41/CHECKS.md +2 -2
- package/rules/CD-42/CHECKS.md +2 -2
- package/rules/CD-43/CHECKS.md +2 -2
- package/rules/CD-44/CHECKS.md +2 -2
- package/rules/CD-47/CHECKS.md +2 -2
- package/rules/CD-5/CHECKS.md +2 -2
- package/rules/CD-6/CHECKS.md +2 -2
- package/rules/CD-7/CHECKS.md +2 -2
- package/rules/CD-7a/CHECKS.md +2 -2
- package/rules/CD-8/CHECKS.md +2 -2
- package/THIRD-PARTY-NOTICES.md +0 -354
- package/chunks/chunk-MYX7GAVM.js +0 -73
- package/chunks/chunk-NCDYOPHG.js +0 -19832
- package/chunks/chunk-NZLE2WMY.js +0 -35
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
nativeExceptionKindSchema,
|
|
4
4
|
projectionWriteSchema,
|
|
5
5
|
runnerResultSchema
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-RNXPEK2U.js";
|
|
7
7
|
import {
|
|
8
8
|
JSON_KIND_NAMES,
|
|
9
9
|
disciplineFilePath,
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
readPieceFile,
|
|
16
16
|
readVersionOneJson,
|
|
17
17
|
sameJsonValue
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-OVEQ37JQ.js";
|
|
19
19
|
import {
|
|
20
20
|
NOT_INSTALLED,
|
|
21
21
|
brandedRepoPathSchema,
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
repoPathSchema,
|
|
24
24
|
repoPathTextSchema,
|
|
25
25
|
runnerModuleSegmentsOf
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-LHVFZMXD.js";
|
|
27
27
|
import {
|
|
28
28
|
NOT_ADOPTED,
|
|
29
29
|
NOT_RUN,
|
|
@@ -32,11 +32,10 @@ import {
|
|
|
32
32
|
clauseAddressObjectSchema,
|
|
33
33
|
clauseAddressSchema,
|
|
34
34
|
clauseAddressText,
|
|
35
|
-
external_exports,
|
|
36
35
|
mechanismIdSchema,
|
|
37
36
|
ruleSetNameSchema,
|
|
38
37
|
sameClauseAddress
|
|
39
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-5X2BR42Y.js";
|
|
40
39
|
|
|
41
40
|
// core/check/load-failure-text.ts
|
|
42
41
|
var escapedLineBreaks = (request) => request.text.replaceAll("\n", "\\n").replaceAll("\r", "\\r");
|
|
@@ -155,7 +154,8 @@ var installRootOf = (request) => installRootAbove({ ...request, entry: "command"
|
|
|
155
154
|
var installRootOfApiEntry = (request) => installRootAbove({ ...request, entry: "api" });
|
|
156
155
|
|
|
157
156
|
// core/values/assessment.ts
|
|
158
|
-
|
|
157
|
+
import { z } from "zod";
|
|
158
|
+
var forfeitureAssessmentSchema = z.enum(["this-run", "elsewhere"]);
|
|
159
159
|
var ASSESSMENT_CONCERNS = {
|
|
160
160
|
forfeiture: forfeitureAssessmentSchema.default("this-run")
|
|
161
161
|
};
|
|
@@ -171,7 +171,7 @@ var unbuiltKeyMessages = (request) => {
|
|
|
171
171
|
const unbuilt = request.keys.filter((key) => !REMOVED_CONCERNS.has(key));
|
|
172
172
|
return unbuilt.length === 0 ? [] : [`not available in this version: ${quotedKeys({ keys: unbuilt })}; assessment takes ${quotedKeys({ keys: Object.keys(ASSESSMENT_CONCERNS) })} only`];
|
|
173
173
|
};
|
|
174
|
-
var assessmentSchema =
|
|
174
|
+
var assessmentSchema = z.strictObject(ASSESSMENT_CONCERNS, {
|
|
175
175
|
error: (issue) => issue.code === "unrecognized_keys" ? [...removedKeyMessages({ keys: issue.keys }), ...unbuiltKeyMessages({ keys: issue.keys })].join(". ") : void 0
|
|
176
176
|
});
|
|
177
177
|
var DEFAULT_ASSESSMENT = assessmentSchema.parse({});
|
|
@@ -180,15 +180,51 @@ var assessmentInEffect = (request) => ({
|
|
|
180
180
|
});
|
|
181
181
|
|
|
182
182
|
// core/values/report-output.ts
|
|
183
|
-
|
|
183
|
+
import { z as z2 } from "zod";
|
|
184
|
+
var reportOutputSchema = z2.enum(["full", "failures-only", "counts", "verdict-only"]);
|
|
184
185
|
var reportOutputInEffect = (request) => request.requested ?? request.configured;
|
|
185
186
|
|
|
187
|
+
// core/check/package-link.ts
|
|
188
|
+
var UNLINKED = { kind: "unlinked" };
|
|
189
|
+
var INSTALL_FOLDER = "node_modules";
|
|
190
|
+
var PACKAGE_MANIFEST = "package.json";
|
|
191
|
+
var manifestTextAt = (request) => {
|
|
192
|
+
const read = request.fileText.read({ path: request.path.join({ segments: [request.root, PACKAGE_MANIFEST] }) });
|
|
193
|
+
return read.outcome === "ok" ? read.value : void 0;
|
|
194
|
+
};
|
|
195
|
+
var sameFolder = (request) => {
|
|
196
|
+
const location = request.path.relative(request);
|
|
197
|
+
return location.relation === "within-root" && location.path === "" ? "same" : "different";
|
|
198
|
+
};
|
|
199
|
+
var holdsRunningPackage = (request) => {
|
|
200
|
+
const running = manifestTextAt({ ...request, root: request.installRoot });
|
|
201
|
+
return running !== void 0 && running === manifestTextAt({ ...request, root: request.linkRoot }) ? "holds" : "does-not-hold";
|
|
202
|
+
};
|
|
203
|
+
var packageLinkOf = (request) => {
|
|
204
|
+
const linkRoot = request.path.join({ segments: [request.repoRoot, INSTALL_FOLDER, TOOL_IDENTITY.packageName] });
|
|
205
|
+
const linked = { kind: "linked", installRoot: request.installRoot, linkRoot };
|
|
206
|
+
if (sameFolder({ path: request.path, from: linkRoot, to: request.installRoot }) === "same") {
|
|
207
|
+
return linked;
|
|
208
|
+
}
|
|
209
|
+
return holdsRunningPackage({ ...request, linkRoot }) === "holds" ? linked : UNLINKED;
|
|
210
|
+
};
|
|
211
|
+
|
|
186
212
|
// core/check/shown-path.ts
|
|
187
213
|
var NATIVE_SEPARATOR = "\\";
|
|
188
214
|
var SHOWN_SEPARATOR = "/";
|
|
215
|
+
var PARENT_FOLDER = "..";
|
|
216
|
+
var insidePackage = (request) => request.within === PARENT_FOLDER || request.within.startsWith(`${PARENT_FOLDER}${SHOWN_SEPARATOR}`) ? "outside" : "inside";
|
|
217
|
+
var throughLink = (request) => {
|
|
218
|
+
if (request.link.kind === "unlinked") {
|
|
219
|
+
return request.target;
|
|
220
|
+
}
|
|
221
|
+
const location = request.path.relative({ from: request.link.installRoot, to: request.target });
|
|
222
|
+
return location.relation === "within-root" && insidePackage({ within: location.path }) === "inside" ? request.path.join({ segments: [request.link.linkRoot, location.path] }) : request.target;
|
|
223
|
+
};
|
|
189
224
|
var shownPathOf = (request) => {
|
|
190
|
-
const
|
|
191
|
-
|
|
225
|
+
const target = throughLink(request);
|
|
226
|
+
const location = request.repoRoot === void 0 ? void 0 : request.path.relative({ from: request.repoRoot, to: target });
|
|
227
|
+
return location?.relation === "within-root" ? location.path : target.replaceAll(NATIVE_SEPARATOR, SHOWN_SEPARATOR);
|
|
192
228
|
};
|
|
193
229
|
var shownRunnerFailureOf = (request) => {
|
|
194
230
|
const { failure } = request;
|
|
@@ -221,7 +257,8 @@ var shownFailureOf = (request) => {
|
|
|
221
257
|
};
|
|
222
258
|
|
|
223
259
|
// core/consumer-selection/clause-settings.ts
|
|
224
|
-
|
|
260
|
+
import { z as z3 } from "zod";
|
|
261
|
+
var clauseSettingsSchema = z3.record(z3.string(), z3.record(z3.string(), z3.json())).transform(
|
|
225
262
|
(settings, context) => Object.entries(settings).flatMap(([key, values]) => {
|
|
226
263
|
const address = clauseAddressSchema.safeParse(key);
|
|
227
264
|
if (address.success) return [[address.data, values]];
|
|
@@ -264,16 +301,18 @@ var settledClauseSettings = (request) => {
|
|
|
264
301
|
};
|
|
265
302
|
|
|
266
303
|
// core/values/file-exception-why-chains.ts
|
|
267
|
-
|
|
304
|
+
import { z as z4 } from "zod";
|
|
305
|
+
var fileExceptionWhyChainsSchema = z4.enum(["required", "optional"]);
|
|
268
306
|
|
|
269
307
|
// core/consumer-selection/consumer-selection.ts
|
|
308
|
+
import { z as z5 } from "zod";
|
|
270
309
|
var RULE_SET_SUFFIX_SEPARATOR = "-";
|
|
271
310
|
var CLAUSE_ADDRESS_RULE_SET_SEPARATOR = "/";
|
|
272
311
|
var LEADING_CURRENT_DIRECTORY = "./";
|
|
273
|
-
var clauseChoiceSchema =
|
|
312
|
+
var clauseChoiceSchema = z5.union(
|
|
274
313
|
[
|
|
275
|
-
|
|
276
|
-
|
|
314
|
+
z5.literal(NOT_RUN).transform(() => ({ state: "not-run" })),
|
|
315
|
+
z5.literal(NOT_ADOPTED).transform(() => ({ state: "not-adopted" })),
|
|
277
316
|
mechanismIdSchema.transform((mechanism) => ({ state: "run", mechanism }))
|
|
278
317
|
],
|
|
279
318
|
{ error: `a clause takes a mechanism id, "${NOT_RUN}" or "${NOT_ADOPTED}"` }
|
|
@@ -284,17 +323,17 @@ var UNSETTABLE_LISTING_REFUSALS = {
|
|
|
284
323
|
"not-adopted": "clauses does not adopt it, so remove its settings"
|
|
285
324
|
};
|
|
286
325
|
var clauseListingOf = (request) => request.clauses.find(([listed2]) => sameClauseAddress({ left: listed2, right: request.address }) === "same")?.[1].state ?? "unlisted";
|
|
287
|
-
var ruleSetLocationSchema =
|
|
288
|
-
|
|
289
|
-
|
|
326
|
+
var ruleSetLocationSchema = z5.union([
|
|
327
|
+
z5.enum([".", LEADING_CURRENT_DIRECTORY]).transform(() => ({ location: "repo-root" })),
|
|
328
|
+
z5.string().transform(
|
|
290
329
|
(text) => text.startsWith(LEADING_CURRENT_DIRECTORY) ? text.slice(LEADING_CURRENT_DIRECTORY.length) : text
|
|
291
330
|
).pipe(repoPathSchema).transform((path) => ({ location: "folder", path }))
|
|
292
331
|
]);
|
|
293
|
-
var consumerSelectionFileSchema =
|
|
294
|
-
version:
|
|
295
|
-
ruleSets:
|
|
296
|
-
clauses:
|
|
297
|
-
exclude:
|
|
332
|
+
var consumerSelectionFileSchema = z5.strictObject({
|
|
333
|
+
version: z5.literal(1),
|
|
334
|
+
ruleSets: z5.record(ruleSetNameSchema, z5.string()).transform((ruleSets) => Object.entries(ruleSets)).pipe(z5.array(z5.tuple([ruleSetNameSchema, ruleSetLocationSchema]))),
|
|
335
|
+
clauses: z5.record(z5.string(), z5.string()).transform((clauses) => Object.entries(clauses)).pipe(z5.array(z5.tuple([clauseAddressSchema, clauseChoiceSchema]))),
|
|
336
|
+
exclude: z5.array(
|
|
298
337
|
brandedRepoPathSchema({
|
|
299
338
|
text: repoPathTextSchema.refine((excludedPath) => !excludedPath.includes("*"), {
|
|
300
339
|
error: "an exclude entry is a repository path, not a glob"
|
|
@@ -302,7 +341,7 @@ var consumerSelectionFileSchema = external_exports.strictObject({
|
|
|
302
341
|
})
|
|
303
342
|
).default([]),
|
|
304
343
|
eslintConfigLookup: eslintConfigLookupSchema.optional(),
|
|
305
|
-
eslintConfigRoots:
|
|
344
|
+
eslintConfigRoots: z5.array(
|
|
306
345
|
brandedRepoPathSchema({
|
|
307
346
|
text: repoPathTextSchema.refine((rootPath) => !rootPath.includes("*"), {
|
|
308
347
|
error: "an eslintConfigRoots entry is a repository folder, not a glob"
|
|
@@ -547,7 +586,7 @@ var parsedSelectionFile = (request) => {
|
|
|
547
586
|
}
|
|
548
587
|
const parsed = consumerSelectionFileSchema.safeParse(document.value);
|
|
549
588
|
if (!parsed.success) {
|
|
550
|
-
return failed({ kind: "file-malformed", path: request.path, detail:
|
|
589
|
+
return failed({ kind: "file-malformed", path: request.path, detail: z5.prettifyError(parsed.error) });
|
|
551
590
|
}
|
|
552
591
|
const refusal2 = selectionFileRefusalOf({ file: parsed.data });
|
|
553
592
|
return refusal2 === void 0 ? { outcome: "ok", value: parsed.data } : failed(refusal2);
|
|
@@ -648,6 +687,15 @@ var readSelection = (request) => {
|
|
|
648
687
|
return { outcome: "ok", value: selectionReadingOf({ resolved: settled.value, unrun: unrun.value, file: file.value }) };
|
|
649
688
|
};
|
|
650
689
|
|
|
690
|
+
// core/check/run-check.ts
|
|
691
|
+
import { z as z12 } from "zod";
|
|
692
|
+
|
|
693
|
+
// core/exception-records/exception-records.ts
|
|
694
|
+
import { z as z7 } from "zod";
|
|
695
|
+
|
|
696
|
+
// core/values/why-chain.ts
|
|
697
|
+
import { z as z6 } from "zod";
|
|
698
|
+
|
|
651
699
|
// core/values/chain-stems.ts
|
|
652
700
|
var FUNCTION_WORDS = /* @__PURE__ */ new Set([
|
|
653
701
|
"about",
|
|
@@ -918,7 +966,7 @@ var THEREFORE = /\btherefore\b/i;
|
|
|
918
966
|
var rootCauseReading = (request) => RESTATEMENT_OPENING.test(request.rootCause.trim()) ? "restates-the-exception" : "names-a-cause";
|
|
919
967
|
var answerSubstance = (request) => request.answer.trim().length >= MINIMUM_ANSWER_CHARACTERS && !ONE_REPEATED_CHARACTER.test(request.answer.trim()) ? "substantive" : "placeholder";
|
|
920
968
|
var evidenceReading = (request) => CHECKABLE_LOCATORS.some((locator) => locator.test(request.evidence.replace(PROSE_LOOKALIKES, " "))) ? "checkable" : "unlocated";
|
|
921
|
-
var substantiveTextSchema = (request) =>
|
|
969
|
+
var substantiveTextSchema = (request) => z6.string({ error: request.refusal }).refine((answer) => answerSubstance({ answer }) === "substantive", {
|
|
922
970
|
error: request.refusal
|
|
923
971
|
});
|
|
924
972
|
var checkableTextSchema = (request) => substantiveTextSchema({ refusal: request.missing }).refine((evidence) => evidenceReading({ evidence }) === "checkable", {
|
|
@@ -933,10 +981,10 @@ var ROOT_CHECK_REQUIRED = "`whyChain.rootCheck` is required beside `readback` in
|
|
|
933
981
|
var ROOT_CHECK_UNLOCATED = "`whyChain.rootCheck` cites nothing checkable: name the path, record, measurement or link you checked today";
|
|
934
982
|
var READBACK_REQUIRED = '`whyChain.readback` is required beside `rootCheck` in a causal chain: read from the root back to the symptom with "therefore"';
|
|
935
983
|
var OWNER_REQUIRED = "`whyChain.owner` is required: a record dir, a capture id, or the holder of the reserved authority";
|
|
936
|
-
var whyQuestionSchema =
|
|
984
|
+
var whyQuestionSchema = z6.string({ error: WHY_QUESTION_MISSING }).refine((question) => question.trim().length > 0, {
|
|
937
985
|
error: WHY_QUESTION_MISSING
|
|
938
986
|
});
|
|
939
|
-
var legacyWhySchema =
|
|
987
|
+
var legacyWhySchema = z6.object(
|
|
940
988
|
{
|
|
941
989
|
why: whyQuestionSchema,
|
|
942
990
|
because: substantiveTextSchema({ refusal: BECAUSE_MISSING }),
|
|
@@ -944,7 +992,7 @@ var legacyWhySchema = external_exports.object(
|
|
|
944
992
|
},
|
|
945
993
|
{ error: "is not a JSON object" }
|
|
946
994
|
);
|
|
947
|
-
var causalWhySchema =
|
|
995
|
+
var causalWhySchema = z6.object(
|
|
948
996
|
{
|
|
949
997
|
why: whyQuestionSchema,
|
|
950
998
|
because: substantiveTextSchema({ refusal: BECAUSE_MISSING }),
|
|
@@ -952,19 +1000,19 @@ var causalWhySchema = external_exports.object(
|
|
|
952
1000
|
},
|
|
953
1001
|
{ error: "is not a JSON object" }
|
|
954
1002
|
);
|
|
955
|
-
var fiveWhysSchema = (request) =>
|
|
1003
|
+
var fiveWhysSchema = (request) => z6.tuple([request.why, request.why, request.why, request.why, request.why], {
|
|
956
1004
|
error: "`whyChain.whys` must hold exactly 5 whys"
|
|
957
1005
|
});
|
|
958
|
-
var rootCauseSchema =
|
|
1006
|
+
var rootCauseSchema = z6.string({ error: ROOT_CAUSE_REQUIRED }).refine((answer) => answerSubstance({ answer }) === "substantive", {
|
|
959
1007
|
error: ROOT_CAUSE_REQUIRED,
|
|
960
1008
|
abort: true
|
|
961
1009
|
}).refine((rootCause) => rootCauseReading({ rootCause }) === "names-a-cause", {
|
|
962
1010
|
error: "`whyChain.rootCause` restates the exception rather than naming its cause"
|
|
963
1011
|
});
|
|
964
|
-
var ownerSchema =
|
|
1012
|
+
var ownerSchema = z6.string({ error: OWNER_REQUIRED }).refine((owner) => owner.trim().length >= MINIMUM_OWNER_CHARACTERS, {
|
|
965
1013
|
error: OWNER_REQUIRED
|
|
966
1014
|
});
|
|
967
|
-
var legacyWhyChainSchema =
|
|
1015
|
+
var legacyWhyChainSchema = z6.object(
|
|
968
1016
|
{
|
|
969
1017
|
whys: fiveWhysSchema({ why: legacyWhySchema }),
|
|
970
1018
|
rootCause: rootCauseSchema,
|
|
@@ -1021,7 +1069,7 @@ var causalProblemsOf = (request) => {
|
|
|
1021
1069
|
...readbackProblems({ readback, rootCause, symptom })
|
|
1022
1070
|
];
|
|
1023
1071
|
};
|
|
1024
|
-
var whyChainSchema =
|
|
1072
|
+
var whyChainSchema = z6.object(
|
|
1025
1073
|
{
|
|
1026
1074
|
whys: fiveWhysSchema({ why: causalWhySchema }),
|
|
1027
1075
|
rootCause: rootCauseSchema,
|
|
@@ -1038,31 +1086,31 @@ var whyChainSchema = external_exports.object(
|
|
|
1038
1086
|
var whyChainFormOf = (request) => typeof request.chain === "object" && request.chain !== null && !Array.isArray(request.chain) && !("rootCheck" in request.chain) && !("readback" in request.chain) ? "legacy" : "causal";
|
|
1039
1087
|
|
|
1040
1088
|
// core/exception-records/exception-records.ts
|
|
1041
|
-
var exceptionsFileSchema =
|
|
1042
|
-
version:
|
|
1043
|
-
exceptions:
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
kind:
|
|
1047
|
-
clause:
|
|
1048
|
-
file:
|
|
1049
|
-
reason:
|
|
1050
|
-
whyChain:
|
|
1051
|
-
provenance:
|
|
1089
|
+
var exceptionsFileSchema = z7.object({
|
|
1090
|
+
version: z7.literal(1),
|
|
1091
|
+
exceptions: z7.array(
|
|
1092
|
+
z7.discriminatedUnion("kind", [
|
|
1093
|
+
z7.strictObject({
|
|
1094
|
+
kind: z7.literal("authorised-location"),
|
|
1095
|
+
clause: z7.string(),
|
|
1096
|
+
file: z7.string(),
|
|
1097
|
+
reason: z7.string(),
|
|
1098
|
+
whyChain: z7.unknown().optional(),
|
|
1099
|
+
provenance: z7.unknown().optional()
|
|
1052
1100
|
}),
|
|
1053
|
-
|
|
1054
|
-
kind:
|
|
1055
|
-
clause:
|
|
1056
|
-
file:
|
|
1057
|
-
reason:
|
|
1058
|
-
whyChain:
|
|
1059
|
-
provenance:
|
|
1101
|
+
z7.strictObject({
|
|
1102
|
+
kind: z7.literal("file-carve-out"),
|
|
1103
|
+
clause: z7.string(),
|
|
1104
|
+
file: z7.string(),
|
|
1105
|
+
reason: z7.string(),
|
|
1106
|
+
whyChain: z7.unknown().optional(),
|
|
1107
|
+
provenance: z7.unknown().optional()
|
|
1060
1108
|
}),
|
|
1061
|
-
|
|
1062
|
-
kind:
|
|
1063
|
-
clause:
|
|
1064
|
-
reason:
|
|
1065
|
-
whyChain:
|
|
1109
|
+
z7.strictObject({
|
|
1110
|
+
kind: z7.literal("clause-wide-carve-out"),
|
|
1111
|
+
clause: z7.string(),
|
|
1112
|
+
reason: z7.string(),
|
|
1113
|
+
whyChain: z7.unknown()
|
|
1066
1114
|
})
|
|
1067
1115
|
])
|
|
1068
1116
|
)
|
|
@@ -1073,51 +1121,51 @@ var LEGACY_DIRECTORY_OF = {
|
|
|
1073
1121
|
"existing-authorisation": ".constitution-authorised-locations"
|
|
1074
1122
|
};
|
|
1075
1123
|
var LEGACY_SOURCE = /^(?<directory>[^/#]+)\/(?<stem>cd-[0-9a-z]+)\.json#(?<index>\d+)$/;
|
|
1076
|
-
var legacySourceGroupsSchema =
|
|
1077
|
-
directory:
|
|
1078
|
-
stem:
|
|
1079
|
-
index:
|
|
1124
|
+
var legacySourceGroupsSchema = z7.object({
|
|
1125
|
+
directory: z7.enum([LEGACY_DIRECTORY_OF["inherited-debt"], LEGACY_DIRECTORY_OF["existing-authorisation"]]),
|
|
1126
|
+
stem: z7.string(),
|
|
1127
|
+
index: z7.coerce.number().int().nonnegative()
|
|
1080
1128
|
});
|
|
1081
|
-
var legacyRecordsSchema =
|
|
1082
|
-
var recordedTextSchema =
|
|
1083
|
-
var existingAuthorisationProvenanceSchema =
|
|
1084
|
-
kind:
|
|
1129
|
+
var legacyRecordsSchema = z7.array(z7.looseObject({ files: z7.array(z7.string()) }));
|
|
1130
|
+
var recordedTextSchema = z7.string().refine((text) => text.trim().length > 0, { error: "must not be blank" });
|
|
1131
|
+
var existingAuthorisationProvenanceSchema = z7.strictObject({
|
|
1132
|
+
kind: z7.literal("existing-authorisation"),
|
|
1085
1133
|
source: recordedTextSchema,
|
|
1086
1134
|
decision: recordedTextSchema.optional()
|
|
1087
1135
|
});
|
|
1088
|
-
var inheritedDebtProvenanceSchema =
|
|
1089
|
-
kind:
|
|
1136
|
+
var inheritedDebtProvenanceSchema = z7.strictObject({
|
|
1137
|
+
kind: z7.literal("inherited-debt"),
|
|
1090
1138
|
source: recordedTextSchema,
|
|
1091
1139
|
decision: recordedTextSchema
|
|
1092
1140
|
});
|
|
1093
1141
|
var authorisedLocationFields = {
|
|
1094
|
-
kind:
|
|
1095
|
-
clause:
|
|
1096
|
-
file:
|
|
1097
|
-
reason:
|
|
1098
|
-
};
|
|
1099
|
-
var unjudgedWhyChainSchema =
|
|
1100
|
-
var reasonOnlyFields = { reason: recordedTextSchema, whyChain:
|
|
1101
|
-
var chainedAuthorisedLocationSchema =
|
|
1102
|
-
var importedAuthorisedLocationSchema =
|
|
1103
|
-
var reasonedAuthorisedLocationSchema =
|
|
1142
|
+
kind: z7.literal("authorised-location"),
|
|
1143
|
+
clause: z7.string(),
|
|
1144
|
+
file: z7.string(),
|
|
1145
|
+
reason: z7.string()
|
|
1146
|
+
};
|
|
1147
|
+
var unjudgedWhyChainSchema = z7.custom((whyChain) => whyChain !== void 0);
|
|
1148
|
+
var reasonOnlyFields = { reason: recordedTextSchema, whyChain: z7.never().optional(), provenance: z7.never().optional() };
|
|
1149
|
+
var chainedAuthorisedLocationSchema = z7.strictObject({ ...authorisedLocationFields, whyChain: unjudgedWhyChainSchema, provenance: existingAuthorisationProvenanceSchema.optional() });
|
|
1150
|
+
var importedAuthorisedLocationSchema = z7.strictObject({ ...authorisedLocationFields, whyChain: z7.never().optional(), provenance: existingAuthorisationProvenanceSchema });
|
|
1151
|
+
var reasonedAuthorisedLocationSchema = z7.strictObject({ ...authorisedLocationFields, ...reasonOnlyFields });
|
|
1104
1152
|
var fileCarveOutFields = {
|
|
1105
|
-
kind:
|
|
1106
|
-
clause:
|
|
1107
|
-
file:
|
|
1108
|
-
reason:
|
|
1109
|
-
};
|
|
1110
|
-
var chainedFileCarveOutSchema =
|
|
1111
|
-
var importedFileCarveOutSchema =
|
|
1112
|
-
var reasonedFileCarveOutSchema =
|
|
1153
|
+
kind: z7.literal("file-carve-out"),
|
|
1154
|
+
clause: z7.string(),
|
|
1155
|
+
file: z7.string(),
|
|
1156
|
+
reason: z7.string()
|
|
1157
|
+
};
|
|
1158
|
+
var chainedFileCarveOutSchema = z7.strictObject({ ...fileCarveOutFields, whyChain: unjudgedWhyChainSchema, provenance: inheritedDebtProvenanceSchema.optional() });
|
|
1159
|
+
var importedFileCarveOutSchema = z7.strictObject({ ...fileCarveOutFields, whyChain: z7.never().optional(), provenance: inheritedDebtProvenanceSchema });
|
|
1160
|
+
var reasonedFileCarveOutSchema = z7.strictObject({ ...fileCarveOutFields, ...reasonOnlyFields });
|
|
1113
1161
|
var FILE_EVIDENCE_SCHEMAS_OF = {
|
|
1114
1162
|
required: {
|
|
1115
|
-
"authorised-location":
|
|
1116
|
-
"file-carve-out":
|
|
1163
|
+
"authorised-location": z7.union([chainedAuthorisedLocationSchema, importedAuthorisedLocationSchema]),
|
|
1164
|
+
"file-carve-out": z7.union([chainedFileCarveOutSchema, importedFileCarveOutSchema])
|
|
1117
1165
|
},
|
|
1118
1166
|
optional: {
|
|
1119
|
-
"authorised-location":
|
|
1120
|
-
"file-carve-out":
|
|
1167
|
+
"authorised-location": z7.union([chainedAuthorisedLocationSchema, importedAuthorisedLocationSchema, reasonedAuthorisedLocationSchema]),
|
|
1168
|
+
"file-carve-out": z7.union([chainedFileCarveOutSchema, importedFileCarveOutSchema, reasonedFileCarveOutSchema])
|
|
1121
1169
|
}
|
|
1122
1170
|
};
|
|
1123
1171
|
var legacySourceOf = (request) => {
|
|
@@ -1177,11 +1225,11 @@ var chainRefused = (request) => ({
|
|
|
1177
1225
|
});
|
|
1178
1226
|
var causalChainOf = (request) => {
|
|
1179
1227
|
const parsed = whyChainSchema.safeParse(request.whyChain);
|
|
1180
|
-
return parsed.success ? { outcome: "ok", value: parsed.data } : chainRefused({ detail: [...request.preface,
|
|
1228
|
+
return parsed.success ? { outcome: "ok", value: parsed.data } : chainRefused({ detail: [...request.preface, z7.prettifyError(parsed.error)].join("\n") });
|
|
1181
1229
|
};
|
|
1182
1230
|
var legacyChainOf = (request) => {
|
|
1183
1231
|
const parsed = legacyWhyChainSchema.safeParse(request.whyChain);
|
|
1184
|
-
return parsed.success ? { outcome: "ok", value: parsed.data } : chainRefused({ detail:
|
|
1232
|
+
return parsed.success ? { outcome: "ok", value: parsed.data } : chainRefused({ detail: z7.prettifyError(parsed.error) });
|
|
1185
1233
|
};
|
|
1186
1234
|
var judgedWhyChain = (request) => {
|
|
1187
1235
|
if (whyChainFormOf({ chain: request.whyChain }) === "causal") {
|
|
@@ -1206,7 +1254,7 @@ var selectedClauseOf = (request) => {
|
|
|
1206
1254
|
if (!address.success) {
|
|
1207
1255
|
return {
|
|
1208
1256
|
outcome: "failed",
|
|
1209
|
-
error: { kind: "clause-unparseable", detail:
|
|
1257
|
+
error: { kind: "clause-unparseable", detail: z7.prettifyError(address.error) }
|
|
1210
1258
|
};
|
|
1211
1259
|
}
|
|
1212
1260
|
const clause = address.data;
|
|
@@ -1253,7 +1301,7 @@ var parsedRecord = (request) => {
|
|
|
1253
1301
|
return file;
|
|
1254
1302
|
}
|
|
1255
1303
|
const evidence = request.fileEvidence["authorised-location"].safeParse(entry);
|
|
1256
|
-
return evidence.success ? fileRecordOf({ evidence: evidence.data, entry, clause, mechanism, file: file.value, baseline: request.baseline }) : { outcome: "failed", error: { kind: "evidence-refused", detail:
|
|
1304
|
+
return evidence.success ? fileRecordOf({ evidence: evidence.data, entry, clause, mechanism, file: file.value, baseline: request.baseline }) : { outcome: "failed", error: { kind: "evidence-refused", detail: z7.prettifyError(evidence.error) } };
|
|
1257
1305
|
}
|
|
1258
1306
|
case "file-carve-out": {
|
|
1259
1307
|
const file = recordedFile({ file: entry.file });
|
|
@@ -1261,7 +1309,7 @@ var parsedRecord = (request) => {
|
|
|
1261
1309
|
return file;
|
|
1262
1310
|
}
|
|
1263
1311
|
const evidence = request.fileEvidence["file-carve-out"].safeParse(entry);
|
|
1264
|
-
return evidence.success ? fileRecordOf({ evidence: evidence.data, entry, clause, mechanism, file: file.value, baseline: request.baseline }) : { outcome: "failed", error: { kind: "evidence-refused", detail:
|
|
1312
|
+
return evidence.success ? fileRecordOf({ evidence: evidence.data, entry, clause, mechanism, file: file.value, baseline: request.baseline }) : { outcome: "failed", error: { kind: "evidence-refused", detail: z7.prettifyError(evidence.error) } };
|
|
1265
1313
|
}
|
|
1266
1314
|
case "clause-wide-carve-out": {
|
|
1267
1315
|
const whyChain = judgedWhyChain({ whyChain: entry.whyChain, entry, baseline: request.baseline });
|
|
@@ -1331,7 +1379,7 @@ var readExceptionEntries = (request) => {
|
|
|
1331
1379
|
if (!parsed.success) {
|
|
1332
1380
|
return {
|
|
1333
1381
|
outcome: "failed",
|
|
1334
|
-
error: { kind: "file-malformed", path, detail:
|
|
1382
|
+
error: { kind: "file-malformed", path, detail: z7.prettifyError(parsed.error) }
|
|
1335
1383
|
};
|
|
1336
1384
|
}
|
|
1337
1385
|
return { outcome: "ok", value: parsed.data.exceptions };
|
|
@@ -1490,23 +1538,24 @@ var applyGovernance = (request) => {
|
|
|
1490
1538
|
};
|
|
1491
1539
|
|
|
1492
1540
|
// core/mechanism-port/runner-module-schema.ts
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1541
|
+
import { z as z8 } from "zod";
|
|
1542
|
+
var runnerCallSchema = z8.function({
|
|
1543
|
+
input: [z8.unknown()],
|
|
1544
|
+
output: z8.promise(z8.unknown())
|
|
1496
1545
|
});
|
|
1497
|
-
var standaloneRunnerModuleSchema =
|
|
1498
|
-
exceptionPath:
|
|
1546
|
+
var standaloneRunnerModuleSchema = z8.object({
|
|
1547
|
+
exceptionPath: z8.literal("standalone"),
|
|
1499
1548
|
run: runnerCallSchema,
|
|
1500
1549
|
conform: runnerCallSchema
|
|
1501
1550
|
});
|
|
1502
|
-
var embeddedRunnerModuleSchema =
|
|
1503
|
-
exceptionPath:
|
|
1504
|
-
projectedKinds:
|
|
1551
|
+
var embeddedRunnerModuleSchema = z8.object({
|
|
1552
|
+
exceptionPath: z8.literal("embedded"),
|
|
1553
|
+
projectedKinds: z8.array(nativeExceptionKindSchema),
|
|
1505
1554
|
run: runnerCallSchema,
|
|
1506
1555
|
conform: runnerCallSchema,
|
|
1507
1556
|
project: runnerCallSchema
|
|
1508
1557
|
});
|
|
1509
|
-
var runnerModuleSchema =
|
|
1558
|
+
var runnerModuleSchema = z8.discriminatedUnion("exceptionPath", [
|
|
1510
1559
|
standaloneRunnerModuleSchema,
|
|
1511
1560
|
embeddedRunnerModuleSchema
|
|
1512
1561
|
]);
|
|
@@ -1571,7 +1620,7 @@ var assessmentSectionOf = (request) => {
|
|
|
1571
1620
|
}
|
|
1572
1621
|
return request.headings.headings.has(assessmentSectionHeading(request)) ? "present" : "not-assessed";
|
|
1573
1622
|
};
|
|
1574
|
-
var shownPageOf = (request) => shownPathOf({ path: request.path, repoRoot: request.repoRoot, target: request.page });
|
|
1623
|
+
var shownPageOf = (request) => shownPathOf({ path: request.path, repoRoot: request.repoRoot, link: request.link, target: request.page });
|
|
1575
1624
|
var clauseReadingOf = (request) => ({
|
|
1576
1625
|
kind: "clause",
|
|
1577
1626
|
clause: request.clause,
|
|
@@ -1592,68 +1641,73 @@ var clauseReadingsOf = (request) => {
|
|
|
1592
1641
|
return [];
|
|
1593
1642
|
}
|
|
1594
1643
|
const headings = assessmentHeadingsOf(request);
|
|
1644
|
+
const link = packageLinkOf(request);
|
|
1595
1645
|
return [
|
|
1596
|
-
...assessmentFileNotes({ ...request, headings }),
|
|
1646
|
+
...assessmentFileNotes({ ...request, headings, link }),
|
|
1597
1647
|
...clauses.flatMap(
|
|
1598
|
-
(clause) => request.clauseRoots.filter((root) => clauseAddressText({ address: root.clause }) === clauseAddressText({ address: clause })).map((root) => clauseReadingOf({ ...request, headings, clause, page: rulePageOf({ root, path: request.path }) }))
|
|
1648
|
+
(clause) => request.clauseRoots.filter((root) => clauseAddressText({ address: root.clause }) === clauseAddressText({ address: clause })).map((root) => clauseReadingOf({ ...request, headings, link, clause, page: rulePageOf({ root, path: request.path }) }))
|
|
1599
1649
|
)
|
|
1600
1650
|
];
|
|
1601
1651
|
};
|
|
1602
1652
|
|
|
1653
|
+
// core/check/mechanism-dispatch.ts
|
|
1654
|
+
import { z as z11 } from "zod";
|
|
1655
|
+
|
|
1603
1656
|
// core/mechanism-port/embedded-run-report-schema.ts
|
|
1604
|
-
|
|
1605
|
-
var
|
|
1606
|
-
|
|
1657
|
+
import { z as z9 } from "zod";
|
|
1658
|
+
var inlineLineSchema = z9.number().int().min(1);
|
|
1659
|
+
var inlineDisableSchema = z9.object({
|
|
1660
|
+
kind: z9.literal("inline-disable"),
|
|
1607
1661
|
clause: clauseAddressObjectSchema,
|
|
1608
1662
|
file: repoPathSchema,
|
|
1609
1663
|
line: inlineLineSchema,
|
|
1610
|
-
text:
|
|
1611
|
-
reach:
|
|
1664
|
+
text: z9.string(),
|
|
1665
|
+
reach: z9.enum(["one-clause", "every-selected-clause"])
|
|
1612
1666
|
}).readonly();
|
|
1613
|
-
var scriptOptionCauseSchema =
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1667
|
+
var scriptOptionCauseSchema = z9.discriminatedUnion("kind", [
|
|
1668
|
+
z9.object({ kind: z9.literal("weakens-run") }).readonly(),
|
|
1669
|
+
z9.object({ kind: z9.literal("after-another-command"), command: z9.string(), invocation: z9.string() }).readonly(),
|
|
1670
|
+
z9.object({ kind: z9.literal("wrapped"), command: z9.string(), wrapper: z9.string() }).readonly()
|
|
1617
1671
|
]);
|
|
1618
|
-
var nativeExceptionSchema =
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
kind:
|
|
1672
|
+
var nativeExceptionSchema = z9.discriminatedUnion("kind", [
|
|
1673
|
+
z9.object({ kind: z9.literal("ignore"), clause: clauseAddressObjectSchema, file: repoPathSchema }).readonly(),
|
|
1674
|
+
z9.object({
|
|
1675
|
+
kind: z9.literal("config-override"),
|
|
1622
1676
|
clause: clauseAddressObjectSchema,
|
|
1623
1677
|
file: repoPathSchema
|
|
1624
1678
|
}).readonly(),
|
|
1625
|
-
|
|
1626
|
-
kind:
|
|
1679
|
+
z9.object({
|
|
1680
|
+
kind: z9.literal("suppression-entry"),
|
|
1627
1681
|
clause: clauseAddressObjectSchema,
|
|
1628
1682
|
file: repoPathSchema,
|
|
1629
1683
|
location: repoPathSchema
|
|
1630
1684
|
}).readonly(),
|
|
1631
1685
|
inlineDisableSchema,
|
|
1632
|
-
|
|
1633
|
-
kind:
|
|
1686
|
+
z9.object({
|
|
1687
|
+
kind: z9.literal("inline-rule-config"),
|
|
1634
1688
|
clause: clauseAddressObjectSchema,
|
|
1635
1689
|
file: repoPathSchema,
|
|
1636
1690
|
line: inlineLineSchema,
|
|
1637
|
-
text:
|
|
1691
|
+
text: z9.string()
|
|
1638
1692
|
}).readonly(),
|
|
1639
|
-
|
|
1640
|
-
kind:
|
|
1693
|
+
z9.object({
|
|
1694
|
+
kind: z9.literal("command-line-option"),
|
|
1641
1695
|
clause: clauseAddressObjectSchema,
|
|
1642
1696
|
location: repoPathSchema,
|
|
1643
|
-
script:
|
|
1644
|
-
option:
|
|
1697
|
+
script: z9.string(),
|
|
1698
|
+
option: z9.string(),
|
|
1645
1699
|
cause: scriptOptionCauseSchema
|
|
1646
1700
|
}).readonly()
|
|
1647
1701
|
]);
|
|
1648
|
-
var sliceProblemSchema =
|
|
1702
|
+
var sliceProblemSchema = z9.object({
|
|
1649
1703
|
slice: repoPathSchema,
|
|
1650
|
-
state:
|
|
1704
|
+
state: z9.enum(["out-of-date", "missing", "not-applied", "unconfigured", "nested-configuration"])
|
|
1651
1705
|
}).readonly();
|
|
1652
|
-
var embeddedRunReportSchema =
|
|
1653
|
-
hits:
|
|
1654
|
-
nativeExceptions:
|
|
1655
|
-
projection:
|
|
1656
|
-
slices:
|
|
1706
|
+
var embeddedRunReportSchema = z9.object({
|
|
1707
|
+
hits: z9.array(hitSchema).readonly(),
|
|
1708
|
+
nativeExceptions: z9.array(nativeExceptionSchema).readonly(),
|
|
1709
|
+
projection: z9.enum(["current", "out-of-date", "missing", "not-included"]),
|
|
1710
|
+
slices: z9.array(sliceProblemSchema).readonly().default([])
|
|
1657
1711
|
}).readonly();
|
|
1658
1712
|
|
|
1659
1713
|
// core/mechanism-port/runner-failure.ts
|
|
@@ -1665,11 +1719,12 @@ var thrownMessage = (request) => request.thrown instanceof Error ? request.throw
|
|
|
1665
1719
|
var rejectedCall = (request) => runnerInvalidOutput({ detail: `the runner call threw or rejected: ${thrownMessage(request)}` });
|
|
1666
1720
|
|
|
1667
1721
|
// core/mechanism-port/standalone-run-report-schema.ts
|
|
1722
|
+
import { z as z10 } from "zod";
|
|
1668
1723
|
var STANDALONE_RUN_SHAPE_MESSAGE = "a standalone run's value is { hits, nativeExceptions }, not a bare list of hits";
|
|
1669
|
-
var standaloneRunReportSchema =
|
|
1724
|
+
var standaloneRunReportSchema = z10.object(
|
|
1670
1725
|
{
|
|
1671
|
-
hits:
|
|
1672
|
-
nativeExceptions:
|
|
1726
|
+
hits: z10.array(hitSchema).readonly(),
|
|
1727
|
+
nativeExceptions: z10.array(inlineDisableSchema).readonly()
|
|
1673
1728
|
},
|
|
1674
1729
|
{ error: STANDALONE_RUN_SHAPE_MESSAGE }
|
|
1675
1730
|
).readonly();
|
|
@@ -1682,14 +1737,14 @@ var unrequestedHit = (request) => request.hits.find(
|
|
|
1682
1737
|
(clause) => sameClauseAddress({ left: clause.address, right: hit.clause }) === "same"
|
|
1683
1738
|
)
|
|
1684
1739
|
);
|
|
1685
|
-
var okOutcomeSchema =
|
|
1686
|
-
var okStandaloneSchema =
|
|
1740
|
+
var okOutcomeSchema = z11.object({ outcome: z11.literal("ok") });
|
|
1741
|
+
var okStandaloneSchema = z11.object({ outcome: z11.literal("ok"), value: standaloneRunReportSchema });
|
|
1687
1742
|
var invalidStandaloneDetail = (request) => {
|
|
1688
1743
|
if (!okOutcomeSchema.safeParse(request.returned).success) {
|
|
1689
|
-
return
|
|
1744
|
+
return z11.prettifyError(request.error);
|
|
1690
1745
|
}
|
|
1691
1746
|
const report = okStandaloneSchema.safeParse(request.returned);
|
|
1692
|
-
return
|
|
1747
|
+
return z11.prettifyError(report.success ? request.error : report.error);
|
|
1693
1748
|
};
|
|
1694
1749
|
var standaloneRun = (request) => {
|
|
1695
1750
|
const parsed = standaloneResultSchema.safeParse(request.returned);
|
|
@@ -1725,7 +1780,7 @@ var standaloneRun = (request) => {
|
|
|
1725
1780
|
};
|
|
1726
1781
|
};
|
|
1727
1782
|
var reportResultSchema = runnerResultSchema({ value: embeddedRunReportSchema });
|
|
1728
|
-
var projectionWriteResultSchema = runnerResultSchema({ value:
|
|
1783
|
+
var projectionWriteResultSchema = runnerResultSchema({ value: z11.array(projectionWriteSchema).readonly() });
|
|
1729
1784
|
var unrequestedNativeException = (request) => request.nativeExceptions.find(
|
|
1730
1785
|
(nativeException) => !request.run.clauses.some(
|
|
1731
1786
|
(clause) => sameClauseAddress({ left: clause.address, right: nativeException.clause }) === "same"
|
|
@@ -1734,7 +1789,7 @@ var unrequestedNativeException = (request) => request.nativeExceptions.find(
|
|
|
1734
1789
|
var embeddedRun = (request) => {
|
|
1735
1790
|
const parsed = reportResultSchema.safeParse(request.returned);
|
|
1736
1791
|
if (!parsed.success) {
|
|
1737
|
-
return runnerInvalidOutput({ detail:
|
|
1792
|
+
return runnerInvalidOutput({ detail: z11.prettifyError(parsed.error) });
|
|
1738
1793
|
}
|
|
1739
1794
|
if (parsed.data.outcome === "failed") {
|
|
1740
1795
|
return parsed.data;
|
|
@@ -1770,7 +1825,7 @@ var embeddedRun = (request) => {
|
|
|
1770
1825
|
var embeddedProjection = (request) => {
|
|
1771
1826
|
const parsed = projectionWriteResultSchema.safeParse(request.returned);
|
|
1772
1827
|
if (!parsed.success) {
|
|
1773
|
-
return runnerInvalidOutput({ detail:
|
|
1828
|
+
return runnerInvalidOutput({ detail: z11.prettifyError(parsed.error) });
|
|
1774
1829
|
}
|
|
1775
1830
|
if (parsed.data.outcome === "failed") {
|
|
1776
1831
|
return parsed.data;
|
|
@@ -1820,7 +1875,7 @@ var projectMechanism = (request) => {
|
|
|
1820
1875
|
// core/check/run-check.ts
|
|
1821
1876
|
var TYPESCRIPT_FILE = /\.(?:ts|tsx|mts|cts)$/;
|
|
1822
1877
|
var EXCEPTIONS_FILE = repoPathSchema.parse("discipline-exceptions.json");
|
|
1823
|
-
var runnerExportSchema =
|
|
1878
|
+
var runnerExportSchema = z12.object({ runner: runnerModuleSchema });
|
|
1824
1879
|
var failed2 = (error) => ({
|
|
1825
1880
|
outcome: "failed",
|
|
1826
1881
|
error
|
|
@@ -1849,7 +1904,7 @@ var loadRunner = async (request) => {
|
|
|
1849
1904
|
}
|
|
1850
1905
|
const parsed = runnerExportSchema.safeParse(loaded.value);
|
|
1851
1906
|
if (!parsed.success) {
|
|
1852
|
-
return failed2({ kind: "runner-invalid", mechanism: request.mechanism, detail:
|
|
1907
|
+
return failed2({ kind: "runner-invalid", mechanism: request.mechanism, detail: z12.prettifyError(parsed.error) });
|
|
1853
1908
|
}
|
|
1854
1909
|
return { outcome: "ok", value: parsed.data.runner };
|
|
1855
1910
|
};
|
|
@@ -2118,6 +2173,8 @@ export {
|
|
|
2118
2173
|
loadFailureText,
|
|
2119
2174
|
installRootOf,
|
|
2120
2175
|
installRootOfApiEntry,
|
|
2176
|
+
UNLINKED,
|
|
2177
|
+
packageLinkOf,
|
|
2121
2178
|
shownFailureOf,
|
|
2122
2179
|
defaultClauseSettings,
|
|
2123
2180
|
readRunSettings,
|