@indigoai-us/hq-cli 5.148.0 → 5.149.1

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 (38) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/assets/scaffold/core/scripts/checkpoint-stop-gate.sh +8 -11
  3. package/dist/command-catalog.generated.d.ts +129 -0
  4. package/dist/command-catalog.generated.js +168 -0
  5. package/dist/commands/lanes.js +506 -23
  6. package/dist/commands/mesh.js +82 -11
  7. package/dist/lib/lanes/index.d.ts +3 -2
  8. package/dist/lib/lanes/index.js +2 -1
  9. package/dist/lib/lanes/mesh-events.d.ts +8 -0
  10. package/dist/lib/lanes/mesh-events.js +83 -6
  11. package/dist/lib/lanes/outpost-dispatch.d.ts +12 -0
  12. package/dist/lib/lanes/outpost-dispatch.js +17 -0
  13. package/dist/lib/lanes/reconcile.js +39 -12
  14. package/dist/lib/lanes/session-relink.d.ts +25 -0
  15. package/dist/lib/lanes/session-relink.js +216 -0
  16. package/dist/lib/lanes/spawn.d.ts +1 -0
  17. package/dist/lib/lanes/spawn.js +48 -5
  18. package/dist/lib/lanes/store.js +109 -1
  19. package/dist/lib/lanes/stories.d.ts +17 -0
  20. package/dist/lib/lanes/stories.js +73 -0
  21. package/dist/lib/lanes/types.d.ts +20 -0
  22. package/dist/lib/lanes/types.js +9 -2
  23. package/dist/lib/lanes/watcher.js +69 -9
  24. package/dist/lib/mesh/live/daemon/doctor.d.ts +27 -0
  25. package/dist/lib/mesh/live/daemon/doctor.js +84 -0
  26. package/dist/lib/mesh/live/daemon/index.d.ts +3 -3
  27. package/dist/lib/mesh/live/daemon/index.js +2 -2
  28. package/dist/lib/mesh/live/daemon/install.d.ts +40 -0
  29. package/dist/lib/mesh/live/daemon/install.js +88 -0
  30. package/dist/lib/mesh/live/daemon/run.d.ts +2 -0
  31. package/dist/lib/mesh/live/daemon/run.js +12 -1
  32. package/dist/lib/mesh/live/daemon/state.d.ts +4 -0
  33. package/dist/lib/mesh/project-board.d.ts +15 -0
  34. package/dist/lib/mesh/project-board.js +84 -0
  35. package/dist/lib/work-context/prd-sync.d.ts +5 -1
  36. package/dist/lib/work-context/prd-sync.js +22 -1
  37. package/package.json +5 -3
  38. package/scripts/mesh-daemon-if-stale.mjs +16 -0
package/CHANGELOG.md CHANGED
@@ -2,6 +2,29 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [5.149.1] — 2026-09-23
6
+
7
+ ### Fixed
8
+
9
+ - The package now ships `scripts/mesh-daemon-if-stale.mjs`, which its postinstall step runs; a failure in that step never fails the install.
10
+
11
+ ### Added
12
+
13
+ - Lanes can carry several project stories with a warning for parallel active
14
+ work. Story commands now add, start, block, list, and complete carried work.
15
+ - Mesh lifecycle events include the story id, and board status moves through
16
+ `in_progress`, `blocked`, `review`, and senior-verified `done`. Missing
17
+ project views are repaired before a status patch is retried.
18
+
19
+ ### Fixed
20
+
21
+ - `hq mesh context prd-sync` adds missing Board stories before it emits, and
22
+ records a snapshot only for stories the server accepted or left unassigned.
23
+ A rejected story stays changed so the next `prd.json` write sends it again.
24
+ - The checkpoint Stop gate now accepts any non-whitespace reply by default.
25
+ `HQ_CHECKPOINT_REPLY_MIN` can still require a longer reply or disable the check.
26
+ - `hq lanes message` and text resumes now reach the lane's Outpost through the existing exec transport and report failure when delivery is not confirmed. Resumes keep the last known provider session id and recover its transcript from registered account homes before spawning.
27
+
5
28
  ## [5.148.0] — 2026-09-23
6
29
 
7
30
  ## [5.147.0] — 2026-09-23
@@ -13,6 +36,7 @@
13
36
  entries still refuse replacement.
