@indigoai-us/hq-cli 5.345.250 → 5.345.252

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 (186) hide show
  1. package/CHANGELOG.md +214 -0
  2. package/assets/scaffold/core/scripts/hq-session.sh +9 -0
  3. package/contracts/host-canary-release.json +9 -3
  4. package/dist/command-catalog.generated.d.ts +316 -2
  5. package/dist/command-catalog.generated.js +389 -2
  6. package/dist/commands/bot.js +12 -3
  7. package/dist/commands/core-bucket-c-work-mesh-offer-native.js +1 -1
  8. package/dist/commands/core-hq-session-binding.d.ts +140 -0
  9. package/dist/commands/core-hq-session-binding.js +363 -0
  10. package/dist/commands/core-hq-session-native.d.ts +23 -0
  11. package/dist/commands/core-hq-session-native.js +59 -9
  12. package/dist/commands/core-stop-autosave.js +1 -1
  13. package/dist/commands/core.js +10 -0
  14. package/dist/commands/doctor.d.ts +5 -1
  15. package/dist/commands/doctor.js +42 -5
  16. package/dist/commands/files.js +1 -1
  17. package/dist/commands/install-global.js +4 -2
  18. package/dist/commands/lanes.d.ts +2 -0
  19. package/dist/commands/lanes.js +9 -4
  20. package/dist/commands/logout.js +4 -0
  21. package/dist/commands/ontology-graph.d.ts +11 -2
  22. package/dist/commands/ontology-graph.js +130 -4
  23. package/dist/commands/report.js +35 -2
  24. package/dist/commands/sources.js +26 -8
  25. package/dist/commands/storage-gate.js +1 -1
  26. package/dist/commands/vault-retention-flag.js +2 -1
  27. package/dist/commands/whoami.js +1 -1
  28. package/dist/hq-cloud-sync-runner/bin/sync-runner.js +238 -221
  29. package/dist/hq-cloud-sync-runner/package.json +1 -1
  30. package/dist/index.js +3 -1
  31. package/dist/lib/agent-kit/inbox-poll-backoff-flag.js +1 -1
  32. package/dist/lib/agent-kit/mcp/tools.js +48 -0
  33. package/dist/lib/bot/fleet-bots-update-pass.js +1 -1
  34. package/dist/lib/bot/fleet-cron.d.ts +37 -0
  35. package/dist/lib/bot/fleet-cron.js +59 -12
  36. package/dist/lib/bot/fleet-local.d.ts +18 -0
  37. package/dist/lib/bot/fleet-local.js +51 -5
  38. package/dist/lib/bot/inbox-poll-backoff-flag.js +1 -1
  39. package/dist/lib/bot/signals-engine-flag.d.ts +1 -1
  40. package/dist/lib/bot/signals-engine-flag.js +1 -1
  41. package/dist/lib/cli-invite-nudge.js +1 -1
  42. package/dist/lib/client-version.d.ts +2 -0
  43. package/dist/lib/client-version.js +24 -0
  44. package/dist/lib/company-flag-gate.d.ts +30 -0
  45. package/dist/lib/company-flag-gate.js +104 -0
  46. package/dist/lib/core-utils/hook-timeout-debug-context-flag.js +1 -1
  47. package/dist/lib/daemon/flag.js +2 -1
  48. package/dist/lib/daemon/legacy-journal-gate.js +3 -1
  49. package/dist/lib/daemon/shared-flag-reads.js +1 -1
  50. package/dist/lib/doctor/checks/host-core.js +22 -4
  51. package/dist/lib/doctor/checks/jq.d.ts +27 -6
  52. package/dist/lib/doctor/checks/jq.js +46 -8
  53. package/dist/lib/doctor/client-health-reason-codes-flag.js +1 -1
  54. package/dist/lib/doctor/fix/refresh-sync-handoff.d.ts +1 -1
  55. package/dist/lib/doctor/fix/refresh-sync-handoff.js +1 -1
  56. package/dist/lib/flag-client-gate-headers.d.ts +38 -0
  57. package/dist/lib/flag-client-gate-headers.js +62 -0
  58. package/dist/lib/flag-client-headers.d.ts +15 -0
  59. package/dist/lib/flag-client-headers.js +25 -0
  60. package/dist/lib/flag-registry-worker-source.generated.d.ts +1 -1
  61. package/dist/lib/flag-registry-worker-source.generated.js +1 -1
  62. package/dist/lib/flag-registry-worker.js +35 -0
  63. package/dist/lib/flag-registry.d.ts +1 -20
  64. package/dist/lib/flag-registry.js +5 -81
  65. package/dist/lib/hook-engine/adapter-core-pin.d.ts +29 -0
  66. package/dist/lib/hook-engine/adapter-core-pin.js +29 -0
  67. package/dist/lib/hook-engine/coverage.d.ts +68 -8
  68. package/dist/lib/hook-engine/coverage.js +167 -25
  69. package/dist/lib/hook-engine/native-stop-compatibility.json +9 -4
  70. package/dist/lib/hook-engine/reconcile.js +3 -2
  71. package/dist/lib/hot-channels/graph-context.d.ts +26 -1
  72. package/dist/lib/hot-channels/graph-context.js +76 -9
  73. package/dist/lib/hot-channels/prompts/signals-pass.md +20 -0
  74. package/dist/lib/hot-channels/run.d.ts +1 -0
  75. package/dist/lib/hot-channels/signal-changes.d.ts +228 -0
  76. package/dist/lib/hot-channels/signal-changes.js +683 -0
  77. package/dist/lib/hot-channels/signals-pass.d.ts +24 -0
  78. package/dist/lib/hot-channels/signals-pass.js +240 -15
  79. package/dist/lib/lanes/outpost-worktree-pruner-flag.d.ts +1 -1
  80. package/dist/lib/lanes/outpost-worktree-pruner-flag.js +1 -1
  81. package/dist/lib/lanes/registry-flag.js +2 -1
  82. package/dist/lib/lanes/spawn.js +11 -1
  83. package/dist/lib/mesh/live/binding-intent.d.ts +61 -0
  84. package/dist/lib/mesh/live/binding-intent.js +201 -0
  85. package/dist/lib/mesh/live/binding-receipt.d.ts +157 -0
  86. package/dist/lib/mesh/live/binding-receipt.js +365 -0
  87. package/dist/lib/mesh/live/company-flag-refresh.js +1 -1
  88. package/dist/lib/mesh/live/daemon/doctor-telemetry.d.ts +39 -0
  89. package/dist/lib/mesh/live/daemon/doctor-telemetry.js +58 -0
  90. package/dist/lib/mesh/live/daemon/install.js +2 -1
  91. package/dist/lib/mesh/live/daemon/presence.js +9 -0
  92. package/dist/lib/mesh/live/daemon/run.d.ts +3 -0
  93. package/dist/lib/mesh/live/daemon/run.js +33 -1
  94. package/dist/lib/ontology-graph/lineage/index.d.ts +401 -0
  95. package/dist/lib/ontology-graph/lineage/index.js +1027 -0
  96. package/dist/lib/ontology-graph/model/files.d.ts +4 -0
  97. package/dist/lib/ontology-graph/model/files.js +23 -0
  98. package/dist/lib/ontology-graph/model/index.d.ts +65 -1
  99. package/dist/lib/ontology-graph/model/index.js +154 -18
  100. package/dist/lib/ontology-graph/model/pass-tasks.d.ts +84 -1
  101. package/dist/lib/ontology-graph/model/pass-tasks.js +173 -4
  102. package/dist/lib/ontology-graph/model/pass.d.ts +11 -0
  103. package/dist/lib/ontology-graph/model/pass.js +17 -10
  104. package/dist/lib/ontology-graph/model/pending-items.d.ts +39 -0
  105. package/dist/lib/ontology-graph/model/pending-items.js +136 -0
  106. package/dist/lib/ontology-graph/model/step.d.ts +47 -2
  107. package/dist/lib/ontology-graph/model/step.js +202 -36
  108. package/dist/lib/ontology-graph/model/tasks.d.ts +28 -4
  109. package/dist/lib/ontology-graph/model/tasks.js +48 -15
  110. package/dist/lib/ontology-graph/pages/render.d.ts +1 -1
  111. package/dist/lib/ontology-graph/pages/render.js +4 -3
  112. package/dist/lib/ontology-graph/read/brief.d.ts +13 -3
  113. package/dist/lib/ontology-graph/read/brief.js +349 -67
  114. package/dist/lib/ontology-graph/read/index.d.ts +5 -1
  115. package/dist/lib/ontology-graph/read/index.js +174 -30
  116. package/dist/lib/ontology-graph/read/lineage.d.ts +101 -0
  117. package/dist/lib/ontology-graph/read/lineage.js +262 -0
  118. package/dist/lib/ontology-graph/read/reader-setting.d.ts +2 -0
  119. package/dist/lib/ontology-graph/read/reader-setting.js +4 -1
  120. package/dist/lib/ontology-graph/remodel/index.d.ts +174 -0
  121. package/dist/lib/ontology-graph/remodel/index.js +450 -0
  122. package/dist/lib/ontology-graph/replay/buffered-store.js +17 -0
  123. package/dist/lib/ontology-graph/replay/engine.d.ts +32 -1
  124. package/dist/lib/ontology-graph/replay/engine.js +213 -8
  125. package/dist/lib/ontology-graph/replay/extractors.d.ts +26 -0
  126. package/dist/lib/ontology-graph/replay/extractors.js +25 -1
  127. package/dist/lib/ontology-graph/replay/index.d.ts +2 -0
  128. package/dist/lib/ontology-graph/replay/index.js +120 -8
  129. package/dist/lib/ontology-graph/replay/signal-changes.d.ts +118 -0
  130. package/dist/lib/ontology-graph/replay/signal-changes.js +687 -0
  131. package/dist/lib/ontology-graph/schema/authority.d.ts +14 -5
  132. package/dist/lib/ontology-graph/schema/authority.js +13 -3
  133. package/dist/lib/ontology-graph/schema/decision-status.d.ts +18 -0
  134. package/dist/lib/ontology-graph/schema/decision-status.js +20 -0
  135. package/dist/lib/ontology-graph/schema/index.d.ts +2 -1
  136. package/dist/lib/ontology-graph/schema/index.js +2 -1
  137. package/dist/lib/ontology-graph/setup/index.d.ts +88 -0
  138. package/dist/lib/ontology-graph/setup/index.js +499 -0
  139. package/dist/lib/ontology-graph/types.d.ts +21 -0
  140. package/dist/lib/ontology-graph/types.js +5 -0
  141. package/dist/lib/search-index/index.d.ts +33 -1
  142. package/dist/lib/search-index/index.js +180 -25
  143. package/dist/lib/search-index/qmd-exit-diagnostics.d.ts +7 -0
  144. package/dist/lib/search-index/qmd-exit-diagnostics.js +25 -1
  145. package/dist/lib/signals/adapters-catalog.js +1 -1
  146. package/dist/lib/signals/failure-alert.js +4 -5
  147. package/dist/lib/signals/steps/adapters.js +3 -0
  148. package/dist/lib/sync-core/engine-holds.d.ts +1 -0
  149. package/dist/lib/sync-core/engine-holds.js +26 -0
  150. package/dist/lib/sync-core/engine-home.d.ts +3 -0
  151. package/dist/lib/sync-core/engine-home.js +41 -1
  152. package/dist/lib/sync-core/flag.js +2 -1
  153. package/dist/lib/sync-core/legacy-journal-export-child.js +5 -3
  154. package/dist/lib/sync-core/legacy-journal-export.d.ts +23 -4
  155. package/dist/lib/sync-core/legacy-journal-export.js +120 -55
  156. package/dist/lib/sync-core/reconcile.d.ts +2 -1
  157. package/dist/lib/sync-core/reconcile.js +30 -5
  158. package/dist/lib/sync-invalid-entity-warning.js +2 -1
  159. package/dist/lib/windows/install-followup.d.ts +41 -0
  160. package/dist/lib/windows/install-followup.js +87 -0
  161. package/dist/lib/windows/jq.d.ts +59 -0
  162. package/dist/lib/windows/jq.js +154 -3
  163. package/dist/lib/windows/user-path.d.ts +5 -0
  164. package/dist/lib/windows/user-path.js +1 -1
  165. package/dist/lib/work-context/auto-bind.d.ts +12 -0
  166. package/dist/lib/work-context/auto-bind.js +49 -3
  167. package/dist/lib/work-context/organize.d.ts +4 -2
  168. package/dist/lib/work-context/organize.js +18 -8
  169. package/dist/lib/work-context/reconcile.js +16 -1
  170. package/dist/main.js +12 -1
  171. package/dist/utils/client-health-contract.d.ts +30 -0
  172. package/dist/utils/client-health-contract.js +111 -0
  173. package/dist/utils/client-health.d.ts +5 -2
  174. package/dist/utils/client-health.js +74 -5
  175. package/dist/utils/exclusive-lock.d.ts +5 -1
  176. package/dist/utils/exclusive-lock.js +9 -2
  177. package/dist/utils/host-registration.d.ts +7 -0
  178. package/dist/utils/host-registration.js +10 -1
  179. package/dist/utils/pid.d.ts +31 -0
  180. package/dist/utils/pid.js +65 -0
  181. package/dist/utils/resident-package-preload.js +12 -4
  182. package/dist/utils/sentry-fingerprint.js +3 -0
  183. package/dist/utils/sync-person.d.ts +15 -0
  184. package/dist/utils/sync-person.js +74 -0
  185. package/package.json +8 -8
  186. package/scripts/install-hook-engine.mjs +5 -3
