@milkenjoyer/toolchain 0.19.0 → 0.21.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.
Files changed (55) hide show
  1. package/STARTS.md +5 -13
  2. package/dist/ci-budget-B2AuZ3xa.mjs +80 -0
  3. package/dist/ci-budget-cli.d.mts +2 -0
  4. package/dist/ci-budget-cli.mjs +31 -0
  5. package/dist/ci-budget.d.mts +22 -0
  6. package/dist/ci-budget.mjs +1 -0
  7. package/dist/ci-result.d.mts +1 -0
  8. package/dist/ci-result.mjs +12 -0
  9. package/dist/{compatible-DIYO9MZf.d.mts → compatible-BKEJ_p20.d.mts} +1 -1
  10. package/dist/{compatible-D54mCSlT.mjs → compatible-CRaMYpBM.mjs} +2 -2
  11. package/dist/compatible.d.mts +1 -1
  12. package/dist/compatible.mjs +1 -1
  13. package/dist/conformance.mjs +1 -1
  14. package/dist/{effect-plugin-BsrW5_nI.mjs → effect-plugin-BiskbKO9.mjs} +2 -2
  15. package/dist/effect-plugin.mjs +1 -1
  16. package/dist/foldkit-plugin.mjs +2 -2
  17. package/dist/formal.d.mts +1 -1
  18. package/dist/formal.mjs +5 -5
  19. package/dist/{guard-fFg_0NIp.mjs → guard-CAm90ZGy.mjs} +5 -5
  20. package/dist/guard.d.mts +1 -1
  21. package/dist/guard.mjs +1 -1
  22. package/dist/hooks.d.mts +1 -1
  23. package/dist/hooks.mjs +2 -2
  24. package/dist/{lint-BJ6SmGk1.mjs → lint-CiO5Etue.mjs} +3 -3
  25. package/dist/lint.mjs +1 -1
  26. package/dist/{plugin-CwxhPtui.mjs → plugin-DwQM07Ih.mjs} +2 -2
  27. package/dist/plugin.mjs +1 -1
  28. package/dist/proof.mjs +3 -3
  29. package/dist/renovate-ci-BdVmECgm.mjs +73 -0
  30. package/dist/renovate-ci.d.mts +10 -0
  31. package/dist/renovate-ci.mjs +1 -0
  32. package/dist/standard.mjs +6 -6
  33. package/dist/starts.d.mts +1 -110
  34. package/dist/starts.mjs +5 -351
  35. package/dist/verdict.d.mts +1 -1
  36. package/dist/verdict.mjs +2 -2
  37. package/dist/{verification-FgQFU1YN.d.mts → verification-fnhfrxmy.d.mts} +1 -1
  38. package/dist/verification.d.mts +1 -1
  39. package/dist/verification.mjs +1 -1
  40. package/dist/versions.mjs +1 -1
  41. package/package.json +11 -1
  42. package/renovate.json +29 -3
  43. package/src/ci-budget-cli.ts +39 -0
  44. package/src/ci-budget.ts +116 -0
  45. package/src/ci-result.ts +12 -0
  46. package/src/renovate-ci.ts +96 -0
  47. package/src/starts/policy.ts +5 -1
  48. package/src/starts.ts +0 -100
  49. package/src/starts/boat.ts +0 -144
  50. package/src/starts/budget.ts +0 -224
  51. package/src/starts/merges.ts +0 -99
  52. package/dist/{specs-file-NsQF4V7X.mjs → specs-file-Ck9ZOt46.mjs} +1 -1
  53. package/dist/{syntax-CGEOffZK.mjs → syntax-B3n7lDYJ.mjs} +1 -1
  54. package/dist/{verification-oAc1Q6I9.mjs → verification-D4Sn2fh5.mjs} +4 -4
  55. package/dist/{versions-DpRzgSR_.mjs → versions-KbYa8kbF.mjs} +1 -1
package/STARTS.md CHANGED
@@ -1,17 +1,9 @@
1
- # Boat start admission
1
+ # Boat workflow policy
2
2
 
3
- Pin `@milkenjoyer/toolchain` to `0.17.1`. Import `admitStart`, `BoatStarts`, `Merges` and `Repo` from `@milkenjoyer/toolchain/starts`. Wrap each create, fork or resume in `admitStart({ repo, jobs: 1, priority: "ordinary" }, start, { deadline })`. Priority is required and accepts `"ordinary"` or `"p0"`. Red main is p0. `Repo` validates an `owner/name`. `deadline` is an absolute epoch time in milliseconds. `start` is a lazy Effect that runs once after admission.
3
+ Pin `@milkenjoyer/toolchain` to `0.20.0`. Import `boatJobFindings` and `BOAT_JOBS_PER_RUN` from `@milkenjoyer/toolchain/starts`.
4
4
 