14
37
  - `hq mesh context prd-sync` now moves the Board. Its task_status events carry the session's company and project, and take sequence numbers from the session's shared counter (the same file the hooks use), so the server no longer rejects them as duplicates. Rejections print their codes.
15
38
  - The mesh daemon no longer treats a missing company slug, a membership timeout, or a lookup error as proof that the device owner is not a member. A device-default session that was cleared to `needs_company` is checked once against the configured default company and, when that membership is active, the company is put back and held events flush. The same cleared session is not counted as a new denial on every later flush.
39
+ - `hq mesh daemon install` records the absolute path of the CLI that ran it (realpath of `process.argv[1]`) and the absolute node binary. It does not look up `hq` on `PATH`. The daemon logs `daemon version=<x> entry=<path>` at start and stores both in `daemon/state.json`. `hq mesh doctor` and `hq mesh daemon doctor` say when that record does not match this CLI and name `hq mesh daemon install` as the fix, and they list every `hq` on `PATH`. `hq mesh daemon install --if-stale` reinstalls and restarts only when this CLI is newer. The package postinstall runs that flag.
16
40
  - `hq mesh project ensure` no longer fails when the server refuses to close the extra genesis thread; it leaves that thread open and prints one line. Registration and the calling session's binding complete.
17
41
  - The mesh daemon re-checks a `needs_project` or unresolved session when it flushes that session's events. If the project Board is now an exact or clear catalog match, the batch is posted with that project and the session file is bound. A tie or near miss stays `needs_project`. The check runs at most once a minute per session.
18
42
 
@@ -620,26 +620,23 @@ exec 3>&2
620
620
 
621
621
  # Reply-owed enforcement (Claude runtime only). The checkpoint payload
622
622
  # goes to the background sibling, never the user. A genuine turn that did
623
- # work and reaches a satisfying checkpoint with (next to) no assistant
624
- # text after its last WORK tool call is a turn whose user-facing reply is
625
- # missing, however rich the checkpoint flags are: block once and demand
626
- # the reply. The window deliberately crosses this gate's own feedback
623
+ # work and reaches a satisfying checkpoint must have some user-facing text
624
+ # after its last WORK tool call. The window crosses this gate's feedback
627
625
  # boundaries and accepts a reply on either side of the checkpoint, so an
628
626
  # agent that replied and then checkpointed is never told to repeat itself
629
627
  # (double-messaging is the failure the reply-aware block variants exist
630
628
  # to prevent). Evidence (transcript audit 2026-08-19, 1471 stop-gate
631
629
  # checkpoint turns): 2.7% ended with no reply anywhere while the substance
632
630
  # lived only in the checkpoint payload. The nudge fires at most once per
633
- # checkpoint tool id (stamped in hook-state), so a legitimately terse turn
634
- # costs exactly one extra Stop round-trip and the gate can never loop.
635
- # Codex is excluded: its Stop feedback is a synthetic re-prompt with its
636
- # own delivery contract. HQ_CHECKPOINT_REPLY_MIN overrides the minimum
637
- # non-whitespace character threshold; 0 disables the enforcement.
631
+ # checkpoint tool id (stamped in hook-state). By default, any non-whitespace
632
+ # reply counts, including a terse reply such as "done.". Codex is excluded:
633
+ # its Stop feedback is a synthetic re-prompt with its own delivery contract.
634
+ # HQ_CHECKPOINT_REPLY_MIN can require a longer reply; 0 disables enforcement.
638
635
  if [ "$satisfied" = "1" ] && [ "$runtime" = "claude" ] \
639
636
  && [ "$reply_required" = "1" ] && [ -n "$reply_tool_id" ] \
640
637
  && [ "$reply_evidence_ambiguous" != "1" ]; then
641
- reply_min="${HQ_CHECKPOINT_REPLY_MIN:-80}"
642
- case "$reply_min" in ''|*[!0-9]*) reply_min=80 ;; esac
638
+ reply_min="${HQ_CHECKPOINT_REPLY_MIN:-1}"
639
+ case "$reply_min" in ''|*[!0-9]*) reply_min=1 ;; esac
643
640
  case "$reply_chars" in ''|*[!0-9]*) reply_chars=0 ;; esac
644
641
  if [ "$reply_min" -gt 0 ] && [ "$reply_chars" -lt "$reply_min" ] && [ "$block_count" -lt 3 ]; then
