@indigoai-us/hq-cli 5.282.0 → 5.284.0

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 (55) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/assets/scaffold/.claude/hooks/validate-policy-frontmatter.sh +485 -0
  3. package/assets/scaffold/core/scripts/eval-trigger.sh +193 -0
  4. package/assets/scaffold/core/scripts/policy-age-report.sh +156 -0
  5. package/assets/scaffold/core/scripts/policy-retire.sh +199 -0
  6. package/assets/scaffold/core/scripts/read-policy-frontmatter.sh +32 -0
  7. package/dist/command-catalog.generated.d.ts +67 -0
  8. package/dist/command-catalog.generated.js +83 -0
  9. package/dist/commands/core-knowledge-prefs.d.ts +10 -0
  10. package/dist/commands/core-knowledge-prefs.js +125 -0
  11. package/dist/commands/core-native-policy-flag.d.ts +9 -0
  12. package/dist/commands/core-native-policy-flag.js +12 -0
  13. package/dist/commands/core-ontology-native.d.ts +0 -1
  14. package/dist/commands/core-ontology-native.js +2 -30
  15. package/dist/commands/core-ontology.d.ts +4 -0
  16. package/dist/commands/core-ontology.js +8 -3
  17. package/dist/commands/core-policy-frontmatter.d.ts +8 -0
  18. package/dist/commands/core-policy-frontmatter.js +52 -0
  19. package/dist/commands/core-policy.d.ts +15 -0
  20. package/dist/commands/core-policy.js +982 -0
  21. package/dist/commands/core.js +14 -1
  22. package/dist/commands/lanes-shared.d.ts +4 -1
  23. package/dist/commands/lanes-shared.js +2 -1
  24. package/dist/commands/lanes.d.ts +8 -0
  25. package/dist/commands/lanes.js +303 -91
  26. package/dist/fast-lanes-list-route.d.ts +8 -0
  27. package/dist/fast-lanes-list-route.js +30 -0
  28. package/dist/fast-lanes-list.d.ts +3 -0
  29. package/dist/fast-lanes-list.js +252 -0
  30. package/dist/fast-scaffold.d.ts +5 -0
  31. package/dist/fast-scaffold.js +10 -0
  32. package/dist/index.js +10 -1
  33. package/dist/lib/checkpoint-ontology/merge-copies.d.ts +24 -1
  34. package/dist/lib/checkpoint-ontology/merge-copies.js +70 -1
  35. package/dist/lib/lanes/flag-keys.d.ts +3 -0
  36. package/dist/lib/lanes/flag-keys.js +3 -0
  37. package/dist/lib/lanes/index.d.ts +1 -1
  38. package/dist/lib/lanes/index.js +1 -1
  39. package/dist/lib/lanes/outpost-dispatch.d.ts +9 -1
  40. package/dist/lib/lanes/outpost-dispatch.js +14 -2
  41. package/dist/lib/lanes/outpost-hire-cache.d.ts +3 -0
  42. package/dist/lib/lanes/outpost-hire-cache.js +11 -3
  43. package/dist/lib/lanes/outpost-snapshot-cache.d.ts +26 -0
  44. package/dist/lib/lanes/outpost-snapshot-cache.js +215 -0
  45. package/dist/lib/lanes/store.d.ts +4 -0
  46. package/dist/lib/lanes/store.js +39 -0
  47. package/dist/lib/mesh/live/daemon/credentials.js +8 -0
  48. package/dist/lib/mesh/live/daemon/work-subscribe.d.ts +1 -0
  49. package/dist/lib/mesh/live/daemon/work-subscribe.js +143 -5
  50. package/dist/lib/policy-validator.d.ts +2 -0
  51. package/dist/lib/policy-validator.js +136 -0
  52. package/dist/native-fast-route.d.ts +2 -0
  53. package/dist/native-fast-route.js +6 -2
  54. package/dist/utils/contribution-table.d.ts +1 -1
  55. package/package.json +1 -1
@@ -32,6 +32,8 @@ import { Option } from "commander";
32
32
  import { registerCoreCheckpointCommand } from "./core-checkpoint.js";
33
33
  import { registerCoreDelegateCommand } from "./core-delegate.js";
34
34
  import { registerCoreOntologyCommand } from "./core-ontology.js";
35
+ import { registerCoreKnowledgePrefsCommand } from "./core-knowledge-prefs.js";
36
+ import { registerCorePolicyCommand } from "./core-policy.js";
35
37
  import { registerCoreCheckpointGateSettingCommand } from "./core-checkpoint-gate-setting.js";
36
38
  import { resolveLiveRoot } from "../utils/hq-roots.js";
37
39
  import { interpreterFor, runBundledScript } from "../utils/run-bundled-script.js";
