@cbartens/bkit 5.2.3 → 5.3.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 +29 -12
- package/.bkit/core/.agents/context.md +1 -1
- package/.bkit/core/.agents/docs.md +1 -1
- package/.bkit/core/.agents/plugins/bkit/hooks/bkit-guardrails.cjs +1 -1
- package/.bkit/core/.agents/rules.md +11 -0
- package/.bkit/core/.bkit/README.md +28 -11
- package/.bkit/core/.bkit/cloud.md +9 -8
- package/.bkit/core/.bkit/comparison.md +68 -345
- package/.bkit/core/.bkit/install.md +15 -9
- package/.bkit/core/.bkit/lite.md +73 -0
- package/.bkit/core/.bkit/pipeline.md +345 -0
- package/.bkit/core/.bkit/prompts.md +88 -73
- package/.bkit/core/.bkit/providers.md +41 -22
- package/.bkit/core/.bkit/templates.md +125 -18
- package/.bkit/core/.bkit/trackers.md +47 -1
- package/.bkit/core/.bkit/workflows.md +51 -45
- package/.bkit/core/.claude/hooks/bkit-guardrails.cjs +1 -1
- package/.bkit/core/.codex/hooks/bkit-guardrails.cjs +7 -4
- package/.bkit/core/.cursor/hooks/bkit-guardrails.cjs +8 -5
- package/.bkit/core/docs/templates/bkit-audit-accessibility.md +9 -1
- package/.bkit/core/docs/templates/bkit-audit-adoption.md +10 -2
- package/.bkit/core/docs/templates/bkit-audit-agents.md +9 -1
- package/.bkit/core/docs/templates/bkit-audit-aio-seo.md +9 -1
- package/.bkit/core/docs/templates/bkit-audit-analytics.md +9 -1
- package/.bkit/core/docs/templates/bkit-audit-annotations.md +10 -2
- package/.bkit/core/docs/templates/bkit-audit-app-performance.md +9 -1
- package/.bkit/core/docs/templates/bkit-audit-app-store.md +9 -1
- package/.bkit/core/docs/templates/bkit-audit-architecture.md +9 -1
- package/.bkit/core/docs/templates/bkit-audit-ci-performance.md +9 -1
- package/.bkit/core/docs/templates/bkit-audit-config.md +9 -1
- package/.bkit/core/docs/templates/bkit-audit-cost.md +10 -2
- package/.bkit/core/docs/templates/bkit-audit-coverage.md +9 -1
- package/.bkit/core/docs/templates/bkit-audit-database.md +9 -1
- package/.bkit/core/docs/templates/bkit-audit-dead-code.md +9 -1
- package/.bkit/core/docs/templates/bkit-audit-deferrals.md +9 -1
- package/.bkit/core/docs/templates/bkit-audit-dependencies.md +22 -10
- package/.bkit/core/docs/templates/bkit-audit-documentation.md +9 -1
- package/.bkit/core/docs/templates/bkit-audit-duplication.md +9 -1
- package/.bkit/core/docs/templates/bkit-audit-failures.md +9 -1
- package/.bkit/core/docs/templates/bkit-audit-flakes.md +10 -2
- package/.bkit/core/docs/templates/bkit-audit-gates.md +9 -1
- package/.bkit/core/docs/templates/bkit-audit-issues.md +9 -1
- package/.bkit/core/docs/templates/bkit-audit-llm.md +29 -15
- package/.bkit/core/docs/templates/bkit-audit-logs.md +10 -2
- package/.bkit/core/docs/templates/bkit-audit-models.md +9 -1
- package/.bkit/core/docs/templates/bkit-audit-privacy.md +9 -1
- package/.bkit/core/docs/templates/bkit-audit-prompts.md +11 -3
- package/.bkit/core/docs/templates/bkit-audit-red-team.md +19 -9
- package/.bkit/core/docs/templates/bkit-audit-reliability.md +9 -1
- package/.bkit/core/docs/templates/bkit-audit-repo.md +10 -2
- package/.bkit/core/docs/templates/bkit-audit-security.md +13 -5
- package/.bkit/core/docs/templates/bkit-audit-slop.md +9 -1
- package/.bkit/core/docs/templates/bkit-audit-testing.md +14 -5
- package/.bkit/core/docs/templates/bkit-audit-usability.md +9 -1
- package/.bkit/core/docs/templates/bkit-plan.md +8 -6
- package/.bkit/core/engine/checks/after/auth.ts +9 -9
- package/.bkit/core/engine/checks/after/ci-yml.ts +14 -12
- package/.bkit/core/engine/checks/after/github.ts +29 -120
- package/.bkit/core/engine/checks/after/index.ts +2 -2
- package/.bkit/core/engine/checks/after/managed.ts +8 -28
- package/.bkit/core/engine/checks/after/tools.ts +3 -15
- package/.bkit/core/engine/checks/before/context-fetch.ts +1 -21
- package/.bkit/core/engine/checks/before/index.ts +7 -43
- package/.bkit/core/engine/checks/before/mcp.ts +17 -8
- package/.bkit/core/engine/checks/before/repo.ts +9 -12
- package/.bkit/core/engine/checks/status-holes.ts +4 -5
- package/.bkit/core/engine/checks/tips/catalogue.ts +70 -24
- package/.bkit/core/engine/checks/tips/detect.ts +45 -2
- package/.bkit/core/engine/checks/tips/index.ts +37 -8
- package/.bkit/core/engine/cli.ts +39 -16
- package/.bkit/core/engine/commands/analysis.ts +36 -26
- package/.bkit/core/engine/commands/comply.ts +17 -16
- package/.bkit/core/engine/commands/harvest.ts +12 -12
- package/.bkit/core/engine/commands/install/doctor.ts +57 -28
- package/.bkit/core/engine/commands/install/install.ts +62 -126
- package/.bkit/core/engine/commands/install/uninstall.ts +191 -33
- package/.bkit/core/engine/commands/install/upgrade.ts +58 -53
- package/.bkit/core/engine/commands/lib.ts +35 -10
- package/.bkit/core/engine/commands/tips.ts +8 -5
- package/.bkit/core/engine/commands/workflow/branches.ts +65 -11
- package/.bkit/core/engine/commands/workflow/counters.ts +21 -12
- package/.bkit/core/engine/commands/workflow/fids.ts +46 -0
- package/.bkit/core/engine/commands/workflow/ledgers.ts +3 -1
- package/.bkit/core/engine/commands/workflow/prs.ts +4 -2
- package/.bkit/core/engine/commands/workflow/repo.ts +18 -4
- package/.bkit/core/engine/commands/workflow/roadmap.ts +4 -3
- package/.bkit/core/engine/commands/workflow/runs.ts +8 -7
- package/.bkit/core/engine/commands/workflow/steps.ts +1 -0
- package/.bkit/core/engine/commands/workflow/tests.ts +17 -5
- package/.bkit/core/engine/commands/workflow/workflows.ts +19 -17
- package/.bkit/core/engine/commands/workflow/workstreams.ts +2 -1
- package/.bkit/core/engine/commands/workflow/worktrees.ts +13 -5
- package/.bkit/core/engine/install/cloud-env.ts +10 -31
- package/.bkit/core/engine/install/manifest.ts +14 -7
- package/.bkit/core/engine/install/modules/antigravity.ts +15 -26
- package/.bkit/core/engine/install/modules/claude.ts +20 -28
- package/.bkit/core/engine/install/modules/cloud.ts +5 -2
- package/.bkit/core/engine/install/modules/codex.ts +15 -29
- package/.bkit/core/engine/install/modules/core.ts +91 -70
- package/.bkit/core/engine/install/modules/cursor.ts +6 -20
- package/.bkit/core/engine/install/modules/index.ts +7 -1
- package/.bkit/core/engine/install/modules/opencode.ts +48 -70
- package/.bkit/core/engine/install/network-allowlist.ts +73 -0
- package/.bkit/core/engine/install/placeholders.ts +3 -18
- package/.bkit/core/engine/install/write.ts +59 -12
- package/.bkit/core/engine/ledgers/telemetry.ts +6 -4
- package/.bkit/core/engine/render/hosts.ts +47 -67
- package/.bkit/core/engine/render/models.ts +29 -11
- package/.bkit/core/engine/shared/bkit-latest.ts +164 -0
- package/.bkit/core/engine/shared/branches.ts +13 -0
- package/.bkit/core/engine/shared/egress.ts +3 -3
- package/.bkit/core/engine/shared/json.ts +18 -1
- package/.bkit/core/engine/shared/package-json.ts +63 -0
- package/.bkit/core/engine/shared/package-roots.ts +0 -10
- package/.bkit/core/engine/shared/protected-paths.ts +5 -130
- package/.bkit/core/engine/shared/settings.ts +36 -0
- package/.bkit/core/engine/shared/timeouts.ts +6 -0
- package/.bkit/core/hooks/antigravity-hook.js +1 -0
- package/.bkit/core/hooks/guardrails-shell.js +186 -40
- package/.bkit/core/hooks/guardrails-tiers.js +5 -78
- package/.bkit/core/prompts/bkit-audit-generate.md +65 -10
- package/.bkit/core/prompts/bkit-build-challenge-1.md +1 -1
- package/.bkit/core/prompts/bkit-build-challenge-2.md +1 -1
- package/.bkit/core/prompts/bkit-build-challenge-reconcile.md +1 -1
- package/.bkit/core/prompts/bkit-build-challenge-remediate.md +1 -1
- package/.bkit/core/prompts/bkit-build-challenge-tests.md +1 -1
- package/.bkit/core/prompts/bkit-build-install-skills.md +1 -1
- package/.bkit/core/prompts/bkit-build-plan-current.md +1 -1
- package/.bkit/core/prompts/bkit-build-plan-execute.md +4 -4
- package/.bkit/core/prompts/bkit-build-plan-gaps-remediate.md +1 -1
- package/.bkit/core/prompts/bkit-build-plan-verify.md +2 -2
- package/.bkit/core/prompts/bkit-debug-abort-handover.md +1 -1
- package/.bkit/core/prompts/bkit-debug-failure-diagnose.md +1 -1
- package/.bkit/core/prompts/bkit-debug-failure-remediate.md +1 -1
- package/.bkit/core/prompts/bkit-debug-failure-reproduce.md +78 -0
- package/.bkit/core/prompts/bkit-debug-failure-soak.md +1 -1
- package/.bkit/core/prompts/bkit-debug-summary.md +3 -3
- package/.bkit/core/prompts/bkit-design-spike.md +1 -1
- package/.bkit/core/prompts/bkit-design-summary.md +2 -2
- package/.bkit/core/prompts/bkit-design-update.md +1 -1
- package/.bkit/core/prompts/bkit-plan-complexity-check.md +1 -1
- package/.bkit/core/prompts/bkit-plan-generate.md +1 -1
- package/.bkit/core/prompts/bkit-plan-scope-check-1.md +1 -1
- package/.bkit/core/prompts/bkit-plan-scope-check-2.md +1 -1
- package/.bkit/core/prompts/bkit-plan-summary.md +1 -1
- package/.bkit/core/prompts/bkit-plan-update.md +1 -1
- package/.bkit/core/prompts/bkit-ship-conflict-resolve.md +1 -1
- package/.bkit/core/prompts/bkit-ship-deferred-sweep.md +1 -1
- package/.bkit/core/prompts/bkit-ship-update-docs.md +1 -1
- package/.bkit/core/prompts/bkit-utility-update-decisions.md +9 -2
- package/.bkit/core/prompts/bkit-utility-update-deferrals.md +9 -2
- package/.bkit/core/prompts/bkit-utility-update-documentation.md +2 -1
- package/.bkit/core/prompts/bkit-utility-update-failures.md +9 -2
- package/.bkit/core/prompts/bkit-utility-update-knowledge.md +9 -2
- package/.bkit/core/prompts/bkit-utility-update-roadmap.md +11 -4
- package/.bkit/core/workflows/bkit-build.md +4 -4
- package/.bkit/core/workflows/bkit-debug.md +70 -34
- package/.bkit/core/workflows/bkit-design.md +3 -3
- package/.bkit/core/workflows/bkit-plan.md +12 -5
- package/.bkit/core/workflows/bkit-ship.md +6 -6
- package/.bkit/shared/.claude/bkit-cloud.md +46 -13
- package/.bkit/shared/.claude/settings.json +18 -0
- package/.bkit/shared/.cursor/mcp.json +2 -1
- package/.bkit/shared/.opencode/opencode.json +19 -1
- package/.bkit/shared/docs/deployments.md +20 -4
- package/.bkit/shared/docs/security.md +8 -6
- package/.bkit/shared/docs/testing.md +9 -5
- package/.bkit/templates/.cursor/Dockerfile +30 -16
- package/.bkit/templates/.github/ISSUE_TEMPLATE/bkit-bug.yml +78 -0
- package/.bkit/templates/.github/ISSUE_TEMPLATE/bkit-change.yml +91 -0
- package/.bkit/templates/.github/ISSUE_TEMPLATE/bkit-idea.yml +56 -0
- package/.bkit/templates/.github/renovate.json5 +91 -12
- package/.bkit/templates/.github/workflows/bkit-ci.yml +66 -53
- package/.bkit/templates/.github/workflows/bkit-cloud.yml +3 -1
- package/.bkit/templates/.github/workflows/bkit-renovate.yml +8 -1
- package/.bkit/templates/.github/workflows/bkit-trivy.yml +67 -0
- package/.bkit/templates/.husky/pre-push +15 -3
- package/.bkit/templates/.oxlintrc.json +21 -0
- package/.bkit/templates/docs/capabilities.md +1 -1
- package/.bkit/templates/scripts/ci/check-capstone.mjs +176 -0
- package/.bkit/templates/scripts/ci/check-capstone.test.mjs +311 -0
- package/.bkit/templates/scripts/cleanup/bkit-tmp-prune.mjs +115 -0
- package/.bkit/templates/scripts/graphify/bkit-graph-eager.py +2 -2
- package/.bkit/templates/scripts/graphify/bkit-graph-imports.py +43 -20
- package/.bkit/templates/scripts/graphify/bkit-graph-pre-push.sh +33 -11
- package/.bkit/templates/scripts/graphify/bkit-graph-repair.py +3 -2
- package/.bkit/templates/scripts/graphify/bkit-graphify-rollup.py +5 -5
- package/.bkit/templates/scripts/graphify/bkit-graphify.sh +79 -19
- package/CHANGELOG.md +67 -3
- package/README.md +258 -129
- package/dist/checks/after/auth.js +10 -11
- package/dist/checks/after/ci-yml.js +11 -14
- package/dist/checks/after/github.js +32 -125
- package/dist/checks/after/index.js +3 -2
- package/dist/checks/after/managed.js +8 -24
- package/dist/checks/after/tools.js +3 -16
- package/dist/checks/before/context-fetch.js +1 -21
- package/dist/checks/before/index.js +6 -42
- package/dist/checks/before/mcp.js +14 -9
- package/dist/checks/before/repo.js +8 -11
- package/dist/checks/status-holes.js +5 -6
- package/dist/checks/tips/catalogue.js +60 -18
- package/dist/checks/tips/detect.js +41 -2
- package/dist/checks/tips/index.js +25 -5
- package/dist/cli.js +34 -14
- package/dist/commands/analysis.js +21 -5
- package/dist/commands/comply.js +20 -18
- package/dist/commands/harvest.js +12 -13
- package/dist/commands/install/doctor.js +55 -23
- package/dist/commands/install/install.js +62 -118
- package/dist/commands/install/uninstall.js +165 -31
- package/dist/commands/install/upgrade.js +55 -49
- package/dist/commands/lib.js +32 -10
- package/dist/commands/tips.js +6 -3
- package/dist/commands/workflow/branches.js +57 -13
- package/dist/commands/workflow/counters.js +17 -7
- package/dist/commands/workflow/fids.js +39 -0
- package/dist/commands/workflow/ledgers.js +3 -1
- package/dist/commands/workflow/prs.js +3 -3
- package/dist/commands/workflow/repo.js +16 -4
- package/dist/commands/workflow/roadmap.js +4 -4
- package/dist/commands/workflow/runs.js +5 -5
- package/dist/commands/workflow/steps.js +1 -0
- package/dist/commands/workflow/tests.js +16 -3
- package/dist/commands/workflow/workflows.js +19 -18
- package/dist/commands/workflow/workstreams.js +2 -1
- package/dist/commands/workflow/worktrees.js +4 -5
- package/dist/install/cloud-env.js +10 -23
- package/dist/install/manifest.js +14 -7
- package/dist/install/modules/antigravity.js +15 -26
- package/dist/install/modules/claude.js +17 -21
- package/dist/install/modules/cloud.js +6 -2
- package/dist/install/modules/codex.js +15 -29
- package/dist/install/modules/core.js +82 -63
- package/dist/install/modules/cursor.js +6 -9
- package/dist/install/modules/index.js +6 -1
- package/dist/install/modules/opencode.js +41 -72
- package/dist/install/network-allowlist.js +62 -0
- package/dist/install/placeholders.js +3 -16
- package/dist/install/write.js +55 -15
- package/dist/ledgers/telemetry.js +5 -4
- package/dist/render/hosts.js +30 -55
- package/dist/render/models.js +20 -9
- package/dist/shared/bkit-latest.js +150 -0
- package/dist/shared/branches.js +11 -0
- package/dist/shared/egress.js +0 -2
- package/dist/shared/json.js +14 -0
- package/dist/shared/package-json.js +61 -0
- package/dist/shared/package-roots.js +0 -8
- package/dist/shared/protected-paths.js +5 -122
- package/dist/shared/settings.js +18 -1
- package/dist/shared/timeouts.js +6 -0
- package/package.json +21 -17
- package/.bkit/core/.agents/shortcuts.md +0 -73
package/dist/commands/comply.js
CHANGED
|
@@ -16,9 +16,10 @@
|
|
|
16
16
|
import { execFileSync } from "node:child_process";
|
|
17
17
|
import * as fs from "node:fs";
|
|
18
18
|
import * as path from "node:path";
|
|
19
|
+
import { readJsonFile } from "../shared/json.js";
|
|
19
20
|
import { getPkgRoot } from "../shared/package-roots.js";
|
|
20
21
|
import { isMirrorPath } from "../shared/protected-paths.js";
|
|
21
|
-
import { resolveGitSha, resolveRepoSlug, } from "../ledgers/telemetry.js";
|
|
22
|
+
import { gitEnv, resolveGitSha, resolveRepoSlug, } from "../ledgers/telemetry.js";
|
|
22
23
|
/** SHA charset guard — only raw hex SHAs from the ledger are accepted. */
|
|
23
24
|
const SHA_RE = /^[0-9a-f]{7,40}$/;
|
|
24
25
|
export const realGitAdapter = {
|
|
@@ -30,6 +31,7 @@ export const realGitAdapter = {
|
|
|
30
31
|
try {
|
|
31
32
|
const output = execFileSync("git", ["diff", "--name-only", `${parentSha}..HEAD`], {
|
|
32
33
|
cwd,
|
|
34
|
+
env: gitEnv(),
|
|
33
35
|
encoding: "utf8",
|
|
34
36
|
stdio: ["ignore", "pipe", "ignore"],
|
|
35
37
|
});
|
|
@@ -47,6 +49,7 @@ export const realGitAdapter = {
|
|
|
47
49
|
try {
|
|
48
50
|
return execFileSync("git", ["log", "-1", "--format=%s"], {
|
|
49
51
|
cwd,
|
|
52
|
+
env: gitEnv(),
|
|
50
53
|
encoding: "utf8",
|
|
51
54
|
stdio: ["ignore", "pipe", "ignore"],
|
|
52
55
|
}).trim();
|
|
@@ -245,24 +248,23 @@ export function formatComplianceSummary(violations) {
|
|
|
245
248
|
* running bkit package's root). Returns "0.0.0" on any read/parse error (fail-open).
|
|
246
249
|
*/
|
|
247
250
|
export function readBkitVersion(searchFrom) {
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
break;
|
|
261
|
-
dir = parent;
|
|
251
|
+
// Walk up looking for a package.json with a `version` field; stop at the filesystem root.
|
|
252
|
+
let dir = path.resolve(searchFrom ?? getPkgRoot());
|
|
253
|
+
for (let i = 0; i < 8; i++) {
|
|
254
|
+
const candidate = path.join(dir, "package.json");
|
|
255
|
+
if (fs.existsSync(candidate)) {
|
|
256
|
+
const read = readJsonFile(candidate);
|
|
257
|
+
// Fail-open: a package.json that cannot be read ends the search with the default.
|
|
258
|
+
if (!read.ok || read.value === null)
|
|
259
|
+
return "0.0.0";
|
|
260
|
+
const pkg = read.value;
|
|
261
|
+
if (typeof pkg.version === "string")
|
|
262
|
+
return pkg.version;
|
|
262
263
|
}
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
264
|
+
const parent = path.dirname(dir);
|
|
265
|
+
if (parent === dir)
|
|
266
|
+
break;
|
|
267
|
+
dir = parent;
|
|
266
268
|
}
|
|
267
269
|
return "0.0.0";
|
|
268
270
|
}
|
package/dist/commands/harvest.js
CHANGED
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
// - The prune gate is byte-for-byte CONTENT, never identity.
|
|
15
15
|
// - The central store ACCUMULATES across runs (never cleared) and holds every
|
|
16
16
|
// DISTINCT row, deduped by content only. It is never rewritten from the fold. It is
|
|
17
|
-
//
|
|
18
|
-
// fold it.
|
|
17
|
+
// gitignored (private consumer content), so it is the only record of pruned consumer
|
|
18
|
+
// friction; readers fold it.
|
|
19
19
|
// - Malformed consumer lines are NEVER pruned (not ours to delete).
|
|
20
20
|
// - Grep-able [bkit-harvest] log lines.
|
|
21
21
|
// - Relies on the tolerant `parse` for half-written tails.
|
|
@@ -24,11 +24,12 @@
|
|
|
24
24
|
// copy -> fsync -> verify -> prune; a crash at any point re-copies idempotently on the
|
|
25
25
|
// next run.
|
|
26
26
|
//
|
|
27
|
-
// Consumers are listed in `
|
|
27
|
+
// Consumers are listed in `harvest/consumers.md` (one absolute path per line).
|
|
28
28
|
// See DE-34 for the shared-entrypoint + crash-isolation contract.
|
|
29
29
|
import * as fs from "node:fs";
|
|
30
30
|
import * as path from "node:path";
|
|
31
31
|
import { fold, parse, resolveRepoSlug, } from "../ledgers/telemetry.js";
|
|
32
|
+
import { parseJson } from "../shared/json.js";
|
|
32
33
|
// ---------------------------------------------------------------------------
|
|
33
34
|
// Constants
|
|
34
35
|
// ---------------------------------------------------------------------------
|
|
@@ -43,17 +44,17 @@ export const HARVEST_PRUNE_FILES = ["friction.jsonl"];
|
|
|
43
44
|
/** Files to COUNT-ONLY from each consumer's `docs/` directory (metadata only). */
|
|
44
45
|
export const HARVEST_COUNT_FILES = ["deferrals.jsonl", "failures.jsonl"];
|
|
45
46
|
/** Path (relative to bkit repo root) for the consumers list. */
|
|
46
|
-
export const CONSUMERS_FILE = "
|
|
47
|
+
export const CONSUMERS_FILE = "harvest/consumers.md";
|
|
47
48
|
/**
|
|
48
49
|
* Destination directory in bkit for harvested data. Repo root, NOT under `.bkit/`
|
|
49
50
|
* (bkit's managed/installed surface).
|
|
50
51
|
*/
|
|
51
52
|
export const HARVEST_DEST_DIR = "harvest";
|
|
52
53
|
// ---------------------------------------------------------------------------
|
|
53
|
-
// Read consumer list from `
|
|
54
|
+
// Read consumer list from `harvest/consumers.md`
|
|
54
55
|
// ---------------------------------------------------------------------------
|
|
55
56
|
/**
|
|
56
|
-
* Read the list of consumer repo root paths from `
|
|
57
|
+
* Read the list of consumer repo root paths from `harvest/consumers.md`.
|
|
57
58
|
* Returns an array of absolute paths (non-empty lines, comments stripped).
|
|
58
59
|
*/
|
|
59
60
|
export function readConsumerPaths(bkitRoot) {
|
|
@@ -176,14 +177,12 @@ export function pruneConsumerFile(srcPath, consumerSlug, durable) {
|
|
|
176
177
|
for (const line of raw.split("\n")) {
|
|
177
178
|
if (line.trim() === "")
|
|
178
179
|
continue;
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
event = JSON.parse(line.trim());
|
|
182
|
-
}
|
|
183
|
-
catch {
|
|
180
|
+
const parsed = parseJson(line.trim());
|
|
181
|
+
if (!parsed.ok) {
|
|
184
182
|
kept.push(line); // malformed — never ours to delete
|
|
185
183
|
continue;
|
|
186
184
|
}
|
|
185
|
+
const event = parsed.value;
|
|
187
186
|
if (durable.rows.has(canonicalRow(stampRepo(event, consumerSlug)))) {
|
|
188
187
|
removed++;
|
|
189
188
|
continue;
|
|
@@ -221,7 +220,7 @@ function fsyncFile(filePath) {
|
|
|
221
220
|
// Run harvest across all consumers
|
|
222
221
|
// ---------------------------------------------------------------------------
|
|
223
222
|
/**
|
|
224
|
-
* Run harvest across all consumers listed in `
|
|
223
|
+
* Run harvest across all consumers listed in `harvest/consumers.md`.
|
|
225
224
|
* Deduplicates the store by row content after collecting all rows.
|
|
226
225
|
*/
|
|
227
226
|
export function runHarvest(bkitRoot) {
|
|
@@ -296,7 +295,7 @@ export function runHarvest(bkitRoot) {
|
|
|
296
295
|
}
|
|
297
296
|
console.error(`[bkit-harvest] Done — total rows collected: ${totalCopied}, entities after fold: ${dedupedRows}, pruned from consumers: ${totalPruned}, kept in consumers: ${totalKept}`);
|
|
298
297
|
if (totalPruned > 0) {
|
|
299
|
-
console.error(`[bkit-harvest] ${totalPruned} row(s) now exist ONLY in ${HARVEST_DEST_DIR}/ —
|
|
298
|
+
console.error(`[bkit-harvest] ${totalPruned} row(s) now exist ONLY in ${HARVEST_DEST_DIR}/ (gitignored) — back it up to make them durable.`);
|
|
300
299
|
}
|
|
301
300
|
return {
|
|
302
301
|
consumers: consumerResults,
|
|
@@ -2,19 +2,54 @@
|
|
|
2
2
|
// `bkit status` (read-only host/provider status).
|
|
3
3
|
import * as fs from "node:fs";
|
|
4
4
|
import * as path from "node:path";
|
|
5
|
-
import { detectOpencodeProvider, detectOpencodeProviders
|
|
5
|
+
import { detectOpencodeProvider, detectOpencodeProviders } from "./install.js";
|
|
6
6
|
import { OPENCODE_PROVIDERS } from "../../shared/egress.js";
|
|
7
|
+
import { readJsonFile } from "../../shared/json.js";
|
|
7
8
|
import { LOG_PREFIX, setLogPrefix } from "../../shared/log-prefix.js";
|
|
9
|
+
import { readInstallingVersion } from "../../shared/package-json.js";
|
|
8
10
|
import { getCoreRoot, getSharedRoot, getTemplatesRoot } from "../../shared/package-roots.js";
|
|
9
11
|
import { runPreflight } from "../../checks/before/index.js";
|
|
10
12
|
import { runPostInstallCheck, formatChecklist, writeAdvisoriesArtifact, } from "../../checks/after/index.js";
|
|
11
13
|
import { collectTips } from "../../checks/tips/index.js";
|
|
12
14
|
import { parseDotenv } from "../../install/cloud-env.js";
|
|
13
15
|
import { detectInstalledHostModules } from "../../install/hosts.js";
|
|
16
|
+
import { parseFrontmatter } from "../../render/hosts.js";
|
|
17
|
+
/**
|
|
18
|
+
* The `model:` pins in the frontmatter of `.opencode/agents/*.md` — where bkit renders the
|
|
19
|
+
* opencode per-agent pins — grouped by model, most-used first (ties by model id). `[]` when
|
|
20
|
+
* the directory is absent or no agent carries a pin.
|
|
21
|
+
*/
|
|
22
|
+
export function readOpencodeModelPins(cwd) {
|
|
23
|
+
const agentsDir = path.join(cwd, ".opencode", "agents");
|
|
24
|
+
if (!fs.existsSync(agentsDir))
|
|
25
|
+
return [];
|
|
26
|
+
const counts = new Map();
|
|
27
|
+
for (const name of fs.readdirSync(agentsDir)) {
|
|
28
|
+
if (!name.endsWith(".md"))
|
|
29
|
+
continue;
|
|
30
|
+
const content = fs.readFileSync(path.join(agentsDir, name), "utf-8");
|
|
31
|
+
const fm = content.match(/^---\r?\n([\s\S]*?)\r?\n---/);
|
|
32
|
+
const model = fm ? parseFrontmatter(fm[1]).get("model")?.trim() : undefined;
|
|
33
|
+
if (model)
|
|
34
|
+
counts.set(model, (counts.get(model) ?? 0) + 1);
|
|
35
|
+
}
|
|
36
|
+
return [...counts]
|
|
37
|
+
.map(([model, agents]) => ({ model, agents }))
|
|
38
|
+
.sort((a, b) => b.agents - a.agents || a.model.localeCompare(b.model));
|
|
39
|
+
}
|
|
40
|
+
/** `model: <id>` for one distinct pin, else `models: <id> (N agents), …`. */
|
|
41
|
+
export function formatOpencodeModelPins(pins) {
|
|
42
|
+
if (pins.length === 0)
|
|
43
|
+
return "model: none pinned in .opencode/agents/";
|
|
44
|
+
if (pins.length === 1)
|
|
45
|
+
return `model: ${pins[0].model}`;
|
|
46
|
+
const list = pins.map((p) => `${p.model} (${p.agents} agent${p.agents === 1 ? "" : "s"})`);
|
|
47
|
+
return `models: ${list.join(", ")}`;
|
|
48
|
+
}
|
|
14
49
|
/**
|
|
15
50
|
* `bkit status` — read-only host/provider status.
|
|
16
|
-
* Reports current host+provider sampled from .
|
|
17
|
-
*
|
|
51
|
+
* Reports current host+provider sampled from .claude/, .cursor/, package.json and the
|
|
52
|
+
* opencode agent model pins in .opencode/agents/. Writes nothing.
|
|
18
53
|
*/
|
|
19
54
|
export function runStatus(cwd, logPrefix) {
|
|
20
55
|
console.log(`${logPrefix} Host/provider status (read-only — no writes)`);
|
|
@@ -25,14 +60,13 @@ export function runStatus(cwd, logPrefix) {
|
|
|
25
60
|
const claudeSettingsPath = path.join(claudeDir, "settings.json");
|
|
26
61
|
let claudeModel = "claude (default)";
|
|
27
62
|
if (claudePresent && fs.existsSync(claudeSettingsPath)) {
|
|
28
|
-
|
|
29
|
-
|
|
63
|
+
// Best-effort: an unreadable settings file keeps the default label.
|
|
64
|
+
const read = readJsonFile(claudeSettingsPath);
|
|
65
|
+
if (read.ok && typeof read.value === "object" && read.value !== null) {
|
|
66
|
+
const settings = read.value;
|
|
30
67
|
if (settings.model)
|
|
31
68
|
claudeModel = settings.model;
|
|
32
69
|
}
|
|
33
|
-
catch {
|
|
34
|
-
// best-effort
|
|
35
|
-
}
|
|
36
70
|
}
|
|
37
71
|
console.log(`${logPrefix} claude: ${claudePresent ? "INSTALLED" : "absent"} (provider: anthropic / ${claudeModel})`);
|
|
38
72
|
// --- cursor host ---
|
|
@@ -46,22 +80,20 @@ export function runStatus(cwd, logPrefix) {
|
|
|
46
80
|
const activeOpencodeProvider = detectOpencodeProvider(cwd);
|
|
47
81
|
// All installed providers.
|
|
48
82
|
const allOpencodeProviders = detectOpencodeProviders(cwd);
|
|
49
|
-
|
|
83
|
+
// bkit pins models per agent in .opencode/agents/*.md frontmatter; opencode.json carries
|
|
84
|
+
// only the consumer's optional top-level default `model`.
|
|
85
|
+
let opencodeModel = formatOpencodeModelPins(readOpencodeModelPins(cwd));
|
|
50
86
|
const opencodeJsonPath = path.join(opencodeDir, "opencode.json");
|
|
51
87
|
if (opencodePresent && fs.existsSync(opencodeJsonPath)) {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
opencodeModel = cfg.model;
|
|
56
|
-
// Fallback: look for non-empty models map
|
|
57
|
-
if (opencodeModel === "unknown" && cfg.models) {
|
|
58
|
-
const modelKeys = Object.keys(cfg.models);
|
|
59
|
-
if (modelKeys.length > 0)
|
|
60
|
-
opencodeModel = `${modelKeys.length} model(s) configured`;
|
|
61
|
-
}
|
|
88
|
+
const read = readJsonFile(opencodeJsonPath);
|
|
89
|
+
if (!read.ok || read.value === null || typeof read.value !== "object") {
|
|
90
|
+
opencodeModel += "; opencode.json: parse-error";
|
|
62
91
|
}
|
|
63
|
-
|
|
64
|
-
|
|
92
|
+
else {
|
|
93
|
+
const cfg = read.value;
|
|
94
|
+
if (typeof cfg.model === "string" && cfg.model) {
|
|
95
|
+
opencodeModel += `; default model: ${cfg.model}`;
|
|
96
|
+
}
|
|
65
97
|
}
|
|
66
98
|
}
|
|
67
99
|
let opencodeProviderDisplay;
|
|
@@ -85,7 +117,7 @@ export function runStatus(cwd, logPrefix) {
|
|
|
85
117
|
// --- antigravity host ---
|
|
86
118
|
const antigravityPresent = detectInstalledHostModules(cwd).has("antigravity");
|
|
87
119
|
const opencodeStatus = opencodePresent
|
|
88
|
-
? `INSTALLED (${providerLabel}: ${opencodeProviderDisplay} /
|
|
120
|
+
? `INSTALLED (${providerLabel}: ${opencodeProviderDisplay} / ${opencodeModel})`
|
|
89
121
|
: "absent (run: bkit install --opencode=<provider>)";
|
|
90
122
|
console.log(`${logPrefix} opencode: ${opencodeStatus}`);
|
|
91
123
|
console.log(`${logPrefix} codex: ${codexPresent ? "INSTALLED (provider: openai)" : "absent (run: bkit install --codex)"}`);
|
|
@@ -132,7 +164,7 @@ export async function runDoctor(modules, opencodeProvider) {
|
|
|
132
164
|
writeAdvisoriesArtifact(allFindings, {
|
|
133
165
|
cwd: process.cwd(),
|
|
134
166
|
mode: "doctor",
|
|
135
|
-
version:
|
|
167
|
+
version: readInstallingVersion(),
|
|
136
168
|
logPrefix: LOG_PREFIX,
|
|
137
169
|
suppressed,
|
|
138
170
|
tips,
|
|
@@ -3,9 +3,11 @@
|
|
|
3
3
|
import * as fs from "node:fs";
|
|
4
4
|
import * as path from "node:path";
|
|
5
5
|
import { OPENCODE_PROVIDERS } from "../../shared/egress.js";
|
|
6
|
-
import {
|
|
6
|
+
import { readInstallingVersion } from "../../shared/package-json.js";
|
|
7
7
|
import { dispatchModules } from "../../install/modules/index.js";
|
|
8
|
-
import { DEFAULT_ISSUE_TRACKER,
|
|
8
|
+
import { DEFAULT_ISSUE_TRACKER, } from "../../install/manifest.js";
|
|
9
|
+
import { parseJson, readJsonFile } from "../../shared/json.js";
|
|
10
|
+
import { readBkitConfig } from "../../shared/settings.js";
|
|
9
11
|
import { LOG_PREFIX, setLogPrefix } from "../../shared/log-prefix.js";
|
|
10
12
|
import { detectInstalledModules, reportCheckDrift } from "./check.js";
|
|
11
13
|
import { runPreflight } from "../../checks/before/index.js";
|
|
@@ -15,7 +17,7 @@ import { findMissingOwnedHooks, detectOwnedHookMissing } from "../../checks/afte
|
|
|
15
17
|
import { resolveTokens } from "../../install/placeholders.js";
|
|
16
18
|
import { parseModelLookup, applyModelOverrides, buildOpencodeModelLookup, buildAntigravityModelLookup, parseEffortMap, } from "../../render/models.js";
|
|
17
19
|
import { getBkitDocsRoot } from "../../shared/package-roots.js";
|
|
18
|
-
import { runUninstall } from "./uninstall.js";
|
|
20
|
+
import { removeUnusedTrackerMcpEntries, runUninstall } from "./uninstall.js";
|
|
19
21
|
// ---------------------------------------------------------------------------
|
|
20
22
|
// Staging scratch area
|
|
21
23
|
//
|
|
@@ -57,24 +59,6 @@ export function requireOpencodeProvider(cwd, context) {
|
|
|
57
59
|
}
|
|
58
60
|
return detected;
|
|
59
61
|
}
|
|
60
|
-
/**
|
|
61
|
-
* Read the installing bkit version from the package root's package.json.
|
|
62
|
-
* Returns "0.0.0" when unreadable (e.g. dev tree without a package.json at the
|
|
63
|
-
* resolved root) — keeps the advisories artifact informational, not fatal.
|
|
64
|
-
*/
|
|
65
|
-
export function getInstallingVersion() {
|
|
66
|
-
try {
|
|
67
|
-
const pkgJsonPath = path.join(getPkgRoot(), "package.json");
|
|
68
|
-
if (fs.existsSync(pkgJsonPath)) {
|
|
69
|
-
const pkg = JSON.parse(fs.readFileSync(pkgJsonPath, "utf-8"));
|
|
70
|
-
return pkg.version ?? "0.0.0";
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
catch {
|
|
74
|
-
return "0.0.0"; // best-effort: unreadable/garbled package.json
|
|
75
|
-
}
|
|
76
|
-
return "0.0.0";
|
|
77
|
-
}
|
|
78
62
|
/**
|
|
79
63
|
* Render a resolved module set back into valid CLI flags for
|
|
80
64
|
* recovery-hint text. Skips core (implicit) and spells opt-ins with their value flags.
|
|
@@ -130,35 +114,23 @@ export function validateCloudTrackerMatch(cloudVariant, hasCloudModule, issueTra
|
|
|
130
114
|
* smuggle an unsupported provider into the render path.
|
|
131
115
|
*/
|
|
132
116
|
export function detectOpencodeProvider(cwd) {
|
|
133
|
-
const
|
|
134
|
-
if (
|
|
135
|
-
|
|
136
|
-
const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf-8"));
|
|
137
|
-
const stored = pkg.bkit?.opencodeProvider;
|
|
138
|
-
if (typeof stored === "string" &&
|
|
139
|
-
OPENCODE_PROVIDERS.includes(stored)) {
|
|
140
|
-
return stored;
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
catch {
|
|
144
|
-
// unparseable package.json — fall through to opencode.json detection
|
|
145
|
-
}
|
|
146
|
-
}
|
|
117
|
+
const stored = readBkitConfig(cwd).opencodeProvider;
|
|
118
|
+
if (stored !== null)
|
|
119
|
+
return stored;
|
|
147
120
|
const jsonPath = path.join(cwd, ".opencode", "opencode.json");
|
|
148
121
|
if (!fs.existsSync(jsonPath))
|
|
149
122
|
return null;
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
return null; // unparseable opencode.json — fall back to the default provider
|
|
123
|
+
// Unparseable opencode.json — fall back to the default provider.
|
|
124
|
+
const read = readJsonFile(jsonPath);
|
|
125
|
+
if (!read.ok || typeof read.value !== "object" || read.value === null)
|
|
126
|
+
return null;
|
|
127
|
+
const cfg = read.value;
|
|
128
|
+
if (cfg.provider && typeof cfg.provider === "object") {
|
|
129
|
+
const first = Object.keys(cfg.provider)[0];
|
|
130
|
+
if (!first)
|
|
131
|
+
return null;
|
|
132
|
+
// Zen's opencode.json block is keyed by the built-in id `opencode`, not the CLI key.
|
|
133
|
+
return first === "opencode" ? "opencode-zen" : first;
|
|
162
134
|
}
|
|
163
135
|
return null;
|
|
164
136
|
}
|
|
@@ -168,20 +140,7 @@ export function detectOpencodeProvider(cwd) {
|
|
|
168
140
|
* the field is absent.
|
|
169
141
|
*/
|
|
170
142
|
export function detectOpencodeProviders(cwd) {
|
|
171
|
-
|
|
172
|
-
if (!fs.existsSync(pkgPath))
|
|
173
|
-
return [];
|
|
174
|
-
try {
|
|
175
|
-
const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf-8"));
|
|
176
|
-
const arr = pkg.bkit?.opencodeProviders;
|
|
177
|
-
if (Array.isArray(arr)) {
|
|
178
|
-
return arr.filter((v) => typeof v === "string" && OPENCODE_PROVIDERS.includes(v));
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
catch {
|
|
182
|
-
// unparseable — return empty
|
|
183
|
-
}
|
|
184
|
-
return [];
|
|
143
|
+
return readBkitConfig(cwd).opencodeProviders;
|
|
185
144
|
}
|
|
186
145
|
/**
|
|
187
146
|
* Re-run Phase 1 detection after the writes. The Phase 1 advisory seeds (the first
|
|
@@ -241,24 +200,8 @@ export async function runInstall(args, upgradeReport = false) {
|
|
|
241
200
|
// already-recorded tracker.
|
|
242
201
|
// Resolved BEFORE preflight: preflight's tracker-dependent detectors grade the tracker
|
|
243
202
|
// this run INSTALLS, not the one on disk from the previous run. Read-only — no writes here.
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
const consumerPkgPath = path.join(process.cwd(), "package.json");
|
|
247
|
-
if (fs.existsSync(consumerPkgPath)) {
|
|
248
|
-
try {
|
|
249
|
-
const pkg = JSON.parse(fs.readFileSync(consumerPkgPath, "utf-8"));
|
|
250
|
-
const bkitField = pkg.bkit;
|
|
251
|
-
const stored = parseIssueTracker(bkitField?.issueTracker);
|
|
252
|
-
if (stored !== null)
|
|
253
|
-
issueTracker = stored;
|
|
254
|
-
}
|
|
255
|
-
catch {
|
|
256
|
-
// non-fatal — keep default
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
if (tracker !== null)
|
|
260
|
-
issueTracker = tracker;
|
|
261
|
-
}
|
|
203
|
+
const recordedTracker = readBkitConfig(process.cwd()).issueTracker;
|
|
204
|
+
const issueTracker = tracker ?? recordedTracker;
|
|
262
205
|
// --- Phase 1: Preflight (read-only, before any writes) ---
|
|
263
206
|
// Must run BEFORE resolveTokens to short-circuit cleanly on blockers.
|
|
264
207
|
const { blockers, advisories: preflightAdvisories } = runPreflight(effectiveModules, process.cwd(), undefined, issueTracker);
|
|
@@ -271,7 +214,7 @@ export async function runInstall(args, upgradeReport = false) {
|
|
|
271
214
|
writeAdvisoriesArtifact(blockers, {
|
|
272
215
|
cwd: process.cwd(),
|
|
273
216
|
mode: "upgrade",
|
|
274
|
-
version:
|
|
217
|
+
version: readInstallingVersion(),
|
|
275
218
|
logPrefix: LOG_PREFIX,
|
|
276
219
|
});
|
|
277
220
|
return;
|
|
@@ -379,31 +322,35 @@ export async function runInstall(args, upgradeReport = false) {
|
|
|
379
322
|
if (fs.existsSync(consumerPkgPath2)) {
|
|
380
323
|
try {
|
|
381
324
|
const raw = fs.readFileSync(consumerPkgPath2, "utf-8");
|
|
382
|
-
|
|
383
|
-
const
|
|
384
|
-
if (
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
325
|
+
// A package.json that is not JSON is left as-is (the preflight blocker reports it).
|
|
326
|
+
const parsed = parseJson(raw);
|
|
327
|
+
if (parsed.ok) {
|
|
328
|
+
const pkg = parsed.value;
|
|
329
|
+
const bkit = (pkg.bkit ?? {});
|
|
330
|
+
if (persistTracker)
|
|
331
|
+
bkit.issueTracker = tracker;
|
|
332
|
+
if (persistProvider) {
|
|
333
|
+
bkit.opencodeProvider = opencodeProvider; // active (drives agent frontmatter)
|
|
334
|
+
// Update providers array (deduped).
|
|
335
|
+
const existingArr = Array.isArray(bkit.opencodeProviders)
|
|
336
|
+
? [...bkit.opencodeProviders]
|
|
337
|
+
: [];
|
|
338
|
+
if (!existingArr.includes(opencodeProvider)) {
|
|
339
|
+
existingArr.push(opencodeProvider);
|
|
340
|
+
}
|
|
341
|
+
bkit.opencodeProviders = existingArr;
|
|
342
|
+
}
|
|
343
|
+
pkg.bkit = bkit;
|
|
344
|
+
const indentMatch = raw.match(/\n([ \t]+)"/);
|
|
345
|
+
const indent = indentMatch ? indentMatch[1] : " ";
|
|
346
|
+
const trailingNewline = raw.endsWith("\n") ? "\n" : "";
|
|
347
|
+
fs.writeFileSync(consumerPkgPath2, JSON.stringify(pkg, null, indent) + trailingNewline, "utf-8");
|
|
348
|
+
if (persistTracker) {
|
|
349
|
+
console.log(`${LOG_PREFIX} Set bkit.issueTracker = "${tracker}" in package.json`);
|
|
350
|
+
}
|
|
351
|
+
if (persistProvider) {
|
|
352
|
+
console.log(`${LOG_PREFIX} Set bkit.opencodeProvider = "${opencodeProvider}" and updated bkit.opencodeProviders in package.json`);
|
|
394
353
|
}
|
|
395
|
-
bkit.opencodeProviders = existingArr;
|
|
396
|
-
}
|
|
397
|
-
pkg.bkit = bkit;
|
|
398
|
-
const indentMatch = raw.match(/\n([ \t]+)"/);
|
|
399
|
-
const indent = indentMatch ? indentMatch[1] : " ";
|
|
400
|
-
const trailingNewline = raw.endsWith("\n") ? "\n" : "";
|
|
401
|
-
fs.writeFileSync(consumerPkgPath2, JSON.stringify(pkg, null, indent) + trailingNewline, "utf-8");
|
|
402
|
-
if (persistTracker) {
|
|
403
|
-
console.log(`${LOG_PREFIX} Set bkit.issueTracker = "${tracker}" in package.json`);
|
|
404
|
-
}
|
|
405
|
-
if (persistProvider) {
|
|
406
|
-
console.log(`${LOG_PREFIX} Set bkit.opencodeProvider = "${opencodeProvider}" and updated bkit.opencodeProviders in package.json`);
|
|
407
354
|
}
|
|
408
355
|
}
|
|
409
356
|
catch {
|
|
@@ -411,6 +358,12 @@ export async function runInstall(args, upgradeReport = false) {
|
|
|
411
358
|
}
|
|
412
359
|
}
|
|
413
360
|
}
|
|
361
|
+
// Tracker switch: drop the bkit MCP entries the new tracker does not use, while each still
|
|
362
|
+
// equals bkit's template (an edited one stays, with a warning). Runs before dispatch so the
|
|
363
|
+
// `.bkit/version` hashes core records cover the final file content.
|
|
364
|
+
if (!dryRun && tracker !== null && tracker !== recordedTracker) {
|
|
365
|
+
removeUnusedTrackerMcpEntries(process.cwd(), tracker, dryRun, ws, LOG_PREFIX);
|
|
366
|
+
}
|
|
414
367
|
const ctx = {
|
|
415
368
|
dryRun,
|
|
416
369
|
tokens,
|
|
@@ -427,7 +380,7 @@ export async function runInstall(args, upgradeReport = false) {
|
|
|
427
380
|
issueTracker,
|
|
428
381
|
cloudVariant,
|
|
429
382
|
// Stamped into every rendered agent + command as the managed-version marker.
|
|
430
|
-
version:
|
|
383
|
+
version: readInstallingVersion(),
|
|
431
384
|
// Full host set for this run: dispatched ∪ already-on-disk. Read by the Antigravity
|
|
432
385
|
// module to warn when Codex is also installed (both hosts' `bkit-*` workflow skills
|
|
433
386
|
// then surface in Antigravity's skill selector).
|
|
@@ -477,18 +430,9 @@ export async function runInstall(args, upgradeReport = false) {
|
|
|
477
430
|
// Runs for both install AND check — detectors are read-only, so check produces
|
|
478
431
|
// the same advisory set as install would emit against the same filesystem state.
|
|
479
432
|
// Changelog version-delta header (A7): surface what changed in the installed version.
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
const pkg = JSON.parse(fs.readFileSync(pkgJsonPath, "utf-8"));
|
|
484
|
-
const deltaHeader = readChangelogVersionDelta(pkg.version ?? "");
|
|
485
|
-
if (deltaHeader)
|
|
486
|
-
console.log(deltaHeader);
|
|
487
|
-
}
|
|
488
|
-
}
|
|
489
|
-
catch (err) {
|
|
490
|
-
void err; // Non-fatal — changelog header is informational
|
|
491
|
-
}
|
|
433
|
+
const deltaHeader = readChangelogVersionDelta(readInstallingVersion());
|
|
434
|
+
if (deltaHeader)
|
|
435
|
+
console.log(deltaHeader);
|
|
492
436
|
const suppressed = [];
|
|
493
437
|
const postFindings = runPostInstallCheck(ctx.advisories, process.cwd(), suppressed);
|
|
494
438
|
if (postWriteBlockers.length > 0) {
|
|
@@ -509,7 +453,7 @@ export async function runInstall(args, upgradeReport = false) {
|
|
|
509
453
|
writeAdvisoriesArtifact(postFindings, {
|
|
510
454
|
cwd: process.cwd(),
|
|
511
455
|
mode: upgradeReport ? "upgrade" : dryRun ? "check" : "install",
|
|
512
|
-
version:
|
|
456
|
+
version: readInstallingVersion(),
|
|
513
457
|
logPrefix: LOG_PREFIX,
|
|
514
458
|
suppressed,
|
|
515
459
|
tips,
|