5
- Provide `BoatStarts.layer(key, { fetch? })` and `Merges.layer(githubToken, { fetch? })` with redacted credentials. Boat reads the key's default billing wallet. GitHub must see all four repos. Each optional `fetch` supplies that SDK's transport. The pure `decide(request, counts, now)` takes the current epoch time explicitly.
5
+ Pass every workflow as a `[path, text]` pair and add the returned findings to the repository's workflow policy. Each closure has at most two Boat jobs, 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 or unresolved graphs produce findings. Keep runner, timeout and concurrency checks.
6
6
 
7
- Each request counts as `jobs` in every live minute, hour and day window. A paid or unavailable next-start quote waits. Below 50% account use, every priority passes, subject to the account ceiling. From 50% to 80%, ordinary requests must fit the repo's share of an 80% pool. From 80% to 95%, only p0 passes. No request may exceed its account ceiling, rounded down to 80% for ordinary or 95% for p0, including the requested jobs.
7
+ `boatJobFindings` reports Boat jobs that start on `pull_request`, `pull_request_target` or PR-branch push. A `pull_request` trigger with a non-empty `types` list containing only `labeled` is exempt. Agent-requested CI uses that label event on the proven head.
8
8
 
9
- `startRepos` contains agent-kit, siglata/siglata, optionhouse-xyz/optionhouse and birbprophet/vibebattler. Each repo's share is `10% + 60% × weight / total weight`. Weight is `max(merges in 24h, 4 × merges in 6h, merges in 7 days / 7)` to main. All zero weights give each repo 25%. Each repo budget is `floor(share × 80% × window limit)`, computed with exact arithmetic. Merge and repo history are read only when an ordinary request faces at least 50% use in a window.
10
-
11
- `StartHeld.line` names the refusal. `Unread` means a read failed, history is incomplete or input is invalid. Read failures and incomplete histories retry until the deadline. Invalid plans, repos, jobs and timestamps hold immediately. `Paid` waits for a free quote. `Account` means the request exceeds its account ceiling and waits on minute or hour, or holds on day. `Budget` means the repo exceeds its live share and waits for the kth oldest start to leave the window. A request larger than its repo budget holds. Every wait polls fresh readings until the deadline, then fails `StartHeld` with the waiting line.
12
-
13
- Repo CI history counts a Boat job without `runStartedAt` as starting now unless Boat reports it settled or gives it a `finishedAt`. States the SDK does not list, such as `paused`, follow the same rule. A paused job that GitHub cancelled stops counting once Boat records its end. A start stamped after Boat answers counts at the answer's time. That history omits direct sandbox starts. Admission reserves nothing, so concurrent callers can race.
14
-
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
-
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.
9
+ CI requesting and its monthly spend cap use the Boat SDK directly. Direct probe creates and resumes require an explicit free next-start quote through the SDK. The starts module supplies workflow validation.
@@ -0,0 +1,80 @@
1
+ import * as Schema from "effect/Schema";
2
+ // src/ci-budget.ts
3
+ const Nonnegative = Schema.Finite.check(Schema.isGreaterThanOrEqualTo(0));
4
+ const Cost = Schema.Struct({
5
+ since: Schema.String,
6
+ dollars: Nonnegative
7
+ });
8
+ const Page = Schema.Struct({
9
+ sandboxes: Schema.Array(Schema.Struct({
10
+ id: Schema.String,
11
+ name: Schema.String,
12
+ cost: Cost
13
+ })),
14
+ deletedCost: Cost,
15
+ pageInfo: Schema.Struct({
16
+ hasMore: Schema.Boolean,
17
+ nextCursor: Schema.NullOr(Schema.String)
18
+ })
19
+ });
20
+ const monthlyCiBudget = (spend) => {
21
+ const dollars = Schema.decodeSync(Nonnegative)(spend.dollars);
22
+ const warning = dollars >= 160 ? `Boat CI month-to-date $${dollars.toFixed(2)} has reached 80% of the $200 monthly budget` : null;
23
+ return dollars >= 200 ? {
24
+ _tag: "Refused",
25
+ reason: `Boat CI month-to-date $${dollars.toFixed(2)} >= $200 monthly CI budget; no CI requested`,
26
+ since: spend.since,
27
+ dollars
28
+ } : {
29
+ _tag: "Allowed",
30
+ dollars,
31
+ warning
32
+ };
33
+ };
34
+ const readMonthlyCiSpend = async ({ boat, now }) => {
35
+ const since = new Date(Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), 1)).toISOString();
36
+ const monthly = boat.withPreMiddleware(({ url, init }) => {
37
+ const request = new URL(url);
38
+ request.searchParams.set("include", "cost,deletedCost");
39
+ return Promise.resolve({
40
+ url: request.href,
41
+ init
42
+ });
43
+ });
44
+ const ids = /* @__PURE__ */ new Set();
45
+ const cursors = /* @__PURE__ */ new Set();
46
+ let cursor;
47
+ let deletedDollars;
48
+ let dollars = 0;
49
+ for (;;) {
50
+ const response = await monthly.sandboxesRaw({
51
+ namePrefix: "ci-",
52
+ include: "cost",
53
+ limit: 200,
54
+ sort: "asc",
55
+ ...cursor === void 0 ? {} : { cursor }
56
+ });
57
+ const page = Schema.decodeUnknownSync(Page)(await response.raw.json());
58
+ if (page.deletedCost.since !== since || page.sandboxes.some(({ cost }) => cost.since !== since)) throw new Error("Monthly Boat CI meter changed month; read again");
59
+ if (deletedDollars !== void 0 && deletedDollars !== page.deletedCost.dollars) throw new Error("Monthly Boat CI deleted cost changed during pagination; read again");
60
+ deletedDollars = page.deletedCost.dollars;
61
+ for (const sandbox of page.sandboxes) {
62
+ if (!sandbox.name.startsWith("ci-") || ids.has(sandbox.id)) throw new Error("Monthly Boat CI page contains an unexpected or repeated sandbox");
63
+ ids.add(sandbox.id);
64
+ dollars += sandbox.cost.dollars;
65
+ }
66
+ if (!page.pageInfo.hasMore) break;
67
+ const next = page.pageInfo.nextCursor;
68
+ if (next === null || cursors.has(next)) throw new Error("Monthly Boat CI pagination is incomplete");
69
+ cursors.add(next);
70
+ cursor = next;
71
+ }
72
+ return {
73
+ since,
74
+ readAt: now.toISOString(),
75
+ dollars: Schema.decodeSync(Nonnegative)(dollars + deletedDollars),
76
+ deletedDollars,
77
+ sandboxes: ids.size
78
+ };
79
+ };
80
+ export { readMonthlyCiSpend as n, monthlyCiBudget as t };
@@ -0,0 +1,2 @@
1
+ import * as Effect from "effect/Effect";
2
+ export declare const checkCiBudget: Effect.Effect<number, never, never>;
@@ -0,0 +1,31 @@
1
+ #!/usr/bin/env bun
2
+ import { n as readMonthlyCiSpend, t as monthlyCiBudget } from "./ci-budget-B2AuZ3xa.mjs";
3
+ import { BoatApi, Configuration } from "@boatdev/sdk";
4
+ import * as Config from "effect/Config";
5
+ import * as Console from "effect/Console";
6
+ import * as DateTime from "effect/DateTime";
7
+ import * as Effect from "effect/Effect";
8
+ import * as Redacted from "effect/Redacted";
9
+ import * as Schema from "effect/Schema";
10
+ // src/ci-budget-cli.ts
11
+ var CiMeterUnread = class extends Schema.TaggedError()("CiMeterUnread", {}) {};
12
+ const checkCiBudget = Effect.gen(function* () {
13
+ const key = yield* Config.Redacted("BOAT_API_KEY");
14
+ const boat = new BoatApi(new Configuration({ accessToken: Redacted.value(key) }));
15
+ const now = yield* DateTime.nowAsDate;
16
+ const spend = yield* Effect.tryPromise({
17
+ try: () => readMonthlyCiSpend({
18
+ boat,
19
+ now
20
+ }),
21
+ catch: () => new CiMeterUnread()
22
+ });
23
+ const budget = monthlyCiBudget(spend);
24
+ yield* Console.log({
25
+ ...budget,
26
+ spend
27
+ });
28
+ return budget._tag === "Allowed" ? 0 : 1;
29
+ }).pipe(Effect.catch(() => Effect.as(Console.error("Boat CI monthly meter unread; no Boat job admitted"), 1)));
30
+ if (import.meta.main) process.exitCode = await Effect.runPromise(checkCiBudget);
31
+ export { checkCiBudget };
@@ -0,0 +1,22 @@
1
+ import { BoatApi } from "@boatdev/sdk";
2
+ export type MonthlyCiSpend = {
3
+ readonly since: string;
4
+ readonly readAt: string;
5
+ readonly dollars: number;
6
+ readonly deletedDollars: number;
7
+ readonly sandboxes: number;
8
+ };
9
+ export declare const monthlyCiBudget: (spend: MonthlyCiSpend) => {
10
+ readonly _tag: "Refused";
11
+ readonly reason: string;
12
+ readonly since: string;
13
+ readonly dollars: number;
14
+ } | {
15
+ readonly _tag: "Allowed";
16
+ readonly dollars: number;
17
+ readonly warning: string | null;
18
+ };
19
+ export declare const readMonthlyCiSpend: ({ boat, now }: {
20
+ readonly boat: BoatApi;
21
+ readonly now: Date;
22
+ }) => Promise<MonthlyCiSpend>;
@@ -0,0 +1 @@
1
+ export { t as monthlyCiBudget, n as readMonthlyCiSpend } from "./ci-budget-B2AuZ3xa.mjs";
@@ -0,0 +1 @@
1
+ export {}
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env bun
2
+ import * as Config from "effect/Config";
3
+ import * as Console from "effect/Console";
4
+ import * as Effect from "effect/Effect";
5
+ // src/ci-result.ts
6
+ const result = Effect.gen(function* () {
7
+ const checks = yield* Config.String("CI_RESULT");
8
+ yield* Console.log(`Ready checks: ${checks}`);
9
+ return checks === "success" ? 0 : 1;
10
+ }).pipe(Effect.orElseSucceed(() => 1));
11
+ if (import.meta.main) process.exitCode = await Effect.runPromise(result);
12
+ export {};
@@ -1,7 +1,7 @@
1
1
  import { n as Family, t as Catalog } from "./versions-DqZd0jF9.mjs";
