@cbartens/bkit 5.2.2 → 5.2.4
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 +4 -2
- package/.bkit/core/.agents/context.md +2 -2
- package/.bkit/core/.agents/plugins/bkit/hooks/bkit-guardrails.cjs +7 -1
- package/.bkit/core/.bkit/README.md +3 -1
- package/.bkit/core/.bkit/comparison.md +114 -45
- package/.bkit/core/.bkit/install.md +6 -6
- package/.bkit/core/.bkit/jsonl.md +3 -3
- package/.bkit/core/.bkit/prompts.md +6 -5
- package/.bkit/core/.bkit/providers.md +5 -4
- package/.bkit/core/.bkit/templates.md +30 -11
- package/.bkit/core/.bkit/workflows.md +14 -7
- package/.bkit/core/.codex/hooks/bkit-guardrails.cjs +5 -1
- package/.bkit/core/.cursor/hooks/bkit-guardrails.cjs +8 -2
- package/.bkit/core/docs/templates/bkit-audit-accessibility.md +13 -2
- package/.bkit/core/docs/templates/bkit-audit-adoption.md +13 -2
- package/.bkit/core/docs/templates/bkit-audit-agents.md +13 -2
- package/.bkit/core/docs/templates/bkit-audit-aio-seo.md +13 -2
- package/.bkit/core/docs/templates/bkit-audit-analytics.md +13 -2
- package/.bkit/core/docs/templates/bkit-audit-annotations.md +15 -4
- package/.bkit/core/docs/templates/bkit-audit-app-performance.md +13 -2
- package/.bkit/core/docs/templates/bkit-audit-app-store.md +13 -2
- package/.bkit/core/docs/templates/bkit-audit-architecture.md +13 -2
- package/.bkit/core/docs/templates/bkit-audit-ci-performance.md +13 -2
- package/.bkit/core/docs/templates/bkit-audit-config.md +13 -2
- package/.bkit/core/docs/templates/bkit-audit-cost.md +14 -3
- package/.bkit/core/docs/templates/bkit-audit-coverage.md +13 -2
- package/.bkit/core/docs/templates/bkit-audit-database.md +13 -2
- package/.bkit/core/docs/templates/bkit-audit-dead-code.md +13 -2
- package/.bkit/core/docs/templates/bkit-audit-deferrals.md +13 -2
- package/.bkit/core/docs/templates/bkit-audit-dependencies.md +13 -2
- package/.bkit/core/docs/templates/bkit-audit-documentation.md +13 -2
- package/.bkit/core/docs/templates/bkit-audit-duplication.md +13 -2
- package/.bkit/core/docs/templates/bkit-audit-failures.md +14 -3
- package/.bkit/core/docs/templates/bkit-audit-flakes.md +15 -4
- package/.bkit/core/docs/templates/bkit-audit-gates.md +13 -2
- package/.bkit/core/docs/templates/bkit-audit-issues.md +13 -2
- package/.bkit/core/docs/templates/bkit-audit-llm.md +13 -2
- package/.bkit/core/docs/templates/bkit-audit-logs.md +25 -13
- package/.bkit/core/docs/templates/bkit-audit-models.md +13 -2
- package/.bkit/core/docs/templates/bkit-audit-privacy.md +13 -2
- package/.bkit/core/docs/templates/bkit-audit-prompts.md +13 -2
- package/.bkit/core/docs/templates/bkit-audit-red-team.md +14 -3
- package/.bkit/core/docs/templates/bkit-audit-reliability.md +14 -3
- package/.bkit/core/docs/templates/bkit-audit-repo.md +14 -3
- package/.bkit/core/docs/templates/bkit-audit-security.md +15 -4
- package/.bkit/core/docs/templates/bkit-audit-slop.md +13 -2
- package/.bkit/core/docs/templates/bkit-audit-testing.md +14 -3
- package/.bkit/core/docs/templates/bkit-audit-usability.md +13 -2
- package/.bkit/core/docs/templates/bkit-plan.md +1 -1
- package/.bkit/core/engine/checks/tips/catalogue.ts +10 -0
- package/.bkit/core/engine/commands/install/check.ts +3 -11
- package/.bkit/core/engine/commands/install/doctor.ts +2 -3
- package/.bkit/core/engine/commands/install/uninstall.ts +60 -44
- package/.bkit/core/engine/commands/install/upgrade.ts +13 -11
- package/.bkit/core/engine/commands/workflow/branches.ts +72 -9
- package/.bkit/core/engine/commands/workflow/repo.ts +16 -2
- package/.bkit/core/engine/commands/workflow/workflows.ts +4 -3
- package/.bkit/core/engine/install/hosts.ts +14 -4
- package/.bkit/core/engine/ledgers/telemetry.ts +3 -4
- package/.bkit/core/engine/shared/bkit-latest.ts +164 -0
- package/.bkit/core/engine/shared/timeouts.ts +6 -0
- package/.bkit/core/hooks/guardrails-read.js +4 -9
- package/.bkit/core/hooks/guardrails-tiers.js +312 -28
- package/.bkit/core/prompts/bkit-audit-generate.md +21 -5
- package/.bkit/core/workflows/bkit-build.md +1 -1
- package/.bkit/core/workflows/bkit-debug.md +1 -1
- package/.bkit/core/workflows/bkit-design.md +1 -1
- package/.bkit/core/workflows/bkit-plan.md +1 -1
- package/.bkit/core/workflows/bkit-ship.md +1 -1
- package/.bkit/shared/.claude/settings.json +19 -0
- package/.bkit/shared/.opencode/opencode.json +21 -1
- package/.bkit/shared/docs/deployments.md +14 -0
- package/.bkit/templates/.github/workflows/bkit-ci.yml +9 -0
- package/.bkit/templates/.husky/pre-push +7 -0
- package/.bkit/templates/context/bkit-cloudrun.md +28 -19
- package/.bkit/templates/context/bkit-expo.md +30 -13
- package/.bkit/templates/context/bkit-inngest.md +54 -17
- package/.bkit/templates/context/bkit-resend.md +36 -8
- package/.bkit/templates/context/bkit-sentry.md +11 -4
- package/.bkit/templates/context/bkit-stripe.md +39 -22
- package/.bkit/templates/context/bkit-supabase.md +45 -20
- package/.bkit/templates/context/bkit-vercel.md +45 -16
- package/.bkit/templates/scripts/ci/accepted-advisories.json +7 -0
- package/.bkit/templates/scripts/ci/check-dependency-audit.mjs +200 -0
- package/.bkit/templates/scripts/ci/check-dependency-audit.test.mjs +127 -0
- package/.bkit/templates/scripts/cleanup/bkit-tmp-prune.mjs +115 -0
- package/CHANGELOG.md +56 -0
- package/README.md +76 -20
- package/dist/checks/tips/catalogue.js +9 -0
- package/dist/commands/install/check.js +3 -15
- package/dist/commands/install/doctor.js +2 -1
- package/dist/commands/install/uninstall.js +52 -45
- package/dist/commands/install/upgrade.js +13 -11
- package/dist/commands/workflow/branches.js +64 -10
- package/dist/commands/workflow/repo.js +14 -2
- package/dist/commands/workflow/workflows.js +4 -3
- package/dist/install/hosts.js +11 -4
- package/dist/shared/bkit-latest.js +150 -0
- package/dist/shared/timeouts.js +6 -0
- package/package.json +1 -1
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
Fits: apps deployed on Vercel. `context=runtime`: error and fatal lines from serverless and edge functions in a time window (default last 4 h, preview environment), PII-safe projection with `traceId` to stitch to the `sentry` block.
|
|
7
7
|
|
|
8
8
|
- Secret: `VERCEL_TOKEN` (local env; cloud dashboard). No `vercel login` — headless agents cannot run it.
|
|
9
|
-
- Non-secret: `VERCEL_SCOPE` (team slug) — uncomment the line in the block so cloud agents inherit it. `VERCEL_ENV` (`preview` default, `production`), `SINCE` / `UNTIL` (ISO-8601 or relative), `
|
|
9
|
+
- Non-secret: `VERCEL_SCOPE` (team slug) — uncomment the line in the block so cloud agents inherit it. `VERCEL_ENV` (`preview` default, `production`), `SINCE` / `UNTIL` (ISO-8601 or relative), `VERCEL_MAX_PAGES` (pages of 50 lines, default 20).
|
|
10
10
|
- CLI: `vercel`; the provision block installs it in cloud.
|
|
11
|
-
-
|
|
11
|
+
- Each call returns at most 50 lines, the newest inside the window, whatever `--limit` says; the block pages backwards with `--until` up to `VERCEL_MAX_PAGES`. `--no-branch` is required: without it CLI 50.x reads only the checked-out git branch. `--level error` also returns `info` lines, so jq filters `.level`. For counts over a wide window, the Vercel MCP `get_runtime_logs` with `group_by` beats lines.
|
|
12
12
|
|
|
13
13
|
Copy the blocks below into `.agents/context.md`, below `<!-- bkit:end -->`.
|
|
14
14
|
|
|
@@ -21,22 +21,51 @@ Copy the blocks below into `.agents/context.md`, below `<!-- bkit:end -->`.
|
|
|
21
21
|
# VERCEL_SCOPE is non-secret — uncomment + set the line below so local AND cloud
|
|
22
22
|
# agents inherit it (headless cloud agents never read .bkit/.env):
|
|
23
23
|
# VERCEL_SCOPE="your-team-slug"
|
|
24
|
-
#
|
|
25
|
-
#
|
|
26
|
-
#
|
|
24
|
+
# --no-branch: CLI 50.x otherwise filters to the checked-out git branch; any other branch reads 0
|
|
25
|
+
# lines. Each call returns at most 50 lines, the NEWEST in the window, whatever --limit says → loop
|
|
26
|
+
# pages backwards with --until until a page comes back short. --level error lets `info` through →
|
|
27
|
+
# jq keeps error / fatal only. SINCE / UNTIL: ISO-8601 (2026-01-31T22:50:00Z) or relative (4h).
|
|
28
|
+
# Failed first call → `skipped`; failed later page or page cap → TRUNCATED line naming the unread part.
|
|
29
|
+
# Customise: VERCEL_ENV; SINCE / UNTIL; VERCEL_MAX_PAGES (x 50 lines); --source; path or status filter; jq keys to the log shape. Positive control (suggested): run once over a window holding a known error (e.g. a 5xx seen in the dashboard); nothing back = reader broken, not clean.
|
|
27
30
|
command -v vercel >/dev/null && [ -n "${VERCEL_TOKEN:-}" ] && [ -n "${VERCEL_SCOPE:-}" ] \
|
|
28
31
|
|| { echo "[context-fetch:vercel] skipped — vercel CLI / VERCEL_TOKEN / VERCEL_SCOPE missing" >&2; exit 0; }
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
32
|
+
VERCEL_PAGE=50
|
|
33
|
+
VERCEL_ALL=$(mktemp); VERCEL_CHUNK=$(mktemp)
|
|
34
|
+
trap 'rm -f "$VERCEL_ALL" "$VERCEL_CHUNK"' EXIT
|
|
35
|
+
VERCEL_UNTIL="${UNTIL:-}"; VERCEL_PAGES=0; VERCEL_NOTE=""
|
|
36
|
+
while [ "$VERCEL_PAGES" -lt "${VERCEL_MAX_PAGES:-20}" ]; do
|
|
37
|
+
VERCEL_PAGES=$((VERCEL_PAGES + 1))
|
|
38
|
+
if ! vercel logs \
|
|
39
|
+
--token "$VERCEL_TOKEN" \
|
|
40
|
+
--scope "$VERCEL_SCOPE" \
|
|
41
|
+
--no-branch \
|
|
42
|
+
--environment "${VERCEL_ENV:-preview}" \
|
|
43
|
+
--level error --level fatal \
|
|
44
|
+
--source serverless --source edge-function \
|
|
45
|
+
--since "${SINCE:-4h}" \
|
|
46
|
+
${VERCEL_UNTIL:+--until "$VERCEL_UNTIL"} \
|
|
47
|
+
--limit "$VERCEL_PAGE" \
|
|
48
|
+
--json > "$VERCEL_CHUNK" 2>/dev/null; then
|
|
49
|
+
[ "$VERCEL_PAGES" -gt 1 ] \
|
|
50
|
+
|| { echo "[context-fetch:vercel] skipped — vercel logs exited non-zero (bad token, scope or project, or host unreachable)" >&2; exit 0; }
|
|
51
|
+
VERCEL_NOTE="page $VERCEL_PAGES failed — lines older than $VERCEL_UNTIL NOT read"; break
|
|
52
|
+
fi
|
|
53
|
+
cat "$VERCEL_CHUNK" >> "$VERCEL_ALL"
|
|
54
|
+
[ "$(grep -c . "$VERCEL_CHUNK")" -ge "$VERCEL_PAGE" ] || break
|
|
55
|
+
# Next page ends 1 s after this page's oldest line (overlap, de-duplicated by id below).
|
|
56
|
+
VERCEL_NEXT=$(jq -rs 'map(.timestamp) | min / 1000 | floor + 1 | todate' "$VERCEL_CHUNK")
|
|
57
|
+
[ "$VERCEL_NEXT" != "$VERCEL_UNTIL" ] \
|
|
58
|
+
|| { VERCEL_NOTE="over $VERCEL_PAGE lines inside one second at $VERCEL_NEXT — narrow --source or the window"; break; }
|
|
59
|
+
VERCEL_UNTIL="$VERCEL_NEXT"
|
|
60
|
+
[ "$VERCEL_PAGES" -lt "${VERCEL_MAX_PAGES:-20}" ] \
|
|
61
|
+
|| VERCEL_NOTE="stopped at VERCEL_MAX_PAGES=${VERCEL_MAX_PAGES:-20} — lines older than $VERCEL_UNTIL NOT read"
|
|
62
|
+
done
|
|
63
|
+
VERCEL_LINES=$(jq -c 'select(.level == "error" or .level == "fatal")' "$VERCEL_ALL" | jq -sc 'unique_by(.id) | sort_by(-.timestamp) | .[]')
|
|
64
|
+
printf '===== vercel %s error/fatal lines, since %s%s — %s lines, %s page(s) =====\n' \
|
|
65
|
+
"${VERCEL_ENV:-preview}" "${SINCE:-4h}" "${UNTIL:+ until $UNTIL}" "$(printf '%s' "$VERCEL_LINES" | grep -c .)" "$VERCEL_PAGES"
|
|
66
|
+
[ -z "$VERCEL_NOTE" ] || { printf '===== TRUNCATED: %s =====\n' "$VERCEL_NOTE"; echo "[context-fetch:vercel] truncated — $VERCEL_NOTE" >&2; }
|
|
67
|
+
printf '%s\n' "$VERCEL_LINES" | grep . \
|
|
68
|
+
| jq -c '{time: (.timestamp / 1000 | floor | todate), level, source, requestPath, responseStatusCode, traceId, message}' # PII-safe projection; traceId stitches to the sentry block, message is free-text — adjust keys to your log shape
|
|
40
69
|
```
|
|
41
70
|
|
|
42
71
|
<!-- context-fetch:end -->
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Example. Copy into scripts/ci/ and own it. bkit install does not write this file
|
|
3
|
+
// and does not overwrite a copy.
|
|
4
|
+
/**
|
|
5
|
+
* check-dependency-audit.mjs — the dependency-audit gate.
|
|
6
|
+
*
|
|
7
|
+
* Runs `pnpm audit --json` and reds when a blocking advisory (by default high or critical)
|
|
8
|
+
* reaches the lockfile without an acceptance in the registry. An acceptance is a row naming
|
|
9
|
+
* the advisory, a reason and an expiry date. The guard reds when:
|
|
10
|
+
* - a blocking advisory has no acceptance (a new advisory),
|
|
11
|
+
* - an acceptance has expired, or runs longer than its severity allows (`blocking` days),
|
|
12
|
+
* - an acceptance names an advisory the audit no longer reports (a stale row),
|
|
13
|
+
* - a row carries no advisory, no reason, or no `YYYY-MM-DD` expiry, or repeats one,
|
|
14
|
+
* - the audit cannot run or prints no report (fails closed; never green on no answer).
|
|
15
|
+
*
|
|
16
|
+
* pnpm's own `auditConfig.ignoreGhsas` ignores an advisory forever and records no reason;
|
|
17
|
+
* the registry makes every exception say why and come back for review.
|
|
18
|
+
*
|
|
19
|
+
* Reads pnpm's report shape (`advisories`: id → { github_advisory_id, severity, module_name,
|
|
20
|
+
* patched_versions, findings }). Another package manager → adapt `blockingFindings()`.
|
|
21
|
+
*
|
|
22
|
+
* Usage: node scripts/ci/check-dependency-audit.mjs [--registry=<file>] [--report=<file>]
|
|
23
|
+
* --report reads a saved `pnpm audit --json` instead of running the audit.
|
|
24
|
+
* Exit: 0 = every blocking advisory accepted and every row live, 1 = drift or no report.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
import { spawnSync } from "node:child_process";
|
|
28
|
+
import fs from "node:fs";
|
|
29
|
+
import path from "node:path";
|
|
30
|
+
import { fileURLToPath } from "node:url";
|
|
31
|
+
import { parseArgs } from "node:util";
|
|
32
|
+
|
|
33
|
+
/** Severity → the most days an acceptance may run. Severities not listed never block. */
|
|
34
|
+
export const DEFAULT_BLOCKING = { critical: 7, high: 30 };
|
|
35
|
+
|
|
36
|
+
const DATE_RE = /^\d{4}-\d{2}-\d{2}$/;
|
|
37
|
+
const DAY_MS = 24 * 60 * 60 * 1000;
|
|
38
|
+
|
|
39
|
+
/** `YYYY-MM-DD` of a Date, in UTC. */
|
|
40
|
+
export function isoDay(date) {
|
|
41
|
+
return date.toISOString().slice(0, 10);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** Whole days from `from` to `to`, both `YYYY-MM-DD`. */
|
|
45
|
+
function daysBetween(from, to) {
|
|
46
|
+
return Math.round((Date.parse(`${to}T00:00:00Z`) - Date.parse(`${from}T00:00:00Z`)) / DAY_MS);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* The blocking advisories in a pnpm audit report, one per advisory id.
|
|
51
|
+
* @returns {Array<{advisory: string, severity: string, module: string, patched: string, versions: string[]}>}
|
|
52
|
+
*/
|
|
53
|
+
export function blockingFindings(report, blocking = DEFAULT_BLOCKING) {
|
|
54
|
+
const found = new Map();
|
|
55
|
+
for (const a of Object.values(report.advisories ?? {})) {
|
|
56
|
+
if (!(a.severity in blocking)) continue;
|
|
57
|
+
const advisory = a.github_advisory_id || String(a.id);
|
|
58
|
+
const prior = found.get(advisory);
|
|
59
|
+
const versions = (a.findings ?? []).map((f) => f.version);
|
|
60
|
+
if (prior) prior.versions.push(...versions);
|
|
61
|
+
else
|
|
62
|
+
found.set(advisory, {
|
|
63
|
+
advisory,
|
|
64
|
+
severity: a.severity,
|
|
65
|
+
module: a.module_name,
|
|
66
|
+
patched: a.patched_versions ?? "none",
|
|
67
|
+
versions,
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
return [...found.values()].sort((x, y) => x.advisory.localeCompare(y.advisory));
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Compare the blocking findings with the registry's acceptances on `today` (`YYYY-MM-DD`).
|
|
75
|
+
* An acceptance is valid through its `expires` day.
|
|
76
|
+
*/
|
|
77
|
+
export function checkAcceptances(findings, registry, today) {
|
|
78
|
+
const blocking = registry.blocking ?? DEFAULT_BLOCKING;
|
|
79
|
+
const rows = registry.accepted ?? [];
|
|
80
|
+
const byAdvisory = new Map(findings.map((f) => [f.advisory, f]));
|
|
81
|
+
const invalid = [];
|
|
82
|
+
const expired = [];
|
|
83
|
+
const tooLong = [];
|
|
84
|
+
const stale = [];
|
|
85
|
+
const accepted = new Set();
|
|
86
|
+
|
|
87
|
+
for (const row of rows) {
|
|
88
|
+
if (!row.advisory || !row.reason || !DATE_RE.test(row.expires ?? "")) {
|
|
89
|
+
invalid.push({ row, why: "needs advisory, reason and a YYYY-MM-DD expires" });
|
|
90
|
+
continue;
|
|
91
|
+
}
|
|
92
|
+
if (accepted.has(row.advisory)) {
|
|
93
|
+
invalid.push({ row, why: "listed twice" });
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
96
|
+
accepted.add(row.advisory);
|
|
97
|
+
const finding = byAdvisory.get(row.advisory);
|
|
98
|
+
if (!finding) {
|
|
99
|
+
stale.push({ row });
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
102
|
+
if (row.expires < today) {
|
|
103
|
+
expired.push({ row, finding });
|
|
104
|
+
continue;
|
|
105
|
+
}
|
|
106
|
+
const limit = blocking[finding.severity];
|
|
107
|
+
if (daysBetween(today, row.expires) > limit) tooLong.push({ row, finding, limit });
|
|
108
|
+
}
|
|
109
|
+
const missing = findings.filter((f) => !accepted.has(f.advisory));
|
|
110
|
+
return { missing, invalid, expired, tooLong, stale };
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Run `pnpm audit --json`, retrying when it prints no report (a registry blip).
|
|
115
|
+
* pnpm exits 1 whenever it finds an advisory, so the exit code is not the signal; the report is.
|
|
116
|
+
* @returns {object | null} the parsed report, or null after three attempts.
|
|
117
|
+
*/
|
|
118
|
+
function runAudit() {
|
|
119
|
+
for (let attempt = 1; attempt <= 3; attempt++) {
|
|
120
|
+
const res = spawnSync("pnpm", ["audit", "--json"], {
|
|
121
|
+
encoding: "utf-8",
|
|
122
|
+
maxBuffer: 64 * 1024 * 1024,
|
|
123
|
+
});
|
|
124
|
+
let parseError = "";
|
|
125
|
+
try {
|
|
126
|
+
const report = JSON.parse(res.stdout);
|
|
127
|
+
if (report && typeof report.advisories === "object") return report;
|
|
128
|
+
} catch (err) {
|
|
129
|
+
parseError = `not JSON (${err.message}): `;
|
|
130
|
+
}
|
|
131
|
+
const tail = (res.stderr || res.stdout || "").trim().split("\n").slice(-3).join(" | ");
|
|
132
|
+
const detail = parseError + tail;
|
|
133
|
+
console.error(`::warning::dependency-audit: attempt ${attempt} printed no report — ${detail}`);
|
|
134
|
+
}
|
|
135
|
+
return null;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
function main(argv) {
|
|
139
|
+
const { values } = parseArgs({
|
|
140
|
+
args: argv,
|
|
141
|
+
options: { registry: { type: "string" }, report: { type: "string" } },
|
|
142
|
+
strict: false,
|
|
143
|
+
});
|
|
144
|
+
const registryPath = values.registry ?? path.join("scripts", "ci", "accepted-advisories.json");
|
|
145
|
+
const reportPath = values.report ?? null;
|
|
146
|
+
|
|
147
|
+
const registry = fs.existsSync(registryPath)
|
|
148
|
+
? JSON.parse(fs.readFileSync(registryPath, "utf-8"))
|
|
149
|
+
: { accepted: [] };
|
|
150
|
+
const report = reportPath ? JSON.parse(fs.readFileSync(reportPath, "utf-8")) : runAudit();
|
|
151
|
+
if (!report || typeof report.advisories !== "object") {
|
|
152
|
+
console.error("::error::dependency-audit: the audit printed no report — failing closed");
|
|
153
|
+
process.exit(1);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
const findings = blockingFindings(report, registry.blocking ?? DEFAULT_BLOCKING);
|
|
157
|
+
const today = isoDay(new Date());
|
|
158
|
+
const { missing, invalid, expired, tooLong, stale } = checkAcceptances(findings, registry, today);
|
|
159
|
+
|
|
160
|
+
const fmt = (f) =>
|
|
161
|
+
` ${f.advisory} ${f.severity} ${f.module} ${f.versions.join(", ")} (patched: ${f.patched})`;
|
|
162
|
+
let failed = 0;
|
|
163
|
+
const fail = (rows, title, line) => {
|
|
164
|
+
if (!rows.length) return;
|
|
165
|
+
failed = 1;
|
|
166
|
+
console.error(`::error::dependency-audit: ${rows.length} ${title}:`);
|
|
167
|
+
for (const r of rows) console.error(line(r));
|
|
168
|
+
};
|
|
169
|
+
fail(
|
|
170
|
+
missing,
|
|
171
|
+
"blocking advisory(ies) with no acceptance — upgrade, or accept with a reason and expiry",
|
|
172
|
+
fmt,
|
|
173
|
+
);
|
|
174
|
+
fail(
|
|
175
|
+
expired,
|
|
176
|
+
"acceptance(s) expired — upgrade, or re-review and renew",
|
|
177
|
+
(r) => `${fmt(r.finding)} expired ${r.row.expires}`,
|
|
178
|
+
);
|
|
179
|
+
fail(
|
|
180
|
+
tooLong,
|
|
181
|
+
"acceptance(s) run past their severity's limit",
|
|
182
|
+
(r) => `${fmt(r.finding)} expires ${r.row.expires}, limit ${r.limit} days`,
|
|
183
|
+
);
|
|
184
|
+
fail(
|
|
185
|
+
stale,
|
|
186
|
+
"acceptance(s) for advisories the audit no longer reports — delete the row",
|
|
187
|
+
(r) => ` ${r.row.advisory} ${r.row.module ?? ""}`,
|
|
188
|
+
);
|
|
189
|
+
fail(invalid, "invalid row(s)", (r) => ` ${JSON.stringify(r.row)} — ${r.why}`);
|
|
190
|
+
if (!failed) {
|
|
191
|
+
console.error(
|
|
192
|
+
`[dependency-audit] ${findings.length} blocking advisory(ies), all accepted and in date`,
|
|
193
|
+
);
|
|
194
|
+
}
|
|
195
|
+
process.exit(failed);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
if (process.argv[1] && path.resolve(process.argv[1]) === fileURLToPath(import.meta.url)) {
|
|
199
|
+
main(process.argv.slice(2));
|
|
200
|
+
}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Example. Copy into scripts/ci/ and own it. bkit install does not write this file
|
|
3
|
+
// and does not overwrite a copy.
|
|
4
|
+
/**
|
|
5
|
+
* check-dependency-audit.test.mjs — unit tests for the dependency-audit gate.
|
|
6
|
+
*
|
|
7
|
+
* Pure Node, no runner: `node scripts/ci/check-dependency-audit.test.mjs`.
|
|
8
|
+
* Exit: 0 = all tests passed, 1 = at least one test failed.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { blockingFindings, checkAcceptances } from "./check-dependency-audit.mjs";
|
|
12
|
+
|
|
13
|
+
let passed = 0;
|
|
14
|
+
let failed = 0;
|
|
15
|
+
|
|
16
|
+
function test(name, fn) {
|
|
17
|
+
try {
|
|
18
|
+
fn();
|
|
19
|
+
passed++;
|
|
20
|
+
console.log(` ok ${name}`);
|
|
21
|
+
} catch (err) {
|
|
22
|
+
failed++;
|
|
23
|
+
console.log(` FAIL ${name} — ${err.message}`);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function assert(cond, message) {
|
|
28
|
+
if (!cond) throw new Error(message);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const REPORT = {
|
|
32
|
+
advisories: {
|
|
33
|
+
1: {
|
|
34
|
+
id: 1,
|
|
35
|
+
github_advisory_id: "GHSA-crit",
|
|
36
|
+
severity: "critical",
|
|
37
|
+
module_name: "proxy-addr",
|
|
38
|
+
patched_versions: ">=2.0.8",
|
|
39
|
+
findings: [{ version: "2.0.7" }],
|
|
40
|
+
},
|
|
41
|
+
2: {
|
|
42
|
+
id: 2,
|
|
43
|
+
github_advisory_id: "GHSA-high",
|
|
44
|
+
severity: "high",
|
|
45
|
+
module_name: "braces",
|
|
46
|
+
patched_versions: "<0.0.0",
|
|
47
|
+
findings: [{ version: "3.0.3" }],
|
|
48
|
+
},
|
|
49
|
+
3: {
|
|
50
|
+
id: 3,
|
|
51
|
+
github_advisory_id: "GHSA-mod",
|
|
52
|
+
severity: "moderate",
|
|
53
|
+
module_name: "nanoid",
|
|
54
|
+
findings: [{ version: "3.3.7" }],
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
const TODAY = "2026-10-17";
|
|
59
|
+
const accept = (advisory, expires, extra = {}) => ({
|
|
60
|
+
advisory,
|
|
61
|
+
reason: "no patched release",
|
|
62
|
+
expires,
|
|
63
|
+
...extra,
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
test("keeps high and critical, drops moderate", () => {
|
|
67
|
+
const ids = blockingFindings(REPORT).map((f) => f.advisory);
|
|
68
|
+
assert(ids.join() === "GHSA-crit,GHSA-high", `got ${ids}`);
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
test("a custom blocking table changes what blocks", () => {
|
|
72
|
+
const ids = blockingFindings(REPORT, { critical: 7 }).map((f) => f.advisory);
|
|
73
|
+
assert(ids.join() === "GHSA-crit", `got ${ids}`);
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
test("an advisory with no acceptance is missing", () => {
|
|
77
|
+
const r = checkAcceptances(blockingFindings(REPORT), { accepted: [] }, TODAY);
|
|
78
|
+
assert(r.missing.length === 2, `missing ${r.missing.length}`);
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
test("accepted, in-date advisories pass", () => {
|
|
82
|
+
const registry = {
|
|
83
|
+
accepted: [accept("GHSA-crit", "2026-10-24"), accept("GHSA-high", "2026-11-16")],
|
|
84
|
+
};
|
|
85
|
+
const r = checkAcceptances(blockingFindings(REPORT), registry, TODAY);
|
|
86
|
+
const total = Object.values(r).reduce((n, rows) => n + rows.length, 0);
|
|
87
|
+
assert(total === 0, JSON.stringify(r));
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
test("an acceptance is valid through its expiry day, expired the day after", () => {
|
|
91
|
+
const registry = { accepted: [accept("GHSA-high", TODAY)] };
|
|
92
|
+
const findings = blockingFindings(REPORT, { high: 30 });
|
|
93
|
+
assert(checkAcceptances(findings, registry, TODAY).expired.length === 0, "expired on its day");
|
|
94
|
+
assert(checkAcceptances(findings, registry, "2026-10-18").expired.length === 1, "not expired");
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
test("an acceptance past its severity's limit is too long", () => {
|
|
98
|
+
const registry = { accepted: [accept("GHSA-crit", "2026-10-25")] };
|
|
99
|
+
const r = checkAcceptances(blockingFindings(REPORT, { critical: 7 }), registry, TODAY);
|
|
100
|
+
assert(r.tooLong.length === 1 && r.tooLong[0].limit === 7, JSON.stringify(r.tooLong));
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
test("an acceptance for an advisory no longer reported is stale", () => {
|
|
104
|
+
const registry = { accepted: [accept("GHSA-gone", "2026-10-20")] };
|
|
105
|
+
const r = checkAcceptances(blockingFindings(REPORT), registry, TODAY);
|
|
106
|
+
assert(r.stale.length === 1, `stale ${r.stale.length}`);
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
test("a row with no reason, a bad date, or a repeat is invalid", () => {
|
|
110
|
+
const registry = {
|
|
111
|
+
accepted: [
|
|
112
|
+
{ advisory: "GHSA-crit", expires: "2026-10-20" },
|
|
113
|
+
accept("GHSA-high", "next month"),
|
|
114
|
+
accept("GHSA-crit", "2026-10-20"),
|
|
115
|
+
accept("GHSA-crit", "2026-10-20"),
|
|
116
|
+
],
|
|
117
|
+
};
|
|
118
|
+
const r = checkAcceptances(blockingFindings(REPORT), registry, TODAY);
|
|
119
|
+
assert(r.invalid.length === 3, `invalid ${r.invalid.length}`);
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
test("a report with no advisories has nothing to block", () => {
|
|
123
|
+
assert(blockingFindings({ advisories: {} }).length === 0, "found something");
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
console.log(`\n${passed} passed, ${failed} failed`);
|
|
127
|
+
process.exit(failed ? 1 : 0);
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Example. Copy into scripts/cleanup/ and own it. bkit install does not write this file
|
|
3
|
+
// and does not overwrite a copy.
|
|
4
|
+
/**
|
|
5
|
+
* bkit-tmp-prune.mjs — deletes files under the checkout's `tmp/` last modified more than
|
|
6
|
+
* `--days` days ago, then the folders that leaves empty.
|
|
7
|
+
*
|
|
8
|
+
* Scope: `tmp/` at the top of the checkout the cwd sits in; each worktree has its own.
|
|
9
|
+
* Symlinks are never followed: a symlinked `tmp/` is left alone; a symlink inside it is
|
|
10
|
+
* aged and removed like a file. A folder goes only when empty and either this sweep
|
|
11
|
+
* emptied it or its own last change is past the cutoff, so a fresh empty folder another
|
|
12
|
+
* process just made stays. An entry another process removes or fills mid-sweep is skipped.
|
|
13
|
+
*
|
|
14
|
+
* Usage: node scripts/cleanup/bkit-tmp-prune.mjs [--days=<n>] (default 7)
|
|
15
|
+
* Exit: 0 = swept or no `tmp/`, 1 = an entry could not be removed, 2 = bad arguments.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import { spawnSync } from "node:child_process";
|
|
19
|
+
import fs from "node:fs";
|
|
20
|
+
import path from "node:path";
|
|
21
|
+
import { fileURLToPath } from "node:url";
|
|
22
|
+
|
|
23
|
+
export const DEFAULT_DAYS = 7;
|
|
24
|
+
|
|
25
|
+
const DAY_MS = 24 * 60 * 60 * 1000;
|
|
26
|
+
|
|
27
|
+
/** Codes meaning another process changed the entry mid-sweep: skip it, not a failure. */
|
|
28
|
+
const RACE_CODES = new Set(["ENOENT", "ENOTDIR", "ENOTEMPTY", "EEXIST"]);
|
|
29
|
+
|
|
30
|
+
/** Remove one entry; true when it is gone. */
|
|
31
|
+
function remove(full, isDir, result) {
|
|
32
|
+
try {
|
|
33
|
+
if (isDir) fs.rmdirSync(full);
|
|
34
|
+
else fs.unlinkSync(full);
|
|
35
|
+
} catch (err) {
|
|
36
|
+
if (!RACE_CODES.has(err.code)) result.failed.push(`${full}: ${err.code ?? err.message}`);
|
|
37
|
+
return err.code === "ENOENT";
|
|
38
|
+
}
|
|
39
|
+
if (isDir) result.dirs++;
|
|
40
|
+
else result.files++;
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** Prune `dir`'s contents; true when `dir` itself should go. `stat` is read before the sweep. */
|
|
45
|
+
function sweep(dir, stat, cutoff, result) {
|
|
46
|
+
let names;
|
|
47
|
+
try {
|
|
48
|
+
names = fs.readdirSync(dir);
|
|
49
|
+
} catch (err) {
|
|
50
|
+
if (!RACE_CODES.has(err.code)) result.failed.push(`${dir}: ${err.code ?? err.message}`);
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
53
|
+
let kept = 0;
|
|
54
|
+
let removed = 0;
|
|
55
|
+
for (const name of names) {
|
|
56
|
+
const full = path.join(dir, name);
|
|
57
|
+
const entry = fs.lstatSync(full, { throwIfNoEntry: false });
|
|
58
|
+
if (!entry) continue;
|
|
59
|
+
const gone = entry.isDirectory()
|
|
60
|
+
? sweep(full, entry, cutoff, result) && remove(full, true, result)
|
|
61
|
+
: entry.mtimeMs < cutoff && remove(full, false, result);
|
|
62
|
+
if (gone) removed++;
|
|
63
|
+
else kept++;
|
|
64
|
+
}
|
|
65
|
+
return kept === 0 && (removed > 0 || stat.mtimeMs < cutoff);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Delete everything under `dir` older than `days` days; `dir` itself always stays.
|
|
70
|
+
* @returns {{ files: number, dirs: number, failed: string[] }}
|
|
71
|
+
*/
|
|
72
|
+
export function pruneTmp(dir, { days = DEFAULT_DAYS, now = Date.now() } = {}) {
|
|
73
|
+
const result = { files: 0, dirs: 0, failed: [] };
|
|
74
|
+
const stat = fs.lstatSync(dir, { throwIfNoEntry: false });
|
|
75
|
+
if (stat?.isDirectory()) sweep(dir, stat, now - days * DAY_MS, result);
|
|
76
|
+
return result;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/** Top of the checkout the cwd sits in; the cwd itself outside git. */
|
|
80
|
+
function checkoutTop(cwd) {
|
|
81
|
+
const r = spawnSync("git", ["rev-parse", "--show-toplevel"], { cwd, encoding: "utf8" });
|
|
82
|
+
return r.status === 0 ? r.stdout.trim() : cwd;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/** `--days=<n>` with n >= 1; null on anything else. */
|
|
86
|
+
export function parseDays(argv) {
|
|
87
|
+
let days = DEFAULT_DAYS;
|
|
88
|
+
for (const arg of argv) {
|
|
89
|
+
const m = /^--days=([1-9]\d*)$/.exec(arg);
|
|
90
|
+
if (!m) return null;
|
|
91
|
+
days = Number(m[1]);
|
|
92
|
+
}
|
|
93
|
+
return days;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export function main(argv, { cwd = process.cwd(), log = console.log, err = console.error } = {}) {
|
|
97
|
+
const days = parseDays(argv);
|
|
98
|
+
if (days === null) {
|
|
99
|
+
err("usage: node scripts/cleanup/bkit-tmp-prune.mjs [--days=<n>] (n >= 1, default 7)");
|
|
100
|
+
return 2;
|
|
101
|
+
}
|
|
102
|
+
const { files, dirs, failed } = pruneTmp(path.join(checkoutTop(cwd), "tmp"), { days });
|
|
103
|
+
if (files + dirs > 0) {
|
|
104
|
+
const n = (count, noun) => `${count} ${noun}${count === 1 ? "" : "s"}`;
|
|
105
|
+
log(
|
|
106
|
+
`[tmp-prune] removed ${n(files, "file")} and ${n(dirs, "folder")} older than ${n(days, "day")} from tmp/`,
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
for (const line of failed) err(`[tmp-prune] could not remove ${line}`);
|
|
110
|
+
return failed.length > 0 ? 1 : 0;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
if (process.argv[1] && path.resolve(process.argv[1]) === fileURLToPath(import.meta.url)) {
|
|
114
|
+
process.exit(main(process.argv.slice(2)));
|
|
115
|
+
}
|
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,62 @@ Format: `## [version] — YYYY-MM-DD`
|
|
|
8
8
|
|
|
9
9
|
## [Unreleased]
|
|
10
10
|
|
|
11
|
+
## [5.2.4] — 2026-10-17
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
|
|
15
|
+
- **`tmp/` prune on push.** New copy-and-own `scripts/cleanup/bkit-tmp-prune.mjs` deletes files under the checkout's `tmp/` untouched for 7+ days (`--days=<n>`), then the folders that leaves empty. It never follows symlinks and never removes `tmp/` itself. The `.husky/pre-push` template runs it before the gates and skips it until the script is copied; a failed prune warns and the push goes on. New `tmp-prune` setup tip. `.bkit/templates.md` § tmp/ prune.
|
|
16
|
+
- **Audit reports suggest the issues to create.** Every audit template's `Report` gains a `Suggested Issues` table, filled by `@bkit-audit-generate`. The table groups findings into issues, one row per change landed in one go (by root cause, then module, then fix), and every `MEDIUM`+ finding lands in exactly one row. Each row names its next step: `/bkit-design`, `/bkit-plan`, `/bkit-build` or `/bkit-debug`; the `.agents/shortcuts.md` lite path (`shortcut:build`, `shortcut:debug`) when its § When to use allows; or `manual` for a change outside the repo. The agent still never files issues. Gate 3 gains a `Suggested Issues` check, shared as `.bkit/wording.md` clause `audit-suggested-issues`, so the wording test fails any template missing it.
|
|
17
|
+
- **Warning when a workflow, plan, design or audit runs on an outdated bkit.** `bkit repo info` (Step 1 of every phase workflow) compares `.bkit/version` `pinnedVersion` with the newest published `@cbartens/bkit` and returns `bkitVersion` / `bkitLatest` / `bkitOutdated` / `bkitAdvisory`; Step 1 shows the advisory with the upgrade command and carries on. Every anchored doc (design, plan, sub-plan, audit report) records `bkitVersion` and `bkitLatest` in its `bkit:anchor` block, and an outdated one gets a visible `Outdated bkit` line under the block that the next stamp drops once current. Warning only, never a stop: the registry is asked at most once a day (cache in the git common dir), offline or no pin means no warning, and `BKIT_NO_UPDATE_CHECK=1` skips the lookup. `.bkit/workflows.md` § Invocation, § Anchor Block.
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
20
|
+
|
|
21
|
+
- **Audits never stop on a blocked call.** Pre-Flight `Permissions` still probes every tool first, but a blocked call (there or in any step) no longer pauses the run for a grant or `continue`. The agent records the call and its narrow allow rule, runs every step the remaining tools allow, and lists what it could not check under `Not Checked`. A call the owner deliberately keeps blocked no longer stalls every run.
|
|
22
|
+
|
|
23
|
+
### Fixed
|
|
24
|
+
|
|
25
|
+
- **Audits no longer duplicate failure rows other workflows wrote.** `@bkit-audit-generate` matches findings against every open `docs/failures.jsonl` row, not only `audit-{slug}-*` keys, and reuses the key of a row naming the same problem (same `file:line`, test title or error signature). Closing stays limited to the audit's own `audit-{slug}-*` rows. Most visible on the flakes audit, where debug runs had already recorded most flakes.
|
|
26
|
+
- **Eight audit templates no longer say the run writes no ledger rows.** Red-team, security, repo, testing, logs, annotations, cost and flakes named failure rows as a later step, contradicting the audit agent writing them itself. They now say the audit agent writes `docs/failures.jsonl` rows; issues and doc edits stay a later step.
|
|
27
|
+
|
|
28
|
+
## [5.2.3] — 2026-10-17
|
|
29
|
+
|
|
30
|
+
### Added
|
|
31
|
+
|
|
32
|
+
- **Dependency-audit CI gate.** New copy-and-own `scripts/ci/check-dependency-audit.mjs` (+ `.test.mjs`, `accepted-advisories.json`) runs `pnpm audit --json` and fails on any high / critical advisory the registry does not accept. Each acceptance needs a reason and an expiry (at most 7 days for critical, 30 for high); expired, over-long and stale rows fail; no report = fail. The CI template gains a `Check Dependency Audit` step in `bkit-tests-static`, a no-op until the script is copied. `docs/deployments.md` § Dependency updaters. Upgrade hint is `pnpm update -r <pkg>` (works on pnpm 10 and 12).
|
|
33
|
+
- **Audit findings reach `docs/failures.jsonl`.** `@bkit-audit-generate` writes one failure row per `MEDIUM`+ finding once the report is complete (`workflow: "audit"`, `step: "audit-{slug}"`). A rerun reuses an open row's `key` for the same problem, downgrades it to `LOW` when the finding drops, and closes rows it no longer finds in surfaces it checked. The failures and deferrals audits write no rows. Plan and design already read the ledger, so findings feed them without a hand link.
|
|
34
|
+
- **Audit reports carry a `bkit:anchor` block.** The audit agent runs `bkit branches anchor-stamp` right after creating the report, so the audited commit sits at the top of the file like design and plan docs. Step 1 of every template reads this and the previous report's commit from it. `anchor-stamp` gains `--base-ref` (default `origin/dev`).
|
|
35
|
+
- **Audit Pre-Flight checks permissions first.** Every template opens with one read-only call per tool; a blocked call stops the run before `Probe Steps` and hands back narrow allow rules to grant, or `continue`. Blocked calls persist in `Project Instructions` `Permissions`.
|
|
36
|
+
|
|
37
|
+
### Changed
|
|
38
|
+
|
|
39
|
+
- **Logs audit template checks three things it skipped** (#575). Step 3: fixed `Board` figure per platform re-reporting to the tracker, platform failures beside tracker events (ratio < 1 = lost reports). Step 9: every `docs/noise.md` archive / mute row against its recorded trigger. Step 12: scheduled-job runs started and never finished. "warnings-doc" → `docs/noise.md`.
|
|
40
|
+
- **Audit agent turn cap 150 → 300** (new `XL` tier). One agent runs every template; the longest run ~20 probe steps.
|
|
41
|
+
- **Audit templates probe direnv before calling a credential missing** and run credentialed CLIs through `direnv exec .`. The logs, failures, reliability, flakes and annotations audits point at the `.agents/context.md` readers for their time window.
|
|
42
|
+
|
|
43
|
+
### Fixed
|
|
44
|
+
|
|
45
|
+
- **Context-fetch templates print `skipped` instead of empty output on an API error** (#575). A consumer's log audit found seven of nine readers returning nothing while real failures existed. Every runtime block now checks HTTP status / CLI exit and body shape, pages the whole window, prints `TRUNCATED` when its page cap stops it, and suggests a positive control in `# Customise:`. Per vendor:
|
|
46
|
+
- `supabase.md`: removed `logs.all` → `analytics/endpoints/logs`, one call per day, counts per SQLSTATE.
|
|
47
|
+
- `vercel.md`: `--no-branch`; pages past the 50-line cap; filters `.level`. `VERCEL_N` → `VERCEL_MAX_PAGES`.
|
|
48
|
+
- `inngest.md`: cursor paging; refuses a branch key with `INNGEST_ENV` unset; error class only, never error text. Adds `UNTIL_ISO`, `INNGEST_MAX_PAGES`.
|
|
49
|
+
- `cloudrun.md`: gcloud login only when `gcloud auth print-access-token` works, else service account in a throwaway `CLOUDSDK_CONFIG`; failed `logging read` → `skipped`. Adds `GCP_FILTER`.
|
|
50
|
+
- `stripe.md`: `starting_after` paging; `delivery_success=false` pass. `STRIPE_N` → `STRIPE_MAX_PAGES`.
|
|
51
|
+
- `resend.md`: `after` paging back to `SINCE_ISO`. `RESEND_N` → `SINCE_ISO`, `RESEND_MAX_PAGES`.
|
|
52
|
+
- `expo.md`: `EAS_N` default 10 → 50. `expo-workflows`: `startedAt` (was `null` via `createdAt`), `--limit` ≤ 100, FAILURE list (`EAS_WF_FAIL_N`), `workflow:status` judged by its JSON.
|
|
53
|
+
- `sentry.md`: status and array-shape checks; detector configs carry uptime-check headers.
|
|
54
|
+
|
|
55
|
+
Templates are copy-and-own: a copy below `bkit:end` changes only when re-copied.
|
|
56
|
+
|
|
57
|
+
- **`.agents/context.md` authoring rules** (#575): API / auth error = self-skip; check status before jq; page the window or print `TRUNCATED`; suggest a positive control.
|
|
58
|
+
- **Destructive-git guardrails catch reordered flags.** The Cursor, Codex and Antigravity hooks parse each command (every `&&` / `;` / `|` part, `bash -c`, `$(...)`) into subcommand and flags in any order, with combined short flags (`-fdx`) and global options (`-C dir`, `-q`). `git reset -q --hard`, `git clean -df`, `git checkout -q -- .` and `git restore --worktree .` now ask. Claude and opencode gain glob rows for the common reordered forms in the same tiers.
|
|
59
|
+
- **Force-push denied in any position on every host.** `git push origin dev --force`, `-f` after other args and `+refspec` are denied on Claude and opencode as on the hook hosts; `--force-with-lease` stays allowed.
|
|
60
|
+
- **`--no-verify` asks on every host** (`git commit -n` too).
|
|
61
|
+
- **Shell reads of secret files ask on Cursor and Antigravity** (advisory on Codex): `.env*` except `.env.example`, `*.pem`, `*.p12`, `id_rsa`. Copy destinations, renames and grep patterns don't count as reads. Claude and opencode don't gate shell reads, because their tables match command text and would stall unattended runs on mentions; `.bkit/providers.md` says so.
|
|
62
|
+
- **`bkit check` and `bkit status` see an Antigravity install with `plugin.json` deleted.** Any of `.agents/plugins/bkit/{plugin.json,hooks.json,agents,skills,hooks}` marks the host installed, so a missing manifest or hook file is drift (exit 1), not `antigravity: absent`. `check`, `status` and install share one detector.
|
|
63
|
+
- **Full `bkit uninstall` removes every bkit-written `.opencode/opencode.json` entry.** Every supported provider block and tracker `mcp` entry that still matches bkit's template is stripped, not just the first one found; an edited block is kept whole.
|
|
64
|
+
- **`bkit upgrade` refreshes the recorded hashes of `.cursor/allowlist.json` and `.cursor/cli.json`** after regenerating them, so a later uninstall no longer keeps them as consumer-modified.
|
|
65
|
+
- **`.bkit/install.md` states that `bkit check` does not verify `.bkit/version` `canonicalHashes`**; a bad entry makes uninstall keep that file (`--force` removes it).
|
|
66
|
+
|
|
11
67
|
## [5.2.2] — 2026-10-15
|
|
12
68
|
|
|
13
69
|
### Fixed
|