645
642
  nudge_file="$state_dir/checkpoint-reply-nudge-$session_key"
@@ -6700,6 +6700,9 @@ export declare const COMMAND_CATALOG: readonly [{
6700
6700
  }, {
6701
6701
  readonly flags: "--hq-root <path>";
6702
6702
  readonly description: "HQ root to record for the service (else HQ_ROOT, else the nearest HQ root above cwd)";
6703
+ }, {
6704
+ readonly flags: "--if-stale";
6705
+ readonly description: "Reinstall and restart only when this CLI is newer than the daemon's recorded version";
6703
6706
  }, {
6704
6707
  readonly flags: "--json";
6705
6708
  readonly description: "Print machine-readable JSON";
@@ -6770,6 +6773,9 @@ export declare const COMMAND_CATALOG: readonly [{
6770
6773
  }, {
6771
6774
  readonly flags: "--story <id>";
6772
6775
  readonly description: "Story id from the project's prd.json";
6776
+ }, {
6777
+ readonly flags: "--additional-story <id>";
6778
+ readonly description: "Additional story carried by this lane; repeatable and discouraged when active";
6773
6779
  }, {
6774
6780
  readonly flags: "--brief-file <path>";
6775
6781
  readonly description: "Path to the lane brief";
@@ -6888,6 +6894,129 @@ export declare const COMMAND_CATALOG: readonly [{
6888
6894
  readonly description: "JSON on stdout (always)";
6889
6895
  }];
6890
6896
  readonly subcommands: readonly [];
6897
+ }, {
6898
+ readonly name: "story";
6899
+ readonly description: "Track several project stories on one lane";
6900
+ readonly aliases: readonly [];
6901
+ readonly hidden: false;
6902
+ readonly usage: "[options] [command]";
6903
+ readonly arguments: readonly [];
6904
+ readonly options: readonly [];
6905
+ readonly subcommands: readonly [{
6906
+ readonly name: "list";
6907
+ readonly description: "List the stories carried by a lane";
6908
+ readonly aliases: readonly [];
6909
+ readonly hidden: false;
6910
+ readonly usage: "[options] <lane-id>";
6911
+ readonly arguments: readonly [{
6912
+ readonly name: "lane-id";
6913
+ readonly required: true;
6914
+ readonly variadic: false;
6915
+ }];
6916
+ readonly options: readonly [{
6917
+ readonly flags: "--json";
6918
+ readonly description: "JSON on stdout (always)";
6919
+ }];
6920
+ readonly subcommands: readonly [];
6921
+ }, {
6922
+ readonly name: "add";
6923
+ readonly description: "Add and start another story on a lane";
6924
+ readonly aliases: readonly [];
6925
+ readonly hidden: false;
6926
+ readonly usage: "[options] <lane-id> <story-id>";
6927
+ readonly arguments: readonly [{
6928
+ readonly name: "lane-id";
6929
+ readonly required: true;
6930
+ readonly variadic: false;
6931
+ }, {
6932
+ readonly name: "story-id";
6933
+ readonly required: true;
6934
+ readonly variadic: false;
6935
+ }];
6936
+ readonly options: readonly [{
6937
+ readonly flags: "--project <slug>";
6938
+ readonly description: "Project id; defaults to the lane's current project";
6939
+ }, {
6940
+ readonly flags: "--json";
6941
+ readonly description: "JSON on stdout (always)";
6942
+ }];
6943
+ readonly subcommands: readonly [];
6944
+ }, {
6945
+ readonly name: "start";
6946
+ readonly description: "Start or resume a carried story";
6947
+ readonly aliases: readonly [];
6948
+ readonly hidden: false;
6949
+ readonly usage: "[options] <lane-id> <story-id>";
6950
+ readonly arguments: readonly [{
6951
+ readonly name: "lane-id";
6952
+ readonly required: true;
6953
+ readonly variadic: false;
6954
+ }, {
6955
+ readonly name: "story-id";
6956
+ readonly required: true;
6957
+ readonly variadic: false;
6958
+ }];
6959
+ readonly options: readonly [{
6960
+ readonly flags: "--project <slug>";
6961
+ readonly description: "Project id; defaults to the lane's current project";
6962
+ }, {
6963
+ readonly flags: "--json";
6964
+ readonly description: "JSON on stdout (always)";
6965
+ }];
6966
+ readonly subcommands: readonly [];
6967
+ }, {
6968
+ readonly name: "block";
6969
+ readonly description: "Mark one carried story blocked";
6970
+ readonly aliases: readonly [];
6971
+ readonly hidden: false;
6972
+ readonly usage: "[options] <lane-id> <story-id>";
6973
+ readonly arguments: readonly [{
6974
+ readonly name: "lane-id";
6975
+ readonly required: true;
6976
+ readonly variadic: false;
6977
+ }, {
6978
+ readonly name: "story-id";
6979
+ readonly required: true;
6980
+ readonly variadic: false;
6981
+ }];
6982
+ readonly options: readonly [{
6983
+ readonly flags: "--reason <text>";
6984
+ readonly description: "Why the story is blocked";
6985
+ }, {
6986
+ readonly flags: "--project <slug>";
6987
+ readonly description: "Project id; defaults to the lane's current project";
6988
+ }, {
6989
+ readonly flags: "--json";
6990
+ readonly description: "JSON on stdout (always)";
6991
+ }];
6992
+ readonly subcommands: readonly [];
6993
+ }, {
6994
+ readonly name: "done";
6995
+ readonly description: "Mark a reviewed story done after senior verification";
6996
+ readonly aliases: readonly [];
6997
+ readonly hidden: false;
6998
+ readonly usage: "[options] <lane-id> <story-id>";
6999
+ readonly arguments: readonly [{
7000
+ readonly name: "lane-id";
7001
+ readonly required: true;
7002
+ readonly variadic: false;
7003
+ }, {
7004
+ readonly name: "story-id";
7005
+ readonly required: true;
7006
+ readonly variadic: false;
7007
+ }];
7008
+ readonly options: readonly [{
7009
+ readonly flags: "--verified";
7010
+ readonly description: "Confirm senior review or merge";
7011
+ }, {
7012
+ readonly flags: "--project <slug>";
7013
+ readonly description: "Project id; defaults to the lane's current project";
7014
+ }, {
7015
+ readonly flags: "--json";
7016
+ readonly description: "JSON on stdout (always)";
7017
+ }];
7018
+ readonly subcommands: readonly [];
7019
+ }];
6891
7020
  }, {
6892
7021
  readonly name: "message";
6893
7022
  readonly description: "Send a follow-up message to a lane";
@@ -8660,6 +8660,10 @@ export const COMMAND_CATALOG = [
8660
8660
  "flags": "--hq-root <path>",
8661
8661
  "description": "HQ root to record for the service (else HQ_ROOT, else the nearest HQ root above cwd)"
8662
8662
  },
8663
+ {
8664
+ "flags": "--if-stale",
8665
+ "description": "Reinstall and restart only when this CLI is newer than the daemon's recorded version"
8666
+ },
8663
8667
  {
8664
8668
  "flags": "--json",
8665
8669
  "description": "Print machine-readable JSON"
@@ -8749,6 +8753,10 @@ export const COMMAND_CATALOG = [
8749
8753
  "flags": "--story <id>",
8750
8754
  "description": "Story id from the project's prd.json"
8751
8755
  },
8756
+ {
8757
+ "flags": "--additional-story <id>",
8758
+ "description": "Additional story carried by this lane; repeatable and discouraged when active"
8759
+ },
8752
8760
  {
8753
8761
  "flags": "--brief-file <path>",
8754
8762
  "description": "Path to the lane brief"
@@ -8904,6 +8912,166 @@ export const COMMAND_CATALOG = [
8904
8912
  ],
8905
8913
  "subcommands": []
8906
8914
  },
8915
+ {
8916
+ "name": "story",
8917
+ "description": "Track several project stories on one lane",
8918
+ "aliases": [],
8919
+ "hidden": false,
8920
+ "usage": "[options] [command]",
8921
+ "arguments": [],
8922
+ "options": [],
8923
+ "subcommands": [
8924
+ {
8925
+ "name": "list",
8926
+ "description": "List the stories carried by a lane",
8927
+ "aliases": [],
8928
+ "hidden": false,
8929
+ "usage": "[options] <lane-id>",
8930
+ "arguments": [
8931
+ {
8932
+ "name": "lane-id",
8933
+ "required": true,
8934
+ "variadic": false
8935
+ }
8936
+ ],
8937
+ "options": [
8938
+ {
8939
+ "flags": "--json",
8940
+ "description": "JSON on stdout (always)"
8941
+ }
8942
+ ],
8943
+ "subcommands": []
8944
+ },
8945
+ {
8946
+ "name": "add",
8947
+ "description": "Add and start another story on a lane",
8948
+ "aliases": [],
8949
+ "hidden": false,
8950
+ "usage": "[options] <lane-id> <story-id>",
8951
+ "arguments": [
8952
+ {
8953
+ "name": "lane-id",
8954
+ "required": true,
8955
+ "variadic": false
8956
+ },
8957
+ {
8958
+ "name": "story-id",
8959
+ "required": true,
8960
+ "variadic": false
8961
+ }
8962
+ ],
8963
+ "options": [
8964
+ {
8965
+ "flags": "--project <slug>",
8966
+ "description": "Project id; defaults to the lane's current project"
8967
+ },
8968
+ {
8969
+ "flags": "--json",
8970
+ "description": "JSON on stdout (always)"
8971
+ }
8972
+ ],
8973
+ "subcommands": []
8974
+ },
8975
+ {
8976
+ "name": "start",
8977
+ "description": "Start or resume a carried story",
8978
+ "aliases": [],
8979
+ "hidden": false,
8980
+ "usage": "[options] <lane-id> <story-id>",
8981
+ "arguments": [
8982
+ {
8983
+ "name": "lane-id",
8984
+ "required": true,
8985
+ "variadic": false
8986
+ },
8987
+ {
8988
+ "name": "story-id",
8989
+ "required": true,
8990
+ "variadic": false
8991
+ }
8992
+ ],
8993
+ "options": [
8994
+ {
8995
+ "flags": "--project <slug>",
8996
+ "description": "Project id; defaults to the lane's current project"
8997
+ },
8998
+ {
8999
+ "flags": "--json",
9000
+ "description": "JSON on stdout (always)"
9001
+ }
9002
+ ],
9003
+ "subcommands": []
9004
+ },
9005
+ {
9006
+ "name": "block",
9007
+ "description": "Mark one carried story blocked",
9008
+ "aliases": [],
9009
+ "hidden": false,
9010
+ "usage": "[options] <lane-id> <story-id>",
9011
+ "arguments": [
9012
+ {
9013
+ "name": "lane-id",
9014
+ "required": true,
9015
+ "variadic": false
9016
+ },
9017
+ {
9018
+ "name": "story-id",
9019
+ "required": true,
9020
+ "variadic": false
9021
+ }
9022
+ ],
9023
+ "options": [
9024
+ {
9025
+ "flags": "--reason <text>",
9026
+ "description": "Why the story is blocked"
9027
+ },
9028
+ {
9029
+ "flags": "--project <slug>",
9030
+ "description": "Project id; defaults to the lane's current project"
9031
+ },
9032
+ {
9033
+ "flags": "--json",
9034
+ "description": "JSON on stdout (always)"
9035
+ }
9036
+ ],
9037
+ "subcommands": []
9038
+ },
9039
+ {
9040
+ "name": "done",
9041
+ "description": "Mark a reviewed story done after senior verification",
9042
+ "aliases": [],
9043
+ "hidden": false,
9044
+ "usage": "[options] <lane-id> <story-id>",
9045
+ "arguments": [
9046
+ {
9047
+ "name": "lane-id",
9048
+ "required": true,
9049
+ "variadic": false
9050
+ },
9051
+ {
9052
+ "name": "story-id",
9053
+ "required": true,
9054
+ "variadic": false
9055
+ }
9056
+ ],
9057
+ "options": [
9058
+ {
9059
+ "flags": "--verified",
9060
+ "description": "Confirm senior review or merge"
9061
+ },
9062
+ {
9063
+ "flags": "--project <slug>",
9064
+ "description": "Project id; defaults to the lane's current project"
9065
+ },
9066
+ {
9067
+ "flags": "--json",
9068
+ "description": "JSON on stdout (always)"
9069
+ }
9070
+ ],
9071
+ "subcommands": []
9072
+ }
9073
+ ]
9074
+ },
8907
9075
  {
8908
9076
  "name": "message",
8909
9077
  "description": "Send a follow-up message to a lane",