@indigoai-us/hq-cli 5.345.248 → 5.345.250

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 (79) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/contracts/host-canary-release.json +3 -3
  3. package/dist/command-catalog.generated.d.ts +93 -8
  4. package/dist/command-catalog.generated.js +114 -8
  5. package/dist/commands/core-job-run-native.js +4 -0
  6. package/dist/commands/core-knowledge-prefs.d.ts +1 -1
  7. package/dist/commands/core-knowledge-prefs.js +1 -16
  8. package/dist/commands/core.js +0 -2
  9. package/dist/commands/daemon.js +21 -0
  10. package/dist/commands/ontology-graph.d.ts +2 -1
  11. package/dist/commands/ontology-graph.js +41 -10
  12. package/dist/commands/sync-core.js +6 -0
  13. package/dist/fast-scaffold.js +1 -3
  14. package/dist/hq-cloud-sync-runner/bin/sync-runner.js +281 -256
  15. package/dist/hq-cloud-sync-runner/package.json +1 -1
  16. package/dist/index.d.ts +8 -0
  17. package/dist/index.js +47 -0
  18. package/dist/lib/daemon/installed-cli-restart.d.ts +57 -0
  19. package/dist/lib/daemon/installed-cli-restart.js +114 -0
  20. package/dist/lib/daemon/legacy-journal-gate.d.ts +32 -0
  21. package/dist/lib/daemon/legacy-journal-gate.js +102 -0
  22. package/dist/lib/daemon/machine-checks.d.ts +7 -0
  23. package/dist/lib/daemon/machine-checks.js +10 -0
  24. package/dist/lib/daemon/run.d.ts +3 -1
  25. package/dist/lib/daemon/run.js +48 -5
  26. package/dist/lib/flag-registry-worker-source.generated.d.ts +1 -1
  27. package/dist/lib/flag-registry-worker-source.generated.js +1 -1
  28. package/dist/lib/hook-engine/coverage.d.ts +82 -13
  29. package/dist/lib/hook-engine/coverage.js +214 -18
  30. package/dist/lib/hook-engine/registration-identity.d.ts +5 -0
  31. package/dist/lib/hook-engine/registration-identity.js +1 -1
  32. package/dist/lib/hook-engine/resolve.d.ts +23 -0
  33. package/dist/lib/hook-engine/resolve.js +48 -1
  34. package/dist/lib/hook-engine/stable-heal.d.ts +87 -0
  35. package/dist/lib/hook-engine/stable-heal.js +214 -0
  36. package/dist/lib/hot-channels/graph-context.js +4 -1
  37. package/dist/lib/ontology-graph/model/step.d.ts +2 -0
  38. package/dist/lib/ontology-graph/model/step.js +3 -0
  39. package/dist/lib/ontology-graph/org/derive.d.ts +2 -0
  40. package/dist/lib/ontology-graph/org/derive.js +9 -2
  41. package/dist/lib/ontology-graph/org/index.d.ts +35 -6
  42. package/dist/lib/ontology-graph/org/index.js +136 -19
  43. package/dist/lib/ontology-graph/org/text.d.ts +2 -0
  44. package/dist/lib/ontology-graph/org/text.js +6 -0
  45. package/dist/lib/ontology-graph/org/types.d.ts +5 -0
  46. package/dist/lib/ontology-graph/pages/render.d.ts +2 -0
  47. package/dist/lib/ontology-graph/pages/render.js +10 -4
  48. package/dist/lib/ontology-graph/read/brief.js +4 -1
  49. package/dist/lib/ontology-graph/read/index.js +13 -2
  50. package/dist/lib/ontology-graph/read/names.d.ts +6 -1
  51. package/dist/lib/ontology-graph/read/names.js +8 -3
  52. package/dist/lib/ontology-graph/replay/engine.d.ts +47 -1
  53. package/dist/lib/ontology-graph/replay/engine.js +68 -2
  54. package/dist/lib/ontology-graph/replay/index.d.ts +2 -1
  55. package/dist/lib/ontology-graph/replay/index.js +1 -1
  56. package/dist/lib/ontology-graph/schema/authority.d.ts +34 -0
  57. package/dist/lib/ontology-graph/schema/authority.js +29 -0
  58. package/dist/lib/ontology-graph/schema/index.d.ts +1 -1
  59. package/dist/lib/ontology-graph/schema/index.js +1 -1
  60. package/dist/lib/ontology-graph/types.d.ts +7 -0
  61. package/dist/lib/sync-core/engine-holds.d.ts +1 -1
  62. package/dist/lib/sync-core/engine-holds.js +12 -2
  63. package/dist/lib/sync-core/hand-back.d.ts +2 -1
  64. package/dist/lib/sync-core/hand-back.js +16 -2
  65. package/dist/lib/sync-core/legacy-journal-export-child.d.ts +2 -0
  66. package/dist/lib/sync-core/legacy-journal-export-child.js +24 -0
  67. package/dist/lib/sync-core/legacy-journal-export.d.ts +39 -0
  68. package/dist/lib/sync-core/legacy-journal-export.js +241 -0
  69. package/dist/lib/sync-core/legacy-journal-reader.d.ts +15 -0
  70. package/dist/lib/sync-core/legacy-journal-reader.js +56 -0
  71. package/dist/lib/sync-core/reconcile.d.ts +3 -0
  72. package/dist/lib/sync-core/reconcile.js +43 -3
  73. package/dist/utils/cli-telemetry.d.ts +1 -0
  74. package/dist/utils/cli-telemetry.js +6 -3
  75. package/dist/utils/hook-engine-rollup.d.ts +96 -0
  76. package/dist/utils/hook-engine-rollup.js +725 -0
  77. package/package.json +8 -8
  78. package/scripts/install-hook-engine.mjs +4 -0
  79. package/assets/scaffold/core/scripts/knowledge-prefs.sh +0 -55
