@cbartens/bkit 6.1.0 → 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 +43 -33
- 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 +99 -36
- package/.bkit/core/.bkit/templates.md +167 -37
- 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 +161 -37
- package/.bkit/core/engine/checks/after/index.ts +18 -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 +124 -19
- package/.bkit/core/engine/commands/ci/push-gate.ts +101 -43
- package/.bkit/core/engine/commands/install/doctor.ts +5 -5
- 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 +202 -26
- 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 +46 -11
- 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/context/bkit-vercel.md +103 -59
- 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-check-accepted-divergences.mjs +1 -6
- package/.bkit/templates/scripts/ci/bkit-machine-lock.sh +511 -103
- package/.bkit/templates/scripts/ci/bkit-test-awake.mjs +314 -28
- package/.bkit/templates/scripts/ci/bkit-test-awake.test.mjs +500 -1
- package/.bkit/templates/scripts/graphify/bkit-graphify-graphml.py +1 -1
- package/.bkit/templates/scripts/graphify/bkit-graphify-rollup.py +91 -62
- package/.bkit/templates/scripts/graphify/bkit-graphify.sh +59 -11
- package/.bkit/templates/slop-scan.config.json +2 -0
- package/CHANGELOG.md +79 -0
- package/DETAILS.md +661 -0
- package/README.md +73 -604
- package/dist/checks/after/auth.js +114 -46
- package/dist/checks/after/github.js +138 -35
- package/dist/checks/after/index.js +16 -4
- 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 +113 -20
- package/dist/commands/ci/push-gate.js +79 -44
- package/dist/commands/install/doctor.js +5 -5
- 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 +190 -27
- 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 +21 -12
- 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 +23 -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
|
@@ -5,7 +5,6 @@ import * as path from "node:path";
|
|
|
5
5
|
import { OPENCODE_PROVIDERS } from "../../shared/egress.js";
|
|
6
6
|
import { readInstallingVersion } from "../../shared/package-json.js";
|
|
7
7
|
import { dispatchModules } from "../../install/modules/index.js";
|
|
8
|
-
import { DEFAULT_ISSUE_TRACKER, } from "../../install/manifest.js";
|
|
9
8
|
import { parseJson, readJsonFile } from "../../shared/json.js";
|
|
10
9
|
import { readBkitConfig } from "../../shared/settings.js";
|
|
11
10
|
import { LOG_PREFIX, setLogPrefix } from "../../shared/log-prefix.js";
|
|
@@ -15,6 +14,7 @@ import { formatChecklist, readChangelogVersionDelta, runPostInstallCheck, writeA
|
|
|
15
14
|
import { collectTips } from "../../checks/tips/index.js";
|
|
16
15
|
import { findMissingOwnedHooks, detectOwnedHookMissing } from "../../checks/after/managed.js";
|
|
17
16
|
import { resolveTokens } from "../../install/placeholders.js";
|
|
17
|
+
import { syncProjectDocs } from "../../install/project-docs.js";
|
|
18
18
|
import { parseModelLookup, applyModelOverrides, unknownModelOverrides, buildOpencodeModelLookup, buildAntigravityModelLookup, parseEffortMap, } from "../../render/models.js";
|
|
19
19
|
import { getBkitDocsRoot } from "../../shared/package-roots.js";
|
|
20
20
|
import { migrateBkitLayout, migrateGithubProjectKey, migrateLinearTeamKey, } from "../../install/modules/core.js";
|
|
@@ -81,24 +81,14 @@ export function modulesToCliFlags(mods, opencodeProvider, cloudVariant) {
|
|
|
81
81
|
return out.join(" ");
|
|
82
82
|
}
|
|
83
83
|
/**
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
* cloud=cursor requires tracker=linear. Mismatch is a hard error — checked BEFORE
|
|
87
|
-
* any package.json write so no state is recorded on mismatch ("no files written
|
|
88
|
-
* on hard error" invariant). Returns the error message to print, or `null` when
|
|
89
|
-
* the tracker matches (or no cloud module/variant is in play).
|
|
84
|
+
* Cloud automation needs a wired tracker. Returns the pre-write error message,
|
|
85
|
+
* or null when a tracker is wired or no cloud module/variant is being installed.
|
|
90
86
|
*/
|
|
91
|
-
export function
|
|
92
|
-
if (cloudVariant === null || !hasCloudModule)
|
|
87
|
+
export function validateCloudTrackerWired(cloudVariant, hasCloudModule, issueTracker) {
|
|
88
|
+
if (cloudVariant === null || !hasCloudModule || issueTracker !== "none")
|
|
93
89
|
return null;
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
return null;
|
|
97
|
-
return (`[bkit] --auto=${cloudVariant} requires tracker=${requiredTracker}, ` +
|
|
98
|
-
`but the resolved tracker is "${issueTracker}". ` +
|
|
99
|
-
(issueTracker === DEFAULT_ISSUE_TRACKER || issueTracker === "none"
|
|
100
|
-
? `Set the tracker first: bkit install --tracker=${requiredTracker} --auto=${cloudVariant}`
|
|
101
|
-
: `Re-run with the matching tracker: bkit install --tracker=${requiredTracker} --auto=${cloudVariant} (tracker switching is free).`));
|
|
90
|
+
return (`[bkit] --auto=${cloudVariant} needs a wired tracker: ` +
|
|
91
|
+
`bkit install --tracker=<github|linear|jira> --auto=${cloudVariant}`);
|
|
102
92
|
}
|
|
103
93
|
/** `parent[key]` as an object, set to a fresh `{}` first when it is absent or not an object. */
|
|
104
94
|
function section(parent, key) {
|
|
@@ -327,10 +317,8 @@ export async function runInstall(args, upgradeReport = false) {
|
|
|
327
317
|
});
|
|
328
318
|
}
|
|
329
319
|
const postDispatch = [];
|
|
330
|
-
//
|
|
331
|
-
|
|
332
|
-
// package.json write so no state is recorded on mismatch.
|
|
333
|
-
const cloudTrackerError = validateCloudTrackerMatch(cloudVariant, modules.has("cloud"), issueTracker);
|
|
320
|
+
// Reject missing tracker wiring before any package.json write.
|
|
321
|
+
const cloudTrackerError = validateCloudTrackerWired(cloudVariant, modules.has("cloud"), issueTracker);
|
|
334
322
|
if (cloudTrackerError) {
|
|
335
323
|
console.error(cloudTrackerError);
|
|
336
324
|
process.exit(1);
|
|
@@ -338,12 +326,20 @@ export async function runInstall(args, upgradeReport = false) {
|
|
|
338
326
|
if (cloudVariant !== null && modules.has("cloud")) {
|
|
339
327
|
// auto=opencode additionally requires the local opencode host to be installed first
|
|
340
328
|
// (the cloud job runs against the committed .opencode/ — no model is hard-coded in YAML).
|
|
341
|
-
if (cloudVariant === "opencode" &&
|
|
329
|
+
if (cloudVariant === "opencode" &&
|
|
330
|
+
!modules.has("opencode") &&
|
|
331
|
+
!fs.existsSync(path.join(process.cwd(), ".opencode"))) {
|
|
342
332
|
console.error(`[bkit] --auto=opencode requires the local opencode host to be installed first.\n` +
|
|
343
333
|
`Run: bkit install --opencode=<provider> (e.g. --opencode=opencode-zen)\n` +
|
|
344
334
|
`The cloud opencode job runs against the committed .opencode/ config — without it there is nothing to run.`);
|
|
345
335
|
process.exit(1);
|
|
346
336
|
}
|
|
337
|
+
if (cloudVariant === "codex" &&
|
|
338
|
+
!modules.has("codex") &&
|
|
339
|
+
!fs.existsSync(path.join(process.cwd(), ".codex"))) {
|
|
340
|
+
console.error(`[bkit] --auto=codex requires the local Codex host. Run: bkit install --codex`);
|
|
341
|
+
process.exit(1);
|
|
342
|
+
}
|
|
347
343
|
}
|
|
348
344
|
// Persist bkit manifest fields to consumer package.json AFTER all hard-error gates pass.
|
|
349
345
|
// This preserves the "no files written on mismatch" invariant. Two fields are recorded:
|
|
@@ -441,6 +437,11 @@ export async function runInstall(args, upgradeReport = false) {
|
|
|
441
437
|
finally {
|
|
442
438
|
discardAllStaging();
|
|
443
439
|
}
|
|
440
|
+
// The ten project documents belong to the project: drop a legacy ownership wrapper and list
|
|
441
|
+
// each present document in `Project Documents`. Runs after the managed index is rendered and
|
|
442
|
+
// before the advisories read the result. `check` is read-only, so it never gets here.
|
|
443
|
+
if (!dryRun)
|
|
444
|
+
syncProjectDocs(process.cwd(), { dryRun: false });
|
|
444
445
|
const totalWrites = ws.writes.length;
|
|
445
446
|
// Done banner first so the line count is easy to find above the checklist.
|
|
446
447
|
// For check, "would occur" makes intent explicit; for install, writes already happened.
|
|
@@ -7,8 +7,9 @@
|
|
|
7
7
|
// - "byte-equal-text" : delete only if unchanged since bkit wrote it (canonicalHashes)
|
|
8
8
|
// 2. package.json: the `bkit` install-state block (full/core uninstall). Scripts and
|
|
9
9
|
// devDeps are the consumer's — the bkit:gate:* names included — and are left alone.
|
|
10
|
-
// 2b. docs/ (full/core uninstall):
|
|
11
|
-
// `docs
|
|
10
|
+
// 2b. docs/ (full/core uninstall): the owned `docs/templates/bkit-*.md` deleted. The ten
|
|
11
|
+
// project documents (`docs/architecture.md` …) and their `Project Documents` index rows
|
|
12
|
+
// belong to the project and stay.
|
|
12
13
|
// 3. .agents/ mirror files (bkit-prefix .md files in .claude/ .cursor/)
|
|
13
14
|
//
|
|
14
15
|
// Flags:
|
|
@@ -28,15 +29,16 @@ import { getInstallManifest, ISSUE_TRACKERS, } from "../../install/manifest.js";
|
|
|
28
29
|
import { OPENCODE_PROVIDERS } from "../../shared/egress.js";
|
|
29
30
|
import { parseJson } from "../../shared/json.js";
|
|
30
31
|
import { hashFile, isConsumerModified, mergeCanonicalHashes, readBkitVersion, writeBkitVersion, } from "../../install/version-file.js";
|
|
31
|
-
import { getBkitDocsRoot, getPkgRoot,
|
|
32
|
+
import { getBkitDocsRoot, getPkgRoot, findTemplateSource, TEMPLATE_COPIES_DIR, } from "../../shared/package-roots.js";
|
|
32
33
|
import { PAYLOAD_LINKS } from "../../install/payload-links.js";
|
|
33
34
|
import { removeOpencodeProviderBlock, renderOpencodeAgentsCommands, renderOpencodeJson, } from "../../install/modules/opencode.js";
|
|
34
35
|
import { applyModelOverrides, buildOpencodeModelLookup, parseEffortMap, } from "../../render/models.js";
|
|
35
36
|
import { readInstallingVersion } from "../../shared/package-json.js";
|
|
36
37
|
import { readBkitConfig } from "../../shared/settings.js";
|
|
37
38
|
import { SEEDED_BKIT_DEFAULTS } from "../../install/modules/core.js";
|
|
38
|
-
import { CLAUDE_CLOUD_RELPATH, CODEX_CLOUD_RELPATH, CURSOR_CLOUD_RELPATH,
|
|
39
|
+
import { CLAUDE_CLOUD_RELPATH, CODEX_CLOUD_RELPATH, CURSOR_CLOUD_RELPATH, } from "../../install/cloud-env.js";
|
|
39
40
|
import { LOG_PREFIX, setLogPrefix } from "../../shared/log-prefix.js";
|
|
41
|
+
import { isOpencodeSubstringFetchKey, redactUrlParts } from "../../checks/before/files.js";
|
|
40
42
|
import { unusedTrackerMcpServers } from "../../checks/before/mcp.js";
|
|
41
43
|
// ---------------------------------------------------------------------------
|
|
42
44
|
// stripTier2JsonScope — remove bkit-owned JSON scope from consumer doc (BAR-167 Phase 1)
|
|
@@ -263,26 +265,6 @@ const CORE_TEMPLATE_DOCTRINE = [
|
|
|
263
265
|
// Retired `.bkit/lite.md` (5.2.5 – 6.0.0), for an install never upgraded since.
|
|
264
266
|
{ path: ".bkit/lite.md", format: "markered-text", module: "core" },
|
|
265
267
|
];
|
|
266
|
-
/**
|
|
267
|
-
* The top-level `docs/*.md` the core payload pass installs: each carries bkit's managed
|
|
268
|
-
* block (`bkit:start` / `bkit:end`, managed marker inside), so uninstall strips the block
|
|
269
|
-
* and keeps the consumer's content, exactly like `.agents/*.md`. The payload's
|
|
270
|
-
* `shared/docs/` holds only these block docs; `docs/capabilities.md` is a template
|
|
271
|
-
* (copied, never installed) and is left alone.
|
|
272
|
-
*/
|
|
273
|
-
function coreDocEntries() {
|
|
274
|
-
const dir = path.join(getSharedRoot(), "docs");
|
|
275
|
-
if (!fs.existsSync(dir))
|
|
276
|
-
return [];
|
|
277
|
-
return fs
|
|
278
|
-
.readdirSync(dir, { withFileTypes: true })
|
|
279
|
-
.filter((e) => e.isFile() && e.name.endsWith(".md"))
|
|
280
|
-
.map((e) => ({
|
|
281
|
-
path: path.join("docs", e.name),
|
|
282
|
-
format: "markered-text",
|
|
283
|
-
module: "core",
|
|
284
|
-
}));
|
|
285
|
-
}
|
|
286
268
|
/** Prefix of the bkit-owned files under `docs/templates/`; uninstall deletes them whole. */
|
|
287
269
|
const DOCS_TEMPLATES_DIR = path.join("docs", "templates");
|
|
288
270
|
const isOwnedDocsTemplate = (name) => name.startsWith("bkit-") && name.endsWith(".md");
|
|
@@ -294,7 +276,7 @@ export function buildDecisionTable(modules, ctx) {
|
|
|
294
276
|
: modules;
|
|
295
277
|
const entries = [
|
|
296
278
|
...getInstallManifest(moduleList),
|
|
297
|
-
...(moduleList.includes("core") ?
|
|
279
|
+
...(moduleList.includes("core") ? CORE_TEMPLATE_DOCTRINE : []),
|
|
298
280
|
];
|
|
299
281
|
// The hash of every owned file as bkit last wrote it.
|
|
300
282
|
const versionFilePath = path.join(ctx.cwd, ".bkit", "version");
|
|
@@ -495,6 +477,9 @@ export async function runUninstall(modules, ctx) {
|
|
|
495
477
|
return result;
|
|
496
478
|
}
|
|
497
479
|
}
|
|
480
|
+
// The grants bkit wrote into `.claude/settings.json`, read before the loop below deletes
|
|
481
|
+
// `.bkit/version` on a full or core uninstall.
|
|
482
|
+
const claudeAllowDerived = readBkitVersion(path.join(ctx.cwd, ".bkit", "version"))?.claudeAllowDerived ?? [];
|
|
498
483
|
const table = buildDecisionTable(moduleList, ctx);
|
|
499
484
|
result.decisions = table;
|
|
500
485
|
if (ctx.dryRun) {
|
|
@@ -567,19 +552,18 @@ export async function runUninstall(modules, ctx) {
|
|
|
567
552
|
// the resolved network allowlist and `mcp__…` grants per declared MCP
|
|
568
553
|
// server (enrichClaudeSettingsAllows). Stripping
|
|
569
554
|
// against the RAW template leaves those grants behind as if the consumer
|
|
570
|
-
// had added them.
|
|
571
|
-
//
|
|
572
|
-
//
|
|
555
|
+
// had added them. `.bkit/version` records exactly the rows install wrote
|
|
556
|
+
// (`claudeAllowDerived`); treat them as part of the template. A derived-looking
|
|
557
|
+
// row the record lacks has unknown ownership: it stays and is listed for review.
|
|
573
558
|
if (summary.file === path.join(".claude", "settings.json")) {
|
|
574
559
|
const perms = templateDoc.permissions;
|
|
575
560
|
if (perms !== null && typeof perms === "object" && !Array.isArray(perms)) {
|
|
576
561
|
const permsObj = perms;
|
|
577
562
|
const allow = permsObj.allow;
|
|
578
563
|
if (Array.isArray(allow)) {
|
|
579
|
-
const enriched = resolveClaudeDerivedAllows(ctx.cwd);
|
|
580
564
|
permsObj.allow = [
|
|
581
565
|
...allow,
|
|
582
|
-
...
|
|
566
|
+
...claudeAllowDerived.filter((e) => !allow.includes(e)),
|
|
583
567
|
];
|
|
584
568
|
}
|
|
585
569
|
}
|
|
@@ -589,6 +573,28 @@ export async function runUninstall(modules, ctx) {
|
|
|
589
573
|
: isOpencodeJson
|
|
590
574
|
? stripOpencodeJsonScope(consumerDoc, templatePath, ctx.cwd)
|
|
591
575
|
: stripTier2JsonScope(consumerDoc, templateDoc);
|
|
576
|
+
if (summary.file === path.join(".claude", "settings.json")) {
|
|
577
|
+
const remaining = stripped.permissions?.allow;
|
|
578
|
+
if (Array.isArray(remaining)) {
|
|
579
|
+
for (const row of remaining) {
|
|
580
|
+
if (typeof row === "string" &&
|
|
581
|
+
/^(WebFetch\(domain:|mcp__)/.test(row) &&
|
|
582
|
+
!claudeAllowDerived.includes(row)) {
|
|
583
|
+
console.log(`${ctx.logPrefix} review: ${summary.file} keeps ${row} — .bkit/version does not record it as bkit-written; remove it by hand if bkit added it`);
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
if (isOpencodeJson) {
|
|
589
|
+
const bash = stripped.permission?.bash;
|
|
590
|
+
if (bash !== null && typeof bash === "object" && !Array.isArray(bash)) {
|
|
591
|
+
for (const [key, value] of Object.entries(bash)) {
|
|
592
|
+
if (value === "allow" && isOpencodeSubstringFetchKey(key)) {
|
|
593
|
+
console.log(`${ctx.logPrefix} review: ${summary.file} keeps legacy substring grant \`${redactUrlParts(key)}\` in permission.bash — remove it by hand if you did not add it`);
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
}
|
|
592
598
|
const strippedJson = JSON.stringify(stripped, null, 2) + "\n";
|
|
593
599
|
if (Object.keys(stripped).length === 0) {
|
|
594
600
|
// All keys were bkit-owned → delete file
|
|
@@ -37,8 +37,9 @@ import { readBkitConfig } from "../../shared/settings.js";
|
|
|
37
37
|
import { detectInstalledHostModules } from "../../install/hosts.js";
|
|
38
38
|
import { detectInstalledModules } from "./check.js";
|
|
39
39
|
import { remapTemplateDest } from "../../install/template-copies.js";
|
|
40
|
+
import { syncProjectDocs } from "../../install/project-docs.js";
|
|
40
41
|
import { CLAUDE_CLOUD_RELPATH, CODEX_CLOUD_RELPATH, CURSOR_CLOUD_RELPATH, writeClaudeCloudDoc, writeCodexCloudDoc, writeCursorCloudDoc, writeCursorCliPermissionsArtifact, } from "../../install/cloud-env.js";
|
|
41
|
-
import { syncTemplateCopies, formatTemplateChanges } from "../../install/template-copies.js";
|
|
42
|
+
import { syncTemplateCopies, formatTemplateChanges, warnMissingLintStagedConfig, } from "../../install/template-copies.js";
|
|
42
43
|
import { formatPayloadLinkChanges, syncPayloadLinks } from "../../install/payload-links.js";
|
|
43
44
|
import { renderOpencodeJson, reconcileOpencodeJson } from "../../install/modules/opencode.js";
|
|
44
45
|
import { renderManagedOutputs } from "../../install/modules/index.js";
|
|
@@ -580,7 +581,7 @@ export async function runUpgradeCommand(upgradeFlags) {
|
|
|
580
581
|
dryRun: upgradeFlags.dryRun,
|
|
581
582
|
ws: { writes: [] },
|
|
582
583
|
});
|
|
583
|
-
const templateReport = formatTemplateChanges(templateChanges);
|
|
584
|
+
const templateReport = formatTemplateChanges(templateChanges, process.cwd());
|
|
584
585
|
if (templateReport)
|
|
585
586
|
console.log(`${LOG_PREFIX} ${templateReport}`);
|
|
586
587
|
// Payload view links — the same sync install runs (`.bkit/core` + `.bkit/shared`
|
|
@@ -763,6 +764,10 @@ export async function runUpgradeCommand(upgradeFlags) {
|
|
|
763
764
|
}
|
|
764
765
|
}
|
|
765
766
|
}
|
|
767
|
+
// Project documents belong to the project: remove a legacy ownership wrapper and register each
|
|
768
|
+
// present document in `Project Documents` (a dry run only prints the preview). They carry no
|
|
769
|
+
// hash, so nothing here feeds `.bkit/version`.
|
|
770
|
+
syncProjectDocs(process.cwd(), { dryRun: upgradeFlags.dryRun });
|
|
766
771
|
// Refresh canonicalHashes (from resulting on-disk content) AND bump pinnedVersion
|
|
767
772
|
// to the version we just upgraded TO, so the next `bkit check` has nothing to write.
|
|
768
773
|
// Called unconditionally (non-dry-run) so the pin bumps even when every file was a
|
|
@@ -793,6 +798,9 @@ export async function runUpgradeCommand(upgradeFlags) {
|
|
|
793
798
|
}
|
|
794
799
|
console.log(`${LOG_PREFIX} Done. updated: ${result.updated.length}, skipped: ${result.skipped.length}, conflicts: ${result.conflicts.length}, re-rendered: ${rendered.length}`);
|
|
795
800
|
// `.bkit/advisories.md` describes the upgraded repo, not the last install or check.
|
|
801
|
+
// A real upgrade prints the missing-lint-staged line through the advisories; a dry run prints it here.
|
|
802
|
+
if (upgradeFlags.dryRun)
|
|
803
|
+
warnMissingLintStagedConfig(process.cwd(), LOG_PREFIX);
|
|
796
804
|
if (!upgradeFlags.dryRun)
|
|
797
805
|
await runUpgradeAdvisories();
|
|
798
806
|
// Non-interactive mode: exit non-zero on conflicts
|
package/dist/commands/land.js
CHANGED
|
@@ -16,9 +16,8 @@ import { gitEnv } from "../ledgers/telemetry.js";
|
|
|
16
16
|
import { readBkitConfig } from "../shared/settings.js";
|
|
17
17
|
import { readPackageJson } from "../shared/package-json.js";
|
|
18
18
|
import { installCommand } from "../shared/package-manager.js";
|
|
19
|
-
import { minPushPathspecs } from "./ci/ci.js";
|
|
19
|
+
import { minPushOutside, minPushPathspecs } from "./ci/ci.js";
|
|
20
20
|
import { requiredPushGate, runPushGate } from "./ci/push-gate.js";
|
|
21
|
-
import { changedOutside } from "./workflow/ledgers.js";
|
|
22
21
|
const REMOTE = "origin";
|
|
23
22
|
const UPSTREAM = `${REMOTE}/${DEV}`;
|
|
24
23
|
/** dev moved before git sent anything: git compared the remote's dev and stopped. */
|
|
@@ -169,7 +168,7 @@ function checkLanding(root, dir, base, log) {
|
|
|
169
168
|
throw new CommandError(EXIT.NO, "landing checkout is not clean — nothing pushed");
|
|
170
169
|
if (!readPackageJson(dir).ok)
|
|
171
170
|
throw new CommandError(EXIT.NO, "landing package.json is unreadable — nothing pushed");
|
|
172
|
-
const diff =
|
|
171
|
+
const diff = minPushOutside(dir, base, head, minPushPathspecs(readBkitConfig(dir)));
|
|
173
172
|
if (!diff.ok)
|
|
174
173
|
throw new CommandError(EXIT.NO, `cannot classify landing: ${diff.stderr}`);
|
|
175
174
|
const gate = diff.outside.length === 0 ? "bkit:gate:min" : requiredPushGate(dir);
|