@indigoai-us/hq-cli 5.345.66 → 5.345.67

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 (32) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/commands/core-delegate-w1b.js +3 -2
  3. package/dist/commands/core-delegate.js +2 -1
  4. package/dist/commands/core-job-native-utils.js +2 -1
  5. package/dist/commands/core-job-probe-native.js +2 -1
  6. package/dist/commands/core-job-run-native.js +2 -1
  7. package/dist/commands/core-native-handoff-flag.d.ts +1 -1
  8. package/dist/commands/core-native-handoff-flag.js +3 -3
  9. package/dist/commands/core-native-hook-helpers-flag.d.ts +1 -1
  10. package/dist/commands/core-native-hook-helpers-flag.js +3 -3
  11. package/dist/commands/core-native-jobs-flag.d.ts +1 -1
  12. package/dist/commands/core-native-jobs-flag.js +3 -3
  13. package/dist/commands/core-native-policy-flag.d.ts +6 -0
  14. package/dist/commands/core-native-policy-flag.js +4 -4
  15. package/dist/commands/core-native-session-flag.d.ts +1 -1
  16. package/dist/commands/core-native-session-flag.js +3 -3
  17. package/dist/commands/core-native-utilities-flag.d.ts +1 -1
  18. package/dist/commands/core-native-utilities-flag.js +3 -3
  19. package/dist/commands/core-native-utilities.js +2 -1
  20. package/dist/commands/core-ontology-native.js +3 -1
  21. package/dist/commands/lanes-session-start.js +72 -4
  22. package/dist/fast-core.js +2 -12
  23. package/dist/fast-scaffold.d.ts +0 -3
  24. package/dist/fast-scaffold.js +0 -14
  25. package/dist/lib/flag-registry.d.ts +1 -3
  26. package/dist/lib/flag-registry.js +2 -4
  27. package/dist/native-fast-route.d.ts +2 -2
  28. package/dist/native-fast-route.js +4 -4
  29. package/dist/utils/resident-package-preload.js +1 -2
  30. package/package.json +1 -1
  31. package/dist/commands/core-native-family-flag.d.ts +0 -7
  32. package/dist/commands/core-native-family-flag.js +0 -16
package/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [5.345.67] — 2026-10-09
6
+
7
+ - Persist the Codex SessionStart model and effort for conduct lanes, with safe fallback defaults.
8
+
9
+ - Native core families go back to their strict readers from 5.345.65. In 5.345.66, a process with no company context ignored the flag registry and ran every native family, so the registry kill switch could not turn a family off on most machines.
10
+
5
11
  ## [5.345.66] — 2026-10-09
6
12
  - Native core families now run by default when the machine has no flag snapshot (including first-run and offline cases); explicit false in a fresh or stale snapshot remains the kill switch. Only the seven approved core-native families use default-on readers. Delegate and worker-skills keep strict default-off readers pending parity follow-ups, and other fast-route families such as hook-batch also remain on the strict reader.
7
13
  - The Windows fast-route shell fallback now converts bundled script paths to Git Bash paths, so the family kill switch can reach its shell companion.
@@ -13,6 +13,7 @@ import { ACL_SOURCE_DISPLAY_LABELS } from "../utils/files-browse-acl.js";
13
13
  import { runBundledScript } from "../utils/run-bundled-script.js";
14
14
  import { resolveWindowsBash } from "../utils/windows-bash.js";
15
15
  import { createShellCompatibleJqInvoker } from "../utils/jq-windows-compat.js";
