vouchington-tooling 0.53.0 → 0.54.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.
- package/README.md +76 -12
- package/dist/agent-blackboard/index.d.mts +0 -1
- package/dist/agent-blackboard/index.mjs +0 -23
- package/dist/cli/commands/agent-blackboard-flags.d.mts +0 -1
- package/dist/cli/commands/agent-blackboard-flags.mjs +0 -9
- package/dist/cli/commands/agent-blackboard.d.mts +0 -2
- package/dist/cli/commands/agent-blackboard.mjs +7 -121
- package/dist/cli/commands/story-coverage.d.mts +2 -0
- package/dist/cli/commands/story-coverage.mjs +56 -0
- package/dist/cli/index.mjs +6 -0
- package/dist/cli/parse-forwarded-commands.d.mts +3 -0
- package/dist/cli/parse-forwarded-commands.mjs +2 -0
- package/dist/cli/parse-story-coverage-fields.d.mts +19 -0
- package/dist/cli/parse-story-coverage-fields.mjs +69 -0
- package/dist/cli/parse-story-coverage.d.mts +8 -0
- package/dist/cli/parse-story-coverage.mjs +34 -0
- package/dist/cli/parse.d.mts +5 -1
- package/dist/cli/parse.mjs +3 -0
- package/dist/cli/usage.d.mts +1 -1
- package/dist/cli/usage.mjs +8 -7
- package/dist/host-storage/check.d.mts +38 -0
- package/dist/host-storage/check.mjs +109 -0
- package/dist/host-storage/cli.d.mts +7 -0
- package/dist/host-storage/cli.mjs +102 -0
- package/dist/host-storage/host-storage.test-helpers.d.mts +26 -0
- package/dist/host-storage/host-storage.test-helpers.mjs +58 -0
- package/dist/host-storage/index.d.mts +3 -0
- package/dist/host-storage/index.mjs +3 -0
- package/dist/host-storage/preflight.d.mts +22 -0
- package/dist/host-storage/preflight.mjs +105 -0
- package/dist/index.d.mts +2 -0
- package/dist/index.mjs +1 -0
- package/dist/playwright/assertions.d.mts +1 -0
- package/dist/playwright/assertions.mjs +5 -0
- package/dist/playwright/blocked-external-network.d.mts +15 -0
- package/dist/playwright/blocked-external-network.mjs +73 -0
- package/dist/playwright/browser-dialog-issues.d.mts +12 -0
- package/dist/playwright/browser-dialog-issues.mjs +29 -0
- package/dist/playwright/browser-errors.d.mts +22 -0
- package/dist/playwright/browser-errors.mjs +130 -0
- package/dist/playwright/browser-issue-monitor.test-helpers.d.mts +31 -0
- package/dist/playwright/browser-issue-monitor.test-helpers.mjs +51 -0
- package/dist/playwright/browser-issue-records.d.mts +42 -0
- package/dist/playwright/browser-issue-records.mjs +148 -0
- package/dist/playwright/browser-test.d.mts +21 -0
- package/dist/playwright/browser-test.mjs +68 -0
- package/dist/playwright/expect-no-broken-images.d.mts +17 -0
- package/dist/playwright/expect-no-broken-images.mjs +39 -0
- package/dist/playwright/index.d.mts +30 -0
- package/dist/playwright/index.mjs +22 -0
- package/dist/playwright/mobile-assertions.d.mts +14 -0
- package/dist/playwright/mobile-assertions.mjs +43 -0
- package/dist/playwright/navigate-to.d.mts +27 -0
- package/dist/playwright/navigate-to.mjs +39 -0
- package/dist/playwright/radix-select.d.mts +18 -0
- package/dist/playwright/radix-select.mjs +19 -0
- package/dist/playwright/random-id.d.mts +34 -0
- package/dist/playwright/random-id.mjs +37 -0
- package/dist/playwright/retry-on-connection-lost.d.mts +7 -0
- package/dist/playwright/retry-on-connection-lost.mjs +107 -0
- package/dist/playwright/scroll-to-load-more.d.mts +37 -0
- package/dist/playwright/scroll-to-load-more.mjs +158 -0
- package/dist/playwright/storybook.d.mts +2 -0
- package/dist/playwright/storybook.mjs +13 -0
- package/dist/playwright/test-fixtures.d.mts +1 -0
- package/dist/playwright/test-fixtures.mjs +2 -0
- package/dist/playwright/test-lifecycle-reporter.d.mts +11 -0
- package/dist/playwright/test-lifecycle-reporter.mjs +35 -0
- package/dist/playwright/totp.d.mts +6 -0
- package/dist/playwright/totp.mjs +37 -0
- package/dist/playwright/turnstile-stub.d.mts +8 -0
- package/dist/playwright/turnstile-stub.mjs +61 -0
- package/dist/playwright/viewport-constants.d.mts +30 -0
- package/dist/playwright/viewport-constants.mjs +9 -0
- package/dist/playwright/virtual-authenticator.d.mts +5 -0
- package/dist/playwright/virtual-authenticator.mjs +15 -0
- package/dist/playwright/wait-for-hydration.d.mts +29 -0
- package/dist/playwright/wait-for-hydration.mjs +81 -0
- package/dist/shell-parse/ansi-c-string.d.mts +12 -0
- package/dist/shell-parse/ansi-c-string.mjs +80 -0
- package/dist/shell-parse/index.d.mts +20 -0
- package/dist/shell-parse/index.mjs +15 -0
- package/dist/shell-parse/shell-command-substitution-reads.d.mts +8 -0
- package/dist/shell-parse/shell-command-substitution-reads.mjs +53 -0
- package/dist/shell-parse/shell-command-substitutions.d.mts +8 -0
- package/dist/shell-parse/shell-command-substitutions.mjs +52 -0
- package/dist/shell-parse/shell-command-wrappers.d.mts +26 -0
- package/dist/shell-parse/shell-command-wrappers.mjs +143 -0
- package/dist/shell-parse/shell-commands.d.mts +24 -0
- package/dist/shell-parse/shell-commands.mjs +155 -0
- package/dist/shell-parse/shell-heredoc-delimiter.d.mts +5 -0
- package/dist/shell-parse/shell-heredoc-delimiter.mjs +52 -0
- package/dist/shell-parse/shell-heredoc-parser.d.mts +7 -0
- package/dist/shell-parse/shell-heredoc-parser.mjs +49 -0
- package/dist/shell-parse/shell-heredoc-quote-state.d.mts +19 -0
- package/dist/shell-parse/shell-heredoc-quote-state.mjs +40 -0
- package/dist/shell-parse/shell-heredoc.d.mts +10 -0
- package/dist/shell-parse/shell-heredoc.mjs +90 -0
- package/dist/shell-parse/shell-redirections.d.mts +5 -0
- package/dist/shell-parse/shell-redirections.mjs +34 -0
- package/dist/shell-parse/shell-script-operand.d.mts +13 -0
- package/dist/shell-parse/shell-script-operand.mjs +103 -0
- package/dist/shell-parse/shell-stdin-script.d.mts +6 -0
- package/dist/shell-parse/shell-stdin-script.mjs +61 -0
- package/dist/shell-parse/shell-token-utils.d.mts +9 -0
- package/dist/shell-parse/shell-token-utils.mjs +33 -0
- package/dist/shell-parse/shell-tokenizer-comments.d.mts +1 -0
- package/dist/shell-parse/shell-tokenizer-comments.mjs +57 -0
- package/dist/shell-parse/shell-tokenizer-operators.d.mts +14 -0
- package/dist/shell-parse/shell-tokenizer-operators.mjs +47 -0
- package/dist/shell-parse/shell-tokenizer.d.mts +12 -0
- package/dist/shell-parse/shell-tokenizer.mjs +104 -0
- package/dist/story-coverage/analyze.d.mts +8 -0
- package/dist/story-coverage/analyze.mjs +24 -0
- package/dist/story-coverage/check.d.mts +11 -0
- package/dist/story-coverage/check.mjs +42 -0
- package/dist/story-coverage/components.d.mts +10 -0
- package/dist/story-coverage/components.mjs +40 -0
- package/dist/story-coverage/coverage.d.mts +10 -0
- package/dist/story-coverage/coverage.mjs +43 -0
- package/dist/story-coverage/index.d.mts +13 -0
- package/dist/story-coverage/index.mjs +7 -0
- package/dist/story-coverage/messages.d.mts +10 -0
- package/dist/story-coverage/messages.mjs +42 -0
- package/dist/story-coverage/options.d.mts +27 -0
- package/dist/story-coverage/options.mjs +51 -0
- package/dist/story-coverage/workspace.d.mts +2 -0
- package/dist/story-coverage/workspace.mjs +27 -0
- package/dist/test-helpers/cancel-runs.test-helpers.d.mts +39 -0
- package/dist/test-helpers/cancel-runs.test-helpers.mjs +124 -0
- package/dist/test-helpers/run-bounded-exit-observer.test-helpers.d.mts +12 -0
- package/dist/test-helpers/run-bounded-exit-observer.test-helpers.mjs +68 -0
- package/dist/test-helpers/run-bounded-output-fixture.test-helpers.d.mts +18 -0
- package/dist/test-helpers/run-bounded-output-fixture.test-helpers.mjs +162 -0
- package/dist/vitest-diagnostics/index.d.mts +9 -1
- package/dist/vitest-diagnostics/index.mjs +5 -1
- package/dist/vitest-diagnostics/vitest-fake-timer-guard.d.mts +6 -0
- package/dist/vitest-diagnostics/vitest-fake-timer-guard.mjs +34 -0
- package/dist/vitest-diagnostics/vitest-fork-leak-detection.d.mts +1 -0
- package/dist/vitest-diagnostics/vitest-fork-leak-detection.mjs +8 -0
- package/dist/vitest-diagnostics/vitest-fork-leak-diagnostics.d.mts +10 -1
- package/dist/vitest-diagnostics/vitest-fork-leak-diagnostics.mjs +43 -2
- package/dist/vitest-diagnostics/vitest-fork-leak-handshake-samples.d.mts +50 -0
- package/dist/vitest-diagnostics/vitest-fork-leak-handshake-samples.mjs +69 -0
- package/dist/vitest-diagnostics/vitest-fork-leak-handshake.d.mts +19 -0
- package/dist/vitest-diagnostics/vitest-fork-leak-handshake.mjs +136 -0
- package/dist/vitest-diagnostics/vitest-network-allowlist-dns.d.mts +7 -0
- package/dist/vitest-diagnostics/vitest-network-allowlist-dns.mjs +54 -0
- package/dist/vitest-diagnostics/vitest-network-allowlist-host.d.mts +8 -0
- package/dist/vitest-diagnostics/vitest-network-allowlist-host.mjs +48 -0
- package/dist/vitest-diagnostics/vitest-network-allowlist-socket.d.mts +14 -0
- package/dist/vitest-diagnostics/vitest-network-allowlist-socket.mjs +39 -0
- package/dist/vitest-diagnostics/vitest-network-allowlist.d.mts +7 -0
- package/dist/vitest-diagnostics/vitest-network-allowlist.mjs +72 -0
- package/dist/vitest-diagnostics/vitest-process-resources.d.mts +6 -0
- package/dist/vitest-diagnostics/vitest-process-resources.mjs +51 -0
- package/dist/vitest-effective-timeout/cap.d.mts +9 -0
- package/dist/vitest-effective-timeout/cap.mjs +28 -0
- package/dist/vitest-effective-timeout/check-profiles.d.mts +15 -0
- package/dist/vitest-effective-timeout/check-profiles.mjs +52 -0
- package/dist/vitest-effective-timeout/config-file.d.mts +6 -0
- package/dist/vitest-effective-timeout/config-file.mjs +23 -0
- package/dist/vitest-effective-timeout/fixtures.d.mts +2 -0
- package/dist/vitest-effective-timeout/fixtures.mjs +18 -0
- package/dist/vitest-effective-timeout/index.d.mts +7 -0
- package/dist/vitest-effective-timeout/index.mjs +4 -0
- package/dist/vitest-effective-timeout/profiles.d.mts +10 -0
- package/dist/vitest-effective-timeout/profiles.mjs +33 -0
- package/dist/vitest-effective-timeout/run-profile.d.mts +31 -0
- package/dist/vitest-effective-timeout/run-profile.mjs +95 -0
- package/docs/mcp-server.md +2 -13
- package/package.json +32 -2
- package/scripts/__pycache__/run_bounded_process.cpython-312.pyc +0 -0
- package/scripts/chromium-launch-probe.d.mts +7 -0
- package/scripts/chromium-launch-probe.mjs +101 -0
- package/scripts/run-bounded-fixtures/run-bounded-backpressure.py +186 -0
- package/scripts/run-bounded-fixtures/run-bounded-merged-output.py +75 -0
- package/scripts/run-bounded-fixtures/run-bounded-reset-socket.py +25 -0
- package/scripts/run-bounded.py +199 -0
- package/scripts/run_bounded_process.py +129 -0
- package/scripts/worktree/git-index-lock.sh +16 -0
- package/scripts/worktree/git-worktrees.sh +23 -20
- package/scripts/worktree/reset-worktree-run.sh +199 -0
- package/scripts/worktree/reset-worktree.sh +122 -0
- package/skills/blackboard/SKILL.md +4 -64
- package/skills/stacked-prs/SKILL.md +1 -1
- package/skills/stacked-prs/references/drain.md +2 -2
package/README.md
CHANGED
|
@@ -73,8 +73,7 @@ vouchington wait-for-apt-locks
|
|
|
73
73
|
vouchington retrospective-transcript --jsonl /path/to/transcript.jsonl
|
|
74
74
|
vouchington retrospective-facts --pr 49 --repo vouchington/vouchington-infra --raw
|
|
75
75
|
vouchington agent-blackboard probe
|
|
76
|
-
vouchington agent-blackboard
|
|
77
|
-
vouchington agent-blackboard journal entries --session-id <uuid>
|
|
76
|
+
vouchington agent-blackboard distill classify <partition.jsonl> --retro-cutoff <iso> --session-cutoff <iso>
|
|
78
77
|
vouchington agent-blackboard snapshot partition --snapshot <snapshot.jsonl> --checksum <sha256> --counts <counts.json>
|
|
79
78
|
vouchington agent-blackboard snapshot cleanup --snapshot <snapshot.jsonl> --partition-directory <partitions-dir> --receipt <receipt-json>
|
|
80
79
|
vouchington mcp
|
|
@@ -196,12 +195,10 @@ as not merged to main, and a missing base is unavailable.
|
|
|
196
195
|
|
|
197
196
|
Agent Blackboard support is optional: only the `agent-blackboard` subpath and its CLI commands
|
|
198
197
|
need `agent-blackboard@^0.6.0`. Snapshot cleanup accepts only package-generated temporary paths.
|
|
199
|
-
`appendJournal`
|
|
198
|
+
`appendJournal` now requires explicit mode, stable source-event identity, work
|
|
200
199
|
outcome, feedback coverage, and exact repositories. This is a breaking pre-1.0 API change; adopt the
|
|
201
200
|
shared contract before upgrading consumers. `appendJournal` reads a bounded UTF-8 note and delegates
|
|
202
|
-
to `writeFeedback`, returning delivered or pending state rather than a success-shaped message.
|
|
203
|
-
`--repository owner/name` flags; it records the entry's exact repositories and updates the session's
|
|
204
|
-
cumulative repository list before appending.
|
|
201
|
+
to `writeFeedback`, returning delivered or pending state rather than a success-shaped message.
|
|
205
202
|
Programmatic callers launched from a different workspace directory pass their own module URL as
|
|
206
203
|
`dependencies: { resolveFrom: import.meta.url }`; the CLI defaults to the current package context.
|
|
207
204
|
It captures a target under a private tombstone, validates partition names, permissions, JSONL,
|
|
@@ -223,12 +220,32 @@ Host-lock environment:
|
|
|
223
220
|
| `HOST_LOCK_PROCESS_GROUP_DRAIN_SECONDS` | `30` | Time to wait for the command process group |
|
|
224
221
|
| `HOST_LOCK_ACTIVE` | unset | Set while a lock is held; nested locks fail |
|
|
225
222
|
|
|
223
|
+
`vouchington host-storage --path <path>` checks free space for each path. Paths on the same device
|
|
224
|
+
are measured once. The default floor is 5 GiB (`--minimum-free-bytes`). `--pnpm-store` discovers the
|
|
225
|
+
pnpm store. `--docker-root` checks Docker Desktop's `Docker.raw` on macOS and `docker info` on Linux.
|
|
226
|
+
Discovery waits 5 seconds unless `--discovery-timeout-ms` sets an integer from 1 through 2147483647. A required path that is missing or low
|
|
227
|
+
fails before optional discovery runs. Optional discovery failures are warnings; low space on a
|
|
228
|
+
discovered filesystem still fails. `inspectHostStorage` and `probeHostStorage` are exported from
|
|
229
|
+
`vouchington-tooling/host-storage`.
|
|
230
|
+
|
|
226
231
|
## Sourceable Bash libraries
|
|
227
232
|
|
|
228
233
|
`scripts/worktree/git-worktrees.sh` is included in the published package. Source it to parse
|
|
229
|
-
`git worktree list --porcelain` with `git_worktree_*` helpers.
|
|
234
|
+
`git worktree list --porcelain` with `git_worktree_*` helpers. Path queries fail when git fails,
|
|
235
|
+
and `git_worktree_main_path` fails when git reports no worktree. Its
|
|
230
236
|
`git_worktree_canonical_path_hash <path>` helper resolves the physical path and prints a stable
|
|
231
237
|
`d` plus the first 12 lowercase hexadecimal characters of its SHA-256 digest.
|
|
238
|
+
`scripts/worktree/git-index-lock.sh` removes only a 0-byte `index.lock`. A non-empty lock is left
|
|
239
|
+
in place.
|
|
240
|
+
|
|
241
|
+
`scripts/worktree/reset-worktree.sh --base-ref <ref>` checks out a new `reset-<hex>` branch and
|
|
242
|
+
hard-resets it to `<ref>`. A `remote/branch` ref is fetched first; `refs/...` and a local ref are
|
|
243
|
+
not. It refuses uncommitted or untracked changes unless `--force` is set, refuses a non-empty
|
|
244
|
+
`index.lock`, and deletes a zero-byte `index.lock`. Repeat `--cache <relative-path>` for caller-owned
|
|
245
|
+
outputs. `--pre` runs after fetch and before the branch switch; `--post` runs after cache removal.
|
|
246
|
+
The script also deletes `.cache` directories and the direct `.cache`, `.vite`, and `.vitest`
|
|
247
|
+
directories inside `node_modules`. It needs `flock` or `lockf` and holds
|
|
248
|
+
`.local/reset-worktree.lock` for the run.
|
|
232
249
|
|
|
233
250
|
## Reclaiming finished worktrees
|
|
234
251
|
|
|
@@ -366,8 +383,11 @@ import {
|
|
|
366
383
|
shellScriptViolations,
|
|
367
384
|
workflowYamlViolations,
|
|
368
385
|
} from 'vouchington-tooling/gh-api-shell-quoting'
|
|
386
|
+
import { tokenizeShellWords } from 'vouchington-tooling/shell-parse'
|
|
369
387
|
```
|
|
370
388
|
|
|
389
|
+
`vouchington-tooling/shell-parse` splits shell text into words, heredocs, redirections, and command prefixes. Callers pass the text. The parser does not decide which commands are allowed. `stripQuotedShellText` and `commandsToInspect*` do not scan `$(...)` substitutions in the command text: call `extractShellCommandSubstitutions` and inspect each result too.
|
|
390
|
+
|
|
371
391
|
`processDiffCommand` runs a caller-supplied `git diff` or `gh pr diff` executable and argv without
|
|
372
392
|
a shell, emitting complete unified-diff file blocks without accumulating the whole patch. It keeps
|
|
373
393
|
at most one file block (which can itself be large), preserves preambles and line content, and drains
|
|
@@ -537,9 +557,44 @@ watch reruns, and prints an attribution summary only for abnormal worker exits.
|
|
|
537
557
|
a synchronous stderr line and one JSONL file per PID; a start record without an exit record
|
|
538
558
|
identifies a fork killed before its handler could run. `createForkLeakDetector` accepts tracked
|
|
539
559
|
resource names and warmup, threshold, and sustained-growth settings; the caller supplies each
|
|
540
|
-
checkpoint's resource counts.
|
|
541
|
-
|
|
542
|
-
|
|
560
|
+
checkpoint's resource counts. `getForkLeakDetector` keeps one detector for the process.
|
|
561
|
+
`formatForkLeakDiagnostics` stays a one-line summary unless resource counts are passed, in which
|
|
562
|
+
case it prints the multi-line report and optional pool metrics. `waitForForkLeakHandshakeSettle`
|
|
563
|
+
waits for a caller-supplied pool snapshot to settle. `installTestNetworkAllowlist` takes the
|
|
564
|
+
allowed hosts, an exempt predicate, and the state key. `checkAndRestoreFakeTimers` restores real
|
|
565
|
+
timers and returns a diagnostic when a test left fake timers installed.
|
|
566
|
+
|
|
567
|
+
Use a caller-owned run directory: the reporter clears only regular numeric PID `.jsonl` files
|
|
568
|
+
there at construction and leaves the directory and other files alone. Application metrics and CI artifact handling stay with the caller.
|
|
569
|
+
|
|
570
|
+
`vitest-effective-timeout` exports `effectiveTimeoutCap`. The plugin rejects a project whose effective
|
|
571
|
+
`testTimeout` or `hookTimeout` is missing, non-finite, non-positive, or above the caller-supplied cap
|
|
572
|
+
(default 30 seconds). The plugin name, the expected root config filename, and the profile scratch
|
|
573
|
+
directory are parameters. `checkFiniteTimeoutProfiles` writes one scratch project per admission
|
|
574
|
+
profile and can take a caller-supplied runner.
|
|
575
|
+
|
|
576
|
+
`playwright` monitors browser console errors, web errors, dialogs, page crashes, and failed
|
|
577
|
+
requests during Playwright tests. `@playwright/test` is an optional peer. `createBrowserTest` and
|
|
578
|
+
`withMonitoredPage` install the generic telemetry blocks (Google Tag Manager, Google Analytics, and
|
|
579
|
+
DoubleClick) and fail the test when an unallowlisted issue remains. Passing `rules` replaces those
|
|
580
|
+
generic defaults rather than adding to them; spread `BLOCKED_EXTERNAL_NETWORK_RULES` to extend them. The default request-failure allowlist follows
|
|
581
|
+
the active rules, and when two rules match one URL the later rule wins. `assertTimeout` runs in both
|
|
582
|
+
`createBrowserTest` and `withMonitoredPage`.
|
|
583
|
+
Pass host-specific block rules and request-failure allowlist entries, a warning pattern, and a timeout checker; the default warning
|
|
584
|
+
pattern records React hydration and render warnings. The fixture does not import a product timeout
|
|
585
|
+
guard: pass `assertTimeout` when the caller owns the timeout cap.
|
|
586
|
+
|
|
587
|
+
`playwright` waits for below-fold hydration, retries transient local connection loss, navigates
|
|
588
|
+
through an injectable Turnstile stub, and scrolls a caller-supplied sentinel into view.
|
|
589
|
+
`@playwright/test` is an optional peer. The stub's attribute name and token default to `data-pw`
|
|
590
|
+
and `PLAYWRIGHT_TURNSTILE_TOKEN`. The scroll helper's sentinel test id defaults to
|
|
591
|
+
`infinite-scroll-sentinel`.
|
|
592
|
+
|
|
593
|
+
`playwright` provides small Playwright helpers: a virtual authenticator, a Radix dropdown opener,
|
|
594
|
+
a Storybook index probe, required-value and mobile overflow assertions, an image-response guard,
|
|
595
|
+
random suffixes, viewport sizes, a 1x1 PNG fixture, RFC 6238 TOTP codes, and a test-lifecycle
|
|
596
|
+
reporter. The reporter prints one JSON line per test with the marker `playwright-test-lifecycle`.
|
|
597
|
+
`@playwright/test` is an optional peer. TOTP setup and cleanup stay with the caller.
|
|
543
598
|
|
|
544
599
|
`browser-session-runner` supervises caller-created browser-test processes. Callers supply command
|
|
545
600
|
construction, line classification, retry/outcome policy, and budgets; the library owns process-group
|
|
@@ -654,8 +709,7 @@ Verified delivery retains its receipt when local cleanup fails, returning
|
|
|
654
709
|
safe to replay: an event is identified by session, `sourceEventId`, and content, and a duplicate that
|
|
655
710
|
differs only in `timestamp` is the same event, so it reports the stored record's `timestamp` and
|
|
656
711
|
receipt and the retained duplicate is removed.
|
|
657
|
-
Use `
|
|
658
|
-
records after connectivity returns.
|
|
712
|
+
Use the `outbox_flush` MCP tool to replay unchanged pending records after connectivity returns.
|
|
659
713
|
|
|
660
714
|
Autonomous mode prohibits the filesystem outbox. `verifyFreshFeedback` requires a fresh source-event
|
|
661
715
|
write plus readback of its own append receipt and rejects visible duplicate source records. This
|
|
@@ -734,6 +788,16 @@ reexports, and literal dynamic/require loads. Missing or incomplete facts for a
|
|
|
734
788
|
throw; external specifiers resolve to `null`. The default file inventory limit is 10,000
|
|
735
789
|
files and can be reduced with `maxFiles`.
|
|
736
790
|
|
|
791
|
+
## Story coverage
|
|
792
|
+
|
|
793
|
+
`vouchington-tooling/story-coverage` exports `checkStoryCoverage`. It reports component exports
|
|
794
|
+
that no reachable story imports. Callers pass the repository root, component directory, story
|
|
795
|
+
directory, source extensions, component extensions, a marker regular expression, a story-file
|
|
796
|
+
pattern, path aliases, and an optional exclusions map. An empty map is the zero-exclusion
|
|
797
|
+
ratchet: any exclusion entry, even one that matches no component, makes `ok` false. Namespace imports of the component directory fail
|
|
798
|
+
the check because coverage cannot see which export was used. `vouchington story-coverage` runs
|
|
799
|
+
the same check and needs the optional `no-mistakes` peer.
|
|
800
|
+
|
|
737
801
|
## Retrospective distill classifier
|
|
738
802
|
|
|
739
803
|
`vouchington-tooling/retrospective-distill` exports `classifySession(session, entries, cutoffs)`,
|
|
@@ -15,7 +15,6 @@ export declare function appendJournal(input: JournalInput & {
|
|
|
15
15
|
markdownFile: string;
|
|
16
16
|
}): Promise<FeedbackDeliveryResult>;
|
|
17
17
|
export declare function readJournal(sessionId: string, env?: NodeJS.ProcessEnv, dependencies?: BlackboardClientDependencies): Promise<unknown[]>;
|
|
18
|
-
export declare function formatJournalEntries(sessionId: string, entries: unknown[]): string;
|
|
19
18
|
export { BlackboardNotInstalledError, resolveBlackboardConnection } from './client.mts';
|
|
20
19
|
export type { BlackboardConnection, BlackboardClientModule, BlackboardClientDependencies, } from './client.mts';
|
|
21
20
|
export type * from './feedback-types.mts';
|
|
@@ -36,29 +36,6 @@ export async function readJournal(sessionId, env, dependencies) {
|
|
|
36
36
|
entries.push(entry);
|
|
37
37
|
return entries;
|
|
38
38
|
}
|
|
39
|
-
export function formatJournalEntries(sessionId, entries) {
|
|
40
|
-
const journals = entries.flatMap((entry) => {
|
|
41
|
-
if (typeof entry !== 'object' ||
|
|
42
|
-
entry === null ||
|
|
43
|
-
!('createdAt' in entry) ||
|
|
44
|
-
!('data' in entry) ||
|
|
45
|
-
typeof entry.createdAt !== 'string' ||
|
|
46
|
-
typeof entry.data !== 'object' ||
|
|
47
|
-
entry.data === null ||
|
|
48
|
-
!('type' in entry.data) ||
|
|
49
|
-
!('markdown' in entry.data) ||
|
|
50
|
-
entry.data.type !== 'journal' ||
|
|
51
|
-
typeof entry.data.markdown !== 'string')
|
|
52
|
-
return [];
|
|
53
|
-
return [{ createdAt: entry.createdAt, markdown: entry.data.markdown }];
|
|
54
|
-
});
|
|
55
|
-
if (!journals.length)
|
|
56
|
-
return `No journal entries found for session ${sessionId}.`;
|
|
57
|
-
return journals
|
|
58
|
-
.sort((left, right) => left.createdAt.localeCompare(right.createdAt))
|
|
59
|
-
.map(({ createdAt, markdown }) => `## ${createdAt}\n\n${markdown}`)
|
|
60
|
-
.join('\n\n');
|
|
61
|
-
}
|
|
62
39
|
export { BlackboardNotInstalledError, resolveBlackboardConnection } from "./client.mjs";
|
|
63
40
|
export { createFeedbackEnvelope, validateFeedbackEnvelope } from "./feedback-codec.mjs";
|
|
64
41
|
export { writeFeedback, verifyFreshFeedback, flushFeedbackOutbox, FeedbackDeliveryError, } from "./feedback-delivery.mjs";
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
export declare function flagsToValues(flags: string[]): Record<string, string>;
|
|
2
2
|
export declare function assertAllowed(values: Record<string, string>, allowed: string[]): void;
|
|
3
3
|
export declare function required(values: Record<string, string>, key: string): string;
|
|
4
|
-
export declare function validatedSessionId(sessionId: string | undefined): string | undefined;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { assertSessionId } from "../../agent-blackboard/session-id.mjs";
|
|
2
1
|
export function flagsToValues(flags) {
|
|
3
2
|
const values = {};
|
|
4
3
|
for (let index = 0; index < flags.length; index += 2) {
|
|
@@ -24,11 +23,3 @@ export function required(values, key) {
|
|
|
24
23
|
throw new Error(`--${key} is required`);
|
|
25
24
|
return value;
|
|
26
25
|
}
|
|
27
|
-
export function validatedSessionId(sessionId) {
|
|
28
|
-
if (sessionId !== undefined) {
|
|
29
|
-
assertSessionId(sessionId);
|
|
30
|
-
if (sessionId.length > 256)
|
|
31
|
-
throw new Error('session identity is too long');
|
|
32
|
-
}
|
|
33
|
-
return sessionId;
|
|
34
|
-
}
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
import { assertAllowed, flagsToValues, required, validatedSessionId, } from "./agent-blackboard-flags.mjs";
|
|
2
1
|
import { runSnapshot } from "./agent-blackboard-snapshot.mjs";
|
|
3
2
|
import { runSessionStart } from "./agent-blackboard-session-start.mjs";
|
|
4
|
-
import {
|
|
3
|
+
import { probeBlackboard } from "../../agent-blackboard/index.mjs";
|
|
4
|
+
import { runDistillClassify } from "../../retrospective-distill/index.mjs";
|
|
5
5
|
const dependencies = { resolveFrom: import.meta.url };
|
|
6
|
-
let journalReader = readJournal;
|
|
7
|
-
export function setJournalReaderForTest(reader) {
|
|
8
|
-
journalReader = reader ?? readJournal;
|
|
9
|
-
}
|
|
10
6
|
export async function runAgentBlackboardCommand(args) {
|
|
11
7
|
try {
|
|
12
8
|
const [command, ...rest] = args;
|
|
@@ -14,128 +10,18 @@ export async function runAgentBlackboardCommand(args) {
|
|
|
14
10
|
await probeBlackboard(undefined, dependencies);
|
|
15
11
|
return 0;
|
|
16
12
|
}
|
|
17
|
-
if (command === 'journal')
|
|
18
|
-
return await runJournal(rest);
|
|
19
13
|
if (command === 'snapshot')
|
|
20
14
|
return await runSnapshot(rest);
|
|
21
15
|
if (command === 'session-start')
|
|
22
16
|
return await runSessionStart(rest);
|
|
23
|
-
|
|
17
|
+
if (command === 'distill' && rest[0] === 'classify') {
|
|
18
|
+
process.stdout.write(`${await runDistillClassify(rest.slice(1))}\n`);
|
|
19
|
+
return 0;
|
|
20
|
+
}
|
|
21
|
+
throw new Error('usage: agent-blackboard probe | session-start | distill classify | snapshot partition|cleanup');
|
|
24
22
|
}
|
|
25
23
|
catch (error) {
|
|
26
24
|
process.stderr.write(`${error instanceof Error ? error.message : String(error)}\n`);
|
|
27
25
|
return 2;
|
|
28
26
|
}
|
|
29
27
|
}
|
|
30
|
-
async function runJournal(args) {
|
|
31
|
-
const [action, ...flags] = args;
|
|
32
|
-
const { repositories, remaining } = action === 'append' ? extractRepositories(flags) : { repositories: [], remaining: flags };
|
|
33
|
-
const values = flagsToValues(remaining);
|
|
34
|
-
if (action === 'flush' || action === 'status') {
|
|
35
|
-
assertAllowed(values, ['outbox-directory', 'session-id']);
|
|
36
|
-
const directory = required(values, 'outbox-directory');
|
|
37
|
-
const sessionId = validatedSessionId(action === 'status' ? required(values, 'session-id') : values['session-id']);
|
|
38
|
-
const result = action === 'flush'
|
|
39
|
-
? await flushFeedbackOutbox({ directory, dependencies })
|
|
40
|
-
: { pendingCount: 0 };
|
|
41
|
-
const counts = sessionId !== undefined ? feedbackOutboxCounts(directory, sessionId) : result;
|
|
42
|
-
process.stdout.write(`${JSON.stringify({
|
|
43
|
-
...result,
|
|
44
|
-
...counts,
|
|
45
|
-
sessionId,
|
|
46
|
-
status: counts.pendingCount ? 'pending' : 'empty',
|
|
47
|
-
})}\n`);
|
|
48
|
-
return 0;
|
|
49
|
-
}
|
|
50
|
-
if (action === 'entries') {
|
|
51
|
-
assertAllowed(values, ['session-id']);
|
|
52
|
-
const sessionId = required(values, 'session-id');
|
|
53
|
-
let entries;
|
|
54
|
-
try {
|
|
55
|
-
entries = await journalReader(sessionId, undefined, dependencies);
|
|
56
|
-
}
|
|
57
|
-
catch (error) {
|
|
58
|
-
if (!isNotFound(error))
|
|
59
|
-
throw error;
|
|
60
|
-
entries = [];
|
|
61
|
-
}
|
|
62
|
-
process.stdout.write(`${formatJournalEntries(sessionId, entries)}\n`);
|
|
63
|
-
return 0;
|
|
64
|
-
}
|
|
65
|
-
if (action === 'append') {
|
|
66
|
-
assertAllowed(values, [
|
|
67
|
-
'session-id',
|
|
68
|
-
'agent',
|
|
69
|
-
'version',
|
|
70
|
-
'file',
|
|
71
|
-
'parent-session-id',
|
|
72
|
-
'timestamp',
|
|
73
|
-
'mode',
|
|
74
|
-
'source-event-id',
|
|
75
|
-
'work-outcome',
|
|
76
|
-
'coverage-status',
|
|
77
|
-
'coverage-source',
|
|
78
|
-
'dropped-count',
|
|
79
|
-
'outbox-directory',
|
|
80
|
-
]);
|
|
81
|
-
const result = await appendJournal({
|
|
82
|
-
dependencies,
|
|
83
|
-
mode: required(values, 'mode'),
|
|
84
|
-
sourceEventId: required(values, 'source-event-id'),
|
|
85
|
-
workOutcome: required(values, 'work-outcome'),
|
|
86
|
-
feedbackCoverage: {
|
|
87
|
-
status: required(values, 'coverage-status'),
|
|
88
|
-
sources: values['coverage-source']?.split(',') ?? [],
|
|
89
|
-
droppedCount: Number(values['dropped-count'] ?? '0'),
|
|
90
|
-
},
|
|
91
|
-
...(values['outbox-directory'] ? { outboxDirectory: values['outbox-directory'] } : {}),
|
|
92
|
-
sessionId: required(values, 'session-id'),
|
|
93
|
-
agent: required(values, 'agent'),
|
|
94
|
-
version: values.version ?? 'unknown',
|
|
95
|
-
repositories: requiredRepositories(repositories),
|
|
96
|
-
markdownFile: required(values, 'file'),
|
|
97
|
-
...('timestamp' in values ? { timestamp: values.timestamp } : {}),
|
|
98
|
-
parentSessionId: values['parent-session-id'] ?? null,
|
|
99
|
-
});
|
|
100
|
-
// Autonomous mode has no outbox, so its receipt must not depend on one.
|
|
101
|
-
const counts = values.mode === 'autonomous'
|
|
102
|
-
? { pendingCount: 0, worktreePendingCount: 0 }
|
|
103
|
-
: pendingCounts(required(values, 'outbox-directory'), required(values, 'session-id'));
|
|
104
|
-
const storedVersion = result.status === 'delivered' ? result.receipt.storedVersion : undefined;
|
|
105
|
-
// JSON.stringify drops an undefined `storedVersion`.
|
|
106
|
-
process.stdout.write(`${JSON.stringify({ ...result, storedVersion, ...counts })}\n`);
|
|
107
|
-
return 0;
|
|
108
|
-
}
|
|
109
|
-
throw new Error('usage: agent-blackboard journal append|entries|flush|status');
|
|
110
|
-
}
|
|
111
|
-
function extractRepositories(flags) {
|
|
112
|
-
const repositories = [];
|
|
113
|
-
const remaining = [];
|
|
114
|
-
for (let index = 0; index < flags.length; index += 2) {
|
|
115
|
-
const flag = flags[index];
|
|
116
|
-
const value = flags[index + 1];
|
|
117
|
-
if (!flag?.startsWith('--') || value === undefined)
|
|
118
|
-
throw new Error(`invalid option: ${flag ?? ''}`);
|
|
119
|
-
if (flag === '--repository')
|
|
120
|
-
repositories.push(value);
|
|
121
|
-
else
|
|
122
|
-
remaining.push(flag, value);
|
|
123
|
-
}
|
|
124
|
-
return { repositories, remaining };
|
|
125
|
-
}
|
|
126
|
-
function requiredRepositories(repositories) {
|
|
127
|
-
if (repositories.length === 0)
|
|
128
|
-
throw new Error('--repository is required');
|
|
129
|
-
return repositories;
|
|
130
|
-
}
|
|
131
|
-
/** An append receipt reports only unsent records; rejected records are not pending. */
|
|
132
|
-
function pendingCounts(directory, sessionId) {
|
|
133
|
-
const { pendingCount, worktreePendingCount } = feedbackOutboxCounts(directory, sessionId);
|
|
134
|
-
return { pendingCount, worktreePendingCount };
|
|
135
|
-
}
|
|
136
|
-
function isNotFound(error) {
|
|
137
|
-
return (typeof error === 'object' &&
|
|
138
|
-
error !== null &&
|
|
139
|
-
(('status' in error && error.status === 404) ||
|
|
140
|
-
('statusCode' in error && error.statusCode === 404)));
|
|
141
|
-
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { readFile } from 'node:fs/promises';
|
|
2
|
+
import { checkStoryCoverage } from "../../story-coverage/index.mjs";
|
|
3
|
+
export async function runStoryCoverage(parsed) {
|
|
4
|
+
let marker;
|
|
5
|
+
let storyFilePattern;
|
|
6
|
+
let exclusions;
|
|
7
|
+
try {
|
|
8
|
+
marker = compile(parsed.marker, '--marker');
|
|
9
|
+
storyFilePattern = compile(parsed.storyPattern, '--story-pattern');
|
|
10
|
+
exclusions = parsed.exclusionsFile ? await readExclusions(parsed.exclusionsFile) : {};
|
|
11
|
+
}
|
|
12
|
+
catch (error) {
|
|
13
|
+
process.stderr.write(`${error.message}\n`);
|
|
14
|
+
return 2;
|
|
15
|
+
}
|
|
16
|
+
const report = await checkStoryCoverage({
|
|
17
|
+
root: parsed.root,
|
|
18
|
+
componentRoot: parsed.componentRoot,
|
|
19
|
+
storyRoot: parsed.storyRoot,
|
|
20
|
+
aliases: parsed.aliases,
|
|
21
|
+
sourceExtensions: parsed.sourceExtensions,
|
|
22
|
+
componentExtensions: parsed.componentExtensions,
|
|
23
|
+
marker,
|
|
24
|
+
storyFilePattern,
|
|
25
|
+
exclusions,
|
|
26
|
+
...(parsed.exclusionsLabel === undefined ? {} : { exclusionsLabel: parsed.exclusionsLabel }),
|
|
27
|
+
});
|
|
28
|
+
for (const message of report.messages)
|
|
29
|
+
process.stderr.write(`${message}\n`);
|
|
30
|
+
if (!report.ok) {
|
|
31
|
+
process.stderr.write('Component story coverage check failed\n');
|
|
32
|
+
return 1;
|
|
33
|
+
}
|
|
34
|
+
return 0;
|
|
35
|
+
}
|
|
36
|
+
function compile(source, flag) {
|
|
37
|
+
try {
|
|
38
|
+
return new RegExp(source);
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
throw new Error(`story-coverage ${flag} is not a valid regular expression`);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
async function readExclusions(file) {
|
|
45
|
+
let parsed;
|
|
46
|
+
try {
|
|
47
|
+
parsed = JSON.parse(await readFile(file, 'utf8'));
|
|
48
|
+
}
|
|
49
|
+
catch {
|
|
50
|
+
throw new Error(`story-coverage could not read exclusions: ${file}`);
|
|
51
|
+
}
|
|
52
|
+
if (typeof parsed !== 'object' || parsed === null || Array.isArray(parsed)) {
|
|
53
|
+
throw new Error('story-coverage exclusions must be a JSON object');
|
|
54
|
+
}
|
|
55
|
+
return parsed;
|
|
56
|
+
}
|
package/dist/cli/index.mjs
CHANGED
|
@@ -6,6 +6,7 @@ import { runPostReviewCli } from "../gha-post-review/cli.mjs";
|
|
|
6
6
|
import { runStageReviewPayloadCli } from "../gha-review-payload/cli.mjs";
|
|
7
7
|
import { runSwiftSemanticEqualCli } from "../swift-semantic-equal/cli.mjs";
|
|
8
8
|
import { runGhaArtifactsCleanup } from "./commands/gha-artifacts-cleanup.mjs";
|
|
9
|
+
import { runStoryCoverage } from "./commands/story-coverage.mjs";
|
|
9
10
|
import { runGhaRuntimeAudit } from "./commands/gha-runtime-audit.mjs";
|
|
10
11
|
import { runHttpOrigin } from "./commands/http-origin.mjs";
|
|
11
12
|
import { runPnpmInstallCli } from "./commands/pnpm-install.mjs";
|
|
@@ -21,6 +22,7 @@ import { runRetrospectiveFactsCommand } from "./commands/retrospective-facts.mjs
|
|
|
21
22
|
import { runAgentBlackboardCommand } from "./commands/agent-blackboard.mjs";
|
|
22
23
|
import { runMcpCommand } from "./commands/mcp.mjs";
|
|
23
24
|
import { runWorktreeCommand } from "./commands/worktree.mjs";
|
|
25
|
+
import { runHostStoragePreflightCli } from "../host-storage/cli.mjs";
|
|
24
26
|
import { runWithHostLock } from "./commands/with-host-lock.mjs";
|
|
25
27
|
import { runFreshBase } from "./commands/fresh-base.mjs";
|
|
26
28
|
import { runRequireUpToDate } from "./commands/require-up-to-date.mjs";
|
|
@@ -99,6 +101,8 @@ export function runCli(argv = process.argv) {
|
|
|
99
101
|
return runRunnerPortPolicy(parsed);
|
|
100
102
|
case 'with-host-lock':
|
|
101
103
|
return runWithHostLock(parsed.args);
|
|
104
|
+
case 'host-storage':
|
|
105
|
+
return runHostStoragePreflightCli(parsed.args);
|
|
102
106
|
case 'gha-runtime-audit':
|
|
103
107
|
return runGhaRuntimeAudit(parsed);
|
|
104
108
|
case 'script': {
|
|
@@ -125,6 +129,8 @@ export function runCli(argv = process.argv) {
|
|
|
125
129
|
return runHttpOrigin(parsed.field, parsed.value);
|
|
126
130
|
case 'gha-artifacts-cleanup':
|
|
127
131
|
return runGhaArtifactsCleanup(parsed);
|
|
132
|
+
case 'story-coverage':
|
|
133
|
+
return runStoryCoverage(parsed);
|
|
128
134
|
case 'retrospective-transcript':
|
|
129
135
|
return runRetrospectiveTranscriptCommand(parsed.args);
|
|
130
136
|
case 'link-skill':
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export function parseForwardedCommand(command, args) {
|
|
2
2
|
if (command === 'with-host-lock')
|
|
3
3
|
return { kind: 'with-host-lock', args };
|
|
4
|
+
if (command === 'host-storage')
|
|
5
|
+
return { kind: 'host-storage', args };
|
|
4
6
|
if (command === 'pnpm-install')
|
|
5
7
|
return { kind: 'pnpm-install', args };
|
|
6
8
|
if (command === 'vitest-blob-manifest')
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type ParsedStoryCoverage = {
|
|
2
|
+
kind: 'story-coverage';
|
|
3
|
+
root: string;
|
|
4
|
+
componentRoot: string;
|
|
5
|
+
storyRoot: string;
|
|
6
|
+
aliases: Record<string, string>;
|
|
7
|
+
sourceExtensions: string[];
|
|
8
|
+
componentExtensions: string[];
|
|
9
|
+
marker: string;
|
|
10
|
+
storyPattern: string;
|
|
11
|
+
exclusionsFile?: string;
|
|
12
|
+
exclusionsLabel?: string;
|
|
13
|
+
};
|
|
14
|
+
export declare function emptyParsed(): ParsedStoryCoverage;
|
|
15
|
+
export declare function applyFlag(parsed: ParsedStoryCoverage, flag: string, value: string): string | undefined;
|
|
16
|
+
export declare function missingField(parsed: ParsedStoryCoverage): {
|
|
17
|
+
kind: 'error';
|
|
18
|
+
message: string;
|
|
19
|
+
} | undefined;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
export function emptyParsed() {
|
|
2
|
+
return {
|
|
3
|
+
kind: 'story-coverage',
|
|
4
|
+
root: '',
|
|
5
|
+
componentRoot: '',
|
|
6
|
+
storyRoot: '',
|
|
7
|
+
aliases: {},
|
|
8
|
+
sourceExtensions: [],
|
|
9
|
+
componentExtensions: [],
|
|
10
|
+
marker: '',
|
|
11
|
+
storyPattern: '',
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export function applyFlag(parsed, flag, value) {
|
|
15
|
+
if (value === '')
|
|
16
|
+
return `${flag} requires a value`;
|
|
17
|
+
if (flag === '--alias')
|
|
18
|
+
return applyAlias(parsed, value);
|
|
19
|
+
if (flag === '--source-extension') {
|
|
20
|
+
parsed.sourceExtensions.push(value);
|
|
21
|
+
return undefined;
|
|
22
|
+
}
|
|
23
|
+
if (flag === '--component-extension') {
|
|
24
|
+
parsed.componentExtensions.push(value);
|
|
25
|
+
return undefined;
|
|
26
|
+
}
|
|
27
|
+
const field = scalarField(flag);
|
|
28
|
+
if (field)
|
|
29
|
+
parsed[field] = value;
|
|
30
|
+
else
|
|
31
|
+
parsed.exclusionsLabel = value;
|
|
32
|
+
return undefined;
|
|
33
|
+
}
|
|
34
|
+
function scalarField(flag) {
|
|
35
|
+
if (flag === '--root')
|
|
36
|
+
return 'root';
|
|
37
|
+
if (flag === '--component-root')
|
|
38
|
+
return 'componentRoot';
|
|
39
|
+
if (flag === '--story-root')
|
|
40
|
+
return 'storyRoot';
|
|
41
|
+
if (flag === '--marker')
|
|
42
|
+
return 'marker';
|
|
43
|
+
if (flag === '--story-pattern')
|
|
44
|
+
return 'storyPattern';
|
|
45
|
+
if (flag === '--exclusions')
|
|
46
|
+
return 'exclusionsFile';
|
|
47
|
+
return undefined;
|
|
48
|
+
}
|
|
49
|
+
function applyAlias(parsed, value) {
|
|
50
|
+
const split = value.indexOf('=');
|
|
51
|
+
if (split <= 0 || split === value.length - 1)
|
|
52
|
+
return '--alias must be <prefix>=<path>';
|
|
53
|
+
parsed.aliases[value.slice(0, split)] = value.slice(split + 1);
|
|
54
|
+
return undefined;
|
|
55
|
+
}
|
|
56
|
+
export function missingField(parsed) {
|
|
57
|
+
const missing = [
|
|
58
|
+
[parsed.root, '--root'],
|
|
59
|
+
[parsed.componentRoot, '--component-root'],
|
|
60
|
+
[parsed.storyRoot, '--story-root'],
|
|
61
|
+
[parsed.sourceExtensions.length > 0 ? 'set' : '', '--source-extension'],
|
|
62
|
+
[parsed.componentExtensions.length > 0 ? 'set' : '', '--component-extension'],
|
|
63
|
+
[parsed.marker, '--marker'],
|
|
64
|
+
[parsed.storyPattern, '--story-pattern'],
|
|
65
|
+
].find(([value]) => value === '');
|
|
66
|
+
if (!missing)
|
|
67
|
+
return undefined;
|
|
68
|
+
return { kind: 'error', message: `story-coverage requires ${missing[1]}` };
|
|
69
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ParsedStoryCoverage } from './parse-story-coverage-fields.mts';
|
|
2
|
+
export type { ParsedStoryCoverage };
|
|
3
|
+
export declare function parseStoryCoverage(args: readonly string[]): ParsedStoryCoverage | {
|
|
4
|
+
kind: 'help';
|
|
5
|
+
} | {
|
|
6
|
+
kind: 'error';
|
|
7
|
+
message: string;
|
|
8
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { applyFlag, emptyParsed, missingField, } from "./parse-story-coverage-fields.mjs";
|
|
2
|
+
const FLAGS = new Set([
|
|
3
|
+
'--root',
|
|
4
|
+
'--component-root',
|
|
5
|
+
'--story-root',
|
|
6
|
+
'--alias',
|
|
7
|
+
'--source-extension',
|
|
8
|
+
'--component-extension',
|
|
9
|
+
'--marker',
|
|
10
|
+
'--story-pattern',
|
|
11
|
+
'--exclusions',
|
|
12
|
+
'--exclusions-label',
|
|
13
|
+
]);
|
|
14
|
+
export function parseStoryCoverage(args) {
|
|
15
|
+
if (args.length === 0)
|
|
16
|
+
return { kind: 'error', message: 'story-coverage requires --root' };
|
|
17
|
+
if (args.includes('--help') || args.includes('-h'))
|
|
18
|
+
return { kind: 'help' };
|
|
19
|
+
const parsed = emptyParsed();
|
|
20
|
+
for (let index = 0; index < args.length; index += 1) {
|
|
21
|
+
const flag = args[index] ?? '';
|
|
22
|
+
if (!FLAGS.has(flag))
|
|
23
|
+
return { kind: 'error', message: `unknown story-coverage option: ${flag}` };
|
|
24
|
+
const value = args[index + 1];
|
|
25
|
+
if (value === undefined || value.startsWith('--')) {
|
|
26
|
+
return { kind: 'error', message: `${flag} requires a value` };
|
|
27
|
+
}
|
|
28
|
+
index += 1;
|
|
29
|
+
const invalid = applyFlag(parsed, flag, value);
|
|
30
|
+
if (invalid)
|
|
31
|
+
return { kind: 'error', message: invalid };
|
|
32
|
+
}
|
|
33
|
+
return missingField(parsed) ?? parsed;
|
|
34
|
+
}
|
package/dist/cli/parse.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type ParsedGhaArtifactsCleanup } from './parse-gha-artifacts-cleanup.mts';
|
|
2
|
+
import { type ParsedStoryCoverage } from './parse-story-coverage.mts';
|
|
2
3
|
import { type ParsedGhaRuntimeAudit } from './parse-gha-runtime-audit.mts';
|
|
3
4
|
export type ParsedCli = {
|
|
4
5
|
kind: 'help';
|
|
@@ -17,6 +18,9 @@ export type ParsedCli = {
|
|
|
17
18
|
} | {
|
|
18
19
|
kind: 'with-host-lock';
|
|
19
20
|
args: string[];
|
|
21
|
+
} | {
|
|
22
|
+
kind: 'host-storage';
|
|
23
|
+
args: string[];
|
|
20
24
|
} | {
|
|
21
25
|
kind: 'script';
|
|
22
26
|
command: ScriptCommand;
|
|
@@ -93,7 +97,7 @@ export type ParsedCli = {
|
|
|
93
97
|
root?: string;
|
|
94
98
|
workflowDirectories?: string[];
|
|
95
99
|
actionDirectories?: string[];
|
|
96
|
-
} | ParsedGhaRuntimeAudit | ParsedGhaArtifactsCleanup;
|
|
100
|
+
} | ParsedGhaRuntimeAudit | ParsedGhaArtifactsCleanup | ParsedStoryCoverage;
|
|
97
101
|
export type ScriptCommand = 'gha-output' | 'gha-needs-results' | 'download-with-diagnostics' | 'download-optional-run-artifacts' | 'host-pressure-diagnostics' | 'allocate-browser-safe-ports' | 'diagnose-port-collision' | 'prepare-trivy-db' | 'check-cache-size' | 'make-shard-matrix' | 'load-runner-env' | 'clean-workspace' | 'install-github-release' | 'run-with-timeout' | 'lint-links' | 'materialize-pr-context' | 'wait-for-apt-locks' | 'install-playwright-chromium-arm64' | 'ghcr-package-retention' | 'harness-admission-lane' | 'harness-assert-gates' | 'gha-collaborator-trust';
|
|
98
102
|
export declare function parseCli(argv: readonly string[]): ParsedCli;
|
|
99
103
|
export declare function parseCommandHelp(command: string | undefined, rest: readonly string[]): {
|
package/dist/cli/parse.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { parseGhaArtifactsCleanup, } from "./parse-gha-artifacts-cleanup.mjs";
|
|
2
|
+
import { parseStoryCoverage } from "./parse-story-coverage.mjs";
|
|
2
3
|
import { parseGhaRuntimeAudit } from "./parse-gha-runtime-audit.mjs";
|
|
3
4
|
import { parseForwardedCommand } from "./parse-forwarded-commands.mjs";
|
|
4
5
|
import { parseFreshBase } from "./parse-fresh-base.mjs";
|
|
@@ -63,6 +64,8 @@ export function parseCli(argv) {
|
|
|
63
64
|
return parseGhaWorkspacePolicy(rest);
|
|
64
65
|
if (command === 'gha-artifacts-cleanup')
|
|
65
66
|
return parseGhaArtifactsCleanup(rest);
|
|
67
|
+
if (command === 'story-coverage')
|
|
68
|
+
return parseStoryCoverage(rest);
|
|
66
69
|
if (command !== undefined && SCRIPT_COMMANDS.has(command)) {
|
|
67
70
|
return { kind: 'script', command: command, args: rest };
|
|
68
71
|
}
|