@cbartens/bkit 5.5.0 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.bkit/README.md +30 -20
- package/.bkit/core/.agents/docs.md +1 -0
- package/.bkit/core/.agents/rules.md +51 -26
- package/.bkit/core/.bkit/README.md +29 -19
- package/.bkit/core/.bkit/authoring.md +117 -0
- package/.bkit/core/.bkit/cloud.md +11 -11
- package/.bkit/core/.bkit/comparison.md +5 -5
- package/.bkit/core/.bkit/install.md +20 -20
- package/.bkit/core/.bkit/jsonl.md +202 -122
- package/.bkit/core/.bkit/lite.md +1 -1
- package/.bkit/core/.bkit/pipeline.md +49 -52
- package/.bkit/core/.bkit/prompts.md +106 -167
- package/.bkit/core/.bkit/providers.md +29 -32
- package/.bkit/core/.bkit/templates.md +44 -18
- package/.bkit/core/.bkit/trackers.md +60 -28
- package/.bkit/core/.bkit/workflows.md +399 -359
- package/.bkit/core/AGENTS.md +16 -22
- package/.bkit/core/docs/templates/bkit-audit-accessibility.md +14 -38
- package/.bkit/core/docs/templates/bkit-audit-adoption.md +16 -40
- package/.bkit/core/docs/templates/bkit-audit-agents.md +19 -43
- package/.bkit/core/docs/templates/bkit-audit-aio-seo.md +16 -40
- package/.bkit/core/docs/templates/bkit-audit-analytics.md +14 -38
- package/.bkit/core/docs/templates/bkit-audit-annotations.md +11 -35
- package/.bkit/core/docs/templates/bkit-audit-app-performance.md +15 -39
- package/.bkit/core/docs/templates/bkit-audit-app-store.md +12 -36
- package/.bkit/core/docs/templates/bkit-audit-architecture.md +16 -40
- package/.bkit/core/docs/templates/bkit-audit-ci-performance.md +16 -40
- package/.bkit/core/docs/templates/bkit-audit-config.md +18 -42
- package/.bkit/core/docs/templates/bkit-audit-cost.md +16 -40
- package/.bkit/core/docs/templates/bkit-audit-coverage.md +15 -39
- package/.bkit/core/docs/templates/bkit-audit-database.md +16 -40
- package/.bkit/core/docs/templates/bkit-audit-dead-code.md +15 -39
- package/.bkit/core/docs/templates/bkit-audit-deferrals.md +15 -38
- package/.bkit/core/docs/templates/bkit-audit-dependencies.md +16 -40
- package/.bkit/core/docs/templates/bkit-audit-documentation.md +11 -35
- package/.bkit/core/docs/templates/bkit-audit-duplication.md +18 -42
- package/.bkit/core/docs/templates/bkit-audit-failures.md +13 -37
- package/.bkit/core/docs/templates/bkit-audit-flakes.md +12 -36
- package/.bkit/core/docs/templates/bkit-audit-gates.md +14 -38
- package/.bkit/core/docs/templates/bkit-audit-issues.md +15 -39
- package/.bkit/core/docs/templates/bkit-audit-llm.md +16 -40
- package/.bkit/core/docs/templates/bkit-audit-logs.md +14 -38
- package/.bkit/core/docs/templates/bkit-audit-models.md +12 -36
- package/.bkit/core/docs/templates/bkit-audit-privacy.md +12 -36
- package/.bkit/core/docs/templates/bkit-audit-prompts.md +15 -39
- package/.bkit/core/docs/templates/bkit-audit-red-team.md +15 -39
- package/.bkit/core/docs/templates/bkit-audit-reliability.md +15 -39
- package/.bkit/core/docs/templates/bkit-audit-repo.md +12 -36
- package/.bkit/core/docs/templates/bkit-audit-security.md +13 -37
- package/.bkit/core/docs/templates/bkit-audit-slop.md +14 -38
- package/.bkit/core/docs/templates/bkit-audit-testing.md +12 -36
- package/.bkit/core/docs/templates/bkit-audit-usability.md +16 -40
- package/.bkit/core/docs/templates/bkit-plan.md +97 -226
- package/.bkit/core/engine/checks/after/ci-yml.ts +39 -30
- package/.bkit/core/engine/checks/after/github.ts +101 -72
- package/.bkit/core/engine/checks/after/index.ts +10 -12
- package/.bkit/core/engine/checks/after/suppression.ts +8 -5
- package/.bkit/core/engine/checks/after/tools.ts +47 -92
- package/.bkit/core/engine/checks/before/env.ts +2 -2
- package/.bkit/core/engine/checks/before/files.ts +5 -4
- package/.bkit/core/engine/checks/before/index.ts +18 -1
- package/.bkit/core/engine/checks/before/repo.ts +168 -2
- package/.bkit/core/engine/checks/tips/catalogue.ts +16 -5
- package/.bkit/core/engine/checks/tips/detect.ts +34 -0
- package/.bkit/core/engine/checks/tips/index.ts +10 -7
- package/.bkit/core/engine/cli.ts +20 -53
- package/.bkit/core/engine/commands/analysis.ts +171 -140
- package/.bkit/core/engine/commands/ci/ci.ts +6 -6
- package/.bkit/core/engine/commands/comply.ts +77 -103
- package/.bkit/core/engine/commands/install/doctor.ts +2 -2
- package/.bkit/core/engine/commands/install/install.ts +57 -18
- package/.bkit/core/engine/commands/install/uninstall.ts +65 -28
- package/.bkit/core/engine/commands/land.ts +18 -12
- package/.bkit/core/engine/commands/lib.ts +79 -17
- package/.bkit/core/engine/commands/registry.ts +4 -0
- package/.bkit/core/engine/commands/setup/setup.ts +7 -7
- package/.bkit/core/engine/commands/stats.ts +204 -0
- package/.bkit/core/engine/commands/tips.ts +10 -5
- package/.bkit/core/engine/commands/workflow/branches.ts +741 -62
- package/.bkit/core/engine/commands/workflow/challenge.ts +673 -0
- package/.bkit/core/engine/commands/workflow/context.ts +853 -29
- package/.bkit/core/engine/commands/workflow/counters.ts +267 -84
- package/.bkit/core/engine/commands/workflow/decisions.ts +541 -0
- package/.bkit/core/engine/commands/workflow/disk.ts +2 -2
- package/.bkit/core/engine/commands/workflow/fids.ts +793 -33
- package/.bkit/core/engine/commands/workflow/issues.ts +427 -105
- package/.bkit/core/engine/commands/workflow/ledgers.ts +884 -27
- package/.bkit/core/engine/commands/workflow/locks.ts +26 -2
- package/.bkit/core/engine/commands/workflow/plan-blocks.ts +582 -0
- package/.bkit/core/engine/commands/workflow/plan-versions.ts +21 -0
- package/.bkit/core/engine/commands/workflow/prs.ts +166 -30
- package/.bkit/core/engine/commands/workflow/repo.ts +59 -7
- package/.bkit/core/engine/commands/workflow/roadmap.ts +16 -7
- package/.bkit/core/engine/commands/workflow/run-facts.ts +501 -0
- package/.bkit/core/engine/commands/workflow/runs.ts +179 -49
- package/.bkit/core/engine/commands/workflow/runtime.ts +22 -1
- package/.bkit/core/engine/commands/workflow/status.ts +142 -29
- package/.bkit/core/engine/commands/workflow/step-table.ts +339 -0
- package/.bkit/core/engine/commands/workflow/steps.ts +213 -88
- package/.bkit/core/engine/commands/workflow/summary.ts +398 -0
- package/.bkit/core/engine/commands/workflow/tests.ts +1013 -148
- package/.bkit/core/engine/commands/workflow/tracker.ts +1195 -0
- package/.bkit/core/engine/commands/workflow/workflows.ts +984 -207
- package/.bkit/core/engine/commands/workflow/workstreams.ts +11 -5
- package/.bkit/core/engine/commands/workflow/worktrees.ts +276 -22
- package/.bkit/core/engine/install/manifest.ts +11 -9
- package/.bkit/core/engine/install/modules/cloud.ts +21 -13
- package/.bkit/core/engine/install/modules/core.ts +325 -7
- package/.bkit/core/engine/install/modules/opencode.ts +2 -2
- package/.bkit/core/engine/install/version-file.ts +6 -2
- package/.bkit/core/engine/ledgers/migrate.ts +92 -0
- package/.bkit/core/engine/ledgers/status.ts +92 -15
- package/.bkit/core/engine/ledgers/telemetry.ts +1261 -254
- package/.bkit/core/engine/render/hosts.ts +4 -0
- package/.bkit/core/engine/render/models.ts +12 -0
- package/.bkit/core/engine/shared/branches.ts +4 -1
- package/.bkit/core/engine/shared/egress.ts +7 -0
- package/.bkit/core/engine/shared/json.ts +25 -7
- package/.bkit/core/engine/shared/settings.ts +202 -33
- package/.bkit/core/engine/shared/text.ts +361 -0
- package/.bkit/core/engine/tools/grammar-density.ts +215 -0
- package/.bkit/core/engine/tools/instructions-sources.ts +834 -0
- package/.bkit/core/engine/tools/instructions.ts +1751 -0
- package/.bkit/core/hooks/gateguard-engine.js +24 -23
- package/.bkit/core/hooks/guardrails-shell.js +2 -3
- package/.bkit/core/hooks/guardrails-tiers.js +7 -1
- package/.bkit/core/hooks/readguard-engine.js +2 -2
- package/.bkit/core/prompts/bkit-audit-generate.md +62 -25
- package/.bkit/core/prompts/bkit-build-challenge-1.md +40 -17
- package/.bkit/core/prompts/bkit-build-challenge-2.md +44 -17
- package/.bkit/core/prompts/bkit-build-install-skills.md +26 -13
- package/.bkit/core/prompts/bkit-build-plan-convert.md +74 -0
- package/.bkit/core/prompts/bkit-build-plan-current.md +26 -13
- package/.bkit/core/prompts/bkit-build-plan-execute.md +74 -26
- package/.bkit/core/prompts/bkit-build-plan-gaps-remediate.md +64 -23
- package/.bkit/core/prompts/bkit-build-plan-verify.md +57 -33
- package/.bkit/core/prompts/bkit-debug-abort-handover.md +30 -14
- package/.bkit/core/prompts/bkit-debug-failure-diagnose.md +34 -14
- package/.bkit/core/prompts/bkit-debug-failure-remediate.md +34 -17
- package/.bkit/core/prompts/bkit-debug-failure-reproduce.md +26 -13
- package/.bkit/core/prompts/bkit-debug-failure-soak.md +31 -16
- package/.bkit/core/prompts/bkit-design-brainstorm-ideate-1.md +21 -11
- package/.bkit/core/prompts/bkit-design-brainstorm-ideate-2.md +20 -11
- package/.bkit/core/prompts/bkit-design-brainstorm-ideate-3.md +20 -11
- package/.bkit/core/prompts/bkit-design-generate.md +33 -13
- package/.bkit/core/prompts/bkit-design-organise.md +25 -12
- package/.bkit/core/prompts/bkit-design-review-1.md +31 -15
- package/.bkit/core/prompts/bkit-design-review-2.md +28 -13
- package/.bkit/core/prompts/bkit-design-spike.md +30 -13
- package/.bkit/core/prompts/bkit-design-update.md +33 -19
- package/.bkit/core/prompts/bkit-plan-generate.md +75 -19
- package/.bkit/core/prompts/bkit-plan-review-1.md +50 -27
- package/.bkit/core/prompts/bkit-plan-review-2.md +59 -28
- package/.bkit/core/prompts/bkit-plan-scope-check.md +109 -0
- package/.bkit/core/prompts/bkit-plan-update.md +61 -24
- package/.bkit/core/prompts/bkit-ship-conflict-resolve.md +27 -15
- package/.bkit/core/prompts/bkit-ship-deferred-sweep.md +31 -16
- package/.bkit/core/prompts/bkit-ship-update-docs.md +30 -15
- package/.bkit/core/prompts/bkit-utility-compress-markdown.md +24 -14
- package/.bkit/core/prompts/bkit-utility-update-decisions.md +32 -14
- package/.bkit/core/prompts/bkit-utility-update-deferrals.md +29 -14
- package/.bkit/core/prompts/bkit-utility-update-documentation.md +28 -13
- package/.bkit/core/prompts/bkit-utility-update-failures.md +31 -14
- package/.bkit/core/prompts/bkit-utility-update-knowledge.md +33 -14
- package/.bkit/core/prompts/bkit-utility-update-roadmap.md +38 -17
- package/.bkit/core/prompts/bkit-utility-update-tracker.md +43 -20
- package/.bkit/core/workflows/bkit-auto.md +54 -46
- package/.bkit/core/workflows/bkit-build.md +577 -458
- package/.bkit/core/workflows/bkit-debug.md +348 -333
- package/.bkit/core/workflows/bkit-design.md +201 -237
- package/.bkit/core/workflows/bkit-plan.md +210 -321
- package/.bkit/core/workflows/bkit-ship.md +328 -278
- package/.bkit/shared/.bkit/.env.example +2 -2
- package/.bkit/shared/.claude/settings.json +11 -0
- package/.bkit/shared/.cursor/mcp.json +1 -1
- package/.bkit/shared/.cursor/rules/bkit-rules.mdc +1 -1
- package/.bkit/shared/.gitattributes +1 -1
- package/.bkit/shared/.mcp.json +1 -1
- package/.bkit/shared/.opencode/opencode.json +11 -0
- package/.bkit/shared/CLAUDE.md +2 -2
- package/.bkit/shared/GEMINI.md +2 -2
- package/.bkit/shared/docs/architecture.md +1 -1
- package/.bkit/shared/docs/data-schema.md +1 -1
- package/.bkit/shared/docs/deployments.md +16 -28
- package/.bkit/shared/docs/design.md +1 -1
- package/.bkit/shared/docs/noise.md +1 -1
- package/.bkit/shared/docs/observability.md +2 -2
- package/.bkit/shared/docs/security.md +1 -1
- package/.bkit/shared/docs/setup.md +1 -1
- package/.bkit/shared/docs/technology.md +1 -1
- package/.bkit/shared/docs/testing.md +27 -10
- package/.bkit/templates/.claude/hooks/bkit-cloud-bootstrap.sh +1 -1
- package/.bkit/templates/.github/ISSUE_TEMPLATE/bkit-change.yml +26 -5
- package/.bkit/templates/.github/workflows/bkit-ci.yml +22 -84
- package/.bkit/templates/.github/workflows/bkit-cloud.yml +21 -19
- package/.bkit/templates/.husky/pre-push +52 -13
- package/.bkit/templates/.prettierignore +7 -0
- package/.bkit/templates/scripts/ci/bkit-local-stack-lock.sh +194 -0
- package/.bkit/templates/scripts/ci/check-capstone.mjs +2 -4
- package/.bkit/templates/scripts/ci/check-capstone.test.mjs +4 -23
- package/.bkit/templates/scripts/ci/lanes/resolve-push-base.mjs +104 -23
- package/.bkit/templates/scripts/ci/lanes/resolve-push-base.test.mjs +103 -6
- package/.bkit/templates/scripts/cleanup/bkit-disk-prune.mjs +1 -1
- package/.bkit/templates/scripts/graphify/bkit-graph-pre-push.sh +3 -1
- package/.bkit/templates/scripts/prettier/bkit-insert-ignore.mjs +49 -29
- package/CHANGELOG.md +142 -0
- package/README.md +58 -34
- package/dist/checks/after/ci-yml.js +39 -29
- package/dist/checks/after/github.js +99 -72
- package/dist/checks/after/index.js +11 -13
- package/dist/checks/after/suppression.js +8 -5
- package/dist/checks/after/tools.js +40 -83
- package/dist/checks/before/env.js +2 -2
- package/dist/checks/before/files.js +5 -3
- package/dist/checks/before/index.js +15 -2
- package/dist/checks/before/repo.js +163 -2
- package/dist/checks/tips/catalogue.js +14 -5
- package/dist/checks/tips/detect.js +32 -0
- package/dist/checks/tips/index.js +7 -5
- package/dist/cli.js +19 -47
- package/dist/commands/analysis.js +109 -100
- package/dist/commands/ci/ci.js +6 -6
- package/dist/commands/comply.js +54 -91
- package/dist/commands/install/doctor.js +2 -2
- package/dist/commands/install/install.js +50 -19
- package/dist/commands/install/uninstall.js +59 -28
- package/dist/commands/land.js +16 -12
- package/dist/commands/lib.js +51 -16
- package/dist/commands/registry.js +4 -0
- package/dist/commands/setup/setup.js +7 -7
- package/dist/commands/stats.js +136 -0
- package/dist/commands/tips.js +7 -3
- package/dist/commands/workflow/branches.js +656 -56
- package/dist/commands/workflow/challenge.js +556 -0
- package/dist/commands/workflow/context.js +709 -30
- package/dist/commands/workflow/counters.js +208 -75
- package/dist/commands/workflow/decisions.js +441 -0
- package/dist/commands/workflow/disk.js +2 -2
- package/dist/commands/workflow/fids.js +689 -33
- package/dist/commands/workflow/issues.js +362 -99
- package/dist/commands/workflow/ledgers.js +762 -27
- package/dist/commands/workflow/locks.js +24 -2
- package/dist/commands/workflow/plan-blocks.js +437 -0
- package/dist/commands/workflow/plan-versions.js +22 -0
- package/dist/commands/workflow/prs.js +142 -32
- package/dist/commands/workflow/repo.js +52 -7
- package/dist/commands/workflow/roadmap.js +9 -7
- package/dist/commands/workflow/run-facts.js +426 -0
- package/dist/commands/workflow/runs.js +144 -43
- package/dist/commands/workflow/runtime.js +12 -1
- package/dist/commands/workflow/status.js +130 -29
- package/dist/commands/workflow/step-table.js +276 -0
- package/dist/commands/workflow/steps.js +171 -80
- package/dist/commands/workflow/summary.js +275 -0
- package/dist/commands/workflow/tests.js +834 -136
- package/dist/commands/workflow/tracker.js +983 -0
- package/dist/commands/workflow/workflows.js +834 -195
- package/dist/commands/workflow/workstreams.js +11 -5
- package/dist/commands/workflow/worktrees.js +221 -22
- package/dist/install/manifest.js +11 -9
- package/dist/install/modules/cloud.js +22 -13
- package/dist/install/modules/core.js +326 -7
- package/dist/install/modules/opencode.js +2 -2
- package/dist/install/version-file.js +6 -2
- package/dist/ledgers/migrate.js +81 -0
- package/dist/ledgers/status.js +61 -8
- package/dist/ledgers/telemetry.js +905 -124
- package/dist/render/hosts.js +4 -0
- package/dist/render/models.js +12 -0
- package/dist/shared/branches.js +3 -1
- package/dist/shared/egress.js +7 -0
- package/dist/shared/json.js +20 -7
- package/dist/shared/settings.js +147 -26
- package/dist/shared/text.js +333 -0
- package/dist/tools/grammar-density.js +183 -0
- package/dist/tools/instructions-sources.js +721 -0
- package/dist/tools/instructions.js +1579 -0
- package/package.json +114 -23
- package/.bkit/core/engine/commands/harvest.ts +0 -459
- package/.bkit/core/engine/tools/wording.ts +0 -748
- package/.bkit/core/prompts/bkit-build-challenge-reconcile.md +0 -69
- package/.bkit/core/prompts/bkit-build-challenge-remediate.md +0 -71
- package/.bkit/core/prompts/bkit-build-challenge-tests.md +0 -74
- package/.bkit/core/prompts/bkit-build-summary.md +0 -94
- package/.bkit/core/prompts/bkit-debug-summary.md +0 -96
- package/.bkit/core/prompts/bkit-design-summary.md +0 -107
- package/.bkit/core/prompts/bkit-plan-complexity-check.md +0 -67
- package/.bkit/core/prompts/bkit-plan-complexity-split.md +0 -88
- package/.bkit/core/prompts/bkit-plan-review-3.md +0 -93
- package/.bkit/core/prompts/bkit-plan-scope-check-1.md +0 -85
- package/.bkit/core/prompts/bkit-plan-scope-check-2.md +0 -85
- package/.bkit/core/prompts/bkit-plan-summary.md +0 -107
- package/.bkit/core/prompts/bkit-ship-summary.md +0 -78
- package/.bkit/templates/scripts/ci/lanes/check-tree-cache.mjs +0 -138
- package/.bkit/templates/scripts/ci/lanes/check-tree-cache.test.mjs +0 -181
- package/dist/commands/harvest.js +0 -353
- package/dist/tools/wording.js +0 -680
package/dist/render/hosts.js
CHANGED
|
@@ -110,6 +110,7 @@ export function applyOpencodeAgent(content, opencodeModelLookup, effortMap, prov
|
|
|
110
110
|
const description = parsed.get("description") ?? "";
|
|
111
111
|
const effort = parsed.get("effort");
|
|
112
112
|
const toolsBlock = extractFrontmatterField(fmBlock, "tools");
|
|
113
|
+
// autoCompactWindow dropped: no per-agent setting, see providers.md § Context compaction.
|
|
113
114
|
let newFm = "---\n";
|
|
114
115
|
newFm += `mode: subagent\n`;
|
|
115
116
|
newFm += `name: ${name}\n`;
|
|
@@ -195,6 +196,7 @@ export function applyCodexAgent(content, codexModelLookup, effortMap) {
|
|
|
195
196
|
const { afterFm, parsed, name, model } = subagent;
|
|
196
197
|
const body = afterFm.trim();
|
|
197
198
|
const effort = parsed.get("effort");
|
|
199
|
+
// autoCompactWindow dropped: a role file's model_auto_compact_token_limit is discarded (openai/codex core/src/agent/role.rs:37-48).
|
|
198
200
|
let out = "";
|
|
199
201
|
out += tomlString("name", name);
|
|
200
202
|
out += tomlString("description", parsed.get("description") ?? "");
|
|
@@ -358,6 +360,7 @@ export function applyT3(content, modelLookup, effortMap) {
|
|
|
358
360
|
const description = parsed.get("description") ?? "";
|
|
359
361
|
const effort = parsed.get("effort");
|
|
360
362
|
const toolsBlock = extractFrontmatterField(fmBlock, "tools");
|
|
363
|
+
// autoCompactWindow dropped: no per-agent setting, see providers.md § Context compaction.
|
|
361
364
|
let newFm = "---\n";
|
|
362
365
|
newFm += `name: ${name}\n`;
|
|
363
366
|
if (description.includes("\n")) {
|
|
@@ -421,6 +424,7 @@ export function applyAntigravityPrompt(content, modelLookup, effortMap) {
|
|
|
421
424
|
const description = parsed.get("description") ?? "";
|
|
422
425
|
const effort = parsed.get("effort");
|
|
423
426
|
const toolsBlock = extractFrontmatterField(fmBlock, "tools");
|
|
427
|
+
// autoCompactWindow dropped: no per-agent setting, see providers.md § Context compaction.
|
|
424
428
|
let newFm = "---\n";
|
|
425
429
|
newFm += `name: ${name}\n`;
|
|
426
430
|
if (description.includes("\n")) {
|
package/dist/render/models.js
CHANGED
|
@@ -189,6 +189,18 @@ export function applyModelOverrides(lookup, providerKey, overridesPath) {
|
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
191
|
}
|
|
192
|
+
/**
|
|
193
|
+
* Override rows (from `overridesPath`) naming no agent in `known`, deduplicated in file
|
|
194
|
+
* order. `applyModelOverrides` skips such rows, so they are reported, not applied.
|
|
195
|
+
*/
|
|
196
|
+
export function unknownModelOverrides(overridesPath, known) {
|
|
197
|
+
const out = [];
|
|
198
|
+
for (const o of parseModelOverrides(overridesPath)) {
|
|
199
|
+
if (!known.has(o.prompt) && !out.includes(o.prompt))
|
|
200
|
+
out.push(o.prompt);
|
|
201
|
+
}
|
|
202
|
+
return out;
|
|
203
|
+
}
|
|
192
204
|
// column → (sourceEffort → target)
|
|
193
205
|
/**
|
|
194
206
|
* Program → prompts.md effort-table column header.
|
package/dist/shared/branches.js
CHANGED
|
@@ -5,7 +5,9 @@
|
|
|
5
5
|
// this one rule.
|
|
6
6
|
/** The integration branch feature work lands on. */
|
|
7
7
|
export const DEV = "dev";
|
|
8
|
+
/** The release branch: bkit never opens a PR into it or merges into it. */
|
|
9
|
+
export const MAIN = "main";
|
|
8
10
|
/** True for `dev` and `main`: no feature work happens on them, no force-push touches them. */
|
|
9
11
|
export function isSharedBranch(branch) {
|
|
10
|
-
return branch === DEV || branch ===
|
|
12
|
+
return branch === DEV || branch === MAIN;
|
|
11
13
|
}
|
package/dist/shared/egress.js
CHANGED
|
@@ -103,6 +103,13 @@ export const BKIT_EGRESS_SOURCES = [
|
|
|
103
103
|
hosts: ["api.githubcopilot.com"],
|
|
104
104
|
bases: ["githubcopilot.com"],
|
|
105
105
|
},
|
|
106
|
+
// The engine's own tracker calls (`gh api` REST and GraphQL), beside the MCP server.
|
|
107
|
+
{
|
|
108
|
+
id: "tracker-github-api",
|
|
109
|
+
kind: "tracker-mcp",
|
|
110
|
+
hosts: ["api.github.com"],
|
|
111
|
+
bases: ["github.com"],
|
|
112
|
+
},
|
|
106
113
|
{
|
|
107
114
|
id: "mcp-linear",
|
|
108
115
|
kind: "tracker-mcp",
|
package/dist/shared/json.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// shared/json.ts — `JSON.parse` without the throw, for consumer-authored input.
|
|
1
|
+
// shared/json.ts — `JSON.parse` and file reads without the throw, for consumer-authored input.
|
|
2
2
|
//
|
|
3
3
|
// Every read of a file bkit does not own (package.json, .mcp.json, settings JSON,
|
|
4
4
|
// .bkit/version) must fail open into a result the caller reports in its own terms,
|
|
@@ -16,15 +16,28 @@ export function parseJson(raw) {
|
|
|
16
16
|
return { ok: false };
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
|
-
/**
|
|
20
|
-
export function
|
|
21
|
-
let raw;
|
|
19
|
+
/** The file at `file` as UTF-8 text, or `{ ok: false }` when it cannot be read. */
|
|
20
|
+
export function readTextFile(file) {
|
|
22
21
|
try {
|
|
23
|
-
|
|
22
|
+
return { ok: true, text: fs.readFileSync(file, "utf-8") };
|
|
24
23
|
}
|
|
25
24
|
catch {
|
|
26
|
-
// Missing, unreadable or a directory: the result says so,
|
|
25
|
+
// Missing, unreadable or a directory: the result says so, and the caller reports it.
|
|
27
26
|
return { ok: false };
|
|
28
27
|
}
|
|
29
|
-
|
|
28
|
+
}
|
|
29
|
+
/** The entry names of the directory `dir`, or `{ ok: false }` when it cannot be read. */
|
|
30
|
+
export function readDirNames(dir) {
|
|
31
|
+
try {
|
|
32
|
+
return { ok: true, names: fs.readdirSync(dir) };
|
|
33
|
+
}
|
|
34
|
+
catch {
|
|
35
|
+
// Missing, unreadable or not a directory: the result says so, and the caller reports it.
|
|
36
|
+
return { ok: false };
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
/** `parseJson` over the file at `file`; `{ ok: false }` also when the file cannot be read. */
|
|
40
|
+
export function readJsonFile(file) {
|
|
41
|
+
const read = readTextFile(file);
|
|
42
|
+
return read.ok ? parseJson(read.text) : { ok: false };
|
|
30
43
|
}
|
package/dist/shared/settings.js
CHANGED
|
@@ -5,6 +5,26 @@
|
|
|
5
5
|
import { DEFAULT_CLOUD_AGENTS, DEFAULT_ISSUE_TRACKER, parseCloudAgents, parseIssueTracker, } from "../install/manifest.js";
|
|
6
6
|
import { isOpencodeProvider } from "../render/models.js";
|
|
7
7
|
import { readPackageJson } from "./package-json.js";
|
|
8
|
+
const BOARD_URL = /^https:\/\/github\.com\/(orgs|users)\/([^/?#\s]+)\/projects\/([1-9][0-9]*)(?:[/?#].*)?$/;
|
|
9
|
+
/** The board a `https://github.com/{orgs|users}/<login>/projects/<n>[/views/…]` URL names; null otherwise. */
|
|
10
|
+
export function parseGithubBoardUrl(url) {
|
|
11
|
+
const m = BOARD_URL.exec(url.trim());
|
|
12
|
+
if (!m)
|
|
13
|
+
return null;
|
|
14
|
+
return { ownerType: m[1] === "orgs" ? "org" : "user", owner: m[2], number: Number(m[3]) };
|
|
15
|
+
}
|
|
16
|
+
/** Every point a workflow can stop and ask the owner at, as `<workflow>.<point>`. */
|
|
17
|
+
export const ASK_POINTS = [
|
|
18
|
+
"design.grill",
|
|
19
|
+
"build.verify",
|
|
20
|
+
"build.challenge",
|
|
21
|
+
"build.tests",
|
|
22
|
+
"debug.fix",
|
|
23
|
+
"debug.soak",
|
|
24
|
+
"ship.merge",
|
|
25
|
+
];
|
|
26
|
+
/** The limit key a point's block holds. */
|
|
27
|
+
export const limitKey = (point) => point === "design.grill" ? "maxTurns" : "maxAttempts";
|
|
8
28
|
export const CONFIG_DEFAULTS = {
|
|
9
29
|
ciWorkflow: "bkit-ci.yml",
|
|
10
30
|
capstoneJob: "bkit-tests-check",
|
|
@@ -12,10 +32,11 @@ export const CONFIG_DEFAULTS = {
|
|
|
12
32
|
worktreeInstall: true,
|
|
13
33
|
diskMinFreeGb: 40,
|
|
14
34
|
issueTracker: DEFAULT_ISSUE_TRACKER,
|
|
35
|
+
// The Status options of GitHub's Kanban and Team planning board templates.
|
|
36
|
+
github: { project: null, projectUrl: null, progress: "In progress", review: "In review" },
|
|
15
37
|
// `started` is a state type every Linear team has; In Review is a name a default team lacks.
|
|
16
38
|
linear: { team: null, project: null, progress: "started", review: "In Review" },
|
|
17
39
|
jira: { site: null, project: null, progress: "In Progress", review: "In Review" },
|
|
18
|
-
githubProject: null,
|
|
19
40
|
shipGateRequiredLanes: [],
|
|
20
41
|
// What bkit's workflows write: plan / design / build logs and the ledgers. Never
|
|
21
42
|
// `docs/**`: a project doc can be a test's input, so a docs edit can red a test.
|
|
@@ -23,6 +44,18 @@ export const CONFIG_DEFAULTS = {
|
|
|
23
44
|
opencodeProvider: null,
|
|
24
45
|
opencodeProviders: [],
|
|
25
46
|
cloudAgents: DEFAULT_CLOUD_AGENTS,
|
|
47
|
+
// `.bkit/workflows.md` § Ask points.
|
|
48
|
+
asks: {
|
|
49
|
+
"design.grill": { ask: true, max: 6 },
|
|
50
|
+
"build.verify": { ask: true, max: 2 },
|
|
51
|
+
"build.challenge": { ask: true, max: 2 },
|
|
52
|
+
"build.tests": { ask: true, max: 2 },
|
|
53
|
+
"debug.fix": { ask: true, max: 2 },
|
|
54
|
+
"debug.soak": { ask: true, max: 2 },
|
|
55
|
+
"ship.merge": { ask: true, max: 2 },
|
|
56
|
+
},
|
|
57
|
+
// Plan caps, `.bkit/workflows.md` § Test-first.
|
|
58
|
+
tasks: { maxPerGroup: 3, maxTestsPerGroup: 15, maxTestsPerTask: 10, maxTestFilesPerTask: 3 },
|
|
26
59
|
depUpdaterOptOut: false,
|
|
27
60
|
issueTrackerExplicit: false,
|
|
28
61
|
cloudAgentsExplicit: false,
|
|
@@ -37,6 +70,75 @@ function trackerStates(raw, defaults) {
|
|
|
37
70
|
review: nonEmptyString(raw.review) ? raw.review.trim() : defaults.review,
|
|
38
71
|
};
|
|
39
72
|
}
|
|
73
|
+
const TASK_CAP_KEYS = Object.keys(CONFIG_DEFAULTS.tasks);
|
|
74
|
+
const validCap = (v) => Number.isInteger(v) && v >= 1;
|
|
75
|
+
/**
|
|
76
|
+
* The keys of a `bkit.workflows.tasks` value that fall back to their default: each set key
|
|
77
|
+
* that is not an integer >= 1, or `["tasks"]` when the value is set but not an object.
|
|
78
|
+
*/
|
|
79
|
+
export function invalidTaskCaps(raw) {
|
|
80
|
+
if (raw === undefined)
|
|
81
|
+
return [];
|
|
82
|
+
if (raw === null || typeof raw !== "object" || Array.isArray(raw))
|
|
83
|
+
return ["tasks"];
|
|
84
|
+
const set = raw;
|
|
85
|
+
return TASK_CAP_KEYS.filter((k) => set[k] !== undefined && !validCap(set[k]));
|
|
86
|
+
}
|
|
87
|
+
/** `bkit.workflows.tasks` read key by key; a missing or invalid key takes its default. */
|
|
88
|
+
function taskCaps(raw) {
|
|
89
|
+
const set = record(raw);
|
|
90
|
+
const caps = { ...CONFIG_DEFAULTS.tasks };
|
|
91
|
+
for (const k of TASK_CAP_KEYS)
|
|
92
|
+
if (validCap(set[k]))
|
|
93
|
+
caps[k] = set[k];
|
|
94
|
+
return caps;
|
|
95
|
+
}
|
|
96
|
+
/** The `bkit.workflows.<workflow>.<point>` block `workflows` holds for `point`. */
|
|
97
|
+
const askBlock = (workflows, point) => {
|
|
98
|
+
const [workflow, name] = point.split(".");
|
|
99
|
+
const block = workflows[workflow];
|
|
100
|
+
return block !== null && typeof block === "object" && !Array.isArray(block)
|
|
101
|
+
? block[name]
|
|
102
|
+
: undefined;
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* The dotted keys under `bkit.workflows` that fall back to their default: each set `ask`
|
|
106
|
+
* that is not a boolean, each set limit that is not an integer >= 1, or the point itself
|
|
107
|
+
* when it is set but not an object.
|
|
108
|
+
*/
|
|
109
|
+
export function invalidAskSettings(workflows) {
|
|
110
|
+
const set = record(workflows);
|
|
111
|
+
const bad = [];
|
|
112
|
+
for (const point of ASK_POINTS) {
|
|
113
|
+
const raw = askBlock(set, point);
|
|
114
|
+
if (raw === undefined)
|
|
115
|
+
continue;
|
|
116
|
+
if (raw === null || typeof raw !== "object" || Array.isArray(raw)) {
|
|
117
|
+
bad.push(point);
|
|
118
|
+
continue;
|
|
119
|
+
}
|
|
120
|
+
const block = raw;
|
|
121
|
+
if (block.ask !== undefined && typeof block.ask !== "boolean")
|
|
122
|
+
bad.push(`${point}.ask`);
|
|
123
|
+
const key = limitKey(point);
|
|
124
|
+
if (block[key] !== undefined && !validCap(block[key]))
|
|
125
|
+
bad.push(`${point}.${key}`);
|
|
126
|
+
}
|
|
127
|
+
return bad;
|
|
128
|
+
}
|
|
129
|
+
/** Every ask point read from `bkit.workflows`; a missing or invalid key takes its default. */
|
|
130
|
+
function askSettings(workflows) {
|
|
131
|
+
const out = {};
|
|
132
|
+
for (const point of ASK_POINTS) {
|
|
133
|
+
const block = record(askBlock(workflows, point));
|
|
134
|
+
const limit = block[limitKey(point)];
|
|
135
|
+
out[point] = {
|
|
136
|
+
ask: typeof block.ask === "boolean" ? block.ask : CONFIG_DEFAULTS.asks[point].ask,
|
|
137
|
+
max: validCap(limit) ? limit : CONFIG_DEFAULTS.asks[point].max,
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
return out;
|
|
141
|
+
}
|
|
40
142
|
/**
|
|
41
143
|
* Read `package.json` `bkit` from `root` (the main checkout). A missing file,
|
|
42
144
|
* missing key, or wrongly typed value falls back to the default for that key.
|
|
@@ -44,20 +146,30 @@ function trackerStates(raw, defaults) {
|
|
|
44
146
|
export function readBkitConfig(root) {
|
|
45
147
|
// A missing or unparseable package.json takes every default; `bkit check` reports the file.
|
|
46
148
|
const read = readPackageJson(root);
|
|
47
|
-
const bkit = (
|
|
48
|
-
const
|
|
149
|
+
const bkit = record(read.ok ? read.pkg.bkit : undefined);
|
|
150
|
+
const tracker = record(bkit.tracker);
|
|
151
|
+
const cloud = record(bkit.cloud);
|
|
152
|
+
const opencode = record(record(bkit.providers).opencode);
|
|
153
|
+
const testing = record(bkit.testing);
|
|
154
|
+
const workflows = record(bkit.workflows);
|
|
155
|
+
const worktree = record(workflows.worktree);
|
|
49
156
|
const copy = worktree.copy;
|
|
50
|
-
const minFreeGb =
|
|
51
|
-
const
|
|
52
|
-
const
|
|
53
|
-
const
|
|
54
|
-
const
|
|
55
|
-
const
|
|
56
|
-
const linear = record(
|
|
57
|
-
const jira = record(
|
|
157
|
+
const minFreeGb = workflows.minFreeGb;
|
|
158
|
+
const lanes = testing.shipGate;
|
|
159
|
+
const book = testing.minPushPaths;
|
|
160
|
+
const provider = opencode.default;
|
|
161
|
+
const providers = opencode.installed;
|
|
162
|
+
const github = record(tracker.github);
|
|
163
|
+
const linear = record(tracker.linear);
|
|
164
|
+
const jira = record(tracker.jira);
|
|
165
|
+
const projectUrl = optionalString(github.project);
|
|
58
166
|
return {
|
|
59
|
-
ciWorkflow: nonEmptyString(
|
|
60
|
-
|
|
167
|
+
ciWorkflow: nonEmptyString(testing.ciWorkflow)
|
|
168
|
+
? testing.ciWorkflow
|
|
169
|
+
: CONFIG_DEFAULTS.ciWorkflow,
|
|
170
|
+
capstoneJob: nonEmptyString(testing.ciCapstone)
|
|
171
|
+
? testing.ciCapstone
|
|
172
|
+
: CONFIG_DEFAULTS.capstoneJob,
|
|
61
173
|
worktreeCopy: Array.isArray(copy) && copy.every(nonEmptyString)
|
|
62
174
|
? [...copy]
|
|
63
175
|
: [...CONFIG_DEFAULTS.worktreeCopy],
|
|
@@ -65,7 +177,12 @@ export function readBkitConfig(root) {
|
|
|
65
177
|
diskMinFreeGb: typeof minFreeGb === "number" && Number.isFinite(minFreeGb) && minFreeGb >= 0
|
|
66
178
|
? minFreeGb
|
|
67
179
|
: CONFIG_DEFAULTS.diskMinFreeGb,
|
|
68
|
-
issueTracker: parseIssueTracker(
|
|
180
|
+
issueTracker: parseIssueTracker(tracker.default) ?? CONFIG_DEFAULTS.issueTracker,
|
|
181
|
+
github: {
|
|
182
|
+
project: github.project === false ? false : projectUrl ? parseGithubBoardUrl(projectUrl) : null,
|
|
183
|
+
projectUrl,
|
|
184
|
+
...trackerStates(github, CONFIG_DEFAULTS.github),
|
|
185
|
+
},
|
|
69
186
|
linear: {
|
|
70
187
|
team: optionalString(linear.team),
|
|
71
188
|
project: optionalString(linear.project),
|
|
@@ -76,11 +193,6 @@ export function readBkitConfig(root) {
|
|
|
76
193
|
project: optionalString(jira.project),
|
|
77
194
|
...trackerStates(jira, CONFIG_DEFAULTS.jira),
|
|
78
195
|
},
|
|
79
|
-
githubProject: project === false
|
|
80
|
-
? false
|
|
81
|
-
: project !== null && typeof project === "object" && !Array.isArray(project)
|
|
82
|
-
? project
|
|
83
|
-
: null,
|
|
84
196
|
shipGateRequiredLanes: Array.isArray(lanes) ? lanes.filter(nonEmptyString) : [],
|
|
85
197
|
// An explicit [] is kept: it switches the min push off.
|
|
86
198
|
minPushPaths: Array.isArray(book)
|
|
@@ -90,16 +202,25 @@ export function readBkitConfig(root) {
|
|
|
90
202
|
opencodeProviders: Array.isArray(providers)
|
|
91
203
|
? providers.filter((v) => typeof v === "string" && isOpencodeProvider(v))
|
|
92
204
|
: [],
|
|
93
|
-
cloudAgents: parseCloudAgents(
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
205
|
+
cloudAgents: parseCloudAgents(cloud.agent) ?? CONFIG_DEFAULTS.cloudAgents,
|
|
206
|
+
asks: askSettings(workflows),
|
|
207
|
+
tasks: taskCaps(workflows.tasks),
|
|
208
|
+
depUpdaterOptOut: record(bkit.dependencies).updater === "none",
|
|
209
|
+
issueTrackerExplicit: tracker.default !== undefined && tracker.default !== "",
|
|
210
|
+
cloudAgentsExplicit: cloud.agent !== undefined && cloud.agent !== "",
|
|
97
211
|
};
|
|
98
212
|
}
|
|
213
|
+
/** The CI workflow file `bkit.testing.ciWorkflow` names, as `.github/workflows/<file>` relative to `root`. */
|
|
214
|
+
export function ciWorkflowPath(root) {
|
|
215
|
+
return `.github/workflows/${readBkitConfig(root).ciWorkflow}`;
|
|
216
|
+
}
|
|
99
217
|
export function trackerScope(cfg) {
|
|
218
|
+
const none = { trackerTeam: null, trackerProject: null, trackerSite: null, trackerBoard: null };
|
|
219
|
+
if (cfg.issueTracker === "github")
|
|
220
|
+
return { ...none, trackerBoard: cfg.github.project || null };
|
|
100
221
|
if (cfg.issueTracker === "linear")
|
|
101
|
-
return { trackerTeam: cfg.linear.team, trackerProject: cfg.linear.project
|
|
222
|
+
return { ...none, trackerTeam: cfg.linear.team, trackerProject: cfg.linear.project };
|
|
102
223
|
if (cfg.issueTracker === "jira")
|
|
103
|
-
return {
|
|
104
|
-
return
|
|
224
|
+
return { ...none, trackerProject: cfg.jira.project, trackerSite: cfg.jira.site };
|
|
225
|
+
return none;
|
|
105
226
|
}
|