16
+ const FLAG = "core-native-delegate";
16
17
  const ASSETS = {
17
18
  bundle: "core/scripts/hq-delegate-bundle.sh",
18
19
  grant: "core/scripts/hq-delegate-grant.sh",
@@ -1214,8 +1215,8 @@ export function registerCoreDelegateW1b(delegate, core) {
1214
1215
  const options = core.opts();
1215
1216
  const root = resolveLiveRoot({ hqRoot: options.hqRoot });
1216
1217
  const context = { cwd: root, root };
1217
- const { coreNativeDelegateEnabled } = await import("./core-native-family-flag.js");
1218
- if (!(await coreNativeDelegateEnabled())) {
1218
+ const { resolveProcessFlagGate } = await import("../lib/flag-registry.js");
1219
+ if (!resolveProcessFlagGate(FLAG, { fallback: false }, () => false)) {
1219
1220
  const result = runBundledScript({ asset: ASSETS[name], args, cwd: root, hqRoot: root });
1220
1221
  if (result.code !== 0)
1221
1222
  process.exit(result.code);
@@ -1022,7 +1022,8 @@ export function registerCoreDelegateCommand(core, registerWave1b) {
1022
1022
  const context = rootMode === "cwd"
1023
1023
  ? { cwd: process.cwd() }
1024
1024
  : (() => { const root = resolveLiveRoot({ hqRoot: scope.hqRoot }); return { cwd: root, root }; })();
1025
- if (!(await (await import("./core-native-family-flag.js")).coreNativeDelegateEnabled())) {
1025
+ const { resolveProcessFlagGate } = await import("../lib/flag-registry.js");
1026
+ if (!resolveProcessFlagGate(CORE_NATIVE_DELEGATE_FLAG, { fallback: false }, () => false)) {
1026
1027
  const result = runBundledScript({ asset: SCRIPT_ASSETS[name], args, cwd: context.cwd, hqRoot: context.root });
1027
1028
  if (result.code !== 0)
1028
1029
  process.exit(result.code);
@@ -1,6 +1,7 @@
1
1
  import { resolveLiveRoot } from "../utils/hq-roots.js";
2
2
  import { runBundledScript } from "../utils/run-bundled-script.js";
3
3
  import { describeCoreCommand } from "./core-command-catalog.js";
4
+ import { coreNativeJobsEnabled } from "./core-native-jobs-flag.js";
4
5
  /** Preserve raw argv (including the option terminator) through Commander. */
5
6
  export function rawJobArgumentsForCommand(command, fallback, raw = process.argv) {
6
7
  const names = [];
@@ -32,7 +33,7 @@ export function registerCoreJobLeaf(group, core, name, asset, summary, run, canU
32
33
  const hqRoot = canUseLiveRoot(argv)
33
34
  ? resolveLiveRoot({ hqRoot: leafRootOverride(argv, valueOptions, booleanOptions) ?? groupHqRoot })
34
35
  : groupHqRoot ?? "";
35
- if (!await (await import("./core-native-jobs-flag.js")).coreNativeJobsEnabled()) {
36
+ if (!await coreNativeJobsEnabled()) {
36
37
  const result = runBundledScript({ asset, args: argv, cwd: process.cwd(), hqRoot: hqRoot || undefined });
37
38
  if (result.code !== 0)
38
39
  process.exit(result.code);
@@ -7,6 +7,7 @@ import { serializeJqJson } from "../lib/core-utils/jq-json-serializer.js";
7
7
  import { resolveLiveRoot } from "../utils/hq-roots.js";
8
8
  import { runBundledScript } from "../utils/run-bundled-script.js";
9
9
  import { describeCoreCommand } from "./core-command-catalog.js";
10
+ import { coreNativeJobsEnabled } from "./core-native-jobs-flag.js";
10
11
  import { resolveWindowsExecutable } from "../lib/bot/runtime/windows.js";
11
12
  import { planResolvedCommandSpawn } from "../utils/windows-spawn.js";
12
13
  export const JOB_PROBE_ASSET = "core/scripts/hq-job-probe.sh";
@@ -592,7 +593,7 @@ export function registerCoreJobProbeCommand(job) {
592
593
  const root = !forwarded.help && (!forwarded.hasRoot || Boolean(forwarded.root))
593
594
  ? resolveLiveRoot({ hqRoot: forwarded.hasRoot ? forwarded.root : core.opts().hqRoot })
594
595
  : undefined;
595
- if (!await (await import("./core-native-jobs-flag.js")).coreNativeJobsEnabled()) {
596
+ if (!await coreNativeJobsEnabled()) {
596
597
  const r = runBundledScript({ asset: JOB_PROBE_ASSET, args: argv, cwd: process.cwd(), ...(root ? { hqRoot: root } : {}) });
597
598
  if (r.code)
598
599
  process.exit(r.code);
@@ -10,6 +10,7 @@ import { serializeJqJson } from "../lib/core-utils/jq-json-serializer.js";
10
10
  import { resolveLiveRoot, resolveBundledAsset } from "../utils/hq-roots.js";
11
11
  import { runBundledScript } from "../utils/run-bundled-script.js";
12
12
  import { describeCoreCommand } from "./core-command-catalog.js";
13
+ import { coreNativeJobsEnabled } from "./core-native-jobs-flag.js";
13
14
  import { releaseChildWrapperPackageUseLeaseAfterStart } from "../utils/child-wrapper-lease.js";
14
15
  import { materializeCoreJobPostExitHelpers } from "./core-job-post-exit-assets.js";
15
16
  const RUN_ASSET = "core/scripts/hq-job-run.sh";
@@ -1215,7 +1216,7 @@ export function registerCoreJobRunCommand(job) {
1215
1216
  .action(async (args, _options, current) => {
1216
1217
  const argv = rawArgumentsForCommand(current, args);
1217
1218
  const root = current.parent?.parent?.opts().hqRoot ?? process.env.HQ_ROOT;
1218
- if (!await (await import("./core-native-jobs-flag.js")).coreNativeJobsEnabled()) {
1219
+ if (!await coreNativeJobsEnabled()) {
1219
1220
  const resolvedRoot = resolveLiveRoot({ hqRoot: root });
1220
1221
  const result = runBundledScript({ asset: RUN_ASSET, args: argv, cwd: process.cwd(), hqRoot: resolvedRoot });
1221
1222
  if (result.code !== 0)
@@ -1,4 +1,4 @@
1
- /** Default-on kill switch for the native Wave 2 worktree/resume helpers. */
1
+ /** Default-off rollout gate for the native Wave 2 worktree/resume helpers. */
2
2
  export declare const CORE_NATIVE_HANDOFF_FLAG = "core-native-handoff";
3
3
  export declare function coreNativeHandoffEnabled(): Promise<boolean>;
4
4
  //# sourceMappingURL=core-native-handoff-flag.d.ts.map
@@ -1,7 +1,7 @@
1
- /** Default-on kill switch for the native Wave 2 worktree/resume helpers. */
2
- import { coreNativeFamilyEnabled } from "./core-native-family-flag.js";
1
+ /** Default-off rollout gate for the native Wave 2 worktree/resume helpers. */
3
2
  export const CORE_NATIVE_HANDOFF_FLAG = "core-native-handoff";
4
3
  export async function coreNativeHandoffEnabled() {
5
- return coreNativeFamilyEnabled(CORE_NATIVE_HANDOFF_FLAG);
4
+ const { resolveProcessFlagGate } = await import("../lib/flag-registry.js");
5
+ return resolveProcessFlagGate(CORE_NATIVE_HANDOFF_FLAG, { fallback: false }, () => false);
6
6
  }
7
7
  //# sourceMappingURL=core-native-handoff-flag.js.map
@@ -1,4 +1,4 @@
1
- /** Default-on kill switch for Wave 8 hook-time helper commands. */
1
+ /** Default-off rollout gate for Wave 8 hook-time helper commands. */
2
2
  export declare const CORE_NATIVE_HOOK_HELPERS_FLAG = "core-native-hook-helpers";
3
3
  export declare function coreNativeHookHelpersEnabled(): Promise<boolean>;
4
4
  //# sourceMappingURL=core-native-hook-helpers-flag.d.ts.map
@@ -1,7 +1,7 @@
1
- /** Default-on kill switch for Wave 8 hook-time helper commands. */
2
- import { coreNativeFamilyEnabled } from "./core-native-family-flag.js";
1
+ /** Default-off rollout gate for Wave 8 hook-time helper commands. */
3
2
  export const CORE_NATIVE_HOOK_HELPERS_FLAG = "core-native-hook-helpers";
4
3
  export async function coreNativeHookHelpersEnabled() {
5
- return coreNativeFamilyEnabled(CORE_NATIVE_HOOK_HELPERS_FLAG);
4
+ const { resolveProcessFlagGate } = await import("../lib/flag-registry.js");
5
+ return resolveProcessFlagGate(CORE_NATIVE_HOOK_HELPERS_FLAG, { fallback: false }, () => false);
6
6
  }
7
7
  //# sourceMappingURL=core-native-hook-helpers-flag.js.map
@@ -1,4 +1,4 @@
1
- /** Default-on kill switch for the native scheduled-jobs helpers. */
1
+ /** Default-off rollout gate for the native scheduled-jobs helpers. */
2
2
  export declare const CORE_NATIVE_JOBS_FLAG = "core-native-jobs";
3
3
  export declare function coreNativeJobsEnabled(): Promise<boolean>;
4
4
  //# sourceMappingURL=core-native-jobs-flag.d.ts.map
@@ -1,7 +1,7 @@
1
- /** Default-on kill switch for the native scheduled-jobs helpers. */
2
- import { coreNativeFamilyEnabled } from "./core-native-family-flag.js";
1
+ /** Default-off rollout gate for the native scheduled-jobs helpers. */
3
2
  export const CORE_NATIVE_JOBS_FLAG = "core-native-jobs";
4
3
  export async function coreNativeJobsEnabled() {
5
- return coreNativeFamilyEnabled(CORE_NATIVE_JOBS_FLAG);
4
+ const { resolveProcessFlagGate } = await import("../lib/flag-registry.js");
5
+ return resolveProcessFlagGate(CORE_NATIVE_JOBS_FLAG, { fallback: false }, () => false);
6
6
  }
7
7
  //# sourceMappingURL=core-native-jobs-flag.js.map
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Default-off rollout gate shared by the native knowledge and policy commands.
3
+ *
4
+ * The flag reader is loaded only after command selection. Its process gate reads
5
+ * the in-memory hq-flags snapshot synchronously and falls back to false.
6
+ */
1
7
  export declare const CORE_NATIVE_POLICY_FLAG = "core-native-policy";
2
8
  export declare function coreNativePolicyEnabled(): Promise<boolean>;
3
9
  //# sourceMappingURL=core-native-policy-flag.d.ts.map
@@ -1,12 +1,12 @@
1
1
  /**
2
- * Default-on kill switch shared by the native knowledge and policy commands.
2
+ * Default-off rollout gate shared by the native knowledge and policy commands.
3
3
  *
4
4
  * The flag reader is loaded only after command selection. Its process gate reads
5
- * the in-memory hq-flags snapshot synchronously and defaults on when unavailable.
5
+ * the in-memory hq-flags snapshot synchronously and falls back to false.
6
6
  */
7
- import { coreNativeFamilyEnabled } from './core-native-family-flag.js';
8
7
  export const CORE_NATIVE_POLICY_FLAG = 'core-native-policy';
9
8
  export async function coreNativePolicyEnabled() {
10
- return coreNativeFamilyEnabled(CORE_NATIVE_POLICY_FLAG);
9
+ const { resolveProcessFlagGate } = await import('../lib/flag-registry.js');
10
+ return resolveProcessFlagGate(CORE_NATIVE_POLICY_FLAG, { fallback: false }, () => false);
11
11
  }
12
12
  //# sourceMappingURL=core-native-policy-flag.js.map
@@ -1,4 +1,4 @@
1
- /** Default-on kill switch for native session and Stop-hook plumbing. */
1
+ /** Default-off rollout gate for native session and Stop-hook plumbing. */
2
2
  export declare const CORE_NATIVE_SESSION_FLAG = "core-native-session";
3
3
  export declare function coreNativeSessionEnabled(): Promise<boolean>;
4
4
  //# sourceMappingURL=core-native-session-flag.d.ts.map
@@ -1,7 +1,7 @@
1
- /** Default-on kill switch for native session and Stop-hook plumbing. */
2
- import { coreNativeFamilyEnabled } from "./core-native-family-flag.js";
1
+ /** Default-off rollout gate for native session and Stop-hook plumbing. */
3
2
  export const CORE_NATIVE_SESSION_FLAG = "core-native-session";
4
3
  export async function coreNativeSessionEnabled() {
5
- return coreNativeFamilyEnabled(CORE_NATIVE_SESSION_FLAG);
4
+ const { resolveProcessFlagGate } = await import("../lib/flag-registry.js");
5
+ return resolveProcessFlagGate(CORE_NATIVE_SESSION_FLAG, { fallback: false }, () => false);
6
6
  }
7
7
  //# sourceMappingURL=core-native-session-flag.js.map
@@ -1,4 +1,4 @@
1
- /** Default-on kill switch for native operator utility commands. */
1
+ /** Default-off rollout gate for native operator utility commands. */
2
2
  export declare const CORE_NATIVE_UTILITIES_FLAG = "core-native-utilities";
3
3
  export declare function coreNativeUtilitiesEnabled(): Promise<boolean>;
4
4
  //# sourceMappingURL=core-native-utilities-flag.d.ts.map
@@ -1,7 +1,7 @@
1
- /** Default-on kill switch for native operator utility commands. */
2
- import { coreNativeFamilyEnabled } from "./core-native-family-flag.js";
1
+ /** Default-off rollout gate for native operator utility commands. */
3
2
  export const CORE_NATIVE_UTILITIES_FLAG = "core-native-utilities";
4
3
  export async function coreNativeUtilitiesEnabled() {
5
- return coreNativeFamilyEnabled(CORE_NATIVE_UTILITIES_FLAG);
4
+ const { resolveProcessFlagGate } = await import("../lib/flag-registry.js");
5
+ return resolveProcessFlagGate(CORE_NATIVE_UTILITIES_FLAG, { fallback: false }, () => false);
6
6
  }
7
7
  //# sourceMappingURL=core-native-utilities-flag.js.map
@@ -1,4 +1,5 @@
1
1
  import * as path from "node:path";
2
+ import { coreNativeUtilitiesEnabled } from "./core-native-utilities-flag.js";
2
3
  import { describeCoreCommand } from "./core-command-catalog.js";
3
4
  import { runBundledScript } from "../utils/run-bundled-script.js";
4
5
  import { packageRoot } from "../utils/hq-roots.js";
@@ -15,7 +16,7 @@ export function registerNativeUtility(core, definition) {
15
16
  const groupRoot = core.opts().hqRoot;
16
17
  const operands = cmd.args.length > 0 ? cmd.args : args;
17
18
  const root = definition.resolveRoot(cwd, groupRoot);
18
- const nativeEnabled = await (await import("./core-native-utilities-flag.js")).coreNativeUtilitiesEnabled();
19
+ const nativeEnabled = await coreNativeUtilitiesEnabled();
19
20
  if (process.env.HQ_CM_W5_EXPECT_NATIVE === "1" && !nativeEnabled) {
20
21
  throw new Error(`core-native-utilities dispatch gate is disabled for ${definition.name}`);
21
22
  }
@@ -9,6 +9,7 @@ import { resolveBundledAsset } from "../utils/hq-roots.js";
9
9
  import { planResolvedCommandSpawn } from "../utils/windows-spawn.js";
10
10
  import { describeCoreCommand } from "./core-command-catalog.js";
11
11
  import { runKnowledgePrefs } from "./core-knowledge-prefs.js";
12
+ const FLAG = "core-native-ontology";
12
13
  const ASSET = "core/scripts/";
13
14
  const SIGNAL_TYPES = ["decision", "commitment", "risk", "question", "action_item", "key_point", "participant_contribution", "summary"];
14
15
  const CANDIDATE_SIGNAL_TYPES = ["action_item", "commitment", "decision", "risk", "question", "key_point", "participant_contribution", "summary"];
@@ -1169,7 +1170,8 @@ export function registerCoreOntologyNativeCommands(ontology, rootFor) {
1169
1170
  const forwarded = commandIndex >= 0 ? argv.slice(commandIndex + 1)
1170
1171
  : commandContext.args.length > 0 ? commandContext.args : args;
1171
1172
  const liveRoot = entry.root === "live" ? rootFor() : process.cwd();
1172
- if (!(await (await import("./core-native-family-flag.js")).coreNativeOntologyEnabled())) {
1173
+ const { resolveProcessFlagGate } = await import("../lib/flag-registry.js");
1174
+ if (!resolveProcessFlagGate(FLAG, { fallback: false }, () => false)) {
1173
1175
  const result = runBundledScript({
1174
1176
  asset: `${ASSET}${entry.asset}`,
1175
1177
  args: forwarded,
@@ -6,6 +6,74 @@ import { randomUUID } from "node:crypto";
6
6
  import { resolveLanesHqRoot } from "../lib/lanes/hq-root.js";
7
7
  import { readLanesRegistryFlagFailOpen } from "../lib/lanes/registry-flag.js";
8
8
  import { LANE_CONDUCT_SESSION_START_FLAG } from "../lib/lanes/flag-keys.js";
9
+ const CODEX_DEFAULT_KEYS = ["conduct_engine", "conduct_child_model", "conduct_child_effort", "conduct_default_source"];
10
+ function readSessionMetaValue(text, key) {
11
+ const line = text.split(/\r?\n/).find((entry) => new RegExp(`^\\s*${key}:`).test(entry));
12
+ if (!line)
13
+ return "";
14
+ const value = line.replace(/^\s*[^:]+:\s*/, "");
15
+ return value.replace(/^"|"$/g, "");
16
+ }
17
+ function writeCodexSessionDefaults(root, env, payload, debug) {
18
+ if (env.HQ_HARNESS !== "codex")
19
+ return;
20
+ const sessionId = payload.session_id ?? payload.sessionId;
21
+ if (!sessionId || !/^[A-Za-z0-9._-]+$/.test(sessionId) || sessionId === "." || sessionId === "..")
22
+ return;
23
+ let model = typeof payload.model === "string" ? payload.model : "";
24
+ if (/\s/.test(model))
25
+ model = "";
26
+ let effort = payload.reasoning_effort ?? payload.reasoningEffort ?? payload.effort ?? "";
27
+ if (typeof effort !== "string" || !/^[a-z]+$/.test(effort))
28
+ effort = "";
29
+ try {
30
+ const sessionDir = path.join(root, "workspace", "sessions", sessionId);
31
+ const metaPath = path.join(sessionDir, "meta.yaml");
32
+ fs.mkdirSync(sessionDir, { recursive: true });
33
+ let text = "";
34
+ try {
35
+ text = fs.readFileSync(metaPath, "utf8");
36
+ }
37
+ catch (error) {
38
+ if (error.code !== "ENOENT")
39
+ throw error;
40
+ }
41
+ if (CODEX_DEFAULT_KEYS.some((key) => readSessionMetaValue(text, key) !== ""))
42
+ return;
43
+ if (!text) {
44
+ text = `session_id: ${sessionId}\nstarted_at: "${new Date().toISOString().replace(/\.\d{3}Z$/, "Z")}"\nsenior: user\n`;
45
+ }
46
+ const defaults = {
47
+ conduct_engine: "codex",
48
+ conduct_child_model: model || undefined,
49
+ conduct_child_effort: effort || undefined,
50
+ conduct_default_source: model ? "codex-session" : "codex-fallback",
51
+ };
52
+ for (const key of CODEX_DEFAULT_KEYS) {
53
+ const value = defaults[key];
54
+ if (value === undefined)
55
+ continue;
56
+ const matcher = new RegExp(`^\\s*${key}:.*(?:\\r?\\n|$)`, "m");
57
+ const line = `${key}: ${value}\n`;
58
+ text = matcher.test(text) ? text.replace(matcher, line) : `${text}${text.endsWith("\n") || !text ? "" : "\n"}${line}`;
59
+ }
60
+ const tempPath = path.join(sessionDir, `.meta-${process.pid}-${randomUUID()}.tmp`);
61
+ try {
62
+ fs.writeFileSync(tempPath, text, { mode: 0o600 });
63
+ fs.renameSync(tempPath, metaPath);
64
+ }
65
+ finally {
66
+ try {
67
+ fs.rmSync(tempPath, { force: true });
68
+ }
69
+ catch { /* best-effort temp cleanup */ }
70
+ }
71
+ }
72
+ catch (error) {
73
+ const kind = error instanceof Error ? error.name : "Error";
74
+ debug(`hq lanes session-start: Codex metadata bootstrap failed (${kind})`);
75
+ }
76
+ }
9
77
  function enabledFromSettings(root) {
10
78
  const personal = path.join(root, "personal", "settings", "orchestrator.yaml");
11
79
  const settings = fs.existsSync(personal) ? personal : path.join(root, "core", "settings", "orchestrator.yaml");
@@ -155,11 +223,10 @@ export async function runLaneSessionStart(options = {}) {
155
223
  chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
156
224
  const input = Buffer.concat(chunks).toString("utf8");
157
225
  let source = "startup";
158
- let payloadSessionId;
226
+ let payload = {};
159
227
  try {
160
- const payload = JSON.parse(input);
228
+ payload = JSON.parse(input);
161
229
  source = payload.source || "startup";
162
- payloadSessionId = payload.session_id;
163
230
  }
164
231
  catch { /* malformed hook input uses startup default */ }
165
232
  if (source !== "startup")
@@ -179,7 +246,7 @@ export async function runLaneSessionStart(options = {}) {
179
246
  if (!flagEnabled)
180
247
  return;
181
248
  (options.startSweep ?? ((r, e) => startSessionStartOrphanSweep(r, e, spawn)))(root, env);
182
- if (sessionWasDisabled(root, env, payloadSessionId))
249
+ if (sessionWasDisabled(root, env, payload.session_id ?? payload.sessionId))
183
250
  return;
184
251
  const autoConduct = env.HQ_AUTO_CONDUCT ?? "";
185
252
  const forceOn = /^(1|true|on|yes)$/i.test(autoConduct);
@@ -192,6 +259,7 @@ export async function runLaneSessionStart(options = {}) {
192
259
  enabled = true;
193
260
  if (!enabled)
194
261
  return;
262
+ writeCodexSessionDefaults(root, env, payload, debug);
195
263
  const core = path.join(root, ".claude", "skills", "conduct", "conductor-core.md");
196
264
  if (!fs.existsSync(core))
197
265
  return;
package/dist/fast-core.js CHANGED
@@ -9,7 +9,7 @@
9
9
  import * as fs from "node:fs";
10
10
  import * as path from "node:path";
11
11
  import { fileURLToPath } from "node:url";
12
- import { isDefaultOnFastFamily, parseFastCore } from "./fast-scaffold.js";
12
+ import { parseFastCore } from "./fast-scaffold.js";
13
13
  const FAST_ROUTE_PROFILE_TOKEN = "hq-fast-route";
14
14
  function wantsFastRouteProfile(env) {
15
15
  return env.NODE_DEBUG === FAST_ROUTE_PROFILE_TOKEN;
@@ -50,16 +50,7 @@ export async function runFastCore(argv, parsed = parseFastCore(argv)) {
50
50
  let familyEnabled = true;
51
51
  if (entry.kind === "native" && entry.familyFlagKey) {
52
52
  const envOverride = localBooleanFlagOverride(entry.familyFlagKey, process.env);
53
- if (envOverride !== null) {
54
- familyEnabled = envOverride;
55
- }
56
- else {
57
- const { fastFlagEnabled, fastFlagEnabledDefaultOn } = await import("./native-fast-route.js");
58
- const readFamilyFlag = isDefaultOnFastFamily(entry.familyFlagKey)
59
- ? fastFlagEnabledDefaultOn
60
- : fastFlagEnabled;
61
- familyEnabled = await readFamilyFlag(entry.familyFlagKey, process.env, { numericEnvironmentOverride: false });
62
- }
53
+ familyEnabled = envOverride ?? await (await import("./native-fast-route.js")).fastFlagEnabled(entry.familyFlagKey, process.env, { numericEnvironmentOverride: false });
63
54
  }
64
55
  if (entry.kind === "native" && entry.fallbackToCommandGraph && !familyEnabled) {
65
56
  const { runCli } = await import("./main.js");
@@ -173,7 +164,6 @@ export async function runFastCore(argv, parsed = parseFastCore(argv)) {
173
164
  args: parsed.args,
174
165
  cwd,
175
166
  ...(injectRoot ? { hqRoot } : {}),
176
- msysScriptPath: process.platform === "win32",
177
167
  ...(Object.keys(childEnv).length ? { env: childEnv } : {}),
178
168
  });
179
169
  // Propagate verbatim: these scripts use their exit code as their interface.
@@ -49,9 +49,6 @@ export type FastScaffoldScript = {
49
49
  /** Whether the bundled fast-route module closure needs Node's network timeout patch. */
50
50
  requiresNodeNetworkCompatibility?: boolean;
51
51
  };
52
- /** Family kill switches whose owner-approved default is enabled. */
53
- export declare const CORE_NATIVE_DEFAULT_ON_FAMILY_FLAGS: readonly ["core-native-session", "core-native-hook-helpers", "core-native-policy", "core-native-utilities", "core-native-jobs", "core-native-ontology", "core-native-handoff"];
54
- export declare function isDefaultOnFastFamily(flagKey: string): boolean;
55
52
  /** The relocated scripts that qualify for the entrypoint fast path. */
56
53
  export declare const FAST_SCAFFOLD_SCRIPTS: readonly FastScaffoldScript[];
57
54
  export type ParsedFastCore = {
@@ -9,20 +9,6 @@
9
9
  * on every turn's Stop. The entrypoint routes eligible commands before loading
10
10
  * the graph, and this module holds the parser + table that routing needs.
11
11
  */
12
- /** Family kill switches whose owner-approved default is enabled. */
13
- export const CORE_NATIVE_DEFAULT_ON_FAMILY_FLAGS = [
14
- "core-native-session",
15
- "core-native-hook-helpers",
16
- "core-native-policy",
17
- "core-native-utilities",
18
- "core-native-jobs",
19
- "core-native-ontology",
20
- "core-native-handoff",
21
- ];
22
- const defaultOnFamilyFlags = new Set(CORE_NATIVE_DEFAULT_ON_FAMILY_FLAGS);
23
- export function isDefaultOnFastFamily(flagKey) {
24
- return defaultOnFamilyFlags.has(flagKey);
25
- }
26
12
  /** The relocated scripts that qualify for the entrypoint fast path. */
27
13
  export const FAST_SCAFFOLD_SCRIPTS = [
28
14
  {
@@ -67,9 +67,7 @@ export declare function resolveFlagGate(reader: FlagReader | null | undefined, f
67
67
  /** Resolve one explicit company's flag without relying on process-wide binding. */
68
68
  export declare function resolveCompanyFlagGate(companyUid: string, idToken: string, flagKey: string, lookup: FlagLookupOptions, legacyFallback: () => boolean, dependencies?: CompanyFlagGateDependencies): Promise<boolean>;
69
69
  /** Resolve a process gate against the shared snapshot reader, when configured. */
70
- export declare function resolveProcessFlagGate(flagKey: string, lookup: FlagLookupOptions, legacyFallback: () => boolean, companyUid?: string, options?: {
71
- acceptStaleSnapshot?: boolean;
72
- }): boolean;
70
+ export declare function resolveProcessFlagGate(flagKey: string, lookup: FlagLookupOptions, legacyFallback: () => boolean, companyUid?: string): boolean;
73
71
  /**
74
72
  * The registry snapshot held by this process, or null when none has arrived
75
73
  * (no endpoint configured, offline, or still fetching). Callers that must
@@ -348,7 +348,7 @@ export async function resolveCompanyFlagGate(companyUid, idToken, flagKey, looku
348
348
  }
349
349
  }
350
350
  /** Resolve a process gate against the shared snapshot reader, when configured. */
351
- export function resolveProcessFlagGate(flagKey, lookup, legacyFallback, companyUid, options = {}) {
351
+ export function resolveProcessFlagGate(flagKey, lookup, legacyFallback, companyUid) {
352
352
  const targetCompanyUid = companyUid ?? (processReader
353
353
  ? refreshCompanyUid
354
354
  : resolveProcessFlagCompanyContext().companyUid);
@@ -360,9 +360,7 @@ export function resolveProcessFlagGate(flagKey, lookup, legacyFallback, companyU
360
360
  // Use the last validated, fresh company snapshot in that window, and when
361
361
  // the process reader was initialized for a different company scope.
362
362
  if (targetCompanyUid) {
363
- const cached = options.acceptStaleSnapshot
364
- ? readFlagSnapshotFile(targetCompanyUid, { maxAgeMs: Number.POSITIVE_INFINITY })
365
- : readFlagSnapshotFile(targetCompanyUid);
363
+ const cached = readFlagSnapshotFile(targetCompanyUid);
366
364
  if (cached) {
367
365
  const snapshot = { version: 0, flags: cached.flags };
368
366
  const reader = createProcessSnapshotReader([targetCompanyUid], () => snapshot);
@@ -1,6 +1,6 @@
1
- /** Routes native entrypoints through their default-on kill switch. */
1
+ /** Default-off flag check for native entrypoint routes. */
2
2
  export declare function nativeFastRouteEnabled(argv: readonly string[], env?: NodeJS.ProcessEnv): Promise<boolean>;
3
- /** Reads the fast-route kill switch; absent scope or snapshot keeps the route enabled. */
3
+ /** Reads a default-off fast-route gate from its local override or fresh snapshot. */
4
4
  export declare function fastFlagEnabled(flagKey: string, env?: NodeJS.ProcessEnv, options?: {
5
5
  numericEnvironmentOverride?: boolean;
6
6
  }): Promise<boolean>;
@@ -1,13 +1,13 @@
1
- /** Routes native entrypoints through their default-on kill switch. */
1
+ /** Default-off flag check for native entrypoint routes. */
2
2
  import { localOverrideEnvVar, readLocalOverride } from "@indigoai-us/hq-flags-client";
3
3
  import { parseFastCore } from "./fast-scaffold.js";
4
4
  export async function nativeFastRouteEnabled(argv, env = process.env) {
5
5
  const parsed = parseFastCore(argv);
6
6
  if (!parsed || parsed.entry.kind !== "native")
7
7
  return false;
8
- return fastFlagEnabledDefaultOn(parsed.entry.flagKey, env);
8
+ return fastFlagEnabled(parsed.entry.flagKey, env);
9
9
  }
10
- /** Reads the fast-route kill switch; absent scope or snapshot keeps the route enabled. */
10
+ /** Reads a default-off fast-route gate from its local override or fresh snapshot. */
11
11
  export async function fastFlagEnabled(flagKey, env = process.env, options = {}) {
12
12
  const override = nativeRouteOverride(flagKey, env, options.numericEnvironmentOverride !== false);
13
13
  if (override !== null)
@@ -41,7 +41,7 @@ export async function fastFlagEnabledDefaultOn(flagKey, env = process.env, optio
41
41
  const { companyUid } = resolveProcessFlagCompanyContext(env);
42
42
  if (!companyUid)
43
43
  return true;
44
- return readFlagSnapshotFile(companyUid, { env, maxAgeMs: Number.POSITIVE_INFINITY })?.flags[flagKey] !== false;
44
+ return readFlagSnapshotFile(companyUid, { env })?.flags[flagKey] !== false;
45
45
  }
46
46
  catch {
47
47
  // This flag is a kill switch: missing scope or cache data must leave the feature enabled.
@@ -42,7 +42,7 @@ export const RESIDENT_PACKAGE_MODULES = {
42
42
  "bot-logs-follow": [],
43
43
  mcp: ["../lib/mcp/tools.js", "../lib/mcp/prompts.js", "../lib/anywhere-person-setting.js", "../utils/cognito-session.js", "@indigoai-us/hq-cloud", "../sentry.js", "../lib/doctor/client-health-reason-codes-flag.js", "@indigoai-us/hq-flags-client"],
44
44
  childWrapper: ["../main.js", "../lib/service-manager/startup-migration.js"],
45
- coreJobRun: ["../lib/flag-registry.js", "../commands/core-native-jobs-flag.js"],
45
+ coreJobRun: ["../lib/flag-registry.js"],
46
46
  "daemon-call": ["../lib/daemon/protocol.js"],
47
47
  daemon: [
48
48
  "../sentry.js",
@@ -204,7 +204,6 @@ const LOADERS = {
204
204
  ],
205
205
  coreJobRun: [
206
206
  () => import("../lib/flag-registry.js"),
207
- () => import("../commands/core-native-jobs-flag.js"),
208
207
  ],
209
208
  "daemon-call": [
210
209
  () => import("../lib/daemon/protocol.js"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@indigoai-us/hq-cli",
3
- "version": "5.345.66",
3
+ "version": "5.345.67",
4
4
  "description": "HQ by Indigo management CLI — modules and cloud sync",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -1,7 +0,0 @@
1
- /** Shared fail-safe readers for shipped native core families. */
2
- export declare function coreNativeFamilyEnabled(flagKey: string): Promise<boolean>;
3
- export declare const CORE_NATIVE_DELEGATE_FLAG = "core-native-delegate";
4
- export declare const CORE_NATIVE_ONTOLOGY_FLAG = "core-native-ontology";
5
- export declare function coreNativeDelegateEnabled(): Promise<boolean>;
6
- export declare function coreNativeOntologyEnabled(): Promise<boolean>;
7
- //# sourceMappingURL=core-native-family-flag.d.ts.map
@@ -1,16 +0,0 @@
1
- /** Shared fail-safe readers for shipped native core families. */
2
- export async function coreNativeFamilyEnabled(flagKey) {
3
- const { resolveProcessFlagGate } = await import("../lib/flag-registry.js");
4
- return resolveProcessFlagGate(flagKey, { fallback: true }, () => true, undefined, {
5
- acceptStaleSnapshot: true,
6
- });
7
- }
8
- export const CORE_NATIVE_DELEGATE_FLAG = "core-native-delegate";
9
- export const CORE_NATIVE_ONTOLOGY_FLAG = "core-native-ontology";
10
- export function coreNativeDelegateEnabled() {
11
- return import("../lib/flag-registry.js").then(({ resolveProcessFlagGate }) => resolveProcessFlagGate(CORE_NATIVE_DELEGATE_FLAG, { fallback: false }, () => false));
12
- }
13
- export function coreNativeOntologyEnabled() {
14
- return coreNativeFamilyEnabled(CORE_NATIVE_ONTOLOGY_FLAG);
15
- }
16
- //# sourceMappingURL=core-native-family-flag.js.map