@cbartens/bkit 6.1.1 → 6.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.bkit/README.md +14 -12
- package/.bkit/core/.agents/docs.md +1 -11
- package/.bkit/core/.agents/plugins/bkit/hooks/bkit-gateguard.cjs +30 -9
- package/.bkit/core/.agents/plugins/bkit/hooks/bkit-guardrails.cjs +25 -27
- package/.bkit/core/.agents/rules.md +22 -9
- package/.bkit/core/.bkit/README.md +13 -11
- package/.bkit/core/.bkit/authoring.md +58 -13
- package/.bkit/core/.bkit/cli.md +42 -32
- package/.bkit/core/.bkit/cloud.md +93 -30
- package/.bkit/core/.bkit/install.md +55 -16
- package/.bkit/core/.bkit/jsonl.md +24 -7
- package/.bkit/core/.bkit/pipeline.md +8 -8
- package/.bkit/core/.bkit/prompts.md +160 -43
- package/.bkit/core/.bkit/providers.md +97 -36
- package/.bkit/core/.bkit/templates.md +162 -34
- package/.bkit/core/.bkit/trackers.md +39 -6
- package/.bkit/core/.bkit/workflows.md +344 -136
- package/.bkit/core/.claude/hooks/bkit-guardrails.cjs +50 -27
- package/.bkit/core/.claude/hooks/bkit-preflight.sh +11 -11
- package/.bkit/core/.codex/hooks/bkit-gateguard.cjs +13 -8
- package/.bkit/core/.codex/hooks/bkit-guardrails.cjs +14 -25
- package/.bkit/core/.cursor/hooks/bkit-guardrails.cjs +20 -9
- package/.bkit/core/.cursor/hooks/bkit-preflight.sh +8 -8
- package/.bkit/core/.opencode/plugin/bkit-gateguard.js +14 -4
- package/.bkit/core/.opencode/plugin/bkit-guardrails.js +114 -0
- package/.bkit/core/docs/templates/bkit-audit-accessibility.md +1 -1
- package/.bkit/core/docs/templates/bkit-audit-adoption.md +30 -6
- package/.bkit/core/docs/templates/bkit-audit-agents.md +1 -1
- package/.bkit/core/docs/templates/bkit-audit-aio-seo.md +1 -1
- package/.bkit/core/docs/templates/bkit-audit-analytics.md +1 -1
- package/.bkit/core/docs/templates/bkit-audit-annotations.md +1 -1
- package/.bkit/core/docs/templates/bkit-audit-app-performance.md +1 -1
- package/.bkit/core/docs/templates/bkit-audit-app-store.md +1 -1
- package/.bkit/core/docs/templates/bkit-audit-architecture.md +1 -1
- package/.bkit/core/docs/templates/bkit-audit-ci-performance.md +2 -2
- package/.bkit/core/docs/templates/bkit-audit-config.md +3 -2
- package/.bkit/core/docs/templates/bkit-audit-cost.md +1 -1
- package/.bkit/core/docs/templates/bkit-audit-coverage.md +1 -1
- package/.bkit/core/docs/templates/bkit-audit-database.md +3 -3
- package/.bkit/core/docs/templates/bkit-audit-dead-code.md +1 -1
- package/.bkit/core/docs/templates/bkit-audit-deferrals.md +1 -1
- package/.bkit/core/docs/templates/bkit-audit-dependencies.md +3 -3
- package/.bkit/core/docs/templates/bkit-audit-documentation.md +32 -2
- package/.bkit/core/docs/templates/bkit-audit-duplication.md +1 -1
- package/.bkit/core/docs/templates/bkit-audit-failures.md +1 -1
- package/.bkit/core/docs/templates/bkit-audit-flakes.md +2 -2
- package/.bkit/core/docs/templates/bkit-audit-gates.md +5 -3
- package/.bkit/core/docs/templates/bkit-audit-issues.md +1 -1
- package/.bkit/core/docs/templates/bkit-audit-llm.md +2 -2
- package/.bkit/core/docs/templates/bkit-audit-logs.md +1 -1
- package/.bkit/core/docs/templates/bkit-audit-models.md +2 -2
- package/.bkit/core/docs/templates/bkit-audit-privacy.md +1 -1
- package/.bkit/core/docs/templates/bkit-audit-prompts.md +1 -1
- package/.bkit/core/docs/templates/bkit-audit-red-team.md +2 -2
- package/.bkit/core/docs/templates/bkit-audit-reliability.md +3 -2
- package/.bkit/core/docs/templates/bkit-audit-repo.md +1 -1
- package/.bkit/core/docs/templates/bkit-audit-security.md +1 -1
- package/.bkit/core/docs/templates/bkit-audit-slop.md +1 -1
- package/.bkit/core/docs/templates/bkit-audit-testing.md +3 -2
- package/.bkit/core/docs/templates/bkit-audit-usability.md +1 -1
- package/.bkit/core/docs/templates/bkit-plan.md +38 -8
- package/.bkit/core/engine/checks/after/auth.ts +118 -47
- package/.bkit/core/engine/checks/after/github.ts +89 -37
- package/.bkit/core/engine/checks/after/index.ts +15 -3
- package/.bkit/core/engine/checks/after/tools.ts +245 -1
- package/.bkit/core/engine/checks/before/files.ts +59 -1
- package/.bkit/core/engine/checks/before/index.ts +8 -0
- package/.bkit/core/engine/checks/status-holes.ts +20 -26
- package/.bkit/core/engine/checks/tips/catalogue.ts +107 -10
- package/.bkit/core/engine/checks/tips/detect.ts +36 -3
- package/.bkit/core/engine/checks/tips/index.ts +1 -1
- package/.bkit/core/engine/cli.ts +13 -13
- package/.bkit/core/engine/commands/ci/ci.ts +64 -11
- package/.bkit/core/engine/commands/ci/push-gate.ts +101 -43
- package/.bkit/core/engine/commands/install/install.ts +28 -25
- package/.bkit/core/engine/commands/install/uninstall.ts +42 -30
- package/.bkit/core/engine/commands/install/upgrade.ts +14 -2
- package/.bkit/core/engine/commands/land.ts +2 -3
- package/.bkit/core/engine/commands/lib.ts +394 -39
- package/.bkit/core/engine/commands/registry.ts +1 -1
- package/.bkit/core/engine/commands/workflow/branches.ts +351 -78
- package/.bkit/core/engine/commands/workflow/challenge.ts +63 -14
- package/.bkit/core/engine/commands/workflow/context.ts +71 -10
- package/.bkit/core/engine/commands/workflow/counters.ts +298 -23
- package/.bkit/core/engine/commands/workflow/decisions.ts +260 -125
- package/.bkit/core/engine/commands/workflow/disk.ts +2 -1
- package/.bkit/core/engine/commands/workflow/feature-base.ts +66 -0
- package/.bkit/core/engine/commands/workflow/issues.ts +312 -17
- package/.bkit/core/engine/commands/workflow/junit.ts +204 -0
- package/.bkit/core/engine/commands/workflow/ledgers.ts +904 -99
- package/.bkit/core/engine/commands/workflow/locks.ts +186 -29
- package/.bkit/core/engine/commands/workflow/loops.ts +87 -0
- package/.bkit/core/engine/commands/workflow/open-decision.ts +251 -0
- package/.bkit/core/engine/commands/workflow/plan-blocks.ts +8 -0
- package/.bkit/core/engine/commands/workflow/plans.ts +1 -1
- package/.bkit/core/engine/commands/workflow/prs.ts +311 -16
- package/.bkit/core/engine/commands/workflow/repo.ts +1 -1
- package/.bkit/core/engine/commands/workflow/run-facts.ts +6 -0
- package/.bkit/core/engine/commands/workflow/runs.ts +877 -174
- package/.bkit/core/engine/commands/workflow/runtime.ts +12 -4
- package/.bkit/core/engine/commands/workflow/status.ts +324 -11
- package/.bkit/core/engine/commands/workflow/step-table.ts +41 -15
- package/.bkit/core/engine/commands/workflow/steps.ts +604 -29
- package/.bkit/core/engine/commands/workflow/summary-findings.ts +1 -1
- package/.bkit/core/engine/commands/workflow/summary.ts +314 -8
- package/.bkit/core/engine/commands/workflow/tasks.ts +400 -27
- package/.bkit/core/engine/commands/workflow/tests-base.ts +319 -0
- package/.bkit/core/engine/commands/workflow/tests-changed.ts +138 -74
- package/.bkit/core/engine/commands/workflow/tests-jump.ts +93 -0
- package/.bkit/core/engine/commands/workflow/tests.ts +815 -182
- package/.bkit/core/engine/commands/workflow/tracker.ts +1134 -137
- package/.bkit/core/engine/commands/workflow/workflows.ts +100 -72
- package/.bkit/core/engine/commands/workflow/worktrees.ts +421 -57
- package/.bkit/core/engine/install/cloud-env.ts +38 -10
- package/.bkit/core/engine/install/managed-block.ts +105 -0
- package/.bkit/core/engine/install/manifest.ts +7 -1
- package/.bkit/core/engine/install/modules/claude.ts +6 -2
- package/.bkit/core/engine/install/modules/cloud.ts +84 -95
- package/.bkit/core/engine/install/modules/codex.ts +10 -2
- package/.bkit/core/engine/install/modules/core.ts +148 -14
- package/.bkit/core/engine/install/modules/opencode.ts +18 -23
- package/.bkit/core/engine/install/network-allowlist.ts +8 -3
- package/.bkit/core/engine/install/project-docs.ts +650 -0
- package/.bkit/core/engine/install/template-copies.ts +58 -5
- package/.bkit/core/engine/install/write.ts +128 -7
- package/.bkit/core/engine/ledgers/journal.ts +18 -10
- package/.bkit/core/engine/ledgers/migrate.ts +20 -8
- package/.bkit/core/engine/ledgers/status.ts +604 -8
- package/.bkit/core/engine/ledgers/telemetry.ts +115 -13
- package/.bkit/core/engine/render/trackers.ts +3 -1
- package/.bkit/core/engine/shared/package-manager.ts +7 -3
- package/.bkit/core/engine/shared/settings.ts +12 -1
- package/.bkit/core/engine/shared/text.ts +14 -0
- package/.bkit/core/engine/tools/instructions-sources.ts +1 -0
- package/.bkit/core/engine/tools/instructions.ts +116 -20
- package/.bkit/core/hooks/antigravity-hook.js +20 -4
- package/.bkit/core/hooks/gateguard-edit-payload.js +8 -5
- package/.bkit/core/hooks/gateguard-engine.js +249 -23
- package/.bkit/core/hooks/guardrails-deny.js +167 -0
- package/.bkit/core/hooks/guardrails-read.js +3 -3
- package/.bkit/core/hooks/guardrails-shell.js +1122 -167
- package/.bkit/core/hooks/guardrails-tiers.js +247 -176
- package/.bkit/core/hooks/preflight-tracker.sh +219 -0
- package/.bkit/core/prompts/bkit-audit-generate.md +23 -6
- package/.bkit/core/prompts/bkit-build-challenge-1.md +5 -4
- package/.bkit/core/prompts/bkit-build-challenge-2.md +6 -5
- package/.bkit/core/prompts/bkit-build-install-skills.md +2 -2
- package/.bkit/core/prompts/bkit-build-plan-convert.md +21 -7
- package/.bkit/core/prompts/bkit-build-plan-current.md +5 -4
- package/.bkit/core/prompts/bkit-build-plan-gaps-remediate.md +22 -17
- package/.bkit/core/prompts/bkit-build-plan-tasks.md +16 -12
- package/.bkit/core/prompts/bkit-build-plan-tests.md +14 -10
- package/.bkit/core/prompts/bkit-build-plan-verify.md +21 -8
- package/.bkit/core/prompts/bkit-debug-abort-handover.md +10 -5
- package/.bkit/core/prompts/bkit-debug-failure-diagnose.md +22 -6
- package/.bkit/core/prompts/bkit-debug-failure-remediate.md +19 -3
- package/.bkit/core/prompts/bkit-debug-failure-reproduce.md +22 -6
- package/.bkit/core/prompts/bkit-debug-failure-soak.md +10 -7
- package/.bkit/core/prompts/bkit-design-brainstorm-ideate-1.md +3 -3
- package/.bkit/core/prompts/bkit-design-brainstorm-ideate-2.md +4 -4
- package/.bkit/core/prompts/bkit-design-brainstorm-ideate-3.md +3 -3
- package/.bkit/core/prompts/bkit-design-generate.md +6 -4
- package/.bkit/core/prompts/bkit-design-organise.md +4 -3
- package/.bkit/core/prompts/bkit-design-review-1.md +5 -4
- package/.bkit/core/prompts/bkit-design-review-2.md +6 -5
- package/.bkit/core/prompts/bkit-design-spike.md +4 -3
- package/.bkit/core/prompts/bkit-design-update.md +6 -4
- package/.bkit/core/prompts/bkit-plan-generate.md +35 -14
- package/.bkit/core/prompts/bkit-plan-review-1.md +9 -7
- package/.bkit/core/prompts/bkit-plan-review-2.md +9 -7
- package/.bkit/core/prompts/bkit-plan-scope-check.md +8 -6
- package/.bkit/core/prompts/bkit-plan-update.md +22 -8
- package/.bkit/core/prompts/bkit-ship-conflict-resolve.md +11 -8
- package/.bkit/core/prompts/bkit-ship-deferred-sweep.md +9 -5
- package/.bkit/core/prompts/bkit-ship-update-docs.md +26 -4
- package/.bkit/core/prompts/bkit-utility-compress-markdown.md +3 -3
- package/.bkit/core/prompts/bkit-utility-update-decisions.md +10 -7
- package/.bkit/core/prompts/bkit-utility-update-deferrals.md +8 -5
- package/.bkit/core/prompts/bkit-utility-update-documentation.md +31 -7
- package/.bkit/core/prompts/bkit-utility-update-failures.md +8 -5
- package/.bkit/core/prompts/bkit-utility-update-knowledge.md +10 -7
- package/.bkit/core/prompts/bkit-utility-update-roadmap.md +4 -4
- package/.bkit/core/prompts/bkit-utility-update-tracker.md +4 -4
- package/.bkit/core/workflows/bkit-auto.md +23 -11
- package/.bkit/core/workflows/bkit-build.md +331 -100
- package/.bkit/core/workflows/bkit-debug.md +135 -64
- package/.bkit/core/workflows/bkit-design.md +58 -32
- package/.bkit/core/workflows/bkit-plan.md +73 -45
- package/.bkit/core/workflows/bkit-ship.md +233 -167
- package/.bkit/shared/.agents/plugins/bkit/hooks.json +1 -1
- package/.bkit/shared/.bkit/.env.example +5 -0
- package/.bkit/shared/.claude/bkit-cloud.md +7 -7
- package/.bkit/shared/.claude/settings.json +5 -1
- package/.bkit/shared/.cursor/bkit-cloud.md +1 -1
- package/.bkit/shared/.cursor/hooks.json +1 -1
- package/.bkit/shared/.opencode/opencode.json +11 -2
- package/.bkit/templates/.claude/hooks/bkit-cloud-bootstrap.sh +27 -0
- package/.bkit/templates/.cursor/Dockerfile +7 -7
- package/.bkit/templates/.github/ISSUE_TEMPLATE/bkit-idea.yml +1 -1
- package/.bkit/templates/.github/dependabot.yml +5 -0
- package/.bkit/templates/.github/renovate.json5 +5 -3
- package/.bkit/templates/.github/workflows/bkit-ci.yml +11 -11
- package/.bkit/templates/.github/workflows/bkit-cloud.yml +525 -161
- package/.bkit/templates/.github/workflows/bkit-renovate.yml +2 -2
- package/.bkit/templates/.husky/pre-push +123 -6
- package/.bkit/templates/context/bkit-serena.md +1 -1
- package/.bkit/templates/docs/architecture.md +98 -0
- package/.bkit/templates/docs/capabilities.md +33 -37
- package/.bkit/templates/docs/components.md +142 -0
- package/.bkit/templates/docs/data-schema.md +87 -0
- package/.bkit/{shared → templates}/docs/deployments.md +128 -142
- package/.bkit/templates/docs/design.md +117 -0
- package/.bkit/templates/docs/noise.md +54 -0
- package/.bkit/templates/docs/observability.md +99 -0
- package/.bkit/templates/docs/security.md +137 -0
- package/.bkit/templates/docs/setup.md +93 -0
- package/.bkit/templates/docs/technology.md +70 -0
- package/.bkit/{shared → templates}/docs/testing.md +200 -87
- package/.bkit/templates/scripts/ci/bkit-machine-lock.sh +511 -103
- package/.bkit/templates/scripts/ci/bkit-test-awake.mjs +228 -35
- package/.bkit/templates/scripts/ci/bkit-test-awake.test.mjs +270 -2
- package/.bkit/templates/scripts/graphify/bkit-graphify-graphml.py +1 -1
- package/.bkit/templates/scripts/graphify/bkit-graphify-rollup.py +92 -63
- package/.bkit/templates/scripts/graphify/bkit-graphify.sh +59 -11
- package/.bkit/templates/slop-scan.config.json +2 -0
- package/CHANGELOG.md +64 -0
- package/DETAILS.md +24 -19
- package/README.md +1 -1
- package/dist/checks/after/auth.js +114 -46
- package/dist/checks/after/github.js +77 -35
- package/dist/checks/after/index.js +12 -3
- package/dist/checks/after/tools.js +224 -1
- package/dist/checks/before/files.js +59 -1
- package/dist/checks/before/index.js +7 -1
- package/dist/checks/status-holes.js +20 -21
- package/dist/checks/tips/catalogue.js +99 -10
- package/dist/checks/tips/detect.js +35 -3
- package/dist/checks/tips/index.js +1 -1
- package/dist/cli.js +13 -13
- package/dist/commands/ci/ci.js +56 -12
- package/dist/commands/ci/push-gate.js +79 -44
- package/dist/commands/install/install.js +23 -22
- package/dist/commands/install/uninstall.js +36 -30
- package/dist/commands/install/upgrade.js +10 -2
- package/dist/commands/land.js +2 -3
- package/dist/commands/lib.js +323 -25
- package/dist/commands/workflow/branches.js +312 -72
- package/dist/commands/workflow/challenge.js +66 -13
- package/dist/commands/workflow/context.js +46 -10
- package/dist/commands/workflow/counters.js +231 -23
- package/dist/commands/workflow/decisions.js +221 -106
- package/dist/commands/workflow/disk.js +2 -1
- package/dist/commands/workflow/feature-base.js +60 -0
- package/dist/commands/workflow/issues.js +243 -15
- package/dist/commands/workflow/junit.js +137 -0
- package/dist/commands/workflow/ledgers.js +726 -112
- package/dist/commands/workflow/locks.js +150 -29
- package/dist/commands/workflow/loops.js +67 -0
- package/dist/commands/workflow/open-decision.js +199 -0
- package/dist/commands/workflow/plan-blocks.js +6 -0
- package/dist/commands/workflow/plans.js +1 -1
- package/dist/commands/workflow/prs.js +272 -16
- package/dist/commands/workflow/repo.js +1 -1
- package/dist/commands/workflow/run-facts.js +6 -0
- package/dist/commands/workflow/runs.js +747 -155
- package/dist/commands/workflow/runtime.js +8 -4
- package/dist/commands/workflow/status.js +259 -13
- package/dist/commands/workflow/step-table.js +41 -15
- package/dist/commands/workflow/steps.js +530 -26
- package/dist/commands/workflow/summary-findings.js +1 -1
- package/dist/commands/workflow/summary.js +289 -8
- package/dist/commands/workflow/tasks.js +294 -27
- package/dist/commands/workflow/tests-base.js +266 -0
- package/dist/commands/workflow/tests-changed.js +130 -56
- package/dist/commands/workflow/tests-jump.js +77 -0
- package/dist/commands/workflow/tests.js +608 -131
- package/dist/commands/workflow/tracker.js +920 -112
- package/dist/commands/workflow/workflows.js +80 -59
- package/dist/commands/workflow/worktrees.js +387 -58
- package/dist/install/cloud-env.js +32 -10
- package/dist/install/managed-block.js +101 -0
- package/dist/install/manifest.js +7 -1
- package/dist/install/modules/claude.js +6 -2
- package/dist/install/modules/cloud.js +73 -86
- package/dist/install/modules/codex.js +9 -2
- package/dist/install/modules/core.js +133 -14
- package/dist/install/modules/opencode.js +18 -23
- package/dist/install/network-allowlist.js +8 -3
- package/dist/install/project-docs.js +551 -0
- package/dist/install/template-copies.js +55 -5
- package/dist/install/write.js +117 -5
- package/dist/ledgers/journal.js +10 -8
- package/dist/ledgers/migrate.js +20 -9
- package/dist/ledgers/status.js +461 -8
- package/dist/ledgers/telemetry.js +71 -13
- package/dist/render/trackers.js +3 -1
- package/dist/shared/package-manager.js +7 -2
- package/dist/shared/settings.js +8 -0
- package/dist/shared/text.js +13 -0
- package/dist/tools/instructions-sources.js +1 -0
- package/dist/tools/instructions.js +97 -24
- package/package.json +22 -15
- package/.bkit/core/hooks/preflight-linear.sh +0 -73
- package/.bkit/shared/docs/architecture.md +0 -16
- package/.bkit/shared/docs/data-schema.md +0 -16
- package/.bkit/shared/docs/design.md +0 -38
- package/.bkit/shared/docs/noise.md +0 -20
- package/.bkit/shared/docs/observability.md +0 -22
- package/.bkit/shared/docs/security.md +0 -62
- package/.bkit/shared/docs/setup.md +0 -52
- package/.bkit/shared/docs/technology.md +0 -15
- /package/.bkit/templates/{.lintstagedrc.json → lintstagedrc.example.json} +0 -0
- /package/.bkit/templates/{.prettierignore → prettierignore.example} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { parseFindings, mergeFindings, normalizeLocation, lowDeferralKey, } from "./challenge.js";
|
|
2
|
-
import { parseDecisionItems } from "./
|
|
2
|
+
import { parseDecisionItems } from "./open-decision.js";
|
|
3
3
|
const artifacts = (row) => Array.isArray(row.artifacts)
|
|
4
4
|
? row.artifacts.filter((p) => typeof p === "string")
|
|
5
5
|
: [];
|
|
@@ -4,9 +4,22 @@
|
|
|
4
4
|
// disk and passes `read` for the log files.
|
|
5
5
|
import { coversList } from "./plans.js";
|
|
6
6
|
import { issueIdOf } from "./fids.js";
|
|
7
|
-
import { parseDecisionItems } from "./
|
|
7
|
+
import { decisionHeader, parseDecisionItems } from "./open-decision.js";
|
|
8
8
|
import { parsePlanBlocks } from "./plan-blocks.js";
|
|
9
|
+
import { parseJson } from "../../shared/json.js";
|
|
10
|
+
import { oneLine } from "../../shared/text.js";
|
|
9
11
|
import { challengeResolution, taskVerified } from "./summary-findings.js";
|
|
12
|
+
import { RED_STEP, redTestsOf, TAKEOVER_STEP } from "./tests.js";
|
|
13
|
+
/** What a taken-over test's red state proves, in the summary's words. */
|
|
14
|
+
const handedWords = (state) => {
|
|
15
|
+
if (state === "red" || state === "red-not-loaded")
|
|
16
|
+
return "recorded failing";
|
|
17
|
+
if (state === "taken-over")
|
|
18
|
+
return "changed hands, not proven failing";
|
|
19
|
+
if (state === "updated")
|
|
20
|
+
return "existing test updated and passing; verify judged its diff";
|
|
21
|
+
return `not recorded red (\`${state}\`)`;
|
|
22
|
+
};
|
|
10
23
|
export const SUMMARY_WORKFLOWS = ["plan", "design", "build", "debug", "ship"];
|
|
11
24
|
/** Per workflow and verdict, the next command the summary recommends. */
|
|
12
25
|
export const NEXT_STEP = {
|
|
@@ -47,14 +60,32 @@ export function refOf(fid, tracker = "any") {
|
|
|
47
60
|
return /^[0-9]+$/.test(id) ? `#${id}` : id;
|
|
48
61
|
}
|
|
49
62
|
/**
|
|
50
|
-
* Review updates cover their review's findings.
|
|
51
|
-
*
|
|
63
|
+
* Review updates cover their review's findings. The same group's verification, or a
|
|
64
|
+
* whole-plan verification, covers failed execution; a passing test run covers a failed
|
|
65
|
+
* test-failure fix. None covers a remediation agent's separate warnings or flakes.
|
|
52
66
|
*/
|
|
53
67
|
const RESOLVED_BY = {
|
|
54
68
|
"plan/plan-review": ["plan-apply-review"],
|
|
55
69
|
"design/design-review": ["design-apply-review"],
|
|
56
|
-
"build/build-plan-tasks": ["build-plan-verify"],
|
|
57
|
-
"build/build-plan-gaps-remediate": ["build-plan-verify"],
|
|
70
|
+
"build/build-plan-tasks": ["build-plan-verify", "build-plan-verify-holistic"],
|
|
71
|
+
"build/build-plan-gaps-remediate": ["build-plan-verify", "build-plan-verify-holistic"],
|
|
72
|
+
"build/build-plan-gaps-remediate-holistic": ["build-plan-verify-holistic"],
|
|
73
|
+
"build/build-failure-remediate": ["build-run-tests"],
|
|
74
|
+
"debug/debug-failure-remediate": ["debug-run-tests"],
|
|
75
|
+
};
|
|
76
|
+
/** Test-fix steps whose resolving run must have run the scope of the run the fix followed. */
|
|
77
|
+
const SAME_SCOPE = new Set(["build/build-failure-remediate", "debug/debug-failure-remediate"]);
|
|
78
|
+
/** Steps that check the whole run, so they answer a failure in any task group. */
|
|
79
|
+
const WHOLE_RUN = new Set(["build-plan-verify-holistic", "build-run-tests"]);
|
|
80
|
+
/**
|
|
81
|
+
* Whole-run checks that cover a failed check of any one group. A Decision Pause `Fix now`
|
|
82
|
+
* can put a group's fix in a new group, so that group is never verified again: the
|
|
83
|
+
* holistic verification judges every task, and the full test gate runs every group gate's suites.
|
|
84
|
+
*/
|
|
85
|
+
const RESOLVED_BY_RUN = {
|
|
86
|
+
"build/build-plan-verify": ["build-plan-verify-holistic"],
|
|
87
|
+
"build/build-group-gate": ["build-run-tests"],
|
|
88
|
+
"build/build-holistic-gate": ["build-run-tests"],
|
|
58
89
|
};
|
|
59
90
|
const RUN_TESTS = new Set(["build-run-tests", "debug-run-tests"]);
|
|
60
91
|
const SEVERITY = /\*\*Severity:\*\*\s*(CRITICAL|HIGH|MEDIUM|LOW)\b/;
|
|
@@ -66,6 +97,131 @@ const taskGroupOf = (r) => {
|
|
|
66
97
|
const taskGroup = r.group ?? r.subPlan;
|
|
67
98
|
return typeof taskGroup === "number" ? taskGroup : undefined;
|
|
68
99
|
};
|
|
100
|
+
const WARNING_FIELDS = [
|
|
101
|
+
"topic",
|
|
102
|
+
"gap",
|
|
103
|
+
"recommendedPath",
|
|
104
|
+
"alternativeEvidence",
|
|
105
|
+
"action",
|
|
106
|
+
];
|
|
107
|
+
/** Each field's length cap after folding to one line, in `WARNING_FIELDS` order. */
|
|
108
|
+
const WARNING_FIELD_MAX = [80, 80, 200, 400, 400];
|
|
109
|
+
/** Raw inputs (`*-input-N.md`) are untrusted: never a source of warnings. */
|
|
110
|
+
const isRawInput = (rel) => /(^|\/)[a-z-]*-?input-[^/]*$/.test(rel) ||
|
|
111
|
+
/(^|\/)related-(issues|failures|deferrals)\.md$/.test(rel) ||
|
|
112
|
+
/(^|\/)context-related-[^/]*$/.test(rel);
|
|
113
|
+
/** Text between the untrusted-content markers is external data: never a source of warnings. */
|
|
114
|
+
const stripUntrusted = (text) => {
|
|
115
|
+
const open = /^[^\n]*={5} BEGIN UNTRUSTED ={5}/m.exec(text);
|
|
116
|
+
if (!open)
|
|
117
|
+
return text;
|
|
118
|
+
// The fence ends at the LAST closing marker: any earlier closer inside the payload is forged.
|
|
119
|
+
const closers = [...text.matchAll(/^[^\n]*={5} END UNTRUSTED ={5}[^\n]*(?:\r?\n|$)/gm)].filter((m) => m.index >= open.index + open[0].length);
|
|
120
|
+
const last = closers.at(-1);
|
|
121
|
+
const end = last ? last.index + last[0].length : text.length;
|
|
122
|
+
return text.slice(0, open.index) + text.slice(end);
|
|
123
|
+
};
|
|
124
|
+
/**
|
|
125
|
+
* The top-level `{...}` objects in a fence body, in order. Each may span several lines (prettier
|
|
126
|
+
* rewrites a one-line record into that shape); braces inside strings are ignored. Text outside
|
|
127
|
+
* an object and an unterminated object are dropped.
|
|
128
|
+
*/
|
|
129
|
+
function jsonObjectChunks(body) {
|
|
130
|
+
const chunks = [];
|
|
131
|
+
let depth = 0;
|
|
132
|
+
let start = -1;
|
|
133
|
+
let inString = false;
|
|
134
|
+
let escaped = false;
|
|
135
|
+
for (let i = 0; i < body.length; i++) {
|
|
136
|
+
const ch = body[i];
|
|
137
|
+
if (inString) {
|
|
138
|
+
if (escaped)
|
|
139
|
+
escaped = false;
|
|
140
|
+
else if (ch === "\\")
|
|
141
|
+
escaped = true;
|
|
142
|
+
else if (ch === '"')
|
|
143
|
+
inString = false;
|
|
144
|
+
continue;
|
|
145
|
+
}
|
|
146
|
+
if (ch === '"' && depth > 0)
|
|
147
|
+
inString = true;
|
|
148
|
+
else if (ch === "{") {
|
|
149
|
+
if (depth === 0)
|
|
150
|
+
start = i;
|
|
151
|
+
depth++;
|
|
152
|
+
}
|
|
153
|
+
else if (ch === "}" && depth > 0) {
|
|
154
|
+
depth--;
|
|
155
|
+
if (depth === 0)
|
|
156
|
+
chunks.push(body.slice(start, i + 1));
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
if (depth > 0) {
|
|
160
|
+
// An unterminated object must not swallow the records after it: rescan after its first line.
|
|
161
|
+
const nl = body.indexOf("\n", start);
|
|
162
|
+
if (nl !== -1)
|
|
163
|
+
chunks.push(...jsonObjectChunks(body.slice(nl + 1)));
|
|
164
|
+
}
|
|
165
|
+
return chunks;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* The structured records under `## Documentation Warnings` (JSON objects, one per line or pretty-printed, in a
|
|
169
|
+
* `jsonl` fence) of the run's own step artifacts, merged by normalised topic and gap. A missing
|
|
170
|
+
* section, a malformed line or a record without all five non-empty fields is skipped. Each
|
|
171
|
+
* field is folded to one line and capped (`oneLine`), and the path loses its backticks, so a
|
|
172
|
+
* record cannot add lines or markup to the summary.
|
|
173
|
+
*/
|
|
174
|
+
function documentationWarnings(rows, read) {
|
|
175
|
+
const merged = new Map();
|
|
176
|
+
const seenFiles = new Set();
|
|
177
|
+
for (const row of rows) {
|
|
178
|
+
if (row.type !== "step-done")
|
|
179
|
+
continue;
|
|
180
|
+
for (const rel of artifactsOf(row)) {
|
|
181
|
+
if (!rel.endsWith(".md") || isRawInput(rel) || seenFiles.has(rel))
|
|
182
|
+
continue;
|
|
183
|
+
seenFiles.add(rel);
|
|
184
|
+
const raw = read(rel);
|
|
185
|
+
if (raw === null)
|
|
186
|
+
continue;
|
|
187
|
+
const text = stripUntrusted(raw);
|
|
188
|
+
const section = /^## Documentation Warnings[ \t]*\r?\n([\s\S]*?)(?=^## |(?![\s\S]))/m.exec(text);
|
|
189
|
+
const fence = section === null
|
|
190
|
+
? null
|
|
191
|
+
: /```jsonl[ \t]*\r?\n([\s\S]*?)(?:```|(?![\s\S]))/.exec(section[1]);
|
|
192
|
+
if (fence === null)
|
|
193
|
+
continue;
|
|
194
|
+
for (const chunk of jsonObjectChunks(fence[1])) {
|
|
195
|
+
const parsed = parseJson(chunk);
|
|
196
|
+
if (!parsed.ok)
|
|
197
|
+
continue;
|
|
198
|
+
const value = parsed.value;
|
|
199
|
+
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
200
|
+
continue;
|
|
201
|
+
const rec = value;
|
|
202
|
+
const fields = WARNING_FIELDS.map((f) => rec[f]);
|
|
203
|
+
if (!fields.every((f) => typeof f === "string" && f.trim() !== ""))
|
|
204
|
+
continue;
|
|
205
|
+
const [topic, gap, path, evidence, action] = fields.map((f, i) => oneLine(f, WARNING_FIELD_MAX[i]));
|
|
206
|
+
const recommendedPath = path.replace(/`/g, "").replace(/ {2,}/g, " ").trim();
|
|
207
|
+
const key = `${topic.toLowerCase()}\u0000${gap.toLowerCase()}`;
|
|
208
|
+
const found = merged.get(key) ?? {
|
|
209
|
+
topic: topic.toLowerCase(),
|
|
210
|
+
gap: gap.toLowerCase(),
|
|
211
|
+
recommendedPath: recommendedPath,
|
|
212
|
+
evidence: [],
|
|
213
|
+
actions: [],
|
|
214
|
+
};
|
|
215
|
+
if (!found.evidence.includes(evidence))
|
|
216
|
+
found.evidence.push(evidence);
|
|
217
|
+
if (!found.actions.includes(action))
|
|
218
|
+
found.actions.push(action);
|
|
219
|
+
merged.set(key, found);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
return [...merged.values()];
|
|
224
|
+
}
|
|
69
225
|
/** The run's step rows grouped per step (and task group), in first-seen order. */
|
|
70
226
|
function stepGroups(rows) {
|
|
71
227
|
const groups = new Map();
|
|
@@ -88,6 +244,22 @@ function stepGroups(rows) {
|
|
|
88
244
|
return [...groups.values()];
|
|
89
245
|
}
|
|
90
246
|
const lastOf = (g) => g.rows.at(-1);
|
|
247
|
+
const PAUSE_RULES = {
|
|
248
|
+
verify: {
|
|
249
|
+
loop: "Verify",
|
|
250
|
+
settles: ["build-plan-tasks", "build-plan-verify", "build-plan-gaps-remediate"],
|
|
251
|
+
grouped: true,
|
|
252
|
+
fixNow: true,
|
|
253
|
+
loopDecide: false,
|
|
254
|
+
},
|
|
255
|
+
holistic: {
|
|
256
|
+
loop: "Holistic verify",
|
|
257
|
+
settles: ["build-plan-verify-holistic", "build-plan-gaps-remediate-holistic"],
|
|
258
|
+
grouped: false,
|
|
259
|
+
fixNow: false,
|
|
260
|
+
loopDecide: true,
|
|
261
|
+
},
|
|
262
|
+
};
|
|
91
263
|
/** A level-2 section whose heading matches `title`, minus the template's non-content subsections. */
|
|
92
264
|
function planSection(text, title) {
|
|
93
265
|
const lines = text.split("\n");
|
|
@@ -150,10 +322,82 @@ export function buildSummary(input) {
|
|
|
150
322
|
const sev = SEVERITY.exec(t.text)?.[1];
|
|
151
323
|
fails.push(`Task ${t.task} not done (${t.path})${sev === undefined ? "" : ` — ${sev} challenge finding`}`);
|
|
152
324
|
}
|
|
325
|
+
// One rule for every verify and holistic pause (PAUSE_RULES): a pause answered in full
|
|
326
|
+
// settles the failed rows before it. Every gap is `Accept`, or (verify) a `Fix now` whose
|
|
327
|
+
// task was verified after the pause. An all-Accept pause whose `Source changed` header is
|
|
328
|
+
// present and not `false` settles nothing: source changed after the check the answers judged.
|
|
329
|
+
// The latest qualifying pause per task group (verify) or per run (holistic) settles.
|
|
330
|
+
const pauseSettled = new Set();
|
|
331
|
+
if (workflow === "build") {
|
|
332
|
+
const latest = new Map();
|
|
333
|
+
input.rows.forEach((row, index) => {
|
|
334
|
+
if (row.type !== "step-done" || row.step !== "build-decision")
|
|
335
|
+
return;
|
|
336
|
+
for (const rel of artifactsOf(row)) {
|
|
337
|
+
const text = read(rel);
|
|
338
|
+
if (text === null)
|
|
339
|
+
continue;
|
|
340
|
+
const header = decisionHeader(text);
|
|
341
|
+
const rule = PAUSE_RULES[header.From ?? ""];
|
|
342
|
+
if (rule === undefined)
|
|
343
|
+
continue;
|
|
344
|
+
const group = /^[0-9]+$/.test(header.Group ?? "") ? Number(header.Group) : undefined;
|
|
345
|
+
if (rule.grouped && group === undefined)
|
|
346
|
+
continue;
|
|
347
|
+
const items = parseDecisionItems(text);
|
|
348
|
+
const gaps = items.filter((i) => i.title !== rule.loop);
|
|
349
|
+
const loop = items.filter((i) => i.title === rule.loop);
|
|
350
|
+
if (gaps.length === 0)
|
|
351
|
+
continue;
|
|
352
|
+
const loopAnswered = (d) => rule.loopDecide ? /^Decide\b/.test(d ?? "") : d !== null;
|
|
353
|
+
if (!loop.every((i) => loopAnswered(i.decision)))
|
|
354
|
+
continue;
|
|
355
|
+
const fixes = rule.fixNow ? gaps.filter((i) => /^Fix now\b/.test(i.decision ?? "")) : [];
|
|
356
|
+
if (!gaps.every((i) => fixes.includes(i) || /^Accept\b/.test(i.decision ?? "")))
|
|
357
|
+
continue;
|
|
358
|
+
let how = "every item accepted";
|
|
359
|
+
if (fixes.length === 0) {
|
|
360
|
+
const source = header["Source changed"];
|
|
361
|
+
if (source !== undefined && source !== "false")
|
|
362
|
+
continue;
|
|
363
|
+
}
|
|
364
|
+
else {
|
|
365
|
+
const fixTasks = fixes.map((i) => tasks.find((t) => t.task === i.fixTask));
|
|
366
|
+
if (fixTasks.some((t) => t === undefined || !taskVerified(input, t, index)))
|
|
367
|
+
continue;
|
|
368
|
+
how = `task ${fixes.map((i) => i.fixTask).join(", ")} verified`;
|
|
369
|
+
}
|
|
370
|
+
const scope = rule.grouped ? `${header.From}#${group}` : String(header.From);
|
|
371
|
+
latest.set(scope, { rule, group: rule.grouped ? group : undefined, index, rel, how });
|
|
372
|
+
}
|
|
373
|
+
});
|
|
374
|
+
// Verify pauses list first, then holistic: the order the findings read in.
|
|
375
|
+
const pauses = Object.values(PAUSE_RULES).flatMap((rule) => [...latest.values()].filter((p) => p.rule === rule));
|
|
376
|
+
for (const pause of pauses)
|
|
377
|
+
for (const step of pause.rule.settles) {
|
|
378
|
+
const rows = input.rows
|
|
379
|
+
.map((row, index) => ({ row, index }))
|
|
380
|
+
.filter(({ row, index }) => row.type === "step-done" &&
|
|
381
|
+
row.step === step &&
|
|
382
|
+
(pause.group === undefined || taskGroupOf(row) === pause.group) &&
|
|
383
|
+
index < pause.index);
|
|
384
|
+
if (rows.at(-1)?.row.verdict !== "FAIL")
|
|
385
|
+
continue;
|
|
386
|
+
const label = pause.group === undefined ? step : `${step} (group ${pause.group})`;
|
|
387
|
+
resolvedFindings.push(`${label} FAIL, resolved by the Decision Pause (\`${pause.rel}\`), ${pause.how}`);
|
|
388
|
+
const g = pause.group === undefined
|
|
389
|
+
? groups.find((x) => x.step === step)
|
|
390
|
+
: groups.find((x) => x.key === `${step}#${pause.group}`);
|
|
391
|
+
if (g !== undefined && lastOf(g).index < pause.index)
|
|
392
|
+
pauseSettled.add(g.key);
|
|
393
|
+
}
|
|
394
|
+
}
|
|
153
395
|
for (const g of groups) {
|
|
154
396
|
const { row, index } = lastOf(g);
|
|
155
397
|
if (g.step === `${workflow}-summary`)
|
|
156
398
|
continue;
|
|
399
|
+
if (pauseSettled.has(g.key) && row.verdict === "FAIL")
|
|
400
|
+
continue;
|
|
157
401
|
if (RUN_TESTS.has(g.step)) {
|
|
158
402
|
if (row.verdict === "FAIL")
|
|
159
403
|
fails.push(`${g.label} FAIL`);
|
|
@@ -186,15 +430,24 @@ export function buildSummary(input) {
|
|
|
186
430
|
: review || row.verdict === "FAIL"
|
|
187
431
|
? (RESOLVED_BY[`${workflow}/${g.step}`] ?? [])
|
|
188
432
|
: [];
|
|
433
|
+
const runAnswers = row.verdict === "FAIL" ? (RESOLVED_BY_RUN[`${workflow}/${g.step}`] ?? []) : [];
|
|
189
434
|
const sub = taskGroupOf(row);
|
|
435
|
+
const needsScope = SAME_SCOPE.has(`${workflow}/${g.step}`);
|
|
436
|
+
const fixScope = needsScope
|
|
437
|
+
? input.rows.find((r) => r.type === "step-done" &&
|
|
438
|
+
RUN_TESTS.has(String(r.step)) &&
|
|
439
|
+
r.attempt === row.attempt &&
|
|
440
|
+
typeof r.scope === "string")?.scope
|
|
441
|
+
: undefined;
|
|
190
442
|
const answer = groups
|
|
191
443
|
.map(lastOf)
|
|
192
444
|
.find(({ row: r, index: i }) => i > index &&
|
|
193
|
-
answers.includes(String(r.step)) &&
|
|
445
|
+
(answers.includes(String(r.step)) || runAnswers.includes(String(r.step))) &&
|
|
194
446
|
(r.verdict === "PASS" || (review && r.verdict === "CONCERNS")) &&
|
|
195
447
|
(r.failures === undefined || r.failures === 0) &&
|
|
196
|
-
taskGroupOf(r) === sub &&
|
|
197
|
-
(!review || r.attempt === row.attempt)
|
|
448
|
+
(WHOLE_RUN.has(String(r.step)) || taskGroupOf(r) === sub) &&
|
|
449
|
+
(!review || r.attempt === row.attempt) &&
|
|
450
|
+
(!needsScope || (fixScope !== undefined && r.scope === fixScope)));
|
|
198
451
|
if (answer !== undefined && spike) {
|
|
199
452
|
const reports = artifactsOf(row).map((p) => read(p));
|
|
200
453
|
const unsettled = reports.map((report) => report === null ? undefined : planSection(report, /^## Unsettled\s*$/));
|
|
@@ -322,6 +575,22 @@ export function buildSummary(input) {
|
|
|
322
575
|
for (const { row } of runs)
|
|
323
576
|
out.push(`- Attempt ${String(row.attempt ?? "?")}: ${str(row.verdict) ?? "-"}, failures ${typeof row.failures === "number" ? row.failures : "-"}, ran \`${str(row.scope) ?? "unknown"}\``);
|
|
324
577
|
}
|
|
578
|
+
// Planned tests a later task took over (red entries with `from`), and the takeover tasks
|
|
579
|
+
// the build added itself (`build-takeover` rows).
|
|
580
|
+
if (workflow === "build") {
|
|
581
|
+
const handed = input.rows
|
|
582
|
+
.filter((r) => r.type === "step-done" && r.step === RED_STEP)
|
|
583
|
+
.flatMap((r) => redTestsOf(r))
|
|
584
|
+
.filter((t) => typeof t.from === "number");
|
|
585
|
+
const latest = new Map(handed.map((t) => [`${t.task}\0${t.test}\0${t.testName}`, t]));
|
|
586
|
+
const added = input.rows.filter((r) => r.type === "step-done" && r.step === TAKEOVER_STEP);
|
|
587
|
+
if (latest.size > 0 || added.length > 0)
|
|
588
|
+
out.push("", "## Tests that changed hands", "");
|
|
589
|
+
for (const t of latest.values())
|
|
590
|
+
out.push(`- TASK ${t.from} → TASK ${t.task}: \`${t.testName}\` ${handedWords(String(t.state))}`);
|
|
591
|
+
for (const r of added)
|
|
592
|
+
out.push(`- TASK ${String(r.task)} added by the build: takes over \`${oneLine(String(r.name))}\` in \`${oneLine(String(r.test))}\` from TASK ${String(r.from)} — ${oneLine(String(r.reason ?? ""))}`);
|
|
593
|
+
}
|
|
325
594
|
if (workflow === "plan") {
|
|
326
595
|
const final = input.plans.at(-1)?.text ?? "";
|
|
327
596
|
out.push("", "## Acceptance Scenario", "", planSection(final, /Acceptance Scenario/) || "None", "", "## Open Questions", "", planSection(final, /Open Questions/) || "None");
|
|
@@ -340,6 +609,18 @@ export function buildSummary(input) {
|
|
|
340
609
|
}
|
|
341
610
|
if (unconfirmed.length > 0)
|
|
342
611
|
out.push("", "## Ship Completed with Assumed Items", "", "Accepted without the owner and not confirmed; each is a `needs-decision` deferral.", "", ...unconfirmed.map((u) => `- ${u}`));
|
|
612
|
+
// Documentation warnings: advisory only, never part of the verdict.
|
|
613
|
+
const docWarnings = documentationWarnings(input.rows, read);
|
|
614
|
+
if (docWarnings.length > 0) {
|
|
615
|
+
out.push("", "## Documentation Warnings", "");
|
|
616
|
+
for (const w of docWarnings) {
|
|
617
|
+
out.push(`- **${w.topic}** (${w.gap}) — \`${w.recommendedPath}\``);
|
|
618
|
+
for (const e of w.evidence)
|
|
619
|
+
out.push(` - Evidence: ${e}`);
|
|
620
|
+
for (const a of w.actions)
|
|
621
|
+
out.push(` - Action: ${a}`);
|
|
622
|
+
}
|
|
623
|
+
}
|
|
343
624
|
// Risks and action items.
|
|
344
625
|
const items = [];
|
|
345
626
|
for (const g of groups) {
|