package/CHANGELOG.md CHANGED
@@ -2,6 +2,220 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [5.345.252] — 2026-11-24
6
+ - Added: the agent MCP tool `hq_dm_send` takes an optional `continueExchange` boolean for agent recipients (`agt_…`). When hq-pro-core 1.182.0 or later pauses an agent-to-agent DM at the loop check, the tool shows the server's warning. The sending agent may then resend the same message once with `continueExchange: true`, and only if the exchange is about unfinished work. The resend reuses the held message's idempotency key, and the tool says "continued the exchange" when the server confirms. If the continued message is held again, the tool tells the agent to stop and not reply. Each DM to an agent now carries its own idempotency key. The flag is refused for a person, an email or a channel recipient, and for a non-boolean value, before anything is sent.
7
+ - The `hq_inbox_read` refused-ack paging test writes its 320 records to the state file in one locked call, instead of rewriting the file 320 times.
8
+ - Internal: on hosted bots (agents-v2) the hq-hook engine runs the bound company's own hook scripts (`companies/<company>/hooks/PreToolUse`, `PostToolUse` and `SessionStart`) itself, with the input, arguments and environment the bot's shell adapter gave them, so those scripts no longer keep the three events on the shell adapter. Another company's scripts never run. A company PreToolUse script that refuses, fails or runs out of time stops the tool call; on PostToolUse and SessionStart a refusal only adds a warning. When the scripts could run longer than the engine's time for the call, as master-hook's 120 s per script allows, the registered call goes to the shell adapter instead, so a slow script is waited for as before.
9
+ - Added test coverage locking in case-sensitive Antigravity tool-name checks.
10
+ - CI: the Windows baseline reader no longer marks a run incomplete when a failed test prints the output of a child test run it started.
11
+ - CI: the Windows test reader no longer marks a run incomplete when a child test run's result line is split over two lines.
12
+ - Internal: the batch train (`scripts/ci/batch-train.py`) no longer drops a green batch when main moves outside the train by at most 5 commits that touch none of the batch's files and no global path (workflows, CI scripts, manifests, lockfiles, toolchain and test config), and no required check on the new main is red. It merges the tested batch on top of the new main, at most twice per batch, and records each such move in the run report. Any compare it cannot read in full keeps the previous stop and rebuild.
13
+ - Internal: the batch train (`scripts/ci/batch-train.py`) reads job logs with `gh api --allow-escape-sequences`. gh 2.x refuses to print a job log with ANSI colour codes without it and exits 1, so the train could not read any gate log and judged a rate-limited run as a plain red (train run 45346687074). A gate whose log still cannot be read is classified from its check-run annotations, where `scripts/ci/wait-for-jobs.mjs` now also writes the `WAIT_FOR_JOBS_RATE_LIMITED` line. When the train cannot read the failed jobs, a gate's log or an annotation, it no longer judges the result: it holds the batch once until its own API limit resets (at most 20 min), judges it again, and otherwise stops without merging, drafting or splitting.
14
+ - Internal: the batch train (`scripts/ci/batch-train.py`) reads each PR's commit messages before its squash merge. When the PR title or any commit message holds `[skip ci]`, `[ci skip]`, `[no ci]`, `[skip actions]` or `[actions skip]`, it passes an explicit `--subject` and `--body` of the PR title (markers removed) and number, so the squash commit on main does not skip push workflows. If the commits cannot be read, or GitHub lists none, it does not merge that PR or the ones after it.
15
+ - ci: the two ci.yml gate pollers no longer run at the same time. `e2e (node 22)` now starts when `build (node 22) / ci` ends (it needs the build job, never its shards) and then waits for the e2e build and shards itself, so a re-run of failed jobs waits again. Both waits read the run's jobs once a minute, and the build job's first read comes after 120 s (`WAIT_FOR_JOBS_INITIAL_DELAY_SECONDS`, new). Required check names are unchanged.
16
+ - Internal: the CI gates `build (node 22) / ci` and `e2e (node 22)` (`scripts/ci/wait-for-jobs.mjs`) now treat a 403 or 429 whose body says "rate limit exceeded" as a rate limit even without the rate-limit headers, wait until the reset plus 1-5 s of jitter, and back off between polls from 30 s to 120 s. A limit that cannot clear before the gate's timeout fails the gate at once with a `WAIT_FOR_JOBS_RATE_LIMITED reset=<time>` line instead of a flat wait and "jobs still not finished". The batch train (`scripts/ci/batch-train.py`) reads that line, or GitHub's "API rate limit exceeded for installation" text, as infrastructure: it never splits the batch or drafts a PR for it, waits for the reset (at most 20 min), re-runs the failed jobs once, and otherwise stops without merging.
17
+ - Added a 17-case real-call Claude Code `Glob`/`Grep` PreToolUse corpus fixture and regression test confirming every case allows under the current Claude adapter.
18
+ - Check cleanup parity fixtures for live helper replies instead of fixed survival waits.
19
+ - Add `Host::Antigravity` payload decode, encode, strict tool-name mapping (refusing control characters including trailing newlines and NUL bytes), and opaque-tool refusals in `hq-hook`.
20
+ - Add Antigravity PreToolUse guard-chain wiring and parity fixtures for supported tool calls in `hq-hook`.
21
+ - Changed: `hq ontology lookup`, `neighbors`, `search`, `traverse` and `hq ontology brief --style full` now show when a decision was replaced by a later one. `lookup` and `neighbors` print `replaced: on <date> by <id> (<name>) [citation] file: <path>` directly under the header for a decision with an open `superseded_by` edge, and `replaces: <id> (<name>) on <date> ...` for the decision that replaced it. Duplicate edges to the same decision are shown once, a chain is followed for up to five decisions (`, itself replaced on <date> by <id>`), and a loop is reported as one. `lookup` prints the status of a replaced decision as `status = replaced [citation of the edge] (was decided [citation of the stored status])`, so "replaced" carries the origin and confidence of the edge that says so. Any other line that shows a replaced decision ends with ` | replaced <date> by <id> [<origin> <confidence>]`, for example `[agent:sonnet 0.60]`. With `--as-of`, the candidate lines under `ambiguous:` and `no match:` are marked as of that day. `--json` adds `replacedBy` and `replaces` on `lookup` and `neighbors`, `replacedBy` on a `search` result and `targetReplacedBy` on an edge (each `{id, date, source, by, conf}`); no existing field changed. The full brief also prints the day beside a project's stage, status and owner and a customer's stage (`stage beta [2026-11-19]`). The readers apply this by rule: nothing in the graph is written or closed, and a decision with no lineage prints as before.
22
+ - Added: `hq ontology update` and `rebuild` now say what the run revised from the changes its signals state: how many decisions were marked replaced, reversed and withdrawn, how many status rows were closed and how many lineage links were written. `--json` carries the same numbers under `revised`.
23
+ - Added: `hq ontology lineage backfill --company <slug>` finds lineage for decisions recorded before signals stated it. It walks decisions oldest day first, picks up to 6 earlier open decisions per decision by the rare words the two statements share and by shared topics that are not on a large share of all decisions, asks the model in batches whether the decision replaces or reverses any of them, and writes each day's accepted links before the next day. An answer must quote both statements. A link carries the model's origin at confidence 0.60 and reads as `replaced`; the command writes no status row, leaves a decision alone when a person or a record has since said it stands, and writes no second link for a pair another model already linked. Options: `--dry-run` (decisions, batches, estimated token and list-price cost ranges, and the flags that let the estimate through the daily cap; no model call), `--from`/`--to`, `--restart`, `--retry-unanswered`, `--allow-unanswered`, `--max-input-tokens`/`--max-output-tokens`, `--graph-root`, `--json`. A run that reaches the cap stops and the next run carries on; a decision that gets no usable reply holds its day and is sent again by the next run, and after three runs it is recorded as unanswered and listed by count. Running it again with nothing new changes nothing.
24
+ - Added: `hq ontology lineage undo --company <slug>` removes exactly the links the backfill wrote and clears its state, so a later backfill starts from the first day. Rows changed since are left and counted. `--dry-run` counts and writes nothing.
25
+ - Fixed: the `revised:` line of `hq ontology update` and `rebuild` counts each decision once, not once per audience folder, and no longer counts a status that was already in the graph.
26
+ - Added: the company graph now records decision lineage from signals by rule. When a signal file carries `changes`, `hq ontology rebuild` and `update` write a `supersedes` edge from the new decision to the earlier one (origin `rule:signal-changes`, confidence 0.75) and set the earlier decision's status to `superseded`, `reversed` or `withdrawn` from the new signal's day. The rows depend only on the set of changes: a decision changed twice keeps one open status after any number of rebuilds, and `update` reaches the same rows as a rebuild. A status a person or a record wrote on or after the change that says the decision stands is kept and the change is not applied; one that confirms the change keeps the link. A change a signal no longer states is taken back. `completes` is not applied to decisions. No model is called for this.
27
+ - Changed: `hq ontology lookup`, `neighbors`, `search` and the brief name the kind of change (`replaced:`, `reversed:`, `withdrawn:`), print a status this rule wrote once with its own citation, and end the citation of its rows with `from a signal quote`. When a person or a record set a status that says the decision stands after a link was written, the link is shown as `earlier link:` and the decision is not marked as replaced. `--json` adds `kind`, `withdrawn` and `earlierLinks`.
28
+ - Added: `model_tasks` in `companies/<slug>/settings/ontology.yaml` switches the graph's own model tasks off per company: `extraction` (reading sources no signal covers), `typing` (relationship typing) and `summaries` (page summaries), each `on`, `off`, `true` or `false`; `model_tasks: off` switches all three off. With a task off, nothing new is collected or sent for it, and items an earlier run left pending for it are held: they are kept, counted and reported ("N items pending for typing are held because the task is off") and are sent when the task is switched on again. A settings file that is not valid YAML, a `model_tasks` that is not a mapping, or a value that is not one of the four words switches the affected tasks off and the run says why; an unknown key under `model_tasks` gets a warning. `hq ontology status` shows the effective setting. A company without the key behaves as before.
29
+ - Added: the signals pass now records when a new signal changes an earlier one. Before a document is read, up to 12 earlier open decisions, action items, commitments and risks of the same audience that share its words or entities are added to the same model turn as data, under labels made for that turn. A signal in the reply may carry `changes`, naming the earlier item, the kind (`replaces`, `reverses`, `completes` or `withdraws`) and 4 to 30 words quoted from the document. Each entry is checked before anything is written: the earlier item must be one that was shown, older than the document, from another source and not already changed in the same run, and the quote must appear in the document body, on whole words, near words or entities it shares with the earlier item. What passes is written to the signal file as `changes`; what fails is dropped and counted in `changes_dropped` and in a warning line. Within one run, a document's new items and the items it changed are visible to the documents read after it. No extra model call is made, and a document with no earlier item is sent as before.
30
+ - Internal: on Claude Code and Codex (macOS and Linux), the new hook engine can now answer PreToolUse itself instead of the old `master-hook.sh` dispatcher, once `hq reindex` switches it over. Roots whose hook setup it does not fully model stay on the old dispatcher.
31
+ - Accept a registered `--hq-root` holding `core/` plus `core/core.yaml` or `.claude/hooks/hook-gate.sh` even before a `companies/` directory exists.
32
+ - Replace the 0.1s FIFO poll loop in `cleanup_mcp_parity` helper fixtures with a blocking `read -t 30` and close inherited fd 3 on spawned child helpers so live probes are not split across timeouts under load.
33
+ - Complete the Grok `PostToolUse` `journal-due` native port so Grok `Write`/`Edit`/`Bash` calls match the shipped hook instead of emitting a false block (`#3662`).
34
+ - Fix grandchild process-kill race in `src/lib/daemon/hook-requests-autocommit.test.ts` by waiting up to 1.5 s for asynchronous `SIGKILL` exit and treating Linux `/proc/<pid>/stat` zombie/dead states as terminated.
35
+ - Fixed: aligned agents-v2 prompt hook registration and enforcement behavior.
36
+ - Exit 0 with one clear stderr line (no block) when `PostToolUse` receives invalid JSON; empty, non-object, and wrong-typed payloads still exit 1.
37
+ - The `pretool_paths`, `pretool_batch2` and `lanes_reminder` hook tests no longer fail with `Broken pipe` when a hook exits before it reads its stdin payload. They use one shared stdin helper that accepts only `BrokenPipe` and still fails on any other write error.
38
+ - The `runBounded` process-group test now checks that the group's SIGTERM reached the grandchild through a marker file the grandchild writes, instead of polling the grandchild's pid. A killed grandchild that its new parent had not yet reaped still answered that poll.
39
+ - `hq sources sync` no longer fails the whole signals pass when one meeting times out. That document stays queued and the rest of the day's meetings still run. If 3 documents in a row time out, or every document that was tried timed out, the pass stops and fails as before so a provider outage is still reported.
40
+ - Fixed: `hq bot stop`'s final SIGKILL and the Windows mesh daemon stop no longer signal pid 0 from a bot status file or a corrupt daemon pid lock. `process.kill(0)` signals the caller's whole process group, so a bad file could kill the terminal that ran the command. Lane worker and watcher pid files, and the doctor refresh-sync pull pid file, are now written through a temp file and a rename, so a reader never sees an empty or partial pid.
41
+ - Internal: test cleanup in the child-bootstrap, runtime-stream and resolve-company suites validates pids read back from fixture files before signalling them, and the new `src/utils/pid.ts` helpers (`parsePid`, `signalPid`, `signalProcessGroup`, `writePidFileAtomic`) refuse 0, negative and non-integer pids. An empty `child.pid` could make cleanup run `process.kill(0, "SIGKILL")` and kill a CI runner (#3626).
42
+ - Flag requests now report the client version and platform.
43
+ - Run six real-time hook cases on the nightly schedule and remove fixed waits from process tests.
44
+ - fix(release): the Windows hook package jobs now install their release tools in each job instead of restoring a shared cache. In v5.345.251 the Windows x64 hook package did not publish because it restored a cache saved by the Windows Arm job on a different drive.
45
+ - Changed: the host canary record shipped with the CLI is refreshed for this release build.
46
+ - Fixed: a file this machine had just uploaded is no longer left "for the next sync" on every later push. A background pull that checked the new upload recorded an older vault version for it, so each push after that was refused as a conflict and nothing uploaded. Pull now records the version it fetched, and push repairs records that already have the older version: it reads the vault copy once and uploads when that copy is the one this machine last synced. Rescue also removes files an earlier release shipped and a later one removed, and keeps retired hooks when `companies/` or a company folder is a missing link. hq-cli now uses hq-cloud 6.18.124.
47
+ - Added jq-only PATH suffix recovery in the native hook gate to match `hook-gate.sh`.
48
+ - Added: `hq-hook` reads a second flag for each bridged hook, `hook-engine-port-<id>-shadow`. When it is true the hook runs in shadow mode (the shell script decides and the engine runs beside it and logs), whatever `hook-engine-port-<id>` and `hook-engine-port-<id>-v2` say. `hq-hook bridge-plan` prints `shadow` for that hook. The flag service stores booleans only, so this is how it can put a hook in shadow mode. A `-shadow` flag for a name that is not a bridged hook is ignored.
49
+ - Improved Windows path handling and native guard evaluation in `hq-hook`.
50
+ - hq-hook on Windows: the company scope check reads HOME in every spelling Windows uses (`C:\Users\name`, `C:/Users/name`, `/c/Users/name`), so `~` and `$HOME` paths are read as the same folder on both sides of a comparison. On every platform, a hook process whose HOME is set to something that is not one absolute folder now stops a call that names a path, with a message that says so.
51
+ - hq-hook on Windows: when HOME is not set, the company scope check takes the home folder from USERPROFILE. When neither is set, a call that names a path under the home folder or a `.hq` folder stops with a message that names the two variables; other calls are unchanged. Nothing changes on macOS or Linux.
52
+ - hq-hook on Windows: the company scope check reads a path under the home `.hq` folder the same way in any letter case, including the drive letter, and reads `/c/../d/...` as drive D as Git Bash does. Nothing changes on macOS or Linux.
53
+ - **hq-hook: the hook state store works on Windows.** In the native engine (`hq-hook run`), the hooks that keep state between calls now run on Windows. They no longer stop with "the Rust state store, which is off on this platform (Windows) until US-022". Nothing changes for Windows machines today: HQ does not register the native engine on Windows yet, and the master-hook bridge still runs the bash hooks there. In the native engine the image-size hook and the session handoff are not yet on for Windows.
54
+ - **hq-hook on Windows: Codex and Grok tool calls work with a Windows home folder.** The native engine read a Windows home folder name (`C:\Users\name`) as pattern text, and Codex and Grok tool calls failed. It now reads it as a folder, in every spelling a command can use.
55
+ - **hq-hook on Windows: the package-install log row is valid JSON.** The row under `workspace/learnings/` wrote the working folder with Windows backslashes, which no JSON reader accepts. It now writes the folder as Git Bash prints it (`/c/Users/name`).
56
+ - hq-hook on Windows: the hook state store can now create, write, rename and remove its files and folders (session ledgers, held reminders, lock folders, the duplicate ledger and the engine log). Also, the Windows read of the hook registry and Stop scripts opens the folders above its folder without blocking other programs, so a program holding a folder such as C:\Users open no longer makes that read fail.
57
+ - Fixed: on the `hq core hq-session` fast path, a company change named with two leading `--session-id` flags (`--session-id a --session-id b set company_slug acme`) now records its binding receipt for the last one, as the command itself already did. Before, only the first flag was skipped, so the change was not seen and no receipt was written, and a hook-confirmed bind of the session's own id was never recorded.
58
+ - Fixed: `hq core hq-session set company_slug PERSONAL` (or `Personal`, any letter case) is now the no-company scope, stored as `personal`, as the CLI's session readers already read it. Before, the native command and the bundled `hq-session.sh` stored it as a company named `PERSONAL`. The native session bind in `hq-hook` accepts the matching `hq-session.sh` revision from hq-core-staging, which folds the same way, beside the revisions it already accepted, which keep their behavior.
59
+ - Fix `journal_due::shell_and_native_writers_on_one_counter_lose_no_update` test contention by running the 13 concurrent shell/native counter updates in barrier-synchronized waves of 2–3 writers instead of queuing 7 bash subprocesses against the 1 s `LOCK_WAIT`.
60
+ - ci: the "Main full suite" workflow no longer cancels a main push run in progress when a newer push arrives; the newer push waits, and only the newest waiting push runs next.
61
+ - Hardened the repository merge-hold check to refuse when the hold lookup cannot complete or confirm an answer.
62
+ - Preserve a merge check refusal when its explanation cannot be read.
63
+ - Fixed: automatic project binding no longer sends sessions to a Board that was archived or completed, such as a duplicate archived in favor of the canonical Board. Remembered bindings to such a Board are forgotten, so the session binds to the active project instead.
64
+ - Fixed: the Board roster now shows when each member's HQ daemon was last seen. The daemon reports a small health summary (counts only) for each company every five minutes, and the Work Mesh service no longer crashes and restarts when a connection to the live channel times out.
65
+ - Improved tool-name normalization in native hook handling.
66
+ - Internal: hardened the PreToolUse guard and made its file check faster.
67
+ - Stabilize the `post_mesh_tool_writes` stand-in daemon handoff so overlapping `prd.json` writes reliably coalesce into a rerun under Linux CI load.
68
+ - Hardened the `protect-core` parity test harness so exit-0 bash runs preserve stdout/stderr diagnostics and avoid repeated `PATH` prefix growth.
69
+ - Fixed: when the qmd bundled with hq fails its startup check, hq now checks the qmd on your PATH the same way before using it. A PATH copy that fails, such as a damaged `qmd.cmd` in `%APPDATA%\npm` on Windows, is no longer run. If neither copy works, hq search prints what happened and the one command that fixes it (reinstall hq), instead of a raw qmd error. Errors from a PATH copy now also record why the bundled copy was skipped.
70
+ - Fixed: `hq reindex` keeps an event of the project's `.claude/settings.json` on `master-hook.sh` while Codex or Grok Build keeps that event on its shell adapter and the root's `hook-adapter-core.sh` is a revision that reads only `master-hook.sh` entries. `hq doctor` reports such an event as held, and as a failure when it is already registered to the new core.
71
+ - Removed the timed "twice the text" credential-shape scan test. The counted engine-input check in the same suite already fails on any scan whose cost grows faster than the text.
72
+ - Re-pin the native `core/scripts/lib/hook-adapter-core.sh` SHA-256 to `cf1abd5c832722d26a46ced0694e8a3cd0d70ff30194a03fb2ce989289a8621c` (`hq-core-staging#2129`, comment-only change).
73
+ - Refuse `NotebookEdit` calls targeting `repos/` outside `workspace/worktrees/` in `hq-hook` `repo-worktree` command rules across Claude and Codex payloads.
74
+ - Fixed: `hq report decommission` now retires the hq-pro report record (DELETE with the current revision) before printing `decommissioned: true`. Direct CLI use no longer reports success while `hq report get` still shows a live or draft-ready record.
75
+ - Fixed Claude Code project hook registration on HQ Core v16.0.51 by recognizing its released adapter alongside the current revision.
76
+ - Added: the native company scope guard (`hq-hook`) now leaves a single-use bind intent when it allows a Bash call that runs `hq-session.sh set company_slug <slug>`, `add company <slug>` or `remove company <slug>` for the calling session, so `hq core hq-session` can record a session's bind of its own id. The file is `~/.hq/work-mesh/bindings/intents/<session>.<tool_use_id>` (mode 0600, folders 0700, never written through a link, never replacing an existing file) and holds the action, the company and the time. The guard's allow or refuse answer is unchanged; a write that fails is one line in the engine log. Command forms the guard cannot read with confidence, calls it refuses, and a `--session-id` naming another session write nothing. The intent is written on macOS and Linux only; on Windows nothing is written yet.
77
+ - Fixed: the copy of the current sync's record that HQ gives the new sync engine is now decided file by file, and leaves a file out whenever it is not sure. A file the current sync wrote after its switch was turned off is left out and the rest are copied, with one journal or several; without a known switch-off time nothing is copied. A file is also left out when its sync or removal time is not a plain UTC timestamp or is in the future, when two journals disagree about it at the same time, or, on macOS and Windows, when two names differ only by case or Unicode form. When two journals both have a file, the later of its sync time and removal time wins. HQ reads the journal only from `HQ_STATE_DIR` when it is set, and otherwise from `~/.hq` and the daemon's own state folder. An old copy is marked out of date before it is removed; if it cannot be removed, for example on Windows while the engine has it open, HQ warns on each reconcile, records it in the rollout state, tries again, and writes no new copy until the old one is gone. This includes a company already back on the current sync. A company with nothing to copy is no longer reported as an error.
78
+ - Changed: the client-health heartbeat now carries `syncEngineByVault`, one
79
+ entry per vault in this machine's new sync engine rollout state, at most 16:
80
+ vault uid, whether the engine or the legacy sync owns it, whether the
81
+ daemon's engine unit is running (checked against a live daemon pid), the
82
+ last cycle's time and result, held count and hold kinds, conflicts and
83
+ transfer failures (with a truncated flag when the engine's list hit its
84
+ cap) and requests in the last 24 hours. No paths or file names are sent.
85
+ A machine with rollout state but no vaults sends an empty list; a machine
86
+ with no rollout state sends the same heartbeat as before.
87
+ - Fixed: `hq` commands no longer slow down on some machines with an unusual
88
+ engine status file.
89
+ - Changed: each `syncEngineByVault` entry in the client-health heartbeat now
90
+ carries `safety` when the sync engine reports it: for vault deletes sent,
91
+ vault deletes applied to local files, local files a download moved to the sync trash, conflict backups written,
92
+ local edits replaced by a vault body, uploads over a vault body, deletes and
93
+ uploads the vault refused, and adoption runs, the total, the count in the last
94
+ 24 hours and the time of the last one. Counters that never fired are left
95
+ out, an engine that reports none sends an empty `safety`, and an older engine
96
+ sends none. Numbers only; no paths.
97
+ - Add full-adapter Antigravity credential-search tests for case variants, backslash forms, `**/.aws/credentials`, `~/.config/gh`, and `~/.hq/secrets-cache`.
98
+ - Changed: accept `hq-core` v16.0.49/v16.0.50 `prompt-company-mention.sh` (`6cb4ec86`) in native `UserPromptSubmit` company bind by porting `prompt_company_mention_scheduled_task_body` and dispatching scheduled-task resolution by the on-disk library revision.
99
+ - Added: `hq-hook` answers Stop natively on Grok, fleet-local and agents-v2 hosts (`grok-adapter:Stop`, `fleet-local-adapter:Stop` and `agents-v2-adapter:Stop` claimed), exports `HQ_STOP_DECISION_DELIVERABLE` to Grok Stop and SubagentStop hooks, runs the lanes Stop hooks natively on fleet hosts, and hands an agents-v2 Stop back to the shell adapter unless the adapter is the fixed hq-agents-v2 #332 revision. Supersedes #3505.
100
+ - Changed: on hosted agents, the hooks that run after a tool call are answered natively by `hq-hook` instead of through the shell adapter. An HQ root with a hook that has no native port, such as a company folder hook, still sends the event to the shell adapter, which runs it.
101
+ - Added: port `agents-v2-adapter:SessionStart` natively in `hq-hook` (immediate `HQ_SESSION_RENDERED=1` no-op, root gate, `HQ_COMPANY_SLUG` single-tenant scope pre-bind, normalized payload, synchronous settings refusal, post-#332 `HQ_HARNESS=codex` mesh export, native skip list) with differential parity tests (US-050-B). A registered agents-v2 SessionStart stays on the adapter while any SessionStart hook is not covered natively (today `master-hook:SessionStart`, and any unported folder hook such as `core/hooks/SessionStart/40-conduct-reap.sh`), or when the adapter is not the fixed hq-agents-v2 #332 revision. The native answer matches the adapter's: it runs a registry hook only when `hook-registry.json` lists it with a script that exists, runs a SessionStart folder hook such as the agent-browser check only when master-hook would run that file, prints `{"context": ...}` in the adapter's indented form, prints nothing after a refusal, refuses when `settings.json` starts master-hook SessionStart, and exits 0 for a registration that names no HQ root where the adapter would find none (one where it would find a root goes to the adapter).
102
+ - Added: port agents-v2 SubagentStop adapter and master-hook rows natively with differential parity tests (US-050-B / US-049-B). Only the fixed hq-agents-v2 #332 adapter (sha256 e5cec6c1) keeps SubagentStop native; an older or edited adapter, or a root with no settings or registry file, hands the event back to the adapter as it does for SessionEnd.
103
+ - Added: port `agents-v2-adapter:UserPromptSubmit` and `master-hook:UserPromptSubmit` for `agents-v2` natively in `hq-hook` (rendered-session early no-op, local US-030 pending freshness stamp, scope pre-bind, post-#332 single-pass skip list and `HQ_HARNESS=codex` master overlay, `UserPromptSubmit@agents-v2` COVERS claim, and differential parity suite).
104
+ - Fixed: a local HQ Fleet bot no longer waits forever for a release update after one of its scheduled jobs stopped mid-run. The update now counts a scheduled job as running only while its run claim is younger than the HQ Fleet Runtime's own 300-second limit, which a live run refreshes every minute. An older, future-dated or unreadable claim no longer holds the update. The daemon log names the job and the claim's time, and also reports a schedule file it cannot read instead of passing over it (hq-core-rust US-054).
105
+ - Fixed: a local bot's scheduled job saved with a year in its schedule (for example `cron(0 9 ? * MON-FRI 2026)`) now moves into the HQ Fleet Runtime instead of being skipped on every `hq bot set` and restart. The old local scheduler never applied the year field, so the job moves as the same five fields it ran on, and the bot's log notes the conversion. As with other moved jobs, the schedule runs in the HQ Fleet Runtime's time zone. A job that still cannot move, such as one that runs on an event or has a schedule that is not text, stays unchanged in `jobs.json`, and the warning now gives the reason for each job (hq-core-rust US-055).
106
+ - Enabled Windows compaction history storage in PreCompact using the owner-only Windows store backend.
107
+ - ci(hq-hook): the Windows hq-hook baseline run is split over four shard jobs on the team's Windows runners instead of one job (about 43 minutes of test time became about 11 per shard). One job joins the shard results into the same `beaker-baseline` artifact; the baseline counts as complete only when every shard reported.
108
+ - fix(windows): `hq doctor --fix-jq` now adds the jq folder (`%USERPROFILE%\.local\bin`) to the user PATH, places a copy beside `hq.cmd` so terminals and Claude Code sessions that are already open find it, finishes with the `jq.on-path` check against the PATH a new terminal gets, and exits 1 with the exact remaining step when that check still fails. Before, it installed jq off PATH, printed "Verified" and exited 0 while HQ hooks kept blocking every tool call. The first hq command after an install or update, the npm postinstall and `hq install-global` now do the same on their own, so a Windows machine without jq needs no jq install by hand; a session that was already open may need a restart when hq is not installed under the user profile. The `jq.on-path` hint on Windows names `hq doctor --fix-jq` instead of winget, and a terminal opened before the repair gets a restart warning instead of a failure (#3716).
109
+ - fix(hq-hook): fall through to normalized repository-edit path checks when the Windows worktree port allows
110
+ - Respect repository worktree requirements for direct file edits on Windows.
111
+ - ci(hq-hook): the Windows hq-hook tests (Beaker) no longer run on draft pull request pushes; add the `ci-windows` label to a draft to get them (it takes effect on the next push). Ready pull requests are unchanged. Also adds a per-batch mode behind the repository variable `HQ_WINDOWS_PER_BATCH=on`: the Windows tests then run once per batch-train batch, on the train's combined commit with the whole Windows list, and the batch train requires that result (green, or red only on tests that already fail on main) instead of one per pull request.
112
+ - Improved Windows path handling for Glob root and company Git metadata checks.
113
+ - Added: `hq core hq-session` keeps a dated record of each company change to a session (`set company_slug`, `add company`, `remove company`) in `~/.hq/work-mesh/bindings/<session>.jsonl`, with the source of the change: `explicit` for a bind a person or agent ran, the source a launcher names, or `scheduled_task` for an unattended run. Each line names the HQ tree it was made in, and, when `--session-id` named another session, the caller's session. A record is kept only for a session named with `--session-id` (or, when the bundled script runs, by the environment); binds made from inside a hook, binds found through `workspace/sessions/.current`, and `set company_source` leave no record. Nothing reads the record to decide reporting yet. `hq logout` deletes it.
114
+ - Added: when `hq core hq-session` binds a session to a single company whose Work Mesh reporting is required (the `work-mesh-company-reporting-required` flag is on), it prints "Activity in session <first 12 characters of its id> is reported to <company>. Required by the company.", adding "(this session)" or "(not this session)" when the caller's own session is known. Nothing records that the line was shown. The session-binding record is now kept only for a `--session-id` the caller typed that names a session no session variable in the environment names (ids compared without case, `CURSOR_TRACE_ID` included), so an id a child process inherited is never credited, and its lines are schema version 2. `hq core hq-session` records a session's bind of its own id when the hook host confirmed that session for the tool call that ran it. The confirmation is a single-use intent file under `~/.hq/work-mesh/bindings/intents/`, owned by the user and writable by no one else, which the native scope guard is to write (not yet shipped). Until then no intent exists and such binds are not credited. When an unconfirmed change leaves a lock set different from the session's last record (an unbind, a remove, a switch, or an add from one company to two), a line with the new lock set and the source `unconfirmed` is written. It never counts, so the earlier bind is closed and nothing new is credited. Only an exact repeat writes nothing.
115
+ - Work Mesh: the organize ask no longer offers "Leave untracked" when the session is (or will be) company-bound. That choice was refused on submit, so the prompt was a dead option.
116
+
117
+ ## [5.345.251] — 2026-11-23
118
+ - Fixed: on hosted agents, the engine-log row for an advisory hook refusal no longer shows "reason withheld" on a slow or busy machine. The time limit for checking each reason now starts after the checker has loaded, and a slow log write no longer uses up the limit for the next row.
119
+ - Fixed: on hosted agents, when a native hook refuses after a tool call or before a model call, `hq-hook` now keeps running the remaining hooks, prints the reason and writes it to the engine log. Before, the first refusal stopped the remaining hooks and its reason was lost.
120
+ - Internal: The batch train now requires the Windows hook tests (Beaker) on every pull request that changes the hook paths. A red Windows run passes only when every failing test already fails on main's current Windows baseline; the train logs each such pass in its report and in one comment on the pull request. New Windows failures, a missing or stale baseline, or a Windows run that is missing, pending, skipped or cancelled keep the pull request out of the batch.
121
+ - Internal: The batch train no longer puts a pull request back to draft when its train run was red only because a self-hosted runner lost contact mid-job. It re-runs the failed jobs once and judges the re-run; if a runner is lost again, it stops without merging or drafting anything. A red run for any other reason is handled as before.
122
+ - Internal: The batch train no longer puts a pull request back to draft when its lone run failed only on tracked flaky tests (listed in issue #3576) that are outside its diff. The pull request is left out of that train with a comment and no failing status, and merges only from a later green train. Each head gets this once; a second tracked-flake failure on the same head goes back to draft as before.
123
+ - Internal: The main full suite workflow (`node20-full.yml`, formerly Node 20 only) now runs every leg of a full pull request run after each push to main and nightly: the unit shards and coverage merge on Node 20 and Node 22, typecheck and lint on both, the worker-scaffold shell suite, and the e2e build with all four shards. It runs on self-hosted runners only (idle Macs first on a main push, the AWS pools otherwise) and never deploys. A red run on main opens or comments on an issue labelled `ci-main-red`, and the next green run closes it.
124
+ - Internal: Pull request CI can run only the tests a change can reach. With the repository variable `HQ_CLI_PR_AFFECTED_TESTS` set to `on` (off by default), a pull request that changes Node source or test files runs the changed files' import graph plus every test that runs the CLI out of process, names a changed file, or walks the repo. Config, lockfile, workflow, script, template and test-setup changes, deletes and renames, large diffs and the `ci-full-suite` label still run the whole suite. e2e stays full for any source change. Merge trains and main keep the whole suite.
125
+ - Internal: the hq-hook PreToolUse dispatcher pins, the native gate fact check and the native image rule also accept the hq-core-staging main revision of `session-id.sh` (fd709b39a, d6a04155), with the matching `coverage.ts` entry. This only affects a root that pairs that file with a pinned `master-hook.sh`: a staging-main root stays on bash for PreToolUse because its `master-hook.sh` is not pinned. The native session bind, SessionStart and UserPromptSubmit still accept only the released revision.
126
+ - Internal: the hq-hook engine also accepts the hq-core-staging main revisions of `hqd-hook-shim.sh` and `hq-session.sh` (fd709b39a). On a staging-main root their native paths still wait for the `session-id.sh` and `master-hook.sh` pins. The native session bind prints `hq-session: invalid --session-id: '<id>'` for an invalid explicit id on that hq-session.sh revision, as the script does.
127
+ - Internal: the native Stop also accepts the `conduct-lanes-link-deliver.sh` (`944c727a`), `hq-autocommit.sh` (`66f5c09b`) and `35-work-mesh-session-start.sh` (`4ab85c27`) that hq-core v16.0.48, v16.0.49 and v16.0.50 ship, so those three files no longer hold a root on those cores on the shell Stop. A v16.0.49 or v16.0.50 root also needs its `master-hook.sh` accepted (hq-cli #3561). The new deliver hook calls `hq runners link _deliver`, the command the native Stop already runs; the autosave script still runs from the root's own sweep. The hq-core-staging main `hq-session.sh` and `session-id.sh` stay unpinned for Stop.
128
+ - Internal: The fleet-local env dump parity tests no longer flake on Linux. The harness that runs the pinned adapter's checks now drains grep's input after `grep -q` answers, so `printf` cannot take SIGPIPE under `pipefail` and turn a dump into an allow. The pinned adapter and the corpus are unchanged; a 200-run loop of the `env-start-of-second-line` row guards the fix.
129
+ - Fixed: on HQ 16.0.48 to 16.0.50, when a Grok turn is cancelled or fails, `hq-hook` now records the turn end in the Work Mesh again. Before, it refused these events because it only knew the 16.0.47 turn-end script.
130
+ - Changed: `hq-hook` now writes a reason to `~/.hq/logs/hook-engine.jsonl` each time it hands a hook event or a single hook back to the shell scripts (status `dispatch-declined`, and a `reason` field on `fallback` and `script-mismatch` lines). With `HQ_HOOK_TRACE` set it also prints that reason on stderr.
131
+ - Changed: the host canary record shipped with the CLI is refreshed for this release build.
132
+ - Internal: the hq-hook replay harness tests (`crates/hq-hook/tests/replay.rs`) now run on Windows. They passed Node a `\\?\D:\...` path from `canonicalize`, which Node cannot run as a main script (`EISDIR ... lstat 'D:'`), so every case failed in the Beaker Windows job. The tests now strip the verbatim prefix before handing a path to Node. `scripts/hook-engine-differential.mjs` also hands bash a forward-slash helper path on Windows, so the bundled helper finds its `lib/` folder instead of failing every case with "missing core/scripts/lib/trigger-fact-text.awk".
133
+ - Internal: on Windows, four replay tests now assert the harness's designed refusals instead of failing on them: `--report <file>` is refused while the stores are off until US-022, and the Grok adapter refuses a HOME holding `\`. Other platforms keep their full assertions.
134
+ - The ontology session brief now puts what the member works on and owns before
135
+ their teams and leads, and prints a reporting line only when a record backs
136
+ it. A manager, report, team or lead that a model wrote with confidence below
137
+ 0.70 is left out of the brief, `hq ontology lookup`, compiled entity pages
138
+ and the entity list sent with a signals document. The brief prints one line
139
+ saying how many it left out.
140
+ - The ontology session brief is now a map: what the company graph holds (a
141
+ count per kind), the commands to look things up (`lookup`, `neighbors`,
142
+ `search`, `traverse`, `activity`) with when to use the graph and when to
143
+ search the vault, and the names of active projects, customers and teammates.
144
+ It no longer prints roles, stages, owners, teams or recent changes; those
145
+ are one `hq ontology lookup` away. `hq ontology brief --style full` (or
146
+ `brief_style: full` in `personal/settings/ontology-reader.yaml`) writes the
147
+ earlier summary. Both styles stay under 1,500 tokens, show a person's name
148
+ in place of a raw Slack id, and label customers "most active" instead of
149
+ "top".
150
+ - `hq ontology remodel --company <slug> --from <model>` asks again, on the model
151
+ the graph is set to use now, what another model wrote (digests of meetings
152
+ and threads, and profiles: role, employer, stage, contacts), and closes the
153
+ old model's rows. The closed rows stay on file with the day and the source.
154
+ `--kinds role_title,affiliation,works_at` picks what is asked again,
155
+ `--dry-run` prints the row counts and an estimate of the input tokens without
156
+ calling a model, and `--budget-tokens`, `--max-input-tokens` and
157
+ `--max-output-tokens` work as on `update`. Rows the replay wrote (typed
158
+ relationships, extractions) are counted and left as they are; a rebuild asks
159
+ those again. A run that is interrupted is finished by the next run before it
160
+ does anything else.
161
+ - Model work left pending is now kept per item, not per model. After a larger
162
+ model finishes the pending work, a later `hq ontology update` on the smaller
163
+ model no longer sends the same items again. Stale entries already in the
164
+ pending file are dropped the next time any ontology command opens it.
165
+ - `hq ontology update --follow-up` sends follow-up work an earlier run left
166
+ pending (profiles, retyped links, decisions that replace each other, page
167
+ summaries, digests), even on a day with nothing new, within the daily cap. A
168
+ plain `update` does not send it and spends what it did before; its summary
169
+ says how many follow-up items are pending. Items the graph no longer asks
170
+ about are dropped with a count and the reason in the summary.
171
+ - Facts and relationships a model reads out of a document now carry the
172
+ model's own confidence instead of a flat 0.60, so a role or employer the
173
+ document states outright is shown by `lookup` and the pages, with the model
174
+ and the source on the same line, and an inferred one is still left out. Rows
175
+ already in a graph keep 0.60 until they are asked again.
176
+ - The session brief no longer prints a role that a model read out of a
177
+ document, at any confidence. It prints a role only from a record, a rule, a
178
+ person's answer or the old entity files.
179
+ - A project's owner that a model wrote at low confidence is no longer shown as
180
+ the owner in the brief, `lookup`, the pages or the signals context.
181
+ - `hq ontology status --company <slug>` prints on one screen which ontology
182
+ this machine's sessions read, the model the graph is built with, whether the
183
+ graph folder is there and whose it is, how many entities and rows it holds,
184
+ how much model work is pending, when it was last updated and how large the
185
+ session brief is. It reads only.
186
+ - `hq ontology reader [graph|entities] --company <slug>` shows or sets which
187
+ ontology this machine's sessions read, in place of a hand-written file.
188
+ `graph` is refused until the company's graph has been built on this machine.
189
+ Running it twice changes nothing, and every reply names the command that
190
+ switches back.
191
+ - `hq ontology model [<model>] --company <slug>` shows or sets the model the
192
+ graph is built with. The setting is per machine and is not synced, and the
193
+ command says so each time, so every teammate sets it on their own machine.
194
+ - `hq ontology rebuild` takes `--max-input-tokens` and `--max-output-tokens`,
195
+ as `hq ontology update` does, so a first build with a model can finish in one
196
+ run. The default cap is unchanged.
197
+ - A bot on a personal Outpost now runs its daily hot-signal-sync as the
198
+ Outpost's owner. Before, the Outpost's own sign-in has no email, so
199
+ `hq sources sync` and `hq signals run` stopped with "signed out of HQ" every
200
+ day. A machine sign-in that acts for no person now says "No person identity
201
+ on this machine" instead of asking you to run `hq login`, and `hq bot start`
202
+ does not add a hot-signal-sync job on such a machine.
203
+ - Fixed: lanes that run on an Outpost now show their final state on your Mac. Before, the background `hq daemon` kept reusing its first read of the Outpost, so it never saw the lane finish and after 15 minutes marked it failed with `remote_lost`. A long-running `hq monitor` had the same problem when it messaged an Outpost lane: it kept its first read, so it could not find a lane the Outpost created later.
204
+ - With the graph reader on, a signal now links to a person the source document
205
+ names only by a Slack id or an email. A Slack thread shows its author as a
206
+ Slack id, so before this most signals from Slack threads were written with no
207
+ `entity_refs`. The key must be a whole token and belong to exactly one
208
+ entity; a key two entities hold links nobody.
209
+ - A `participant_contribution` signal from a thread with one participant links
210
+ to that participant even when its text does not name them.
211
+ - Signal text shows the person's name from the graph where it had a raw Slack
212
+ id the graph resolves to one person. An id the graph does not know, and every
213
+ email, stays as written. Bare first names still do not link.
214
+ - Recognize hq-core v16.0.49 (`d5049d5f`) and v16.0.50 (`774bca73`) `.claude/hooks/master-hook.sh` hashes in `native-stop-compatibility.json` `generations.from104` so native Stop registration and runtime evaluation accept them without holding or refusing.
215
+ - Internal: the native Stop no longer refuses a session id that contains a dot (such as `v16.0.49-allow`). master-hook uses the Stop session id as written for the session folder, its `meta.yaml` company binding and the company Stop hooks; the native Stop's session snapshot and folder-hook company lookup now accept letters, digits, `.`, `_` and `-` (not `.` or `..`) and read the same folder, where they refused the Stop before.
216
+ - Port `agents-v2-adapter:PreToolUse` natively in `hq-hook` (`agents_v2_pre_tool_use`: fail-closed root/gate check, `HQ_COMPANY_SLUG` single-tenant scope pre-bind, inline core/template/sensitive-read/env-dump guards with exact `hq-agents-v2-hook-adapter.sh` wording, `hq_cli` Bash mapping, `pre_approval_request` exec/apply_patch handling, and synchronous settings refusal) and add differential parity tests against `hq-agents-v2` main `853859ac` (US-050-B).
217
+ - Internal: on hosted agents (`agents-v2`), `hq-hook` can now answer the session-end event itself instead of the hq-agents-v2 adapter, matching the fixed adapter (hq-agents-v2 #332): each hook runs once, the adapter's skip list and `HQ_AGENTS_V2_HOOK_SKIP` are applied natively (so the MCP cleanup still never runs there), the company scope is pre-bound from `HQ_COMPANY_SLUG`, and the Work Mesh session-end record names the harness `codex`. A `.claude/settings.json` command other than master-hook is refused natively rather than started. The event stays on the adapter when the installed adapter is not the fixed revision (for example the older `a8e9a7e`, where the MCP cleanup still runs) or when the HQ root has no `.claude/settings.json` or `hook-registry.json`. Other events and hosts are unchanged.
218
+
5
219
  ## [5.345.250] — 2026-11-23
6
220
  - Internal: the batch train runner (`scripts/ci/batch-train.py`) is committed with tests. When main moves outside the train after part of a batch has merged, the runner re-reads main and builds a fresh train for the pull requests that did not merge, instead of stopping on the old main. Every pull request that drops out of a train build, for example on a merge conflict, is logged with its reason.
7
221
  - Internal: `hq-hook PR tests` now runs on same-repository draft pull requests that change the hook crate, on the same Mac pool runners a ready pull request uses, following the owner's 2026-11-21 draft rule in ci.yml. Fork drafts, `HQ_DRAFT_PR_CI=off`, `HQ_MAC_RUNNERS=off` and the `ci-hosted-runners` label still skip it, so a draft never runs on a GitHub-hosted runner. Before this, a draft such as hq-cli #3490 had no Rust checks until it was marked ready.
@@ -280,6 +280,15 @@ cmd_set() {
280
280
  local key="${1:-}" value="${2:-}"
281
281
  [ -n "$key" ] && [ $# -ge 2 ] || { echo "usage: hq-session.sh set <key> <value>" >&2; exit 1; }
282
282
 
283
+ # `personal` is the no-company scope in any letter case (PERSONAL, Personal),
284
+ # as the CLI's session readers treat it. Fold it here so the stored value,
285
+ # the capability and the Work Mesh register all see the reserved scope,
286
+ # never a company of that name.
287
+ # A bracket pattern, not tr: the exact-name bind path starts no process.
288
+ if [ "$key" = "company_slug" ]; then
289
+ case "$value" in [Pp][Ee][Rr][Ss][Oo][Nn][Aa][Ll]) value=personal ;; esac
290
+ fi
291
+
283
292
  # Reject invalid company_slug values before writing anything. A case alias
284
293
  # could otherwise bind the session and surface policies from a differently
285
294
  # named company directory on a case-insensitive filesystem.
@@ -1,13 +1,19 @@
1
1
  {
2
2
  "schema": "hq.host-canary-release.v1",
3
- "cliVersion": "5.345.250",
3
+ "cliVersion": "5.345.252",
4
4
  "hosts": {
5
5
  "claude": [
6
6
  {
7
7
  "passed": true,
8
- "at": "2026-11-23T07:39:40.796Z",
9
- "engineVersion": "0.3.1+hq.5.345.250.src.a33e9846b38c54900ba8dde4a7cbe1f726801b015a94ffd7927de7ca01204cef",
8
+ "at": "2026-11-24T11:13:19.040Z",
9
+ "engineVersion": "0.3.1+hq.5.345.252.src.693fad31131da1905b12ee154c7fbef1558b92848c90d1f3842ff76684c471a9",
10
10
  "gateSha256": "a2879dfe692233f5953bac86672947bbd82f3c5247292f3efcb80f16c3d2c6b1"
11
+ },
12
+ {
13
+ "passed": true,
14
+ "at": "2026-11-24T11:13:54.581Z",
15
+ "engineVersion": "0.3.1+hq.5.345.252.src.693fad31131da1905b12ee154c7fbef1558b92848c90d1f3842ff76684c471a9",
16
+ "gateSha256": "ca58a94859eae0a345c11c8d9c59303eb76350dc1cf223391037d21979c28718"
11
17
  }
12
18
  ]
13
19
  }