2
+ import * as Schema from "effect/Schema";
2
3
  import * as Data from "effect/Data";
3
4
  import * as Option from "effect/Option";
4
- import * as Schema from "effect/Schema";
5
5
  declare const VersionManifest: Schema.Struct<{
6
6
  readonly dependencies: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
7
7
  readonly peerDependencies: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
@@ -1,4 +1,5 @@
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";
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-KbYa8kbF.mjs";
2
+ import * as Schema from "effect/Schema";
2
3
  import * as Arr from "effect/Array";
3
4
  import * as Data from "effect/Data";
4
5
  import { dual } from "effect/Function";
@@ -6,7 +7,6 @@ import * as HashSet from "effect/HashSet";
6
7
  import * as Match from "effect/Match";
7
8
  import * as Option from "effect/Option";
8
9
  import * as R from "effect/Record";
9
- import * as Schema from "effect/Schema";
10
10
  import * as Str from "effect/String";
11
11
  import semver from "semver";
12
12
  // src/compatible.ts
@@ -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-DIYO9MZf.mjs";
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-BKEJ_p20.mjs";
2
2
  export { Conflict, Packument, Packuments, Solution, VersionManifest, aliasTarget, conflicts, describeConflict, fixedRange, latestOf, onLatestLine, otherTags, solve };
@@ -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-D54mCSlT.mjs";
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-CRaMYpBM.mjs";
@@ -1,7 +1,7 @@
1
1
  import { n as readTraces, r as receiptPath, t as FORMAL_TRACES } from "./trace-file-KuPRWgwt.mjs";
2
- import { readFileSync, writeFileSync } from "node:fs";
3
2
  import * as Config from "effect/Config";
4
3
  import * as Effect from "effect/Effect";
4
+ import { readFileSync, writeFileSync } from "node:fs";
5
5
  import { afterAll, expect, test } from "vite-plus/test";
6
6
  // src/conformance.ts
7
7
  const replayTraces = (name, start) => {
@@ -1,8 +1,8 @@
1
- import { n as memberPropertyName } from "./syntax-CGEOffZK.mjs";
1
+ import { n as memberPropertyName } from "./syntax-B3n7lDYJ.mjs";
2
+ import * as Effect from "effect/Effect";
2
3
  import * as Arr from "effect/Array";
3
4
  import * as Option from "effect/Option";
4
5
  import * as R from "effect/Record";
5
- import * as Effect from "effect/Effect";
6
6
  import upstream from "@mpsuesser/oxlint-plugin-effect";
7
7
  import { Diagnostic, Rule, RuleContext } from "effect-oxlint";
8
8
  // src/rules/use-temp-file-scoped.ts
@@ -1 +1 @@
1
- export { t as default } from "./effect-plugin-BsrW5_nI.mjs";
1
+ export { t as default } from "./effect-plugin-BiskbKO9.mjs";
@@ -1,8 +1,8 @@
1
+ import * as Effect from "effect/Effect";
2
+ import * as Schema from "effect/Schema";
1
3
  import * as Arr from "effect/Array";
2
4
  import * as R from "effect/Record";
3
- import * as Schema from "effect/Schema";
4
5
  import { existsSync, readFileSync } from "node:fs";
5
- import * as Effect from "effect/Effect";
6
6
  import { dirname, join } from "node:path";
7
7
  import upstream from "@foldkit/oxlint-plugin";
8
8
  // src/foldkit-plugin.ts
package/dist/formal.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import * as Schema from "effect/Schema";
2
1
  import * as Effect from "effect/Effect";
2
+ import * as Schema from "effect/Schema";
3
3
  import * as Layer from "effect/Layer";
4
4
  import { ChildProcessSpawner } from "effect/process";
5
5
  import { FileSystem } from "effect/FileSystem";
package/dist/formal.mjs CHANGED
@@ -1,15 +1,15 @@
1
1
  #!/usr/bin/env bun
2
- import { n as criticalFindings, t as decode } from "./specs-file-NsQF4V7X.mjs";
2
+ import { n as criticalFindings, t as decode } from "./specs-file-Ck9ZOt46.mjs";
3
3
  import { i as sorted, r as receiptPath, t as FORMAL_TRACES } from "./trace-file-KuPRWgwt.mjs";
4
- import * as Data from "effect/Data";
5
- import * as Option from "effect/Option";
6
- import * as Schema from "effect/Schema";
7
4
  import * as Config from "effect/Config";
5
+ import * as Console from "effect/Console";
8
6
  import * as Effect from "effect/Effect";
7
+ import * as Schema from "effect/Schema";
8
+ import * as Data from "effect/Data";
9
+ import * as Option from "effect/Option";
9
10
  import { basename, dirname, join, relative } from "node:path";
10
11
  import { NodeServices } from "@effect/platform-node";
11
12
  import * as Cause from "effect/Cause";
12
- import * as Console from "effect/Console";
13
13
  import * as Exit from "effect/Exit";
14
14
  import * as Layer from "effect/Layer";
15
15
  import { ChildProcess, ChildProcessSpawner } from "effect/process";
@@ -1,16 +1,16 @@
1
- import { d as otherTags, l as latestOf, u as onLatestLine } from "./compatible-D54mCSlT.mjs";
1
+ import { d as otherTags, l as latestOf, u as onLatestLine } from "./compatible-CRaMYpBM.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-BJ6SmGk1.mjs";
5
- import { c as lead, f as versionOf } from "./versions-DpRzgSR_.mjs";
4
+ import { a as toolchainScopes, n as effectRules, r as foldkitPreset, t as birbprophetRules } from "./lint-CiO5Etue.mjs";
5
+ import { c as lead, f as versionOf } from "./versions-KbYa8kbF.mjs";
6
+ import * as Effect from "effect/Effect";
7
+ import * as Schema from "effect/Schema";
6
8
  import * as Arr from "effect/Array";
7
9
  import { dual } from "effect/Function";
8
10
  import * as HashSet from "effect/HashSet";
9
11
  import * as Option from "effect/Option";
10
12
  import * as R from "effect/Record";
11
- import * as Schema from "effect/Schema";
12
13
  import * as Str from "effect/String";
13
- import * as Effect from "effect/Effect";
14
14
  import * as Result from "effect/Result";
15
15
  // src/standard/manifest.ts
16
16
  const Versions = Schema.Record(Schema.String, Schema.String).pipe(Schema.withDecodingDefaultKey(Effect.succeed({})));
package/dist/guard.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { r as Packuments } from "./compatible-DIYO9MZf.mjs";
1
+ import { r as Packuments } from "./compatible-BKEJ_p20.mjs";
2
2
  import { t as Exception } from "./exceptions-LNZ022dl.mjs";
3
3
  import { t as Catalog } from "./versions-DqZd0jF9.mjs";
4
4
  import { OxlintConfig } from "vite-plus/lint";
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-fFg_0NIp.mjs";
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-CAm90ZGy.mjs";
package/dist/hooks.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import * as Schema from "effect/Schema";
2
1
  import * as Effect from "effect/Effect";
2
+ import * as Schema from "effect/Schema";
3
3
  import { FileSystem } from "effect/FileSystem";
4
4
  import { Path } from "effect/Path";
5
5
  export declare const worktreePrePush = "#!/bin/sh\nif ! root=$(git rev-parse --show-toplevel); then\n printf '%s\\n' 'pre-push: could not determine the invoking worktree root' >&2\n exit 1\nfi\nif [ ! -f \"$root/node_modules/.bin/vp\" ] || [ ! -x \"$root/node_modules/.bin/vp\" ]; then\n printf '%s\\n' \"pre-push: missing or nonexecutable $root/node_modules/.bin/vp\" >&2\n exit 1\nfi\nif [ ! -f \"$root/.vite-hooks/pre-push\" ]; then\n printf '%s\\n' \"pre-push: missing $root/.vite-hooks/pre-push\" >&2\n exit 1\nfi\nif ! git -C \"$root\" ls-files --error-unmatch .vite-hooks/pre-push >/dev/null 2>&1; then\n printf '%s\\n' \"pre-push: untracked $root/.vite-hooks/pre-push\" >&2\n exit 1\nfi\nexport PATH=\"$root/node_modules/.bin:$PATH\"\nexec /bin/sh -e \"$root/.vite-hooks/pre-push\" \"$@\"\n";
package/dist/hooks.mjs CHANGED
@@ -1,7 +1,7 @@
1
- import * as Arr from "effect/Array";
1
+ import * as Effect from "effect/Effect";
2
2
  import * as Schema from "effect/Schema";
3
+ import * as Arr from "effect/Array";
3
4
  import * as Str from "effect/String";
4
- import * as Effect from "effect/Effect";
5
5
  import { ChildProcess } from "effect/process";
6
6
  import * as Stream from "effect/Stream";
7
7
  import { FileSystem } from "effect/FileSystem";
@@ -1,12 +1,12 @@
1
- import { t as plugin } from "./effect-plugin-BsrW5_nI.mjs";
1
+ import { t as plugin } from "./effect-plugin-BiskbKO9.mjs";
2
2
  import { n as effectTsgoPlugin, r as effectTsgoRules } from "./effect-tsgo-D0QfeKGD.mjs";
3
3
  import { t as exceptions } from "./exceptions-Dybl9xpc.mjs";
4
- import { t as plugin$1 } from "./plugin-CwxhPtui.mjs";
4
+ import { t as plugin$1 } from "./plugin-DwQM07Ih.mjs";
5
5
  import { t as staticRules } from "./rules-vHmNoAU0.mjs";
6
+ import * as Schema from "effect/Schema";
6
7
  import * as Arr from "effect/Array";
7
8
  import * as Option from "effect/Option";
8
9
  import * as R from "effect/Record";
9
- import * as Schema from "effect/Schema";
10
10
  import * as Str from "effect/String";
11
11
  import foldkitRecommended from "@foldkit/oxlint-plugin/recommended.json" with { type: "json" };
12
12
  import ultraciteCore from "ultracite/oxlint/core";
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-BJ6SmGk1.mjs";
1
+ export { t as birbprophetRules, n as effectRules, r as foldkitPreset, i as lint, a as toolchainScopes } from "./lint-CiO5Etue.mjs";
@@ -1,10 +1,10 @@
1
- import { i as unwrapExpression, n as memberPropertyName, r as propertyName, t as isStringLiteral } from "./syntax-CGEOffZK.mjs";
1
+ import { i as unwrapExpression, n as memberPropertyName, r as propertyName, t as isStringLiteral } from "./syntax-B3n7lDYJ.mjs";
2
+ import * as Effect from "effect/Effect";
2
3
  import * as Arr from "effect/Array";
3
4
  import { dual } from "effect/Function";
4
5
  import * as HashSet from "effect/HashSet";
5
6
  import * as Option from "effect/Option";
6
7
  import * as Str from "effect/String";
7
- import * as Effect from "effect/Effect";
8
8
  import { Comment, Diagnostic, Plugin, Rule, RuleContext } from "effect-oxlint";
9
9
  import * as HashMap from "effect/HashMap";
10
10
  // src/rules/no-comments.ts
package/dist/plugin.mjs CHANGED
@@ -1 +1 @@
1
- export { t as default } from "./plugin-CwxhPtui.mjs";
1
+ export { t as default } from "./plugin-DwQM07Ih.mjs";
package/dist/proof.mjs CHANGED
@@ -1,8 +1,9 @@
1
1
  #!/usr/bin/env bun
2
- import * as Data from "effect/Data";
3
- import * as Schema from "effect/Schema";
4
2
  import * as Config from "effect/Config";
5
3
  import * as Effect from "effect/Effect";
4
+ import * as Redacted from "effect/Redacted";
5
+ import * as Schema from "effect/Schema";
6
+ import * as Data from "effect/Data";
6
7
  import { NodeServices } from "@effect/platform-node";
7
8
  import * as Cause from "effect/Cause";
8
9
  import * as Exit from "effect/Exit";
@@ -12,7 +13,6 @@ import { FileSystem } from "effect/FileSystem";
12
13
  import { Path } from "effect/Path";
13
14
  import { Octokit } from "@octokit/rest";
14
15
  import { Base64 } from "effect/encoding";
15
- import * as Redacted from "effect/Redacted";
16
16
  // src/proof.ts
17
17
  var ProofError = class extends Data.TaggedError("ProofError") {};
18
18
  const kinds = /* @__PURE__ */ new Map([
@@ -0,0 +1,73 @@
1
+ import * as Schema from "effect/Schema";
2
+ import { parse } from "yaml";
3
+ // src/renovate-ci.ts
4
+ const headRequest = "github.event.action == 'labeled' && github.event.label.name == format('ready:{0}', github.event.pull_request.head.sha)";
5
+ const renovateRequest = "github.event.action != 'labeled' && github.event.pull_request.user.login == 'renovate[bot]' && github.event.pull_request.head.repo.full_name == github.repository";
6
+ const readyRequest = `github.event_name == 'push' || (github.event.pull_request.draft == false && !startsWith(github.head_ref, 'probe/') && ((${headRequest}) || (${renovateRequest})))`;
7
+ const budgetRequest = `github.event_name == 'pull_request' && github.event.pull_request.draft == false && (${renovateRequest})`;
8
+ const checksRequest = `always() && (${readyRequest}) && (needs.budget.result == 'success' || needs.budget.result == 'skipped')`;
9
+ const resultRequest = `always() && (${readyRequest})`;
10
+ const readyGroup = `\${{ github.workflow }}-\${{ github.event_name == 'pull_request' && !((${headRequest}) || (${renovateRequest})) && format('label-{0}-{1}', github.event.pull_request.number, github.event.label.name) || github.event.pull_request.number || github.ref }}`;
11
+ const readyCancellation = `\${{ github.event_name == 'pull_request' && ((${headRequest}) || (${renovateRequest})) }}`;
12
+ const readyRunName = `\${{ github.event_name == 'push' && format('ready {0} at {1}', github.ref_name, github.sha) || ((${headRequest}) || (${renovateRequest})) && format('ready #{0} at {1}', github.event.pull_request.number, github.event.pull_request.head.sha) || format('label {0} on #{1}', github.event.label.name, github.event.pull_request.number) }}`;
13
+ const BudgetStep = Schema.Struct({
14
+ if: Schema.optionalKey(Schema.Never),
15
+ "continue-on-error": Schema.optionalKey(Schema.Literal(false)),
16
+ run: Schema.Literal("vp exec ci-budget"),
17
+ env: Schema.Struct({ BOAT_API_KEY: Schema.Literal(`\${{ secrets.BOAT_CI_READ_KEY }}`) })
18
+ });
19
+ const ResultStep = Schema.Struct({
20
+ if: Schema.optionalKey(Schema.Never),
21
+ "continue-on-error": Schema.optionalKey(Schema.Literal(false)),
22
+ run: Schema.Literal("vp exec ci-result"),
23
+ env: Schema.Struct({ CI_RESULT: Schema.Literal(`\${{ needs.checks.result }}`) })
24
+ });
25
+ const Workflow = Schema.Struct({
26
+ on: Schema.Struct({
27
+ push: Schema.Struct({ branches: Schema.Array(Schema.String) }),
28
+ pull_request: Schema.Struct({ types: Schema.Array(Schema.String) })
29
+ }),
30
+ concurrency: Schema.Struct({
31
+ group: Schema.Literal(readyGroup),
32
+ "cancel-in-progress": Schema.Literal(readyCancellation)
33
+ }),
34
+ jobs: Schema.Struct({
35
+ budget: Schema.Struct({
36
+ "continue-on-error": Schema.optionalKey(Schema.Literal(false)),
37
+ if: Schema.Literal(budgetRequest),
38
+ "runs-on": Schema.Literal("ubuntu-24.04"),
39
+ steps: Schema.Array(Schema.Unknown)
40
+ }),
41
+ checks: Schema.Struct({
42
+ "continue-on-error": Schema.optionalKey(Schema.Literal(false)),
43
+ needs: Schema.Literal("budget"),
44
+ if: Schema.Literal(checksRequest)
45
+ }),
46
+ ready: Schema.Struct({
47
+ "continue-on-error": Schema.optionalKey(Schema.Literal(false)),
48
+ needs: Schema.Array(Schema.String),
49
+ if: Schema.Literal(resultRequest),
50
+ "runs-on": Schema.Literal("ubuntu-24.04"),
51
+ steps: Schema.Array(Schema.Unknown)
52
+ })
53
+ })
54
+ });
55
+ const Layout = Schema.Struct({
56
+ on: Schema.Record(Schema.String, Schema.Unknown),
57
+ jobs: Schema.Record(Schema.String, Schema.Unknown)
58
+ });
59
+ const MainOnlyJob = Schema.Struct({ if: Schema.Literal("github.event_name == 'push'") });
60
+ const isRenovateCi = (text) => {
61
+ const parsed = parse(text);
62
+ const decoded = Schema.decodeUnknownOption(Workflow)(parsed);
63
+ if (decoded._tag === "None") return false;
64
+ const layout = Schema.decodeUnknownSync(Layout)(parsed);
65
+ const push = Schema.decodeUnknownSync(Schema.Record(Schema.String, Schema.Unknown))(layout.on.push);
66
+ const workflow = decoded.value;
67
+ return Object.keys(layout.on).toSorted().join(",") === "pull_request,push" && Object.keys(push).join(",") === "branches" && workflow.on.push.branches.join(",") === "main" && Object.entries(layout.jobs).every(([name, job]) => [
68
+ "budget",
69
+ "checks",
70
+ "ready"
71
+ ].includes(name) || Schema.is(MainOnlyJob)(job)) && workflow.on.pull_request.types.join(",") === "labeled,opened,synchronize,reopened,ready_for_review" && workflow.jobs.ready.needs.join(",") === "budget,checks" && workflow.jobs.budget.steps.some(Schema.is(BudgetStep)) && workflow.jobs.ready.steps.some(Schema.is(ResultStep));
72
+ };
73
+ export { readyCancellation as a, readyRunName as c, isRenovateCi as i, renovateRequest as l, checksRequest as n, readyGroup as o, headRequest as r, readyRequest as s, budgetRequest as t, resultRequest as u };
@@ -0,0 +1,10 @@
1
+ export declare const headRequest = "github.event.action == 'labeled' && github.event.label.name == format('ready:{0}', github.event.pull_request.head.sha)";
2
+ export declare const renovateRequest = "github.event.action != 'labeled' && github.event.pull_request.user.login == 'renovate[bot]' && github.event.pull_request.head.repo.full_name == github.repository";
3
+ export declare const readyRequest = "github.event_name == 'push' || (github.event.pull_request.draft == false && !startsWith(github.head_ref, 'probe/') && ((github.event.action == 'labeled' && github.event.label.name == format('ready:{0}', github.event.pull_request.head.sha)) || (github.event.action != 'labeled' && github.event.pull_request.user.login == 'renovate[bot]' && github.event.pull_request.head.repo.full_name == github.repository)))";
4
+ export declare const budgetRequest = "github.event_name == 'pull_request' && github.event.pull_request.draft == false && (github.event.action != 'labeled' && github.event.pull_request.user.login == 'renovate[bot]' && github.event.pull_request.head.repo.full_name == github.repository)";
5
+ export declare const checksRequest = "always() && (github.event_name == 'push' || (github.event.pull_request.draft == false && !startsWith(github.head_ref, 'probe/') && ((github.event.action == 'labeled' && github.event.label.name == format('ready:{0}', github.event.pull_request.head.sha)) || (github.event.action != 'labeled' && github.event.pull_request.user.login == 'renovate[bot]' && github.event.pull_request.head.repo.full_name == github.repository)))) && (needs.budget.result == 'success' || needs.budget.result == 'skipped')";
6
+ export declare const resultRequest = "always() && (github.event_name == 'push' || (github.event.pull_request.draft == false && !startsWith(github.head_ref, 'probe/') && ((github.event.action == 'labeled' && github.event.label.name == format('ready:{0}', github.event.pull_request.head.sha)) || (github.event.action != 'labeled' && github.event.pull_request.user.login == 'renovate[bot]' && github.event.pull_request.head.repo.full_name == github.repository))))";
7
+ export declare const readyGroup = "${{ github.workflow }}-${{ github.event_name == 'pull_request' && !((github.event.action == 'labeled' && github.event.label.name == format('ready:{0}', github.event.pull_request.head.sha)) || (github.event.action != 'labeled' && github.event.pull_request.user.login == 'renovate[bot]' && github.event.pull_request.head.repo.full_name == github.repository)) && format('label-{0}-{1}', github.event.pull_request.number, github.event.label.name) || github.event.pull_request.number || github.ref }}";
8
+ export declare const readyCancellation = "${{ github.event_name == 'pull_request' && ((github.event.action == 'labeled' && github.event.label.name == format('ready:{0}', github.event.pull_request.head.sha)) || (github.event.action != 'labeled' && github.event.pull_request.user.login == 'renovate[bot]' && github.event.pull_request.head.repo.full_name == github.repository)) }}";
9
+ export declare const readyRunName = "${{ github.event_name == 'push' && format('ready {0} at {1}', github.ref_name, github.sha) || ((github.event.action == 'labeled' && github.event.label.name == format('ready:{0}', github.event.pull_request.head.sha)) || (github.event.action != 'labeled' && github.event.pull_request.user.login == 'renovate[bot]' && github.event.pull_request.head.repo.full_name == github.repository)) && format('ready #{0} at {1}', github.event.pull_request.number, github.event.pull_request.head.sha) || format('label {0} on #{1}', github.event.label.name, github.event.pull_request.number) }}";
10
+ export declare const isRenovateCi: (text: string) => boolean;
@@ -0,0 +1 @@
1
+ export { t as budgetRequest, n as checksRequest, r as headRequest, i as isRenovateCi, a as readyCancellation, o as readyGroup, s as readyRequest, c as readyRunName, l as renovateRequest, u as resultRequest } from "./renovate-ci-BdVmECgm.mjs";
package/dist/standard.mjs CHANGED
@@ -1,17 +1,17 @@
1
1
  #!/usr/bin/env bun
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";
2
+ import { f as versionOf } from "./versions-KbYa8kbF.mjs";
3
+ import { a as ruleFindings, c as exactFindings, l as manifestRanges, s as PLAIN, u as resolveCatalog } from "./guard-CAm90ZGy.mjs";
4
4
  import { t as fmt } from "./fmt-C6autuPP.mjs";
5
- import { n as criticalFindings, t as decode } from "./specs-file-NsQF4V7X.mjs";
5
+ import { n as criticalFindings, t as decode } from "./specs-file-Ck9ZOt46.mjs";
6
+ import * as Console from "effect/Console";
7
+ import * as Effect from "effect/Effect";
8
+ import * as Schema from "effect/Schema";
6
9
  import * as Arr from "effect/Array";
7
10
  import * as Option from "effect/Option";
8
11
  import * as R from "effect/Record";
9
- import * as Schema from "effect/Schema";
10
- import * as Effect from "effect/Effect";
11
12
  import { posix } from "node:path";
12
13
  import { NodeServices } from "@effect/platform-node";
13
14
  import * as Cause from "effect/Cause";
14
- import * as Console from "effect/Console";
15
15
  import * as Exit from "effect/Exit";
16
16
  import { ChildProcess } from "effect/process";
17
17
  import * as Stream from "effect/Stream";