@cbartens/bkit 6.1.1 → 6.2.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 +14 -12
- package/.bkit/core/.agents/docs.md +1 -11
- package/.bkit/core/.agents/plugins/bkit/hooks/bkit-gateguard.cjs +30 -9
- package/.bkit/core/.agents/plugins/bkit/hooks/bkit-guardrails.cjs +25 -27
- package/.bkit/core/.agents/rules.md +22 -9
- package/.bkit/core/.bkit/README.md +13 -11
- package/.bkit/core/.bkit/authoring.md +58 -13
- package/.bkit/core/.bkit/cli.md +42 -32
- package/.bkit/core/.bkit/cloud.md +93 -30
- package/.bkit/core/.bkit/install.md +55 -16
- package/.bkit/core/.bkit/jsonl.md +24 -7
- package/.bkit/core/.bkit/pipeline.md +8 -8
- package/.bkit/core/.bkit/prompts.md +160 -43
- package/.bkit/core/.bkit/providers.md +97 -36
- package/.bkit/core/.bkit/templates.md +162 -34
- package/.bkit/core/.bkit/trackers.md +39 -6
- package/.bkit/core/.bkit/workflows.md +344 -136
- package/.bkit/core/.claude/hooks/bkit-guardrails.cjs +50 -27
- package/.bkit/core/.claude/hooks/bkit-preflight.sh +11 -11
- package/.bkit/core/.codex/hooks/bkit-gateguard.cjs +13 -8
- package/.bkit/core/.codex/hooks/bkit-guardrails.cjs +14 -25
- package/.bkit/core/.cursor/hooks/bkit-guardrails.cjs +20 -9
- package/.bkit/core/.cursor/hooks/bkit-preflight.sh +8 -8
- package/.bkit/core/.opencode/plugin/bkit-gateguard.js +14 -4
- package/.bkit/core/.opencode/plugin/bkit-guardrails.js +114 -0
- package/.bkit/core/docs/templates/bkit-audit-accessibility.md +1 -1
- package/.bkit/core/docs/templates/bkit-audit-adoption.md +30 -6
- package/.bkit/core/docs/templates/bkit-audit-agents.md +1 -1
- package/.bkit/core/docs/templates/bkit-audit-aio-seo.md +1 -1
- package/.bkit/core/docs/templates/bkit-audit-analytics.md +1 -1
- package/.bkit/core/docs/templates/bkit-audit-annotations.md +1 -1
- package/.bkit/core/docs/templates/bkit-audit-app-performance.md +1 -1
- package/.bkit/core/docs/templates/bkit-audit-app-store.md +1 -1
- package/.bkit/core/docs/templates/bkit-audit-architecture.md +1 -1
- package/.bkit/core/docs/templates/bkit-audit-ci-performance.md +2 -2
- package/.bkit/core/docs/templates/bkit-audit-config.md +3 -2
- package/.bkit/core/docs/templates/bkit-audit-cost.md +1 -1
- package/.bkit/core/docs/templates/bkit-audit-coverage.md +1 -1
- package/.bkit/core/docs/templates/bkit-audit-database.md +3 -3
- package/.bkit/core/docs/templates/bkit-audit-dead-code.md +1 -1
- package/.bkit/core/docs/templates/bkit-audit-deferrals.md +1 -1
- package/.bkit/core/docs/templates/bkit-audit-dependencies.md +3 -3
- package/.bkit/core/docs/templates/bkit-audit-documentation.md +32 -2
- package/.bkit/core/docs/templates/bkit-audit-duplication.md +1 -1
- package/.bkit/core/docs/templates/bkit-audit-failures.md +1 -1
- package/.bkit/core/docs/templates/bkit-audit-flakes.md +2 -2
- package/.bkit/core/docs/templates/bkit-audit-gates.md +5 -3
- package/.bkit/core/docs/templates/bkit-audit-issues.md +1 -1
- package/.bkit/core/docs/templates/bkit-audit-llm.md +2 -2
- package/.bkit/core/docs/templates/bkit-audit-logs.md +1 -1
- package/.bkit/core/docs/templates/bkit-audit-models.md +2 -2
- package/.bkit/core/docs/templates/bkit-audit-privacy.md +1 -1
- package/.bkit/core/docs/templates/bkit-audit-prompts.md +1 -1
- package/.bkit/core/docs/templates/bkit-audit-red-team.md +2 -2
- package/.bkit/core/docs/templates/bkit-audit-reliability.md +3 -2
- package/.bkit/core/docs/templates/bkit-audit-repo.md +1 -1
- package/.bkit/core/docs/templates/bkit-audit-security.md +1 -1
- package/.bkit/core/docs/templates/bkit-audit-slop.md +1 -1
- package/.bkit/core/docs/templates/bkit-audit-testing.md +3 -2
- package/.bkit/core/docs/templates/bkit-audit-usability.md +1 -1
- package/.bkit/core/docs/templates/bkit-plan.md +38 -8
- package/.bkit/core/engine/checks/after/auth.ts +118 -47
- package/.bkit/core/engine/checks/after/github.ts +89 -37
- package/.bkit/core/engine/checks/after/index.ts +15 -3
- package/.bkit/core/engine/checks/after/tools.ts +245 -1
- package/.bkit/core/engine/checks/before/files.ts +59 -1
- package/.bkit/core/engine/checks/before/index.ts +8 -0
- package/.bkit/core/engine/checks/status-holes.ts +20 -26
- package/.bkit/core/engine/checks/tips/catalogue.ts +107 -10
- package/.bkit/core/engine/checks/tips/detect.ts +36 -3
- package/.bkit/core/engine/checks/tips/index.ts +1 -1
- package/.bkit/core/engine/cli.ts +13 -13
- package/.bkit/core/engine/commands/ci/ci.ts +64 -11
- package/.bkit/core/engine/commands/ci/push-gate.ts +101 -43
- package/.bkit/core/engine/commands/install/install.ts +28 -25
- package/.bkit/core/engine/commands/install/uninstall.ts +42 -30
- package/.bkit/core/engine/commands/install/upgrade.ts +14 -2
- package/.bkit/core/engine/commands/land.ts +2 -3
- package/.bkit/core/engine/commands/lib.ts +394 -39
- package/.bkit/core/engine/commands/registry.ts +1 -1
- package/.bkit/core/engine/commands/workflow/branches.ts +351 -78
- package/.bkit/core/engine/commands/workflow/challenge.ts +63 -14
- package/.bkit/core/engine/commands/workflow/context.ts +71 -10
- package/.bkit/core/engine/commands/workflow/counters.ts +298 -23
- package/.bkit/core/engine/commands/workflow/decisions.ts +260 -125
- package/.bkit/core/engine/commands/workflow/disk.ts +2 -1
- package/.bkit/core/engine/commands/workflow/feature-base.ts +66 -0
- package/.bkit/core/engine/commands/workflow/issues.ts +312 -17
- package/.bkit/core/engine/commands/workflow/junit.ts +204 -0
- package/.bkit/core/engine/commands/workflow/ledgers.ts +904 -99
- package/.bkit/core/engine/commands/workflow/locks.ts +186 -29
- package/.bkit/core/engine/commands/workflow/loops.ts +87 -0
- package/.bkit/core/engine/commands/workflow/open-decision.ts +251 -0
- package/.bkit/core/engine/commands/workflow/plan-blocks.ts +8 -0
- package/.bkit/core/engine/commands/workflow/plans.ts +1 -1
- package/.bkit/core/engine/commands/workflow/prs.ts +311 -16
- package/.bkit/core/engine/commands/workflow/repo.ts +1 -1
- package/.bkit/core/engine/commands/workflow/run-facts.ts +6 -0
- package/.bkit/core/engine/commands/workflow/runs.ts +877 -174
- package/.bkit/core/engine/commands/workflow/runtime.ts +12 -4
- package/.bkit/core/engine/commands/workflow/status.ts +324 -11
- package/.bkit/core/engine/commands/workflow/step-table.ts +41 -15
- package/.bkit/core/engine/commands/workflow/steps.ts +604 -29
- package/.bkit/core/engine/commands/workflow/summary-findings.ts +1 -1
- package/.bkit/core/engine/commands/workflow/summary.ts +314 -8
- package/.bkit/core/engine/commands/workflow/tasks.ts +400 -27
- package/.bkit/core/engine/commands/workflow/tests-base.ts +319 -0
- package/.bkit/core/engine/commands/workflow/tests-changed.ts +138 -74
- package/.bkit/core/engine/commands/workflow/tests-jump.ts +93 -0
- package/.bkit/core/engine/commands/workflow/tests.ts +815 -182
- package/.bkit/core/engine/commands/workflow/tracker.ts +1134 -137
- package/.bkit/core/engine/commands/workflow/workflows.ts +100 -72
- package/.bkit/core/engine/commands/workflow/worktrees.ts +421 -57
- package/.bkit/core/engine/install/cloud-env.ts +38 -10
- package/.bkit/core/engine/install/managed-block.ts +105 -0
- package/.bkit/core/engine/install/manifest.ts +7 -1
- package/.bkit/core/engine/install/modules/claude.ts +6 -2
- package/.bkit/core/engine/install/modules/cloud.ts +84 -95
- package/.bkit/core/engine/install/modules/codex.ts +10 -2
- package/.bkit/core/engine/install/modules/core.ts +148 -14
- package/.bkit/core/engine/install/modules/opencode.ts +18 -23
- package/.bkit/core/engine/install/network-allowlist.ts +8 -3
- package/.bkit/core/engine/install/project-docs.ts +650 -0
- package/.bkit/core/engine/install/template-copies.ts +58 -5
- package/.bkit/core/engine/install/write.ts +128 -7
- package/.bkit/core/engine/ledgers/journal.ts +18 -10
- package/.bkit/core/engine/ledgers/migrate.ts +20 -8
- package/.bkit/core/engine/ledgers/status.ts +604 -8
- package/.bkit/core/engine/ledgers/telemetry.ts +115 -13
- package/.bkit/core/engine/render/trackers.ts +3 -1
- package/.bkit/core/engine/shared/package-manager.ts +7 -3
- package/.bkit/core/engine/shared/settings.ts +12 -1
- package/.bkit/core/engine/shared/text.ts +14 -0
- package/.bkit/core/engine/tools/instructions-sources.ts +1 -0
- package/.bkit/core/engine/tools/instructions.ts +116 -20
- package/.bkit/core/hooks/antigravity-hook.js +20 -4
- package/.bkit/core/hooks/gateguard-edit-payload.js +8 -5
- package/.bkit/core/hooks/gateguard-engine.js +249 -23
- package/.bkit/core/hooks/guardrails-deny.js +167 -0
- package/.bkit/core/hooks/guardrails-read.js +3 -3
- package/.bkit/core/hooks/guardrails-shell.js +1122 -167
- package/.bkit/core/hooks/guardrails-tiers.js +247 -176
- package/.bkit/core/hooks/preflight-tracker.sh +219 -0
- package/.bkit/core/prompts/bkit-audit-generate.md +23 -6
- package/.bkit/core/prompts/bkit-build-challenge-1.md +5 -4
- package/.bkit/core/prompts/bkit-build-challenge-2.md +6 -5
- package/.bkit/core/prompts/bkit-build-install-skills.md +2 -2
- package/.bkit/core/prompts/bkit-build-plan-convert.md +21 -7
- package/.bkit/core/prompts/bkit-build-plan-current.md +5 -4
- package/.bkit/core/prompts/bkit-build-plan-gaps-remediate.md +22 -17
- package/.bkit/core/prompts/bkit-build-plan-tasks.md +16 -12
- package/.bkit/core/prompts/bkit-build-plan-tests.md +14 -10
- package/.bkit/core/prompts/bkit-build-plan-verify.md +21 -8
- package/.bkit/core/prompts/bkit-debug-abort-handover.md +10 -5
- package/.bkit/core/prompts/bkit-debug-failure-diagnose.md +22 -6
- package/.bkit/core/prompts/bkit-debug-failure-remediate.md +19 -3
- package/.bkit/core/prompts/bkit-debug-failure-reproduce.md +22 -6
- package/.bkit/core/prompts/bkit-debug-failure-soak.md +10 -7
- package/.bkit/core/prompts/bkit-design-brainstorm-ideate-1.md +3 -3
- package/.bkit/core/prompts/bkit-design-brainstorm-ideate-2.md +4 -4
- package/.bkit/core/prompts/bkit-design-brainstorm-ideate-3.md +3 -3
- package/.bkit/core/prompts/bkit-design-generate.md +6 -4
- package/.bkit/core/prompts/bkit-design-organise.md +4 -3
- package/.bkit/core/prompts/bkit-design-review-1.md +5 -4
- package/.bkit/core/prompts/bkit-design-review-2.md +6 -5
- package/.bkit/core/prompts/bkit-design-spike.md +4 -3
- package/.bkit/core/prompts/bkit-design-update.md +6 -4
- package/.bkit/core/prompts/bkit-plan-generate.md +35 -14
- package/.bkit/core/prompts/bkit-plan-review-1.md +9 -7
- package/.bkit/core/prompts/bkit-plan-review-2.md +9 -7
- package/.bkit/core/prompts/bkit-plan-scope-check.md +8 -6
- package/.bkit/core/prompts/bkit-plan-update.md +22 -8
- package/.bkit/core/prompts/bkit-ship-conflict-resolve.md +11 -8
- package/.bkit/core/prompts/bkit-ship-deferred-sweep.md +9 -5
- package/.bkit/core/prompts/bkit-ship-update-docs.md +26 -4
- package/.bkit/core/prompts/bkit-utility-compress-markdown.md +3 -3
- package/.bkit/core/prompts/bkit-utility-update-decisions.md +10 -7
- package/.bkit/core/prompts/bkit-utility-update-deferrals.md +8 -5
- package/.bkit/core/prompts/bkit-utility-update-documentation.md +31 -7
- package/.bkit/core/prompts/bkit-utility-update-failures.md +8 -5
- package/.bkit/core/prompts/bkit-utility-update-knowledge.md +10 -7
- package/.bkit/core/prompts/bkit-utility-update-roadmap.md +4 -4
- package/.bkit/core/prompts/bkit-utility-update-tracker.md +4 -4
- package/.bkit/core/workflows/bkit-auto.md +23 -11
- package/.bkit/core/workflows/bkit-build.md +331 -100
- package/.bkit/core/workflows/bkit-debug.md +135 -64
- package/.bkit/core/workflows/bkit-design.md +58 -32
- package/.bkit/core/workflows/bkit-plan.md +73 -45
- package/.bkit/core/workflows/bkit-ship.md +233 -167
- package/.bkit/shared/.agents/plugins/bkit/hooks.json +1 -1
- package/.bkit/shared/.bkit/.env.example +5 -0
- package/.bkit/shared/.claude/bkit-cloud.md +7 -7
- package/.bkit/shared/.claude/settings.json +5 -1
- package/.bkit/shared/.cursor/bkit-cloud.md +1 -1
- package/.bkit/shared/.cursor/hooks.json +1 -1
- package/.bkit/shared/.opencode/opencode.json +11 -2
- package/.bkit/templates/.claude/hooks/bkit-cloud-bootstrap.sh +27 -0
- package/.bkit/templates/.cursor/Dockerfile +7 -7
- package/.bkit/templates/.github/ISSUE_TEMPLATE/bkit-idea.yml +1 -1
- package/.bkit/templates/.github/dependabot.yml +5 -0
- package/.bkit/templates/.github/renovate.json5 +5 -3
- package/.bkit/templates/.github/workflows/bkit-ci.yml +11 -11
- package/.bkit/templates/.github/workflows/bkit-cloud.yml +525 -161
- package/.bkit/templates/.github/workflows/bkit-renovate.yml +2 -2
- package/.bkit/templates/.husky/pre-push +123 -6
- package/.bkit/templates/context/bkit-serena.md +1 -1
- package/.bkit/templates/docs/architecture.md +98 -0
- package/.bkit/templates/docs/capabilities.md +33 -37
- package/.bkit/templates/docs/components.md +142 -0
- package/.bkit/templates/docs/data-schema.md +87 -0
- package/.bkit/{shared → templates}/docs/deployments.md +128 -142
- package/.bkit/templates/docs/design.md +117 -0
- package/.bkit/templates/docs/noise.md +54 -0
- package/.bkit/templates/docs/observability.md +99 -0
- package/.bkit/templates/docs/security.md +137 -0
- package/.bkit/templates/docs/setup.md +93 -0
- package/.bkit/templates/docs/technology.md +70 -0
- package/.bkit/{shared → templates}/docs/testing.md +200 -87
- package/.bkit/templates/scripts/ci/bkit-machine-lock.sh +511 -103
- package/.bkit/templates/scripts/ci/bkit-test-awake.mjs +228 -35
- package/.bkit/templates/scripts/ci/bkit-test-awake.test.mjs +270 -2
- package/.bkit/templates/scripts/graphify/bkit-graphify-graphml.py +1 -1
- package/.bkit/templates/scripts/graphify/bkit-graphify-rollup.py +92 -63
- package/.bkit/templates/scripts/graphify/bkit-graphify.sh +59 -11
- package/.bkit/templates/slop-scan.config.json +2 -0
- package/CHANGELOG.md +64 -0
- package/DETAILS.md +24 -19
- package/README.md +1 -1
- package/dist/checks/after/auth.js +114 -46
- package/dist/checks/after/github.js +77 -35
- package/dist/checks/after/index.js +12 -3
- package/dist/checks/after/tools.js +224 -1
- package/dist/checks/before/files.js +59 -1
- package/dist/checks/before/index.js +7 -1
- package/dist/checks/status-holes.js +20 -21
- package/dist/checks/tips/catalogue.js +99 -10
- package/dist/checks/tips/detect.js +35 -3
- package/dist/checks/tips/index.js +1 -1
- package/dist/cli.js +13 -13
- package/dist/commands/ci/ci.js +56 -12
- package/dist/commands/ci/push-gate.js +79 -44
- package/dist/commands/install/install.js +23 -22
- package/dist/commands/install/uninstall.js +36 -30
- package/dist/commands/install/upgrade.js +10 -2
- package/dist/commands/land.js +2 -3
- package/dist/commands/lib.js +323 -25
- package/dist/commands/workflow/branches.js +312 -72
- package/dist/commands/workflow/challenge.js +66 -13
- package/dist/commands/workflow/context.js +46 -10
- package/dist/commands/workflow/counters.js +231 -23
- package/dist/commands/workflow/decisions.js +221 -106
- package/dist/commands/workflow/disk.js +2 -1
- package/dist/commands/workflow/feature-base.js +60 -0
- package/dist/commands/workflow/issues.js +243 -15
- package/dist/commands/workflow/junit.js +137 -0
- package/dist/commands/workflow/ledgers.js +726 -112
- package/dist/commands/workflow/locks.js +150 -29
- package/dist/commands/workflow/loops.js +67 -0
- package/dist/commands/workflow/open-decision.js +199 -0
- package/dist/commands/workflow/plan-blocks.js +6 -0
- package/dist/commands/workflow/plans.js +1 -1
- package/dist/commands/workflow/prs.js +272 -16
- package/dist/commands/workflow/repo.js +1 -1
- package/dist/commands/workflow/run-facts.js +6 -0
- package/dist/commands/workflow/runs.js +747 -155
- package/dist/commands/workflow/runtime.js +8 -4
- package/dist/commands/workflow/status.js +259 -13
- package/dist/commands/workflow/step-table.js +41 -15
- package/dist/commands/workflow/steps.js +530 -26
- package/dist/commands/workflow/summary-findings.js +1 -1
- package/dist/commands/workflow/summary.js +289 -8
- package/dist/commands/workflow/tasks.js +294 -27
- package/dist/commands/workflow/tests-base.js +266 -0
- package/dist/commands/workflow/tests-changed.js +130 -56
- package/dist/commands/workflow/tests-jump.js +77 -0
- package/dist/commands/workflow/tests.js +608 -131
- package/dist/commands/workflow/tracker.js +920 -112
- package/dist/commands/workflow/workflows.js +80 -59
- package/dist/commands/workflow/worktrees.js +387 -58
- package/dist/install/cloud-env.js +32 -10
- package/dist/install/managed-block.js +101 -0
- package/dist/install/manifest.js +7 -1
- package/dist/install/modules/claude.js +6 -2
- package/dist/install/modules/cloud.js +73 -86
- package/dist/install/modules/codex.js +9 -2
- package/dist/install/modules/core.js +133 -14
- package/dist/install/modules/opencode.js +18 -23
- package/dist/install/network-allowlist.js +8 -3
- package/dist/install/project-docs.js +551 -0
- package/dist/install/template-copies.js +55 -5
- package/dist/install/write.js +117 -5
- package/dist/ledgers/journal.js +10 -8
- package/dist/ledgers/migrate.js +20 -9
- package/dist/ledgers/status.js +461 -8
- package/dist/ledgers/telemetry.js +71 -13
- package/dist/render/trackers.js +3 -1
- package/dist/shared/package-manager.js +7 -2
- package/dist/shared/settings.js +8 -0
- package/dist/shared/text.js +13 -0
- package/dist/tools/instructions-sources.js +1 -0
- package/dist/tools/instructions.js +97 -24
- package/package.json +22 -15
- package/.bkit/core/hooks/preflight-linear.sh +0 -73
- package/.bkit/shared/docs/architecture.md +0 -16
- package/.bkit/shared/docs/data-schema.md +0 -16
- package/.bkit/shared/docs/design.md +0 -38
- package/.bkit/shared/docs/noise.md +0 -20
- package/.bkit/shared/docs/observability.md +0 -22
- package/.bkit/shared/docs/security.md +0 -62
- package/.bkit/shared/docs/setup.md +0 -52
- package/.bkit/shared/docs/technology.md +0 -15
- /package/.bkit/templates/{.lintstagedrc.json → lintstagedrc.example.json} +0 -0
- /package/.bkit/templates/{.prettierignore → prettierignore.example} +0 -0
|
@@ -6,13 +6,14 @@ import * as path from "node:path";
|
|
|
6
6
|
import { writeTier1, writeTier2, ensurePackageJsonScripts } from "../write.js";
|
|
7
7
|
import { readBkitVersion, writeBkitVersion, hashFile, mergeCanonicalHashes, sha256, } from "../version-file.js";
|
|
8
8
|
import { extractManagedBlock, findLineAnchoredMarkers, selectMarkers, stripManagedBlock, } from "../managed-block.js";
|
|
9
|
-
import { listFilesRecursive, syncTemplateCopies } from "../template-copies.js";
|
|
9
|
+
import { listFilesRecursive, warnMissingLintStagedConfig, syncTemplateCopies, } from "../template-copies.js";
|
|
10
10
|
import { PAYLOAD_LINK_RELPATHS, syncPayloadLinks } from "../payload-links.js";
|
|
11
11
|
import { writeNetworkAllowlist } from "../network-allowlist.js";
|
|
12
12
|
import { migrateContextCiWorkflow } from "../context-ci-workflow.js";
|
|
13
13
|
import { migrateTemplateNotes } from "../template-notes.js";
|
|
14
14
|
import { isAdvisorySuppressed } from "../../checks/after/suppression.js";
|
|
15
15
|
import { parseJson, readJsonFile } from "../../shared/json.js";
|
|
16
|
+
import { compareSemver } from "../../shared/bkit-latest.js";
|
|
16
17
|
import { readInstallingVersion } from "../../shared/package-json.js";
|
|
17
18
|
import { detectDepUpdater } from "../../shared/dep-updater.js";
|
|
18
19
|
import { ASK_POINTS, CONFIG_DEFAULTS, ciWorkflowPath, limitKey } from "../../shared/settings.js";
|
|
@@ -145,8 +146,8 @@ export function listCoreTemplateFiles(root = getCoreRoot()) {
|
|
|
145
146
|
}
|
|
146
147
|
/**
|
|
147
148
|
* The shared payload files core writes, sourced from `root` (defaults to the
|
|
148
|
-
* resolved shared root): the
|
|
149
|
-
*
|
|
149
|
+
* resolved shared root): the two shared-root files the core manifest owns. The ten project
|
|
150
|
+
* documents are copy-and-own starters under `templates/docs/`, never written here.
|
|
150
151
|
*/
|
|
151
152
|
export function listSharedTemplateFiles(root = getSharedRoot()) {
|
|
152
153
|
const out = [];
|
|
@@ -155,14 +156,6 @@ export function listSharedTemplateFiles(root = getSharedRoot()) {
|
|
|
155
156
|
if (fs.existsSync(src))
|
|
156
157
|
out.push({ src, dst, scope: "block", marker: "html-comment" });
|
|
157
158
|
}
|
|
158
|
-
for (const name of listMdFiles(path.join(root, "docs"))) {
|
|
159
|
-
out.push({
|
|
160
|
-
src: path.join(root, "docs", name),
|
|
161
|
-
dst: path.join("docs", name),
|
|
162
|
-
scope: "block",
|
|
163
|
-
marker: "html-comment",
|
|
164
|
-
});
|
|
165
|
-
}
|
|
166
159
|
return out;
|
|
167
160
|
}
|
|
168
161
|
function runCoreTemplates(dryRun, tokens, ws, logPrefix) {
|
|
@@ -259,6 +252,7 @@ export function runBkitDocs(dryRun, tokens, ws, logPrefix) {
|
|
|
259
252
|
migrateTemplateNotes(dryRun, ws, logPrefix);
|
|
260
253
|
migrateContextCiWorkflow(dryRun, ws, logPrefix);
|
|
261
254
|
migrateSlopTypeSuppression(dryRun, ws, logPrefix);
|
|
255
|
+
migrateMachineLockCopy(dryRun, ws, logPrefix);
|
|
262
256
|
const renames = migrateBrandedTemplateFiles(dryRun, ws, logPrefix);
|
|
263
257
|
migrateBrandedFileTokens(dryRun, ws, logPrefix, renames);
|
|
264
258
|
migrateBrandedCheckNames(dryRun, ws, logPrefix, tokens.DEFAULT_BRANCH);
|
|
@@ -477,6 +471,9 @@ export function seedCorePackageJsonScripts(ctx) {
|
|
|
477
471
|
if (pruneMinPushPaths(dryRun, ws, logPrefix) && !written.includes("package.json")) {
|
|
478
472
|
written.push("package.json");
|
|
479
473
|
}
|
|
474
|
+
if (lowerVerifyMaxAttempts(dryRun, ws, logPrefix) && !written.includes("package.json")) {
|
|
475
|
+
written.push("package.json");
|
|
476
|
+
}
|
|
480
477
|
if (seedBkitDefaults(dryRun, ws, logPrefix) && !written.includes("package.json")) {
|
|
481
478
|
written.push("package.json");
|
|
482
479
|
}
|
|
@@ -512,7 +509,7 @@ export const SEEDED_BKIT_DEFAULTS = {
|
|
|
512
509
|
cloud: { agent: "" },
|
|
513
510
|
providers: { opencode: { default: "", installed: [] } },
|
|
514
511
|
testing: {
|
|
515
|
-
// What bkit writes (ship's bookkeeping allow-list, the plans tree) is always a min push;
|
|
512
|
+
// What bkit writes (ship's bookkeeping allow-list, the plans tree, docs/audits/**) is always a min push;
|
|
516
513
|
// the seed adds nothing, because a project doc can be a test's input.
|
|
517
514
|
minPushPaths: [...CONFIG_DEFAULTS.minPushPaths],
|
|
518
515
|
ciWorkflow: CONFIG_DEFAULTS.ciWorkflow,
|
|
@@ -692,6 +689,89 @@ function migrateSlopTypeSuppression(dryRun, ws, logPrefix) {
|
|
|
692
689
|
ws.writes.push({ path: file, action: "update", unhashed: true });
|
|
693
690
|
console.log(`${logPrefix} ${tag}core: ${file} — slop plugin updated`);
|
|
694
691
|
}
|
|
692
|
+
// sha256 of every released scripts/ci/bkit-machine-lock.sh text older than the current template (6.1.0, 6.1.1).
|
|
693
|
+
const SHIPPED_MACHINE_LOCK_HASHES = [
|
|
694
|
+
"63ee5873795fd06b60e1f13c238c9e3c44d9f6dc76a50fe271793de6ad284e87",
|
|
695
|
+
];
|
|
696
|
+
// Migration (6.1.0-6.2.x installs, docs/migrations.md): replace an unedited adopted machine-lock
|
|
697
|
+
// copy with the current template; warn about an edited copy that lacks the queue, never writes
|
|
698
|
+
// the status file or has no hold limit. A copy that starts bkit-test-awake.mjs gets that file
|
|
699
|
+
// beside it (see `migrateHoldSupervisor`).
|
|
700
|
+
function migrateMachineLockCopy(dryRun, ws, logPrefix) {
|
|
701
|
+
const file = path.join("scripts", "ci", "bkit-machine-lock.sh");
|
|
702
|
+
const stat = fs.lstatSync(file, { throwIfNoEntry: false });
|
|
703
|
+
if (!stat)
|
|
704
|
+
return;
|
|
705
|
+
const tag = dryRun ? "[dry-run] " : "";
|
|
706
|
+
const templatePath = ".bkit/templates/scripts/ci/bkit-machine-lock.sh";
|
|
707
|
+
const outOfOrder = "waiting runs take the lock out of arrival order";
|
|
708
|
+
const manual = (reason, until = outOfOrder) => {
|
|
709
|
+
console.warn(`${logPrefix} ${tag}core: ${file} left unchanged (${reason}); merge ${templatePath} by hand, until then ${until}`);
|
|
710
|
+
};
|
|
711
|
+
if (linkedPath(file) || !stat.isFile()) {
|
|
712
|
+
manual("the path is not a regular file or sits under a symlink");
|
|
713
|
+
return;
|
|
714
|
+
}
|
|
715
|
+
const current = fs.readFileSync(file);
|
|
716
|
+
const template = fs.readFileSync(path.join(getTemplatesRoot(), "scripts", "ci", "bkit-machine-lock.sh"));
|
|
717
|
+
const text = current.toString("utf8");
|
|
718
|
+
if (current.equals(template)) {
|
|
719
|
+
migrateHoldSupervisor(dryRun, ws, logPrefix);
|
|
720
|
+
return;
|
|
721
|
+
}
|
|
722
|
+
if (SHIPPED_MACHINE_LOCK_HASHES.includes(sha256(current))) {
|
|
723
|
+
if (!dryRun)
|
|
724
|
+
fs.writeFileSync(file, template);
|
|
725
|
+
ws.writes.push({ path: file, action: "update", unhashed: true });
|
|
726
|
+
console.log(`${logPrefix} ${tag}core: ${file} — machine lock updated to the current template`);
|
|
727
|
+
migrateHoldSupervisor(dryRun, ws, logPrefix);
|
|
728
|
+
return;
|
|
729
|
+
}
|
|
730
|
+
if (text.includes("bkit-test-awake.mjs"))
|
|
731
|
+
migrateHoldSupervisor(dryRun, ws, logPrefix);
|
|
732
|
+
if (!text.includes(".queue"))
|
|
733
|
+
manual("the copy differs from the shipped version");
|
|
734
|
+
if (!text.includes("LOCAL_STACK_LOCK_STATUS_FILE"))
|
|
735
|
+
manual("the copy never writes LOCAL_STACK_LOCK_STATUS_FILE", "a lock wait that gives up reads as a gate failure (exit 1) instead of exit 81");
|
|
736
|
+
if (!text.includes("LOCAL_STACK_LOCK_HOLD_S"))
|
|
737
|
+
manual("the copy has no LOCAL_STACK_LOCK_HOLD_S hold limit", "a hung run holds the tests lock until someone stops it by hand");
|
|
738
|
+
}
|
|
739
|
+
// sha256 of every scripts/ci/bkit-test-awake.mjs template text in history older than the current one.
|
|
740
|
+
const SHIPPED_AWAKE_HASHES = [
|
|
741
|
+
"d218439bd4d65b57732a96aaea7bb678f9ebf95a6247f5e6b899d6ef26a59cb5",
|
|
742
|
+
"a686bf75700f2ff54de2cedd3b7afc943774da40a68c243b9911bc435742f434",
|
|
743
|
+
"0842c2e2789a1c77935655130de5b8cf253bfe0655407834f23a6abaaf1b0bb1",
|
|
744
|
+
"0dce1b50638cd609183a871ed8d0d9e3d20c545073f0a32f18526d6f38b5b748",
|
|
745
|
+
];
|
|
746
|
+
// The machine-lock script runs a command holding its own tests lock under
|
|
747
|
+
// scripts/ci/bkit-test-awake.mjs --hold-s: write the template there when the file is missing,
|
|
748
|
+
// replace an unedited shipped copy, and warn about an edited copy without --hold-s, since the
|
|
749
|
+
// lock script refuses every such run with exit 73.
|
|
750
|
+
function migrateHoldSupervisor(dryRun, ws, logPrefix) {
|
|
751
|
+
const file = path.join("scripts", "ci", "bkit-test-awake.mjs");
|
|
752
|
+
const tag = dryRun ? "[dry-run] " : "";
|
|
753
|
+
const template = path.join(getTemplatesRoot(), "scripts", "ci", "bkit-test-awake.mjs");
|
|
754
|
+
if (!fs.lstatSync(file, { throwIfNoEntry: false })) {
|
|
755
|
+
if (!dryRun)
|
|
756
|
+
fs.copyFileSync(template, file);
|
|
757
|
+
ws.writes.push({ path: file, action: "write", unhashed: true });
|
|
758
|
+
console.log(`${logPrefix} ${tag}core: ${file} — added beside the machine lock, which runs its hold limit`);
|
|
759
|
+
return;
|
|
760
|
+
}
|
|
761
|
+
const stat = fs.statSync(file, { throwIfNoEntry: false });
|
|
762
|
+
if (stat?.isFile() &&
|
|
763
|
+
!linkedPath(file) &&
|
|
764
|
+
SHIPPED_AWAKE_HASHES.includes(sha256(fs.readFileSync(file)))) {
|
|
765
|
+
if (!dryRun)
|
|
766
|
+
fs.copyFileSync(template, file);
|
|
767
|
+
ws.writes.push({ path: file, action: "update", unhashed: true });
|
|
768
|
+
console.log(`${logPrefix} ${tag}core: ${file} — test sleep prevention updated to the current template`);
|
|
769
|
+
return;
|
|
770
|
+
}
|
|
771
|
+
if (stat?.isFile() && fs.readFileSync(file, "utf8").includes("--hold-s"))
|
|
772
|
+
return;
|
|
773
|
+
console.warn(`${logPrefix} ${tag}core: ${file} left unchanged (it has no --hold-s hold limit); merge .bkit/templates/scripts/ci/bkit-test-awake.mjs by hand, until then every run that holds the tests lock is refused with exit 73`);
|
|
774
|
+
}
|
|
695
775
|
// Every `.github/workflows/*.yml` / `*.yaml` regular file outside `skip`.
|
|
696
776
|
function otherWorkflows(skip) {
|
|
697
777
|
const dir = path.join(".github", "workflows");
|
|
@@ -1332,7 +1412,7 @@ export const BKIT_LAYOUT_MOVES = [
|
|
|
1332
1412
|
];
|
|
1333
1413
|
// Migration (up to 6.0.x installs, `docs/migrations.md`): `bkit.testing.minPushPaths` was the
|
|
1334
1414
|
// whole min-push list, so installs seeded and repos restated what bkit itself writes. The
|
|
1335
|
-
// engine now always allows that floor (ship's bookkeeping allow-list, `docs/plans/**`) and
|
|
1415
|
+
// engine now always allows that floor (ship's bookkeeping allow-list, `docs/plans/**`, `docs/audits/**`) and
|
|
1336
1416
|
// `bkit.testing.ciSkipPaths`; the setting only adds. Entries the floor already covers are
|
|
1337
1417
|
// dropped from the list. Returns true when package.json changed.
|
|
1338
1418
|
export const MIN_PUSH_FLOOR_ENTRIES = [
|
|
@@ -1367,6 +1447,44 @@ export function pruneMinPushPaths(dryRun, ws, logPrefix) {
|
|
|
1367
1447
|
console.log(`${logPrefix} ${dryRun ? "[dry-run] " : ""}core: dropped [${dropped.join(", ")}] from bkit.testing.minPushPaths in package.json — bkit always allows what it writes, and ciSkipPaths counts`);
|
|
1368
1448
|
return true;
|
|
1369
1449
|
}
|
|
1450
|
+
const LAST_RELEASE_WITHOUT_VERIFY_CAP = "6.1.1";
|
|
1451
|
+
// Migration (up to 6.1.x installs, `docs/migrations.md`): `bkit.workflows.build.verify.maxAttempts`
|
|
1452
|
+
// is one non-resetting allowance per run, and every build limit is 2. A value above 2 is
|
|
1453
|
+
// lowered to 2 once, on the upgrade from an install that predates this release (no recorded
|
|
1454
|
+
// version, an unreadable one, or an older one); 2 or less is left alone, and a value set after
|
|
1455
|
+
// that upgrade is the consumer's. Returns true when package.json changed.
|
|
1456
|
+
export function lowerVerifyMaxAttempts(dryRun, ws, logPrefix) {
|
|
1457
|
+
const pkgPath = "package.json";
|
|
1458
|
+
if (!fs.existsSync(pkgPath))
|
|
1459
|
+
return false;
|
|
1460
|
+
const recorded = readBkitVersion(path.join(".bkit", "version"))?.pinnedVersion ?? "";
|
|
1461
|
+
// Skip a re-run of the same version, and any install recorded after the last release without
|
|
1462
|
+
// this migration, so a value set after the upgrade to this release is never lowered again.
|
|
1463
|
+
const order = compareSemver(recorded, readInstallingVersion());
|
|
1464
|
+
if (order === 0 || order === 1)
|
|
1465
|
+
return false;
|
|
1466
|
+
if (compareSemver(recorded, LAST_RELEASE_WITHOUT_VERIFY_CAP) === 1)
|
|
1467
|
+
return false;
|
|
1468
|
+
const raw = fs.readFileSync(pkgPath, "utf-8");
|
|
1469
|
+
const parsed = parseJson(raw);
|
|
1470
|
+
if (!parsed.ok)
|
|
1471
|
+
return false;
|
|
1472
|
+
const pkg = parsed.value;
|
|
1473
|
+
if (!plainObject(pkg.bkit) || !plainObject(pkg.bkit.workflows))
|
|
1474
|
+
return false;
|
|
1475
|
+
const build = pkg.bkit.workflows.build;
|
|
1476
|
+
if (!plainObject(build) || !plainObject(build.verify))
|
|
1477
|
+
return false;
|
|
1478
|
+
const old = build.verify.maxAttempts;
|
|
1479
|
+
if (typeof old !== "number" || old <= 2)
|
|
1480
|
+
return false;
|
|
1481
|
+
build.verify.maxAttempts = 2;
|
|
1482
|
+
ws.writes.push({ path: pkgPath, action: "update" });
|
|
1483
|
+
if (!dryRun)
|
|
1484
|
+
writePackageJsonLike(raw, pkg);
|
|
1485
|
+
console.log(`${logPrefix} ${dryRun ? "[dry-run] " : ""}core: lowered bkit.workflows.build.verify.maxAttempts from ${old} to 2 in package.json — the holistic allowance is one per run`);
|
|
1486
|
+
return true;
|
|
1487
|
+
}
|
|
1370
1488
|
// Fill `into` with each `from` key it lacks, descending into blocks both sides hold.
|
|
1371
1489
|
function mergeMissing(into, from) {
|
|
1372
1490
|
for (const [k, v] of Object.entries(from)) {
|
|
@@ -1608,7 +1726,7 @@ export function detectGateAdvisories(cwd) {
|
|
|
1608
1726
|
id: "test-file-script-missing",
|
|
1609
1727
|
severity: "advisory",
|
|
1610
1728
|
detect: `package.json does not declare \`${BKIT_TEST_FILE_SCRIPT}\`, so \`/bkit-build\` cannot check that each task's tests fail before its code is written.`,
|
|
1611
|
-
action: `Add \`${BKIT_TEST_FILE_SCRIPT}\` to package.json: it runs the ONE test file bkit appends as its argument (repo-relative path) and writes a JUnit report to the path in \`$BKIT_TEST_REPORT\`. Vitest example:\n\n "${BKIT_TEST_FILE_SCRIPT}": "vitest run --reporter=default --reporter=junit --outputFile.junit=\\"$BKIT_TEST_REPORT\\""\n\
|
|
1729
|
+
action: `Add \`${BKIT_TEST_FILE_SCRIPT}\` to package.json: it runs the ONE test file bkit appends as its argument (repo-relative path) and writes a JUnit report to the path in \`$BKIT_TEST_REPORT\`. Vitest example:\n\n "${BKIT_TEST_FILE_SCRIPT}": "vitest run --reporter=default --reporter=junit --outputFile.junit=\\"$BKIT_TEST_REPORT\\""\n\njest reads a bare path as a regex, so a folder such as \`(tabs)\` matches no file: pass \`--runTestsByPath\`. Call the runner directly, not through a task runner that caches results or runs dependent packages first. A monorepo routes the path to the package and config that own it.`,
|
|
1612
1730
|
});
|
|
1613
1731
|
}
|
|
1614
1732
|
// A red recorded before the linter sees the test: a lint rewrite after it reads as an
|
|
@@ -1702,6 +1820,7 @@ export function runCoreModule(ctx) {
|
|
|
1702
1820
|
console.log(`${logPrefix} ${tag}template ${verb}: ${path.join(TEMPLATE_COPIES_DIR, p)}`);
|
|
1703
1821
|
}
|
|
1704
1822
|
}
|
|
1823
|
+
warnMissingLintStagedConfig(cwd, logPrefix);
|
|
1705
1824
|
// 3b3. Payload view links — `.bkit/core` + `.bkit/shared` symlinks into the
|
|
1706
1825
|
// installed package (browse-only, gitignored; no-op in dogfood). A real
|
|
1707
1826
|
// directory or file at either path is never clobbered (advisory); a platform
|
|
@@ -116,8 +116,9 @@ export function opencodeProviderEnvVar(providerKey) {
|
|
|
116
116
|
* secret `env:` var. `bkit install --opencode=<provider>` rewrites neither; this advisory names
|
|
117
117
|
* the hand-edit.
|
|
118
118
|
*
|
|
119
|
-
* bkit-cloud.yml runs `opencode run` against the committed `.opencode/` config and
|
|
120
|
-
* `
|
|
119
|
+
* bkit-cloud.yml runs `opencode run` against the committed `.opencode/` config and passes
|
|
120
|
+
* the provider's `BKIT_` secret (`BKIT_OPENCODE_API_KEY`, `BKIT_OPENROUTER_API_KEY` or
|
|
121
|
+
* `BKIT_OLLAMA_API_KEY`) under its own env var name, so it is not checked.
|
|
121
122
|
*
|
|
122
123
|
* No-op when opencode.yml is absent. No equivalent check for claude.yml (provider-fixed to
|
|
123
124
|
* Claude). Severity "advisory": never gates `bkit check`; surfaces on both check and postinstall.
|
|
@@ -174,7 +175,7 @@ export function detectOpencodeYmlProviderDrift(cwd) {
|
|
|
174
175
|
" model: " +
|
|
175
176
|
expectedPrefix +
|
|
176
177
|
"/<model> # a model your provider serves (see .opencode/opencode.json)\n\n" +
|
|
177
|
-
"Keep opencode.yml in sync with .opencode/opencode.json on every provider switch. (bkit-cloud.yml needs no such edit: it reads .opencode/ and
|
|
178
|
+
"Keep opencode.yml in sync with .opencode/opencode.json on every provider switch. (bkit-cloud.yml needs no such edit: it reads .opencode/ and passes the provider's BKIT_ secret under its own name.)",
|
|
178
179
|
};
|
|
179
180
|
}
|
|
180
181
|
// Sentinel values used in the opencode.json template for tracker-filtered mcp injection.
|
|
@@ -188,10 +189,8 @@ const OPENCODE_PROVIDER_BASE_URL_SENTINEL = "@@OPENCODE_PROVIDER_BASE_URL@@";
|
|
|
188
189
|
* and fills in provider-specific fields.
|
|
189
190
|
*
|
|
190
191
|
* Also injects derived **allow** rules for {@link resolveNetworkAllowlist} so
|
|
191
|
-
* context-fetch / provider hosts do not prompt on
|
|
192
|
-
* `
|
|
193
|
-
* last-match-wins), and `*{domain}*` into the `permission.webfetch` URL map (after its
|
|
194
|
-
* `"*": "ask"`). Adds `<server>_*` allows for the consumer's `mcp-servers` block.
|
|
192
|
+
* context-fetch / provider hosts do not prompt on the fetch tool: `*{domain}*` into the
|
|
193
|
+
* `permission.webfetch` URL map (after its `"*": "ask"`); shell fetches keep asking. Adds `<server>_*` allows for the consumer's `mcp-servers` block.
|
|
195
194
|
*/
|
|
196
195
|
export function renderOpencodeJson(templatePath, tracker, provider, cwd = process.cwd()) {
|
|
197
196
|
const raw = fs.readFileSync(templatePath, "utf-8");
|
|
@@ -280,12 +279,10 @@ export function renderOpencodeJson(templatePath, tracker, provider, cwd = proces
|
|
|
280
279
|
* last-match-wins), and one `<server>_*` allow per declared MCP server — opencode names
|
|
281
280
|
* MCP tools `<server>_<tool>` and matches permission keys as globs against the tool name.
|
|
282
281
|
*
|
|
283
|
-
*
|
|
284
|
-
*
|
|
285
|
-
*
|
|
286
|
-
*
|
|
287
|
-
* - shell fetch — `permission.bash` gains `curl *{base}*` / `wget *{base}*` after the
|
|
288
|
-
* template's `curl *` / `wget *` ask.
|
|
282
|
+
* Only the fetch tool gets derived allows: `permission.webfetch` is a URL-keyed map
|
|
283
|
+
* (`{ "*": "ask" }` from the template); opencode matches the resource against the URL, so
|
|
284
|
+
* `*{base}*` allows it (accepted risk, decision 551). Shell `curl` / `wget` keep the
|
|
285
|
+
* template's ask, because a glob over the command string also matches a host in a query.
|
|
289
286
|
*/
|
|
290
287
|
function injectOpencodeDerivedAllows(parsed, cwd) {
|
|
291
288
|
const permission = parsed.permission;
|
|
@@ -295,13 +292,6 @@ function injectOpencodeDerivedAllows(parsed, cwd) {
|
|
|
295
292
|
permission[`${server}_*`] = "allow";
|
|
296
293
|
}
|
|
297
294
|
const bases = networkAllowlistBases(resolveNetworkAllowlist(cwd));
|
|
298
|
-
if (typeof permission.bash === "object" && permission.bash !== null) {
|
|
299
|
-
const bash = permission.bash;
|
|
300
|
-
for (const base of bases) {
|
|
301
|
-
bash[`curl *${base}*`] = "allow";
|
|
302
|
-
bash[`wget *${base}*`] = "allow";
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
295
|
// Fetch tool — opencode matches the webfetch resource against the requested URL.
|
|
306
296
|
if (typeof permission.webfetch === "object" && permission.webfetch !== null) {
|
|
307
297
|
const webfetch = permission.webfetch;
|
|
@@ -450,9 +440,14 @@ export function runOpencodeModule(ctx) {
|
|
|
450
440
|
}
|
|
451
441
|
}
|
|
452
442
|
}
|
|
453
|
-
// --- bkit-gateguard.js / bkit-readguard.js / bkit-rules.js — Tier-2
|
|
454
|
-
// (slash-comment); see install/manifest.ts ---
|
|
455
|
-
for (const plugin of [
|
|
443
|
+
// --- bkit-gateguard.js / bkit-readguard.js / bkit-rules.js / bkit-guardrails.js — Tier-2
|
|
444
|
+
// markered-text (slash-comment); see install/manifest.ts ---
|
|
445
|
+
for (const plugin of [
|
|
446
|
+
"bkit-gateguard.js",
|
|
447
|
+
"bkit-readguard.js",
|
|
448
|
+
"bkit-rules.js",
|
|
449
|
+
"bkit-guardrails.js",
|
|
450
|
+
]) {
|
|
456
451
|
const opencodeCore = path.join(getCoreRoot(), ".opencode", "plugin");
|
|
457
452
|
const pluginSrc = path.join(opencodeCore, plugin);
|
|
458
453
|
const pluginDst = `.opencode/plugin/${plugin}`;
|
|
@@ -5,15 +5,20 @@
|
|
|
5
5
|
// it exists for every host that reads it and `bkit check` reports it missing or stale.
|
|
6
6
|
import * as fs from "node:fs";
|
|
7
7
|
import * as path from "node:path";
|
|
8
|
-
import { resolveNetworkAllowlist } from "./cloud-env.js";
|
|
8
|
+
import { egressFingerprint, resolveNetworkAllowlist } from "./cloud-env.js";
|
|
9
9
|
import { readBkitVersion } from "./version-file.js";
|
|
10
10
|
/** Consumer-relative path of the install-written curl/wget allowlist. */
|
|
11
11
|
export const NETWORK_ALLOWLIST_RELPATH = path.join(".bkit", "allowlist.json");
|
|
12
12
|
/** Where the cursor module wrote the allowlist up to 5.2.4 (migrated away). */
|
|
13
13
|
export const RETIRED_NETWORK_ALLOWLIST_RELPATH = path.join(".cursor", "allowlist.json");
|
|
14
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* The allowlist file body: `{ domains, fingerprint }` — `domains` is apex + `*.` wildcard
|
|
16
|
+
* per base, sorted; `fingerprint` is the 8-hex stamp of that list, which the cloud
|
|
17
|
+
* bootstrap compares with `BKIT_CLOUD_ALLOWLIST_FINGERPRINT`.
|
|
18
|
+
*/
|
|
15
19
|
export function renderNetworkAllowlist(cwd) {
|
|
16
|
-
|
|
20
|
+
const domains = resolveNetworkAllowlist(cwd);
|
|
21
|
+
return JSON.stringify({ domains, fingerprint: egressFingerprint(domains) }, null, 2) + "\n";
|
|
17
22
|
}
|
|
18
23
|
/**
|
|
19
24
|
* Write `.bkit/allowlist.json` whole (hand edits do not survive — `allowed-domains` in
|