@@ -230,7 +232,16 @@ export const SCAFFOLD_ONLY_ASSETS = [
230
232
  { asset: "core/scripts/ontology-garden.mjs", root: "live", summary: "Rollback companion for native ontology garden" },
231
233
  { asset: "core/scripts/ontology-source-worklist.sh", root: "live", summary: "Rollback companion for native ontology source worklist" },
232
234
  { asset: "core/scripts/source-yaml-validate.sh", root: "cwd", summary: "Rollback companion for native source YAML validation" },
233
- { asset: "core/scripts/knowledge-prefs.sh", root: "live", summary: "Sibling dependency for ontology candidate rollback companion" },
235
+ // Shared by native knowledge-prefs and the ontology candidate shell fallback.
236
+ { asset: "core/scripts/knowledge-prefs.sh", root: "live", summary: "Rollback companion for native knowledge-prefs and ontology candidate" },
237
+ // Rollback companions for the default-off native knowledge and policy routes.
238
+ // policy-retire also runs the scaffold validator in-process when native, but
239
+ // its bundled shell fallback needs both helper assets at these exact paths.
240
+ { asset: "core/scripts/policy-age-report.sh", root: "live", summary: "Rollback companion for native policy age-report" },
241
+ { asset: "core/scripts/policy-retire.sh", root: "live", summary: "Rollback companion for native policy retire" },
242
+ { asset: "core/scripts/read-policy-frontmatter.sh", root: "cwd", summary: "Rollback companion for native policy frontmatter" },
243
+ { asset: "core/scripts/eval-trigger.sh", root: "live", summary: "Trigger grammar helper used by the policy validator companion" },
244
+ { asset: ".claude/hooks/validate-policy-frontmatter.sh", root: "live", summary: "Policy validator companion used by policy-retire rollback" },
234
245
  ...NATIVE_UTILITY_COMMANDS.map(({ asset, root, summary }) => ({
235
246
  asset,
236
247
  root,
@@ -307,6 +318,8 @@ export function registerCoreCommands(program) {
307
318
  registerCoreOntologyCommand(core);
308
319
  registerCoreCheckpointGateSettingCommand(core);
309
320
  registerCoreDelegateCommand(core);
321
+ registerCoreKnowledgePrefsCommand(core);
322
+ registerCorePolicyCommand(core);
310
323
  // These command names intentionally own native implementations. Their
311
324
  // similarly named scaffold assets are forwarders, so sending them through
312
325
  // runEntry would recurse back into this command forever.
@@ -9,6 +9,7 @@ import type { RunCompactionFn } from "../lib/lanes/compaction.js";
9
9
  import type { LaneMesh, LaneMeshEvent } from "../lib/lanes/mesh-events.js";
10
10
  import type { BalanceHostGap, BalanceHostSnapshot } from "../lib/lanes/claude-balance.js";
11
11
  import type { HostCapacitySnapshot } from "../lib/lanes/host-capacity.js";
12
+ import { LANE_OUTPOST_LOAD_BALANCING_FLAG } from "../lib/lanes/flag-keys.js";
12
13
  import { type ResolvedEffort } from "../lib/lanes/effort.js";
13
14
  import type { SessionCopyResult } from "../lib/lanes/move-account.js";
14
15
  import type { WorkerProfile } from "../lib/lanes/profile.js";
@@ -245,6 +246,8 @@ export interface Ctx {
245
246
  backfillOutpostIdentity: (expectedId: string) => "created" | "unchanged";
246
247
  fetchText: (url: string) => Promise<string>;
247
248
  lanePlacementEnabled: (company: LaneCompanyRef | undefined) => Promise<boolean>;
249
+ outpostSnapshotCacheEnabled: () => Promise<boolean>;
250
+ startOutpostLaneSnapshotRefresh: (hqRoot: string) => void;
248
251
  storyLedgerEnabled: () => boolean;
249
252
  isSsmOwnerDispatch: () => boolean;
250
253
  withGrantHireLocks: typeof withLaneHireLocks;
@@ -255,7 +258,7 @@ export interface OutpostRouteIdentity {
255
258
  outpostId: string;
256
259
  instanceName?: string;
257
260
  }
258
- export declare const LANE_OUTPOST_LOAD_BALANCING_FLAG = "lanes.outpost-load-balancing";
261
+ export { LANE_OUTPOST_LOAD_BALANCING_FLAG };
259
262
  export declare const CLAUDE_ACCOUNT_BALANCE_SIGNALS_FLAG = "lanes.claude-account-balance-signals";
260
263
  export declare function defaultLanePlacementEnabled(company: LaneCompanyRef | undefined): Promise<boolean>;
261
264
  export declare function readLanePlacementEnabled(ctx: Ctx, company: LaneCompanyRef | undefined): Promise<boolean>;
@@ -1,5 +1,6 @@
1
1
  import { resolveProcessFlagCompanyContext } from "../lib/flag-registry.js";
2
2
  import { readLanesRegistryFlag } from "../lib/lanes/registry-flag.js";
3
+ import { LANE_OUTPOST_LOAD_BALANCING_FLAG } from "../lib/lanes/flag-keys.js";
3
4
  import { resolveLaneEffort } from "../lib/lanes/effort.js";
4
5
  import { LanesError } from "../lib/lanes/errors.js";
5
6
  import { AccountResolutionError, accountStatus, loadLanesConfig } from "../lib/lanes/index.js";
@@ -98,7 +99,7 @@ export function recordedResumeEffort(lane) {
98
99
  source: lane.effort_source ?? "none",
99
100
  };
100
101
  }
101
- export const LANE_OUTPOST_LOAD_BALANCING_FLAG = "lanes.outpost-load-balancing";
102
+ export { LANE_OUTPOST_LOAD_BALANCING_FLAG };
102
103
  export const CLAUDE_ACCOUNT_BALANCE_SIGNALS_FLAG = "lanes.claude-account-balance-signals";
103
104
  function lanePlacementFlagErrorCode(error) {
104
105
  if (error && typeof error === "object") {
@@ -14,6 +14,7 @@ import type { OutpostIdentity } from "../lib/lanes/admission-host.js";
14
14
  export { OUTPOST_DIR, OUTPOST_ID_PATH, readOutpostIdentity } from "../lib/lanes/admission-host.js";
15
15
  export type { OutpostIdentity } from "../lib/lanes/admission-host.js";
16
16
  import { type OutpostDispatchResult } from "../lib/lanes/outpost-dispatch.js";
17
+ import { LANE_OUTPOST_SNAPSHOT_CACHE_FLAG } from "../lib/lanes/outpost-hire-cache.js";
17
18
  import { emitLaneDecisionEvents } from "../lib/lanes/mesh-events.js";
18
19
  import { MAX_LANE_DEPTH, withLaneHireLocks, type LaneCompanyRef, type QuestionBody, type LaneRecord, type QuestionRecord, type ResolvedLaneWorker, type SeniorRef, type LivenessDeps, type MachineIdentity, type MonitorEvidenceReader, type RunCommand, type ThrottleDeps } from "../lib/lanes/index.js";
19
20
  import { questionBodyAbsPath } from "../lib/lanes/questions.js";
@@ -87,6 +88,10 @@ export interface LanesCommandDeps {
87
88
  monitorEvidence?: MonitorEvidenceReader;
88
89
  /** Test seam for the default-off outpost placement rollout flag. */
89
90
  lanePlacementEnabled?: (company: LaneCompanyRef | undefined) => Promise<boolean>;
91
+ /** Test seam for the default-off shared Outpost snapshot cache. */
92
+ outpostSnapshotCacheEnabled?: () => Promise<boolean>;
93
+ /** Test seam for the detached refresh started by the cache-first lane list. */
94
+ startOutpostLaneSnapshotRefresh?: (hqRoot: string) => void;
90
95
  /** Test seam for the default-off story ledger flag. */
91
96
  storyLedgerEnabled?: () => boolean;
92
97
  /** Test seam for the SSM-only Outpost owner grant path. */
@@ -98,6 +103,7 @@ export interface LanesCommandDeps {
98
103
  /** Test seam for the repository-merge-hold registry flag. */
99
104
  mergeHoldEnabled?: (company: LaneCompanyRef) => boolean | Promise<boolean>;
100
105
  }
106
+ export { LANE_OUTPOST_SNAPSHOT_CACHE_FLAG };
101
107
  export declare function parseSeniorRef(raw: string): SeniorRef;
102
108
  export declare function parseQuestionBody(raw: unknown): QuestionBody | null;
103
109
  /**
@@ -140,6 +146,8 @@ export declare function pickupFailureUpdater(reasonRaw: string, details: Record<
140
146
  */
141
147
  export declare function applyOutpostAccountPickup(hqRoot: string, laneId: string, modelDeps?: KnownModelsDeps): LaneRecord;
142
148
  export declare function cancelPendingQuestionsForLane(hqRoot: string, laneId: string, nowIso: string, operatorReason?: string): QuestionRecord[];
149
+ /** Keeps the placement-enabled cache-first path on the full lane command graph. */
150
+ export declare function runFastCachedLanesListFromEntrypoint(): Promise<void>;
143
151
  export declare function stopCommittedState(state: LaneRecord["state"]): "cancelled" | "killed";
144
152
  /** Stderr notice that `stop` ends a lane for good, naming the resumable path. */
145
153
  export declare function stopTerminalWarning(laneId: string): string;