@theholocron/astromech 5.0.0-alpha.58 → 5.0.0-alpha.581

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
@@ -1,7 +1,7 @@
1
1
  # `@theholocron/astromech`
2
2
 
3
3
  The Holocron task runner. One **task manifest** per repo, and every
4
- derived surface comes from it: `holocron run` (local), `holocron ci` (the
4
+ derived surface comes from it: `holocron run` (local), `holocron run ci` (the
5
5
  CI suite run locally), the generated GitHub Actions workflows, the
6
6
  `package.json` scripts, and the branch-protection required-checks list.
7
7
 
@@ -24,69 +24,85 @@ import { createAstromech } from "@theholocron/astromech";
24
24
 
25
25
  const astromech = createAstromech({ cwd });
26
26
 
27
- const report = astromech.run("verification.unitTests", { passthrough: ["--watch"] });
27
+ const report = astromech.run("test:unit", { passthrough: ["--watch"] });
28
28
  // → { status: "ok" | "fail" | "skip" | "dry-run" | "unknown", command?, message? }
29
29
  ```
30
30
 
31
31
  ### `holocron run <task>` resolution
32
32
 
33
- `holocron run verification.unitTests` runs your tests — you don't tell it
34
- turbo vs pnpm vs npm, or which runner:
33
+ `holocron run test:unit` runs your unit tests, `holocron run test` the whole `test` suite — you don't tell it
34
+ turbo vs pnpm vs npm, or which runner. The words are joined with `:` and the longest match against the registry wins
35
+ (`test unit` is `test:unit`, `deploy preview` is `deploy-preview`); what is left is the `[job]` argument. A suite
36
+ (`test`, `lint`, `scan`) is declared by the `suite` field of its leaves in the registry and runs the leaves the repo's
37
+ `tasks:` lists, in registry order; `format` is its own verb (prettier only; writes, `--check` reads). The old dotted
38
+ names (`LEGACY_NAMES`) are accepted in `tasks:` and by `run`, with a deprecation notice on stderr:
35
39
 
36
- ```
40
+ ```text
37
41
  1. turbo.json defines the task → turbo run <task>
38
42
  2. package.json has a <task> script → <detected pm> run <task>
39
- (a "holocron run …" thin caller is skipped — no recursion)
40
- 3. the registry has a local runner → <tool> <args> <org-flags> (e.g. --coverage)
43
+ (a "holocron run …" thin caller is skipped — no recursion; so is the root script generated from the
44
+ registry's own command, which step 3 runs itself)
45
+ 3. the registry has a local runner → <tool> <args> (`test:unit` is `vitest run --coverage`)
41
46
  3b. the task is a linterGroup → each resolved linter, run natively
42
- 4. the task is a container of jobs → each job, in declared order
43
- 5. known task, nothing to run → "no <task> task", exit 0 (exit 1 with --required)
44
- 6. unknown task → error, exit 1
47
+ 4. known task, nothing to run → "no <task> task", exit 0 (exit 1 with --required)
48
+ 5. unknown task → error, exit 1
45
49
  ```
46
50
 
47
51
  ## Intent → technology
48
52
 
49
53
  Tasks are named by **intent**, not by tool — a repo declares
50
- `verification.unitTests`, not `vitest`. The table below is the full
51
- registry (`TASKS` in `src/registry.ts`): every task name astromech knows,
54
+ `test:unit`, not `vitest`. (The dotted names such as `verification.unitTests` are the old spelling; they still <!-- holocron-allow-old-name -->
55
+ work as aliases, see `LEGACY_NAMES`, but nothing generated uses them for a repo on flat ids.)
56
+ The table below is the full
57
+ registry (`TASKS` in `src/registry/registry.ts`): every task name astromech knows,
52
58
  what it actually runs, and why. Tool names never appear in
53
59
  `holocron.config.ts` — they're an implementation detail this table
54
60
  documents, not a naming convention repos need to follow.
55
61
 
56
- | Task | Runs | Notes |
57
- | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
58
- | `verification.unitTests` | vitest | carries the `--coverage` org default |
59
- | `verification.typeSafety` | tsc | `tsc --noEmit` |
60
- | `verification.performance` | Lighthouse CI | only runs with a `lighthouse.config.*` present |
61
- | `sourceQuality.staticAnalysis` | eslint, actionlint, git-merge-conflict-markers | a `linterGroup` — see below |
62
- | `sourceQuality.formatting` | prettier, editorconfig-checker, markdownlint-cli2 | a `linterGroup` |
63
- | `sourceQuality.structuredDataValidation` | yamllint | |
64
- | `sourceQuality.deadCodeAnalysis` | knip | |
65
- | `security.secretDetection` | gitleaks | |
66
- | `security.codeScanning` | CodeQL | no local equivalent — CI only |
67
- | `security.dependencyReview` | GitHub's native Dependabot alerts/graph | a capability-model method (`Source.enableVulnerabilityAlerts()`), not a task |
68
- | `delivery.build` | tsdown / vite / rollup / tsc, detected from the repo's own config file, or `package.json`'s own `dependencies`/`devDependencies` if that config file isn't there | |
69
- | `delivery.publish` | semantic-release | no local equivalent — CI only; carries `preview` (npm dist-tags) |
70
- | `delivery.deploy` | Cloudflare Pages / Vercel | no local equivalent — CI only; carries `preview` |
71
- | `delivery.bundleSize` | bundle-size upload to Codecov | no local equivalent — CI only |
72
- | `platform.repoSync` | `holocron sync` | keeps generated files current |
73
- | `platform.commitStandards` | commitlint | no local equivalent — enforced by the `commit-msg` hook locally, over the PR's commit range in CI |
74
- | `platform.repoValidation` | `scripts/validate-adrs.mjs`, `scripts/validate-registry.mjs`, `scripts/validate-docs-presence.mjs` | a job-bearing task — spec/ADR frontmatter, registry-doc completeness, and docs-presence, not linters |
75
- | `knowledge.wiki` | Fern | publishes `docs/wiki/*.md` — not a sync, a publish; carries `preview` |
76
- | `knowledge.docs` | Astro build | the docs site itself; carries `preview` (defaults on) |
77
- | `knowledge.components` | Storybook build | a browsable component catalog — "Storybook" is the tool, not the intent; carries `preview` (defaults on) |
62
+ | Task | Runs | Notes |
63
+ | ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
64
+ | `test:unit` | vitest | always runs with coverage: `vitest run --coverage`, there is no flag |
65
+ | `typecheck` | tsc | `tsc --noEmit` |
66
+ | `test:perf` | Lighthouse CI | only runs with a `lighthouse.config.*` present |
67
+ | `lint:code` | eslint, actionlint, git-merge-conflict-markers | a `linterGroup` — see below |
68
+ | `lint:editorconfig`, `lint:markdown` | editorconfig-checker, markdownlint-cli2 | each is a `linterGroup` of one tool |
69
+ | `format` | prettier | writes by default, `--check` is read-only; no workflow of its own |
70
+ | `lint:data` | yamllint | |
71
+ | `lint:unused` | knip | |
72
+ | `scan:secrets` | gitleaks | |
73
+ | `scan:code` | CodeQL | no local equivalent — CI only |
74
+ | `check-tokens` | `holocron doctor secrets --verify` | scheduled daily in CI; fails on a rejected token or one with 7 days or fewer left; never part of `run ci` |
75
+ | `doctor-tokens` | `holocron doctor tokens` | scheduled daily in CI; each layer's tokens against their declaration; unreadable layers skip; never part of `run ci` |
76
+ | `build` | tsdown / vite / rollup / tsc, detected from the repo's own config file, or `package.json`'s own `dependencies`/`devDependencies` if that config file isn't there | |
77
+ | `release` | semantic-release | no local equivalent — CI only; carries `preview` (npm dist-tags) |
78
+ | `deploy` | Cloudflare Pages / Vercel | no local equivalent — CI only; carries `preview` |
79
+ | `measure:bundle` | bundle-size upload to Codecov | no local equivalent — CI only |
80
+ | `check-preview` | `holocron check monitor <url>` against the PR's own Vercel preview URL | no local equivalent — CI only; triggered by `deployment_status`, not `push`/`pull_request` |
81
+ | `check-notify` | _(none — manual workflow)_ | posts a labelled test message to every notification channel; fails per channel that does not work |
82
+ | `sync-repo` | `holocron sync` | keeps generated files current |
83
+ | `lint:commits` | commitlint | no local equivalent — enforced by the `commit-msg` hook locally, over the PR's commit range in CI |
84
+ | `validate:specs` | `holocron probe specs check` | spec/ADR frontmatter — a leaf of the `validate` suite, not a linter |
85
+ | `validate:docs` | `holocron probe docs validate` | docs presence (warns) and token docs (fails) — a leaf of the `validate` suite, not a linter |
86
+ | `validate:deps` | `holocron probe deps check` | dependency catalogs — a leaf of the `validate` suite, not a linter |
87
+ | `validate:generated` | `holocron probe generated check` | generated files match the config — a leaf of the `validate` suite, not a linter |
88
+ | `measure:docs` | `holocron probe docs coverage` | doc-comment coverage, uploaded to Codecov as the `documentation` flag; the Codecov status gates, not the job |
89
+ | `remind-doctor` | _(none — posts through a webhook secret)_ | a weekly #alerts line that reminds a maintainer to run `doctor notifications --post` |
90
+ | `publish-wiki` | Fern | publishes `docs/wiki/*.md` — not a sync, a publish; carries `preview` |
91
+ | `deploy-docs` | Astro build | the docs site itself; carries `preview` (defaults on) |
92
+ | `deploy-components` | Storybook build | a browsable component catalog — "Storybook" is the tool, not the intent; carries `preview` (defaults on) |
78
93
 
79
94
  **`preview` is a cross-cutting feature, not a namespace.** npm has staging
80
95
  dist-tags, Cloudflare/Vercel do per-PR preview deploys, Fern previews
81
96
  docs — none of these earn their own task or verb; it's one capability any
82
97
  publish/deploy-shaped task can carry, toggled via that task's `with:`.
83
98
 
84
- **`linterGroup` tasks** (`sourceQuality.staticAnalysis`,
85
- `sourceQuality.formatting`) bundle more than one tool under a single
86
- required check. Each tool is still gated by its own detection rule (e.g.
87
- `eslint` only runs if `eslint.config.*` is present) — the
99
+ **`linterGroup` tasks** (`lint:code`) bundle more than one tool under a single
100
+ required check. Each tool is still gated by its own detection rule — e.g.
101
+ `eslint` runs when either a local `eslint.config.*` is present, or the
102
+ package has no local file but `@theholocron/eslint-config` resolves
103
+ (the same shared-config splice the `tool`/`detect` runner path uses) — the
88
104
  `tool name → detection rule → local binary` mapping lives in one place,
89
- `src/linters.ts`. A repo's choice of which of these run is just which
105
+ `src/tasks/run/linters/linters.ts`. A repo's choice of which of these run is based on which
90
106
  tasks it includes in `tasks: [...]`, same as any other task.
91
107
 
92
108
  **No super-linter.** Each task above runs its own tool directly, through
@@ -106,9 +122,9 @@ import { defineConfig } from "@theholocron/astromech/config";
106
122
 
107
123
  export default defineConfig({
108
124
  tasks: [
109
- "verification.typeSafety",
110
- { name: "verification.unitTests", required: true, with: { "run-coverage": true } },
111
- { name: "security.codeScanning", ci: true, local: false }, // CI-only
125
+ "typecheck",
126
+ { name: "test:unit", required: true, with: { "run-coverage": true } },
127
+ { name: "scan:code", ci: true, local: false }, // CI-only
112
128
  ],
113
129
  });
114
130
  ```
@@ -116,10 +132,13 @@ export default defineConfig({
116
132
  `loadTasksConfig(cwd)` resolves the manifest: the `tasks` key of
117
133
  `holocron.config.*` (a bare item array), then a dedicated
118
134
  `astromech.config.*` merged on top (dedicated wins; arrays concatenate).
135
+ A caller that loads the two sources some other way (Sentinel reads them
136
+ through the GitHub API) layers them with datapad's `loadLayeredFromContent()`
137
+ and `coerceTasks` from this entry.
119
138
 
120
139
  | `TaskEntry` field | Effect |
121
140
  | ------------------------ | ----------------------------------------------------------- |
122
- | `ci` (default `true`) | emit the CI workflow; include in `holocron ci` |
141
+ | `ci` (default `true`) | emit the CI workflow; include in `holocron run ci` |
123
142
  | `local` (default `true`) | write the `package.json` script; `holocron run` resolves it |
124
143
  | `local: false` | `holocron run <name>` → "CI-only task", exit 0 |
125
144
  | `required` | the task's check context is a required status check |
@@ -127,7 +146,7 @@ export default defineConfig({
127
146
 
128
147
  Top-level keys: `syncScripts: false` disables the `package.json` script
129
148
  writes entirely; `holocronScript` sets the command the synced `"holocron"`
130
- script runs (default `"holocron"`).
149
+ script runs (default `"holocron"`) and the one the generated git hooks call.
131
150
 
132
151
  ### Generated surfaces
133
152
 
@@ -135,9 +154,9 @@ script runs (default `"holocron"`).
135
154
  const astromech = createAstromech({ cwd, config, orgContext: { org, domain } });
136
155
 
137
156
  astromech.thinCallers(); // Map<"<name>.yml", yaml> — one per templated, ci-enabled task
138
- astromech.packageScripts(); // { holocron: "holocron", "verification.unitTests": "holocron run verification.unitTests", … }
139
- astromech.requiredChecks(); // ["Typecheck / tsc --noEmit", "codecov/patch", …] — branch-protection contexts
140
- astromech.codecovConfig(existing); // codecov.yml content — merges into `existing`, or scaffolds fresh when null
157
+ astromech.packageScripts(); // single package: { holocron: "holocron", "test:unit": "holocron run test unit --", … }; workspace: { "test:unit": "turbo run test:unit", … }
158
+ astromech.requiredChecks(true); // ["ci / Required checks", DCO_CHECK] — branch-protection contexts (false: DCO_CHECK, then the per-task contexts, then extras); DCO_CHECK is Sentinel's `validate:dco / Run Developer Certificate of Origin`
159
+ astromech.aggregateCaller(); // the thin caller of the `ci` aggregate check, or null when nothing is required
141
160
  astromech.ci({ scope: "required" }); // CiReport — run the gating checks locally, in CI order
142
161
  ```
143
162
 
@@ -145,56 +164,145 @@ astromech.ci({ scope: "required" }); // CiReport — run the gating checks local
145
164
  the same resolution as `run()`, in `CI_ORDER`, and returns `{ status, jobs }`.
146
165
  A `required` task whose local runner can't run is a failure — **except** a
147
166
  task that's genuinely CI-only (`local: null`, or a `linterGroup` whose every
148
- member lacks a local binary entirely, like `platform.commitStandards`),
149
- which is reported skipped even when required. `holocron ci` sets the
167
+ member lacks a local binary entirely, like `lint:commits`),
168
+ which is reported skipped even when required. `holocron run ci` sets the
150
169
  process exit code from `status`.
