vouchington-tooling 3.3.0 → 3.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/README.md +3 -1
  2. package/dist/agent-blackboard/feedback-audit-source.d.mts +6 -0
  3. package/dist/agent-blackboard/feedback-audit-source.mjs +12 -0
  4. package/dist/agent-blackboard/feedback-compose.mjs +8 -3
  5. package/dist/audit-journal/scope.d.mts +6 -0
  6. package/dist/audit-journal/scope.mjs +16 -3
  7. package/dist/cli/commands/retrospective-transcript.mjs +8 -0
  8. package/dist/cli/usage-text.d.mts +1 -1
  9. package/dist/cli/usage-text.mjs +1 -1
  10. package/dist/mcp-server/retrospective-facts-input.d.mts +8 -0
  11. package/dist/mcp-server/retrospective-facts-input.mjs +18 -0
  12. package/dist/mcp-server/retrospective-input.mjs +5 -5
  13. package/dist/mcp-server/tools-retrospective.mjs +1 -1
  14. package/dist/retrospective-transcript/claude.d.mts +2 -1
  15. package/dist/retrospective-transcript/claude.mjs +8 -2
  16. package/dist/retrospective-transcript/codex-records.d.mts +2 -0
  17. package/dist/retrospective-transcript/codex-records.mjs +10 -0
  18. package/dist/retrospective-transcript/codex.d.mts +2 -1
  19. package/dist/retrospective-transcript/codex.mjs +13 -4
  20. package/dist/retrospective-transcript/format.d.mts +2 -1
  21. package/dist/retrospective-transcript/format.mjs +15 -1
  22. package/dist/retrospective-transcript/index.d.mts +3 -1
  23. package/dist/retrospective-transcript/index.mjs +7 -8
  24. package/dist/retrospective-transcript/resolve-transcript-file.d.mts +5 -0
  25. package/dist/retrospective-transcript/shared.d.mts +2 -0
  26. package/dist/retrospective-transcript/window.d.mts +24 -0
  27. package/dist/retrospective-transcript/window.mjs +32 -0
  28. package/docs/mcp-server.md +8 -3
  29. package/package.json +1 -1
  30. package/scripts/__pycache__/run_bounded_process.cpython-314.pyc +0 -0
  31. package/skills/manifest.json +9 -9
  32. package/skills/triage-loop/SKILL.md +4 -1
  33. package/skills/triage-loop/scripts/state.py +1 -1
  34. package/skills/triage-sweep/SKILL.md +21 -8
package/README.md CHANGED
@@ -186,7 +186,9 @@ layout when `GROK_SESSION_ID` is set. Use `--grok-sessions-dir` to point discove
186
186
  Grok session root. Without `--session-id`, it reads those session identities from the host
187
187
  environment. `resolveTranscriptFile` is the canonical resolver: it lowercases and UUID-validates
188
188
  session ids, honors `CODEX_HOME`, `CLAUDE_CONFIG_DIR` and `GROK_HOME`, and errors when more than one
189
- transcript matches. The subpath also exports `normalizeCommandPrefix`, `splitCommandSegments`,
189
+ transcript matches. `--since` and `--until` (ISO 8601; `since` exclusive, `until` inclusive) count
190
+ only events whose record timestamp is inside the window and report how many were excluded; the
191
+ Codex token totals continue from the last excluded cumulative counter. The subpath also exports `normalizeCommandPrefix`, `splitCommandSegments`,
190
192
  `isPackageRunner`, `asRecord`, `asArray` and `openTranscriptLines(path, { maxRecordBytes })`, which
191
193
  streams lines (2 MiB per record by default) and throws from the iterable on an oversized record.
192
194
 
@@ -1,4 +1,5 @@
1
1
  import type { JournalScan } from '../audit-journal/journal.mts';
2
+ import type { TranscriptWindow } from '../retrospective-transcript/index.mts';
2
3
  import { type JournalAuditOptions, type JournalAuditReport } from './feedback-journal-audit.mts';
