@intellectual-frontiers/repoctl 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/LICENSE +75 -0
  2. package/README.md +19 -2
  3. package/dist/governance/checks.d.ts +23 -0
  4. package/dist/governance/config.d.ts +233 -0
  5. package/dist/governance/generators.d.ts +54 -0
  6. package/dist/governance/identity.d.ts +23 -0
  7. package/dist/governance/ids.d.ts +46 -0
  8. package/dist/governance/mod.d.ts +25 -0
  9. package/dist/governance/mod.js +1063 -0
  10. package/dist/governance/problems.d.ts +28 -0
  11. package/dist/governance/proof.d.ts +108 -0
  12. package/dist/governance/tiers.d.ts +25 -0
  13. package/dist/governance/verbs.d.ts +43 -0
  14. package/dist/governance/version.d.ts +14 -0
  15. package/dist/logical/check.d.ts +33 -0
  16. package/dist/logical/commit.d.ts +64 -0
  17. package/dist/logical/constants.d.ts +27 -0
  18. package/dist/logical/declared.d.ts +32 -0
  19. package/dist/logical/docs.d.ts +31 -0
  20. package/dist/logical/doctor.d.ts +42 -0
  21. package/dist/logical/findings.d.ts +26 -0
  22. package/dist/logical/glob.d.ts +17 -0
  23. package/dist/logical/hygiene-facts.d.ts +33 -0
  24. package/dist/logical/hygiene.d.ts +68 -0
  25. package/dist/logical/merge.d.ts +46 -0
  26. package/dist/logical/mod.d.ts +36 -0
  27. package/dist/logical/mod.js +2553 -0
  28. package/dist/logical/order.d.ts +24 -0
  29. package/dist/logical/pool.d.ts +14 -0
  30. package/dist/logical/ports.d.ts +96 -0
  31. package/dist/logical/prove.d.ts +118 -0
  32. package/dist/logical/publish.d.ts +70 -0
  33. package/dist/logical/scaffold.d.ts +52 -0
  34. package/dist/logical/select.d.ts +83 -0
  35. package/dist/logical/semver.d.ts +16 -0
  36. package/dist/logical/status.d.ts +71 -0
  37. package/dist/logical/step.d.ts +18 -0
  38. package/dist/logical/surface.d.ts +73 -0
  39. package/dist/logical/sync.d.ts +34 -0
  40. package/dist/mod.d.ts +20 -0
  41. package/dist/mod.js +12992 -0
  42. package/dist/physical/adapters.d.ts +25 -0
  43. package/dist/physical/config-load.d.ts +30 -0
  44. package/dist/physical/define.d.ts +73 -0
  45. package/dist/physical/mod.d.ts +26 -0
  46. package/dist/physical/mod.js +12660 -0
  47. package/dist/physical/program.d.ts +14 -0
  48. package/dist/physical/prove-run.d.ts +50 -0
  49. package/dist/physical/prove.d.ts +76 -0
  50. package/dist/physical/tests.d.ts +54 -0
  51. package/dist/physical/verbs/check.d.ts +26 -0
  52. package/dist/physical/verbs/docs.d.ts +6 -0
  53. package/dist/physical/verbs/library.d.ts +4 -0
  54. package/dist/physical/verbs/prove.d.ts +5 -0
  55. package/dist/physical/verbs/releasing.d.ts +27 -0
  56. package/dist/physical/verbs/sync.d.ts +12 -0
  57. package/dist/repoctl.d.ts +16 -0
  58. package/package.json +70 -4
  59. package/repoctl.mjs +12693 -0
