@indigoai-us/hq-cli 5.345.248 → 5.345.251

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 (114) hide show
  1. package/CHANGELOG.md +143 -0
  2. package/contracts/host-canary-release.json +3 -3
  3. package/dist/command-catalog.generated.d.ts +288 -9
  4. package/dist/command-catalog.generated.js +355 -9
  5. package/dist/commands/bot.js +5 -1
  6. package/dist/commands/core-job-run-native.js +4 -0
  7. package/dist/commands/core-knowledge-prefs.d.ts +1 -1
  8. package/dist/commands/core-knowledge-prefs.js +1 -16
  9. package/dist/commands/core.js +0 -2
  10. package/dist/commands/daemon.js +21 -0
  11. package/dist/commands/lanes.d.ts +2 -0
  12. package/dist/commands/lanes.js +9 -4
  13. package/dist/commands/ontology-graph.d.ts +11 -3
  14. package/dist/commands/ontology-graph.js +138 -14
  15. package/dist/commands/sources.js +26 -8
  16. package/dist/commands/sync-core.js +6 -0
  17. package/dist/fast-scaffold.js +1 -3
  18. package/dist/hq-cloud-sync-runner/bin/sync-runner.js +281 -256
  19. package/dist/hq-cloud-sync-runner/package.json +1 -1
  20. package/dist/index.d.ts +8 -0
  21. package/dist/index.js +47 -0
  22. package/dist/lib/bot/fleet-cron.d.ts +2 -0
  23. package/dist/lib/bot/fleet-cron.js +5 -0
  24. package/dist/lib/daemon/installed-cli-restart.d.ts +57 -0
  25. package/dist/lib/daemon/installed-cli-restart.js +114 -0
  26. package/dist/lib/daemon/legacy-journal-gate.d.ts +32 -0
  27. package/dist/lib/daemon/legacy-journal-gate.js +102 -0
  28. package/dist/lib/daemon/machine-checks.d.ts +7 -0
  29. package/dist/lib/daemon/machine-checks.js +10 -0
  30. package/dist/lib/daemon/run.d.ts +3 -1
  31. package/dist/lib/daemon/run.js +48 -5
  32. package/dist/lib/flag-registry-worker-source.generated.d.ts +1 -1
  33. package/dist/lib/flag-registry-worker-source.generated.js +1 -1
  34. package/dist/lib/hook-engine/coverage.d.ts +99 -19
  35. package/dist/lib/hook-engine/coverage.js +269 -35
  36. package/dist/lib/hook-engine/native-stop-compatibility.json +9 -4
  37. package/dist/lib/hook-engine/registration-identity.d.ts +5 -0
  38. package/dist/lib/hook-engine/registration-identity.js +1 -1
  39. package/dist/lib/hook-engine/resolve.d.ts +23 -0
  40. package/dist/lib/hook-engine/resolve.js +48 -1
  41. package/dist/lib/hook-engine/stable-heal.d.ts +87 -0
  42. package/dist/lib/hook-engine/stable-heal.js +214 -0
  43. package/dist/lib/hot-channels/graph-context.d.ts +26 -1
  44. package/dist/lib/hot-channels/graph-context.js +80 -10
  45. package/dist/lib/hot-channels/run.d.ts +1 -0
  46. package/dist/lib/hot-channels/signals-pass.js +9 -4
  47. package/dist/lib/ontology-graph/model/files.d.ts +4 -0
  48. package/dist/lib/ontology-graph/model/files.js +23 -0
  49. package/dist/lib/ontology-graph/model/index.d.ts +11 -1
  50. package/dist/lib/ontology-graph/model/index.js +42 -18
  51. package/dist/lib/ontology-graph/model/pass-tasks.d.ts +9 -1
  52. package/dist/lib/ontology-graph/model/pass-tasks.js +7 -4
  53. package/dist/lib/ontology-graph/model/pass.d.ts +5 -0
  54. package/dist/lib/ontology-graph/model/pass.js +8 -8
  55. package/dist/lib/ontology-graph/model/pending-items.d.ts +31 -0
  56. package/dist/lib/ontology-graph/model/pending-items.js +113 -0
  57. package/dist/lib/ontology-graph/model/step.d.ts +48 -1
  58. package/dist/lib/ontology-graph/model/step.js +205 -36
  59. package/dist/lib/ontology-graph/model/tasks.d.ts +17 -1
  60. package/dist/lib/ontology-graph/model/tasks.js +28 -8
  61. package/dist/lib/ontology-graph/org/derive.d.ts +2 -0
  62. package/dist/lib/ontology-graph/org/derive.js +9 -2
  63. package/dist/lib/ontology-graph/org/index.d.ts +35 -6
  64. package/dist/lib/ontology-graph/org/index.js +136 -19
  65. package/dist/lib/ontology-graph/org/text.d.ts +2 -0
  66. package/dist/lib/ontology-graph/org/text.js +6 -0
  67. package/dist/lib/ontology-graph/org/types.d.ts +5 -0
  68. package/dist/lib/ontology-graph/pages/render.d.ts +2 -0
  69. package/dist/lib/ontology-graph/pages/render.js +11 -4
  70. package/dist/lib/ontology-graph/read/brief.d.ts +13 -3
  71. package/dist/lib/ontology-graph/read/brief.js +312 -62
  72. package/dist/lib/ontology-graph/read/index.d.ts +1 -1
  73. package/dist/lib/ontology-graph/read/index.js +14 -3
  74. package/dist/lib/ontology-graph/read/names.d.ts +6 -1
  75. package/dist/lib/ontology-graph/read/names.js +8 -3
  76. package/dist/lib/ontology-graph/read/reader-setting.d.ts +2 -0
  77. package/dist/lib/ontology-graph/read/reader-setting.js +4 -1
  78. package/dist/lib/ontology-graph/remodel/index.d.ts +174 -0
  79. package/dist/lib/ontology-graph/remodel/index.js +450 -0
  80. package/dist/lib/ontology-graph/replay/engine.d.ts +47 -1
  81. package/dist/lib/ontology-graph/replay/engine.js +68 -2
  82. package/dist/lib/ontology-graph/replay/index.d.ts +2 -1
  83. package/dist/lib/ontology-graph/replay/index.js +114 -8
  84. package/dist/lib/ontology-graph/schema/authority.d.ts +43 -0
  85. package/dist/lib/ontology-graph/schema/authority.js +39 -0
  86. package/dist/lib/ontology-graph/schema/index.d.ts +1 -1
  87. package/dist/lib/ontology-graph/schema/index.js +1 -1
  88. package/dist/lib/ontology-graph/setup/index.d.ts +88 -0
  89. package/dist/lib/ontology-graph/setup/index.js +489 -0
  90. package/dist/lib/ontology-graph/types.d.ts +28 -0
  91. package/dist/lib/ontology-graph/types.js +5 -0
  92. package/dist/lib/signals/failure-alert.js +4 -5
  93. package/dist/lib/signals/steps/adapters.js +3 -0
  94. package/dist/lib/sync-core/engine-holds.d.ts +1 -1
  95. package/dist/lib/sync-core/engine-holds.js +12 -2
  96. package/dist/lib/sync-core/hand-back.d.ts +2 -1
  97. package/dist/lib/sync-core/hand-back.js +16 -2
  98. package/dist/lib/sync-core/legacy-journal-export-child.d.ts +2 -0
  99. package/dist/lib/sync-core/legacy-journal-export-child.js +24 -0
  100. package/dist/lib/sync-core/legacy-journal-export.d.ts +39 -0
  101. package/dist/lib/sync-core/legacy-journal-export.js +241 -0
  102. package/dist/lib/sync-core/legacy-journal-reader.d.ts +15 -0
  103. package/dist/lib/sync-core/legacy-journal-reader.js +56 -0
  104. package/dist/lib/sync-core/reconcile.d.ts +3 -0
  105. package/dist/lib/sync-core/reconcile.js +43 -3
  106. package/dist/utils/cli-telemetry.d.ts +1 -0
  107. package/dist/utils/cli-telemetry.js +6 -3
  108. package/dist/utils/hook-engine-rollup.d.ts +96 -0
  109. package/dist/utils/hook-engine-rollup.js +725 -0
  110. package/dist/utils/sync-person.d.ts +15 -0
  111. package/dist/utils/sync-person.js +74 -0
  112. package/package.json +8 -8
  113. package/scripts/install-hook-engine.mjs +4 -0
  114. package/assets/scaffold/core/scripts/knowledge-prefs.sh +0 -55