151
170
 
152
171
  `thinCallers()` returns the raw `.github/workflows/*.yml` content (no
153
- generated-by header — the caller prefixes its own). `delivery.deploy` /
154
- `knowledge.docs` / `knowledge.components` with `preview:` produce the
172
+ generated-by header — the caller prefixes its own). `deploy` /
173
+ `deploy-docs` / `deploy-components` with `preview:` produce the
155
174
  combined push-to-Pages / PR-to-preview workflow —
156
- `knowledge.docs`/`knowledge.components` default `preview` on, since
175
+ `deploy-docs`/`deploy-components` default `preview` on, since
157
176
  neither has a plain-production-only fallback template.
158
177
  `packageScripts()` emits the `holocron` entry (`holocronScript ?? "holocron"`)
159
- plus one `"<task>": "holocron run <task>"` per runnable task; it skips
178
+ plus the scripts `scriptsFor(config, registry, { monorepo })` computes; it skips
160
179
  `local: false` entries and tasks with no local runner at all, and returns
161
- `{}` when `syncScripts: false` or there is no config.
180
+ `{}` when `syncScripts: false` or there is no config. The same function backs `sync`, which merges the result with
181
+ `mergeScripts()`, and `probe generated check`, which fails on a root script that differs and on a script that breaks the
182
+ rules of `checkPackageScripts()`.
183
+
184
+ #### Scripts and `turbo.json`
185
+
186
+ `scriptsFor()` is the one rule for what a root script calls (spec `ci-flat-task-vocabulary`):
187
+
188
+ | Repo | Package-scoped leaf (`build`, `test:unit`) | Repo-scoped leaf (`lint:markdown`, `format`) | Suite (`test`, `lint`) |
189
+ | ---------------------------------------------- | ------------------------------------------ | --------------------------------------------- | ------------------------- |
190
+ | a pnpm workspace with a generated `turbo.json` | `turbo run <key>` | the tool's own command (`prettier --write .`) | `turbo run <suite>` |
191
+ | a single package | `holocron run <words> --` | `holocron run <words> --` | `holocron run <suite> --` |
192
+
193
+ A leaf with no local command (`scan:code`, `lint:commits`, `release`, a holocron subcommand) has no script in a
194
+ workspace. `holocron` may not be built on a fresh clone while turbo is an ordinary devDependency, which is why a
195
+ workspace calls turbo directly. In a workspace `turboConfig()` also writes each suite as a task with no script that
196
+ `dependsOn` its leaves, and a `//#<id>` root task (`cache: false`, since it reads every package's files) for each
197
+ repo-scoped leaf that belongs to a suite, which is how a suite reaches the root tool. A package's own leaf script holds the
198
+ real tool command and never calls turbo or `holocron run`, and no package carries a script named like a suite.
199
+
200
+ The key a package-scoped leaf has in `turbo.json`, and so the name of its script in every package, **follows how the
201
+ manifest spells the task**: `{ name: "test:unit" }` gives `test:unit`, `{ name: "test:unit" }` keeps
202
+ `test:unit`. A repo's packages hold scripts in the vocabulary its `tasks:` list speaks, so rewriting the list
203
+ to flat ids is what moves its keys, and the package scripts with them (`taskKey()`).
162
204
 
163
205
  ### Required checks
164
206
 
165
- `requiredChecks()` derives the branch-protection required-status-check list
166
- from the manifest: every `{ required: true }` task's check context, ordered
167
- by `CI_ORDER`, then `config.extraRequiredChecks` (codecov gates, …),
168
- de-duplicated. Most tasks are single always-run jobs now, so their context
169
- names that job directly (`"Typecheck / tsc --noEmit"`) — the `… /
170
- Conclusion` fan-in aggregate is only used where a task genuinely has
207
+ `requiredChecks(aggregate)` is the branch-protection required-status-check list. With the `ci` aggregate (the repo
208
+ contains it, see below) it is `["ci / Required checks", DCO_CHECK]`. Without it, it is `DCO_CHECK`, then every `{ required: true }` task's check
209
+ context, ordered by `CI_ORDER`, then `config.extraRequiredChecks` (codecov gates, …), de-duplicated. Most tasks are
210
+ single always-run jobs now, so their context
211
+ names that job directly (`"typecheck / Run tsc --noEmit"`) — the `… /
212
+ Conclusion` fan-in job inside a workflow is only used where a task genuinely has
171
213
  several conditionally-run jobs feeding one check
172
- (`verification.unitTests`, `platform.repoValidation`). `holocron setup`
173
- prepends `"DCO"` and applies the list for `protection: "strict"` repos.
174
- Policy-free — manifest only.
214
+ (`test:unit`). `holocron setup`
215
+ applies the list for `protection: "strict"` repos. Policy-free — manifest only.
216
+
217
+ ### The `ci` aggregate
218
+
219
+ `aggregateChecks(config, statusContexts?)` derives what the reusable `ci.yml` (in `ci/workflows/`) waits on, from the same list: the
220
+ `expected` ids are the part before `/` of each required task's context and of each `extraRequiredChecks` entry that
221
+ is not a coverage status (the hand-written `Generated files / Check` becomes `Generated files`), and `statuses` are
222
+ the coverage entries. Astromech imports no provider, so a `coverage` provider's contexts (`{ name, required }[]`, from the CLI) come in as the optional `statusContexts` argument (of `aggregateChecks()`, `requiredChecks()`, `taskCheckContexts()`, and `createAstromech({ statusContexts })`): a context is a status when the provider names it, and the provider's required ones are added after `extraRequiredChecks`. Without it, a context starting with `codecov/` is a status and nothing is added, which is what runs with no provider loaded do. `aggregateCaller()` renders the `pull_request` caller, whose job `ci` calls the reusable's `Required checks` job.
223
+ `holocron sync` writes it only in the repo that contains the reusables. The ids are today's check names; the later
224
+ rename changes them here and costs no ruleset edit.
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
+
237
+ `requiredChecksVerdict({ expected, statuses, checkRuns, commitStatuses, incomplete? })` is the verdict for a repo with no
238
+ aggregate (`ci: { aggregate: "none" }`; SPEC-0118, #2754, step 1): the same question, "are the required checks green?",
239
+ answered from the newest run of each required check, as `{ state: "success" | "failure" | "pending" | "none", failing }`
240
+ (the shape of the CLI's `PullRequestChecks`; each `failing` entry is `{ name, url?, required }`). It is pure and runs
241
+ `evaluateAggregate()` and `newestCheckRuns()` with no deadline, so matching is theirs, and `evaluateAggregate()` itself is
242
+ unchanged. When a required check is not yet green and not failed, the verdict also has `pending`, the ids of those checks in the order of `expected` then `statuses` (a cancelled newest run counts; absent when there are none or the state is `none`). Nothing calls it yet; `close work`, the board and Sentinel will, so the rule lives in one place. The rules:
243
+
244
+ - Only the newest run of each name counts; `skipped` and `neutral` pass.
245
+ - `success` only when every required check is satisfied; one that has not posted is `pending`.
246
+ - `failure` as soon as a required check's newest run failed (`failure`, `timed_out`, `startup_failure`, `action_required`,
247
+ `stale`), because waiting cannot turn it green.
248
+ - A re-run still going over an earlier failure is `pending`; so is a `cancelled` newest run (`evaluateAggregate()` counts
249
+ that as a failure).
250
+ - An empty `expected` list or an `incomplete` read is `none`, never `success`.
251
+ - Only required checks decide: a failing optional check is listed in `failing` with `required: false` and never changes `state`.
175
252
 
176
253
  ### `codecov.yml`
177
254
 
178
- `codecovConfig(existing)` generates this repo's `codecov.yml` — component
179
- `paths` derived from `packages/*` **and** `apps/*` (monorepo templates ship
180
- user-facing code under `apps/` alongside library code under `packages/`;
181
- `readWorkspacePackages()` scans both and tags each result with the `dir` it
182
- came from), same manifest-derived category as `thinCallers()`. Pass the
183
- current file's content (or `null`) and it either merges the
184
- `individual_components` list in (preserving everything else in the file —
185
- thresholds, flags, custom rules) or scaffolds a fresh file from the base
186
- template. `holocron setup` writes the result via the `source` capability;
187
- this method never touches the filesystem beyond reading `packages/*` and
188
- `apps/*` under `cwd`.
255
+ Astromech no longer writes `codecov.yml`: the `coverage` provider does, through its optional `Coverage.configFiles()`
256
+ (`@theholocron/holocron-plugin-codecov`), and astromech imports no plugin. What stayed here is what other code reads from
257
+ the workspace: `readWorkspacePackages()` (every package the `pnpm-workspace.yaml` declares, sorted by location, each with
258
+ its `slug`, `dir` or `path`), `packageLocation()` (where one lives), `codecovFlagNames()` (one flag per package, none for
259
+ `docs`), `codecovUploads()` (the `uploads` input of the unit-test workflow) and `DOCUMENTATION_FLAG`. The CLI turns them
260
+ into the provider's input; `holocron setup` writes the result and `holocron probe generated check` compares it.
261
+
262
+ ## Release-time deploys — `deployOnRelease`
263
+
264
+ Deploys the workspace packages whose manifest declares it (holocron#930):
265
+
266
+ ```ts
267
+ // packages/<app>/holocron.config.ts
268
+ tasks: [{ name: "deploy", with: { on: "release", channel: "alpha" } }];
269
+ ```
270
+
271
+ `holocron deploy on-release --channel=<alpha|main> --from=<previous release commit> --to=<release commit>`
272
+ (or `deployOnRelease()` from `@theholocron/astromech`) deploys each such package
273
+ when the release is on its `channel` (default `main`, the stable release;
274
+ set `alpha` for prereleases) and changes the package or one of its `workspace:*` dependencies
275
+ (`with.paths` overrides that), once npm serves the release's new dependency
276
+ versions, by running `pnpm --filter <package> deploy`. A package
277
+ that doesn't apply to the release is skipped; a deploy that fails exits
278
+ non-zero. The shared `release` workflow runs it as a separate `deploy`
279
+ job after the release job (opt in with `deploy-on-release: true`), so a deploy
280
+ is its own re-runnable check. A `deploy` task with `on: "release"`
281
+ generates no workflow.
282
+
283
+ Each package is compared from the commit it was last deployed at, not only from
284
+ `from`: a successful deploy is recorded as a `deployed/<package>` tag
285
+ (`@theholocron/sentinel` is `deployed/theholocron-sentinel`) at the release
286
+ commit, so a release whose deploy job failed is made up by the next release, even
287
+ one that touches nothing in the app. A package with no tag yet (or one whose tag
288
+ is not an ancestor of `to`) falls back to `from`, and its skip line says
289
+ `No deploy is recorded for it yet.`
290
+
291
+ `deployOnRelease()` itself writes no tag: with `recordFile` it lists the packages
292
+ that deployed, and `recordDeploys({ cwd, file, token, print })` (a later step,
293
+ the only one given a write token) tags and pushes them, handing the token to
294
+ `git push` through `GIT_CONFIG_*` so it is never in argv or `.git/config`. A tag
295
+ that cannot be pushed fails that step, naming the package. A dry run writes
296
+ nothing.
189
297
 
190
298
  ## Development
191
299
 
192
- | Script | Description |
193
- | --------------------------------------- | ------------------------------------------- |
194
- | `pnpm run delivery.build` | Bundle with tsdown |
195
- | `pnpm run verification.unitTests` | Run the vitest suite (always with coverage) |
196
- | `pnpm run verification.typeSafety` | `tsc --noEmit` |
197
- | `pnpm run sourceQuality.staticAnalysis` | ESLint |
300
+ | Script | Description |
301
+ | -------------------- | ------------------------------------------- |
302
+ | `pnpm run build` | Bundle with tsdown |
303
+ | `pnpm run test:unit` | Run the vitest suite (always with coverage) |
304
+ | `pnpm run typecheck` | `tsc --noEmit` |
305
+ | `pnpm run lint:code` | ESLint |
198
306
 
199
307
  ## Releases
200
308
 
@@ -202,4 +310,51 @@ Automated via semantic-release. See [CHANGELOG.md](../../CHANGELOG.md).
202
310
 
203
311
  ## Documentation
204
312
 
205
- <https://theholocron.github.io/holocron/>
313
+ <https://docs.theholocron.dev/holocron/>
314
+
315
+ ## Lint — `@theholocron/astromech/lint`
316
+
317
+ The lint tools' own data and checks, in a subpath so the runner and the
318
+ config surface don't pull `@commitlint/*` in:
319
+
320
+ - `lintCommitMsgFile(file, cwd)` / `lintCommitMessage(message, config)` —
321
+ what `holocron run lint commit-msg <file>` (the `commit-msg` hook) runs.
322
+ - `ALEX_CONFIG`, `ALEX_IGNORE_PATTERNS`, `PRETTIER_IGNORE_PATTERNS`,
323
+ `EDITORCONFIG_CHECKER_EXCLUDE` and `isEditorConfigExcluded(path)` — read
324
+ from the same templates `holocron setup` writes, so Sentinel's central
325
+ checks skip exactly what each repo's own CI skips.
326
+
327
+ The root entry also exports the config-file generators `holocron setup`
328
+ writes (`createEditorconfig`, `createPrePush`, …) and
329
+ `createHeader`.
330
+
331
+ ## Repo validation — `@theholocron/astromech/repo-validation`
332
+
333
+ The rules of the `validate:specs` and `validate:docs` checks, once, as pure functions over plain data (changed files, commit
334
+ subjects, the PR description, a manifest) that return findings. They do no git, no filesystem and no network, so the two
335
+ interfaces that run them only supply the data: the CLI (`holocron probe docs presence` and `holocron probe specs check`, the two leaves of
336
+ the `validate` suite) from git and the filesystem, and [Sentinel](https://docs.theholocron.dev/holocron/sentinel/) from the
337
+ webhook and the GitHub API (#929).
338
+
339
+ - Docs presence: `isFeat(subjects)`, `packageOf(file, readPackage)`, `pageNames(dir)`, `hasDocsSignal(dir, changedFiles, addedCommentLines)`,
340
+ `isAddedDocComment(line)`, `parseSkipDocs(text)` (the `[skip docs] <reason>` marker) and
341
+ `evaluateDocsPresence({ packages, changedFiles, addedCommentLines, skip })`, which sorts a feature's packages into
342
+ those to warn about and those a marker excused.
343
+ - ADRs and specs: `checkSpecs(files)` takes `{ path, text }` pairs and returns `{ fileCount, findings }`, skipping a path that
344
+ is neither an ADR nor a spec; underneath it are `classifySpecPath(path)`, `parseFrontmatter(text)`,
345
+ `validateAdr(path, text)`, `validateSpec(path, text)` and `isValidIsoDate(value)`, and the folders and status sets
346
+ (`ADR_DIR`, `SPEC_DIRS`, `ADR_STATUSES`, `SPEC_STATUSES`). A `SpecFinding` is an `error` (fails the check) or a
347
+ `warning` (never does), with the file, the field's line and the rule.
348
+
349
+ ## Upgrade — `@theholocron/astromech/upgrade`
350
+
351
+ The repo-agnostic machinery behind `holocron upgrade`, in a subpath so the CLI and any other tool can use it.
352
+
353
+ - `runUpgradeNode({ to, from?, cwd?, dryRun?, extra?, logger? })` walks the repo and rewrites every Node.js major pin:
354
+ `engines.node`, an exact `@types/node`, `.nvmrc`, `.node-version`, workflow `node-version:`, Dockerfile
355
+ `FROM node:` and `.tool-versions`. `from` is read from `.nvmrc` or `engines.node` when omitted. It never throws:
356
+ a failure is `{ status: "fail", message }`. Underneath are `patchPackageJson`, `patchYaml`, `patchPinFile`,
357
+ `patchDockerfile`, `patchToolVersions` and `detectNodeMajor`.
358
+ - `fetchLatestFromNpm(pkg)` resolves a package's `latest` dist-tag from the npm registry, or `null` on any failure.
359
+
360
+ What counts as a Holocron pin (`@theholocron/*`) and the `holocron.config.ts` migration stay in `@theholocron/cli`.
@@ -1,5 +1,51 @@
1
- import { i as normalizeTaskEntry, n as TaskEntry, r as TasksConfig, t as TaskConfigItem } from "../schema-D01VYg43.mjs";
2
- //#region src/config/define.d.ts
1
+ /**
2
+ * `@theholocron/astromech/config` — the config surface, kept in a
3
+ * zero-runtime-dep entry so `astromech.config.ts` and `@theholocron/cli`
4
+ * can import it without pulling the task runner.
5
+ */
6
+ import { a as TaskEntry, i as TaskConfigItem, n as CiConfig, o as TasksConfig, r as CiPin, t as CiAggregatePoster } from "../schema.type-MUEwDLrg.mjs";
7
+ import { Loaded } from "@theholocron/datapad";
8
+ /**
9
+ * The `tasks` config shape — the single manifest of what a repo runs.
10
+ * Read from a dedicated `astromech.config.*` file or the `tasks` key of
11
+ * `holocron.config.*` (see {@link loadTasksConfig}).
12
+ *
13
+ * Runtime validation is the loader's job, not this type's — the type only
14
+ * describes what an author writes.
15
+ */
16
+ /** Normalise a `TaskConfigItem` to a full {@link TaskEntry} with defaults applied. */
17
+ export declare function normalizeTaskEntry(item: TaskConfigItem): Required<Pick<TaskEntry, "name" | "ci" | "local">> & TaskEntry;
18
+ /**
19
+ * The `tasks` value in each source. A dedicated `astromech.config.*`
20
+ * default-exports the full {@link TasksConfig} object; the `tasks` key of
21
+ * `holocron.config.*` is the bare item array (it mirrors the old
22
+ * `workflows` key). Either form is accepted from either source.
23
+ */
24
+ type TasksInput = TasksConfig | TaskConfigItem[];
25
+ interface LoadTasksConfigOptions {
26
+ /**
27
+ * The `holocron.config.*` the caller has already loaded (`null`: it looked and
28
+ * there is none), so it isn't found and loaded a second time. Leave it unset
29
+ * to have `loadTasksConfig` find it itself.
30
+ */
31
+ holocron?: Loaded<object> | null;
32
+ }
33
+ /**
34
+ * Resolve the task manifest for a repo: the `tasks` key of
35
+ * `holocron.config.*`, then a dedicated `astromech.config.*` merged on
36
+ * top (dedicated wins; item arrays concatenate). Returns `{}` when
37
+ * neither source is present.
38
+ *
39
+ * `walkUp: true` — `holocron run`/`ci` are usable from any subdirectory of
40
+ * a repo, not only its exact root (datapad walks up to the nearest `.git`
41
+ * boundary; see `@theholocron/datapad`'s own doc comment).
42
+ *
43
+ * A caller that has already loaded `holocron.config.*` passes it as
44
+ * `options.holocron` so it is not found and loaded again.
45
+ */
46
+ export declare function loadTasksConfig(cwd: string, options?: LoadTasksConfigOptions): Promise<TasksConfig>;
47
+ /** A bare item array is shorthand for `{ tasks: [...] }`. */
48
+ export declare function coerceTasks(value: TasksInput | undefined): TasksConfig | undefined;
3
49
  /**
4
50
  * Typed identity helper for `astromech.config.ts`:
5
51
  *
@@ -11,15 +57,12 @@ import { i as normalizeTaskEntry, n as TaskEntry, r as TasksConfig, t as TaskCon
11
57
  * });
12
58
  * ```
13
59
  */
14
- declare const defineConfig: <C extends TasksConfig>(config: C) => C;
15
- //#endregion
16
- //#region src/config/load.d.ts
60
+ export declare const defineConfig: <C extends TasksConfig>(config: C) => C;
17
61
  /**
18
- * Resolve the task manifest for a repo: the `tasks` key of
19
- * `holocron.config.*`, then a dedicated `astromech.config.*` merged on
20
- * top (dedicated wins; item arrays concatenate). Returns `{}` when
21
- * neither source is present.
62
+ * The version groups a repo releases on their own: the folder names listed under `groups`
63
+ * in its `delivery.publish` task. This is what the generated publish workflow reads, so a
64
+ * release config that asks here stays in step with it instead of keeping a second list.
65
+ * `[]` for a repo that releases as one.
22
66
  */
23
- declare function loadTasksConfig(cwd: string): Promise<TasksConfig>;
24
- //#endregion
25
- export { type TaskConfigItem, type TaskEntry, type TasksConfig, defineConfig, loadTasksConfig, normalizeTaskEntry };
67
+ export declare function releaseGroups(config: Pick<TasksConfig, "tasks">): string[];
68
+ export type { CiAggregatePoster, CiConfig, CiPin, TaskConfigItem, TaskEntry, TasksConfig, TasksInput };
@@ -1,6 +1,6 @@
1
- import { t as normalizeTaskEntry } from "../schema-Cf5dfaDO.mjs";
2
- import { createDefineConfig, loadConfigFile, mergeConfig } from "@theholocron/datapad";
3
- //#region src/config/define.ts
1
+ import { n as coerceTasks, r as isTask, t as loadTasksConfig, u as normalizeTaskEntry } from "../load-WHAqMxwx.mjs";
2
+ import { createDefineConfig } from "@theholocron/datapad";
3
+ // src/config/define/define.ts
4
4
  /**
5
5
  * Typed identity helper for `astromech.config.ts`:
6
6
  *
@@ -13,27 +13,19 @@ import { createDefineConfig, loadConfigFile, mergeConfig } from "@theholocron/da
13
13
  * ```
14
14
  */
15
15
  const defineConfig = createDefineConfig();
16
- //#endregion
17
- //#region src/config/load.ts
16
+ // src/config/release-groups/release-groups.ts
18
17
  /**
19
- * Resolve the task manifest for a repo: the `tasks` key of
20
- * `holocron.config.*`, then a dedicated `astromech.config.*` merged on
21
- * top (dedicated wins; item arrays concatenate). Returns `{}` when
22
- * neither source is present.
18
+ * The version groups a repo releases on their own: the folder names listed under `groups`
19
+ * in its `delivery.publish` task. This is what the generated publish workflow reads, so a
20
+ * release config that asks here stays in step with it instead of keeping a second list.
21
+ * `[]` for a repo that releases as one.
23
22
  */
24
- async function loadTasksConfig(cwd) {
25
- const dedicated = await loadConfigFile({
26
- cwd,
27
- name: "astromech"
23
+ function releaseGroups(config) {
24
+ const groups = (config.tasks ?? []).map(normalizeTaskEntry).find((entry) => isTask(entry.name, "release"))?.with?.["groups"];
25
+ if (!Array.isArray(groups)) return [];
26
+ return groups.flatMap((group) => {
27
+ const name = typeof group === "string" ? group : group?.name;
28
+ return typeof name === "string" ? [name] : [];
28
29
  });
29
- return [coerce((await loadConfigFile({
30
- cwd,
31
- name: "holocron"
32
- }))?.config.tasks), coerce(dedicated?.config)].filter((layer) => layer !== void 0).reduce((acc, layer) => mergeConfig(acc, layer), {});
33
30
  }
34
- function coerce(value) {
35
- if (value == null) return void 0;
36
- return Array.isArray(value) ? { tasks: value } : value;
37
- }
38
- //#endregion
39
- export { defineConfig, loadTasksConfig, normalizeTaskEntry };
31
+ export { coerceTasks, defineConfig, loadTasksConfig, normalizeTaskEntry, releaseGroups };
@@ -0,0 +1,27 @@
1
+ // src/templates/configs/editorconfig-checker/editorconfig-checker.json
2
+ var editorconfig_checker_default = {
3
+ Verbose: false,
4
+ Format: "",
5
+ Debug: false,
6
+ IgnoreDefaults: false,
7
+ SpacesAfterTabs: false,
8
+ NoColor: false,
9
+ Exclude: [
10
+ "(^|.+/)LICENSE$",
11
+ "^public/.*",
12
+ "\\.md$",
13
+ "\\.mdx$",
14
+ "\\.(png|jpe?g|gif|webp|avif|ico)$"
15
+ ],
16
+ AllowedContentTypes: [],
17
+ PassedFiles: [],
18
+ Disable: {
19
+ "EndOfLine": false,
20
+ "Indentation": false,
21
+ "InsertFinalNewline": false,
22
+ "TrimTrailingWhitespace": false,
23
+ "IndentSize": false,
24
+ "MaxLineLength": false
25
+ }
26
+ };
27
+ export { editorconfig_checker_default as t };