@tiphys/kernel 0.0.0 → 0.2.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 (207) hide show
  1. package/AGENTS.md +663 -0
  2. package/LICENSE +202 -0
  3. package/assurance-modes.yaml +299 -0
  4. package/checklists/clean-room.yaml +325 -0
  5. package/checklists/env-failure-diagnosis.yaml +68 -0
  6. package/checklists/flake-playbook.yaml +68 -0
  7. package/checklists/hazard-review.yaml +144 -0
  8. package/checklists/plan-review.yaml +103 -0
  9. package/dist/bin/tiphys.d.ts +2 -0
  10. package/dist/bin/tiphys.js +92 -0
  11. package/dist/src/adapters/load.d.ts +202 -0
  12. package/dist/src/adapters/load.js +440 -0
  13. package/dist/src/brief.d.ts +32 -0
  14. package/dist/src/brief.js +66 -0
  15. package/dist/src/checklists.d.ts +169 -0
  16. package/dist/src/checklists.js +310 -0
  17. package/dist/src/checks.d.ts +1539 -0
  18. package/dist/src/checks.js +5025 -0
  19. package/dist/src/cli.d.ts +9 -0
  20. package/dist/src/cli.js +68 -0
  21. package/dist/src/commands/brief.d.ts +92 -0
  22. package/dist/src/commands/brief.js +343 -0
  23. package/dist/src/commands/checklist.d.ts +42 -0
  24. package/dist/src/commands/checklist.js +168 -0
  25. package/dist/src/commands/cutover.d.ts +35 -0
  26. package/dist/src/commands/cutover.js +448 -0
  27. package/dist/src/commands/doctor.d.ts +264 -0
  28. package/dist/src/commands/doctor.js +1546 -0
  29. package/dist/src/commands/gates.d.ts +9 -0
  30. package/dist/src/commands/gates.js +360 -0
  31. package/dist/src/commands/init.d.ts +30 -0
  32. package/dist/src/commands/init.js +177 -0
  33. package/dist/src/commands/lock.d.ts +34 -0
  34. package/dist/src/commands/lock.js +340 -0
  35. package/dist/src/commands/mode.d.ts +40 -0
  36. package/dist/src/commands/mode.js +134 -0
  37. package/dist/src/commands/next.d.ts +130 -0
  38. package/dist/src/commands/next.js +597 -0
  39. package/dist/src/commands/plan.d.ts +20 -0
  40. package/dist/src/commands/plan.js +105 -0
  41. package/dist/src/commands/pool.d.ts +1 -0
  42. package/dist/src/commands/pool.js +139 -0
  43. package/dist/src/commands/resume.d.ts +1 -0
  44. package/dist/src/commands/resume.js +88 -0
  45. package/dist/src/commands/spawn.d.ts +1 -0
  46. package/dist/src/commands/spawn.js +195 -0
  47. package/dist/src/commands/status.d.ts +21 -0
  48. package/dist/src/commands/status.js +122 -0
  49. package/dist/src/commands/sync.d.ts +47 -0
  50. package/dist/src/commands/sync.js +341 -0
  51. package/dist/src/commands/teardown.d.ts +1 -0
  52. package/dist/src/commands/teardown.js +87 -0
  53. package/dist/src/commands/tuition.d.ts +21 -0
  54. package/dist/src/commands/tuition.js +218 -0
  55. package/dist/src/commands/validate.d.ts +78 -0
  56. package/dist/src/commands/validate.js +430 -0
  57. package/dist/src/commands/watch.d.ts +1 -0
  58. package/dist/src/commands/watch.js +172 -0
  59. package/dist/src/cutover.d.ts +584 -0
  60. package/dist/src/cutover.js +1444 -0
  61. package/dist/src/exclusion.d.ts +389 -0
  62. package/dist/src/exclusion.js +843 -0
  63. package/dist/src/exec/env.d.ts +278 -0
  64. package/dist/src/exec/env.js +334 -0
  65. package/dist/src/fleet.d.ts +223 -0
  66. package/dist/src/fleet.js +298 -0
  67. package/dist/src/gates/adapters/http-json.d.ts +5 -0
  68. package/dist/src/gates/adapters/http-json.js +283 -0
  69. package/dist/src/gates/adapters/migrations-command.d.ts +1 -0
  70. package/dist/src/gates/adapters/migrations-command.js +373 -0
  71. package/dist/src/gates/citations.d.ts +408 -0
  72. package/dist/src/gates/citations.js +1169 -0
  73. package/dist/src/gates/coverage.d.ts +375 -0
  74. package/dist/src/gates/coverage.js +836 -0
  75. package/dist/src/gates/credentials.d.ts +233 -0
  76. package/dist/src/gates/credentials.js +752 -0
  77. package/dist/src/gates/deploy.d.ts +1 -0
  78. package/dist/src/gates/deploy.js +33 -0
  79. package/dist/src/gates/gate-classes.d.ts +56 -0
  80. package/dist/src/gates/gate-classes.js +633 -0
  81. package/dist/src/gates/manifest.d.ts +99 -0
  82. package/dist/src/gates/manifest.js +208 -0
  83. package/dist/src/gates/merge-preconditions.d.ts +319 -0
  84. package/dist/src/gates/merge-preconditions.js +932 -0
  85. package/dist/src/gates/migrations.d.ts +1 -0
  86. package/dist/src/gates/migrations.js +36 -0
  87. package/dist/src/gates/pin.d.ts +114 -0
  88. package/dist/src/gates/pin.js +154 -0
  89. package/dist/src/gates/red-witness.d.ts +22 -0
  90. package/dist/src/gates/red-witness.js +482 -0
  91. package/dist/src/gates/release.d.ts +283 -0
  92. package/dist/src/gates/release.js +820 -0
  93. package/dist/src/gates/result.d.ts +116 -0
  94. package/dist/src/gates/result.js +91 -0
  95. package/dist/src/gates/run.d.ts +614 -0
  96. package/dist/src/gates/run.js +1614 -0
  97. package/dist/src/gates/schemas/citation-config.schema.json +59 -0
  98. package/dist/src/gates/schemas/coverage-config.schema.json +77 -0
  99. package/dist/src/gates/schemas/gate-manifest.schema.json +125 -0
  100. package/dist/src/gates/schemas/gate-result.schema.json +160 -0
  101. package/dist/src/gates/schemas/phase-declaration.schema.json +87 -0
  102. package/dist/src/gates/schemas/release-record.schema.json +119 -0
  103. package/dist/src/gates/schemas/verifier-config.schema.json +101 -0
  104. package/dist/src/gates/schemas/witness-spec.schema.json +110 -0
  105. package/dist/src/gates/scope.d.ts +131 -0
  106. package/dist/src/gates/scope.js +1018 -0
  107. package/dist/src/gates/suite.d.ts +217 -0
  108. package/dist/src/gates/suite.js +968 -0
  109. package/dist/src/gates/validate.d.ts +121 -0
  110. package/dist/src/gates/validate.js +414 -0
  111. package/dist/src/hooks.d.ts +84 -0
  112. package/dist/src/hooks.js +125 -0
  113. package/dist/src/index.d.ts +31 -0
  114. package/dist/src/index.js +30 -0
  115. package/dist/src/liveness.d.ts +321 -0
  116. package/dist/src/liveness.js +396 -0
  117. package/dist/src/lock.d.ts +256 -0
  118. package/dist/src/lock.js +792 -0
  119. package/dist/src/model-resolution.d.ts +159 -0
  120. package/dist/src/model-resolution.js +307 -0
  121. package/dist/src/modes.d.ts +149 -0
  122. package/dist/src/modes.js +258 -0
  123. package/dist/src/path-identity.d.ts +34 -0
  124. package/dist/src/path-identity.js +48 -0
  125. package/dist/src/plan.d.ts +73 -0
  126. package/dist/src/plan.js +153 -0
  127. package/dist/src/pool.d.ts +326 -0
  128. package/dist/src/pool.js +988 -0
  129. package/dist/src/roles.d.ts +461 -0
  130. package/dist/src/roles.js +776 -0
  131. package/dist/src/spawn.d.ts +482 -0
  132. package/dist/src/spawn.js +1003 -0
  133. package/dist/src/status.d.ts +116 -0
  134. package/dist/src/status.js +148 -0
  135. package/dist/src/task.d.ts +504 -0
  136. package/dist/src/task.js +307 -0
  137. package/dist/src/teardown.d.ts +39 -0
  138. package/dist/src/teardown.js +422 -0
  139. package/dist/src/tuition.d.ts +159 -0
  140. package/dist/src/tuition.js +311 -0
  141. package/dist/src/validate.d.ts +263 -0
  142. package/dist/src/validate.js +742 -0
  143. package/dist/src/version.d.ts +3 -0
  144. package/dist/src/version.js +38 -0
  145. package/dist/src/watcher.d.ts +275 -0
  146. package/dist/src/watcher.js +849 -0
  147. package/dist/src/witness/run.d.ts +299 -0
  148. package/dist/src/witness/run.js +1373 -0
  149. package/dist/src/witness/spec.d.ts +270 -0
  150. package/dist/src/witness/spec.js +475 -0
  151. package/dist/tsconfig.src.tsbuildinfo +1 -0
  152. package/gate-registry.yaml +526 -0
  153. package/gates.manifest.json +257 -0
  154. package/package.json +72 -3
  155. package/role-model-config.yaml +88 -0
  156. package/roles/README.md +128 -0
  157. package/roles/_shared-dispatch-contract.md +87 -0
  158. package/roles/adversarial-plan-reviewer.md +80 -0
  159. package/roles/clean-room-reviewer.md +140 -0
  160. package/roles/implementer.md +463 -0
  161. package/roles/investigator.md +138 -0
  162. package/roles/plan-writer.md +95 -0
  163. package/schemas/README.md +82 -0
  164. package/schemas/assurance-modes.schema.json +264 -0
  165. package/schemas/charter.schema.json +185 -0
  166. package/schemas/checklist.schema.json +114 -0
  167. package/schemas/cutover-state.schema.json +64 -0
  168. package/schemas/decision-record.schema.json +88 -0
  169. package/schemas/executor-record.schema.json +36 -0
  170. package/schemas/final-report.schema.json +90 -0
  171. package/schemas/finding.schema.json +106 -0
  172. package/schemas/gate-registry.schema.json +260 -0
  173. package/schemas/mechanism-index.schema.json +94 -0
  174. package/schemas/model-resolution.schema.json +362 -0
  175. package/schemas/plan.schema.json +300 -0
  176. package/schemas/report.schema.json +579 -0
  177. package/schemas/role-brief.schema.json +105 -0
  178. package/schemas/role-model-config.schema.json +90 -0
  179. package/schemas/status-line.schema.json +40 -0
  180. package/schemas/tuition.schema.json +191 -0
  181. package/schemas/verdict.schema.json +295 -0
  182. package/schemas/work-history.schema.json +183 -0
  183. package/schemas/write-bypass.schema.json +69 -0
  184. package/templates/charter.example.yaml +54 -0
  185. package/templates/decision-record.example.yaml +27 -0
  186. package/templates/final-report.example.yaml +80 -0
  187. package/templates/plan.example.yaml +87 -0
  188. package/templates/report.example.yaml +236 -0
  189. package/templates/warnings.md +74 -0
  190. package/templates/work-history.example.yaml +185 -0
  191. package/tuition/README.md +76 -0
  192. package/tuition/T-001.yaml +48 -0
  193. package/tuition/T-002.yaml +51 -0
  194. package/tuition/T-003.yaml +100 -0
  195. package/tuition/T-004.yaml +52 -0
  196. package/tuition/T-005.yaml +72 -0
  197. package/tuition/T-006.yaml +81 -0
  198. package/tuition/T-007.yaml +56 -0
  199. package/tuition/T-008.yaml +111 -0
  200. package/tuition/T-009.yaml +50 -0
  201. package/tuition/T-015.yaml +36 -0
  202. package/tuition/T-016.yaml +36 -0
  203. package/tuition/T-017.yaml +46 -0
  204. package/tuition/T-018.yaml +84 -0
  205. package/tuition/T-021.yaml +40 -0
  206. package/tuition/T-022.yaml +36 -0
  207. package/tuition/mechanism-index.yaml +256 -0
