@indigoai-us/hq-cli 5.345.244 → 5.345.246

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 (116) hide show
  1. package/CHANGELOG.md +87 -0
  2. package/dist/command-catalog.generated.d.ts +93 -6
  3. package/dist/command-catalog.generated.js +114 -6
  4. package/dist/commands/bot.js +1 -1
  5. package/dist/commands/core-checkpoint-native.d.ts +5 -1
  6. package/dist/commands/core-checkpoint-native.js +13 -5
  7. package/dist/commands/deploy-comments.js +139 -0
  8. package/dist/commands/deploy-list.d.ts +5 -0
  9. package/dist/commands/deploy-list.js +8 -0
  10. package/dist/commands/dm.d.ts +4 -1
  11. package/dist/commands/dm.js +11 -2
  12. package/dist/commands/files.d.ts +11 -2
  13. package/dist/commands/files.js +48 -3
  14. package/dist/commands/lanes-loop.js +4 -1
  15. package/dist/commands/lanes.js +16 -5
  16. package/dist/commands/mesh.d.ts +2 -0
  17. package/dist/commands/mesh.js +26 -6
  18. package/dist/commands/reindex.js +2 -1
  19. package/dist/commands/rescue.d.ts +22 -1
  20. package/dist/commands/rescue.js +56 -9
  21. package/dist/commands/sources.d.ts +1 -1
  22. package/dist/commands/sources.js +1 -1
  23. package/dist/commands/storage.d.ts +15 -2
  24. package/dist/commands/storage.js +74 -7
  25. package/dist/hq-cloud-sync-runner/bin/sync-runner.js +2033 -1829
  26. package/dist/hq-cloud-sync-runner/package.json +1 -1
  27. package/dist/lib/agent-kit/mcp/tools.js +22 -0
  28. package/dist/lib/bot/jobs/hot-signal-sync.js +4 -1
  29. package/dist/lib/daemon/fleet-members-cache.d.ts +55 -0
  30. package/dist/lib/daemon/fleet-members-cache.js +266 -0
  31. package/dist/lib/daemon/handoff.d.ts +4 -0
  32. package/dist/lib/daemon/handoff.js +2 -1
  33. package/dist/lib/daemon/hook-requests.d.ts +2 -1
  34. package/dist/lib/daemon/hook-requests.js +19 -2
  35. package/dist/lib/daemon/install.d.ts +9 -1
  36. package/dist/lib/daemon/install.js +11 -2
  37. package/dist/lib/daemon/ops/policy.d.ts +23 -3
  38. package/dist/lib/daemon/ops/policy.js +62 -15
  39. package/dist/lib/daemon/run.js +12 -0
  40. package/dist/lib/daemon/server.d.ts +5 -0
  41. package/dist/lib/daemon/server.js +1 -1
  42. package/dist/lib/daemon/supervisor.d.ts +6 -0
  43. package/dist/lib/daemon/supervisor.js +31 -2
  44. package/dist/lib/doctor/checks/sync-runtime.js +8 -1
  45. package/dist/lib/flag-registry-worker-source.generated.d.ts +1 -1
  46. package/dist/lib/flag-registry-worker-source.generated.js +1 -1
  47. package/dist/lib/hook-engine/coverage.d.ts +68 -0
  48. package/dist/lib/hook-engine/coverage.js +163 -0
  49. package/dist/lib/hook-engine/native-precompact-compatibility.json +1 -0
  50. package/dist/lib/hot-channels/signals-pass.d.ts +52 -2
  51. package/dist/lib/hot-channels/signals-pass.js +65 -3
  52. package/dist/lib/install/claude-targets.d.ts +6 -0
  53. package/dist/lib/install/claude-targets.js +9 -1
  54. package/dist/lib/lanes/reconcile-result.d.ts +1 -1
  55. package/dist/lib/lanes/reconcile.js +19 -4
  56. package/dist/lib/lanes/remote-control-lane.d.ts +6 -0
  57. package/dist/lib/lanes/remote-control-lane.js +10 -1
  58. package/dist/lib/lanes/spawn.d.ts +2 -0
  59. package/dist/lib/lanes/spawn.js +19 -3
  60. package/dist/lib/lanes/worker-env-scrub.d.ts +48 -0
  61. package/dist/lib/lanes/worker-env-scrub.js +146 -0
  62. package/dist/lib/lanes/worker-process.js +4 -1
  63. package/dist/lib/mesh/client.js +5 -1
  64. package/dist/lib/mesh/live/daemon/doctor.d.ts +9 -0
  65. package/dist/lib/mesh/live/daemon/doctor.js +51 -6
  66. package/dist/lib/mesh/live/daemon/install.d.ts +39 -0
  67. package/dist/lib/mesh/live/daemon/install.js +70 -0
  68. package/dist/lib/mesh/live/daemon/outbox-company.d.ts +47 -0
  69. package/dist/lib/mesh/live/daemon/outbox-company.js +77 -0
  70. package/dist/lib/mesh/live/daemon/run.d.ts +2 -0
  71. package/dist/lib/mesh/live/daemon/run.js +48 -3
  72. package/dist/lib/mesh/live/daemon/state.d.ts +5 -0
  73. package/dist/lib/mesh/live/daemon/system-unit.d.ts +21 -0
  74. package/dist/lib/mesh/live/daemon/system-unit.js +80 -0
  75. package/dist/lib/mesh/live/daemon/transcript-watch.d.ts +4 -1
  76. package/dist/lib/mesh/live/daemon/transcript-watch.js +42 -38
  77. package/dist/lib/mesh/live/direct-drain.js +3 -1
  78. package/dist/lib/mesh/live/emit.js +4 -2
  79. package/dist/lib/mesh/live/flush.d.ts +61 -0
  80. package/dist/lib/mesh/live/flush.js +434 -114
  81. package/dist/lib/mesh/live/paths.d.ts +10 -0
  82. package/dist/lib/mesh/live/paths.js +14 -0
  83. package/dist/lib/mesh/live/reporting-privacy.d.ts +41 -1
  84. package/dist/lib/mesh/live/reporting-privacy.js +81 -7
  85. package/dist/lib/mesh/live/spool.d.ts +171 -17
  86. package/dist/lib/mesh/live/spool.js +777 -62
  87. package/dist/lib/signals/engine.d.ts +82 -2
  88. package/dist/lib/signals/engine.js +389 -53
  89. package/dist/lib/signals/steps/extract.js +5 -0
  90. package/dist/lib/sync-core/engine-holds.d.ts +17 -1
  91. package/dist/lib/sync-core/engine-holds.js +73 -3
  92. package/dist/lib/sync-core/reconcile.js +10 -2
  93. package/dist/lib/work-context/organize.d.ts +22 -4
  94. package/dist/lib/work-context/organize.js +50 -21
  95. package/dist/lib/work-context/paths.d.ts +6 -0
  96. package/dist/lib/work-context/paths.js +9 -0
  97. package/dist/lib/work-context/reconcile.d.ts +1 -1
  98. package/dist/lib/work-context/reconcile.js +1 -1
  99. package/dist/startup-registration.d.ts +14 -0
  100. package/dist/startup-registration.js +26 -0
  101. package/dist/utils/cli-telemetry.d.ts +6 -0
  102. package/dist/utils/cli-telemetry.js +154 -9
  103. package/dist/utils/github-tag-fallback.d.ts +7 -2
  104. package/dist/utils/github-tag-fallback.js +17 -8
  105. package/dist/utils/hq-core-source.d.ts +31 -0
  106. package/dist/utils/hq-core-source.js +144 -0
  107. package/dist/utils/interactive-caller.d.ts +6 -0
  108. package/dist/utils/interactive-caller.js +8 -0
  109. package/dist/utils/shipped-codex-hooks.d.ts +6 -4
  110. package/dist/utils/shipped-codex-hooks.js +22 -10
  111. package/dist/utils/vault-api.js +1 -0
  112. package/dist/utils/version-report.d.ts +3 -1
  113. package/dist/utils/version-report.js +13 -5
  114. package/docs/anywhere-runtime.md +2 -2
  115. package/package.json +8 -8
  116. package/scripts/check-function-manifest.mjs +99 -18
