@indigoai-us/hq-cli 5.345.13 → 5.345.14
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 +4 -0
- package/dist/commands/core-archive-old-threads-fast.d.ts +2 -0
- package/dist/commands/core-archive-old-threads-fast.js +5 -0
- package/dist/commands/core-codex-skill-bridge-fast.d.ts +2 -0
- package/dist/commands/core-codex-skill-bridge-fast.js +5 -0
- package/dist/commands/core-hq-status-summary-fast.d.ts +2 -0
- package/dist/commands/core-hq-status-summary-fast.js +11 -0
- package/dist/commands/core-resize-screenshot-fast.d.ts +2 -0
- package/dist/commands/core-resize-screenshot-fast.js +5 -0
- package/dist/commands/core-sentry-report-fast.d.ts +2 -0
- package/dist/commands/core-sentry-report-fast.js +33 -0
- package/dist/commands/core-soft-timeout-fast.d.ts +2 -0
- package/dist/commands/core-soft-timeout-fast.js +5 -0
- package/dist/commands/core-token-usage-report-fast.d.ts +2 -0
- package/dist/commands/core-token-usage-report-fast.js +5 -0
- package/dist/commands/core-worktree-fast.d.ts +2 -0
- package/dist/commands/core-worktree-fast.js +5 -0
- package/dist/commands/lanes.js +45 -4
- package/dist/fast-core.d.ts +1 -1
- package/dist/fast-core.js +10 -4
- package/dist/fast-scaffold.d.ts +6 -3
- package/dist/fast-scaffold.js +103 -4
- package/dist/lib/core-utils/sentry-report.js +8 -2
- package/dist/lib/lanes/constants.d.ts +1 -1
- package/dist/lib/lanes/constants.js +1 -1
- package/dist/lib/lanes/reconcile.d.ts +4 -1
- package/dist/lib/lanes/reconcile.js +5 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [5.345.14] — 2026-10-06
|
|
6
|
+
- Route frequently called native core commands through isolated fast handlers.
|
|
7
|
+
- Allow lane hierarchies up to four levels and include actionable senior-chain details when depth limits refuse a create or re-parent.
|
|
8
|
+
|
|
5
9
|
## [5.345.13] — 2026-10-06
|
|
6
10
|
- Stream provider transcript scans and account-move comparisons so large session files do not require whole-file reads.
|
|
7
11
|
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { runCodexSkillBridgeCommand } from "../lib/core-utils/codex-skill-bridge-entry.js";
|
|
2
|
+
export function runCodexSkillBridgeFast(args, _stdin, _cwd, hqRoot) {
|
|
3
|
+
return runCodexSkillBridgeCommand([...args], { root: hqRoot });
|
|
4
|
+
}
|
|
5
|
+
//# sourceMappingURL=core-codex-skill-bridge-fast.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { summarizeHqStatus } from "../lib/core-utils/hq-status-summary.js";
|
|
2
|
+
export function runHqStatusSummaryFast(args, _stdin, cwd, _hqRoot, _commandName, hqRootArg) {
|
|
3
|
+
// The full graph canonicalizes an explicit --hq-root through resolveLiveRoot.
|
|
4
|
+
// Keep that spelling on the authoritative path so the command graph can
|
|
5
|
+
// preserve its canonicalization and diagnostics. This adapter owns only the
|
|
6
|
+
// ordinary cwd-rooted invocation.
|
|
7
|
+
if (hqRootArg)
|
|
8
|
+
return undefined;
|
|
9
|
+
return summarizeHqStatus([...args], { cwd });
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=core-hq-status-summary-fast.js.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { reportSentryEvent } from "../lib/core-utils/sentry-report.js";
|
|
2
|
+
export function runSentryReportFast(args, stdin, _cwd, hqRoot) {
|
|
3
|
+
let dryRun = false;
|
|
4
|
+
let timeoutMs;
|
|
5
|
+
for (let index = 0; index < args.length; index += 1) {
|
|
6
|
+
const arg = args[index];
|
|
7
|
+
if (arg === "--dry-run") {
|
|
8
|
+
dryRun = true;
|
|
9
|
+
continue;
|
|
10
|
+
}
|
|
11
|
+
if (arg === "--timeout-ms") {
|
|
12
|
+
const value = args[index + 1];
|
|
13
|
+
if (value === undefined || value.startsWith("-"))
|
|
14
|
+
return Promise.resolve(undefined);
|
|
15
|
+
timeoutMs = Number(value);
|
|
16
|
+
index += 1;
|
|
17
|
+
continue;
|
|
18
|
+
}
|
|
19
|
+
if (arg?.startsWith("--timeout-ms=")) {
|
|
20
|
+
timeoutMs = Number(arg.slice("--timeout-ms=".length));
|
|
21
|
+
continue;
|
|
22
|
+
}
|
|
23
|
+
// Let Commander retain its authoritative diagnostics for forms this
|
|
24
|
+
// lightweight parser does not own. This branch emits no output.
|
|
25
|
+
return Promise.resolve(undefined);
|
|
26
|
+
}
|
|
27
|
+
// Live sends need main.ts's initialized Sentry transport. Keep those calls on
|
|
28
|
+
// the authoritative command graph; only side-effect-free validation is fast.
|
|
29
|
+
if (!dryRun)
|
|
30
|
+
return Promise.resolve(undefined);
|
|
31
|
+
return reportSentryEvent(stdin, { dryRun, timeoutMs, hqRoot }).then((result) => result.code);
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=core-sentry-report-fast.js.map
|
package/dist/commands/lanes.js
CHANGED
|
@@ -2029,6 +2029,37 @@ function depthOfRef(hqRoot, ref, ctx, visited = new Set(), override) {
|
|
|
2029
2029
|
function derivedLaneDepth(hqRoot, senior, ctx, override) {
|
|
2030
2030
|
return depthOfRef(hqRoot, senior, ctx, new Set(), override) + 1;
|
|
2031
2031
|
}
|
|
2032
|
+
function seniorLaneChain(hqRoot, ref, ctx, visited = new Set(), override) {
|
|
2033
|
+
if (ref.kind === "user")
|
|
2034
|
+
return [];
|
|
2035
|
+
const key = seniorKey(ref);
|
|
2036
|
+
if (visited.has(key)) {
|
|
2037
|
+
throw new LanesError("senior_cycle", `Cycle in senior chain at ${key}`, { at: ref });
|
|
2038
|
+
}
|
|
2039
|
+
visited.add(key);
|
|
2040
|
+
if (ref.kind === "session") {
|
|
2041
|
+
if (!ref.id) {
|
|
2042
|
+
throw new LanesError("invalid_senior_ref", "Session senior is missing an id", { senior: ref });
|
|
2043
|
+
}
|
|
2044
|
+
return seniorLaneChain(hqRoot, seniorOfSession(hqRoot, ref.id, ctx), ctx, visited, override);
|
|
2045
|
+
}
|
|
2046
|
+
if (!ref.id) {
|
|
2047
|
+
throw new LanesError("invalid_senior_ref", "Lane senior is missing an id", { senior: ref });
|
|
2048
|
+
}
|
|
2049
|
+
const lane = readLane(hqRoot, ref.id);
|
|
2050
|
+
const isOverridden = override?.laneId === lane.lane_id;
|
|
2051
|
+
const senior = isOverridden ? override.senior : lane.senior;
|
|
2052
|
+
const prefix = seniorLaneChain(hqRoot, senior, ctx, visited, override);
|
|
2053
|
+
const depth = isOverridden ? override.depth : derivedLaneDepth(hqRoot, lane.senior, ctx, override);
|
|
2054
|
+
return [...prefix, { lane_id: lane.lane_id, depth }];
|
|
2055
|
+
}
|
|
2056
|
+
function maxLaneDepthError(depth, chain, description, extraDetails = {}) {
|
|
2057
|
+
const parentLane = [...chain].reverse().find((entry) => entry.depth < MAX_LANE_DEPTH);
|
|
2058
|
+
const nextStep = parentLane
|
|
2059
|
+
? `Ask your senior lane ${parentLane.lane_id} to create this worker instead, or re-parent this lane under a shallower senior.`
|
|
2060
|
+
: "Ask a shallower senior to create this lane, or re-parent it to a shallower senior.";
|
|
2061
|
+
return new LanesError("max_lane_depth", `${description}: senior chain length ${depth} exceeds cap ${MAX_LANE_DEPTH}`, { ...extraDetails, depth, max: MAX_LANE_DEPTH, senior_chain: chain, next_step: nextStep });
|
|
2062
|
+
}
|
|
2032
2063
|
function callerDepth(hqRoot, ctx) {
|
|
2033
2064
|
const laneId = ctx.env.HQ_LANE_ID?.trim();
|
|
2034
2065
|
if (laneId) {
|
|
@@ -3012,7 +3043,13 @@ async function runCreate(ctx, opts) {
|
|
|
3012
3043
|
}
|
|
3013
3044
|
const depth = callerDepth(hqRoot, ctx);
|
|
3014
3045
|
if (depth >= MAX_LANE_DEPTH) {
|
|
3015
|
-
|
|
3046
|
+
const callerLaneId = ctx.env.HQ_LANE_ID?.trim();
|
|
3047
|
+
const chain = callerLaneId
|
|
3048
|
+
? seniorLaneChain(hqRoot, { kind: "lane", id: callerLaneId }, ctx)
|
|
3049
|
+
: seniorLaneChain(hqRoot, sessionIdFromEnv(ctx.env)
|
|
3050
|
+
? { kind: "session", id: sessionIdFromEnv(ctx.env) }
|
|
3051
|
+
: { kind: "user" }, ctx);
|
|
3052
|
+
throw maxLaneDepthError(depth + 1, chain, `A depth-${depth} caller may not spawn a depth-${depth + 1} lane`);
|
|
3016
3053
|
}
|
|
3017
3054
|
const senior = opts.senior ? parseSeniorRef(opts.senior) : defaultSenior(ctx);
|
|
3018
3055
|
assertSeniorExists(hqRoot, senior, ctx);
|
|
@@ -3033,7 +3070,7 @@ async function runCreate(ctx, opts) {
|
|
|
3033
3070
|
const hireGrant = requestedHireGrant ?? 0;
|
|
3034
3071
|
const laneDepth = derivedLaneDepth(hqRoot, senior, ctx);
|
|
3035
3072
|
if (laneDepth > MAX_LANE_DEPTH) {
|
|
3036
|
-
throw
|
|
3073
|
+
throw maxLaneDepthError(laneDepth, seniorLaneChain(hqRoot, senior, ctx), `Creating lane at depth ${laneDepth} is refused`);
|
|
3037
3074
|
}
|
|
3038
3075
|
// A no-company lane must not call company resolution (openMeshTransport).
|
|
3039
3076
|
if (storyIds.length > 0 && ctx.storyLedgerEnabled()) {
|
|
@@ -7081,7 +7118,9 @@ function runReparentLocked(ctx, laneId, opts) {
|
|
|
7081
7118
|
}
|
|
7082
7119
|
const newDepth = derivedLaneDepth(hqRoot, nextSenior, ctx);
|
|
7083
7120
|
if (newDepth > MAX_LANE_DEPTH) {
|
|
7084
|
-
|
|
7121
|
+
const chain = seniorLaneChain(hqRoot, nextSenior, ctx);
|
|
7122
|
+
chain.push({ lane_id: lane.lane_id, depth: newDepth });
|
|
7123
|
+
throw maxLaneDepthError(newDepth, chain, `Re-parent would put lane at depth ${newDepth}`);
|
|
7085
7124
|
}
|
|
7086
7125
|
const pending = pendingQuestionsForLane(hqRoot, laneId);
|
|
7087
7126
|
const oldDepth = derivedLaneDepth(hqRoot, lane.senior, ctx);
|
|
@@ -7099,7 +7138,9 @@ function runReparentLocked(ctx, laneId, opts) {
|
|
|
7099
7138
|
const oldDescendantDepth = derivedLaneDepth(hqRoot, other.senior, ctx);
|
|
7100
7139
|
const descendantDepth = derivedLaneDepth(hqRoot, other.senior, ctx, override);
|
|
7101
7140
|
if (descendantDepth > MAX_LANE_DEPTH) {
|
|
7102
|
-
|
|
7141
|
+
const chain = seniorLaneChain(hqRoot, other.senior, ctx, new Set(), override);
|
|
7142
|
+
chain.push({ lane_id: other.lane_id, depth: descendantDepth });
|
|
7143
|
+
throw maxLaneDepthError(descendantDepth, chain, `Re-parent would put descendant ${other.lane_id} at depth ${descendantDepth}`, { lane_id: other.lane_id });
|
|
7103
7144
|
}
|
|
7104
7145
|
if (descendantDepth > oldDescendantDepth &&
|
|
7105
7146
|
pendingQuestionsForLane(hqRoot, other.lane_id).length > 0) {
|
package/dist/fast-core.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* module. The registration in `core.ts` remains the complete fallback path.
|
|
8
8
|
*/
|
|
9
9
|
import { parseFastCore } from "./fast-scaffold.js";
|
|
10
|
-
export declare function readStdinIfPiped(stream: NodeJS.ReadStream): Promise<string>;
|
|
10
|
+
export declare function readStdinIfPiped(stream: NodeJS.ReadStream, maxBytes?: number): Promise<string>;
|
|
11
11
|
/**
|
|
12
12
|
* Run the fast-path core command named in `argv` and exit with its code.
|
|
13
13
|
* Only call when {@link isFastCoreRequest} is true; a non-match returns without
|
package/dist/fast-core.js
CHANGED
|
@@ -14,12 +14,18 @@ const FAST_ROUTE_PROFILE_TOKEN = "hq-fast-route";
|
|
|
14
14
|
function wantsFastRouteProfile(env) {
|
|
15
15
|
return env.NODE_DEBUG === FAST_ROUTE_PROFILE_TOKEN;
|
|
16
16
|
}
|
|
17
|
-
export async function readStdinIfPiped(stream) {
|
|
17
|
+
export async function readStdinIfPiped(stream, maxBytes) {
|
|
18
18
|
if (stream.isTTY)
|
|
19
19
|
return "";
|
|
20
20
|
const chunks = [];
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
let bytesRead = 0;
|
|
22
|
+
for await (const chunk of stream) {
|
|
23
|
+
const buffer = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk);
|
|
24
|
+
bytesRead += buffer.length;
|
|
25
|
+
if (maxBytes !== undefined && bytesRead > maxBytes)
|
|
26
|
+
return "";
|
|
27
|
+
chunks.push(buffer);
|
|
28
|
+
}
|
|
23
29
|
return Buffer.concat(chunks).toString("utf8");
|
|
24
30
|
}
|
|
25
31
|
/**
|
|
@@ -105,7 +111,7 @@ export async function runFastCore(argv, parsed = parseFastCore(argv)) {
|
|
|
105
111
|
handlerImportMs = profileElapsed(handlerImportStartedAt, profileMark());
|
|
106
112
|
const stdinStartedAt = profileMark();
|
|
107
113
|
const readsStdin = entry.readsStdinFor?.(parsed.args) ?? entry.readsStdin ?? false;
|
|
108
|
-
const stdin = readsStdin ? await readStdinIfPiped(process.stdin) : "";
|
|
114
|
+
const stdin = readsStdin ? await readStdinIfPiped(process.stdin, entry.kind === "native" ? entry.stdinMaxBytes : undefined) : "";
|
|
109
115
|
stdinReadMs = profileElapsed(stdinStartedAt, profileMark());
|
|
110
116
|
if (profile && profileStart !== undefined) {
|
|
111
117
|
process.stderr.write(`HQ_FAST_ROUTE_PROFILE ${JSON.stringify({
|
package/dist/fast-scaffold.d.ts
CHANGED
|
@@ -42,6 +42,8 @@ export type FastScaffoldScript = {
|
|
|
42
42
|
shellHqRoot?: "none" | "live" | "reconcile-default";
|
|
43
43
|
/** Whether this handler consumes stdin. Shell companions inherit stdin directly. */
|
|
44
44
|
readsStdin?: boolean;
|
|
45
|
+
/** Bound bytes buffered from stdin; overflow is treated as empty input. */
|
|
46
|
+
stdinMaxBytes?: number;
|
|
45
47
|
/** Per-invocation stdin policy for handlers whose shell reads conditionally. */
|
|
46
48
|
readsStdinFor?: (args: readonly string[]) => boolean;
|
|
47
49
|
/** Whether the bundled fast-route module closure needs Node's network timeout patch. */
|
|
@@ -78,9 +80,10 @@ export declare function parseSecretsEnvFastRequest(argv: readonly string[]): Par
|
|
|
78
80
|
* Parse `hq core [--hq-root <path>] <name> [args...]` when `<name>` is a
|
|
79
81
|
* fast-path script. Returns null for anything else so the caller defers to the
|
|
80
82
|
* full CLI. Mirrors the `core` group's single `--hq-root` option (both the
|
|
81
|
-
* `--hq-root <path>` and `--hq-root=<path>` forms)
|
|
82
|
-
*
|
|
83
|
-
*
|
|
83
|
+
* `--hq-root <path>` and `--hq-root=<path>` forms) before the command name.
|
|
84
|
+
* Commander also accepts that parent option after a subcommand; those
|
|
85
|
+
* invocations are deferred because the fast parser cannot safely distinguish
|
|
86
|
+
* a parent option from a command's pass-through arguments.
|
|
84
87
|
*/
|
|
85
88
|
export declare function parseFastCore(argv: readonly string[]): ParsedFastCore | null;
|
|
86
89
|
/** Whether this invocation is a fast-path scaffold dispatch. */
|
package/dist/fast-scaffold.js
CHANGED
|
@@ -11,6 +11,101 @@
|
|
|
11
11
|
*/
|
|
12
12
|
/** The relocated scripts that qualify for the entrypoint fast path. */
|
|
13
13
|
export const FAST_SCAFFOLD_SCRIPTS = [
|
|
14
|
+
{
|
|
15
|
+
name: "sentry report",
|
|
16
|
+
kind: "native",
|
|
17
|
+
modulePath: "./commands/core-sentry-report-fast.js",
|
|
18
|
+
exportName: "runSentryReportFast",
|
|
19
|
+
flagKey: "hq-core-native-fast-route",
|
|
20
|
+
root: "live",
|
|
21
|
+
readsStdinFor: (args) => {
|
|
22
|
+
let dryRun = false;
|
|
23
|
+
for (let index = 0; index < args.length; index += 1) {
|
|
24
|
+
const arg = args[index];
|
|
25
|
+
if (arg === "--dry-run") {
|
|
26
|
+
dryRun = true;
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
if (arg === "--timeout-ms") {
|
|
30
|
+
const value = args[index + 1];
|
|
31
|
+
if (value === undefined || value.startsWith("-"))
|
|
32
|
+
return false;
|
|
33
|
+
index += 1;
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
if (arg?.startsWith("--timeout-ms="))
|
|
37
|
+
continue;
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
return dryRun;
|
|
41
|
+
},
|
|
42
|
+
stdinMaxBytes: 2_048,
|
|
43
|
+
requiresNodeNetworkCompatibility: true,
|
|
44
|
+
fallbackToCommandGraph: true,
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: "soft-timeout",
|
|
48
|
+
kind: "native",
|
|
49
|
+
modulePath: "./commands/core-soft-timeout-fast.js",
|
|
50
|
+
exportName: "runSoftTimeoutFast",
|
|
51
|
+
flagKey: "hq-core-native-fast-route",
|
|
52
|
+
root: "cwd",
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: "hq-status-summary",
|
|
56
|
+
kind: "native",
|
|
57
|
+
modulePath: "./commands/core-hq-status-summary-fast.js",
|
|
58
|
+
exportName: "runHqStatusSummaryFast",
|
|
59
|
+
flagKey: "hq-core-native-fast-route",
|
|
60
|
+
asset: "core/scripts/hq-status-summary.sh",
|
|
61
|
+
root: "cwd",
|
|
62
|
+
fallbackToCommandGraph: true,
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
name: "archive-old-threads",
|
|
66
|
+
kind: "native",
|
|
67
|
+
modulePath: "./commands/core-archive-old-threads-fast.js",
|
|
68
|
+
exportName: "runArchiveOldThreadsFast",
|
|
69
|
+
flagKey: "hq-core-native-fast-route",
|
|
70
|
+
asset: "core/scripts/archive-old-threads.sh",
|
|
71
|
+
root: "live",
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
name: "worktree",
|
|
75
|
+
kind: "native",
|
|
76
|
+
modulePath: "./commands/core-worktree-fast.js",
|
|
77
|
+
exportName: "runWorktreeFast",
|
|
78
|
+
flagKey: "hq-core-native-fast-route",
|
|
79
|
+
asset: "core/scripts/worktree.sh",
|
|
80
|
+
root: "live",
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
name: "token-usage-report",
|
|
84
|
+
kind: "native",
|
|
85
|
+
modulePath: "./commands/core-token-usage-report-fast.js",
|
|
86
|
+
exportName: "runTokenUsageReportFast",
|
|
87
|
+
flagKey: "hq-core-native-fast-route",
|
|
88
|
+
asset: "core/scripts/token-usage-report.sh",
|
|
89
|
+
root: "cwd",
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
name: "resize-screenshot",
|
|
93
|
+
kind: "native",
|
|
94
|
+
modulePath: "./commands/core-resize-screenshot-fast.js",
|
|
95
|
+
exportName: "runResizeScreenshotFast",
|
|
96
|
+
flagKey: "hq-core-native-fast-route",
|
|
97
|
+
asset: "core/scripts/resize-screenshot.sh",
|
|
98
|
+
root: "cwd",
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
name: "codex-skill-bridge",
|
|
102
|
+
kind: "native",
|
|
103
|
+
modulePath: "./commands/core-codex-skill-bridge-fast.js",
|
|
104
|
+
exportName: "runCodexSkillBridgeFast",
|
|
105
|
+
flagKey: "hq-core-native-fast-route",
|
|
106
|
+
asset: "core/scripts/codex-skill-bridge.sh",
|
|
107
|
+
root: "live",
|
|
108
|
+
},
|
|
14
109
|
...["notify", "probe", "remediate", "run"].map((name) => ({
|
|
15
110
|
name: `job ${name}`,
|
|
16
111
|
kind: "native",
|
|
@@ -454,9 +549,10 @@ export function parseSecretsEnvFastRequest(argv) {
|
|
|
454
549
|
* Parse `hq core [--hq-root <path>] <name> [args...]` when `<name>` is a
|
|
455
550
|
* fast-path script. Returns null for anything else so the caller defers to the
|
|
456
551
|
* full CLI. Mirrors the `core` group's single `--hq-root` option (both the
|
|
457
|
-
* `--hq-root <path>` and `--hq-root=<path>` forms)
|
|
458
|
-
*
|
|
459
|
-
*
|
|
552
|
+
* `--hq-root <path>` and `--hq-root=<path>` forms) before the command name.
|
|
553
|
+
* Commander also accepts that parent option after a subcommand; those
|
|
554
|
+
* invocations are deferred because the fast parser cannot safely distinguish
|
|
555
|
+
* a parent option from a command's pass-through arguments.
|
|
460
556
|
*/
|
|
461
557
|
export function parseFastCore(argv) {
|
|
462
558
|
// argv is process.argv: [node, hq, core, ...rest].
|
|
@@ -482,7 +578,10 @@ export function parseFastCore(argv) {
|
|
|
482
578
|
.find((candidate) => candidate.name.split(" ").every((part, index) => commandArgs[index] === part));
|
|
483
579
|
if (!entry)
|
|
484
580
|
return null;
|
|
485
|
-
|
|
581
|
+
const routeArgs = argv.slice(i + entry.name.split(" ").length);
|
|
582
|
+
if (routeArgs.some((arg) => arg === "--hq-root" || arg.startsWith("--hq-root=")))
|
|
583
|
+
return null;
|
|
584
|
+
return { entry, hqRootArg, args: routeArgs };
|
|
486
585
|
}
|
|
487
586
|
/** Whether this invocation is a fast-path scaffold dispatch. */
|
|
488
587
|
export function isFastCoreRequest(argv) {
|
|
@@ -24,7 +24,6 @@ import { gte as semverGte, valid as validSemver } from "semver";
|
|
|
24
24
|
import { CLI_VERSION } from "../../cli-version.js";
|
|
25
25
|
import { beforeSend } from "../../sentry-before-send.js";
|
|
26
26
|
import { resolveLiveRoot } from "../../utils/hq-roots.js";
|
|
27
|
-
import { hookTimeoutDebugContextEnabled } from "./hook-timeout-debug-context-flag.js";
|
|
28
27
|
const requireSentry = createRequire(import.meta.url);
|
|
29
28
|
let sentryModule;
|
|
30
29
|
function loadSentryModule() {
|
|
@@ -208,7 +207,14 @@ const defaultDependencies = {
|
|
|
208
207
|
},
|
|
209
208
|
stdout: process.stdout,
|
|
210
209
|
stderr: process.stderr,
|
|
211
|
-
timeoutDebugContextEnabled: (signal) =>
|
|
210
|
+
timeoutDebugContextEnabled: async (signal) => {
|
|
211
|
+
// This optional diagnostic gate is needed only for reports that carry
|
|
212
|
+
// hook-timeout debug context. Load it on demand so ordinary dry-run
|
|
213
|
+
// validation stays on the isolated fast route without importing the full
|
|
214
|
+
// flag registry.
|
|
215
|
+
const { hookTimeoutDebugContextEnabled } = await import("./hook-timeout-debug-context-flag.js");
|
|
216
|
+
return hookTimeoutDebugContextEnabled({}, signal);
|
|
217
|
+
},
|
|
212
218
|
};
|
|
213
219
|
/**
|
|
214
220
|
* Read no more than the accepted event size. Returning early keeps a malformed
|
|
@@ -15,7 +15,10 @@ import type { LaneCompanyRef, LaneAccountSelection, LaneRecord, LivenessState, Q
|
|
|
15
15
|
import { type LaneMesh } from "./mesh-events.js";
|
|
16
16
|
/** Spec §9: unanswered at the current hop for 60 minutes → one hop. */
|
|
17
17
|
export declare const QUESTION_AGE_MS: number;
|
|
18
|
-
/**
|
|
18
|
+
/**
|
|
19
|
+
* Questions can advance through a session and its senior lane separately at
|
|
20
|
+
* each lane level, so allow both routing hops per lane before reaching user.
|
|
21
|
+
*/
|
|
19
22
|
export declare const MAX_AGED_ADVANCES: number;
|
|
20
23
|
/** Aligns with watcher silence: a host that has not reported for this long is dead. */
|
|
21
24
|
export declare const DEAD_HOST_MS: number;
|
|
@@ -41,8 +41,11 @@ import { decideEnvelopeRepair, envelopeQuestionIds, routeProviderFailure } from
|
|
|
41
41
|
import { PROVIDER_REJECTED_REASON, providerRejectionDetails, readProviderRejection, } from "./provider-rejection.js";
|
|
42
42
|
/** Spec §9: unanswered at the current hop for 60 minutes → one hop. */
|
|
43
43
|
export const QUESTION_AGE_MS = 60 * 60 * 1000;
|
|
44
|
-
/**
|
|
45
|
-
|
|
44
|
+
/**
|
|
45
|
+
* Questions can advance through a session and its senior lane separately at
|
|
46
|
+
* each lane level, so allow both routing hops per lane before reaching user.
|
|
47
|
+
*/
|
|
48
|
+
export const MAX_AGED_ADVANCES = MAX_LANE_DEPTH * 2;
|
|
46
49
|
/** Aligns with watcher silence: a host that has not reported for this long is dead. */
|
|
47
50
|
export const DEAD_HOST_MS = SILENCE_MS;
|
|
48
51
|
const RECONCILE_LOCK_STALE_MS = 30_000;
|