@indigoai-us/hq-cli 5.345.273 → 5.345.274
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 +17 -0
- package/contracts/host-canary-release.json +8 -7
- package/dist/lib/hook-engine/canary-gate.d.ts +2 -0
- package/dist/lib/hook-engine/canary-gate.js +22 -2
- package/dist/lib/hook-engine/coverage.d.ts +1 -1
- package/dist/lib/hook-engine/coverage.js +2 -1
- package/dist/lib/hook-engine/native-stop-compatibility.json +2 -1
- package/dist/lib/hook-engine/stable-link.d.ts +21 -0
- package/dist/lib/hook-engine/stable-link.js +37 -0
- package/package.json +7 -7
- package/scripts/install-hook-engine.mjs +24 -5
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,23 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [5.345.274] — 2026-12-01
|
|
6
|
+
- Move `a_company_post_tool_use_hook_past_two_seconds_is_killed_alike_on_both_paths` (an 8+ s real `sleep 30` child-kill test in `agents_v2_post_tool_use_parity.rs`) into `HQ_HOOK_REAL_TIME_FILTER` in both `hq-hook-pr.yml` and `hq-hook-macos-pr.yml` so it runs on the daily schedule instead of PR shards.
|
|
7
|
+
- Changed: with the repository variable HQ_MACOS_PER_BATCH set to on, the native macOS hq-hook tests run once per batch train commit (the whole PR tier) instead of on every pull request push, and the batch train merges a batch that reaches the hook paths only when that check passed on the train commit. A pull request runs them on demand with the run-macos-native label. Unset, nothing changes.
|
|
8
|
+
- Fixed auto-checkpoint-trigger git dirty detection to treat binary files (NUL byte within the first 8,000 bytes) under `text=auto` or `core.autocrlf` as stored as-is, preventing false refusals on racy-clean image assets while keeping explicit `text` and CRLF text files fail-closed.
|
|
9
|
+
- Fixed host-canary snapshot creation to include an empty companies/ directory so disposable snapshots satisfy HQ-root validation without copying live company data.
|
|
10
|
+
- Fixed: `hq-hook run --host` now honors per-port `hook-engine-port-*` flags (all 18 `HOOK_IDS`) using the shared `snapshot-v2` / daemon-state reader with the 15-minute freshness bound and logs per-port mode entries to `~/.hq/logs/hook-engine.jsonl`. An explicit `false` override runs the hook's bash script when present on disk; when no bash script is present, guard ports stay native (`fallback_unavailable_kept_native`) and non-guard ports skip (`skipped`).
|
|
11
|
+
- Fixed: Explicit reinstall of an older `@indigoai-us/hq-cli` version now moves `~/.hq/bin/hq-hook/stable` back to that version's hook engine during postinstall, while accidental downgrades from other callers remain refused.
|
|
12
|
+
- Isolate the shell and native test roots in `agents_v2_session_end::a_hung_hook_under_the_p347_budget_clock_is_handed_back_and_skipped_by_name` so a late orphaned child from the timed-out shell run cannot race into the native run's marker file under runner load.
|
|
13
|
+
- Updated `contracts/host-canary-release.json` with the Claude Code host canary records for hq-cli 5.345.274.
|
|
14
|
+
- Changed: native hooks accept the next hq-core `.claude/hooks/master-hook.sh` (`0ab08d73`, `hq-core-staging#2192`), which drops an unused engine call, for PreToolUse and Stop.
|
|
15
|
+
- Decouple the `hq-hook` source build digest from `package.json` version bumps and key `scripts/release-canary.mjs` and `src/lib/hook-engine/canary-gate.ts` to the hook-engine source tree hash (`engineSourceSha256`), so unchanged hook-engine releases reuse a fresh passing canary end-to-end while failing closed whenever any hook-engine source input or build target changes.
|
|
16
|
+
- The agents-v2 company hook cut test now runs at a 200 ms per-hook limit that only test builds can set, so it no longer waits on a real 2-second limit; a new test checks that a PreToolUse hook cut at that limit still blocks.
|
|
17
|
+
- Split the agents-v2 company PostToolUse hook test so its refusal and crash cases no longer share one call with a 1-second hook timeout, so the macOS hook tests stop failing on busy build Macs.
|
|
18
|
+
- Set `HQ_HOOK_DEDUPE_WINDOW=60` in `folder_hooks_codex_grok_lifecycle_parity.rs` (matching `session_start_master.rs` and `agents_v2_subagent_stop_parity.rs`) so the twin-event parity test checks lock sharing rather than the default 5 s wall-clock window under runner load.
|
|
19
|
+
- Bind the `Rng::pick` result before passing it to `pem` in the PostToolUse output-redaction test suite so the test target compiles on Rust 1.95.0 and passes Clippy on Rust 1.100.0.
|
|
20
|
+
- Fix two load-sensitive timing flakes in `hq-hook` tests: refresh the synthetic 12 s `refreshed_at` timestamp in `fleet_merge_hold_parity.rs` right before the native `hq-hook` invocation so a slow bash pass cannot expire the 20 s window before `hq-hook` starts, and clear `HQD_SHIM_DEADLINE_MS` in a transparent `perl` wrapper for `Daemon::Busy` in `session_start_hqd_open.rs` so bash startup under load does not expire the 300 ms shim budget before `perl` connects.
|
|
21
|
+
|
|
5
22
|
## [5.345.273] — 2026-12-01
|
|
6
23
|
- Fixed: hosted agents (`agents-v2`) on the v2.71 release-line hook adapter that carries the `hq-agents-v2` #364 PreToolUse payload fix (`b6db50be`) keep native hook registration. `hq-hook` now answers `PreToolUse`, `PostToolUse`, `UserPromptSubmit`, `SessionStart`, `SessionEnd` and `SubagentStop` natively for that adapter, as it already does for the main-line #364 adapter (`15fa77e8`), and still hands `Stop` to the adapter. An adapter revision `hq-hook` does not know still runs every event through the adapter, and the reason it gives no longer names only #332.
|
|
7
24
|
- Updated `contracts/host-canary-release.json` with the Claude Code host canary records for hq-cli 5.345.273.
|
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema": "hq.host-canary-release.v1",
|
|
3
|
-
"cliVersion": "5.345.
|
|
3
|
+
"cliVersion": "5.345.274",
|
|
4
|
+
"engineSourceSha256": "819bcbe74ce86e558fc8ffc97ad39d1967bec108866a1be4c59ef779a6ed5db2",
|
|
4
5
|
"hosts": {
|
|
5
6
|
"claude": [
|
|
6
7
|
{
|
|
7
8
|
"passed": true,
|
|
8
|
-
"at": "2026-12-
|
|
9
|
-
"engineVersion": "0.3.1+hq.5.345.
|
|
9
|
+
"at": "2026-12-01T01:49:19.303Z",
|
|
10
|
+
"engineVersion": "0.3.1+hq.5.345.274.src.26bc267875a24662656ea518ef7f7a702c6327c741ceafdcc4f4f5a48cb770dc",
|
|
10
11
|
"gateSha256": "a2879dfe692233f5953bac86672947bbd82f3c5247292f3efcb80f16c3d2c6b1"
|
|
11
12
|
},
|
|
12
13
|
{
|
|
13
14
|
"passed": true,
|
|
14
|
-
"at": "2026-12-
|
|
15
|
-
"engineVersion": "0.3.1+hq.5.345.
|
|
15
|
+
"at": "2026-12-01T01:49:53.957Z",
|
|
16
|
+
"engineVersion": "0.3.1+hq.5.345.274.src.26bc267875a24662656ea518ef7f7a702c6327c741ceafdcc4f4f5a48cb770dc",
|
|
16
17
|
"gateSha256": "ca58a94859eae0a345c11c8d9c59303eb76350dc1cf223391037d21979c28718"
|
|
17
18
|
},
|
|
18
19
|
{
|
|
19
20
|
"passed": true,
|
|
20
|
-
"at": "2026-12-
|
|
21
|
-
"engineVersion": "0.3.1+hq.5.345.
|
|
21
|
+
"at": "2026-12-01T01:50:49.692Z",
|
|
22
|
+
"engineVersion": "0.3.1+hq.5.345.274.src.26bc267875a24662656ea518ef7f7a702c6327c741ceafdcc4f4f5a48cb770dc",
|
|
22
23
|
"gateSha256": "ecdbab7c2e0a1d94eb9c98f15e760390f215bc7115a217ded24b4275322722d2"
|
|
23
24
|
}
|
|
24
25
|
]
|
|
@@ -70,6 +70,8 @@ export interface ReleaseCanary {
|
|
|
70
70
|
schema: typeof RELEASE_CANARY_SCHEMA;
|
|
71
71
|
/** The CLI release the file was made for. */
|
|
72
72
|
cliVersion: string;
|
|
73
|
+
/** Optional SHA-256 of the hook-engine source inputs when the canary ran. */
|
|
74
|
+
engineSourceSha256?: string;
|
|
73
75
|
hosts: Partial<Record<CanaryHost, ReleaseCanaryRun[]>>;
|
|
74
76
|
}
|
|
75
77
|
/** The release canary file inside this CLI's own package. */
|
|
@@ -142,6 +142,25 @@ function short(hash) {
|
|
|
142
142
|
export const RELEASE_CANARY_FILE = path.join('contracts', 'host-canary-release.json');
|
|
143
143
|
/** Schema of [`RELEASE_CANARY_FILE`]. */
|
|
144
144
|
export const RELEASE_CANARY_SCHEMA = 'hq.host-canary-release.v1';
|
|
145
|
+
const ENGINE_VERSION_RE = /^([^+\s]+)\+hq\.([0-9A-Za-z.-]+)\.src\.([0-9a-f]{64})$/;
|
|
146
|
+
/**
|
|
147
|
+
* True when a shipped canary run's `engineVersion` covers `expectedEngineVersion`:
|
|
148
|
+
* - always when exact strings match; or
|
|
149
|
+
* - when the shipped file carries a valid `engineSourceSha256` (opt-in
|
|
150
|
+
* source-hash-keyed canary) and both versions share the exact same crate
|
|
151
|
+
* version and 64-hex `.src.<digest>` (meaning identical hook-engine source
|
|
152
|
+
* inputs and identical build target/config, differing only in `+hq.<cli>`).
|
|
153
|
+
*/
|
|
154
|
+
function shippedRunMatchesEngine(runEngineVersion, expectedEngineVersion, release) {
|
|
155
|
+
if (runEngineVersion === expectedEngineVersion)
|
|
156
|
+
return true;
|
|
157
|
+
if (typeof release.engineSourceSha256 !== 'string' || !/^[0-9a-f]{64}$/.test(release.engineSourceSha256)) {
|
|
158
|
+
return false;
|
|
159
|
+
}
|
|
160
|
+
const runMatch = ENGINE_VERSION_RE.exec(runEngineVersion);
|
|
161
|
+
const expectedMatch = ENGINE_VERSION_RE.exec(expectedEngineVersion);
|
|
162
|
+
return Boolean(runMatch && expectedMatch && runMatch[1] === expectedMatch[1] && runMatch[3] === expectedMatch[3]);
|
|
163
|
+
}
|
|
145
164
|
/** The release canary file inside this CLI's own package. */
|
|
146
165
|
export function defaultReleaseCanaryPath() {
|
|
147
166
|
// src/lib/hook-engine and dist/lib/hook-engine both sit three levels below the package root.
|
|
@@ -200,7 +219,7 @@ export function releaseCanaryRefusal(release, expected) {
|
|
|
200
219
|
const runs = Array.isArray(listed) ? listed.filter((run) => run && typeof run === 'object') : [];
|
|
201
220
|
if (runs.length === 0)
|
|
202
221
|
return `no shipped host canary result for ${expected.host}`;
|
|
203
|
-
const same = runs.filter((run) => run.engineVersion
|
|
222
|
+
const same = runs.filter((run) => shippedRunMatchesEngine(run.engineVersion, expected.engineVersion, release) && run.gateSha256 === expected.gateSha256);
|
|
204
223
|
if (same.some((run) => run.passed !== true))
|
|
205
224
|
return `a shipped ${expected.host} canary for this hq-hook build and hq-core gate failed`;
|
|
206
225
|
let first = null;
|
|
@@ -209,7 +228,8 @@ export function releaseCanaryRefusal(release, expected) {
|
|
|
209
228
|
// bound to one exact build, so it does not age out on the user's machine.
|
|
210
229
|
// Freshness is checked when the release is published; a run dated in the
|
|
211
230
|
// future is still refused.
|
|
212
|
-
const
|
|
231
|
+
const matchedEngine = shippedRunMatchesEngine(run.engineVersion, expected.engineVersion, release);
|
|
232
|
+
const refusal = canaryRefusal({ schema: CANARY_RECORD_SCHEMA, hosts: { [expected.host]: run } }, { ...expected, engineVersion: matchedEngine ? run.engineVersion : expected.engineVersion, maxAgeMs: Number.POSITIVE_INFINITY });
|
|
213
233
|
if (refusal === null)
|
|
214
234
|
return null;
|
|
215
235
|
first ??= refusal.replace(`the last ${expected.host} canary`, `the shipped ${expected.host} canary`);
|
|
@@ -346,7 +346,7 @@ export declare function grokPreToolUseHold(root: string, shadow: boolean): strin
|
|
|
346
346
|
/**
|
|
347
347
|
* The dispatcher files the native PreToolUse master model reproduces, in its check order:
|
|
348
348
|
* crates/hq-hook/src/pre_tool_use_master.rs `DISPATCHER_PINS`. master-hook.sh is v16.0.48 (1a2439ae),
|
|
349
|
-
* v16.0.50 (774bca73), v16.0.49 (d5049d5f), v16.0.51 (443272ef) or v16.0.52 (ab46ebdf, and hq-core-staging #2152's f9a32c25, which only scopes the folder hook limit by event; v16.0.51 plus a PostToolUse-only
|
|
349
|
+
* v16.0.50 (774bca73), v16.0.49 (d5049d5f), v16.0.51 (443272ef) or v16.0.52 (ab46ebdf, and hq-core-staging #2152's f9a32c25, which only scopes the folder hook limit by event, and #2192's 0ab08d73, f9a32c25 without the unused hq-hook bridge; v16.0.51 plus a PostToolUse-only
|
|
350
350
|
* prefilter text for MCP tools), whose session-id alias record the native bind writes too; hook-adapter-core.sh is held per host below; hqd-hook-shim.sh is the released ab289ac0 or the
|
|
351
351
|
* hq-core-staging fd709b39a ee5e9fe7 or the hq-core v16.0.53 d1d7e7d0 (hq-core-staging #2024, whose new
|
|
352
352
|
* branches run only on an error answer from hqd, which the model never asks), and session-id.sh the released 2ebbc508 or the fd709b39a
|
|
@@ -2298,7 +2298,7 @@ export function grokPreToolUseHold(root, shadow) {
|
|
|
2298
2298
|
/**
|
|
2299
2299
|
* The dispatcher files the native PreToolUse master model reproduces, in its check order:
|
|
2300
2300
|
* crates/hq-hook/src/pre_tool_use_master.rs `DISPATCHER_PINS`. master-hook.sh is v16.0.48 (1a2439ae),
|
|
2301
|
-
* v16.0.50 (774bca73), v16.0.49 (d5049d5f), v16.0.51 (443272ef) or v16.0.52 (ab46ebdf, and hq-core-staging #2152's f9a32c25, which only scopes the folder hook limit by event; v16.0.51 plus a PostToolUse-only
|
|
2301
|
+
* v16.0.50 (774bca73), v16.0.49 (d5049d5f), v16.0.51 (443272ef) or v16.0.52 (ab46ebdf, and hq-core-staging #2152's f9a32c25, which only scopes the folder hook limit by event, and #2192's 0ab08d73, f9a32c25 without the unused hq-hook bridge; v16.0.51 plus a PostToolUse-only
|
|
2302
2302
|
* prefilter text for MCP tools), whose session-id alias record the native bind writes too; hook-adapter-core.sh is held per host below; hqd-hook-shim.sh is the released ab289ac0 or the
|
|
2303
2303
|
* hq-core-staging fd709b39a ee5e9fe7 or the hq-core v16.0.53 d1d7e7d0 (hq-core-staging #2024, whose new
|
|
2304
2304
|
* branches run only on an error answer from hqd, which the model never asks), and session-id.sh the released 2ebbc508 or the fd709b39a
|
|
@@ -2332,6 +2332,7 @@ export const PRE_TOOL_USE_DISPATCHER_PINS = [
|
|
|
2332
2332
|
'ab46ebdf0cc84a90dd95a54417817f9f9023b109d5b3710c472a8f5e89061592',
|
|
2333
2333
|
'f9a32c25f5984856a1bb91a7914495577e505c42a8c02831acf8faf049a9a806',
|
|
2334
2334
|
'711fb6d2ba7a3b126ddbbcc83e6f14a59178a75f4b856d8a4e64f67b586cabbd',
|
|
2335
|
+
'0ab08d73256bed402bc961cb64e35b0826c2d6125df234102c8b8bf4c1072de3',
|
|
2335
2336
|
],
|
|
2336
2337
|
},
|
|
2337
2338
|
{ relative: '.claude/hooks/turn-timing.sh', accepted: ['97c70a3251225ba9e469e41fd3fe2341cfe2936490f54571d2ca16de8e766443'] },
|
|
@@ -386,7 +386,8 @@
|
|
|
386
386
|
"1a2439aee50652c5143ccd18561a0aa84a1e94848d02c1aa1c99157f70023f29",
|
|
387
387
|
"d5049d5fb38d2b33467d493a4a136df8f6d9021c29e722df0d1e6a17d7f452ab",
|
|
388
388
|
"774bca73a2e806b4d9ad96b803525bdf25afd2265d63c9216881aa4ced403f16",
|
|
389
|
-
"f9a32c25f5984856a1bb91a7914495577e505c42a8c02831acf8faf049a9a806"
|
|
389
|
+
"f9a32c25f5984856a1bb91a7914495577e505c42a8c02831acf8faf049a9a806",
|
|
390
|
+
"0ab08d73256bed402bc961cb64e35b0826c2d6125df234102c8b8bf4c1072de3"
|
|
390
391
|
]
|
|
391
392
|
}
|
|
392
393
|
}
|
|
@@ -63,6 +63,27 @@ export interface LinkStableEngineOptions {
|
|
|
63
63
|
* downgrade ([`LinkStableEngineOptions.allowDowngrade`]).
|
|
64
64
|
*/
|
|
65
65
|
export declare function linkStableEngine(pinned: string, home: string, platform?: NodeJS.Platform, options?: LinkStableEngineOptions): string;
|
|
66
|
+
/** Result of an explicit postinstall downgrade of `<home>/.hq/bin/hq-hook/stable`. */
|
|
67
|
+
export interface StableDowngradeResult {
|
|
68
|
+
stable: string;
|
|
69
|
+
from: string;
|
|
70
|
+
to: string;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Move `<home>/.hq/bin/hq-hook/stable` back to `pinned` only when `stable`
|
|
74
|
+
* already exists as a link to a strictly newer engine version. Called solely
|
|
75
|
+
* from `scripts/install-hook-engine.mjs` (postinstall) so an explicit install
|
|
76
|
+
* of an older `hq-cli` version brings that version's hook engine back into use
|
|
77
|
+
* on registered hooks.
|
|
78
|
+
*
|
|
79
|
+
* Upgrades, equal versions, non-semver targets, and homes with no `stable`
|
|
80
|
+
* link are left untouched (upgrades continue to wait for the canary-gated
|
|
81
|
+
* `hq reindex`). Accidental downgrades from other callers still hit
|
|
82
|
+
* [`StableDowngradeRefused`] in [`linkStableEngine`].
|
|
83
|
+
*/
|
|
84
|
+
export declare function downgradeStableEngineOnInstall(pinned: string, home?: string, platform?: NodeJS.Platform, options?: {
|
|
85
|
+
now?: () => number;
|
|
86
|
+
}): StableDowngradeResult | null;
|
|
66
87
|
/** A real folder or file (not a link) of this user that group and others cannot write. */
|
|
67
88
|
export declare function checkOwnedEntry(entry: string, kind: 'folder' | 'file', platform: NodeJS.Platform): void;
|
|
68
89
|
/** True when the link resolves to `folder` (Windows reports junction targets in its own spelling). */
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
* CLI when the pinned engine was canary-accepted on this machine.
|
|
20
20
|
*/
|
|
21
21
|
import * as fs from 'node:fs';
|
|
22
|
+
import { homedir } from 'node:os';
|
|
22
23
|
import * as path from 'node:path';
|
|
23
24
|
/** Name of the release-stable link next to the pinned engine versions. */
|
|
24
25
|
export const STABLE_LINK_NAME = 'stable';
|
|
@@ -278,6 +279,42 @@ export function linkStableEngine(pinned, home, platform = process.platform, opti
|
|
|
278
279
|
}
|
|
279
280
|
return stableEnginePath(pinned, home);
|
|
280
281
|
}
|
|
282
|
+
/**
|
|
283
|
+
* Move `<home>/.hq/bin/hq-hook/stable` back to `pinned` only when `stable`
|
|
284
|
+
* already exists as a link to a strictly newer engine version. Called solely
|
|
285
|
+
* from `scripts/install-hook-engine.mjs` (postinstall) so an explicit install
|
|
286
|
+
* of an older `hq-cli` version brings that version's hook engine back into use
|
|
287
|
+
* on registered hooks.
|
|
288
|
+
*
|
|
289
|
+
* Upgrades, equal versions, non-semver targets, and homes with no `stable`
|
|
290
|
+
* link are left untouched (upgrades continue to wait for the canary-gated
|
|
291
|
+
* `hq reindex`). Accidental downgrades from other callers still hit
|
|
292
|
+
* [`StableDowngradeRefused`] in [`linkStableEngine`].
|
|
293
|
+
*/
|
|
294
|
+
export function downgradeStableEngineOnInstall(pinned, home = homedir(), platform = process.platform, options = {}) {
|
|
295
|
+
const stable = path.join(hookEngineDir(home), STABLE_LINK_NAME);
|
|
296
|
+
let current;
|
|
297
|
+
try {
|
|
298
|
+
current = fs.lstatSync(stable);
|
|
299
|
+
}
|
|
300
|
+
catch (error) {
|
|
301
|
+
if (error.code === 'ENOENT')
|
|
302
|
+
return null;
|
|
303
|
+
throw error;
|
|
304
|
+
}
|
|
305
|
+
if (!current.isSymbolicLink())
|
|
306
|
+
return null;
|
|
307
|
+
const linked = stableLinkVersion(home);
|
|
308
|
+
const targetVersion = engineVersionOf(pinned, home);
|
|
309
|
+
if (!linked || !targetVersion)
|
|
310
|
+
return null;
|
|
311
|
+
const order = compareEngineVersions(targetVersion, linked);
|
|
312
|
+
if (order === null || order >= 0)
|
|
313
|
+
return null;
|
|
314
|
+
linkStableEngine(pinned, home, platform, { allowDowngrade: true, now: options.now });
|
|
315
|
+
appendStableHealLog(home, `explicit install moved ${stable} from ${linked} to ${targetVersion} (${pinned})`, (options.now ?? Date.now)());
|
|
316
|
+
return { stable, from: linked, to: targetVersion };
|
|
317
|
+
}
|
|
281
318
|
/** A real folder or file (not a link) of this user that group and others cannot write. */
|
|
282
319
|
export function checkOwnedEntry(entry, kind, platform) {
|
|
283
320
|
const stat = fs.lstatSync(entry);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@indigoai-us/hq-cli",
|
|
3
|
-
"version": "5.345.
|
|
3
|
+
"version": "5.345.274",
|
|
4
4
|
"description": "HQ by Indigo management CLI — modules and cloud sync",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -128,11 +128,11 @@
|
|
|
128
128
|
"*.{ts,tsx,mts,cts,js,jsx,mjs,cjs}": "eslint --cache --no-error-on-unmatched-pattern"
|
|
129
129
|
},
|
|
130
130
|
"optionalDependencies": {
|
|
131
|
-
"@indigoai-us/hq-hook-win32-x64": "5.345.
|
|
132
|
-
"@indigoai-us/hq-hook-win32-arm64": "5.345.
|
|
133
|
-
"@indigoai-us/hq-hook-darwin-x64": "5.345.
|
|
134
|
-
"@indigoai-us/hq-hook-darwin-arm64": "5.345.
|
|
135
|
-
"@indigoai-us/hq-hook-linux-x64": "5.345.
|
|
136
|
-
"@indigoai-us/hq-hook-linux-arm64": "5.345.
|
|
131
|
+
"@indigoai-us/hq-hook-win32-x64": "5.345.274",
|
|
132
|
+
"@indigoai-us/hq-hook-win32-arm64": "5.345.274",
|
|
133
|
+
"@indigoai-us/hq-hook-darwin-x64": "5.345.274",
|
|
134
|
+
"@indigoai-us/hq-hook-darwin-arm64": "5.345.274",
|
|
135
|
+
"@indigoai-us/hq-hook-linux-x64": "5.345.274",
|
|
136
|
+
"@indigoai-us/hq-hook-linux-arm64": "5.345.274"
|
|
137
137
|
}
|
|
138
138
|
}
|
|
@@ -9,11 +9,30 @@ let repair = 'npm install -g @indigoai-us/hq-cli --allow-scripts=@indigoai-us/hq
|
|
|
9
9
|
try {
|
|
10
10
|
const resolver = await import('../dist/lib/hook-engine/resolve.js');
|
|
11
11
|
if (typeof resolver.HOOK_ENGINE_REPAIR === 'string') repair = resolver.HOOK_ENGINE_REPAIR;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
//
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
const pinned = resolver.installHookEngine();
|
|
13
|
+
if (!pinned) throw new Error('Optional platform package missing');
|
|
14
|
+
// An explicit reinstall of an older hq-cli moves an existing stable link back
|
|
15
|
+
// to this version's engine. Upgrades and equal versions still wait for the
|
|
16
|
+
// canary-gated reconcile (hq reindex).
|
|
17
|
+
let downgraded = null;
|
|
18
|
+
if (typeof pinned === 'string') {
|
|
19
|
+
try {
|
|
20
|
+
const stableLink = await import('../dist/lib/hook-engine/stable-link.js');
|
|
21
|
+
if (typeof stableLink.downgradeStableEngineOnInstall === 'function') {
|
|
22
|
+
downgraded = stableLink.downgradeStableEngineOnInstall(pinned);
|
|
23
|
+
}
|
|
24
|
+
} catch (error) {
|
|
25
|
+
if (error?.code !== 'ERR_MODULE_NOT_FOUND') throw error;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
if (downgraded) {
|
|
29
|
+
console.warn(`HQ hook engine: moved ${downgraded.stable} from ${downgraded.from} to ${downgraded.to} for this explicit downgrade.`);
|
|
30
|
+
} else {
|
|
31
|
+
// The stable link core.next registrations name moves only through the gated
|
|
32
|
+
// reconcile (hq reindex), which the next hq command starts on its own.
|
|
33
|
+
const stale = typeof resolver.staleStableEngine === 'function' ? resolver.staleStableEngine() : null;
|
|
34
|
+
if (stale) console.warn(`HQ hook engine: ${stale.stable} still names the previous engine. The next hq command re-checks the new engine against the host canary gate and moves it; to do it now, run: hq reindex`);
|
|
35
|
+
}
|
|
17
36
|
} catch (error) {
|
|
18
37
|
console.warn(`HQ native hook engine unavailable: ${error instanceof Error ? error.message : String(error)}. Existing bash hooks remain active. Repair: ${repair}`);
|
|
19
38
|
}
|