@antelopejs/tooling-configs 0.3.3 → 0.3.5

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/dist/bin/sync.mjs CHANGED
@@ -1,13 +1,14 @@
1
1
  #!/usr/bin/env node
2
2
  import { a as formatCeilings, l as readCeilings, s as isRetired, t as CEILINGS_FILE } from "../ceilings-B7KayYIG.mjs";
3
- import { a as repositoryTools, i as parseManifest, n as managedPackage, o as templatePackage, r as packageManager, s as toolingVersions } from "../package-BRTjkzt5.mjs";
4
- import { i as presetConfig, n as SETUP_SCRIPT, r as lefthook, t as PRESET_CONFIGS } from "../templates-CypDm-j9.mjs";
3
+ import { a as repositoryTools, i as parseManifest, n as managedPackage, o as templatePackage, r as packageManager, s as toolingVersions } from "../package-CqqBgE8Y.mjs";
4
+ import { i as presetConfig, n as SETUP_SCRIPT, r as lefthook, t as PRESET_CONFIGS } from "../templates-BKZv-BRw.mjs";
5
5
  import { a as VERIFY_KINDS, c as isVerifyKind, i as SYNCED_SKILL_FILES, l as skillFolder, o as claudeLink, s as claudeLinkTarget, u as planDocsSkills } from "../shared-igPpEDpS.mjs";
6
6
  import { t as runCli } from "../cli-4Tv71vYk.mjs";
7
7
  import { c as repositoryRoot } from "../files-DJ0TeaTU.mjs";
8
- import { i as recordedRelease, t as measureBaseline } from "../ratchet-BAcLRYuM.mjs";
9
- import { a as ciWorkflow, c as ciRenovateSyncCallers, f as renovateArtifacts, l as hasChecksWorkflow, o as MISSING_CHECKS_WORKFLOW, r as CI_PATH, s as ciNodeCallers } from "../ci-workflow-CXcAZj6g.mjs";
8
+ import { i as recordedRelease, t as measureBaseline } from "../ratchet-Q-JXuZIX.mjs";
9
+ import { a as ciWorkflow, c as ciRenovateSyncCallers, f as renovateArtifacts, l as hasChecksWorkflow, o as MISSING_CHECKS_WORKFLOW, r as CI_PATH, s as ciNodeCallers } from "../ci-workflow-C4mQ8QSp.mjs";
10
10
  import { n as SUPPRESSIONS_FILE, r as adoptedBudget } from "../suppression-budget-C0SkPO5R.mjs";
11
+ import { t as DEFAULT_SHARED } from "../map-s_jKqBQv.mjs";
11
12
  import { chmodSync, existsSync, lstatSync, mkdirSync, readFileSync, readdirSync, readlinkSync, rmdirSync, statSync, symlinkSync, unlinkSync, writeFileSync } from "node:fs";
12
13
  import { dirname, join, resolve } from "node:path";
13
14
  import { execFileSync } from "node:child_process";
@@ -811,7 +812,7 @@ ${text.builtins}
811
812
 
812
813
  ## Evidence
813
814
 