@@ -0,0 +1,1063 @@
1
+ // ../core/src/absurd.ts
2
+ function absurd(value) {
3
+ throw new Error(`an alternative was not handled: ${JSON.stringify(value)}`);
4
+ }
5
+ // ../core/src/result.ts
6
+ function ok(value) {
7
+ return { kind: "ok", value };
8
+ }
9
+ function err(error) {
10
+ return { kind: "err", error };
11
+ }
12
+ var done = ok(undefined);
13
+
14
+ // ../core/src/decode.ts
15
+ function describe(input) {
16
+ if (input === null)
17
+ return "null";
18
+ if (input === undefined)
19
+ return "nothing";
20
+ if (Array.isArray(input))
21
+ return "an array";
22
+ const t = typeof input;
23
+ if (t === "string")
24
+ return `the string ${JSON.stringify(input).slice(0, 60)}`;
25
+ if (t === "object")
26
+ return "an object";
27
+ if (t === "function")
28
+ return "a function";
29
+ if (typeof input === "symbol")
30
+ return "a symbol";
31
+ if (typeof input === "number" || typeof input === "bigint" || typeof input === "boolean")
32
+ return `${t} ${String(input)}`;
33
+ return t;
34
+ }
35
+ function fail(path, expected, input) {
36
+ return err({ kind: "decode", path, expected, found: describe(input) });
37
+ }
38
+ var string = (input, path = "$") => typeof input === "string" ? ok(input) : fail(path, "a string", input);
39
+ function refine(base, name, valid) {
40
+ return (input, path = "$") => {
41
+ const r = base(input, path);
42
+ if (r.kind === "err")
43
+ return r;
44
+ return valid(r.value) ? ok(r.value) : fail(path, `a ${name}`, input);
45
+ };
46
+ }
47
+ // ../core/src/text.ts
48
+ var ANSI = new RegExp(`${String.fromCharCode(27)}\\[[0-9;?]*[A-Za-z]`, "g");
49
+ // src/governance/ids.ts
50
+ var LIBRARY = refine(string, "library name", (t) => /^[a-z][a-z0-9-]*$/.test(t) && t.length <= 60);
51
+ var SEMVER = refine(string, "semver", (t) => /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/.test(t));
52
+ var ISSUE = refine(string, "issue number", (t) => /^[1-9]\d{0,8}$/.test(t));
53
+ var SESSION = refine(string, "session url", (t) => /^https:\/\/[A-Za-z0-9.-]+(?:\/[A-Za-z0-9._~%/-]*)?$/.test(t));
54
+ var SUBJECT = refine(string, "commit subject", (t) => t.trim() === t && t !== "" && !t.includes(`
55
+ `) && t.length <= 100 && !t.endsWith("."));
56
+ var STEP = refine(string, "step id", (t) => /^[a-z][a-z0-9:-]*$/.test(t) && t.length <= 60);
57
+ var VARIABLE = refine(string, "variable name", (t) => /^[A-Z][A-Z0-9_]*$/.test(t) && t.length <= 80);
58
+ var REF = refine(string, "git ref", (t) => t !== "" && !t.startsWith("-") && !/[\s~^:?*[\\]|\.\.|@\{|\/\/|\.lock$|\/$/.test(t));
59
+ function parseLibraryName(text) {
60
+ const r = LIBRARY(text, "name");
61
+ return r.kind === "ok" ? ok(r.value) : err(`${JSON.stringify(text)} is not a library name: lower-case letters, digits and hyphens, starting with a letter, at most 60 characters`);
62
+ }
63
+ function parseSemver(text) {
64
+ const r = SEMVER(text, "version");
65
+ return r.kind === "ok" ? ok(r.value) : err(`${JSON.stringify(text)} is not a version of the form 1.2.3, with an optional -pre-release`);
66
+ }
67
+ function parseIssueNumber(text) {
68
+ const r = ISSUE(text.startsWith("#") ? text.slice(1) : text, "issue");
69
+ return r.kind === "ok" ? ok(r.value) : err(`${JSON.stringify(text)} is not an issue number: digits, from 1`);
70
+ }
71
+ function parseSessionUrl(text) {
72
+ const r = SESSION(text, "session");
73
+ return r.kind === "ok" ? ok(r.value) : err(`${JSON.stringify(text)} is not a session address: an https address with no user name or password`);
74
+ }
75
+ function parseSubject(text) {
76
+ const r = SUBJECT(text, "subject");
77
+ return r.kind === "ok" ? ok(r.value) : err("the subject is one line of at most 100 characters, with nothing around it and no full stop at its end");
78
+ }
79
+ function parseGitRef(text) {
80
+ const r = REF(text, "ref");
81
+ return r.kind === "ok" ? ok(r.value) : err(`${JSON.stringify(text)} is not a name Git accepts for a reference`);
82
+ }
83
+ function parseStepId(text) {
84
+ const r = STEP(text, "id");
85
+ return r.kind === "ok" ? ok(r.value) : err(`${JSON.stringify(text)} is not an id: lower-case letters, digits, hyphens and colons, starting with a letter, at most 60 characters`);
86
+ }
87
+ function parseVariableName(text) {
88
+ const r = VARIABLE(text, "variable");
89
+ return r.kind === "ok" ? ok(r.value) : err(`${JSON.stringify(text)} is not the name of an environment variable: capitals, digits and underscores, starting with a capital`);
90
+ }
91
+
92
+ // src/governance/problems.ts
93
+ var PROBLEM_CODES = [
94
+ "E-USAGE",
95
+ "E-ENVIRONMENT",
96
+ "E-STALE-GENERATED",
97
+ "E-GENERATOR-FAILED",
98
+ "E-SPEC-KIT",
99
+ "E-MIZAN-RULE",
100
+ "E-VERSIONS",
101
+ "E-TYPES",
102
+ "E-VERSION-CONSTANT",
103
+ "E-UNDECLARED-DEPENDENCY",
104
+ "E-LIBRARY-CHECK",
105
+ "E-MERGE-FAILED",
106
+ "E-MERGE-CONFLICT",
107
+ "E-REGENERATE-FAILED",
108
+ "E-NPM-UNREACHABLE",
109
+ "E-RELEASE-RECORD",
110
+ "E-RELEASE-FAILED",
111
+ "E-PUBLISH-REFUSED",
112
+ "E-NO-TOKEN",
113
+ "E-NO-TARBALL",
114
+ "E-PUBLISH-FAILED",
115
+ "E-COMMIT-SUBJECT",
116
+ "E-COMMIT-REFS",
117
+ "E-COMMIT-SESSION",
118
+ "E-COMMIT-FORBIDDEN",
119
+ "E-COMMIT-NOTHING",
120
+ "E-COMMIT-FAILED",
121
+ "E-LIBRARY-NAME",
122
+ "E-LIBRARY-RESERVED",
123
+ "E-LIBRARY-EXISTS",
124
+ "E-DOCTOR-INSTALL",
125
+ "E-DOCTOR-LINKS",
126
+ "E-DOCTOR-NODE",
127
+ "E-DOCTOR-BUN",
128
+ "E-DOCTOR-GIT",
129
+ "E-HYGIENE-GIT",
130
+ "E-HYGIENE-PATH",
131
+ "E-HYGIENE-IMPORT",
132
+ "E-HYGIENE-VENDORED",
133
+ "E-HYGIENE-DUPLICATE",
134
+ "E-HYGIENE-RANGE",
135
+ "E-PROVE-FAILED",
136
+ "E-PROVE-QUARANTINE",
137
+ "E-CHECK-FAILED",
138
+ "E-CONFIG-MISSING",
139
+ "E-CONFIG-LOAD",
140
+ "E-CONFIG-INVALID",
141
+ "E-DOCS-GENERATOR-MISSING",
142
+ "E-DOCS-FAILED"
143
+ ];
144
+ function isProblemCode(text) {
145
+ return PROBLEM_CODES.some((c) => c === text);
146
+ }
147
+ var CATALOGUE = {
148
+ "E-USAGE": {
149
+ title: "The command line does not fit",
150
+ what: "The words after `repoctl` do not name a verb, an option or an operand it takes.",
151
+ why: "A typing mistake, or an option of another verb.",
152
+ fix: "repoctl help"
153
+ },
154
+ "E-ENVIRONMENT": {
155
+ title: "This checkout cannot do it",
156
+ what: "Something the run needs is not there: a program, a folder, a file or the network.",
157
+ why: "Git, Bun or npm is not installed or not on the PATH, or the working folder is not this repository.",
158
+ fix: "repoctl doctor"
159
+ },
160
+ "E-STALE-GENERATED": {
161
+ title: "A generated file is stale",
162
+ what: "A generator's own check says its files are not what it makes now from their sources.",
163
+ why: "A source (a manifest, an about.ts, an ontology, a specification) changed and the generated files were not made again.",
164
+ fix: "repoctl sync"
165
+ },
166
+ "E-GENERATOR-FAILED": {
167
+ title: "A generator could not run",
168
+ what: "A generator ended with a status that is neither success nor staleness, so what it makes is not known.",
169
+ why: "A source it reads is broken (a manifest that does not decode, an ontology that breaks a rule), or its program is missing.",
170
+ fix: "repoctl check"
171
+ },
172
+ "E-SPEC-KIT": {
173
+ title: "A specification kit breaks the format",
174
+ what: "The check of the specification format found a finding in a specification kit.",
175
+ why: "A requirement without a row in enforcement.tsv, a number that is not in registry.tsv, or a form a specification must have.",
176
+ fix: "run the command named in the finding and read its output"
177
+ },
178
+ "E-MIZAN-RULE": {
179
+ title: "A rule of Mizan finds something",
180
+ what: "The rules Mizan adds to the format found a finding that its baseline does not hold, or a line of the baseline that no longer occurs.",
181
+ why: "A change that breaks a rule, or a fix that left its line in the baseline.",
182
+ fix: "run the command named in the finding and read its output"
183
+ },
184
+ "E-VERSIONS": {
185
+ title: "A version record is wrong",
186
+ what: "The check of versions found a record that is wrong, an identity that changed, or a version that went back since the base.",
187
+ why: "A version was raised by hand or lowered; versions grow only at the release.",
188
+ fix: "run the command named in the finding and read its output"
189
+ },
190
+ "E-TYPES": {
191
+ title: "TypeScript 7 finds a type error",
192
+ what: "The type check of the tests of the root, or of commons' tools, which no library's own check covers, found an error.",
193
+ why: "A change to a test or a tool that does not type-check under the strict settings of the repository's base configuration.",
194
+ fix: "run the command named in the finding and read its output"
195
+ },
196
+ "E-VERSION-CONSTANT": {
197
+ title: "A constant of the sources disagrees with its library's version",
198
+ what: "A constant named for a library (`ERGONEX_VERSION`) or named by its manifest in `versionConstants` does not say the version of its package.",
199
+ why: "The release raised the version in the manifest and the package and a constant in a source was left at the old one.",
200
+ fix: "Set the constant to the version of its library; list it in the manifest's versionConstants so that the release writes it"
201
+ },
202
+ "E-UNDECLARED-DEPENDENCY": {
203
+ title: "A library imports a package its manifest does not declare",
204
+ what: "A source, a test or a tool of a library imports a package by name (or a `node:` built-in, which needs `@types/node`) that its package.json declares neither in dependencies nor in devDependencies.",
205
+ why: "A library job of CI installs only its own folder, so the import, or the types of Node, are found in a checkout with the whole repository installed and are missing there.",
206
+ fix: "Add the package, at an exact version, to the devDependencies of the library's package.json (a library of commons as link:../<name>) and run bun install in its folder"
207
+ },
208
+ "E-LIBRARY-CHECK": {
209
+ title: "The check of a library's own rules finds something",
210
+ what: "A library's manifest or its folder breaks a rule that the register of libraries holds.",
211
+ why: "A manifest that does not decode, a folder without its files, or a name that is held for a family.",
212
+ fix: "repoctl check"
213
+ },
214
+ "E-MERGE-FAILED": {
215
+ title: "The merge could not be made",
216
+ what: "Git refused the merge for a reason that is not a conflict.",
217
+ why: "Uncommitted changes in the working tree, or a reference that is not there.",
218
+ fix: "git status"
219
+ },
220
+ "E-MERGE-CONFLICT": {
221
+ title: "A file a person wrote conflicts",
222
+ what: "The merge conflicts in a file that is not generated; it is left as Git left it, for a person.",
223
+ why: "Both sides changed the same lines of a source or a document.",
224
+ fix: "repoctl merge --help"
225
+ },
226
+ "E-REGENERATE-FAILED": {
227
+ title: "A conflicted generated file could not be made again",
228
+ what: "A generated file conflicted and its generator could not make it, so it stays unresolved.",
229
+ why: "A source the generator reads is in conflict or broken.",
230
+ fix: "repoctl sync"
231
+ },
232
+ "E-NPM-UNREACHABLE": {
233
+ title: "npm could not be asked",
234
+ what: "The registry of npm did not answer for a library, so its version there is not known.",
235
+ why: "No network, a proxy, or a registry that is down.",
236
+ fix: "repoctl status --offline"
237
+ },
238
+ "E-RELEASE-FAILED": {
239
+ title: "The release could not be made",
240
+ what: "The release stopped before it was made: a version that went back, a registry that could not be compared, a generator or a test that failed.",
241
+ why: "A manifest is wrong, a tag is missing from the clone, or a test that packs a library failed.",
242
+ fix: "repoctl release plan"
243
+ },
244
+ "E-RELEASE-RECORD": {
245
+ title: "The release record is missing",
246
+ what: "`release publish` reads commons/generated/release.auto.json and it is not there or does not decode.",
247
+ why: "`release apply` was not run, or its record was not committed.",
248
+ fix: "repoctl release apply"
249
+ },
250
+ "E-PUBLISH-REFUSED": {
251
+ title: "The publication was refused",
252
+ what: "`release publish` needs the releaser tier and a typed confirmation, and one of them is missing.",
253
+ why: "REPOCTL_TIER is not releaser, or --confirm does not say the phrase that --dry-run printed.",
254
+ fix: "repoctl release publish --dry-run"
255
+ },
256
+ "E-NO-TOKEN": {
257
+ title: "There is no npm credential",
258
+ what: "The variable INFRO_NPMJS_TOKEN is not set, so nothing can be sent to npm by hand.",
259
+ why: "The token is held only by the person who publishes.",
260
+ fix: "repoctl doctor"
261
+ },
262
+ "E-NO-TARBALL": {
263
+ title: "A package was not packed",
264
+ what: "The tarball of a library of the record is not under dist/.",
265
+ why: "`release apply` did not pack it, or it is a library that names no npm.",
266
+ fix: "repoctl release apply"
267
+ },
268
+ "E-PUBLISH-FAILED": {
269
+ title: "npm did not take a package",
270
+ what: "npm refused a package or the run could not start it; nothing was tagged.",
271
+ why: "The version is on npm already with other files, the token may not publish the package, or the network failed.",
272
+ fix: "repoctl status"
273
+ },
274
+ "E-COMMIT-SUBJECT": {
275
+ title: "The commit subject is not valid",
276
+ what: "The subject is empty, has more than one line, is longer than 100 characters or ends with a full stop.",
277
+ why: "A subject written as a sentence or a paragraph.",
278
+ fix: "repoctl commit --help"
279
+ },
280
+ "E-COMMIT-REFS": {
281
+ title: "The issue number is not valid",
282
+ what: "`--refs` is not an issue number.",
283
+ why: "A word where digits were expected.",
284
+ fix: "repoctl commit --help"
285
+ },
286
+ "E-COMMIT-SESSION": {
287
+ title: "The session address is missing or not valid",
288
+ what: "The trailer Claude-Session needs an https address, from --session or CLAUDE_SESSION_URL.",
289
+ why: "The variable is not set in this shell, or the address has a credential in it.",
290
+ fix: "repoctl commit --help"
291
+ },
292
+ "E-COMMIT-FORBIDDEN": {
293
+ title: "A file that must not be committed is staged",
294
+ what: "A path under .claude/, under node_modules or one that looks like a secret is among the files to commit.",
295
+ why: "A tool's local folder was added with `git add .`, or a key or a .env file was.",
296
+ fix: "git restore --staged <path>"
297
+ },
298
+ "E-COMMIT-NOTHING": {
299
+ title: "There is nothing to commit",
300
+ what: "Nothing is staged and no path was given.",
301
+ why: "The change was committed already or was never added.",
302
+ fix: "git status"
303
+ },
304
+ "E-COMMIT-FAILED": {
305
+ title: "Git did not make the commit",
306
+ what: "Git refused the commit.",
307
+ why: "A hook failed, or the repository is in the middle of a merge.",
308
+ fix: "git status"
309
+ },
310
+ "E-LIBRARY-NAME": {
311
+ title: "The library name is not valid",
312
+ what: "The name is not lower-case letters, digits and hyphens starting with a letter.",
313
+ why: "A capital, a space or an underscore.",
314
+ fix: "repoctl new library --help"
315
+ },
316
+ "E-LIBRARY-RESERVED": {
317
+ title: "The library name is held for a family",
318
+ what: "The name is one that commons/libraries/src/family.ts holds for the library of a family.",
319
+ why: "The names of the fleet libraries and their dialects are reserved.",
320
+ fix: "repoctl new library --help"
321
+ },
322
+ "E-LIBRARY-EXISTS": {
323
+ title: "The library exists",
324
+ what: "A folder with this name is already in commons/.",
325
+ why: "The library was made before.",
326
+ fix: "repoctl status"
327
+ },
328
+ "E-DOCTOR-INSTALL": {
329
+ title: "The dependencies are not installed",
330
+ what: "The root has no node_modules, so no program can import a library.",
331
+ why: "`bun install` was not run in this checkout.",
332
+ fix: "bun install --frozen-lockfile"
333
+ },
334
+ "E-DOCTOR-LINKS": {
335
+ title: "The libraries are not linked",
336
+ what: "The folder under which the configuration's doctor policy says the libraries are linked does not link every library.",
337
+ why: "A library was added and the links were not made again.",
338
+ fix: "run the program the doctor policy names to link the libraries"
339
+ },
340
+ "E-DOCTOR-NODE": {
341
+ title: "Node 26 is missing",
342
+ what: "The program `node` is older than the least version the configuration's doctor policy names, or is not there.",
343
+ why: "The machine has an older Node.",
344
+ fix: "install the Node version the configuration's doctor policy names and put it first on the PATH"
345
+ },
346
+ "E-DOCTOR-BUN": {
347
+ title: "Bun is not the pinned version",
348
+ what: "The version of Bun is not the one the repository pins (the file the doctor policy names).",
349
+ why: "Bun was installed by another route or not upgraded.",
350
+ fix: "bun upgrade"
351
+ },
352
+ "E-DOCTOR-GIT": {
353
+ title: "Git is not available or this is not a checkout",
354
+ what: "`git` does not run here, or the folder is not a Git working tree with an origin.",
355
+ why: "Git is not installed, or the folder is not a clone.",
356
+ fix: "git --version"
357
+ },
358
+ "E-HYGIENE-GIT": {
359
+ title: "A dependency by Git on the repository of commons",
360
+ what: "A package.json depends on the family's own repository by Git (github:, git+https:, git: or ssh:, at a commit or not).",
361
+ why: "The family's packages reach a repository only as published packages; a Git dependency installs sources that are not a release and is not the rule.",
362
+ fix: "bun add <scope>/<package>@<version> --exact"
363
+ },
364
+ "E-HYGIENE-PATH": {
365
+ title: "A path dependency into a checkout of commons",
366
+ what: "A package.json has a file: or link: dependency whose path goes through the folder the hygiene policy names.",
367
+ why: "A checkout of commons next to the repository was linked in place of installing the published package.",
368
+ fix: "bun add <scope>/<package>@<version> --exact"
369
+ },
370
+ "E-HYGIENE-IMPORT": {
371
+ title: "A relative import into a copy of commons",
372
+ what: "A source imports a relative path that goes through the folder the hygiene policy names.",
373
+ why: "A copy of the family sits in the repository and its files are imported by path.",
374
+ fix: "import from the package, installed from a registry"
375
+ },
376
+ "E-HYGIENE-VENDORED": {
377
+ title: "A vendored copy of a library of commons",
378
+ what: "A folder of the repository, outside node_modules, carries a package of the policy's scope and is not the root package or a workspace the root declares.",
379
+ why: "A package of the family was copied into the repository.",
380
+ fix: "remove the folder and install the published package with --exact"
381
+ },
382
+ "E-HYGIENE-DUPLICATE": {
383
+ title: "Two installed copies of one library",
384
+ what: "The lockfile or node_modules holds one package of the policy's scope at two versions.",
385
+ why: "Two dependencies ask for different versions of it, or one is pinned and another is a range.",
386
+ fix: "pin one version with overrides in package.json and install again"
387
+ },
388
+ "E-HYGIENE-RANGE": {
389
+ title: "A dependency that is not an exact version",
390
+ what: "A dependency of the policy's scope is a range, a tag or latest.",
391
+ why: "The family is installed as one coherent set per release; a range lets two releases meet in one tree.",
392
+ fix: "bun add <package>@<version> --exact"
393
+ },
394
+ "E-PROVE-FAILED": {
395
+ title: "A proof of the plan failed",
396
+ what: "A proof that `repoctl prove` ran (a type check, a check of the specifications, a suite, a packing) ended with a failure.",
397
+ why: "The change broke what that proof holds, or the proof is flaky: a failing property test prints its seed.",
398
+ fix: "repoctl prove --why"
399
+ },
400
+ "E-PROVE-QUARANTINE": {
401
+ title: "A quarantined test is past its expiry, or the record is wrong",
402
+ what: "The quarantine record names a test whose expiry day has passed (it runs again), or the record is not a list of entries with a test, an owner, an expiry and a reason.",
403
+ why: "A quarantine holds a flaky test back for a time and names who fixes it; it never holds one for good.",
404
+ fix: "fix the test, or renew its entry with a new expiry and a reason"
405
+ },
406
+ "E-CHECK-FAILED": {
407
+ title: "A check of the repository found something",
408
+ what: "A named check of the repository's configuration ended with 1 and said what is wrong, line by line.",
409
+ why: "What the check judges is wrong in this checkout.",
410
+ fix: "run the check's own command, named in the finding, and read its output"
411
+ },
412
+ "E-CONFIG-MISSING": {
413
+ title: "This repository has no repoctl.config.ts",
414
+ what: "No `repoctl.config.ts` is in this folder or above it, and `--config` did not name one.",
415
+ why: "repoctl is driven by a typed configuration at the root of the repository it operates; without one it knows no generator, check or rule.",
416
+ fix: "write repoctl.config.ts at the root of the repository (see the guide: repoctl in your repository)"
417
+ },
418
+ "E-CONFIG-LOAD": {
419
+ title: "The configuration could not be loaded",
420
+ what: "`repoctl.config.ts` could not be imported, or it exports no configuration (its default export or `config`).",
421
+ why: "A syntax error, an import that is not installed, or a file that exports nothing.",
422
+ fix: "run the file with bun or node to read the error, and export `defineConfig({ ... })` as the default"
423
+ },
424
+ "E-CONFIG-INVALID": {
425
+ title: "The configuration is not valid",
426
+ what: "`repoctl.config.ts` was loaded and says something that cannot be: an id used twice, a generator that waits for one that is not there, a capability that needs `libraries`, a variable that is not a name.",
427
+ why: "A typing mistake in the configuration; every reason is listed.",
428
+ fix: "correct each reason listed, then run repoctl doctor"
429
+ },
430
+ "E-DOCS-GENERATOR-MISSING": {
431
+ title: "The documentation generator is not installed",
432
+ what: "`@intellectual-frontiers/docs`, the package of the generator `ifc-docs`, cannot be imported from this repository.",
433
+ why: "`repoctl docs` wraps the generator and does not carry it: it is an optional peer of repoctl.",
434
+ fix: "bun add --dev @intellectual-frontiers/docs (or npm install --save-dev @intellectual-frontiers/docs)"
435
+ },
436
+ "E-DOCS-FAILED": {
437
+ title: "The documentation generator reported a failure",
438
+ what: "The generator ended with a status that is not 0, or could not be served.",
439
+ why: "The site has a finding (its lines are above), or the configuration file named by `docs.config` is wrong.",
440
+ fix: "repoctl docs check"
441
+ }
442
+ };
443
+
444
+ // src/governance/config.ts
445
+ var TRAILER_KINDS = ["issue", "co-author", "session"];
446
+ var CAPABILITY_NAMES = ["release", "newLibrary", "status", "prove"];
447
+ var CONFIG_FILE = "repoctl.config.ts";
448
+ var DEFAULT_TIER_VARIABLE = "REPOCTL_TIER";
449
+ var DEFAULT_READ_ONLY_VARIABLE = "REPOCTL_READ_ONLY";
450
+ var DEFAULT_FORBIDDEN_PATHS = [
451
+ { glob: "**/.claude/**", why: "the local folder of an agent (.claude/)" },
452
+ { glob: "**/node_modules/**", why: "installed packages (node_modules/)" },
453
+ { glob: "**/.env", why: "an environment file, which may hold secrets" },
454
+ { glob: "**/.env.*", why: "an environment file, which may hold secrets" },
455
+ { glob: "**/*.pem", why: "a key or a certificate" },
456
+ { glob: "**/*.key", why: "a key or a certificate" },
457
+ { glob: "**/*.p12", why: "a key or a certificate" },
458
+ { glob: "**/*.pfx", why: "a key or a certificate" },
459
+ { glob: "**/*.jks", why: "a key or a certificate" },
460
+ { glob: "**/*.keystore", why: "a key or a certificate" },
461
+ { glob: "**/id_rsa", why: "a private key of ssh" },
462
+ { glob: "**/id_dsa", why: "a private key of ssh" },
463
+ { glob: "**/id_ecdsa", why: "a private key of ssh" },
464
+ { glob: "**/id_ed25519", why: "a private key of ssh" },
465
+ { glob: "**/.npmrc", why: "a file of credentials" },
466
+ { glob: "**/.netrc", why: "a file of credentials" },
467
+ { glob: "**/.pypirc", why: "a file of credentials" },
468
+ { glob: "**/credentials", why: "a file of credentials" },
469
+ { glob: "**/credentials.json", why: "a file of credentials" }
470
+ ];
471
+ var DEFAULT_ALLOWED_PATHS = ["**/.env.example", "**/.env.sample", "**/.env.template"];
472
+ var DEFAULT_SECRET_PATTERNS = [
473
+ { pattern: "-----BEGIN (?:RSA |EC |DSA |OPENSSH |PGP )?PRIVATE KEY", label: "a private key" },
474
+ { pattern: "\\bnpm_[A-Za-z0-9]{36}\\b", label: "an npm token" },
475
+ { pattern: "\\bgh[pousr]_[A-Za-z0-9]{36,}\\b", label: "a GitHub token" },
476
+ { pattern: "\\bgithub_pat_[A-Za-z0-9_]{22,}\\b", label: "a GitHub token" },
477
+ { pattern: "\\bAKIA[0-9A-Z]{16}\\b", label: "an access key of AWS" },
478
+ { pattern: "\\bxox[baprs]-[A-Za-z0-9-]{10,}", label: "a token of Slack" },
479
+ { pattern: "\\bsk-ant-[A-Za-z0-9_-]{20,}", label: "a key of an API" }
480
+ ];
481
+ function defineConfig(input) {
482
+ return input;
483
+ }
484
+ var stepOf = (input, label) => typeof input === "function" ? { kind: "function", call: input, label } : { kind: "program", argv: input };
485
+ var dedupe = (words) => new Set(words).size === words.length;
486
+ var relative = (p) => p !== "" && !p.startsWith("/") && !/^[A-Za-z]:/.test(p) && !p.split("/").includes("..") && !p.includes("\\");
487
+ function parseConfig(input) {
488
+ const problems = [];
489
+ const bad = (m) => void problems.push(m);
490
+ const variable = (name, fallback, what) => {
491
+ const r = parseVariableName(name ?? fallback);
492
+ if (r.kind === "ok")
493
+ return r.value;
494
+ bad(`${what}: ${r.error}`);
495
+ return;
496
+ };
497
+ if (input.repo.trim() === "")
498
+ bad("repo is the name of the repository and is not empty");
499
+ const tierVariable = variable(input.tierVariable, DEFAULT_TIER_VARIABLE, "tierVariable");
500
+ const readOnlyVariable = variable(input.readOnlyVariable, DEFAULT_READ_ONLY_VARIABLE, "readOnlyVariable");
501
+ const c = input.commit;
502
+ if (c.identity.name.trim() === "" || !/^[^@\s]+@[^@\s]+$/.test(c.identity.email))
503
+ bad("commit.identity needs a name and an email address");
504
+ const trailers = c.trailers ?? TRAILER_KINDS.filter((t) => t !== "issue" || c.issue !== undefined);
505
+ if (!dedupe(trailers))
506
+ bad("commit.trailers names a trailer twice");
507
+ if (c.issue === undefined && trailers.includes("issue"))
508
+ bad('commit.trailers has "issue" and commit.issue gives no prefix');
509
+ if (c.issue !== undefined && c.issue.prefix.trim() === "")
510
+ bad('commit.issue.prefix is not empty (for example "Refs #")');
511
+ if (c.issue?.required === true && !trailers.includes("issue"))
512
+ bad('commit.issue is required and commit.trailers has no "issue"');
513
+ const secrets = c.forbidden?.secrets ?? DEFAULT_SECRET_PATTERNS;
514
+ for (const s of secrets) {
515
+ try {
516
+ new RegExp(s.pattern);
517
+ } catch {
518
+ bad(`commit.forbidden.secrets: ${JSON.stringify(s.pattern)} is not a regular expression`);
519
+ }
520
+ }
521
+ const commit = {
522
+ identity: c.identity,
523
+ issue: { prefix: c.issue?.prefix ?? "", required: c.issue?.required ?? false },
524
+ trailers,
525
+ coAuthor: c.coAuthor,
526
+ forbidden: { paths: c.forbidden?.paths ?? DEFAULT_FORBIDDEN_PATHS, allow: c.forbidden?.allow ?? DEFAULT_ALLOWED_PATHS, secrets }
527
+ };
528
+ const generators = [];
529
+ for (const g of input.generators ?? []) {
530
+ const id = parseStepId(g.id);
531
+ if (id.kind === "err") {
532
+ bad(`generators: ${id.error}`);
533
+ continue;
534
+ }
535
+ const run = stepOf(g.command, `${g.id} (a function)`);
536
+ const check = g.check !== undefined ? stepOf(g.check, `${g.id} --check (a function)`) : typeof g.command === "function" ? undefined : stepOf([...g.command, "--check"], "");
537
+ if (check === undefined) {
538
+ bad(`generators.${g.id}: a generator that is a function gives its check as well`);
539
+ continue;
540
+ }
541
+ generators.push({ id: id.value, summary: g.summary ?? g.id, run, check, inputs: g.inputs ?? [], outputs: g.outputs, after: [], mixed: g.mixed ?? [] });
542
+ }
543
+ if (!dedupe(generators.map((g) => g.id)))
544
+ bad("generators: an id is used twice");
545
+ const withAfter = [];
546
+ for (const [i, g] of generators.entries()) {
547
+ const named = input.generators?.[i]?.after ?? [];
548
+ const after = named.flatMap((n) => {
549
+ const found = generators.find((o) => o.id === n);
550
+ if (found === undefined) {
551
+ bad(`generators.${g.id}.after: ${JSON.stringify(n)} is not a generator of this configuration`);
552
+ return [];
553
+ }
554
+ return [found.id];
555
+ });
556
+ withAfter.push({ ...g, after });
557
+ }
558
+ for (const g of withAfter) {
559
+ if (g.outputs.length === 0)
560
+ bad(`generators.${g.id}: a generator writes something: outputs is not empty`);
561
+ for (const m of g.mixed)
562
+ if (!g.outputs.includes(m))
563
+ bad(`generators.${g.id}.mixed: ${m} is not one of its outputs`);
564
+ }
565
+ const checks = [];
566
+ for (const k of input.checks ?? []) {
567
+ const id = parseStepId(k.id);
568
+ if (id.kind === "err") {
569
+ bad(`checks: ${id.error}`);
570
+ continue;
571
+ }
572
+ const code = k.code ?? "E-CHECK-FAILED";
573
+ if (!isProblemCode(code))
574
+ bad(`checks.${k.id}.code: ${code} is not a problem code`);
575
+ checks.push({ id: id.value, summary: k.summary ?? k.id, run: stepOf(k.command, `${k.id} (a function)`), code });
576
+ }
577
+ if (!dedupe(checks.map((k) => k.id)))
578
+ bad("checks: an id is used twice");
579
+ const capabilities = { release: false, newLibrary: false, status: false, prove: false, ...input.capabilities };
580
+ const needsLibraries = CAPABILITY_NAMES.filter((name) => capabilities[name]);
581
+ const libraries = input.libraries === undefined ? undefined : { folder: input.libraries.folder, specKit: input.libraries.specKit, versionConstants: input.libraries.versionConstants ?? false, declaredDependencies: input.libraries.declaredDependencies ?? false, linker: input.libraries.linker, roleFile: input.libraries.roleFile };
582
+ if (libraries === undefined && needsLibraries.length > 0)
583
+ bad(`capabilities ${needsLibraries.join(", ")} need libraries: { folder }, the folder of the library manifests`);
584
+ if (libraries !== undefined && !relative(libraries.folder))
585
+ bad("libraries.folder is a folder inside the repository, written with /");
586
+ const h = input.hygiene;
587
+ const hygiene = h === undefined ? undefined : { scope: h.scope, gitSources: (h.gitSources ?? []).map((s) => s.toLowerCase()), pathSegment: h.pathSegment ?? "", sourceMarker: h.sourceMarker ?? "", allow: { paths: h.allow?.paths ?? [], packages: h.allow?.packages ?? [] } };
588
+ if (hygiene !== undefined && !/^@[a-z0-9][a-z0-9._-]*\/$/.test(hygiene.scope))
589
+ bad('hygiene.scope is an npm scope with its slash, for example "@acme/"');
590
+ const d = input.doctor ?? {};
591
+ const doctor = { minNode: d.minNode, bunPin: d.bunPin, links: d.links, install: d.install ?? "bun install --frozen-lockfile" };
592
+ const docs = input.docs === undefined ? undefined : { config: input.docs.config ?? "docs.config.ts", out: input.docs.out ?? "_site", generator: input.docs.generator };
593
+ if (docs !== undefined && (!relative(docs.config) || !relative(docs.out) || docs.generator !== undefined && !relative(docs.generator)))
594
+ bad("docs.config, docs.out and docs.generator are paths inside the repository, written with /");
595
+ if (problems.length > 0 || tierVariable === undefined || readOnlyVariable === undefined)
596
+ return err(problems);
597
+ return ok({ repo: input.repo, tierVariable, readOnlyVariable, commit, generators: withAfter, checks, capabilities, libraries, hygiene, doctor, docs });
598
+ }
599
+ function enabledVerbs(config) {
600
+ const out = [];
601
+ const capability = (name) => {
602
+ switch (name) {
603
+ case "release":
604
+ out.push("release plan", "release apply", "release publish");
605
+ return;
606
+ case "newLibrary":
607
+ out.push("new library");
608
+ return;
609
+ case "status":
610
+ out.push("status");
611
+ return;
612
+ case "prove":
613
+ out.push("prove");
614
+ return;
615
+ default:
616
+ absurd(name);
617
+ }
618
+ };
619
+ for (const name of CAPABILITY_NAMES)
620
+ if (config.capabilities[name])
621
+ capability(name);
622
+ if (config.hygiene !== undefined)
623
+ out.push("hygiene");
624
+ if (config.docs !== undefined)
625
+ out.push("docs build", "docs serve", "docs check");
626
+ return out;
627
+ }
628
+ // src/governance/generators.ts
629
+ function stepText(step) {
630
+ return step.kind === "program" ? step.argv.join(" ") : step.label;
631
+ }
632
+ // src/governance/identity.ts
633
+ var SESSION_VARIABLE = "CLAUDE_SESSION_URL";
634
+ var CO_AUTHOR_VARIABLE = "REPOCTL_CO_AUTHOR";
635
+ function identityArgs(identity) {
636
+ return ["-c", `user.name=${identity.name}`, "-c", `user.email=${identity.email}`];
637
+ }
638
+ // src/governance/proof.ts
639
+ var PROOF_TIER_IDS = ["T0", "T1", "T2", "T3", "T4", "T5", "T6"];
640
+ var PROOF_TIERS = {
641
+ T0: { id: "T0", name: "static", proves: "types, format, specification and trace checks, on the affected files alone", budgetSeconds: 10, runsOn: ["edit", "push", "main", "nightly", "release"] },
642
+ T1: { id: "T1", name: "library", proves: "the suite of one library, property tests included", budgetSeconds: 30, runsOn: ["edit", "push", "main", "nightly", "release"] },
643
+ T2: { id: "T2", name: "seam", proves: "provider conformance and consumer seam tests where a provider's surface changed", budgetSeconds: 120, runsOn: ["push", "main", "nightly", "release"] },
644
+ T3: { id: "T3", name: "packaging", proves: "a tarball packed, installed, imported and type-checked", budgetSeconds: 120, runsOn: ["push", "main", "nightly", "release"] },
645
+ T4: { id: "T4", name: "end to end", proves: "the hermetic flows of a product", budgetSeconds: 600, runsOn: ["main", "nightly", "release"] },
646
+ T5: { id: "T5", name: "platform", proves: "Windows, macOS and Node against Bun, for libraries with code of their own for a system", budgetSeconds: 600, runsOn: ["main", "nightly", "release"] },
647
+ T6: { id: "T6", name: "release", proves: "everything, once per release", budgetSeconds: 1800, runsOn: ["release"] }
648
+ };
649
+ function parseProofTier(text) {
650
+ const word = /^T?([0-6])$/.exec(text.trim());
651
+ const found = PROOF_TIER_IDS.find((t) => t === `T${word?.[1] ?? ""}`);
652
+ return found === undefined ? err(`${JSON.stringify(text)} is not a tier: 0 to 6, or T0 to T6`) : ok(found);
653
+ }
654
+ var CHANGE_CLASSES = ["prose", "spec", "spec-requirements", "generated", "version", "test", "source", "packaging", "planner", "outside"];
655
+ var CLASS_RULES = {
656
+ prose: { class: "prose", means: "a comment, TSDoc or text with no code change", proofs: "the documentation check", tiers: ["T0"] },
657
+ spec: { class: "spec", means: "a specification whose requirement identifiers are unchanged", proofs: "the specification and trace checks", tiers: ["T0"] },
658
+ "spec-requirements": { class: "spec-requirements", means: "a specification whose requirement identifiers changed", proofs: "the specification and trace checks, and the suite of the library", tiers: ["T0", "T1"] },
659
+ generated: { class: "generated", means: "a file a generator makes", proofs: "sync --check: the bytes equal the generators'", tiers: ["T0"] },
660
+ version: { class: "version", means: "a version or a release record only", proofs: "the versions check", tiers: ["T0"] },
661
+ test: { class: "test", means: "a test file of a library", proofs: "types, trace and the suite of that library", tiers: ["T0", "T1"] },
662
+ source: {
663
+ class: "source",
664
+ means: "code inside a library",
665
+ proofs: "types, trace and the suite of the library; its importers only where the public surface changed, and only the importers of the changed symbols; a foundation library also its smoke gate",
666
+ tiers: ["T0", "T1", "T2"]
667
+ },
668
+ packaging: { class: "packaging", means: "exports, package.json beyond its version, the packer", proofs: "pack, install, import and type-check the tarball", tiers: ["T0", "T3"] },
669
+ planner: { class: "planner", means: "the planner, the generators, the workflows or the tier rules", proofs: "every proof of every tier", tiers: ["T0", "T1", "T2", "T3", "T4", "T5", "T6"] },
670
+ outside: { class: "outside", means: "a file in no library that is none of the above", proofs: "the checks of the repository and the libraries that read the file", tiers: ["T0", "T1", "T4"] }
671
+ };
672
+ function tierOfProof(p) {
673
+ switch (p.kind) {
674
+ case "docs-check":
675
+ case "spec-check":
676
+ case "trace-check":
677
+ case "types":
678
+ case "sync-check":
679
+ case "versions-check":
680
+ return "T0";
681
+ case "suite":
682
+ case "smoke":
683
+ return "T1";
684
+ case "seam":
685
+ return "T2";
686
+ case "pack":
687
+ return "T3";
688
+ case "end-to-end":
689
+ return "T4";
690
+ case "platform":
691
+ return "T5";
692
+ case "release-gate":
693
+ return "T6";
694
+ default:
695
+ return absurd(p);
696
+ }
697
+ }
698
+ function proofKey(p) {
699
+ switch (p.kind) {
700
+ case "docs-check":
701
+ case "sync-check":
702
+ case "versions-check":
703
+ case "end-to-end":
704
+ case "release-gate":
705
+ return p.kind;
706
+ case "spec-check":
707
+ return `${p.kind}:${p.scope}`;
708
+ case "trace-check":
709
+ case "types":
710
+ case "suite":
711
+ case "smoke":
712
+ case "pack":
713
+ return `${p.kind}:${p.library}`;
714
+ case "seam":
715
+ return `${p.kind}:${p.provider}>${p.consumer}`;
716
+ case "platform":
717
+ return `${p.kind}:${p.library}:${p.system}`;
718
+ default:
719
+ return absurd(p);
720
+ }
721
+ }
722
+ var SKIP_REASONS = ["class-needs-none", "surface-unchanged", "symbols-unused", "tests-unaffected", "cache-hit", "tier-scheduled", "quarantined"];
723
+ var FOUNDATION = ["core", "formats", "crypto", "system", "terminal", "kanon", "libraries"];
724
+ var PLANNER_GLOBS = [
725
+ "commons/repoctl/src/governance/proof.ts",
726
+ "commons/repoctl/src/governance/generators.ts",
727
+ "commons/repoctl/src/logical/prove*.ts",
728
+ "commons/repoctl/src/logical/surface.ts",
729
+ "commons/repoctl/src/logical/select.ts",
730
+ "commons/repoctl/src/physical/tests.ts",
731
+ "commons/repoctl/src/physical/prove*.ts",
732
+ "commons/repoctl/src/physical/verbs/prove.ts",
733
+ "commons/libraries/src/affected.ts",
734
+ "commons/libraries/src/plan.ts",
735
+ "commons/libraries/src/dev.ts",
736
+ "commons/libraries/src/generate-*.ts",
737
+ "commons/libraries/src/libraries.ts",
738
+ "commons/libraries/src/readme.ts",
739
+ "commons/libraries/src/license.ts",
740
+ "commons/libraries/src/workflows/**",
741
+ "commons/tools/generate-*.ts"
742
+ ];
743
+ function parseQuarantine(text) {
744
+ let raw;
745
+ try {
746
+ raw = JSON.parse(text);
747
+ } catch {
748
+ return err("the quarantine record is not JSON");
749
+ }
750
+ if (!Array.isArray(raw))
751
+ return err("the quarantine record is a list of entries");
752
+ const entries = [];
753
+ for (const [i, e] of raw.entries()) {
754
+ if (typeof e !== "object" || e === null)
755
+ return err(`entry ${i} is not an object`);
756
+ const field = (k) => {
757
+ const v = Object.entries(e).find(([name]) => name === k)?.[1];
758
+ return typeof v === "string" ? v : "";
759
+ };
760
+ const entry = { test: field("test"), owner: field("owner"), expires: field("expires"), reason: field("reason") };
761
+ if (entry.test === "" || entry.owner === "" || entry.reason === "")
762
+ return err(`entry ${i} needs a test, an owner and a reason`);
763
+ if (!/^\d{4}-\d{2}-\d{2}$/.test(entry.expires))
764
+ return err(`entry ${i} needs an expiry day as YYYY-MM-DD`);
765
+ entries.push(entry);
766
+ }
767
+ return ok(entries);
768
+ }
769
+ // ../headless/src/governance/tier.ts
770
+ var tierDecoder = refine(string, "tier name", (t) => /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/.test(t));
771
+ function parseTierName(text) {
772
+ const r = tierDecoder(text, "tier");
773
+ return r.kind === "ok" ? ok(r.value) : err(`${JSON.stringify(text)} is not a tier name: lower-case words joined by hyphens`);
774
+ }
775
+ function literalTier(text) {
776
+ const r = parseTierName(text);
777
+ if (r.kind === "err")
778
+ throw new Error(r.error);
779
+ return r.value;
780
+ }
781
+ var PUBLIC = literalTier("public");
782
+ var OPERATOR = literalTier("operator");
783
+ var ADMINISTRATOR = literalTier("administrator");
784
+ // ../headless/src/governance/redact.ts
785
+ var VALUE = String.raw`('[^']*'|"[^"]*"|[^\s,;&'"]+)`;
786
+ // src/governance/tiers.ts
787
+ var TIER_IDS = ["public", "contributor", "releaser"];
788
+ function named(id, standIn) {
789
+ const r = parseTierName(id);
790
+ return r.kind === "ok" ? r.value : standIn;
791
+ }
792
+ var TIERS = {
793
+ public: PUBLIC,
794
+ contributor: named("contributor", OPERATOR),
795
+ releaser: named("releaser", ADMINISTRATOR)
796
+ };
797
+ var LADDER = { ladder: [TIERS.public, TIERS.contributor, TIERS.releaser], default: TIERS.contributor };
798
+ function tierOf(word) {
799
+ const id = TIER_IDS.find((t) => t === word);
800
+ return id === undefined ? undefined : TIERS[id];
801
+ }
802
+ // src/governance/verbs.ts
803
+ var VERBS = {
804
+ sync: {
805
+ id: "sync",
806
+ summary: "Make every generated file, in dependency order, rerunning only the generators whose output is stale.",
807
+ kind: "action",
808
+ effect: "mutate",
809
+ idempotent: true,
810
+ dryRun: true,
811
+ check: true,
812
+ tier: "contributor",
813
+ channels: ["local", "mcp"],
814
+ confirmation: "none",
815
+ humanOnly: []
816
+ },
817
+ merge: {
818
+ id: "merge",
819
+ summary: "Merge a reference, regenerate the generated files that conflict and report the conflicts in files a person wrote.",
820
+ kind: "action",
821
+ effect: "mutate",
822
+ idempotent: false,
823
+ dryRun: false,
824
+ check: false,
825
+ tier: "contributor",
826
+ channels: ["local", "mcp"],
827
+ confirmation: "none",
828
+ humanOnly: []
829
+ },
830
+ check: {
831
+ id: "check",
832
+ summary: "Run every check of the repository (generated files, specifications, rules, versions) and say what is wrong in one report.",
833
+ kind: "report",
834
+ effect: "read",
835
+ idempotent: true,
836
+ dryRun: false,
837
+ check: false,
838
+ tier: "public",
839
+ channels: ["local", "mcp"],
840
+ confirmation: "none",
841
+ humanOnly: []
842
+ },
843
+ status: {
844
+ id: "status",
845
+ summary: "Tell, for each library, its version in the repository, on npm and in its tag.",
846
+ kind: "report",
847
+ effect: "read",
848
+ idempotent: true,
849
+ dryRun: false,
850
+ check: false,
851
+ tier: "public",
852
+ channels: ["local", "mcp"],
853
+ confirmation: "none",
854
+ humanOnly: []
855
+ },
856
+ hygiene: {
857
+ id: "hygiene",
858
+ summary: "Say whether this repository consumes commons as published packages: no Git or path dependency, no vendored copy, one copy of each library, exact versions.",
859
+ kind: "report",
860
+ effect: "read",
861
+ idempotent: true,
862
+ dryRun: false,
863
+ check: false,
864
+ tier: "public",
865
+ channels: ["local", "mcp"],
866
+ confirmation: "none",
867
+ humanOnly: []
868
+ },
869
+ "release plan": {
870
+ id: "release plan",
871
+ summary: "Say what a release would do, library by library and why; writes nothing.",
872
+ kind: "report",
873
+ effect: "read",
874
+ idempotent: true,
875
+ dryRun: false,
876
+ check: false,
877
+ tier: "public",
878
+ channels: ["local", "mcp"],
879
+ confirmation: "none",
880
+ humanOnly: []
881
+ },
882
+ "release apply": {
883
+ id: "release apply",
884
+ summary: "Make a release: raise the versions the plan says, make the generated files, run the tests that pack and write the record; commits nothing.",
885
+ kind: "action",
886
+ effect: "mutate",
887
+ idempotent: false,
888
+ dryRun: true,
889
+ check: false,
890
+ tier: "contributor",
891
+ channels: ["local", "mcp"],
892
+ confirmation: "none",
893
+ humanOnly: []
894
+ },
895
+ "release publish": {
896
+ id: "release publish",
897
+ summary: "Publish the packed libraries of the release record to npm, behind the releaser tier and a typed confirmation.",
898
+ kind: "action",
899
+ effect: "destructive",
900
+ idempotent: false,
901
+ dryRun: true,
902
+ check: false,
903
+ tier: "releaser",
904
+ channels: ["local", "mcp"],
905
+ confirmation: "person",
906
+ humanOnly: ["confirm"]
907
+ },
908
+ "new library": {
909
+ id: "new library",
910
+ summary: "Scaffold a library of commons: its folder, manifest, about.ts, specification kit, tools, tsconfig and LICENSE, and make what needs it again.",
911
+ kind: "action",
912
+ effect: "mutate",
913
+ idempotent: false,
914
+ dryRun: true,
915
+ check: false,
916
+ tier: "contributor",
917
+ channels: ["local", "mcp"],
918
+ confirmation: "none",
919
+ humanOnly: []
920
+ },
921
+ commit: {
922
+ id: "commit",
923
+ summary: "Make the commit with the repository's identity and trailers, refusing what must not be committed, after the generated files are checked.",
924
+ kind: "action",
925
+ effect: "mutate",
926
+ idempotent: false,
927
+ dryRun: true,
928
+ check: false,
929
+ tier: "contributor",
930
+ channels: ["local", "mcp"],
931
+ confirmation: "none",
932
+ humanOnly: []
933
+ },
934
+ doctor: {
935
+ id: "doctor",
936
+ summary: "Say what is wrong with this checkout (dependencies, links, Node, Bun, stale generated files) and what to do about it.",
937
+ kind: "report",
938
+ effect: "read",
939
+ idempotent: true,
940
+ dryRun: false,
941
+ check: false,
942
+ tier: "public",
943
+ channels: ["local", "mcp"],
944
+ confirmation: "none",
945
+ humanOnly: []
946
+ },
947
+ prove: {
948
+ id: "prove",
949
+ summary: "Compute the proof a change needs from its blast radius (the tiers, the tests and why each skipped proof is safe) and run it.",
950
+ kind: "report",
951
+ effect: "read",
952
+ idempotent: true,
953
+ dryRun: false,
954
+ check: false,
955
+ tier: "public",
956
+ channels: ["local", "mcp"],
957
+ confirmation: "none",
958
+ humanOnly: []
959
+ },
960
+ "docs build": {
961
+ id: "docs build",
962
+ summary: "Build the documentation site of this repository with the documentation generator, into the folder its configuration names.",
963
+ kind: "action",
964
+ effect: "mutate",
965
+ idempotent: true,
966
+ dryRun: true,
967
+ check: false,
968
+ tier: "contributor",
969
+ channels: ["local", "mcp"],
970
+ confirmation: "none",
971
+ humanOnly: []
972
+ },
973
+ "docs serve": {
974
+ id: "docs serve",
975
+ summary: "Build the documentation site and serve it on a loopback port of this computer until the run is stopped; nothing is uploaded.",
976
+ kind: "action",
977
+ effect: "mutate",
978
+ idempotent: true,
979
+ dryRun: true,
980
+ check: false,
981
+ tier: "contributor",
982
+ channels: ["local"],
983
+ confirmation: "none",
984
+ humanOnly: []
985
+ },
986
+ "docs check": {
987
+ id: "docs check",
988
+ summary: "Build the documentation site into a temporary folder and say every finding, writing nothing in the repository.",
989
+ kind: "report",
990
+ effect: "read",
991
+ idempotent: true,
992
+ dryRun: false,
993
+ check: false,
994
+ tier: "public",
995
+ channels: ["local", "mcp"],
996
+ confirmation: "none",
997
+ humanOnly: []
998
+ },
999
+ mcp: {
1000
+ id: "mcp",
1001
+ summary: "Serve the verbs the held tier sees as tools of a tool server on standard input and output.",
1002
+ kind: "report",
1003
+ effect: "read",
1004
+ idempotent: true,
1005
+ dryRun: false,
1006
+ check: false,
1007
+ tier: "public",
1008
+ channels: ["local"],
1009
+ confirmation: "none",
1010
+ humanOnly: []
1011
+ }
1012
+ };
1013
+ function verbIds() {
1014
+ return ["check", "sync", "merge", "status", "hygiene", "release plan", "release apply", "release publish", "new library", "commit", "doctor", "prove", "docs build", "docs serve", "docs check", "mcp"];
1015
+ }
1016
+ // src/governance/version.ts
1017
+ var REPOCTL_VERSION = "0.1.0";
1018
+ export {
1019
+ CAPABILITY_NAMES,
1020
+ CATALOGUE,
1021
+ CHANGE_CLASSES,
1022
+ CLASS_RULES,
1023
+ CONFIG_FILE,
1024
+ CO_AUTHOR_VARIABLE,
1025
+ DEFAULT_ALLOWED_PATHS,
1026
+ DEFAULT_FORBIDDEN_PATHS,
1027
+ DEFAULT_READ_ONLY_VARIABLE,
1028
+ DEFAULT_SECRET_PATTERNS,
1029
+ DEFAULT_TIER_VARIABLE,
1030
+ FOUNDATION,
1031
+ LADDER,
1032
+ PLANNER_GLOBS,
1033
+ PROBLEM_CODES,
1034
+ PROOF_TIERS,
1035
+ PROOF_TIER_IDS,
1036
+ REPOCTL_VERSION,
1037
+ SESSION_VARIABLE,
1038
+ SKIP_REASONS,
1039
+ TIERS,
1040
+ TIER_IDS,
1041
+ TRAILER_KINDS,
1042
+ VERBS,
1043
+ defineConfig,
1044
+ enabledVerbs,
1045
+ identityArgs,
1046
+ isProblemCode,
1047
+ parseConfig,
1048
+ parseGitRef,
1049
+ parseIssueNumber,
1050
+ parseLibraryName,
1051
+ parseProofTier,
1052
+ parseQuarantine,
1053
+ parseSemver,
1054
+ parseSessionUrl,
1055
+ parseStepId,
1056
+ parseSubject,
1057
+ parseVariableName,
1058
+ proofKey,
1059
+ stepText,
1060
+ tierOf,
1061
+ tierOfProof,
1062
+ verbIds
1063
+ };