@indigoai-us/hq-cli 5.345.238 → 5.345.242

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 (206) hide show
  1. package/CHANGELOG.md +74 -0
  2. package/assets/scaffold/core/scripts/hq-delegate-grant.sh +170 -8
  3. package/assets/scaffold/core/scripts/hq-delegate-publish.sh +21 -1
  4. package/assets/scaffold/core/scripts/hq-delegate-repo.sh +7 -1
  5. package/assets/scaffold/core/scripts/hq-delegate-secrets.sh +95 -20
  6. package/assets/scaffold/core/scripts/hq-delegate-transfer.sh +57 -9
  7. package/assets/scaffold/core/scripts/lib/delegate-engine.sh +77 -0
  8. package/dist/command-catalog.generated.d.ts +212 -10
  9. package/dist/command-catalog.generated.js +260 -10
  10. package/dist/command-registration-plan.d.ts +6 -0
  11. package/dist/command-registration-plan.js +1 -0
  12. package/dist/commands/cloud-off-gate.d.ts +9 -8
  13. package/dist/commands/cloud-off-gate.js +41 -40
  14. package/dist/commands/cloud.d.ts +17 -2
  15. package/dist/commands/cloud.js +126 -24
  16. package/dist/commands/core-delegate-w1b.js +333 -27
  17. package/dist/commands/core-delegate.d.ts +2 -1
  18. package/dist/commands/core-delegate.js +209 -48
  19. package/dist/commands/core-handoff.js +1 -1
  20. package/dist/commands/core-job-model-auth.d.ts +95 -0
  21. package/dist/commands/core-job-model-auth.js +247 -0
  22. package/dist/commands/core-job-run-native.js +280 -12
  23. package/dist/commands/core.js +1 -0
  24. package/dist/commands/deploy-comments.js +8 -2
  25. package/dist/commands/deploy-events.d.ts +40 -0
  26. package/dist/commands/deploy-events.js +300 -0
  27. package/dist/commands/doctor.d.ts +4 -4
  28. package/dist/commands/doctor.js +2 -2
  29. package/dist/commands/feedback.js +2 -3
  30. package/dist/commands/files-browse.js +2 -0
  31. package/dist/commands/files.js +4 -0
  32. package/dist/commands/integrations-core.d.ts +11 -0
  33. package/dist/commands/integrations-core.js +15 -1
  34. package/dist/commands/keyed-sync-pull.d.ts +12 -0
  35. package/dist/commands/keyed-sync-pull.js +151 -0
  36. package/dist/commands/lanes-link.js +2 -2
  37. package/dist/commands/lanes-loop.d.ts +2 -2
  38. package/dist/commands/lanes-loop.js +5 -5
  39. package/dist/commands/lanes-questions.js +1 -1
  40. package/dist/commands/lanes-stories.js +1 -1
  41. package/dist/commands/lanes.js +80 -14
  42. package/dist/commands/library-add.d.ts +5 -2
  43. package/dist/commands/library-add.js +22 -9
  44. package/dist/commands/mcp-registration.d.ts +4 -18
  45. package/dist/commands/mcp-registration.js +9 -29
  46. package/dist/commands/mesh.d.ts +4 -0
  47. package/dist/commands/mesh.js +25 -5
  48. package/dist/commands/pack-install.d.ts +2 -3
  49. package/dist/commands/pack-install.js +6 -8
  50. package/dist/commands/rescue.d.ts +3 -2
  51. package/dist/commands/rescue.js +48 -34
  52. package/dist/commands/search.d.ts +6 -0
  53. package/dist/commands/search.js +24 -4
  54. package/dist/commands/secrets.d.ts +3 -4
  55. package/dist/commands/secrets.js +3 -20
  56. package/dist/commands/sources.js +6 -2
  57. package/dist/commands/sync-core.d.ts +8 -0
  58. package/dist/commands/sync-core.js +43 -0
  59. package/dist/hq-cloud-sync-runner/bin/sync-runner.js +1830 -1468
  60. package/dist/hq-cloud-sync-runner/package.json +1 -1
  61. package/dist/lib/bot/api.d.ts +2 -1
  62. package/dist/lib/bot/api.js +2 -15
  63. package/dist/lib/capacity/accounts.d.ts +1 -1
  64. package/dist/lib/capacity/accounts.js +1 -1
  65. package/dist/lib/capacity/collectors/claude-oauth.d.ts +0 -2
  66. package/dist/lib/capacity/collectors/claude-oauth.js +0 -5
  67. package/dist/lib/capacity/freshness.d.ts +1 -1
  68. package/dist/lib/capacity/freshness.js +1 -1
  69. package/dist/lib/capacity/route.js +1 -1
  70. package/dist/lib/core-utils/delegate-helper-paths.d.ts +26 -0
  71. package/dist/lib/core-utils/delegate-helper-paths.js +33 -0
  72. package/dist/lib/daemon/catalog.d.ts +3 -0
  73. package/dist/lib/daemon/hook-requests.d.ts +1 -1
  74. package/dist/lib/daemon/hook-requests.js +4 -2
  75. package/dist/lib/daemon/jq-provision.d.ts +63 -0
  76. package/dist/lib/daemon/jq-provision.js +155 -0
  77. package/dist/lib/daemon/lanes-reconcile-guard.d.ts +4 -3
  78. package/dist/lib/daemon/lanes-reconcile-guard.js +4 -4
  79. package/dist/lib/daemon/mesh-owner.d.ts +4 -0
  80. package/dist/lib/daemon/mesh-owner.js +20 -0
  81. package/dist/lib/daemon/ops/policy.d.ts +3 -0
  82. package/dist/lib/daemon/ops/policy.js +32 -4
  83. package/dist/lib/daemon/run.js +17 -22
  84. package/dist/lib/daemon/server.d.ts +6 -0
  85. package/dist/lib/daemon/server.js +5 -0
  86. package/dist/lib/daemon/verified-jq.d.ts +96 -0
  87. package/dist/lib/daemon/verified-jq.js +337 -0
  88. package/dist/lib/doctor/checks/jq.js +16 -0
  89. package/dist/lib/doctor/deep/executor.d.ts +7 -0
  90. package/dist/lib/doctor/deep/executor.js +1 -1
  91. package/dist/lib/doctor/deep/parity.js +1 -27
  92. package/dist/lib/doctor/deep/sandbox.d.ts +2 -2
  93. package/dist/lib/doctor/deep/sandbox.js +3 -19
  94. package/dist/lib/doctor/fix/refresh-sync-handoff.js +52 -21
  95. package/dist/lib/doctor/fixtures/discover.d.ts +2 -0
  96. package/dist/lib/doctor/fixtures/discover.js +1 -1
  97. package/dist/lib/doctor/json-output.d.ts +1 -1
  98. package/dist/lib/doctor/registry.d.ts +6 -7
  99. package/dist/lib/doctor/registry.js +6 -7
  100. package/dist/lib/doctor/report.d.ts +9 -10
  101. package/dist/lib/doctor/report.js +4 -4
  102. package/dist/lib/environment/work-requirements.d.ts +1 -1
  103. package/dist/lib/environment/work-requirements.js +1 -1
  104. package/dist/lib/flag-registry-worker-source.generated.d.ts +1 -1
  105. package/dist/lib/flag-registry-worker-source.generated.js +1 -1
  106. package/dist/lib/hook-engine/coverage.js +11 -3
  107. package/dist/lib/hook-engine/git-stop-config.json +510 -510
  108. package/dist/lib/hook-engine/native-precompact-compatibility.json +443 -443
  109. package/dist/lib/hook-engine/native-stop-compatibility.json +359 -359
  110. package/dist/lib/hot-channels/adapters/meetings.d.ts +1 -16
  111. package/dist/lib/hot-channels/adapters/meetings.js +3 -28
  112. package/dist/lib/hot-channels/adapters/slack.d.ts +3 -1
  113. package/dist/lib/hot-channels/adapters/slack.js +4 -1
  114. package/dist/lib/hot-channels/contract.d.ts +14 -0
  115. package/dist/lib/hot-channels/fleet-complete.d.ts +18 -2
  116. package/dist/lib/hot-channels/fleet-complete.js +29 -4
  117. package/dist/lib/hot-channels/meeting-source-ref.d.ts +17 -0
  118. package/dist/lib/hot-channels/meeting-source-ref.js +32 -0
  119. package/dist/lib/hot-channels/prompts/signals-pass.md +6 -1
  120. package/dist/lib/hot-channels/run.d.ts +10 -0
  121. package/dist/lib/hot-channels/run.js +34 -0
  122. package/dist/lib/hot-channels/signals-pass.d.ts +27 -0
  123. package/dist/lib/hot-channels/signals-pass.js +57 -2
  124. package/dist/lib/hot-channels/signals-runtime.js +3 -2
  125. package/dist/lib/jq/install.d.ts +27 -0
  126. package/dist/lib/jq/install.js +156 -0
  127. package/dist/lib/lanes/accounts.js +2 -2
  128. package/dist/lib/lanes/claude-balance.d.ts +6 -0
  129. package/dist/lib/lanes/claude-balance.js +124 -0
  130. package/dist/lib/lanes/grants.js +15 -2
  131. package/dist/lib/lanes/hq-root.d.ts +1 -1
  132. package/dist/lib/lanes/hq-root.js +1 -1
  133. package/dist/lib/lanes/links.d.ts +1 -1
  134. package/dist/lib/lanes/liveness.d.ts +3 -0
  135. package/dist/lib/lanes/liveness.js +61 -7
  136. package/dist/lib/lanes/models.d.ts +1 -1
  137. package/dist/lib/lanes/models.js +1 -1
  138. package/dist/lib/lanes/outpost-dispatch.d.ts +1 -1
  139. package/dist/lib/lanes/outpost-dispatch.js +13 -13
  140. package/dist/lib/lanes/outpost-pruner-install.js +1 -1
  141. package/dist/lib/lanes/questions.d.ts +1 -1
  142. package/dist/lib/lanes/questions.js +2 -2
  143. package/dist/lib/lanes/spawn.js +4 -6
  144. package/dist/lib/lanes/store.d.ts +13 -2
  145. package/dist/lib/lanes/store.js +13 -5
  146. package/dist/lib/lanes/types.d.ts +7 -7
  147. package/dist/lib/lanes/types.js +1 -1
  148. package/dist/lib/lanes/watcher-main.js +1 -1
  149. package/dist/lib/lanes/watcher.d.ts +1 -1
  150. package/dist/lib/lanes/watcher.js +1 -1
  151. package/dist/lib/mesh/live/daemon/doctor.js +7 -1
  152. package/dist/lib/mesh/live/daemon/install.d.ts +4 -0
  153. package/dist/lib/mesh/live/daemon/install.js +10 -0
  154. package/dist/lib/mesh/live/daemon/run.js +17 -0
  155. package/dist/lib/mesh/live/emit-retry.d.ts +20 -2
  156. package/dist/lib/mesh/live/emit-retry.js +57 -4
  157. package/dist/lib/mesh/live/emit.js +25 -4
  158. package/dist/lib/mesh/live/flush.d.ts +2 -0
  159. package/dist/lib/mesh/live/flush.js +21 -8
  160. package/dist/lib/mesh/live/spool.d.ts +9 -1
  161. package/dist/lib/mesh/live/spool.js +41 -29
  162. package/dist/lib/onboarding/cli/onboard.js +5 -0
  163. package/dist/lib/signals/sanitize.d.ts +19 -0
  164. package/dist/lib/signals/sanitize.js +103 -7
  165. package/dist/lib/signals/steps/upload.d.ts +40 -1
  166. package/dist/lib/signals/steps/upload.js +122 -6
  167. package/dist/lib/sync-core/access-refresh.d.ts +29 -0
  168. package/dist/lib/sync-core/access-refresh.js +97 -0
  169. package/dist/lib/sync-core/company-adoption.d.ts +33 -0
  170. package/dist/lib/sync-core/company-adoption.js +223 -0
  171. package/dist/lib/sync-core/engine-home.d.ts +1 -0
  172. package/dist/lib/sync-core/engine-owned.d.ts +13 -0
  173. package/dist/lib/sync-core/engine-owned.js +38 -0
  174. package/dist/lib/sync-core/hand-back.d.ts +17 -0
  175. package/dist/lib/sync-core/hand-back.js +23 -0
  176. package/dist/lib/sync-core/post-apply-reindex.d.ts +33 -0
  177. package/dist/lib/sync-core/post-apply-reindex.js +149 -0
  178. package/dist/lib/sync-core/reconcile.d.ts +10 -0
  179. package/dist/lib/sync-core/reconcile.js +117 -12
  180. package/dist/lib/sync-core/rollout-state.d.ts +11 -1
  181. package/dist/lib/sync-core/rollout-state.js +40 -4
  182. package/dist/lib/vault-sync-switches.d.ts +14 -0
  183. package/dist/lib/vault-sync-switches.js +22 -0
  184. package/dist/lib/windows/jq.d.ts +4 -0
  185. package/dist/lib/windows/jq.js +10 -39
  186. package/dist/lib/workers-registry/index.d.ts +1 -1
  187. package/dist/lib/workers-registry/index.js +8 -12
  188. package/dist/utils/callback-port-busy.d.ts +2 -2
  189. package/dist/utils/callback-port-busy.js +2 -2
  190. package/dist/utils/cli-network-lifecycle.js +1 -0
  191. package/dist/utils/client-health-contract.d.ts +2 -0
  192. package/dist/utils/client-health-contract.js +1 -1
  193. package/dist/utils/client-health.js +1 -9
  194. package/dist/utils/cognito-config.js +5 -0
  195. package/dist/utils/cognito-session.d.ts +4 -6
  196. package/dist/utils/cognito-session.js +4 -24
  197. package/dist/utils/github-tag-fallback.d.ts +16 -0
  198. package/dist/utils/github-tag-fallback.js +126 -0
  199. package/dist/utils/incomplete-install-error.js +1 -11
  200. package/dist/utils/install-tree-torn.d.ts +11 -0
  201. package/dist/utils/install-tree-torn.js +1 -1
  202. package/dist/utils/resident-package-preload.js +2 -1
  203. package/dist/utils/version-report.d.ts +2 -1
  204. package/dist/utils/version-report.js +40 -27
  205. package/docs/anywhere-runtime.md +8 -0
  206. package/package.json +9 -9