814
- Each step writes \`<run>/evidence/<feature>/<journey>/<NN-step>/\` with \`command.txt\`, \`stdout.txt\`, \`stderr.txt\`, \`exit-code.txt\`, \`pid.txt\` for background processes, \`tree.txt\`, \`http.json\` for every request, and \`checks.json\`. \`result.json\` holds a journey's result and \`feature.json\` the merged results of the feature. Read the evidence before you judge a PASS: a check proves only what it asserts.
815
+ Each step writes \`<run>/evidence/<feature>/<journey>/<NN-step>/\` with \`command.txt\`, \`stdout.txt\`, \`stderr.txt\`, \`exit-code.txt\`, \`pid.txt\` for background processes, \`tree.txt\`, \`http.json\` for every request, and \`checks.json\`. \`result.json\` holds a journey's result and \`feature.json\` the merged results of the feature. A journey id listed under two features runs once per run: when \`journey <run> <feature>\` names no ids and another feature of the run already passed that id at the same HEAD, the feature records a result with \`reusedFrom\` naming that evidence folder and runs nothing. Name the id to run it again. Read the evidence before you judge a PASS: a check proves only what it asserts.
815
816
 
816
817
  ## Cleanup
817
818
 
@@ -819,14 +820,15 @@ Each step writes \`<run>/evidence/<feature>/<journey>/<NN-step>/\` with \`comman
819
820
  ${BIN} clean <run>
820
821
  \`\`\`
821
822
 
822
- Each journey deletes its scratch folder and \`HOME\`, its install included, when it ends: passed, failed or interrupted. Only its evidence stays. \`clean\` stops what the run started, by recorded PID and container name, and removes everything but \`evidence/\` and \`run.json\`. Run it after every run, failed ones included.
823
+ Each journey deletes its scratch folder and \`HOME\`, its install included, when it ends: passed, failed or interrupted. Only its evidence stays. \`clean\` stops what the run started, by recorded PID and container name, and removes everything but \`evidence/\` and \`run.json\`, the folders \`context.prepared\` kept included. Run it after every run, failed ones included.
823
824
 
824
825
  ## The repository's own layer
825
826
 
826
827
  - \`verify.config.ts\` default-exports a \`VerifyConfig\` from \`@antelopejs/tooling-configs/verify\`:
827
828
  - \`doors\`: one entry per door kind (\`data\`, \`format\`, \`contract\`, \`outbound\`, \`exposure\`, \`publish\`), each \`null\` when it cannot apply or \`{ globs, funnels, why }\`.
828
829
  - \`journeys\`: the repository's journeys by id, each \`{ title, entryPoint, run(context) }\`, using the check helpers the same import exports. A check states what the product must do; an environment that went away is never a failing check. When a journey fails, the harness reruns each service's readiness command, up to four times over about 3.5 s, and looks at every \`ajs project dev\` the journey started, its own readiness probe included. The journey ends NOT VERIFIED, not FAIL, when a service still fails every rerun, an app was killed by SIGKILL, SIGTERM, SIGHUP or SIGINT that the harness did not send, or the app the harness started failed to bind the port the harness gave it (\`EADDRINUSE\` naming that port). An app that exits on its own with an exit code, one that crashes by another signal such as SIGABRT or SIGSEGV, and one that logs \`EADDRINUSE\` for any other port are the product's failure. A change that takes its own service down still reads as an outage: the service stays down, so the journey is NOT VERIFIED. For anything else the journey depends on, such as a process it started with \`context.command\` or an outside endpoint, probe it when a check fails and call \`context.notVerified(reason)\` when it no longer answers.
829
- - \`env\`, \`setup\` (commands replacing the build), \`userFacing\` (globs replacing the kind's default) and \`formal\` (formal checks: \`name\`, \`covers\`, \`command\`, \`violation\`, and optionally \`behaviour\` and \`baseCommand\`).
830
+ - \`context.prepared(key, build)\` does the preparation many journeys repeat once per run, such as scaffolding and installing a project, and returns the journey's own copy at \`<work>/<key>\`. The first journey that asks for \`key\` runs \`build(folder)\` on the empty folder with its usual steps, after a step \`prepared <key>\` that marks them as the build and says whether it was kept. A build is kept until \`clean\` only when it returns, records at least one check, passes every check, and leaves only files, directories and symlinks in the folder. Every later journey of the run, also in a later \`journey\` command, gets a fresh copy and one step, \`prepared <key>\`, that names the journey that built it and holds that build's evidence under \`build/\`. A build that is not kept is built again by the next journey, and rerunning the journey that built builds again. An absolute symlink into the folder points into each copy; other symlinks keep their target. \`build\` writes only inside the folder it is given: a write elsewhere, such as a sibling under \`<work>\` or the repository, stays with the journey that built. Two concurrent \`journey\` commands that reach the same key at once both build, and the first to finish is kept. The commands \`build\` runs get a \`HOME\` of their own that is deleted when it ends: redo after \`prepared\` anything a later step needs in \`HOME\`, such as \`ajs config set git\`. Pass the same \`build\` for a key in every journey.
831
+ - \`env\`, \`setup\` (commands replacing the build), \`userFacing\` and \`shared\` (globs replacing the kind's default; \`shared\` lists the files whose change runs every feature), and \`formal\` (formal checks: \`name\`, \`covers\`, \`command\`, \`violation\`, and optionally \`behaviour\` and \`baseCommand\`).
830
832
  ${text.layer}
831
833
  - \`features/README.md\`: the index of the features; \`map\` does not read it as a feature.
832
834
  - \`features/<feature>.md\`: frontmatter lists \`covers:\` (source globs), \`docs:\` (pages a verdict judges) and \`journeys:\`, then the sections Sub-features, How to get to it (user POV), Driving it with antelopejs-verify, and Gotchas. \`features/smoke.md\` covers nothing and runs on every verdict; here it runs ${text.smoke}.
@@ -839,10 +841,10 @@ ${BIN} map
839
841
 
840
842
  ## Verdict rules
841
843
 
842
- 1. **Run every feature whose \`covers:\` globs the diff touches, plus \`smoke\`.** \`plan\` prints that list as \`run\`.
844
+ 1. **Run every feature whose \`covers:\` globs the diff touches, plus \`smoke\`.** \`plan\` prints that list as \`run\`. When the diff changes a shared file (${DEFAULT_SHARED[kind].map((glob) => `\`${glob}\``).join(", ")}; \`shared\` in \`verify.config.ts\` replaces this list; files under \`.agents/\`, \`.claude/\` and \`.github/\` never count), \`run\` is every feature, every feature's docs pages are judged, and \`full\` says why. Before a release, create the run with \`new --all\` and plan with \`plan --all\`: every feature runs, whatever the diff.
843
845
  2. **An unmapped surface fails the verdict.** A changed user-facing file no feature covers needs a feature entry and its journeys in the same PR.
844
846
  3. **Every registered journey of a feature in \`run\` must have run and passed.** Run whole features. A journey that could not reach the product, or whose environment went away during it, is NOT VERIFIED, and so is the verdict, whatever else passed: never PASS and never PASS+NOTES. Every journey result in the run's evidence counts, also for a feature outside \`run\`: a failed one fails the verdict, because it shows a \`covers:\` glob that misses what the diff broke. A NOT VERIFIED one outside \`run\` is listed under Not verified and caps the result at PASS+NOTES. A journey outside \`run\` that never ran is not required.
845
- 4. **Docs.** Judge every \`docs:\` page of a touched feature against what the journeys showed. A stale page fails the verdict.
847
+ 4. **Docs.** Judge every page \`plan\` lists as \`docs\` against what the journeys showed: the \`docs:\` pages of the touched features, or of every feature when the full set runs. A stale page fails the verdict.
846
848
  5. **Formal checks.** \`${BIN} formal <run>\` runs every formal check of \`verify.config.ts\` that covers the diff, or whose own \`files\` the diff changes, and records it under \`evidence/formal/<name>/\`. For each one it decides, without judgement, whether the diff changed what the covered code does. \`emit\` (the default) compares the structure of the covered files' JavaScript on the base and on HEAD: node kinds, names and literal values, leaving out types, comments, formatting, parentheses and \`export\` keywords. Each use of an imported binding stands for its origin (the resolved module and the imported name), so an import retargeted to another module or alias counts as changed; a function declaration refers to the top-level variables and classes of its own file by file and name, so moving it next to a different variable of the same name counts as changed. Exports are keyed by the origin they export, so a re-export or an \`export { f as run }\` retargeted to another binding counts as changed. Each file must keep its top-level statements and its side-effect imports in order; function declarations, which are hoisted, may move between covered files with their imports. So a type-only edit, a reformat or a moved function declaration counts as unchanged, while reordering statements or moving any other statement counts as changed. \`emit\` judges behaviour, not the public surface: exports are the api-diff's job. \`probe\` runs the check's \`behaviour.command\` with a worktree of each commit and compares what it prints. Then:
847
849
  - a covered check that did not run, or exits non-zero (a tool error, or a check that no longer matches its record), fails the verdict;
848
850
  - recorded findings fail the verdict only when the covered behaviour changed; when it did not, the verdict reports them as known findings;