3
4
  export type AuditSourceInput = {
4
5
  journal?: JournalAuditOptions;
@@ -12,6 +13,11 @@ export type AuditInputs = {
12
13
  kind: 'none';
13
14
  };
14
15
  export declare function loadAuditInputs(sessionId: string, input: AuditSourceInput): Promise<AuditInputs>;
16
+ /**
17
+ * The window of the session's newest earlier retrospective, found in the same journal scan that
18
+ * scopes the audit sections: events after it are new to the retrospective being composed.
19
+ */
20
+ export declare function defaultTranscriptWindow(inputs: AuditInputs): TranscriptWindow | undefined;
15
21
  /** Builds the CI-failure and sandbox sections from loaded inputs, with no further I/O. */
16
22
  export declare function renderAuditReport(input: AuditSourceInput, inputs: AuditInputs): AuditReport;
17
23
  /** Only a complete, untruncated journal scan counts as assessed. */
@@ -1,3 +1,4 @@
1
+ import { retrospectiveBoundary } from "../audit-journal/scope.mjs";
1
2
  import { loadJournalAuditInput, renderJournalAuditReport, } from "./feedback-journal-audit.mjs";
2
3
  const ASSESSED_SOURCE_ERROR = 'complete feedback coverage requires assessed available factual and finding sources';
3
4
  const NOT_ASSESSED_MARKDOWN = '## CI Failures\nStatus: unavailable (not assessed)\n\n## Sandbox & Permission Audit\nStatus: unavailable (not assessed)';
@@ -6,6 +7,17 @@ export async function loadAuditInputs(sessionId, input) {
6
7
  return { kind: 'journal', scanned: await loadJournalAuditInput(sessionId, input.journal) };
7
8
  return { kind: 'none' };
8
9
  }
10
+ /**
11
+ * The window of the session's newest earlier retrospective, found in the same journal scan that
12
+ * scopes the audit sections: events after it are new to the retrospective being composed.
13
+ */
14
+ export function defaultTranscriptWindow(inputs) {
15
+ if (inputs.kind !== 'journal' || inputs.scanned.status !== 'ok')
16
+ return undefined;
17
+ const { entries, retrospectives } = inputs.scanned;
18
+ const boundary = retrospectiveBoundary(entries, retrospectives);
19
+ return boundary && { since: boundary.createdAt, boundary: boundary.sourceEventId };
20
+ }
9
21
  /** Builds the CI-failure and sandbox sections from loaded inputs, with no further I/O. */
10
22
  export function renderAuditReport(input, inputs) {
11
23
  if (inputs.kind === 'journal')
@@ -1,6 +1,6 @@
1
1
  import { runRetrospectiveFactsReport, } from "../retrospective-facts/index.mjs";
2
2
  import { runRetrospectiveTranscriptReport, } from "../retrospective-transcript/index.mjs";
3
- import { auditAssessed, loadAuditInputs, renderAuditReport, completeCoverageError, } from "./feedback-audit-source.mjs";
3
+ import { auditAssessed, defaultTranscriptWindow, loadAuditInputs, renderAuditReport, completeCoverageError, } from "./feedback-audit-source.mjs";
4
4
  import { AUDIT_ATTEMPTS, boundedAuditSource, shrinkCaps, UNBOUNDED_CAPS, } from "./feedback-compose-audit.mjs";
5
5
  import { createFeedbackEnvelope, feedbackOverflowBytes, redactFeedbackText, } from "./feedback-codec.mjs";
6
6
  import { validateFeedbackText } from "./feedback-fields.mjs";
@@ -45,13 +45,19 @@ export async function composeRetrospective(input) {
45
45
  coverage: input.transcript.status,
46
46
  }
47
47
  : undefined;
48
+ const loaded = await loadAuditInputs(input.sessionId, input);
48
49
  const [facts, transcript] = await Promise.all([
49
50
  'status' in input.facts
50
51
  ? Promise.resolve(unavailableFacts)
51
52
  : runRetrospectiveFactsReport({ ...input.facts, raw: false }),
52
53
  'status' in input.transcript
53
54
  ? Promise.resolve(unavailableTranscript)
54
- : runRetrospectiveTranscriptReport(input.transcript),
55
+ : runRetrospectiveTranscriptReport({
56
+ ...(input.transcript.since || input.transcript.until
57
+ ? {}
58
+ : defaultTranscriptWindow(loaded)),
59
+ ...input.transcript,
60
+ }),
55
61
  ]);
56
62
  const assemble = (auditMarkdown) => [
57
63
  '---',
@@ -87,7 +93,6 @@ export async function composeRetrospective(input) {
87
93
  });
88
94
  // The audit sections are the only unbounded ones: render them, measure the real envelope against
89
95
  // its limits, and shrink the audit caps by the measured overflow until it fits.
90
- const loaded = await loadAuditInputs(input.sessionId, input);
91
96
  let caps = UNBOUNDED_CAPS;
92
97
  let audit;
93
98
  let markdown;
@@ -10,6 +10,12 @@ export type JournalScope = {
10
10
  /** The retrospective whose time bounds the scope; absent when every entry is in scope. */
11
11
  boundary?: SavedRetrospective;
12
12
  };
13
+ /**
14
+ * The retrospective that bounds work reported by an earlier one: the newest saved retrospective
15
+ * created before the newest journal entry, by the same rule as `scopeSinceRetrospective` but
16
+ * anchored on any entry rather than only on audit blocks.
17
+ */
18
+ export declare function retrospectiveBoundary(entries: JournalEntry[], retrospectives: SavedRetrospective[]): SavedRetrospective | undefined;
13
19
  /**
14
20
  * Keeps only the entries created after the boundary retrospective, so a later retrospective does
15
21
  * not repeat what an earlier one already reported.
@@ -15,6 +15,21 @@ function newest(items, at) {
15
15
  }
16
16
  return best;
17
17
  }
18
+ /** The newest saved retrospective created before `at`. */
19
+ function newestBefore(retrospectives, at) {
20
+ if (at === undefined)
21
+ return undefined;
22
+ return newest(retrospectives.filter((retrospective) => retrospective.createdAt < at), (retrospective) => retrospective.createdAt);
23
+ }
24
+ /**
25
+ * The retrospective that bounds work reported by an earlier one: the newest saved retrospective
26
+ * created before the newest journal entry, by the same rule as `scopeSinceRetrospective` but
27
+ * anchored on any entry rather than only on audit blocks.
28
+ */
29
+ export function retrospectiveBoundary(entries, retrospectives) {
30
+ const latest = newest(entries, createdAtOf);
31
+ return newestBefore(retrospectives, latest && createdAtOf(latest));
32
+ }
18
33
  /**
19
34
  * Keeps only the entries created after the boundary retrospective, so a later retrospective does
20
35
  * not repeat what an earlier one already reported.
@@ -30,9 +45,7 @@ function newest(items, at) {
30
45
  export function scopeSinceRetrospective(entries, retrospectives) {
31
46
  const newestBlock = newest(entries.filter(hasAuditBlock), createdAtOf);
32
47
  const blockAt = newestBlock === undefined ? undefined : createdAtOf(newestBlock);
33
- const boundary = blockAt === undefined
34
- ? undefined
35
- : newest(retrospectives.filter((retrospective) => retrospective.createdAt < blockAt), (retrospective) => retrospective.createdAt);
48
+ const boundary = newestBefore(retrospectives, blockAt);
36
49
  if (boundary === undefined)
37
50
  return { included: entries, excluded: [] };
38
51
  const isLater = (entry) => {
@@ -1,5 +1,6 @@
1
1
  import { parseArgs } from 'node:util';
2
2
  import { runRetrospectiveTranscript, } from "../../retrospective-transcript/index.mjs";
3
+ import { isTimestamp } from "../../retrospective-transcript/window.mjs";
3
4
  export async function runRetrospectiveTranscriptCommand(args) {
4
5
  try {
5
6
  const { values } = parseArgs({
@@ -11,14 +12,21 @@ export async function runRetrospectiveTranscriptCommand(args) {
11
12
  'projects-dir': { type: 'string' },
12
13
  'codex-sessions-dir': { type: 'string' },
13
14
  'grok-sessions-dir': { type: 'string' },
15
+ since: { type: 'string' },
16
+ until: { type: 'string' },
14
17
  },
15
18
  });
19
+ for (const key of ['since', 'until'])
20
+ if (values[key] !== undefined && !isTimestamp(values[key]))
21
+ throw new Error(`--${key} must be an ISO 8601 timestamp`);
16
22
  const options = {
17
23
  ...(values['session-id'] ? { sessionId: values['session-id'] } : {}),
18
24
  ...(values.jsonl ? { jsonlPath: values.jsonl } : {}),
19
25
  ...(values['projects-dir'] ? { projectsDir: values['projects-dir'] } : {}),
20
26
  ...(values['codex-sessions-dir'] ? { codexSessionsDir: values['codex-sessions-dir'] } : {}),
21
27
  ...(values['grok-sessions-dir'] ? { grokSessionsDir: values['grok-sessions-dir'] } : {}),
28
+ ...(values.since ? { since: values.since } : {}),
29
+ ...(values.until ? { until: values.until } : {}),
22
30
  env: process.env,
23
31
  };
24
32
  process.stdout.write(await runRetrospectiveTranscript(options));
@@ -1 +1 @@
1
- export declare const USAGE = "Usage: vouchington <command> [options]\n\nCommands:\n runner-port-policy Print or validate a runner port policy\n with-host-lock Run a command under a host-wide lock\n host-storage Check free space on caller-supplied paths\n gha-runtime-audit Audit successful GitHub Actions job runtimes\n require-up-to-date Require HEAD to include a fetched remote branch\n fresh-base Classify the worktree against a remote base branch\n gitleaks-directory-scan Scan a directory with Gitleaks\n ast-grep-examples Run AST-grep rule examples\n ast-grep-pack Print shipped unconditional AST-grep pack paths as JSON\n gha-workspace-policy Check GitHub Actions workspace safety policy\n gha-output Write a collision-safe multiline GITHUB_OUTPUT record\n gha-needs-results Fail if required GitHub Actions job results failed\n download-with-diagnostics Download a URL and report HTTP status on failure\n download-optional-run-artifacts Download optional artifacts from the current run\n host-pressure-diagnostics Print a bounded host memory/OOM/PSI snapshot\n allocate-browser-safe-ports Allocate Fetch-safe localhost ports\n diagnose-port-collision Capture bounded localhost port diagnostics\n prepare-trivy-db Download the Trivy vulnerability database\n gha-artifacts-cleanup Delete classified GitHub Actions artifacts\n agent-issue-labels Map changed paths to labels; create missing repository labels\n http-origin Validate an optional HTTP(S) origin\n vitest-blob-manifest Stamp a vitest-blob-manifest:v1 identity file\n vitest-report-attempt Write or read a Vitest report-attempt marker\n prepare-vitest-reports Validate and select Vitest report JSON files\n pnpm-install Install a pnpm workspace with retry and release-age fail-fast\n check-cache-size Measure a path and decide whether to save a GHA cache\n make-shard-matrix Emit a [1..N] GitHub Actions shard matrix\n load-runner-env Overlay a runner env file onto GITHUB_ENV with injection guards\n clean-workspace Reset a persistent-runner workspace with a fork-PR trust gate\n install-github-release Download a checksum-verified GitHub Release binary\n run-with-timeout Run a command with GNU timeout or a Perl fallback\n lint-links Two-pass lychee: internal links fail, external warn\n wait-for-apt-locks Wait until apt/dpkg lock files are free\n install-playwright-chromium-arm64 Install Playwright Chromium from browsers.json\n ghcr-package-retention Delete old GHCR package versions (KEEP_MIN or --main-history)\n harness-admission-lane Compute a GITHUB_RUN_ID admission lane for fleet fan-out\n gha-collaborator-trust Classify authors as write-access collaborators or not\n nuget-central-version Validate a Directory.Packages.props PackageVersion delta\n verify-workflow-secrets Check a secret inventory against live repository and environment secrets\n runner-policy Check workflow runner labels and jobs against a config\n dead-code Gate unused code against a committed jscpd baseline\n swift-semantic-equal Compare Swift sources ignoring comments and whitespace\n retrospective-transcript Format facts from Claude-compatible, Codex, or Grok transcripts\n link-skill Link one packaged skill into an explicit consumer directory\n retrospective-facts Gather immutable facts for a retrospective\n agent-blackboard Probe an Agent Blackboard deployment, classify distill sessions, manage snapshots\n mcp Serve the agent-blackboard journal tools over stdio (MCP)\n hook Run a repository policy module as a pre/post tool-use hook\n worktree Reclaim finished git worktrees (dry run unless --yes)\n tmux Run configured dev windows in tmux; name panes; agent reminders\n story-coverage Check component exports are imported by stories\n transient-retry Rerun a failed GitHub Actions run when an injected rule matches\n sandbox-command-audit Audit agent transcripts for sandbox escalations and denials\n cloc Count tracked lines of code by category and service with scc\n coverage-scope-check Check positive-threshold coverage rules against the Vitest scope\n trivy-policy Check tracked Trivy workflow scans and the exception registry\n docker-image-mirror Require tracked Docker images to come from a Docker Hub mirror\n workspace-registry-check Check syncpack, pnpm workspace and CI path-filter registries against tracked manifests\n storybook-browser-runner Run the Storybook Vitest browser project with cache, retry and watchdog\n\nOptions:\n -h, --help Show this help\n -v, --version Print the package version\n\nrunner-port-policy\n (no args) Print the shipped policy as JSON\n --file <path> Validate and print a policy file\n --reserved <port> Print true if the port is reserved\n\nwith-host-lock\n --name <family>\n [--slots <n>]\n --timeout-seconds <n>\n [--command-timeout-seconds <n>]\n [--failure-diagnostics <absolute-script>]\n [--on-acquire-timeout fail|run-unlocked]\n -- <command> [args...]\n\nhost-storage --path <path> [--path <path>...] [--minimum-free-bytes <bytes>] [--pnpm-store] [--docker-root] [--docker-desktop-path <path>] [--discovery-timeout-ms <ms>]\n\ngha-runtime-audit\n [--repository owner/name] Default GITHUB_REPOSITORY\n [--branch main]\n [--median-threshold-floor <seconds>] Off unless set. Must be below the ceiling\n [--median-threshold-ceiling <seconds>] Default 360. Flags a five-sample median above this\n --pr-workflow <name|/regex/> Repeatable\n --push-workflow <name|/regex/> Repeatable\n\nrequire-up-to-date --remote <name> --branch <name>\nfresh-base [--remote <name>] [--branch <name>] [--skip-fetch]\ngitleaks-directory-scan --config <path> [--directory <path>]\nast-grep-examples --rules <directory> --config <path>\nast-grep-pack\ngha-workspace-policy [--root <directory>] [--workflow-directory <directory>] [--action-directory <directory>]\n\ngha-output <name>\ngha-needs-results [label]\ndownload-with-diagnostics <url> <destination> [-- curl-args...]\ndownload-optional-run-artifacts (--name <name>... | --pattern <pattern>) --dir <directory>\nhost-pressure-diagnostics\nallocate-browser-safe-ports <count> [--policy path] [--forbidden-ports path]\ndiagnose-port-collision [--ports \"2200 2216\"] [--output-dir PATH]\nprepare-trivy-db\ngha-artifacts-cleanup run --run-id <id> [--keep-pattern glob] [--delete-pattern glob] [--patterns-file json]\ngha-artifacts-cleanup sweep --older-than-hours <n> [--keep-pattern glob] [--delete-pattern glob] [--patterns-file json]\nagent-issue-labels labels-from-paths [--labeler <path>] <path>...\nagent-issue-labels ensure-labels [--repo owner/name] [--policy-file json] [--update] <label>...\nhttp-origin [--field NAME] [value]\nvitest-blob-manifest <suite> [reports-directory]\nvitest-report-attempt <write DIRECTORY SUITE|read ROOT>\nprepare-vitest-reports [primary-directory] [fallback-directory] [output-directory]\npnpm-install --runner-lifecycle persistent|ephemeral|ephemeral-full --install-scripts true|false\ncheck-cache-size <path> <max-bytes> <label>\nmake-shard-matrix <total>\nload-runner-env\nclean-workspace\ninstall-github-release --repo owner/name --version X --asset 'name-{platform}.tar.gz' --bin name [--tag-prefix PREFIX] [--expected-sha256 SHA256] [--no-checksum] [--checksums-asset NAME] [--version-flag FLAG] [--bin-dir DIR]\nrun-with-timeout <timeout-seconds> <kill-after-seconds> <command...>\nlint-links [--offline] [--config PATH] [--glob PATTERN] [files...]\nwait-for-apt-locks\ninstall-playwright-chromium-arm64 [name:archive...]\nghcr-package-retention [--main-history] [--apply|--dry-run] [<url-encoded-package>...]\nharness-admission-lane <lanes>\ngha-collaborator-trust <owner/repo> [--allow-bot <login>]... < authors.json\nnuget-central-version <trusted-props> <candidate-props> <metadata-json> <output-props>\nverify-workflow-secrets [--repo OWNER/NAME] [--confirm NAME,...] [--inventory MODULE] [--export NAME] [--branch NAME]\nrunner-policy [--config FILE] [--root DIR]\ndead-code --baseline PATH [--seed|--update] [--config PATH] [--binary PATH] [--repo-root PATH] [--entry GLOB]... [--snapshot-ignore GLOB]... [--exclude GLOB]...\nswift-semantic-equal <base> <head> <file.swift>\nretrospective-transcript [--session-id ID] [--jsonl PATH] [--projects-dir PATH] [--codex-sessions-dir PATH] [--grok-sessions-dir PATH]\nlink-skill <name> --source-root <skills-dir> --target-root <consumer-skills-dir> Link a packaged or repository-local skill\nretrospective-facts (--pr NUMBER | --branch NAME | --no-pr) [--repo OWNER/NAME] [--raw]\nagent-blackboard probe\nagent-blackboard session-start [--skip-env NAME] [--setup-hint TEXT] [--docs-path PATH] [--restore-hint TEXT] [--timeout-ms N] (SessionStart hook; payload on stdin)\nagent-blackboard distill classify <partition.jsonl> --retro-cutoff ISO8601 --session-cutoff ISO8601\nagent-blackboard snapshot partition --snapshot PATH --checksum SHA256 --counts '{\"sessions\":N,\"entries\":N,\"records\":N,\"bytes\":N}'\nagent-blackboard snapshot cleanup [--snapshot PATH] [--partition-directory PATH --receipt JSON]\nmcp\n (no args) Serve journal_append, journal_entries, outbox_status, outbox_flush,\n session_ensure, retrospective_check, retrospective_save,\n pr_validate, pr_create, pr_update, snapshot_export, snapshot_partition,\n snapshot_archive, snapshot_cleanup, and session_archive over stdio.\n Needs the optional @modelcontextprotocol/sdk peer (and zod).\n Launch it from inside the repository's git worktree.\n\nhook pre-tool-use|post-tool-use --harness claude|codex|cursor|grok --policy <module> [--root <dir>] [--automation-env NAME]...\n Reads the harness hook payload on stdin. <module> default-exports a policy object (or a function\n of the hook context returning one) with a command rule table, post-tool-use checkers, and an\n optional reminder. pre-tool-use exits 2 to block, and also when the policy cannot load.\n post-tool-use is advisory and always exits 0. --root defaults to the working directory.\n Each --automation-env NAME (repeatable) marks the run unattended when that environment variable\n is set, non-empty, and not 0 or false; CI markers and claude -p are always unattended.\n\nworktree reclaim [--yes] [--json] [--max-worktrees N] [--timeout-ms N] [--pr-limit N] [--after PATH]\n Dry run by default. Removes clean, fully pushed worktrees whose same-repository PR for the\n branch is merged or closed at exactly HEAD, using git worktree remove (never forced).\n Skips the main checkout, the current worktree, and locked, bare or detached worktrees.\n\ntransient-retry --rules <module> [--repo owner/name] [--token-env NAME] [--dry-run] <run-id>\n Loads a module exporting \"rules\" (and optionally \"limits\"), evaluates them against the failed run,\n and reruns only on a match. Exits 0 on rerun, 2 when none is warranted, 1 on error.\n\nsandbox-command-audit --rules <module> [--settings-path <file>] [--repo-root <dir>]... [--worktree-glob <glob>]... [--projects-dir <dir>] [--codex-sessions-dir <dir>] [--session-id <id>] [--limit N] [--since DAYS] [--json] [--raw]\n Scans Claude and Codex transcripts scoped to this repository (git roots plus any --worktree-glob\n layouts) and reports Bash escalations, denials and permission failures by command prefix.\n <module> exports an object (default or \"rules\") with loadPolicy({ settingsPath, cwd }), which\n returns { covers(list, commandOrPrefix) } for the allow/deny/excluded lists or { error }, and\n optionally classifyFailure(command, text, source), limits and worktreeGlobs. Transcript roots\n default to CLAUDE_CONFIG_DIR/projects and CODEX_HOME/sessions. --raw prints full command text.\n\ncloc --config <file> [--scc-bin <path>] [--json]\n Counts git-tracked lines with scc (SCC_BIN or --scc-bin, else \"scc\"), classified into\n source/tests/tooling and by service, and prints an aligned table (--json: rows). <file> is a .json\n file or a module whose default (or \"config\") export is the layout: services [{ name, match }],\n defaultService, categories, testPatterns, toolingPatterns, countedRoots, countedRootFiles,\n excludedDirs, ignoredDirs, sccBin, missingSccHint.\n\ncoverage-scope-check [--rules <path>] [--scope-file <json>] [--include <glob>]... [--exclude <glob>]...\n Fails (exit 1) when a git-tracked file that a coverage rules file (default .coverage-rules.yml)\n gives a patch_coverage_min above 0, and its scope does not ignore, is outside the collector's\n scope. The collector scope is the repeated --include/--exclude globs plus, optionally, the\n include/exclude string arrays of a --scope-file JSON written from the Vitest coverage config.\n At least one include glob is required.\n\ntrivy-policy [--root <dir>] [--ignore-file <path>] [--findings-exit-code-env <NAME>] [--cleanup-url-prefix <url>] [--min-gates N] [--min-sboms N] [--max-expiry-days N]\n Reads git-tracked workflows, composite actions and shell scripts and prints each violation (exit 1).\n Every Trivy package scan must be an auditable CLI command in a workflow run block or shell script (no action, wrapper, substitution or\n background). Vulnerability gates need --scanners vuln, --pkg-types os, --severity CRITICAL,HIGH,\n --ignore-unfixed, --skip-db-update, --quiet, table output to a file, --ignorefile <ignore-file>\n (default .trivyignore.yaml) and --exit-code \"$<NAME>\" (default TRIVY_FINDINGS_EXIT_CODE).\n CycloneDX SBOM scans must be unfiltered with --exit-code 0. At least --min-gates gates and\n --min-sboms SBOM scans (default 2 each) must exist. The tracked ignore registry needs purl-exact OS\n packages, a \"Not exploitable: ... Cleanup: <issue URL>\" statement (URL must start with\n --cleanup-url-prefix when given) and an expired_at between tomorrow and --max-expiry-days (30).\n\ndocker-image-mirror [--root <dir>] [--mirror <host>] [--allow-registry <prefix>]... [--require-digest]\n [--allow-ref-expression <text>]...\n Prints each Docker Hub image in git-tracked workflows, composite actions and Dockerfiles (exit 1):\n run, pull and create commands, containers, services, docker:// references, buildx drivers, FROM,\n COPY --from and # syntax. Images must name a registry host; --mirror (default mirror.gcr.io) is\n the host the message tells you to use. --allow-registry (repeatable) instead requires every image,\n including FROM and COPY --from, to start with one of the prefixes; a reference that expands a\n variable passes only when its literal text before the variable starts with a prefix. --require-digest\n requires @sha256: plus 64 lowercase hex characters. Stage aliases and scratch stay exempt.\n --allow-ref-expression (repeatable) is an audited escape hatch for dynamic job outputs: a reference\n whose raw text exactly equals the value is accepted. Images the same file builds locally are exempt.\n\nworkspace-registry-check [--root <dir>] [--syncpack-config <path>] [--workspace-file <path>]\n [--path-filters <path>] [--tooling-group <name>] [--trigger-only-glob <glob>] [--runtime-prefix <prefix>]\n Reconciles git-tracked package.json manifests with the syncpack \"source\" globs (default\n .syncpackrc.json), the pnpm \"packages\" globs (pnpm-workspace.yaml) and the dorny/paths-filter groups\n (.github/ci-path-filters.yml) and prints one line per violation (exit 1). The --tooling-group group\n (default tooling) must reach every manifest and wildcard workspace glob, and its --trigger-only-glob\n (default **/package.json) does not count as registering a manifest. Each group named with\n --runtime-prefix (default runtime-) must mirror the primary group of the same name.\n\nstorybook-browser-runner --project <name> [--command <cmd>] [--result-file <path>]... [--completion-file <path>] [--coverage-arg=<arg>]... [--optimize-deps-config <path>] [--env-prefix <PREFIX>] [--progress-prefix <text>] [-- <argv>...]\n Spawns <cmd> (default pnpm) in its own process group with <argv> (default \"exec vitest run\n --project <name>\") plus the coverage args (default --coverage) and supervises it: a Vite optimizer\n cache, retries on known Vite and browser start-up flakes, and stall, hang and session-budget\n watchdogs. --result-file paths are removed before each attempt and --completion-file is the one\n whose appearance is recorded. Tuned by <PREFIX>_STARTUP_ATTEMPTS, _OPTIMIZER_STALL_MS, _HANG_MS,\n _SESSION_BUDGET_MS, _DIAGNOSTICS_FILE, _PERSISTENT_CACHE, _PERSISTENT_CACHE_DIR and _COVERAGE\n (PREFIX defaults to STORYBOOK_BROWSER). Exits with the resolved test exit code.\n\ntmux up --config <file> [--root <dir>] [--no-attach] [-v|--verbose]\ntmux name [--socket PATH --pane %ID --worktree PATH] <name> | read-title | post-tool | agent-reminder <event>\n Environment: TMUX_TARGET_BIN, TMUX_TARGET_ROOT, TMUX_NAME_COMMAND, AGENT_TMUX_SOCKET/PANE/WORKTREE.\n\nstory-coverage --root <dir> --component-root <rel> --story-root <rel> --source-extension <ext> --component-extension <ext> --marker <regex> --story-pattern <regex> [--alias <prefix>=<path>] [--exclusions <json>] [--exclusions-label <text>]\n";
1
+ export declare const USAGE = "Usage: vouchington <command> [options]\n\nCommands:\n runner-port-policy Print or validate a runner port policy\n with-host-lock Run a command under a host-wide lock\n host-storage Check free space on caller-supplied paths\n gha-runtime-audit Audit successful GitHub Actions job runtimes\n require-up-to-date Require HEAD to include a fetched remote branch\n fresh-base Classify the worktree against a remote base branch\n gitleaks-directory-scan Scan a directory with Gitleaks\n ast-grep-examples Run AST-grep rule examples\n ast-grep-pack Print shipped unconditional AST-grep pack paths as JSON\n gha-workspace-policy Check GitHub Actions workspace safety policy\n gha-output Write a collision-safe multiline GITHUB_OUTPUT record\n gha-needs-results Fail if required GitHub Actions job results failed\n download-with-diagnostics Download a URL and report HTTP status on failure\n download-optional-run-artifacts Download optional artifacts from the current run\n host-pressure-diagnostics Print a bounded host memory/OOM/PSI snapshot\n allocate-browser-safe-ports Allocate Fetch-safe localhost ports\n diagnose-port-collision Capture bounded localhost port diagnostics\n prepare-trivy-db Download the Trivy vulnerability database\n gha-artifacts-cleanup Delete classified GitHub Actions artifacts\n agent-issue-labels Map changed paths to labels; create missing repository labels\n http-origin Validate an optional HTTP(S) origin\n vitest-blob-manifest Stamp a vitest-blob-manifest:v1 identity file\n vitest-report-attempt Write or read a Vitest report-attempt marker\n prepare-vitest-reports Validate and select Vitest report JSON files\n pnpm-install Install a pnpm workspace with retry and release-age fail-fast\n check-cache-size Measure a path and decide whether to save a GHA cache\n make-shard-matrix Emit a [1..N] GitHub Actions shard matrix\n load-runner-env Overlay a runner env file onto GITHUB_ENV with injection guards\n clean-workspace Reset a persistent-runner workspace with a fork-PR trust gate\n install-github-release Download a checksum-verified GitHub Release binary\n run-with-timeout Run a command with GNU timeout or a Perl fallback\n lint-links Two-pass lychee: internal links fail, external warn\n wait-for-apt-locks Wait until apt/dpkg lock files are free\n install-playwright-chromium-arm64 Install Playwright Chromium from browsers.json\n ghcr-package-retention Delete old GHCR package versions (KEEP_MIN or --main-history)\n harness-admission-lane Compute a GITHUB_RUN_ID admission lane for fleet fan-out\n gha-collaborator-trust Classify authors as write-access collaborators or not\n nuget-central-version Validate a Directory.Packages.props PackageVersion delta\n verify-workflow-secrets Check a secret inventory against live repository and environment secrets\n runner-policy Check workflow runner labels and jobs against a config\n dead-code Gate unused code against a committed jscpd baseline\n swift-semantic-equal Compare Swift sources ignoring comments and whitespace\n retrospective-transcript Format facts from Claude-compatible, Codex, or Grok transcripts\n link-skill Link one packaged skill into an explicit consumer directory\n retrospective-facts Gather immutable facts for a retrospective\n agent-blackboard Probe an Agent Blackboard deployment, classify distill sessions, manage snapshots\n mcp Serve the agent-blackboard journal tools over stdio (MCP)\n hook Run a repository policy module as a pre/post tool-use hook\n worktree Reclaim finished git worktrees (dry run unless --yes)\n tmux Run configured dev windows in tmux; name panes; agent reminders\n story-coverage Check component exports are imported by stories\n transient-retry Rerun a failed GitHub Actions run when an injected rule matches\n sandbox-command-audit Audit agent transcripts for sandbox escalations and denials\n cloc Count tracked lines of code by category and service with scc\n coverage-scope-check Check positive-threshold coverage rules against the Vitest scope\n trivy-policy Check tracked Trivy workflow scans and the exception registry\n docker-image-mirror Require tracked Docker images to come from a Docker Hub mirror\n workspace-registry-check Check syncpack, pnpm workspace and CI path-filter registries against tracked manifests\n storybook-browser-runner Run the Storybook Vitest browser project with cache, retry and watchdog\n\nOptions:\n -h, --help Show this help\n -v, --version Print the package version\n\nrunner-port-policy\n (no args) Print the shipped policy as JSON\n --file <path> Validate and print a policy file\n --reserved <port> Print true if the port is reserved\n\nwith-host-lock\n --name <family>\n [--slots <n>]\n --timeout-seconds <n>\n [--command-timeout-seconds <n>]\n [--failure-diagnostics <absolute-script>]\n [--on-acquire-timeout fail|run-unlocked]\n -- <command> [args...]\n\nhost-storage --path <path> [--path <path>...] [--minimum-free-bytes <bytes>] [--pnpm-store] [--docker-root] [--docker-desktop-path <path>] [--discovery-timeout-ms <ms>]\n\ngha-runtime-audit\n [--repository owner/name] Default GITHUB_REPOSITORY\n [--branch main]\n [--median-threshold-floor <seconds>] Off unless set. Must be below the ceiling\n [--median-threshold-ceiling <seconds>] Default 360. Flags a five-sample median above this\n --pr-workflow <name|/regex/> Repeatable\n --push-workflow <name|/regex/> Repeatable\n\nrequire-up-to-date --remote <name> --branch <name>\nfresh-base [--remote <name>] [--branch <name>] [--skip-fetch]\ngitleaks-directory-scan --config <path> [--directory <path>]\nast-grep-examples --rules <directory> --config <path>\nast-grep-pack\ngha-workspace-policy [--root <directory>] [--workflow-directory <directory>] [--action-directory <directory>]\n\ngha-output <name>\ngha-needs-results [label]\ndownload-with-diagnostics <url> <destination> [-- curl-args...]\ndownload-optional-run-artifacts (--name <name>... | --pattern <pattern>) --dir <directory>\nhost-pressure-diagnostics\nallocate-browser-safe-ports <count> [--policy path] [--forbidden-ports path]\ndiagnose-port-collision [--ports \"2200 2216\"] [--output-dir PATH]\nprepare-trivy-db\ngha-artifacts-cleanup run --run-id <id> [--keep-pattern glob] [--delete-pattern glob] [--patterns-file json]\ngha-artifacts-cleanup sweep --older-than-hours <n> [--keep-pattern glob] [--delete-pattern glob] [--patterns-file json]\nagent-issue-labels labels-from-paths [--labeler <path>] <path>...\nagent-issue-labels ensure-labels [--repo owner/name] [--policy-file json] [--update] <label>...\nhttp-origin [--field NAME] [value]\nvitest-blob-manifest <suite> [reports-directory]\nvitest-report-attempt <write DIRECTORY SUITE|read ROOT>\nprepare-vitest-reports [primary-directory] [fallback-directory] [output-directory]\npnpm-install --runner-lifecycle persistent|ephemeral|ephemeral-full --install-scripts true|false\ncheck-cache-size <path> <max-bytes> <label>\nmake-shard-matrix <total>\nload-runner-env\nclean-workspace\ninstall-github-release --repo owner/name --version X --asset 'name-{platform}.tar.gz' --bin name [--tag-prefix PREFIX] [--expected-sha256 SHA256] [--no-checksum] [--checksums-asset NAME] [--version-flag FLAG] [--bin-dir DIR]\nrun-with-timeout <timeout-seconds> <kill-after-seconds> <command...>\nlint-links [--offline] [--config PATH] [--glob PATTERN] [files...]\nwait-for-apt-locks\ninstall-playwright-chromium-arm64 [name:archive...]\nghcr-package-retention [--main-history] [--apply|--dry-run] [<url-encoded-package>...]\nharness-admission-lane <lanes>\ngha-collaborator-trust <owner/repo> [--allow-bot <login>]... < authors.json\nnuget-central-version <trusted-props> <candidate-props> <metadata-json> <output-props>\nverify-workflow-secrets [--repo OWNER/NAME] [--confirm NAME,...] [--inventory MODULE] [--export NAME] [--branch NAME]\nrunner-policy [--config FILE] [--root DIR]\ndead-code --baseline PATH [--seed|--update] [--config PATH] [--binary PATH] [--repo-root PATH] [--entry GLOB]... [--snapshot-ignore GLOB]... [--exclude GLOB]...\nswift-semantic-equal <base> <head> <file.swift>\nretrospective-transcript [--session-id ID] [--jsonl PATH] [--projects-dir PATH] [--codex-sessions-dir PATH] [--grok-sessions-dir PATH] [--since ISO] [--until ISO]\nlink-skill <name> --source-root <skills-dir> --target-root <consumer-skills-dir> Link a packaged or repository-local skill\nretrospective-facts (--pr NUMBER | --branch NAME | --no-pr) [--repo OWNER/NAME] [--raw]\nagent-blackboard probe\nagent-blackboard session-start [--skip-env NAME] [--setup-hint TEXT] [--docs-path PATH] [--restore-hint TEXT] [--timeout-ms N] (SessionStart hook; payload on stdin)\nagent-blackboard distill classify <partition.jsonl> --retro-cutoff ISO8601 --session-cutoff ISO8601\nagent-blackboard snapshot partition --snapshot PATH --checksum SHA256 --counts '{\"sessions\":N,\"entries\":N,\"records\":N,\"bytes\":N}'\nagent-blackboard snapshot cleanup [--snapshot PATH] [--partition-directory PATH --receipt JSON]\nmcp\n (no args) Serve journal_append, journal_entries, outbox_status, outbox_flush,\n session_ensure, retrospective_check, retrospective_save,\n pr_validate, pr_create, pr_update, snapshot_export, snapshot_partition,\n snapshot_archive, snapshot_cleanup, and session_archive over stdio.\n Needs the optional @modelcontextprotocol/sdk peer (and zod).\n Launch it from inside the repository's git worktree.\n\nhook pre-tool-use|post-tool-use --harness claude|codex|cursor|grok --policy <module> [--root <dir>] [--automation-env NAME]...\n Reads the harness hook payload on stdin. <module> default-exports a policy object (or a function\n of the hook context returning one) with a command rule table, post-tool-use checkers, and an\n optional reminder. pre-tool-use exits 2 to block, and also when the policy cannot load.\n post-tool-use is advisory and always exits 0. --root defaults to the working directory.\n Each --automation-env NAME (repeatable) marks the run unattended when that environment variable\n is set, non-empty, and not 0 or false; CI markers and claude -p are always unattended.\n\nworktree reclaim [--yes] [--json] [--max-worktrees N] [--timeout-ms N] [--pr-limit N] [--after PATH]\n Dry run by default. Removes clean, fully pushed worktrees whose same-repository PR for the\n branch is merged or closed at exactly HEAD, using git worktree remove (never forced).\n Skips the main checkout, the current worktree, and locked, bare or detached worktrees.\n\ntransient-retry --rules <module> [--repo owner/name] [--token-env NAME] [--dry-run] <run-id>\n Loads a module exporting \"rules\" (and optionally \"limits\"), evaluates them against the failed run,\n and reruns only on a match. Exits 0 on rerun, 2 when none is warranted, 1 on error.\n\nsandbox-command-audit --rules <module> [--settings-path <file>] [--repo-root <dir>]... [--worktree-glob <glob>]... [--projects-dir <dir>] [--codex-sessions-dir <dir>] [--session-id <id>] [--limit N] [--since DAYS] [--json] [--raw]\n Scans Claude and Codex transcripts scoped to this repository (git roots plus any --worktree-glob\n layouts) and reports Bash escalations, denials and permission failures by command prefix.\n <module> exports an object (default or \"rules\") with loadPolicy({ settingsPath, cwd }), which\n returns { covers(list, commandOrPrefix) } for the allow/deny/excluded lists or { error }, and\n optionally classifyFailure(command, text, source), limits and worktreeGlobs. Transcript roots\n default to CLAUDE_CONFIG_DIR/projects and CODEX_HOME/sessions. --raw prints full command text.\n\ncloc --config <file> [--scc-bin <path>] [--json]\n Counts git-tracked lines with scc (SCC_BIN or --scc-bin, else \"scc\"), classified into\n source/tests/tooling and by service, and prints an aligned table (--json: rows). <file> is a .json\n file or a module whose default (or \"config\") export is the layout: services [{ name, match }],\n defaultService, categories, testPatterns, toolingPatterns, countedRoots, countedRootFiles,\n excludedDirs, ignoredDirs, sccBin, missingSccHint.\n\ncoverage-scope-check [--rules <path>] [--scope-file <json>] [--include <glob>]... [--exclude <glob>]...\n Fails (exit 1) when a git-tracked file that a coverage rules file (default .coverage-rules.yml)\n gives a patch_coverage_min above 0, and its scope does not ignore, is outside the collector's\n scope. The collector scope is the repeated --include/--exclude globs plus, optionally, the\n include/exclude string arrays of a --scope-file JSON written from the Vitest coverage config.\n At least one include glob is required.\n\ntrivy-policy [--root <dir>] [--ignore-file <path>] [--findings-exit-code-env <NAME>] [--cleanup-url-prefix <url>] [--min-gates N] [--min-sboms N] [--max-expiry-days N]\n Reads git-tracked workflows, composite actions and shell scripts and prints each violation (exit 1).\n Every Trivy package scan must be an auditable CLI command in a workflow run block or shell script (no action, wrapper, substitution or\n background). Vulnerability gates need --scanners vuln, --pkg-types os, --severity CRITICAL,HIGH,\n --ignore-unfixed, --skip-db-update, --quiet, table output to a file, --ignorefile <ignore-file>\n (default .trivyignore.yaml) and --exit-code \"$<NAME>\" (default TRIVY_FINDINGS_EXIT_CODE).\n CycloneDX SBOM scans must be unfiltered with --exit-code 0. At least --min-gates gates and\n --min-sboms SBOM scans (default 2 each) must exist. The tracked ignore registry needs purl-exact OS\n packages, a \"Not exploitable: ... Cleanup: <issue URL>\" statement (URL must start with\n --cleanup-url-prefix when given) and an expired_at between tomorrow and --max-expiry-days (30).\n\ndocker-image-mirror [--root <dir>] [--mirror <host>] [--allow-registry <prefix>]... [--require-digest]\n [--allow-ref-expression <text>]...\n Prints each Docker Hub image in git-tracked workflows, composite actions and Dockerfiles (exit 1):\n run, pull and create commands, containers, services, docker:// references, buildx drivers, FROM,\n COPY --from and # syntax. Images must name a registry host; --mirror (default mirror.gcr.io) is\n the host the message tells you to use. --allow-registry (repeatable) instead requires every image,\n including FROM and COPY --from, to start with one of the prefixes; a reference that expands a\n variable passes only when its literal text before the variable starts with a prefix. --require-digest\n requires @sha256: plus 64 lowercase hex characters. Stage aliases and scratch stay exempt.\n --allow-ref-expression (repeatable) is an audited escape hatch for dynamic job outputs: a reference\n whose raw text exactly equals the value is accepted. Images the same file builds locally are exempt.\n\nworkspace-registry-check [--root <dir>] [--syncpack-config <path>] [--workspace-file <path>]\n [--path-filters <path>] [--tooling-group <name>] [--trigger-only-glob <glob>] [--runtime-prefix <prefix>]\n Reconciles git-tracked package.json manifests with the syncpack \"source\" globs (default\n .syncpackrc.json), the pnpm \"packages\" globs (pnpm-workspace.yaml) and the dorny/paths-filter groups\n (.github/ci-path-filters.yml) and prints one line per violation (exit 1). The --tooling-group group\n (default tooling) must reach every manifest and wildcard workspace glob, and its --trigger-only-glob\n (default **/package.json) does not count as registering a manifest. Each group named with\n --runtime-prefix (default runtime-) must mirror the primary group of the same name.\n\nstorybook-browser-runner --project <name> [--command <cmd>] [--result-file <path>]... [--completion-file <path>] [--coverage-arg=<arg>]... [--optimize-deps-config <path>] [--env-prefix <PREFIX>] [--progress-prefix <text>] [-- <argv>...]\n Spawns <cmd> (default pnpm) in its own process group with <argv> (default \"exec vitest run\n --project <name>\") plus the coverage args (default --coverage) and supervises it: a Vite optimizer\n cache, retries on known Vite and browser start-up flakes, and stall, hang and session-budget\n watchdogs. --result-file paths are removed before each attempt and --completion-file is the one\n whose appearance is recorded. Tuned by <PREFIX>_STARTUP_ATTEMPTS, _OPTIMIZER_STALL_MS, _HANG_MS,\n _SESSION_BUDGET_MS, _DIAGNOSTICS_FILE, _PERSISTENT_CACHE, _PERSISTENT_CACHE_DIR and _COVERAGE\n (PREFIX defaults to STORYBOOK_BROWSER). Exits with the resolved test exit code.\n\ntmux up --config <file> [--root <dir>] [--no-attach] [-v|--verbose]\ntmux name [--socket PATH --pane %ID --worktree PATH] <name> | read-title | post-tool | agent-reminder <event>\n Environment: TMUX_TARGET_BIN, TMUX_TARGET_ROOT, TMUX_NAME_COMMAND, AGENT_TMUX_SOCKET/PANE/WORKTREE.\n\nstory-coverage --root <dir> --component-root <rel> --story-root <rel> --source-extension <ext> --component-extension <ext> --marker <regex> --story-pattern <regex> [--alias <prefix>=<path>] [--exclusions <json>] [--exclusions-label <text>]\n";
@@ -127,7 +127,7 @@ verify-workflow-secrets [--repo OWNER/NAME] [--confirm NAME,...] [--inventory MO
127
127
  runner-policy [--config FILE] [--root DIR]
128
128
  dead-code --baseline PATH [--seed|--update] [--config PATH] [--binary PATH] [--repo-root PATH] [--entry GLOB]... [--snapshot-ignore GLOB]... [--exclude GLOB]...
129
129
  swift-semantic-equal <base> <head> <file.swift>
130
- retrospective-transcript [--session-id ID] [--jsonl PATH] [--projects-dir PATH] [--codex-sessions-dir PATH] [--grok-sessions-dir PATH]
130
+ retrospective-transcript [--session-id ID] [--jsonl PATH] [--projects-dir PATH] [--codex-sessions-dir PATH] [--grok-sessions-dir PATH] [--since ISO] [--until ISO]
131
131
  link-skill <name> --source-root <skills-dir> --target-root <consumer-skills-dir> Link a packaged or repository-local skill
132
132
  retrospective-facts (--pr NUMBER | --branch NAME | --no-pr) [--repo OWNER/NAME] [--raw]
133
133
  agent-blackboard probe
@@ -1,6 +1,14 @@
1
1
  import type { Args } from './args.mts';
2
2
  /** A pull request number as digits, from a digit string or a positive safe integer. */
3
3
  export declare function prNumber(value: unknown): string | undefined;
4
+ /**
5
+ * The optional `since`/`until` window of `compose.transcript`: ISO timestamps, `since` before
6
+ * `until`. Absent, the server defaults `since` to the session's newest earlier retrospective.
7
+ */
8
+ export declare function transcriptWindow(transcript: Args): {
9
+ since?: string;
10
+ until?: string;
11
+ };
4
12
  /**
5
13
  * Checks `compose.facts`: either `{ status, reason }` (unassessed) or a live collection selector,
6
14
  * never both. Returns whether live collection was requested.
@@ -1,3 +1,4 @@
1
+ import { isTimestamp } from "../retrospective-transcript/window.mjs";
1
2
  /** A plain branch name: no scheme or colon, no leading dash, no `..`. */
2
3
  const BRANCH = /^(?!-)(?!.*\.\.)[A-Za-z0-9._/-]+$/;
3
4
  /** A pull request number as digits, from a digit string or a positive safe integer. */
@@ -6,6 +7,23 @@ export function prNumber(value) {
6
7
  return Number.isSafeInteger(value) && value > 0 ? String(value) : undefined;
7
8
  return typeof value === 'string' && /^\d+$/.test(value) ? value : undefined;
8
9
  }
10
+ /**
11
+ * The optional `since`/`until` window of `compose.transcript`: ISO timestamps, `since` before
12
+ * `until`. Absent, the server defaults `since` to the session's newest earlier retrospective.
13
+ */
14
+ export function transcriptWindow(transcript) {
15
+ const window = {};
16
+ for (const key of ['since', 'until']) {
17
+ if (transcript[key] === undefined)
18
+ continue;
19
+ if (!isTimestamp(transcript[key]))
20
+ throw new Error(`compose.transcript.${key} must be an ISO 8601 timestamp`);
21
+ window[key] = transcript[key];
22
+ }
23
+ if (window.since && window.until && Date.parse(window.since) >= Date.parse(window.until))
24
+ throw new Error('compose.transcript.since must be before until');
25
+ return window;
26
+ }
9
27
  /**
10
28
  * Checks `compose.facts`: either `{ status, reason }` (unassessed) or a live collection selector,
11
29
  * never both. Returns whether live collection was requested.
@@ -3,7 +3,7 @@ import { rejectUnknown } from "./args.mjs";
3
3
  import { inspectHarnessEnvironment, selectHarnessSession, } from "../agent-harness-identity/index.mjs";
4
4
  import { SESSION_ID } from "../retrospective-transcript/resolve-transcript-file.mjs";
5
5
  import { serverJournalLoader } from "./journal-read.mjs";
6
- import { checkFactsInput, prNumber } from "./retrospective-facts-input.mjs";
6
+ import { checkFactsInput, prNumber, transcriptWindow } from "./retrospective-facts-input.mjs";
7
7
  import { spawnPolicy } from "./policy-spawn.mjs";
8
8
  const HARNESSES = ['codex', 'claude', 'cursor', 'grok'];
9
9
  const COMPOSE_KEYS = [
@@ -22,7 +22,7 @@ const COMPOSE_REQUIRED = COMPOSE_KEYS.filter((key) => key !== 'knownSensitiveVal
22
22
  /** No `repo`: a caller must not aim the server's GitHub token at another repository. */
23
23
  const FACTS_KEYS = ['pr', 'branch', 'noPr', 'status', 'reason'];
24
24
  /** No path overrides: the server reads the session's transcript from its own default roots. */
25
- const TRANSCRIPT_KEYS = ['sessionId', 'harnessSessionId', 'status', 'reason'];
25
+ const TRANSCRIPT_KEYS = ['sessionId', 'harnessSessionId', 'since', 'until', 'status', 'reason'];
26
26
  /** The longest a facts subprocess may run before it is killed. */
27
27
  export const FACTS_TIMEOUT_MS = 120_000;
28
28
  const MAX_OUTPUT_BYTES = 10_000_000;
@@ -92,8 +92,8 @@ export function sensitiveValues(compose, env) {
92
92
  */
93
93
  function transcriptInput(transcript, base) {
94
94
  if ('status' in transcript) {
95
- if ('sessionId' in transcript || 'harnessSessionId' in transcript)
96
- throw new Error('compose.transcript: sessionId and harnessSessionId are exclusive with status');
95
+ if (['sessionId', 'harnessSessionId', 'since', 'until'].some((key) => key in transcript))
96
+ throw new Error('compose.transcript: sessionId, harnessSessionId, since and until are exclusive with status');
97
97
  return transcript;
98
98
  }
99
99
  // A reason without a status is malformed, not a request to read the transcript.
@@ -113,7 +113,7 @@ function transcriptInput(transcript, base) {
113
113
  throw new Error('compose.transcript may read only the harness session that launched the server: if the ' +
114
114
  'session changed since (/clear, a thread switch), reconnect the server (/mcp in Claude ' +
115
115
  'Code, or restart Codex), or pass { status, reason }');
116
- return { sessionId: harnessId, cwd: base.worktree };
116
+ return { sessionId: harnessId, cwd: base.worktree, ...transcriptWindow(transcript) };
117
117
  }
118
118
  function factsInput(facts, base) {
119
119
  return checkFactsInput(facts)
@@ -12,7 +12,7 @@ export const RETROSPECTIVE_TOOLS = [
12
12
  'each line key: <JSON>; any that repeat an argument must equal it) or compose (the retrospective ' +
13
13
  'composer input: narrative, date, issues, prs, description, facts, transcript, tools, ' +
14
14
  'architecture, optional knownSensitiveValues; the server adds the rest). compose.transcript ' +
15
- 'takes only { sessionId?, harnessSessionId? } (sessionId must be the call sessionId; the ' +
15
+ 'takes only { sessionId?, harnessSessionId?, since?, until? } (since/until ISO times bound the counted events, default since is the newest earlier retrospective; sessionId must be the call sessionId; the ' +
16
16
  'transcript is found by harnessSessionId, the harness session UUID, else by sessionId when ' +
17
17
  'that is a UUID, in the default session roots of the worktree) or { status, reason } to report it ' +
18
18
  'unassessed; any path override is rejected. The server redacts its blackboard token and ' +
@@ -1,2 +1,3 @@
1
1
  import { type TranscriptFacts } from './shared.mts';
2
- export declare function computeClaude(lines: string[][]): TranscriptFacts;
2
+ import { type TranscriptWindow } from './window.mts';
3
+ export declare function computeClaude(lines: string[][], window?: TranscriptWindow): TranscriptFacts;
@@ -1,5 +1,6 @@
1
1
  import { asRecord, emptyFacts, parseLines } from "./shared.mjs";
2
2
  import { applyAssistantUsage, applyToolBlocks } from "./claude-blocks.mjs";
3
+ import { windowRecords } from "./window.mjs";
3
4
  function hasPromptContent(content) {
4
5
  if (typeof content === 'string')
5
6
  return true;
@@ -10,12 +11,15 @@ function hasPromptContent(content) {
10
11
  return (value !== undefined && value.type !== 'tool_result' && value.type !== 'advisor_tool_result');
11
12
  });
12
13
  }
13
- export function computeClaude(lines) {
14
+ export function computeClaude(lines, window) {
14
15
  const facts = emptyFacts();
15
16
  const seen = new Set();
16
17
  const advisorIds = new Set();
18
+ let skipped = 0;
17
19
  for (const group of lines) {
18
- for (const record of parseLines(group)) {
20
+ const { included, excluded } = windowRecords(parseLines(group), window);
21
+ skipped += excluded;
22
+ for (const record of included) {
19
23
  if (typeof record.uuid === 'string' && (seen.has(record.uuid) || !seen.add(record.uuid)))
20
24
  continue;
21
25
  const subagent = record.isSidechain === true;
@@ -33,5 +37,7 @@ export function computeClaude(lines) {
33
37
  }
34
38
  }
35
39
  facts.advisorCalls = advisorIds.size;
40
+ if (window)
41
+ facts.excludedEvents = skipped;
36
42
  return facts;
37
43
  }
@@ -1,2 +1,4 @@
1
1
  import { type ParsedLine, type TokenTotals, type TranscriptFacts } from './shared.mts';
2
+ /** The cumulative token counters after the records, so a window's first delta starts from them. */
3
+ export declare function advanceBaseline(records: ParsedLine[], start?: TokenTotals): TokenTotals;
2
4
  export declare function applyRecords(records: ParsedLine[], facts: TranscriptFacts, subagent: boolean, baseline?: TokenTotals): void;
@@ -32,6 +32,16 @@ function addDelta(current, previous, target) {
32
32
  cacheCreation: 0,
33
33
  };
34
34
  }
35
+ /** The cumulative token counters after the records, so a window's first delta starts from them. */
36
+ export function advanceBaseline(records, start = emptyTokens()) {
37
+ let previous = start;
38
+ for (const record of records) {
39
+ const totals = usage(record);
40
+ if (totals)
41
+ previous = addDelta(totals, previous, emptyTokens());
42
+ }
43
+ return previous;
44
+ }
35
45
  export function applyRecords(records, facts, subagent, baseline = emptyTokens()) {
36
46
  let previous = baseline;
37
47
  const calls = new Set();
@@ -1,4 +1,5 @@
1
1
  import { type CodexSegment, type TokenTotals, type TranscriptFacts } from './shared.mts';
2
+ import { type TranscriptWindow } from './window.mts';
2
3
  export declare function codexChildren(lines: string[], ownerPath?: string): Array<{
3
4
  threadId: string;
4
5
  agentPath: string;
@@ -7,4 +8,4 @@ export declare function codexIdentity(lines: string[]): {
7
8
  threadId?: string;
8
9
  agentPath: string;
9
10
  };
10
- export declare function computeCodex(lines: string[], subagents?: CodexSegment[], baseline?: TokenTotals): TranscriptFacts;
11
+ export declare function computeCodex(lines: string[], subagents?: CodexSegment[], baseline?: TokenTotals, window?: TranscriptWindow): TranscriptFacts;
@@ -1,5 +1,6 @@
1
1
  import { asRecord, emptyFacts, parseLines, } from "./shared.mjs";
2
- import { applyRecords } from "./codex-records.mjs";
2
+ import { advanceBaseline, applyRecords } from "./codex-records.mjs";
3
+ import { windowRecords } from "./window.mjs";
3
4
  export function codexChildren(lines, ownerPath = '/root') {
4
5
  const direct = new Map();
5
6
  const base = ownerPath.replace(/\/$/, '');
@@ -29,10 +30,18 @@ export function codexIdentity(lines) {
29
30
  agentPath: typeof payload?.agent_path === 'string' ? payload.agent_path : '/root',
30
31
  };
31
32
  }
32
- export function computeCodex(lines, subagents = [], baseline) {
33
+ export function computeCodex(lines, subagents = [], baseline, window) {
33
34
  const facts = emptyFacts();
34
- applyRecords(parseLines(lines), facts, false, baseline);
35
+ let skipped = 0;
36
+ const apply = (segment, subagent, start) => {
37
+ const { included, before, excluded } = windowRecords(parseLines(segment), window);
38
+ skipped += excluded;
39
+ applyRecords(included, facts, subagent, advanceBaseline(before, start));
40
+ };
41
+ apply(lines, false, baseline);
35
42
  for (const subagent of subagents)
36
- applyRecords(parseLines(subagent.lines), facts, true, subagent.baseline);
43
+ apply(subagent.lines, true, subagent.baseline);
44
+ if (window)
45
+ facts.excludedEvents = skipped;
37
46
  return facts;
38
47
  }
@@ -1,4 +1,5 @@
1
1
  import type { TranscriptFacts } from './shared.mts';
2
+ import type { TranscriptWindow } from './window.mts';
2
3
  export declare function sessionLabel(value: string): string;
3
- export declare function formatTranscriptFacts(sessionId: string, facts: TranscriptFacts): string;
4
+ export declare function formatTranscriptFacts(sessionId: string, facts: TranscriptFacts, window?: TranscriptWindow): string;
4
5
  export declare const formatUnavailable: (reason: string) => string;
@@ -2,10 +2,11 @@ const LABEL_CHARACTER = /[^A-Za-z0-9._-]+/g;
2
2
  export function sessionLabel(value) {
3
3
  return value.replace(/\s+/g, '_').replace(LABEL_CHARACTER, '_').slice(0, 128) || 'transcript';
4
4
  }
5
- export function formatTranscriptFacts(sessionId, facts) {
5
+ export function formatTranscriptFacts(sessionId, facts, window) {
6
6
  return [
7
7
  '=== Transcript Facts ===',
8
8
  `Session: ${sessionLabel(sessionId)}`,
9
+ ...windowLines(facts, window),
9
10
  `User prompts: ${facts.userPrompts}`,
10
11
  `Assistant responses: ${facts.assistantResponses}`,
11
12
  `Tool calls: ${facts.toolCalls} (failed: ${facts.failedToolCalls})`,
@@ -20,6 +21,19 @@ export function formatTranscriptFacts(sessionId, facts) {
20
21
  '',
21
22
  ].join('\n');
22
23
  }
24
+ function windowLines(facts, window) {
25
+ if (!window)
26
+ return [];
27
+ const bounds = [
28
+ ...(window.since ? [`after ${window.since}`] : []),
29
+ ...(window.until ? [`until ${window.until}`] : []),
30
+ ].join(' ');
31
+ const boundary = window.boundary ? ` (retrospective ${window.boundary})` : '';
32
+ return [
33
+ `Window: ${bounds}${boundary}`,
34
+ `Excluded: ${facts.excludedEvents ?? 0} events outside the window`,
35
+ ];
36
+ }
23
37
  function escalationLines(facts) {
24
38
  if (!facts.escalations.length)
25
39
  return [];
@@ -1,8 +1,10 @@
1
1
  import { type ResolveOptions } from './resolve-transcript-file.mts';
2
+ import { type TranscriptWindow } from './window.mts';
2
3
  import { type CodexSegment, type TranscriptFacts } from './shared.mts';
3
4
  export type { TokenTotals, TranscriptFacts } from './shared.mts';
4
5
  export { codexChildren, codexIdentity } from './codex.mts';
5
6
  export { formatTranscriptFacts, formatUnavailable } from './format.mts';
7
+ export type { TranscriptWindow } from './window.mts';
6
8
  export type { ResolveOptions } from './resolve-transcript-file.mts';
7
9
  export { resolveTranscriptFile } from './resolve-transcript-file.mts';
8
10
  export { asRecord } from './shared.mts';
@@ -14,6 +16,6 @@ export type RetrospectiveTranscriptReport = {
14
16
  markdown: string;
15
17
  coverage: 'complete' | 'partial' | 'unavailable';
16
18
  };
17
- export declare function computeTranscriptFacts(lines: string[], subagents?: Array<string[] | CodexSegment>): TranscriptFacts;
19
+ export declare function computeTranscriptFacts(lines: string[], subagents?: Array<string[] | CodexSegment>, window?: TranscriptWindow): TranscriptFacts;
18
20
  export declare function runRetrospectiveTranscript(options: ResolveOptions): Promise<string>;
19
21
  export declare function runRetrospectiveTranscriptReport(options: ResolveOptions): Promise<RetrospectiveTranscriptReport>;
@@ -7,6 +7,7 @@ import { explainCodexSegment } from "./codex-segment.mjs";
7
7
  import { computeClaude } from "./claude.mjs";
8
8
  import { formatTranscriptFacts, formatUnavailable } from "./format.mjs";
9
9
  import { globFrom, resolveTranscriptFile, SESSION_ID, } from "./resolve-transcript-file.mjs";
10
+ import { optionsWindow } from "./window.mjs";
10
11
  import { hasMalformedInteriorRecord } from "./malformed-record.mjs";
11
12
  import { emptyFacts, parseLines } from "./shared.mjs";
12
13
  export { codexChildren, codexIdentity } from "./codex.mjs";
@@ -38,18 +39,15 @@ function schema(lines) {
38
39
  .filter(Boolean));
39
40
  return kinds.size === 1 ? [...kinds][0] : undefined;
40
41
  }
41
- export function computeTranscriptFacts(lines, subagents = []) {
42
+ export function computeTranscriptFacts(lines, subagents = [], window) {
42
43
  const detected = schema(lines);
43
44
  if (!detected)
44
45
  return emptyFacts();
45
46
  if (detected === 'claude')
46
- return computeClaude([
47
- lines,
48
- ...subagents.map((value) => (Array.isArray(value) ? value : value.lines)),
49
- ]);
47
+ return computeClaude([lines, ...subagents.map((value) => (Array.isArray(value) ? value : value.lines))], window);
50
48
  if (subagents.some(Array.isArray))
51
49
  throw new TypeError('Codex subagents must be segmented');
52
- return computeCodex(lines, subagents);
50
+ return computeCodex(lines, subagents, undefined, window);
53
51
  }
54
52
  async function readLines(path) {
55
53
  return (await readFile(path, 'utf8').catch(() => undefined))?.split('\n');
@@ -100,6 +98,7 @@ export async function runRetrospectiveTranscript(options) {
100
98
  return (await runRetrospectiveTranscriptReport(options)).markdown;
101
99
  }
102
100
  export async function runRetrospectiveTranscriptReport(options) {
101
+ const window = optionsWindow(options);
103
102
  const resolved = resolveTranscriptFile(options);
104
103
  if ('error' in resolved)
105
104
  return unavailable(resolved.error);
@@ -116,7 +115,7 @@ export async function runRetrospectiveTranscriptReport(options) {
116
115
  const subagents = await Promise.all(globFrom(directory, '*.jsonl').sort().map(readLines));
117
116
  const valid = subagents.filter((value) => value !== undefined && schema(value) === 'claude' && !hasMalformedInteriorRecord(value));
118
117
  return {
119
- markdown: formatTranscriptFacts(resolved.sessionId, computeTranscriptFacts(lines, valid)),
118
+ markdown: formatTranscriptFacts(resolved.sessionId, computeTranscriptFacts(lines, valid, window), window),
120
119
  coverage: valid.length === subagents.length && !partialCapture(lines) && !valid.some(partialCapture)
121
120
  ? 'complete'
122
121
  : 'partial',
@@ -136,7 +135,7 @@ export async function runRetrospectiveTranscriptReport(options) {
136
135
  if (!subagents)
137
136
  return unavailable(failure.reason ? `${unresolved}: could not segment it (${failure.reason})` : unresolved);
138
137
  return {
139
- markdown: formatTranscriptFacts(resolved.sessionId, computeCodex(root.lines, subagents, root.baseline)),
138
+ markdown: formatTranscriptFacts(resolved.sessionId, computeCodex(root.lines, subagents, root.baseline, window), window),
140
139
  coverage: partialCapture(lines) || subagents.some((segment) => segment.partial)
141
140
  ? 'partial'
142
141
  : 'complete',
@@ -5,6 +5,11 @@ export type ResolveOptions = {
5
5
  codexSessionsDir?: string;
6
6
  grokSessionsDir?: string;
7
7
  cwd?: string;
8
+ /** Count only events after this ISO time (exclusive) and up to `until` (inclusive). */
9
+ since?: string;
10
+ until?: string;
11
+ /** Names the retrospective that set `since` in the report. */
12
+ boundary?: string;
8
13
  env?: NodeJS.ProcessEnv;
9
14
  };
10
15
  export declare const SESSION_ID: RegExp;
@@ -18,6 +18,8 @@ export type TranscriptFacts = {
18
18
  subagentToolCalls: number;
19
19
  subagentTokens: TokenTotals;
20
20
  escalations: SandboxEscalation[];
21
+ /** Records outside the requested window; absent when no window was requested. */
22
+ excludedEvents?: number;
21
23
  };
22
24
  export type ParsedLine = Record<string, unknown>;
23
25
  export type CodexSegment = {
@@ -0,0 +1,24 @@
1
+ import type { ParsedLine } from './shared.mts';
2
+ /**
3
+ * A time window over transcript records. `since` is exclusive and `until` inclusive, matching the
4
+ * journal scope (an event is new when it is created after the boundary). A bound that does not
5
+ * parse as a timestamp is ignored.
6
+ */
7
+ export type TranscriptWindow = {
8
+ since?: string;
9
+ until?: string;
10
+ /** The saved retrospective that set `since`, named in the report. */
11
+ boundary?: string;
12
+ };
13
+ export type WindowedRecords = {
14
+ included: ParsedLine[];
15
+ /** Records at or before `since`, kept so cumulative counters can continue from them. */
16
+ before: ParsedLine[];
17
+ excluded: number;
18
+ };
19
+ /** The window the options ask for; absent unless a bound is given, so no bound changes nothing. */
20
+ export declare function optionsWindow(options: TranscriptWindow): TranscriptWindow | undefined;
21
+ /** Whether the value is an ISO-style timestamp that `Date.parse` accepts. */
22
+ export declare const isTimestamp: (value: unknown) => value is string;
23
+ /** Splits records by window. Records without a parseable `timestamp` are never excluded. */
24
+ export declare function windowRecords(records: ParsedLine[], window?: TranscriptWindow): WindowedRecords;
@@ -0,0 +1,32 @@
1
+ /** The window the options ask for; absent unless a bound is given, so no bound changes nothing. */
2
+ export function optionsWindow(options) {
3
+ const { since, until, boundary } = options;
4
+ if (!since && !until)
5
+ return undefined;
6
+ return {
7
+ ...(since ? { since } : {}),
8
+ ...(until ? { until } : {}),
9
+ ...(boundary ? { boundary } : {}),
10
+ };
11
+ }
12
+ const bound = (value) => Date.parse(value ?? '');
13
+ /** Whether the value is an ISO-style timestamp that `Date.parse` accepts. */
14
+ export const isTimestamp = (value) => typeof value === 'string' && /^\d{4}-\d{2}-\d{2}T/.test(value) && !Number.isNaN(bound(value));
15
+ /** Splits records by window. Records without a parseable `timestamp` are never excluded. */
16
+ export function windowRecords(records, window) {
17
+ const since = bound(window?.since);
18
+ const until = bound(window?.until);
19
+ const included = [];
20
+ const before = [];
21
+ let excluded = 0;
22
+ for (const record of records) {
23
+ const at = typeof record.timestamp === 'string' ? Date.parse(record.timestamp) : NaN;
24
+ if (at <= since)
25
+ before.push(record);
26
+ if (at <= since || at > until)
27
+ excluded++;
28
+ else
29
+ included.push(record);
30
+ }
31
+ return { included, before, excluded };
32
+ }
@@ -270,8 +270,9 @@ timestamp; a `timestamp` argument is rejected). The document comes from `markdow
270
270
  `compose`, the input of `composeRetrospective` (`narrative`, `date`, `issues`, `prs`,
271
271
  `description`, `facts`, `transcript`, `tools`, `architecture`, optional `knownSensitiveValues`;
272
272
  unknown keys are rejected, and the journal audit reads through the server's own client).
273
- `compose.transcript` accepts only `{ sessionId?, harnessSessionId? }` (`sessionId` must equal the
274
- call's `sessionId`) or `{ status, reason }` for an unassessed transcript. The transcript is found by
273
+ `compose.transcript` accepts only `{ sessionId?, harnessSessionId?, since?, until? }` (`sessionId`
274
+ must equal the call's `sessionId`; `since` and `until` are ISO 8601 timestamps, `since` exclusive and
275
+ `until` inclusive, that count only transcript events inside the window) or `{ status, reason }` for an unassessed transcript. The transcript is found by
275
276
  `harnessSessionId`, the harness's own session UUID, else by the call's `sessionId` when that is a
276
277
  UUID; otherwise the call fails rather than reporting the transcript unavailable. When the server's environment names its harness session (`CLAUDE_CODE_SESSION_ID`, `CODEX_THREAD_ID`, and so on), only that session's transcript is read (after `/clear` or a thread switch, reconnect the server, or pass `{ status, reason }`); `jsonlPath`, `projectsDir`, `codexSessionsDir`,
277
278
  `grokSessionsDir`, and `cwd` are rejected, and the server reads the transcript from the worktree
@@ -311,7 +312,11 @@ stored receipt and timestamp. Changed content under the same `sourceEventId` is
311
312
  the live journal and repository, so repeating a `compose` call is not a retry: when an interactive
312
313
  save is retained in the outbox, deliver it with `outbox_flush`. The CI Failures and Sandbox &
313
314
  Permission Audit sections use only the journal entries created after the session's newest earlier
314
- retrospective (by the blackboard's `createdAt`), and each section with excluded blocks adds an
315
+ retrospective (by the blackboard's `createdAt`), and the Transcript Facts count only the transcript
316
+ events after that retrospective's `createdAt` (the newest retrospective older than the session's
317
+ newest journal entry, found in the same journal scan), adding `Window:` and `Excluded: N events
318
+ outside the window` lines; an explicit `compose.transcript.since` or `until` replaces that default,
319
+ and a session with no earlier retrospective reports the whole thread exactly as before. Each section with excluded blocks adds an
315
320
  `Excluded: N blocks from before retrospective <sourceEventId>` line; a revision keeps its own
316
321
  blocks because the boundary is the newest retrospective older than the newest block.
317
322
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vouchington-tooling",
3
- "version": "3.3.0",
3
+ "version": "3.4.0",
4
4
  "description": "Vouchington CLI and extractable tooling libraries.",
5
5
  "homepage": "https://github.com/vouchington/vouchington-tooling/tree/main/packages/vouchington-tooling#readme",
6
6
  "bugs": {
@@ -4,57 +4,57 @@
4
4
  {
5
5
  "name": "blackboard",
6
6
  "plugin": "vouchington-workflow",
7
- "pluginVersion": "0.25.0",
7
+ "pluginVersion": "0.25.1",
8
8
  "path": "blackboard/SKILL.md"
9
9
  },
10
10
  {
11
11
  "name": "organize-github-issues",
12
12
  "plugin": "vouchington-workflow",
13
- "pluginVersion": "0.25.0",
13
+ "pluginVersion": "0.25.1",
14
14
  "path": "organize-github-issues/SKILL.md"
15
15
  },
16
16
  {
17
17
  "name": "pr-description",
18
18
  "plugin": "vouchington-workflow",
19
- "pluginVersion": "0.25.0",
19
+ "pluginVersion": "0.25.1",
20
20
  "path": "pr-description/SKILL.md"
21
21
  },
22
22
  {
23
23
  "name": "retrospective",
24
24
  "plugin": "vouchington-workflow",
25
- "pluginVersion": "0.25.0",
25
+ "pluginVersion": "0.25.1",
26
26
  "path": "retrospective/SKILL.md"
27
27
  },
28
28
  {
29
29
  "name": "retrospective-distill",
30
30
  "plugin": "vouchington-workflow",
31
- "pluginVersion": "0.25.0",
31
+ "pluginVersion": "0.25.1",
32
32
  "path": "retrospective-distill/SKILL.md"
33
33
  },
34
34
  {
35
35
  "name": "review-github-issue-taxonomy",
36
36
  "plugin": "vouchington-workflow",
37
- "pluginVersion": "0.25.0",
37
+ "pluginVersion": "0.25.1",
38
38
  "path": "review-github-issue-taxonomy/SKILL.md",
39
39
  "prerequisites": ["organize-github-issues"]
40
40
  },
41
41
  {
42
42
  "name": "triage-loop",
43
43
  "plugin": "vouchington-workflow",
44
- "pluginVersion": "0.25.0",
44
+ "pluginVersion": "0.25.1",
45
45
  "path": "triage-loop/SKILL.md"
46
46
  },
47
47
  {
48
48
  "name": "triage-prs",
49
49
  "plugin": "vouchington-workflow",
50
- "pluginVersion": "0.25.0",
50
+ "pluginVersion": "0.25.1",
51
51
  "path": "triage-prs/SKILL.md",
52
52
  "prerequisites": ["pr-description", "retrospective"]
53
53
  },
54
54
  {
55
55
  "name": "triage-sweep",
56
56
  "plugin": "vouchington-workflow",
57
- "pluginVersion": "0.25.0",
57
+ "pluginVersion": "0.25.1",
58
58
  "path": "triage-sweep/SKILL.md",
59
59
  "prerequisites": [
60
60
  "triage-loop",
@@ -110,7 +110,10 @@ through a printed command, and merges within the grant.
110
110
  it), `activityThrough` (ISO time; the `since` for Phase F's review-activity signal, advanced
111
111
  only after that step succeeds, falling back to `scannedThrough`), and `fullScanAt` (time of
112
112
  the last full window rescan)
113
- - `schedule` (the fallback sweep job's id and registration time)
113
+ - `commandsThrough` (ISO time; the `since` for triage-sweep Phase G2's command-comment scan,
114
+ advanced only after that phase succeeds, falling back to `lastSweepAt`)
115
+ - `schedule` (the fallback sweep job's id and registration time; its presence marks a standing
116
+ loop, and only a standing loop's sweep maintains the job)
114
117
  - `retroCursor`
115
118
  - `escalations` (key to first-notified time, used for dedupe)
116
119
  - `hookHarness` (`cursor`, recently `seen` event ids, and per-event progress)
@@ -11,7 +11,7 @@ import argparse, contextlib, datetime, fcntl, json, os, sys, tempfile
11
11
  SEEN_MAX = 200
12
12
  # The top-level fields and their shapes; `set`, `append`, and `remove` touch only these.
13
13
  FIELDS = {
14
- "lastSweepAt": str, "reviewedComments": dict, "lateReview": dict, "schedule": dict,
14
+ "lastSweepAt": str, "commandsThrough": str, "reviewedComments": dict, "lateReview": dict, "schedule": dict,
15
15
  "retroCursor": str, "escalations": dict, "hookHarness": dict, "handledFailures": dict,
16
16
  "shepherds": dict, "intake": list, "scheduledPrompts": dict, "delegations": list,
17
17
  "routed": list,
@@ -156,9 +156,13 @@ parts, paginating fully:
156
156
  - the repository-level review-comment and issue-comment lists sorted by `updated`
157
157
  (`gh api --paginate 'repos/<o>/<r>/pulls/comments?sort=updated&direction=desc&since=<ts>'`
158
158
  and `repos/<o>/<r>/issues/comments?sort=updated&since=<ts>`), mapped back to their PRs;
159
- - reviews submitted since then, through search or the event-wait stream when configured. A
160
- review with only a body and no inline comments is absent from the comment lists, so without
161
- the event-wait stream the periodic full rescan is what catches it.
159
+ - and, on every sweep, a signal that catches reviews with only a body: such a review is
160
+ absent from both comment lists, and the weekly backstop can run after a PR has left the
161
+ window. Search for merged PRs in the window updated since then
162
+ (`gh search prs --repo <o>/<r> --merged --merged-at '>=<window start>' --updated '><ts>'
163
+ --limit 1000 --json number`) and, for each, keep it when
164
+ `gh api --paginate 'repos/<o>/<r>/pulls/<n>/reviews'` has a review whose `submitted_at` is
165
+ after `<ts>`. A failed search or listing fails step 2, so `activityThrough` stays put.
162
166
  3. **Backstop:** when `fullScanAt` is unset or older than `fullRescanDays`
163
167
  (default 7), rescan every PR in the window as before.
164
168
 
@@ -208,9 +212,14 @@ one handled. Fix PRs follow the same merge rule: only a test-only diff merges.
208
212
 
209
213
  The backstop for `/shepherd`, `/plan`, and `/fix` events, run on `gap: true`, on a failed wait, and
210
214
  each full sweep. A mechanical-tier subagent per repository lists those comments on issues and PRs
211
- posted since `lastSweepAt` by the configured `trustedLogins` (never trust `authorAssociation`),
212
- paginating fully, and keeps those with no `eyes` reaction from the loop and no `shepherds` entry
213
- for the PR. This covers commands missed while the loop was down. The loop handles each as the
215
+ posted since `commandsThrough` (falling back to `lastSweepAt` while it is unset) by the configured
216
+ `trustedLogins` (never trust `authorAssociation`), paginating fully, and keeps those with no `eyes`
217
+ reaction from the loop and no `shepherds` entry for the PR. This covers commands missed while the
218
+ loop was down. Set `commandsThrough` to the sweep start (`state.py set commandsThrough --json
219
+ '"<ISO time>"'`) only after G2 succeeds for every repository; never on a skip, a failure, or
220
+ `--dry-run`. Never list from `lastSweepAt` once `commandsThrough` is set: it advances even when
221
+ preflight skipped G2, so commands posted in that gap would be missed. `lastSweepAt` stays the
222
+ pacing timestamp only. The loop handles each as the
214
223
  [Comment commands](../triage-loop/SKILL.md#comment-commands) section describes, including the
215
224
  acknowledgement.
216
225
 
@@ -248,8 +257,12 @@ in each selected repository.
248
257
  ## Phase H - Report and escalate
249
258
 
250
259
  Before exiting, keep the schedule alive (see triage-loop
251
- [Step 2](../triage-loop/SKILL.md#step-2---schedule-and-event-wait)). Hosts may expire recurring
252
- jobs, such as session-only crons that auto-expire after some days:
260
+ [Step 2](../triage-loop/SKILL.md#step-2---schedule-and-event-wait)), but only inside a standing
261
+ loop: the pass was started by triage-loop (its fallback cron, a wakeup, or its own event handling)
262
+ and the state file's `schedule` field is set. A standalone pass, which the user's request grants
263
+ for that one pass, never creates, replaces, or deletes a recurring job; it skips the steps below
264
+ and says so in its summary. Registering the first job belongs to triage-loop Step 2. Hosts may
265
+ expire recurring jobs, such as session-only crons that auto-expire after some days:
253
266
 
254
267
  1. List the loop's recurring jobs.
255
268
  2. If the fallback sweep job is missing, or its expiry falls within the next fallback interval plus