@bbcsoftwarefactory/cli 0.1.1 → 1.1.3

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 (155) hide show
  1. package/dist/audit-ledger.d.ts +2 -0
  2. package/dist/audit-ledger.js +71 -0
  3. package/dist/bbc-install.d.ts +2 -0
  4. package/dist/bbc-install.js +1278 -0
  5. package/dist/bbc.js +87 -3
  6. package/dist/bundle/commands/daily/SKILL.md +112 -0
  7. package/dist/bundle/commands/daily/adapters/command.md +17 -0
  8. package/dist/bundle/commands/daily/adapters/gemini.toml +17 -0
  9. package/dist/bundle/commands/issue-clean-and-close/SKILL.md +85 -0
  10. package/dist/bundle/commands/issue-clean-and-close/adapters/command.md +17 -0
  11. package/dist/bundle/commands/issue-clean-and-close/adapters/gemini.toml +17 -0
  12. package/dist/bundle/commands/issue-clean-and-close/references/policy.md +87 -0
  13. package/dist/bundle/commands/recap/SKILL.md +84 -0
  14. package/dist/bundle/commands/recap/adapters/command.md +17 -0
  15. package/dist/bundle/commands/recap/adapters/gemini.toml +17 -0
  16. package/dist/bundle/installer/clients.json +103 -0
  17. package/dist/bundle/skills/code-quality-gate/SKILL.md +58 -0
  18. package/dist/bundle/skills/code-quality-gate/references/gate-bigo.md +31 -0
  19. package/dist/bundle/skills/code-quality-gate/references/gate-earlyreturn.md +73 -0
  20. package/dist/bundle/skills/code-quality-gate/references/gate-typesafe.md +32 -0
  21. package/dist/bundle/skills/code-quality-gate/references/output-schema.yml +40 -0
  22. package/dist/bundle/skills/delivery-coordinator/SKILL.md +80 -0
  23. package/dist/bundle/skills/delivery-coordinator/references/hud-output.md +55 -0
  24. package/dist/bundle/skills/delivery-coordinator/references/intake.md +86 -0
  25. package/dist/bundle/skills/delivery-coordinator/references/issue-claim.md +143 -0
  26. package/dist/bundle/skills/delivery-coordinator/references/issue-dedup.md +38 -0
  27. package/dist/bundle/skills/delivery-coordinator/references/sleuth-regression-exercise.md +60 -0
  28. package/dist/bundle/skills/delivery-coordinator/references/visual-reference.md +45 -0
  29. package/dist/bundle/skills/delivery-coordinator/references/worktree-isolation.md +19 -0
  30. package/dist/bundle/skills/documentation-steward/SKILL.md +43 -0
  31. package/dist/bundle/skills/documentation-steward/references/discovery.md +17 -0
  32. package/dist/bundle/skills/documentation-steward/references/handoff.md +15 -0
  33. package/dist/bundle/skills/greptile-review-loop/SKILL.md +56 -0
  34. package/dist/bundle/skills/greptile-review-loop/references/review-protocol.md +37 -0
  35. package/dist/bundle/skills/issue-reviewer/SKILL.md +84 -0
  36. package/dist/bundle/skills/issue-reviewer/references/review-format.md +100 -0
  37. package/dist/bundle/skills/issue-reviewer/references/triage.md +105 -0
  38. package/dist/bundle/skills/question-gate/SKILL.md +64 -0
  39. package/dist/bundle/skills/question-gate/references/client-hooks.md +111 -0
  40. package/dist/bundle/skills/question-gate/references/diagram-routing.md +58 -0
  41. package/dist/bundle/skills/question-gate/tests/fixtures/question-corpus.json +481 -0
  42. package/dist/bundle/skills/regression-testing/SKILL.md +49 -0
  43. package/dist/bundle/skills/regression-testing/references/evidence-record.md +35 -0
  44. package/dist/bundle/skills/requirements-spec/SKILL.md +59 -0
  45. package/dist/bundle/skills/risk-scout/SKILL.md +53 -0
  46. package/dist/bundle/skills/risk-scout/references/risk-matrix.md +49 -0
  47. package/dist/bundle/skills/skill-clean-architecture/SKILL.md +53 -0
  48. package/dist/bundle/skills/skill-clean-architecture/references/layer-rules.md +22 -0
  49. package/dist/bundle/skills/skill-clean-architecture/references/source-headers.md +30 -0
  50. package/dist/bundle/skills/skill-clean-architecture/tests/fixtures/bigo/bad-utf8.js +1 -0
  51. package/dist/bundle/skills/skill-clean-architecture/tests/fixtures/bigo/edge-crlf.ts +6 -0
  52. package/dist/bundle/skills/skill-clean-architecture/tests/fixtures/bigo/edge-mixed.ts +15 -0
  53. package/dist/bundle/skills/skill-clean-architecture/tests/fixtures/bigo/empty.js +0 -0
  54. package/dist/bundle/skills/skill-clean-architecture/tests/fixtures/bigo/no-newline.js +1 -0
  55. package/dist/bundle/skills/skill-clean-architecture/tests/fixtures/bigo.expected.yml +95 -0
  56. package/dist/bundle/skills/tool-depot/SKILL.md +47 -0
  57. package/dist/bundle/skills/tool-depot/references/checkout.md +29 -0
  58. package/dist/bundle/skills/tool-depot/references/loki-read.md +41 -0
  59. package/dist/bundle/skills/tool-depot/references/readonly-access.md +84 -0
  60. package/dist/bundle/skills/tool-depot/references/tool-catalog.json +47 -0
  61. package/dist/bundle/skills/tool-depot/scripts/loki-runtime-logs.py +305 -0
  62. package/dist/bundle/skills/tool-depot/tests/loki-runtime-logs.test.sh +101 -0
  63. package/dist/bundle/skills/watcher-observability/SKILL.md +72 -0
  64. package/dist/bundle/skills/watcher-observability/references/batch-protocol.md +44 -0
  65. package/dist/bundle/skills/watcher-observability/references/configuration.md +31 -0
  66. package/dist/bundle/skills/watcher-observability/references/error-scan.md +102 -0
  67. package/dist/bundle/skills/watcher-observability/references/live-protocol.md +49 -0
  68. package/dist/bundle/skills/watcher-observability/references/server-account.md +72 -0
  69. package/dist/bundle/skills/watcher-observability/server/watcher-gate.sh +51 -0
  70. package/dist/bundle/skills/watcher-observability/tests/watcher-gate.test.sh +113 -0
  71. package/dist/bundle/skills/watcher-observability/watcher.json +1 -0
  72. package/dist/bundle/skills/workflow-auditor/SKILL.md +53 -0
  73. package/dist/bundle/skills/workflow-auditor/references/audit-protocol.md +49 -0
  74. package/dist/bundle/skills/workflow-auditor/references/ledger.md +122 -0
  75. package/dist/change-lane/classification.js +3 -1
  76. package/dist/check-issue-claim.d.ts +2 -0
  77. package/dist/check-issue-claim.js +146 -0
  78. package/dist/check-worktree-guard.d.ts +2 -0
  79. package/dist/check-worktree-guard.js +114 -0
  80. package/dist/error-scan.d.ts +3 -0
  81. package/dist/error-scan.js +216 -0
  82. package/dist/export-public.d.ts +9 -0
  83. package/dist/export-public.js +274 -0
  84. package/dist/fetch-issue-attachments.d.ts +22 -0
  85. package/dist/fetch-issue-attachments.js +325 -0
  86. package/dist/issue-claim/evaluation.d.ts +66 -0
  87. package/dist/issue-claim/evaluation.js +259 -0
  88. package/dist/issue-claim/loaders.d.ts +5 -0
  89. package/dist/issue-claim/loaders.js +116 -0
  90. package/dist/list-zed-commands.d.ts +7 -0
  91. package/dist/list-zed-commands.js +288 -0
  92. package/dist/plan-issue-triage.d.ts +3 -0
  93. package/dist/plan-issue-triage.js +404 -0
  94. package/dist/question-gate/ledger.d.ts +5 -0
  95. package/dist/question-gate/ledger.js +115 -0
  96. package/dist/question-gate/rules.d.ts +40 -0
  97. package/dist/question-gate/rules.js +483 -0
  98. package/dist/recap/board.d.ts +5 -0
  99. package/dist/recap/board.js +384 -0
  100. package/dist/recap/git-and-github.d.ts +11 -0
  101. package/dist/recap/git-and-github.js +620 -0
  102. package/dist/recap/report-and-hud.d.ts +2 -0
  103. package/dist/recap/report-and-hud.js +294 -0
  104. package/dist/recap/time-and-refs.d.ts +27 -0
  105. package/dist/recap/time-and-refs.js +148 -0
  106. package/dist/recap.d.ts +2 -0
  107. package/dist/recap.js +217 -0
  108. package/dist/render-workflow.js +12 -14
  109. package/dist/resolve-containers.d.ts +2 -0
  110. package/dist/resolve-containers.js +96 -0
  111. package/dist/review-loop.d.ts +7 -0
  112. package/dist/review-loop.js +622 -0
  113. package/dist/save-counts.d.ts +2 -0
  114. package/dist/save-counts.js +191 -0
  115. package/dist/summarize-logs.d.ts +2 -0
  116. package/dist/summarize-logs.js +41 -0
  117. package/dist/sweep-github.d.ts +10 -0
  118. package/dist/sweep-github.js +453 -0
  119. package/dist/sweep-issues.d.ts +56 -0
  120. package/dist/sweep-issues.js +650 -0
  121. package/dist/sweep.d.ts +2 -0
  122. package/dist/sweep.js +301 -0
  123. package/dist/triage-question.d.ts +2 -0
  124. package/dist/triage-question.js +189 -0
  125. package/dist/validate-skills.d.ts +2 -0
  126. package/dist/validate-skills.js +48 -0
  127. package/dist/watch-live.d.ts +7 -0
  128. package/dist/watch-live.js +83 -0
  129. package/dist/watcher/config.d.ts +11 -0
  130. package/dist/watcher/config.js +265 -0
  131. package/dist/watcher/live-classifier.d.ts +52 -0
  132. package/dist/watcher/live-classifier.js +510 -0
  133. package/dist/watcher/safe-fs.d.ts +9 -0
  134. package/dist/watcher/safe-fs.js +159 -0
  135. package/dist/watcher/stream.d.ts +27 -0
  136. package/dist/watcher/stream.js +340 -0
  137. package/dist/watcher/summarizer.d.ts +19 -0
  138. package/dist/watcher/summarizer.js +121 -0
  139. package/dist/wave3/process.d.ts +14 -0
  140. package/dist/wave3/process.js +84 -0
  141. package/dist/wave4/process.d.ts +14 -0
  142. package/dist/wave4/process.js +128 -0
  143. package/dist/workflow/render.d.ts +1 -1
  144. package/dist/workflow/render.js +1 -1
  145. package/dist/workflow-auditor/audit.d.ts +27 -0
  146. package/dist/workflow-auditor/audit.js +583 -0
  147. package/dist/workflow-auditor/ledger-io.d.ts +5 -0
  148. package/dist/workflow-auditor/ledger-io.js +99 -0
  149. package/dist/workflow-auditor/skills-validator.d.ts +10 -0
  150. package/dist/workflow-auditor/skills-validator.js +533 -0
  151. package/dist/worktree-guard/evaluation.d.ts +19 -0
  152. package/dist/worktree-guard/evaluation.js +84 -0
  153. package/dist/worktree-guard/git.d.ts +3 -0
  154. package/dist/worktree-guard/git.js +61 -0
  155. package/package.json +32 -33
