@indigoai-us/hq-cli 5.345.252 → 5.345.253
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 +41 -0
- package/contracts/host-canary-release.json +5 -5
- package/dist/command-catalog.generated.d.ts +148 -0
- package/dist/command-catalog.generated.js +182 -0
- package/dist/command-registration-plan.d.ts +6 -0
- package/dist/command-registration-plan.js +1 -0
- package/dist/commands/ci-intake.d.ts +15 -0
- package/dist/commands/ci-intake.js +252 -0
- package/dist/commands/ci-metrics.d.ts +8 -0
- package/dist/commands/ci-metrics.js +55 -0
- package/dist/commands/ci.d.ts +13 -0
- package/dist/commands/ci.js +10 -0
- package/dist/commands/files.d.ts +62 -0
- package/dist/commands/files.js +249 -8
- package/dist/lib/bot/fleet-cron.d.ts +15 -0
- package/dist/lib/bot/fleet-cron.js +119 -20
- package/dist/lib/daemon/run.js +4 -3
- package/dist/lib/delivery/migrations.d.ts +32 -1
- package/dist/lib/delivery/migrations.js +69 -8
- package/dist/lib/hook-engine/adapter-core-pin.d.ts +2 -1
- package/dist/lib/hook-engine/adapter-core-pin.js +2 -1
- package/dist/lib/hook-engine/coverage.d.ts +15 -0
- package/dist/lib/hook-engine/coverage.js +62 -1
- package/dist/lib/smart-ci/cost.d.ts +72 -0
- package/dist/lib/smart-ci/cost.js +120 -0
- package/dist/lib/smart-ci/github.d.ts +112 -0
- package/dist/lib/smart-ci/github.js +267 -0
- package/dist/lib/smart-ci/intake.d.ts +288 -0
- package/dist/lib/smart-ci/intake.js +1078 -0
- package/dist/lib/smart-ci/ledger.d.ts +218 -0
- package/dist/lib/smart-ci/ledger.js +527 -0
- package/dist/lib/smart-ci/metrics.d.ts +137 -0
- package/dist/lib/smart-ci/metrics.js +249 -0
- package/dist/lib/smart-ci/records.d.ts +265 -0
- package/dist/lib/smart-ci/records.js +281 -0
- package/dist/lib/smart-ci/reducer.d.ts +67 -0
- package/dist/lib/smart-ci/reducer.js +261 -0
- package/dist/lib/sync-core/engine-holds.d.ts +14 -0
- package/dist/lib/sync-core/engine-holds.js +78 -11
- package/dist/lib/sync-core/hand-back.d.ts +1 -0
- package/dist/lib/sync-core/hand-back.js +7 -2
- package/dist/lib/sync-core/reconcile.js +10 -2
- package/package.json +9 -7
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,47 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [5.345.253] — 2026-11-24
|
|
6
|
+
- Resolve `agents-v2` adapter parent and grandparent directories via `Path::parent()` before canonicalizing so Windows verbatim (`\\?\`) paths locate the HQ root instead of failing on `..` normalization.
|
|
7
|
+
- Claim `master-hook:PreToolUse` natively on hosted agents-v2 bots, modelled on master-hook.sh 774bca73 (hq-core v16.0.50) as the hq-agents-v2 adapter e5cec6c1 runs it, with differential tests against both. A `pre_tool_call` goes back to the adapter when the registered fallback is the earlier released adapter a8e9a7e, the root has `.claude/hooks/mandatory-scope-authorizer.sh`, the registry lists any PreToolUse row or is one this reader rejects, a PreToolUse folder hook outside `companies/` exists, or the host is not Unix. A fallback naming any other unknown adapter revision is refused natively when none of these hands the call back. The merge gates (hold records, daemon sections, owner approval, review) no longer answer on agents-v2, matching the released adapter, which never refused a merge there. On Claude Code and Codex, the native hqd policy check with `HOME` unset or empty now looks for the socket at `/.hq/daemon/hqd.sock`, as master-hook does.
|
|
8
|
+
- Internal: the merged write guard shadow in `hq-hook` is now claimed on hosted agents (`agents-v2`). It records what the released agents-v2 adapter records: the adapter's own payload and tool name (approval requests included), its HQ root as the project folder, every tool the registry row's matcher takes, and calls a later guard refuses. It runs only when the adapter's settings and registry would run the row. An unreadable wrapper is refused, as the adapter refuses it. A wrapper of an unknown revision, or any call on Windows, goes back to the adapter. A call the native row cannot rebuild is refused only while a session's shadow marker is on. A call is refused once the runtime's own pre_tool_call hook timeout from its config has passed. `hq reindex` keeps agents-v2 PreToolUse on the adapter while the registry lists the row and its files are off their pins.
|
|
9
|
+
- Internal: `hq-hook` now accepts the hq-agents-v2 #347 hook adapter (sha256 `31877890`, shipped in the v2.71 p33a944a artifact) on hosted agents. SessionEnd, SubagentStop, PostToolUse, UserPromptSubmit and SessionStart stay native under it, as they do under the #332 adapter, when the call's native time budget ends before #347 stops starting hooks (its 21 s budget, 56 s on SessionEnd and SubagentStop, less its 2 s kill grace and 1 s). The event goes back to the adapter when `HQ_AGENTS_V2_HOOK_BUDGET_SECONDS` lowers that budget, `SECONDS` or `HQ_PERL_BIN` is set, `core/scripts/lib/advisory-cap.sh` or `perl-child-locale.sh` is present but not a released copy, `advisory-cap.sh` is present without `perl-child-locale.sh`, the budget value is too large for the adapter's integer test, or a PostToolUse or SessionStart call has company folder hooks. PreToolUse and Stop under #347 always go back to the adapter: #347 runs PreToolUse safety guards first, skips other guards and advisory hooks that run past its budget, blocks on a missing safety guard, and drops a Stop hook's block when the hook runs out of time. Before this change a #347 adapter sent every gated event back to the adapter, and a native PreToolUse registration refused every tool call under it.
|
|
10
|
+
- Stripped the Windows `\\?\` verbatim prefix from temporary fixture directories in the credential-guard test harness (`credential_native`, `credential_history`, `credential_reflog`, and `support/credential_history`) and normalized Windows `jq` CRLF stdout in the `credential_history` legacy comparison.
|
|
11
|
+
- CI: the Windows (Beaker) baseline reader no longer marks the hook crate's lib unit tests as aborted when a child test's result line is glued onto the end of a parent test line, so a main baseline where every binary reported reads as complete.
|
|
12
|
+
- Bound pipe reads and writes in the Glob parity test harness so a stalled subprocess fails with a timeout diagnostic.
|
|
13
|
+
- Pin `jq-1.7.1` and `yq v4.54.3` via SHA-256-verified downloads in the Windows `hq-hook` workflow and add fast tool/version preflight and bounded child execution to `block_hq_glob` parity tests.
|
|
14
|
+
- Internal: contributors get `pnpm changelog:new` and `pnpm changelog:check`, and the pre-push hook now runs the release-note fragment check locally. When a branch adds no `changelog.d` fragment, the hook writes a draft from the branch's first commit subject and stops the push, so the required "changelog entry" check no longer fails after a full CI cycle. The hook refreshes `origin/main` first and does not block stacked branches or failures it cannot confirm against a current base. `HQ_NO_CHANGELOG=1` skips the local check only.
|
|
15
|
+
- Internal: split `build` into `build-node20` and native-`needs:` `build-node22` (`build (node 22) / ci`) with report-only coverage merge moved to an advisory `coverage-summary` job, and wired hardened `scripts/ci/changelog-only-reuse.mjs` into `ci.yml`'s `route` job so `changelog.d/`-only synchronize pushes over a full green run skip redundant shards.
|
|
16
|
+
- Internal: added fail-closed `scripts/ci/changelog-only-reuse.mjs` helper (unwired) and unit tests to verify when a pull request `synchronize` push changes only `changelog.d/*.md` release-note fragments on top of a prior full green `ci.yml` run.
|
|
17
|
+
- Fail closed on `build (node 22) / ci` and `e2e (node 22)` for same-repo draft PRs skipped by `HQ_DRAFT_PR_CI=off` (zero-checkout step on `hq-mac-light`) so stale `skipped` statuses cannot satisfy branch protection on `ready_for_review` before upstream shards complete.
|
|
18
|
+
- Internal: CI's four e2e shards now split the e2e files by measured time and start each shard's heaviest file first, using the same weighted sequencer as the unit shards. Under vitest's default split the slowest e2e shard took about 192 s against about 32 s for the quickest; the estimate after the change is about 160 s for the slowest.
|
|
19
|
+
- CI: hook-crate pull requests now run only the tests their change reaches, in 1 to 4 shards planned by `scripts/ci/hq-hook-test-plan.mjs`. Slow bash-parity cases run on a pull request only when it changes their own module or test file. Batch train pushes and the daily main run still run every test in 6 balanced shards. Node affected-test selection is now on by default for pull requests (`HQ_CLI_PR_AFFECTED_TESTS=off` turns it off). Known Windows failures on main are tracked with an owner in `crates/hq-hook/ci/windows-known-failures.json`.
|
|
20
|
+
- Internal: added the `HQ_DRAFT_PR_CI=off` draft guard and `ready_for_review` trigger to `stop-native-pr.yml`, and switched `e2e (node 22)` in `ci.yml` from `wait-for-jobs.mjs` polling to native `needs: [route, e2e-build, e2e-shard]` with `always() && !cancelled()`.
|
|
21
|
+
- CI: the hook PR test tiers now treat the new 16.0.51 gate target's four slow delivery-regex parity tests like its siblings': they run on batch trains and the daily main run, and on a pull request only when the diff touches the gate or command-guard code.
|
|
22
|
+
- The daily hot-channel sync on a local bot no longer messages you every morning when it could not reach the network. It retries for a few minutes first (a laptop that just woke often has no connection yet), stays quiet on a single failed morning, and tells you once when the same failure repeats. Any failure is sent at most once until a run works or the reason changes.
|
|
23
|
+
- PreToolUse native members report executed registry and folder hooks to `pre_tool_use_master::ran` so timeout-sentry rows and `HQ_HOOK_TRACE` lines match `master-hook.sh`.
|
|
24
|
+
- `hq files delete` now handles the per-company delete limit in HQ Pro. When the server stops a delete, it shows how many objects the delete would remove, how many were already deleted in the window, and the limit. In a terminal you can type a confirmation to go ahead; without a terminal, or with only `--yes`, it stops. When the server needs another owner or admin to approve, it says so and exits with an error. `--dry-run` warns when a real delete would hit the limit. When the server runs the limit in watch-only mode, `--dry-run` says a real delete would go through and shows the limit, instead of saying it would be stopped. When another owner or admin must approve, the message says no HQ command can approve it yet. If the delete alone is over the approval limit, it says to split it into chunks no bigger than the limit and wait for the window to pass between chunks; otherwise it says to wait for the window to pass. `--dry-run` gives the same advice. `--confirmation` together with `--dry-run` is now an error.
|
|
25
|
+
- Fix Windows test-harness tool discovery (`which` and `/bin/bash`) in `hq-hook` parity suites (`merged_write_guard`, `command_rules`, `numbered_policy_sibling`)
|
|
26
|
+
- Drop the obsolete US-048 side-effect ledger row for PreToolUse per-hook journal rows; native PreToolUse now journals the same rows and trace lines as `master-hook.sh`.
|
|
27
|
+
- Internal: `hq-hook` now accepts the `core/scripts/lib/hook-adapter-core.sh` that HQ Core v16.0.51 ships on hosted agents (`agents-v2`) and local fleet bots (`fleet-local`). It differs from the revision the native ports already reproduce only in comment lines, so on a v16.0.51 install fleet-local PreToolUse and agents-v2 and fleet-local PostToolUse are answered natively instead of being refused or handed back to the shell adapter. `hq reindex` lets fleet-local PostToolUse switch on that file as well.
|
|
28
|
+
- Bound the `jq` index-error probe in `gate::post` with a 500 ms hard deadline and process-tree cleanup so a missing or hanging `jq` cannot stall `PostToolUse`.
|
|
29
|
+
- Create the disposable `<base>/reindex-codex` directory in `scripts/host-canary.mjs` before invoking `reindex` with `CODEX_HOME` pointing to it.
|
|
30
|
+
- Changed: the host canary record shipped with the CLI is refreshed for this release build.
|
|
31
|
+
- Move the `hq-hook` release-tag Windows x64 job to self-hosted Beaker runners (`[self-hosted, Windows, X64, hq-windows]`) using the pinned Beaker Rust toolchain step and add a `platforms=windows-beaker` manual dispatch option.
|
|
32
|
+
- Pin the GNU Bash version used alongside system Bash for macOS image-context parity tests.
|
|
33
|
+
- Internal: the repository merge-hold check in `hq-hook` now decides like `hq runners hold check` and is claimed on hosted agents (`agents-v2`) as well as Claude Code, Codex and Grok Build. Holds are matched by repository whatever company owns them, and a hold company's `lanes.repo-merge-hold` setting that the daemon does not report as on is read from the flag registry at the call, as the CLI reads it. A merge is refused when a hold record or that setting cannot be read or trusted, including a record with a field `hq runners hold` never writes and a registry read that runs out of time. The short window in which a held merge was allowed after the setting was switched on is gone. Hold records are read under the registered HQ root as well as the hook's own. On agents-v2, where the shell adapter never applied the hold, merges are now checked with the hold and review records exactly as `hq runners hold check` checks them. The daemon-state, conduct-link, owner-approval and daemon review-row refusals no longer apply on agents-v2, as the released agents-v2 adapter never applied them, and `hq-hook` tests now cover every merge refusal agents-v2 keeps or stops applying, on tool calls and exec approvals.
|
|
34
|
+
- Added native support and pin for the updated `inject-policy-on-trigger.sh` revision with MCP PostToolUse trigger text and short-reply handling while keeping earlier pins accepted.
|
|
35
|
+
- agents-v2 hook handling returns to the released behavior. The native agents-v2 PreToolUse, merge-hold and write-guard claims will return in a later release.
|
|
36
|
+
- Added: `hq ci intake` records what CI does for a repository (workflow runs and jobs, check runs, pull requests, pushes, and runner pool counts) into the HQ Native run ledger, and `hq ci metrics --repo <owner/repo> --since <date>` prints queue wait and run time (median and p90), replaced-head runs, cold-start and idle runner minutes, PR open to merge, merge to production where the repository deploys on merge, and cost per merge with each input marked measured or estimated. The intake only reads GitHub, as this machine's signed-in `gh` login: it sends GET requests, uses conditional requests so unchanged data costs no rate limit, checks every request against an hourly budget that is kept across restarts (default 1,500 charged requests), stops while the login has 500 or fewer requests left, and writes one audit line per request. A restarted intake continues from its saved position and records nothing twice; a stretch it could not read is written to the ledger as a gap. Closed records older than two hours move to dated archive files beside the ledger, which `hq ci metrics` reads as well. `--replay-fixture` records from a saved file and `--record-fixture` saves a past window as one. Nothing in `hq ci` changes GitHub, a workflow or a runner. The ledger store file moves to schema version 8, which adds an empty Smart CI section to existing stores when they are next opened.
|
|
37
|
+
- `hq sync-core` hand-back now knows every hold direction hq-syncd writes (`delete_local`, `delete_remote`, `overwrite_local`, `overwrite_remote`, `merge`, `undecided`, `not_approvable`). A vault whose engine hold names a change that keeps this device's copy (`overwrite_remote`, `merge`, `undecided`, `not_approvable`), a direction this hq does not know, or a group with no usable direction is no longer handed to the current sync, which would replace those local copies with the vault's: the old-sync switch stays off and the engine keeps its ownership record until the engine runs the vault again and the hold is decided. Each reconcile reports the waiting vault in `rollout.json`.
|
|
38
|
+
- Fixed: on Codex, the PostToolUse redaction check now runs before refusing a call, so plain reads such as `tail` are no longer blocked.
|
|
39
|
+
- Changed: on Codex, policy reminders for a tool call now also arrive before the call runs.
|
|
40
|
+
- Keep `crates/hq-hook/tests/fixtures` `.cjs` and `.mjs` files LF on Windows checkouts so pinned fixture SHA-256 checks match on Windows.
|
|
41
|
+
- Normalize Windows paths, inherited `PATH`, and refusal footer expectations in `command_rules` integration tests.
|
|
42
|
+
- Pass POSIX `cwd` paths to the legacy Bash reference runner on Windows in `credential_native` tests and match the Windows unregistered-root refusal text in `credential_entry`.
|
|
43
|
+
- Accept `hq-core` v16.0.48–v16.0.50 `.claude/hooks/migrate-policy-triggers-if-changed.sh` (`1a01eb3c`) in native `SessionStart` `migrate-policy-triggers` by porting the native `last-success` stamp check, and add a registration-time pin hold in `coverage.ts`.
|
|
44
|
+
- Pin the `hq-core` `v16.0.51` `policy-enforcement-gate.sh` and `hook-gate.sh` in the native Rust hook engine and the registration coverage holds, with `v16.0.51` shell-oracle parity tests, so the native policy enforcement gate answers on a `v16.0.51` root and the `v16.0.51` `hq_augment_path` PATH is reproduced. On a `v16.0.51` root the native gate still treats `broadcast` inside an identifier (`broadcast_inbox_message`, `broadcast2`) as a request for `work-broadcast`, which `v16.0.51`'s shell gate no longer does, so a later gated call can be refused where the shell allowed it. The Grok Stop observer also accepts the `v16.0.51` `session-id.sh`. SessionStart, the first-prompt company bind and the native session bind still hand `v16.0.51` roots back to the shell, because `v16.0.51`'s `master-hook.sh` records environment session aliases that the native path does not write.
|
|
45
|
+
|
|
5
46
|
## [5.345.252] — 2026-11-24
|
|
6
47
|
- Added: the agent MCP tool `hq_dm_send` takes an optional `continueExchange` boolean for agent recipients (`agt_…`). When hq-pro-core 1.182.0 or later pauses an agent-to-agent DM at the loop check, the tool shows the server's warning. The sending agent may then resend the same message once with `continueExchange: true`, and only if the exchange is about unfinished work. The resend reuses the held message's idempotency key, and the tool says "continued the exchange" when the server confirms. If the continued message is held again, the tool tells the agent to stop and not reply. Each DM to an agent now carries its own idempotency key. The flag is refused for a person, an email or a channel recipient, and for a non-boolean value, before anything is sent.
|
|
7
48
|
- The `hq_inbox_read` refused-ack paging test writes its 320 records to the state file in one locked call, instead of rewriting the file 320 times.
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema": "hq.host-canary-release.v1",
|
|
3
|
-
"cliVersion": "5.345.
|
|
3
|
+
"cliVersion": "5.345.253",
|
|
4
4
|
"hosts": {
|
|
5
5
|
"claude": [
|
|
6
6
|
{
|
|
7
7
|
"passed": true,
|
|
8
|
-
"at": "2026-11-
|
|
9
|
-
"engineVersion": "0.3.1+hq.5.345.
|
|
8
|
+
"at": "2026-11-24T19:51:13.230Z",
|
|
9
|
+
"engineVersion": "0.3.1+hq.5.345.253.src.59e8f1923191dbcba843a9703992994f8782a22fd64be131061da7975ae0d421",
|
|
10
10
|
"gateSha256": "a2879dfe692233f5953bac86672947bbd82f3c5247292f3efcb80f16c3d2c6b1"
|
|
11
11
|
},
|
|
12
12
|
{
|
|
13
13
|
"passed": true,
|
|
14
|
-
"at": "2026-11-
|
|
15
|
-
"engineVersion": "0.3.1+hq.5.345.
|
|
14
|
+
"at": "2026-11-24T19:52:12.286Z",
|
|
15
|
+
"engineVersion": "0.3.1+hq.5.345.253.src.59e8f1923191dbcba843a9703992994f8782a22fd64be131061da7975ae0d421",
|
|
16
16
|
"gateSha256": "ca58a94859eae0a345c11c8d9c59303eb76350dc1cf223391037d21979c28718"
|
|
17
17
|
}
|
|
18
18
|
]
|
|
@@ -3236,6 +3236,10 @@ export declare const COMMAND_CATALOG: readonly [{
|
|
|
3236
3236
|
readonly flags: "-y, --yes";
|
|
3237
3237
|
readonly description: "Skip the confirmation prompt (for scripts); not above 1000 objects";
|
|
3238
3238
|
readonly hidden: false;
|
|
3239
|
+
}, {
|
|
3240
|
+
readonly flags: "--confirmation <token>";
|
|
3241
|
+
readonly description: "Send an hqdc_ delete confirmation token with a real company-vault delete; asks you to type the confirmation in a terminal first (not with --dry-run or --personal)";
|
|
3242
|
+
readonly hidden: false;
|
|
3239
3243
|
}];
|
|
3240
3244
|
readonly subcommands: readonly [];
|
|
3241
3245
|
}, {
|
|
@@ -14344,6 +14348,150 @@ export declare const COMMAND_CATALOG: readonly [{
|
|
|
14344
14348
|
readonly subcommands: readonly [];
|
|
14345
14349
|
}];
|
|
14346
14350
|
}];
|
|
14351
|
+
}, {
|
|
14352
|
+
readonly name: "ci";
|
|
14353
|
+
readonly description: "Smart CI: record and measure what CI does (watch-only)";
|
|
14354
|
+
readonly aliases: readonly [];
|
|
14355
|
+
readonly hidden: false;
|
|
14356
|
+
readonly helpOption: true;
|
|
14357
|
+
readonly helpCommand: true;
|
|
14358
|
+
readonly usage: "[options] [command]";
|
|
14359
|
+
readonly helpText: readonly [];
|
|
14360
|
+
readonly arguments: readonly [];
|
|
14361
|
+
readonly options: readonly [];
|
|
14362
|
+
readonly subcommands: readonly [{
|
|
14363
|
+
readonly name: "intake";
|
|
14364
|
+
readonly description: "Record CI jobs, checks, pull requests, pushes and runner pool state into the run ledger (read-only towards GitHub)";
|
|
14365
|
+
readonly aliases: readonly [];
|
|
14366
|
+
readonly hidden: false;
|
|
14367
|
+
readonly helpOption: true;
|
|
14368
|
+
readonly helpCommand: false;
|
|
14369
|
+
readonly usage: "[options]";
|
|
14370
|
+
readonly helpText: readonly [];
|
|
14371
|
+
readonly arguments: readonly [];
|
|
14372
|
+
readonly options: readonly [{
|
|
14373
|
+
readonly flags: "--repo <owner/name>";
|
|
14374
|
+
readonly description: "repository to record; repeat for more (default: indigoai-us/hq-cli and indigoai-us/hq-pro)";
|
|
14375
|
+
readonly hidden: false;
|
|
14376
|
+
}, {
|
|
14377
|
+
readonly flags: "--runner-org <org>";
|
|
14378
|
+
readonly description: "org whose runner pools are sampled (default: indigoai-us)";
|
|
14379
|
+
readonly hidden: false;
|
|
14380
|
+
}, {
|
|
14381
|
+
readonly flags: "--no-runners";
|
|
14382
|
+
readonly description: "do not sample runner pools";
|
|
14383
|
+
readonly hidden: false;
|
|
14384
|
+
}, {
|
|
14385
|
+
readonly flags: "--no-check-runs";
|
|
14386
|
+
readonly description: "do not read check runs";
|
|
14387
|
+
readonly hidden: false;
|
|
14388
|
+
}, {
|
|
14389
|
+
readonly flags: "--store-dir <path>";
|
|
14390
|
+
readonly description: "ledger directory (default: HQ_SMART_CI_STORE_DIR, else ~/.hq/delivery/ledger)";
|
|
14391
|
+
readonly hidden: false;
|
|
14392
|
+
}, {
|
|
14393
|
+
readonly flags: "--once";
|
|
14394
|
+
readonly description: "run one cycle and stop";
|
|
14395
|
+
readonly hidden: false;
|
|
14396
|
+
}, {
|
|
14397
|
+
readonly flags: "--duration-minutes <n>";
|
|
14398
|
+
readonly description: "stop after this many minutes (default: run until stopped)";
|
|
14399
|
+
readonly hidden: false;
|
|
14400
|
+
}, {
|
|
14401
|
+
readonly flags: "--interval-seconds <n>";
|
|
14402
|
+
readonly description: "seconds between cycles (default: 60)";
|
|
14403
|
+
readonly hidden: false;
|
|
14404
|
+
}, {
|
|
14405
|
+
readonly flags: "--lookback-minutes <n>";
|
|
14406
|
+
readonly description: "on a first start, also record runs created this many minutes back (default: 0)";
|
|
14407
|
+
readonly hidden: false;
|
|
14408
|
+
}, {
|
|
14409
|
+
readonly flags: "--hourly-budget <n>";
|
|
14410
|
+
readonly description: "charged GitHub requests an hour the intake allows itself, counted across restarts (default: 1500)";
|
|
14411
|
+
readonly hidden: false;
|
|
14412
|
+
}, {
|
|
14413
|
+
readonly flags: "--rate-floor <n>";
|
|
14414
|
+
readonly description: "make no request while the gh login has this many or fewer requests left this hour (default: 500)";
|
|
14415
|
+
readonly hidden: false;
|
|
14416
|
+
}, {
|
|
14417
|
+
readonly flags: "--active-window-minutes <n>";
|
|
14418
|
+
readonly description: "closed records older than this move to dated archive files; 0 keeps one file (default: 120)";
|
|
14419
|
+
readonly hidden: false;
|
|
14420
|
+
}, {
|
|
14421
|
+
readonly flags: "--audit-log <path>";
|
|
14422
|
+
readonly description: "where to write one line per GitHub request (default: smart-ci-github-audit.jsonl in the ledger directory)";
|
|
14423
|
+
readonly hidden: false;
|
|
14424
|
+
}, {
|
|
14425
|
+
readonly flags: "--replay-fixture <path>";
|
|
14426
|
+
readonly description: "record a fixture file instead of polling GitHub";
|
|
14427
|
+
readonly hidden: false;
|
|
14428
|
+
}, {
|
|
14429
|
+
readonly flags: "--batch-size <n>";
|
|
14430
|
+
readonly description: "observations per commit when replaying (default: 200)";
|
|
14431
|
+
readonly hidden: false;
|
|
14432
|
+
}, {
|
|
14433
|
+
readonly flags: "--record-fixture <path>";
|
|
14434
|
+
readonly description: "read a past window from GitHub and write it as a fixture; needs one --repo, --from and --to";
|
|
14435
|
+
readonly hidden: false;
|
|
14436
|
+
}, {
|
|
14437
|
+
readonly flags: "--from <iso>";
|
|
14438
|
+
readonly description: "start of the window to record (inclusive)";
|
|
14439
|
+
readonly hidden: false;
|
|
14440
|
+
}, {
|
|
14441
|
+
readonly flags: "--to <iso>";
|
|
14442
|
+
readonly description: "end of the window to record (exclusive)";
|
|
14443
|
+
readonly hidden: false;
|
|
14444
|
+
}, {
|
|
14445
|
+
readonly flags: "--json";
|
|
14446
|
+
readonly description: "print the final summary as JSON";
|
|
14447
|
+
readonly hidden: false;
|
|
14448
|
+
}];
|
|
14449
|
+
readonly subcommands: readonly [];
|
|
14450
|
+
}, {
|
|
14451
|
+
readonly name: "metrics";
|
|
14452
|
+
readonly description: "Print CI waits, waste and cost per merge for a repo from the run ledger";
|
|
14453
|
+
readonly aliases: readonly [];
|
|
14454
|
+
readonly hidden: false;
|
|
14455
|
+
readonly helpOption: true;
|
|
14456
|
+
readonly helpCommand: false;
|
|
14457
|
+
readonly usage: "[options]";
|
|
14458
|
+
readonly helpText: readonly [];
|
|
14459
|
+
readonly arguments: readonly [];
|
|
14460
|
+
readonly options: readonly [{
|
|
14461
|
+
readonly flags: "--repo <owner/name>";
|
|
14462
|
+
readonly description: "repository to report on";
|
|
14463
|
+
readonly hidden: false;
|
|
14464
|
+
}, {
|
|
14465
|
+
readonly flags: "--since <date>";
|
|
14466
|
+
readonly description: "start of the window, a date (2026-11-21) or an ISO time, UTC";
|
|
14467
|
+
readonly hidden: false;
|
|
14468
|
+
}, {
|
|
14469
|
+
readonly flags: "--until <date>";
|
|
14470
|
+
readonly description: "end of the window, exclusive (default: now)";
|
|
14471
|
+
readonly hidden: false;
|
|
14472
|
+
}, {
|
|
14473
|
+
readonly flags: "--store-dir <path>";
|
|
14474
|
+
readonly description: "ledger directory (default: HQ_SMART_CI_STORE_DIR, else ~/.hq/delivery/ledger)";
|
|
14475
|
+
readonly hidden: false;
|
|
14476
|
+
}, {
|
|
14477
|
+
readonly flags: "--deploy-workflow <name>";
|
|
14478
|
+
readonly description: "workflow that deploys to production on merge (default: known per repo)";
|
|
14479
|
+
readonly hidden: false;
|
|
14480
|
+
}, {
|
|
14481
|
+
readonly flags: "--github-billed-usd <amount>";
|
|
14482
|
+
readonly description: "billed GitHub amount for this repo and window, to use in place of the estimate";
|
|
14483
|
+
readonly hidden: false;
|
|
14484
|
+
}, {
|
|
14485
|
+
readonly flags: "--aws-fleet-usd <amount>";
|
|
14486
|
+
readonly description: "AWS runner fleet amount for this window, to use in place of the estimate";
|
|
14487
|
+
readonly hidden: false;
|
|
14488
|
+
}, {
|
|
14489
|
+
readonly flags: "--json";
|
|
14490
|
+
readonly description: "print the numbers as JSON";
|
|
14491
|
+
readonly hidden: false;
|
|
14492
|
+
}];
|
|
14493
|
+
readonly subcommands: readonly [];
|
|
14494
|
+
}];
|
|
14347
14495
|
}, {
|
|
14348
14496
|
readonly name: "env";
|
|
14349
14497
|
readonly description: "Environment profiles: the places that can do work (hq-environment-profile.v1)";
|
|
@@ -3901,6 +3901,11 @@ export const COMMAND_CATALOG = [
|
|
|
3901
3901
|
"flags": "-y, --yes",
|
|
3902
3902
|
"description": "Skip the confirmation prompt (for scripts); not above 1000 objects",
|
|
3903
3903
|
"hidden": false
|
|
3904
|
+
},
|
|
3905
|
+
{
|
|
3906
|
+
"flags": "--confirmation <token>",
|
|
3907
|
+
"description": "Send an hqdc_ delete confirmation token with a real company-vault delete; asks you to type the confirmation in a terminal first (not with --dry-run or --personal)",
|
|
3908
|
+
"hidden": false
|
|
3904
3909
|
}
|
|
3905
3910
|
],
|
|
3906
3911
|
"subcommands": []
|
|
@@ -17469,6 +17474,183 @@ export const COMMAND_CATALOG = [
|
|
|
17469
17474
|
}
|
|
17470
17475
|
]
|
|
17471
17476
|
},
|
|
17477
|
+
{
|
|
17478
|
+
"name": "ci",
|
|
17479
|
+
"description": "Smart CI: record and measure what CI does (watch-only)",
|
|
17480
|
+
"aliases": [],
|
|
17481
|
+
"hidden": false,
|
|
17482
|
+
"helpOption": true,
|
|
17483
|
+
"helpCommand": true,
|
|
17484
|
+
"usage": "[options] [command]",
|
|
17485
|
+
"helpText": [],
|
|
17486
|
+
"arguments": [],
|
|
17487
|
+
"options": [],
|
|
17488
|
+
"subcommands": [
|
|
17489
|
+
{
|
|
17490
|
+
"name": "intake",
|
|
17491
|
+
"description": "Record CI jobs, checks, pull requests, pushes and runner pool state into the run ledger (read-only towards GitHub)",
|
|
17492
|
+
"aliases": [],
|
|
17493
|
+
"hidden": false,
|
|
17494
|
+
"helpOption": true,
|
|
17495
|
+
"helpCommand": false,
|
|
17496
|
+
"usage": "[options]",
|
|
17497
|
+
"helpText": [],
|
|
17498
|
+
"arguments": [],
|
|
17499
|
+
"options": [
|
|
17500
|
+
{
|
|
17501
|
+
"flags": "--repo <owner/name>",
|
|
17502
|
+
"description": "repository to record; repeat for more (default: indigoai-us/hq-cli and indigoai-us/hq-pro)",
|
|
17503
|
+
"hidden": false
|
|
17504
|
+
},
|
|
17505
|
+
{
|
|
17506
|
+
"flags": "--runner-org <org>",
|
|
17507
|
+
"description": "org whose runner pools are sampled (default: indigoai-us)",
|
|
17508
|
+
"hidden": false
|
|
17509
|
+
},
|
|
17510
|
+
{
|
|
17511
|
+
"flags": "--no-runners",
|
|
17512
|
+
"description": "do not sample runner pools",
|
|
17513
|
+
"hidden": false
|
|
17514
|
+
},
|
|
17515
|
+
{
|
|
17516
|
+
"flags": "--no-check-runs",
|
|
17517
|
+
"description": "do not read check runs",
|
|
17518
|
+
"hidden": false
|
|
17519
|
+
},
|
|
17520
|
+
{
|
|
17521
|
+
"flags": "--store-dir <path>",
|
|
17522
|
+
"description": "ledger directory (default: HQ_SMART_CI_STORE_DIR, else ~/.hq/delivery/ledger)",
|
|
17523
|
+
"hidden": false
|
|
17524
|
+
},
|
|
17525
|
+
{
|
|
17526
|
+
"flags": "--once",
|
|
17527
|
+
"description": "run one cycle and stop",
|
|
17528
|
+
"hidden": false
|
|
17529
|
+
},
|
|
17530
|
+
{
|
|
17531
|
+
"flags": "--duration-minutes <n>",
|
|
17532
|
+
"description": "stop after this many minutes (default: run until stopped)",
|
|
17533
|
+
"hidden": false
|
|
17534
|
+
},
|
|
17535
|
+
{
|
|
17536
|
+
"flags": "--interval-seconds <n>",
|
|
17537
|
+
"description": "seconds between cycles (default: 60)",
|
|
17538
|
+
"hidden": false
|
|
17539
|
+
},
|
|
17540
|
+
{
|
|
17541
|
+
"flags": "--lookback-minutes <n>",
|
|
17542
|
+
"description": "on a first start, also record runs created this many minutes back (default: 0)",
|
|
17543
|
+
"hidden": false
|
|
17544
|
+
},
|
|
17545
|
+
{
|
|
17546
|
+
"flags": "--hourly-budget <n>",
|
|
17547
|
+
"description": "charged GitHub requests an hour the intake allows itself, counted across restarts (default: 1500)",
|
|
17548
|
+
"hidden": false
|
|
17549
|
+
},
|
|
17550
|
+
{
|
|
17551
|
+
"flags": "--rate-floor <n>",
|
|
17552
|
+
"description": "make no request while the gh login has this many or fewer requests left this hour (default: 500)",
|
|
17553
|
+
"hidden": false
|
|
17554
|
+
},
|
|
17555
|
+
{
|
|
17556
|
+
"flags": "--active-window-minutes <n>",
|
|
17557
|
+
"description": "closed records older than this move to dated archive files; 0 keeps one file (default: 120)",
|
|
17558
|
+
"hidden": false
|
|
17559
|
+
},
|
|
17560
|
+
{
|
|
17561
|
+
"flags": "--audit-log <path>",
|
|
17562
|
+
"description": "where to write one line per GitHub request (default: smart-ci-github-audit.jsonl in the ledger directory)",
|
|
17563
|
+
"hidden": false
|
|
17564
|
+
},
|
|
17565
|
+
{
|
|
17566
|
+
"flags": "--replay-fixture <path>",
|
|
17567
|
+
"description": "record a fixture file instead of polling GitHub",
|
|
17568
|
+
"hidden": false
|
|
17569
|
+
},
|
|
17570
|
+
{
|
|
17571
|
+
"flags": "--batch-size <n>",
|
|
17572
|
+
"description": "observations per commit when replaying (default: 200)",
|
|
17573
|
+
"hidden": false
|
|
17574
|
+
},
|
|
17575
|
+
{
|
|
17576
|
+
"flags": "--record-fixture <path>",
|
|
17577
|
+
"description": "read a past window from GitHub and write it as a fixture; needs one --repo, --from and --to",
|
|
17578
|
+
"hidden": false
|
|
17579
|
+
},
|
|
17580
|
+
{
|
|
17581
|
+
"flags": "--from <iso>",
|
|
17582
|
+
"description": "start of the window to record (inclusive)",
|
|
17583
|
+
"hidden": false
|
|
17584
|
+
},
|
|
17585
|
+
{
|
|
17586
|
+
"flags": "--to <iso>",
|
|
17587
|
+
"description": "end of the window to record (exclusive)",
|
|
17588
|
+
"hidden": false
|
|
17589
|
+
},
|
|
17590
|
+
{
|
|
17591
|
+
"flags": "--json",
|
|
17592
|
+
"description": "print the final summary as JSON",
|
|
17593
|
+
"hidden": false
|
|
17594
|
+
}
|
|
17595
|
+
],
|
|
17596
|
+
"subcommands": []
|
|
17597
|
+
},
|
|
17598
|
+
{
|
|
17599
|
+
"name": "metrics",
|
|
17600
|
+
"description": "Print CI waits, waste and cost per merge for a repo from the run ledger",
|
|
17601
|
+
"aliases": [],
|
|
17602
|
+
"hidden": false,
|
|
17603
|
+
"helpOption": true,
|
|
17604
|
+
"helpCommand": false,
|
|
17605
|
+
"usage": "[options]",
|
|
17606
|
+
"helpText": [],
|
|
17607
|
+
"arguments": [],
|
|
17608
|
+
"options": [
|
|
17609
|
+
{
|
|
17610
|
+
"flags": "--repo <owner/name>",
|
|
17611
|
+
"description": "repository to report on",
|
|
17612
|
+
"hidden": false
|
|
17613
|
+
},
|
|
17614
|
+
{
|
|
17615
|
+
"flags": "--since <date>",
|
|
17616
|
+
"description": "start of the window, a date (2026-11-21) or an ISO time, UTC",
|
|
17617
|
+
"hidden": false
|
|
17618
|
+
},
|
|
17619
|
+
{
|
|
17620
|
+
"flags": "--until <date>",
|
|
17621
|
+
"description": "end of the window, exclusive (default: now)",
|
|
17622
|
+
"hidden": false
|
|
17623
|
+
},
|
|
17624
|
+
{
|
|
17625
|
+
"flags": "--store-dir <path>",
|
|
17626
|
+
"description": "ledger directory (default: HQ_SMART_CI_STORE_DIR, else ~/.hq/delivery/ledger)",
|
|
17627
|
+
"hidden": false
|
|
17628
|
+
},
|
|
17629
|
+
{
|
|
17630
|
+
"flags": "--deploy-workflow <name>",
|
|
17631
|
+
"description": "workflow that deploys to production on merge (default: known per repo)",
|
|
17632
|
+
"hidden": false
|
|
17633
|
+
},
|
|
17634
|
+
{
|
|
17635
|
+
"flags": "--github-billed-usd <amount>",
|
|
17636
|
+
"description": "billed GitHub amount for this repo and window, to use in place of the estimate",
|
|
17637
|
+
"hidden": false
|
|
17638
|
+
},
|
|
17639
|
+
{
|
|
17640
|
+
"flags": "--aws-fleet-usd <amount>",
|
|
17641
|
+
"description": "AWS runner fleet amount for this window, to use in place of the estimate",
|
|
17642
|
+
"hidden": false
|
|
17643
|
+
},
|
|
17644
|
+
{
|
|
17645
|
+
"flags": "--json",
|
|
17646
|
+
"description": "print the numbers as JSON",
|
|
17647
|
+
"hidden": false
|
|
17648
|
+
}
|
|
17649
|
+
],
|
|
17650
|
+
"subcommands": []
|
|
17651
|
+
}
|
|
17652
|
+
]
|
|
17653
|
+
},
|
|
17472
17654
|
{
|
|
17473
17655
|
"name": "env",
|
|
17474
17656
|
"description": "Environment profiles: the places that can do work (hq-environment-profile.v1)",
|
|
@@ -490,6 +490,12 @@ export declare const REGISTRATION_PLAN: readonly [{
|
|
|
490
490
|
readonly parent: "program";
|
|
491
491
|
readonly module: "./commands/capacity.js";
|
|
492
492
|
readonly exportName: "registerCapacityCommand";
|
|
493
|
+
}, {
|
|
494
|
+
readonly type: "registrar";
|
|
495
|
+
readonly root: "ci";
|
|
496
|
+
readonly parent: "program";
|
|
497
|
+
readonly module: "./commands/ci.js";
|
|
498
|
+
readonly exportName: "registerCiCommand";
|
|
493
499
|
}, {
|
|
494
500
|
readonly type: "registrar";
|
|
495
501
|
readonly root: "env";
|
|
@@ -84,6 +84,7 @@ export const REGISTRATION_PLAN = [
|
|
|
84
84
|
{ type: "registrar", root: "library", parent: "program", module: "./commands/library.js", exportName: "registerLibraryCommand" },
|
|
85
85
|
{ type: "registrar", root: "index", parent: "program", module: "./commands/index-cmd.js", exportName: "registerIndexCommand" },
|
|
86
86
|
{ type: "registrar", root: "capacity", parent: "program", module: "./commands/capacity.js", exportName: "registerCapacityCommand" },
|
|
87
|
+
{ type: "registrar", root: "ci", parent: "program", module: "./commands/ci.js", exportName: "registerCiCommand" },
|
|
87
88
|
{ type: "registrar", root: "env", parent: "program", module: "./commands/env.js", exportName: "registerEnvCommand" },
|
|
88
89
|
{ type: "registrar", root: "work-env", parent: "program", module: "./commands/work-env.js", exportName: "registerWorkEnvCommand" },
|
|
89
90
|
{ type: "registrar", root: "doctor", parent: "program", module: "./commands/doctor.js", exportName: "registerDoctorCommand" },
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Command } from "commander";
|
|
2
|
+
export declare const DEFAULT_REPOS: readonly string[];
|
|
3
|
+
export declare const DEFAULT_RUNNER_ORG = "indigoai-us";
|
|
4
|
+
export type TokenCommand = (file: string, args: string[], env: NodeJS.ProcessEnv) => Promise<string>;
|
|
5
|
+
/**
|
|
6
|
+
* The GitHub token of this machine's signed-in `gh` login, and nothing else.
|
|
7
|
+
* A token in GH_TOKEN or GITHUB_TOKEN is never used: under an Actions or App
|
|
8
|
+
* installation token the intake would spend the allowance CI itself runs on.
|
|
9
|
+
* Those variables are also taken out of the environment `gh` is asked in, so
|
|
10
|
+
* `gh auth token` cannot hand one back. With no signed-in login the intake
|
|
11
|
+
* refuses to start. The token is held in memory and never printed or logged.
|
|
12
|
+
*/
|
|
13
|
+
export declare function resolveGitHubToken(env?: NodeJS.ProcessEnv, run?: TokenCommand): Promise<string>;
|
|
14
|
+
export declare function registerCiIntakeCommand(ci: Command): void;
|
|
15
|
+
//# sourceMappingURL=ci-intake.d.ts.map
|