package/CHANGELOG.md CHANGED
@@ -2,6 +2,93 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [5.345.246] — 2026-11-23
6
+ - Fixed: the agent MCP tool `hq_dm_send` no longer answers "sent to <recipient>" when the server saved a DM but held it back from the recipient (`delivery: "held"`, for example an agent-to-agent DM stopped by the bot loop breaker). It now returns a warning that the DM was not delivered, with the server's explanation and reason, so the sending agent knows to resend later.
7
+ - Internal: Pushes to `train/**` branches run the same Linux checks as a merge-queue run, on the self-hosted pools only. This is the trigger for the merge lane's batch train, which tests main plus a batch of ready pull requests before any of them merges.
8
+ - Internal: "Re-run failed jobs" can turn `build (node 22) / ci` green again. Each test shard now uploads its result and coverage blob under a name that carries the run attempt, and the aggregate job merges only the newest attempt of each shard. Before, a re-run shard left two artifacts with one name and the aggregate could merge the failed attempt's results, so the check stayed red until a new commit was pushed. The nightly Node 20 run gets the same fix.
9
+ - Internal: The `Native Stop focused parity` job no longer runs on GitHub-hosted runners for same-repo pull requests. Drafts now go through the Mac runner route like ready pull requests, and when the route answers ubuntu-latest, fails, or is skipped by a Mac escape hatch, the job runs on the AWS pool `hq-cli-main-priority`. Fork pull requests stay on ubuntu-latest. All test binaries are built in one cargo run before the focused test steps, and dev builds skip debug info as the hq-hook shards do.
10
+ - Internal: The Mac runner route jobs and the `e2e (node 22)` gate check out their scripts sparsely into their own directory instead of the workspace root. On self-hosted runners that reuse the workspace, the root sparse checkout left the next job with only one file, which broke the Function manifest check on the light Mac pool.
11
+ - Fixed (`hq install --global`): the hq-anywhere `@import` written into `~/.claude/CLAUDE.md` now uses forward slashes on Windows. Claude Code never loads a backslash `@import`, so a global install on Windows previously left the HQ charter unread until someone rewrote the path by hand.
12
+ - Changed: the CLI now sends `cli_session_started` (including its first-sync and invite-prompt variants), `cli_feature_used`, `plan_limit_prompt_exposed` and `plan_limit_prompt_engaged` only for people who opted in to telemetry, read from `GET /v1/usage/opt-in`. People who opted out or never answered, and runs where the answer cannot be read, send none of these events. Agent and machine identities are still always collected. The answer is cached in `~/.hq/cli-telemetry-consent.json` for five minutes, and the read uses each event's existing time limit, so it does not slow a command. `HQ_TELEMETRY=0` still turns all CLI telemetry off.
13
+ - Fix: post-rescue Codex hook re-trust reads its shipped-hook reference from the built-in hq-core source.
14
+ - Added (hook engine, Codex): when `hq-hook run --host codex <Event>` answers an event (exit 0 or 2), it first writes an "answered" mark. The mark is one file in `$HQ_HOOK_STATE_DIR/codex-answered/` (default `~/.hq/state/hq-hook/codex-answered/`), named by a SHA-256 key of the HQ root's real path (so an answer for one HQ root never makes another root's adapter stand aside), the payload's session id, the event and a digest of the exact payload bytes, and it holds the time it was written. Alongside it the engine keeps an `event-<Event>` hint for each event it answers. Inside an HQ root, Codex also runs the bash adapter from the tracked `.codex/config.toml` for the same event. The adapter (hq-core-staging) waits briefly for the mark with its own key and stands aside only when the mark appears. An engine that is not registered, not trusted, turned off, crashed or gave no verdict leaves no mark, so the adapter answers as before (US-021 c4, T5 note 422). An unreadable payload, a duplicate call and no-verdict exits leave no mark. Marks older than ten minutes are pruned. Tests: `host::answered` unit tests, and `tests/injector_host_run.rs` (a Codex answer leaves its keyed mark and hint, a Claude Code answer leaves none, each turn gets its own mark, and an unreadable payload leaves none).
15
+ - Fixed: `hq daemon status` no longer shows lanes-reconcile as failed for two expected states. A stopped lane whose project file is not on this computer is now left as it is with a note, and the Outpost registry step is skipped with a note while you are signed out. Other reconcile errors still mark the pass as failed.
16
+ - `hq storage prune` (and the desktop Storage pane, which runs it) now keeps the last old version of every file deleted in the last 30 days, and of any file whose delete date it cannot read. The dry run and the summary say how many versions were kept this way; the JSON reports `kept_recent_delete_count` and `kept_recent_delete_bytes` per company.
17
+ - `hq files delete` now stops when one delete would remove more than 1,000 objects, even with `--yes`. To go ahead, run it in a terminal and type the confirmation it asks for. Deletes of 1,000 objects or fewer work as before.
18
+ - Vault API requests from hq-cli now send a `User-Agent` of `hq-cli/<version>`.
19
+ - Deploy: `hq deploy list --json` now keeps each app's `ownerId`, `privateMode`, `passwordProtected` and `accessPolicy` as hq-deploy sent them. The `/deploy` skill needs them to tell gated apps from public ones and to pick the caller's own apps, so it can drop its own paged app list (US-033).
20
+ - Deploy: new `hq deploy comments reply <app>` adds a comment as you (unanchored, at another comment's anchor with `--reply-to`, or at `--anchor-json`), and `hq deploy comments resolve <app> <comment-id>` marks a comment resolved, or open again with `--reopen`. Both take exactly one of `--company <slug>` or `--personal`. The `/deploy` skill used its own API script for these (US-033).
21
+ - Fixed: `hq doctor` reports the sync runner log as unreadable when its path is a directory, on every filesystem. On btrfs, where an empty directory reads as size 0, it used to report the log as healthy.
22
+ - Fixed: signal extraction on grok fails when the saved grok login is not a regular file, instead of running the turn with an empty login on filesystems where a directory copies as an empty file.
23
+ - `hq dm --attach` to your own email no longer fails with "not in your contacts".
24
+ The file is stored on the self-DM pair (`prs_you--prs_you`) instead of asking
25
+ you to send a connection request to yourself.
26
+ - `hq lanes create` on Windows no longer fails every worker with `not_detached`. A live process started with `detached: true` counts as detached without Unix session-leader checks.
27
+ - Internal: fleet-local PostToolUse hook output handling fix.
28
+ - Internal: The function manifest smoke test runs against a small fixture. The required pull request job still checks the full checkout.
29
+ - Internal: `scripts/check-function-manifest.mjs` no longer fails on wall time by default. It counts the work it does (subprocesses, listed paths, files and bytes read, needle and line checks) and fails a run that goes over a limit (rule `work-budget`), so a busy shared CI machine cannot fail it. `--max-work <name>=<n>` sets one limit; `--max-seconds <n>` is now an opt-in local timing check. Regression test: `test/ci/function-manifest-check.test.ts`.
30
+ - Added: a strict mode for the `hq-hook` engine. Set `HQ_HOOK_ENGINE=strict` or create `~/.hq/hook-engine.strict`, and the engine no longer hands a hook it cannot answer to the bash hook. A PreToolUse guard is refused, with a message naming the hook and the reason. Any other hook does nothing. Each case is logged in `~/.hq/logs/hook-engine.jsonl` with status `strict-miss`. The off switch (`HQ_HOOK_ENGINE=off` or `~/.hq/hook-engine.off`) still wins. Without the switch nothing changes.
31
+ - Fixed (host canary): on macOS the Claude host canary now runs with a normal Claude Code sign-in. When neither CLAUDE_CODE_OAUTH_TOKEN nor ANTHROPIC_API_KEY is set, it checks the sign-in with `claude auth status` and points the run at the existing login, keeping a disposable Claude config folder, no user shell startup file and the write-confining sandbox. Before, it refused without one of those variables, so core.next registrations never switched on for most Claude Code users.
32
+ - Added: `hq rescue`, `hq reindex`'s hook repair, `hq version` and the post-rescue Codex hook re-trust now read the hq-core source address from `HQ_CORE_SOURCE` (a JSON object with optional `repo`, `stagingRepo`, `apiBase`, `codeloadBase` and `webBase`), or from `~/.hq/core-source.json` when the env var is unset. Missing keys keep the GitHub defaults, so nothing changes unless you set it. An invalid value prints one warning and falls back to the defaults for the bad fields. A GitHub token is only sent to github.com, api.github.com and codeload.github.com, never to an overridden host.
33
+ - Fixed: the native PreCompact runs with the hq-core purge hook that keeps the policy ledgers across a compaction (hq-core-staging #2092), and does what that hook does: it removes only the per-turn ledger and writes the session's `.compacted` marker. Before this, that hook version made the native PreCompact refuse every compaction. Older hook versions purge as before.
34
+ - On Windows, when the bridge runs block-core-writes for the pinned e6c14f48 script, the Rust port answers: in on and shadow mode, and where a companion mismatch would have returned exit 75. With the port flag off or the kill switch set, the dispatcher does not call the bridge and bash still runs, as before. Other scripts keep the existing route: a39061417 still hands back to bash on Windows (owner decision 57). A write through a core package link stays blocked when that link is spelled with the folder's 8.3 short name or a different letter case. A missing path still allows. Any other failure to read the Windows path denies the write.
35
+ - Windows hook checks resolve existing short-name parent folders for new files and keep company-scope comparisons in one path form.
36
+ - Keep Windows core write checks consistent when the project root uses an 8.3 short name.
37
+ - Windows short-name folders that contain punctuation (such as `BLOCK-~1`) now expand like other 8.3 names, an MSYS `/tmp` path mapped to a short temp folder compares with its long project root, and the block message prints the file in the spelling bash prints.
38
+ - Fixed (lanes): lane workers (Claude, Codex and Grok runners, on start, resume, message resume, envelope repair and resume-time compaction), the lane watcher and the loop controller now start with a reduced environment. Proxy settings and other ordinary settings still pass through. gh inside a lane uses the account from your own gh setup.
39
+ - The native hook engine now reports the `lifecycle-dispatch` evaluator for SubagentStop, so `hq reindex` moves SubagentStop to the new engine on Claude Code and Grok Build, where every SubagentStop hook is already handled natively. On Codex, `hq reindex` moves SubagentStop only when the HQ's Codex adapter is the hq-core v16.0.47 release the native port is modelled on; every other Codex install keeps SubagentStop on the Codex adapter. The fleet runtimes keep SubagentStop on their adapter until their hooks are handled natively too, and Notification, SubagentStart and the other Grok lifecycle events stay on the old dispatcher. A Codex SubagentStop that reaches the new engine with any other adapter is refused natively with the reason on stderr, instead of being handed back to the old adapter; run `hq reindex` to move it back.
40
+ - Fixed: the Work Mesh daemon keeps its MQTT connection and timers running while it reads a large spool claim; the read now pauses between 1 MB chunks.
41
+ - Fixed: when the daemon starts, a dead-letter file over 50 MB is rewritten with one line per event (one machine had 1.9 million lines for 11,696 events). Nothing is expired. New dead letters no longer re-read the whole file to check for repeats.
42
+ - Fixed: work-session registrations that know their company only by name are no longer quarantined for good. The daemon looks the company up through the membership check when it sends them, and re-queues ones quarantined by earlier versions on start. A registration whose membership is not confirmed stays quarantined, with the reason in the daemon log.
43
+ - Fixed: when a daemon unit such as the Work Mesh exits abnormally, the daemon log now names the cause from the unit's own output (for example the V8 out-of-memory line before a SIGABRT), not only the exit signal.
44
+ - Fixed: `hq daemon doctor` shows a flush that is still running and the last flush error, counts lines left in spool claim files in the spool depth, shows the parked count, and no longer calls the daemon unhealthy for companies left out only because one presence credential cannot hold them all.
45
+ - Fixed: Work Mesh flushes check that the lines they write back arrived in full, link the file into place instead of copying it when the spool is empty, keep the parked-file lock fresh during long writes, and bound the memory they use by bytes as well as by event count.
46
+ - Fixed: with HQ Anywhere off, the daemon's first flush parks a backlog of 1 MB or more that cannot be sent, and lines that have sat in the parked file for more than 30 days are dropped, with a dropped receipt naming the sessions and event ids and a log line. Lines are aged by when they were parked, not by their event time, only lines read back from the parked file are dropped, and nothing is dropped while the clock is behind a recorded parked time.
47
+ - `hq mesh daemon install` on a Linux machine whose Work Mesh daemon already
48
+ runs from `/etc/systemd/system/hq-mesh-daemon.service` no longer adds a second,
49
+ per-user unit next to it. It says the system unit is in charge, changes
50
+ nothing and exits with code 3. `--system-user` works as before.
51
+ - `hq mesh daemon status` on such a machine reports the system unit's state
52
+ (for example `active (running), enabled` or `failed, enabled`) instead of
53
+ "not installed", and names a leftover user unit as a duplicate.
54
+ - Fixed: the Work Mesh flush no longer fails with "Cannot create a string longer than 0x1fffffe8 characters" when the spool grows past about 512 MB. Claims are read line by line with bounded memory, repeated lines of the same event are collapsed to one, and events the flush cannot send are written back in chunks instead of one file write per line.
55
+ - Fixed: with HQ Anywhere off, events the flush may not send (sessions without a verified company binding, and events from before HQ Anywhere was turned off) wait in `spool.parked.jsonl` instead of being read again on every flush. They are offered again when HQ Anywhere is turned on or the session gets a company binding. Nothing is dropped.
56
+ - hq-hook: the native credential guard now refuses a read glob that reaches a real credential file under other shell glob options. It always also expands a read glob without case, because startup files can set bash `nocaseglob` or turn off zsh `CASE_GLOB`; for example `cat .ENV*` is refused when `.env` exists. After the command changes glob options (`shopt`, `setopt`, `GLOBIGNORE`, `set -f`), it also expands with dot files, extended patterns and recursive `**`. A glob that matches no credential file is not refused. It also refuses `git diff --no-index` on a directory that holds a credential file.
57
+ - hq-hook: the native credential guard now checks a trap action as a command line, so a trap that reads a credential file at exit is refused, as is a trap action that comes from a variable or a substitution.
58
+ - Internal: A nightly flake hunt reruns the full unit suite three times on one main commit on the self-hosted pool and opens or updates a `flaky-test` issue for any test that both passed and failed. It is report-only and never runs on pull requests.
59
+ - Fixed: hqd's policy index could miss a policy file or policy folder created right after it last scanned the policy folders, when the file watcher also missed the change. On Linux a folder's change time only moves in steps of a few milliseconds, so a change in the same step looked like no change. The index now re-reads any folder that changed within two seconds of a scan and compares its file names, until that folder is older than two seconds. Folders that have not changed recently are still checked with one quick status read.
60
+ - Internal: Tests no longer wait on real timers for more than 2 seconds; they wait for the process they watch to exit, a ready or release file, or a fake clock. New overrides make the timers they exercise settable, with unchanged defaults: `HQ_INSTALL_SETTLE_STALE_PROBE_MS` and `HQ_INSTALL_SETTLE_QUIET_MS` for the torn-install settle wait (1.5 s each), and `HQ_CHECKPOINT_SIBLING_POLL_S` and `HQ_CHECKPOINT_SIBLING_KILL_GRACE_S` for the checkpoint sibling supervisor (2 s each).
61
+ - Fixed: `hq rescue` now clones hq-core from the `webBase` and `repo` set in `HQ_CORE_SOURCE` (or `~/.hq/core-source.json`) instead of always cloning from github.com. hq-cli now uses hq-cloud 6.18.121. Rescue does not use `codeloadBase`. Nothing changes unless you set the address.
62
+ - `hq rescue` and `/update-hq` now re-plan hook registrations after a successful core apply, the same step `hq reindex` runs. A Stop or SubagentStop that the new core does not cover for the applied files goes back to its old hook registration instead of being refused on every call until someone runs `hq reindex` by hand. A failure is reported and does not fail the update.
63
+ - Fixed: `hq reindex` keeps SessionStart on the shell hook when the HQ root's hqd-hook-shim.sh, hqd-hook-flag-cache-lib.sh, hq-session.sh (or a library it sources) or resolve-company.sh is not the revision the native SessionStart rebuilds (hq-core 16.0.48 to 16.0.50), so a newer or edited core no longer starts sessions with no SessionStart hooks.
64
+ - Fixed: `hq signals run` with a trigger other than `job` no longer replaces the record of a day's job that finished complete. When the day record has `jobRanAt` and status `complete`, the run is written to `workspace/signals/runs/<date>/sidecars/<company>/manual-<HHMMSS>.json` (with `-2`, `-3` and so on when the name is taken; an existing record is never written over). When the job ended partial or failed, a brief, chat or manual run still replaces `<company>.json` and carries `jobRanAt` forward, so the Daily Brief check sees the new run. Incremental passes on a day whose record has `jobRanAt` all write one file, `sidecars/<company>/incremental.json`. For a company whose slug ends in a dot, the folder name under `sidecars/` writes each dot at the end as `%2E`. `summary.json` keeps the job's row and its `status`, lists the other runs under `manualRuns` (newest also as `lastManualRun`) and `incrementalRun`, and reports them in `manualStatus` and `manualTotals`; `totals` counts every run once. Every run that fails, hangs or dies is reported to the owner by the stopped-run alert once, whether or not another run finished or was reported before or after it. One check sends at most one alert, so when two runs stopped, the second is reported by a later check, after the one-alert-per-hour limit has passed. The runs already reported are listed in `sidecars/<company>/alerted-runs.json`; a failed run reported before this change may be reported one more time. When that file cannot be written, a stopped run is still reported once and not once an hour: the bot keeps the runs it reported in memory, and after a restart an alert sent at or after a run started counts as that run's alert (so one alert can then stand for several runs). The bot job checks today's runs before yesterday's, so yesterday's unreported runs no longer take the hourly alert ahead of a run that died today. Several failed runs in one day can mean that many alerts, one per hour. A stopped incremental pass is not reported. A later job the same day still sees that it already ran. A manual run on a day with no job record still writes `<company>.json`.
65
+ - Fixed (signals): the signals pass now reads up to 40 documents per run, up from 20 (`hq sources sync`, `hq sources signals`, and the daily signals job; `--max-docs` still overrides it). On 2026-11-21 a run with nothing wrong had 31 documents waiting, read 20, left 11 for the next day, and was reported as finished with problems. Calls stay on the subscription login, and the usage-limit and unusable-reply stops still end a pass early.
66
+ - Fixed: a meeting recap signal (type `summary`) with no usable timestamp now cites from the earliest segment start to the latest segment end, so transcript markers that are out of order or overlap can no longer give a start after the end or a span shorter than the meeting. Two limits of the recap citation, stated here because the earlier entry said "the whole transcript": the pass reads at most 200 KB of a transcript, so a longer one is cited up to the last marker inside that cap, and only recap signals written from now on get the citation. Recaps already written are not changed.
67
+ - Fixed: a meeting recap signal (type `summary`) with no single timestamp now cites the whole transcript, from the first segment start to the last segment end, so upload no longer skips it for missing timestamps.
68
+ - The native company scope guard now refuses `hq docs create --text-file PATH` (or `--text-file=PATH`) inside a shell function when PATH is built from the function's arguments and its folder does not exist, as the released shell guard does. The same path from a plain variable, or one whose folder exists, is still allowed.
69
+ - Internal: the native hook engine now answers the vault-write access hook for Bash as well as the file-edit tools, on every host. On the new path the Bash check always follows the 16.0.48 arithmetic rules, whatever arithmetic library file is installed (including none), as the credential guard does. Only the bridge path still follows the installed library, and there an unknown library version is refused in the engine instead of handed back to the shell hook.
70
+ - Internal: `hq-hook` now claims master-hook's own SessionStart work on Claude Code, Codex and Grok Build (Unix): the session bind, the company bind for a session started outside the HQ root (registry lookup through `hq resolve-company` under a time limit, then the in-process `hq-session.sh set`), the nested-install warning, the scope pin and the daemon's `session.open` over its Unix socket, which keeps the "HQ session bound to company" context. No bash, perl or node is started. Inputs it does not model, such as HQ Anywhere configured with a flags URL, a resolver or session script revision it does not rebuild, or a time limit that is not a plain number, are refused natively before any write.
71
+ - Internal: on the local bot runtime (fleet-local), `hq-hook` now answers every UserPromptSubmit and PostToolUse event itself. Before, it handed the event back to the hq-fleet-local adapter whenever the HQ root's registry listed a hook the adapter's skip list skips, which on a stock 16.0.50 root was every such event. The skip list, the helper-session rules and `HQ_FLEET_LOCAL_HOOK_SKIP` are now applied natively to each row, including `native-plan-project-sync`, and in a session the runtime marks rendered (`HQ_SESSION_RENDERED=1`) no prompt hook runs, as the adapter ran none. Other events, Claude Code, Codex, Grok and hosted agents (`agents-v2`) are unchanged.
72
+ - Internal: on the local bot runtime (fleet-local), `hq-hook` now runs the registry's `reindex`, `hq-autocommit`, `pr-fingerprint-footer` and `hq-auto-acl-suggest` rows on PostToolUse where the hq-fleet-local v0.4.33 adapter runs them: the same regex prefilters, skip list, helper-session rule, profile gate and payload, and for a gated row the `PATH` that `hook-gate.sh` builds. Each hook leaves the HQ daemon the request note it leaves on Claude Code instead of starting `hq`, `git`, `gh` or the share helper. Before this the native path refused these rows on fleet-local. A row of these hooks with a prefilter, arguments or script this port does not read is refused natively. Registry diagnostics from failed hooks are now joined into one line at the end, as the adapter prints them. The fleet hand-back is unchanged, and Claude Code, Codex, Grok and hosted agents (`agents-v2`) are unchanged.
73
+ - Internal: on the local bot runtime (fleet-local), `hq-hook` now runs the registry's `policy-enforcement-gate` row on PostToolUse as the hq-fleet-local v0.4.33 adapter does: the canonical tool name and rebuilt payload, the adapter's skip list and helper-session rule, the hook profile gate and the adapter's environment. A read of a required skill or brief is recorded in the session's policy-enforcement state, so the PreToolUse gate sees the same receipts. Before this the native path recorded nothing on fleet-local. A gate row this port does not read (a prefilter, arguments, another script, a regex matcher), a malformed registry or settings file, an adapter core that is not a released copy and a payload with no session id are refused natively. The fleet hand-back is unchanged, and Claude Code, Codex, Grok and hosted agents (`agents-v2`) are unchanged.
74
+ - Internal: on the local bot runtime (fleet-local), `hq-hook` now runs the rest of the registry's PostToolUse rows where the hq-fleet-local v0.4.33 adapter runs them: `journal-due`, `journal-autocapture`, `redact-credential-output`, `auto-checkpoint-trigger`, `record-policy-retrieval`, `conduct-lanes-link-deliver`, `conduct-link-inherit` and `inject-policy-on-trigger`. They follow the adapter's matcher, prefilters (now including file and policy-vocabulary prefilters), skip list, helper-session rule, profile gate and payload, and write the same journal counters, auto-capture lines, checkpoint stamps and policy retrieval and trigger state. The two conduct hooks leave the HQ daemon a request note instead of starting `hq` or `node`. The policy injector now writes trigger state on fleet-local PostToolUse only where the adapter would have run it. Before this the native path refused these rows on fleet-local, and the injector ran there whatever the registry said. Claude Code, Codex, Grok and hosted agents (`agents-v2`) are unchanged.
75
+ - Internal: `hq-hook` now claims master-hook's own UserPromptSubmit work on the local bot runtime (`master-hook:UserPromptSubmit` on fleet-local), so the fleet-local registration plan can move `pre_llm_call` to the engine. The session bind, twin dedupe, timeout journal and verdict run inline after the adapter's own prompt work (owner scope, deferred notes, company-scope line), under the same rules as the hq-fleet-local v0.4.33 adapter: no master work in a helper or rendered session, without a settings master record or without master-hook.sh. A payload with no session id, text jq prints differently, a pinned-engine exec entry, a Task agent and an unmodelled environment are refused natively. A deferred note is no longer shown twice. Hosted agents (`agents-v2`) are unchanged.
76
+ - Internal: on local bots (`fleet-local`), `hq-hook` now sets each message's company scope from its sender natively, before the turn, as the shell adapter does: the owner gets every owner company on the machine, a sender that is not a person gets the narrowest (`personal`) scope, and a teammate is checked against the member cache in `~/.hq-fleet/cache/company-members`. When that cache is missing, stale or unreadable, the message runs at the narrowest scope (the previous sender's scope is always dropped) and the hook leaves a `fleet-members-refresh` note so the HQ daemon fills the cache for the next message. The daemon also keeps each owner company's member cache warm on machines with a local bot. Warm HQ DM turns are skipped as the adapter skips them. `fleet-local-adapter:UserPromptSubmit` is now claimed on fleet-local.
77
+ - Internal: on the local bot runtime (fleet-local), the native UserPromptSubmit rows now see what the hq-fleet-local v0.4.33 adapter hands its hooks. One shared helper rebuilds the adapter's payload (the prompt from `extra.user_message`, cut to its first and last 1000 characters with skill turns shortened, the conversation history dropped, the working folder set to the HQ root when it is inside the fleet home), and the engine sets the adapter's `HQ_ROOT`, `CLAUDE_PROJECT_DIR`, `HQ_CHECKPOINT_RUNTIME`, `HQ_HARNESS=codex` and `HQ_WORK_MESH_DISABLED=1`. The rows skip what the adapter skips (its fixed list, `HQ_FLEET_LOCAL_HOOK_SKIP`, helper sessions, where the folder hooks are skipped too), the sender's company scope is set before the policy injector runs, registry rows are not written to master-hook's timeout journal, the spawn-company-handoff prompt row runs as the adapter runs it, and an unknown `HQ_HOOK_PROFILE` prints no warning. The remaining differences are recorded in the US-050 c2 ledgers. The fleet hand-back is unchanged, so running bots keep using the adapter, and Claude Code, Codex, Grok and hosted agents (`agents-v2`) are unchanged.
78
+ - Fixed: `hq reindex` keeps UserPromptSubmit on the shell hook when the HQ root's prompt-company-mention.sh, hq-session.sh, session-id.sh or session-scope-capability.sh is not the revision the native first-prompt company bind rebuilds (hq-core 16.0.49 and 16.0.50 ship a newer prompt-company-mention.sh), so the first prompt of a session is no longer refused on those roots.
79
+ - Windows: `hq daemon install` now asks `%SystemRoot%\\System32\\whoami.exe` for the user SID, not PATH `whoami.exe`. Git Bash's coreutils whoami rejects `/user`, which used to register a name-based Scheduled Task next to the desktop app's SID task (feedback_9fa243e0).
80
+ - Windows: the scope guard now refuses a path-tool path or cwd that holds a colon inside a name (NTFS alternate data streams such as `file:stream` or `dir::$INDEX_ALLOCATION`), and the letters U+0131 and U+017F, which NTFS case folding matches to `I` and `S`, in any part of a path at or below the HQ root (or anywhere in the path when no HQ root is known, the path is relative, or its links cannot be followed). Each path is checked as written and with its links resolved, against the HQ root both as configured and with its links resolved, so a root reached through a junction or symlink (such as `C:\Users\name\hq` linked to `D:\dev\hq`) is covered. An HQ root or home folder whose name holds U+0131, such as a Turkish user name, keeps working, including when the working folder spells the root's folders in another letter case. A leading `C:` drive and `\\?\` paths are unchanged. Re-lands the two refusals unique to closed #2928.
81
+ - Work Mesh company reporting enforcement now requires the `work-mesh-company-reporting-required` HQ flag to be confirmed on. While it is off or unavailable, member reporting switches remain effective pending the company notice. Fleet agents (the fleet-local and agents-v2 adapters) are not held: their company sessions keep reporting as before.
82
+ - Work Mesh: the fleet-agent exemption from the company reporting hold is recorded per session. A fleet-local bot that shares a member's home keeps reporting while the member has HQ Anywhere off, `hq daemon disable mesh` is refused while such a session is recent, and a fleet process no longer releases a member's held events. A fleet agent's own session (the one its environment names) is exempt as before, with or without the record.
83
+ - Work Mesh: correction to the `hq mesh context organize --cancel` note on the project hint. Dropping the project hint stops the stored hint from binding the cancelled project again; a session whose next prompt comes from the project's folder, or that has `HQ_SPAWN_PROJECT` or a session meta file naming the project, still binds it.
84
+ - Work Mesh: `hq mesh context organize --cancel` (and `--settle`) no longer drops a company session's company. A session waiting for its project stays `needs_project`, so it keeps counting as company work. A session whose company was only the device default, or is reported by another actor, keeps that marker, so it still does not count as company work.
85
+ - Work Mesh: `hq mesh context organize --cancel` (and `--settle`) now keeps the rest of the session when it drops the project and task, including its binding episode, so the session's later events still carry it. What described the dropped project goes with it: the pending project choice (so the session's events are sent instead of being held for a choice that is no longer asked), a trusted project bind (so a later PRD edit can bind the session again), and the project hint (so the next prompt does not bind the project that was just cancelled).
86
+
87
+ ## [5.345.245] — 2026-11-21
88
+ - `hq sync-core reconcile` no longer says the current sync "will apply" the deletes the new sync engine held when a vault switches back. Nothing from the hold is passed to the current sync: it decides each path again from its own journal and its own delete checks, and may apply those deletes or keep the files. The log line now says so.
89
+ - When `hq sync-core reconcile` hands a vault back from the new sync engine to the current sync, the deletes the engine was holding for a person to approve are now listed in `~/.hq/sync-core/handback-keep.json`. A current sync from an hq-cloud release that includes indigoai-us/hq-cloud#1152 keeps those files on both sides instead of applying the deletes: a missing local file downloads again, and a local file whose vault copy is gone stays. A path leaves the list only after a later signal, such as the user deleting the restored file again. The hand-back log line now says this instead of "the current sync will apply them". An older current sync ignores the list.
90
+ - Updates the bundled HQ Cloud to 6.18.120. When HQ hands a vault back from the new sync engine to the older sync, the older sync no longer applies the deletes the engine was holding for you to approve. It keeps every path listed in `~/.hq/sync-core/handback-keep.json`: the server copy stays, and downloads again if the local file is missing, and the local copy stays when the server copy is already gone. Without that file, sync behaves as before. A held file that was deleted in the vault from another machine can come back after a hand-back; delete it again to remove it everywhere.
91
+
5
92
  ## [5.345.244] — 2026-11-20