package/CHANGELOG.md CHANGED
@@ -2,6 +2,47 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [5.345.250] — 2026-11-23
6
+ - Internal: the batch train runner (`scripts/ci/batch-train.py`) is committed with tests. When main moves outside the train after part of a batch has merged, the runner re-reads main and builds a fresh train for the pull requests that did not merge, instead of stopping on the old main. Every pull request that drops out of a train build, for example on a merge conflict, is logged with its reason.
7
+ - Internal: `hq-hook PR tests` now runs on same-repository draft pull requests that change the hook crate, on the same Mac pool runners a ready pull request uses, following the owner's 2026-11-21 draft rule in ci.yml. Fork drafts, `HQ_DRAFT_PR_CI=off`, `HQ_MAC_RUNNERS=off` and the `ci-hosted-runners` label still skip it, so a draft never runs on a GitHub-hosted runner. Before this, a draft such as hq-cli #3490 had no Rust checks until it was marked ready.
8
+ - Internal: `hq-hook PR tests` now runs Windows Clippy on the team's self-hosted Windows runner for same-repo pull requests that change the hook crate, plus the Windows hook tests the diff touches (scripts/ci/hq-hook-windows-test-scope.mjs). A manual run of `hq-hook` takes a `platforms` choice (linux, windows, macos, all): `windows` runs the full Windows suite and starts no macOS job.
9
+ - Fixed: the scaffold bundle freshness check passes again. The scaffold manifest still listed `knowledge-prefs.sh` after its bundled copy was retired, so the check failed on main and on the 5.345.249 tag.
10
+ - Fixed: the daemon now restarts itself onto a newer hq CLI that the desktop app, `hq update` or npm installed, even when its updater is turned off. A daemon already stuck on an older release is restarted by the first service it starts from the new CLI, with no manual step. Before, a daemon could keep running an old release for days, so fixes such as the lanes reconcile repair in 5.345.246 never took effect and `hq daemon status` kept showing "last run failed".
11
+ - Added: the HQ daemon sends a daily count of hook-engine failures (fallbacks, mismatches, script mismatches, host-guard refusals, bad exit codes, timeouts, dispatch failures, run denies and run faults) from `~/.hq/logs/hook-engine.jsonl`. It runs on the daemon's hourly machine-check timer, only while that schedule is on, and sends the rows of completed UTC days from the last seven days, reading at most 16 MiB of log and sending at most 500 groups per run; groups over that limit are dropped. Each event carries the UTC day it counts, a consent basis, an idempotency key (a random id for the run, the day and a counter) and the group's values. Every value is a closed label, a count, a timing, an exit code, a timed-out flag, the engine version or the HQ release number: no hashes, paths, row text, free-text reasons, custom hook names or company ids leave the machine. On each tick it reads `HQ_TELEMETRY` from the daemon's own environment, the sign-in and the person's telemetry choice. If `HQ_TELEMETRY` is off, nobody is signed in or the person has not opted in, the rows logged up to that tick are dropped. If a different person is signed in, or the saved state has no usable time for the last tick that confirmed the opt-in, it starts again from the end of the log. If no tick confirmed the same person's opt-in for more than two hours and fifteen minutes (a stopped or sleeping machine, the schedule being off, answers that could not be read), the rows whose own time falls after the last confirming tick and up to the current one are dropped, and rows from before it are still sent, so a laptop that sleeps overnight keeps the day it logged before sleeping. Rows without a readable time are never sent. A telemetry choice or a sign-in that changes and changes back between two ticks inside that window is not seen. A send that fails with a retryable answer is retried with the same events on a later tick, with no limit on how long, so a batch that waits can be older than seven days when it goes out; a batch the server rejects is dropped. An agent machine needs no opt-in and marks its rows `agent-required`; a person's rows are marked `opted-in`. The log's place is kept by its exact file id, so it also works on Windows volumes whose file ids are larger than a JavaScript safe integer.
12
+ - After an update, the first `hq` command now re-runs `hq reindex` in the background for each HQ root that uses the new hook core. This moves `~/.hq/bin/hq-hook/stable` to the newly installed engine only through the same host canary gate and checks a manual reindex applies, so `hq doctor` no longer fails after every update until someone runs `hq reindex` by hand. The installer itself moves nothing; it says that the next command will finish the job.
13
+ - Changed: on Apple-silicon Macs, this release ships a passing Claude Code host canary for its own hq-hook build, so with core.next on, `hq reindex` keeps Claude Code on the new hook engine after updating, on HQ roots whose hq-core gate matches (hq-core 16.0.50). Codex, Grok Build, Intel Macs and Linux stay on the old hooks in this release.
14
+ - Changed: the host canary record shipped with the CLI is refreshed for this release build.
15
+ - `hq ontology activity [<person>]` shows what each person does, from behavior in
16
+ the ontology graph: kinds of work with counts, what they ship and own, who they
17
+ work with and how that changed over time. It replaces `hq ontology org
18
+ observed|compare|person` as the visible command; the old names still work.
19
+ Role lines and who appears to direct whom are now shown only with `--roles`,
20
+ and the stated-versus-observed comparison only with `--compare`. Commits to a
21
+ repository named for marketing or design count as that work, and an action
22
+ item filed under a speaker label such as "Host" is no longer counted for a
23
+ person.
24
+ - `hq ontology lookup` no longer lists a role title or an affiliation that a
25
+ model wrote with confidence below 0.70. It prints how many such rows it left
26
+ out and tells the reader to check the sources, and `--json` carries the count
27
+ as `leftOutGuesses`. Rows from records, rules, people and the old entity
28
+ files are shown as before. The same rows are now left out of compiled entity
29
+ pages (and so `lookup --page`), the session brief and the entity list sent
30
+ with a signals document, and they no longer take the place of an established
31
+ value for the same field. `lookup` and the signals entity list also leave out
32
+ an employer relationship a model wrote below 0.70. A page counts what it left
33
+ out as `unconfirmed_model_guesses_left_out`.
34
+ - `hq ontology update` takes `--max-input-tokens <n>` and `--max-output-tokens <n>`
35
+ to raise the model step's cap per day for that one run. The default (150,000
36
+ input and 20,000 output tokens per model per day) is unchanged, so the
37
+ scheduled daily run behaves as before. The run summary of `rebuild` and
38
+ `update` now prints the cap, what the run used, and, when the daily cap or
39
+ `--budget-tokens` stopped the run, which one and how many items are pending.
40
+ `--json` carries the same as `modelCap`.
41
+ - Changed: `hq reindex` keeps PreToolUse on the shell dispatcher on a host where the native engine claims it, when the HQ root's dispatcher files, Codex adapter or pinned PreToolUse guards are not the revisions the native engine reproduces.
42
+ - Fixed: when a vault went back from the new sync engine to the current sync while the engine was holding files it would have replaced with the vault's copies (a `mass_overwrite` hold), `hq sync-core reconcile` reported the engine's hold file as unreadable. If the same hold also held deletes, those deletes were not passed to the current sync's keep list, so the current sync could apply them. Reconcile now reads such a hold and passes its held deletes on. A kind of hold this hq does not know is skipped with a warning, and the deletes held beside it are still passed on.
43
+ - Fixed: when a company vault moves from the current sync to the new sync engine, HQ can now give the engine a copy of what the current sync last synced for each file (`legacy-journal/<slug>.json` in the vault's engine home). The engine uses it to tell an old local copy, which it should replace with the vault's file, from a local edit that was never uploaded, which it should upload, where before it treated both as conflicts. The copy is written once the current sync has let go of the company and before the engine starts; a company already on the engine gets it on the next `hq sync-core reconcile`. It is removed when the company goes back to the current sync. The journal is read with hq-cloud 6.18.122's `readJournalWithoutWrites`, which changes nothing in the current sync's state folder; this release moves the bundled hq-cloud to 6.18.122. On a machine whose daemon still runs an older hq-cloud, or if the copy cannot be made, HQ logs why and the engine runs as before.
44
+ - Run knowledge preference lookups in the CLI without bundling a second shell implementation.
45
+
5
46
  ## [5.345.248] — 2026-11-23
6
47
  - Internal: The `e2e (node 22)` gate no longer fails after two minutes while `e2e cli build artifact` is still queued. GitHub lists the e2e shards only once that build has finished, so the gate's waiter now keeps waiting for them while the build is queued or running, fails at once if the build fails, and starts its two-minute grace for missing shards when the build finishes.
7
48
  - Internal: `hq-hook PR tests` now also runs when a draft pull request is marked ready for review. Its jobs skip on drafts, so a pull request opened as a draft and marked ready without a later push never ran the hook tests, the Grok comparison or the Windows Clippy cross-check.
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "schema": "hq.host-canary-release.v1",
3
- "cliVersion": "5.345.248",
3
+ "cliVersion": "5.345.250",
4
4
  "hosts": {
5
5
  "claude": [
6
6
  {
7
7
  "passed": true,
8
- "at": "2026-11-23T03:43:08.843Z",
9
- "engineVersion": "0.3.1+hq.5.345.248.src.d4a8d681bba7bc9474778bdabd9adcb19435ce292749e0a7151a7fec61b6386b",
8
+ "at": "2026-11-23T07:39:40.796Z",
9
+ "engineVersion": "0.3.1+hq.5.345.250.src.a33e9846b38c54900ba8dde4a7cbe1f726801b015a94ffd7927de7ca01204cef",
10
10
  "gateSha256": "a2879dfe692233f5953bac86672947bbd82f3c5247292f3efcb80f16c3d2c6b1"
11
11
  }
12
12
  ]
@@ -5802,6 +5802,14 @@ export declare const COMMAND_CATALOG: readonly [{
5802
5802
  readonly flags: "--full-listing";
5803
5803
  readonly description: "list the whole corpus again instead of only new and changed files";
5804
5804
  readonly hidden: false;
5805
+ }, {
5806
+ readonly flags: "--max-input-tokens <n>";
5807
+ readonly description: "model input tokens allowed per day for this run, counting the day's earlier runs (default 150000)";
5808
+ readonly hidden: false;
5809
+ }, {
5810
+ readonly flags: "--max-output-tokens <n>";
5811
+ readonly description: "model output tokens allowed per day for this run (default 20000)";
5812
+ readonly hidden: false;
5805
5813
  }, {
5806
5814
  readonly flags: "--dry-run";
5807
5815
  readonly description: "read and count, write nothing";
@@ -6458,9 +6466,9 @@ export declare const COMMAND_CATALOG: readonly [{
6458
6466
  }];
6459
6467
  }, {
6460
6468
  readonly name: "org";
6461
- readonly description: "The org as observed from behavior in the graph, beside the stated one. Inferred, never a confirmed fact";
6469
+ readonly description: "Earlier name of `hq ontology activity`. Inferred from behavior, never a confirmed fact";
6462
6470
  readonly aliases: readonly [];
6463
- readonly hidden: false;
6471
+ readonly hidden: true;
6464
6472
  readonly helpOption: true;
6465
6473
  readonly helpCommand: true;
6466
6474
  readonly usage: "[options] [command]";
@@ -6469,7 +6477,7 @@ export declare const COMMAND_CATALOG: readonly [{
6469
6477
  readonly options: readonly [];
6470
6478
  readonly subcommands: readonly [{
6471
6479
  readonly name: "observed";
6472
- readonly description: "Print the observed org: role, areas, who appears to direct whom, groups and de facto owners. Stores nothing without --write";
6480
+ readonly description: "Same as `hq ontology activity`";
6473
6481
  readonly aliases: readonly [];
6474
6482
  readonly hidden: false;
6475
6483
  readonly helpOption: true;
@@ -6509,9 +6517,13 @@ export declare const COMMAND_CATALOG: readonly [{
6509
6517
  readonly flags: "--as-of <date>";
6510
6518
  readonly description: "the day the 30, 90 and 365 day windows end on (YYYY-MM-DD; default today)";
6511
6519
  readonly hidden: false;
6520
+ }, {
6521
+ readonly flags: "--roles";
6522
+ readonly description: "also show the inferred role line and who appears to direct whom";
6523
+ readonly hidden: false;
6512
6524
  }, {
6513
6525
  readonly flags: "--model";
6514
- readonly description: "phrase each active person's observed role with one small model call";
6526
+ readonly description: "with --roles, phrase each active person's role line with one small model call";
6515
6527
  readonly hidden: false;
6516
6528
  }, {
6517
6529
  readonly flags: "--write";
@@ -6521,7 +6533,7 @@ export declare const COMMAND_CATALOG: readonly [{
6521
6533
  readonly subcommands: readonly [];
6522
6534
  }, {
6523
6535
  readonly name: "compare";
6524
- readonly description: "Print stated beside observed: title, manager and listed owner against behavior. Changes nothing";
6536
+ readonly description: "Same as `hq ontology activity --compare`";
6525
6537
  readonly aliases: readonly [];
6526
6538
  readonly hidden: false;
6527
6539
  readonly helpOption: true;
@@ -6561,15 +6573,19 @@ export declare const COMMAND_CATALOG: readonly [{
6561
6573
  readonly flags: "--as-of <date>";
6562
6574
  readonly description: "the day the 30, 90 and 365 day windows end on (YYYY-MM-DD; default today)";
6563
6575
  readonly hidden: false;
6576
+ }, {
6577
+ readonly flags: "--roles";
6578
+ readonly description: "also show the inferred role line and who appears to direct whom";
6579
+ readonly hidden: false;
6564
6580
  }, {
6565
6581
  readonly flags: "--model";
6566
- readonly description: "phrase each active person's observed role with one small model call";
6582
+ readonly description: "with --roles, phrase each active person's role line with one small model call";
6567
6583
  readonly hidden: false;
6568
6584
  }];
6569
6585
  readonly subcommands: readonly [];
6570
6586
  }, {
6571
6587
  readonly name: "person";
6572
- readonly description: "Print one person's observed activity by window, coverage, edges and stated claims. Changes nothing";
6588
+ readonly description: "Same as `hq ontology activity <person>`";
6573
6589
  readonly aliases: readonly [];
6574
6590
  readonly hidden: false;
6575
6591
  readonly helpOption: true;
@@ -6614,13 +6630,82 @@ export declare const COMMAND_CATALOG: readonly [{
6614
6630
  readonly flags: "--as-of <date>";
6615
6631
  readonly description: "the day the 30, 90 and 365 day windows end on (YYYY-MM-DD; default today)";
6616
6632
  readonly hidden: false;
6633
+ }, {
6634
+ readonly flags: "--roles";
6635
+ readonly description: "also show the inferred role line and who appears to direct whom";
6636
+ readonly hidden: false;
6617
6637
  }, {
6618
6638
  readonly flags: "--model";
6619
- readonly description: "phrase each active person's observed role with one small model call";
6639
+ readonly description: "with --roles, phrase each active person's role line with one small model call";
6620
6640
  readonly hidden: false;
6621
6641
  }];
6622
6642
  readonly subcommands: readonly [];
6623
6643
  }];
6644
+ }, {
6645
+ readonly name: "activity";
6646
+ readonly description: "What each person does, from behavior in the graph: kinds of work with counts, what they ship and own, who they work with, change over time. Inferred; stores nothing without --write";
6647
+ readonly aliases: readonly [];
6648
+ readonly hidden: false;
6649
+ readonly helpOption: true;
6650
+ readonly helpCommand: false;
6651
+ readonly usage: "[options] [person]";
6652
+ readonly helpText: readonly [];
6653
+ readonly arguments: readonly [{
6654
+ readonly name: "person";
6655
+ readonly required: false;
6656
+ readonly variadic: false;
6657
+ readonly description: "one person's name or slug; without it, everyone";
6658
+ }];
6659
+ readonly options: readonly [{
6660
+ readonly flags: "--company <slug>";
6661
+ readonly description: "company whose graph to use";
6662
+ readonly hidden: false;
6663
+ }, {
6664
+ readonly flags: "--hq-root <path>";
6665
+ readonly description: "HQ installation to operate on";
6666
+ readonly hidden: false;
6667
+ }, {
6668
+ readonly flags: "--graph-root <path>";
6669
+ readonly description: "graph folder to use instead of companies/<slug>/.hq/ontology-graph (env HQ_ONTOLOGY_GRAPH_ROOT)";
6670
+ readonly hidden: false;
6671
+ }, {
6672
+ readonly flags: "--member <person uid>";
6673
+ readonly description: "member the graph is built or read for (env HQ_ONTOLOGY_MEMBER)";
6674
+ readonly hidden: false;
6675
+ }, {
6676
+ readonly flags: "--audience-key <key>";
6677
+ readonly description: "audience key the member holds; repeat for more (env HQ_ONTOLOGY_AUDIENCE_KEYS, comma-separated)";
6678
+ readonly hidden: false;
6679
+ }, {
6680
+ readonly flags: "--json";
6681
+ readonly description: "print JSON";
6682
+ readonly hidden: false;
6683
+ }, {
6684
+ readonly flags: "--view <view>";
6685
+ readonly description: "company (company-wide rows only) or member (also the rows only this member may read)";
6686
+ readonly hidden: false;
6687
+ }, {
6688
+ readonly flags: "--as-of <date>";
6689
+ readonly description: "the day the 30, 90 and 365 day windows end on (YYYY-MM-DD; default today)";
6690
+ readonly hidden: false;
6691
+ }, {
6692
+ readonly flags: "--roles";
6693
+ readonly description: "also show the inferred role line and who appears to direct whom";
6694
+ readonly hidden: false;
6695
+ }, {
6696
+ readonly flags: "--model";
6697
+ readonly description: "with --roles, phrase each active person's role line with one small model call";
6698
+ readonly hidden: false;
6699
+ }, {
6700
+ readonly flags: "--compare";
6701
+ readonly description: "print stated beside observed instead: title, manager and listed owner against behavior";
6702
+ readonly hidden: false;
6703
+ }, {
6704
+ readonly flags: "--write";
6705
+ readonly description: "also store the derived rows in the graph folder, marked as inferred";
6706
+ readonly hidden: false;
6707
+ }];
6708
+ readonly subcommands: readonly [];
6624
6709
  }, {
6625
6710
  readonly name: "daily";
6626
6711
  readonly description: "The daily job: update, lint, brief, once a day unless --force";
@@ -7051,6 +7051,16 @@ export const COMMAND_CATALOG = [
7051
7051
  "description": "list the whole corpus again instead of only new and changed files",
7052
7052
  "hidden": false
7053
7053
  },
7054
+ {
7055
+ "flags": "--max-input-tokens <n>",
7056
+ "description": "model input tokens allowed per day for this run, counting the day's earlier runs (default 150000)",
7057
+ "hidden": false
7058
+ },
7059
+ {
7060
+ "flags": "--max-output-tokens <n>",
7061
+ "description": "model output tokens allowed per day for this run (default 20000)",
7062
+ "hidden": false
7063
+ },
7054
7064
  {
7055
7065
  "flags": "--dry-run",
7056
7066
  "description": "read and count, write nothing",
@@ -7861,9 +7871,9 @@ export const COMMAND_CATALOG = [
7861
7871
  },
7862
7872
  {
7863
7873
  "name": "org",
7864
- "description": "The org as observed from behavior in the graph, beside the stated one. Inferred, never a confirmed fact",
7874
+ "description": "Earlier name of `hq ontology activity`. Inferred from behavior, never a confirmed fact",
7865
7875
  "aliases": [],
7866
- "hidden": false,
7876
+ "hidden": true,
7867
7877
  "helpOption": true,
7868
7878
  "helpCommand": true,
7869
7879
  "usage": "[options] [command]",
@@ -7873,7 +7883,7 @@ export const COMMAND_CATALOG = [
7873
7883
  "subcommands": [
7874
7884
  {
7875
7885
  "name": "observed",
7876
- "description": "Print the observed org: role, areas, who appears to direct whom, groups and de facto owners. Stores nothing without --write",
7886
+ "description": "Same as `hq ontology activity`",
7877
7887
  "aliases": [],
7878
7888
  "hidden": false,
7879
7889
  "helpOption": true,
@@ -7922,9 +7932,14 @@ export const COMMAND_CATALOG = [
7922
7932
  "description": "the day the 30, 90 and 365 day windows end on (YYYY-MM-DD; default today)",
7923
7933
  "hidden": false
7924
7934
  },
7935
+ {
7936
+ "flags": "--roles",
7937
+ "description": "also show the inferred role line and who appears to direct whom",
7938
+ "hidden": false
7939
+ },
7925
7940
  {
7926
7941
  "flags": "--model",
7927
- "description": "phrase each active person's observed role with one small model call",
7942
+ "description": "with --roles, phrase each active person's role line with one small model call",
7928
7943
  "hidden": false
7929
7944
  },
7930
7945
  {
@@ -7937,7 +7952,7 @@ export const COMMAND_CATALOG = [
7937
7952
  },
7938
7953
  {
7939
7954
  "name": "compare",
7940
- "description": "Print stated beside observed: title, manager and listed owner against behavior. Changes nothing",
7955
+ "description": "Same as `hq ontology activity --compare`",
7941
7956
  "aliases": [],
7942
7957
  "hidden": false,
7943
7958
  "helpOption": true,
@@ -7986,9 +8001,14 @@ export const COMMAND_CATALOG = [
7986
8001
  "description": "the day the 30, 90 and 365 day windows end on (YYYY-MM-DD; default today)",
7987
8002
  "hidden": false
7988
8003
  },
8004
+ {
8005
+ "flags": "--roles",
8006
+ "description": "also show the inferred role line and who appears to direct whom",
8007
+ "hidden": false
8008
+ },
7989
8009
  {
7990
8010
  "flags": "--model",
7991
- "description": "phrase each active person's observed role with one small model call",
8011
+ "description": "with --roles, phrase each active person's role line with one small model call",
7992
8012
  "hidden": false
7993
8013
  }
7994
8014
  ],
@@ -7996,7 +8016,7 @@ export const COMMAND_CATALOG = [
7996
8016
  },
7997
8017
  {
7998
8018
  "name": "person",
7999
- "description": "Print one person's observed activity by window, coverage, edges and stated claims. Changes nothing",
8019
+ "description": "Same as `hq ontology activity <person>`",
8000
8020
  "aliases": [],
8001
8021
  "hidden": false,
8002
8022
  "helpOption": true,
@@ -8052,9 +8072,14 @@ export const COMMAND_CATALOG = [
8052
8072
  "description": "the day the 30, 90 and 365 day windows end on (YYYY-MM-DD; default today)",
8053
8073
  "hidden": false
8054
8074
  },
8075
+ {
8076
+ "flags": "--roles",
8077
+ "description": "also show the inferred role line and who appears to direct whom",
8078
+ "hidden": false
8079
+ },
8055
8080
  {
8056
8081
  "flags": "--model",
8057
- "description": "phrase each active person's observed role with one small model call",
8082
+ "description": "with --roles, phrase each active person's role line with one small model call",
8058
8083
  "hidden": false
8059
8084
  }
8060
8085
  ],
@@ -8062,6 +8087,87 @@ export const COMMAND_CATALOG = [
8062
8087
  }
8063
8088
  ]
8064
8089
  },
8090
+ {
8091
+ "name": "activity",
8092
+ "description": "What each person does, from behavior in the graph: kinds of work with counts, what they ship and own, who they work with, change over time. Inferred; stores nothing without --write",
8093
+ "aliases": [],
8094
+ "hidden": false,
8095
+ "helpOption": true,
8096
+ "helpCommand": false,
8097
+ "usage": "[options] [person]",
8098
+ "helpText": [],
8099
+ "arguments": [
8100
+ {
8101
+ "name": "person",
8102
+ "required": false,
8103
+ "variadic": false,
8104
+ "description": "one person's name or slug; without it, everyone"
8105
+ }
8106
+ ],
8107
+ "options": [
8108
+ {
8109
+ "flags": "--company <slug>",
8110
+ "description": "company whose graph to use",
8111
+ "hidden": false
8112
+ },
8113
+ {
8114
+ "flags": "--hq-root <path>",
8115
+ "description": "HQ installation to operate on",
8116
+ "hidden": false
8117
+ },
8118
+ {
8119
+ "flags": "--graph-root <path>",
8120
+ "description": "graph folder to use instead of companies/<slug>/.hq/ontology-graph (env HQ_ONTOLOGY_GRAPH_ROOT)",
8121
+ "hidden": false
8122
+ },
8123
+ {
8124
+ "flags": "--member <person uid>",
8125
+ "description": "member the graph is built or read for (env HQ_ONTOLOGY_MEMBER)",
8126
+ "hidden": false
8127
+ },
8128
+ {
8129
+ "flags": "--audience-key <key>",
8130
+ "description": "audience key the member holds; repeat for more (env HQ_ONTOLOGY_AUDIENCE_KEYS, comma-separated)",
8131
+ "hidden": false
8132
+ },
8133
+ {
8134
+ "flags": "--json",
8135
+ "description": "print JSON",
8136
+ "hidden": false
8137
+ },
8138
+ {
8139
+ "flags": "--view <view>",
8140
+ "description": "company (company-wide rows only) or member (also the rows only this member may read)",
8141
+ "hidden": false
8142
+ },
8143
+ {
8144
+ "flags": "--as-of <date>",
8145
+ "description": "the day the 30, 90 and 365 day windows end on (YYYY-MM-DD; default today)",
8146
+ "hidden": false
8147
+ },
8148
+ {
8149
+ "flags": "--roles",
8150
+ "description": "also show the inferred role line and who appears to direct whom",
8151
+ "hidden": false
8152
+ },
8153
+ {
8154
+ "flags": "--model",
8155
+ "description": "with --roles, phrase each active person's role line with one small model call",
8156
+ "hidden": false
8157
+ },
8158
+ {
8159
+ "flags": "--compare",
8160
+ "description": "print stated beside observed instead: title, manager and listed owner against behavior",
8161
+ "hidden": false
8162
+ },
8163
+ {
8164
+ "flags": "--write",
8165
+ "description": "also store the derived rows in the graph folder, marked as inferred",
8166
+ "hidden": false
8167
+ }
8168
+ ],
8169
+ "subcommands": []
8170
+ },
8065
8171
  {
8066
8172
  "name": "daily",
8067
8173
  "description": "The daily job: update, lint, brief, once a day unless --force",
@@ -1256,6 +1256,10 @@ async function recordSkip(jobId, jobName, runtime, skipReason, failureClass, act
1256
1256
  export const JOB_UNATTENDED_SYNC_ENV = { HQ_SYNC_UNATTENDED: "1" };
1257
1257
  export async function runJob(argv, hqRootOverride, injected) {
1258
1258
  const env = { ...(injected?.env ?? process.env), ...JOB_UNATTENDED_SYNC_ENV };
1259
+ if (env.HQ_MACHINE_AUTH_REQUIRED === "1") {
1260
+ process.stderr.write("hq core job run runs personal jobs only; on a company machine (HQ_MACHINE_AUTH_REQUIRED=1) company jobs run through core/scripts/lib/company-jobs.mjs\n");
1261
+ return 2;
1262
+ }
1259
1263
  const deps = { ...defaultDependencies(env), ...injected, env };
1260
1264
  const args = parseArgs(argv);
1261
1265
  if (args.help) {
@@ -5,7 +5,7 @@ export type CoreCommandResult = {
5
5
  stderr: string;
6
6
  };
7
7
  export declare function runKnowledgePrefs(args: readonly string[], root: string): CoreCommandResult;
8
- /** Fast-entry adapter; family gating and shell fallback happen before import. */
8
+ /** Fast-entry adapter for the native command. */
9
9
  export declare function runKnowledgePrefsFast(args: readonly string[], _stdin: string, _cwd: string, hqRoot: string | undefined): number;
10
10
  export declare function registerCoreKnowledgePrefsCommand(core: Command): void;
11
11
  //# sourceMappingURL=core-knowledge-prefs.d.ts.map
@@ -7,9 +7,7 @@
7
7
  import * as fs from 'node:fs';
8
8
  import * as path from 'node:path';
9
9
  import { resolveLiveRoot } from '../utils/hq-roots.js';
10
- import { runBundledScript } from '../utils/run-bundled-script.js';
11
10
  import { describeCoreCommand } from './core-command-catalog.js';
12
- const KNOWLEDGE_PREFS_ASSET = 'core/scripts/knowledge-prefs.sh';
13
11
  const DEFAULTS = {
14
12
  signals_enabled: 'true',
15
13
  ontology_enabled: 'true',
@@ -83,7 +81,7 @@ export function runKnowledgePrefs(args, root) {
83
81
  stderr: '',
84
82
  };
85
83
  }
86
- /** Fast-entry adapter; family gating and shell fallback happen before import. */
84
+ /** Fast-entry adapter for the native command. */
87
85
  export function runKnowledgePrefsFast(args, _stdin, _cwd, hqRoot) {
88
86
  const root = hqRoot ?? resolveLiveRoot();
89
87
  const result = runKnowledgePrefs(args, root);
@@ -108,18 +106,6 @@ export function registerCoreKnowledgePrefsCommand(core) {
108
106
  const hqRoot = resolveLiveRoot({
109
107
  hqRoot: core.opts().hqRoot,
110
108
  });
111
- const { coreNativePolicyEnabled } = await import('./core-native-policy-flag.js');
112
- if (!await coreNativePolicyEnabled()) {
113
- const result = runBundledScript({
114
- asset: KNOWLEDGE_PREFS_ASSET,
115
- args: operands,
116
- cwd: hqRoot,
117
- hqRoot,
118
- });
119
- if (result.code !== 0)
120
- process.exitCode = result.code;
121
- return;
122
- }
123
109
  const result = runKnowledgePrefs(operands, hqRoot);
124
110
  if (result.stdout)
125
111
  process.stdout.write(result.stdout);
@@ -130,7 +116,6 @@ export function registerCoreKnowledgePrefsCommand(core) {
130
116
  });
131
117
  describeCoreCommand(command, {
132
118
  execution: 'native',
133
- asset: KNOWLEDGE_PREFS_ASSET,
134
119
  root: 'live',
135
120
  });
136
121
  }
@@ -352,8 +352,6 @@ export const SCAFFOLD_ONLY_ASSETS = [
352
352
  { asset: "core/scripts/hq-delegate-send.sh", root: "live", summary: "Rollback shell for native delegate send" },
353
353
  { asset: "core/scripts/hq-delegate-verify.sh", root: "live", summary: "Rollback shell for native delegate verify" },
354
354
  { asset: "core/scripts/lib/secret-patterns.sh", root: "live", summary: "Secret-pattern library sourced by the delegate rollback shells" },
355
- // Native knowledge-prefs retains its own shell companion until its family PR.
356
- { asset: "core/scripts/knowledge-prefs.sh", root: "live", summary: "Rollback companion for native knowledge-prefs" },
357
355
  // Retained policy helpers used by the policy validator and trigger tooling.
358
356
  { asset: "core/scripts/eval-trigger.sh", root: "live", summary: "Trigger grammar helper used by the policy validator companion" },
359
357
  { asset: "core/scripts/migrate-policy-triggers.sh", root: "live", summary: "Rollback shell for native migrate-policy-triggers" },
@@ -1959,6 +1959,27 @@ export function registerDaemonCommand(program, over = {}) {
1959
1959
  const service = daemon
1960
1960
  .command("service", { hidden: true })
1961
1961
  .description("Entry points the daemon runs for services that have no command of their own");
1962
+ // A unit runs the CLI on disk; when the daemon that started it is older, ask
1963
+ // that daemon to restart onto this release (heals daemons stuck from before
1964
+ // the housekeeping check existed, with the updater off).
1965
+ service.hook("preAction", async () => {
1966
+ try {
1967
+ const [{ requestRestartOfOlderParentDaemon }, { CLI_VERSION }] = await Promise.all([
1968
+ import("../lib/daemon/installed-cli-restart.js"),
1969
+ import("../cli-version.js"),
1970
+ ]);
1971
+ const paths = daemonPaths(os.homedir(), process.env);
1972
+ requestRestartOfOlderParentDaemon({
1973
+ parentVersion: process.env.HQ_DAEMON_CLI_VERSION,
1974
+ cliVersion: CLI_VERSION,
1975
+ markerPath: path.join(paths.root, "older-daemon-restart.json"),
1976
+ requestRestart: () => { writeControlRequest(paths.requestsDir, { action: "restart-daemon", deferUntilSyncIdle: true }); },
1977
+ });
1978
+ }
1979
+ catch {
1980
+ // The unit starts either way.
1981
+ }
1982
+ });
1962
1983
  service
1963
1984
  .command("mesh")
1964
1985
  .description("Work Mesh Live: spool drain, MQTT presence and the live Board cache (the daemon's mesh service)")
@@ -10,7 +10,8 @@
10
10
  * hq ontology lookup <name> [--page] | neighbors <id> [--depth N] | search <text> | traverse <from> [<to>]
11
11
  * hq ontology lint [--strict] [--coverage] | proposals list|accept|nope|undo [--set <name>] | brief
12
12
  * hq ontology org-chart draft | confirm --from <file> [--yes] | show
13
- * hq ontology org observed [--write] | compare | person <name> [--view company|member] [--as-of D] [--model]
13
+ * hq ontology activity [<person>] [--roles] [--compare] [--write] [--view company|member] [--as-of D] [--model]
14
+ * (`hq ontology org observed|compare|person <name>` is the same thing under its first name, kept hidden)
14
15
  * hq ontology daily | job install|uninstall|status
15
16
  *
16
17
  * No identity flag is needed (correction C5). Without `--member` the read