@@ -0,0 +1,264 @@
1
+ /**
2
+ * tiphys doctor: deterministic health checks over the current directory as
3
+ * a fleet home (kernel plan v1, M1-P2 step 3). One line per check, format
4
+ * "CHECK <name> PASS|WARN|FAIL <detail>", exit 0 only if no check FAILs.
5
+ * Every check is file-based (substrate-neutral, DR-0007): no process is
6
+ * ever probed (plan constraint C-2), and no currency is ever read off a
7
+ * log tail (plan constraint C-1; this phase's checks read no task state,
8
+ * and any later task-currency check must read tasks/<id>/meta.json and the
9
+ * turn-end file only).
10
+ */
11
+ export type CheckStatus = "PASS" | "WARN" | "FAIL";
12
+ export interface CheckResult {
13
+ name: string;
14
+ status: CheckStatus;
15
+ detail: string;
16
+ /** Names the WARN condition a profile may promote to FAIL (EXT-F-08). */
17
+ condition?: string;
18
+ }
19
+ /**
20
+ * Readiness profiles (EXT-F-08): a profile promotes its required WARN
21
+ * conditions to FAIL, so exit 0 under a profile means ready for that mode
22
+ * (SC-011: never green by omission). The M1 table is deliberately small
23
+ * and grows at M2/M3 with the gate registry.
24
+ */
25
+ export declare const PROFILES: Record<string, readonly string[]>;
26
+ /**
27
+ * Evaluate a running node version against the kernel's engines.node range.
28
+ * Fails closed (CR-102): only the exact ">=<major>[.<minor>[.<patch>]]"
29
+ * form is interpreted, compared over the full version tuple; any other
30
+ * range shape, and any unparseable version, is FAIL with a reason line,
31
+ * never a silent truncation.
32
+ */
33
+ export declare function nodeCheckFor(range: string, version: string): CheckResult;
34
+ /**
35
+ * THE VERDICT OVER A LEASE THAT HAS BEEN READ (M4-P17 criteria 1 and 2).
36
+ *
37
+ * AN EXPIRED LEASE IS A FAIL. Until this phase it was a PASS carrying the
38
+ * word `(expired)` inside the detail, and that is the H-B shape this
39
+ * repository keeps paying for: the check's condition was TRUE OF THE
40
+ * DANGEROUS STATE, so a fleet whose orchestrator died holding the lease
41
+ * reported `CHECK lock PASS` and doctor exited 0. AGENTS.md's resume clause
42
+ * says doctor reports "which leases are expired and who last held them"; a
43
+ * green line with a parenthesis in it is not that report, and an operator
44
+ * scanning for FAIL lines never saw it.
45
+ *
46
+ * The holder id and the expiry are both in the detail because the remedy
47
+ * needs both: WHO to ask before breaking the lease, and WHEN it lapsed.
48
+ *
49
+ * `nowMs` IS A PARAMETER, and that is what makes criterion 2's boundary
50
+ * member testable at all. `Date.now()` cannot be driven to a chosen
51
+ * millisecond from outside the process, so a lease whose expiry is exactly
52
+ * the current instant is unreachable through the CLI: by the time doctor
53
+ * runs, the instant has passed and the case under test is the interior one
54
+ * again. The caller above passes the clock; the witness passes an instant.
55
+ *
56
+ * THE COMPARISON IS NOT MADE HERE. `expiryHasPassed` (src/lock.ts) owns it,
57
+ * so doctor and the lock module cannot return two verdicts about one lease.
58
+ * That is the same rule checkBeacon follows for `judgeBeacon`, and it was
59
+ * written down there after a delta review found doctor carrying its own copy
60
+ * of the beacon comparison and missing a floor the module had.
61
+ */
62
+ export declare function lockCheckFor(holderId: string, expiresAt: string, nowMs: number): CheckResult;
63
+ /**
64
+ * The installed kernel's own package root: the first ancestor of THIS MODULE
65
+ * carrying a `package.json`.
66
+ *
67
+ * **This is deliberately NOT `kernelRoot()` from src/roles.ts, and the reason
68
+ * is the whole point of the check.** That function walks upward looking for a
69
+ * `roles/` directory containing a `.md` file, which is the very artifact this
70
+ * check exists to find missing: against an install with `roles/` removed it
71
+ * walks PAST the install and answers about an ancestor, and where no ancestor
72
+ * carries one it throws. A check built on it reports on the wrong tree or
73
+ * crashes on precisely the state its own criteria describe.
74
+ *
75
+ * Walking for `package.json` does not have that property. `package.json` is
76
+ * the package BOUNDARY rather than a member of the set under test, and it is
77
+ * present in both shipped layouts. Measured on this head: the published
78
+ * package puts this module at `dist/src/commands/doctor.js` with the artifacts
79
+ * three levels up at the package root, and the development checkout puts it at
80
+ * `src/commands/doctor.ts` with the artifacts two levels up, while
81
+ * `dist/package.json` does not exist in the pack listing. So a FIXED DEPTH
82
+ * from `import.meta.url` is wrong in one of the two layouts and the first
83
+ * `package.json` above the module is right in both.
84
+ *
85
+ * Returns the reason rather than throwing, because a guard whose correctness
86
+ * depends on a crash is not a guard (mechanism index,
87
+ * `a-guard-s-own-failure-path`).
88
+ */
89
+ export declare function resolveInstalledKernelRoot(from?: string): {
90
+ ok: true;
91
+ root: string;
92
+ } | {
93
+ ok: false;
94
+ reason: string;
95
+ };
96
+ /**
97
+ * `kernel-artifacts`: the resolved kernel install carries every artifact M3
98
+ * made load-bearing (kernel plan M3 section 4, stage E0.4's designated subject;
99
+ * phase M3-P13).
100
+ *
101
+ * WHAT THIS CHECK IS FOR. The brief composer resolves `roles/`, the validator
102
+ * loads `schemas/`, the checklist command resolves `checklists/`, and
103
+ * `AGENTS.md` is the policy document every role brief points at. Until now an
104
+ * install that lost one of them reported nothing wrong: the loss surfaced later
105
+ * as one command's resolution failure, whose message names the path it could
106
+ * not open rather than the state of the install. doctor is the command whose
107
+ * whole job is answering "is this environment fit to run", and the kernel's own
108
+ * artifacts were the one input none of its checks looked at.
109
+ *
110
+ * EVERY missing artifact is named, not the first (decision D-2): a check that
111
+ * names one sends its reader round the loop once per missing item, and the loop
112
+ * here is a reinstall.
113
+ *
114
+ * The condition is `kernel-artifacts-incomplete`, promoted to FAIL under the
115
+ * `full` profile and left a WARN below it. Below `full` no command that needs
116
+ * these artifacts is necessarily in the pipeline, and promoting everywhere is
117
+ * how a check like this ends up failing a fleet that never needed it.
118
+ */
119
+ export declare function checkKernelArtifacts(resolution?: ReturnType<typeof resolveInstalledKernelRoot>): CheckResult;
120
+ /**
121
+ * CHECK tasks (M4-P17 criterion 3): how many tasks are OPEN, and which.
122
+ *
123
+ * THE DEFINITION IS THE PLAN'S AND IT IS DELIBERATELY NARROW. A task is open
124
+ * when `tasks/<id>/meta.json` is there and `tasks/<id>/turn-end` is not. Two
125
+ * file existences, both under `tasks/`, and nothing else. No log is read
126
+ * (constraint C-1: currency never comes off the tail of an append-only
127
+ * stream), and nothing is probed for being alive (constraint C-2: liveness is
128
+ * lease freshness, never a process). A test in test/doctor.test.ts greps this
129
+ * function's own source for the four tokens that would mean either constraint
130
+ * had been broken, because a violation of either is invisible in the output.
131
+ *
132
+ * ESTABLISHED, ABSENT, UNUSABLE, AND THEY NEVER PRINT THE SAME WORD. This is
133
+ * the one thing this check must not get wrong. The kernel already carries a
134
+ * live instance of the opposite, tracked at
135
+ * delivery/verification/tracked-doctor-charter-selection.md:1: the retention
136
+ * check selects charter documents by a raw `kind` read, so a document whose
137
+ * `kind` cannot be read is SKIPPED, and skipping is indistinguishable from
138
+ * absence, so the command reports PASS over a fleet it could not examine. A
139
+ * fourth check with that shape would be worse than no check.
140
+ *
141
+ * So every candidate under `tasks/` lands in exactly one of three buckets and
142
+ * the third is reported by name:
143
+ *
144
+ * - open meta.json is a regular file, turn-end is absent
145
+ * - closed meta.json is a regular file, turn-end is a regular file
146
+ * - UNUSABLE anything else: no meta.json at all, a meta.json or a turn-end
147
+ * that is a directory, a named pipe, a dangling link, or a path
148
+ * `lstat` itself could not answer about
149
+ *
150
+ * An UNUSABLE candidate is a WARN carrying its own condition, never folded
151
+ * into "closed" and never dropped from the total. A directory under `tasks/`
152
+ * with no `meta.json` is the common real shape of it, a task half created or
153
+ * half removed, and the honest report is that the check could not establish
154
+ * what it is.
155
+ *
156
+ * NO PATH HERE IS OPENED. `classifyEntry` (src/task.ts) lstats, stats and
157
+ * answers a kind; a named pipe at `tasks/<id>/meta.json` is therefore a named
158
+ * WARN in bounded time rather than a doctor that hangs with no output, which
159
+ * is the defect CR-520 recorded at the lease path and which this check would
160
+ * otherwise reintroduce one directory along.
161
+ */
162
+ export declare function checkTasks(root: string): CheckResult;
163
+ /**
164
+ * CHECK branches (M4-P17 criterion 5): which branches are PUSHED and NOT YET
165
+ * MERGED. AGENTS.md's resume clause names this as one of the three things
166
+ * doctor reports after a reclaim, and it was the one with no implementation.
167
+ *
168
+ * PUSHED means a remote-tracking ref exists for it, which is the only
169
+ * evidence available locally that the branch is somewhere other than this
170
+ * disk. UNMERGED means the trunk does not already contain it.
171
+ *
172
+ * IT REPORTS EVERY PUSHED REF RATHER THAN FILTERING TO A NAMING PATTERN, and
173
+ * that is a decision rather than an omission. At least two branch spellings
174
+ * are in use across the repositories this kernel runs over: the pool names
175
+ * task branches `task/<id>` (src/pool.ts:54), and a delivery process running
176
+ * on this kernel names phase branches with its own harness prefix followed by
177
+ * a milestone and phase segment. A filter written for either is blind to the
178
+ * other, and a check that is blind to a branch is worse than one that names a
179
+ * branch the reader already knew about. A superset prints rows a reader can
180
+ * skip; a filter that misses a branch prints nothing at all, and nothing is
181
+ * what a healthy fleet prints too.
182
+ *
183
+ * NO BRANCH PREFIX IS SPELLED OUT HERE, and that is not a style choice.
184
+ * test/schemas.test.ts:800 asserts by name which shipped files carry the
185
+ * harness-derived branch prefix and exists to stop that set GROWING; writing
186
+ * the literal prefix into this comment added src/commands/doctor.ts to it and
187
+ * reddened that test. The spelling belongs in the delivery process that uses
188
+ * it, not in the kernel that reports over any of them.
189
+ *
190
+ * WARN, AND NO PROFILE PROMOTES IT TO FAIL. The reason is measured and is not
191
+ * a preference. Deleting a remote ref is REFUSED in the container this kernel
192
+ * is built in, and `git push --dry-run --delete` exits 0 whether deletion is
193
+ * allowed or not, so the dry run cannot tell an operator whether the remedy is
194
+ * even available (CLAUDE.md standing warning 14). A promotable branch check
195
+ * would therefore make `tiphys doctor --for full` unpassable on the kernel's
196
+ * own fleet, with no action its operator could take, and an unpassable check
197
+ * is a check that gets switched off. The count is printed; the exit code does
198
+ * not move. A test walks every profile in PROFILES and asserts that, so a
199
+ * later profile cannot promote it by accident.
200
+ *
201
+ * AND IT NEVER PRINTS PASS FOR A QUESTION IT COULD NOT ASK. If git refuses to
202
+ * list the refs, or the trunk cannot be resolved, the check says so under its
203
+ * own condition instead of reporting an empty list as a clean bill of health.
204
+ * An empty result from a query that failed is indistinguishable from an empty
205
+ * result from a query that succeeded, which is the third way this repository
206
+ * has shipped a guard that could not go red.
207
+ */
208
+ export declare function checkBranches(root: string): CheckResult;
209
+ /**
210
+ * CHECK worktrees (M4-P19): every entry in the worktree pool, and whether a
211
+ * pool record still exists beside it.
212
+ *
213
+ * THE STATE THIS REPORTS IS THE POST-RECLAIM ONE. `worktrees/` is
214
+ * gitignored (src/fleet.ts:28) and `tasks/` is tracked, so a reclaim takes
215
+ * every worktrees/<id>.pool.json with it and leaves the task records
216
+ * standing. Before this check, nothing in the kernel said so: `pool list`
217
+ * enumerated records, and a task whose record was gone was invisible to
218
+ * every reporting path.
219
+ *
220
+ * WARN AND NEVER FAIL, AND NOT PROMOTED BY ANY PROFILE. The condition is
221
+ * named (`worktree-record-missing`) so a later profile CAN promote it, and
222
+ * none does, deliberately: a fleet that has just been rehydrated from its
223
+ * remote is EXPECTED to be in exactly this state, so promoting it would
224
+ * make `doctor --for full` unpassable on the one fleet the remedy exists
225
+ * for, and an unpassable check is a check that gets switched off (hazard
226
+ * H-D). The number is printed; the exit code does not move.
227
+ *
228
+ * It reads tasks/<id>/meta.json and git, never a log tail (C-1), and
229
+ * probes no process (C-2).
230
+ */
231
+ export declare function checkWorktrees(root: string): CheckResult;
232
+ /**
233
+ * CHECK shared-lock (M4-P22 criterion 1): who holds this fleet ACROSS
234
+ * environments, in exactly one of four statuses.
235
+ *
236
+ * CHECK lock above reports the lease on THIS filesystem, which is the only
237
+ * thing it can report: src/lock.ts:63 states that domain honestly, and
238
+ * M4-P20 measured two clones of one fleet remote both holding their own
239
+ * lease at once. This check reports the second layer M4-P21 built, and the
240
+ * two are separate lines on purpose, because they answer different questions
241
+ * and an operator reading one of them is entitled to know the other was not
242
+ * merged into it.
243
+ *
244
+ * THE VERDICT IS NOT MADE HERE. `sharedLockStatus` (src/exclusion.ts) owns
245
+ * it, exactly as `expiryHasPassed` owns CHECK lock's comparison and
246
+ * `judgeBeacon` owns CHECK beacon's. This check only decides how to present
247
+ * a status, so doctor and the exclusion layer cannot return two verdicts
248
+ * about one register.
249
+ *
250
+ * THE FOURTH STATUS IS NEVER PASS, which is this check's whole reason for
251
+ * having four. An unreachable register absorbed into a green line is the
252
+ * H-C shape: the bundle says fine and the one question that mattered was
253
+ * never asked. It is a WARN under its own condition so an operator sees it
254
+ * without doctor exiting nonzero on a fleet that never opted in, and `full`
255
+ * promotes it (see the PROFILES table).
256
+ *
257
+ * IT SPAWNS NOTHING FOR A FLEET THAT HAS NOT OPTED IN. `sharedLockStatus`
258
+ * reads the fleet home's own package.json first and returns `not-declared`
259
+ * before any git call, so the cost of this check on every existing fleet is
260
+ * one file read.
261
+ */
262
+ export declare function checkSharedLock(root: string): CheckResult;
263
+ export declare function runChecks(root: string): CheckResult[];
264
+ export declare function cmdDoctor(args: string[]): number;