@cbartens/bkit 6.1.0 → 6.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.bkit/README.md +14 -12
- package/.bkit/core/.agents/docs.md +1 -11
- package/.bkit/core/.agents/plugins/bkit/hooks/bkit-gateguard.cjs +30 -9
- package/.bkit/core/.agents/plugins/bkit/hooks/bkit-guardrails.cjs +25 -27
- package/.bkit/core/.agents/rules.md +22 -9
- package/.bkit/core/.bkit/README.md +13 -11
- package/.bkit/core/.bkit/authoring.md +58 -13
- package/.bkit/core/.bkit/cli.md +43 -33
- package/.bkit/core/.bkit/cloud.md +93 -30
- package/.bkit/core/.bkit/install.md +55 -16
- package/.bkit/core/.bkit/jsonl.md +24 -7
- package/.bkit/core/.bkit/pipeline.md +8 -8
- package/.bkit/core/.bkit/prompts.md +160 -43
- package/.bkit/core/.bkit/providers.md +99 -36
- package/.bkit/core/.bkit/templates.md +167 -37
- package/.bkit/core/.bkit/trackers.md +39 -6
- package/.bkit/core/.bkit/workflows.md +344 -136
- package/.bkit/core/.claude/hooks/bkit-guardrails.cjs +50 -27
- package/.bkit/core/.claude/hooks/bkit-preflight.sh +11 -11
- package/.bkit/core/.codex/hooks/bkit-gateguard.cjs +13 -8
- package/.bkit/core/.codex/hooks/bkit-guardrails.cjs +14 -25
- package/.bkit/core/.cursor/hooks/bkit-guardrails.cjs +20 -9
- package/.bkit/core/.cursor/hooks/bkit-preflight.sh +8 -8
- package/.bkit/core/.opencode/plugin/bkit-gateguard.js +14 -4
- package/.bkit/core/.opencode/plugin/bkit-guardrails.js +114 -0
- package/.bkit/core/docs/templates/bkit-audit-accessibility.md +1 -1
- package/.bkit/core/docs/templates/bkit-audit-adoption.md +30 -6
- package/.bkit/core/docs/templates/bkit-audit-agents.md +1 -1
- package/.bkit/core/docs/templates/bkit-audit-aio-seo.md +1 -1
- package/.bkit/core/docs/templates/bkit-audit-analytics.md +1 -1
- package/.bkit/core/docs/templates/bkit-audit-annotations.md +1 -1
- package/.bkit/core/docs/templates/bkit-audit-app-performance.md +1 -1
- package/.bkit/core/docs/templates/bkit-audit-app-store.md +1 -1
- package/.bkit/core/docs/templates/bkit-audit-architecture.md +1 -1
- package/.bkit/core/docs/templates/bkit-audit-ci-performance.md +2 -2
- package/.bkit/core/docs/templates/bkit-audit-config.md +3 -2
- package/.bkit/core/docs/templates/bkit-audit-cost.md +1 -1
- package/.bkit/core/docs/templates/bkit-audit-coverage.md +1 -1
- package/.bkit/core/docs/templates/bkit-audit-database.md +3 -3
- package/.bkit/core/docs/templates/bkit-audit-dead-code.md +1 -1
- package/.bkit/core/docs/templates/bkit-audit-deferrals.md +1 -1
- package/.bkit/core/docs/templates/bkit-audit-dependencies.md +3 -3
- package/.bkit/core/docs/templates/bkit-audit-documentation.md +32 -2
- package/.bkit/core/docs/templates/bkit-audit-duplication.md +1 -1
- package/.bkit/core/docs/templates/bkit-audit-failures.md +1 -1
- package/.bkit/core/docs/templates/bkit-audit-flakes.md +2 -2
- package/.bkit/core/docs/templates/bkit-audit-gates.md +5 -3
- package/.bkit/core/docs/templates/bkit-audit-issues.md +1 -1
- package/.bkit/core/docs/templates/bkit-audit-llm.md +2 -2
- package/.bkit/core/docs/templates/bkit-audit-logs.md +1 -1
- package/.bkit/core/docs/templates/bkit-audit-models.md +2 -2
- package/.bkit/core/docs/templates/bkit-audit-privacy.md +1 -1
- package/.bkit/core/docs/templates/bkit-audit-prompts.md +1 -1
- package/.bkit/core/docs/templates/bkit-audit-red-team.md +2 -2
- package/.bkit/core/docs/templates/bkit-audit-reliability.md +3 -2
- package/.bkit/core/docs/templates/bkit-audit-repo.md +1 -1
- package/.bkit/core/docs/templates/bkit-audit-security.md +1 -1
- package/.bkit/core/docs/templates/bkit-audit-slop.md +1 -1
- package/.bkit/core/docs/templates/bkit-audit-testing.md +3 -2
- package/.bkit/core/docs/templates/bkit-audit-usability.md +1 -1
- package/.bkit/core/docs/templates/bkit-plan.md +38 -8
- package/.bkit/core/engine/checks/after/auth.ts +118 -47
- package/.bkit/core/engine/checks/after/github.ts +161 -37
- package/.bkit/core/engine/checks/after/index.ts +18 -3
- package/.bkit/core/engine/checks/after/tools.ts +245 -1
- package/.bkit/core/engine/checks/before/files.ts +59 -1
- package/.bkit/core/engine/checks/before/index.ts +8 -0
- package/.bkit/core/engine/checks/status-holes.ts +20 -26
- package/.bkit/core/engine/checks/tips/catalogue.ts +107 -10
- package/.bkit/core/engine/checks/tips/detect.ts +36 -3
- package/.bkit/core/engine/checks/tips/index.ts +1 -1
- package/.bkit/core/engine/cli.ts +13 -13
- package/.bkit/core/engine/commands/ci/ci.ts +124 -19
- package/.bkit/core/engine/commands/ci/push-gate.ts +101 -43
- package/.bkit/core/engine/commands/install/doctor.ts +5 -5
- package/.bkit/core/engine/commands/install/install.ts +28 -25
- package/.bkit/core/engine/commands/install/uninstall.ts +42 -30
- package/.bkit/core/engine/commands/install/upgrade.ts +14 -2
- package/.bkit/core/engine/commands/land.ts +2 -3
- package/.bkit/core/engine/commands/lib.ts +394 -39
- package/.bkit/core/engine/commands/registry.ts +1 -1
- package/.bkit/core/engine/commands/workflow/branches.ts +351 -78
- package/.bkit/core/engine/commands/workflow/challenge.ts +63 -14
- package/.bkit/core/engine/commands/workflow/context.ts +71 -10
- package/.bkit/core/engine/commands/workflow/counters.ts +298 -23
- package/.bkit/core/engine/commands/workflow/decisions.ts +260 -125
- package/.bkit/core/engine/commands/workflow/disk.ts +2 -1
- package/.bkit/core/engine/commands/workflow/feature-base.ts +66 -0
- package/.bkit/core/engine/commands/workflow/issues.ts +312 -17
- package/.bkit/core/engine/commands/workflow/junit.ts +204 -0
- package/.bkit/core/engine/commands/workflow/ledgers.ts +904 -99
- package/.bkit/core/engine/commands/workflow/locks.ts +186 -29
- package/.bkit/core/engine/commands/workflow/loops.ts +87 -0
- package/.bkit/core/engine/commands/workflow/open-decision.ts +251 -0
- package/.bkit/core/engine/commands/workflow/plan-blocks.ts +8 -0
- package/.bkit/core/engine/commands/workflow/plans.ts +1 -1
- package/.bkit/core/engine/commands/workflow/prs.ts +311 -16
- package/.bkit/core/engine/commands/workflow/repo.ts +1 -1
- package/.bkit/core/engine/commands/workflow/run-facts.ts +6 -0
- package/.bkit/core/engine/commands/workflow/runs.ts +877 -174
- package/.bkit/core/engine/commands/workflow/runtime.ts +12 -4
- package/.bkit/core/engine/commands/workflow/status.ts +324 -11
- package/.bkit/core/engine/commands/workflow/step-table.ts +41 -15
- package/.bkit/core/engine/commands/workflow/steps.ts +604 -29
- package/.bkit/core/engine/commands/workflow/summary-findings.ts +1 -1
- package/.bkit/core/engine/commands/workflow/summary.ts +314 -8
- package/.bkit/core/engine/commands/workflow/tasks.ts +400 -27
- package/.bkit/core/engine/commands/workflow/tests-base.ts +319 -0
- package/.bkit/core/engine/commands/workflow/tests-changed.ts +138 -74
- package/.bkit/core/engine/commands/workflow/tests-jump.ts +93 -0
- package/.bkit/core/engine/commands/workflow/tests.ts +815 -182
- package/.bkit/core/engine/commands/workflow/tracker.ts +1134 -137
- package/.bkit/core/engine/commands/workflow/workflows.ts +100 -72
- package/.bkit/core/engine/commands/workflow/worktrees.ts +421 -57
- package/.bkit/core/engine/install/cloud-env.ts +38 -10
- package/.bkit/core/engine/install/managed-block.ts +105 -0
- package/.bkit/core/engine/install/manifest.ts +7 -1
- package/.bkit/core/engine/install/modules/claude.ts +6 -2
- package/.bkit/core/engine/install/modules/cloud.ts +84 -95
- package/.bkit/core/engine/install/modules/codex.ts +10 -2
- package/.bkit/core/engine/install/modules/core.ts +202 -26
- package/.bkit/core/engine/install/modules/opencode.ts +18 -23
- package/.bkit/core/engine/install/network-allowlist.ts +8 -3
- package/.bkit/core/engine/install/project-docs.ts +650 -0
- package/.bkit/core/engine/install/template-copies.ts +58 -5
- package/.bkit/core/engine/install/write.ts +128 -7
- package/.bkit/core/engine/ledgers/journal.ts +18 -10
- package/.bkit/core/engine/ledgers/migrate.ts +20 -8
- package/.bkit/core/engine/ledgers/status.ts +604 -8
- package/.bkit/core/engine/ledgers/telemetry.ts +115 -13
- package/.bkit/core/engine/render/trackers.ts +46 -11
- package/.bkit/core/engine/shared/package-manager.ts +7 -3
- package/.bkit/core/engine/shared/settings.ts +12 -1
- package/.bkit/core/engine/shared/text.ts +14 -0
- package/.bkit/core/engine/tools/instructions-sources.ts +1 -0
- package/.bkit/core/engine/tools/instructions.ts +116 -20
- package/.bkit/core/hooks/antigravity-hook.js +20 -4
- package/.bkit/core/hooks/gateguard-edit-payload.js +8 -5
- package/.bkit/core/hooks/gateguard-engine.js +249 -23
- package/.bkit/core/hooks/guardrails-deny.js +167 -0
- package/.bkit/core/hooks/guardrails-read.js +3 -3
- package/.bkit/core/hooks/guardrails-shell.js +1122 -167
- package/.bkit/core/hooks/guardrails-tiers.js +247 -176
- package/.bkit/core/hooks/preflight-tracker.sh +219 -0
- package/.bkit/core/prompts/bkit-audit-generate.md +23 -6
- package/.bkit/core/prompts/bkit-build-challenge-1.md +5 -4
- package/.bkit/core/prompts/bkit-build-challenge-2.md +6 -5
- package/.bkit/core/prompts/bkit-build-install-skills.md +2 -2
- package/.bkit/core/prompts/bkit-build-plan-convert.md +21 -7
- package/.bkit/core/prompts/bkit-build-plan-current.md +5 -4
- package/.bkit/core/prompts/bkit-build-plan-gaps-remediate.md +22 -17
- package/.bkit/core/prompts/bkit-build-plan-tasks.md +16 -12
- package/.bkit/core/prompts/bkit-build-plan-tests.md +14 -10
- package/.bkit/core/prompts/bkit-build-plan-verify.md +21 -8
- package/.bkit/core/prompts/bkit-debug-abort-handover.md +10 -5
- package/.bkit/core/prompts/bkit-debug-failure-diagnose.md +22 -6
- package/.bkit/core/prompts/bkit-debug-failure-remediate.md +19 -3
- package/.bkit/core/prompts/bkit-debug-failure-reproduce.md +22 -6
- package/.bkit/core/prompts/bkit-debug-failure-soak.md +10 -7
- package/.bkit/core/prompts/bkit-design-brainstorm-ideate-1.md +3 -3
- package/.bkit/core/prompts/bkit-design-brainstorm-ideate-2.md +4 -4
- package/.bkit/core/prompts/bkit-design-brainstorm-ideate-3.md +3 -3
- package/.bkit/core/prompts/bkit-design-generate.md +6 -4
- package/.bkit/core/prompts/bkit-design-organise.md +4 -3
- package/.bkit/core/prompts/bkit-design-review-1.md +5 -4
- package/.bkit/core/prompts/bkit-design-review-2.md +6 -5
- package/.bkit/core/prompts/bkit-design-spike.md +4 -3
- package/.bkit/core/prompts/bkit-design-update.md +6 -4
- package/.bkit/core/prompts/bkit-plan-generate.md +35 -14
- package/.bkit/core/prompts/bkit-plan-review-1.md +9 -7
- package/.bkit/core/prompts/bkit-plan-review-2.md +9 -7
- package/.bkit/core/prompts/bkit-plan-scope-check.md +8 -6
- package/.bkit/core/prompts/bkit-plan-update.md +22 -8
- package/.bkit/core/prompts/bkit-ship-conflict-resolve.md +11 -8
- package/.bkit/core/prompts/bkit-ship-deferred-sweep.md +9 -5
- package/.bkit/core/prompts/bkit-ship-update-docs.md +26 -4
- package/.bkit/core/prompts/bkit-utility-compress-markdown.md +3 -3
- package/.bkit/core/prompts/bkit-utility-update-decisions.md +10 -7
- package/.bkit/core/prompts/bkit-utility-update-deferrals.md +8 -5
- package/.bkit/core/prompts/bkit-utility-update-documentation.md +31 -7
- package/.bkit/core/prompts/bkit-utility-update-failures.md +8 -5
- package/.bkit/core/prompts/bkit-utility-update-knowledge.md +10 -7
- package/.bkit/core/prompts/bkit-utility-update-roadmap.md +4 -4
- package/.bkit/core/prompts/bkit-utility-update-tracker.md +4 -4
- package/.bkit/core/workflows/bkit-auto.md +23 -11
- package/.bkit/core/workflows/bkit-build.md +331 -100
- package/.bkit/core/workflows/bkit-debug.md +135 -64
- package/.bkit/core/workflows/bkit-design.md +58 -32
- package/.bkit/core/workflows/bkit-plan.md +73 -45
- package/.bkit/core/workflows/bkit-ship.md +233 -167
- package/.bkit/shared/.agents/plugins/bkit/hooks.json +1 -1
- package/.bkit/shared/.bkit/.env.example +5 -0
- package/.bkit/shared/.claude/bkit-cloud.md +7 -7
- package/.bkit/shared/.claude/settings.json +5 -1
- package/.bkit/shared/.cursor/bkit-cloud.md +1 -1
- package/.bkit/shared/.cursor/hooks.json +1 -1
- package/.bkit/shared/.opencode/opencode.json +11 -2
- package/.bkit/templates/.claude/hooks/bkit-cloud-bootstrap.sh +27 -0
- package/.bkit/templates/.cursor/Dockerfile +7 -7
- package/.bkit/templates/.github/ISSUE_TEMPLATE/bkit-idea.yml +1 -1
- package/.bkit/templates/.github/dependabot.yml +5 -0
- package/.bkit/templates/.github/renovate.json5 +5 -3
- package/.bkit/templates/.github/workflows/bkit-ci.yml +11 -11
- package/.bkit/templates/.github/workflows/bkit-cloud.yml +525 -161
- package/.bkit/templates/.github/workflows/bkit-renovate.yml +2 -2
- package/.bkit/templates/.husky/pre-push +123 -6
- package/.bkit/templates/context/bkit-serena.md +1 -1
- package/.bkit/templates/context/bkit-vercel.md +103 -59
- package/.bkit/templates/docs/architecture.md +98 -0
- package/.bkit/templates/docs/capabilities.md +33 -37
- package/.bkit/templates/docs/components.md +142 -0
- package/.bkit/templates/docs/data-schema.md +87 -0
- package/.bkit/{shared → templates}/docs/deployments.md +128 -142
- package/.bkit/templates/docs/design.md +117 -0
- package/.bkit/templates/docs/noise.md +54 -0
- package/.bkit/templates/docs/observability.md +99 -0
- package/.bkit/templates/docs/security.md +137 -0
- package/.bkit/templates/docs/setup.md +93 -0
- package/.bkit/templates/docs/technology.md +70 -0
- package/.bkit/{shared → templates}/docs/testing.md +200 -87
- package/.bkit/templates/scripts/ci/bkit-check-accepted-divergences.mjs +1 -6
- package/.bkit/templates/scripts/ci/bkit-machine-lock.sh +511 -103
- package/.bkit/templates/scripts/ci/bkit-test-awake.mjs +314 -28
- package/.bkit/templates/scripts/ci/bkit-test-awake.test.mjs +500 -1
- package/.bkit/templates/scripts/graphify/bkit-graphify-graphml.py +1 -1
- package/.bkit/templates/scripts/graphify/bkit-graphify-rollup.py +91 -62
- package/.bkit/templates/scripts/graphify/bkit-graphify.sh +59 -11
- package/.bkit/templates/slop-scan.config.json +2 -0
- package/CHANGELOG.md +79 -0
- package/DETAILS.md +661 -0
- package/README.md +73 -604
- package/dist/checks/after/auth.js +114 -46
- package/dist/checks/after/github.js +138 -35
- package/dist/checks/after/index.js +16 -4
- package/dist/checks/after/tools.js +224 -1
- package/dist/checks/before/files.js +59 -1
- package/dist/checks/before/index.js +7 -1
- package/dist/checks/status-holes.js +20 -21
- package/dist/checks/tips/catalogue.js +99 -10
- package/dist/checks/tips/detect.js +35 -3
- package/dist/checks/tips/index.js +1 -1
- package/dist/cli.js +13 -13
- package/dist/commands/ci/ci.js +113 -20
- package/dist/commands/ci/push-gate.js +79 -44
- package/dist/commands/install/doctor.js +5 -5
- package/dist/commands/install/install.js +23 -22
- package/dist/commands/install/uninstall.js +36 -30
- package/dist/commands/install/upgrade.js +10 -2
- package/dist/commands/land.js +2 -3
- package/dist/commands/lib.js +323 -25
- package/dist/commands/workflow/branches.js +312 -72
- package/dist/commands/workflow/challenge.js +66 -13
- package/dist/commands/workflow/context.js +46 -10
- package/dist/commands/workflow/counters.js +231 -23
- package/dist/commands/workflow/decisions.js +221 -106
- package/dist/commands/workflow/disk.js +2 -1
- package/dist/commands/workflow/feature-base.js +60 -0
- package/dist/commands/workflow/issues.js +243 -15
- package/dist/commands/workflow/junit.js +137 -0
- package/dist/commands/workflow/ledgers.js +726 -112
- package/dist/commands/workflow/locks.js +150 -29
- package/dist/commands/workflow/loops.js +67 -0
- package/dist/commands/workflow/open-decision.js +199 -0
- package/dist/commands/workflow/plan-blocks.js +6 -0
- package/dist/commands/workflow/plans.js +1 -1
- package/dist/commands/workflow/prs.js +272 -16
- package/dist/commands/workflow/repo.js +1 -1
- package/dist/commands/workflow/run-facts.js +6 -0
- package/dist/commands/workflow/runs.js +747 -155
- package/dist/commands/workflow/runtime.js +8 -4
- package/dist/commands/workflow/status.js +259 -13
- package/dist/commands/workflow/step-table.js +41 -15
- package/dist/commands/workflow/steps.js +530 -26
- package/dist/commands/workflow/summary-findings.js +1 -1
- package/dist/commands/workflow/summary.js +289 -8
- package/dist/commands/workflow/tasks.js +294 -27
- package/dist/commands/workflow/tests-base.js +266 -0
- package/dist/commands/workflow/tests-changed.js +130 -56
- package/dist/commands/workflow/tests-jump.js +77 -0
- package/dist/commands/workflow/tests.js +608 -131
- package/dist/commands/workflow/tracker.js +920 -112
- package/dist/commands/workflow/workflows.js +80 -59
- package/dist/commands/workflow/worktrees.js +387 -58
- package/dist/install/cloud-env.js +32 -10
- package/dist/install/managed-block.js +101 -0
- package/dist/install/manifest.js +7 -1
- package/dist/install/modules/claude.js +6 -2
- package/dist/install/modules/cloud.js +73 -86
- package/dist/install/modules/codex.js +9 -2
- package/dist/install/modules/core.js +190 -27
- package/dist/install/modules/opencode.js +18 -23
- package/dist/install/network-allowlist.js +8 -3
- package/dist/install/project-docs.js +551 -0
- package/dist/install/template-copies.js +55 -5
- package/dist/install/write.js +117 -5
- package/dist/ledgers/journal.js +10 -8
- package/dist/ledgers/migrate.js +20 -9
- package/dist/ledgers/status.js +461 -8
- package/dist/ledgers/telemetry.js +71 -13
- package/dist/render/trackers.js +21 -12
- package/dist/shared/package-manager.js +7 -2
- package/dist/shared/settings.js +8 -0
- package/dist/shared/text.js +13 -0
- package/dist/tools/instructions-sources.js +1 -0
- package/dist/tools/instructions.js +97 -24
- package/package.json +23 -15
- package/.bkit/core/hooks/preflight-linear.sh +0 -73
- package/.bkit/shared/docs/architecture.md +0 -16
- package/.bkit/shared/docs/data-schema.md +0 -16
- package/.bkit/shared/docs/design.md +0 -38
- package/.bkit/shared/docs/noise.md +0 -20
- package/.bkit/shared/docs/observability.md +0 -22
- package/.bkit/shared/docs/security.md +0 -62
- package/.bkit/shared/docs/setup.md +0 -52
- package/.bkit/shared/docs/technology.md +0 -15
- /package/.bkit/templates/{.lintstagedrc.json → lintstagedrc.example.json} +0 -0
- /package/.bkit/templates/{.prettierignore → prettierignore.example} +0 -0
|
@@ -13,7 +13,7 @@ description: "Build Feature — Autonomous implementation"
|
|
|
13
13
|
- **Order:** Execute steps sequentially unless stated otherwise.
|
|
14
14
|
- **No improv:** Skip no step, and add no step of your own; how deeply you investigate within a step is your call.
|
|
15
15
|
- **Narrate:** Emit user-visible lines at key points (step start, subagent return, pivot, blocker). After each completed numbered step, show its printed `progressLine` word for word as plain text outside code blocks. Show each completed row's line once; delayed bookkeeping and repeated validation gates add no second line. `/bkit-auto` shows its delegated workflow's lines. Headless runs show the same lines without waiting for acknowledgement. Silence between actions = compliance regression; Auto-apply does not mean silent.
|
|
16
|
-
- **Failures:** Apply explicit recovery routes, including **Sandbox recovery
|
|
16
|
+
- **Failures:** Apply explicit recovery routes, including **Sandbox recovery**, **Read-only helper recovery** and **Bounded correction**, before **Failure Path**.
|
|
17
17
|
- **If** a step, tool or command still fails, or a gate cannot pass → **Failure Path**.
|
|
18
18
|
- **Sandbox recovery:** **If** the host reports a sandbox or permission denial:
|
|
19
19
|
- Retry the same operation once through the host's approval mechanism only when permitted.
|
|
@@ -34,40 +34,73 @@ description: "Build Feature — Autonomous implementation"
|
|
|
34
34
|
- **Recovery scope:** Repository code, bkit commands, test and gate failures keep their explicit recovery or failure routes.
|
|
35
35
|
- **Placeholders:** Assert `{PLACEHOLDERS}` such as `{FID}`, `{YYYYMM}`, etc non-empty if required before making tool calls<!-- bkit:tracker true start --> (`{ISSUE_ID}` may be empty)<!-- bkit:tracker true end -->. **Else** → **Failure Path**.
|
|
36
36
|
- **Commands:** Blocks run `"{BKIT}" <noun> <verb> --flag=value`; `{BKIT}` = `bkit` printed by Step 1 `repo info`, until then `"$(dirname "$(git rev-parse --path-format=absolute --git-common-dir)")/node_modules/.bin/bkit"`. Stdout is `key: value` lines, nested keys indented under their parent (`a.b` = `b` under `a:`), lists of rows as tables: hold named keys under bare `UPPER_SNAKE` names, a `"quoted"` value without its quotes, and write a held name as `{VAR}` where it goes into a command or a `Context:` / `Read:` / `Create:` line. Exit non-zero with no `Route:` or recovery under **Failures** → **Failure Path**; exit 80 → mapped MCP tool (**gh MCP fallback**); exit 81 → end turn, re-run block. A flag still holding a literal `{PLACEHOLDER}` exits 2.
|
|
37
|
-
- **CI wait turn-loop:** **If** a `bkit runs dispatch` block exits 81 (runtime cannot wait) or 80 (`gh` unavailable) → resolve the poll in the agent turn loop
|
|
37
|
+
- **CI wait turn-loop:** **If** a `bkit runs dispatch` block exits 81 (runtime cannot wait) or 80 (`gh` unavailable) → resolve the poll in the agent turn loop. Pass `--invocation="{INVOCATION}"` on every run of the block. Each orchestrator turn run once `bkit runs wait --pr={PR_NUMBER} --once` (on exit 80 read the PR's checks via `pull_request_read` instead), then record what it saw with `bkit runs handoff --invocation="{INVOCATION}" --repo={OWNER_REPO} --pr={PR_NUMBER} --head=<printed head> --branch={BRANCH} --result=<none|pending|success|failure|provider-error> --polls=1`. Follow the printed `nextAction`: `poll-again` → end turn and repeat; `retrigger`, `reconcile-retrigger` or `verdict` → re-run the block. The engine derives the attempts, errors and re-trigger state from the persisted rows; never supply a counter.
|
|
38
|
+
- **Bounded correction:** **If** a bkit command fails with a structured error that declares effects = none and correctable = true (a guaranteed no-write rejection, checked by the engine fill before any write) → correct only what the error names, and retry with `--correction-of=<the rejected --operation>` and a fresh `--operation`. Allow two corrected retries per printed `scope`; a replay of a counted operation spends nothing. After a verified retry (`correction.verified`) resume the same sub-step. **If** the error reports uncertain effects → reconcile first by re-running the original `--operation`, and make no corrected candidate until that settles. A stricter command-specific route or limit wins over this allowance. Authorization failures, gate and check failures, exhausted budgets and unverified retries keep **Failure Path**.
|
|
39
|
+
- **Deterministic bookkeeping:** Use the engine's validated execution context and artifact data for metadata, counts, paths and serialization. Agents supply substantive findings and judgments. Do not invent missing attribution or replace conflicting evidence with a guess.
|
|
40
|
+
- **Recoverable execution errors:** Apply the command's explicit recovery route first. If validation guarantees that no changes were made, correct the input from verified evidence and retry at most twice. Keep this correction budget across helper rewrites, tool switches and resume. Verify the required outputs and continue from the interrupted sub-step after success.
|
|
41
|
+
- **Uncertain effects:** Inspect and reconcile the operation's durable state before retrying a write. Retry only when the engine can establish that it will not duplicate or corrupt an effect. Preserve work and report a blocker when the outcome cannot be established.
|
|
42
|
+
- **Failure boundary:** Enter Failure Path when the applicable recovery budget is exhausted, a required check still fails, required information or authorization is unavailable, or recovery cannot proceed safely. Recovery does not permit weakening tests, bypassing gates or granting approval. A recovered command error alone does not fail the workflow.
|
|
43
|
+
- **Recovery precedence:** A specific recovery route supplies its own limit and eligibility before the generic two-correction route. Optional model telemetry unavailability is diagnostic, while missing author or run authority or required substantive evidence blocks the affected action. A permission escalation follows its existing authorization policy, never the generic correction allowance.
|
|
38
44
|
|
|
39
45
|
**Contract:** The terms between this agent and whoever runs it.
|
|
40
46
|
|
|
41
47
|
- **Friction:** Watch own context and subagent returns for manual installs, agent rework, repeated tool failures, destructive backouts → append rows to `.bkit/friction.jsonl` with `bkit ledgers append` (`.bkit/jsonl.md` § Write Idiom) → continue or escalate; `status row --type=owner-pause` logs each owner pause itself, so do not log one; logging does not replace **Failure Path**.
|
|
42
48
|
- **Finish:** `bkit steps finish` reads each `--agent`'s header from the `--artifact` in the same position, derives the attempt (`--attempt-of`; `<attempt>` in a path or message becomes it), checks artifacts and row, writes the row, commits, prints `comment`. Exit 5 **or** 6 → invoke `reask.agent` again with `"Your prior output '<reask.artifact>' has an invalid header. Re-emit only its header fields + '<!-- verdict:end -->' at top of that file. Do not redo work."` → wait for subagent and re-run the block → **If** still non-zero → **Failure Path**. Exit 8 → nothing written, nothing committed: fix what the hook's message names, then re-run this block — the step's attempt is unchanged. Hold `verdict` as the step's verdict, `fields` as its other header fields, `attempt` as its attempt.
|
|
43
|
-
- **Resume:** After Step 2, `"{BKIT}" status resume --workflow=build --file="{STATUS}"` names where the active `IN_PROGRESS` run picks up — after its last `DONE` step; Steps 1-2
|
|
44
|
-
-
|
|
49
|
+
- **Resume:** After Step 2, `"{BKIT}" status resume --workflow=build --file="{STATUS}"` names where the active `IN_PROGRESS` run picks up — after its last `DONE` step; Steps 1-2 run again on every resume, and rows of steps this workflow no longer has are ignored → continue at Step `number`.
|
|
50
|
+
- Hold `challengeRound` as `CHALLENGE_ROUND` and `challengeDone` as `CHALLENGE_DONE`.
|
|
51
|
+
- **If** `group` non-null → hold it as `GROUP`.
|
|
52
|
+
- Route — first match wins:
|
|
53
|
+
- **If** Step 2's `workflows start --session-dir="{SESSION_DIR}"` printed `openDecision` != null → the **Open decision** steps below.
|
|
54
|
+
- **If** `step` = `build-plan-gaps-remediate-holistic` → Step 10 sub-step 9.
|
|
55
|
+
- **If** `after` = `build-challenge` → Step 11 sub-step 1's `counters max --point=build.challenge` block (hold `value` as `CHALLENGE_MAX`), then sub-step 2, then sub-step 5.
|
|
56
|
+
- **Else** → Step `number`.
|
|
57
|
+
- **Open decision:** `openDecision` is a decision file with `Status: OPEN`, or a `DECIDED` / `ASSUMED` one that no `build-decision` row names, because the run stopped after **Decision Pause** step 6 wrote the answers. Resume from it:
|
|
58
|
+
1. Hold its `decision` as `DECISION`, `question` as `PAUSE_QUESTION`, `pauseStep` as `PAUSE_STEP`, `group` as `GROUP`, `verifyAttempt` as `VERIFY_ATTEMPT`, `testAttempt` as `TEST_ATTEMPT` and `sourceChanged` as `SOURCE_CHANGED` (null stays unset).
|
|
59
|
+
2. Set `PAUSE_POINT` = `build.{from}`.
|
|
60
|
+
3. **If** `from` = `challenge` → restore the round's tasks:
|
|
61
|
+
- Run Step 11 sub-step 1's `counters max --point=build.challenge` block (hold `value` as `CHALLENGE_MAX`).
|
|
62
|
+
- Run Step 11 sub-steps 2 and 5. The merge finds its tasks already in the plan, writes nothing and prints the round's open tasks.
|
|
63
|
+
- Hold `fixTasks` as `CHALLENGE_TASKS`.
|
|
64
|
+
- NEVER go on to Step 11 sub-step 6, because the open pause decides the route.
|
|
65
|
+
4. Route on the `gateRerun` that `status resume` printed. It is true when the open pause only asks to try a red gate again:
|
|
66
|
+
- **If** `gateRerun` = true → the **Gate rerun** steps below.
|
|
67
|
+
- **Else** → **Decision Pause** step 3.
|
|
68
|
+
- **Gate rerun:** Skip **Decision Pause** step 3 and re-run the gate, with no `counters grant`:
|
|
69
|
+
1. Set `DECISION_ROUTE` = `rerunFrom`.
|
|
70
|
+
2. Run § Pending takeovers.
|
|
71
|
+
3. Run **Decision Pause** step 6's `steps finish --step=build-decision` block.
|
|
72
|
+
4. Run `"{BKIT}" decisions apply --by=rerun --file="docs/plans/{YYYYMM}/logs/{FID}/build-decision-{RUN}-{DECISION}.md"`. It runs after sub-step 3, so an interruption between them leaves the pause `OPEN` and the next resume re-runs the gate again.
|
|
73
|
+
5. Route:
|
|
74
|
+
- **If** `rerunFrom` = `verify` → `VERIFY_VERDICT` = PASS, the held `{VERIFY_ATTEMPT}` unchanged → Step 8 sub-step 8.
|
|
75
|
+
- **If** `rerunFrom` = `holistic` → `HOLISTIC_VERDICT` = PASS → Step 10 sub-step 5.
|
|
76
|
+
- **Else** → Step 12, the tests gate.
|
|
77
|
+
- **Owner decisions:** A subagent learns the owner's `Accept`, `Try again` and `Stop` answers by reading the decision file (`build-decision-{RUN}-*.md`) named in its `Read`, and a `Fix now` direction from the task block that carries it. NEVER restate, summarise or paraphrase an owner's answer in a subagent's `Context`.
|
|
45
78
|
- **Plan:** `docs/plans/{YYYYMM}/{FID}-plan.md`, in task-block form (`docs/templates/bkit-plan.md` § Agent Execution Runbook). Each group holds at most `MAX_TASKS_PER_GROUP` tasks and at most `MAX_TESTS_PER_GROUP` `TEST FIRST` tests (`bkit.workflows.tasks`, held at Step 1). One group runs per pass of Steps 7-9. Only the verify steps and the **Decision Pause** tick a task `[x]`. The pause ticks a challenge task it accepts, whether the owner accepts it or the run assumes the accept.
|
|
46
79
|
- **Status:** `status.jsonl` = append-only NDJSON event log, one event per line. `step-done` carries `parentSha` captured at step START, optional `verdict` (`PASS|CONCERNS|FAIL`, or a word the step's agent adds, e.g. execute's `HANDOVER`), `failures`, `attempt`, `group`, `strategy` (`STANDARD|PIVOT|FINAL`). **If** `failures` present → `PASS => failures=0`, `FAIL => failures>0`, `CONCERNS => failures>=0`.
|
|
47
|
-
- **Locks:** Step 1 takes `$REPO_ROOT/docs/plans/{YYYYMM}/logs/{FID}/.lock` with `bkit locks acquire --kind=workflow` (hold `token`); release in last step and Failure Path with that token; assert lock released before exiting. **If** still held → **Failure Path** with `Lock removal failed`. **If** existing lock — its owning workflow's folded status.jsonl decides: `IN_PROGRESS` and last step <30min idle → **Failure Path**; any other holder (`DONE`, `FAILED`, `IN_PROGRESS` idle >=30min, no run) → reclaimed.
|
|
80
|
+
- **Locks:** Step 1 takes `$REPO_ROOT/docs/plans/{YYYYMM}/logs/{FID}/.lock` with `bkit locks acquire --kind=workflow` (hold `token`); release in last step and Failure Path with that token; assert lock released before exiting. **If** still held → **Failure Path** with `Lock removal failed`. **If** existing lock — its owning workflow's folded status.jsonl decides: `IN_PROGRESS` and last step <30min idle → `locks acquire` exits 8 and the run stops without the **Failure Path**; any other holder (`DONE`, `FAILED`, `IN_PROGRESS` idle >=30min, no run) → reclaimed.
|
|
48
81
|
- **Status branch:** status.jsonl committed on `feat/{FID}` (`$(git rev-parse --show-toplevel)/docs/plans/{YYYYMM}/logs/{FID}/status.jsonl`); per-step commits, no pushes.
|
|
49
82
|
- **Worktrees:** **If** `runtimeWorktrees` = true (mint mode) → `bkit worktrees setup` creates / resumes `.worktrees/{FID}`. **Else** → adopts current branch in place. `cd` into its `worktreePath` = `{WORKTREE_PATH}`. cwd persists across subsequent Bash calls. **If** steps ever find `pwd` != `{WORKTREE_PATH}` → **Failure Path**.
|
|
50
|
-
- **gh MCP fallback:** `gh` primary for PR / CI / merge surface. **If** a command exits 80, **or** `runtimeGithubCli` = false in the `runtime-resolved` row of `{STATUS}` → use mapped MCP tool (needs `actions` toolset in `.mcp.json`): `bkit prs open` / `bkit branches land` stage `open` → `create_pull_request` with the printed `title` / `base` / `head` and the content of the printed `bodyFile` as `body`, byte-for-byte; `bkit prs probe --number` → `pull_request_read` (`get`, minimal fields); `bkit prs probe --head` / `bkit workflows handover --push` → `list_pull_requests`; `bkit prs merge` / `bkit branches land` stage `merge` → `merge_pull_request` (printed skip-token-free `subject` as `commit_message`, empty body; `--match-head` SHA as `sha`); `bkit prs verbose-ci` → `update_pull_request`; `bkit prs update-branch --number` → `update_pull_request_branch`; `bkit prs checks --number` → `pull_request_read` (`
|
|
83
|
+
- **gh MCP fallback:** `gh` primary for PR / CI / merge surface. **If** a command exits 80, **or** `runtimeGithubCli` = false in the `runtime-resolved` row of `{STATUS}` → use mapped MCP tool (needs `actions` toolset in `.mcp.json`): `bkit prs open` / `bkit branches land` stage `open` → `create_pull_request` with the printed `title` / `base` / `head` and the content of the printed `bodyFile` as `body`, byte-for-byte; `bkit prs probe --number` → `pull_request_read` (`get`, minimal fields); `bkit prs probe --head` / `bkit workflows handover --push` → `list_pull_requests`; `bkit prs merge` / `bkit branches land` stage `merge` → `merge_pull_request` (printed skip-token-free `subject` as `commit_message`, empty body; `--match-head` SHA as `sha`); `bkit prs verbose-ci` → `update_pull_request`; `bkit prs update-branch --number` → `update_pull_request_branch`; `bkit prs checks --number` → `pull_request_read` (`get_check_runs`, the check-run conclusions for the PR head; or `actions_list` runs for the head SHA), never `get_status`; `bkit runs wait` / `bkit runs dispatch` / `bkit runs revalidate` / `bkit runs gate` → `actions_list`; `gh run view {id} --json jobs` → `actions_get`; `gh run view --log-failed` → `get_job_logs` (`failed_only=true`). Max 1 transition per run, recorded as a `transport-fallback` row via `bkit prs transport-row --file={STATUS} --kind=fallback --from=<gh command> --to=<MCP tool> --reason=<why> --asserted-by=<re-read>` — **Skip if** `{STATUS}` not set. Tracker reads and writes go through `bkit` verbs; the tracker MCP ONLY when a verb prints `tracker.done: false` or exits 80.
|
|
51
84
|
|
|
52
85
|
<!-- bkit:tracker github start -->
|
|
53
86
|
|
|
54
87
|
- **Tracker:** GitHub Issues — `bkit` verbs read and write it; MCP server `github` (`.mcp.json` `mcpServers.github`) ONLY when a verb exits 80 or prints `done` = false. Tools: `mcp__github__issue_read` (method `get` / `get_comments` / `get_labels`), `mcp__github__issue_write` (method `update`), `mcp__github__add_issue_comment`, `mcp__github__list_issues`, `mcp__github__projects_write` (method `add_project_item` / `update_project_item`); board status sync needs `projects` toolset in `.mcp.json` (`X-MCP-Toolsets`) and `package.json` `bkit.tracker.github.project`, absent either → silently skipped. Assert `{ISSUE_ID}` / `{STATE}` / `{LABELS}` non-empty before tool calls; writes best-effort, NEVER gate; **If** failure → retry once after 5s → continue.
|
|
55
|
-
- **Labels:** Phase labels `bkit:design`, `bkit:plan`, `bkit:build`, `bkit:debug`, `bkit:ship`, `bkit:merged` (mutually exclusive; a phase start drops the old phase, every `next:*` and `bkit:failed`). Additive labels: `bkit:auto` (
|
|
56
|
-
- **Comments:**
|
|
88
|
+
- **Labels:** Phase labels `bkit:design`, `bkit:plan`, `bkit:build`, `bkit:debug`, `bkit:ship`, `bkit:merged` (mutually exclusive; a phase start drops the old phase, every `next:*` and `bkit:failed`). Additive labels: `bkit:auto` (the opt-in the cloud gate job reads before it starts a run), `bkit:failed` (Failure Path). `bkit issues labels --write` computes and writes each transition. Fallback (`tracker.done` = false): `mcp__github__issue_write({ method: "update", owner: "{OWNER}", repo: "{REPO}", issue_number: {ISSUE_ID}, labels: [{LABELS}] })`; `boardWrite.done` = false → `mcp__github__projects_write({BOARD}.addItem)` → `mcp__github__projects_write({BOARD}.updateItem)`.
|
|
89
|
+
- **Comments:** The engine may append routine reports to its own eligible progress comment; explicit session/run ownership keeps invocations separate. Attention and terminal reports use new comments. Comment preparation, delivery, MCP fallback and friction failures are nonfatal: attempt best-effort friction and continue substantive work. **If** `tracker.done` = false and `commentFile` is available → attempt one new comment from that file byte-for-byte via `mcp__github__add_issue_comment({ owner: "{OWNER}", repo: "{REPO}", issue_number: {ISSUE_ID}, body: "{BODY}" })`; NEVER edit prior tracker content or rebuild the fallback body. A missing file or exhausted fallback is an attempted report, not a workflow blocker. Every comment gate requires an attempt or an applicable skip. **If** `SESSION_DIR` is not held → re-run the workflow's Step 1 `repo info` call and hold `sessionDir` as `SESSION_DIR` before the call; keep `--session-dir` on the call, because `bkit issues comment` refuses a call with no workflow-run proof.
|
|
57
90
|
|
|
58
91
|
<!-- bkit:tracker github end -->
|
|
59
92
|
<!-- bkit:tracker linear start -->
|
|
60
93
|
|
|
61
94
|
- **Tracker:** Linear — `bkit` verbs read and write it; MCP server `linear` (`.mcp.json` `mcpServers.linear`) ONLY when a verb exits 80 or prints `done` = false. Tools: `mcp__linear__get_issue`, `mcp__linear__save_issue`, `mcp__linear__save_issue_label`, `mcp__linear__save_comment`, `mcp__linear__list_comments`, `mcp__linear__list_issues`. Assert `{ISSUE_ID}` / `{STATE}` / `{LABELS}` non-empty before tool calls; `save_*` writes best-effort, NEVER gate; **If** failure → retry once after 5s → continue. `save_issue` ALWAYS includes `id` and is all-or-nothing (one state or label name the team lacks rejects the whole call) → labels and state in separate calls, labels first; create each printed `add` entry first via `save_issue_label({ name })` (`already exists` = done). `Could not find state` / `Could not find label` → log `Unapplied: <state|label> "<name>" not in team`, no retry, continue.
|
|
62
|
-
- **Labels:** Phase labels `bkit:design`, `bkit:plan`, `bkit:build`, `bkit:debug`, `bkit:ship`, `bkit:merged` (mutually exclusive; a phase start drops the old phase, every `next:*` and `bkit:failed`). Additive labels: `bkit:auto` (
|
|
63
|
-
- **Comments:**
|
|
95
|
+
- **Labels:** Phase labels `bkit:design`, `bkit:plan`, `bkit:build`, `bkit:debug`, `bkit:ship`, `bkit:merged` (mutually exclusive; a phase start drops the old phase, every `next:*` and `bkit:failed`). Additive labels: `bkit:auto` (the opt-in the cloud gate job reads before it starts a run), `bkit:failed` (Failure Path). `bkit issues labels --write` computes and writes each transition. Fallback (`tracker.done` = false): `mcp__linear__save_issue_label({ name })` per printed `add` entry → `mcp__linear__save_issue({ id: "{ISSUE_ID}", labels: [{LABELS}] })` → `mcp__linear__save_issue({ id: "{ISSUE_ID}", state: "{TRACKER_STATE}" })`.
|
|
96
|
+
- **Comments:** The engine may append routine reports to its own eligible progress comment; explicit session/run ownership keeps invocations separate. Attention and terminal reports use new comments. Comment preparation, delivery, MCP fallback and friction failures are nonfatal: attempt best-effort friction and continue substantive work. **If** `tracker.done` = false and `commentFile` is available → attempt one new comment from that file byte-for-byte via `mcp__linear__save_comment({ issueId: "{ISSUE_ID}", body: "{BODY}" })` (no `id`); NEVER edit prior tracker content or rebuild the fallback body. A missing file or exhausted fallback is an attempted report, not a workflow blocker. Every comment gate requires an attempt or an applicable skip. **If** `SESSION_DIR` is not held → re-run the workflow's Step 1 `repo info` call and hold `sessionDir` as `SESSION_DIR` before the call; keep `--session-dir` on the call, because `bkit issues comment` refuses a call with no workflow-run proof.
|
|
64
97
|
|
|
65
98
|
<!-- bkit:tracker linear end -->
|
|
66
99
|
<!-- bkit:tracker jira start -->
|
|
67
100
|
|
|
68
101
|
- **Tracker:** Jira — `bkit` verbs read and write it over the same Rovo MCP endpoint; MCP server `jira` (`.mcp.json` `mcpServers.jira`) ONLY when a verb exits 80 or prints `done` = false. Tools: `mcp__jira__getJiraIssue`, `mcp__jira__editJiraIssue`, `mcp__jira__transitionJiraIssue`, `mcp__jira__addOrEditJiraIssueComment`, `mcp__jira__searchJiraIssuesUsingJql`, `mcp__jira__executeRead`; every call passes `cloudId: "{TRACKER_SITE}"`. Assert `{ISSUE_ID}` / `{TRACKER_SITE}` / `{STATE}` / `{LABELS}` non-empty before tool calls; writes best-effort, NEVER gate; **If** failure → retry once after 5s → continue. `getJiraIssue` ALWAYS passes `view: "evidence"` (other views omit labels). `editJiraIssue` `fields.labels` replaces the whole set → pass full printed `LABELS`; labels and status in separate calls, labels first; NEVER pass `fields` / `update` to `transitionJiraIssue`. Status change: `executeRead({ name: "listJiraIssueTransitions", inputs: { issueIdOrKey } })` → transition whose `to.name` = target status → `transitionJiraIssue({ issueIdOrKey, transitionId })`; none → log `Unapplied: status "<name>" not reachable`, no retry, continue. Comment reads: `executeRead({ name: "listJiraIssueComments", inputs: { issueIdOrKey, maxResults: 100, startAt } })`, oldest first, raise `startAt` while `isLast` is false; page with `appliedContentFormat` = `html` → re-read it one comment per call (`maxResults: 1`).
|
|
69
|
-
- **Labels:** Phase labels `bkit:design`, `bkit:plan`, `bkit:build`, `bkit:debug`, `bkit:ship`, `bkit:merged` (mutually exclusive; a phase start drops the old phase, every `next:*` and `bkit:failed`). Additive labels: `bkit:auto` (
|
|
70
|
-
- **Comments:**
|
|
102
|
+
- **Labels:** Phase labels `bkit:design`, `bkit:plan`, `bkit:build`, `bkit:debug`, `bkit:ship`, `bkit:merged` (mutually exclusive; a phase start drops the old phase, every `next:*` and `bkit:failed`). Additive labels: `bkit:auto` (the opt-in the cloud gate job reads before it starts a run), `bkit:failed` (Failure Path). `bkit issues labels --write` computes and writes each transition. Fallback (`tracker.done` = false): `mcp__jira__editJiraIssue({ cloudId: "{TRACKER_SITE}", issueIdOrKey: "{ISSUE_ID}", fields: { labels: [{LABELS}] } })` → move status to `{TRACKER_STATE}` (**Tracker** status change).
|
|
103
|
+
- **Comments:** The engine may append routine reports to its own eligible progress comment; explicit session/run ownership keeps invocations separate. Attention and terminal reports use new comments. Comment preparation, delivery, MCP fallback and friction failures are nonfatal: attempt best-effort friction and continue substantive work. **If** `tracker.done` = false and `commentFile` is available → attempt one new comment from that file byte-for-byte via `mcp__jira__addOrEditJiraIssueComment({ cloudId: "{TRACKER_SITE}", issueIdOrKey: "{ISSUE_ID}", commentBody: "{BODY}" })` (no `commentId`); NEVER edit prior tracker content or rebuild the fallback body. A missing file or exhausted fallback is an attempted report, not a workflow blocker. Every comment gate requires an attempt or an applicable skip. **If** `SESSION_DIR` is not held → re-run the workflow's Step 1 `repo info` call and hold `sessionDir` as `SESSION_DIR` before the call; keep `--session-dir` on the call, because `bkit issues comment` refuses a call with no workflow-run proof. Fallback body over 32,767 characters → post as consecutive comments split at line breaks, in order (the engine splits its own posts the same way).
|
|
71
104
|
|
|
72
105
|
<!-- bkit:tracker jira end -->
|
|
73
106
|
<!-- bkit:tracker true start -->
|
|
@@ -76,7 +109,7 @@ description: "Build Feature — Autonomous implementation"
|
|
|
76
109
|
|
|
77
110
|
<!-- bkit:tracker true end -->
|
|
78
111
|
|
|
79
|
-
- **Limits:** `bkit.workflows.build.verify` / `.challenge` / `.tests` each hold `ask` and `maxAttempts`, read via `bkit counters route --point=` in fenced routing blocks below; `bkit counters max --point=` reads a limit alone. Verify counts rounds per group, challenge counts rounds (`CHALLENGE_ROUND`, Step 11; the last round's fixes get no further challenge round), tests counts test rounds. A verify or
|
|
112
|
+
- **Limits:** `bkit.workflows.build.verify` / `.challenge` / `.tests` / `.holistic` each hold `ask` and `maxAttempts`, read via `bkit counters route --point=` in fenced routing blocks below; `bkit counters max --point=` reads a limit alone. Verify counts rounds per group, challenge counts rounds (`CHALLENGE_ROUND`, Step 11; the last round's fixes get no further challenge round), tests counts test rounds, holistic counts holistic fix rounds within the run (no reset between rounds). A verify, tests or holistic limit used up asks the owner at the **Decision Pause** when `ask` = true in a session; the owner's `Fix now`, `Try again` or `Accept` gives that loop alone one more full allowance (`bkit counters grant`), and it asks again once that allowance is used up too. `ask` = false, or headless → a used-up limit goes to the **Failure Path**; a question never resets a count. `ask` = false, or headless → the **Decision Pause** takes each recommendation (`bkit decisions apply --by=headless`); hard blockers (no recommendation) are asked in a session and go to the **Failure Path** headless.
|
|
80
113
|
|
|
81
114
|
**Rules:** Copied word for word from `.agents/rules.md`.
|
|
82
115
|
|
|
@@ -118,8 +151,7 @@ description: "Build Feature — Autonomous implementation"
|
|
|
118
151
|
```
|
|
119
152
|
Route:
|
|
120
153
|
- **If** exit 80 → open PR on `{BRANCH}` via `list_pull_requests` → re-run with `--open-pr={number}` or `--open-pr=none`.
|
|
121
|
-
- **
|
|
122
|
-
- **Else** → **If** `tracker.done` = false → post `comment` via the tracker MCP per the header's fallback section → step 6.
|
|
154
|
+
- **Else** → add `message` to the final message when it is not empty → follow `route`: `stop`, or none printed → step 6.
|
|
123
155
|
6. **STOP**, no further downstream steps. **If** `SUMMARY_VERDICT` = FAIL → the final message is `build-summary.md` content verbatim.<!-- bkit:tracker true start --> Line 1 of the final message = the no-issue warning, when one was emitted.<!-- bkit:tracker true end -->
|
|
124
156
|
|
|
125
157
|
---
|
|
@@ -131,28 +163,42 @@ description: "Build Feature — Autonomous implementation"
|
|
|
131
163
|
"{BKIT}" counters derive --file="{STATUS}" --workflow=build --step=build-decision --position=next
|
|
132
164
|
```
|
|
133
165
|
Hold `value` as `DECISION`.
|
|
134
|
-
2. Write `{OUTBOX}/decision-items.json` = one JSON object per item, in item order — `{"title", "question", "options", "recommended", "reason"}`, or a hard blocker `{"title", "question", "options", "noRecommendation"}` (why no agent can settle it); never a recommendation on a hard blocker. Per `question`: word each so "yes" accepts the recommendation. State what the owner must decide
|
|
166
|
+
2. Write `{OUTBOX}/decision-items.json` = one JSON object per item, in item order — `{"title", "question", "options", "recommended", "reason"}`, or a hard blocker `{"title", "question", "options", "noRecommendation"}` (why no agent can settle it); never a recommendation on a hard blocker. Each option is `{"name", "effect"}`: `name` is the bare option name and `effect` says what happens if the owner picks it. The default effects are `Accept` = `the item is recorded as accepted and the build moves on`, `Fix now` = `one more fix round runs before the build moves on` and `Stop` = `Stop — the run ends here with a handover; the next run resumes here`, each sharpened to the item when that helps. Per `question`: word each so "yes" accepts the recommendation. State what the owner must decide, what each option does and the reason for the recommendation, in plain English, before naming any file, test or identifier. Items:
|
|
167
|
+
- **If** `PAUSE_QUESTION` = `VERIFY_GAPS` **and** `PAUSE_STEP` = 10 → write one item per `Identified Gaps Log` line of `build-plan-verify-holistic-{RUN}-{HOLISTIC_ATTEMPT}.md`. Add the gap's last `BLOCKED` reason from `build-plan-gaps-remediate-holistic-{RUN}-*-log.md` when it has one.
|
|
135
168
|
- **If** `PAUSE_QUESTION` = `VERIFY_GAPS` → write one item per `Identified Gaps Log` line of `build-plan-verify-{GROUP}-{VERIFY_ATTEMPT}.md`. Add the gap's last `BLOCKED` reason from `build-plan-gaps-remediate-{GROUP}-*-log.md` when it has one.
|
|
136
|
-
|
|
137
|
-
-
|
|
138
|
-
- A
|
|
169
|
+
- For either `VERIFY_GAPS` list:
|
|
170
|
+
- Title each item `Task {N}` from its `TASK {N}` gap line, so a decision tick finds the task. A gap with no task number gets its description as the title.
|
|
171
|
+
- A fixable gap → options `Accept` and `Fix now`, with a recommendation per item.
|
|
172
|
+
- Any unfixable gap (`no-test-first`, `test-first-malformed`, `test-first-unread`, `exception-refused`, `test-loosened`, or a holistic gap, logged `Fixable: false`) → a hard blocker with options `Accept`, `Fix now` and `Stop`.
|
|
173
|
+
- A group-gate failure is never an item: no item option can settle it, and the loop question carries it.
|
|
139
174
|
- **If** `PAUSE_QUESTION` = `CHALLENGE`:
|
|
140
175
|
- **If** `CHALLENGE_OVERFLOW` is set → the merge wrote nothing to the plan. Write one item per `Location` of each `CRITICAL`, `HIGH` or `MEDIUM` finding in the merged reports: `build-challenge-2.md`, plus `build-challenge-1.md` when the change is large.
|
|
141
176
|
- **Else** → write one item per task of `CHALLENGE_TASKS` whose block in the plan says `**Fixable:** false`, at any severity.
|
|
142
177
|
- Title each item with its task number, when it has one, followed by its `Location` in brackets.
|
|
143
|
-
- **If** the item is `**Fixable:** false` → a hard blocker with options `
|
|
144
|
-
- **Else** → options `
|
|
145
|
-
- **If** `PAUSE_QUESTION` = `TESTS_LOOP` → write no items
|
|
146
|
-
- **If** `PAUSE_QUESTION` = `
|
|
178
|
+
- **If** the item is `**Fixable:** false` → a hard blocker with options `Accept`, `Fix now` and `Stop`.
|
|
179
|
+
- **Else** → options `Accept` and `Fix now`, with a recommendation per finding.
|
|
180
|
+
- **If** `PAUSE_QUESTION` = `TESTS_LOOP` → write no items: a failing suite test is never an item, and the loop question carries it.
|
|
181
|
+
- **If** `PAUSE_QUESTION` = `CHANGED_TESTS` → write one item per entry of `CHANGED_TESTS`, titled with its task number and test name. Each item is a planned test a code step had to change, with the step's reason and the entry's `diff` (the test's own-line diff since its baseline, shown in a diff fence). Options `Accept` and `Stop`, recommended `Accept`. Its question ends `Accept the change?`
|
|
182
|
+
- **If** `PAUSE_QUESTION` = `UNPROVEN` → write one item per entry of `UNPROVEN_TESTS`, titled with its task number and test name. Each item is a planned test that never failed before its code existed, so nothing shows it can catch the bug it was written for. Options `Accept` and `Stop`, recommended `Accept`. Its question ends `Accept it? You write the reason, and it is recorded as your TEST EXCEPTION.`
|
|
183
|
+
|
|
184
|
+
Check a red gate against the base commit, the commit the branch started from. **If** `PAUSE_QUESTION` = `TESTS_LOOP` **or** `GATE_VERDICT` = FAIL → `GATE_LOG` = `{OUTBOX}/run-tests-{TEST_ATTEMPT}.log` for `TESTS_LOOP`; `{OUTBOX}/build-holistic-gate-{HOLISTIC_ATTEMPT}.log` when `PAUSE_STEP` = 10; else `{OUTBOX}/build-group-gate-{GROUP}-{VERIFY_ATTEMPT}.log`:
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
"{BKIT}" tests base --log="{GATE_LOG}" --file="{STATUS}" --workflow=build --out="{OUTBOX}/base-check.json"
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
**If** `tests base` exits non-zero → **Failure Path**. Every verdict, `unknown` included, exits 0 and goes into the pause.
|
|
147
191
|
|
|
148
192
|
Compose the file with these flags:
|
|
149
|
-
- `{LOOP_FLAGS}` = `--loop=tests --attempt={TEST_ATTEMPT} --max={PAUSE_MAX}` when `PAUSE_QUESTION` = `TESTS_LOOP`; `--loop=verify --group={GROUP} --attempt={VERIFY_ATTEMPT} --max={PAUSE_MAX}` when `PAUSE_LOOP` = `verify`; empty otherwise.
|
|
150
|
-
- `{HEADER_FLAGS}` = `--header=Question={PAUSE_QUESTION} --header=From={verify|challenge|tests|summary} --header="Pause step={PAUSE_STEP}" --header="Plan=docs/plans/{YYYYMM}/{FID}-plan.md"`.
|
|
151
|
-
- **If** the pause comes from verify → add `--header=Group={GROUP} --header="Verify attempt={VERIFY_ATTEMPT}"` to `{HEADER_FLAGS}`.
|
|
193
|
+
- `{LOOP_FLAGS}` = `--loop=tests --attempt={TEST_ATTEMPT} --max={PAUSE_MAX}` when `PAUSE_QUESTION` = `TESTS_LOOP`; `--loop=verify --group={GROUP} --attempt={VERIFY_ATTEMPT} --max={PAUSE_MAX}` when `PAUSE_LOOP` = `verify`; `--loop=holistic --attempt={HOLISTIC_ROUNDS} --max={PAUSE_MAX}` when `PAUSE_LOOP` = `holistic`; empty otherwise.
|
|
194
|
+
- `{HEADER_FLAGS}` = `--header=Question={PAUSE_QUESTION} --header=From={verify|holistic|challenge|tests|summary} --header="Pause step={PAUSE_STEP}" --header="Plan=docs/plans/{YYYYMM}/{FID}-plan.md"`.
|
|
195
|
+
- **If** the pause comes from verify → add `--header=Group={GROUP} --header="Verify attempt={VERIFY_ATTEMPT}" --header="Source changed={SOURCE_CHANGED}"` to `{HEADER_FLAGS}`.
|
|
196
|
+
- **If** the pause comes from holistic → add `--header="Holistic attempt={HOLISTIC_ATTEMPT}" --header="Source changed={SOURCE_CHANGED}"` to `{HEADER_FLAGS}`.
|
|
152
197
|
- **If** the pause comes from tests → add `--header="Test attempt={TEST_ATTEMPT}"` to `{HEADER_FLAGS}`.
|
|
198
|
+
- `{BASE_FLAGS}` = `--header=Gate=FAIL` when the base check ran, plus `--base-check="{OUTBOX}/base-check.json"` when `{LOOP_FLAGS}` is not empty; empty otherwise.
|
|
153
199
|
|
|
154
200
|
```bash
|
|
155
|
-
"{BKIT}" decisions compose --out="docs/plans/{YYYYMM}/logs/{FID}/build-decision-{RUN}-{DECISION}.md" {HEADER_FLAGS} --items="{OUTBOX}/decision-items.json" --file="{STATUS}" {LOOP_FLAGS}
|
|
201
|
+
"{BKIT}" decisions compose --out="docs/plans/{YYYYMM}/logs/{FID}/build-decision-{RUN}-{DECISION}.md" {HEADER_FLAGS} --items="{OUTBOX}/decision-items.json" --file="{STATUS}" {LOOP_FLAGS} {BASE_FLAGS}
|
|
156
202
|
```
|
|
157
203
|
|
|
158
204
|
**If** `decisions compose` exits non-zero → **Failure Path**.
|
|
@@ -172,9 +218,10 @@ description: "Build Feature — Autonomous implementation"
|
|
|
172
218
|
- **If** exit 4 → step 4, asking only the printed `hardBlockers` questions.
|
|
173
219
|
- **Else** → **Failure Path**.
|
|
174
220
|
4. Ask the owner in this session; NEVER hand questions or acceptances to subagents:
|
|
175
|
-
- One message = the attempt line and `## Progress` block (loop questions only), then each `Q{n}` question still without a `Decision:` line, each with its
|
|
221
|
+
- One message = the attempt line and `## Progress` block (loop questions only), then each `Q{n}` question still without a `Decision:` line, each with its option lines, its `Recommended:` line (`Recommended: none — {why}` on a hard blocker) and its `Default if unanswered:` line, then the file's last line; plain text, not through a host question tool.
|
|
222
|
+
- Offer only the file's options for each question; NEVER add an `Accept` or any other option the file does not list.
|
|
176
223
|
- Look up facts in the repo, docs and tools, and never ask the owner for them.
|
|
177
|
-
- Decide nothing on the owner's behalf. "yes"
|
|
224
|
+
- Decide nothing on the owner's behalf. Reply with a letter per question, or "yes" to take every recommendation. "yes" never answers a `Recommended: none — {why}` question. Show the `Or say "one by one" and I'll ask them one at a time.` line only when the message asks 3 or more questions (after a headless apply it asks only the `hardBlockers` subset). **If** the owner replies "one by one" → ask each unanswered question in its own message, per § Human questions. Narrate `Decision pause {DECISION}: {count} question(s)` → record the wait → end turn → wait for answers:
|
|
178
225
|
```bash
|
|
179
226
|
"{BKIT}" status row --file="{STATUS}" --workflow=build --type=owner-pause --field=reason=decision >/dev/null || exit 1
|
|
180
227
|
```
|
|
@@ -186,12 +233,13 @@ description: "Build Feature — Autonomous implementation"
|
|
|
186
233
|
- Route — first match wins:
|
|
187
234
|
- **If** the owner says stop, **or** answers `Stop` → step 8.
|
|
188
235
|
- **If** the loop question is answered `Try again` → step 6. The items then need no decision.
|
|
189
|
-
- **If** any asked item still lacks a decision:
|
|
190
|
-
- Discuss the follow-ups with the owner.
|
|
236
|
+
- **If** any asked item still lacks a decision, which includes a hard blocker answered `Fix now` with no direction:
|
|
237
|
+
- Discuss the follow-ups with the owner. For a hard blocker answered `Fix now` with no direction, ask what the fix should do.
|
|
191
238
|
- Record the wait with the `owner-pause` block above.
|
|
192
239
|
- End the turn and wait for the answers.
|
|
193
240
|
- **Else** → step 5.
|
|
194
241
|
5. Apply each decision:
|
|
242
|
+
- **If** the file is a reopened `DECIDED` / `ASSUMED` one → an item that already carries a `Decision:` line was applied in an earlier pass: write nothing already written — no second `docs/decisions.jsonl` row, no second title suffix, no second `TEST EXCEPTION`; a plan tick already made stays.
|
|
195
243
|
- **Accept** by the owner → write the acceptance ONLY on that item's explicit approval from the owner. A "yes" to an `Accept` recommendation counts as approval.
|
|
196
244
|
- **If** the item is an `exception-refused` gap **or** an `UNPROVEN` item → write a `- **TEST EXCEPTION:**` field as the last field of the task's block in `docs/plans/{YYYYMM}/{FID}-plan.md`:
|
|
197
245
|
- Give the field one sub-bullet per test, in `TEST FIRST` form, each ending `— {human's reason} (owner, {YYYY-MM-DD})`.
|
|
@@ -204,7 +252,13 @@ description: "Build Feature — Autonomous implementation"
|
|
|
204
252
|
- **If** the item is a challenge task → tick it `[x]` and end its title with ` — accepted (assumed)`.
|
|
205
253
|
- **Fix now**:
|
|
206
254
|
- Write no test and no fix code at this pause. Step 7 writes the new task's `TEST FIRST` tests with `@bkit-build-plan-tests`, records them failing with `tests red`, and only then writes the fix with `@bkit-build-plan-tasks`. NEVER undo code to force a red.
|
|
207
|
-
- **If** the item
|
|
255
|
+
- **If** the item already has a `Fix task:` line in the decision file → reuse the task it names and write no second block. A resumed pause can reach this step twice.
|
|
256
|
+
- Write the item's `Fix task: {N}` line under it in the decision file right after the task block is written or rewritten, before `tests plan-check`, where `{N}` is the number of the task that carries its fix: the rewritten challenge task, the new task block, or the task an existing `Fix task:` line names.
|
|
257
|
+
- **If** the item is a challenge task → rewrite that task in place to the owner's direction:
|
|
258
|
+
- Rewrite its `**DONE WHEN:**` and its `**TEST FIRST:**`, with one sub-bullet per test: `` `{test file}` `{test name}` fails on {what goes wrong} ``.
|
|
259
|
+
- Rewrite its rows in the `Derived Test Matrix` to match the new `TEST FIRST`.
|
|
260
|
+
- Keep the task's number, title, group and meta line, `**Fixable:** false` included.
|
|
261
|
+
- Keep the task open. Step 7 builds the rewritten block.
|
|
208
262
|
- **Else** → write a new task block:
|
|
209
263
|
- Use the task-block form (`docs/templates/bkit-plan.md` § Agent Execution Runbook), numbered one above the plan's highest task.
|
|
210
264
|
- Give it `**DONE WHEN:**` and `**TEST FIRST:**`, with one sub-bullet per test: `` `{test file}` `{test name}` fails on {what goes wrong} ``.
|
|
@@ -213,14 +267,16 @@ description: "Build Feature — Autonomous implementation"
|
|
|
213
267
|
- Place the task block:
|
|
214
268
|
- **If** `From: verify` **and** group `{GROUP}` stays within `MAX_TASKS_PER_GROUP` tasks and `MAX_TESTS_PER_GROUP` `TEST FIRST` tests with it → put it inside group `{GROUP}`.
|
|
215
269
|
- **If** `From: verify` **and** it would take group `{GROUP}` over either cap → put it in a new group right after `{GROUP}`. Add 1 to every later group's number, in its markers and its `### TASK GROUP` heading.
|
|
216
|
-
- **If** `From: tests` **or** `From: challenge` → put it in a new last group, keeping each new group within the caps.
|
|
270
|
+
- **If** `From: holistic`, `From: tests` **or** `From: challenge` → put it in a new last group, keeping each new group within the caps.
|
|
271
|
+
- A fix that changes what an earlier task's planned test asserts names that test, with the same file and the same name, on the rewritten or new task's `**TEST FIRST:**` too: the build then takes the test over and records it failing again, and `tests plan-check` lists it under `takeovers`.
|
|
217
272
|
- Then check the plan:
|
|
218
273
|
```bash
|
|
219
274
|
"{BKIT}" tests plan-check --plan="docs/plans/{YYYYMM}/{FID}-plan.md" --existence=report --log="docs/plans/{YYYYMM}/logs/{FID}/build-plan-check.md"
|
|
220
275
|
```
|
|
221
276
|
**If** exit non-zero → **Failure Path** naming each problem in the report.
|
|
222
277
|
6. Write the decisions into the decision file:
|
|
223
|
-
- Under each item the owner answered, add `Decision: {Accept|Fix now} — {owner's words}
|
|
278
|
+
- Under each item the owner answered, add `Decision: {Accept|Fix now} — {owner's words}` only under an item that has none; a reopened file keeps the line it has.
|
|
279
|
+
- Under each `Fix now` item, add the `Fix task: {N}` line only if it is still missing after step 5.
|
|
224
280
|
- Under the loop question, add `Decision: {Try again|Decide} — {owner's words}`.
|
|
225
281
|
- Set `Status: ASSUMED` while any `Decision: Accept (assumed)` line remains, and `Status: DECIDED` otherwise.
|
|
226
282
|
|
|
@@ -237,17 +293,34 @@ description: "Build Feature — Autonomous implementation"
|
|
|
237
293
|
- **Else** → `CHALLENGE_ROUND` = `CHALLENGE_ROUND` + 1.
|
|
238
294
|
- **If** any item was answered `Fix now` → `DECISION_ROUTE` = `fix`.
|
|
239
295
|
- **If** the loop question was answered `Try again` → `DECISION_ROUTE` = `retry`.
|
|
296
|
+
- **If** `From: verify` **or** `From: holistic` → ask the engine whether the answers settle the check, so the run can skip its re-run. It reads the decision file's header and answers:
|
|
297
|
+
|
|
298
|
+
```bash
|
|
299
|
+
"{BKIT}" decisions skip --file="docs/plans/{YYYYMM}/logs/{FID}/build-decision-{RUN}-{DECISION}.md"
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
- **If** exit 0 → `DECISION_ROUTE` = `continue`.
|
|
303
|
+
- **If** exit 1 → keep the re-run: the next rule sets the route. The printed fact says why the check runs again.
|
|
304
|
+
- **Else** → **Failure Path**.
|
|
305
|
+
|
|
306
|
+
- **If** `From: holistic` → `DECISION_ROUTE` = `holistic`.
|
|
240
307
|
- **If** `From: verify` → `DECISION_ROUTE` = `verify`.
|
|
241
308
|
- **If** `From: summary` → `DECISION_ROUTE` = `summary`.
|
|
242
309
|
- **Else** → `DECISION_ROUTE` = `tests`. This covers `From: tests` and `From: challenge`.
|
|
243
310
|
|
|
244
|
-
Clear `PAUSE_LOOP`. **If** `From: verify` **or** `From: tests` → the owner chose to go on, so give that loop one more full allowance when its limit is used up. Below the limit, or with `ask` = false, the command grants nothing and exits 1; both exits go on:
|
|
311
|
+
Clear `PAUSE_LOOP`. **If** `From: verify`, `From: holistic` **or** `From: tests` → the owner chose to go on, so give that loop one more full allowance when its limit is used up. Below the limit, or with `ask` = false, the command grants nothing and exits 1; both exits go on:
|
|
245
312
|
- **If** `From: verify`:
|
|
246
313
|
|
|
247
314
|
```bash
|
|
248
315
|
"{BKIT}" counters grant --name=VERIFY_ATTEMPT --of=build-plan-verify:current --group={GROUP} --point={PAUSE_POINT} --file="{STATUS}" --workflow=build
|
|
249
316
|
```
|
|
250
317
|
|
|
318
|
+
- **If** `From: holistic` → count the allowance over the run's holistic fix rounds:
|
|
319
|
+
|
|
320
|
+
```bash
|
|
321
|
+
"{BKIT}" counters grant --name=HOLISTIC_ATTEMPT --of=build-plan-gaps-remediate-holistic:next --point=build.holistic --file="{STATUS}" --workflow=build
|
|
322
|
+
```
|
|
323
|
+
|
|
251
324
|
- **Else**:
|
|
252
325
|
|
|
253
326
|
```bash
|
|
@@ -256,6 +329,21 @@ description: "Build Feature — Autonomous implementation"
|
|
|
256
329
|
|
|
257
330
|
**If** exit >= 2 → **Failure Path**.
|
|
258
331
|
|
|
332
|
+
**If** `DECISION_ROUTE` = `continue` → tick the accepted gaps' tasks before the decision is recorded, so a resume either reopens the unrecorded decision (the tick already made is kept) or finds the tasks ticked:
|
|
333
|
+
- **If** `From: verify`:
|
|
334
|
+
|
|
335
|
+
```bash
|
|
336
|
+
"{BKIT}" tasks tick --plan="docs/plans/{YYYYMM}/{FID}-plan.md" --group={GROUP} --decision="docs/plans/{YYYYMM}/logs/{FID}/build-decision-{RUN}-{DECISION}.md"
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
- **If** `From: holistic` → the accepted gaps span groups, so each task is ticked in its own group:
|
|
340
|
+
|
|
341
|
+
```bash
|
|
342
|
+
"{BKIT}" tasks tick --plan="docs/plans/{YYYYMM}/{FID}-plan.md" --decision="docs/plans/{YYYYMM}/logs/{FID}/build-decision-{RUN}-{DECISION}.md"
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
**If** exit != 0 → **Failure Path**.
|
|
346
|
+
|
|
259
347
|
Record the decision and its route. The loop counts are not reset:
|
|
260
348
|
|
|
261
349
|
```bash
|
|
@@ -265,8 +353,12 @@ description: "Build Feature — Autonomous implementation"
|
|
|
265
353
|
7. Route — first match wins:
|
|
266
354
|
- **If** `DECISION_ROUTE` = `fix` → Step 7.
|
|
267
355
|
- **If** `DECISION_ROUTE` = `retry` **and** `From: verify` → Step 9.
|
|
356
|
+
- **If** `DECISION_ROUTE` = `retry` **and** `From: holistic` → Step 10 sub-step 9.
|
|
268
357
|
- **If** `DECISION_ROUTE` = `retry` → Step 13.
|
|
358
|
+
- **If** `DECISION_ROUTE` = `continue` **and** `From: holistic` → Step 11.
|
|
359
|
+
- **If** `DECISION_ROUTE` = `continue` **and** `From: verify` → run `"{BKIT}" tasks tick --plan="docs/plans/{YYYYMM}/{FID}-plan.md" --group={GROUP} --decision="docs/plans/{YYYYMM}/logs/{FID}/build-decision-{RUN}-{DECISION}.md"` again (it ticks nothing twice), **If** exit != 0 → **Failure Path**, else Step 7.
|
|
269
360
|
- **If** `DECISION_ROUTE` = `verify` → re-run Step 8.
|
|
361
|
+
- **If** `DECISION_ROUTE` = `holistic` → Step 7, which runs a takeover group a holistic fix added and goes straight to Step 10 when no group is open.
|
|
270
362
|
- **If** `DECISION_ROUTE` = `summary` → Step 15.
|
|
271
363
|
- **Else** → Step 12.
|
|
272
364
|
8. Record the wait (step 4 `owner-pause` block). Create `docs/plans/{YYYYMM}/logs/{FID}/build-handover.md` = the decision file plus the line `Stopped by the owner ({RUNTIME}); run stays IN_PROGRESS. /bkit-build {REF} resumes at this pause.`; `REF` empty → `{FID}`. Then keep the record:
|
|
@@ -287,13 +379,16 @@ description: "Build Feature — Autonomous implementation"
|
|
|
287
379
|
|
|
288
380
|
### 🔒 Gate — Decision Pause
|
|
289
381
|
|
|
382
|
+
- [ ] Red gate checked against the base commit (`tests base`), its verdict in the decision file
|
|
290
383
|
- [ ] Decision file written (`decisions compose`)
|
|
291
384
|
- [ ] Questions asked in the session, or recommendations taken (`decisions apply --by=headless`)
|
|
292
385
|
- [ ] Hard blockers asked in a session, or sent to the Failure Path when headless
|
|
293
386
|
- [ ] Acceptances written only on the owner's approval
|
|
294
387
|
- [ ] Assumed acceptances left without a ledger row or `TEST EXCEPTION`
|
|
388
|
+
- [ ] Fix now tasks shaped to the owner's direction, each named on a `Fix task` line in the decision file
|
|
295
389
|
- [ ] Fix now tasks checked (`tests plan-check`)
|
|
296
|
-
- [ ]
|
|
390
|
+
- [ ] Verify or holistic pause routed `continue` only when `decisions skip` exited 0: the accepted tasks ticked (`tasks tick --decision`, made before the decision is recorded), then holistic to Step 11 and verify to Step 7, with no new verify round
|
|
391
|
+
- [ ] Used-up verify, holistic or tests loop given its allowance on a go-on answer (`counters grant`)
|
|
297
392
|
- [ ] Mechanical checks passed (`steps finish`), or run handed over and lock released
|
|
298
393
|
|
|
299
394
|
---
|
|
@@ -313,7 +408,7 @@ description: "Build Feature — Autonomous implementation"
|
|
|
313
408
|
"{BKIT}" fids parse --prompt-file="{SESSION_DIR}/prompt.md"
|
|
314
409
|
```
|
|
315
410
|
<!-- bkit:tracker true start -->
|
|
316
|
-
**If** exit 8 →
|
|
411
|
+
**If** exit 8 → ask the owner in this session, plain text, not through a host question tool, in one message with no tests or edits: `**Q1 — Issue:** the prompt names more than one issue. Which one did you mean?`, then one option line per issue `fids parse` printed under `ambiguous` (`Use {issue} — the run works on {issue}`) and `Stop — nothing changes; the run can be started again`, lettered in that order, then `Recommended: none — only you know which issue you meant` and `Default if unanswered: the run waits for you; the run stops when nobody can be asked`, then the line `Reply with a letter per question. "stop" ends here; nothing has changed yet, so the run can be started again.` Write no status row (none exists yet); end turn → wait for the answer; no status file yet. On a pick, write the issue reference with the file-write tool to `{SESSION_DIR}/owner-answer.md` and re-run `fids parse --prompt-file="{SESSION_DIR}/owner-answer.md"`; on `Stop` → **STOP**; never the **Failure Path**.
|
|
317
412
|
<!-- bkit:tracker true end -->
|
|
318
413
|
Hold `fidNamed` as `FID_NAMED`. Hold `issue` as `ISSUE_ID`, `ref` as `REF`.
|
|
319
414
|
<!-- bkit:tracker false start -->
|
|
@@ -327,7 +422,7 @@ description: "Build Feature — Autonomous implementation"
|
|
|
327
422
|
Route:
|
|
328
423
|
- **If** exit 0 and `issueId` non-null → hold `issueId` as `ISSUE_ID`.
|
|
329
424
|
- **If** exit 0 and `issueId` null → set `ISSUE_ID=""` → emit the no-issue warning once `FID` is held → continue; NEVER create a tracker issue.
|
|
330
|
-
- **If** exit 3 → **
|
|
425
|
+
- **If** exit 3 → **Action needed — Branch name:** rename `BRANCH` to `feat/{lowercase-slug}`, or name an issue. Then say "continue". Write no status row (none exists yet); end turn → wait for the answer; no status file yet. On "continue" re-run this block; never the **Failure Path**.
|
|
331
426
|
- **Else** → **Failure Path**.
|
|
332
427
|
<!-- bkit:tracker true end -->
|
|
333
428
|
3. <!-- bkit:tracker true start -->
|
|
@@ -357,13 +452,13 @@ description: "Build Feature — Autonomous implementation"
|
|
|
357
452
|
Route:
|
|
358
453
|
- **If** exit 0 → hold `fid` as `FID`; one `FID` for all artifacts.
|
|
359
454
|
- **If** exit 4 → **Failure Path** listing `fids` (name the `FID` in the session prompt to pick one).
|
|
360
|
-
- **If** exit 9 → **
|
|
455
|
+
- **If** exit 9 → **Action needed — Issue reference:** name the issue as `#N`, its key or its URL. Then say "continue". Write no status row (none exists yet); end turn → wait for the answer; no status file yet. On "continue" write the named reference with the file-write tool to `{SESSION_DIR}/owner-answer.md`, re-run `fids parse --prompt-file="{SESSION_DIR}/owner-answer.md"` and this block on it; never the **Failure Path**.
|
|
361
456
|
- **Else** → **Failure Path**.
|
|
362
457
|
6. Acquire concurrency lock:
|
|
363
458
|
```bash
|
|
364
459
|
"{BKIT}" locks acquire --kind=workflow --workflow=build --fid={FID}
|
|
365
460
|
```
|
|
366
|
-
|
|
461
|
+
Route: hold `token` as `LOCK_TOKEN`, `month` as `YYYYMM`. Follow `route`: `go` → next sub-step; `stop` → tell the owner `message` → **STOP**, with no **Failure Path**, label, comment or status row, because the other run is healthy and keeps its lock; no `route` → **Failure Path**.
|
|
367
462
|
7. Emit the long-branch advisory `[bkit-build] feature branch is {BEHIND_DEV} commits behind dev / {DIVERGED_AGO} since divergence`.
|
|
368
463
|
8. <!-- bkit:tracker true start -->
|
|
369
464
|
**Skip if** `ISSUE_ID` empty. Add `Build` phase and drop old phase — `{LABEL_FLAGS}` = one `--label=<name>` per current `LABELS` entry:
|
|
@@ -376,7 +471,7 @@ description: "Build Feature — Autonomous implementation"
|
|
|
376
471
|
9. <!-- bkit:tracker true start -->
|
|
377
472
|
**Skip if** `ISSUE_ID` empty. Comment:
|
|
378
473
|
```bash
|
|
379
|
-
"{BKIT}" issues comment --post --issue="{ISSUE_ID}" --workflow=build --workflow-heading --step-number=1 --step-title="Start Workflow" --owner-repo={OWNER_REPO} --tree={BRANCH}
|
|
474
|
+
"{BKIT}" issues comment --post --issue="{ISSUE_ID}" --workflow=build --workflow-heading --step-number=1 --step-title="Start Workflow" --owner-repo={OWNER_REPO} --tree={BRANCH} --session-dir="{SESSION_DIR}"
|
|
380
475
|
```
|
|
381
476
|
<!-- bkit:tracker true end -->
|
|
382
477
|
|
|
@@ -387,6 +482,7 @@ description: "Build Feature — Autonomous implementation"
|
|
|
387
482
|
```
|
|
388
483
|
|
|
389
484
|
- [ ] Mechanical checks passed (`steps gate`)
|
|
485
|
+
- [ ] Issue comment attempted when applicable
|
|
390
486
|
- [ ] Issue resolved
|
|
391
487
|
- [ ] Long-branch advisory emitted
|
|
392
488
|
|
|
@@ -421,7 +517,7 @@ description: "Build Feature — Autonomous implementation"
|
|
|
421
517
|
3. Enter the worktree, open the run and record the runtime:
|
|
422
518
|
```bash
|
|
423
519
|
cd "{WORKTREE_PATH}" && mkdir -p "{OUTBOX}" || exit 2
|
|
424
|
-
"{BKIT}" workflows start --workflow=build --fid={FID} --month={YYYYMM} --lock-held --token={LOCK_TOKEN} || exit 1
|
|
520
|
+
"{BKIT}" workflows start --workflow=build --fid={FID} --month={YYYYMM} --lock-held --token={LOCK_TOKEN} --session-dir="{SESSION_DIR}" || exit 1
|
|
425
521
|
"{BKIT}" runtime row --workflow=build --file="{LOG_DIR}/status.jsonl" >/dev/null || exit 2
|
|
426
522
|
"{BKIT}" runtime assert --workflow=build --file="{LOG_DIR}/status.jsonl"
|
|
427
523
|
```
|
|
@@ -488,6 +584,7 @@ description: "Build Feature — Autonomous implementation"
|
|
|
488
584
|
Context: You are a subagent in the Build phase. Write the plan in task-block form. Plan caps (`bkit.workflows.tasks`): {MAX_TASKS_PER_GROUP} tasks and {MAX_TESTS_PER_GROUP} `TEST FIRST` tests per group; {MAX_TESTS_PER_TASK} tests across {MAX_TEST_FILES_PER_TASK} test files per task. **If** `CONVERT_RETRY` is held → add `Your last plan failed the plan check: {CONVERT_RETRY}. Fix only those problems.` **If** `NEWER_COMMENTS` > 0 → add `{NEWER_COMMENTS} issue comments are newer than the plan; write what they change into it.` Switch into the working directory with `cd "{WORKTREE_PATH}"`, check it with `pwd`, and use it for every file operation that follows. Check command: `"{BKIT}" tests plan-check --plan="docs/plans/{YYYYMM}/{FID}-plan.md" --existence=report --log="docs/plans/{YYYYMM}/logs/{FID}/build-plan-check.md"`.
|
|
489
585
|
Read: `docs/plans/{YYYYMM}/logs/{FID}/build-input-{RUN}.md`, `docs/plans/{YYYYMM}/{FID}-plan.md` (if present), `docs/plans/{YYYYMM}/logs/{FID}/build-plan-check.md` (if present), `docs/templates/bkit-plan.md`.
|
|
490
586
|
Create or Update: `docs/plans/{YYYYMM}/{FID}-plan.md`.
|
|
587
|
+
Project documents: the converted plan carries `Documentation Consultation` and `Documentation Warnings`, and each task that touches an assessed topic names its `READ` / `UPDATE` documents. Later steps read those sources and warn from applicable tasks; a missing or starter-only document warns and the run continues.
|
|
491
588
|
3. Finish, then re-run sub-step 1 with `CONVERTED` = true:
|
|
492
589
|
```bash
|
|
493
590
|
"{BKIT}" steps finish --workflow=build --step=build-plan-convert --file="{STATUS}" --attempt-of=build-plan-convert:next --artifact=docs/plans/{YYYYMM}/{FID}-plan.md --optional-artifact=docs/plans/{YYYYMM}/logs/{FID}/build-plan-check.md --number=4 --post --title="Plan Convert" --message="chore({FID}): plan-convert attempt <attempt>"
|
|
@@ -565,6 +662,22 @@ description: "Build Feature — Autonomous implementation"
|
|
|
565
662
|
|
|
566
663
|
---
|
|
567
664
|
|
|
665
|
+
## Pending takeovers
|
|
666
|
+
|
|
667
|
+
A takeover task rewrites an earlier task's planned test that a later change contradicts. A code step's `steps finish` adds the task and its group to the plan when it refuses that change. Step 8 and a gate re-run on resume run this section first, so the takeover group's tests are recorded before a verify or a gate reads the plan; Step 7 writes the group's code when the Group Loop reaches it.
|
|
668
|
+
|
|
669
|
+
1. Read the takeover group whose tests are not recorded yet:
|
|
670
|
+
```bash
|
|
671
|
+
"{BKIT}" tasks takeover --pending --plan="docs/plans/{YYYYMM}/{FID}-plan.md" --file="{STATUS}"
|
|
672
|
+
```
|
|
673
|
+
2. **If** `pending` != null → record the group's tests now:
|
|
674
|
+
- Hold `GROUP` as `TAKEOVER_RETURN`, then set `GROUP` = `pending.group`.
|
|
675
|
+
- Run Step 7 sub-steps 3-6 for that group. Where they route to step 7, come back here instead: the Group Loop writes the group's code later.
|
|
676
|
+
- Set `GROUP` = `TAKEOVER_RETURN`.
|
|
677
|
+
3. Go back to where this section was run from.
|
|
678
|
+
|
|
679
|
+
---
|
|
680
|
+
|
|
568
681
|
## Group Loop — Steps 7-9
|
|
569
682
|
|
|
570
683
|
Each task group gets its own pass of Steps 7-9, in group order. Step 7 briefs the first group with an open task, writes its planned tests, records them red and then writes its code; Step 8 verifies that group's own diff, and Step 9 closes its gaps. Attempt budgets count per group (`--group`). Per-group files are named `{step}-{GROUP}-{ATTEMPT}.md`. When no group is left open → Step 10.
|
|
@@ -604,6 +717,7 @@ Each task group gets its own pass of Steps 7-9, in group order. Step 7 briefs th
|
|
|
604
717
|
"{BKIT}" steps finish --workflow=build --step=build-plan-tests --file="{STATUS}" --attempt-of=build-plan-tests:next --group={GROUP} --plan="docs/plans/{YYYYMM}/{FID}-plan.md" --agent=bkit-build-plan-tests --artifact=docs/plans/{YYYYMM}/logs/{FID}/build-plan-tests-{GROUP}-log.md --number=7 --post --title="Plan Execute — tests" --message="chore({FID}): plan-tests group {GROUP} attempt <attempt>"
|
|
605
718
|
```
|
|
606
719
|
**If** exit 15 → the diff changes a file no `TEST FIRST` line of the group names (`source`): invoke `@bkit-build-plan-tests` again with `"<problem> Undo your edits to each file in <source>: restore it to its committed content, or delete it when you created it. Write no source code."` → wait for subagent and re-run the block → **If** still non-zero → **Failure Path**.
|
|
720
|
+
**If** exit 11 → the diff changes an earlier task's recorded test that no open task of the group names (`tests`): invoke `@bkit-build-plan-tests` again with `"<problem> Put each test in <tests> back as it was committed; change only the tests a TEST FIRST line of group {GROUP} names."` → wait for subagent and re-run the block → **If** still non-zero → **Failure Path**.
|
|
607
721
|
Hold `verdict` as `WRITE_VERDICT`.
|
|
608
722
|
**If** `WRITE_RESUMED` is not held for `GROUP` **and** `WRITE_VERDICT` = HANDOVER → the agent stopped at its turn cap. This is a handover, not a failed attempt: `WRITE_RESUMED` = `GROUP`, then re-run from step 3. Its brief leaves out the tests the log records `WROTE`.
|
|
609
723
|
6. Record the reds, before any task code exists:
|
|
@@ -629,7 +743,7 @@ Each task group gets its own pass of Steps 7-9, in group order. Step 7 briefs th
|
|
|
629
743
|
```bash
|
|
630
744
|
"{BKIT}" steps finish --workflow=build --step=build-plan-tasks --file="{STATUS}" --attempt-of=build-plan-tasks:next --group={GROUP} --agent=bkit-build-plan-tasks --artifact=docs/plans/{YYYYMM}/logs/{FID}/build-plan-tasks-{GROUP}-log.md --number=7 --post --title="Plan Execute — code" --message="chore({FID}): plan-execute group {GROUP} attempt <attempt>"
|
|
631
745
|
```
|
|
632
|
-
**If** exit 11 → the code step edited a planned test case the tests step recorded (`tests`; the engine logs an `agent-rework` friction row): invoke `@bkit-build-plan-tasks` again with
|
|
746
|
+
**If** exit 11 → the code step edited a planned test case the tests step recorded (`tests`; the engine logs an `agent-rework` friction row): invoke `@bkit-build-plan-tasks` again with ``"<problem> Put each test in <tests> back as the tests step left it; your other edits to those files stay. Or, when a correct code change forces the edit, keep it and append the line BLOCKED — TASK {N}: test `{file}` `{name}` — {why} to '<reask.artifact>', then append DONE — TASK {N} again. Do not redo other tasks."`` → wait for subagent and re-run the block → **If** still non-zero → **Failure Path**.
|
|
633
747
|
Hold `verdict` as `TASKS_VERDICT`.
|
|
634
748
|
9. Read the group's open tasks:
|
|
635
749
|
```bash
|
|
@@ -656,6 +770,8 @@ Each task group gets its own pass of Steps 7-9, in group order. Step 7 briefs th
|
|
|
656
770
|
|
|
657
771
|
### 🧠 Step 8 — Plan Verify
|
|
658
772
|
|
|
773
|
+
Run § Pending takeovers first.
|
|
774
|
+
|
|
659
775
|
1. Derive the attempt the verify artifact is named for:
|
|
660
776
|
```bash
|
|
661
777
|
"{BKIT}" counters derive --file="{STATUS}" --workflow=build --step=build-plan-verify --group={GROUP} --position=next
|
|
@@ -678,6 +794,11 @@ Each task group gets its own pass of Steps 7-9, in group order. Step 7 briefs th
|
|
|
678
794
|
Context: You are a subagent in the Build phase. Group verification. Group `{GROUP}`, attempt `{VERIFY_ATTEMPT}`. Switch into the working directory with `cd "{WORKTREE_PATH}"`, check it with `pwd`, and use it for every file operation that follows. Plan caps (`bkit.workflows.tasks`): {MAX_TASKS_PER_GROUP} tasks and {MAX_TESTS_PER_GROUP} `TEST FIRST` tests per group; {MAX_TESTS_PER_TASK} tests across {MAX_TEST_FILES_PER_TASK} test files per task.
|
|
679
795
|
Read: glob `docs/plans/{YYYYMM}/logs/{FID}/build-brief-{GROUP}-*.md`, `docs/plans/{YYYYMM}/logs/{FID}/build-diff-{GROUP}-{VERIFY_ATTEMPT}.md`, `docs/plans/{YYYYMM}/logs/{FID}/build-plan-tests-{GROUP}-log.md` (if present), `docs/plans/{YYYYMM}/logs/{FID}/build-plan-tasks-{GROUP}-log.md`, `docs/plans/{YYYYMM}/logs/{FID}/build-tests-green-{GROUP}-{VERIFY_ATTEMPT}.md`, `docs/plans/{YYYYMM}/logs/{FID}/build-plan-current.md` (if present), glob `docs/plans/{YYYYMM}/logs/{FID}/build-plan-verify-{GROUP}-*.md`, glob `docs/plans/{YYYYMM}/logs/{FID}/build-plan-gaps-remediate-{GROUP}-*-log.md`, glob `docs/plans/{YYYYMM}/logs/{FID}/build-decision-*.md`.
|
|
680
796
|
Create: `docs/plans/{YYYYMM}/logs/{FID}/build-plan-verify-{GROUP}-{VERIFY_ATTEMPT}.md`.
|
|
797
|
+
Result: `{OUTBOX}/build-plan-verify-{GROUP}-{VERIFY_ATTEMPT}-result.json`. Before the launch, delete any older file at the Result path, so a subagent that dies leaves no result to render.
|
|
798
|
+
When the verifier is done, produce the group's verify report from its result:
|
|
799
|
+
```bash
|
|
800
|
+
"{BKIT}" steps stub --agent=bkit-build-plan-verify --result-file="{OUTBOX}/build-plan-verify-{GROUP}-{VERIFY_ATTEMPT}-result.json" --to="docs/plans/{YYYYMM}/logs/{FID}/build-plan-verify-{GROUP}-{VERIFY_ATTEMPT}.md"
|
|
801
|
+
```
|
|
681
802
|
5. Finish:
|
|
682
803
|
```bash
|
|
683
804
|
"{BKIT}" steps finish --workflow=build --step=build-plan-verify --file="{STATUS}" --attempt-of=build-plan-verify:next --group={GROUP} --agent=bkit-build-plan-verify --artifact="docs/plans/{YYYYMM}/logs/{FID}/build-plan-verify-{GROUP}-<attempt>.md" --number=8 --post --title="Plan Verify" --message="chore({FID}): plan-verify group {GROUP} attempt <attempt>"
|
|
@@ -698,9 +819,13 @@ Each task group gets its own pass of Steps 7-9, in group order. Step 7 briefs th
|
|
|
698
819
|
- **If** the printed `groups` hold a group numbered above `GROUP` → sub-step 8.
|
|
699
820
|
- **Else** → `GATE_VERDICT` = SKIPPED → sub-step 10.
|
|
700
821
|
- **Else** → `GATE_VERDICT` = SKIPPED → sub-step 10.
|
|
701
|
-
8. Run the group gate: the static checks and the unit tier. The integration tier
|
|
822
|
+
8. Run the group gate on the files changed since the newest passing run of the gate or its fix run, from `GROUP_BASE` when there is none: the static checks and the unit tier for them. The whole unit tier and the integration tier run once, at Step 12. **If** `GROUP_BASE` is not held (a Decision Pause re-run or a resume) → re-derive it first:
|
|
823
|
+
```bash
|
|
824
|
+
"{BKIT}" status route --step=build-group-start --group={GROUP} --file="{STATUS}" --workflow=build
|
|
825
|
+
```
|
|
826
|
+
Hold `parentSha` as `GROUP_BASE`. **If** `GROUP_BASE` = null → **Failure Path**. The gate writes the trimmed log to the artifact:
|
|
702
827
|
```bash
|
|
703
|
-
"{BKIT}" tests run --gate=bkit:gate:static-unit --log="{OUTBOX}/build-group-gate-{GROUP}-{VERIFY_ATTEMPT}.log" --artifact="docs/plans/{YYYYMM}/logs/{FID}/build-group-gate-{GROUP}-{VERIFY_ATTEMPT}.md" --fid={FID} --file="{STATUS}" --workflow=build --step=build-group-gate-{GROUP} --attempt={VERIFY_ATTEMPT}
|
|
828
|
+
"{BKIT}" tests run --gate=bkit:gate:static-unit --changed-since={GROUP_BASE} --since-pass-of=build-group-gate-{GROUP},build-group-gate-{GROUP}-fix --log="{OUTBOX}/build-group-gate-{GROUP}-{VERIFY_ATTEMPT}.log" --artifact="docs/plans/{YYYYMM}/logs/{FID}/build-group-gate-{GROUP}-{VERIFY_ATTEMPT}.md" --fid={FID} --file="{STATUS}" --workflow=build --step=build-group-gate-{GROUP} --attempt={VERIFY_ATTEMPT}
|
|
704
829
|
```
|
|
705
830
|
Route:
|
|
706
831
|
- **If** exit 0 **or** 1 → hold `verdict` as `GATE_VERDICT` and `scope` as `TEST_SCOPE` → sub-step 9.
|
|
@@ -710,13 +835,13 @@ Each task group gets its own pass of Steps 7-9, in group order. Step 7 briefs th
|
|
|
710
835
|
```bash
|
|
711
836
|
"{BKIT}" steps finish --workflow=build --step=build-group-gate --file="{STATUS}" --verdict={GATE_VERDICT} --scope="{TEST_SCOPE}" --attempt-of=build-plan-verify:current --group={GROUP} --artifact="docs/plans/{YYYYMM}/logs/{FID}/build-group-gate-{GROUP}-<attempt>.md" --clamp-log="build-group-gate-{GROUP}:<attempt>" --number=8 --post --title="Group Gate" --message="chore({FID}): group-gate group {GROUP} attempt <attempt>"
|
|
712
837
|
```
|
|
713
|
-
10. **If** `VERIFY_VERDICT` = PASS **and** `GATE_VERDICT` != FAIL → Step 7, which briefs the next group or goes to Step 10 when none is open.
|
|
838
|
+
10. **If** `VERIFY_VERDICT` = PASS **and** `GATE_VERDICT` != FAIL → Step 7 without asking, which briefs the next group or goes to Step 10 when none is open.
|
|
714
839
|
11. **If** `VERIFY_VERDICT` = CONCERNS **or** `VERIFY_VERDICT` = FAIL **or** `GATE_VERDICT` = FAIL → route on the group's verify rounds:
|
|
715
840
|
```bash
|
|
716
841
|
"{BKIT}" counters route --name=VERIFY_ATTEMPT --of=build-plan-verify:current --file="{STATUS}" --workflow=build --group={GROUP} --point=build.verify --continue=within-limit --exceeded=failure-path
|
|
717
842
|
```
|
|
718
843
|
Hold `value` as `VERIFY_ROUNDS`, `max` as `PAUSE_MAX` and `ask` as `LIMIT_ASK`.
|
|
719
|
-
Set `PAUSE_STEP` = 8
|
|
844
|
+
Set `PAUSE_STEP` = 8, `PAUSE_POINT` = `build.verify` and `SOURCE_CHANGED` = false.
|
|
720
845
|
**If** `LIMIT_ASK` = true **and** either exit 1 **or** `VERIFY_ROUNDS` = `PAUSE_MAX` → `PAUSE_LOOP` = `verify`, so the pause also asks whether to try another round.
|
|
721
846
|
Route — first match wins:
|
|
722
847
|
- **If** exit 1 **and** `LIMIT_ASK` = true → `PAUSE_QUESTION` = `VERIFY_GAPS` → **Decision Pause** — `build.verify.maxAttempts` is used up, so the owner decides.
|
|
@@ -750,7 +875,7 @@ Each task group gets its own pass of Steps 7-9, in group order. Step 7 briefs th
|
|
|
750
875
|
```bash
|
|
751
876
|
"{BKIT}" status route --file="{STATUS}" --workflow=build --step=build-plan-gaps-remediate --group={GROUP} --require=strategy
|
|
752
877
|
```
|
|
753
|
-
Hold `nextStrategy` as `STRATEGY`.
|
|
878
|
+
Hold `nextStrategy` as `STRATEGY` and `repeatTests` as `REPEAT_TESTS`.
|
|
754
879
|
- **If** `VERIFY_VERDICT` is not held (resumed into this step) → read group `{GROUP}`'s last verify round back, one block at a time:
|
|
755
880
|
```bash
|
|
756
881
|
"{BKIT}" counters derive --file="{STATUS}" --workflow=build --step=build-plan-verify --group={GROUP} --position=current
|
|
@@ -766,29 +891,34 @@ Each task group gets its own pass of Steps 7-9, in group order. Step 7 briefs th
|
|
|
766
891
|
"{BKIT}" status route --file="{STATUS}" --workflow=build --step=build-group-gate --group={GROUP} --require=verdict
|
|
767
892
|
```
|
|
768
893
|
Hold `verdict` as `GATE_VERDICT`.
|
|
769
|
-
2. **If** `VERIFY_LOOSENED` != `none` → the tests step removed or loosened an expectation of an existing test (each `test-loosened` gap of the verify report, `Fixable: true`). The tests step restores it, because no code step may rewrite a planned test
|
|
770
|
-
**Subagent:** Invoke `@bkit-build-plan-tests` using `Agent` tool:
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
Record the restore. The command reads the group's `TEST FIRST` files from the plan and commits the diff:
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
Record the group's red again:
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
894
|
+
2. **If** `VERIFY_LOOSENED` != `none` → restore the loosened tests with the sub-steps below; no fixer runs this round. The tests step removed or loosened an expectation of an existing test (each `test-loosened` gap of the verify report, `Fixable: true`). The tests step restores it, because no code step may rewrite a planned test:
|
|
895
|
+
1. **Subagent:** Invoke `@bkit-build-plan-tests` using `Agent` tool:
|
|
896
|
+
Context: You are a subagent in the Build phase. Restore these tests of group `{GROUP}`, which verify logged `test-loosened`: `{VERIFY_LOOSENED}`. Switch into the working directory with `cd "{WORKTREE_PATH}"`, check it with `pwd`, and use it for every file operation that follows. Plan caps (`bkit.workflows.tasks`): {MAX_TASKS_PER_GROUP} tasks and {MAX_TESTS_PER_GROUP} `TEST FIRST` tests per group; {MAX_TESTS_PER_TASK} tests across {MAX_TEST_FILES_PER_TASK} test files per task.
|
|
897
|
+
Read: `docs/plans/{YYYYMM}/logs/{FID}/build-plan-verify-{GROUP}-{VERIFY_ATTEMPT}.md`, `docs/plans/{YYYYMM}/logs/{FID}/build-tests-green-{GROUP}-{VERIFY_ATTEMPT}.md`, `docs/plans/{YYYYMM}/logs/{FID}/build-plan-tests-{GROUP}-log.md`.
|
|
898
|
+
Update: the tests named, `docs/plans/{YYYYMM}/logs/{FID}/build-plan-tests-{GROUP}-log.md`.
|
|
899
|
+
2. Record the restore. The command reads the group's `TEST FIRST` files from the plan and commits the diff:
|
|
900
|
+
```bash
|
|
901
|
+
"{BKIT}" steps finish --workflow=build --step=build-plan-tests --file="{STATUS}" --attempt-of=build-plan-tests:next --group={GROUP} --plan="docs/plans/{YYYYMM}/{FID}-plan.md" --agent=bkit-build-plan-tests --artifact=docs/plans/{YYYYMM}/logs/{FID}/build-plan-tests-{GROUP}-log.md --number=7 --post --title="Plan Execute — tests restored" --message="chore({FID}): plan-tests group {GROUP} attempt <attempt>"
|
|
902
|
+
```
|
|
903
|
+
Route exit 15 and exit 11 as Step 7 sub-step 5 routes them, with the same re-asks, and re-run this block.
|
|
904
|
+
3. Record the group's red again:
|
|
905
|
+
```bash
|
|
906
|
+
"{BKIT}" counters derive --file="{STATUS}" --workflow=build --step=build-tests-red --group={GROUP} --position=next
|
|
907
|
+
```
|
|
908
|
+
Hold `value` as `RED_ATTEMPT`.
|
|
909
|
+
```bash
|
|
910
|
+
"{BKIT}" tests red --file="{STATUS}" --workflow=build --group={GROUP} --plan="docs/plans/{YYYYMM}/{FID}-plan.md" --log="docs/plans/{YYYYMM}/logs/{FID}/build-tests-red-{GROUP}-{RED_ATTEMPT}.md" --writer-log="docs/plans/{YYYYMM}/logs/{FID}/build-plan-tests-{GROUP}-log.md"
|
|
911
|
+
```
|
|
912
|
+
4. Route — first match wins:
|
|
913
|
+
- **If** exit 0, 1 or 3 → re-run Step 8: the next verify round judges the restored diff, and a test the restore left unproven waits for Step 15 like any other.
|
|
914
|
+
- **Else** → **Failure Path**.
|
|
915
|
+
3. **If** `GROUP_BASE` is not held (a Decision Pause re-run or a resume) → re-derive it first:
|
|
784
916
|
```bash
|
|
785
|
-
"{BKIT}"
|
|
917
|
+
"{BKIT}" status route --step=build-group-start --group={GROUP} --file="{STATUS}" --workflow=build
|
|
786
918
|
```
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
3. **Subagent:** Invoke `@bkit-build-plan-gaps-remediate` using `Agent` tool:
|
|
791
|
-
Context: You are a subagent in the Build phase. Group `{GROUP}`, attempt `{VERIFY_ATTEMPT}`. `Strategy`: `{STRATEGY}`. **If** `GATE_VERDICT` = FAIL → add `Group gate`: `"{BKIT}" tests run --gate=bkit:gate:static-unit --log="{OUTBOX}/build-plan-gaps-remediate-{GROUP}-{VERIFY_ATTEMPT}-gate.log"`. **If** `VERIFY_VERDICT` = FAIL → add `Scope`: `fixable only`. Switch into the working directory with `cd "{WORKTREE_PATH}"`, check it with `pwd`, and use it for every file operation that follows.
|
|
919
|
+
Hold `parentSha` as `GROUP_BASE`. **If** `GROUP_BASE` = null → **Failure Path**.
|
|
920
|
+
**Subagent:** Invoke `@bkit-build-plan-gaps-remediate` using `Agent` tool:
|
|
921
|
+
Context: You are a subagent in the Build phase. Group `{GROUP}`, attempt `{VERIFY_ATTEMPT}`. `Strategy`: `{STRATEGY}`. **If** `REPEAT_TESTS` is not empty → add `Repeat tests`: `{REPEAT_TESTS}`. **If** `GATE_VERDICT` = FAIL → add `Group gate`: `"{BKIT}" tests run --gate=bkit:gate:static-unit --changed-since={GROUP_BASE} --since-pass-of=build-group-gate-{GROUP},build-group-gate-{GROUP}-fix --log="{OUTBOX}/build-plan-gaps-remediate-{GROUP}-{VERIFY_ATTEMPT}-gate.log" --file="{STATUS}" --workflow=build --step=build-group-gate-{GROUP}-fix --attempt={VERIFY_ATTEMPT}`. **If** `VERIFY_VERDICT` = FAIL → add `Scope`: `fixable only`. Switch into the working directory with `cd "{WORKTREE_PATH}"`, check it with `pwd`, and use it for every file operation that follows.
|
|
792
922
|
Read: glob `docs/plans/{YYYYMM}/logs/{FID}/build-brief-{GROUP}-*.md`, `docs/plans/{YYYYMM}/logs/{FID}/status.jsonl`, `docs/plans/{YYYYMM}/logs/{FID}/build-plan-verify-{GROUP}-{VERIFY_ATTEMPT}.md`, `docs/plans/{YYYYMM}/logs/{FID}/build-group-gate-{GROUP}-{VERIFY_ATTEMPT}.md` (if present), `docs/plans/{YYYYMM}/logs/{FID}/build-tests-green-{GROUP}-{VERIFY_ATTEMPT}.md`, `docs/plans/{YYYYMM}/logs/{FID}/build-plan-tests-{GROUP}-log.md` (if present), glob `docs/plans/{YYYYMM}/logs/{FID}/build-plan-gaps-remediate-{GROUP}-*-log.md`, glob `docs/plans/{YYYYMM}/logs/{FID}/build-decision-{RUN}-*.md` (highest number, if present).
|
|
793
923
|
Update: Source files.
|
|
794
924
|
Create: `docs/plans/{YYYYMM}/logs/{FID}/build-plan-gaps-remediate-{GROUP}-{VERIFY_ATTEMPT}-log.md`.
|
|
@@ -796,15 +926,18 @@ Each task group gets its own pass of Steps 7-9, in group order. Step 7 briefs th
|
|
|
796
926
|
```bash
|
|
797
927
|
"{BKIT}" steps finish --workflow=build --step=build-plan-gaps-remediate --file="{STATUS}" --attempt-of=build-plan-verify:current --group={GROUP} --agent=bkit-build-plan-gaps-remediate --artifact="docs/plans/{YYYYMM}/logs/{FID}/build-plan-gaps-remediate-{GROUP}-<attempt>-log.md" --number=9 --post --title="Plan Gaps Remediate" --message="chore({FID}): plan-gaps-remediate group {GROUP} attempt <attempt>"
|
|
798
928
|
```
|
|
799
|
-
**If** exit 11 → the fix edited a planned test case the tests step recorded (`tests`; the engine logs an `agent-rework` friction row): invoke `@bkit-build-plan-gaps-remediate` again with
|
|
929
|
+
**If** exit 11 → the fix edited a planned test case the tests step recorded (`tests`; the engine logs an `agent-rework` friction row): invoke `@bkit-build-plan-gaps-remediate` again with ``"<problem> Put each test in <tests> back as the tests step left it; your other edits to those files stay. Or, when a correct code change forces the edit, keep it and append the line BLOCKED — Gap {N}: test `{file}` `{name}` — {why} to your log, then append DONE — Gap {N} again. Correct the Fixed count and verdict in your log to match."`` → wait for subagent and re-run the block → **If** still non-zero → **Failure Path**.
|
|
800
930
|
Hold `fields.Fixed` as `VERIFY_FIXED`. Nothing routes on `verdict`: it only goes on the step's row. Step 8 runs again and judges the fixes. A later PASS verification of the same group resolves a gaps-fix FAIL in the summary; separate warnings remain concerns.
|
|
801
931
|
5. Check that the attempt changed source files, not only logs and ledgers:
|
|
802
932
|
```bash
|
|
803
933
|
cd "{WORKTREE_PATH}" && "{BKIT}" branches scan-diff --base=HEAD~1 --code >/dev/null
|
|
804
934
|
```
|
|
805
|
-
Exit 1 means the attempt changed no source file.
|
|
935
|
+
Exit 1 means the attempt changed no source file. Hold `SOURCE_CHANGED` = true on exit 0, else false.
|
|
806
936
|
Route — first match wins:
|
|
807
|
-
- **If** exit 1 **or** `VERIFY_FIXED` = 0
|
|
937
|
+
- **If** exit 1 **or** `VERIFY_FIXED` = 0:
|
|
938
|
+
- Set `PAUSE_STEP` = 9, `PAUSE_POINT` = `build.verify` and `PAUSE_QUESTION` = `VERIFY_GAPS`.
|
|
939
|
+
- **If** `GATE_VERDICT` = FAIL → also set `PAUSE_LOOP` = `verify`, so the pause asks the loop question about the red gate.
|
|
940
|
+
- Go to **Decision Pause**.
|
|
808
941
|
- **If** exit 0 → re-run Step 8.
|
|
809
942
|
- **Else** → **Failure Path**.
|
|
810
943
|
|
|
@@ -820,38 +953,116 @@ Each task group gets its own pass of Steps 7-9, in group order. Step 7 briefs th
|
|
|
820
953
|
|
|
821
954
|
## 🧠 Step 10 — Plan Verify Holistic
|
|
822
955
|
|
|
823
|
-
This step
|
|
956
|
+
This step checks the whole feature against the plan after the last group, and again each time later groups ran, such as Build Challenge's fix groups. Its gaps and a red holistic gate get a fix loop like Steps 8-9: fixable gaps and gate failures are fixed and checked again, and the rest go to the **Decision Pause**. Holistic fix rounds count within the run against `build.holistic.maxAttempts`, with no reset after a clean check. The holistic gate tests the files changed since its newest passing run or its fix run's, and the whole feature when there is none. Holistic report and fix-log file names carry the run number, so a restart overwrites no earlier run's file.
|
|
824
957
|
|
|
825
|
-
1.
|
|
958
|
+
1. Derive the attempt the holistic report is named for:
|
|
826
959
|
```bash
|
|
827
|
-
"{BKIT}"
|
|
960
|
+
"{BKIT}" counters derive --file="{STATUS}" --workflow=build --step=build-plan-verify-holistic --position=next
|
|
828
961
|
```
|
|
829
|
-
|
|
962
|
+
Hold `value` as `HOLISTIC_ATTEMPT`.
|
|
830
963
|
2. Write the run's diff to the file the agent reads:
|
|
831
964
|
```bash
|
|
832
965
|
cd "{WORKTREE_PATH}" && "{BKIT}" context diff --reset-log --artifact="tmp/bkit-diff-{FID}.md" --fid={FID} --step=build-plan-verify-holistic >/dev/null || exit 2
|
|
833
966
|
```
|
|
834
967
|
**Subagent:** Invoke `@bkit-build-plan-verify` using `Agent` tool:
|
|
835
|
-
Context: You are a subagent in the Build phase. Holistic plan verification (every group)
|
|
968
|
+
Context: You are a subagent in the Build phase. Holistic plan verification (every group), attempt `{HOLISTIC_ATTEMPT}`. Switch into the working directory with `cd "{WORKTREE_PATH}"`, check it with `pwd`, and use it for every file operation that follows. Plan caps (`bkit.workflows.tasks`): {MAX_TASKS_PER_GROUP} tasks and {MAX_TESTS_PER_GROUP} `TEST FIRST` tests per group; {MAX_TESTS_PER_TASK} tests across {MAX_TEST_FILES_PER_TASK} test files per task.
|
|
836
969
|
Read: `docs/plans/{YYYYMM}/{FID}-plan.md`, glob `docs/plans/{YYYYMM}/logs/{FID}/build-plan-tasks-*-log.md`, glob `docs/plans/{YYYYMM}/logs/{FID}/build-plan-verify-*.md`, glob `docs/plans/{YYYYMM}/logs/{FID}/build-plan-gaps-remediate-*-log.md`, glob `docs/plans/{YYYYMM}/logs/{FID}/build-decision-*.md`, `tmp/bkit-diff-{FID}.md` (the run's diff; review full feature diff for cross-group integration).
|
|
837
|
-
Create: `docs/plans/{YYYYMM}/logs/{FID}/build-plan-verify-holistic.md`.
|
|
970
|
+
Create: `docs/plans/{YYYYMM}/logs/{FID}/build-plan-verify-holistic-{RUN}-{HOLISTIC_ATTEMPT}.md`.
|
|
971
|
+
Result: `{OUTBOX}/build-plan-verify-holistic-{RUN}-{HOLISTIC_ATTEMPT}-result.json`. Before the launch, delete any older file at the Result path, so a subagent that dies leaves no result to render.
|
|
972
|
+
When the holistic verifier is done, produce the holistic report from its result:
|
|
973
|
+
```bash
|
|
974
|
+
"{BKIT}" steps stub --agent=bkit-build-plan-verify --result-file="{OUTBOX}/build-plan-verify-holistic-{RUN}-{HOLISTIC_ATTEMPT}-result.json" --to="docs/plans/{YYYYMM}/logs/{FID}/build-plan-verify-holistic-{RUN}-{HOLISTIC_ATTEMPT}.md"
|
|
975
|
+
```
|
|
838
976
|
3. Finish:
|
|
839
977
|
```bash
|
|
840
|
-
"{BKIT}" steps finish --workflow=build --step=build-plan-verify-holistic --file="{STATUS}" --attempt=
|
|
978
|
+
"{BKIT}" steps finish --workflow=build --step=build-plan-verify-holistic --file="{STATUS}" --attempt-of=build-plan-verify-holistic:next --agent=bkit-build-plan-verify --artifact="docs/plans/{YYYYMM}/logs/{FID}/build-plan-verify-holistic-{RUN}-<attempt>.md" --number=10 --post --title="Plan Verify Holistic" --message="chore({FID}): plan-verify-holistic attempt <attempt>"
|
|
841
979
|
```
|
|
842
|
-
Hold `fields.Tasks` as `VERIFIED_TASKS`.
|
|
980
|
+
Hold `verdict` as `HOLISTIC_VERDICT`, `failures` as `HOLISTIC_FAILURES`, `fields.Fixable` as `HOLISTIC_FIXABLE`, `fields.Tasks` as `VERIFIED_TASKS`.
|
|
843
981
|
4. Tick each group's satisfied tasks, with one call per task group. Set `{GROUP}` to that group and `{VERIFIED_TASKS}` to the numbers `Tasks:` names for it:
|
|
844
982
|
```bash
|
|
845
983
|
"{BKIT}" tasks tick --plan="docs/plans/{YYYYMM}/{FID}-plan.md" --group={GROUP} --tasks="{VERIFIED_TASKS}"
|
|
846
984
|
```
|
|
847
|
-
5.
|
|
848
|
-
|
|
985
|
+
5. Run the holistic gate on every round: the static checks and the unit tier for the files changed since its newest passing run or its fix run's, from the feature's start commit when there is none. **If** `HOLISTIC_ATTEMPT` is not held (a resume re-runs the gate) → read the last holistic round's attempt back:
|
|
986
|
+
```bash
|
|
987
|
+
"{BKIT}" counters derive --file="{STATUS}" --workflow=build --step=build-plan-verify-holistic --position=current
|
|
988
|
+
```
|
|
989
|
+
Hold `value` as `HOLISTIC_ATTEMPT`. The gate writes the trimmed log to the artifact:
|
|
990
|
+
```bash
|
|
991
|
+
"{BKIT}" tests run --gate=bkit:gate:static-unit --changed-since=feature-base --since-pass-of=build-holistic-gate,build-holistic-gate-fix --log="{OUTBOX}/build-holistic-gate-{HOLISTIC_ATTEMPT}.log" --artifact="docs/plans/{YYYYMM}/logs/{FID}/build-holistic-gate-{RUN}-{HOLISTIC_ATTEMPT}.md" --fid={FID} --file="{STATUS}" --workflow=build --step=build-holistic-gate --attempt={HOLISTIC_ATTEMPT}
|
|
992
|
+
```
|
|
993
|
+
Route:
|
|
994
|
+
- **If** exit 0 **or** 1 → hold `verdict` as `GATE_VERDICT` and `scope` as `TEST_SCOPE` → sub-step 6.
|
|
995
|
+
- **If** exit 81 → end turn, re-run this block.
|
|
996
|
+
- **Else** → **Failure Path**.
|
|
997
|
+
6. Finish:
|
|
998
|
+
```bash
|
|
999
|
+
"{BKIT}" steps finish --workflow=build --step=build-holistic-gate --file="{STATUS}" --verdict={GATE_VERDICT} --scope="{TEST_SCOPE}" --attempt-of=build-plan-verify-holistic:current --artifact="docs/plans/{YYYYMM}/logs/{FID}/build-holistic-gate-{RUN}-<attempt>.md" --clamp-log="build-holistic-gate:<attempt>" --number=10 --post --title="Holistic Gate" --message="chore({FID}): holistic-gate attempt <attempt>"
|
|
1000
|
+
```
|
|
1001
|
+
7. Route — first match wins:
|
|
1002
|
+
- **If** `GATE_VERDICT` = FAIL → sub-step 8, for a round that fixes the gate.
|
|
1003
|
+
- **If** `HOLISTIC_VERDICT` = PASS **and** `GATE_VERDICT` != FAIL → Step 11.
|
|
1004
|
+
- **If** `HOLISTIC_VERDICT` = CONCERNS **and** `HOLISTIC_FAILURES` = 0 **and** `GATE_VERDICT` != FAIL → Step 11. No gap is open: the report's concern is a group count, which the summary lists.
|
|
1005
|
+
- **If** `HOLISTIC_VERDICT` = CONCERNS **or** `HOLISTIC_VERDICT` = FAIL → sub-step 8.
|
|
1006
|
+
- **Else** → **Failure Path**.
|
|
1007
|
+
8. Route on the holistic fix rounds of this run:
|
|
1008
|
+
```bash
|
|
1009
|
+
"{BKIT}" counters route --name=HOLISTIC_ATTEMPT --of=build-plan-gaps-remediate-holistic:next --file="{STATUS}" --workflow=build --point=build.holistic --continue=within-limit --exceeded=failure-path
|
|
1010
|
+
```
|
|
1011
|
+
Hold `value` as `HOLISTIC_ROUNDS`, `max` as `PAUSE_MAX` and `ask` as `LIMIT_ASK`.
|
|
1012
|
+
Set `PAUSE_STEP` = 10, `PAUSE_POINT` = `build.holistic` and `SOURCE_CHANGED` = false.
|
|
1013
|
+
**If** `LIMIT_ASK` = true **and** exit 1 → `PAUSE_LOOP` = `holistic`, so the pause also asks whether to try another round.
|
|
1014
|
+
Route — first match wins:
|
|
1015
|
+
- **If** exit 1 **and** `LIMIT_ASK` = true → `PAUSE_QUESTION` = `VERIFY_GAPS` → **Decision Pause** — `build.holistic.maxAttempts` is used up, so the owner decides.
|
|
1016
|
+
- **If** exit 1 → **Failure Path** — `build.holistic.maxAttempts` is used up.
|
|
1017
|
+
- **If** exit 0 **and** `GATE_VERDICT` != FAIL **and** `HOLISTIC_FIXABLE` = false → `PAUSE_QUESTION` = `VERIFY_GAPS` → **Decision Pause**.
|
|
1018
|
+
- **If** exit 0 → sub-step 9, for a round that fixes the fixable gaps and the gate. Gate failures are always fixed, never asked.
|
|
849
1019
|
- **Else** → **Failure Path**.
|
|
1020
|
+
9. **Run only if** sub-step 8 **or** the **Decision Pause** routed here. Read status.jsonl and derive the next `STRATEGY`:
|
|
1021
|
+
```bash
|
|
1022
|
+
"{BKIT}" status route --file="{STATUS}" --workflow=build --step=build-plan-gaps-remediate-holistic --require=strategy
|
|
1023
|
+
```
|
|
1024
|
+
Hold `nextStrategy` as `STRATEGY` and `repeatTests` as `REPEAT_TESTS`.
|
|
1025
|
+
- **If** `HOLISTIC_ATTEMPT` is not held (resumed into this sub-step) → read the last holistic round's attempt back with sub-step 5's `counters derive` block.
|
|
1026
|
+
- **If** `GATE_VERDICT` is not held (resumed into this sub-step) → read the holistic gate's verdict back:
|
|
1027
|
+
- **If** `docs/plans/{YYYYMM}/logs/{FID}/build-holistic-gate-{RUN}-{HOLISTIC_ATTEMPT}.md` does not exist → `GATE_VERDICT` = SKIPPED.
|
|
1028
|
+
- **Else** → read the holistic gate's verdict:
|
|
1029
|
+
```bash
|
|
1030
|
+
"{BKIT}" status route --file="{STATUS}" --workflow=build --step=build-holistic-gate --require=verdict
|
|
1031
|
+
```
|
|
1032
|
+
Hold `verdict` as `GATE_VERDICT`.
|
|
1033
|
+
10. **Subagent:** Invoke `@bkit-build-plan-gaps-remediate` using `Agent` tool:
|
|
1034
|
+
Context: You are a subagent in the Build phase. `Mode`: `Holistic`, attempt `{HOLISTIC_ATTEMPT}`. `Strategy`: `{STRATEGY}`. **If** `REPEAT_TESTS` is not empty → add `Repeat tests`: `{REPEAT_TESTS}`. **If** `GATE_VERDICT` = FAIL → add `Holistic gate`: `"{BKIT}" tests run --gate=bkit:gate:static-unit --changed-since=feature-base --since-pass-of=build-holistic-gate,build-holistic-gate-fix --log="{OUTBOX}/build-plan-gaps-remediate-holistic-{RUN}-{HOLISTIC_ATTEMPT}-gate.log" --file="{STATUS}" --workflow=build --step=build-holistic-gate-fix --attempt={HOLISTIC_ATTEMPT}`. `Scope`: `fixable only`. Switch into the working directory with `cd "{WORKTREE_PATH}"`, check it with `pwd`, and use it for every file operation that follows.
|
|
1035
|
+
Read: `docs/plans/{YYYYMM}/{FID}-plan.md`, `docs/plans/{YYYYMM}/logs/{FID}/status.jsonl`, `docs/plans/{YYYYMM}/logs/{FID}/build-plan-verify-holistic-{RUN}-{HOLISTIC_ATTEMPT}.md`, `docs/plans/{YYYYMM}/logs/{FID}/build-holistic-gate-{RUN}-{HOLISTIC_ATTEMPT}.md` (if present), glob `docs/plans/{YYYYMM}/logs/{FID}/build-plan-gaps-remediate-holistic-{RUN}-*-log.md`, glob `docs/plans/{YYYYMM}/logs/{FID}/build-decision-{RUN}-*.md` (highest number, if present).
|
|
1036
|
+
Update: Source files.
|
|
1037
|
+
Create: `docs/plans/{YYYYMM}/logs/{FID}/build-plan-gaps-remediate-holistic-{RUN}-{HOLISTIC_ATTEMPT}-log.md`.
|
|
1038
|
+
11. Finish. The command records the header's `Strategy`:
|
|
1039
|
+
```bash
|
|
1040
|
+
"{BKIT}" steps finish --workflow=build --step=build-plan-gaps-remediate-holistic --file="{STATUS}" --attempt-of=build-plan-verify-holistic:current --agent=bkit-build-plan-gaps-remediate --artifact="docs/plans/{YYYYMM}/logs/{FID}/build-plan-gaps-remediate-holistic-{RUN}-<attempt>-log.md" --number=10 --post --title="Holistic Gaps Remediate" --message="chore({FID}): plan-gaps-remediate holistic attempt <attempt>"
|
|
1041
|
+
```
|
|
1042
|
+
**If** exit 11 → the fix edited a planned test case the tests step recorded (`tests`; the engine logs an `agent-rework` friction row): invoke `@bkit-build-plan-gaps-remediate` again with ``"<problem> Put each test in <tests> back as the tests step left it; your other edits to those files stay. Or, when a correct code change forces the edit, keep it and append the line BLOCKED — Gap {N}: test `{file}` `{name}` — {why} to your log, then append DONE — Gap {N} again. Correct the Fixed count and verdict in your log to match."`` → wait for subagent and re-run the block → **If** still non-zero → **Failure Path**.
|
|
1043
|
+
Hold `fields.Fixed` as `HOLISTIC_FIXED`. Nothing routes on `verdict`: it only goes on the step's row. Sub-step 1 runs again and judges the fixes. A later PASS holistic verification resolves a holistic gaps-fix FAIL in the summary.
|
|
1044
|
+
12. Check that the attempt changed source files, as Step 9 sub-step 5 does:
|
|
1045
|
+
```bash
|
|
1046
|
+
cd "{WORKTREE_PATH}" && "{BKIT}" branches scan-diff --base=HEAD~1 --code >/dev/null
|
|
1047
|
+
```
|
|
1048
|
+
Hold `SOURCE_CHANGED` = true on exit 0, else false.
|
|
1049
|
+
Route — first match wins:
|
|
1050
|
+
- **If** exit 1 **or** `HOLISTIC_FIXED` = 0:
|
|
1051
|
+
- Set `PAUSE_STEP` = 10, `PAUSE_POINT` = `build.holistic` and `PAUSE_QUESTION` = `VERIFY_GAPS`.
|
|
1052
|
+
- **If** `GATE_VERDICT` = FAIL → also set `PAUSE_LOOP` = `holistic`, so the pause asks the loop question about the red gate.
|
|
1053
|
+
- Go to **Decision Pause**.
|
|
1054
|
+
- **If** exit 0 → Step 7, which runs a takeover group the fix added and goes straight to Step 10 when no group is open.
|
|
1055
|
+
- **Else** → **Failure Path**.
|
|
850
1056
|
|
|
851
1057
|
### 🔒 Gate 10 — Plan Verify Holistic
|
|
852
1058
|
|
|
853
1059
|
- [ ] Subagent invoked (`@bkit-build-plan-verify`, holistic, no inline work)
|
|
854
1060
|
- [ ] Mechanical checks passed (`steps finish`)
|
|
1061
|
+
- [ ] Holistic gate run and recorded on every round
|
|
1062
|
+
- [ ] Step 11 reached only with no red holistic gate
|
|
1063
|
+
- [ ] Holistic gaps and gate failures routed: fixed in a holistic round, or asked at the **Decision Pause**
|
|
1064
|
+
- [ ] Holistic fix invoked (`@bkit-build-plan-gaps-remediate`, holistic, no inline work), or no round run
|
|
1065
|
+
- [ ] No-progress holistic round routed
|
|
855
1066
|
|
|
856
1067
|
---
|
|
857
1068
|
|
|
@@ -891,10 +1102,17 @@ This step runs once, after the last group. Challenge fix groups pass through it
|
|
|
891
1102
|
Context: You are a subagent in the Build phase running in parallel with another agent. Switch into the working directory with `cd "{WORKTREE_PATH}"`, check it with `pwd`, and use it for every file operation that follows. Plan caps (`bkit.workflows.tasks`): {MAX_TESTS_PER_TASK} tests across {MAX_TEST_FILES_PER_TASK} test files per task.
|
|
892
1103
|
Read: `docs/plans/{YYYYMM}/{FID}-plan.md`, `tmp/bkit-diff-{FID}.md` (the run's diff).
|
|
893
1104
|
Create: `docs/plans/{YYYYMM}/logs/{FID}/build-challenge-1.md`.
|
|
1105
|
+
Result: `{OUTBOX}/build-challenge-1-result.json`. Before the launch, delete any older file at the Result path, so a subagent that dies leaves no result to render.
|
|
894
1106
|
- **Subagent:** Invoke `@bkit-build-challenge-2` using `Agent` tool:
|
|
895
1107
|
Context: You are a subagent in the Build phase running in parallel with another agent. Switch into the working directory with `cd "{WORKTREE_PATH}"`, check it with `pwd`, and use it for every file operation that follows. Plan caps (`bkit.workflows.tasks`): {MAX_TESTS_PER_TASK} tests across {MAX_TEST_FILES_PER_TASK} test files per task.
|
|
896
1108
|
Read: `docs/plans/{YYYYMM}/{FID}-plan.md`, `tmp/bkit-diff-{FID}.md` (the run's diff).
|
|
897
1109
|
Create: `docs/plans/{YYYYMM}/logs/{FID}/build-challenge-2.md`.
|
|
1110
|
+
Result: `{OUTBOX}/build-challenge-2-result.json`. Before the launch, delete any older file at the Result path, so a subagent that dies leaves no result to render.
|
|
1111
|
+
Once the subagents return, render each challenge report from its result. **If** `CHALLENGE_SIZE` = small → render only `bkit-build-challenge-2`:
|
|
1112
|
+
```bash
|
|
1113
|
+
"{BKIT}" steps stub --agent=bkit-build-challenge-1 --result-file="{OUTBOX}/build-challenge-1-result.json" --to="docs/plans/{YYYYMM}/logs/{FID}/build-challenge-1.md"
|
|
1114
|
+
"{BKIT}" steps stub --agent=bkit-build-challenge-2 --result-file="{OUTBOX}/build-challenge-2-result.json" --to="docs/plans/{YYYYMM}/logs/{FID}/build-challenge-2.md"
|
|
1115
|
+
```
|
|
898
1116
|
4. Wait for all subagents to complete, then finish — `verdict` = worst of the reports (`FAIL > CONCERNS > PASS`), `failures` = their sum. **If** `CHALLENGE_SIZE` = small → drop the `--agent=bkit-build-challenge-1` / `--artifact=docs/plans/{YYYYMM}/logs/{FID}/build-challenge-1.md` pair:
|
|
899
1117
|
```bash
|
|
900
1118
|
"{BKIT}" steps finish --workflow=build --step=build-challenge --file="{STATUS}" --attempt=next --agent=bkit-build-challenge-1 --agent=bkit-build-challenge-2 --artifact=docs/plans/{YYYYMM}/logs/{FID}/build-challenge-1.md --artifact=docs/plans/{YYYYMM}/logs/{FID}/build-challenge-2.md --field=round={CHALLENGE_ROUND} --number=11 --post --title="Build Challenge" --message="chore({FID}): build-challenge attempt <attempt>"
|
|
@@ -969,7 +1187,7 @@ This step runs once, after the last group. Challenge fix groups pass through it
|
|
|
969
1187
|
```
|
|
970
1188
|
**If** exit non-zero → **Failure Path**. Hold `trend` as `TEST_TREND`.
|
|
971
1189
|
- **If** `TEST_TREND` = `stuck` **or** `worse` → `PAUSE_STEP` = 12, `PAUSE_POINT` = `build.tests`, `PAUSE_QUESTION` = `TESTS_LOOP` → **Decision Pause**.
|
|
972
|
-
- **Else** → Step 13; a failed test round
|
|
1190
|
+
- **Else** → Step 13; a failed test round whose trend is not `stuck` or `worse` (`closing`, `unknown`) is always fixed, never asked.
|
|
973
1191
|
- **Else** → **Failure Path**.
|
|
974
1192
|
- **Else** → **Failure Path**.
|
|
975
1193
|
|
|
@@ -990,15 +1208,20 @@ This step runs once, after the last group. Challenge fix groups pass through it
|
|
|
990
1208
|
```bash
|
|
991
1209
|
"{BKIT}" status route --file="{STATUS}" --workflow=build --step=build-failure-diagnose --require=strategy
|
|
992
1210
|
```
|
|
993
|
-
Hold `nextStrategy` as `STRATEGY`. **If** `TEST_ATTEMPT` is not held (resumed into this step) → read the test round back:
|
|
1211
|
+
Hold `nextStrategy` as `STRATEGY` and `repeatTests` as `REPEAT_TESTS`. **If** `TEST_ATTEMPT` is not held (resumed into this step) → read the test round back:
|
|
994
1212
|
```bash
|
|
995
1213
|
"{BKIT}" counters derive --file="{STATUS}" --workflow=build --step=build-run-tests --position=current
|
|
996
1214
|
```
|
|
997
1215
|
Hold `value` as `TEST_ATTEMPT`.
|
|
998
1216
|
2. **Subagent:** Invoke `@bkit-debug-failure-diagnose` using `Agent` tool:
|
|
999
|
-
Context: You are a subagent in the Build Debug phase. Test failure during Build workflow. `Strategy`: `{STRATEGY}`. Switch into the working directory with `cd "{WORKTREE_PATH}"`, check it with `pwd`, and use it for every file operation that follows.
|
|
1217
|
+
Context: You are a subagent in the Build Debug phase. Test failure during Build workflow. `Strategy`: `{STRATEGY}`. **If** `REPEAT_TESTS` is not empty → add `Repeat tests`: `{REPEAT_TESTS}`. Switch into the working directory with `cd "{WORKTREE_PATH}"`, check it with `pwd`, and use it for every file operation that follows.
|
|
1000
1218
|
Read: `docs/plans/{YYYYMM}/logs/{FID}/run-tests-{TEST_ATTEMPT}.md`, `docs/plans/{YYYYMM}/{FID}-plan.md`, `docs/plans/{YYYYMM}/logs/{FID}/status.jsonl`, glob `docs/plans/{YYYYMM}/logs/{FID}/build-decision-{RUN}-*.md` (highest number, if present).
|
|
1001
1219
|
Create: `docs/plans/{YYYYMM}/logs/{FID}/build-failure-diagnose-{TEST_ATTEMPT}.md`.
|
|
1220
|
+
Result: `{OUTBOX}/build-failure-diagnose-{TEST_ATTEMPT}-result.json`. Before the launch, delete any older file at the Result path, so a subagent that dies leaves no result to render.
|
|
1221
|
+
When the diagnosing agent is done, produce the test-failure diagnosis from its result:
|
|
1222
|
+
```bash
|
|
1223
|
+
"{BKIT}" steps stub --agent=bkit-debug-failure-diagnose --result-file="{OUTBOX}/build-failure-diagnose-{TEST_ATTEMPT}-result.json" --to="docs/plans/{YYYYMM}/logs/{FID}/build-failure-diagnose-{TEST_ATTEMPT}.md"
|
|
1224
|
+
```
|
|
1002
1225
|
3. Finish:
|
|
1003
1226
|
```bash
|
|
1004
1227
|
"{BKIT}" steps finish --workflow=build --step=build-failure-diagnose --file="{STATUS}" --attempt-of=build-run-tests:current --strategy={STRATEGY} --agent=bkit-debug-failure-diagnose --artifact="docs/plans/{YYYYMM}/logs/{FID}/build-failure-diagnose-<attempt>.md" --number=13 --post --title="Failure Diagnose" --message="chore({FID}): failure-diagnose attempt <attempt>"
|
|
@@ -1048,19 +1271,21 @@ This step runs once, after the last group. Challenge fix groups pass through it
|
|
|
1048
1271
|
|
|
1049
1272
|
**Run only if** all Step 12 tests PASS.
|
|
1050
1273
|
|
|
1051
|
-
1. Ask once about the planned tests that never failed before their code existed. **Skip if**
|
|
1274
|
+
1. Ask once about the planned tests a code step changed, then once about the planned tests that never failed before their code existed. **Skip if** `docs/plans/{YYYYMM}/logs/{FID}/build-decision-{RUN}-*.md` files hold both the line `Question: CHANGED_TESTS` and the line `Question: UNPROVEN`, because the owner already answered both this run → sub-step 2.
|
|
1052
1275
|
```bash
|
|
1053
1276
|
"{BKIT}" tests green --file="{STATUS}" --workflow=build --plan="docs/plans/{YYYYMM}/{FID}-plan.md" --log="docs/plans/{YYYYMM}/logs/{FID}/build-tests-green-final.md"
|
|
1054
1277
|
```
|
|
1055
|
-
**If** exit >= 2 → **Failure Path**. Hold `unproven` as `UNPROVEN_TESTS`.
|
|
1278
|
+
**If** exit >= 2 → **Failure Path**. Hold `changed` as `CHANGED_TESTS` and `unproven` as `UNPROVEN_TESTS`.
|
|
1056
1279
|
Route:
|
|
1057
|
-
- **If** `
|
|
1280
|
+
- **If** `CHANGED_TESTS` is not empty **and** no decision file holds the line `Question: CHANGED_TESTS` → `PAUSE_STEP` = 15, `PAUSE_POINT` = `build.verify`, `PAUSE_QUESTION` = `CHANGED_TESTS` → **Decision Pause**. Headless, it takes `Accept (assumed)` for each test, and ship asks the owner to confirm them.
|
|
1281
|
+
- **If** `UNPROVEN_TESTS` is not empty **and** no decision file holds the line `Question: UNPROVEN` → `PAUSE_STEP` = 15, `PAUSE_POINT` = `build.verify`, `PAUSE_QUESTION` = `UNPROVEN` → **Decision Pause**. Headless, it takes `Accept (assumed)` for each test, and ship asks the owner to confirm them.
|
|
1058
1282
|
- **Else** → sub-step 2.
|
|
1059
1283
|
2. Write `build-summary.md` from this run's status rows and the plan's tasks:
|
|
1060
1284
|
```bash
|
|
1061
1285
|
"{BKIT}" workflows summary --workflow=build --file="{STATUS}" --publish={PUBLISH}
|
|
1062
1286
|
```
|
|
1063
1287
|
**If** exit non-zero → **Failure Path**. Hold `verdict` as `SUMMARY_VERDICT`, `failures` as `SUMMARY_FAILURES`.
|
|
1288
|
+
The summary's `## Documentation Warnings` section lists this run's attributed documentation gaps once per topic and gap, with the evidence and action each agent gave. It is advisory: it changes no verdict. Show it in the final return and do not re-aggregate it.
|
|
1064
1289
|
3. Finish:
|
|
1065
1290
|
```bash
|
|
1066
1291
|
"{BKIT}" steps finish --workflow=build --step=build-summary --file="{STATUS}" --attempt=1 --verdict={SUMMARY_VERDICT} --failures={SUMMARY_FAILURES} --artifact=docs/plans/{YYYYMM}/logs/{FID}/build-summary.md --number=15 --post --title=Summary --link-ref={BRANCH} --comment-body --message="chore({FID}): summary"
|
|
@@ -1087,6 +1312,7 @@ This step runs once, after the last group. Challenge fix groups pass through it
|
|
|
1087
1312
|
|
|
1088
1313
|
### 🔒 Gate 15 — Summary
|
|
1089
1314
|
|
|
1315
|
+
- [ ] Changed planned tests asked once, or none left
|
|
1090
1316
|
- [ ] Unproven planned tests asked once, or none left
|
|
1091
1317
|
- [ ] `workflows summary` printed a verdict
|
|
1092
1318
|
- [ ] Mechanical checks passed (`steps finish`)
|
|
@@ -1144,7 +1370,7 @@ This block appends the roadmap row in the worktree only, closes and commits the
|
|
|
1144
1370
|
- **If** one is found → **Failure Path**.
|
|
1145
1371
|
- **Else** → sub-step 2.
|
|
1146
1372
|
- **Else** → sub-step 2.
|
|
1147
|
-
2. Scan the
|
|
1373
|
+
2. Scan everything the push publishes for migrations, measured from `origin/dev`:
|
|
1148
1374
|
```bash
|
|
1149
1375
|
"{BKIT}" branches scan-diff --base=origin/dev --paths='(^|/)(migrations|migrate)/' >/dev/null
|
|
1150
1376
|
```
|
|
@@ -1155,6 +1381,8 @@ This block appends the roadmap row in the worktree only, closes and commits the
|
|
|
1155
1381
|
3. Re-read the labels, then close the run once with the block below. The block mirrors the roadmap row to `dev`, closes the run (telemetry, report, artifact links) and commits it. Its commit subject carries ` bkit [auto route]` when the re-read labels hold `bkit:auto`. Retain its outputs before the push so a push retry preserves the original final return. `{LABEL_FLAGS}` = one `--label=<name>` per re-read `LABELS` entry, and empty when no tracker is wired:
|
|
1156
1382
|
<!-- bkit:tracker true start -->
|
|
1157
1383
|
|
|
1384
|
+
**If** the no-issue warning was emitted → add `--warning="<that warning>"`.
|
|
1385
|
+
|
|
1158
1386
|
**Skip if** `ISSUE_ID` empty. Re-read the issue:
|
|
1159
1387
|
|
|
1160
1388
|
```bash
|
|
@@ -1162,19 +1390,18 @@ This block appends the roadmap row in the worktree only, closes and commits the
|
|
|
1162
1390
|
```
|
|
1163
1391
|
|
|
1164
1392
|
Hold `state` as `STATE`, `labels` as `LABELS`. **If** exit 80 → read them via the tracker MCP (**Tracker**).
|
|
1165
|
-
**If** the no-issue warning was emitted → add `--warning="<that warning>"`.
|
|
1166
1393
|
<!-- bkit:tracker true end -->
|
|
1167
1394
|
|
|
1168
1395
|
```bash
|
|
1169
1396
|
"{BKIT}" roadmap mirror --workflow=build --fid={FID} >/dev/null || exit 1
|
|
1170
|
-
"{BKIT}" workflows close --workflow=build --fid={FID} --month={YYYYMM} --owner-repo={OWNER_REPO} --outbox="{OUTBOX}" --message="chore({FID}): close-workflow" {LABEL_FLAGS} --number=16 --
|
|
1397
|
+
"{BKIT}" workflows close --workflow=build --fid={FID} --month={YYYYMM} --owner-repo={OWNER_REPO} --outbox="{OUTBOX}" --message="chore({FID}): close-workflow" {LABEL_FLAGS} --number=16 --title="Close Workflow & Create PR" --tree={BRANCH} --final-return --summary-file="docs/plans/{YYYYMM}/logs/{FID}/build-summary.md" --session-dir="{SESSION_DIR}" --line="CI not awaited here — /bkit-ship gates on its result; red → /bkit-debug." || exit 1
|
|
1171
1398
|
```
|
|
1172
1399
|
|
|
1173
1400
|
Route:
|
|
1174
1401
|
- **If** exit 0 → continue with the next instruction.
|
|
1175
1402
|
- **Else** → **Failure Path**.
|
|
1176
1403
|
|
|
1177
|
-
Hold the close's `commentFile` as `CLOSE_COMMENT_FILE
|
|
1404
|
+
Hold the close's `commentFile` as `CLOSE_COMMENT_FILE` and `finalReturn` as `FINAL_RETURN`. The close prepares its report for the single completion comment in sub-step 7.
|
|
1178
1405
|
|
|
1179
1406
|
Push with the HEAD-Subject Assertion:
|
|
1180
1407
|
|
|
@@ -1206,7 +1433,7 @@ This block appends the roadmap row in the worktree only, closes and commits the
|
|
|
1206
1433
|
Route:
|
|
1207
1434
|
- **If** exit 0 → hold `url` as `PR_URL` and `number` as `PR_NUMBER`.
|
|
1208
1435
|
- **If** exit 80:
|
|
1209
|
-
- Call `create_pull_request` with the printed `title`, `
|
|
1436
|
+
- Call `create_pull_request` with the printed `title`, `base` and `head`, and the content of the printed `bodyFile` as `body`.
|
|
1210
1437
|
- Hold its URL as `PR_URL` and its number as `PR_NUMBER`.
|
|
1211
1438
|
- **If** its base != dev → **Failure Path**.
|
|
1212
1439
|
- **Else** → **Failure Path**.
|
|
@@ -1227,19 +1454,23 @@ This block appends the roadmap row in the worktree only, closes and commits the
|
|
|
1227
1454
|
"{BKIT}" steps done --workflow=build --step=build-create-pr --file="{STATUS}" --artifact={PR_URL} --commit=none
|
|
1228
1455
|
```
|
|
1229
1456
|
6. Run the CI-Dispatch Gate. It records `build-close-workflow` with its `ciDispatch` verdict, cross-checks the transport and records the close transport.
|
|
1230
|
-
|
|
1457
|
+
Issue the invocation once and hold its `invocation` as `INVOCATION`:
|
|
1231
1458
|
```bash
|
|
1232
|
-
"{BKIT}"
|
|
1459
|
+
"{BKIT}" status invocation --workflow=build --step=build-close-workflow --file="{STATUS}"
|
|
1460
|
+
```
|
|
1461
|
+
```bash
|
|
1462
|
+
"{BKIT}" runs dispatch --pr={PR_NUMBER} --fid={FID} {LABEL_FLAGS} --file="{STATUS}" --workflow=build --step=build-close-workflow --invocation="{INVOCATION}"
|
|
1233
1463
|
```
|
|
1234
1464
|
Route:
|
|
1235
1465
|
- **If** exit 80 **or** 81 → **CI wait turn-loop** → re-run this block.
|
|
1236
1466
|
- **If** exit 0 → sub-step 7.
|
|
1237
1467
|
- **Else** → **Failure Path**.
|
|
1238
1468
|
7. <!-- bkit:tracker true start -->
|
|
1239
|
-
**Skip if** `ISSUE_ID` empty.
|
|
1469
|
+
**Skip if** `ISSUE_ID` empty. Post the completion report with the PR link. Drop `--body-file` when `CLOSE_COMMENT_FILE` is null:
|
|
1240
1470
|
```bash
|
|
1241
|
-
"{BKIT}" issues comment --post --issue="{ISSUE_ID}" --step-number=16 --step-title="Create PR" --owner-repo={OWNER_REPO} --pr-number={PR_NUMBER} --pr-url={PR_URL}
|
|
1471
|
+
"{BKIT}" issues comment --post --purpose=terminal --workflow=build --file="{STATUS}" --issue="{ISSUE_ID}" --step-number=16 --step-title="Create PR" --owner-repo={OWNER_REPO} --pr-number={PR_NUMBER} --pr-url={PR_URL} --body-file="{CLOSE_COMMENT_FILE}"
|
|
1242
1472
|
```
|
|
1473
|
+
Hold this report's `commentFile` as `CLOSE_COMMENT_FILE` and `tracker` as `CLOSE_TRACKER` for sub-step 10's fallback.
|
|
1243
1474
|
<!-- bkit:tracker true end -->
|
|
1244
1475
|
8. <!-- bkit:tracker true start -->
|
|
1245
1476
|
**Skip if** `ISSUE_ID` empty.
|
|
@@ -1249,7 +1480,7 @@ This block appends the roadmap row in the worktree only, closes and commits the
|
|
|
1249
1480
|
Hold `board` as `BOARD` and `trackerState` as `TRACKER_STATE`.
|
|
1250
1481
|
**If** `tracker.done` = false **or** `boardWrite.done` = false → apply the printed `labels` / `trackerState` / `board` via the tracker MCP (**Labels** fallback).
|
|
1251
1482
|
<!-- bkit:tracker true end -->
|
|
1252
|
-
9. Re-read the issue's labels after the push,
|
|
1483
|
+
9. Re-read the issue's labels after the push, to report a removed `bkit:auto`:
|
|
1253
1484
|
<!-- bkit:tracker true start -->
|
|
1254
1485
|
**Skip if** `ISSUE_ID` empty. Re-read the issue:
|
|
1255
1486
|
```bash
|
|
@@ -1258,7 +1489,7 @@ This block appends the roadmap row in the worktree only, closes and commits the
|
|
|
1258
1489
|
Hold `state` as `STATE`, `labels` as `LABELS`. **If** exit 80 → read them via the tracker MCP (**Tracker**).
|
|
1259
1490
|
<!-- bkit:tracker true end -->
|
|
1260
1491
|
<!-- bkit:tracker true start -->
|
|
1261
|
-
**Skip if** `ISSUE_ID` empty. After reading issue (`issue-read`): **If** `bkit:auto` not in `LABELS` →
|
|
1492
|
+
**Skip if** `ISSUE_ID` empty. After reading issue (`issue-read`): **If** `bkit:auto` not in `LABELS` → the run ends as it would anyway, because its push is done → add the line `Label bkit:auto removed during this run: the cloud gate starts no new run on this issue until it is added back` after `{FINAL_RETURN}` in the final message.
|
|
1262
1493
|
<!-- bkit:tracker true end -->
|
|
1263
1494
|
10. <!-- bkit:tracker true start -->
|
|
1264
1495
|
**Skip if** `ISSUE_ID` empty. **If** `CLOSE_TRACKER`.done = false → post the content of `CLOSE_COMMENT_FILE` via the tracker MCP (**Comments** fallback).
|
|
@@ -1302,7 +1533,7 @@ Both paths:
|
|
|
1302
1533
|
|
|
1303
1534
|
- [ ] Marker `bkit [auto route]` present
|
|
1304
1535
|
- [ ] Issue update attempted
|
|
1305
|
-
- [ ]
|
|
1536
|
+
- [ ] Labels re-read after the push
|
|
1306
1537
|
- [ ] Artifact link list and telemetry report posted
|
|
1307
1538
|
|
|
1308
1539
|
<!-- bkit:tracker true end -->
|