@indigoai-us/hq-cli 5.345.251 → 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.
- package/CHANGELOG.md +112 -0
- package/assets/scaffold/core/scripts/hq-session.sh +9 -0
- package/contracts/host-canary-release.json +9 -3
- package/dist/command-catalog.generated.d.ts +121 -1
- package/dist/command-catalog.generated.js +148 -1
- package/dist/commands/bot.js +7 -2
- package/dist/commands/core-bucket-c-work-mesh-offer-native.js +1 -1
- package/dist/commands/core-hq-session-binding.d.ts +140 -0
- package/dist/commands/core-hq-session-binding.js +363 -0
- package/dist/commands/core-hq-session-native.d.ts +23 -0
- package/dist/commands/core-hq-session-native.js +59 -9
- package/dist/commands/core-stop-autosave.js +1 -1
- package/dist/commands/core.js +10 -0
- package/dist/commands/doctor.d.ts +5 -1
- package/dist/commands/doctor.js +42 -5
- package/dist/commands/files.js +1 -1
- package/dist/commands/install-global.js +4 -2
- package/dist/commands/logout.js +4 -0
- package/dist/commands/ontology-graph.d.ts +2 -0
- package/dist/commands/ontology-graph.js +33 -0
- package/dist/commands/report.js +35 -2
- package/dist/commands/storage-gate.js +1 -1
- package/dist/commands/vault-retention-flag.js +2 -1
- package/dist/commands/whoami.js +1 -1
- package/dist/hq-cloud-sync-runner/bin/sync-runner.js +238 -221
- package/dist/hq-cloud-sync-runner/package.json +1 -1
- package/dist/index.js +3 -1
- package/dist/lib/agent-kit/inbox-poll-backoff-flag.js +1 -1
- package/dist/lib/agent-kit/mcp/tools.js +48 -0
- package/dist/lib/bot/fleet-bots-update-pass.js +1 -1
- package/dist/lib/bot/fleet-cron.d.ts +35 -0
- package/dist/lib/bot/fleet-cron.js +54 -12
- package/dist/lib/bot/fleet-local.d.ts +18 -0
- package/dist/lib/bot/fleet-local.js +51 -5
- package/dist/lib/bot/inbox-poll-backoff-flag.js +1 -1
- package/dist/lib/bot/signals-engine-flag.d.ts +1 -1
- package/dist/lib/bot/signals-engine-flag.js +1 -1
- package/dist/lib/cli-invite-nudge.js +1 -1
- package/dist/lib/client-version.d.ts +2 -0
- package/dist/lib/client-version.js +24 -0
- package/dist/lib/company-flag-gate.d.ts +30 -0
- package/dist/lib/company-flag-gate.js +104 -0
- package/dist/lib/core-utils/hook-timeout-debug-context-flag.js +1 -1
- package/dist/lib/daemon/flag.js +2 -1
- package/dist/lib/daemon/legacy-journal-gate.js +3 -1
- package/dist/lib/daemon/shared-flag-reads.js +1 -1
- package/dist/lib/doctor/checks/host-core.js +22 -4
- package/dist/lib/doctor/checks/jq.d.ts +27 -6
- package/dist/lib/doctor/checks/jq.js +46 -8
- package/dist/lib/doctor/client-health-reason-codes-flag.js +1 -1
- package/dist/lib/doctor/fix/refresh-sync-handoff.d.ts +1 -1
- package/dist/lib/doctor/fix/refresh-sync-handoff.js +1 -1
- package/dist/lib/flag-client-gate-headers.d.ts +38 -0
- package/dist/lib/flag-client-gate-headers.js +62 -0
- package/dist/lib/flag-client-headers.d.ts +15 -0
- package/dist/lib/flag-client-headers.js +25 -0
- package/dist/lib/flag-registry-worker-source.generated.d.ts +1 -1
- package/dist/lib/flag-registry-worker-source.generated.js +1 -1
- package/dist/lib/flag-registry-worker.js +35 -0
- package/dist/lib/flag-registry.d.ts +1 -20
- package/dist/lib/flag-registry.js +5 -81
- package/dist/lib/hook-engine/adapter-core-pin.d.ts +29 -0
- package/dist/lib/hook-engine/adapter-core-pin.js +29 -0
- package/dist/lib/hook-engine/coverage.d.ts +50 -1
- package/dist/lib/hook-engine/coverage.js +111 -7
- package/dist/lib/hook-engine/reconcile.js +3 -2
- package/dist/lib/hot-channels/prompts/signals-pass.md +20 -0
- package/dist/lib/hot-channels/signal-changes.d.ts +228 -0
- package/dist/lib/hot-channels/signal-changes.js +683 -0
- package/dist/lib/hot-channels/signals-pass.d.ts +24 -0
- package/dist/lib/hot-channels/signals-pass.js +232 -12
- package/dist/lib/lanes/outpost-worktree-pruner-flag.d.ts +1 -1
- package/dist/lib/lanes/outpost-worktree-pruner-flag.js +1 -1
- package/dist/lib/lanes/registry-flag.js +2 -1
- package/dist/lib/lanes/spawn.js +11 -1
- package/dist/lib/mesh/live/binding-intent.d.ts +61 -0
- package/dist/lib/mesh/live/binding-intent.js +201 -0
- package/dist/lib/mesh/live/binding-receipt.d.ts +157 -0
- package/dist/lib/mesh/live/binding-receipt.js +365 -0
- package/dist/lib/mesh/live/company-flag-refresh.js +1 -1
- package/dist/lib/mesh/live/daemon/doctor-telemetry.d.ts +39 -0
- package/dist/lib/mesh/live/daemon/doctor-telemetry.js +58 -0
- package/dist/lib/mesh/live/daemon/install.js +2 -1
- package/dist/lib/mesh/live/daemon/presence.js +9 -0
- package/dist/lib/mesh/live/daemon/run.d.ts +3 -0
- package/dist/lib/mesh/live/daemon/run.js +33 -1
- package/dist/lib/ontology-graph/lineage/index.d.ts +401 -0
- package/dist/lib/ontology-graph/lineage/index.js +1027 -0
- package/dist/lib/ontology-graph/model/index.d.ts +54 -0
- package/dist/lib/ontology-graph/model/index.js +112 -0
- package/dist/lib/ontology-graph/model/pass-tasks.d.ts +75 -0
- package/dist/lib/ontology-graph/model/pass-tasks.js +166 -0
- package/dist/lib/ontology-graph/model/pass.d.ts +6 -0
- package/dist/lib/ontology-graph/model/pass.js +9 -2
- package/dist/lib/ontology-graph/model/pending-items.d.ts +8 -0
- package/dist/lib/ontology-graph/model/pending-items.js +24 -1
- package/dist/lib/ontology-graph/model/step.d.ts +1 -1
- package/dist/lib/ontology-graph/model/tasks.d.ts +11 -3
- package/dist/lib/ontology-graph/model/tasks.js +20 -7
- package/dist/lib/ontology-graph/read/brief.js +41 -6
- package/dist/lib/ontology-graph/read/index.d.ts +4 -0
- package/dist/lib/ontology-graph/read/index.js +173 -29
- package/dist/lib/ontology-graph/read/lineage.d.ts +101 -0
- package/dist/lib/ontology-graph/read/lineage.js +262 -0
- package/dist/lib/ontology-graph/replay/buffered-store.js +17 -0
- package/dist/lib/ontology-graph/replay/engine.d.ts +32 -1
- package/dist/lib/ontology-graph/replay/engine.js +213 -8
- package/dist/lib/ontology-graph/replay/extractors.d.ts +26 -0
- package/dist/lib/ontology-graph/replay/extractors.js +25 -1
- package/dist/lib/ontology-graph/replay/index.d.ts +2 -0
- package/dist/lib/ontology-graph/replay/index.js +9 -3
- package/dist/lib/ontology-graph/replay/signal-changes.d.ts +118 -0
- package/dist/lib/ontology-graph/replay/signal-changes.js +687 -0
- package/dist/lib/ontology-graph/schema/decision-status.d.ts +18 -0
- package/dist/lib/ontology-graph/schema/decision-status.js +20 -0
- package/dist/lib/ontology-graph/schema/index.d.ts +1 -0
- package/dist/lib/ontology-graph/schema/index.js +1 -0
- package/dist/lib/ontology-graph/setup/index.js +13 -3
- package/dist/lib/search-index/index.d.ts +33 -1
- package/dist/lib/search-index/index.js +180 -25
- package/dist/lib/search-index/qmd-exit-diagnostics.d.ts +7 -0
- package/dist/lib/search-index/qmd-exit-diagnostics.js +25 -1
- package/dist/lib/signals/adapters-catalog.js +1 -1
- package/dist/lib/sync-core/engine-holds.d.ts +1 -0
- package/dist/lib/sync-core/engine-holds.js +26 -0
- package/dist/lib/sync-core/engine-home.d.ts +3 -0
- package/dist/lib/sync-core/engine-home.js +41 -1
- package/dist/lib/sync-core/flag.js +2 -1
- package/dist/lib/sync-core/legacy-journal-export-child.js +5 -3
- package/dist/lib/sync-core/legacy-journal-export.d.ts +23 -4
- package/dist/lib/sync-core/legacy-journal-export.js +120 -55
- package/dist/lib/sync-core/reconcile.d.ts +2 -1
- package/dist/lib/sync-core/reconcile.js +30 -5
- package/dist/lib/sync-invalid-entity-warning.js +2 -1
- package/dist/lib/windows/install-followup.d.ts +41 -0
- package/dist/lib/windows/install-followup.js +87 -0
- package/dist/lib/windows/jq.d.ts +59 -0
- package/dist/lib/windows/jq.js +154 -3
- package/dist/lib/windows/user-path.d.ts +5 -0
- package/dist/lib/windows/user-path.js +1 -1
- package/dist/lib/work-context/auto-bind.d.ts +12 -0
- package/dist/lib/work-context/auto-bind.js +49 -3
- package/dist/lib/work-context/organize.d.ts +4 -2
- package/dist/lib/work-context/organize.js +18 -8
- package/dist/lib/work-context/reconcile.js +16 -1
- package/dist/main.js +12 -1
- package/dist/utils/client-health-contract.d.ts +30 -0
- package/dist/utils/client-health-contract.js +111 -0
- package/dist/utils/client-health.d.ts +5 -2
- package/dist/utils/client-health.js +74 -5
- package/dist/utils/exclusive-lock.d.ts +5 -1
- package/dist/utils/exclusive-lock.js +9 -2
- package/dist/utils/host-registration.d.ts +7 -0
- package/dist/utils/host-registration.js +10 -1
- package/dist/utils/pid.d.ts +31 -0
- package/dist/utils/pid.js +65 -0
- package/dist/utils/resident-package-preload.js +12 -4
- package/dist/utils/sentry-fingerprint.js +3 -0
- package/package.json +8 -8
- package/scripts/install-hook-engine.mjs +5 -3
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,118 @@
|
|
|
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
|
+
|
|
5
117
|
## [5.345.251] — 2026-11-23
|
|
6
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.
|
|
7
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.
|
|
@@ -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.
|
|
3
|
+
"cliVersion": "5.345.252",
|
|
4
4
|
"hosts": {
|
|
5
5
|
"claude": [
|
|
6
6
|
{
|
|
7
7
|
"passed": true,
|
|
8
|
-
"at": "2026-11-
|
|
9
|
-
"engineVersion": "0.3.1+hq.5.345.
|
|
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
|
}
|
|
@@ -6006,6 +6006,126 @@ export declare const COMMAND_CATALOG: readonly [{
|
|
|
6006
6006
|
readonly hidden: false;
|
|
6007
6007
|
}];
|
|
6008
6008
|
readonly subcommands: readonly [];
|
|
6009
|
+
}, {
|
|
6010
|
+
readonly name: "lineage";
|
|
6011
|
+
readonly description: "Decision lineage: which decision replaced an earlier one";
|
|
6012
|
+
readonly aliases: readonly [];
|
|
6013
|
+
readonly hidden: false;
|
|
6014
|
+
readonly helpOption: true;
|
|
6015
|
+
readonly helpCommand: true;
|
|
6016
|
+
readonly usage: "[options] [command]";
|
|
6017
|
+
readonly helpText: readonly [];
|
|
6018
|
+
readonly arguments: readonly [];
|
|
6019
|
+
readonly options: readonly [];
|
|
6020
|
+
readonly subcommands: readonly [{
|
|
6021
|
+
readonly name: "backfill";
|
|
6022
|
+
readonly description: "Ask the model, day by day from the oldest, whether each decision with no stated change replaces or reverses an earlier open one, and write a link for each that holds (model authority, no status row; each written link is listed in .state/lineage-backfill.jsonl, and `hq ontology lineage undo` removes exactly those). A day with a decision that got no usable reply is not written: the next run sends it again, and after 3 runs it is recorded as unanswered. Exit code 2 when the walk stopped early, 3 when it finished with a decision unanswered in this run. Runs whenever it is invoked, whatever model_tasks says";
|
|
6023
|
+
readonly aliases: readonly [];
|
|
6024
|
+
readonly hidden: false;
|
|
6025
|
+
readonly helpOption: true;
|
|
6026
|
+
readonly helpCommand: false;
|
|
6027
|
+
readonly usage: "[options]";
|
|
6028
|
+
readonly helpText: readonly [];
|
|
6029
|
+
readonly arguments: readonly [];
|
|
6030
|
+
readonly options: readonly [{
|
|
6031
|
+
readonly flags: "--company <slug>";
|
|
6032
|
+
readonly description: "company whose graph to use";
|
|
6033
|
+
readonly hidden: false;
|
|
6034
|
+
}, {
|
|
6035
|
+
readonly flags: "--hq-root <path>";
|
|
6036
|
+
readonly description: "HQ installation to operate on";
|
|
6037
|
+
readonly hidden: false;
|
|
6038
|
+
}, {
|
|
6039
|
+
readonly flags: "--graph-root <path>";
|
|
6040
|
+
readonly description: "graph folder to use instead of companies/<slug>/.hq/ontology-graph (env HQ_ONTOLOGY_GRAPH_ROOT)";
|
|
6041
|
+
readonly hidden: false;
|
|
6042
|
+
}, {
|
|
6043
|
+
readonly flags: "--member <person uid>";
|
|
6044
|
+
readonly description: "member the graph is built or read for (env HQ_ONTOLOGY_MEMBER)";
|
|
6045
|
+
readonly hidden: false;
|
|
6046
|
+
}, {
|
|
6047
|
+
readonly flags: "--audience-key <key>";
|
|
6048
|
+
readonly description: "audience key the member holds; repeat for more (env HQ_ONTOLOGY_AUDIENCE_KEYS, comma-separated)";
|
|
6049
|
+
readonly hidden: false;
|
|
6050
|
+
}, {
|
|
6051
|
+
readonly flags: "--json";
|
|
6052
|
+
readonly description: "print JSON";
|
|
6053
|
+
readonly hidden: false;
|
|
6054
|
+
}, {
|
|
6055
|
+
readonly flags: "--from <date>";
|
|
6056
|
+
readonly description: "first decision day to ask about (YYYY-MM-DD)";
|
|
6057
|
+
readonly hidden: false;
|
|
6058
|
+
}, {
|
|
6059
|
+
readonly flags: "--to <date>";
|
|
6060
|
+
readonly description: "last decision day to ask about (YYYY-MM-DD)";
|
|
6061
|
+
readonly hidden: false;
|
|
6062
|
+
}, {
|
|
6063
|
+
readonly flags: "--restart";
|
|
6064
|
+
readonly description: "forget what earlier runs settled, their attempt counts and their unanswered decisions, and walk from the first day; answers already given cost nothing";
|
|
6065
|
+
readonly hidden: false;
|
|
6066
|
+
}, {
|
|
6067
|
+
readonly flags: "--retry-unanswered";
|
|
6068
|
+
readonly description: "send the decisions earlier runs recorded as unanswered again";
|
|
6069
|
+
readonly hidden: false;
|
|
6070
|
+
}, {
|
|
6071
|
+
readonly flags: "--allow-unanswered";
|
|
6072
|
+
readonly description: "record a decision with no usable reply as unanswered at once instead of holding its day for the next run, and do not exit non-zero for it";
|
|
6073
|
+
readonly hidden: false;
|
|
6074
|
+
}, {
|
|
6075
|
+
readonly flags: "--max-input-tokens <n>";
|
|
6076
|
+
readonly description: "model input tokens allowed per day for this run, counting the day's earlier runs (default 150000)";
|
|
6077
|
+
readonly hidden: false;
|
|
6078
|
+
}, {
|
|
6079
|
+
readonly flags: "--max-output-tokens <n>";
|
|
6080
|
+
readonly description: "model output tokens allowed per day for this run (default 20000)";
|
|
6081
|
+
readonly hidden: false;
|
|
6082
|
+
}, {
|
|
6083
|
+
readonly flags: "--dry-run";
|
|
6084
|
+
readonly description: "count the decisions and batches and estimate the tokens and the list-price cost as ranges, with the flags that let the estimate through the daily cap; call no model and write nothing";
|
|
6085
|
+
readonly hidden: false;
|
|
6086
|
+
}];
|
|
6087
|
+
readonly subcommands: readonly [];
|
|
6088
|
+
}, {
|
|
6089
|
+
readonly name: "undo";
|
|
6090
|
+
readonly description: "Take back what `hq ontology lineage backfill` wrote: remove the rows .state/lineage-backfill.jsonl lists (each link's edge and its inverse) and clear the walk's state, so a later backfill starts from the first day. A row is removed only when the graph still holds it as the backfill wrote it; a row changed since is left and counted. No other row is touched, and no model is called";
|
|
6091
|
+
readonly aliases: readonly [];
|
|
6092
|
+
readonly hidden: false;
|
|
6093
|
+
readonly helpOption: true;
|
|
6094
|
+
readonly helpCommand: false;
|
|
6095
|
+
readonly usage: "[options]";
|
|
6096
|
+
readonly helpText: readonly [];
|
|
6097
|
+
readonly arguments: readonly [];
|
|
6098
|
+
readonly options: readonly [{
|
|
6099
|
+
readonly flags: "--company <slug>";
|
|
6100
|
+
readonly description: "company whose graph to use";
|
|
6101
|
+
readonly hidden: false;
|
|
6102
|
+
}, {
|
|
6103
|
+
readonly flags: "--hq-root <path>";
|
|
6104
|
+
readonly description: "HQ installation to operate on";
|
|
6105
|
+
readonly hidden: false;
|
|
6106
|
+
}, {
|
|
6107
|
+
readonly flags: "--graph-root <path>";
|
|
6108
|
+
readonly description: "graph folder to use instead of companies/<slug>/.hq/ontology-graph (env HQ_ONTOLOGY_GRAPH_ROOT)";
|
|
6109
|
+
readonly hidden: false;
|
|
6110
|
+
}, {
|
|
6111
|
+
readonly flags: "--member <person uid>";
|
|
6112
|
+
readonly description: "member the graph is built or read for (env HQ_ONTOLOGY_MEMBER)";
|
|
6113
|
+
readonly hidden: false;
|
|
6114
|
+
}, {
|
|
6115
|
+
readonly flags: "--audience-key <key>";
|
|
6116
|
+
readonly description: "audience key the member holds; repeat for more (env HQ_ONTOLOGY_AUDIENCE_KEYS, comma-separated)";
|
|
6117
|
+
readonly hidden: false;
|
|
6118
|
+
}, {
|
|
6119
|
+
readonly flags: "--json";
|
|
6120
|
+
readonly description: "print JSON";
|
|
6121
|
+
readonly hidden: false;
|
|
6122
|
+
}, {
|
|
6123
|
+
readonly flags: "--dry-run";
|
|
6124
|
+
readonly description: "count what would be removed and left; write nothing";
|
|
6125
|
+
readonly hidden: false;
|
|
6126
|
+
}];
|
|
6127
|
+
readonly subcommands: readonly [];
|
|
6128
|
+
}];
|
|
6009
6129
|
}, {
|
|
6010
6130
|
readonly name: "lookup";
|
|
6011
6131
|
readonly description: "Find an entity by name and print its facts, each with a source and date";
|
|
@@ -14397,7 +14517,7 @@ export declare const COMMAND_CATALOG: readonly [{
|
|
|
14397
14517
|
readonly hidden: false;
|
|
14398
14518
|
}, {
|
|
14399
14519
|
readonly flags: "--fix-jq";
|
|
14400
|
-
readonly description: "Install the verified jq required by HQ hooks on Windows.";
|
|
14520
|
+
readonly description: "Install the verified jq required by HQ hooks on Windows, add it to your PATH, and check it.";
|
|
14401
14521
|
readonly hidden: false;
|
|
14402
14522
|
}, {
|
|
14403
14523
|
readonly flags: "--client-health-report";
|
|
@@ -7304,6 +7304,153 @@ export const COMMAND_CATALOG = [
|
|
|
7304
7304
|
],
|
|
7305
7305
|
"subcommands": []
|
|
7306
7306
|
},
|
|
7307
|
+
{
|
|
7308
|
+
"name": "lineage",
|
|
7309
|
+
"description": "Decision lineage: which decision replaced an earlier one",
|
|
7310
|
+
"aliases": [],
|
|
7311
|
+
"hidden": false,
|
|
7312
|
+
"helpOption": true,
|
|
7313
|
+
"helpCommand": true,
|
|
7314
|
+
"usage": "[options] [command]",
|
|
7315
|
+
"helpText": [],
|
|
7316
|
+
"arguments": [],
|
|
7317
|
+
"options": [],
|
|
7318
|
+
"subcommands": [
|
|
7319
|
+
{
|
|
7320
|
+
"name": "backfill",
|
|
7321
|
+
"description": "Ask the model, day by day from the oldest, whether each decision with no stated change replaces or reverses an earlier open one, and write a link for each that holds (model authority, no status row; each written link is listed in .state/lineage-backfill.jsonl, and `hq ontology lineage undo` removes exactly those). A day with a decision that got no usable reply is not written: the next run sends it again, and after 3 runs it is recorded as unanswered. Exit code 2 when the walk stopped early, 3 when it finished with a decision unanswered in this run. Runs whenever it is invoked, whatever model_tasks says",
|
|
7322
|
+
"aliases": [],
|
|
7323
|
+
"hidden": false,
|
|
7324
|
+
"helpOption": true,
|
|
7325
|
+
"helpCommand": false,
|
|
7326
|
+
"usage": "[options]",
|
|
7327
|
+
"helpText": [],
|
|
7328
|
+
"arguments": [],
|
|
7329
|
+
"options": [
|
|
7330
|
+
{
|
|
7331
|
+
"flags": "--company <slug>",
|
|
7332
|
+
"description": "company whose graph to use",
|
|
7333
|
+
"hidden": false
|
|
7334
|
+
},
|
|
7335
|
+
{
|
|
7336
|
+
"flags": "--hq-root <path>",
|
|
7337
|
+
"description": "HQ installation to operate on",
|
|
7338
|
+
"hidden": false
|
|
7339
|
+
},
|
|
7340
|
+
{
|
|
7341
|
+
"flags": "--graph-root <path>",
|
|
7342
|
+
"description": "graph folder to use instead of companies/<slug>/.hq/ontology-graph (env HQ_ONTOLOGY_GRAPH_ROOT)",
|
|
7343
|
+
"hidden": false
|
|
7344
|
+
},
|
|
7345
|
+
{
|
|
7346
|
+
"flags": "--member <person uid>",
|
|
7347
|
+
"description": "member the graph is built or read for (env HQ_ONTOLOGY_MEMBER)",
|
|
7348
|
+
"hidden": false
|
|
7349
|
+
},
|
|
7350
|
+
{
|
|
7351
|
+
"flags": "--audience-key <key>",
|
|
7352
|
+
"description": "audience key the member holds; repeat for more (env HQ_ONTOLOGY_AUDIENCE_KEYS, comma-separated)",
|
|
7353
|
+
"hidden": false
|
|
7354
|
+
},
|
|
7355
|
+
{
|
|
7356
|
+
"flags": "--json",
|
|
7357
|
+
"description": "print JSON",
|
|
7358
|
+
"hidden": false
|
|
7359
|
+
},
|
|
7360
|
+
{
|
|
7361
|
+
"flags": "--from <date>",
|
|
7362
|
+
"description": "first decision day to ask about (YYYY-MM-DD)",
|
|
7363
|
+
"hidden": false
|
|
7364
|
+
},
|
|
7365
|
+
{
|
|
7366
|
+
"flags": "--to <date>",
|
|
7367
|
+
"description": "last decision day to ask about (YYYY-MM-DD)",
|
|
7368
|
+
"hidden": false
|
|
7369
|
+
},
|
|
7370
|
+
{
|
|
7371
|
+
"flags": "--restart",
|
|
7372
|
+
"description": "forget what earlier runs settled, their attempt counts and their unanswered decisions, and walk from the first day; answers already given cost nothing",
|
|
7373
|
+
"hidden": false
|
|
7374
|
+
},
|
|
7375
|
+
{
|
|
7376
|
+
"flags": "--retry-unanswered",
|
|
7377
|
+
"description": "send the decisions earlier runs recorded as unanswered again",
|
|
7378
|
+
"hidden": false
|
|
7379
|
+
},
|
|
7380
|
+
{
|
|
7381
|
+
"flags": "--allow-unanswered",
|
|
7382
|
+
"description": "record a decision with no usable reply as unanswered at once instead of holding its day for the next run, and do not exit non-zero for it",
|
|
7383
|
+
"hidden": false
|
|
7384
|
+
},
|
|
7385
|
+
{
|
|
7386
|
+
"flags": "--max-input-tokens <n>",
|
|
7387
|
+
"description": "model input tokens allowed per day for this run, counting the day's earlier runs (default 150000)",
|
|
7388
|
+
"hidden": false
|
|
7389
|
+
},
|
|
7390
|
+
{
|
|
7391
|
+
"flags": "--max-output-tokens <n>",
|
|
7392
|
+
"description": "model output tokens allowed per day for this run (default 20000)",
|
|
7393
|
+
"hidden": false
|
|
7394
|
+
},
|
|
7395
|
+
{
|
|
7396
|
+
"flags": "--dry-run",
|
|
7397
|
+
"description": "count the decisions and batches and estimate the tokens and the list-price cost as ranges, with the flags that let the estimate through the daily cap; call no model and write nothing",
|
|
7398
|
+
"hidden": false
|
|
7399
|
+
}
|
|
7400
|
+
],
|
|
7401
|
+
"subcommands": []
|
|
7402
|
+
},
|
|
7403
|
+
{
|
|
7404
|
+
"name": "undo",
|
|
7405
|
+
"description": "Take back what `hq ontology lineage backfill` wrote: remove the rows .state/lineage-backfill.jsonl lists (each link's edge and its inverse) and clear the walk's state, so a later backfill starts from the first day. A row is removed only when the graph still holds it as the backfill wrote it; a row changed since is left and counted. No other row is touched, and no model is called",
|
|
7406
|
+
"aliases": [],
|
|
7407
|
+
"hidden": false,
|
|
7408
|
+
"helpOption": true,
|
|
7409
|
+
"helpCommand": false,
|
|
7410
|
+
"usage": "[options]",
|
|
7411
|
+
"helpText": [],
|
|
7412
|
+
"arguments": [],
|
|
7413
|
+
"options": [
|
|
7414
|
+
{
|
|
7415
|
+
"flags": "--company <slug>",
|
|
7416
|
+
"description": "company whose graph to use",
|
|
7417
|
+
"hidden": false
|
|
7418
|
+
},
|
|
7419
|
+
{
|
|
7420
|
+
"flags": "--hq-root <path>",
|
|
7421
|
+
"description": "HQ installation to operate on",
|
|
7422
|
+
"hidden": false
|
|
7423
|
+
},
|
|
7424
|
+
{
|
|
7425
|
+
"flags": "--graph-root <path>",
|
|
7426
|
+
"description": "graph folder to use instead of companies/<slug>/.hq/ontology-graph (env HQ_ONTOLOGY_GRAPH_ROOT)",
|
|
7427
|
+
"hidden": false
|
|
7428
|
+
},
|
|
7429
|
+
{
|
|
7430
|
+
"flags": "--member <person uid>",
|
|
7431
|
+
"description": "member the graph is built or read for (env HQ_ONTOLOGY_MEMBER)",
|
|
7432
|
+
"hidden": false
|
|
7433
|
+
},
|
|
7434
|
+
{
|
|
7435
|
+
"flags": "--audience-key <key>",
|
|
7436
|
+
"description": "audience key the member holds; repeat for more (env HQ_ONTOLOGY_AUDIENCE_KEYS, comma-separated)",
|
|
7437
|
+
"hidden": false
|
|
7438
|
+
},
|
|
7439
|
+
{
|
|
7440
|
+
"flags": "--json",
|
|
7441
|
+
"description": "print JSON",
|
|
7442
|
+
"hidden": false
|
|
7443
|
+
},
|
|
7444
|
+
{
|
|
7445
|
+
"flags": "--dry-run",
|
|
7446
|
+
"description": "count what would be removed and left; write nothing",
|
|
7447
|
+
"hidden": false
|
|
7448
|
+
}
|
|
7449
|
+
],
|
|
7450
|
+
"subcommands": []
|
|
7451
|
+
}
|
|
7452
|
+
]
|
|
7453
|
+
},
|
|
7307
7454
|
{
|
|
7308
7455
|
"name": "lookup",
|
|
7309
7456
|
"description": "Find an entity by name and print its facts, each with a source and date",
|
|
@@ -17533,7 +17680,7 @@ export const COMMAND_CATALOG = [
|
|
|
17533
17680
|
},
|
|
17534
17681
|
{
|
|
17535
17682
|
"flags": "--fix-jq",
|
|
17536
|
-
"description": "Install the verified jq required by HQ hooks on Windows.",
|
|
17683
|
+
"description": "Install the verified jq required by HQ hooks on Windows, add it to your PATH, and check it.",
|
|
17537
17684
|
"hidden": false
|
|
17538
17685
|
},
|
|
17539
17686
|
{
|
package/dist/commands/bot.js
CHANGED
|
@@ -95,6 +95,7 @@ import { gatedInteractiveLogin } from "../utils/interactive-caller.js";
|
|
|
95
95
|
import { brainSignInStatus, fleetInstallProgressReporter, fleetRuntimeStatus, runBotAuthStatus, runBotRuntimeInstall, runBotRuntimeStatus, runBotSignIn } from "./bot-runtime.js";
|
|
96
96
|
import { ensureFleetRuntimeInstalled } from "../lib/bot/fleet-local.js";
|
|
97
97
|
import { installFleetRuntimeSources, installOptionalFleetRuntimeSources } from "../lib/bot/fleet-runtime-sources.js";
|
|
98
|
+
import { signalPid } from "../utils/pid.js";
|
|
98
99
|
function collectRepeated(value, previous) {
|
|
99
100
|
return [...previous, value];
|
|
100
101
|
}
|
|
@@ -259,11 +260,15 @@ async function syncFleetRuntimeJobs(name, dir, config) {
|
|
|
259
260
|
if (migrated) {
|
|
260
261
|
const movedCount = migrated.imported;
|
|
261
262
|
const moved = `moved ${movedCount} scheduled job${movedCount === 1 ? "" : "s"} into the HQ Fleet Runtime${migrated.alreadyPresent ? ` (${migrated.alreadyPresent} already there)` : ""}`;
|
|
263
|
+
for (const { jobId, note } of migrated.notes ?? [])
|
|
264
|
+
log("info", `scheduled job ${jobId}: ${note}`);
|
|
262
265
|
if (migrated.skipped.length === 0) {
|
|
263
266
|
log("info", `${moved}; the old list is kept at ${migrated.renamedTo}`);
|
|
264
267
|
}
|
|
265
268
|
else {
|
|
266
|
-
const
|
|
269
|
+
const reasons = new Map((migrated.skippedReasons ?? []).map((entry) => [entry.jobId, entry.reason]));
|
|
270
|
+
const each = migrated.skipped.map((jobId) => `${jobId} (${reasons.get(jobId) ?? "the HQ Fleet Runtime cannot run its schedule"})`).join("; ");
|
|
271
|
+
const message = `${moved}, but could not move ${migrated.skipped.length} scheduled job(s): ${each}. They are left unchanged in ${path.join(dir, "jobs.json")}, which was not renamed, and they will not run until you add them again with hq bot jobs --add using a schedule the runtime supports.`;
|
|
267
272
|
log("warn", message);
|
|
268
273
|
console.warn(`Warning: ${name}: ${message}`);
|
|
269
274
|
}
|
|
@@ -1433,7 +1438,7 @@ async function stopBot(name, dir, config, output) {
|
|
|
1433
1438
|
const s = readBotStatus(dir);
|
|
1434
1439
|
if (s) {
|
|
1435
1440
|
try {
|
|
1436
|
-
|
|
1441
|
+
signalPid(s.pid, "SIGKILL");
|
|
1437
1442
|
}
|
|
1438
1443
|
catch {
|
|
1439
1444
|
/* ignore */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as fs from "node:fs";
|
|
2
2
|
import * as path from "node:path";
|
|
3
3
|
import { loadCachedTokens } from "@indigoai-us/hq-cloud";
|
|
4
|
-
import { createFlagClient } from "
|
|
4
|
+
import { createHqFlagClient as createFlagClient } from "../lib/flag-client-headers.js";
|
|
5
5
|
import { resolveFlagRegistryEndpoint } from "../lib/flag-registry-endpoint.js";
|
|
6
6
|
const success = (stdout) => ({ code: 0, stdout, stderr: "" });
|
|
7
7
|
const failure = (stderr) => ({ code: 1, stdout: "", stderr: `${stderr}\n` });
|