@milkenjoyer/toolchain 0.17.1 → 0.19.0
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/README.md +3 -1
- package/STARTS.md +1 -1
- package/dist/{compatible-D8n_sQHa.mjs → compatible-D54mCSlT.mjs} +1 -1
- package/dist/{compatible-n7uFGrI3.d.mts → compatible-DIYO9MZf.d.mts} +1 -1
- package/dist/compatible.d.mts +1 -1
- package/dist/compatible.mjs +1 -1
- package/dist/{fmt-BaECz64m.mjs → fmt-C6autuPP.mjs} +1 -1
- package/dist/fmt.mjs +1 -1
- package/dist/formal.mjs +26 -16
- package/dist/{guard-Doqk4Fju.mjs → guard-fFg_0NIp.mjs} +9 -4
- package/dist/guard.d.mts +2 -2
- package/dist/guard.mjs +1 -1
- package/dist/{lint-CfztB4u8.mjs → lint-BJ6SmGk1.mjs} +1 -1
- package/dist/lint.mjs +1 -1
- package/dist/standard.mjs +26 -17
- package/dist/starts.mjs +19 -0
- package/dist/{versions-C7LKZGr3.mjs → versions-DpRzgSR_.mjs} +12 -12
- package/dist/{versions-D02TrtKw.d.mts → versions-DqZd0jF9.d.mts} +1 -1
- package/dist/versions.d.mts +1 -1
- package/dist/versions.mjs +1 -1
- package/formal-tools/tla2tools-1.8.0.jar +0 -0
- package/licenses/tlaplus.txt +24 -0
- package/node-version +1 -1
- package/package.json +11 -10
- package/src/fmt.ts +1 -1
- package/src/formal/tla.ts +27 -27
- package/src/formal/tools.ts +16 -0
- package/src/lint.ts +1 -1
- package/src/standard/alchemy.ts +26 -29
- package/src/standard/manifest.ts +16 -0
- package/src/standard/toolchain.ts +37 -13
- package/src/starts/policy.ts +28 -0
- package/src/versions.ts +12 -12
package/README.md
CHANGED
|
@@ -48,7 +48,9 @@ In the PR job, set `permissions: contents: read` and `GH_TOKEN: ${{ github.token
|
|
|
48
48
|
|
|
49
49
|
`vp exec formal` checks every tracked TLA+ module and arithmetic proof against the standard in agent-kit#276. Run it from anywhere in the repository with no arguments. It exits 0 when every check passes. Each finding goes to stderr as `<file>: <check>: <message>`, sorted by file and then by check order, and the command exits 1. Each passing step logs one line to stdout.
|
|
50
50
|
|
|
51
|
-
It needs Java 17 on `PATH`. In CI, add `actions/setup-java` with `distribution: temurin` and `java-version: "17"` before the step that runs it. The
|
|
51
|
+
It needs Java 17 on `PATH`. In CI, add `actions/setup-java` with `distribution: temurin` and `java-version: "17"` before the step that runs it. The package contains TLC 1.8.0 (`tla2tools-1.8.0.jar`). The first run verifies its pinned SHA-256 digest and copies it into `$XDG_CACHE_HOME/tla`, or `~/.cache/tla`, without downloading TLC. CommunityModules 202611060952 (`CommunityModules-deps-202611060952.jar`) retains its pinned release download and REST asset fallback. Every run checks both cached JARs against their existing digests. A cached JAR with the wrong digest stops the run. Delete it to restore the verified source on the next run. Immutable CommunityModules distribution is tracked in agent-kit#471.
|
|
52
|
+
|
|
53
|
+
In an agent-kit source checkout, run `bun scripts/hydrate-formal-tools.ts` with `GH_TOKEN` set to a token with contents access before formal tests or packing. The build helper verifies the fixed private archive and TLC JAR before writing generated package files. `ready` and `release` run it automatically with their workflow token.
|
|
52
54
|
|
|
53
55
|
### `specs.json`
|
|
54
56
|
|
package/STARTS.md
CHANGED
|
@@ -14,4 +14,4 @@ Repo CI history counts a Boat job without `runStartedAt` as starting now unless
|
|
|
14
14
|
|
|
15
15
|
Import `boatJobFindings` from `@milkenjoyer/toolchain/starts`. Add its findings to the existing workflow policy, with every workflow as a `[path, text]` pair. It bounds each closure to `BOAT_JOBS_PER_RUN = 2`, including literal matrices, repeated local reusable calls and `workflow_run` descendants. Each descendant counts once per distinct activity type, or three times when `types` is absent. Dynamic and unresolved graphs produce findings. Keep runner, timeout and concurrency checks.
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
`boatJobFindings` also reports a workflow whose Boat jobs start on a `pull_request`, `pull_request_target` or PR-branch push. A `pull_request` trigger with a non-empty `types` list containing only `labeled` is exempt. Every other PR trigger stays flagged. A product repo moves PR `ready` to `pull_request` `labeled` with the pin move that brings this rule. Product repos adopt the published pin instead of copying files. Boat reports no start spend, so nothing here proves zero paid starts.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as lead, f as versionOf, i as familyOf, o as fixedBy, r as familyNamed, s as fixedOf, t as catalog, u as ownerOf } from "./versions-
|
|
1
|
+
import { c as lead, f as versionOf, i as familyOf, o as fixedBy, r as familyNamed, s as fixedOf, t as catalog, u as ownerOf } from "./versions-DpRzgSR_.mjs";
|
|
2
2
|
import * as Arr from "effect/Array";
|
|
3
3
|
import * as Data from "effect/Data";
|
|
4
4
|
import { dual } from "effect/Function";
|
package/dist/compatible.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as VersionManifest, c as describeConflict, d as onLatestLine, f as otherTags, i as Solution, l as fixedRange, n as Packument, o as aliasTarget, p as solve, r as Packuments, s as conflicts, t as Conflict, u as latestOf } from "./compatible-
|
|
1
|
+
import { a as VersionManifest, c as describeConflict, d as onLatestLine, f as otherTags, i as Solution, l as fixedRange, n as Packument, o as aliasTarget, p as solve, r as Packuments, s as conflicts, t as Conflict, u as latestOf } from "./compatible-DIYO9MZf.mjs";
|
|
2
2
|
export { Conflict, Packument, Packuments, Solution, VersionManifest, aliasTarget, conflicts, describeConflict, fixedRange, latestOf, onLatestLine, otherTags, solve };
|
package/dist/compatible.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as Conflict, n as Packument, r as Packuments, i as VersionManifest, a as aliasTarget, o as conflicts, s as describeConflict, c as fixedRange, l as latestOf, u as onLatestLine, d as otherTags, f as solve } from "./compatible-
|
|
1
|
+
export { t as Conflict, n as Packument, r as Packuments, i as VersionManifest, a as aliasTarget, o as conflicts, s as describeConflict, c as fixedRange, l as latestOf, u as onLatestLine, d as otherTags, f as solve } from "./compatible-D54mCSlT.mjs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import ultraciteFmt from "ultracite/oxfmt";
|
|
2
2
|
// src/fmt.ts
|
|
3
|
-
const { ignorePatterns: coreIgnores
|
|
3
|
+
const { ignorePatterns: coreIgnores } = ultraciteFmt;
|
|
4
4
|
const fmt = ({ ignores = [] } = {}) => ({
|
|
5
5
|
...ultraciteFmt,
|
|
6
6
|
ignorePatterns: [...coreIgnores, ...ignores]
|
package/dist/fmt.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as fmt } from "./fmt-
|
|
1
|
+
export { t as fmt } from "./fmt-C6autuPP.mjs";
|
package/dist/formal.mjs
CHANGED
|
@@ -17,11 +17,11 @@ import * as Stream from "effect/Stream";
|
|
|
17
17
|
import { FileSystem } from "effect/FileSystem";
|
|
18
18
|
import { fileURLToPath } from "node:url";
|
|
19
19
|
import * as Result from "effect/Result";
|
|
20
|
-
import { createHash } from "node:crypto";
|
|
21
20
|
import * as Clock from "effect/Clock";
|
|
22
21
|
import * as Context from "effect/Context";
|
|
23
22
|
import { FetchHttpClient, HttpClient } from "effect/http";
|
|
24
23
|
import { Path } from "effect/Path";
|
|
24
|
+
import { createHash } from "node:crypto";
|
|
25
25
|
import * as Cache from "effect/Cache";
|
|
26
26
|
// src/formal/proof-run.ts
|
|
27
27
|
const Edit = Schema.Struct({
|
|
@@ -237,19 +237,21 @@ const fromXml = (xml) => {
|
|
|
237
237
|
typeOK: typeOK && new Set(body ? typed(body, /* @__PURE__ */ new Set()) : [])
|
|
238
238
|
};
|
|
239
239
|
};
|
|
240
|
-
// src/formal/
|
|
241
|
-
|
|
242
|
-
const pins = [{
|
|
240
|
+
// src/formal/tools.ts
|
|
241
|
+
const pins$1 = [{
|
|
243
242
|
file: "tla2tools-1.8.0.jar",
|
|
244
|
-
urls: ["https://github.com/tlaplus/tlaplus/releases/download/v1.8.0/tla2tools.jar", "https://api.github.com/repos/tlaplus/tlaplus/releases/assets/718777374"],
|
|
245
243
|
sha256: "e1f11b75c4b5bc4478ba0ac5cb6ae28e40a01b0016bc33e0aa97da22dfdbcd7f"
|
|
246
|
-
}
|
|
244
|
+
}];
|
|
245
|
+
const packagedTools = fileURLToPath(new URL("../../formal-tools/", import.meta.url));
|
|
246
|
+
const digest = (bytes) => createHash("sha256").update(bytes).digest("hex");
|
|
247
|
+
// src/formal/tla.ts
|
|
248
|
+
var FormalError = class extends Data.TaggedError("FormalError") {};
|
|
249
|
+
const pins = [...pins$1, {
|
|
247
250
|
file: "CommunityModules-deps-202611060952.jar",
|
|
248
251
|
urls: ["https://github.com/tlaplus/CommunityModules/releases/download/202611060952/CommunityModules-deps-202611060952.jar", "https://api.github.com/repos/tlaplus/CommunityModules/releases/assets/716678698"],
|
|
249
252
|
sha256: "a3b27c40f1fb5085f30c6ead37e918457f8cfc62c1e50a1dc668ef592ad2b5fb"
|
|
250
253
|
}];
|
|
251
254
|
const error = (cause) => new FormalError({ message: cause instanceof Error ? cause.message : String(cause) });
|
|
252
|
-
const digest = (bytes) => createHash("sha256").update(bytes).digest("hex");
|
|
253
255
|
const messages = (output) => [...output.matchAll(/@!@!@STARTMSG (\d+):([0-4]) @!@!@([\s\S]*?)@!@!@ENDMSG \1 @!@!@/gu)].map((match) => ({
|
|
254
256
|
code: Number(match[1]),
|
|
255
257
|
severity: Number(match[2]),
|
|
@@ -269,28 +271,35 @@ const make$1 = Effect.gen(function* () {
|
|
|
269
271
|
const file = path.join(cache, pin.file);
|
|
270
272
|
if (yield* fs.exists(file)) {
|
|
271
273
|
const actual = digest(yield* fs.readFile(file));
|
|
272
|
-
if (actual !== pin.sha256) return yield* new FormalError({ message: `${file} has sha256 ${actual}, expected ${pin.sha256}; delete it to
|
|
274
|
+
if (actual !== pin.sha256) return yield* new FormalError({ message: `${file} has sha256 ${actual}, expected ${pin.sha256}; delete it to restore the pinned JAR` });
|
|
273
275
|
} else yield* Effect.scoped(Effect.gen(function* () {
|
|
274
276
|
const temp = yield* fs.makeTempFileScoped({
|
|
275
277
|
directory: cache,
|
|
276
278
|
prefix: `.${pin.file}.`,
|
|
277
279
|
suffix: ".part"
|
|
278
280
|
});
|
|
279
|
-
const {
|
|
281
|
+
const { source, bytes } = yield* Effect.gen(function* () {
|
|
282
|
+
if (!("urls" in pin)) {
|
|
283
|
+
const source = path.join(packagedTools, pin.file);
|
|
284
|
+
return {
|
|
285
|
+
source,
|
|
286
|
+
bytes: yield* fs.readFile(source)
|
|
287
|
+
};
|
|
288
|
+
}
|
|
280
289
|
const failures = [];
|
|
281
|
-
for (const
|
|
282
|
-
const result = yield* HttpClient.get(
|
|
290
|
+
for (const source of pin.urls) {
|
|
291
|
+
const result = yield* HttpClient.get(source, { headers: { Accept: "application/octet-stream" } }).pipe(Effect.flatMap((response) => response.status === 200 ? response.arrayBuffer.pipe(Effect.mapError(error)) : Effect.fail(new FormalError({ message: `HTTP ${response.status}` }))), Effect.map((buffer) => new Uint8Array(buffer)), Effect.timeout("120 seconds"), Effect.provide(FetchHttpClient.layer), Effect.result);
|
|
283
292
|
if (Result.isSuccess(result)) return {
|
|
284
|
-
|
|
293
|
+
source,
|
|
285
294
|
bytes: result.success
|
|
286
295
|
};
|
|
287
|
-
failures.push(`${
|
|
296
|
+
failures.push(`${source}: ${error(result.failure).message}`);
|
|
288
297
|
}
|
|
289
298
|
return yield* new FormalError({ message: failures.join("; ") });
|
|
290
299
|
});
|
|
291
|
-
yield* fs.writeFile(temp, bytes);
|
|
292
300
|
const actual = digest(bytes);
|
|
293
|
-
if (actual !== pin.sha256) return yield* new FormalError({ message: `${
|
|
301
|
+
if (actual !== pin.sha256) return yield* new FormalError({ message: `${source} has sha256 ${actual}, expected ${pin.sha256}` });
|
|
302
|
+
yield* fs.writeFile(temp, bytes);
|
|
294
303
|
return yield* fs.rename(temp, file);
|
|
295
304
|
}));
|
|
296
305
|
jars.push(file);
|
|
@@ -298,7 +307,8 @@ const make$1 = Effect.gen(function* () {
|
|
|
298
307
|
const classpath = jars.join(":");
|
|
299
308
|
const run = Effect.fn("formal.java")(function* (args, cwd, seconds = 120) {
|
|
300
309
|
return yield* Effect.scoped(Effect.gen(function* () {
|
|
301
|
-
const
|
|
310
|
+
const temporary = yield* fs.makeTempDirectoryScoped({ prefix: "formal-java-" });
|
|
311
|
+
const process = yield* ChildProcess.make("java", [`-Djava.io.tmpdir=${temporary}`, ...args], {
|
|
302
312
|
cwd,
|
|
303
313
|
stdin: "ignore",
|
|
304
314
|
killSignal: "SIGKILL"
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { d as otherTags, l as latestOf, u as onLatestLine } from "./compatible-
|
|
1
|
+
import { d as otherTags, l as latestOf, u as onLatestLine } from "./compatible-D54mCSlT.mjs";
|
|
2
2
|
import { i as enforcedTsgoRules } from "./effect-tsgo-D0QfeKGD.mjs";
|
|
3
3
|
import { t as exceptions } from "./exceptions-Dybl9xpc.mjs";
|
|
4
|
-
import { a as toolchainScopes, n as effectRules, r as foldkitPreset, t as birbprophetRules } from "./lint-
|
|
5
|
-
import { c as lead, f as versionOf } from "./versions-
|
|
4
|
+
import { a as toolchainScopes, n as effectRules, r as foldkitPreset, t as birbprophetRules } from "./lint-BJ6SmGk1.mjs";
|
|
5
|
+
import { c as lead, f as versionOf } from "./versions-DpRzgSR_.mjs";
|
|
6
6
|
import * as Arr from "effect/Array";
|
|
7
7
|
import { dual } from "effect/Function";
|
|
8
8
|
import * as HashSet from "effect/HashSet";
|
|
@@ -31,6 +31,11 @@ const Manifest = Schema.fromJsonString(Schema.Struct({
|
|
|
31
31
|
catalogs: Catalogs,
|
|
32
32
|
workspaces: Schema.optionalKey(Schema.Union([WorkspaceList, WorkspaceCatalogs]))
|
|
33
33
|
}));
|
|
34
|
+
const resolveCatalog = (name, written, groups) => {
|
|
35
|
+
if (!written.startsWith("catalog:")) return written;
|
|
36
|
+
const catalog = written.slice(8);
|
|
37
|
+
return (catalog === "" ? groups.get("workspaces.catalog")?.[name] ?? groups.get("catalog")?.[name] : groups.get(`workspaces.catalogs.${catalog}`)?.[name] ?? groups.get(`catalogs.${catalog}`)?.[name]) ?? written;
|
|
38
|
+
};
|
|
34
39
|
const named = (prefix, catalogs) => Arr.map(R.toEntries(catalogs), ([name, ranges]) => [`${prefix}.${name}`, ranges]);
|
|
35
40
|
const manifestRanges = (text) => {
|
|
36
41
|
const decoded = Schema.decodeResult(Manifest)(text);
|
|
@@ -140,4 +145,4 @@ const familyTagFindings = (registry, family) => Option.match(latestOf(registry,
|
|
|
140
145
|
})
|
|
141
146
|
});
|
|
142
147
|
const tagFindings = dual(2, (current, registry) => Arr.flatMap(current.families, (family) => familyTagFindings(registry, family)));
|
|
143
|
-
export { ruleFindings as a, exactFindings as c, pinFindings as i, manifestRanges as l, foldkitViteFindings as n, tagFindings as o, isFoldkitViteInput as r, PLAIN as s, exceptionFindings as t };
|
|
148
|
+
export { ruleFindings as a, exactFindings as c, pinFindings as i, manifestRanges as l, foldkitViteFindings as n, tagFindings as o, isFoldkitViteInput as r, PLAIN as s, exceptionFindings as t, resolveCatalog as u };
|
package/dist/guard.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { r as Packuments } from "./compatible-
|
|
1
|
+
import { r as Packuments } from "./compatible-DIYO9MZf.mjs";
|
|
2
2
|
import { t as Exception } from "./exceptions-LNZ022dl.mjs";
|
|
3
|
-
import { t as Catalog } from "./versions-
|
|
3
|
+
import { t as Catalog } from "./versions-DqZd0jF9.mjs";
|
|
4
4
|
import { OxlintConfig } from "vite-plus/lint";
|
|
5
5
|
type Ranges = Readonly<Record<string, string>>;
|
|
6
6
|
export declare const manifestRanges: (text: string) => ReadonlyArray<readonly [string, Ranges]>;
|
package/dist/guard.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { c as exactFindings, t as exceptionFindings, n as foldkitViteFindings, r as isFoldkitViteInput, l as manifestRanges, i as pinFindings, a as ruleFindings, o as tagFindings } from "./guard-
|
|
1
|
+
export { c as exactFindings, t as exceptionFindings, n as foldkitViteFindings, r as isFoldkitViteInput, l as manifestRanges, i as pinFindings, a as ruleFindings, o as tagFindings } from "./guard-fFg_0NIp.mjs";
|
|
@@ -89,7 +89,7 @@ const toolchainScopes = [
|
|
|
89
89
|
const atError = (prefix, rules) => R.fromEntries(Arr.map(rules, (rule) => [`${prefix}/${rule}`, "error"]));
|
|
90
90
|
const effectRules = atError(plugin.meta.name, R.keys(plugin.rules));
|
|
91
91
|
const birbprophetRules = atError(plugin$1.meta.name, R.keys(plugin$1.rules));
|
|
92
|
-
const { ignorePatterns: coreIgnores
|
|
92
|
+
const { ignorePatterns: coreIgnores } = ultraciteCore;
|
|
93
93
|
const resolved = (specifier) => decodeURIComponent(new URL(import.meta.resolve(specifier)).pathname);
|
|
94
94
|
const ownExtension = Str.slice(Str.lastIndexOf(".")(import.meta.filename).pipe(Option.getOrElse(() => -1)))(import.meta.filename);
|
|
95
95
|
const sibling = (module) => resolved(`./${module}${ownExtension}`);
|
package/dist/lint.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as birbprophetRules, n as effectRules, r as foldkitPreset, i as lint, a as toolchainScopes } from "./lint-
|
|
1
|
+
export { t as birbprophetRules, n as effectRules, r as foldkitPreset, i as lint, a as toolchainScopes } from "./lint-BJ6SmGk1.mjs";
|
package/dist/standard.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { f as versionOf } from "./versions-DpRzgSR_.mjs";
|
|
3
|
+
import { a as ruleFindings, c as exactFindings, l as manifestRanges, s as PLAIN, u as resolveCatalog } from "./guard-fFg_0NIp.mjs";
|
|
4
|
+
import { t as fmt } from "./fmt-C6autuPP.mjs";
|
|
4
5
|
import { n as criticalFindings, t as decode } from "./specs-file-NsQF4V7X.mjs";
|
|
5
6
|
import * as Arr from "effect/Array";
|
|
6
7
|
import * as Option from "effect/Option";
|
|
@@ -167,11 +168,6 @@ const skillNames = (repo) => Effect.succeed(repo.tracked.flatMap((file) => {
|
|
|
167
168
|
}] : []);
|
|
168
169
|
}));
|
|
169
170
|
// src/standard/alchemy.ts
|
|
170
|
-
const resolve = (name, written, groups) => {
|
|
171
|
-
if (!written.startsWith("catalog:")) return written;
|
|
172
|
-
const catalog = written.slice(8);
|
|
173
|
-
return (catalog === "" ? groups.get("workspaces.catalog")?.[name] ?? groups.get("catalog")?.[name] : groups.get(`workspaces.catalogs.${catalog}`)?.[name] ?? groups.get(`catalogs.${catalog}`)?.[name]) ?? written;
|
|
174
|
-
};
|
|
175
171
|
const alchemyPins = (repo) => Effect.gen(function* () {
|
|
176
172
|
const root = yield* read(repo, "package.json", manifestRanges);
|
|
177
173
|
if (!root.ok) return root.findings;
|
|
@@ -184,19 +180,23 @@ const alchemyPins = (repo) => Effect.gen(function* () {
|
|
|
184
180
|
findings.push(...input.findings);
|
|
185
181
|
continue;
|
|
186
182
|
}
|
|
187
|
-
for (const [field, ranges] of input.value) for (const [name, written] of Object.entries(ranges).toSorted(([a], [b]) => a.localeCompare(b))) if (name === "alchemy" || name.startsWith("@alchemy.run/")) entries.push({
|
|
183
|
+
for (const [field, ranges] of input.value) for (const [name, written] of Object.entries(ranges).toSorted(([a], [b]) => a.localeCompare(b))) if ((name === "alchemy" || name.startsWith("@alchemy.run/")) && !written.startsWith("workspace:")) entries.push({
|
|
188
184
|
file,
|
|
189
185
|
field,
|
|
190
186
|
name,
|
|
191
|
-
version:
|
|
187
|
+
version: resolveCatalog(name, written, groups)
|
|
192
188
|
});
|
|
193
189
|
}
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
190
|
+
return Option.match(versionOf("alchemy"), {
|
|
191
|
+
onNone: () => [...findings, {
|
|
192
|
+
file: "package.json",
|
|
193
|
+
message: "toolchain catalog has no Alchemy version"
|
|
194
|
+
}],
|
|
195
|
+
onSome: (expected) => [...findings, ...entries.filter((entry) => entry.version !== expected).map((entry) => ({
|
|
196
|
+
file: entry.file,
|
|
197
|
+
message: `${entry.field} ${entry.name}: ${entry.version} must match the exact Alchemy version ${expected}`
|
|
198
|
+
}))]
|
|
198
199
|
});
|
|
199
|
-
return findings;
|
|
200
200
|
});
|
|
201
201
|
// src/standard/config.ts
|
|
202
202
|
const ConfigValue = Schema.declare((value) => typeof value === "object" && value !== null);
|
|
@@ -847,8 +847,7 @@ const pin = (repo) => Effect.gen(function* () {
|
|
|
847
847
|
if (!input.ok) return input.findings;
|
|
848
848
|
const groups = new Map(input.value);
|
|
849
849
|
const version = groups.get("dependencies")?.[packageName] ?? groups.get("devDependencies")?.[packageName];
|
|
850
|
-
const
|
|
851
|
-
const resolved = name === void 0 ? version : name === "" ? groups.get("workspaces.catalog")?.[packageName] ?? groups.get("catalog")?.[packageName] : groups.get(`workspaces.catalogs.${name}`)?.[packageName] ?? groups.get(`catalogs.${name}`)?.[packageName];
|
|
850
|
+
const resolved = version === void 0 ? void 0 : resolveCatalog(packageName, version, groups);
|
|
852
851
|
return resolved !== void 0 && PLAIN.test(resolved) ? [] : [{
|
|
853
852
|
file: "package.json",
|
|
854
853
|
message: "pin @milkenjoyer/toolchain to an exact version or an exact catalog entry"
|
|
@@ -879,9 +878,19 @@ const renovate = (repo) => Effect.gen(function* () {
|
|
|
879
878
|
}];
|
|
880
879
|
});
|
|
881
880
|
const exact = (repo) => Effect.gen(function* () {
|
|
881
|
+
const root = yield* read(repo, "package.json", manifestRanges);
|
|
882
|
+
if (!root.ok) return root.findings;
|
|
883
|
+
const groups = new Map(root.value);
|
|
882
884
|
const findings = [];
|
|
883
885
|
for (const file of repo.tracked.filter((f) => /(?:^|\/)package\.json$/u.test(f))) {
|
|
884
|
-
const input = yield* read(repo, file, (text) => exactFindings(file, text))
|
|
886
|
+
const input = yield* read(repo, file, (text) => [...exactFindings(file, text), ...manifestRanges(text).flatMap(([field, ranges]) => Object.entries(ranges).flatMap(([name, written]) => {
|
|
887
|
+
if (name === "alchemy" || name.startsWith("@alchemy.run/") || written.startsWith("workspace:")) return [];
|
|
888
|
+
const actual = resolveCatalog(name, written, groups);
|
|
889
|
+
return Option.match(versionOf(name), {
|
|
890
|
+
onNone: () => [],
|
|
891
|
+
onSome: (expected) => actual === expected ? [] : [`${field} ${name}: ${actual} must match the toolchain catalog's ${expected}`]
|
|
892
|
+
});
|
|
893
|
+
}))]);
|
|
885
894
|
findings.push(...input.ok ? input.value.map((message) => ({
|
|
886
895
|
file,
|
|
887
896
|
message
|
package/dist/starts.mjs
CHANGED
|
@@ -325,6 +325,7 @@ const Descendant = Schema.Struct({ workflow_run: Schema.Struct({
|
|
|
325
325
|
workflows: Schema.Union([Schema.String, Schema.Array(Schema.String)]),
|
|
326
326
|
types: Schema.optionalKey(Schema.Union([Schema.String, Schema.Array(Schema.String)]))
|
|
327
327
|
}) });
|
|
328
|
+
const LabelRequest = Schema.Struct({ types: Schema.NonEmptyArray(Schema.Literal("labeled")) });
|
|
328
329
|
const dynamic = (value) => {
|
|
329
330
|
try {
|
|
330
331
|
return JSON.stringify(value).includes("${{");
|
|
@@ -332,6 +333,23 @@ const dynamic = (value) => {
|
|
|
332
333
|
return true;
|
|
333
334
|
}
|
|
334
335
|
};
|
|
336
|
+
const startsOnPr = (events) => {
|
|
337
|
+
if (typeof events === "string") return [
|
|
338
|
+
"pull_request",
|
|
339
|
+
"pull_request_target",
|
|
340
|
+
"push"
|
|
341
|
+
].includes(events);
|
|
342
|
+
if (Array.isArray(events)) return events.some((event) => startsOnPr(event));
|
|
343
|
+
if (events === void 0) return false;
|
|
344
|
+
if ("pull_request_target" in events) return true;
|
|
345
|
+
if ("pull_request" in events && !Schema.is(LabelRequest)(events.pull_request)) return true;
|
|
346
|
+
if (!("push" in events)) return false;
|
|
347
|
+
const push = events.push;
|
|
348
|
+
if (typeof push !== "object" || push === null) return true;
|
|
349
|
+
if ("branches-ignore" in push) return true;
|
|
350
|
+
if ("branches" in push) return !Array.isArray(push.branches) || push.branches.some((branch) => branch !== "main");
|
|
351
|
+
return !("tags" in push || "tags-ignore" in push);
|
|
352
|
+
};
|
|
335
353
|
const boatJobFindings = (files) => {
|
|
336
354
|
const findings = [];
|
|
337
355
|
const workflows = [];
|
|
@@ -409,6 +427,7 @@ const boatJobFindings = (files) => {
|
|
|
409
427
|
};
|
|
410
428
|
for (const entry of workflows) {
|
|
411
429
|
const total = count(entry, [], true);
|
|
430
|
+
if (total > 0 && startsOnPr(entry.workflow.on)) findings.push(`${entry.path}: a pull_request or PR-branch push starts ${total} Boat jobs; PR ready starts on request`);
|
|
412
431
|
if (total > 2) findings.push(`${entry.path}: closure starts ${total} Boat jobs, limit 2`);
|
|
413
432
|
}
|
|
414
433
|
return [...new Set(findings)];
|
|
@@ -5,17 +5,17 @@ import * as R from "effect/Record";
|
|
|
5
5
|
import * as Schema from "effect/Schema";
|
|
6
6
|
import * as Str from "effect/String";
|
|
7
7
|
// src/versions.ts
|
|
8
|
-
const nodeVersion = "26.13.
|
|
8
|
+
const nodeVersion = "26.13.1";
|
|
9
9
|
const families = [
|
|
10
10
|
{
|
|
11
11
|
name: "vite-plus",
|
|
12
|
-
version: "1.
|
|
12
|
+
version: "1.6.0",
|
|
13
13
|
packages: ["vite-plus"],
|
|
14
14
|
scopes: []
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
17
|
name: "alchemy",
|
|
18
|
-
version: "2.0.0-beta.
|
|
18
|
+
version: "2.0.0-beta.87",
|
|
19
19
|
packages: [
|
|
20
20
|
"@alchemy.run/domain",
|
|
21
21
|
"alchemy",
|
|
@@ -50,7 +50,7 @@ const families = [
|
|
|
50
50
|
},
|
|
51
51
|
{
|
|
52
52
|
name: "effect",
|
|
53
|
-
version: "4.1.
|
|
53
|
+
version: "4.1.4",
|
|
54
54
|
packages: [
|
|
55
55
|
"effect",
|
|
56
56
|
"@effect/platform-browser",
|
|
@@ -63,13 +63,13 @@ const families = [
|
|
|
63
63
|
},
|
|
64
64
|
{
|
|
65
65
|
name: "@effect/tsgo",
|
|
66
|
-
version: "0.
|
|
66
|
+
version: "0.69.0",
|
|
67
67
|
packages: ["@effect/tsgo"],
|
|
68
68
|
scopes: []
|
|
69
69
|
},
|
|
70
70
|
{
|
|
71
71
|
name: "ultracite",
|
|
72
|
-
version: "8.
|
|
72
|
+
version: "8.2.1",
|
|
73
73
|
packages: ["ultracite"],
|
|
74
74
|
scopes: []
|
|
75
75
|
},
|
|
@@ -81,7 +81,7 @@ const families = [
|
|
|
81
81
|
},
|
|
82
82
|
{
|
|
83
83
|
name: "effect-oxlint",
|
|
84
|
-
version: "0.
|
|
84
|
+
version: "0.5.1",
|
|
85
85
|
packages: ["effect-oxlint"],
|
|
86
86
|
scopes: []
|
|
87
87
|
},
|
|
@@ -95,22 +95,22 @@ const families = [
|
|
|
95
95
|
const fixed = [
|
|
96
96
|
{
|
|
97
97
|
name: "oxlint",
|
|
98
|
-
version: "1.
|
|
98
|
+
version: "1.93.0",
|
|
99
99
|
by: "vite-plus"
|
|
100
100
|
},
|
|
101
101
|
{
|
|
102
102
|
name: "@oxlint/plugins",
|
|
103
|
-
version: "1.
|
|
103
|
+
version: "1.93.0",
|
|
104
104
|
by: "vite-plus"
|
|
105
105
|
},
|
|
106
106
|
{
|
|
107
107
|
name: "oxlint-tsgolint",
|
|
108
|
-
version: "7.0.
|
|
108
|
+
version: "7.0.2006",
|
|
109
109
|
by: "vite-plus"
|
|
110
110
|
},
|
|
111
111
|
{
|
|
112
112
|
name: "oxfmt",
|
|
113
|
-
version: "0.
|
|
113
|
+
version: "0.78.0",
|
|
114
114
|
by: "vite-plus"
|
|
115
115
|
},
|
|
116
116
|
{
|
|
@@ -120,7 +120,7 @@ const fixed = [
|
|
|
120
120
|
},
|
|
121
121
|
{
|
|
122
122
|
name: "vite",
|
|
123
|
-
version: "npm:@voidzero-dev/vite-plus-core@1.
|
|
123
|
+
version: "npm:@voidzero-dev/vite-plus-core@1.6.0",
|
|
124
124
|
by: "vite-plus"
|
|
125
125
|
}
|
|
126
126
|
];
|
|
@@ -10,7 +10,7 @@ type Fixed = {
|
|
|
10
10
|
readonly version: string;
|
|
11
11
|
readonly by: string;
|
|
12
12
|
};
|
|
13
|
-
declare const nodeVersion = "26.13.
|
|
13
|
+
declare const nodeVersion = "26.13.1";
|
|
14
14
|
declare const families: ReadonlyArray<Family>;
|
|
15
15
|
declare const fixed: ReadonlyArray<Fixed>;
|
|
16
16
|
type Catalog = {
|
package/dist/versions.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as families, c as fixed, d as lead, f as nodeVersion, g as versions, h as versionOf, i as catalog, l as fixedBy, m as pinned, n as Family, o as familyNamed, p as ownerOf, r as Fixed, s as familyOf, t as Catalog, u as fixedOf } from "./versions-
|
|
1
|
+
import { a as families, c as fixed, d as lead, f as nodeVersion, g as versions, h as versionOf, i as catalog, l as fixedBy, m as pinned, n as Family, o as familyNamed, p as ownerOf, r as Fixed, s as familyOf, t as Catalog, u as fixedOf } from "./versions-DqZd0jF9.mjs";
|
|
2
2
|
export { Catalog, Family, Fixed, catalog, families, familyNamed, familyOf, fixed, fixedBy, fixedOf, lead, nodeVersion, ownerOf, pinned, versionOf, versions };
|
package/dist/versions.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as catalog, n as families, r as familyNamed, i as familyOf, a as fixed, o as fixedBy, s as fixedOf, c as lead, l as nodeVersion, u as ownerOf, d as pinned, f as versionOf, p as versions } from "./versions-
|
|
1
|
+
export { t as catalog, n as families, r as familyNamed, i as familyOf, a as fixed, o as fixedBy, s as fixedOf, c as lead, l as nodeVersion, u as ownerOf, d as pinned, f as versionOf, p as versions } from "./versions-DpRzgSR_.mjs";
|
|
Binary file
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 199? HP Corporation
|
|
4
|
+
Copyright (c) 2003 Microsoft Corporation
|
|
5
|
+
Copyright (c) 2023 Linux Foundation
|
|
6
|
+
|
|
7
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
9
|
+
in the Software without restriction, including without limitation the rights
|
|
10
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
12
|
+
furnished to do so, subject to the following conditions:
|
|
13
|
+
|
|
14
|
+
The above copyright notice and this permission notice shall be included in all
|
|
15
|
+
copies or substantial portions of the Software.
|
|
16
|
+
|
|
17
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
23
|
+
SOFTWARE.
|
|
24
|
+
|
package/node-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
26.13.
|
|
1
|
+
26.13.1
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@milkenjoyer/toolchain",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.19.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/birbprophet/agent-kit.git",
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
"files": [
|
|
17
17
|
"dist",
|
|
18
18
|
"STARTS.md",
|
|
19
|
+
"formal-tools/tla2tools-1.8.0.jar",
|
|
19
20
|
"licenses",
|
|
20
21
|
"node-version",
|
|
21
22
|
"renovate.json",
|
|
@@ -108,30 +109,30 @@
|
|
|
108
109
|
},
|
|
109
110
|
"dependencies": {
|
|
110
111
|
"@boatdev/sdk": "1.13.0",
|
|
111
|
-
"@effect/platform-node": "4.1.
|
|
112
|
-
"@effect/tsgo": "0.
|
|
112
|
+
"@effect/platform-node": "4.1.4",
|
|
113
|
+
"@effect/tsgo": "0.69.0",
|
|
113
114
|
"@foldkit/oxlint-plugin": "0.15.4",
|
|
114
115
|
"@mpsuesser/oxlint-plugin-effect": "0.6.0",
|
|
115
116
|
"@octokit/rest": "22.0.1",
|
|
116
|
-
"effect": "4.1.
|
|
117
|
-
"effect-oxlint": "0.
|
|
117
|
+
"effect": "4.1.4",
|
|
118
|
+
"effect-oxlint": "0.5.1",
|
|
118
119
|
"oxc-parser": "0.157.0",
|
|
119
120
|
"semver": "7.8.6",
|
|
120
|
-
"ultracite": "8.
|
|
121
|
+
"ultracite": "8.2.1",
|
|
121
122
|
"yaml": "2.9.1",
|
|
122
123
|
"z3-solver": "5.3.3"
|
|
123
124
|
},
|
|
124
125
|
"devDependencies": {
|
|
125
126
|
"@birbprophet/test-kit": "0.0.0",
|
|
126
|
-
"@effect/vitest": "4.1.
|
|
127
|
+
"@effect/vitest": "4.1.4",
|
|
127
128
|
"@types/semver": "7.8.0",
|
|
128
129
|
"jsonata": "2.2.2",
|
|
129
130
|
"knip": "6.44.1",
|
|
130
|
-
"oxlint": "1.
|
|
131
|
-
"vite-plus": "1.
|
|
131
|
+
"oxlint": "1.93.0",
|
|
132
|
+
"vite-plus": "1.6.0"
|
|
132
133
|
},
|
|
133
134
|
"peerDependencies": {
|
|
134
135
|
"knip": "6.44.1",
|
|
135
|
-
"vite-plus": "1.
|
|
136
|
+
"vite-plus": "1.6.0"
|
|
136
137
|
}
|
|
137
138
|
}
|
package/src/fmt.ts
CHANGED
|
@@ -5,7 +5,7 @@ export type FmtOptions = {
|
|
|
5
5
|
readonly ignores?: ReadonlyArray<string>;
|
|
6
6
|
};
|
|
7
7
|
|
|
8
|
-
const { ignorePatterns: coreIgnores
|
|
8
|
+
const { ignorePatterns: coreIgnores } = ultraciteFmt;
|
|
9
9
|
|
|
10
10
|
export const fmt = ({ ignores = [] }: FmtOptions = {}): OxfmtConfig => ({
|
|
11
11
|
...ultraciteFmt,
|
package/src/formal/tla.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { createHash } from "node:crypto";
|
|
2
|
-
|
|
3
1
|
import * as Clock from "effect/Clock";
|
|
4
2
|
import * as Config from "effect/Config";
|
|
5
3
|
import * as Context from "effect/Context";
|
|
@@ -16,6 +14,7 @@ import * as Stream from "effect/Stream";
|
|
|
16
14
|
|
|
17
15
|
import { fromXml } from "./semantics.ts";
|
|
18
16
|
import type { Analysis } from "./specs.ts";
|
|
17
|
+
import { digest, packagedTools, pins as packagedPins } from "./tools.ts";
|
|
19
18
|
|
|
20
19
|
export class FormalError extends Data.TaggedError("FormalError")<{
|
|
21
20
|
readonly message: string;
|
|
@@ -51,14 +50,7 @@ type Formatted =
|
|
|
51
50
|
| { readonly _tag: "Failed"; readonly output: string };
|
|
52
51
|
|
|
53
52
|
const pins = [
|
|
54
|
-
|
|
55
|
-
file: "tla2tools-1.8.0.jar",
|
|
56
|
-
urls: [
|
|
57
|
-
"https://github.com/tlaplus/tlaplus/releases/download/v1.8.0/tla2tools.jar",
|
|
58
|
-
"https://api.github.com/repos/tlaplus/tlaplus/releases/assets/718777374",
|
|
59
|
-
],
|
|
60
|
-
sha256: "e1f11b75c4b5bc4478ba0ac5cb6ae28e40a01b0016bc33e0aa97da22dfdbcd7f",
|
|
61
|
-
},
|
|
53
|
+
...packagedPins,
|
|
62
54
|
{
|
|
63
55
|
file: "CommunityModules-deps-202611060952.jar",
|
|
64
56
|
urls: [
|
|
@@ -68,12 +60,11 @@ const pins = [
|
|
|
68
60
|
sha256: "a3b27c40f1fb5085f30c6ead37e918457f8cfc62c1e50a1dc668ef592ad2b5fb",
|
|
69
61
|
},
|
|
70
62
|
];
|
|
63
|
+
|
|
71
64
|
const error = (cause: unknown) =>
|
|
72
65
|
new FormalError({
|
|
73
66
|
message: cause instanceof Error ? cause.message : String(cause),
|
|
74
67
|
});
|
|
75
|
-
const digest = (bytes: Uint8Array) =>
|
|
76
|
-
createHash("sha256").update(bytes).digest("hex");
|
|
77
68
|
const messages = (output: string): ToolMessage[] =>
|
|
78
69
|
[
|
|
79
70
|
...output.matchAll(
|
|
@@ -116,7 +107,7 @@ const make = Effect.gen(function* () {
|
|
|
116
107
|
const actual = digest(yield* fs.readFile(file));
|
|
117
108
|
if (actual !== pin.sha256)
|
|
118
109
|
return yield* new FormalError({
|
|
119
|
-
message: `${file} has sha256 ${actual}, expected ${pin.sha256}; delete it to
|
|
110
|
+
message: `${file} has sha256 ${actual}, expected ${pin.sha256}; delete it to restore the pinned JAR`,
|
|
120
111
|
});
|
|
121
112
|
} else {
|
|
122
113
|
yield* Effect.scoped(
|
|
@@ -126,19 +117,21 @@ const make = Effect.gen(function* () {
|
|
|
126
117
|
prefix: `.${pin.file}.`,
|
|
127
118
|
suffix: ".part",
|
|
128
119
|
});
|
|
129
|
-
const {
|
|
120
|
+
const { source, bytes } = yield* Effect.gen(function* () {
|
|
121
|
+
if (!("urls" in pin)) {
|
|
122
|
+
const source = path.join(packagedTools, pin.file);
|
|
123
|
+
return { source, bytes: yield* fs.readFile(source) };
|
|
124
|
+
}
|
|
130
125
|
const failures: string[] = [];
|
|
131
|
-
for (const
|
|
132
|
-
const result = yield* HttpClient.get(
|
|
126
|
+
for (const source of pin.urls) {
|
|
127
|
+
const result = yield* HttpClient.get(source, {
|
|
133
128
|
headers: { Accept: "application/octet-stream" },
|
|
134
129
|
}).pipe(
|
|
135
130
|
Effect.flatMap((response) =>
|
|
136
131
|
response.status === 200
|
|
137
132
|
? response.arrayBuffer.pipe(Effect.mapError(error))
|
|
138
133
|
: Effect.fail(
|
|
139
|
-
new FormalError({
|
|
140
|
-
message: `HTTP ${response.status}`,
|
|
141
|
-
})
|
|
134
|
+
new FormalError({ message: `HTTP ${response.status}` })
|
|
142
135
|
)
|
|
143
136
|
),
|
|
144
137
|
Effect.map((buffer) => new Uint8Array(buffer)),
|
|
@@ -147,17 +140,17 @@ const make = Effect.gen(function* () {
|
|
|
147
140
|
Effect.result
|
|
148
141
|
);
|
|
149
142
|
if (Result.isSuccess(result))
|
|
150
|
-
return {
|
|
151
|
-
failures.push(`${
|
|
143
|
+
return { source, bytes: result.success };
|
|
144
|
+
failures.push(`${source}: ${error(result.failure).message}`);
|
|
152
145
|
}
|
|
153
146
|
return yield* new FormalError({ message: failures.join("; ") });
|
|
154
147
|
});
|
|
155
|
-
yield* fs.writeFile(temp, bytes);
|
|
156
148
|
const actual = digest(bytes);
|
|
157
149
|
if (actual !== pin.sha256)
|
|
158
150
|
return yield* new FormalError({
|
|
159
|
-
message: `${
|
|
151
|
+
message: `${source} has sha256 ${actual}, expected ${pin.sha256}`,
|
|
160
152
|
});
|
|
153
|
+
yield* fs.writeFile(temp, bytes);
|
|
161
154
|
return yield* fs.rename(temp, file);
|
|
162
155
|
})
|
|
163
156
|
);
|
|
@@ -172,11 +165,18 @@ const make = Effect.gen(function* () {
|
|
|
172
165
|
) {
|
|
173
166
|
return yield* Effect.scoped(
|
|
174
167
|
Effect.gen(function* () {
|
|
175
|
-
const
|
|
176
|
-
|
|
177
|
-
stdin: "ignore",
|
|
178
|
-
killSignal: "SIGKILL",
|
|
168
|
+
const temporary = yield* fs.makeTempDirectoryScoped({
|
|
169
|
+
prefix: "formal-java-",
|
|
179
170
|
});
|
|
171
|
+
const process = yield* ChildProcess.make(
|
|
172
|
+
"java",
|
|
173
|
+
[`-Djava.io.tmpdir=${temporary}`, ...args],
|
|
174
|
+
{
|
|
175
|
+
cwd,
|
|
176
|
+
stdin: "ignore",
|
|
177
|
+
killSignal: "SIGKILL",
|
|
178
|
+
}
|
|
179
|
+
);
|
|
180
180
|
return yield* Effect.all(
|
|
181
181
|
[
|
|
182
182
|
process.stdout.pipe(Stream.decodeText, Stream.mkString),
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { fileURLToPath } from "node:url";
|
|
3
|
+
|
|
4
|
+
export const pins = [
|
|
5
|
+
{
|
|
6
|
+
file: "tla2tools-1.8.0.jar",
|
|
7
|
+
sha256: "e1f11b75c4b5bc4478ba0ac5cb6ae28e40a01b0016bc33e0aa97da22dfdbcd7f",
|
|
8
|
+
},
|
|
9
|
+
];
|
|
10
|
+
|
|
11
|
+
export const packagedTools = fileURLToPath(
|
|
12
|
+
new URL("../../formal-tools/", import.meta.url)
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
export const digest = (bytes: Uint8Array): string =>
|
|
16
|
+
createHash("sha256").update(bytes).digest("hex");
|
package/src/lint.ts
CHANGED
|
@@ -124,7 +124,7 @@ export const birbprophetRules = atError(
|
|
|
124
124
|
R.keys(birbprophetPlugin.rules)
|
|
125
125
|
);
|
|
126
126
|
|
|
127
|
-
const { ignorePatterns: coreIgnores
|
|
127
|
+
const { ignorePatterns: coreIgnores } = ultraciteCore;
|
|
128
128
|
|
|
129
129
|
const resolved = (specifier: string): string =>
|
|
130
130
|
decodeURIComponent(new URL(import.meta.resolve(specifier)).pathname);
|
package/src/standard/alchemy.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import * as Effect from "effect/Effect";
|
|
2
|
+
import * as Option from "effect/Option";
|
|
2
3
|
|
|
3
|
-
import {
|
|
4
|
+
import { versionOf } from "../versions.ts";
|
|
5
|
+
import { manifestRanges, resolveCatalog } from "./manifest.ts";
|
|
4
6
|
import { read, type Finding, type Rule } from "./repo.ts";
|
|
5
7
|
|
|
6
8
|
interface AlchemyEntry {
|
|
@@ -9,21 +11,6 @@ interface AlchemyEntry {
|
|
|
9
11
|
readonly name: string;
|
|
10
12
|
readonly version: string;
|
|
11
13
|
}
|
|
12
|
-
const resolve = (
|
|
13
|
-
name: string,
|
|
14
|
-
written: string,
|
|
15
|
-
groups: ReadonlyMap<string, Ranges>
|
|
16
|
-
): string => {
|
|
17
|
-
if (!written.startsWith("catalog:")) return written;
|
|
18
|
-
const catalog = written.slice(8);
|
|
19
|
-
return (
|
|
20
|
-
(catalog === ""
|
|
21
|
-
? (groups.get("workspaces.catalog")?.[name] ??
|
|
22
|
-
groups.get("catalog")?.[name])
|
|
23
|
-
: (groups.get(`workspaces.catalogs.${catalog}`)?.[name] ??
|
|
24
|
-
groups.get(`catalogs.${catalog}`)?.[name])) ?? written
|
|
25
|
-
);
|
|
26
|
-
};
|
|
27
14
|
export const alchemyPins: Rule = (repo) =>
|
|
28
15
|
Effect.gen(function* () {
|
|
29
16
|
const root = yield* read(repo, "package.json", manifestRanges);
|
|
@@ -46,25 +33,35 @@ export const alchemyPins: Rule = (repo) =>
|
|
|
46
33
|
for (const [name, written] of Object.entries(ranges).toSorted(
|
|
47
34
|
([a], [b]) => a.localeCompare(b)
|
|
48
35
|
)) {
|
|
49
|
-
if (
|
|
36
|
+
if (
|
|
37
|
+
(name === "alchemy" || name.startsWith("@alchemy.run/")) &&
|
|
38
|
+
!written.startsWith("workspace:")
|
|
39
|
+
)
|
|
50
40
|
entries.push({
|
|
51
41
|
file,
|
|
52
42
|
field,
|
|
53
43
|
name,
|
|
54
|
-
version:
|
|
44
|
+
version: resolveCatalog(name, written, groups),
|
|
55
45
|
});
|
|
56
46
|
}
|
|
57
47
|
}
|
|
58
48
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
49
|
+
return Option.match(versionOf("alchemy"), {
|
|
50
|
+
onNone: () => [
|
|
51
|
+
...findings,
|
|
52
|
+
{
|
|
53
|
+
file: "package.json",
|
|
54
|
+
message: "toolchain catalog has no Alchemy version",
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
onSome: (expected) => [
|
|
58
|
+
...findings,
|
|
59
|
+
...entries
|
|
60
|
+
.filter((entry) => entry.version !== expected)
|
|
61
|
+
.map((entry) => ({
|
|
62
|
+
file: entry.file,
|
|
63
|
+
message: `${entry.field} ${entry.name}: ${entry.version} must match the exact Alchemy version ${expected}`,
|
|
64
|
+
})),
|
|
65
|
+
],
|
|
66
|
+
});
|
|
70
67
|
});
|
package/src/standard/manifest.ts
CHANGED
|
@@ -39,6 +39,22 @@ const Manifest = Schema.fromJsonString(
|
|
|
39
39
|
|
|
40
40
|
export type Ranges = Readonly<Record<string, string>>;
|
|
41
41
|
|
|
42
|
+
export const resolveCatalog = (
|
|
43
|
+
name: string,
|
|
44
|
+
written: string,
|
|
45
|
+
groups: ReadonlyMap<string, Ranges>
|
|
46
|
+
): string => {
|
|
47
|
+
if (!written.startsWith("catalog:")) return written;
|
|
48
|
+
const catalog = written.slice(8);
|
|
49
|
+
return (
|
|
50
|
+
(catalog === ""
|
|
51
|
+
? (groups.get("workspaces.catalog")?.[name] ??
|
|
52
|
+
groups.get("catalog")?.[name])
|
|
53
|
+
: (groups.get(`workspaces.catalogs.${catalog}`)?.[name] ??
|
|
54
|
+
groups.get(`catalogs.${catalog}`)?.[name])) ?? written
|
|
55
|
+
);
|
|
56
|
+
};
|
|
57
|
+
|
|
42
58
|
const named = (
|
|
43
59
|
prefix: string,
|
|
44
60
|
catalogs: Readonly<Record<string, Ranges>>
|
|
@@ -2,9 +2,16 @@ import { fileURLToPath } from "node:url";
|
|
|
2
2
|
|
|
3
3
|
import * as Effect from "effect/Effect";
|
|
4
4
|
import { FileSystem } from "effect/FileSystem";
|
|
5
|
+
import * as Option from "effect/Option";
|
|
5
6
|
import * as Schema from "effect/Schema";
|
|
6
7
|
|
|
7
|
-
import {
|
|
8
|
+
import { versionOf } from "../versions.ts";
|
|
9
|
+
import {
|
|
10
|
+
exactFindings,
|
|
11
|
+
manifestRanges,
|
|
12
|
+
PLAIN,
|
|
13
|
+
resolveCatalog,
|
|
14
|
+
} from "./manifest.ts";
|
|
8
15
|
import { read, type Finding, type Rule } from "./repo.ts";
|
|
9
16
|
|
|
10
17
|
const packageName = "@milkenjoyer/toolchain";
|
|
@@ -16,16 +23,10 @@ export const pin: Rule = (repo) =>
|
|
|
16
23
|
const version =
|
|
17
24
|
groups.get("dependencies")?.[packageName] ??
|
|
18
25
|
groups.get("devDependencies")?.[packageName];
|
|
19
|
-
const name =
|
|
20
|
-
version?.startsWith("catalog:") === true ? version.slice(8) : undefined;
|
|
21
26
|
const resolved =
|
|
22
|
-
|
|
23
|
-
?
|
|
24
|
-
:
|
|
25
|
-
? (groups.get("workspaces.catalog")?.[packageName] ??
|
|
26
|
-
groups.get("catalog")?.[packageName])
|
|
27
|
-
: (groups.get(`workspaces.catalogs.${name}`)?.[packageName] ??
|
|
28
|
-
groups.get(`catalogs.${name}`)?.[packageName]);
|
|
27
|
+
version === undefined
|
|
28
|
+
? undefined
|
|
29
|
+
: resolveCatalog(packageName, version, groups);
|
|
29
30
|
return resolved !== undefined && PLAIN.test(resolved)
|
|
30
31
|
? []
|
|
31
32
|
: [
|
|
@@ -73,13 +74,36 @@ export const renovate: Rule = (repo) =>
|
|
|
73
74
|
});
|
|
74
75
|
export const exact: Rule = (repo) =>
|
|
75
76
|
Effect.gen(function* () {
|
|
77
|
+
const root = yield* read(repo, "package.json", manifestRanges);
|
|
78
|
+
if (!root.ok) return root.findings;
|
|
79
|
+
const groups = new Map(root.value);
|
|
76
80
|
const findings: Finding[] = [];
|
|
77
81
|
for (const file of repo.tracked.filter((f) =>
|
|
78
82
|
/(?:^|\/)package\.json$/u.test(f)
|
|
79
83
|
)) {
|
|
80
|
-
const input = yield* read(repo, file, (text) =>
|
|
81
|
-
exactFindings(file, text)
|
|
82
|
-
|
|
84
|
+
const input = yield* read(repo, file, (text) => [
|
|
85
|
+
...exactFindings(file, text),
|
|
86
|
+
...manifestRanges(text).flatMap(([field, ranges]) =>
|
|
87
|
+
Object.entries(ranges).flatMap(([name, written]) => {
|
|
88
|
+
if (
|
|
89
|
+
name === "alchemy" ||
|
|
90
|
+
name.startsWith("@alchemy.run/") ||
|
|
91
|
+
written.startsWith("workspace:")
|
|
92
|
+
)
|
|
93
|
+
return [];
|
|
94
|
+
const actual = resolveCatalog(name, written, groups);
|
|
95
|
+
return Option.match(versionOf(name), {
|
|
96
|
+
onNone: () => [],
|
|
97
|
+
onSome: (expected) =>
|
|
98
|
+
actual === expected
|
|
99
|
+
? []
|
|
100
|
+
: [
|
|
101
|
+
`${field} ${name}: ${actual} must match the toolchain catalog's ${expected}`,
|
|
102
|
+
],
|
|
103
|
+
});
|
|
104
|
+
})
|
|
105
|
+
),
|
|
106
|
+
]);
|
|
83
107
|
findings.push(
|
|
84
108
|
...(input.ok
|
|
85
109
|
? input.value.map((message) => ({ file, message }))
|
package/src/starts/policy.ts
CHANGED
|
@@ -36,6 +36,9 @@ const Descendant = Schema.Struct({
|
|
|
36
36
|
),
|
|
37
37
|
}),
|
|
38
38
|
});
|
|
39
|
+
const LabelRequest = Schema.Struct({
|
|
40
|
+
types: Schema.NonEmptyArray(Schema.Literal("labeled")),
|
|
41
|
+
});
|
|
39
42
|
type WorkflowFile = readonly [path: string, text: string];
|
|
40
43
|
type Parsed = {
|
|
41
44
|
readonly path: string;
|
|
@@ -50,6 +53,27 @@ const dynamic = (value: unknown): boolean => {
|
|
|
50
53
|
}
|
|
51
54
|
};
|
|
52
55
|
|
|
56
|
+
const startsOnPr = (events: typeof Workflow.Type.on): boolean => {
|
|
57
|
+
if (typeof events === "string")
|
|
58
|
+
return ["pull_request", "pull_request_target", "push"].includes(events);
|
|
59
|
+
if (Array.isArray(events))
|
|
60
|
+
return events.some((event: string) => startsOnPr(event));
|
|
61
|
+
if (events === undefined) return false;
|
|
62
|
+
if ("pull_request_target" in events) return true;
|
|
63
|
+
if ("pull_request" in events && !Schema.is(LabelRequest)(events.pull_request))
|
|
64
|
+
return true;
|
|
65
|
+
if (!("push" in events)) return false;
|
|
66
|
+
const push = events.push;
|
|
67
|
+
if (typeof push !== "object" || push === null) return true;
|
|
68
|
+
if ("branches-ignore" in push) return true;
|
|
69
|
+
if ("branches" in push)
|
|
70
|
+
return (
|
|
71
|
+
!Array.isArray(push.branches) ||
|
|
72
|
+
push.branches.some((branch: unknown) => branch !== "main")
|
|
73
|
+
);
|
|
74
|
+
return !("tags" in push || "tags-ignore" in push);
|
|
75
|
+
};
|
|
76
|
+
|
|
53
77
|
export const boatJobFindings = (
|
|
54
78
|
files: ReadonlyArray<WorkflowFile>
|
|
55
79
|
): ReadonlyArray<string> => {
|
|
@@ -162,6 +186,10 @@ export const boatJobFindings = (
|
|
|
162
186
|
};
|
|
163
187
|
for (const entry of workflows) {
|
|
164
188
|
const total = count(entry, [], true);
|
|
189
|
+
if (total > 0 && startsOnPr(entry.workflow.on))
|
|
190
|
+
findings.push(
|
|
191
|
+
`${entry.path}: a pull_request or PR-branch push starts ${total} Boat jobs; PR ready starts on request`
|
|
192
|
+
);
|
|
165
193
|
if (total > BOAT_JOBS_PER_RUN)
|
|
166
194
|
findings.push(
|
|
167
195
|
`${entry.path}: closure starts ${total} Boat jobs, limit ${BOAT_JOBS_PER_RUN}`
|
package/src/versions.ts
CHANGED
|
@@ -18,18 +18,18 @@ export type Fixed = {
|
|
|
18
18
|
readonly by: string;
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
-
export const nodeVersion = "26.13.
|
|
21
|
+
export const nodeVersion = "26.13.1";
|
|
22
22
|
|
|
23
23
|
export const families: ReadonlyArray<Family> = [
|
|
24
24
|
{
|
|
25
25
|
name: "vite-plus",
|
|
26
|
-
version: "1.
|
|
26
|
+
version: "1.6.0",
|
|
27
27
|
packages: ["vite-plus"],
|
|
28
28
|
scopes: [],
|
|
29
29
|
},
|
|
30
30
|
{
|
|
31
31
|
name: "alchemy",
|
|
32
|
-
version: "2.0.0-beta.
|
|
32
|
+
version: "2.0.0-beta.87",
|
|
33
33
|
packages: [
|
|
34
34
|
"@alchemy.run/domain",
|
|
35
35
|
"alchemy",
|
|
@@ -64,7 +64,7 @@ export const families: ReadonlyArray<Family> = [
|
|
|
64
64
|
},
|
|
65
65
|
{
|
|
66
66
|
name: "effect",
|
|
67
|
-
version: "4.1.
|
|
67
|
+
version: "4.1.4",
|
|
68
68
|
packages: [
|
|
69
69
|
"effect",
|
|
70
70
|
"@effect/platform-browser",
|
|
@@ -77,13 +77,13 @@ export const families: ReadonlyArray<Family> = [
|
|
|
77
77
|
},
|
|
78
78
|
{
|
|
79
79
|
name: "@effect/tsgo",
|
|
80
|
-
version: "0.
|
|
80
|
+
version: "0.69.0",
|
|
81
81
|
packages: ["@effect/tsgo"],
|
|
82
82
|
scopes: [],
|
|
83
83
|
},
|
|
84
84
|
{
|
|
85
85
|
name: "ultracite",
|
|
86
|
-
version: "8.
|
|
86
|
+
version: "8.2.1",
|
|
87
87
|
packages: ["ultracite"],
|
|
88
88
|
scopes: [],
|
|
89
89
|
},
|
|
@@ -95,7 +95,7 @@ export const families: ReadonlyArray<Family> = [
|
|
|
95
95
|
},
|
|
96
96
|
{
|
|
97
97
|
name: "effect-oxlint",
|
|
98
|
-
version: "0.
|
|
98
|
+
version: "0.5.1",
|
|
99
99
|
packages: ["effect-oxlint"],
|
|
100
100
|
scopes: [],
|
|
101
101
|
},
|
|
@@ -108,14 +108,14 @@ export const families: ReadonlyArray<Family> = [
|
|
|
108
108
|
];
|
|
109
109
|
|
|
110
110
|
export const fixed: ReadonlyArray<Fixed> = [
|
|
111
|
-
{ name: "oxlint", version: "1.
|
|
112
|
-
{ name: "@oxlint/plugins", version: "1.
|
|
113
|
-
{ name: "oxlint-tsgolint", version: "7.0.
|
|
114
|
-
{ name: "oxfmt", version: "0.
|
|
111
|
+
{ name: "oxlint", version: "1.93.0", by: "vite-plus" },
|
|
112
|
+
{ name: "@oxlint/plugins", version: "1.93.0", by: "vite-plus" },
|
|
113
|
+
{ name: "oxlint-tsgolint", version: "7.0.2006", by: "vite-plus" },
|
|
114
|
+
{ name: "oxfmt", version: "0.78.0", by: "vite-plus" },
|
|
115
115
|
{ name: "vitest", version: "5.1.0", by: "vite-plus" },
|
|
116
116
|
{
|
|
117
117
|
name: "vite",
|
|
118
|
-
version: "npm:@voidzero-dev/vite-plus-core@1.
|
|
118
|
+
version: "npm:@voidzero-dev/vite-plus-core@1.6.0",
|
|
119
119
|
by: "vite-plus",
|
|
120
120
|
},
|
|
121
121
|
];
|