@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
|
@@ -19,7 +19,11 @@ import {
|
|
|
19
19
|
stripManagedBlock,
|
|
20
20
|
} from "../managed-block.js";
|
|
21
21
|
import type { TokenMap } from "../placeholders.js";
|
|
22
|
-
import {
|
|
22
|
+
import {
|
|
23
|
+
listFilesRecursive,
|
|
24
|
+
warnMissingLintStagedConfig,
|
|
25
|
+
syncTemplateCopies,
|
|
26
|
+
} from "../template-copies.js";
|
|
23
27
|
import { PAYLOAD_LINK_RELPATHS, syncPayloadLinks } from "../payload-links.js";
|
|
24
28
|
import { writeNetworkAllowlist } from "../network-allowlist.js";
|
|
25
29
|
import { migrateContextCiWorkflow } from "../context-ci-workflow.js";
|
|
@@ -27,6 +31,7 @@ import { migrateTemplateNotes } from "../template-notes.js";
|
|
|
27
31
|
import type { PreflightFinding } from "../../checks/before/index.js";
|
|
28
32
|
import { isAdvisorySuppressed } from "../../checks/after/suppression.js";
|
|
29
33
|
import { parseJson, readJsonFile } from "../../shared/json.js";
|
|
34
|
+
import { compareSemver } from "../../shared/bkit-latest.js";
|
|
30
35
|
import { readInstallingVersion } from "../../shared/package-json.js";
|
|
31
36
|
import { detectDepUpdater, type DepUpdater } from "../../shared/dep-updater.js";
|
|
32
37
|
import { ASK_POINTS, CONFIG_DEFAULTS, ciWorkflowPath, limitKey } from "../../shared/settings.js";
|
|
@@ -214,8 +219,8 @@ export function listCoreTemplateFiles(root: string = getCoreRoot()): CoreTemplat
|
|
|
214
219
|
|
|
215
220
|
/**
|
|
216
221
|
* The shared payload files core writes, sourced from `root` (defaults to the
|
|
217
|
-
* resolved shared root): the
|
|
218
|
-
*
|
|
222
|
+
* resolved shared root): the two shared-root files the core manifest owns. The ten project
|
|
223
|
+
* documents are copy-and-own starters under `templates/docs/`, never written here.
|
|
219
224
|
*/
|
|
220
225
|
export function listSharedTemplateFiles(root: string = getSharedRoot()): CoreTemplateFile[] {
|
|
221
226
|
const out: CoreTemplateFile[] = [];
|
|
@@ -223,14 +228,6 @@ export function listSharedTemplateFiles(root: string = getSharedRoot()): CoreTem
|
|
|
223
228
|
const src = path.join(root, rel);
|
|
224
229
|
if (fs.existsSync(src)) out.push({ src, dst, scope: "block", marker: "html-comment" });
|
|
225
230
|
}
|
|
226
|
-
for (const name of listMdFiles(path.join(root, "docs"))) {
|
|
227
|
-
out.push({
|
|
228
|
-
src: path.join(root, "docs", name),
|
|
229
|
-
dst: path.join("docs", name),
|
|
230
|
-
scope: "block",
|
|
231
|
-
marker: "html-comment",
|
|
232
|
-
});
|
|
233
|
-
}
|
|
234
231
|
return out;
|
|
235
232
|
}
|
|
236
233
|
|
|
@@ -338,6 +335,7 @@ export function runBkitDocs(
|
|
|
338
335
|
migrateTemplateNotes(dryRun, ws, logPrefix);
|
|
339
336
|
migrateContextCiWorkflow(dryRun, ws, logPrefix);
|
|
340
337
|
migrateSlopTypeSuppression(dryRun, ws, logPrefix);
|
|
338
|
+
migrateMachineLockCopy(dryRun, ws, logPrefix);
|
|
341
339
|
const renames = migrateBrandedTemplateFiles(dryRun, ws, logPrefix);
|
|
342
340
|
migrateBrandedFileTokens(dryRun, ws, logPrefix, renames);
|
|
343
341
|
migrateBrandedCheckNames(dryRun, ws, logPrefix, tokens.DEFAULT_BRANCH);
|
|
@@ -574,6 +572,9 @@ export function seedCorePackageJsonScripts(
|
|
|
574
572
|
if (pruneMinPushPaths(dryRun, ws, logPrefix) && !written.includes("package.json")) {
|
|
575
573
|
written.push("package.json");
|
|
576
574
|
}
|
|
575
|
+
if (lowerVerifyMaxAttempts(dryRun, ws, logPrefix) && !written.includes("package.json")) {
|
|
576
|
+
written.push("package.json");
|
|
577
|
+
}
|
|
577
578
|
if (seedBkitDefaults(dryRun, ws, logPrefix) && !written.includes("package.json")) {
|
|
578
579
|
written.push("package.json");
|
|
579
580
|
}
|
|
@@ -610,7 +611,7 @@ export const SEEDED_BKIT_DEFAULTS: Readonly<Record<string, unknown>> = {
|
|
|
610
611
|
cloud: { agent: "" },
|
|
611
612
|
providers: { opencode: { default: "", installed: [] } },
|
|
612
613
|
testing: {
|
|
613
|
-
// What bkit writes (ship's bookkeeping allow-list, the plans tree) is always a min push;
|
|
614
|
+
// What bkit writes (ship's bookkeeping allow-list, the plans tree, docs/audits/**) is always a min push;
|
|
614
615
|
// the seed adds nothing, because a project doc can be a test's input.
|
|
615
616
|
minPushPaths: [...CONFIG_DEFAULTS.minPushPaths],
|
|
616
617
|
ciWorkflow: CONFIG_DEFAULTS.ciWorkflow,
|
|
@@ -812,6 +813,104 @@ function migrateSlopTypeSuppression(dryRun: boolean, ws: WriteSet, logPrefix: st
|
|
|
812
813
|
console.log(`${logPrefix} ${tag}core: ${file} — slop plugin updated`);
|
|
813
814
|
}
|
|
814
815
|
|
|
816
|
+
// sha256 of every released scripts/ci/bkit-machine-lock.sh text older than the current template (6.1.0, 6.1.1).
|
|
817
|
+
const SHIPPED_MACHINE_LOCK_HASHES: readonly string[] = [
|
|
818
|
+
"63ee5873795fd06b60e1f13c238c9e3c44d9f6dc76a50fe271793de6ad284e87",
|
|
819
|
+
];
|
|
820
|
+
|
|
821
|
+
// Migration (6.1.0-6.2.x installs, docs/migrations.md): replace an unedited adopted machine-lock
|
|
822
|
+
// copy with the current template; warn about an edited copy that lacks the queue, never writes
|
|
823
|
+
// the status file or has no hold limit. A copy that starts bkit-test-awake.mjs gets that file
|
|
824
|
+
// beside it (see `migrateHoldSupervisor`).
|
|
825
|
+
function migrateMachineLockCopy(dryRun: boolean, ws: WriteSet, logPrefix: string): void {
|
|
826
|
+
const file = path.join("scripts", "ci", "bkit-machine-lock.sh");
|
|
827
|
+
const stat = fs.lstatSync(file, { throwIfNoEntry: false });
|
|
828
|
+
if (!stat) return;
|
|
829
|
+
const tag = dryRun ? "[dry-run] " : "";
|
|
830
|
+
const templatePath = ".bkit/templates/scripts/ci/bkit-machine-lock.sh";
|
|
831
|
+
const outOfOrder = "waiting runs take the lock out of arrival order";
|
|
832
|
+
const manual = (reason: string, until = outOfOrder): void => {
|
|
833
|
+
console.warn(
|
|
834
|
+
`${logPrefix} ${tag}core: ${file} left unchanged (${reason}); merge ${templatePath} by hand, until then ${until}`,
|
|
835
|
+
);
|
|
836
|
+
};
|
|
837
|
+
if (linkedPath(file) || !stat.isFile()) {
|
|
838
|
+
manual("the path is not a regular file or sits under a symlink");
|
|
839
|
+
return;
|
|
840
|
+
}
|
|
841
|
+
const current = fs.readFileSync(file);
|
|
842
|
+
const template = fs.readFileSync(
|
|
843
|
+
path.join(getTemplatesRoot(), "scripts", "ci", "bkit-machine-lock.sh"),
|
|
844
|
+
);
|
|
845
|
+
const text = current.toString("utf8");
|
|
846
|
+
if (current.equals(template)) {
|
|
847
|
+
migrateHoldSupervisor(dryRun, ws, logPrefix);
|
|
848
|
+
return;
|
|
849
|
+
}
|
|
850
|
+
if (SHIPPED_MACHINE_LOCK_HASHES.includes(sha256(current))) {
|
|
851
|
+
if (!dryRun) fs.writeFileSync(file, template);
|
|
852
|
+
ws.writes.push({ path: file, action: "update", unhashed: true });
|
|
853
|
+
console.log(`${logPrefix} ${tag}core: ${file} — machine lock updated to the current template`);
|
|
854
|
+
migrateHoldSupervisor(dryRun, ws, logPrefix);
|
|
855
|
+
return;
|
|
856
|
+
}
|
|
857
|
+
if (text.includes("bkit-test-awake.mjs")) migrateHoldSupervisor(dryRun, ws, logPrefix);
|
|
858
|
+
if (!text.includes(".queue")) manual("the copy differs from the shipped version");
|
|
859
|
+
if (!text.includes("LOCAL_STACK_LOCK_STATUS_FILE"))
|
|
860
|
+
manual(
|
|
861
|
+
"the copy never writes LOCAL_STACK_LOCK_STATUS_FILE",
|
|
862
|
+
"a lock wait that gives up reads as a gate failure (exit 1) instead of exit 81",
|
|
863
|
+
);
|
|
864
|
+
if (!text.includes("LOCAL_STACK_LOCK_HOLD_S"))
|
|
865
|
+
manual(
|
|
866
|
+
"the copy has no LOCAL_STACK_LOCK_HOLD_S hold limit",
|
|
867
|
+
"a hung run holds the tests lock until someone stops it by hand",
|
|
868
|
+
);
|
|
869
|
+
}
|
|
870
|
+
|
|
871
|
+
// sha256 of every scripts/ci/bkit-test-awake.mjs template text in history older than the current one.
|
|
872
|
+
const SHIPPED_AWAKE_HASHES: readonly string[] = [
|
|
873
|
+
"d218439bd4d65b57732a96aaea7bb678f9ebf95a6247f5e6b899d6ef26a59cb5",
|
|
874
|
+
"a686bf75700f2ff54de2cedd3b7afc943774da40a68c243b9911bc435742f434",
|
|
875
|
+
"0842c2e2789a1c77935655130de5b8cf253bfe0655407834f23a6abaaf1b0bb1",
|
|
876
|
+
"0dce1b50638cd609183a871ed8d0d9e3d20c545073f0a32f18526d6f38b5b748",
|
|
877
|
+
];
|
|
878
|
+
|
|
879
|
+
// The machine-lock script runs a command holding its own tests lock under
|
|
880
|
+
// scripts/ci/bkit-test-awake.mjs --hold-s: write the template there when the file is missing,
|
|
881
|
+
// replace an unedited shipped copy, and warn about an edited copy without --hold-s, since the
|
|
882
|
+
// lock script refuses every such run with exit 73.
|
|
883
|
+
function migrateHoldSupervisor(dryRun: boolean, ws: WriteSet, logPrefix: string): void {
|
|
884
|
+
const file = path.join("scripts", "ci", "bkit-test-awake.mjs");
|
|
885
|
+
const tag = dryRun ? "[dry-run] " : "";
|
|
886
|
+
const template = path.join(getTemplatesRoot(), "scripts", "ci", "bkit-test-awake.mjs");
|
|
887
|
+
if (!fs.lstatSync(file, { throwIfNoEntry: false })) {
|
|
888
|
+
if (!dryRun) fs.copyFileSync(template, file);
|
|
889
|
+
ws.writes.push({ path: file, action: "write", unhashed: true });
|
|
890
|
+
console.log(
|
|
891
|
+
`${logPrefix} ${tag}core: ${file} — added beside the machine lock, which runs its hold limit`,
|
|
892
|
+
);
|
|
893
|
+
return;
|
|
894
|
+
}
|
|
895
|
+
const stat = fs.statSync(file, { throwIfNoEntry: false });
|
|
896
|
+
if (
|
|
897
|
+
stat?.isFile() &&
|
|
898
|
+
!linkedPath(file) &&
|
|
899
|
+
SHIPPED_AWAKE_HASHES.includes(sha256(fs.readFileSync(file)))
|
|
900
|
+
) {
|
|
901
|
+
if (!dryRun) fs.copyFileSync(template, file);
|
|
902
|
+
ws.writes.push({ path: file, action: "update", unhashed: true });
|
|
903
|
+
console.log(
|
|
904
|
+
`${logPrefix} ${tag}core: ${file} — test sleep prevention updated to the current template`,
|
|
905
|
+
);
|
|
906
|
+
return;
|
|
907
|
+
}
|
|
908
|
+
if (stat?.isFile() && fs.readFileSync(file, "utf8").includes("--hold-s")) return;
|
|
909
|
+
console.warn(
|
|
910
|
+
`${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`,
|
|
911
|
+
);
|
|
912
|
+
}
|
|
913
|
+
|
|
815
914
|
// Every `.github/workflows/*.yml` / `*.yaml` regular file outside `skip`.
|
|
816
915
|
function otherWorkflows(skip: readonly string[]): string[] {
|
|
817
916
|
const dir = path.join(".github", "workflows");
|
|
@@ -1521,7 +1620,7 @@ export const BKIT_LAYOUT_MOVES: readonly (readonly [string, string])[] = [
|
|
|
1521
1620
|
|
|
1522
1621
|
// Migration (up to 6.0.x installs, `docs/migrations.md`): `bkit.testing.minPushPaths` was the
|
|
1523
1622
|
// whole min-push list, so installs seeded and repos restated what bkit itself writes. The
|
|
1524
|
-
// engine now always allows that floor (ship's bookkeeping allow-list, `docs/plans/**`) and
|
|
1623
|
+
// engine now always allows that floor (ship's bookkeeping allow-list, `docs/plans/**`, `docs/audits/**`) and
|
|
1525
1624
|
// `bkit.testing.ciSkipPaths`; the setting only adds. Entries the floor already covers are
|
|
1526
1625
|
// dropped from the list. Returns true when package.json changed.
|
|
1527
1626
|
export const MIN_PUSH_FLOOR_ENTRIES: readonly string[] = [
|
|
@@ -1554,6 +1653,40 @@ export function pruneMinPushPaths(dryRun: boolean, ws: WriteSet, logPrefix: stri
|
|
|
1554
1653
|
return true;
|
|
1555
1654
|
}
|
|
1556
1655
|
|
|
1656
|
+
const LAST_RELEASE_WITHOUT_VERIFY_CAP = "6.1.1";
|
|
1657
|
+
|
|
1658
|
+
// Migration (up to 6.1.x installs, `docs/migrations.md`): `bkit.workflows.build.verify.maxAttempts`
|
|
1659
|
+
// is one non-resetting allowance per run, and every build limit is 2. A value above 2 is
|
|
1660
|
+
// lowered to 2 once, on the upgrade from an install that predates this release (no recorded
|
|
1661
|
+
// version, an unreadable one, or an older one); 2 or less is left alone, and a value set after
|
|
1662
|
+
// that upgrade is the consumer's. Returns true when package.json changed.
|
|
1663
|
+
export function lowerVerifyMaxAttempts(dryRun: boolean, ws: WriteSet, logPrefix: string): boolean {
|
|
1664
|
+
const pkgPath = "package.json";
|
|
1665
|
+
if (!fs.existsSync(pkgPath)) return false;
|
|
1666
|
+
const recorded = readBkitVersion(path.join(".bkit", "version"))?.pinnedVersion ?? "";
|
|
1667
|
+
// Skip a re-run of the same version, and any install recorded after the last release without
|
|
1668
|
+
// this migration, so a value set after the upgrade to this release is never lowered again.
|
|
1669
|
+
const order = compareSemver(recorded, readInstallingVersion());
|
|
1670
|
+
if (order === 0 || order === 1) return false;
|
|
1671
|
+
if (compareSemver(recorded, LAST_RELEASE_WITHOUT_VERIFY_CAP) === 1) return false;
|
|
1672
|
+
const raw = fs.readFileSync(pkgPath, "utf-8");
|
|
1673
|
+
const parsed = parseJson(raw);
|
|
1674
|
+
if (!parsed.ok) return false;
|
|
1675
|
+
const pkg = parsed.value as Record<string, unknown>;
|
|
1676
|
+
if (!plainObject(pkg.bkit) || !plainObject(pkg.bkit.workflows)) return false;
|
|
1677
|
+
const build = pkg.bkit.workflows.build;
|
|
1678
|
+
if (!plainObject(build) || !plainObject(build.verify)) return false;
|
|
1679
|
+
const old = build.verify.maxAttempts;
|
|
1680
|
+
if (typeof old !== "number" || old <= 2) return false;
|
|
1681
|
+
build.verify.maxAttempts = 2;
|
|
1682
|
+
ws.writes.push({ path: pkgPath, action: "update" });
|
|
1683
|
+
if (!dryRun) writePackageJsonLike(raw, pkg);
|
|
1684
|
+
console.log(
|
|
1685
|
+
`${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`,
|
|
1686
|
+
);
|
|
1687
|
+
return true;
|
|
1688
|
+
}
|
|
1689
|
+
|
|
1557
1690
|
// Fill `into` with each `from` key it lacks, descending into blocks both sides hold.
|
|
1558
1691
|
function mergeMissing(into: Record<string, unknown>, from: Record<string, unknown>): void {
|
|
1559
1692
|
for (const [k, v] of Object.entries(from)) {
|
|
@@ -1788,7 +1921,7 @@ export function detectGateAdvisories(cwd: string): PreflightFinding[] {
|
|
|
1788
1921
|
id: "test-file-script-missing",
|
|
1789
1922
|
severity: "advisory",
|
|
1790
1923
|
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.`,
|
|
1791
|
-
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\
|
|
1924
|
+
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.`,
|
|
1792
1925
|
});
|
|
1793
1926
|
}
|
|
1794
1927
|
|
|
@@ -1893,6 +2026,7 @@ export function runCoreModule(ctx: ModuleContext): void {
|
|
|
1893
2026
|
console.log(`${logPrefix} ${tag}template ${verb}: ${path.join(TEMPLATE_COPIES_DIR, p)}`);
|
|
1894
2027
|
}
|
|
1895
2028
|
}
|
|
2029
|
+
warnMissingLintStagedConfig(cwd, logPrefix);
|
|
1896
2030
|
|
|
1897
2031
|
// 3b3. Payload view links — `.bkit/core` + `.bkit/shared` symlinks into the
|
|
1898
2032
|
// installed package (browse-only, gitignored; no-op in dogfood). A real
|
|
@@ -159,8 +159,9 @@ export function opencodeProviderEnvVar(providerKey: string): string {
|
|
|
159
159
|
* secret `env:` var. `bkit install --opencode=<provider>` rewrites neither; this advisory names
|
|
160
160
|
* the hand-edit.
|
|
161
161
|
*
|
|
162
|
-
* bkit-cloud.yml runs `opencode run` against the committed `.opencode/` config and
|
|
163
|
-
* `
|
|
162
|
+
* bkit-cloud.yml runs `opencode run` against the committed `.opencode/` config and passes
|
|
163
|
+
* the provider's `BKIT_` secret (`BKIT_OPENCODE_API_KEY`, `BKIT_OPENROUTER_API_KEY` or
|
|
164
|
+
* `BKIT_OLLAMA_API_KEY`) under its own env var name, so it is not checked.
|
|
164
165
|
*
|
|
165
166
|
* No-op when opencode.yml is absent. No equivalent check for claude.yml (provider-fixed to
|
|
166
167
|
* Claude). Severity "advisory": never gates `bkit check`; surfaces on both check and postinstall.
|
|
@@ -222,7 +223,7 @@ export function detectOpencodeYmlProviderDrift(cwd: string): PreflightFinding |
|
|
|
222
223
|
" model: " +
|
|
223
224
|
expectedPrefix +
|
|
224
225
|
"/<model> # a model your provider serves (see .opencode/opencode.json)\n\n" +
|
|
225
|
-
"Keep opencode.yml in sync with .opencode/opencode.json on every provider switch. (bkit-cloud.yml needs no such edit: it reads .opencode/ and
|
|
226
|
+
"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.)",
|
|
226
227
|
};
|
|
227
228
|
}
|
|
228
229
|
|
|
@@ -241,10 +242,8 @@ const OPENCODE_PROVIDER_BASE_URL_SENTINEL = "@@OPENCODE_PROVIDER_BASE_URL@@";
|
|
|
241
242
|
* and fills in provider-specific fields.
|
|
242
243
|
*
|
|
243
244
|
* Also injects derived **allow** rules for {@link resolveNetworkAllowlist} so
|
|
244
|
-
* context-fetch / provider hosts do not prompt on
|
|
245
|
-
* `
|
|
246
|
-
* last-match-wins), and `*{domain}*` into the `permission.webfetch` URL map (after its
|
|
247
|
-
* `"*": "ask"`). Adds `<server>_*` allows for the consumer's `mcp-servers` block.
|
|
245
|
+
* context-fetch / provider hosts do not prompt on the fetch tool: `*{domain}*` into the
|
|
246
|
+
* `permission.webfetch` URL map (after its `"*": "ask"`); shell fetches keep asking. Adds `<server>_*` allows for the consumer's `mcp-servers` block.
|
|
248
247
|
*/
|
|
249
248
|
export function renderOpencodeJson(
|
|
250
249
|
templatePath: string,
|
|
@@ -337,12 +336,10 @@ export function renderOpencodeJson(
|
|
|
337
336
|
* last-match-wins), and one `<server>_*` allow per declared MCP server — opencode names
|
|
338
337
|
* MCP tools `<server>_<tool>` and matches permission keys as globs against the tool name.
|
|
339
338
|
*
|
|
340
|
-
*
|
|
341
|
-
*
|
|
342
|
-
*
|
|
343
|
-
*
|
|
344
|
-
* - shell fetch — `permission.bash` gains `curl *{base}*` / `wget *{base}*` after the
|
|
345
|
-
* template's `curl *` / `wget *` ask.
|
|
339
|
+
* Only the fetch tool gets derived allows: `permission.webfetch` is a URL-keyed map
|
|
340
|
+
* (`{ "*": "ask" }` from the template); opencode matches the resource against the URL, so
|
|
341
|
+
* `*{base}*` allows it (accepted risk, decision 551). Shell `curl` / `wget` keep the
|
|
342
|
+
* template's ask, because a glob over the command string also matches a host in a query.
|
|
346
343
|
*/
|
|
347
344
|
function injectOpencodeDerivedAllows(parsed: Record<string, unknown>, cwd: string): void {
|
|
348
345
|
const permission = parsed.permission as Record<string, unknown> | undefined;
|
|
@@ -351,13 +348,6 @@ function injectOpencodeDerivedAllows(parsed: Record<string, unknown>, cwd: strin
|
|
|
351
348
|
permission[`${server}_*`] = "allow";
|
|
352
349
|
}
|
|
353
350
|
const bases = networkAllowlistBases(resolveNetworkAllowlist(cwd));
|
|
354
|
-
if (typeof permission.bash === "object" && permission.bash !== null) {
|
|
355
|
-
const bash = permission.bash as Record<string, string>;
|
|
356
|
-
for (const base of bases) {
|
|
357
|
-
bash[`curl *${base}*`] = "allow";
|
|
358
|
-
bash[`wget *${base}*`] = "allow";
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
351
|
// Fetch tool — opencode matches the webfetch resource against the requested URL.
|
|
362
352
|
if (typeof permission.webfetch === "object" && permission.webfetch !== null) {
|
|
363
353
|
const webfetch = permission.webfetch as Record<string, string>;
|
|
@@ -527,9 +517,14 @@ export function runOpencodeModule(ctx: ModuleContext): void {
|
|
|
527
517
|
}
|
|
528
518
|
}
|
|
529
519
|
|
|
530
|
-
// --- bkit-gateguard.js / bkit-readguard.js / bkit-rules.js — Tier-2
|
|
531
|
-
// (slash-comment); see install/manifest.ts ---
|
|
532
|
-
for (const plugin of [
|
|
520
|
+
// --- bkit-gateguard.js / bkit-readguard.js / bkit-rules.js / bkit-guardrails.js — Tier-2
|
|
521
|
+
// markered-text (slash-comment); see install/manifest.ts ---
|
|
522
|
+
for (const plugin of [
|
|
523
|
+
"bkit-gateguard.js",
|
|
524
|
+
"bkit-readguard.js",
|
|
525
|
+
"bkit-rules.js",
|
|
526
|
+
"bkit-guardrails.js",
|
|
527
|
+
]) {
|
|
533
528
|
const opencodeCore = path.join(getCoreRoot(), ".opencode", "plugin");
|
|
534
529
|
const pluginSrc = path.join(opencodeCore, plugin);
|
|
535
530
|
const pluginDst = `.opencode/plugin/${plugin}`;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
import * as fs from "node:fs";
|
|
8
8
|
import * as path from "node:path";
|
|
9
|
-
import { resolveNetworkAllowlist } from "./cloud-env.js";
|
|
9
|
+
import { egressFingerprint, resolveNetworkAllowlist } from "./cloud-env.js";
|
|
10
10
|
import { readBkitVersion } from "./version-file.js";
|
|
11
11
|
import type { WriteSet } from "./write.js";
|
|
12
12
|
|
|
@@ -16,9 +16,14 @@ export const NETWORK_ALLOWLIST_RELPATH = path.join(".bkit", "allowlist.json");
|
|
|
16
16
|
/** Where the cursor module wrote the allowlist up to 5.2.4 (migrated away). */
|
|
17
17
|
export const RETIRED_NETWORK_ALLOWLIST_RELPATH = path.join(".cursor", "allowlist.json");
|
|
18
18
|
|
|
19
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* The allowlist file body: `{ domains, fingerprint }` — `domains` is apex + `*.` wildcard
|
|
21
|
+
* per base, sorted; `fingerprint` is the 8-hex stamp of that list, which the cloud
|
|
22
|
+
* bootstrap compares with `BKIT_CLOUD_ALLOWLIST_FINGERPRINT`.
|
|
23
|
+
*/
|
|
20
24
|
export function renderNetworkAllowlist(cwd: string): string {
|
|
21
|
-
|
|
25
|
+
const domains = resolveNetworkAllowlist(cwd);
|
|
26
|
+
return JSON.stringify({ domains, fingerprint: egressFingerprint(domains) }, null, 2) + "\n";
|
|
22
27
|
}
|
|
23
28
|
|
|
24
29
|
/**
|