@cbartens/bkit 6.0.0 → 6.1.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 +154 -151
- package/.bkit/core/.agents/context.md +95 -29
- package/.bkit/core/.agents/docs.md +17 -15
- package/.bkit/core/.agents/plugins/bkit/hooks/bkit-gateguard.cjs +1 -0
- package/.bkit/core/.agents/plugins/bkit/hooks/bkit-guardrails.cjs +6 -5
- package/.bkit/core/.agents/plugins/bkit/hooks/bkit-readguard.cjs +1 -0
- package/.bkit/core/.agents/plugins/bkit/hooks/bkit-rules.cjs +65 -0
- package/.bkit/core/.agents/rules.md +108 -107
- package/.bkit/core/.agents/skills.md +63 -15
- package/.bkit/core/.bkit/README.md +154 -151
- package/.bkit/core/.bkit/authoring.md +714 -84
- package/.bkit/core/.bkit/cli.md +407 -0
- package/.bkit/core/.bkit/cloud.md +281 -193
- package/.bkit/core/.bkit/comparison.md +43 -41
- package/.bkit/core/.bkit/install.md +154 -84
- package/.bkit/core/.bkit/jsonl.md +193 -130
- package/.bkit/core/.bkit/pipeline.md +114 -114
- package/.bkit/core/.bkit/prompts.md +272 -165
- package/.bkit/core/.bkit/providers.md +457 -271
- package/.bkit/core/.bkit/router.md +69 -0
- package/.bkit/core/.bkit/templates.md +529 -256
- package/.bkit/core/.bkit/trackers.md +80 -52
- package/.bkit/core/.bkit/workflows.md +589 -504
- package/.bkit/core/.claude/hooks/bkit-gateguard.cjs +2 -2
- package/.bkit/core/.claude/hooks/bkit-guardrails.cjs +3 -3
- package/.bkit/core/.claude/hooks/bkit-preflight.sh +45 -14
- package/.bkit/core/.codex/hooks/bkit-guardrails.cjs +3 -3
- package/.bkit/core/.codex/hooks/bkit-rules.cjs +57 -0
- package/.bkit/core/.cursor/hooks/bkit-guardrails.cjs +7 -7
- package/.bkit/core/.cursor/hooks/bkit-preflight.sh +47 -12
- package/.bkit/core/.opencode/plugin/bkit-rules.js +89 -0
- package/.bkit/core/AGENTS.md +5 -73
- package/.bkit/core/docs/templates/bkit-audit-accessibility.md +127 -105
- package/.bkit/core/docs/templates/bkit-audit-adoption.md +104 -70
- package/.bkit/core/docs/templates/bkit-audit-agents.md +94 -72
- package/.bkit/core/docs/templates/bkit-audit-aio-seo.md +99 -78
- package/.bkit/core/docs/templates/bkit-audit-analytics.md +140 -82
- package/.bkit/core/docs/templates/bkit-audit-annotations.md +98 -72
- package/.bkit/core/docs/templates/bkit-audit-app-performance.md +121 -96
- package/.bkit/core/docs/templates/bkit-audit-app-store.md +157 -76
- package/.bkit/core/docs/templates/bkit-audit-architecture.md +113 -71
- package/.bkit/core/docs/templates/bkit-audit-ci-performance.md +75 -72
- package/.bkit/core/docs/templates/bkit-audit-config.md +122 -76
- package/.bkit/core/docs/templates/bkit-audit-cost.md +85 -74
- package/.bkit/core/docs/templates/bkit-audit-coverage.md +75 -68
- package/.bkit/core/docs/templates/bkit-audit-database.md +101 -70
- package/.bkit/core/docs/templates/bkit-audit-dead-code.md +164 -83
- package/.bkit/core/docs/templates/bkit-audit-deferrals.md +115 -86
- package/.bkit/core/docs/templates/bkit-audit-dependencies.md +264 -88
- package/.bkit/core/docs/templates/bkit-audit-documentation.md +118 -93
- package/.bkit/core/docs/templates/bkit-audit-duplication.md +139 -86
- package/.bkit/core/docs/templates/bkit-audit-failures.md +110 -81
- package/.bkit/core/docs/templates/bkit-audit-flakes.md +99 -74
- package/.bkit/core/docs/templates/bkit-audit-gates.md +105 -77
- package/.bkit/core/docs/templates/bkit-audit-issues.md +104 -80
- package/.bkit/core/docs/templates/bkit-audit-llm.md +131 -58
- package/.bkit/core/docs/templates/bkit-audit-logs.md +123 -100
- package/.bkit/core/docs/templates/bkit-audit-models.md +98 -53
- package/.bkit/core/docs/templates/bkit-audit-privacy.md +56 -52
- package/.bkit/core/docs/templates/bkit-audit-prompts.md +63 -54
- package/.bkit/core/docs/templates/bkit-audit-red-team.md +124 -68
- package/.bkit/core/docs/templates/bkit-audit-reliability.md +95 -70
- package/.bkit/core/docs/templates/bkit-audit-repo.md +169 -73
- package/.bkit/core/docs/templates/bkit-audit-security.md +206 -96
- package/.bkit/core/docs/templates/bkit-audit-slop.md +77 -70
- package/.bkit/core/docs/templates/bkit-audit-testing.md +162 -114
- package/.bkit/core/docs/templates/bkit-audit-usability.md +113 -71
- package/.bkit/core/docs/templates/bkit-plan.md +138 -132
- package/.bkit/core/engine/checks/after/auth.ts +40 -37
- package/.bkit/core/engine/checks/after/ci-yml.ts +65 -2
- package/.bkit/core/engine/checks/after/index.ts +12 -2
- package/.bkit/core/engine/checks/after/tools.ts +80 -33
- package/.bkit/core/engine/checks/before/context-fetch.ts +227 -33
- package/.bkit/core/engine/checks/before/env.ts +1 -1
- package/.bkit/core/engine/checks/before/index.ts +7 -0
- package/.bkit/core/engine/checks/before/repo.ts +40 -0
- package/.bkit/core/engine/checks/status-holes.ts +916 -123
- package/.bkit/core/engine/checks/tips/catalogue.ts +68 -17
- package/.bkit/core/engine/checks/tips/detect.ts +32 -0
- package/.bkit/core/engine/checks/tips/index.ts +47 -6
- package/.bkit/core/engine/cli.ts +238 -84
- package/.bkit/core/engine/commands/analysis.ts +128 -76
- package/.bkit/core/engine/commands/ci/ci.ts +363 -29
- package/.bkit/core/engine/commands/ci/pins.ts +172 -0
- package/.bkit/core/engine/commands/ci/push-gate.ts +223 -0
- package/.bkit/core/engine/commands/install/uninstall.ts +21 -27
- package/.bkit/core/engine/commands/install/upgrade.ts +32 -15
- package/.bkit/core/engine/commands/land.ts +126 -11
- package/.bkit/core/engine/commands/lib.ts +303 -6
- package/.bkit/core/engine/commands/registry.ts +6 -2
- package/.bkit/core/engine/commands/setup/setup.ts +1 -0
- package/.bkit/core/engine/commands/stats.ts +91 -35
- package/.bkit/core/engine/commands/workflow/branches.ts +1477 -117
- package/.bkit/core/engine/commands/workflow/challenge.ts +114 -39
- package/.bkit/core/engine/commands/workflow/completeness.ts +109 -0
- package/.bkit/core/engine/commands/workflow/context.ts +433 -55
- package/.bkit/core/engine/commands/workflow/counters.ts +244 -39
- package/.bkit/core/engine/commands/workflow/decisions.ts +61 -17
- package/.bkit/core/engine/commands/workflow/disk.ts +237 -55
- package/.bkit/core/engine/commands/workflow/fids.ts +19 -1
- package/.bkit/core/engine/commands/workflow/issues.ts +6 -0
- package/.bkit/core/engine/commands/workflow/ledgers.ts +458 -18
- package/.bkit/core/engine/commands/workflow/locks.ts +2 -0
- package/.bkit/core/engine/commands/workflow/plan-blocks.ts +124 -15
- package/.bkit/core/engine/commands/workflow/plans.ts +257 -0
- package/.bkit/core/engine/commands/workflow/prs.ts +12 -3
- package/.bkit/core/engine/commands/workflow/repo.ts +8 -0
- package/.bkit/core/engine/commands/workflow/roadmap.ts +56 -15
- package/.bkit/core/engine/commands/workflow/run-facts.ts +22 -31
- package/.bkit/core/engine/commands/workflow/runs.ts +652 -34
- package/.bkit/core/engine/commands/workflow/runtime.ts +3 -0
- package/.bkit/core/engine/commands/workflow/skills.ts +1 -0
- package/.bkit/core/engine/commands/workflow/status.ts +200 -17
- package/.bkit/core/engine/commands/workflow/step-table.ts +75 -33
- package/.bkit/core/engine/commands/workflow/steps.ts +635 -24
- package/.bkit/core/engine/commands/workflow/summary-findings.ts +177 -0
- package/.bkit/core/engine/commands/workflow/summary.ts +192 -46
- package/.bkit/core/engine/commands/workflow/tasks.ts +409 -0
- package/.bkit/core/engine/commands/workflow/test-blocks.ts +254 -0
- package/.bkit/core/engine/commands/workflow/tests-changed.ts +201 -0
- package/.bkit/core/engine/commands/workflow/tests.ts +1285 -356
- package/.bkit/core/engine/commands/workflow/workflows.ts +228 -43
- package/.bkit/core/engine/commands/workflow/worktrees.ts +389 -47
- package/.bkit/core/engine/install/cloud-env.ts +251 -121
- package/.bkit/core/engine/install/context-ci-workflow.ts +102 -0
- package/.bkit/core/engine/install/manifest.ts +60 -12
- package/.bkit/core/engine/install/modules/antigravity.ts +3 -2
- package/.bkit/core/engine/install/modules/cloud.ts +3 -3
- package/.bkit/core/engine/install/modules/codex.ts +15 -2
- package/.bkit/core/engine/install/modules/core.ts +956 -52
- package/.bkit/core/engine/install/modules/cursor.ts +6 -6
- package/.bkit/core/engine/install/modules/opencode.ts +16 -4
- package/.bkit/core/engine/install/template-notes.ts +130 -0
- package/.bkit/core/engine/install/version-file.ts +3 -2
- package/.bkit/core/engine/install/write.ts +5 -0
- package/.bkit/core/engine/ledgers/compact.ts +124 -0
- package/.bkit/core/engine/ledgers/journal.ts +291 -0
- package/.bkit/core/engine/ledgers/status.ts +160 -9
- package/.bkit/core/engine/ledgers/telemetry.ts +158 -21
- package/.bkit/core/engine/render/hosts.ts +114 -14
- package/.bkit/core/engine/shared/bkit-latest.ts +26 -4
- package/.bkit/core/engine/shared/dep-updater.ts +60 -0
- package/.bkit/core/engine/shared/egress.ts +1 -1
- package/.bkit/core/engine/shared/package-manager.ts +9 -0
- package/.bkit/core/engine/shared/settings.ts +92 -17
- package/.bkit/core/engine/shared/timeouts.ts +2 -0
- package/.bkit/core/engine/tools/cli-doc.ts +111 -0
- package/.bkit/core/engine/tools/grammar-density.ts +1 -1
- package/.bkit/core/engine/tools/instructions-sources.ts +15 -17
- package/.bkit/core/engine/tools/instructions.ts +94 -43
- package/.bkit/core/hooks/antigravity-hook.js +25 -10
- package/.bkit/core/hooks/gateguard-engine.js +53 -29
- package/.bkit/core/hooks/guardrails-shell.js +4 -4
- package/.bkit/core/hooks/guardrails-tiers.js +3 -3
- package/.bkit/core/hooks/preflight-linear.sh +9 -9
- package/.bkit/core/hooks/preflight-rules.sh +8 -0
- package/.bkit/core/hooks/readguard-engine.js +29 -10
- package/.bkit/core/hooks/session-rules-advisory.js +61 -0
- package/.bkit/core/prompts/bkit-audit-generate.md +187 -116
- package/.bkit/core/prompts/bkit-build-challenge-1.md +56 -37
- package/.bkit/core/prompts/bkit-build-challenge-2.md +65 -45
- package/.bkit/core/prompts/bkit-build-install-skills.md +38 -29
- package/.bkit/core/prompts/bkit-build-plan-convert.md +43 -32
- package/.bkit/core/prompts/bkit-build-plan-current.md +49 -39
- package/.bkit/core/prompts/bkit-build-plan-gaps-remediate.md +79 -55
- package/.bkit/core/prompts/bkit-build-plan-tasks.md +149 -0
- package/.bkit/core/prompts/bkit-build-plan-tests.md +120 -0
- package/.bkit/core/prompts/bkit-build-plan-verify.md +87 -50
- package/.bkit/core/prompts/bkit-debug-abort-handover.md +36 -35
- package/.bkit/core/prompts/bkit-debug-failure-diagnose.md +96 -64
- package/.bkit/core/prompts/bkit-debug-failure-remediate.md +54 -45
- package/.bkit/core/prompts/bkit-debug-failure-reproduce.md +42 -33
- package/.bkit/core/prompts/bkit-debug-failure-soak.md +53 -37
- package/.bkit/core/prompts/bkit-design-brainstorm-ideate-1.md +35 -30
- package/.bkit/core/prompts/bkit-design-brainstorm-ideate-2.md +34 -29
- package/.bkit/core/prompts/bkit-design-brainstorm-ideate-3.md +32 -28
- package/.bkit/core/prompts/bkit-design-generate.md +68 -52
- package/.bkit/core/prompts/bkit-design-organise.md +73 -35
- package/.bkit/core/prompts/bkit-design-review-1.md +58 -54
- package/.bkit/core/prompts/bkit-design-review-2.md +54 -50
- package/.bkit/core/prompts/bkit-design-spike.md +54 -47
- package/.bkit/core/prompts/bkit-design-update.md +42 -31
- package/.bkit/core/prompts/bkit-plan-generate.md +76 -58
- package/.bkit/core/prompts/bkit-plan-review-1.md +63 -49
- package/.bkit/core/prompts/bkit-plan-review-2.md +60 -48
- package/.bkit/core/prompts/bkit-plan-scope-check.md +53 -46
- package/.bkit/core/prompts/bkit-plan-update.md +70 -52
- package/.bkit/core/prompts/bkit-ship-conflict-resolve.md +82 -50
- package/.bkit/core/prompts/bkit-ship-deferred-sweep.md +80 -45
- package/.bkit/core/prompts/bkit-ship-update-docs.md +35 -29
- package/.bkit/core/prompts/bkit-utility-compress-markdown.md +55 -49
- package/.bkit/core/prompts/bkit-utility-update-decisions.md +76 -49
- package/.bkit/core/prompts/bkit-utility-update-deferrals.md +70 -41
- package/.bkit/core/prompts/bkit-utility-update-documentation.md +33 -30
- package/.bkit/core/prompts/bkit-utility-update-failures.md +73 -43
- package/.bkit/core/prompts/bkit-utility-update-knowledge.md +77 -50
- package/.bkit/core/prompts/bkit-utility-update-roadmap.md +77 -45
- package/.bkit/core/prompts/bkit-utility-update-tracker.md +144 -68
- package/.bkit/core/workflows/bkit-auto.md +53 -30
- package/.bkit/core/workflows/bkit-build.md +635 -304
- package/.bkit/core/workflows/bkit-debug.md +301 -148
- package/.bkit/core/workflows/bkit-design.md +167 -95
- package/.bkit/core/workflows/bkit-plan.md +172 -84
- package/.bkit/core/workflows/bkit-ship.md +299 -152
- package/.bkit/shared/.agents/plugins/bkit/hooks.json +10 -0
- package/.bkit/shared/.claude/bkit-cloud.md +12 -10
- package/.bkit/shared/.claude/settings.json +3 -0
- package/.bkit/shared/.codex/bkit-cloud.md +98 -0
- package/.bkit/shared/.codex/hooks.json +20 -0
- package/.bkit/shared/.cursor/bkit-cloud.md +3 -3
- package/.bkit/shared/.opencode/opencode.json +1 -1
- package/.bkit/shared/CLAUDE.md +5 -1
- package/.bkit/shared/GEMINI.md +4 -1
- package/.bkit/shared/docs/architecture.md +4 -7
- package/.bkit/shared/docs/data-schema.md +4 -7
- package/.bkit/shared/docs/deployments.md +239 -166
- package/.bkit/shared/docs/design.md +11 -12
- package/.bkit/shared/docs/noise.md +8 -7
- package/.bkit/shared/docs/observability.md +5 -8
- package/.bkit/shared/docs/security.md +35 -17
- package/.bkit/shared/docs/setup.md +29 -18
- package/.bkit/shared/docs/technology.md +3 -6
- package/.bkit/shared/docs/testing.md +282 -176
- package/.bkit/shared/gitignore +6 -2
- package/.bkit/templates/.claude/hooks/bkit-cloud-bootstrap.sh +15 -16
- package/.bkit/templates/.cursor/Dockerfile +12 -8
- package/.bkit/templates/.cursor/environment.json +1 -1
- package/.bkit/templates/.github/ISSUE_TEMPLATE/bkit-bug.yml +10 -8
- package/.bkit/templates/.github/ISSUE_TEMPLATE/bkit-change.yml +24 -12
- package/.bkit/templates/.github/ISSUE_TEMPLATE/bkit-idea.yml +3 -3
- package/.bkit/templates/.github/renovate.json5 +34 -6
- package/.bkit/templates/.github/workflows/bkit-ci.yml +53 -50
- package/.bkit/templates/.github/workflows/bkit-cloud.yml +13 -14
- package/.bkit/templates/.github/workflows/bkit-health.yml +97 -0
- package/.bkit/templates/.github/workflows/bkit-renovate.yml +5 -4
- package/.bkit/templates/.github/workflows/bkit-trivy.yml +5 -4
- package/.bkit/templates/.husky/pre-commit +2 -2
- package/.bkit/templates/.husky/pre-push +95 -35
- package/.bkit/templates/.prettierignore +6 -7
- package/.bkit/templates/.vale.ini +27 -27
- package/.bkit/templates/context/bkit-cloudrun.md +23 -15
- package/.bkit/templates/context/bkit-expo.md +70 -52
- package/.bkit/templates/context/bkit-github.md +93 -56
- package/.bkit/templates/context/bkit-inngest.md +21 -15
- package/.bkit/templates/context/bkit-maestro.md +22 -16
- package/.bkit/templates/context/bkit-playwright.md +23 -17
- package/.bkit/templates/context/bkit-resend.md +12 -10
- package/.bkit/templates/context/bkit-sentry.md +30 -20
- package/.bkit/templates/context/bkit-serena.md +8 -7
- package/.bkit/templates/context/bkit-stripe.md +14 -13
- package/.bkit/templates/context/bkit-supabase.md +16 -13
- package/.bkit/templates/context/bkit-tavily.md +14 -11
- package/.bkit/templates/context/bkit-vercel.md +27 -18
- package/.bkit/templates/docs/capabilities.md +15 -14
- package/.bkit/templates/scripts/ci/{check-accepted-divergences.mjs → bkit-check-accepted-divergences.mjs} +6 -3
- package/.bkit/templates/scripts/ci/{check-accepted-divergences.test.mjs → bkit-check-accepted-divergences.test.mjs} +3 -3
- package/.bkit/templates/scripts/ci/{check-capstone.mjs → bkit-check-capstone.mjs} +2 -2
- package/.bkit/templates/scripts/ci/{check-capstone.test.mjs → bkit-check-capstone.test.mjs} +4 -4
- package/.bkit/templates/scripts/ci/{check-dependency-audit.mjs → bkit-check-dependency-audit.mjs} +103 -18
- package/.bkit/templates/scripts/ci/{check-dependency-audit.test.mjs → bkit-check-dependency-audit.test.mjs} +31 -3
- package/.bkit/templates/scripts/ci/bkit-machine-lock.sh +387 -0
- package/.bkit/templates/scripts/ci/bkit-test-awake.mjs +75 -0
- package/.bkit/templates/scripts/ci/bkit-test-awake.test.mjs +160 -0
- package/.bkit/templates/scripts/ci/lanes/{resolve-push-base.mjs → bkit-resolve-push-base.mjs} +3 -3
- package/.bkit/templates/scripts/ci/lanes/{resolve-push-base.test.mjs → bkit-resolve-push-base.test.mjs} +4 -4
- package/.bkit/templates/scripts/cleanup/bkit-disk-prune.mjs +9 -1
- package/.bkit/templates/scripts/graphify/bkit-graph-drift.py +1 -1
- package/.bkit/templates/scripts/graphify/bkit-graph-eager.py +3 -3
- package/.bkit/templates/scripts/graphify/bkit-graph-embed.py +63 -0
- package/.bkit/templates/scripts/graphify/bkit-graph-imports.py +2 -2
- package/.bkit/templates/scripts/graphify/bkit-graph-pre-push.sh +69 -18
- package/.bkit/templates/scripts/graphify/bkit-graph-repair.py +3 -3
- package/.bkit/templates/scripts/graphify/bkit-graph-surface.py +1 -1
- package/.bkit/templates/scripts/graphify/bkit-graphify-graphml.py +1 -1
- package/.bkit/templates/scripts/graphify/bkit-graphify-rollup.py +197 -126
- package/.bkit/templates/scripts/graphify/bkit-graphify.sh +64 -41
- package/.bkit/templates/scripts/slop/bkit-slop-type-suppression.mjs +23 -7
- package/.bkit/templates/slop-scan.config.json +9 -2
- package/CHANGELOG.md +119 -0
- package/README.md +250 -76
- package/dist/checks/after/auth.js +36 -33
- package/dist/checks/after/ci-yml.js +52 -2
- package/dist/checks/after/index.js +12 -4
- package/dist/checks/after/tools.js +73 -33
- package/dist/checks/before/context-fetch.js +218 -33
- package/dist/checks/before/env.js +1 -1
- package/dist/checks/before/index.js +6 -2
- package/dist/checks/before/repo.js +35 -1
- package/dist/checks/status-holes.js +739 -114
- package/dist/checks/tips/catalogue.js +59 -17
- package/dist/checks/tips/detect.js +30 -0
- package/dist/checks/tips/index.js +48 -6
- package/dist/cli.js +222 -84
- package/dist/commands/analysis.js +77 -53
- package/dist/commands/ci/ci.js +302 -25
- package/dist/commands/ci/pins.js +142 -0
- package/dist/commands/ci/push-gate.js +194 -0
- package/dist/commands/install/uninstall.js +23 -27
- package/dist/commands/install/upgrade.js +21 -11
- package/dist/commands/land.js +126 -10
- package/dist/commands/lib.js +244 -5
- package/dist/commands/registry.js +6 -2
- package/dist/commands/setup/setup.js +1 -0
- package/dist/commands/stats.js +69 -30
- package/dist/commands/workflow/branches.js +1232 -111
- package/dist/commands/workflow/challenge.js +90 -37
- package/dist/commands/workflow/completeness.js +97 -0
- package/dist/commands/workflow/context.js +371 -51
- package/dist/commands/workflow/counters.js +206 -40
- package/dist/commands/workflow/decisions.js +60 -17
- package/dist/commands/workflow/disk.js +213 -55
- package/dist/commands/workflow/fids.js +18 -1
- package/dist/commands/workflow/issues.js +6 -0
- package/dist/commands/workflow/ledgers.js +372 -21
- package/dist/commands/workflow/locks.js +2 -0
- package/dist/commands/workflow/plan-blocks.js +78 -14
- package/dist/commands/workflow/plans.js +205 -0
- package/dist/commands/workflow/prs.js +12 -3
- package/dist/commands/workflow/repo.js +6 -0
- package/dist/commands/workflow/roadmap.js +50 -17
- package/dist/commands/workflow/run-facts.js +23 -28
- package/dist/commands/workflow/runs.js +530 -33
- package/dist/commands/workflow/runtime.js +3 -0
- package/dist/commands/workflow/skills.js +1 -0
- package/dist/commands/workflow/status.js +166 -19
- package/dist/commands/workflow/step-table.js +61 -29
- package/dist/commands/workflow/steps.js +542 -26
- package/dist/commands/workflow/summary-findings.js +117 -0
- package/dist/commands/workflow/summary.js +154 -41
- package/dist/commands/workflow/tasks.js +378 -0
- package/dist/commands/workflow/test-blocks.js +231 -0
- package/dist/commands/workflow/tests-changed.js +172 -0
- package/dist/commands/workflow/tests.js +1013 -321
- package/dist/commands/workflow/workflows.js +191 -38
- package/dist/commands/workflow/worktrees.js +310 -42
- package/dist/install/cloud-env.js +233 -99
- package/dist/install/context-ci-workflow.js +85 -0
- package/dist/install/manifest.js +57 -12
- package/dist/install/modules/antigravity.js +3 -2
- package/dist/install/modules/cloud.js +3 -3
- package/dist/install/modules/codex.js +12 -2
- package/dist/install/modules/core.js +851 -53
- package/dist/install/modules/cursor.js +6 -6
- package/dist/install/modules/opencode.js +11 -5
- package/dist/install/template-notes.js +116 -0
- package/dist/install/version-file.js +3 -2
- package/dist/ledgers/compact.js +87 -0
- package/dist/ledgers/journal.js +233 -0
- package/dist/ledgers/status.js +115 -5
- package/dist/ledgers/telemetry.js +121 -17
- package/dist/render/hosts.js +100 -14
- package/dist/shared/bkit-latest.js +26 -4
- package/dist/shared/dep-updater.js +49 -0
- package/dist/shared/egress.js +1 -1
- package/dist/shared/package-manager.js +6 -0
- package/dist/shared/settings.js +59 -10
- package/dist/shared/timeouts.js +2 -0
- package/dist/tools/cli-doc.js +97 -0
- package/dist/tools/grammar-density.js +1 -1
- package/dist/tools/instructions-sources.js +15 -16
- package/dist/tools/instructions.js +83 -39
- package/package.json +58 -42
- package/.bkit/core/.bkit/lite.md +0 -73
- package/.bkit/core/engine/commands/workflow/workstreams.ts +0 -172
- package/.bkit/core/prompts/bkit-build-plan-execute.md +0 -124
- package/.bkit/templates/scripts/ci/bkit-local-stack-lock.sh +0 -194
- package/dist/commands/workflow/workstreams.js +0 -149
- /package/.bkit/templates/.vale/styles/{House → Bkit}/Filler.yml +0 -0
- /package/.bkit/templates/.vale/styles/{House → Bkit}/Hedging.yml +0 -0
- /package/.bkit/templates/.vale/styles/{House → Bkit}/LLMSlop.yml +0 -0
- /package/.bkit/templates/.vale/styles/{House → Bkit}/Verbose.yml +0 -0
- /package/.bkit/templates/scripts/ci/{accepted-advisories.json → bkit-accepted-advisories.json} +0 -0
- /package/.bkit/templates/scripts/ci/{accepted-divergences.json → bkit-accepted-divergences.json} +0 -0
- /package/.bkit/templates/scripts/launchd/{launchd.env.example → bkit-launchd.env.example} +0 -0
- /package/.bkit/templates/scripts/launchd/{ai.bkit.launchd.plist → bkit-launchd.plist} +0 -0
|
@@ -9,10 +9,11 @@
|
|
|
9
9
|
// unique. A finding at the location and severity of an earlier task that is still open
|
|
10
10
|
// reruns that task (its Round value gains this round) rather than adding a twin; one whose
|
|
11
11
|
// earlier task is done from an earlier round is a new task. It then names the route:
|
|
12
|
-
// `fix` (run the tasks), `pause` (
|
|
13
|
-
//
|
|
14
|
-
//
|
|
15
|
-
// reports appends
|
|
12
|
+
// `fix` (run the tasks: every one is fixable, in any round), `pause` (a task is not
|
|
13
|
+
// fixable: ask the owner) or `none`. More than `maxChallengeTasks` new tasks in one merge
|
|
14
|
+
// writes nothing and pauses. The plan is checked in memory before it is written, so a
|
|
15
|
+
// refused merge leaves every file as it was. A re-run with the same reports appends
|
|
16
|
+
// nothing.
|
|
16
17
|
//
|
|
17
18
|
// bkit challenge gate — size the run's diff before the reviewers start. A small change
|
|
18
19
|
// (under CHALLENGE_SMALL lines and files, `docs/plans/**` excluded) runs the security
|
|
@@ -24,9 +25,11 @@ import * as path from "node:path";
|
|
|
24
25
|
import { appendLine, statusTimestamp } from "../../ledgers/status.js";
|
|
25
26
|
import { CommandError, DEV, EXIT, git, runGit } from "../lib.js";
|
|
26
27
|
import { DIFF_BASE, EXIT_BASE, diffNumstat } from "./context.js";
|
|
28
|
+
import { parseDecisionItems } from "./decisions.js";
|
|
27
29
|
import { EXIT_ROW_REFUSED, EXIT_STAGE, appendLedgerRows } from "./ledgers.js";
|
|
28
|
-
import { parsePlanBlocks } from "./plan-blocks.js";
|
|
30
|
+
import { derivedTestMatrix, parsePlanBlocks } from "./plan-blocks.js";
|
|
29
31
|
import { readBkitConfig } from "../../shared/settings.js";
|
|
32
|
+
import { grantCount } from "./counters.js";
|
|
30
33
|
import { checkPlanText, planCaps, readTestFirst } from "./tests.js";
|
|
31
34
|
import { ledgerRows } from "./workflows.js";
|
|
32
35
|
/**
|
|
@@ -103,7 +106,7 @@ function findingsLog(text) {
|
|
|
103
106
|
return { body: lines.slice(start + 1, end < 0 ? undefined : end).join("\n"), line: start + 2 };
|
|
104
107
|
}
|
|
105
108
|
/** The group wrapper a Findings Log gets when the reviewer wrote task blocks only. */
|
|
106
|
-
const WRAP = ["<!-- bkit:group 1 start -->", "### GROUP 1: Findings"];
|
|
109
|
+
const WRAP = ["<!-- bkit:group 1 start -->", "### TASK GROUP 1: Findings"];
|
|
107
110
|
/**
|
|
108
111
|
* One report's findings: each task block under `## Findings Log` (read through
|
|
109
112
|
* `parsePlanBlocks`; a log with no group marker is read as one group) with its
|
|
@@ -173,7 +176,8 @@ export function mergeFindings(reports, accepted) {
|
|
|
173
176
|
return { findings, dropped: all.length - findings.length };
|
|
174
177
|
}
|
|
175
178
|
/**
|
|
176
|
-
* Locations named in a `Decision: Accept` item of any `build-decision-*.md` in `logDir
|
|
179
|
+
* Locations named in a `Decision: Accept` item of any `build-decision-*.md` in `logDir`, the
|
|
180
|
+
* decision read by `parseDecisionItems` (so `Decision: A) Accept …` counts). An
|
|
177
181
|
* `Accept (assumed)` counts too, so the next round does not raise it again; the build summary
|
|
178
182
|
* and ship report it as assumed.
|
|
179
183
|
*/
|
|
@@ -183,12 +187,12 @@ export function acceptedLocations(logDir, cwd) {
|
|
|
183
187
|
? fs.readdirSync(logDir).filter((f) => /^build-decision-.*\.md$/.test(f))
|
|
184
188
|
: [];
|
|
185
189
|
for (const file of files) {
|
|
186
|
-
const items = fs.readFileSync(path.join(logDir, file), "utf-8")
|
|
187
|
-
for (const item of items
|
|
188
|
-
if (!/^
|
|
190
|
+
const items = parseDecisionItems(fs.readFileSync(path.join(logDir, file), "utf-8"));
|
|
191
|
+
for (const item of items) {
|
|
192
|
+
if (!/^Accept\b/.test(item.decision ?? ""))
|
|
189
193
|
continue;
|
|
190
194
|
// `path:line`, the path with or without an extension (`src/a.ts:10`, `Makefile:12`).
|
|
191
|
-
for (const m of item.matchAll(/(?<![\w@./-])[\w@./-]*[A-Za-z_][\w@./-]*:\d+/g)) {
|
|
195
|
+
for (const m of item.text.matchAll(/(?<![\w@./-])[\w@./-]*[A-Za-z_][\w@./-]*:\d+/g)) {
|
|
192
196
|
const loc = normalizeLocation(m[0], cwd);
|
|
193
197
|
if (loc !== null)
|
|
194
198
|
out.add(loc);
|
|
@@ -207,6 +211,29 @@ const taskBlock = (n, f, round) => [
|
|
|
207
211
|
...f.tests.map((e) => ` - ${e}`),
|
|
208
212
|
`<!-- bkit:task ${n} end -->`,
|
|
209
213
|
];
|
|
214
|
+
/** The test tier `docs/testing.md` records for a test file's name. */
|
|
215
|
+
const testTier = (file) => /\.integration\.test\./.test(file)
|
|
216
|
+
? "Integration"
|
|
217
|
+
: /\.live\.test\./.test(file)
|
|
218
|
+
? "@live (golden)"
|
|
219
|
+
: "Unit";
|
|
220
|
+
/**
|
|
221
|
+
* One `Derived Test Matrix` row per test a finding task appends: the test's own name and
|
|
222
|
+
* file from its `TEST FIRST` entry, its tier from the file's name, and the task number.
|
|
223
|
+
* A file or name holding a `|` would split the row's cells, so it is refused, not written.
|
|
224
|
+
*/
|
|
225
|
+
function matrixRows(findings, firstTask) {
|
|
226
|
+
const refused = [];
|
|
227
|
+
const rows = findings.flatMap((f, i) => f.tests.map((entry) => {
|
|
228
|
+
const spans = [...entry.matchAll(/`([^`]+)`/g)].map((m) => m[1].trim());
|
|
229
|
+
const file = spans[0] ?? "";
|
|
230
|
+
const name = spans[1] ?? entry.replace(/[`|]/g, "").trim();
|
|
231
|
+
if (file.includes("|") || name.includes("|"))
|
|
232
|
+
refused.push(`TASK ${firstTask + i} (${f.location}): its TEST FIRST test file or name holds a \`|\`, which breaks the Derived Test Matrix row`);
|
|
233
|
+
return `| ${name} | ${testTier(file)} | \`${file}\` | ${firstTask + i} |`;
|
|
234
|
+
}));
|
|
235
|
+
return { rows, refused };
|
|
236
|
+
}
|
|
210
237
|
/**
|
|
211
238
|
* The findings as groups of task blocks, numbered from `firstTask` and `firstGroup`: a
|
|
212
239
|
* group closes at `caps.maxPerGroup` tasks, or before a task that would take it past
|
|
@@ -234,7 +261,7 @@ function findingGroups(findings, firstTask, firstGroup, round, caps) {
|
|
|
234
261
|
const lines = chunks.flatMap((chunk, g) => [
|
|
235
262
|
...(g === 0 ? [] : [""]),
|
|
236
263
|
`<!-- bkit:group ${firstGroup + g} start -->`,
|
|
237
|
-
`### GROUP ${firstGroup + g}: Challenge round ${round} findings`,
|
|
264
|
+
`### TASK GROUP ${firstGroup + g}: Challenge round ${round} findings`,
|
|
238
265
|
...chunk.flatMap((f) => taskBlock(next++, f, round)),
|
|
239
266
|
`<!-- bkit:group ${firstGroup + g} end -->`,
|
|
240
267
|
]);
|
|
@@ -242,36 +269,60 @@ function findingGroups(findings, firstTask, firstGroup, round, caps) {
|
|
|
242
269
|
}
|
|
243
270
|
/**
|
|
244
271
|
* `plan` with the findings written as new groups after its last group (at the end when
|
|
245
|
-
* it has none), tasks numbered from `firstTask`, grouped within `caps`.
|
|
272
|
+
* it has none), tasks numbered from `firstTask`, grouped within `caps`. A plan that
|
|
273
|
+
* carries a `Derived Test Matrix` gains a row per finding test, so the matrix check holds
|
|
274
|
+
* over the appended tasks too.
|
|
246
275
|
*/
|
|
247
276
|
export function appendTasks(plan, findings, round, firstTask, caps) {
|
|
248
277
|
const blocks = parsePlanBlocks(plan);
|
|
249
278
|
const firstGroup = Math.max(0, ...blocks.groups.map((g) => g.group)) + 1;
|
|
250
279
|
const { lines: block, tasks } = findingGroups(findings, firstTask, firstGroup, round, caps);
|
|
280
|
+
const matrix = derivedTestMatrix(plan);
|
|
281
|
+
const { rows, refused } = matrix === null ? { rows: [], refused: [] } : matrixRows(findings, firstTask);
|
|
282
|
+
// The matrix table's last row, or its separator line when it holds none: 0-based index.
|
|
283
|
+
const matrixAt = matrix === null ? -1 : (matrix.rows.at(-1)?.number ?? matrix.line + 1);
|
|
284
|
+
const lines = plan.split("\n");
|
|
285
|
+
if (matrixAt >= 0)
|
|
286
|
+
lines.splice(matrixAt, 0, ...rows);
|
|
287
|
+
const rowLines = matrixAt >= 0 && rows.length > 0
|
|
288
|
+
? { from: matrixAt + 1, to: matrixAt + rows.length }
|
|
289
|
+
: undefined;
|
|
251
290
|
const last = blocks.groups.at(-1);
|
|
252
291
|
if (last === undefined) {
|
|
253
|
-
const body =
|
|
292
|
+
const body = lines.join("\n").replace(/\n*$/, "");
|
|
254
293
|
const from = body.split("\n").length + 2;
|
|
255
294
|
return {
|
|
256
295
|
text: `${body}\n\n${block.join("\n")}\n`,
|
|
257
296
|
tasks,
|
|
258
|
-
written: { from, to: from + block.length - 1 },
|
|
297
|
+
written: { from, to: from + block.length - 1, rows: rowLines, refused },
|
|
259
298
|
};
|
|
260
299
|
}
|
|
261
|
-
const
|
|
262
|
-
lines.splice(last.end, 0, "", ...block);
|
|
263
|
-
const from = last.end + 2;
|
|
264
|
-
|
|
300
|
+
const shift = matrixAt >= 0 && matrixAt <= last.end ? rows.length : 0;
|
|
301
|
+
lines.splice(last.end + shift, 0, "", ...block);
|
|
302
|
+
const from = last.end + shift + 2;
|
|
303
|
+
// Matrix rows below the last group move down by the block and its blank line.
|
|
304
|
+
const moved = rowLines !== undefined && shift === 0
|
|
305
|
+
? { from: rowLines.from + block.length + 1, to: rowLines.to + block.length + 1 }
|
|
306
|
+
: rowLines;
|
|
307
|
+
return {
|
|
308
|
+
text: lines.join("\n"),
|
|
309
|
+
tasks,
|
|
310
|
+
written: { from, to: from + block.length - 1, rows: moved, refused },
|
|
311
|
+
};
|
|
265
312
|
}
|
|
266
313
|
/**
|
|
267
|
-
* Why the merged `text` may not be written: a plan-check problem on
|
|
268
|
-
* wrote (a malformed block, a group or task over its cap
|
|
269
|
-
* TEST FIRST names no test.
|
|
314
|
+
* Why the merged `text` may not be written: a refused matrix row, a plan-check problem on
|
|
315
|
+
* the lines the merge wrote (a malformed block, a group or task over its cap, a broken
|
|
316
|
+
* matrix row), or a written task whose TEST FIRST names no test.
|
|
270
317
|
*/
|
|
271
318
|
function planProblems(text, written, added, caps) {
|
|
272
|
-
const
|
|
273
|
-
|
|
274
|
-
.
|
|
319
|
+
const at = (line, r) => r !== undefined && line >= r.from && line <= r.to;
|
|
320
|
+
const problems = [
|
|
321
|
+
...written.refused,
|
|
322
|
+
...checkPlanText(text, caps)
|
|
323
|
+
.problems.filter((p) => at(p.line, written) || at(p.line, written.rows))
|
|
324
|
+
.map((p) => `line ${p.line}: ${p.message}`),
|
|
325
|
+
];
|
|
275
326
|
const kinds = readTestFirst(text);
|
|
276
327
|
for (const n of added) {
|
|
277
328
|
const kind = kinds.find((s) => s.task === n)?.kind ?? "missing";
|
|
@@ -280,13 +331,15 @@ function planProblems(text, written, added, caps) {
|
|
|
280
331
|
}
|
|
281
332
|
return problems;
|
|
282
333
|
}
|
|
334
|
+
/** Stable identity shared by the challenge writer and its resolution reader. */
|
|
335
|
+
export const lowDeferralKey = (fid, location) => `${fid}-challenge-low-${location.replace(/[^A-Za-z0-9]+/g, "-").replace(/^-|-$/g, "")}`.toLowerCase();
|
|
283
336
|
/** LOW findings as `docs/deferrals.jsonl` rows, keyed by FID and location. */
|
|
284
337
|
export function lowDeferrals(fid, findings) {
|
|
285
338
|
return findings
|
|
286
339
|
.filter((f) => f.severity === "LOW")
|
|
287
340
|
.map((f) => ({
|
|
288
341
|
kind: "deferral",
|
|
289
|
-
key:
|
|
342
|
+
key: lowDeferralKey(fid, f.location),
|
|
290
343
|
type: "issue",
|
|
291
344
|
category: "correctness",
|
|
292
345
|
severity: "LOW",
|
|
@@ -341,6 +394,7 @@ export const challengeCommand = {
|
|
|
341
394
|
verbs: {
|
|
342
395
|
gate: {
|
|
343
396
|
summary: "Size the run's diff ({base}...HEAD, docs/plans/** excluded) and name the reviewers: small runs challenge-2 alone, large runs both. Writes a challenge-gate status row.",
|
|
397
|
+
use: "workflow",
|
|
344
398
|
flags: [
|
|
345
399
|
{
|
|
346
400
|
name: "file",
|
|
@@ -402,6 +456,7 @@ export const challengeCommand = {
|
|
|
402
456
|
},
|
|
403
457
|
merge: {
|
|
404
458
|
summary: "Merge the challenge reports' findings into the plan as tasks (LOW → deferral rows); prints the route: fix | pause | none.",
|
|
459
|
+
use: "workflow",
|
|
405
460
|
flags: [
|
|
406
461
|
{
|
|
407
462
|
name: "report",
|
|
@@ -426,11 +481,11 @@ export const challengeCommand = {
|
|
|
426
481
|
name: "round",
|
|
427
482
|
type: "string",
|
|
428
483
|
required: true,
|
|
429
|
-
help: "challenge round, 1 up to bkit.workflows.build.challenge.maxAttempts
|
|
484
|
+
help: "challenge round, 1 up to bkit.workflows.build.challenge.maxAttempts, one more full set per allowance-granted row for build.challenge in the log folder's status.jsonl",
|
|
430
485
|
},
|
|
431
486
|
],
|
|
432
487
|
output: {
|
|
433
|
-
route: "fix (tasks to run), pause (a task is not fixable,
|
|
488
|
+
route: "fix (tasks to run, every one fixable), pause (a task is not fixable, or more than 4 x `bkit.workflows.tasks.maxPerGroup` new tasks) or none (nothing to run)",
|
|
434
489
|
fixTasks: "comma-separated task numbers in `plan` this round runs: every task reopened, then every task appended; empty when none",
|
|
435
490
|
appended: "how many tasks this run wrote",
|
|
436
491
|
reopened: "comma-separated numbers of open earlier tasks a finding reported again (same location and severity); this round is added to their **Round:** value; empty when none",
|
|
@@ -451,14 +506,16 @@ export const challengeCommand = {
|
|
|
451
506
|
run: (ctx) => {
|
|
452
507
|
const round = String(ctx.flags.round);
|
|
453
508
|
const top = git(ctx.cwd, ["rev-parse", "--show-toplevel"]) ?? ctx.cwd;
|
|
454
|
-
const maxRounds = readBkitConfig(top).asks["build.challenge"].max;
|
|
455
|
-
if (!/^[1-9][0-9]*$/.test(round) || Number(round) > maxRounds)
|
|
456
|
-
throw new CommandError(EXIT.USAGE, `--round must be 1 to ${maxRounds} (bkit.workflows.build.challenge.maxAttempts), got "${round}"`);
|
|
457
|
-
const roundN = Number(round);
|
|
458
509
|
const abs = (p) => path.resolve(ctx.cwd, p);
|
|
459
510
|
const rel = (p) => path.relative(ctx.cwd, p).split(path.sep).join("/");
|
|
460
511
|
const planArg = String(ctx.flags.plan);
|
|
461
512
|
const logDir = abs(String(ctx.flags.log));
|
|
513
|
+
// Each allowance the owner granted at the used-up limit adds one full set of rounds.
|
|
514
|
+
const grants = grantCount(path.join(logDir, "status.jsonl"), "build", "build.challenge", undefined, false);
|
|
515
|
+
const maxRounds = readBkitConfig(top).asks["build.challenge"].max * (1 + grants);
|
|
516
|
+
if (!/^[1-9][0-9]*$/.test(round) || Number(round) > maxRounds)
|
|
517
|
+
throw new CommandError(EXIT.USAGE, `--round must be 1 to ${maxRounds} (bkit.workflows.build.challenge.maxAttempts x (1 + ${grants} allowance(s) granted)), got "${round}"`);
|
|
518
|
+
const roundN = Number(round);
|
|
462
519
|
const fid = path.basename(logDir);
|
|
463
520
|
const reports = ctx.flags.report.map((r) => {
|
|
464
521
|
if (!fs.existsSync(abs(r)))
|
|
@@ -533,11 +590,7 @@ export const challengeCommand = {
|
|
|
533
590
|
if (after !== before)
|
|
534
591
|
writeAtomic(planAbs, after);
|
|
535
592
|
const running = [...fresh, ...open.map((x) => x.f)];
|
|
536
|
-
const route = fixTasks.length === 0
|
|
537
|
-
? "none"
|
|
538
|
-
: roundN >= maxRounds || running.some((f) => !f.fixable)
|
|
539
|
-
? "pause"
|
|
540
|
-
: "fix";
|
|
593
|
+
const route = fixTasks.length === 0 ? "none" : running.some((f) => !f.fixable) ? "pause" : "fix";
|
|
541
594
|
ctx.emit({
|
|
542
595
|
route,
|
|
543
596
|
fixTasks: fixTasks.join(","),
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
// bkit completeness check — report whether a run recorded every step and journaled every command its workflow requires.
|
|
2
|
+
import * as fs from "node:fs";
|
|
3
|
+
import * as path from "node:path";
|
|
4
|
+
import { deriveContract, inferWorkflows, parseRows, readCompleteness, runsOf, } from "../../checks/status-holes.js";
|
|
5
|
+
import { getWorkflowsRoot } from "../../shared/package-roots.js";
|
|
6
|
+
import { EXIT } from "../lib.js";
|
|
7
|
+
import { readIssueTracker } from "./fids.js";
|
|
8
|
+
import { FILE_FLAG, WORKFLOW_FLAG, statusFile } from "./status.js";
|
|
9
|
+
const TAG = "[bkit-status-holes]";
|
|
10
|
+
const readText = (file, log) => {
|
|
11
|
+
try {
|
|
12
|
+
return fs.readFileSync(file, "utf-8");
|
|
13
|
+
}
|
|
14
|
+
catch (err) {
|
|
15
|
+
log(`${TAG} ${file} not readable: ${err instanceof Error ? err.message : String(err)}`);
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
function reportLines(v) {
|
|
20
|
+
const calls = (list) => list.map((c) => `${c.noun} ${c.verb}`).join(", ");
|
|
21
|
+
const lines = [
|
|
22
|
+
`${TAG} ADVISORY — ${v.workflow}: ${v.verdict} (${v.observed.steps} step(s), ${v.observed.calls} call(s) observed)`,
|
|
23
|
+
];
|
|
24
|
+
if (v.preJournal)
|
|
25
|
+
lines.push(" pre-journal run: command evidence not available");
|
|
26
|
+
if (v.stepHoles.length > 0)
|
|
27
|
+
lines.push(` step holes: ${v.stepHoles.join(", ")}`);
|
|
28
|
+
for (const h of v.evidenceHoles)
|
|
29
|
+
lines.push(` evidence hole: ${h.step} lacks ${calls(h.missing)}`);
|
|
30
|
+
if (v.unexercised.length > 0)
|
|
31
|
+
lines.push(` unexercised arms: ${v.unexercised.length} (not holes)`);
|
|
32
|
+
return lines;
|
|
33
|
+
}
|
|
34
|
+
export const completenessCommand = {
|
|
35
|
+
noun: "completeness",
|
|
36
|
+
summary: "Check a run for missing steps and missing bkit commands.",
|
|
37
|
+
verbs: {
|
|
38
|
+
check: {
|
|
39
|
+
summary: "Report the steps and bkit commands a run is missing, from its status.jsonl and the workflow markdown; advisory, always exits 0.",
|
|
40
|
+
use: "by-hand",
|
|
41
|
+
flags: [
|
|
42
|
+
FILE_FLAG,
|
|
43
|
+
{
|
|
44
|
+
...WORKFLOW_FLAG,
|
|
45
|
+
required: false,
|
|
46
|
+
help: "workflow name: design, plan, build, debug, ship; absent = each workflow the file holds rows of",
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
output: {
|
|
50
|
+
report: "the human-readable report",
|
|
51
|
+
holey: "true when any checked run has an evidence hole or a step hole",
|
|
52
|
+
verdicts: "one completeness verdict per checked run; empty when nothing could be read",
|
|
53
|
+
},
|
|
54
|
+
run: (ctx) => {
|
|
55
|
+
const file = statusFile(ctx);
|
|
56
|
+
const text = readText(file, ctx.log);
|
|
57
|
+
if (text === null) {
|
|
58
|
+
ctx.emit({ report: `${TAG} no status.jsonl to check`, holey: false, verdicts: [] });
|
|
59
|
+
return EXIT.OK;
|
|
60
|
+
}
|
|
61
|
+
const rows = parseRows(text);
|
|
62
|
+
const given = typeof ctx.flags.workflow === "string" ? ctx.flags.workflow : undefined;
|
|
63
|
+
const workflows = given === undefined ? inferWorkflows(rows) : [given];
|
|
64
|
+
// The repo holding the file sets the tracker, as on the close and start paths.
|
|
65
|
+
const tracker = readIssueTracker(path.dirname(file));
|
|
66
|
+
const verdicts = [];
|
|
67
|
+
const lines = [];
|
|
68
|
+
for (const workflow of workflows) {
|
|
69
|
+
const md = readText(path.join(getWorkflowsRoot(), `bkit-${workflow}.md`), ctx.log);
|
|
70
|
+
if (md === null) {
|
|
71
|
+
ctx.log(`${TAG} bkit-${workflow}.md not readable — skipping ${workflow} (advisory)`);
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
try {
|
|
75
|
+
const contract = deriveContract(md, workflow, tracker);
|
|
76
|
+
for (const run of runsOf(rows, workflow)) {
|
|
77
|
+
const { verdict } = readCompleteness(run, contract);
|
|
78
|
+
verdicts.push(verdict);
|
|
79
|
+
lines.push(...reportLines(verdict));
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
catch (err) {
|
|
83
|
+
ctx.log(`${TAG} ${workflow}: ${err instanceof Error ? err.message : String(err)} — no verdict (advisory)`);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
if (lines.length === 0)
|
|
87
|
+
lines.push(`${TAG} no verdict`);
|
|
88
|
+
ctx.emit({
|
|
89
|
+
report: lines.join("\n"),
|
|
90
|
+
holey: verdicts.some((v) => v.holey),
|
|
91
|
+
verdicts,
|
|
92
|
+
});
|
|
93
|
+
return EXIT.OK;
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
};
|