@theholocron/astromech 5.0.0-alpha.520 → 5.0.0-alpha.522

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 CHANGED
@@ -223,6 +223,17 @@ the coverage entries. Astromech imports no provider, so a `coverage` provider's
223
223
  `holocron sync` writes it only in the repo that contains the reusables. The ids are today's check names; the later
224
224
  rename changes them here and costs no ruleset edit.
225
225
 
226
+ `evaluateAggregate({ expected, statuses, checkRuns, commitStatuses, now, startedAt, timeoutMs, incomplete? })` is the verdict itself
227
+ as a pure function (SPEC-0099, phase 1): the newest run of each check name counts (#2171), an expected id needs a run named
228
+ `<id> / ...`, a status context is a check run named like it else a commit status, and `success`, `skipped` and `neutral`
229
+ pass. It returns `{ conclusion: "pending" | "success" | "failure", rows, summary, annotations }`. `pending` lasts until
230
+ `startedAt + timeoutMs`; at the deadline running and missing rows become failures. It has no clock, network or GitHub types
231
+ and fails closed: an empty `expected`, an `incomplete` read (a truncated list, a failed request) or a clock that cannot be read
232
+ never gives `success`. Nothing calls it yet: the reusable `ci.yml` still polls with a jq program, and
233
+ `evaluate-aggregate.conformance.test.ts` runs that exact program and the function over the same fixtures and fails if their
234
+ verdicts differ (it needs `jq`; CI has it, and without `jq` or `CI` it skips). One deliberate difference: the jq passes an empty
235
+ `expected` list, the function does not.
236
+
226
237
  ### `codecov.yml`
227
238
 
228
239
  Astromech no longer writes `codecov.yml`: the `coverage` provider does, through its optional `Coverage.configFiles()`
@@ -3,7 +3,7 @@
3
3
  * zero-runtime-dep entry so `astromech.config.ts` and `@theholocron/cli`
4
4
  * can import it without pulling the task runner.
5
5
  */
6
- import { n as TaskEntry, r as TasksConfig, t as TaskConfigItem } from "../schema.type-Cg6I1dCc.mjs";
6
+ import { a as TaskEntry, i as TaskConfigItem, n as CiConfig, o as TasksConfig, r as CiPin, t as CiAggregatePoster } from "../schema.type-CGJuQMKD.mjs";
7
7
  import { Loaded } from "@theholocron/datapad";
8
8
  /**
9
9
  * The `tasks` config shape — the single manifest of what a repo runs.
@@ -65,4 +65,4 @@ export declare const defineConfig: <C extends TasksConfig>(config: C) => C;
65
65
  * `[]` for a repo that releases as one.
66
66
  */
67
67
  export declare function releaseGroups(config: Pick<TasksConfig, "tasks">): string[];
68
- export type { TaskConfigItem, TaskEntry, TasksConfig, TasksInput };
68
+ export type { CiAggregatePoster, CiConfig, CiPin, TaskConfigItem, TaskEntry, TasksConfig, TasksInput };
@@ -1,4 +1,4 @@
1
- import { n as coerceTasks, r as isTask, t as loadTasksConfig, u as normalizeTaskEntry } from "../load-PgZbUPyW.mjs";
1
+ import { n as coerceTasks, r as isTask, t as loadTasksConfig, u as normalizeTaskEntry } from "../load-ByvVLKLw.mjs";
2
2
  import { createDefineConfig } from "@theholocron/datapad";
3
3
  // src/config/define/define.ts
4
4
  /**
package/dist/index.d.mts CHANGED
@@ -20,7 +20,187 @@
20
20
  * The config surface (`defineConfig`, `TasksConfig`, `loadTasksConfig`)
21
21
  * lives in the zero-runtime-dep `@theholocron/astromech/config` subpath.
22
22
  */
23
- import { r as TasksConfig } from "./schema.type-Cg6I1dCc.mjs";
23
+ import { o as TasksConfig, t as CiAggregatePoster } from "./schema.type-CGJuQMKD.mjs";
24
+ /** A check run on the head commit, in the plain shape the aggregate needs (no GitHub types). */
25
+ interface AggregateCheckRun {
26
+ /** The check run's id, `null` when the API gave none; the tie-break when two runs started together. */
27
+ id: number | null;
28
+ /** The check run's name, such as `test:unit / Conclusion`. */
29
+ name: string;
30
+ /** `completed`, or anything else (`queued`, `in_progress`) for a run that is still going. */
31
+ status: string;
32
+ /** The run's conclusion; `null` while it is not completed. */
33
+ conclusion: string | null;
34
+ /** ISO 8601 time the run started, `null` when GitHub has not set one. */
35
+ startedAt: string | null;
36
+ /** A link to the run, `null` when there is none. */
37
+ url: string | null;
38
+ /** The slug of the app that posted the run (`github-actions` for a workflow's), `null` or absent when unknown. */
39
+ appSlug?: string | null;
40
+ }
41
+ /** A commit status on the head commit. */
42
+ interface AggregateCommitStatus {
43
+ /** The status context, such as `codecov/patch`. */
44
+ context: string;
45
+ /** `success`, `pending`, `failure` or `error`. */
46
+ state: string;
47
+ /** A link to the status, `null` when there is none. */
48
+ url: string | null;
49
+ }
50
+ /** Everything {@link evaluateAggregate} reads. All of it comes from the API, never from a webhook payload. */
51
+ interface EvaluateAggregateInput {
52
+ /** Check ids: each needs a check run named `<id> / ...`. */
53
+ expected: string[];
54
+ /** Contexts that must reach success, as a check run named like the context, else as a commit status. */
55
+ statuses: string[];
56
+ /** Every check run on the commit, any order and any number per name. */
57
+ checkRuns: AggregateCheckRun[];
58
+ /** The commit statuses, newest first as the API returns them; the first match for a context counts. */
59
+ commitStatuses: AggregateCommitStatus[];
60
+ /** The current time in epoch milliseconds. */
61
+ now: number;
62
+ /** When the aggregate began waiting for this commit, in epoch milliseconds. */
63
+ startedAt: number;
64
+ /** How long to wait before a pending or missing check becomes a failure. */
65
+ timeoutMs: number;
66
+ /**
67
+ * Set when the state could not be read in full (the list was truncated, a read failed): the reason. The result is
68
+ * then never `success`.
69
+ */
70
+ incomplete?: string;
71
+ }
72
+ /** One line of the aggregate: an expected check id or a status context. */
73
+ interface AggregateRow {
74
+ /** The expected check id or the status context. */
75
+ id: string;
76
+ /** `check` for an expected id, `status` for a status context, `config` for a problem with the inputs. */
77
+ kind: "check" | "status" | "config";
78
+ /** Where the row stands; `missing` means nothing has posted it yet. */
79
+ state: "success" | "failure" | "pending" | "missing";
80
+ /** What the check said: its conclusion, `still running`, `never posted`, ... */
81
+ detail: string;
82
+ /** A link to the check or status, `null` when there is none. */
83
+ url: string | null;
84
+ }
85
+ /** One error line for a failing row. */
86
+ interface AggregateAnnotation {
87
+ /** The id of the row that failed. */
88
+ title: string;
89
+ /** What the row said, with its link. */
90
+ message: string;
91
+ }
92
+ /** The verdict. `pending` means "ask again later"; only `success` lets a pull request merge. */
93
+ interface AggregateResult {
94
+ /** `success` only when every row passed; `pending` while a row can still change. */
95
+ conclusion: "pending" | "success" | "failure";
96
+ /** Every row, in the order the inputs list them (config problems first). */
97
+ rows: AggregateRow[];
98
+ /** The failing-first table of every row, as Markdown. */
99
+ summary: string;
100
+ /** One entry for each row that is not a success. */
101
+ annotations: AggregateAnnotation[];
102
+ }
103
+ /**
104
+ * Decides the `ci` aggregate check for one commit from the state read from the API.
105
+ *
106
+ * Pure: no clock, no network, no GitHub types. It fails closed: `success` only when every expected id and every status
107
+ * context is satisfied, so an empty `expected`, an `incomplete` read or an unreadable clock never yields `success`.
108
+ * `pending` means a check is still running or has not posted and the deadline (`startedAt + timeoutMs`) has not passed;
109
+ * at the deadline pending and missing rows become failures.
110
+ */
111
+ export declare function evaluateAggregate(input: EvaluateAggregateInput): AggregateResult;
112
+ /** The name of the aggregate check run, the one context the ruleset requires. */
113
+ export declare const AGGREGATE_CHECK_NAME = "ci / Required checks";
114
+ /** The name Sentinel posts the aggregate under while it runs beside the Actions poller (the shadow), which nothing requires. */
115
+ export declare const AGGREGATE_SHADOW_CHECK_NAME = "ci / Required checks (sentinel)";
116
+ /** How long the aggregate waits for a check that has not finished or not posted, as the polling job does. */
117
+ export declare const AGGREGATE_TIMEOUT_MS: number;
118
+ /** What one write puts on the aggregate check run. */
119
+ interface AggregateWrite {
120
+ /** `in_progress` while a check can still change, `completed` once the verdict is final. */
121
+ status: "in_progress" | "completed";
122
+ /** The verdict; only set when `status` is `completed`. */
123
+ conclusion?: "success" | "failure" | "neutral";
124
+ /** The check run's title. */
125
+ title: string;
126
+ /** The failing-first Markdown table. */
127
+ summary: string;
128
+ /** One line per failing row, for the run's details; empty when nothing failed. */
129
+ text: string;
130
+ /** ISO time the aggregate began waiting, set when the run is created. */
131
+ startedAt?: string;
132
+ }
133
+ /**
134
+ * The four calls {@link postAggregate} needs. Sentinel backs them with `@theholocron/github-client`, the CLI with the
135
+ * `source` provider, and the tests with a fake, so the one function serves all three.
136
+ */
137
+ interface AggregateApi {
138
+ /** Every check run on the commit, the aggregate's own included. */
139
+ listCheckRuns(sha: string): Promise<AggregateCheckRun[]>;
140
+ /** The commit statuses on the commit, newest first. */
141
+ listCommitStatuses(sha: string): Promise<AggregateCommitStatus[]>;
142
+ /** Creates the aggregate check run and returns its id. */
143
+ createCheckRun(sha: string, name: string, write: AggregateWrite): Promise<number>;
144
+ /** Changes one run the aggregate made. A provider that refuses (a completed run cannot reopen) throws. */
145
+ updateCheckRun(id: number, write: AggregateWrite): Promise<void>;
146
+ }
147
+ /** What {@link postAggregate} reads and decides with. */
148
+ interface PostAggregateInput {
149
+ /** The provider calls. */
150
+ api: AggregateApi;
151
+ /** The commit to post on. */
152
+ sha: string;
153
+ /** The expected check ids, from the config at the pull request's base ref. */
154
+ expected: string[];
155
+ /** The status contexts that must reach success. */
156
+ statuses: string[];
157
+ /** The current time in epoch milliseconds. */
158
+ now: number;
159
+ /** The name to post under; defaults to {@link AGGREGATE_CHECK_NAME}. */
160
+ name?: string;
161
+ /** How long to wait before a pending or missing check fails; defaults to {@link AGGREGATE_TIMEOUT_MS}. */
162
+ timeoutMs?: number;
163
+ /** Read and decide, write nothing. */
164
+ dryRun?: boolean;
165
+ /** Write again even when the status and conclusion already match, so the table stays current (a webhook). */
166
+ refreshOutput?: boolean;
167
+ /** An `in_progress` run older than this many milliseconds counts as stale; defaults to 10 minutes. */
168
+ graceMs?: number;
169
+ /**
170
+ * Slugs of apps whose runs under this name are not ours: such a run is never updated, and when one is there and none of ours
171
+ * is, nothing is posted (`foreign`). Defaults to `github-actions`, the Actions poller.
172
+ */
173
+ foreignAppSlugs?: string[];
174
+ }
175
+ /** What {@link postAggregate} did. */
176
+ interface PostAggregateResult {
177
+ /**
178
+ * `created` or `updated` a run, `recreated` when the provider refused to reopen one, `unchanged`, `foreign` when another
179
+ * app (the Actions poller) already posts this check on the commit and nothing was written, or `would-...` on a dry run.
180
+ */
181
+ action: "created" | "updated" | "recreated" | "unchanged" | "foreign" | "would-create" | "would-update";
182
+ /** The verdict the state calls for. */
183
+ result: AggregateResult;
184
+ /** True when the stored run was missing or disagreed with the verdict, and had been waiting longer than the grace. */
185
+ stale: boolean;
186
+ /** The id of the run the verdict is on, `null` on a dry run that would create one. */
187
+ runId: number | null;
188
+ /** Ids of duplicate runs a race left, completed as `neutral`. */
189
+ closed: number[];
190
+ /** True when the verdict changed under the write and a second write corrected it. */
191
+ rewritten: boolean;
192
+ }
193
+ /**
194
+ * Computes the `ci` aggregate for one commit from the state the API holds and makes the check run say it. This is the
195
+ * one writer: Sentinel's webhook handler, the `reconcile ci` command and the scheduled sweep all call it, so a verdict
196
+ * is the same whoever asks.
197
+ *
198
+ * Every call reads the whole state again (the payload of a webhook is never used), finds the aggregate's run by name
199
+ * and updates it, or creates one when there is none. After a create it lists the runs again and, when two writers
200
+ * raced, keeps the oldest and completes the others as `neutral`. After every write it reads once more and writes
201
+ * again if the verdict moved, so a slow older computation cannot leave a stale `in_progress` over a `success`.
202
+ */
203
+ export declare function postAggregate(input: PostAggregateInput): Promise<PostAggregateResult>;
24
204
  /** A commit status a coverage provider reports on a pull request (names only), as `Coverage.statusContexts()` returns it. */
25
205
  interface StatusContext {
26
206
  /** The context GitHub shows, such as `codecov/patch`. */
@@ -48,6 +228,13 @@ interface AggregateChecks {
48
228
  * context is a status when it starts with `codecov/`.
49
229
  */
50
230
  export declare function aggregateChecks(config: TasksConfig, statusContexts?: readonly StatusContext[]): AggregateChecks;
231
+ /**
232
+ * Who posts the `ci / Required checks` check for a manifest: `"sentinel"` only when `ci.aggregate` says exactly that,
233
+ * otherwise `"actions"`. A misspelling therefore keeps the poster that exists today (the config loader rejects it with
234
+ * an error where it can, so this is the quiet fallback, not the validation), and a manifest with no `ci` block, which
235
+ * is every repo today, is unchanged.
236
+ */
237
+ export declare function aggregatePoster(config: Pick<TasksConfig, "ci">): CiAggregatePoster;
51
238
  /**
52
239
  * Where the reusable workflows and composite actions that every generated workflow calls are hosted, and at which ref.
53
240
  * This is the only place that says so: the templates are written against the spelling in {@link TEMPLATE_HOME}, and
@@ -1092,6 +1279,11 @@ interface Astromech {
1092
1279
  * nothing to wait on. Only a repo that hosts the reusable `ci.yml` writes it; the others have no `ci` yet.
1093
1280
  */
1094
1281
  aggregateCaller(): string | null;
1282
+ /**
1283
+ * Who posts the `ci / Required checks` check for this manifest, from `ci.aggregate` (`"actions"` when it is not set). With
1284
+ * `"sentinel"`, {@link aggregateCaller} is `null` and the repo that hosts the reusables does not write `ci.yml`.
1285
+ */
1286
+ aggregatePoster(): CiAggregatePoster;
1095
1287
  /**
1096
1288
  * The generated `turbo.json` for this repo's manifest, pretty-printed —
1097
1289
  * write directly, no merge. In a pnpm workspace it also holds the suite aggregator tasks and a `//#<id>` root task
@@ -1125,6 +1317,10 @@ interface Astromech {
1125
1317
  */
1126
1318
  ensureTurboDependency(packageJson: string, workspaceYaml: string): EnsureTurboDependencyResult;
1127
1319
  }
1320
+ /**
1321
+ * Creates the Holocron task runner: `run` / `ci`, the generated workflows, `package.json` scripts, linter set and required
1322
+ * checks, all driven by one `tasks` manifest. `@theholocron/cli` creates it once and delegates to it.
1323
+ */
1128
1324
  export declare function createAstromech(options: AstromechOptions): Astromech;
1129
1325
  /**
1130
1326
  * The branches releases are cut from, in release order: `main` is the stable line, `alpha` the prerelease line.
@@ -1431,4 +1627,4 @@ declare function createConfig$8(): string;
1431
1627
  declare function createConfig$9(): string;
1432
1628
  /** The `.yamlignore` body. */
1433
1629
  declare function createIgnoreConfig(): string;
1434
- export { type AggregateChecks, type Astromech, type AstromechOptions, type CheckReleaseLinesInput, type CiJobReport, type CiOptions, type CiReport, type CreateHeaderOptions, type DependabotConfigOptions, type DeployOnReleaseOptions, type DeployOnReleaseReport, type DeployOnReleaseResult, type WorkspacePackage as DeployWorkspacePackage, type DocsCoverageMode, type ExecFn, type GitTag, type GroupJobReport, type GroupOptions, type GroupReport, type HeaderFunctions, type LegacyTarget, type LocalRunner, type MergedScripts, type NpmDistTags, type OrgContext, type PackageBehind, type PackageRole, type PackageScriptProblem, type PlannedKind, type PlannedTask, type PreviewConfig, type ReleaseLine, type ReleaseTagCheck, type ReleaseTagState, type RepoShape, type RunLogger, type RunOptions, type RunTaskInput, type RunTaskReport, type StatusContext, type TaskDef, type TaskGroup, type TaskScope, type TsconfigOptions, type WorkflowHeaderFormat, type WorkspacePackage$1 as WorkspacePackage, createConfig as createCommitMsg, createConfig$1 as createDependabot, createConfig$2 as createDevmoji, createConfig$3 as createEditorconfig, createConfig$4 as createEditorconfigChecker, createConfig$5 as createLabeler, createConfig$6 as createPreCommit, createConfig$7 as createPrePush, createConfig$8 as createPrepareCommitMsg, createIgnoreConfig as createYamlignore, createConfig$9 as createYamllint };
1630
+ export { type AggregateAnnotation, type AggregateApi, type AggregateCheckRun, type AggregateChecks, type AggregateCommitStatus, type AggregateResult, type AggregateRow, type AggregateWrite, type Astromech, type AstromechOptions, type CheckReleaseLinesInput, type CiJobReport, type CiOptions, type CiReport, type CreateHeaderOptions, type DependabotConfigOptions, type DeployOnReleaseOptions, type DeployOnReleaseReport, type DeployOnReleaseResult, type WorkspacePackage as DeployWorkspacePackage, type DocsCoverageMode, type EvaluateAggregateInput, type ExecFn, type GitTag, type GroupJobReport, type GroupOptions, type GroupReport, type HeaderFunctions, type LegacyTarget, type LocalRunner, type MergedScripts, type NpmDistTags, type OrgContext, type PackageBehind, type PackageRole, type PackageScriptProblem, type PlannedKind, type PlannedTask, type PostAggregateInput, type PostAggregateResult, type PreviewConfig, type ReleaseLine, type ReleaseTagCheck, type ReleaseTagState, type RepoShape, type RunLogger, type RunOptions, type RunTaskInput, type RunTaskReport, type StatusContext, type TaskDef, type TaskGroup, type TaskScope, type TsconfigOptions, type WorkflowHeaderFormat, type WorkspacePackage$1 as WorkspacePackage, createConfig as createCommitMsg, createConfig$1 as createDependabot, createConfig$2 as createDevmoji, createConfig$3 as createEditorconfig, createConfig$4 as createEditorconfigChecker, createConfig$5 as createLabeler, createConfig$6 as createPreCommit, createConfig$7 as createPrePush, createConfig$8 as createPrepareCommitMsg, createIgnoreConfig as createYamlignore, createConfig$9 as createYamllint };
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { a as legacyName, c as CI_ORDER, i as resolveTaskName, l as TASKS, o as ownLegacyName, r as isTask, s as LEGACY_NAMES, t as loadTasksConfig, u as normalizeTaskEntry } from "./load-PgZbUPyW.mjs";
1
+ import { a as legacyName, c as CI_ORDER, i as resolveTaskName, l as TASKS, o as ownLegacyName, r as isTask, s as LEGACY_NAMES, t as loadTasksConfig, u as normalizeTaskEntry } from "./load-ByvVLKLw.mjs";
2
2
  import { t as editorconfig_checker_default } from "./editorconfig-checker-BKNGE7U2.mjs";
3
3
  import { existsSync, readFileSync, readdirSync, writeFileSync } from "node:fs";
4
4
  import { dirname, join, relative } from "node:path";
@@ -6,6 +6,285 @@ import { addWorkspaceMember, dependencyNames, detectPackageManager, discoverWork
6
6
  import { stringifyJson } from "@theholocron/json-utils";
7
7
  import { spawnSync } from "node:child_process";
8
8
  import { findExecutableSync } from "@theholocron/fs-utils";
9
+ // src/aggregate/newest-check-runs/newest-check-runs.ts
10
+ /**
11
+ * Keeps only the newest run of each check name, ordered by name. A commit can carry several runs of one check (a
12
+ * cancelled first batch, a job re-run to green): the newest is the one that counts (latest `startedAt`, then `id`, #2171).
13
+ * The sort key is the one the `ci` workflow's jq program uses (names are unique here, so there are no ties).
14
+ */
15
+ function newestCheckRuns(runs) {
16
+ const byName = /* @__PURE__ */ new Map();
17
+ for (const run of runs) {
18
+ const kept = byName.get(run.name);
19
+ if (kept === void 0 || isNewer(run, kept)) byName.set(run.name, run);
20
+ }
21
+ return [...byName.values()].sort((a, b) => a.name < b.name ? -1 : 1);
22
+ }
23
+ function isNewer(a, b) {
24
+ const aStart = a.startedAt ?? "";
25
+ const bStart = b.startedAt ?? "";
26
+ if (aStart !== bStart) return aStart > bStart;
27
+ return (a.id ?? 0) >= (b.id ?? 0);
28
+ }
29
+ // src/aggregate/render-aggregate/render-aggregate.ts
30
+ const RANK = {
31
+ failure: 0,
32
+ missing: 1,
33
+ pending: 2,
34
+ success: 3
35
+ };
36
+ /** Renders the failing-first Markdown table of the rows and one error annotation per row that is not a success. */
37
+ function renderAggregate(rows) {
38
+ const lines = [
39
+ "## ci",
40
+ "",
41
+ "| Check | Result | Link |",
42
+ "| --- | --- | --- |"
43
+ ];
44
+ for (const row of [...rows].sort((a, b) => RANK[a.state] - RANK[b.state])) {
45
+ const result = `${row.state === "success" ? "pass" : "FAIL"}: ${row.detail}`;
46
+ lines.push(`| \`${row.id}\` | ${result} | ${row.url === null ? "none" : `[open](${row.url})`} |`);
47
+ }
48
+ const annotations = rows.filter((row) => row.state !== "success").map((row) => ({
49
+ title: row.id,
50
+ message: `${row.detail} ${row.url ?? ""}`.trim()
51
+ }));
52
+ return {
53
+ summary: lines.join("\n"),
54
+ annotations
55
+ };
56
+ }
57
+ // src/aggregate/evaluate-aggregate/evaluate-aggregate.ts
58
+ const PASSING = /* @__PURE__ */ new Set([
59
+ "success",
60
+ "skipped",
61
+ "neutral"
62
+ ]);
63
+ function passes(conclusion) {
64
+ return PASSING.has(conclusion ?? "");
65
+ }
66
+ function row(id, kind, state, detail, url) {
67
+ return {
68
+ id,
69
+ kind,
70
+ state,
71
+ detail,
72
+ url
73
+ };
74
+ }
75
+ function checkRow(id, latest) {
76
+ const found = latest.filter((run) => run.name.startsWith(`${id} / `));
77
+ const [first] = found;
78
+ if (first === void 0) return row(id, "check", "missing", "never posted", null);
79
+ const open = found.find((run) => run.status !== "completed");
80
+ if (open !== void 0) return row(id, "check", "pending", "still running", open.url);
81
+ const bad = found.find((run) => !passes(run.conclusion));
82
+ if (bad !== void 0) return row(id, "check", "failure", bad.conclusion ?? "none", bad.url);
83
+ return row(id, "check", "success", String(first.conclusion), first.url);
84
+ }
85
+ function statusRow(context, latest, input) {
86
+ const run = latest.find((candidate) => candidate.name === context);
87
+ if (run !== void 0) {
88
+ if (run.status !== "completed") return row(context, "status", "pending", "still running", run.url);
89
+ if (passes(run.conclusion)) return row(context, "status", "success", String(run.conclusion), run.url);
90
+ return row(context, "status", "failure", run.conclusion ?? "none", run.url);
91
+ }
92
+ const posted = input.commitStatuses.find((status) => status.context === context);
93
+ if (posted === void 0) return row(context, "status", "missing", "never posted", null);
94
+ if (posted.state === "pending") return row(context, "status", "pending", "still pending", posted.url);
95
+ if (posted.state === "success") return row(context, "status", "success", "success", posted.url);
96
+ return row(context, "status", "failure", posted.state, posted.url);
97
+ }
98
+ /**
99
+ * Decides the `ci` aggregate check for one commit from the state read from the API.
100
+ *
101
+ * Pure: no clock, no network, no GitHub types. It fails closed: `success` only when every expected id and every status
102
+ * context is satisfied, so an empty `expected`, an `incomplete` read or an unreadable clock never yields `success`.
103
+ * `pending` means a check is still running or has not posted and the deadline (`startedAt + timeoutMs`) has not passed;
104
+ * at the deadline pending and missing rows become failures.
105
+ */
106
+ function evaluateAggregate(input) {
107
+ const latest = newestCheckRuns(input.checkRuns);
108
+ const raw = [...input.expected.map((id) => checkRow(id, latest)), ...input.statuses.map((context) => statusRow(context, latest, input))];
109
+ const expired = !(input.now - input.startedAt < input.timeoutMs);
110
+ const rows = raw.map((r) => {
111
+ if (!expired) return r;
112
+ if (r.state === "pending") return {
113
+ ...r,
114
+ state: "failure",
115
+ detail: "timed out while still running"
116
+ };
117
+ if (r.state === "missing") return {
118
+ ...r,
119
+ state: "failure"
120
+ };
121
+ return r;
122
+ });
123
+ if (input.expected.length === 0) rows.unshift(row("expected", "config", "failure", "no expected checks are configured", null));
124
+ if (input.incomplete !== void 0) rows.unshift(row("checks", "config", "failure", `state not read in full: ${input.incomplete}`, null));
125
+ const settled = rows.every((r) => r.state === "success" || r.state === "failure");
126
+ return {
127
+ conclusion: rows.every((r) => r.state === "success") ? "success" : settled ? "failure" : "pending",
128
+ rows,
129
+ ...renderAggregate(rows)
130
+ };
131
+ }
132
+ // src/aggregate/post-aggregate/post-aggregate.type.ts
133
+ /** The name of the aggregate check run, the one context the ruleset requires. */
134
+ const AGGREGATE_CHECK_NAME = "ci / Required checks";
135
+ /** The name Sentinel posts the aggregate under while it runs beside the Actions poller (the shadow), which nothing requires. */
136
+ const AGGREGATE_SHADOW_CHECK_NAME = `${AGGREGATE_CHECK_NAME} (sentinel)`;
137
+ /** How long the aggregate waits for a check that has not finished or not posted, as the polling job does. */
138
+ const AGGREGATE_TIMEOUT_MS = 18e5;
139
+ // src/aggregate/post-aggregate/post-aggregate.ts
140
+ const DEFAULT_GRACE_MS = 6e5;
141
+ /** The app whose runs are the Actions poller's: `ci / Required checks` posted by a workflow belongs to `github-actions`. */
142
+ const DEFAULT_FOREIGN_APP_SLUGS = ["github-actions"];
143
+ const asWrite = (result, startedAt) => ({
144
+ status: result.conclusion === "pending" ? "in_progress" : "completed",
145
+ ...result.conclusion === "pending" ? {} : { conclusion: result.conclusion },
146
+ title: result.conclusion === "success" ? "All required checks passed" : result.conclusion === "failure" ? "Required checks failed" : "Waiting for required checks",
147
+ summary: result.summary,
148
+ text: result.annotations.map((a) => `${a.title}: ${a.message}`).join("\n"),
149
+ ...startedAt === void 0 ? {} : { startedAt }
150
+ });
151
+ const startMs = (run) => run.startedAt === null ? NaN : Date.parse(run.startedAt);
152
+ /** Whether the stored run already says what the verdict says. */
153
+ function matches(stored, result) {
154
+ if (result.conclusion === "pending") return stored.status !== "completed";
155
+ return stored.status === "completed" && stored.conclusion === result.conclusion;
156
+ }
157
+ /**
158
+ * Computes the `ci` aggregate for one commit from the state the API holds and makes the check run say it. This is the
159
+ * one writer: Sentinel's webhook handler, the `reconcile ci` command and the scheduled sweep all call it, so a verdict
160
+ * is the same whoever asks.
161
+ *
162
+ * Every call reads the whole state again (the payload of a webhook is never used), finds the aggregate's run by name
163
+ * and updates it, or creates one when there is none. After a create it lists the runs again and, when two writers
164
+ * raced, keeps the oldest and completes the others as `neutral`. After every write it reads once more and writes
165
+ * again if the verdict moved, so a slow older computation cannot leave a stale `in_progress` over a `success`.
166
+ */
167
+ async function postAggregate(input) {
168
+ const name = input.name ?? "ci / Required checks";
169
+ const timeoutMs = input.timeoutMs ?? 18e5;
170
+ const graceMs = input.graceMs ?? DEFAULT_GRACE_MS;
171
+ const expected = input.expected.filter((id) => id !== "ci");
172
+ const foreignSlugs = input.foreignAppSlugs ?? DEFAULT_FOREIGN_APP_SLUGS;
173
+ const isForeign = (run) => run.appSlug != null && foreignSlugs.includes(run.appSlug);
174
+ const read = async () => {
175
+ const [runs, commitStatuses] = await Promise.all([input.api.listCheckRuns(input.sha), input.api.listCommitStatuses(input.sha)]);
176
+ const named = runs.filter((run) => run.name === name);
177
+ const own = named.filter((run) => !isForeign(run));
178
+ const foreign = named.length - own.length;
179
+ const startedAt = own.map(startMs).filter((ms) => !Number.isNaN(ms)).sort((a, b) => a - b)[0] ?? input.now;
180
+ const result = evaluateAggregate({
181
+ expected,
182
+ statuses: input.statuses,
183
+ checkRuns: runs.filter((run) => run.name !== name),
184
+ commitStatuses,
185
+ now: input.now,
186
+ startedAt,
187
+ timeoutMs
188
+ });
189
+ return {
190
+ own,
191
+ foreign,
192
+ stored: newestCheckRuns(own)[0],
193
+ startedAt,
194
+ result
195
+ };
196
+ };
197
+ const state = await read();
198
+ const { stored, result } = state;
199
+ if (stored === void 0 && state.foreign > 0) return {
200
+ action: "foreign",
201
+ result,
202
+ stale: false,
203
+ runId: null,
204
+ closed: [],
205
+ rewritten: false
206
+ };
207
+ const waited = input.now - state.startedAt;
208
+ const stale = stored === void 0 ? true : !matches(stored, result) && (stored.status !== "completed" ? waited > graceMs : true);
209
+ const needsWrite = stored === void 0 || !matches(stored, result) || input.refreshOutput === true;
210
+ const base = {
211
+ result,
212
+ stale,
213
+ closed: [],
214
+ rewritten: false
215
+ };
216
+ if (!needsWrite) return {
217
+ ...base,
218
+ action: "unchanged",
219
+ runId: stored.id
220
+ };
221
+ if (input.dryRun) return stored === void 0 ? {
222
+ ...base,
223
+ action: "would-create",
224
+ runId: null
225
+ } : {
226
+ ...base,
227
+ action: "would-update",
228
+ runId: stored.id
229
+ };
230
+ let action;
231
+ let runId;
232
+ const closed = [];
233
+ if (stored === void 0) {
234
+ runId = await input.api.createCheckRun(input.sha, name, asWrite(result, new Date(input.now).toISOString()));
235
+ action = "created";
236
+ const mine = (await input.api.listCheckRuns(input.sha)).flatMap((run) => run.name === name && run.id !== null && !(run.status === "completed" && run.conclusion === "neutral") ? [{
237
+ ...run,
238
+ id: run.id
239
+ }] : []);
240
+ if (mine.length > 1) {
241
+ const ordered = [...mine].sort((a, b) => (a.startedAt ?? "").localeCompare(b.startedAt ?? "") || a.id - b.id);
242
+ runId = ordered[0]?.id;
243
+ for (const extra of ordered.slice(1)) {
244
+ await input.api.updateCheckRun(extra.id, {
245
+ status: "completed",
246
+ conclusion: "neutral",
247
+ title: "Duplicate of the canonical aggregate",
248
+ summary: "Another delivery posted this check at the same time; the oldest run is the one that counts.",
249
+ text: ""
250
+ });
251
+ closed.push(extra.id);
252
+ }
253
+ }
254
+ } else {
255
+ runId = stored.id;
256
+ try {
257
+ await input.api.updateCheckRun(runId, asWrite(result));
258
+ action = "updated";
259
+ } catch (error) {
260
+ if (stored.status !== "completed" || result.conclusion !== "pending") throw error;
261
+ runId = await input.api.createCheckRun(input.sha, name, asWrite(result, new Date(input.now).toISOString()));
262
+ action = "recreated";
263
+ }
264
+ }
265
+ let rewritten = false;
266
+ const again = await read();
267
+ if (again.result.conclusion !== result.conclusion) {
268
+ await input.api.updateCheckRun(runId, asWrite(again.result));
269
+ rewritten = true;
270
+ return {
271
+ action,
272
+ result: again.result,
273
+ stale,
274
+ runId,
275
+ closed,
276
+ rewritten
277
+ };
278
+ }
279
+ return {
280
+ action,
281
+ result,
282
+ stale,
283
+ runId,
284
+ closed,
285
+ rewritten
286
+ };
287
+ }
9
288
  // src/vocabulary/suites/suites.ts
10
289
  /**
11
290
  * The suites the registry declares, in the order their first leaf appears: `test`, `lint`, `scan` and `validate`. A suite is declared by the `suite` field of its
@@ -68,6 +347,7 @@ var docs_default$1$1 = "name: Measure Documentation Coverage\n\n# Doc-comment co
68
347
  var preview_specs_default$1 = "#\n# Makes the forum post for a spec or ADR while its pull request is still open (#1600, spec\n# `tech-specs-discussion-threads`), instead of waiting for the file to land on `alpha`. It runs `holocron sync specs` with\n# `--files` (only the spec and ADR files this pull request changes, so a stale branch cannot retag the posts of files it\n# does not touch) and `--pr` (the post names this pull request). Everything the command edits stays in this checkout and\n# is thrown away: the post's address reaches the file after the merge, when the `sync-specs` task finds the post\n# by the path it records and links it through its sync pull request.\n#\n# - Only for a pull request from this repository: a post carries text the author wrote, and a fork gets no secrets.\n# - Only when the pull request changes a spec or an ADR.\n# - When the pull request is CLOSED WITHOUT MERGING, its posts are tagged `withdrawn` and closed (#1653,\n# `sync specs --withdraw`); reopening it, or the same file coming back in a new pull request, puts the file's own status\n# back on the post and reopens it. A merged pull request does nothing here. Nothing from a closed pull request's head\n# runs with the bot token: that event checks out and builds the BASE branch, and takes only the list of paths from the\n# pull request through the API.\n# - It shares the `spec-discussions` concurrency group with the `sync-specs` task, so a post is never made twice\n# by two runs at once; the post is also found by its path before it is made, so a rerun is safe.\n#\n# It needs the org secret `HOLOCRON_DISCORD_BOT_TOKEN`; without it the job warns and does nothing.\n\nname: Preview Specs\n\non: # yamllint disable-line rule:truthy\n workflow_call:\n secrets:\n HOLOCRON_DISCORD_BOT_TOKEN:\n description: The Holonet bot token. Without it the job warns and does nothing.\n required: false\n\njobs:\n preview-specs:\n name: Sync spec discussions for the pull request\n permissions:\n contents: read\n pull-requests: read\n # Shared with `sync-specs`, so a post is never made twice by two runs at once.\n concurrency:\n group: spec-discussions\n cancel-in-progress: false\n if: github.repository == format('{0}/holocron', github.repository_owner) && github.event.pull_request.head.repo.full_name == github.repository && (github.event.action != 'closed' || github.event.pull_request.merged == false)\n runs-on: ubuntu-latest\n timeout-minutes: 20\n env:\n HOLOCRON_DISCORD_BOT_TOKEN: ${{ secrets.HOLOCRON_DISCORD_BOT_TOKEN }}\n BASE_REF: ${{ github.event.pull_request.base.sha }}\n PR_NUMBER: ${{ github.event.pull_request.number }}\n WITHDRAW: ${{ github.event.action == 'closed' }}\n steps:\n - name: Warn that there is no Discord token\n if: env.HOLOCRON_DISCORD_BOT_TOKEN == ''\n run: |\n echo \"::warning::HOLOCRON_DISCORD_BOT_TOKEN is not set, so no spec discussion was made for this pull request. Add it as an Actions secret.\"\n\n - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1\n name: Checkout the pull request (the base branch, when it was closed)\n if: env.HOLOCRON_DISCORD_BOT_TOKEN != ''\n with:\n # A closed pull request is never checked out: its head is not needed beyond the list of paths, and the bot token\n # must not run its code. The base branch's tip is trusted code.\n ref: ${{ github.event.action == 'closed' && github.event.pull_request.base.ref || '' }}\n # The whole history: a spec is numbered by when its file was first committed, and the base is needed to see\n # which files this pull request changes.\n fetch-depth: 0\n\n - name: List the specs and ADRs this pull request changes\n id: files\n if: env.HOLOCRON_DISCORD_BOT_TOKEN != ''\n env:\n GH_TOKEN: ${{ github.token }}\n REPO: ${{ github.repository }}\n run: |\n # Added or modified, not deleted: a file that is gone has nothing to post.\n if [ \"$WITHDRAW\" = \"true\" ]; then\n # The head is not checked out, so the pull request's paths come from the API (names only, and only those of a\n # plain shape, since the list becomes arguments).\n files=$(gh api --paginate \"repos/$REPO/pulls/$PR_NUMBER/files\" --jq '.[] | select(.status != \"removed\") | .filename' \\\n | grep -E '^(\\.notes/[A-Za-z0-9._-]+\\.spec\\.md|docs/wiki/specifications/[A-Za-z0-9._-]+\\.spec\\.md|docs/wiki/decisions/[A-Za-z0-9._-]+\\.md)$' \\\n | tr '\\n' ' ' || true)\n else\n files=$(git diff --name-only --diff-filter=AM \"$BASE_REF\"...HEAD -- '.notes/*.spec.md' 'docs/wiki/specifications/*.spec.md' 'docs/wiki/decisions/*.md' | tr '\\n' ' ')\n fi\n echo \"list=$files\" >> \"$GITHUB_OUTPUT\"\n if [ -z \"$files\" ]; then echo \"No spec or ADR is added or changed here.\"; fi\n\n - uses: theholocron/.github/.github/actions/setup@main\n name: Setup\n if: env.HOLOCRON_DISCORD_BOT_TOKEN != '' && steps.files.outputs.list != ''\n\n - name: Build the CLI\n if: env.HOLOCRON_DISCORD_BOT_TOKEN != '' && steps.files.outputs.list != ''\n run: pnpm turbo run build --filter=@theholocron/cli...\n\n - name: Sync the discussions for these files (withdraw them, when it was closed)\n if: env.HOLOCRON_DISCORD_BOT_TOKEN != '' && steps.files.outputs.list != ''\n env:\n FILES: ${{ steps.files.outputs.list }}\n run: |\n # The list is file names from this repository's own pull request; word splitting is what turns it into arguments.\n # shellcheck disable=SC2086\n if [ \"$WITHDRAW\" = \"true\" ]; then\n node cli/cli/dist/cli.mjs sync specs --withdraw --files $FILES\n else\n node cli/cli/dist/cli.mjs sync specs --pr \"$PR_NUMBER\" --files $FILES\n fi\n";
69
348
  var preview_default$1 = "name: Preview\n\non: # yamllint disable-line rule:truthy\n workflow_call:\n inputs:\n type:\n description: \"Type of deployment: docs or storybook\"\n required: true\n type: string\n name:\n description: Repo name prefix used to filter the docs site package (<name>-site); omit to run pnpm -C docs build\n required: false\n type: string\n default: \"\"\n storybook-projects:\n description: >\n JSON array of { \"name\"?, \"workingDir\", \"outputDir\"? } objects for storybook deploys.\n Each is built via `pnpm -C <workingDir> build:storybook`. If \"name\" is provided the\n output is placed under `sandbox/<name>/`; omit \"name\" for single-repo deploys and the\n output lands directly in `sandbox/`.\n type: string\n required: false\n default: \"[]\"\n build-script:\n description: pnpm script that builds the Storybook static output (single storybook, type:storybook only)\n type: string\n required: false\n default: build:storybook\n output-dir:\n description: Directory where Storybook writes its static output (single storybook, type:storybook only)\n type: string\n required: false\n default: storybook-static\n cloudflare-project:\n description: >\n Cloudflare Pages project name. Falls back to the CLOUDFLARE_PAGES_PROJECT\n org variable (filled from the 1Password sync) when omitted — set that variable once and all repos get previews\n without per-repo config.\n required: false\n type: string\n default: \"\"\n\njobs:\n deploy-preview:\n name: Preview\n if: ${{ github.event.action != 'closed' }}\n runs-on: ubuntu-latest\n permissions:\n contents: read\n deployments: write\n pull-requests: write\n steps:\n - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1\n name: Checkout repository\n\n - uses: theholocron/.github/.github/actions/setup@main\n name: Setup\n\n - name: Build workspace dependencies\n # The docs site imports workspace packages (e.g. a shared theme) via\n # `workspace:*` — its exports map points at dist/, which doesn't\n # exist until something builds it. Nothing else in this job does,\n # so without this step Vite fails to resolve the import entirely.\n if: ${{ inputs.type == 'docs' }}\n run: pnpm run build\n\n - name: Build docs site\n if: ${{ inputs.type == 'docs' && inputs.name != '' }}\n env:\n SITE_NAME: ${{ inputs.name }}\n run: pnpm --filter @theholocron/\"$SITE_NAME\"-site build\n\n - name: Build docs site\n if: ${{ inputs.type == 'docs' && inputs.name == '' }}\n run: pnpm -C docs build\n\n - name: Build Storybook projects\n if: ${{ inputs.storybook-projects != '[]' }}\n env:\n PROJECTS: ${{ inputs.storybook-projects }}\n run: |\n echo \"$PROJECTS\" | jq -c '.[]' | while IFS= read -r project; do\n workingDir=$(echo \"$project\" | jq -r '.workingDir')\n pnpm -C \"$workingDir\" build:storybook\n done\n\n - name: Build Storybook\n if: ${{ inputs.type == 'storybook' && inputs.storybook-projects == '[]' }}\n env:\n BUILD_SCRIPT: ${{ inputs.build-script }}\n run: pnpm run \"$BUILD_SCRIPT\"\n\n - name: Assemble site\n env:\n DEPLOY_TYPE: ${{ inputs.type }}\n SITE_NAME: ${{ inputs.name }}\n PROJECTS: ${{ inputs.storybook-projects }}\n STORYBOOK_OUTPUT_DIR: ${{ inputs.output-dir }}\n run: |\n mkdir -p _site\n if [ \"$DEPLOY_TYPE\" = \"docs\" ]; then\n if [ -n \"$SITE_NAME\" ]; then\n # Site built with base: /<name>/ — nest under _site/<name>/ so asset\n # paths match (/name/_astro/... → served at /name/_astro/...).\n mkdir -p \"_site/${SITE_NAME}\"\n cp -r docs/dist/. \"_site/${SITE_NAME}/\"\n # Redirect root to the base path so the preview URL lands correctly.\n printf \"/ /%s/ 301\\n\" \"$SITE_NAME\" > _site/_redirects\n else\n cp -r docs/dist/. _site/\n fi\n fi\n if [ \"$PROJECTS\" != \"[]\" ]; then\n echo \"$PROJECTS\" | jq -c '.[]' | while IFS= read -r project; do\n name=$(echo \"$project\" | jq -r '.name // \"\"')\n workingDir=$(echo \"$project\" | jq -r '.workingDir')\n outputDir=$(echo \"$project\" | jq -r '.outputDir // \"storybook-static\"')\n if [ -n \"$name\" ]; then\n target=\"_site/sandbox/${name}\"\n else\n target=\"_site/sandbox\"\n fi\n mkdir -p \"$target\"\n cp -r \"${workingDir}/${outputDir}/.\" \"$target/\"\n done\n elif [ \"$DEPLOY_TYPE\" = \"storybook\" ]; then\n mkdir -p _site/sandbox\n cp -r \"${STORYBOOK_OUTPUT_DIR}/.\" _site/sandbox/\n fi\n\n - name: Install Wrangler\n # The action's install step runs npm/pnpm in the repo root; pnpm fails\n # because it rejects adding to a workspace root without -w, and npm fails\n # because package.json contains pnpm catalog: references it cannot parse.\n # Pre-installing from /tmp (no package.json) lets the action find wrangler\n # already on PATH and skip its own install entirely.\n working-directory: /tmp\n run: npm install -g wrangler@4\n\n - name: Warn when the Cloudflare account id is missing\n # The deploy below needs it. It is an organization variable that `holocron sync secrets` writes from\n # the 1Password Environment named by `repo.variables.sync` in .holocron/repo.ts.\n if: ${{ (inputs.cloudflare-project != '' || (vars.HOLOCRON_CLOUDFLARE_PAGES_PROJECT || vars.CLOUDFLARE_PAGES_PROJECT) != '') && (vars.HOLOCRON_CLOUDFLARE_ACCOUNT_ID || vars.CLOUDFLARE_ACCOUNT_ID) == '' }}\n run: echo \"::warning title=CLOUDFLARE_ACCOUNT_ID is not set::The Pages deploy needs it. Add it to the 1Password Environment behind repo.variables.sync and run holocron sync secrets.\"\n\n - uses: cloudflare/wrangler-action@953926a2e2182532811c01a25e53647d93bf07c0 # v4.1.3\n id: deploy\n name: Deploy to Cloudflare Pages\n # Skip when neither the per-repo input nor the org variable is set.\n if: ${{ inputs.cloudflare-project != '' || (vars.HOLOCRON_CLOUDFLARE_PAGES_PROJECT || vars.CLOUDFLARE_PAGES_PROJECT) != '' }}\n with:\n apiToken: ${{ secrets.HOLOCRON_CLOUDFLARE_TOKEN || secrets.CLOUDFLARE_API_TOKEN }}\n accountId: ${{ vars.HOLOCRON_CLOUDFLARE_ACCOUNT_ID || vars.CLOUDFLARE_ACCOUNT_ID }}\n packageManager: npm\n command: >-\n pages deploy _site\n --project-name ${{ inputs.cloudflare-project || vars.HOLOCRON_CLOUDFLARE_PAGES_PROJECT || vars.CLOUDFLARE_PAGES_PROJECT }}\n --branch ${{ github.event.repository.name }}-pr-${{ github.event.pull_request.number }}\n --commit-dirty=true\n\n - name: Report preview URL\n if: ${{ steps.deploy.outputs.pages-deployment-alias-url != '' }}\n env:\n GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n ALIAS: ${{ steps.deploy.outputs.pages-deployment-alias-url }}\n SITE_NAME: ${{ inputs.name }}\n PROJECT: ${{ inputs.cloudflare-project || vars.HOLOCRON_CLOUDFLARE_PAGES_PROJECT || vars.CLOUDFLARE_PAGES_PROJECT }}\n run: |\n PREVIEW_URL=\"${ALIAS%/}${SITE_NAME:+/${SITE_NAME}}/\"\n # GITHUB_HEAD_REF is the PR branch name — links the deployment to this PR's sidebar widget.\n PAYLOAD=$(printf '{\"ref\":\"%s\",\"environment\":\"%s\",\"description\":\"Cloudflare Pages\",\"production_environment\":false,\"auto_merge\":false,\"required_contexts\":[]}' \\\n \"$GITHUB_HEAD_REF\" \"${PROJECT} (Preview)\")\n DEPLOY_ID=$(echo \"$PAYLOAD\" | gh api \"repos/${GITHUB_REPOSITORY}/deployments\" \\\n --method POST --input - | jq -r '.id')\n gh api \"repos/${GITHUB_REPOSITORY}/deployments/${DEPLOY_ID}/statuses\" \\\n --method POST --field state=success --field environment_url=\"${PREVIEW_URL}\"\n\n cleanup:\n name: Clean up Preview\n if: ${{ github.event.action == 'closed' }}\n runs-on: ubuntu-latest\n permissions:\n contents: read\n deployments: write\n pull-requests: write\n steps:\n - name: Warn when the Cloudflare account id is missing\n # Without it the request below cannot find the preview deployments, so closing the PR leaves them behind.\n if: ${{ (inputs.cloudflare-project != '' || (vars.HOLOCRON_CLOUDFLARE_PAGES_PROJECT || vars.CLOUDFLARE_PAGES_PROJECT) != '') && (vars.HOLOCRON_CLOUDFLARE_ACCOUNT_ID || vars.CLOUDFLARE_ACCOUNT_ID) == '' }}\n run: echo \"::warning title=CLOUDFLARE_ACCOUNT_ID is not set::The preview deployments cannot be deleted without it. Add it to the 1Password Environment behind repo.variables.sync and run holocron sync secrets.\"\n\n - name: Delete Cloudflare Pages deployments for branch\n if: ${{ inputs.cloudflare-project != '' || (vars.HOLOCRON_CLOUDFLARE_PAGES_PROJECT || vars.CLOUDFLARE_PAGES_PROJECT) != '' }}\n env:\n CLOUDFLARE_API_TOKEN: ${{ secrets.HOLOCRON_CLOUDFLARE_TOKEN || secrets.CLOUDFLARE_API_TOKEN }}\n CLOUDFLARE_ACCOUNT_ID: ${{ vars.HOLOCRON_CLOUDFLARE_ACCOUNT_ID || vars.CLOUDFLARE_ACCOUNT_ID }}\n PROJECT: ${{ inputs.cloudflare-project || vars.HOLOCRON_CLOUDFLARE_PAGES_PROJECT || vars.CLOUDFLARE_PAGES_PROJECT }}\n BRANCH: ${{ github.event.repository.name }}-pr-${{ github.event.pull_request.number }}\n GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n run: |\n DEPLOYMENTS=$(curl -s \\\n \"https://api.cloudflare.com/client/v4/accounts/${CLOUDFLARE_ACCOUNT_ID}/pages/projects/${PROJECT}/deployments\" \\\n -H \"Authorization: Bearer ${CLOUDFLARE_API_TOKEN}\" \\\n | jq -r --arg b \"$BRANCH\" \\\n '.result[] | select(.deployment_trigger.metadata.branch == $b) | .id')\n\n if [ -z \"$DEPLOYMENTS\" ]; then\n echo \"No deployments found for branch ${BRANCH} — nothing to clean up.\"\n exit 0\n fi\n\n for id in $DEPLOYMENTS; do\n echo \"Deleting CF Pages deployment: $id\"\n curl -s -X DELETE \\\n \"https://api.cloudflare.com/client/v4/accounts/${CLOUDFLARE_ACCOUNT_ID}/pages/projects/${PROJECT}/deployments/${id}?force=true\" \\\n -H \"Authorization: Bearer ${CLOUDFLARE_API_TOKEN}\" | jq -r 'if .success then \" ✓ deleted\" else \" ✗ \\(.errors[0].message)\" end'\n done\n\n # Mark the GitHub Deployment environment as inactive.\n ENV_NAME=\"${PROJECT} (Preview)\"\n gh api \"repos/${GITHUB_REPOSITORY}/deployments\" \\\n | jq -r \".[] | select(.environment == \\\"${ENV_NAME}\\\") | .id\" \\\n | while read -r deploy_id; do\n gh api \"repos/${GITHUB_REPOSITORY}/deployments/${deploy_id}/statuses\" \\\n --method POST --field state=inactive 2>/dev/null || true\n done\n";
70
349
  var publish_wiki_default$1 = "name: Wiki\n\non: # yamllint disable-line rule:truthy\n workflow_call:\n inputs:\n fern-version:\n description: >\n Fern CLI version to install. Pin this to avoid breaking changes when\n Fern updates their config schema.\n type: string\n required: false\n default: \"5.114.1\"\n preview:\n description: >\n When true, publishes a preview instead of production.\n Requires preview-id to be set.\n type: boolean\n required: false\n default: false\n preview-id:\n description: >\n Stable ID for the preview build. Use the PR number (e.g. \"pr-123\")\n so the same preview URL is reused on every push to the branch.\n type: string\n required: false\n default: \"\"\n fern-org:\n description: >\n DEPRECATED — the preview URL is now read from Fern's own output.\n Kept as a fallback for building the URL when that parse fails, and so\n existing callers do not error.\n type: string\n required: false\n default: \"\"\n base-path:\n description: >\n DEPRECATED — see fern-org. Basepath appended to the fallback preview\n URL (e.g. \"holocron\" for multi-source routing).\n type: string\n required: false\n default: \"\"\n secrets:\n HOLOCRON_FERN_TOKEN:\n required: false\n FERN_TOKEN:\n required: false\n\njobs:\n publish:\n name: Publish to Fern\n runs-on: ubuntu-latest\n timeout-minutes: 10\n permissions:\n contents: read\n deployments: write\n steps:\n - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1\n name: Checkout repository\n\n - name: Install Fern CLI\n run: npm install -g \"fern-api@$FERN_VERSION\"\n env:\n FERN_VERSION: ${{ inputs.fern-version }}\n\n - name: Publish docs\n if: ${{ !inputs.preview }}\n run: fern generate --docs\n env:\n FERN_TOKEN: ${{ secrets.HOLOCRON_FERN_TOKEN || secrets.FERN_TOKEN }}\n\n - name: Preview docs\n id: preview\n if: ${{ inputs.preview && inputs.preview-id != '' }}\n env:\n FERN_TOKEN: ${{ secrets.HOLOCRON_FERN_TOKEN || secrets.FERN_TOKEN }}\n PREVIEW_ID: ${{ inputs.preview-id }}\n run: |\n out=$(fern generate --docs --preview --id \"$PREVIEW_ID\" 2>&1) || { printf '%s\\n' \"$out\"; exit 1; }\n printf '%s\\n' \"$out\"\n # Fern prints \"Published docs to https://<org>-preview-<id>.docs.buildwithfern.com/<path>\"\n url=$(printf '%s\\n' \"$out\" | grep -oiE 'https://[a-z0-9.-]+\\.docs\\.buildwithfern\\.com[^ )]*' | head -n1)\n echo \"url=$url\" >> \"$GITHUB_OUTPUT\"\n\n - name: Report preview URL\n if: ${{ inputs.preview && inputs.preview-id != '' }}\n env:\n GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n CAPTURED_URL: ${{ steps.preview.outputs.url }}\n FERN_ORG: ${{ inputs.fern-org }}\n PREVIEW_ID: ${{ inputs.preview-id }}\n BASE_PATH: ${{ inputs.base-path }}\n run: |\n PREVIEW_URL=\"$CAPTURED_URL\"\n if [ -z \"$PREVIEW_URL\" ] && [ -n \"$FERN_ORG\" ]; then\n PREVIEW_URL=\"https://${FERN_ORG}-preview-${PREVIEW_ID}.docs.buildwithfern.com${BASE_PATH:+/${BASE_PATH}}\"\n fi\n if [ -z \"$PREVIEW_URL\" ]; then\n echo \"::warning::no preview URL parsed from Fern output and no fern-org fallback — skipping the deployment widget\"\n exit 0\n fi\n PAYLOAD=$(printf '{\"ref\":\"%s\",\"environment\":\"wiki (Preview)\",\"description\":\"Wiki\",\"production_environment\":false,\"auto_merge\":false,\"required_contexts\":[]}' \\\n \"$GITHUB_HEAD_REF\")\n DEPLOY_ID=$(printf '%s\\n' \"$PAYLOAD\" | gh api \"repos/${GITHUB_REPOSITORY}/deployments\" \\\n --method POST --input - | jq -r '.id')\n gh api \"repos/${GITHUB_REPOSITORY}/deployments/${DEPLOY_ID}/statuses\" \\\n --method POST --field state=success --field environment_url=\"$PREVIEW_URL\"\n";
350
+ var reconcile_ci_default$1 = "name: Reconcile ci\n\n# The safety net of the `ci` aggregate (spec `process-sentinel-posts-ci`, SPEC-0099): runs `holocron reconcile ci`, which\n# reads each open pull request's check runs and statuses and makes `ci / Required checks` say what they call for. A\n# healthy run writes nothing. A check that was missing or wrong for longer than ten minutes means a webhook was missed:\n# the run fails, and a failed run reaches #alerts through `platform.notifications.yml`.\n#\n# It posts as Sentinel's GitHub App, with an installation token narrowed to the three permissions it needs (checks:\n# write, pull_requests: read, statuses: read), never as `GITHUB_TOKEN`: a check run belongs to the app that posted it, and\n# the ruleset will be pinned to Sentinel's app. The App's id and private key reach the job as the secrets below (`secrets:\n# inherit` passes them from the caller). The App must hold Commit statuses: read, which a person grants.\n#\n# In a repo whose `ci.aggregate` is `actions` (the default) the command posts nothing and the run is green: the Actions job\n# is the poster there. Scheduled every 15 minutes by the caller; GitHub delays and drops scheduled runs, so the heartbeat\n# is more lenient than the cron.\n\non: # yamllint disable-line rule:truthy\n workflow_call:\n secrets:\n SENTINEL_GITHUB_APP_ID:\n description: The id of the GitHub App whose installation token posts the check.\n required: false\n SENTINEL_GITHUB_APP_PRIVATE_KEY:\n description: The private key of that GitHub App.\n required: false\n SENTINEL_APP_ID:\n description: The old name of SENTINEL_GITHUB_APP_ID, read when the new one is not set.\n required: false\n SENTINEL_APP_PRIVATE_KEY:\n description: The old name of SENTINEL_GITHUB_APP_PRIVATE_KEY, read when the new one is not set.\n required: false\n HOLOCRON_HEARTBEAT_RECONCILE_CI:\n description: The ping URL of the `reconcile-ci` heartbeat. Without it the run sends none.\n required: false\n\njobs:\n reconcile-ci:\n name: Bring the ci check up to date\n permissions:\n contents: read\n runs-on: ubuntu-latest\n timeout-minutes: 10\n # Two runs could post the same check twice, so a second waits for the first.\n concurrency:\n group: reconcile-ci\n cancel-in-progress: false\n steps:\n - name: Generate GitHub App token\n id: app-token\n uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0\n with:\n app-id: ${{ vars.SENTINEL_GITHUB_APP_ID || secrets.SENTINEL_GITHUB_APP_ID || secrets.SENTINEL_APP_ID }}\n private-key: ${{ secrets.SENTINEL_GITHUB_APP_PRIVATE_KEY || secrets.SENTINEL_APP_PRIVATE_KEY }}\n owner: ${{ github.repository_owner }}\n repositories: ${{ github.event.repository.name }}\n permission-checks: write\n permission-pull-requests: read\n permission-statuses: read\n\n - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1\n name: Checkout repository\n\n - uses: theholocron/.github/.github/actions/setup@main\n name: Setup\n\n # The token goes in the environment, never on the command line. The `source` provider reads it as its token.\n - uses: theholocron/.github/.github/actions/holocron@main\n name: Reconcile the ci check\n id: reconcile\n env:\n HOLOCRON_ADMIN_TOKEN: ${{ steps.app-token.outputs.token }}\n with:\n command: reconcile ci --max-age 10\n\n - name: List what was done\n if: ${{ !cancelled() && steps.reconcile.outputs.log-file != '' }}\n env:\n LOG_FILE: ${{ steps.reconcile.outputs.log-file }}\n run: |\n {\n echo \"### ci reconcile\"\n echo '```'\n cat \"$LOG_FILE\"\n echo '```'\n } >> \"$GITHUB_STEP_SUMMARY\"\n\n # Tells Checkly this run finished (#2359, the `reconcile-ci` heartbeat). Last, and only on success, so a red or\n # missing run is what Checkly notices. A no-op until the secret exists; the URL is a credential: it goes in through\n # `env` only, is masked, and a failed ping never fails the job.\n - name: Ping the heartbeat\n env:\n PING_URL: ${{ secrets.HOLOCRON_HEARTBEAT_RECONCILE_CI }}\n run: |\n if [ -z \"$PING_URL\" ]; then\n echo \"::notice::HOLOCRON_HEARTBEAT_RECONCILE_CI is not set, so no heartbeat was sent.\"\n exit 0\n fi\n echo \"::add-mask::$PING_URL\"\n curl -fsS --retry 3 --max-time 10 -o /dev/null \"$PING_URL\" || echo \"::warning::The heartbeat ping failed.\"\n";
71
351
  var reconcile_projects_default$1 = "name: Reconcile Projects\n\n# Keeps the project boards true to their rules (SPEC-0020, #1744): runs `holocron reconcile project`, which sets an item's\n# status from the issue's state and its \"blocked by\" links (an open blocker means blocked, no blocker left means planned,\n# a closed issue means done), then `holocron doctor project`, which reports what reconcile cannot fix.\n#\n# `GITHUB_TOKEN` cannot write an organization project, so the job mints an installation token from a GitHub App. The App\n# needs the organization permission Projects (read and write), which a person grants; its id and private key reach the job\n# as the secrets below (`secrets: inherit` passes them from the caller). The boards a repo keeps come from its own\n# `providers.projects` in holocron.config.ts, so a repo that declares none passes `doctor project` as a skip.\n#\n# Scheduled hourly by the caller. A failed run reaches #alerts through `platform.notifications.yml`.\n\non: # yamllint disable-line rule:truthy\n workflow_call:\n secrets:\n SENTINEL_GITHUB_APP_ID:\n description: The id of the GitHub App whose installation token writes the boards.\n required: false\n SENTINEL_GITHUB_APP_PRIVATE_KEY:\n description: The private key of that GitHub App.\n required: false\n SENTINEL_APP_ID:\n description: The old name of SENTINEL_GITHUB_APP_ID, read when the new one is not set.\n required: false\n SENTINEL_APP_PRIVATE_KEY:\n description: The old name of SENTINEL_GITHUB_APP_PRIVATE_KEY, read when the new one is not set.\n required: false\n HOLOCRON_HEARTBEAT_RECONCILE_PROJECTS:\n description: The ping URL of the `reconcile-projects` heartbeat. Without it the run sends none.\n required: false\n\njobs:\n reconcile-projects:\n name: Reconcile and check the boards\n permissions:\n contents: read\n runs-on: ubuntu-latest\n timeout-minutes: 15\n # Two runs could set the same item twice, so a second waits for the first.\n concurrency:\n group: reconcile-projects\n cancel-in-progress: false\n steps:\n - name: Generate GitHub App token\n id: app-token\n uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0\n with:\n app-id: ${{ vars.SENTINEL_GITHUB_APP_ID || secrets.SENTINEL_GITHUB_APP_ID || secrets.SENTINEL_APP_ID }}\n private-key: ${{ secrets.SENTINEL_GITHUB_APP_PRIVATE_KEY || secrets.SENTINEL_APP_PRIVATE_KEY }}\n owner: ${{ github.repository_owner }}\n permission-organization-projects: write\n permission-issues: read\n permission-pull-requests: read\n\n - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1\n name: Checkout repository\n\n - uses: theholocron/.github/.github/actions/setup@main\n name: Setup\n\n # The token goes in the environment, never on the command line.\n - uses: theholocron/.github/.github/actions/holocron@main\n name: Reconcile the boards\n id: reconcile\n env:\n HOLOCRON_ORG_TOKEN: ${{ steps.app-token.outputs.token }}\n with:\n command: reconcile project\n\n - name: List what changed\n if: ${{ !cancelled() && steps.reconcile.outputs.log-file != '' }}\n env:\n LOG_FILE: ${{ steps.reconcile.outputs.log-file }}\n run: |\n {\n echo \"### Project reconcile\"\n echo '```'\n cat \"$LOG_FILE\"\n echo '```'\n } >> \"$GITHUB_STEP_SUMMARY\"\n\n # What reconcile cannot fix: a board that differs from its template, a rule that is off, a missing App permission.\n - uses: theholocron/.github/.github/actions/holocron@main\n name: Check the boards\n if: ${{ !cancelled() }}\n env:\n HOLOCRON_ORG_TOKEN: ${{ steps.app-token.outputs.token }}\n with:\n command: doctor project\n\n # Tells Checkly this run finished (#2359, the `reconcile-projects` heartbeat). Last, and only on success, so a red or\n # missing run is what Checkly notices. A no-op until the secret exists; the URL is a credential: it goes in through\n # `env` only, is masked, and a failed ping never fails the job.\n - name: Ping the heartbeat\n env:\n PING_URL: ${{ secrets.HOLOCRON_HEARTBEAT_RECONCILE_PROJECTS }}\n run: |\n if [ -z \"$PING_URL\" ]; then\n echo \"::notice::HOLOCRON_HEARTBEAT_RECONCILE_PROJECTS is not set, so no heartbeat was sent.\"\n exit 0\n fi\n echo \"::add-mask::$PING_URL\"\n curl -fsS --retry 3 --max-time 10 -o /dev/null \"$PING_URL\" || echo \"::warning::The heartbeat ping failed.\"\n";
72
352
  var release_default$1 = "name: Release\n\n# Semantic-release with OIDC Trusted Publishing.\n# actions/setup-node writes a default NODE_AUTH_TOKEN=${{ github.token }}\n# which shadows OIDC auth. We explicitly clear it so npm falls through to\n# the Trusted Publisher OIDC exchange.\n# The calling repo must have a .releaserc.json that configures branches,\n# plugins, and any publish options. npm@11+ is installed to support OIDC.\n\non: # yamllint disable-line rule:truthy\n workflow_call:\n inputs:\n dry-run:\n description: >\n When true, runs semantic-release --dry-run: analyzes commits and\n previews the next release without git writes or publish. Only\n meaningful for workflow_dispatch triggers; push-triggered runs\n always run fully.\n type: boolean\n required: false\n default: false\n group:\n description: >\n Version group to release: a folder of the repo (`clients`,\n `observability`). Passed to the release config as RELEASE_GROUP, and\n scopes every tag lookup below to that group's `<group>-v*` tags, so\n releasing one group never reads another's. Empty releases the whole\n repo, with plain `v*` tags. Groups push release commits to the same\n branch, so release them one at a time (a matrix with `max-parallel: 1`);\n each run starts from the branch's current tip, not the commit that\n triggered the workflow.\n type: string\n required: false\n default: \"\"\n from-branch-tip:\n description: >\n When true, an ungrouped release starts from the branch's current tip\n instead of the commit that triggered the workflow. Set it when the\n repo-wide release runs after the version groups, whose release\n commits have moved the branch (semantic-release refuses to run\n behind its remote). A group always starts from the tip.\n type: boolean\n required: false\n default: false\n post-release:\n description: >\n When true, dispatches a readme sync broadcast after a successful\n release. Enable for packages consumed by other repos via the\n registry-doc system so downstream README installation blocks\n stay current.\n type: boolean\n required: false\n default: false\n run-build:\n description: Run `pnpm build` before releasing\n type: boolean\n required: false\n default: true\n deploy-on-release:\n description: >\n When true, runs a separate `deploy` job after a successful release\n (holocron#930): `holocron deploy on-release` deploys every workspace\n package whose `delivery.deploy` task is `with: { on: release }`, when\n the release is on its channel and changes its paths. The job is its\n own check, re-runnable on its own, and gets VERCEL_TOKEN; the release\n job never sees it. Off by default, so a repo that doesn't deploy from\n its release never exposes the token.\n type: boolean\n required: false\n default: false\n republish-tag:\n description: >\n Publish what npm lacks for an existing release instead of releasing\n (holocron#1387): the tag of the release, `<group>-v<version>` for a\n version group or `v<version>` for the rest. Set, the `release` job is\n skipped (no semantic-release, no tag, no release commit) and the\n `republish` job checks the tag out and runs `publish package\n --skip-already-published` for it. The tag must be on a release branch.\n The caller sets it from a manual run only. Empty is a normal release.\n type: string\n required: false\n default: \"\"\n exclude-groups:\n description: >\n Space-separated version groups that release on their own, left out of\n a republish of the repo-wide tag (`v<version>`). Ignored otherwise.\n type: string\n required: false\n default: \"\"\n sentry-project:\n description: >\n Sentry project slug for sourcemap upload and release creation after\n publishing. Omit to skip the Sentry release step entirely.\n type: string\n required: false\n default: \"\"\n secrets:\n HOLOCRON_RELEASE_TOKEN:\n description: >\n Fine-grained PAT (Contents + Issues + Pull requests: write) owned by\n an admin. Required when the default branch is protected by a ruleset —\n github.token cannot push through rulesets, but an admin PAT can.\n Takes priority over HOLOCRON_SYNC_TOKEN. Falls back to github.token.\n required: false\n HOLOCRON_SYNC_TOKEN:\n description: >\n Legacy alias for HOLOCRON_RELEASE_TOKEN — kept for backward compatibility.\n Prefer HOLOCRON_RELEASE_TOKEN for new repos.\n required: false\n HOLOCRON_READ_TOKEN:\n description: >\n Fine-grained PAT for read-only GitHub API calls (e.g. resolving git\n committer identity via `gh api user`). Falls back to github.token.\n required: false\n GH_TOKEN:\n description: >\n Generic GitHub token fallback for `gh` CLI calls. Used when\n HOLOCRON_READ_TOKEN is not set.\n required: false\n HOLOCRON_SENTRY_RELEASE_TOKEN:\n description: The Sentry release token (sourcemaps and release creation). Read first; the SENTRY_AUTH_TOKEN secret is the fallback.\n required: false\n SENTRY_AUTH_TOKEN:\n description: >\n Sentry auth token for sourcemap upload and release creation.\n Required when sentry-project is set. Use the org-level secret.\n required: false\n HOLOCRON_TURBO_TOKEN:\n description: The Turbo remote cache token. Read first; the TURBO_TOKEN secret is the fallback.\n required: false\n TURBO_TOKEN:\n required: false\n HOLOCRON_VERCEL_TOKEN:\n description: The Vercel token. Read first; the vendor-native VERCEL_TOKEN secret is the fallback.\n required: false\n VERCEL_TOKEN:\n description: >\n Vercel token for the deploy job. Only used when deploy-on-release is\n true, and only by that job.\n required: false\n\njobs:\n release:\n name: Semantic release\n if: ${{ inputs.republish-tag == '' }}\n permissions:\n contents: write\n id-token: write\n issues: write\n pull-requests: write\n runs-on: ubuntu-latest\n timeout-minutes: 30\n outputs:\n # Read by the deploy job (holocron#930). Empty unless semantic-release\n # published: `commit` is the release commit, `previous` the commit of\n # the release before it (to diff against), `channel` the new version's\n # prerelease identifier (`alpha`), empty for a stable release (`main`).\n commit: ${{ steps.release.outputs.commit }}\n previous: ${{ steps.release.outputs.previous }}\n channel: ${{ steps.release.outputs.channel }}\n env:\n TURBO_TOKEN: ${{ secrets.HOLOCRON_TURBO_TOKEN || secrets.TURBO_TOKEN }}\n TURBO_TEAM: ${{ vars.HOLOCRON_TURBO_TEAM || vars.TURBO_TEAM }}\n # Do not cancel in-progress releases — a partial release is worse than a slow one.\n steps:\n - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1\n name: Checkout repository\n with:\n fetch-depth: 0\n persist-credentials: false\n # A group's release commit moves the branch, so a later group's run must\n # release from the branch's current tip, not the commit that triggered the\n # workflow (semantic-release refuses to run behind its remote). Ungrouped,\n # the default (the triggering commit) is unchanged, unless `from-branch-tip`\n # says the groups ran first.\n ref: ${{ (inputs.group != '' || inputs.from-branch-tip) && github.ref || github.sha }}\n # Use HOLOCRON_RELEASE_TOKEN when available — git push (tags, release commits)\n # uses the checkout credential, not GITHUB_TOKEN env var. The\n # built-in github.token cannot push through branch protection rulesets.\n token: ${{ secrets.HOLOCRON_RELEASE_TOKEN || secrets.HOLOCRON_SYNC_TOKEN || github.token }}\n\n - uses: theholocron/.github/.github/actions/setup@main\n name: Setup\n\n # By path: the action is new and `theholocron/.github` is frozen (see the `format` action in lint/code.yml).\n - uses: ./ci/actions/git-identity\n name: Configure git identity\n with:\n scope: global\n resolve: \"true\"\n signoff: \"true\"\n token: ${{ secrets.HOLOCRON_READ_TOKEN || secrets.GH_TOKEN || github.token }}\n\n - name: Upgrade npm for OIDC support\n run: npm install -g npm@11 sigstore\n # sigstore is required by libnpmpublish/provenance.js at module parse\n # time — before any config takes effect. Some npm 11.x builds stopped\n # bundling it; installing it globally into the same prefix ensures it\n # resolves regardless of npm version. (Discovered 2026-07-09.)\n\n - run: pnpm build\n name: Build\n if: ${{ inputs.run-build == true }}\n\n - name: Release\n id: release\n run: |\n BEFORE=$(git rev-parse HEAD)\n # A group's tags are `<group>-v<version>`; without one, any tag (as before).\n MATCH=()\n PREFIX=\"v\"\n if [ -n \"$RELEASE_GROUP\" ]; then\n MATCH=(--match \"${RELEASE_GROUP}-v*\")\n PREFIX=\"${RELEASE_GROUP}-v\"\n fi\n PREVIOUS_TAG=$(git describe --tags --abbrev=0 \"${MATCH[@]}\" 2>/dev/null || true)\n PREVIOUS=\"\"\n if [ -n \"$PREVIOUS_TAG\" ]; then PREVIOUS=$(git rev-list -n 1 \"$PREVIOUS_TAG\"); fi\n if [ \"$DRY_RUN\" = \"true\" ]; then\n npx semantic-release --dry-run\n else\n npx semantic-release\n fi\n AFTER=$(git rev-parse HEAD)\n # semantic-release only commits (`chore(release): … [skip ci]`) when it\n # actually publishes. That commit gets no CI (and so no coverage\n # upload), which makes the next PR's `codecov/project` compare a full\n # report against a stale ancestor — a phantom drop (holocron#644).\n # Emit the new SHA so the steps below upload coverage for it.\n if [ \"$BEFORE\" != \"$AFTER\" ]; then\n echo \"commit=$AFTER\" >> \"$GITHUB_OUTPUT\"\n echo \"previous=$PREVIOUS\" >> \"$GITHUB_OUTPUT\"\n # The new version's channel: the prerelease identifier of its tag\n # (v5.0.0-alpha.108 or cli-v5.0.0-alpha.108 -> alpha), empty for a stable release.\n VERSION=$(git describe --tags --abbrev=0 \"${MATCH[@]}\")\n VERSION=${VERSION#\"$PREFIX\"}\n CHANNEL=\"\"\n case \"$VERSION\" in *-*) PRE=${VERSION#*-}; CHANNEL=${PRE%%.*} ;; esac\n echo \"channel=$CHANNEL\" >> \"$GITHUB_OUTPUT\"\n fi\n env:\n DRY_RUN: ${{ inputs.dry-run }}\n # Read by the repo's release config to release one version group.\n RELEASE_GROUP: ${{ inputs.group }}\n # Prefer HOLOCRON_RELEASE_TOKEN (fine-grained PAT, Contents+Issues+PRs write,\n # owned by an admin with ruleset bypass) so @semantic-release/git can\n # push the version-bump commit through branch protection. Falls back to\n # HOLOCRON_SYNC_TOKEN (legacy) then github.token for unprotected repos.\n GITHUB_TOKEN: ${{ secrets.HOLOCRON_RELEASE_TOKEN || secrets.HOLOCRON_SYNC_TOKEN || github.token }}\n HUSKY: \"0\"\n NPM_CONFIG_PROVENANCE: true\n\n - uses: theholocron/.github/.github/actions/holocron@main\n name: Coverage for the release commit\n if: ${{ steps.release.outputs.commit != '' }}\n with:\n task: test:unit\n\n - uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1\n name: Upload release-commit coverage to Codecov\n if: ${{ steps.release.outputs.commit != '' }}\n # fail_ci_if_error makes a failed upload fail this step, so it is visible, but\n # continue-on-error keeps it from failing the job: the release has already\n # published, and the Sentry release steps below must still run (holocron#934).\n continue-on-error: true\n with:\n use_oidc: true\n fail_ci_if_error: true\n override_commit: ${{ steps.release.outputs.commit }}\n override_branch: ${{ github.ref_name }}\n\n - name: Get release version\n id: release_version\n if: ${{ inputs.sentry-project != '' && inputs.dry-run != true }}\n env:\n SENTRY_PROJECT: ${{ inputs.sentry-project }}\n RELEASE_GROUP: ${{ inputs.group }}\n run: |\n MATCH=()\n PREFIX=\"v\"\n if [ -n \"$RELEASE_GROUP\" ]; then\n MATCH=(--match \"${RELEASE_GROUP}-v*\")\n PREFIX=\"${RELEASE_GROUP}-v\"\n fi\n TAG=$(git describe --tags --abbrev=0 \"${MATCH[@]}\" 2>/dev/null || echo \"\")\n if [ -n \"$TAG\" ]; then\n echo \"release=${SENTRY_PROJECT}@${TAG#\"$PREFIX\"}\" >> \"$GITHUB_OUTPUT\"\n fi\n\n - name: Create Sentry release\n if: ${{ inputs.sentry-project != '' && steps.release_version.outputs.release != '' && inputs.dry-run != true }}\n uses: getsentry/action-release@d55c8c3b7375607e972b710f12926b676d89d7d2 # v3\n env:\n SENTRY_AUTH_TOKEN: ${{ secrets.HOLOCRON_SENTRY_RELEASE_TOKEN || secrets.SENTRY_AUTH_TOKEN }}\n SENTRY_ORG: ${{ vars.HOLOCRON_SENTRY_ORG || vars.SENTRY_ORG }}\n SENTRY_PROJECT: ${{ inputs.sentry-project }}\n with:\n environment: production\n version: ${{ steps.release_version.outputs.release }}\n sourcemaps: \"**/dist\"\n\n republish:\n name: Republish\n # Publishes what npm lacks for a tag that already exists (holocron#1387). Never tags, never makes a release or a\n # release commit, never moves a branch: it reads the tag and publishes. It holds no write token for the repository.\n if: ${{ inputs.republish-tag != '' }}\n permissions:\n contents: read\n id-token: write\n runs-on: ubuntu-latest\n timeout-minutes: 30\n env:\n TURBO_TOKEN: ${{ secrets.HOLOCRON_TURBO_TOKEN || secrets.TURBO_TOKEN }}\n TURBO_TEAM: ${{ vars.HOLOCRON_TURBO_TEAM || vars.TURBO_TEAM }}\n steps:\n - name: Check the tag\n id: tag\n env:\n TAG: ${{ inputs.republish-tag }}\n RELEASE_GROUP: ${{ inputs.group }}\n EXCLUDED_GROUPS: ${{ inputs.exclude-groups }}\n DRY_RUN: ${{ inputs.dry-run }}\n run: |\n # A group's tags are `<group>-v<version>`; the rest of the repo's are `v<version>`.\n PREFIX=\"v\"\n if [ -n \"$RELEASE_GROUP\" ]; then PREFIX=\"${RELEASE_GROUP}-v\"; fi\n case \"$TAG\" in\n \"$PREFIX\"[0-9]*) ;;\n *) echo \"::error::$TAG is not a ${PREFIX}<version> tag\"; exit 1 ;;\n esac\n VERSION=${TAG#\"$PREFIX\"}\n # The channel is the prerelease identifier (5.0.0-alpha.9 -> alpha), `latest` for a stable version.\n CHANNEL=latest\n case \"$VERSION\" in *-*) PRE=${VERSION#*-}; CHANNEL=${PRE%%.*} ;; esac\n ARGS=\"--skip-already-published --tag $CHANNEL\"\n if [ -n \"$RELEASE_GROUP\" ]; then\n ARGS=\"$ARGS --group $RELEASE_GROUP\"\n else\n for g in $EXCLUDED_GROUPS; do ARGS=\"$ARGS --exclude-group $g\"; done\n fi\n # A manual run defaults to a dry run, so a republish is previewed before it publishes.\n if [ \"$DRY_RUN\" = \"true\" ]; then ARGS=\"$ARGS --dry-run\"; fi\n echo \"args=$ARGS\" >> \"$GITHUB_OUTPUT\"\n\n - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1\n name: Checkout the tag\n with:\n ref: refs/tags/${{ inputs.republish-tag }}\n fetch-depth: 0\n persist-credentials: false\n\n # Only a tag on a release branch is republished: a tag pushed to some other branch is not a release.\n - name: Require a release branch\n env:\n TAG: ${{ inputs.republish-tag }}\n run: |\n git fetch --no-tags origin '+refs/heads/main:refs/remotes/origin/main' '+refs/heads/alpha:refs/remotes/origin/alpha' || true\n for branch in main alpha; do\n if git rev-parse --verify --quiet \"refs/remotes/origin/$branch\" >/dev/null && git merge-base --is-ancestor HEAD \"refs/remotes/origin/$branch\"; then\n echo \"$TAG is on $branch\"\n exit 0\n fi\n done\n echo \"::error::$TAG is not on main or alpha, so it is not republished\"\n exit 1\n\n - uses: theholocron/.github/.github/actions/setup@main\n name: Setup\n\n - name: Upgrade npm for OIDC support\n run: npm install -g npm@11 sigstore\n\n - run: pnpm build\n name: Build\n if: ${{ inputs.run-build == true }}\n\n # Writes the packages left unpublished to the job summary and fails when one is.\n - uses: theholocron/.github/.github/actions/holocron@main\n name: Publish what npm lacks\n env:\n NPM_CONFIG_PROVENANCE: true\n with:\n command: publish package\n args: ${{ steps.tag.outputs.args }}\n\n deploy:\n name: Deploy\n needs: release\n # Only after a release that actually published (`commit` is empty on a dry\n # run or when nothing was released). A failed deploy fails only this job:\n # the release is already on npm, and this job re-runs on its own.\n if: ${{ inputs.deploy-on-release == true && inputs.dry-run != true && needs.release.outputs.commit != '' }}\n permissions:\n contents: write\n runs-on: ubuntu-latest\n timeout-minutes: 30\n env:\n TURBO_TOKEN: ${{ secrets.HOLOCRON_TURBO_TOKEN || secrets.TURBO_TOKEN }}\n TURBO_TEAM: ${{ vars.HOLOCRON_TURBO_TEAM || vars.TURBO_TEAM }}\n steps:\n - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1\n name: Checkout the release commit\n with:\n ref: ${{ needs.release.outputs.commit }}\n fetch-depth: 0\n # No credential is left in .git/config: the deploy script below runs with VERCEL_TOKEN and must not find a\n # write token. Only the record step at the end is given one (holocron#2330).\n persist-credentials: false\n\n - uses: theholocron/.github/.github/actions/setup@main\n name: Setup\n\n - uses: theholocron/.github/.github/actions/holocron@main\n name: Deploy packages that deploy on release\n env:\n VERCEL_TOKEN: ${{ secrets.HOLOCRON_VERCEL_TOKEN || secrets.VERCEL_TOKEN }}\n with:\n command: deploy on-release\n args: >-\n --channel=${{ needs.release.outputs.channel }}\n --from=${{ needs.release.outputs.previous }}\n --to=${{ needs.release.outputs.commit }}\n --record-file=${{ runner.temp }}/deployed.json\n\n # Records each package that deployed as a `deployed/<package>` tag, so a later release can make up a deploy this\n # one missed (holocron#2330). It runs even after a failed deploy (for the packages that did deploy), deploys\n # nothing, and is the only step that gets the job's token, in its own environment and never in .git/config.\n - uses: theholocron/.github/.github/actions/holocron@main\n name: Record the deploys\n if: ${{ !cancelled() }}\n env:\n GITHUB_TOKEN: ${{ github.token }}\n with:\n command: deploy on-release\n args: >-\n --record\n --record-file=${{ runner.temp }}/deployed.json\n\n sync-readme:\n name: Post-release readme sync\n needs: release\n if: ${{ inputs.post-release == true && inputs.dry-run != true }}\n runs-on: ubuntu-latest\n timeout-minutes: 5\n steps:\n - name: Trigger broadcast readme sync\n run: |\n gh workflow run sync-dispatch.yml \\\n --repo \"$GITHUB_REPOSITORY_OWNER/.github\" \\\n --field \"steps=readme\"\n env:\n GH_TOKEN: ${{ secrets.HOLOCRON_SYNC_TOKEN || secrets.GH_TOKEN }}\n";
73
353
  var remind_doctor_default$1 = "name: Remind Doctor\n\n# A weekly nudge to run the drift check by hand (#1585). `holocron doctor notifications` compares the layout with the\n# live server and reads the Worker, the tracker and the secrets with provider tokens, which stay on a maintainer's\n# machine rather than in CI. This posts one line to #alerts, no ping, naming the command that checks and shares the\n# result. A missing webhook secret skips the post and never fails the run.\n\non: # yamllint disable-line rule:truthy\n workflow_call:\n secrets:\n HOLOCRON_NOTIFY_WEBHOOK_ALERTS:\n description: The #alerts webhook the reminder posts to. Without it the post is skipped.\n required: false\n\njobs:\n remind-doctor:\n name: Remind to run the drift check\n permissions: {}\n runs-on: ubuntu-latest\n timeout-minutes: 2\n steps:\n - uses: theholocron/.github/.github/actions/notify@main\n name: \"Remind #alerts\"\n with:\n webhook: ${{ secrets.HOLOCRON_NOTIFY_WEBHOOK_ALERTS }}\n message: \"🩺 ${{ github.repository }}: time for the weekly drift check. Run `holocron doctor notifications --built-only --post` to compare the server with the layout and post the result here.\"\n";
@@ -147,6 +427,7 @@ const WORKFLOWS = Object.fromEntries(Object.entries(/* @__PURE__ */ Object.assig
147
427
  "../workflows/preview-specs.yml": preview_specs_default$1,
148
428
  "../workflows/preview.yml": preview_default$1,
149
429
  "../workflows/publish-wiki.yml": publish_wiki_default$1,
430
+ "../workflows/reconcile-ci.yml": reconcile_ci_default$1,
150
431
  "../workflows/reconcile-projects.yml": reconcile_projects_default$1,
151
432
  "../workflows/release.yml": release_default$1,
152
433
  "../workflows/remind-doctor.yml": remind_doctor_default$1,
@@ -375,6 +656,13 @@ const LEGACY_CALLERS = {
375
656
  name: "Doctor reminder"
376
657
  } }
377
658
  },
659
+ "reconcile-ci": {
660
+ name: "Reconcile ci",
661
+ jobs: { "reconcile-ci": {
662
+ id: "reconcile-ci",
663
+ name: "Reconcile ci"
664
+ } }
665
+ },
378
666
  "reconcile-projects": {
379
667
  name: "Platform",
380
668
  jobs: { "reconcile-projects": {
@@ -900,6 +1188,8 @@ var preview_specs_default = "name: preview-specs\n\non: # yamllint disable-line
900
1188
  var preview_default = "name: preview\n\non: # yamllint disable-line rule:truthy\n pull_request:\n branches: [main]\n\nconcurrency:\n group: preview-${{ github.event.pull_request.number }}\n cancel-in-progress: true\n\npermissions:\n contents: read\n deployments: write\n pull-requests: write\n\njobs:\n preview:\n name: preview\n uses: theholocron/.github/.github/workflows/preview.yml@main\n secrets: inherit\n";
901
1189
  // src/templates/workflows/publish-wiki.yml
902
1190
  var publish_wiki_default = "name: publish-wiki\n\non: # yamllint disable-line rule:truthy\n push:\n branches: [main]\n pull_request:\n branches: [main]\n\nconcurrency:\n group: ${{ github.event_name == 'pull_request' && format('wiki-preview-{0}', github.event.pull_request.number) || 'wiki' }}\n cancel-in-progress: ${{ github.event_name == 'pull_request' }}\n\npermissions:\n contents: read\n deployments: write\n\njobs:\n publish-wiki:\n name: publish-wiki\n if: ${{ github.event_name != 'pull_request' }}\n uses: theholocron/.github/.github/workflows/publish-wiki.yml@main\n secrets: inherit\n\n publish-wiki-preview:\n name: publish-wiki\n if: ${{ github.event_name == 'pull_request' }}\n uses: theholocron/.github/.github/workflows/publish-wiki.yml@main\n with:\n preview: true\n preview-id: pr-${{ github.event.pull_request.number }}\n secrets: inherit\n";
1191
+ // src/templates/workflows/reconcile-ci.yml
1192
+ var reconcile_ci_default = "name: reconcile-ci\n\non: # yamllint disable-line rule:truthy\n schedule:\n - cron: \"*/15 * * * *\"\n workflow_dispatch: {}\n\npermissions:\n contents: read\n\njobs:\n reconcile-ci:\n name: reconcile-ci\n uses: theholocron/.github/.github/workflows/reconcile-ci.yml@main\n secrets: inherit\n";
903
1193
  // src/templates/workflows/reconcile-projects.yml
904
1194
  var reconcile_projects_default = "name: reconcile-projects\n\non: # yamllint disable-line rule:truthy\n schedule:\n - cron: \"23 * * * *\"\n workflow_dispatch: {}\n\npermissions:\n contents: read\n\njobs:\n reconcile-projects:\n name: reconcile-projects\n uses: theholocron/.github/.github/workflows/reconcile-projects.yml@main\n secrets: inherit\n";
905
1195
  // src/templates/workflows/release.yml
@@ -1162,6 +1452,7 @@ const WORKFLOW_TEMPLATES = rehomeAll(Object.fromEntries(Object.entries(/* @__PUR
1162
1452
  "../../templates/workflows/preview-specs.yml": preview_specs_default,
1163
1453
  "../../templates/workflows/preview.yml": preview_default,
1164
1454
  "../../templates/workflows/publish-wiki.yml": publish_wiki_default,
1455
+ "../../templates/workflows/reconcile-ci.yml": reconcile_ci_default,
1165
1456
  "../../templates/workflows/reconcile-projects.yml": reconcile_projects_default,
1166
1457
  "../../templates/workflows/release.yml": release_default,
1167
1458
  "../../templates/workflows/remind-doctor.yml": remind_doctor_default,
@@ -1543,6 +1834,16 @@ function aggregateChecks(config, statusContexts) {
1543
1834
  statuses: [...statuses]
1544
1835
  };
1545
1836
  }
1837
+ // src/generators/aggregate-poster/aggregate-poster.ts
1838
+ /**
1839
+ * Who posts the `ci / Required checks` check for a manifest: `"sentinel"` only when `ci.aggregate` says exactly that,
1840
+ * otherwise `"actions"`. A misspelling therefore keeps the poster that exists today (the config loader rejects it with
1841
+ * an error where it can, so this is the quiet fallback, not the validation), and a manifest with no `ci` block, which
1842
+ * is every repo today, is unchanged.
1843
+ */
1844
+ function aggregatePoster(config) {
1845
+ return config.ci?.aggregate === "sentinel" ? "sentinel" : "actions";
1846
+ }
1546
1847
  // src/generators/codecov/codecov.ts
1547
1848
  /**
1548
1849
  * What the rest of Holocron reads from the workspace about Codecov: the packages, their flag names and the upload list.
@@ -3819,6 +4120,10 @@ function runWords(input) {
3819
4120
  * `@theholocron/cli` instantiates it once and delegates the `run` /
3820
4121
  * `ci` / workflow-generation commands to it (like `@theholocron/observability`).
3821
4122
  */
4123
+ /**
4124
+ * Creates the Holocron task runner: `run` / `ci`, the generated workflows, `package.json` scripts, linter set and required
4125
+ * checks, all driven by one `tasks` manifest. `@theholocron/cli` creates it once and delegates to it.
4126
+ */
3822
4127
  function createAstromech(options) {
3823
4128
  const deps = {
3824
4129
  print: options.print ?? ((line) => console.log(line)),
@@ -3936,7 +4241,9 @@ function createAstromech(options) {
3936
4241
  runnableTasks: () => runnableTaskNames(),
3937
4242
  reusableTemplates: () => reusableTemplates(),
3938
4243
  requiredChecks: (aggregate) => requiredChecks(options.config ?? {}, aggregate, options.statusContexts),
4244
+ aggregatePoster: () => aggregatePoster(options.config ?? {}),
3939
4245
  aggregateCaller: () => {
4246
+ if (aggregatePoster(options.config ?? {}) === "sentinel") return null;
3940
4247
  const checks = aggregateChecks(options.config ?? {}, options.statusContexts);
3941
4248
  return checks.expected.length === 0 && checks.statuses.length === 0 ? null : aggregateCaller(checks);
3942
4249
  },
@@ -4215,4 +4522,4 @@ function createConfig$9() {
4215
4522
  function createIgnoreConfig() {
4216
4523
  return `${workflowHeader()}${_yamlignore_default}`;
4217
4524
  }
4218
- export { AGGREGATE_CHECK, CI_ORDER, DCO_CHECK, DEFAULT_ORG, DOCUMENTATION_FLAG, DOT_GITHUB_REPO, HOLOCRON_REPO, KNOWN_TASKS, KNOWN_WORKFLOWS, LEGACY_NAMES, PNPM_BUILTIN_COMMANDS, PRERELEASE_CHANNEL, RELEASE_BRANCHES, RESERVED_SCRIPT_NAMES, REUSABLE_ACTIONS, REUSABLE_WORKFLOWS, SUITES, TASKS, TEMPLATE_HOME, WORKFLOW_CHECK_CONTEXTS, WORKFLOW_TEMPLATES, WORKFLOW_TEMPLATE_PROPERTIES, aggregateChecks, checkPackageScripts, checkReleaseLines, codecovFlagNames, codecovUploads, compareVersions, createAstromech, createConfig as createCommitMsg, createConfig$1 as createDependabot, createConfig$2 as createDevmoji, createConfig$3 as createEditorconfig, createConfig$4 as createEditorconfigChecker, createHeader, createConfig$5 as createLabeler, createConfig$6 as createPreCommit, createConfig$7 as createPrePush, createConfig$8 as createPrepareCommitMsg, createTsconfig, createIgnoreConfig as createYamlignore, createConfig$9 as createYamllint, defaultListDirs, defaultPaths, defaultReadJson, deployOnRelease, deriveDeployPaths, describeTasks, extractPreviewConfig, formatJson, frozenReusablePaths, generateCombinedDeployContent, generateThinCallerContent, hostedReusableWorkflows, idFromSource, isDeprecated, isGeneratedScript, isTask, legacyCaller, legacyCallerFile, legacyFile, legacyGate, legacyName, legacyWorkflowKey, localize, localizeActions, matchNamespace, mergeScripts, normalizeWorkflowWith, packageLocation, planSuites, planTasks, readWorkspacePackages, recordDeploys, requiredChecks, resolveTaskName, reusableTemplates, runCi, runGroup, runTask, scriptName, scriptsFor, stampDeprecated, suiteMembers, taskKey, wedgeFix, workflowFile, workflowKey, workflowKeys, workspacePackages };
4525
+ export { AGGREGATE_CHECK, AGGREGATE_CHECK_NAME, AGGREGATE_SHADOW_CHECK_NAME, AGGREGATE_TIMEOUT_MS, CI_ORDER, DCO_CHECK, DEFAULT_ORG, DOCUMENTATION_FLAG, DOT_GITHUB_REPO, HOLOCRON_REPO, KNOWN_TASKS, KNOWN_WORKFLOWS, LEGACY_NAMES, PNPM_BUILTIN_COMMANDS, PRERELEASE_CHANNEL, RELEASE_BRANCHES, RESERVED_SCRIPT_NAMES, REUSABLE_ACTIONS, REUSABLE_WORKFLOWS, SUITES, TASKS, TEMPLATE_HOME, WORKFLOW_CHECK_CONTEXTS, WORKFLOW_TEMPLATES, WORKFLOW_TEMPLATE_PROPERTIES, aggregateChecks, aggregatePoster, checkPackageScripts, checkReleaseLines, codecovFlagNames, codecovUploads, compareVersions, createAstromech, createConfig as createCommitMsg, createConfig$1 as createDependabot, createConfig$2 as createDevmoji, createConfig$3 as createEditorconfig, createConfig$4 as createEditorconfigChecker, createHeader, createConfig$5 as createLabeler, createConfig$6 as createPreCommit, createConfig$7 as createPrePush, createConfig$8 as createPrepareCommitMsg, createTsconfig, createIgnoreConfig as createYamlignore, createConfig$9 as createYamllint, defaultListDirs, defaultPaths, defaultReadJson, deployOnRelease, deriveDeployPaths, describeTasks, evaluateAggregate, extractPreviewConfig, formatJson, frozenReusablePaths, generateCombinedDeployContent, generateThinCallerContent, hostedReusableWorkflows, idFromSource, isDeprecated, isGeneratedScript, isTask, legacyCaller, legacyCallerFile, legacyFile, legacyGate, legacyName, legacyWorkflowKey, localize, localizeActions, matchNamespace, mergeScripts, normalizeWorkflowWith, packageLocation, planSuites, planTasks, postAggregate, readWorkspacePackages, recordDeploys, requiredChecks, resolveTaskName, reusableTemplates, runCi, runGroup, runTask, scriptName, scriptsFor, stampDeprecated, suiteMembers, taskKey, wedgeFix, workflowFile, workflowKey, workflowKeys, workspacePackages };
@@ -341,6 +341,11 @@ const TASKS = {
341
341
  scope: "repo",
342
342
  local: { command: "reconcile project" }
343
343
  },
344
+ "reconcile-ci": {
345
+ group: "Platform",
346
+ scope: "repo",
347
+ local: { command: "reconcile ci" }
348
+ },
344
349
  "sync-issues": {
345
350
  group: "Platform",
346
351
  scope: "repo",
@@ -81,6 +81,12 @@ interface TasksConfig {
81
81
  * `required`-task contexts. (`DCO` is prepended by `holocron setup` itself.)
82
82
  */
83
83
  extraRequiredChecks?: string[];
84
+ /**
85
+ * Settings of the repo's CI as a whole. Left out, everything is as it was: the Actions poller posts the `ci` aggregate.
86
+ * Read at the **head** ref by Sentinel, so a commit carries both the files that run for it and the word that says who
87
+ * posts (spec `process-sentinel-posts-ci`, SPEC-0099).
88
+ */
89
+ ci?: CiConfig;
84
90
  /**
85
91
  * Git hooks `holocron setup` installs. `true` / `{ prePush: true }` writes
86
92
  * `.husky/pre-push` (runs `holocron run ci`); `false` / `{ prePush: false }`
@@ -91,4 +97,32 @@ interface TasksConfig {
91
97
  prePush?: boolean;
92
98
  };
93
99
  }
94
- export { TaskEntry as n, TasksConfig as r, TaskConfigItem as t };
100
+ /** Who posts the required `ci / Required checks` check: the Actions poller (`ci.yml`) or Sentinel, from webhooks. */
101
+ type CiAggregatePoster = "actions" | "sentinel";
102
+ /** Who may satisfy the required `ci / Required checks` context: one GitHub App, by its integration id. */
103
+ interface CiPin {
104
+ /**
105
+ * The numeric id of the GitHub App (the ruleset's `integration_id`) whose check runs may satisfy
106
+ * `ci / Required checks`. For Sentinel's production App, use its App id (the one `githubApps` and
107
+ * `SENTINEL_GITHUB_APP_ID` hold); a dev instance has another id and does not count. Setting it changes who can merge,
108
+ * so turn it on only once the outage runbook's bypass is settled (spec `process-sentinel-posts-ci`, phase 10).
109
+ */
110
+ integrationId: number;
111
+ }
112
+ /** The `ci` block of the manifest. */
113
+ interface CiConfig {
114
+ /**
115
+ * Who posts `ci / Required checks`. `"actions"` (the default) keeps the thin caller `ci.ci.yml` and the reusable that
116
+ * polls; `"sentinel"` writes neither, because Sentinel posts the check under that name for a commit whose own config
117
+ * says so. Each commit has exactly one poster: the setting and the generated files change together in one pull
118
+ * request, which `probe generated check` enforces.
119
+ */
120
+ aggregate?: CiAggregatePoster;
121
+ /**
122
+ * Opt in to pinning the required `ci / Required checks` context to one GitHub App. Off when omitted: the ruleset names
123
+ * the context only, so any app (or a workflow) can satisfy it. `holocron setup` writes `integration_id` on that one
124
+ * entry of a `strict` repo's ruleset; `holocron doctor repo` compares it. Other required checks are never pinned.
125
+ */
126
+ pin?: CiPin;
127
+ }
128
+ export { TaskEntry as a, TaskConfigItem as i, CiConfig as n, TasksConfig as o, CiPin as r, CiAggregatePoster as t };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theholocron/astromech",
3
- "version": "5.0.0-alpha.520",
3
+ "version": "5.0.0-alpha.522",
4
4
  "description": "The Holocron task runner — one task manifest drives `holocron run`, `holocron run ci`, the CI workflows, package.json scripts, linters, and required checks.",
5
5
  "keywords": [
6
6
  "ci",
@@ -55,11 +55,11 @@
55
55
  "@commitlint/lint": "^21.2.3",
56
56
  "@commitlint/load": "^21.2.3",
57
57
  "@commitlint/types": "^21.2.3",
58
+ "@theholocron/datapad": "5.0.0-alpha.522",
59
+ "@theholocron/fs-utils": "^1.17.0-alpha.5",
58
60
  "@theholocron/json-utils": "^1.17.0-alpha.5",
59
- "@theholocron/datapad": "5.0.0-alpha.520",
60
- "@theholocron/misc-utils": "^1.17.0-alpha.5",
61
61
  "@theholocron/pkg-utils": "^1.17.0-alpha.5",
62
- "@theholocron/fs-utils": "^1.17.0-alpha.5"
62
+ "@theholocron/misc-utils": "^1.17.0-alpha.5"
63
63
  },
64
64
  "devDependencies": {
65
65
  "@commitlint/config-conventional": "^21.2.3",
@@ -75,11 +75,11 @@
75
75
  "vitest": "^5.1.0",
76
76
  "@theholocron/ci": "1.0.0",
77
77
  "@theholocron/commitlint-config": "^8.9.0-alpha.22",
78
- "@theholocron/eslint-config": "^8.9.0-alpha.22",
79
78
  "@theholocron/rollup-plugin-transform-template": "^8.9.0-alpha.22",
80
- "@theholocron/vitest-config": "^8.9.0-alpha.22",
81
79
  "@theholocron/tsconfig": "^8.9.0-alpha.22",
82
- "@theholocron/tsdown-config": "^8.9.0-alpha.22"
80
+ "@theholocron/eslint-config": "^8.9.0-alpha.22",
81
+ "@theholocron/tsdown-config": "^8.9.0-alpha.22",
82
+ "@theholocron/vitest-config": "^8.9.0-alpha.22"
83
83
  },
84
84
  "engines": {
85
85
  "node": ">=22"