@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.
- package/dist/audit-ledger.d.ts +2 -0
- package/dist/audit-ledger.js +71 -0
- package/dist/bbc-install.d.ts +2 -0
- package/dist/bbc-install.js +1278 -0
- package/dist/bbc.js +87 -3
- package/dist/bundle/commands/daily/SKILL.md +112 -0
- package/dist/bundle/commands/daily/adapters/command.md +17 -0
- package/dist/bundle/commands/daily/adapters/gemini.toml +17 -0
- package/dist/bundle/commands/issue-clean-and-close/SKILL.md +85 -0
- package/dist/bundle/commands/issue-clean-and-close/adapters/command.md +17 -0
- package/dist/bundle/commands/issue-clean-and-close/adapters/gemini.toml +17 -0
- package/dist/bundle/commands/issue-clean-and-close/references/policy.md +87 -0
- package/dist/bundle/commands/recap/SKILL.md +84 -0
- package/dist/bundle/commands/recap/adapters/command.md +17 -0
- package/dist/bundle/commands/recap/adapters/gemini.toml +17 -0
- package/dist/bundle/installer/clients.json +103 -0
- package/dist/bundle/skills/code-quality-gate/SKILL.md +58 -0
- package/dist/bundle/skills/code-quality-gate/references/gate-bigo.md +31 -0
- package/dist/bundle/skills/code-quality-gate/references/gate-earlyreturn.md +73 -0
- package/dist/bundle/skills/code-quality-gate/references/gate-typesafe.md +32 -0
- package/dist/bundle/skills/code-quality-gate/references/output-schema.yml +40 -0
- package/dist/bundle/skills/delivery-coordinator/SKILL.md +80 -0
- package/dist/bundle/skills/delivery-coordinator/references/hud-output.md +55 -0
- package/dist/bundle/skills/delivery-coordinator/references/intake.md +86 -0
- package/dist/bundle/skills/delivery-coordinator/references/issue-claim.md +143 -0
- package/dist/bundle/skills/delivery-coordinator/references/issue-dedup.md +38 -0
- package/dist/bundle/skills/delivery-coordinator/references/sleuth-regression-exercise.md +60 -0
- package/dist/bundle/skills/delivery-coordinator/references/visual-reference.md +45 -0
- package/dist/bundle/skills/delivery-coordinator/references/worktree-isolation.md +19 -0
- package/dist/bundle/skills/documentation-steward/SKILL.md +43 -0
- package/dist/bundle/skills/documentation-steward/references/discovery.md +17 -0
- package/dist/bundle/skills/documentation-steward/references/handoff.md +15 -0
- package/dist/bundle/skills/greptile-review-loop/SKILL.md +56 -0
- package/dist/bundle/skills/greptile-review-loop/references/review-protocol.md +37 -0
- package/dist/bundle/skills/issue-reviewer/SKILL.md +84 -0
- package/dist/bundle/skills/issue-reviewer/references/review-format.md +100 -0
- package/dist/bundle/skills/issue-reviewer/references/triage.md +105 -0
- package/dist/bundle/skills/question-gate/SKILL.md +64 -0
- package/dist/bundle/skills/question-gate/references/client-hooks.md +111 -0
- package/dist/bundle/skills/question-gate/references/diagram-routing.md +58 -0
- package/dist/bundle/skills/question-gate/tests/fixtures/question-corpus.json +481 -0
- package/dist/bundle/skills/regression-testing/SKILL.md +49 -0
- package/dist/bundle/skills/regression-testing/references/evidence-record.md +35 -0
- package/dist/bundle/skills/requirements-spec/SKILL.md +59 -0
- package/dist/bundle/skills/risk-scout/SKILL.md +53 -0
- package/dist/bundle/skills/risk-scout/references/risk-matrix.md +49 -0
- package/dist/bundle/skills/skill-clean-architecture/SKILL.md +53 -0
- package/dist/bundle/skills/skill-clean-architecture/references/layer-rules.md +22 -0
- package/dist/bundle/skills/skill-clean-architecture/references/source-headers.md +30 -0
- package/dist/bundle/skills/skill-clean-architecture/tests/fixtures/bigo/bad-utf8.js +1 -0
- package/dist/bundle/skills/skill-clean-architecture/tests/fixtures/bigo/edge-crlf.ts +6 -0
- package/dist/bundle/skills/skill-clean-architecture/tests/fixtures/bigo/edge-mixed.ts +15 -0
- package/dist/bundle/skills/skill-clean-architecture/tests/fixtures/bigo/empty.js +0 -0
- package/dist/bundle/skills/skill-clean-architecture/tests/fixtures/bigo/no-newline.js +1 -0
- package/dist/bundle/skills/skill-clean-architecture/tests/fixtures/bigo.expected.yml +95 -0
- package/dist/bundle/skills/tool-depot/SKILL.md +47 -0
- package/dist/bundle/skills/tool-depot/references/checkout.md +29 -0
- package/dist/bundle/skills/tool-depot/references/loki-read.md +41 -0
- package/dist/bundle/skills/tool-depot/references/readonly-access.md +84 -0
- package/dist/bundle/skills/tool-depot/references/tool-catalog.json +47 -0
- package/dist/bundle/skills/tool-depot/scripts/loki-runtime-logs.py +305 -0
- package/dist/bundle/skills/tool-depot/tests/loki-runtime-logs.test.sh +101 -0
- package/dist/bundle/skills/watcher-observability/SKILL.md +72 -0
- package/dist/bundle/skills/watcher-observability/references/batch-protocol.md +44 -0
- package/dist/bundle/skills/watcher-observability/references/configuration.md +31 -0
- package/dist/bundle/skills/watcher-observability/references/error-scan.md +102 -0
- package/dist/bundle/skills/watcher-observability/references/live-protocol.md +49 -0
- package/dist/bundle/skills/watcher-observability/references/server-account.md +72 -0
- package/dist/bundle/skills/watcher-observability/server/watcher-gate.sh +51 -0
- package/dist/bundle/skills/watcher-observability/tests/watcher-gate.test.sh +113 -0
- package/dist/bundle/skills/watcher-observability/watcher.json +1 -0
- package/dist/bundle/skills/workflow-auditor/SKILL.md +53 -0
- package/dist/bundle/skills/workflow-auditor/references/audit-protocol.md +49 -0
- package/dist/bundle/skills/workflow-auditor/references/ledger.md +122 -0
- package/dist/change-lane/classification.js +3 -1
- package/dist/check-issue-claim.d.ts +2 -0
- package/dist/check-issue-claim.js +146 -0
- package/dist/check-worktree-guard.d.ts +2 -0
- package/dist/check-worktree-guard.js +114 -0
- package/dist/error-scan.d.ts +3 -0
- package/dist/error-scan.js +216 -0
- package/dist/export-public.d.ts +9 -0
- package/dist/export-public.js +274 -0
- package/dist/fetch-issue-attachments.d.ts +22 -0
- package/dist/fetch-issue-attachments.js +325 -0
- package/dist/issue-claim/evaluation.d.ts +66 -0
- package/dist/issue-claim/evaluation.js +259 -0
- package/dist/issue-claim/loaders.d.ts +5 -0
- package/dist/issue-claim/loaders.js +116 -0
- package/dist/list-zed-commands.d.ts +7 -0
- package/dist/list-zed-commands.js +288 -0
- package/dist/plan-issue-triage.d.ts +3 -0
- package/dist/plan-issue-triage.js +404 -0
- package/dist/question-gate/ledger.d.ts +5 -0
- package/dist/question-gate/ledger.js +115 -0
- package/dist/question-gate/rules.d.ts +40 -0
- package/dist/question-gate/rules.js +483 -0
- package/dist/recap/board.d.ts +5 -0
- package/dist/recap/board.js +384 -0
- package/dist/recap/git-and-github.d.ts +11 -0
- package/dist/recap/git-and-github.js +620 -0
- package/dist/recap/report-and-hud.d.ts +2 -0
- package/dist/recap/report-and-hud.js +294 -0
- package/dist/recap/time-and-refs.d.ts +27 -0
- package/dist/recap/time-and-refs.js +148 -0
- package/dist/recap.d.ts +2 -0
- package/dist/recap.js +217 -0
- package/dist/render-workflow.js +12 -14
- package/dist/resolve-containers.d.ts +2 -0
- package/dist/resolve-containers.js +96 -0
- package/dist/review-loop.d.ts +7 -0
- package/dist/review-loop.js +622 -0
- package/dist/save-counts.d.ts +2 -0
- package/dist/save-counts.js +191 -0
- package/dist/summarize-logs.d.ts +2 -0
- package/dist/summarize-logs.js +41 -0
- package/dist/sweep-github.d.ts +10 -0
- package/dist/sweep-github.js +453 -0
- package/dist/sweep-issues.d.ts +56 -0
- package/dist/sweep-issues.js +650 -0
- package/dist/sweep.d.ts +2 -0
- package/dist/sweep.js +301 -0
- package/dist/triage-question.d.ts +2 -0
- package/dist/triage-question.js +189 -0
- package/dist/validate-skills.d.ts +2 -0
- package/dist/validate-skills.js +48 -0
- package/dist/watch-live.d.ts +7 -0
- package/dist/watch-live.js +83 -0
- package/dist/watcher/config.d.ts +11 -0
- package/dist/watcher/config.js +265 -0
- package/dist/watcher/live-classifier.d.ts +52 -0
- package/dist/watcher/live-classifier.js +510 -0
- package/dist/watcher/safe-fs.d.ts +9 -0
- package/dist/watcher/safe-fs.js +159 -0
- package/dist/watcher/stream.d.ts +27 -0
- package/dist/watcher/stream.js +340 -0
- package/dist/watcher/summarizer.d.ts +19 -0
- package/dist/watcher/summarizer.js +121 -0
- package/dist/wave3/process.d.ts +14 -0
- package/dist/wave3/process.js +84 -0
- package/dist/wave4/process.d.ts +14 -0
- package/dist/wave4/process.js +128 -0
- package/dist/workflow/render.d.ts +1 -1
- package/dist/workflow/render.js +1 -1
- package/dist/workflow-auditor/audit.d.ts +27 -0
- package/dist/workflow-auditor/audit.js +583 -0
- package/dist/workflow-auditor/ledger-io.d.ts +5 -0
- package/dist/workflow-auditor/ledger-io.js +99 -0
- package/dist/workflow-auditor/skills-validator.d.ts +10 -0
- package/dist/workflow-auditor/skills-validator.js +533 -0
- package/dist/worktree-guard/evaluation.d.ts +19 -0
- package/dist/worktree-guard/evaluation.js +84 -0
- package/dist/worktree-guard/git.d.ts +3 -0
- package/dist/worktree-guard/git.js +61 -0
- package/package.json +32 -33
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LAYER: Interface
|
|
3
|
+
* Contains: CLI entry point and JSON formatting for audit-ledger.
|
|
4
|
+
* Rules: Match audit-ledger.py stdout and exit codes byte-for-byte.
|
|
5
|
+
* BigO: O(n) score:3
|
|
6
|
+
* keywords: [AuditLedgerCli, LedgerArguments]
|
|
7
|
+
* GOAL: Run workflow-auditor ledger conformance checks from the bbc CLI.
|
|
8
|
+
*/
|
|
9
|
+
import { EOL } from 'node:os';
|
|
10
|
+
import { auditLedgerData, AuditUnusableError } from "./workflow-auditor/audit.js";
|
|
11
|
+
import { defaultCatalogPath, loadCatalogFile, loadJsonFile, loadServerLogFile, resolveDefaultLedgerPath, } from "./workflow-auditor/ledger-io.js";
|
|
12
|
+
export const auditLedgerUsage = 'bbc audit-ledger [ledger.json] [--catalog tool-catalog.json] [--server-log watcher-gate.log]';
|
|
13
|
+
const HELP = 'Usage: bbc audit-ledger [ledger.json] [--catalog tool-catalog.json] [--server-log watcher-gate.log]\n' +
|
|
14
|
+
'Without a ledger path, read bbc-delivery-ledger.json from the current Git worktree\n' +
|
|
15
|
+
'(git rev-parse --git-path). Exit 0: conforms or gaps only; 1: violations; 2: unusable input.';
|
|
16
|
+
function escapeAscii(text) {
|
|
17
|
+
return text.replace(/[\u007f-\uffff]/g, (char) => `\\u${char.charCodeAt(0).toString(16).padStart(4, '0')}`);
|
|
18
|
+
}
|
|
19
|
+
function writeOut(text) {
|
|
20
|
+
process.stdout.write(`${text.replaceAll('\n', EOL)}${EOL}`);
|
|
21
|
+
}
|
|
22
|
+
function writeCompactJson(value) {
|
|
23
|
+
const entries = Object.entries(value);
|
|
24
|
+
const compact = `{${entries.map(([k, v]) => `${escapeAscii(JSON.stringify(k))}: ${escapeAscii(JSON.stringify(v))}`).join(', ')}}`;
|
|
25
|
+
writeOut(compact);
|
|
26
|
+
}
|
|
27
|
+
function parseArgs(argv) {
|
|
28
|
+
let ledgerPath = null;
|
|
29
|
+
let catalogPath = defaultCatalogPath();
|
|
30
|
+
let serverLogPath = null;
|
|
31
|
+
for (let i = 0; i < argv.length; i++) {
|
|
32
|
+
const arg = argv[i] ?? '';
|
|
33
|
+
if (arg === '-h' || arg === '--help')
|
|
34
|
+
return null;
|
|
35
|
+
if (arg === '--catalog' && argv[i + 1] !== undefined) {
|
|
36
|
+
catalogPath = argv[i + 1];
|
|
37
|
+
i++;
|
|
38
|
+
}
|
|
39
|
+
else if (arg === '--server-log' && argv[i + 1] !== undefined) {
|
|
40
|
+
serverLogPath = argv[i + 1];
|
|
41
|
+
i++;
|
|
42
|
+
}
|
|
43
|
+
else if (ledgerPath === null && !arg.startsWith('-')) {
|
|
44
|
+
ledgerPath = arg;
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
throw new AuditUnusableError('Unexpected argument; see --help.');
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return { ledgerPath, catalogPath, serverLogPath };
|
|
51
|
+
}
|
|
52
|
+
export function auditLedger(argv) {
|
|
53
|
+
try {
|
|
54
|
+
const parsed = parseArgs(argv);
|
|
55
|
+
if (parsed === null) {
|
|
56
|
+
writeOut(HELP);
|
|
57
|
+
return 0;
|
|
58
|
+
}
|
|
59
|
+
const catalog = loadCatalogFile(parsed.catalogPath);
|
|
60
|
+
const commands = parsed.serverLogPath !== null ? loadServerLogFile(parsed.serverLogPath) : null;
|
|
61
|
+
const rawLedger = loadJsonFile(parsed.ledgerPath ?? resolveDefaultLedgerPath(), 'Delivery ledger');
|
|
62
|
+
const report = auditLedgerData(rawLedger, catalog, commands);
|
|
63
|
+
writeOut(escapeAscii(JSON.stringify(report, null, 2)));
|
|
64
|
+
return report.violations.length > 0 ? 1 : 0;
|
|
65
|
+
}
|
|
66
|
+
catch (error) {
|
|
67
|
+
const detail = error instanceof AuditUnusableError ? error.message : String(error);
|
|
68
|
+
writeCompactJson({ verdict: 'unusable', detail });
|
|
69
|
+
return 2;
|
|
70
|
+
}
|
|
71
|
+
}
|