6
93
  - Fixed: `hq bot create --kind company --company <slug>` now files the bot as a company bot. Its `personal/workers/<name>/worker.yaml` says `type: CompanyBot`, `company: <slug>` and a company description, and its `persona.md` says it is a company bot that acts as itself, with its own permissions, only in its company's context. Before, both files described the owner's personal bot. `hq bot adopt` and `hq bot restore` label a rebuilt company bot the same way. `hq bot create --json` and `hq bot list --json` report a one-company bot's company in `companySlug` instead of `null`, the HQ Fleet Runtime instructions bind its turns to that company, and its promotion snapshot carries the company, so the cloud import refuses to load it into another company. Bots that already exist keep their files.
7
94
  - Fixed: `hq bot promote` now says what a pending move waits for. While HQ sets up the cloud copy it says a Codex sign-in comes next; once HQ has a device code it prints the page (https://auth.openai.com/codex/device), the code and when the code expires. `--json` carries the same as a new `signIn` field (`type: "codex-device-sign-in"`, `status`, `url`, `code`, `capturedAt`, `expiresAt`, `instruction`), and no longer passes on an expired code as `pairing`. In a terminal the command keeps waiting: it checks every 30 seconds, shows the new code when one expires, rides out a few failed checks, and stops when the move finishes, when HQ reports a failure, when the move is cancelled (it never starts a new one), or after an hour. Ctrl-C stops waiting and leaves the move running. `--company` now takes the company's slug (e.g. `--company indigo`) as well as its uid; a company bot's slug must be one of its own companies. The help says so.
@@ -3211,7 +3211,7 @@ export declare const COMMAND_CATALOG: readonly [{
3211
3211
  readonly subcommands: readonly [];
3212
3212
  }, {
3213
3213
  readonly name: "delete";
3214
- readonly description: "Delete vault objects by exact key or bounded prefix. A trailing slash expands recursively; use * for an explicit wildcard prefix. Always previews the exact count first; prompts for confirmation unless --yes. Use --personal to target your own personal vault instead of a company.";
3214
+ readonly description: "Delete vault objects by exact key or bounded prefix. A trailing slash expands recursively; use * for an explicit wildcard prefix. Always previews the exact count first; prompts for confirmation unless --yes. Over 1000 objects it asks you to type a confirmation in a terminal, and --yes does not skip that. Use --personal to target your own personal vault instead of a company.";
3215
3215
  readonly aliases: readonly [];
3216
3216
  readonly hidden: false;
3217
3217
  readonly helpOption: true;
@@ -3234,7 +3234,7 @@ export declare const COMMAND_CATALOG: readonly [{
3234
3234
  readonly hidden: false;
3235
3235
  }, {
3236
3236
  readonly flags: "-y, --yes";
3237
- readonly description: "Skip the confirmation prompt (for scripts)";
3237
+ readonly description: "Skip the confirmation prompt (for scripts); not above 1000 objects";
3238
3238
  readonly hidden: false;
3239
3239
  }];
3240
3240
  readonly subcommands: readonly [];
@@ -3601,7 +3601,7 @@ export declare const COMMAND_CATALOG: readonly [{
3601
3601
  readonly hidden: false;
3602
3602
  }, {
3603
3603
  readonly flags: "--cloud-before <date>";
3604
- readonly description: "Delete old (noncurrent) cloud file versions before YYYY-MM-DD";
3604
+ readonly description: "Delete old (noncurrent) cloud file versions before YYYY-MM-DD; files deleted in the last 30 days keep their last old version";
3605
3605
  readonly hidden: false;
3606
3606
  }, {
3607
3607
  readonly flags: "--company <slug>";
@@ -5433,7 +5433,7 @@ export declare const COMMAND_CATALOG: readonly [{
5433
5433
  readonly hidden: false;
5434
5434
  }, {
5435
5435
  readonly flags: "--max-docs <n>";
5436
- readonly description: "Documents sent to claude in this run (default 20)";
5436
+ readonly description: "Documents sent to claude in this run (default 40)";
5437
5437
  readonly hidden: false;
5438
5438
  }, {
5439
5439
  readonly flags: "--dry-run";
@@ -14065,11 +14065,11 @@ export declare const COMMAND_CATALOG: readonly [{
14065
14065
  readonly hidden: false;
14066
14066
  }, {
14067
14067
  readonly flags: "--cancel";
14068
- readonly description: "Settle ask without binding (leave unresolved; never repeat)";
14068
+ readonly description: "Settle ask without binding a project (keeps the company; never repeat)";
14069
14069
  readonly hidden: false;
14070
14070
  }, {
14071
14071
  readonly flags: "--settle <reason>";
14072
- readonly description: "Settle ask: cancelled|timeout|incapable (leave unresolved)";
14072
+ readonly description: "Settle ask: cancelled|timeout|incapable (keeps the company; never repeat)";
14073
14073
  readonly hidden: false;
14074
14074
  }, {
14075
14075
  readonly flags: "--offline";
@@ -21742,6 +21742,93 @@ export declare const COMMAND_CATALOG: readonly [{
21742
21742
  readonly hidden: false;
21743
21743
  }];
21744
21744
  readonly subcommands: readonly [];
21745
+ }, {
21746
+ readonly name: "reply";
21747
+ readonly description: "Add a comment to an app as yourself, next to another comment or unanchored";
21748
+ readonly aliases: readonly [];
21749
+ readonly hidden: false;
21750
+ readonly helpOption: true;
21751
+ readonly helpCommand: false;
21752
+ readonly usage: "[options] <app>";
21753
+ readonly helpText: readonly [];
21754
+ readonly arguments: readonly [{
21755
+ readonly name: "app";
21756
+ readonly required: true;
21757
+ readonly variadic: false;
21758
+ readonly description: "";
21759
+ }];
21760
+ readonly options: readonly [{
21761
+ readonly flags: "--company <slug>";
21762
+ readonly description: "company owning the app";
21763
+ readonly hidden: false;
21764
+ }, {
21765
+ readonly flags: "--personal";
21766
+ readonly description: "use personal scope";
21767
+ readonly hidden: false;
21768
+ }, {
21769
+ readonly flags: "--text <text>";
21770
+ readonly description: "the comment text";
21771
+ readonly hidden: false;
21772
+ }, {
21773
+ readonly flags: "--text-file <path>";
21774
+ readonly description: "read the comment text from a file";
21775
+ readonly hidden: false;
21776
+ }, {
21777
+ readonly flags: "--reply-to <commentId>";
21778
+ readonly description: "place the comment at that comment's anchor";
21779
+ readonly hidden: false;
21780
+ }, {
21781
+ readonly flags: "--anchor-json <json>";
21782
+ readonly description: "anchor object to use instead (default: unanchored)";
21783
+ readonly hidden: false;
21784
+ }, {
21785
+ readonly flags: "--deploy-id <id>";
21786
+ readonly description: "the deploy the comment is about";
21787
+ readonly hidden: false;
21788
+ }, {
21789
+ readonly flags: "--json";
21790
+ readonly description: "print the created comment as JSON";
21791
+ readonly hidden: false;
21792
+ }];
21793
+ readonly subcommands: readonly [];
21794
+ }, {
21795
+ readonly name: "resolve";
21796
+ readonly description: "Mark a comment resolved, or open again with --reopen";
21797
+ readonly aliases: readonly [];
21798
+ readonly hidden: false;
21799
+ readonly helpOption: true;
21800
+ readonly helpCommand: false;
21801
+ readonly usage: "[options] <app> <commentId>";
21802
+ readonly helpText: readonly [];
21803
+ readonly arguments: readonly [{
21804
+ readonly name: "app";
21805
+ readonly required: true;
21806
+ readonly variadic: false;
21807
+ readonly description: "";
21808
+ }, {
21809
+ readonly name: "commentId";
21810
+ readonly required: true;
21811
+ readonly variadic: false;
21812
+ readonly description: "";
21813
+ }];
21814
+ readonly options: readonly [{
21815
+ readonly flags: "--company <slug>";
21816
+ readonly description: "company owning the app";
21817
+ readonly hidden: false;
21818
+ }, {
21819
+ readonly flags: "--personal";
21820
+ readonly description: "use personal scope";
21821
+ readonly hidden: false;
21822
+ }, {
21823
+ readonly flags: "--reopen";
21824
+ readonly description: "mark the comment open instead of resolved";
21825
+ readonly hidden: false;
21826
+ }, {
21827
+ readonly flags: "--json";
21828
+ readonly description: "print the updated comment as JSON";
21829
+ readonly hidden: false;
21830
+ }];
21831
+ readonly subcommands: readonly [];
21745
21832
  }];
21746
21833
  }, {
21747
21834
  readonly name: "events";
@@ -3871,7 +3871,7 @@ export const COMMAND_CATALOG = [
3871
3871
  },
3872
3872
  {
3873
3873
  "name": "delete",
3874
- "description": "Delete vault objects by exact key or bounded prefix. A trailing slash expands recursively; use * for an explicit wildcard prefix. Always previews the exact count first; prompts for confirmation unless --yes. Use --personal to target your own personal vault instead of a company.",
3874
+ "description": "Delete vault objects by exact key or bounded prefix. A trailing slash expands recursively; use * for an explicit wildcard prefix. Always previews the exact count first; prompts for confirmation unless --yes. Over 1000 objects it asks you to type a confirmation in a terminal, and --yes does not skip that. Use --personal to target your own personal vault instead of a company.",
3875
3875
  "aliases": [],
3876
3876
  "hidden": false,
3877
3877
  "helpOption": true,
@@ -3899,7 +3899,7 @@ export const COMMAND_CATALOG = [
3899
3899
  },
3900
3900
  {
3901
3901
  "flags": "-y, --yes",
3902
- "description": "Skip the confirmation prompt (for scripts)",
3902
+ "description": "Skip the confirmation prompt (for scripts); not above 1000 objects",
3903
3903
  "hidden": false
3904
3904
  }
3905
3905
  ],
@@ -4350,7 +4350,7 @@ export const COMMAND_CATALOG = [
4350
4350
  },
4351
4351
  {
4352
4352
  "flags": "--cloud-before <date>",
4353
- "description": "Delete old (noncurrent) cloud file versions before YYYY-MM-DD",
4353
+ "description": "Delete old (noncurrent) cloud file versions before YYYY-MM-DD; files deleted in the last 30 days keep their last old version",
4354
4354
  "hidden": false
4355
4355
  },
4356
4356
  {
@@ -6589,7 +6589,7 @@ export const COMMAND_CATALOG = [
6589
6589
  },
6590
6590
  {
6591
6591
  "flags": "--max-docs <n>",
6592
- "description": "Documents sent to claude in this run (default 20)",
6592
+ "description": "Documents sent to claude in this run (default 40)",
6593
6593
  "hidden": false
6594
6594
  },
6595
6595
  {
@@ -17119,12 +17119,12 @@ export const COMMAND_CATALOG = [
17119
17119
  },
17120
17120
  {
17121
17121
  "flags": "--cancel",
17122
- "description": "Settle ask without binding (leave unresolved; never repeat)",
17122
+ "description": "Settle ask without binding a project (keeps the company; never repeat)",
17123
17123
  "hidden": false
17124
17124
  },
17125
17125
  {
17126
17126
  "flags": "--settle <reason>",
17127
- "description": "Settle ask: cancelled|timeout|incapable (leave unresolved)",
17127
+ "description": "Settle ask: cancelled|timeout|incapable (keeps the company; never repeat)",
17128
17128
  "hidden": false
17129
17129
  },
17130
17130
  {
@@ -26527,6 +26527,114 @@ export const COMMAND_CATALOG = [
26527
26527
  }
26528
26528
  ],
26529
26529
  "subcommands": []
26530
+ },
26531
+ {
26532
+ "name": "reply",
26533
+ "description": "Add a comment to an app as yourself, next to another comment or unanchored",
26534
+ "aliases": [],
26535
+ "hidden": false,
26536
+ "helpOption": true,
26537
+ "helpCommand": false,
26538
+ "usage": "[options] <app>",
26539
+ "helpText": [],
26540
+ "arguments": [
26541
+ {
26542
+ "name": "app",
26543
+ "required": true,
26544
+ "variadic": false,
26545
+ "description": ""
26546
+ }
26547
+ ],
26548
+ "options": [
26549
+ {
26550
+ "flags": "--company <slug>",
26551
+ "description": "company owning the app",
26552
+ "hidden": false
26553
+ },
26554
+ {
26555
+ "flags": "--personal",
26556
+ "description": "use personal scope",
26557
+ "hidden": false
26558
+ },
26559
+ {
26560
+ "flags": "--text <text>",
26561
+ "description": "the comment text",
26562
+ "hidden": false
26563
+ },
26564
+ {
26565
+ "flags": "--text-file <path>",
26566
+ "description": "read the comment text from a file",
26567
+ "hidden": false
26568
+ },
26569
+ {
26570
+ "flags": "--reply-to <commentId>",
26571
+ "description": "place the comment at that comment's anchor",
26572
+ "hidden": false
26573
+ },
26574
+ {
26575
+ "flags": "--anchor-json <json>",
26576
+ "description": "anchor object to use instead (default: unanchored)",
26577
+ "hidden": false
26578
+ },
26579
+ {
26580
+ "flags": "--deploy-id <id>",
26581
+ "description": "the deploy the comment is about",
26582
+ "hidden": false
26583
+ },
26584
+ {
26585
+ "flags": "--json",
26586
+ "description": "print the created comment as JSON",
26587
+ "hidden": false
26588
+ }
26589
+ ],
26590
+ "subcommands": []
26591
+ },
26592
+ {
26593
+ "name": "resolve",
26594
+ "description": "Mark a comment resolved, or open again with --reopen",
26595
+ "aliases": [],
26596
+ "hidden": false,
26597
+ "helpOption": true,
26598
+ "helpCommand": false,
26599
+ "usage": "[options] <app> <commentId>",
26600
+ "helpText": [],
26601
+ "arguments": [
26602
+ {
26603
+ "name": "app",
26604
+ "required": true,
26605
+ "variadic": false,
26606
+ "description": ""
26607
+ },
26608
+ {
26609
+ "name": "commentId",
26610
+ "required": true,
26611
+ "variadic": false,
26612
+ "description": ""
26613
+ }
26614
+ ],
26615
+ "options": [
26616
+ {
26617
+ "flags": "--company <slug>",
26618
+ "description": "company owning the app",
26619
+ "hidden": false
26620
+ },
26621
+ {
26622
+ "flags": "--personal",
26623
+ "description": "use personal scope",
26624
+ "hidden": false
26625
+ },
26626
+ {
26627
+ "flags": "--reopen",
26628
+ "description": "mark the comment open instead of resolved",
26629
+ "hidden": false
26630
+ },
26631
+ {
26632
+ "flags": "--json",
26633
+ "description": "print the updated comment as JSON",
26634
+ "hidden": false
26635
+ }
26636
+ ],
26637
+ "subcommands": []
26530
26638
  }
26531
26639
  ]
26532
26640
  },
@@ -2297,7 +2297,7 @@ async function runBotResident(nameArg) {
2297
2297
  briefJobScheduled: hasScheduledBriefJob(dir),
2298
2298
  ...(signals ? { signals } : {}),
2299
2299
  sync: (syncInput) => runCompanyHotChannelSync({ hqRoot: config.hqRoot, ...syncInput }),
2300
- // A new pass per run: the login preflight and the 20-document cap are per run.
2300
+ // A new pass per run: the login preflight and the document cap are per run.
2301
2301
  // The runtime comes from the Executive bot, as on main for the wording
2302
2302
  // (defaultResolveBotRuntime) and as in `hq sources sync`: Claude Code
2303
2303
  // unless that bot is a Codex bot with signalsRuntime "bot".
@@ -139,9 +139,13 @@ export declare function companyPrefersGrok(liveRoot: string, companySlug: string
139
139
  /** True while a recent "no allowed backend" result still holds for this PATH. */
140
140
  export declare function noBackendRecentlyFound(liveRoot: string, now?: number): boolean;
141
141
  export declare function siblingArgs(backend: SpawnableBackend, prompt: string): string[];
142
+ /** Environment overrides for the supervisor's snapshot interval and kill grace (seconds, default 2). */
143
+ export declare const SIBLING_SUPERVISOR_POLL_ENV = "HQ_CHECKPOINT_SIBLING_POLL_S";
144
+ export declare const SIBLING_SUPERVISOR_GRACE_ENV = "HQ_CHECKPOINT_SIBLING_KILL_GRACE_S";
142
145
  /**
143
146
  * Supervisor for a detached sibling on POSIX. It forks the backend, records
144
- * the backend's descendant tree every 2 seconds, kills that tree after the
147
+ * the backend's descendant tree every 2 seconds (SIBLING_SUPERVISOR_POLL_ENV),
148
+ * kills that tree after the
145
149
  * wall-clock cap, and on exit terminates any recorded descendant that was
146
150
  * reparented to init. Without it, a shell command the agent started (an
147
151
  * unbounded `find workspace` was the observed case) kept running after the
@@ -1150,19 +1150,27 @@ export function siblingArgs(backend, prompt) {
1150
1150
  ];
1151
1151
  }
1152
1152
  }
1153
+ /** Environment overrides for the supervisor's snapshot interval and kill grace (seconds, default 2). */
1154
+ export const SIBLING_SUPERVISOR_POLL_ENV = "HQ_CHECKPOINT_SIBLING_POLL_S";
1155
+ export const SIBLING_SUPERVISOR_GRACE_ENV = "HQ_CHECKPOINT_SIBLING_KILL_GRACE_S";
1153
1156
  /**
1154
1157
  * Supervisor for a detached sibling on POSIX. It forks the backend, records
1155
- * the backend's descendant tree every 2 seconds, kills that tree after the
1158
+ * the backend's descendant tree every 2 seconds (SIBLING_SUPERVISOR_POLL_ENV),
1159
+ * kills that tree after the
1156
1160
  * wall-clock cap, and on exit terminates any recorded descendant that was
1157
1161
  * reparented to init. Without it, a shell command the agent started (an
1158
1162
  * unbounded `find workspace` was the observed case) kept running after the
1159
1163
  * agent exited, with PID 1 as its parent.
1160
1164
  */
1161
1165
  export const SIBLING_SUPERVISOR_SCRIPT = [
1162
- "use strict; use warnings; use POSIX qw(:sys_wait_h);",
1166
+ "use strict; use warnings; use POSIX qw(:sys_wait_h); use Time::HiRes qw(time sleep);",
1163
1167
  "my $secs = shift @ARGV;",
1168
+ // Snapshot interval and TERM-to-KILL grace, in seconds. Both default to 2;
1169
+ // tests set them shorter. Neither is passed on to the backend.
1170
+ "sub knob { my $v = $ENV{$_[0]}; return (defined $v && $v =~ /^\\d+(?:\\.\\d+)?$/ && $v > 0) ? $v : 2; }",
1171
+ `my $poll = knob('${SIBLING_SUPERVISOR_POLL_ENV}'); my $grace = knob('${SIBLING_SUPERVISOR_GRACE_ENV}');`,
1164
1172
  'my $pid = fork(); die "checkpoint sibling: fork failed\\n" unless defined $pid;',
1165
- "if ($pid == 0) { exec { $ARGV[0] } @ARGV; exit 127; }",
1173
+ `if ($pid == 0) { delete @ENV{'${SIBLING_SUPERVISOR_POLL_ENV}', '${SIBLING_SUPERVISOR_GRACE_ENV}'}; exec { $ARGV[0] } @ARGV; exit 127; }`,
1166
1174
  "my %seen;",
1167
1175
  "sub tree {",
1168
1176
  " my %kids;",
@@ -1179,11 +1187,11 @@ export const SIBLING_SUPERVISOR_SCRIPT = [
1179
1187
  " if (time >= $deadline) {",
1180
1188
  " my @d = tree(); $seen{$_} = 1 for @d;",
1181
1189
  ' print STDERR "checkpoint sibling: killed after $secs s wall-clock limit\\n";',
1182
- " kill 'TERM', @d, $pid; sleep 2;",
1190
+ " kill 'TERM', @d, $pid; sleep $grace;",
1183
1191
  " kill 'KILL', grep { kill 0, $_ } (tree(), @d, $pid);",
1184
1192
  " waitpid($pid, 0); $rc = 124 << 8; last;",
1185
1193
  " }",
1186
- " sleep 2;",
1194
+ " sleep $poll;",
1187
1195
  "}",
1188
1196
  "for my $p (keys %seen) {",
1189
1197
  " my $pp = qx{ps -o ppid= -p $p 2>/dev/null}; $pp =~ s/\\s//g;",