@@ -6916,6 +6916,152 @@ export const COMMAND_CATALOG = [
6916
6916
  "arguments": [],
6917
6917
  "options": [],
6918
6918
  "subcommands": [
6919
+ {
6920
+ "name": "status",
6921
+ "description": "Show the reader, the model, the graph folder, its counts, pending model work, the last update and the brief (reads only)",
6922
+ "aliases": [],
6923
+ "hidden": false,
6924
+ "helpOption": true,
6925
+ "helpCommand": false,
6926
+ "usage": "[options]",
6927
+ "helpText": [],
6928
+ "arguments": [],
6929
+ "options": [
6930
+ {
6931
+ "flags": "--company <slug>",
6932
+ "description": "company whose graph to use",
6933
+ "hidden": false
6934
+ },
6935
+ {
6936
+ "flags": "--hq-root <path>",
6937
+ "description": "HQ installation to operate on",
6938
+ "hidden": false
6939
+ },
6940
+ {
6941
+ "flags": "--graph-root <path>",
6942
+ "description": "graph folder to use instead of companies/<slug>/.hq/ontology-graph (env HQ_ONTOLOGY_GRAPH_ROOT)",
6943
+ "hidden": false
6944
+ },
6945
+ {
6946
+ "flags": "--member <person uid>",
6947
+ "description": "member the graph is built or read for (env HQ_ONTOLOGY_MEMBER)",
6948
+ "hidden": false
6949
+ },
6950
+ {
6951
+ "flags": "--audience-key <key>",
6952
+ "description": "audience key the member holds; repeat for more (env HQ_ONTOLOGY_AUDIENCE_KEYS, comma-separated)",
6953
+ "hidden": false
6954
+ },
6955
+ {
6956
+ "flags": "--json",
6957
+ "description": "print JSON",
6958
+ "hidden": false
6959
+ }
6960
+ ],
6961
+ "subcommands": []
6962
+ },
6963
+ {
6964
+ "name": "reader",
6965
+ "description": "Show or set which ontology this machine's sessions read for the company: graph, or entities (the old files)",
6966
+ "aliases": [],
6967
+ "hidden": false,
6968
+ "helpOption": true,
6969
+ "helpCommand": false,
6970
+ "usage": "[options] [reader]",
6971
+ "helpText": [],
6972
+ "arguments": [
6973
+ {
6974
+ "name": "reader",
6975
+ "required": false,
6976
+ "variadic": false,
6977
+ "description": "graph or entities; leave out to show the setting"
6978
+ }
6979
+ ],
6980
+ "options": [
6981
+ {
6982
+ "flags": "--company <slug>",
6983
+ "description": "company whose graph to use",
6984
+ "hidden": false
6985
+ },
6986
+ {
6987
+ "flags": "--hq-root <path>",
6988
+ "description": "HQ installation to operate on",
6989
+ "hidden": false
6990
+ },
6991
+ {
6992
+ "flags": "--graph-root <path>",
6993
+ "description": "graph folder to use instead of companies/<slug>/.hq/ontology-graph (env HQ_ONTOLOGY_GRAPH_ROOT)",
6994
+ "hidden": false
6995
+ },
6996
+ {
6997
+ "flags": "--member <person uid>",
6998
+ "description": "member the graph is built or read for (env HQ_ONTOLOGY_MEMBER)",
6999
+ "hidden": false
7000
+ },
7001
+ {
7002
+ "flags": "--audience-key <key>",
7003
+ "description": "audience key the member holds; repeat for more (env HQ_ONTOLOGY_AUDIENCE_KEYS, comma-separated)",
7004
+ "hidden": false
7005
+ },
7006
+ {
7007
+ "flags": "--json",
7008
+ "description": "print JSON",
7009
+ "hidden": false
7010
+ }
7011
+ ],
7012
+ "subcommands": []
7013
+ },
7014
+ {
7015
+ "name": "model",
7016
+ "description": "Show or set the model the graph's model step uses for the company on this machine (per machine; the setting does not sync)",
7017
+ "aliases": [],
7018
+ "hidden": false,
7019
+ "helpOption": true,
7020
+ "helpCommand": false,
7021
+ "usage": "[options] [model]",
7022
+ "helpText": [],
7023
+ "arguments": [
7024
+ {
7025
+ "name": "model",
7026
+ "required": false,
7027
+ "variadic": false,
7028
+ "description": "model name, for example haiku, sonnet or opus; leave out to show the setting"
7029
+ }
7030
+ ],
7031
+ "options": [
7032
+ {
7033
+ "flags": "--company <slug>",
7034
+ "description": "company whose graph to use",
7035
+ "hidden": false
7036
+ },
7037
+ {
7038
+ "flags": "--hq-root <path>",
7039
+ "description": "HQ installation to operate on",
7040
+ "hidden": false
7041
+ },
7042
+ {
7043
+ "flags": "--graph-root <path>",
7044
+ "description": "graph folder to use instead of companies/<slug>/.hq/ontology-graph (env HQ_ONTOLOGY_GRAPH_ROOT)",
7045
+ "hidden": false
7046
+ },
7047
+ {
7048
+ "flags": "--member <person uid>",
7049
+ "description": "member the graph is built or read for (env HQ_ONTOLOGY_MEMBER)",
7050
+ "hidden": false
7051
+ },
7052
+ {
7053
+ "flags": "--audience-key <key>",
7054
+ "description": "audience key the member holds; repeat for more (env HQ_ONTOLOGY_AUDIENCE_KEYS, comma-separated)",
7055
+ "hidden": false
7056
+ },
7057
+ {
7058
+ "flags": "--json",
7059
+ "description": "print JSON",
7060
+ "hidden": false
7061
+ }
7062
+ ],
7063
+ "subcommands": []
7064
+ },
6919
7065
  {
6920
7066
  "name": "rebuild",
6921
7067
  "description": "Rebuild the graph: import the old entity files, then replay the vault day by day",
@@ -6977,6 +7123,16 @@ export const COMMAND_CATALOG = [
6977
7123
  "description": "stop model calls after this many input tokens; 0 runs rules only",
6978
7124
  "hidden": false
6979
7125
  },
7126
+ {
7127
+ "flags": "--max-input-tokens <n>",
7128
+ "description": "model input tokens allowed per day for this run, counting the day's earlier runs (default 150000)",
7129
+ "hidden": false
7130
+ },
7131
+ {
7132
+ "flags": "--max-output-tokens <n>",
7133
+ "description": "model output tokens allowed per day for this run (default 20000)",
7134
+ "hidden": false
7135
+ },
6980
7136
  {
6981
7137
  "flags": "--no-model",
6982
7138
  "description": "rules only: make no model call and leave model work pending",
@@ -7051,6 +7207,21 @@ export const COMMAND_CATALOG = [
7051
7207
  "description": "list the whole corpus again instead of only new and changed files",
7052
7208
  "hidden": false
7053
7209
  },
7210
+ {
7211
+ "flags": "--max-input-tokens <n>",
7212
+ "description": "model input tokens allowed per day for this run, counting the day's earlier runs (default 150000)",
7213
+ "hidden": false
7214
+ },
7215
+ {
7216
+ "flags": "--max-output-tokens <n>",
7217
+ "description": "model output tokens allowed per day for this run (default 20000)",
7218
+ "hidden": false
7219
+ },
7220
+ {
7221
+ "flags": "--follow-up",
7222
+ "description": "also send model work an earlier run left pending (profiles, retyped links, decisions, summaries), within the daily cap",
7223
+ "hidden": false
7224
+ },
7054
7225
  {
7055
7226
  "flags": "--dry-run",
7056
7227
  "description": "read and count, write nothing",
@@ -7059,6 +7230,80 @@ export const COMMAND_CATALOG = [
7059
7230
  ],
7060
7231
  "subcommands": []
7061
7232
  },
7233
+ {
7234
+ "name": "remodel",
7235
+ "description": "Ask again, on the model in use, what another model wrote, and close that model's rows (history kept)",
7236
+ "aliases": [],
7237
+ "hidden": false,
7238
+ "helpOption": true,
7239
+ "helpCommand": false,
7240
+ "usage": "[options]",
7241
+ "helpText": [],
7242
+ "arguments": [],
7243
+ "options": [
7244
+ {
7245
+ "flags": "--company <slug>",
7246
+ "description": "company whose graph to use",
7247
+ "hidden": false
7248
+ },
7249
+ {
7250
+ "flags": "--hq-root <path>",
7251
+ "description": "HQ installation to operate on",
7252
+ "hidden": false
7253
+ },
7254
+ {
7255
+ "flags": "--graph-root <path>",
7256
+ "description": "graph folder to use instead of companies/<slug>/.hq/ontology-graph (env HQ_ONTOLOGY_GRAPH_ROOT)",
7257
+ "hidden": false
7258
+ },
7259
+ {
7260
+ "flags": "--member <person uid>",
7261
+ "description": "member the graph is built or read for (env HQ_ONTOLOGY_MEMBER)",
7262
+ "hidden": false
7263
+ },
7264
+ {
7265
+ "flags": "--audience-key <key>",
7266
+ "description": "audience key the member holds; repeat for more (env HQ_ONTOLOGY_AUDIENCE_KEYS, comma-separated)",
7267
+ "hidden": false
7268
+ },
7269
+ {
7270
+ "flags": "--json",
7271
+ "description": "print JSON",
7272
+ "hidden": false
7273
+ },
7274
+ {
7275
+ "flags": "--from <model>",
7276
+ "description": "model whose rows to replace, for example haiku",
7277
+ "hidden": false
7278
+ },
7279
+ {
7280
+ "flags": "--kinds <list>",
7281
+ "description": "ask again only what wrote these fact fields and relationship verbs, comma-separated (role_title,affiliation,works_at)",
7282
+ "hidden": false
7283
+ },
7284
+ {
7285
+ "flags": "--budget-tokens <n>",
7286
+ "description": "stop model calls after this many input tokens",
7287
+ "hidden": false
7288
+ },
7289
+ {
7290
+ "flags": "--max-input-tokens <n>",
7291
+ "description": "model input tokens allowed per day for this run, counting the day's earlier runs (default 150000)",
7292
+ "hidden": false
7293
+ },
7294
+ {
7295
+ "flags": "--max-output-tokens <n>",
7296
+ "description": "model output tokens allowed per day for this run (default 20000)",
7297
+ "hidden": false
7298
+ },
7299
+ {
7300
+ "flags": "--dry-run",
7301
+ "description": "count the rows and estimate the tokens; call no model and write nothing",
7302
+ "hidden": false
7303
+ }
7304
+ ],
7305
+ "subcommands": []
7306
+ },
7062
7307
  {
7063
7308
  "name": "lookup",
7064
7309
  "description": "Find an entity by name and print its facts, each with a source and date",
@@ -7331,7 +7576,7 @@ export const COMMAND_CATALOG = [
7331
7576
  },
7332
7577
  {
7333
7578
  "name": "brief",
7334
- "description": "Write brief.md, the short summary every session starts with",
7579
+ "description": "Write brief.md, the short text every session starts with: a map of the graph and how to look things up",
7335
7580
  "aliases": [],
7336
7581
  "hidden": false,
7337
7582
  "helpOption": true,
@@ -7374,6 +7619,11 @@ export const COMMAND_CATALOG = [
7374
7619
  "flags": "--stdout",
7375
7620
  "description": "print the brief without writing it",
7376
7621
  "hidden": false
7622
+ },
7623
+ {
7624
+ "flags": "--style <style>",
7625
+ "description": "map: what the graph holds, the lookup commands and names worth looking up, with no facts. full: the earlier summary with facts in it. Default: brief_style in the reader setting, else map",
7626
+ "hidden": false
7377
7627
  }
7378
7628
  ],
7379
7629
  "subcommands": []
@@ -7861,9 +8111,9 @@ export const COMMAND_CATALOG = [
7861
8111
  },
7862
8112
  {
7863
8113
  "name": "org",
7864
- "description": "The org as observed from behavior in the graph, beside the stated one. Inferred, never a confirmed fact",
8114
+ "description": "Earlier name of `hq ontology activity`. Inferred from behavior, never a confirmed fact",
7865
8115
  "aliases": [],
7866
- "hidden": false,
8116
+ "hidden": true,
7867
8117
  "helpOption": true,
7868
8118
  "helpCommand": true,
7869
8119
  "usage": "[options] [command]",
@@ -7873,7 +8123,7 @@ export const COMMAND_CATALOG = [
7873
8123
  "subcommands": [
7874
8124
  {
7875
8125
  "name": "observed",
7876
- "description": "Print the observed org: role, areas, who appears to direct whom, groups and de facto owners. Stores nothing without --write",
8126
+ "description": "Same as `hq ontology activity`",
7877
8127
  "aliases": [],
7878
8128
  "hidden": false,
7879
8129
  "helpOption": true,
@@ -7922,9 +8172,14 @@ export const COMMAND_CATALOG = [
7922
8172
  "description": "the day the 30, 90 and 365 day windows end on (YYYY-MM-DD; default today)",
7923
8173
  "hidden": false
7924
8174
  },
8175
+ {
8176
+ "flags": "--roles",
8177
+ "description": "also show the inferred role line and who appears to direct whom",
8178
+ "hidden": false
8179
+ },
7925
8180
  {
7926
8181
  "flags": "--model",
7927
- "description": "phrase each active person's observed role with one small model call",
8182
+ "description": "with --roles, phrase each active person's role line with one small model call",
7928
8183
  "hidden": false
7929
8184
  },
7930
8185
  {
@@ -7937,7 +8192,7 @@ export const COMMAND_CATALOG = [
7937
8192
  },
7938
8193
  {
7939
8194
  "name": "compare",
7940
- "description": "Print stated beside observed: title, manager and listed owner against behavior. Changes nothing",
8195
+ "description": "Same as `hq ontology activity --compare`",
7941
8196
  "aliases": [],
7942
8197
  "hidden": false,
7943
8198
  "helpOption": true,
@@ -7986,9 +8241,14 @@ export const COMMAND_CATALOG = [
7986
8241
  "description": "the day the 30, 90 and 365 day windows end on (YYYY-MM-DD; default today)",
7987
8242
  "hidden": false
7988
8243
  },
8244
+ {
8245
+ "flags": "--roles",
8246
+ "description": "also show the inferred role line and who appears to direct whom",
8247
+ "hidden": false
8248
+ },
7989
8249
  {
7990
8250
  "flags": "--model",
7991
- "description": "phrase each active person's observed role with one small model call",
8251
+ "description": "with --roles, phrase each active person's role line with one small model call",
7992
8252
  "hidden": false
7993
8253
  }
7994
8254
  ],
@@ -7996,7 +8256,7 @@ export const COMMAND_CATALOG = [
7996
8256
  },
7997
8257
  {
7998
8258
  "name": "person",
7999
- "description": "Print one person's observed activity by window, coverage, edges and stated claims. Changes nothing",
8259
+ "description": "Same as `hq ontology activity <person>`",
8000
8260
  "aliases": [],
8001
8261
  "hidden": false,
8002
8262
  "helpOption": true,
@@ -8052,9 +8312,14 @@ export const COMMAND_CATALOG = [
8052
8312
  "description": "the day the 30, 90 and 365 day windows end on (YYYY-MM-DD; default today)",
8053
8313
  "hidden": false
8054
8314
  },
8315
+ {
8316
+ "flags": "--roles",
8317
+ "description": "also show the inferred role line and who appears to direct whom",
8318
+ "hidden": false
8319
+ },
8055
8320
  {
8056
8321
  "flags": "--model",
8057
- "description": "phrase each active person's observed role with one small model call",
8322
+ "description": "with --roles, phrase each active person's role line with one small model call",
8058
8323
  "hidden": false
8059
8324
  }
8060
8325
  ],
@@ -8062,6 +8327,87 @@ export const COMMAND_CATALOG = [
8062
8327
  }
8063
8328
  ]
8064
8329
  },
8330
+ {
8331
+ "name": "activity",
8332
+ "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",
8333
+ "aliases": [],
8334
+ "hidden": false,
8335
+ "helpOption": true,
8336
+ "helpCommand": false,
8337
+ "usage": "[options] [person]",
8338
+ "helpText": [],
8339
+ "arguments": [
8340
+ {
8341
+ "name": "person",
8342
+ "required": false,
8343
+ "variadic": false,
8344
+ "description": "one person's name or slug; without it, everyone"
8345
+ }
8346
+ ],
8347
+ "options": [
8348
+ {
8349
+ "flags": "--company <slug>",
8350
+ "description": "company whose graph to use",
8351
+ "hidden": false
8352
+ },
8353
+ {
8354
+ "flags": "--hq-root <path>",
8355
+ "description": "HQ installation to operate on",
8356
+ "hidden": false
8357
+ },
8358
+ {
8359
+ "flags": "--graph-root <path>",
8360
+ "description": "graph folder to use instead of companies/<slug>/.hq/ontology-graph (env HQ_ONTOLOGY_GRAPH_ROOT)",
8361
+ "hidden": false
8362
+ },
8363
+ {
8364
+ "flags": "--member <person uid>",
8365
+ "description": "member the graph is built or read for (env HQ_ONTOLOGY_MEMBER)",
8366
+ "hidden": false
8367
+ },
8368
+ {
8369
+ "flags": "--audience-key <key>",
8370
+ "description": "audience key the member holds; repeat for more (env HQ_ONTOLOGY_AUDIENCE_KEYS, comma-separated)",
8371
+ "hidden": false
8372
+ },
8373
+ {
8374
+ "flags": "--json",
8375
+ "description": "print JSON",
8376
+ "hidden": false
8377
+ },
8378
+ {
8379
+ "flags": "--view <view>",
8380
+ "description": "company (company-wide rows only) or member (also the rows only this member may read)",
8381
+ "hidden": false
8382
+ },
8383
+ {
8384
+ "flags": "--as-of <date>",
8385
+ "description": "the day the 30, 90 and 365 day windows end on (YYYY-MM-DD; default today)",
8386
+ "hidden": false
8387
+ },
8388
+ {
8389
+ "flags": "--roles",
8390
+ "description": "also show the inferred role line and who appears to direct whom",
8391
+ "hidden": false
8392
+ },
8393
+ {
8394
+ "flags": "--model",
8395
+ "description": "with --roles, phrase each active person's role line with one small model call",
8396
+ "hidden": false
8397
+ },
8398
+ {
8399
+ "flags": "--compare",
8400
+ "description": "print stated beside observed instead: title, manager and listed owner against behavior",
8401
+ "hidden": false
8402
+ },
8403
+ {
8404
+ "flags": "--write",
8405
+ "description": "also store the derived rows in the graph folder, marked as inferred",
8406
+ "hidden": false
8407
+ }
8408
+ ],
8409
+ "subcommands": []
8410
+ },
8065
8411
  {
8066
8412
  "name": "daily",
8067
8413
  "description": "The daily job: update, lint, brief, once a day unless --force",
@@ -14,6 +14,7 @@ import { checkClaudeLoginNow, readSignalsClaudeLogin, recordSignalsPassClaudeLog
14
14
  import { fleetCompleteTargetFor } from "../lib/hot-channels/fleet-complete.js";
15
15
  import { machineTimeZone } from "../lib/bot/job-run.js";
16
16
  import { runCompanyHotChannelSync } from "./sources.js";
17
+ import { resolveSyncPerson } from "../utils/sync-person.js";
17
18
  import { OwnerContextCache, lookupOwnerContext } from "../lib/bot/owner-context.js";
18
19
  import { hasActivePromotion, localPromotionState } from "../lib/bot/promotion-receipt.js";
19
20
  import { botBusyState, readInflightTurns } from "../lib/bot/inflight.js";
@@ -303,7 +304,8 @@ async function syncFleetRuntimeJobs(name, dir, config) {
303
304
  executiveCompanies: role.executiveCompanies,
304
305
  };
305
306
  const signalsJobEnabled = await fleetHotSignalSyncEngineCompanies(jobs, undefined, (message) => log("warn", message));
306
- const result = ensureFleetHotSignalSync({ ...jobs, signalsJobEnabled });
307
+ const noPersonIdentity = resolveSyncPerson().kind === "no-person";
308
+ const result = ensureFleetHotSignalSync({ ...jobs, signalsJobEnabled, noPersonIdentity });
307
309
  if (executive === false && result.removed.length > 0) {
308
310
  log("info", `removed the daily hot-signal-sync from this bot (${result.removed.length} job${result.removed.length === 1 ? "" : "s"}): ${executiveBot ? `${executiveBot.name} is the Executive bot now and runs it` : "only the Executive bot runs it"}`);
309
311
  }
@@ -316,6 +318,8 @@ async function syncFleetRuntimeJobs(name, dir, config) {
316
318
  log("info", `registered the daily hot-signal-sync job for ${entry.company} at 06:30 in the HQ Fleet Runtime`);
317
319
  if (entry.heldBy)
318
320
  log("info", `not adding a hot-signal-sync job for ${entry.company}: the bot in ${entry.heldBy} already runs it`);
321
+ if (entry.noPersonIdentity)
322
+ log("warn", `not adding a hot-signal-sync job for ${entry.company}: this computer's HQ sign-in is a machine identity that acts for no person, so the sync would have no one to run for`);
319
323
  }
320
324
  }
321
325
  catch (err) {
@@ -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)")
@@ -136,6 +136,8 @@ export interface LanesCommandDeps {
136
136
  export type MonitorLaneMessageApi = (laneId: string, payload: MonitorLaneMessagePayload) => Promise<MonitorLaneMessageResult>;
137
137
  /** Build the same lane message handlers used by `hq runners _monitor-message`, without a CLI process boundary. */
138
138
  export declare function createMonitorLaneMessageApi(hqRoot: string, cwd: string, env?: NodeJS.ProcessEnv): MonitorLaneMessageApi;
139
+ /** The monitor lane message handler registered on `program`, if any. */
140
+ export declare function monitorLaneMessageApiFor(program: Command): MonitorLaneMessageApi | undefined;
139
141
  export declare function parseSeniorRef(raw: string): SeniorRef;
140
142
  export declare function parseQuestionBody(raw: unknown): QuestionBody | null;
141
143
  /**
@@ -265,11 +265,15 @@ export function createMonitorLaneMessageApi(hqRoot, cwd, env = process.env) {
265
265
  cwd: () => cwd,
266
266
  env: { ...env, HQ_ROOT: hqRoot },
267
267
  });
268
- const api = monitorLaneMessageApis.get(program);
268
+ const api = monitorLaneMessageApiFor(program);
269
269
  if (!api)
270
270
  throw new Error("Monitor lane message handler was not registered");
271
271
  return api;
272
272
  }
273
+ /** The monitor lane message handler registered on `program`, if any. */
274
+ export function monitorLaneMessageApiFor(program) {
275
+ return monitorLaneMessageApis.get(program);
276
+ }
273
277
  function withoutProviderHome(value) {
274
278
  if (Array.isArray(value))
275
279
  return value.map(withoutProviderHome);
@@ -11038,11 +11042,12 @@ export function registerRunnersCommand(parent, deps = {}) {
11038
11042
  daemonReconcileCtx.env.HQ_ROOT = hqRoot;
11039
11043
  daemonReconcileCtx.cwd = () => hqRoot;
11040
11044
  daemonReconcileCtx.callerCwd = () => hqRoot;
11041
- await runReconcile(daemonReconcileCtx, { inProcess: true }, async (lane) => {
11042
- await messageHandlers.recoverQueuedMessages(daemonReconcileCtx, lane.lane_id);
11045
+ const passCtx = { ...daemonReconcileCtx };
11046
+ await runReconcile(passCtx, { inProcess: true }, async (lane) => {
11047
+ await messageHandlers.recoverQueuedMessages(passCtx, lane.lane_id);
11043
11048
  });
11044
11049
  });
11045
- monitorLaneMessageApis.set(parent, (laneId, payload) => messageHandlers.deliverMonitorLaneMessage(ctx, laneId, payload));
11050
+ monitorLaneMessageApis.set(parent, (laneId, payload) => messageHandlers.deliverMonitorLaneMessage({ ...ctx }, laneId, payload));
11046
11051
  const resumeHandlers = createLaneResumeHandlers({
11047
11052
  onLaneWorkerStarted: deps.onLaneWorkerStarted,
11048
11053
  archiveResumeMessage,