@@ -61,7 +61,7 @@ export interface SeedResult {
61
61
  }
62
62
  /** Options for {@link seedSandbox}. */
63
63
  export interface SeedOptions {
64
- /** Tree entries copied from the live tree. Default: {@link SANDBOX_SEED_RELPATHS}. */
64
+ /** Tree entries copied from the live tree. Default: {@link SANDBOX_COPY_RELPATHS}. */
65
65
  seedRelpaths?: readonly string[];
66
66
  /** Which preconditions to seed. Default: {@link KNOWN_PRECONDITIONS}. */
67
67
  preconditions?: readonly Precondition[];
@@ -144,7 +144,7 @@ export declare function discoverSideEffectFixtures(hqRoot: string): SideEffectDi
144
144
  export interface SideEffectTestOptions {
145
145
  /** Per-case time bound. Default: {@link DEFAULT_PER_CASE_TIMEOUT_MS}. */
146
146
  perCaseTimeoutMs?: number;
147
- /** Tree entries copied into each sandbox. Default: {@link SANDBOX_SEED_RELPATHS}. */
147
+ /** Tree entries copied into each sandbox. Default: {@link SANDBOX_COPY_RELPATHS}. */
148
148
  seedRelpaths?: readonly string[];
149
149
  /** Preconditions the sandbox seeds. Default: {@link KNOWN_PRECONDITIONS}. */
150
150
  preconditions?: readonly Precondition[];
@@ -41,8 +41,9 @@ import * as path from "node:path";
41
41
  import * as yaml from "js-yaml";
42
42
  import { isRecord } from "../shared.js";
43
43
  import { classifyCaseStatus, looksLikeFixture, } from "../fixtures/schema.js";
44
- import { HOOK_TESTS_RELDIR, registeredHookIds } from "../fixtures/discover.js";
44
+ import { HOOK_TESTS_RELDIR, NON_FIXTURE_FILES, registeredHookIds, } from "../fixtures/discover.js";
45
45
  import { isSideEffectingHookId } from "./classify.js";
46
+ import { SANDBOX_COPY_RELPATHS } from "./executor.js";
46
47
  import { captureEffectBaseline, describeEffect, defaultGitProbe, evaluateEffects, parseEffectExpectations, } from "./effects.js";
47
48
  /** Default per-case time bound. No latency target, but no case may hang. */
48
49
  export const DEFAULT_PER_CASE_TIMEOUT_MS = 15_000;
@@ -52,25 +53,8 @@ const KNOWN_PRECONDITIONS = [
52
53
  "session-metadata",
53
54
  "company-scaffold",
54
55
  ];
55
- /**
56
- * Tree entries copied from the live tree into every sandbox — the same curated
57
- * set US-008 uses: the hook scripts and gate, the settings a hook may read, the
58
- * Codex/Grok mirrors, and `core/` (helpers hooks source). Missing entries are
59
- * skipped so a partial tree still sandboxes cleanly.
60
- */
61
- const SANDBOX_SEED_RELPATHS = [
62
- ".claude/hooks",
63
- ".claude/settings.json",
64
- ".claude/settings.local.json",
65
- ".codex/hooks",
66
- ".codex/hooks.json",
67
- ".grok",
68
- "core",
69
- ];
70
56
  /** A slug for the throwaway company the `company-scaffold` precondition seeds. */
71
57
  const SANDBOX_COMPANY_SLUG = "sandbox-co";
72
- /** `*.yaml` files under core/hook-tests that are configuration, not fixtures. */
73
- const NON_FIXTURE_FILES = new Set(["allowed-divergence.yaml"]);
74
58
  // --- sandbox lifecycle --------------------------------------------------------
75
59
  const trackedSandboxes = new Set();
76
60
  let sandboxExitHandlerRegistered = false;
@@ -117,7 +101,7 @@ function destroySandbox(root) {
117
101
  */
118
102
  export function seedSandbox(hqRoot, opts = {}) {
119
103
  ensureSandboxExitHandler();
120
- const relpaths = opts.seedRelpaths ?? SANDBOX_SEED_RELPATHS;
104
+ const relpaths = opts.seedRelpaths ?? SANDBOX_COPY_RELPATHS;
121
105
  const intended = new Set(opts.preconditions ?? KNOWN_PRECONDITIONS);
122
106
  const prefix = opts.prefix ?? "hq-doctor-sandbox-";
123
107
  const root = fs.realpathSync(fs.mkdtempSync(path.join(os.tmpdir(), prefix)));
@@ -450,36 +450,67 @@ export function acquireRefreshSpawnLock(hqRoot, nowMs, identity) {
450
450
  const holder = parseSpawnLock(text);
451
451
  if (!holder || !ownerProvenGone(holder, identity))
452
452
  return null;
453
- // Take it over atomically: only the process whose rename succeeds removes
454
- // it. If the renamed file is not the holder we judged (a new holder raced
455
- // in), put it back and give up.
456
- const aside = `${file}.stale-${crypto.randomBytes(6).toString("hex")}`;
453
+ // Remove the dead holder's lock, then retry the O_EXCL create above.
454
+ if (!removeLockIfUnchanged(file, text, token, identity))
455
+ return null;
456
+ }
457
+ return null;
458
+ }
459
+ /**
460
+ * Remove `file` only while it still holds exactly `expected` (a holder judged
461
+ * gone), so that at most one process ever removes a given holder.
462
+ *
463
+ * The remover first creates `<file>.takeover-<hash of expected>` with O_EXCL.
464
+ * Only the process that creates it may remove `file`, and only after reading
465
+ * `expected` there again. A holder's text carries a random token and is never
466
+ * written twice, so once it is removed no later remover can match it: a new
467
+ * holder's lock is never removed by a taker that judged an older one.
468
+ *
469
+ * Returns true when this call removed `expected`. If a remover crashed while
470
+ * holding the claim file, the claim is cleared the same way, one level down,
471
+ * once its own owner is proven gone; this call then returns false and the
472
+ * next acquire can take the lock over.
473
+ */
474
+ function removeLockIfUnchanged(file, expected, token, identity, depth = 0) {
475
+ const digest = crypto.createHash("sha256").update(expected).digest("hex").slice(0, 16);
476
+ const claim = `${file}.takeover-${digest}`;
477
+ try {
478
+ fs.writeFileSync(claim, token, { flag: "wx", mode: 0o600 });
479
+ }
480
+ catch (error) {
481
+ if (error.code !== "EEXIST" || depth >= 2)
482
+ return false;
483
+ // Another process is removing this same holder now, or one crashed while
484
+ // doing so.
485
+ let claimText;
457
486
  try {
458
- fs.renameSync(file, aside);
487
+ claimText = fs.readFileSync(claim, "utf8");
459
488
  }
460
489
  catch {
461
- return null;
490
+ return false;
462
491
  }
463
- let moved = "";
492
+ const claimOwner = parseSpawnLock(claimText);
493
+ if (claimOwner && ownerProvenGone(claimOwner, identity)) {
494
+ removeLockIfUnchanged(claim, claimText, token, identity, depth + 1);
495
+ }
496
+ return false;
497
+ }
498
+ try {
499
+ let current;
464
500
  try {
465
- moved = fs.readFileSync(aside, "utf8");
501
+ current = fs.readFileSync(file, "utf8");
466
502
  }
467
503
  catch {
468
- moved = "";
504
+ current = null;
469
505
  }
470
- if (moved !== text) {
471
- try {
472
- fs.linkSync(aside, file);
473
- }
474
- catch {
475
- // someone already holds it again
476
- }
477
- fs.rmSync(aside, { force: true });
478
- return null;
479
- }
480
- fs.rmSync(aside, { force: true });
506
+ if (current !== expected)
507
+ return false;
508
+ fs.rmSync(file, { force: true });
509
+ return true;
510
+ }
511
+ finally {
512
+ fs.rmSync(claim, { force: true });
481
513
  }
482
- return null;
483
514
  }
484
515
  /** A spawn lock still held after this long is reported by `hq doctor`. */
485
516
  export const REFRESH_SPAWN_LOCK_WARN_MS = 10 * 60 * 1000;
@@ -30,6 +30,8 @@ import { type ParsedFixture } from "./schema.js";
30
30
  export declare const HOOK_TESTS_RELDIR: string;
31
31
  /** checkId of the single coverage-ratio result the report surfaces in its summary. */
32
32
  export declare const FIXTURE_COVERAGE_CHECK_ID = "hooks.fixtures.coverage";
33
+ /** A `*.yaml` file in `core/hook-tests/` that is not a fixture and must be skipped. */
34
+ export declare const NON_FIXTURE_FILES: Set<string>;
33
35
  /**
34
36
  * The hook ids the wiring tier found registered, deduplicated and sorted. A hook
35
37
  * id is the identity a fixture is keyed by: the id passed to `hook-gate.sh` when
@@ -36,7 +36,7 @@ const FIXTURES_FAMILY_ID = "fixtures";
36
36
  /** checkId of the single coverage-ratio result the report surfaces in its summary. */
37
37
  export const FIXTURE_COVERAGE_CHECK_ID = "hooks.fixtures.coverage";
38
38
  /** A `*.yaml` file in `core/hook-tests/` that is not a fixture and must be skipped. */
39
- const NON_FIXTURE_FILES = new Set(["allowed-divergence.yaml"]);
39
+ export const NON_FIXTURE_FILES = new Set(["allowed-divergence.yaml"]);
40
40
  // --- registered-hook enumeration ----------------------------------------------
41
41
  /**
42
42
  * The hook ids the wiring tier found registered, deduplicated and sorted. A hook
@@ -71,7 +71,7 @@ export interface DoctorJsonResult {
71
71
  export interface DoctorJsonDocument {
72
72
  /** Output-contract version. See {@link DOCTOR_JSON_SCHEMA_VERSION}. */
73
73
  schemaVersion: number;
74
- /** The detected agent platform and its evidence (placeholder until US-003). */
74
+ /** The detected agent platform and its evidence. */
75
75
  platform: DoctorPlatform;
76
76
  /** The resolved HQ tree root. */
77
77
  hqRoot: string;
@@ -1,6 +1,5 @@
1
1
  /**
2
- * The doctor engine — an ordered set of check families — and the first family
3
- * (hooks).
2
+ * The doctor engine — an ordered set of check families — and the hooks family.
4
3
  *
5
4
  * The engine is deliberately ignorant of any specific family: `register`
6
5
  * accepts any object implementing {@link CheckFamily}, and `run` iterates them
@@ -8,10 +7,10 @@
8
7
  * added by registering it — never by editing this class — which is exactly the
9
8
  * property US-002 requires and later stories rely on.
10
9
  *
11
- * The hooks family here is intentionally a skeleton: it establishes the family
12
- * so the wiring/parity/runtime checks (US-004+) have somewhere to live, and
13
- * reports only the presence and validity of `.claude/settings.json`. Those
14
- * later stories add per-item results to this family without touching the engine.
10
+ * The hooks family checks `.claude/settings.json` (presence, validity and
11
+ * required command-hook events), Codex and Grok hook wiring, and the runtime
12
+ * probe. The default registry below also registers the other families (hook
13
+ * engine, jq, sync health, integrations, bots, search index and more).
15
14
  */
16
15
  import type { CheckContext, CheckFamily, FamilyRun } from "./types.js";
17
16
  /**
@@ -44,7 +43,7 @@ export declare class DoctorRegistry {
44
43
  /** Run every family in order and collect grouped results. */
45
44
  run(context: CheckContext): Promise<FamilyRun[]>;
46
45
  }
47
- /** The id of the hooks family — the first, and for now only, check family. */
46
+ /** The id of the hooks family, the first family the default registry runs. */
48
47
  export declare const HOOKS_FAMILY_ID = "hooks";
49
48
  /**
50
49
  * The hooks check family. US-002 shipped the skeleton (Claude settings presence
@@ -1,6 +1,5 @@
1
1
  /**
2
- * The doctor engine — an ordered set of check families — and the first family
3
- * (hooks).
2
+ * The doctor engine — an ordered set of check families — and the hooks family.
4
3
  *
5
4
  * The engine is deliberately ignorant of any specific family: `register`
6
5
  * accepts any object implementing {@link CheckFamily}, and `run` iterates them
@@ -8,10 +7,10 @@
8
7
  * added by registering it — never by editing this class — which is exactly the
9
8
  * property US-002 requires and later stories rely on.
10
9
  *
11
- * The hooks family here is intentionally a skeleton: it establishes the family
12
- * so the wiring/parity/runtime checks (US-004+) have somewhere to live, and
13
- * reports only the presence and validity of `.claude/settings.json`. Those
14
- * later stories add per-item results to this family without touching the engine.
10
+ * The hooks family checks `.claude/settings.json` (presence, validity and
11
+ * required command-hook events), Codex and Grok hook wiring, and the runtime
12
+ * probe. The default registry below also registers the other families (hook
13
+ * engine, jq, sync health, integrations, bots, search index and more).
15
14
  */
16
15
  import * as fs from "node:fs";
17
16
  import { hookEngineFamily } from './checks/hook-engine.js';
@@ -88,7 +87,7 @@ export class DoctorRegistry {
88
87
  return runs;
89
88
  }
90
89
  }
91
- /** The id of the hooks family — the first, and for now only, check family. */
90
+ /** The id of the hooks family, the first family the default registry runs. */
92
91
  export const HOOKS_FAMILY_ID = "hooks";
93
92
  /**
94
93
  * The hooks check family. US-002 shipped the skeleton (Claude settings presence
@@ -22,25 +22,24 @@
22
22
  * output carries no ANSI escape sequences at all, so a run piped to a file
23
23
  * or consumed by CI has the same information content as an interactive one.
24
24
  *
25
- * The platform field is a placeholder in this story (US-015). Host platform
26
- * detection is US-003; until it lands, {@link UNKNOWN_PLATFORM} is emitted and
27
- * US-003 injects the real value through the same `platform` option.
25
+ * The platform field comes from host platform detection (`detectPlatform` in
26
+ * ./platform.ts), which the command layer passes in through the `platform`
27
+ * option. {@link UNKNOWN_PLATFORM} is the fallback when no platform is given.
28
28
  */
29
29
  import { type CheckResult, type DoctorStatus, type FamilyRun } from "./types.js";
30
30
  /**
31
- * The detected agent platform and the evidence for the verdict. A structural
32
- * placeholder in US-015: host platform detection (US-003) produces the real
33
- * value and passes it through unchanged. `evidence` is intentionally `unknown`
34
- * so US-003 can attach whatever signal shape it settles on without a breaking
35
- * change here.
31
+ * The detected agent platform and the evidence for the verdict. Host platform
32
+ * detection (`detectPlatform` in ./platform.ts) produces it and the report
33
+ * passes it through unchanged. `evidence` is typed `unknown` so the detector
34
+ * owns its signal shape.
36
35
  */
37
36
  export interface DoctorPlatform {
38
37
  /** Platform id, e.g. `claude-code-cli`, `codex`, `grok`, or `unknown`. */
39
38
  id: string;
40
- /** Evidence that led to the verdict. Shape owned by US-003. */
39
+ /** Evidence that led to the verdict. Shape owned by the platform detector. */
41
40
  evidence?: unknown;
42
41
  }
43
- /** The placeholder platform emitted until host detection (US-003) lands. */
42
+ /** The fallback platform used when the caller passes no detected platform. */
44
43
  export declare const UNKNOWN_PLATFORM: DoctorPlatform;
45
44
  /** Per-status tallies across every result of a run. */
46
45
  export type StatusCounts = Record<DoctorStatus, number>;
@@ -22,14 +22,14 @@
22
22
  * output carries no ANSI escape sequences at all, so a run piped to a file
23
23
  * or consumed by CI has the same information content as an interactive one.
24
24
  *
25
- * The platform field is a placeholder in this story (US-015). Host platform
26
- * detection is US-003; until it lands, {@link UNKNOWN_PLATFORM} is emitted and
27
- * US-003 injects the real value through the same `platform` option.
25
+ * The platform field comes from host platform detection (`detectPlatform` in
26
+ * ./platform.ts), which the command layer passes in through the `platform`
27
+ * option. {@link UNKNOWN_PLATFORM} is the fallback when no platform is given.
28
28
  */
29
29
  import { Chalk } from "chalk";
30
30
  import { DOCTOR_STATUSES, } from "./types.js";
31
31
  import { FIXTURE_COVERAGE_CHECK_ID } from "./fixtures/discover.js";
32
- /** The placeholder platform emitted until host detection (US-003) lands. */
32
+ /** The fallback platform used when the caller passes no detected platform. */
33
33
  export const UNKNOWN_PLATFORM = { id: "unknown" };
34
34
  /**
35
35
  * The statuses that fail the command. This is the whole exit-code contract:
@@ -161,7 +161,7 @@ export declare const DERIVED_WORK_SIZE: {
161
161
  */
162
162
  export declare function deriveWorkRequirements(input: DeriveWorkRequirementsInput): WorkRequirements;
163
163
  /**
164
- * A derived document after the work's company was repaired (hq lanes
164
+ * A derived document after the work's company was repaired (hq runners
165
165
  * repair-company). The company and the company line of derived_from are
166
166
  * replaced; a slug outside the schema pattern leaves the document as it is.
167
167
  */
@@ -371,7 +371,7 @@ export function deriveWorkRequirements(input) {
371
371
  return document;
372
372
  }
373
373
  /**
374
- * A derived document after the work's company was repaired (hq lanes
374
+ * A derived document after the work's company was repaired (hq runners
375
375
  * repair-company). The company and the company line of derived_from are
376
376
  * replaced; a slug outside the schema pattern leaves the document as it is.
377
377
  */