@@ -0,0 +1,122 @@
1
+ # Delivery ledger
2
+
3
+ The delivery ledger is the record of one delivery: which stages ran, in what order, with what evidence, who authorized what, and every covered external tool operation with its Tool Depot decision. `delivery-coordinator` keeps it; `workflow-auditor` reads it.
4
+
5
+ ## Where it lives
6
+
7
+ One ledger per worktree, inside that worktree's private Git directory, so it is never committed or pushed:
8
+
9
+ ```bash
10
+ ledger=$(git rev-parse --git-path bbc-delivery-ledger.json)
11
+ ```
12
+
13
+ Run this from the delivery worktree. Removing the worktree removes the ledger, so hand over the audit verdict, not the file. Never put secrets, tokens, customer data, raw logs, or full reports in it; record references (issue or PR IDs, commands, SHAs, rule names) instead.
14
+
15
+ ## Format (version 1)
16
+
17
+ ```json
18
+ {
19
+ "version": 1,
20
+ "task": "C1: status filter shows only failed jobs",
21
+ "kind": "change",
22
+ "issue": "example/repo#12",
23
+ "worktree": {"path": "/work/example-status-filter", "branch": "feat/12-status-filter", "base_sha": "<default-branch SHA>"},
24
+ "authorizations": [
25
+ {"id": "AUTH-1", "by": "person", "role": "Tech Lead", "covers": ["implement", "commit_pr"]}
26
+ ],
27
+ "stages": [
28
+ {"stage": "specify", "status": "reused", "actor": "requirements-spec", "reason": "Issue example#12 lists C1.", "evidence": {"issue": "example/repo#12", "issue_action": "linked_and_commented", "project_status": "Trabajando"}},
29
+ {"stage": "claim", "status": "done", "actor": "delivery-coordinator", "authorization": "AUTH-1", "evidence": {"issue": "example/repo#12", "claimant": "ana", "check": "free", "verify": "claimed-by-you"}},
30
+ {"stage": "reproduce", "status": "done", "actor": "regression-testing", "evidence": {"command": "npm test -- status-filter", "result": "fail"}},
31
+ {"stage": "implement", "status": "done", "actor": "skill-clean-architecture", "authorization": "AUTH-1"},
32
+ {"stage": "verify", "status": "done", "actor": "regression-testing", "evidence": {"command": "npm test -- status-filter", "result": "pass"}},
33
+ {"stage": "quality", "status": "done", "actor": "code-quality-gate", "evidence": {"typesafe": "pass", "earlyreturn": "pass", "bigo": "pass"}},
34
+ {"stage": "commit_pr", "status": "done", "actor": "host", "authorization": "AUTH-1", "evidence": {"pr": "example/repo#13", "head_sha": "<PR head SHA>", "issue": "example/repo#12", "issue_linked": true}},
35
+ {"stage": "review", "status": "done", "actor": "greptile-review-loop", "evidence": {"head_sha": "<PR head SHA>", "score": "5/5"}}
36
+ ],
37
+ "tool_requests": [
38
+ {"id": "TD-1", "requester": "delivery-coordinator", "tool": "github-read", "purpose": "read-approved-issue-or-pr",
39
+ "target": "example/repo#12", "operation": "read issue", "disposition": "eligible"},
40
+ {"id": "TD-2", "requester": "delivery-coordinator", "tool": "github-read", "purpose": "check-issue-claim",
41
+ "target": "example/repo#12", "operation": "read assignees, labels, open PRs, feat/12-* branches", "disposition": "eligible"},
42
+ {"id": "TD-3", "requester": "delivery-coordinator", "tool": "github-write", "purpose": "claim-approved-issue",
43
+ "target": "example/repo#12", "operation": "assign ana, add status:in-progress", "disposition": "eligible", "authorization": "AUTH-1"}
44
+ ],
45
+ "tool_uses": [
46
+ {"request": "TD-1", "tool": "github-read", "target": "example/repo#12"},
47
+ {"request": "TD-2", "tool": "github-read", "target": "example/repo#12"},
48
+ {"request": "TD-3", "tool": "github-write", "target": "example/repo#12"}
49
+ ]
50
+ }
51
+ ```
52
+
53
+ | Field | Rule |
54
+ |---|---|
55
+ | `kind` | `change` (edits repository files), `issue-only`, or `read-only`. Only `change` needs a worktree and the write stages. |
56
+ | `lane` | Optional risk lane from `bbc classify-change-lane`: `trivial`, `standard` (default), or `high-risk`. |
57
+ | `issue` | Optional canonical issue this delivery implements (`owner/repo#n`). With it, or with `commit_pr.evidence.issue`, change work needs a `claim` stage ([claim the issue](../../delivery-coordinator/references/issue-claim.md)). |
58
+ | `authorizations` | One entry per human decision. `by` is always `person`; `covers` lists the stages it authorizes. Agents never add an entry on a person's behalf. |
59
+ | `stages` | Chronological. Append a new entry each time a stage runs again (a fix loop repeats `implement` through `review`). |
60
+ | `status` | `done`, `reused` (equivalent evidence; `reason` names its source), or `gap` (`reason` required). |
61
+ | `tool_requests` | Every Tool Depot request with its returned `disposition` (`eligible`, `needs-clarification`, `needs-approval`, `denied`, `unavailable`). Record non-eligible decisions too. |
62
+ | `tool_uses` | Every covered SSH, public web, or GitHub operation actually performed, citing the request it relied on. |
63
+ | `visual` | Required on each `tool_uses` entry for `publish-approved-issue`, `update-approved-issue`, or `comment-approved-issue`: the embedded `https://` image URL, or `{"gap": "<reason>"}`. See the [visual reference rule](../../delivery-coordinator/references/visual-reference.md). |
64
+
65
+ ## Stages, in diagram order
66
+
67
+ | `stage` | Diagram step | Gap allowed? |
68
+ |---|---|---|
69
+ | `observe` | Optional Sleuth report | Yes |
70
+ | `specify` | Requirements & Specification | No |
71
+ | `claim` | Claim the issue (only with a canonical issue) | Yes: the claimant cannot claim |
72
+ | `reproduce` | Regression Testing · Before (RED) | Yes, with `gap_type` |
73
+ | `implement` | Clean Architecture | No |
74
+ | `verify` | Regression Testing · After (GREEN) | Only after a `no-runnable-test` gap |
75
+ | `quality` | Code Quality Gate | No |
76
+ | `docs` | Documentation Steward | Yes |
77
+ | `commit_pr` | Commit & PR · CI (host) | No |
78
+ | `review` | Greptile Review Loop | Yes: Greptile unavailable or budget spent |
79
+ | `residual_risk` | Risk Scout after PR | Yes |
80
+ | `code_owner` | Human review & merge (`actor: person`) | No |
81
+ | `release_owner` | Deploy decision (`actor: person`) | No |
82
+
83
+ A reproduction gap needs `gap_type`: `not-reproducible` (the workflow stops before implementation) or `no-runnable-test` (verify proportionately without claiming RED/GREEN).
84
+
85
+ ## Rules checked by the script
86
+
87
+ | Rule | Violation |
88
+ |---|---|
89
+ | `W1` | Change work without a worktree path, a `feat/<task>` branch, or a default-branch base SHA. |
90
+ | `K1` | Issue-only or read-only work that includes write stages. |
91
+ | `S1` | A required stage for change work is missing: `specify`, `reproduce`, `implement`, `verify`, `quality`, `commit_pr`, `review`. |
92
+ | `S2` | A stage runs before an earlier diagram stage; loops may only return to `reproduce` or `implement`. |
93
+ | `S3` | Implementation started before `specify` and `reproduce`. |
94
+ | `S4` | `verify`, `quality`, `commit_pr`, or `review` was not rerun after the last implementation. |
95
+ | `S5` | A `reused` or `gap` entry without a reason, or a gap where the diagram allows none. |
96
+ | `E1` | RED without a command and a failing result, a reproduction gap without `gap_type`, or implementation after `not-reproducible`. |
97
+ | `E2` | The last verification lacks a command and a passing result, or is a gap without a `no-runnable-test` reproduction gap. |
98
+ | `Q1` | The last quality gate did not pass all three checks. |
99
+ | `R1` | Commit & PR lacks the PR or head SHA, the review lacks a score, or the Greptile review is not for the current PR head. |
100
+ | `R2` | Commit & PR cites a canonical `issue`, but `issue_linked: true` or the matching `comment-approved-issue` Tool Depot use is missing. |
101
+ | `V1` | An issue publish, update, or comment use without a `visual` image URL or a stated visual gap. |
102
+ | `D1` | A `publish-approved-issue` or `reopen-approved-issue` use with no earlier eligible `check-duplicate-issues` use on the same repository ([search before filing](../../delivery-coordinator/references/issue-dedup.md)). |
103
+ | `I1` | A `triage-approved-issue` use with no earlier eligible `check-issue-triage` use on the same issue ([triage](../../issue-reviewer/references/triage.md)). |
104
+ | `I2` | A `triage-approved-issue` use with no later `comment-approved-issue` use on the same issue stating the assignment, labels, and priority. |
105
+ | `C1` | Change work with a canonical issue and no `claim` stage. |
106
+ | `C2` | The claim names another issue or no claimant, its `check` is not `free` / `claimed-by-you` without a person's handover covering `claim`, or its `verify` is not `claimed-by-you`. |
107
+ | `C3` | No eligible `check-issue-claim` use on the issue, no `claim-approved-issue` use when the issue was not already the claimant's, or the claim written before the read. |
108
+ | `C4` | With a claim, the worktree branch is not `feat/<n>-<slug>` for the canonical issue. |
109
+ | `A1` | `claim`, `implement`, or `commit_pr` cites no authorization from a person, or one that does not cover it (`implement` also covers `claim`). |
110
+ | `A2` | An authorization not granted by a person. |
111
+ | `H1` | `code_owner` or `release_owner` recorded with an agent as actor. |
112
+ | `H2` | A deployment decision without a prior Code Owner review. |
113
+ | `L1` | A `high-risk` lane delivery missing a completed `residual_risk` stage (`risk-scout`). |
114
+ | `T1` | A covered tool used without a Tool Depot request. |
115
+ | `T2` | A tool used although the Depot did not return `eligible`. |
116
+ | `T3` | An eligible request whose tool or purpose is not in the catalog. |
117
+ | `T4` | A use whose tool or target differs from its eligible request. |
118
+ | `T5` | A GitHub write request without a person's authorization. |
119
+ | `T6` | A Tool Depot request missing its ID, requester, tool, purpose, target, operation, or disposition. |
120
+ | `T7` | With `--server-log`: a command the server's `watcher-gate` allowed (`allowed:` in syslog) with no matching `ssh` use in `tool_uses`. Each recorded use covers one command whose container or discovery prefix it names. Commands the gate denied never ran and are ignored. |
121
+
122
+ Gaps (`G1` for stages, `G2` for an issue write with a stated visual gap) are not violations. They go to the Code Owner with the PR.
@@ -21,6 +21,8 @@ const riskPatterns = [
21
21
  /(^|\/)skills\/question-gate\/scripts\/triage-question\.py$/i,
22
22
  /(^|\/)skills\/delivery-coordinator\/scripts\/check-worktree-guard\.py$/i,
23
23
  /(^|\/)tools\/export-public\.py$/i,
24
+ /(^|\/)packages\/cli\/src\/(?:audit-ledger|triage-question|check-worktree-guard|export-public)\.ts$/i,
25
+ /(^|\/)packages\/cli\/src\/(?:workflow-auditor|question-gate|worktree-guard)\//i,
24
26
  /(^|\/)\.github\/workflows\//i,
25
27
  /(^|\/)(?:auth|oauth|jwt|session|token|crypto|secret|permission|rbac|security|migration|migrations|prisma|schema|deploy|infra)(?:\/|[._-]|$)/i,
26
28
  /\.sql$/i,
@@ -30,7 +32,7 @@ const plans = {
30
32
  test_mode: 'proportional',
31
33
  required_stages: ['specify', 'implement', 'quality', 'docs', 'commit_pr', 'review'],
32
34
  skipped_stages: ['requirements-spec-full-prd', 'risk-scout', 'reproduce-runtime-red', 'verify-runtime-green'],
33
- extra_checks: ['documentation-steward', 'validate-skills.py'],
35
+ extra_checks: ['documentation-steward', 'bbc validate-skills'],
34
36
  },
35
37
  standard: {
36
38
  test_mode: 'tdd',
@@ -0,0 +1,2 @@
1
+ export declare const checkIssueClaimUsage = "bbc check-issue-claim --phase check|verify|release|status --issue-json <file> [options]";
2
+ export declare function checkIssueClaim(argv: readonly string[]): number;
@@ -0,0 +1,146 @@
1
+ /**
2
+ * LAYER: Interface
3
+ * Contains: CLI argument parsing and JSON report emission for check-issue-claim.
4
+ * Rules: Match check-issue-claim.py stdout/exit codes byte-for-byte.
5
+ * BigO: O(n) score:3
6
+ * keywords: [IssueClaimCli, ClaimArguments]
7
+ * GOAL: Run offline issue-claim checks (CL1-CL12) from the bbc CLI.
8
+ */
9
+ import { evaluateClaim, parseIsoTime, STOP_VERDICTS, UnusableClaimError, } from "./issue-claim/evaluation.js";
10
+ import { loadBranches, loadEvents, loadIssue, loadPulls } from "./issue-claim/loaders.js";
11
+ export const checkIssueClaimUsage = 'bbc check-issue-claim --phase check|verify|release|status --issue-json <file> [options]';
12
+ const PHASES = new Set(['check', 'verify', 'release', 'status']);
13
+ const DEFAULT_LABEL = 'status:in-progress';
14
+ const DEFAULT_STALE_DAYS = 7;
15
+ const HELP = 'Usage: bbc check-issue-claim --phase check|verify|release|status\n' +
16
+ ' --issue-json <file> gh api repos/<o>/<r>/issues/<n> (or gh issue view <n> --json ...)\n' +
17
+ ' --pulls-json <file> gh api --paginate --slurp "repos/<o>/<r>/pulls?state=open&per_page=100"\n' +
18
+ ' --branches <file> git ls-remote --heads <remote> "feat/<n>-*"\n' +
19
+ ' --events-json <file> gh api --paginate --slurp repos/<o>/<r>/issues/<n>/events (verify)\n' +
20
+ ' --claimant <login> GitHub login of the person (check, verify, release)\n' +
21
+ ' --branch <feat/<n>-<slug>> the branch this delivery will use (check, verify)\n' +
22
+ ' [--repo <owner/repo>] [--label status:in-progress] [--stale-days 7] [--now <ISO-8601>]\n' +
23
+ 'Exit 0: proceed (free, claimed-by-you, released, claimed, unclaimed); 1: stop; 2: unusable.';
24
+ const FLAG_KEYS = {
25
+ '--phase': 'phase',
26
+ '--issue-json': 'issue',
27
+ '--pulls-json': 'pulls',
28
+ '--branches': 'branches',
29
+ '--events-json': 'events',
30
+ '--claimant': 'claimant',
31
+ '--branch': 'branch',
32
+ '--repo': 'repo',
33
+ '--label': 'label',
34
+ '--stale-days': 'stale_days',
35
+ '--now': 'now',
36
+ };
37
+ function writeJsonOut(value) {
38
+ const escaped = JSON.stringify(value, null, 2).replace(/[\u007f-\uffff]/g, (char) => `\\u${char.charCodeAt(0).toString(16).padStart(4, '0')}`);
39
+ process.stdout.write(`${escaped}\n`);
40
+ }
41
+ function parseArgs(argv) {
42
+ const raw = {
43
+ phase: null,
44
+ issue: null,
45
+ pulls: null,
46
+ branches: null,
47
+ events: null,
48
+ claimant: null,
49
+ branch: null,
50
+ repo: null,
51
+ label: DEFAULT_LABEL,
52
+ stale_days: String(DEFAULT_STALE_DAYS),
53
+ now: null,
54
+ };
55
+ for (let i = 0; i < argv.length; i++) {
56
+ const arg = argv[i] ?? '';
57
+ if (arg === '-h' || arg === '--help')
58
+ return null;
59
+ const key = FLAG_KEYS[arg];
60
+ const value = argv[i + 1];
61
+ if (key === undefined || value === undefined) {
62
+ throw new UnusableClaimError(`Unexpected argument ${arg}; see --help.`);
63
+ }
64
+ raw[key] = value;
65
+ i++;
66
+ }
67
+ const phase = raw.phase ?? null;
68
+ if (phase === null || !PHASES.has(phase)) {
69
+ throw new UnusableClaimError('--phase must be one of: check, verify, release, status.');
70
+ }
71
+ const issuePath = raw.issue ?? null;
72
+ if (issuePath === null) {
73
+ throw new UnusableClaimError('--issue-json is required.');
74
+ }
75
+ const pullsPath = raw.pulls ?? null;
76
+ const branchesPath = raw.branches ?? null;
77
+ if (phase !== 'release' && (pullsPath === null || branchesPath === null)) {
78
+ throw new UnusableClaimError(`--pulls-json and --branches are required for ${phase}.`);
79
+ }
80
+ const claimant = raw.claimant ?? null;
81
+ if (phase !== 'status' && !claimant) {
82
+ throw new UnusableClaimError(`--claimant is required for ${phase}.`);
83
+ }
84
+ const branch = raw.branch ?? null;
85
+ if ((phase === 'check' || phase === 'verify') && !branch) {
86
+ throw new UnusableClaimError(`--branch is required for ${phase}.`);
87
+ }
88
+ const staleRaw = raw.stale_days ?? '';
89
+ if (!/^-?\d+$/.test(staleRaw)) {
90
+ throw new UnusableClaimError('--stale-days must be an integer.');
91
+ }
92
+ const staleDays = Number.parseInt(staleRaw, 10);
93
+ const now = raw.now ? parseIsoTime(raw.now) : Date.now();
94
+ if (now === null) {
95
+ throw new UnusableClaimError('--now must be an ISO-8601 time.');
96
+ }
97
+ return {
98
+ issuePath,
99
+ pullsPath,
100
+ branchesPath,
101
+ eventsPath: raw.events ?? null,
102
+ options: {
103
+ phase: phase,
104
+ claimant,
105
+ branch,
106
+ repo: raw.repo ?? null,
107
+ label: raw.label ?? DEFAULT_LABEL,
108
+ stale_days: staleDays,
109
+ now,
110
+ },
111
+ };
112
+ }
113
+ export function checkIssueClaim(argv) {
114
+ try {
115
+ const parsed = parseArgs(argv);
116
+ if (parsed === null) {
117
+ process.stdout.write(`${HELP}\n`);
118
+ return 0;
119
+ }
120
+ const issue = loadIssue(parsed.issuePath);
121
+ const pulls = parsed.pullsPath ? loadPulls(parsed.pullsPath) : [];
122
+ const branches = parsed.branchesPath ? loadBranches(parsed.branchesPath) : [];
123
+ const events = parsed.eventsPath ? loadEvents(parsed.eventsPath) : null;
124
+ const { verdict, findings, holders } = evaluateClaim(issue, pulls, branches, events, parsed.options);
125
+ const proceed = !STOP_VERDICTS.has(verdict);
126
+ writeJsonOut({
127
+ verdict,
128
+ proceed,
129
+ phase: parsed.options.phase,
130
+ issue: issue.number,
131
+ claimant: parsed.options.claimant,
132
+ holders,
133
+ findings,
134
+ });
135
+ return proceed ? 0 : 1;
136
+ }
137
+ catch (error) {
138
+ const detail = error instanceof UnusableClaimError ? error.message : String(error);
139
+ writeJsonOut({
140
+ verdict: 'unusable',
141
+ proceed: false,
142
+ findings: [{ rule: 'CL1', verdict: 'unusable', detail }],
143
+ });
144
+ return 2;
145
+ }
146
+ }
@@ -0,0 +1,2 @@
1
+ export declare const checkWorktreeGuardUsage = "bbc check-worktree-guard [--path <dir>] [--target-path <file>] [--stdin --format json|claude-hook|cursor-hook|codex-hook]";
2
+ export declare function checkWorktreeGuard(argv: readonly string[]): number;
@@ -0,0 +1,114 @@
1
+ /**
2
+ * LAYER: Interface
3
+ * Contains: CLI argument parsing, stdin reading, and JSON formatting for check-worktree-guard.
4
+ * Rules: Match check-worktree-guard.py stdout/stderr/exit codes byte-for-byte.
5
+ * BigO: O(n) score:3
6
+ * keywords: [WorktreeGuardCli, HookStdin]
7
+ * GOAL: Enforce linked feat/<task> worktree isolation from the bbc CLI.
8
+ */
9
+ import { readFileSync } from 'node:fs';
10
+ import { EOL } from 'node:os';
11
+ import { evaluateGitInfo, extractPayloadPath, formatHookOutput, } from "./worktree-guard/evaluation.js";
12
+ import { findExistingDirectory, probeGitWorktree } from "./worktree-guard/git.js";
13
+ export const checkWorktreeGuardUsage = 'bbc check-worktree-guard [--path <dir>] [--target-path <file>] [--stdin --format json|claude-hook|cursor-hook|codex-hook]';
14
+ const HELP = 'Usage: bbc check-worktree-guard [--path <dir>] [--target-path <file>] [--stdin --format json|claude-hook|cursor-hook|codex-hook]\n' +
15
+ 'Exit 0: allowed linked feat/<task> worktree; 1: blocked (primary/non-feat); 2: unusable.';
16
+ const VALID_FORMATS = new Set(['json', 'claude-hook', 'cursor-hook', 'codex-hook']);
17
+ function escapeAscii(json) {
18
+ return json.replace(/[\u007f-\uffff]/g, (char) => `\\u${char.charCodeAt(0).toString(16).padStart(4, '0')}`);
19
+ }
20
+ function pythonJsonPretty(value) {
21
+ return escapeAscii(JSON.stringify(value, null, 2));
22
+ }
23
+ function pythonJsonCompact(value) {
24
+ if (value === null || typeof value !== 'object')
25
+ return escapeAscii(JSON.stringify(value));
26
+ if (Array.isArray(value))
27
+ return `[${value.map(pythonJsonCompact).join(', ')}]`;
28
+ const entries = Object.entries(value);
29
+ return `{${entries.map(([key, val]) => `${escapeAscii(JSON.stringify(key))}: ${pythonJsonCompact(val)}`).join(', ')}}`;
30
+ }
31
+ function writeOut(line) {
32
+ process.stdout.write(`${line}\n`);
33
+ }
34
+ function parseArgs(argv) {
35
+ let pathArg;
36
+ let targetPath;
37
+ let useStdin = false;
38
+ let format = 'json';
39
+ for (let i = 0; i < argv.length; i++) {
40
+ const arg = argv[i] ?? '';
41
+ if (arg === '-h' || arg === '--help')
42
+ return { kind: 'help' };
43
+ if (arg === '--stdin') {
44
+ useStdin = true;
45
+ continue;
46
+ }
47
+ if (arg === '--path' || arg === '--target-path' || arg === '--format') {
48
+ const value = argv[i + 1];
49
+ if (value === undefined || value === '')
50
+ return { kind: 'error', message: `error: ${arg} requires a value` };
51
+ if (arg === '--path')
52
+ pathArg = value;
53
+ else if (arg === '--target-path')
54
+ targetPath = value;
55
+ else {
56
+ if (!VALID_FORMATS.has(value))
57
+ return { kind: 'error', message: `error: invalid --format: ${value}` };
58
+ format = value;
59
+ }
60
+ i++;
61
+ continue;
62
+ }
63
+ return { kind: 'error', message: `error: unknown option: ${arg}` };
64
+ }
65
+ return { kind: 'run', pathArg, targetPath, useStdin, format };
66
+ }
67
+ function evaluatePath(pathStr) {
68
+ const directory = findExistingDirectory(pathStr);
69
+ if (directory === undefined) {
70
+ return { report: { decision: 'unusable', reason: `Path does not exist: ${pathStr}` }, status: 2 };
71
+ }
72
+ const info = probeGitWorktree(directory);
73
+ if (info === undefined) {
74
+ return { report: { decision: 'unusable', reason: 'Target directory is not inside a Git worktree.' }, status: 2 };
75
+ }
76
+ return evaluateGitInfo(info);
77
+ }
78
+ export function checkWorktreeGuard(argv) {
79
+ const parsed = parseArgs(argv);
80
+ if (parsed.kind === 'help') {
81
+ writeOut(HELP);
82
+ return 0;
83
+ }
84
+ if (parsed.kind === 'error') {
85
+ process.stderr.write(`${parsed.message}${EOL}`);
86
+ return 1;
87
+ }
88
+ let resolvedTarget = parsed.targetPath || parsed.pathArg;
89
+ if (parsed.useStdin) {
90
+ const rawStdin = readFileSync(0, 'utf8').trim();
91
+ if (rawStdin !== '') {
92
+ let payload;
93
+ try {
94
+ payload = JSON.parse(rawStdin);
95
+ }
96
+ catch {
97
+ writeOut(pythonJsonCompact({ decision: 'unusable', reason: 'Invalid JSON on stdin.' }));
98
+ return 2;
99
+ }
100
+ const extracted = extractPayloadPath(payload);
101
+ if (extracted !== undefined && !parsed.targetPath)
102
+ resolvedTarget = extracted;
103
+ }
104
+ }
105
+ if (!resolvedTarget)
106
+ resolvedTarget = '.';
107
+ const { report, status } = evaluatePath(resolvedTarget);
108
+ if (parsed.format === 'json') {
109
+ writeOut(pythonJsonPretty(report));
110
+ return status;
111
+ }
112
+ writeOut(pythonJsonCompact(formatHookOutput(report, status, parsed.format)));
113
+ return 0;
114
+ }
@@ -0,0 +1,3 @@
1
+ export declare const errorScanUsage = "bbc error-scan [--project <uuid>] <ssh-alias> <exact-container> [minutes | --tail <lines>]";
2
+ export declare function digest(body: string, record?: Record<string, unknown> | null): string;
3
+ export declare function errorScan(argv: readonly string[]): Promise<number>;
@@ -0,0 +1,216 @@
1
+ /**
2
+ * LAYER: Interface
3
+ * Contains: CLI entry point and allowlisted digest builder for bbc error-scan.
4
+ * Rules: Match error-scan.py help, output, digest allowlist, and tmp_logs/scan/ save contract.
5
+ * BigO: O(n^2) score:1
6
+ * keywords: [ErrorScanCli, DigestAllowlist, BoundedScan]
7
+ * GOAL: Perform one bounded historical error scan and optionally save an allowlisted digest.
8
+ */
9
+ import { EOL } from 'node:os';
10
+ import { aliasPattern, ConfigError, CONTAINER_RE, resolveSshExecutable, SSH_OPTIONS, } from "./watcher/config.js";
11
+ import { CODES, EXCEPTIONS, jsonHit, jsonLevel, LEVELS, PATTERNS, PLAIN_LEVEL_RE, stripHeaders, } from "./watcher/live-classifier.js";
12
+ import { saveScanReport } from "./watcher/safe-fs.js";
13
+ import { runBoundedLineScan } from "./watcher/stream.js";
14
+ export const errorScanUsage = 'bbc error-scan [--project <uuid>] <ssh-alias> <exact-container> [minutes | --tail <lines>]';
15
+ const MAX_BYTES = 16 * 1024 * 1024;
16
+ const MAX_MINUTES = 120;
17
+ const MAX_TAIL = 50_000;
18
+ const MAX_ROWS = 40;
19
+ const DEADLINE_MS = 60_000;
20
+ const PROJECT_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
21
+ const EVENT_RE = /"event":"([^"]+)"/;
22
+ const HELP = 'Usage: bbc error-scan [--project <uuid>] <ssh-alias> <exact-container> [minutes | --tail <lines>]\n' +
23
+ 'Read one bounded window once (1-120 minutes, or 1-50000 lines) and report only warn/error signal.\n' +
24
+ '--project keeps only lines that contain that project uuid (any field name, any case).';
25
+ const DIGEST_WORDS = new Set([
26
+ 'error', 'errors', 'warn', 'warning', 'fatal', 'critical', 'failed', 'failure', 'fails', 'fail',
27
+ 'timeout', 'timed', 'out', 'refused', 'reset', 'closed', 'broken', 'pipe', 'connection',
28
+ 'connect', 'socket', 'retry', 'retrying', 'retries', 'unavailable', 'upstream', 'downstream',
29
+ 'denied', 'forbidden', 'unauthorized', 'auth', 'authentication', 'expired', 'invalid',
30
+ 'missing', 'not', 'found', 'exceeded', 'limit', 'rate', 'quota', 'crash', 'crashed', 'killed',
31
+ 'memory', 'disk', 'full', 'database', 'db', 'query', 'request', 'response', 'webhook', 'message',
32
+ 'send', 'sent', 'delivery', 'deliver', 'template', 'queue', 'job', 'worker', 'payment', 'charge',
33
+ 'handshake', 'tls', 'ssl', 'dns', 'lookup', 'parse', 'json', 'unexpected', 'token', 'status',
34
+ 'server', 'client', 'internal', 'gateway', 'bad', 'service', 'for', 'to', 'from', 'with', 'on',
35
+ 'in', 'of', 'the', 'a', 'an', 'is', 'was', 'while', 'after', 'during', 'cannot', 'could',
36
+ ]);
37
+ const DIGEST_EXACT = { ...CODES, ...EXCEPTIONS };
38
+ const DIGEST_MESSAGE_KEYS = ['msg', 'message', 'error', 'err'];
39
+ const DIGEST_TOKENS = 16;
40
+ const DIGEST_CHARS = 220;
41
+ const REDACTED = '[redacted]';
42
+ function writeOut(text) {
43
+ process.stdout.write(`${text.replaceAll('\n', EOL)}${EOL}`);
44
+ }
45
+ function writeErr(text) {
46
+ process.stderr.write(`${text.replaceAll('\n', EOL)}${EOL}`);
47
+ }
48
+ export function digest(body, record = null) {
49
+ let text = body;
50
+ if (record !== null) {
51
+ const key = DIGEST_MESSAGE_KEYS.find((k) => typeof record[k] === 'string');
52
+ text = key !== undefined ? record[key] : '';
53
+ }
54
+ const out = [];
55
+ for (const raw of text.trim().split(/\s+/).filter((t) => t !== '').slice(0, DIGEST_TOKENS)) {
56
+ const token = raw.replace(/^[.,;:()[\]{}"'!?]+|[.,;:()[\]{}"'!?]+$/g, '');
57
+ const exact = Object.hasOwn(DIGEST_EXACT, token) ? DIGEST_EXACT[token] : undefined;
58
+ const lowered = token.toLowerCase();
59
+ const word = exact ?? (DIGEST_WORDS.has(lowered) ? lowered : REDACTED);
60
+ if (word !== REDACTED || out.length === 0 || out.at(-1) !== REDACTED)
61
+ out.push(word);
62
+ }
63
+ return out.join(' ').slice(0, DIGEST_CHARS);
64
+ }
65
+ function classifyLine(line) {
66
+ const body = stripHeaders(line.trim());
67
+ let record = null;
68
+ const brace = body.indexOf('{');
69
+ if (brace >= 0 && body.trimEnd().endsWith('}')) {
70
+ try {
71
+ const parsed = JSON.parse(body.slice(brace));
72
+ if (typeof parsed === 'object' && parsed !== null && !Array.isArray(parsed)) {
73
+ record = parsed;
74
+ }
75
+ }
76
+ catch {
77
+ record = null;
78
+ }
79
+ }
80
+ let level = record !== null ? jsonLevel(record) : null;
81
+ let hit = record !== null ? jsonHit(record) : null;
82
+ if (level === null) {
83
+ const match = PLAIN_LEVEL_RE.exec(body);
84
+ if (match !== null)
85
+ level = LEVELS[(match[1] ?? match[2] ?? '').toLowerCase()] ?? null;
86
+ }
87
+ if (hit === null) {
88
+ const idx = PATTERNS.findIndex(([, regex]) => regex.test(body));
89
+ hit = idx === -1 ? null : idx;
90
+ }
91
+ return { level: level ?? (hit !== null ? 'error' : null), hit, body, record };
92
+ }
93
+ class Tally {
94
+ project;
95
+ filtered = 0;
96
+ counts = { error: 0, warn: 0, info: 0, debug: 0, unclassified: 0 };
97
+ hits = new Array(PATTERNS.length).fill(0);
98
+ events = {};
99
+ rows = [];
100
+ constructor(project) {
101
+ this.project = project;
102
+ }
103
+ feed(segment) {
104
+ const decoded = new TextDecoder('utf-8', { fatal: false }).decode(segment);
105
+ for (const raw of decoded.split(/\r\n|\n|\r/)) {
106
+ if (raw.trim() === '')
107
+ continue;
108
+ if (this.project !== null && !raw.toLowerCase().includes(this.project)) {
109
+ this.filtered += 1;
110
+ continue;
111
+ }
112
+ const { level, hit, body, record } = classifyLine(raw);
113
+ const bucket = level ?? 'unclassified';
114
+ this.counts[bucket] = (this.counts[bucket] ?? 0) + 1;
115
+ if (hit !== null)
116
+ this.hits[hit] = (this.hits[hit] ?? 0) + 1;
117
+ const event = EVENT_RE.exec(raw);
118
+ if (event !== null) {
119
+ const name = event[1];
120
+ this.events[name] = (this.events[name] ?? 0) + 1;
121
+ }
122
+ if ((level === 'error' || level === 'warn' || hit !== null) && this.rows.length < MAX_ROWS) {
123
+ this.rows.push({
124
+ level: level ?? 'signature',
125
+ signature: hit !== null ? PATTERNS[hit][0] : null,
126
+ digest: digest(body, record),
127
+ });
128
+ }
129
+ }
130
+ }
131
+ }
132
+ function parseSelector(args) {
133
+ if (args.length === 2)
134
+ return { kind: 'since', value: 15 };
135
+ if (args.length === 3 && /^\d+$/.test(args[2])) {
136
+ const minutes = Number.parseInt(args[2], 10);
137
+ if (minutes >= 1 && minutes <= MAX_MINUTES)
138
+ return { kind: 'since', value: minutes };
139
+ }
140
+ if (args.length === 4 && args[2] === '--tail' && /^\d+$/.test(args[3])) {
141
+ const tail = Number.parseInt(args[3], 10);
142
+ if (tail >= 1 && tail <= MAX_TAIL)
143
+ return { kind: 'tail', value: tail };
144
+ }
145
+ return null;
146
+ }
147
+ export async function errorScan(argv) {
148
+ let args = [...argv];
149
+ let project = null;
150
+ if (args[0] === '--project') {
151
+ if (args.length < 2 || !PROJECT_RE.test(args[1])) {
152
+ writeErr(HELP);
153
+ return 1;
154
+ }
155
+ project = args[1].toLowerCase();
156
+ args = args.slice(2);
157
+ }
158
+ if (args.length < 2 || args.length > 4) {
159
+ writeErr(HELP);
160
+ return 1;
161
+ }
162
+ let aliasOk;
163
+ try {
164
+ aliasOk = aliasPattern();
165
+ }
166
+ catch (error) {
167
+ if (error instanceof ConfigError) {
168
+ writeErr(error.message);
169
+ return 1;
170
+ }
171
+ throw error;
172
+ }
173
+ const [alias, container] = [args[0], args[1]];
174
+ const selector = parseSelector(args);
175
+ if (!aliasOk.test(alias) || !CONTAINER_RE.test(container) || selector === null) {
176
+ writeErr(HELP);
177
+ return 1;
178
+ }
179
+ const ssh = resolveSshExecutable();
180
+ if (ssh === null) {
181
+ writeErr('Watcher scan failed; no counts.');
182
+ return 1;
183
+ }
184
+ const flag = selector.kind === 'since' ? `--since=${selector.value}m` : `--tail=${selector.value}`;
185
+ const tally = new Tally(project);
186
+ let totalBytes = 0;
187
+ try {
188
+ const res = await runBoundedLineScan(ssh, [...SSH_OPTIONS, alias, 'docker', 'logs', flag, '--timestamps', '--', container], DEADLINE_MS, MAX_BYTES, (segment) => tally.feed(segment));
189
+ totalBytes = res.totalBytes;
190
+ }
191
+ catch (error) {
192
+ const msg = error instanceof Error ? error.message : 'Watcher scan failed; no counts.';
193
+ writeErr(msg);
194
+ return 1;
195
+ }
196
+ const total = Object.values(tally.counts).reduce((a, b) => a + b, 0);
197
+ const scope = project !== null ? ` project=${project} filtered_out=${tally.filtered}` : '';
198
+ const label = selector.kind === 'since' ? `${selector.value}m` : `${selector.value}l`;
199
+ writeOut(`scan alias=${alias} container=${container} selector=${label} lines=${total} bytes=${totalBytes}${scope}`);
200
+ writeOut(`severity ${Object.entries(tally.counts).map(([k, v]) => `${k}=${v}`).join(' ')}`);
201
+ const ranked = PATTERNS.map(([name], i) => [name, tally.hits[i] ?? 0])
202
+ .filter(([, n]) => n > 0)
203
+ .sort((a, b) => b[1] - a[1]);
204
+ writeOut(`signatures ${ranked.length > 0 ? ranked.map(([name, n]) => `${name}:${n}`).join(', ') : 'none'}`);
205
+ const topEvents = Object.entries(tally.events).sort((a, b) => b[1] - a[1]).slice(0, 8);
206
+ writeOut(`events ${topEvents.length > 0 ? topEvents.map(([name, n]) => `${name}:${n}`).join(', ') : 'none'}`);
207
+ writeOut(`evidence rows=${tally.rows.length}`);
208
+ for (const row of tally.rows) {
209
+ const sig = row.signature !== null ? ` sig=${row.signature}` : '';
210
+ writeOut(` [${row.level}]${sig} ${row.digest}`);
211
+ }
212
+ const saved = saveScanReport(alias, container, selector, tally.counts, tally.hits, PATTERNS.map(([name]) => name), tally.events, tally.rows, totalBytes, project, tally.filtered);
213
+ if (saved !== null)
214
+ writeOut(`saved=${saved}`);
215
+ return 0;
216
+ }
@@ -0,0 +1,9 @@
1
+ export declare const exportPublicUsage = "bbc export-public <out-dir> --public-repo <owner/name> [--repo <repo-root>]";
2
+ export declare class ExportRefusedError extends Error {
3
+ constructor(message: string);
4
+ }
5
+ export declare function trackedFiles(root: string): string[];
6
+ export declare function privateProfiles(root: string): Map<string, string[]>;
7
+ export declare function dropMarked(text: string, srcName: string): string;
8
+ export declare function exportPublicEdition(rootInput: string, outInput: string, publicRepo: string): Record<string, unknown>;
9
+ export declare function exportPublic(argv: readonly string[]): number;