@indigoai-us/hq-cli 5.345.244 → 5.345.246
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 +87 -0
- package/dist/command-catalog.generated.d.ts +93 -6
- package/dist/command-catalog.generated.js +114 -6
- package/dist/commands/bot.js +1 -1
- package/dist/commands/core-checkpoint-native.d.ts +5 -1
- package/dist/commands/core-checkpoint-native.js +13 -5
- package/dist/commands/deploy-comments.js +139 -0
- package/dist/commands/deploy-list.d.ts +5 -0
- package/dist/commands/deploy-list.js +8 -0
- package/dist/commands/dm.d.ts +4 -1
- package/dist/commands/dm.js +11 -2
- package/dist/commands/files.d.ts +11 -2
- package/dist/commands/files.js +48 -3
- package/dist/commands/lanes-loop.js +4 -1
- package/dist/commands/lanes.js +16 -5
- package/dist/commands/mesh.d.ts +2 -0
- package/dist/commands/mesh.js +26 -6
- package/dist/commands/reindex.js +2 -1
- package/dist/commands/rescue.d.ts +22 -1
- package/dist/commands/rescue.js +56 -9
- package/dist/commands/sources.d.ts +1 -1
- package/dist/commands/sources.js +1 -1
- package/dist/commands/storage.d.ts +15 -2
- package/dist/commands/storage.js +74 -7
- package/dist/hq-cloud-sync-runner/bin/sync-runner.js +2033 -1829
- package/dist/hq-cloud-sync-runner/package.json +1 -1
- package/dist/lib/agent-kit/mcp/tools.js +22 -0
- package/dist/lib/bot/jobs/hot-signal-sync.js +4 -1
- package/dist/lib/daemon/fleet-members-cache.d.ts +55 -0
- package/dist/lib/daemon/fleet-members-cache.js +266 -0
- package/dist/lib/daemon/handoff.d.ts +4 -0
- package/dist/lib/daemon/handoff.js +2 -1
- package/dist/lib/daemon/hook-requests.d.ts +2 -1
- package/dist/lib/daemon/hook-requests.js +19 -2
- package/dist/lib/daemon/install.d.ts +9 -1
- package/dist/lib/daemon/install.js +11 -2
- package/dist/lib/daemon/ops/policy.d.ts +23 -3
- package/dist/lib/daemon/ops/policy.js +62 -15
- package/dist/lib/daemon/run.js +12 -0
- package/dist/lib/daemon/server.d.ts +5 -0
- package/dist/lib/daemon/server.js +1 -1
- package/dist/lib/daemon/supervisor.d.ts +6 -0
- package/dist/lib/daemon/supervisor.js +31 -2
- package/dist/lib/doctor/checks/sync-runtime.js +8 -1
- package/dist/lib/flag-registry-worker-source.generated.d.ts +1 -1
- package/dist/lib/flag-registry-worker-source.generated.js +1 -1
- package/dist/lib/hook-engine/coverage.d.ts +68 -0
- package/dist/lib/hook-engine/coverage.js +163 -0
- package/dist/lib/hook-engine/native-precompact-compatibility.json +1 -0
- package/dist/lib/hot-channels/signals-pass.d.ts +52 -2
- package/dist/lib/hot-channels/signals-pass.js +65 -3
- package/dist/lib/install/claude-targets.d.ts +6 -0
- package/dist/lib/install/claude-targets.js +9 -1
- package/dist/lib/lanes/reconcile-result.d.ts +1 -1
- package/dist/lib/lanes/reconcile.js +19 -4
- package/dist/lib/lanes/remote-control-lane.d.ts +6 -0
- package/dist/lib/lanes/remote-control-lane.js +10 -1
- package/dist/lib/lanes/spawn.d.ts +2 -0
- package/dist/lib/lanes/spawn.js +19 -3
- package/dist/lib/lanes/worker-env-scrub.d.ts +48 -0
- package/dist/lib/lanes/worker-env-scrub.js +146 -0
- package/dist/lib/lanes/worker-process.js +4 -1
- package/dist/lib/mesh/client.js +5 -1
- package/dist/lib/mesh/live/daemon/doctor.d.ts +9 -0
- package/dist/lib/mesh/live/daemon/doctor.js +51 -6
- package/dist/lib/mesh/live/daemon/install.d.ts +39 -0
- package/dist/lib/mesh/live/daemon/install.js +70 -0
- package/dist/lib/mesh/live/daemon/outbox-company.d.ts +47 -0
- package/dist/lib/mesh/live/daemon/outbox-company.js +77 -0
- package/dist/lib/mesh/live/daemon/run.d.ts +2 -0
- package/dist/lib/mesh/live/daemon/run.js +48 -3
- package/dist/lib/mesh/live/daemon/state.d.ts +5 -0
- package/dist/lib/mesh/live/daemon/system-unit.d.ts +21 -0
- package/dist/lib/mesh/live/daemon/system-unit.js +80 -0
- package/dist/lib/mesh/live/daemon/transcript-watch.d.ts +4 -1
- package/dist/lib/mesh/live/daemon/transcript-watch.js +42 -38
- package/dist/lib/mesh/live/direct-drain.js +3 -1
- package/dist/lib/mesh/live/emit.js +4 -2
- package/dist/lib/mesh/live/flush.d.ts +61 -0
- package/dist/lib/mesh/live/flush.js +434 -114
- package/dist/lib/mesh/live/paths.d.ts +10 -0
- package/dist/lib/mesh/live/paths.js +14 -0
- package/dist/lib/mesh/live/reporting-privacy.d.ts +41 -1
- package/dist/lib/mesh/live/reporting-privacy.js +81 -7
- package/dist/lib/mesh/live/spool.d.ts +171 -17
- package/dist/lib/mesh/live/spool.js +777 -62
- package/dist/lib/signals/engine.d.ts +82 -2
- package/dist/lib/signals/engine.js +389 -53
- package/dist/lib/signals/steps/extract.js +5 -0
- package/dist/lib/sync-core/engine-holds.d.ts +17 -1
- package/dist/lib/sync-core/engine-holds.js +73 -3
- package/dist/lib/sync-core/reconcile.js +10 -2
- package/dist/lib/work-context/organize.d.ts +22 -4
- package/dist/lib/work-context/organize.js +50 -21
- package/dist/lib/work-context/paths.d.ts +6 -0
- package/dist/lib/work-context/paths.js +9 -0
- package/dist/lib/work-context/reconcile.d.ts +1 -1
- package/dist/lib/work-context/reconcile.js +1 -1
- package/dist/startup-registration.d.ts +14 -0
- package/dist/startup-registration.js +26 -0
- package/dist/utils/cli-telemetry.d.ts +6 -0
- package/dist/utils/cli-telemetry.js +154 -9
- package/dist/utils/github-tag-fallback.d.ts +7 -2
- package/dist/utils/github-tag-fallback.js +17 -8
- package/dist/utils/hq-core-source.d.ts +31 -0
- package/dist/utils/hq-core-source.js +144 -0
- package/dist/utils/interactive-caller.d.ts +6 -0
- package/dist/utils/interactive-caller.js +8 -0
- package/dist/utils/shipped-codex-hooks.d.ts +6 -4
- package/dist/utils/shipped-codex-hooks.js +22 -10
- package/dist/utils/vault-api.js +1 -0
- package/dist/utils/version-report.d.ts +3 -1
- package/dist/utils/version-report.js +13 -5
- package/docs/anywhere-runtime.md +2 -2
- package/package.json +8 -8
- package/scripts/check-function-manifest.mjs +99 -18
|
@@ -42,12 +42,29 @@
|
|
|
42
42
|
// the release leaves out (* within a folder, ** across
|
|
43
43
|
// folders, ?). Repeatable; none are built in
|
|
44
44
|
// --json print the result as JSON
|
|
45
|
-
// --max-
|
|
46
|
-
//
|
|
47
|
-
//
|
|
45
|
+
// --max-work <name>=<n> set one work limit (see "Work budget" below).
|
|
46
|
+
// Repeatable
|
|
47
|
+
// --max-seconds <n> also fail a run that takes n seconds or longer of
|
|
48
|
+
// wall time (rule time-budget). Off unless given. For a
|
|
49
|
+
// local timing check only: wall time depends on how
|
|
50
|
+
// busy the machine is, so CI never passes it
|
|
48
51
|
//
|
|
49
52
|
// Exit 0: no problem. Exit 1: at least one problem. Exit 2: usage error.
|
|
50
53
|
//
|
|
54
|
+
// Work budget
|
|
55
|
+
// The check has to run locally in under 10 seconds (hq-core-rust US-003).
|
|
56
|
+
// Wall time on a shared CI machine depends on its load, so the check counts
|
|
57
|
+
// the work it does instead and fails (rule work-budget) when a count goes
|
|
58
|
+
// over its limit in WORK_LIMITS:
|
|
59
|
+
// subprocesses git and pwd processes started
|
|
60
|
+
// filesListed paths listed from git or a folder walk
|
|
61
|
+
// filesRead files read
|
|
62
|
+
// bytesRead bytes read from those files
|
|
63
|
+
// needleScans file x reference-target pairs searched for a needle
|
|
64
|
+
// lineChecks line x reference-target pairs run through a matcher
|
|
65
|
+
// The counts are the same on every machine and under any load. How the
|
|
66
|
+
// limits were set is in the comment on WORK_LIMITS.
|
|
67
|
+
//
|
|
51
68
|
// Trees covered by the "exists on disk" rule
|
|
52
69
|
// hq-core-staging: .claude/hooks, core/hooks, .codex/hooks, .grok/hooks (kind
|
|
53
70
|
// hook) and core/scripts (kind script). Test folders (tests, __tests__,
|
|
@@ -131,8 +148,54 @@ const DOC_EXT_RE = /\.(md|mdx|mdc|txt|rst|html?)$/i;
|
|
|
131
148
|
const COMMENT_RE = /^\s*(#(?!!)|\/\/|\/\*|\*(\s|$)|<!--|rem\s|::\s)/i;
|
|
132
149
|
const SCRIPT_NAME_RE = /\.(sh|bash|mjs|cjs|js|py|ps1|cmd|awk)$/;
|
|
133
150
|
const MAX_FILE_BYTES = 2_000_000;
|
|
134
|
-
//
|
|
135
|
-
|
|
151
|
+
// Work limits (rule work-budget). They replace a 10 s wall-clock limit that
|
|
152
|
+
// failed on a busy shared CI machine (12.9 s on a loaded MBP5, 2026-11-21) for
|
|
153
|
+
// a run that passes in a few seconds on an idle one.
|
|
154
|
+
// The CI command (--cli-root . --manifest scripts/function-manifest.yaml
|
|
155
|
+
// --cli-states ... --require-cli-states) counted the same on the light Mac
|
|
156
|
+
// pool and on EC2 (draft run 44873969164, hq-cli 943393d0 plus this change):
|
|
157
|
+
// subprocesses 6, filesListed 20,507, filesRead 2,052, bytesRead 35.8 MB,
|
|
158
|
+
// needleScans 151,552, lineChecks 24.1 million.
|
|
159
|
+
// That run took 2.5 s on EC2 and 10.2 s on the busy light pool. At 2.5 s, 10 s
|
|
160
|
+
// is 4 times the work, so each limit is about 4 times its CI count: if one kind
|
|
161
|
+
// of work grows that much, the run reaches about 10 s on EC2. lineChecks is
|
|
162
|
+
// most of the run time (command targets search every line holding "hq").
|
|
163
|
+
// A local run with --core-root (hq-core-staging 412b358b5) and --cli-root
|
|
164
|
+
// counts subprocesses 12, filesListed 24,638, filesRead 3,632, bytesRead
|
|
165
|
+
// 50.6 MB, needleScans 264,844, lineChecks 30.3 million: under every limit.
|
|
166
|
+
export const WORK_LIMITS = Object.freeze({
|
|
167
|
+
subprocesses: 24,
|
|
168
|
+
filesListed: 82_000,
|
|
169
|
+
filesRead: 8_200,
|
|
170
|
+
bytesRead: 143_000_000,
|
|
171
|
+
needleScans: 606_000,
|
|
172
|
+
lineChecks: 96_500_000,
|
|
173
|
+
});
|
|
174
|
+
const WORK_KEYS = Object.keys(WORK_LIMITS);
|
|
175
|
+
|
|
176
|
+
// ---------- work counter ----------
|
|
177
|
+
// Every subprocess, listed path, file read and matcher call is counted here,
|
|
178
|
+
// so `work` holds the whole cost of a run.
|
|
179
|
+
let work = newWork();
|
|
180
|
+
function newWork() { return Object.fromEntries(WORK_KEYS.map((k) => [k, 0])); }
|
|
181
|
+
function runCommand(cmd, args, opts) {
|
|
182
|
+
work.subprocesses++;
|
|
183
|
+
return execFileSync(cmd, args, opts);
|
|
184
|
+
}
|
|
185
|
+
function readText(file) {
|
|
186
|
+
const buf = readFileSync(file);
|
|
187
|
+
work.filesRead++;
|
|
188
|
+
work.bytesRead += buf.length;
|
|
189
|
+
return buf.toString("utf8");
|
|
190
|
+
}
|
|
191
|
+
/** Work counts over their limits, as work-budget problems. */
|
|
192
|
+
export function checkWork(counts, limits = WORK_LIMITS) {
|
|
193
|
+
const problems = [];
|
|
194
|
+
for (const k of WORK_KEYS) {
|
|
195
|
+
if (counts[k] > limits[k]) problems.push({ rule: "work-budget", counter: k, count: counts[k], limit: limits[k], message: `the check did too much work: ${k} is ${counts[k]}, over its limit of ${limits[k]} (WORK_LIMITS in scripts/check-function-manifest.mjs). The limits keep the check under 10 s on a developer Mac; find what made it do more work before raising one` });
|
|
196
|
+
}
|
|
197
|
+
return problems;
|
|
198
|
+
}
|
|
136
199
|
|
|
137
200
|
// ---------- small helpers ----------
|
|
138
201
|
const posix = (p) => p.split(path.sep).join("/");
|
|
@@ -140,14 +203,14 @@ const esc = (s) => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
|
140
203
|
|
|
141
204
|
function isGitRoot(root) {
|
|
142
205
|
try {
|
|
143
|
-
const top =
|
|
206
|
+
const top = runCommand("git", ["-C", root, "rev-parse", "--show-toplevel"], { encoding: "utf8", stdio: ["ignore", "pipe", "ignore"] }).trim();
|
|
144
207
|
return path.resolve(top) === path.resolve(statSync(root).isDirectory() ? realPath(root) : root);
|
|
145
208
|
} catch {
|
|
146
209
|
return false;
|
|
147
210
|
}
|
|
148
211
|
}
|
|
149
212
|
function realPath(p) {
|
|
150
|
-
try { return
|
|
213
|
+
try { return runCommand("pwd", ["-P"], { cwd: p, encoding: "utf8" }).trim(); } catch { return path.resolve(p); }
|
|
151
214
|
}
|
|
152
215
|
|
|
153
216
|
/** Files under `dirs` (repo-relative, forward slashes) that exist on disk. */
|
|
@@ -157,12 +220,15 @@ function listFiles(root, dirs) {
|
|
|
157
220
|
if (isGitRoot(root)) {
|
|
158
221
|
// Tracked files plus new files that are not ignored, so a file added and
|
|
159
222
|
// not yet committed is seen. A file deleted in the work tree is dropped.
|
|
160
|
-
const out =
|
|
161
|
-
|
|
223
|
+
const out = runCommand("git", ["-C", root, "ls-files", "-z", "--cached", "--others", "--exclude-standard", "--", ...present], { encoding: "utf8", maxBuffer: 512 * 1024 * 1024 });
|
|
224
|
+
const listed = out.split("\0").filter(Boolean);
|
|
225
|
+
work.filesListed += listed.length;
|
|
226
|
+
return [...new Set(listed)].filter((f) => !SKIP_DIR_RE.test(f) && existsSync(path.join(root, f)));
|
|
162
227
|
}
|
|
163
228
|
const found = [];
|
|
164
229
|
const walk = (rel) => {
|
|
165
230
|
for (const entry of readdirSync(path.join(root, rel), { withFileTypes: true })) {
|
|
231
|
+
work.filesListed++;
|
|
166
232
|
const child = rel === "." ? entry.name : `${rel}/${entry.name}`;
|
|
167
233
|
if (SKIP_DIR_RE.test(child)) continue;
|
|
168
234
|
if (entry.isDirectory()) walk(child);
|
|
@@ -305,7 +371,7 @@ function flattenCatalog(nodes, prefix = [], aliases = new Map(), out = []) {
|
|
|
305
371
|
function readSourceCatalog(cliRoot) {
|
|
306
372
|
const file = path.join(cliRoot, "src/command-catalog.generated.ts");
|
|
307
373
|
if (!existsSync(file)) return null;
|
|
308
|
-
const text =
|
|
374
|
+
const text = readText(file);
|
|
309
375
|
const marker = "export const COMMAND_CATALOG = ";
|
|
310
376
|
const start = text.indexOf(marker);
|
|
311
377
|
const end = text.lastIndexOf("] as const");
|
|
@@ -315,6 +381,8 @@ function readSourceCatalog(cliRoot) {
|
|
|
315
381
|
async function readPackageCatalog(pkgRoot) {
|
|
316
382
|
const file = path.join(pkgRoot, "dist/command-catalog.generated.js");
|
|
317
383
|
if (!existsSync(file)) return null;
|
|
384
|
+
work.filesRead++;
|
|
385
|
+
work.bytesRead += statSync(file).size;
|
|
318
386
|
const mod = await import(pathToFileURL(file).href);
|
|
319
387
|
return flattenCatalog(mod.COMMAND_CATALOG);
|
|
320
388
|
}
|
|
@@ -359,6 +427,7 @@ export function checkCliPackage(entries, pkgRoot, catalog) {
|
|
|
359
427
|
const built = [];
|
|
360
428
|
const walk = (abs) => {
|
|
361
429
|
for (const entry of readdirSync(abs, { withFileTypes: true })) {
|
|
430
|
+
work.filesListed++;
|
|
362
431
|
const child = path.join(abs, entry.name);
|
|
363
432
|
if (entry.isDirectory()) walk(child);
|
|
364
433
|
else if (entry.isFile()) built.push(posix(path.relative(pkgRoot, child)));
|
|
@@ -495,9 +564,10 @@ export function findReferences(targets, root, { allFiles, manifest } = {}) {
|
|
|
495
564
|
let stat;
|
|
496
565
|
try { stat = statSync(path.join(root, file)); } catch { continue; }
|
|
497
566
|
if (!stat.isFile() || stat.size > MAX_FILE_BYTES) continue;
|
|
498
|
-
const body =
|
|
567
|
+
const body = readText(path.join(root, file));
|
|
499
568
|
if (body.includes("\u0000")) continue;
|
|
500
569
|
scanned++;
|
|
570
|
+
work.needleScans += targets.length;
|
|
501
571
|
const live = targets.filter((t) => t.needles.some((n) => body.includes(n)));
|
|
502
572
|
if (!live.length) continue;
|
|
503
573
|
const isDoc = DOC_EXT_RE.test(file);
|
|
@@ -511,6 +581,7 @@ export function findReferences(targets, root, { allFiles, manifest } = {}) {
|
|
|
511
581
|
const text = lines[i];
|
|
512
582
|
if (text.length > 6000) continue;
|
|
513
583
|
if (!isDoc && COMMENT_RE.test(text)) continue;
|
|
584
|
+
work.lineChecks++;
|
|
514
585
|
const how = t.match(text, file);
|
|
515
586
|
if (!how) continue;
|
|
516
587
|
problems.push({
|
|
@@ -560,7 +631,7 @@ function referenceTargets(entries, aliases) {
|
|
|
560
631
|
export function readCliStates(file) {
|
|
561
632
|
if (!existsSync(file)) return { missing: true };
|
|
562
633
|
let data;
|
|
563
|
-
try { data = JSON.parse(
|
|
634
|
+
try { data = JSON.parse(readText(file)); } catch (err) { return { problems: [{ rule: "cli-states", message: `${file} is not JSON: ${err.message}` }] }; }
|
|
564
635
|
const problems = [];
|
|
565
636
|
if (data?.schema !== 1) problems.push({ rule: "cli-states", message: `${file}: schema must be 1` });
|
|
566
637
|
const commands = data?.commands;
|
|
@@ -642,6 +713,7 @@ export function checkInstalledCore(root, { keep = [], tooling = [] } = {}) {
|
|
|
642
713
|
const entries = readdirSync(rel ? path.join(root, rel) : root, { withFileTypes: true });
|
|
643
714
|
entries.sort((a, b) => (a.name < b.name ? -1 : a.name > b.name ? 1 : 0));
|
|
644
715
|
for (const entry of entries) {
|
|
716
|
+
work.filesListed++;
|
|
645
717
|
const child = rel ? `${rel}/${entry.name}` : entry.name;
|
|
646
718
|
// Dirent types come from lstat: a symlink is never a directory here.
|
|
647
719
|
if (entry.isDirectory()) {
|
|
@@ -666,12 +738,12 @@ export function checkInstalledCore(root, { keep = [], tooling = [] } = {}) {
|
|
|
666
738
|
|
|
667
739
|
function readKeepFile(file) {
|
|
668
740
|
if (!existsSync(file)) usage(`--keep-file ${file} does not exist`);
|
|
669
|
-
return
|
|
741
|
+
return readText(file).split("\n").map((l) => l.replace(/\r$/, "").trim()).filter((l) => l && !l.startsWith("#"));
|
|
670
742
|
}
|
|
671
743
|
|
|
672
744
|
// ---------- main ----------
|
|
673
745
|
function parseArgs(argv) {
|
|
674
|
-
const opt = { json: false, noManifest: false, keep: [], tooling: [], maxSeconds:
|
|
746
|
+
const opt = { json: false, noManifest: false, keep: [], tooling: [], maxSeconds: null, maxWork: { ...WORK_LIMITS } };
|
|
675
747
|
const value = (i) => {
|
|
676
748
|
if (argv[i + 1] === undefined) usage(`${argv[i]} needs a value`);
|
|
677
749
|
return argv[i + 1];
|
|
@@ -695,6 +767,12 @@ function parseArgs(argv) {
|
|
|
695
767
|
if (!/^\d+(\.\d+)?$/.test(v)) usage(`--max-seconds needs a number of seconds, got ${v}`);
|
|
696
768
|
opt.maxSeconds = Number(v);
|
|
697
769
|
}
|
|
770
|
+
else if (a === "--max-work") {
|
|
771
|
+
const v = value(i++);
|
|
772
|
+
const m = /^([A-Za-z]+)=(\d+)$/.exec(v);
|
|
773
|
+
if (!m || !WORK_KEYS.includes(m[1])) usage(`--max-work needs <name>=<count> with a name from ${WORK_KEYS.join(", ")}, got ${v}`);
|
|
774
|
+
opt.maxWork[m[1]] = Number(m[2]);
|
|
775
|
+
}
|
|
698
776
|
else if (a === "--help" || a === "-h") usage();
|
|
699
777
|
else usage(`unknown argument: ${a}`);
|
|
700
778
|
}
|
|
@@ -702,12 +780,13 @@ function parseArgs(argv) {
|
|
|
702
780
|
}
|
|
703
781
|
function usage(error) {
|
|
704
782
|
if (error) console.error(`check-function-manifest: ${error}`);
|
|
705
|
-
console.error("usage: node scripts/check-function-manifest.mjs [--manifest <file>] [--core-root <dir>] [--cli-root <dir> | --cli-package <dir>] [--cli-states <file> [--require-cli-states]] [--no-manifest] [--installed-core <dir> [--keep <path>]... [--keep-file <file>] [--tooling <glob>]...] [--max-seconds <n>] [--json]");
|
|
783
|
+
console.error("usage: node scripts/check-function-manifest.mjs [--manifest <file>] [--core-root <dir>] [--cli-root <dir> | --cli-package <dir>] [--cli-states <file> [--require-cli-states]] [--no-manifest] [--installed-core <dir> [--keep <path>]... [--keep-file <file>] [--tooling <glob>]...] [--max-work <name>=<n>]... [--max-seconds <n>] [--json]");
|
|
706
784
|
process.exit(2);
|
|
707
785
|
}
|
|
708
786
|
|
|
709
787
|
export async function run(argv) {
|
|
710
788
|
const started = Date.now();
|
|
789
|
+
work = newWork();
|
|
711
790
|
const opt = parseArgs(argv);
|
|
712
791
|
const here = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
|
|
713
792
|
if (!opt.cliRoot && !opt.cliPackage) {
|
|
@@ -737,7 +816,7 @@ export async function run(argv) {
|
|
|
737
816
|
if ((opt.cliRoot || opt.cliPackage) && !catalog) usage(`${opt.cliRoot || opt.cliPackage} has no command catalog`);
|
|
738
817
|
|
|
739
818
|
if (opt.manifest) {
|
|
740
|
-
const parsed = parseManifest(
|
|
819
|
+
const parsed = parseManifest(readText(opt.manifest));
|
|
741
820
|
entries = parsed.entries;
|
|
742
821
|
problems.push(...parsed.problems, ...checkEntries(entries));
|
|
743
822
|
const n = (pred) => entries.filter(pred).length;
|
|
@@ -797,15 +876,17 @@ export async function run(argv) {
|
|
|
797
876
|
}
|
|
798
877
|
if (opt.noManifest) notices.push("--no-manifest: the manifest rules did not run here; they run where the manifest is (hq-core-staging pull requests and a local run with --core-root)");
|
|
799
878
|
|
|
879
|
+
problems.push(...checkWork(work, opt.maxWork));
|
|
800
880
|
const elapsedMs = Date.now() - started;
|
|
801
|
-
if (elapsedMs >= opt.maxSeconds * 1000) {
|
|
881
|
+
if (opt.maxSeconds !== null && elapsedMs >= opt.maxSeconds * 1000) {
|
|
802
882
|
problems.push({ rule: "time-budget", message: `the check took ${(elapsedMs / 1000).toFixed(1)} s; it must finish in under ${opt.maxSeconds} s (--max-seconds) so it stays fast enough to run locally` });
|
|
803
883
|
}
|
|
804
884
|
const seconds = (elapsedMs / 1000).toFixed(1);
|
|
805
885
|
if (opt.json) {
|
|
806
|
-
console.log(JSON.stringify({ ok: problems.length === 0, seconds: Number(seconds), checked, notices, problems }, null, 2));
|
|
886
|
+
console.log(JSON.stringify({ ok: problems.length === 0, seconds: Number(seconds), work: { ...work }, workLimits: opt.maxWork, checked, notices, problems }, null, 2));
|
|
807
887
|
} else {
|
|
808
888
|
for (const c of checked) console.log(`checked: ${c}`);
|
|
889
|
+
console.log(`work: ${WORK_KEYS.map((k) => `${k} ${work[k]} of ${opt.maxWork[k]}`).join(", ")}`);
|
|
809
890
|
for (const n of notices) console.log(`note: ${n}`);
|
|
810
891
|
for (const p of problems) console.error(`FAIL [${p.rule}] ${p.message}`);
|
|
811
892
|
if (problems.length) console.error(`function manifest check failed: ${problems.length} problem${problems.length === 1 ? "" : "s"} (${seconds} s)`);
|