@cbartens/bkit 5.5.0 → 6.0.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 +30 -20
- package/.bkit/core/.agents/docs.md +1 -0
- package/.bkit/core/.agents/rules.md +51 -26
- package/.bkit/core/.bkit/README.md +29 -19
- package/.bkit/core/.bkit/authoring.md +117 -0
- package/.bkit/core/.bkit/cloud.md +11 -11
- package/.bkit/core/.bkit/comparison.md +5 -5
- package/.bkit/core/.bkit/install.md +20 -20
- package/.bkit/core/.bkit/jsonl.md +202 -122
- package/.bkit/core/.bkit/lite.md +1 -1
- package/.bkit/core/.bkit/pipeline.md +49 -52
- package/.bkit/core/.bkit/prompts.md +106 -167
- package/.bkit/core/.bkit/providers.md +29 -32
- package/.bkit/core/.bkit/templates.md +44 -18
- package/.bkit/core/.bkit/trackers.md +60 -28
- package/.bkit/core/.bkit/workflows.md +399 -359
- package/.bkit/core/AGENTS.md +16 -22
- package/.bkit/core/docs/templates/bkit-audit-accessibility.md +14 -38
- package/.bkit/core/docs/templates/bkit-audit-adoption.md +16 -40
- package/.bkit/core/docs/templates/bkit-audit-agents.md +19 -43
- package/.bkit/core/docs/templates/bkit-audit-aio-seo.md +16 -40
- package/.bkit/core/docs/templates/bkit-audit-analytics.md +14 -38
- package/.bkit/core/docs/templates/bkit-audit-annotations.md +11 -35
- package/.bkit/core/docs/templates/bkit-audit-app-performance.md +15 -39
- package/.bkit/core/docs/templates/bkit-audit-app-store.md +12 -36
- package/.bkit/core/docs/templates/bkit-audit-architecture.md +16 -40
- package/.bkit/core/docs/templates/bkit-audit-ci-performance.md +16 -40
- package/.bkit/core/docs/templates/bkit-audit-config.md +18 -42
- package/.bkit/core/docs/templates/bkit-audit-cost.md +16 -40
- package/.bkit/core/docs/templates/bkit-audit-coverage.md +15 -39
- package/.bkit/core/docs/templates/bkit-audit-database.md +16 -40
- package/.bkit/core/docs/templates/bkit-audit-dead-code.md +15 -39
- package/.bkit/core/docs/templates/bkit-audit-deferrals.md +15 -38
- package/.bkit/core/docs/templates/bkit-audit-dependencies.md +16 -40
- package/.bkit/core/docs/templates/bkit-audit-documentation.md +11 -35
- package/.bkit/core/docs/templates/bkit-audit-duplication.md +18 -42
- package/.bkit/core/docs/templates/bkit-audit-failures.md +13 -37
- package/.bkit/core/docs/templates/bkit-audit-flakes.md +12 -36
- package/.bkit/core/docs/templates/bkit-audit-gates.md +14 -38
- package/.bkit/core/docs/templates/bkit-audit-issues.md +15 -39
- package/.bkit/core/docs/templates/bkit-audit-llm.md +16 -40
- package/.bkit/core/docs/templates/bkit-audit-logs.md +14 -38
- package/.bkit/core/docs/templates/bkit-audit-models.md +12 -36
- package/.bkit/core/docs/templates/bkit-audit-privacy.md +12 -36
- package/.bkit/core/docs/templates/bkit-audit-prompts.md +15 -39
- package/.bkit/core/docs/templates/bkit-audit-red-team.md +15 -39
- package/.bkit/core/docs/templates/bkit-audit-reliability.md +15 -39
- package/.bkit/core/docs/templates/bkit-audit-repo.md +12 -36
- package/.bkit/core/docs/templates/bkit-audit-security.md +13 -37
- package/.bkit/core/docs/templates/bkit-audit-slop.md +14 -38
- package/.bkit/core/docs/templates/bkit-audit-testing.md +12 -36
- package/.bkit/core/docs/templates/bkit-audit-usability.md +16 -40
- package/.bkit/core/docs/templates/bkit-plan.md +97 -226
- package/.bkit/core/engine/checks/after/ci-yml.ts +39 -30
- package/.bkit/core/engine/checks/after/github.ts +101 -72
- package/.bkit/core/engine/checks/after/index.ts +10 -12
- package/.bkit/core/engine/checks/after/suppression.ts +8 -5
- package/.bkit/core/engine/checks/after/tools.ts +47 -92
- package/.bkit/core/engine/checks/before/env.ts +2 -2
- package/.bkit/core/engine/checks/before/files.ts +5 -4
- package/.bkit/core/engine/checks/before/index.ts +18 -1
- package/.bkit/core/engine/checks/before/repo.ts +168 -2
- package/.bkit/core/engine/checks/tips/catalogue.ts +16 -5
- package/.bkit/core/engine/checks/tips/detect.ts +34 -0
- package/.bkit/core/engine/checks/tips/index.ts +10 -7
- package/.bkit/core/engine/cli.ts +20 -53
- package/.bkit/core/engine/commands/analysis.ts +171 -140
- package/.bkit/core/engine/commands/ci/ci.ts +6 -6
- package/.bkit/core/engine/commands/comply.ts +77 -103
- package/.bkit/core/engine/commands/install/doctor.ts +2 -2
- package/.bkit/core/engine/commands/install/install.ts +57 -18
- package/.bkit/core/engine/commands/install/uninstall.ts +65 -28
- package/.bkit/core/engine/commands/land.ts +18 -12
- package/.bkit/core/engine/commands/lib.ts +79 -17
- package/.bkit/core/engine/commands/registry.ts +4 -0
- package/.bkit/core/engine/commands/setup/setup.ts +7 -7
- package/.bkit/core/engine/commands/stats.ts +204 -0
- package/.bkit/core/engine/commands/tips.ts +10 -5
- package/.bkit/core/engine/commands/workflow/branches.ts +741 -62
- package/.bkit/core/engine/commands/workflow/challenge.ts +673 -0
- package/.bkit/core/engine/commands/workflow/context.ts +853 -29
- package/.bkit/core/engine/commands/workflow/counters.ts +267 -84
- package/.bkit/core/engine/commands/workflow/decisions.ts +541 -0
- package/.bkit/core/engine/commands/workflow/disk.ts +2 -2
- package/.bkit/core/engine/commands/workflow/fids.ts +793 -33
- package/.bkit/core/engine/commands/workflow/issues.ts +427 -105
- package/.bkit/core/engine/commands/workflow/ledgers.ts +884 -27
- package/.bkit/core/engine/commands/workflow/locks.ts +26 -2
- package/.bkit/core/engine/commands/workflow/plan-blocks.ts +582 -0
- package/.bkit/core/engine/commands/workflow/plan-versions.ts +21 -0
- package/.bkit/core/engine/commands/workflow/prs.ts +166 -30
- package/.bkit/core/engine/commands/workflow/repo.ts +59 -7
- package/.bkit/core/engine/commands/workflow/roadmap.ts +16 -7
- package/.bkit/core/engine/commands/workflow/run-facts.ts +501 -0
- package/.bkit/core/engine/commands/workflow/runs.ts +179 -49
- package/.bkit/core/engine/commands/workflow/runtime.ts +22 -1
- package/.bkit/core/engine/commands/workflow/status.ts +142 -29
- package/.bkit/core/engine/commands/workflow/step-table.ts +339 -0
- package/.bkit/core/engine/commands/workflow/steps.ts +213 -88
- package/.bkit/core/engine/commands/workflow/summary.ts +398 -0
- package/.bkit/core/engine/commands/workflow/tests.ts +1013 -148
- package/.bkit/core/engine/commands/workflow/tracker.ts +1195 -0
- package/.bkit/core/engine/commands/workflow/workflows.ts +984 -207
- package/.bkit/core/engine/commands/workflow/workstreams.ts +11 -5
- package/.bkit/core/engine/commands/workflow/worktrees.ts +276 -22
- package/.bkit/core/engine/install/manifest.ts +11 -9
- package/.bkit/core/engine/install/modules/cloud.ts +21 -13
- package/.bkit/core/engine/install/modules/core.ts +325 -7
- package/.bkit/core/engine/install/modules/opencode.ts +2 -2
- package/.bkit/core/engine/install/version-file.ts +6 -2
- package/.bkit/core/engine/ledgers/migrate.ts +92 -0
- package/.bkit/core/engine/ledgers/status.ts +92 -15
- package/.bkit/core/engine/ledgers/telemetry.ts +1261 -254
- package/.bkit/core/engine/render/hosts.ts +4 -0
- package/.bkit/core/engine/render/models.ts +12 -0
- package/.bkit/core/engine/shared/branches.ts +4 -1
- package/.bkit/core/engine/shared/egress.ts +7 -0
- package/.bkit/core/engine/shared/json.ts +25 -7
- package/.bkit/core/engine/shared/settings.ts +202 -33
- package/.bkit/core/engine/shared/text.ts +361 -0
- package/.bkit/core/engine/tools/grammar-density.ts +215 -0
- package/.bkit/core/engine/tools/instructions-sources.ts +834 -0
- package/.bkit/core/engine/tools/instructions.ts +1751 -0
- package/.bkit/core/hooks/gateguard-engine.js +24 -23
- package/.bkit/core/hooks/guardrails-shell.js +2 -3
- package/.bkit/core/hooks/guardrails-tiers.js +7 -1
- package/.bkit/core/hooks/readguard-engine.js +2 -2
- package/.bkit/core/prompts/bkit-audit-generate.md +62 -25
- package/.bkit/core/prompts/bkit-build-challenge-1.md +40 -17
- package/.bkit/core/prompts/bkit-build-challenge-2.md +44 -17
- package/.bkit/core/prompts/bkit-build-install-skills.md +26 -13
- package/.bkit/core/prompts/bkit-build-plan-convert.md +74 -0
- package/.bkit/core/prompts/bkit-build-plan-current.md +26 -13
- package/.bkit/core/prompts/bkit-build-plan-execute.md +74 -26
- package/.bkit/core/prompts/bkit-build-plan-gaps-remediate.md +64 -23
- package/.bkit/core/prompts/bkit-build-plan-verify.md +57 -33
- package/.bkit/core/prompts/bkit-debug-abort-handover.md +30 -14
- package/.bkit/core/prompts/bkit-debug-failure-diagnose.md +34 -14
- package/.bkit/core/prompts/bkit-debug-failure-remediate.md +34 -17
- package/.bkit/core/prompts/bkit-debug-failure-reproduce.md +26 -13
- package/.bkit/core/prompts/bkit-debug-failure-soak.md +31 -16
- package/.bkit/core/prompts/bkit-design-brainstorm-ideate-1.md +21 -11
- package/.bkit/core/prompts/bkit-design-brainstorm-ideate-2.md +20 -11
- package/.bkit/core/prompts/bkit-design-brainstorm-ideate-3.md +20 -11
- package/.bkit/core/prompts/bkit-design-generate.md +33 -13
- package/.bkit/core/prompts/bkit-design-organise.md +25 -12
- package/.bkit/core/prompts/bkit-design-review-1.md +31 -15
- package/.bkit/core/prompts/bkit-design-review-2.md +28 -13
- package/.bkit/core/prompts/bkit-design-spike.md +30 -13
- package/.bkit/core/prompts/bkit-design-update.md +33 -19
- package/.bkit/core/prompts/bkit-plan-generate.md +75 -19
- package/.bkit/core/prompts/bkit-plan-review-1.md +50 -27
- package/.bkit/core/prompts/bkit-plan-review-2.md +59 -28
- package/.bkit/core/prompts/bkit-plan-scope-check.md +109 -0
- package/.bkit/core/prompts/bkit-plan-update.md +61 -24
- package/.bkit/core/prompts/bkit-ship-conflict-resolve.md +27 -15
- package/.bkit/core/prompts/bkit-ship-deferred-sweep.md +31 -16
- package/.bkit/core/prompts/bkit-ship-update-docs.md +30 -15
- package/.bkit/core/prompts/bkit-utility-compress-markdown.md +24 -14
- package/.bkit/core/prompts/bkit-utility-update-decisions.md +32 -14
- package/.bkit/core/prompts/bkit-utility-update-deferrals.md +29 -14
- package/.bkit/core/prompts/bkit-utility-update-documentation.md +28 -13
- package/.bkit/core/prompts/bkit-utility-update-failures.md +31 -14
- package/.bkit/core/prompts/bkit-utility-update-knowledge.md +33 -14
- package/.bkit/core/prompts/bkit-utility-update-roadmap.md +38 -17
- package/.bkit/core/prompts/bkit-utility-update-tracker.md +43 -20
- package/.bkit/core/workflows/bkit-auto.md +54 -46
- package/.bkit/core/workflows/bkit-build.md +577 -458
- package/.bkit/core/workflows/bkit-debug.md +348 -333
- package/.bkit/core/workflows/bkit-design.md +201 -237
- package/.bkit/core/workflows/bkit-plan.md +210 -321
- package/.bkit/core/workflows/bkit-ship.md +328 -278
- package/.bkit/shared/.bkit/.env.example +2 -2
- package/.bkit/shared/.claude/settings.json +11 -0
- package/.bkit/shared/.cursor/mcp.json +1 -1
- package/.bkit/shared/.cursor/rules/bkit-rules.mdc +1 -1
- package/.bkit/shared/.gitattributes +1 -1
- package/.bkit/shared/.mcp.json +1 -1
- package/.bkit/shared/.opencode/opencode.json +11 -0
- package/.bkit/shared/CLAUDE.md +2 -2
- package/.bkit/shared/GEMINI.md +2 -2
- package/.bkit/shared/docs/architecture.md +1 -1
- package/.bkit/shared/docs/data-schema.md +1 -1
- package/.bkit/shared/docs/deployments.md +16 -28
- package/.bkit/shared/docs/design.md +1 -1
- package/.bkit/shared/docs/noise.md +1 -1
- package/.bkit/shared/docs/observability.md +2 -2
- package/.bkit/shared/docs/security.md +1 -1
- package/.bkit/shared/docs/setup.md +1 -1
- package/.bkit/shared/docs/technology.md +1 -1
- package/.bkit/shared/docs/testing.md +27 -10
- package/.bkit/templates/.claude/hooks/bkit-cloud-bootstrap.sh +1 -1
- package/.bkit/templates/.github/ISSUE_TEMPLATE/bkit-change.yml +26 -5
- package/.bkit/templates/.github/workflows/bkit-ci.yml +22 -84
- package/.bkit/templates/.github/workflows/bkit-cloud.yml +21 -19
- package/.bkit/templates/.husky/pre-push +52 -13
- package/.bkit/templates/.prettierignore +7 -0
- package/.bkit/templates/scripts/ci/bkit-local-stack-lock.sh +194 -0
- package/.bkit/templates/scripts/ci/check-capstone.mjs +2 -4
- package/.bkit/templates/scripts/ci/check-capstone.test.mjs +4 -23
- package/.bkit/templates/scripts/ci/lanes/resolve-push-base.mjs +104 -23
- package/.bkit/templates/scripts/ci/lanes/resolve-push-base.test.mjs +103 -6
- package/.bkit/templates/scripts/cleanup/bkit-disk-prune.mjs +1 -1
- package/.bkit/templates/scripts/graphify/bkit-graph-pre-push.sh +3 -1
- package/.bkit/templates/scripts/prettier/bkit-insert-ignore.mjs +49 -29
- package/CHANGELOG.md +142 -0
- package/README.md +58 -34
- package/dist/checks/after/ci-yml.js +39 -29
- package/dist/checks/after/github.js +99 -72
- package/dist/checks/after/index.js +11 -13
- package/dist/checks/after/suppression.js +8 -5
- package/dist/checks/after/tools.js +40 -83
- package/dist/checks/before/env.js +2 -2
- package/dist/checks/before/files.js +5 -3
- package/dist/checks/before/index.js +15 -2
- package/dist/checks/before/repo.js +163 -2
- package/dist/checks/tips/catalogue.js +14 -5
- package/dist/checks/tips/detect.js +32 -0
- package/dist/checks/tips/index.js +7 -5
- package/dist/cli.js +19 -47
- package/dist/commands/analysis.js +109 -100
- package/dist/commands/ci/ci.js +6 -6
- package/dist/commands/comply.js +54 -91
- package/dist/commands/install/doctor.js +2 -2
- package/dist/commands/install/install.js +50 -19
- package/dist/commands/install/uninstall.js +59 -28
- package/dist/commands/land.js +16 -12
- package/dist/commands/lib.js +51 -16
- package/dist/commands/registry.js +4 -0
- package/dist/commands/setup/setup.js +7 -7
- package/dist/commands/stats.js +136 -0
- package/dist/commands/tips.js +7 -3
- package/dist/commands/workflow/branches.js +656 -56
- package/dist/commands/workflow/challenge.js +556 -0
- package/dist/commands/workflow/context.js +709 -30
- package/dist/commands/workflow/counters.js +208 -75
- package/dist/commands/workflow/decisions.js +441 -0
- package/dist/commands/workflow/disk.js +2 -2
- package/dist/commands/workflow/fids.js +689 -33
- package/dist/commands/workflow/issues.js +362 -99
- package/dist/commands/workflow/ledgers.js +762 -27
- package/dist/commands/workflow/locks.js +24 -2
- package/dist/commands/workflow/plan-blocks.js +437 -0
- package/dist/commands/workflow/plan-versions.js +22 -0
- package/dist/commands/workflow/prs.js +142 -32
- package/dist/commands/workflow/repo.js +52 -7
- package/dist/commands/workflow/roadmap.js +9 -7
- package/dist/commands/workflow/run-facts.js +426 -0
- package/dist/commands/workflow/runs.js +144 -43
- package/dist/commands/workflow/runtime.js +12 -1
- package/dist/commands/workflow/status.js +130 -29
- package/dist/commands/workflow/step-table.js +276 -0
- package/dist/commands/workflow/steps.js +171 -80
- package/dist/commands/workflow/summary.js +275 -0
- package/dist/commands/workflow/tests.js +834 -136
- package/dist/commands/workflow/tracker.js +983 -0
- package/dist/commands/workflow/workflows.js +834 -195
- package/dist/commands/workflow/workstreams.js +11 -5
- package/dist/commands/workflow/worktrees.js +221 -22
- package/dist/install/manifest.js +11 -9
- package/dist/install/modules/cloud.js +22 -13
- package/dist/install/modules/core.js +326 -7
- package/dist/install/modules/opencode.js +2 -2
- package/dist/install/version-file.js +6 -2
- package/dist/ledgers/migrate.js +81 -0
- package/dist/ledgers/status.js +61 -8
- package/dist/ledgers/telemetry.js +905 -124
- package/dist/render/hosts.js +4 -0
- package/dist/render/models.js +12 -0
- package/dist/shared/branches.js +3 -1
- package/dist/shared/egress.js +7 -0
- package/dist/shared/json.js +20 -7
- package/dist/shared/settings.js +147 -26
- package/dist/shared/text.js +333 -0
- package/dist/tools/grammar-density.js +183 -0
- package/dist/tools/instructions-sources.js +721 -0
- package/dist/tools/instructions.js +1579 -0
- package/package.json +114 -23
- package/.bkit/core/engine/commands/harvest.ts +0 -459
- package/.bkit/core/engine/tools/wording.ts +0 -748
- package/.bkit/core/prompts/bkit-build-challenge-reconcile.md +0 -69
- package/.bkit/core/prompts/bkit-build-challenge-remediate.md +0 -71
- package/.bkit/core/prompts/bkit-build-challenge-tests.md +0 -74
- package/.bkit/core/prompts/bkit-build-summary.md +0 -94
- package/.bkit/core/prompts/bkit-debug-summary.md +0 -96
- package/.bkit/core/prompts/bkit-design-summary.md +0 -107
- package/.bkit/core/prompts/bkit-plan-complexity-check.md +0 -67
- package/.bkit/core/prompts/bkit-plan-complexity-split.md +0 -88
- package/.bkit/core/prompts/bkit-plan-review-3.md +0 -93
- package/.bkit/core/prompts/bkit-plan-scope-check-1.md +0 -85
- package/.bkit/core/prompts/bkit-plan-scope-check-2.md +0 -85
- package/.bkit/core/prompts/bkit-plan-summary.md +0 -107
- package/.bkit/core/prompts/bkit-ship-summary.md +0 -78
- package/.bkit/templates/scripts/ci/lanes/check-tree-cache.mjs +0 -138
- package/.bkit/templates/scripts/ci/lanes/check-tree-cache.test.mjs +0 -181
- package/dist/commands/harvest.js +0 -353
- package/dist/tools/wording.js +0 -680
|
@@ -11,15 +11,18 @@
|
|
|
11
11
|
// and print the step's tracker comment.
|
|
12
12
|
import * as fs from "node:fs";
|
|
13
13
|
import * as path from "node:path";
|
|
14
|
-
import { activeDoneSteps, appendLine, runOrStepField, statusTimestamp, } from "../../ledgers/status.js";
|
|
14
|
+
import { actionKey, activeDoneSteps, allRunsDoneSteps, appendLine, runNumber, runOrStepField, statusTimestamp, } from "../../ledgers/status.js";
|
|
15
15
|
import { clampLogPath, readRecords } from "../../ledgers/clamp-log.js";
|
|
16
16
|
import { resolveRepoSlug } from "../../ledgers/telemetry.js";
|
|
17
17
|
import { getPromptsRoot } from "../../shared/package-roots.js";
|
|
18
|
-
import { CommandError, EXIT, repoRoot, runGit, } from "../lib.js";
|
|
19
|
-
import {
|
|
18
|
+
import { CommandError, EXIT, git, isSharedBranch, repoRoot, runGit, } from "../lib.js";
|
|
19
|
+
import { fidProblem, normaliseFid, readIssueTracker } from "./fids.js";
|
|
20
20
|
import { buildComment } from "./issues.js";
|
|
21
|
+
import { EXIT_FOREIGN_PATH, activeRecord, ownPathCommit, ownSet, } from "./ledgers.js";
|
|
21
22
|
import { readHolder, resolveMonth, workflowLockPath } from "./locks.js";
|
|
22
|
-
import { EXIT_NO_STATUS, FILE_FLAG,
|
|
23
|
+
import { EXIT_NO_STATUS, FILE_FLAG, GROUP_FLAG, STEP_FLAG, WORKFLOW_FLAG, extraField, nonNegativeInt, positiveInt, readRuns, readRunsAt, statusFile, str, } from "./status.js";
|
|
24
|
+
import { COMMENT_FILE_OUTPUT, POST_FLAG, TRACKER_OUTPUT, commentFileOf, postForVerb, } from "./tracker.js";
|
|
25
|
+
import { addAllButCopied } from "./worktrees.js";
|
|
23
26
|
const VERDICT_END = "<!-- verdict:end -->";
|
|
24
27
|
const DEFAULT_VERDICTS = ["PASS", "CONCERNS", "FAIL"];
|
|
25
28
|
const STRATEGIES = ["STANDARD", "PIVOT", "FINAL"];
|
|
@@ -220,22 +223,17 @@ export const ROW_FIELDS = {
|
|
|
220
223
|
"plan/plan-fetch-context": ["attempt"],
|
|
221
224
|
"plan/plan-review": ["attempt"],
|
|
222
225
|
"plan/plan-apply-review": ["attempt"],
|
|
223
|
-
"plan/plan-scope-check": ["attempt"],
|
|
224
|
-
"plan/plan-apply-scope": ["attempt"],
|
|
225
|
-
"plan/plan-complexity-check": ["attempt"],
|
|
226
|
-
"plan/plan-complexity-split": ["attempt"],
|
|
227
226
|
"plan/plan-summary": ["attempt"],
|
|
227
|
+
"build/build-plan-convert": ["attempt"],
|
|
228
228
|
"build/build-plan-current": ["attempt"],
|
|
229
229
|
"build/build-install-skills": ["attempt"],
|
|
230
230
|
"build/build-plan-execute": ["attempt"],
|
|
231
231
|
"build/build-plan-verify": ["attempt"],
|
|
232
|
-
"build/build-
|
|
232
|
+
"build/build-group-gate": ["attempt", "scope"],
|
|
233
233
|
"build/build-plan-gaps-remediate": ["attempt", "strategy"],
|
|
234
234
|
"build/build-plan-verify-holistic": ["attempt"],
|
|
235
235
|
"build/build-challenge": ["attempt"],
|
|
236
|
-
"build/build-
|
|
237
|
-
"build/build-challenge-remediate": ["attempt"],
|
|
238
|
-
"build/build-challenge-tests": ["attempt"],
|
|
236
|
+
"build/build-decision": ["attempt"],
|
|
239
237
|
"build/build-run-tests": ["attempt", "scope"],
|
|
240
238
|
"build/build-failure-diagnose": ["attempt", "strategy"],
|
|
241
239
|
"build/build-failure-remediate": ["attempt", "strategy"],
|
|
@@ -267,10 +265,32 @@ const CORE_ROW_KEYS = new Set([
|
|
|
267
265
|
"artifacts",
|
|
268
266
|
"verdict",
|
|
269
267
|
"attempt",
|
|
270
|
-
"
|
|
268
|
+
"group",
|
|
271
269
|
"failures",
|
|
272
270
|
"strategy",
|
|
273
271
|
]);
|
|
272
|
+
// ---------------------------------------------------------------------------
|
|
273
|
+
// Writing the row
|
|
274
|
+
// ---------------------------------------------------------------------------
|
|
275
|
+
/** The FID a `docs/plans/{month}/logs/{fid}/status.jsonl` path belongs to; undefined for any other file. */
|
|
276
|
+
function fidOfStatusFile(file) {
|
|
277
|
+
return /(?:^|\/)docs\/plans\/[0-9]{6}\/logs\/([^/]+)\/status\.jsonl$/.exec(file.split(path.sep).join("/"))?.[1];
|
|
278
|
+
}
|
|
279
|
+
/** Exit code: a debug run on a shared branch has no shared-checkout record, so nothing was written or committed. */
|
|
280
|
+
export const EXIT_NO_RECORD = 14;
|
|
281
|
+
/**
|
|
282
|
+
* A debug run on `dev` / `main` works in place, so its record must exist before
|
|
283
|
+
* it writes or commits (`git add -A` there would carry work the run does not own).
|
|
284
|
+
* Throws EXIT_NO_RECORD when the checkout is on a shared branch and `rec` is null.
|
|
285
|
+
*/
|
|
286
|
+
export function requireRecordOnShared(cwd, workflow, rec) {
|
|
287
|
+
if (workflow !== "debug" || rec !== null)
|
|
288
|
+
return;
|
|
289
|
+
const branch = git(cwd, ["branch", "--show-current"]) ?? "";
|
|
290
|
+
if (!isSharedBranch(branch))
|
|
291
|
+
return;
|
|
292
|
+
throw new CommandError(EXIT_NO_RECORD, `no shared-checkout record for this run on ${branch} — nothing written or committed (the record is gone or belongs to another run); a plain commit here would carry work the run does not own`);
|
|
293
|
+
}
|
|
274
294
|
/**
|
|
275
295
|
* Append one `step-done` row, then commit (parentSha first, the row, then the
|
|
276
296
|
* commit — the order the fold's de-dup relies on). Returns the row and the new
|
|
@@ -295,16 +315,50 @@ export function writeStepRow(cwd, r, log) {
|
|
|
295
315
|
artifacts: r.artifacts,
|
|
296
316
|
...(r.verdict === undefined ? {} : { verdict: r.verdict }),
|
|
297
317
|
...(r.attempt === undefined ? {} : { attempt: r.attempt }),
|
|
298
|
-
...(r.
|
|
318
|
+
...(r.group === undefined ? {} : { group: r.group }),
|
|
299
319
|
...(r.failures === undefined ? {} : { failures: r.failures }),
|
|
300
320
|
...(r.strategy === undefined ? {} : { strategy: r.strategy }),
|
|
301
321
|
...(r.extras ?? {}),
|
|
302
322
|
};
|
|
323
|
+
// An in-place run on a shared branch commits its own paths only; a refusal
|
|
324
|
+
// comes before the append, so a re-run after the human's fix writes the row once.
|
|
325
|
+
const fid = r.commit === "auto" ? fidOfStatusFile(r.file) : undefined;
|
|
326
|
+
const rec = fid === undefined ? null : activeRecord(cwd, fid);
|
|
327
|
+
if (r.commit === "auto")
|
|
328
|
+
requireRecordOnShared(cwd, r.workflow, rec);
|
|
329
|
+
if (rec !== null) {
|
|
330
|
+
try {
|
|
331
|
+
ownSet(cwd, rec);
|
|
332
|
+
}
|
|
333
|
+
catch (err) {
|
|
334
|
+
if (!(err instanceof CommandError) || err.code !== EXIT_FOREIGN_PATH)
|
|
335
|
+
throw err;
|
|
336
|
+
log(`no row written to ${r.file}: the commit would be refused: ${err.message}`);
|
|
337
|
+
return { row, commit: null, code: EXIT_FOREIGN_PATH };
|
|
338
|
+
}
|
|
339
|
+
}
|
|
303
340
|
fs.mkdirSync(path.dirname(r.file), { recursive: true });
|
|
304
341
|
fs.appendFileSync(r.file, appendLine(row));
|
|
305
342
|
if (r.commit === "none")
|
|
306
343
|
return { row, commit: null, code: EXIT.OK };
|
|
307
|
-
|
|
344
|
+
if (rec !== null) {
|
|
345
|
+
let own;
|
|
346
|
+
try {
|
|
347
|
+
own = ownPathCommit(cwd, rec, r.message, { allowEmpty: true });
|
|
348
|
+
}
|
|
349
|
+
catch (err) {
|
|
350
|
+
if (!(err instanceof CommandError) || err.code !== EXIT_FOREIGN_PATH)
|
|
351
|
+
throw err;
|
|
352
|
+
log(`row written to ${r.file} but the commit was refused: ${err.message}`);
|
|
353
|
+
return { row, commit: null, code: EXIT_FOREIGN_PATH };
|
|
354
|
+
}
|
|
355
|
+
if (!own.ok) {
|
|
356
|
+
log(`row written to ${r.file} but the commit failed: ${own.error}`);
|
|
357
|
+
return { row, commit: null, code: EXIT_COMMIT };
|
|
358
|
+
}
|
|
359
|
+
return { row, commit: runGit(cwd, ["rev-parse", "HEAD"]).stdout, code: EXIT.OK };
|
|
360
|
+
}
|
|
361
|
+
const add = addAllButCopied(cwd);
|
|
308
362
|
const made = add.ok ? runGit(cwd, ["commit", "--allow-empty", "-m", r.message]) : add;
|
|
309
363
|
if (!made.ok) {
|
|
310
364
|
log(`row written to ${r.file} but the commit failed: ${made.stderr || made.stdout}`);
|
|
@@ -325,9 +379,7 @@ function gateChecks(cwd, o) {
|
|
|
325
379
|
if (o.fid !== undefined) {
|
|
326
380
|
const tracker = readIssueTracker(cwd);
|
|
327
381
|
const fid = normaliseFid(o.fid, tracker);
|
|
328
|
-
add(`fid ${fid}`,
|
|
329
|
-
? undefined
|
|
330
|
-
: `does not match the ${tracker} shape ${FID_PATTERNS[tracker].source}`, `${tracker} shape`);
|
|
382
|
+
add(`fid ${fid}`, fidProblem(fid, tracker, o.issue), o.issue === "" && tracker !== "none" ? "issue-less shape" : `${tracker} shape`);
|
|
331
383
|
if (o.token !== undefined) {
|
|
332
384
|
const root = repoRoot(cwd);
|
|
333
385
|
const lock = workflowLockPath(root, resolveMonth(root, o.fid, o.month), o.fid);
|
|
@@ -342,6 +394,9 @@ function gateChecks(cwd, o) {
|
|
|
342
394
|
else if (o.token !== undefined) {
|
|
343
395
|
throw new CommandError(EXIT.USAGE, "--token needs --fid");
|
|
344
396
|
}
|
|
397
|
+
else if (o.issue !== undefined) {
|
|
398
|
+
throw new CommandError(EXIT.USAGE, "--issue needs --fid");
|
|
399
|
+
}
|
|
345
400
|
for (const a of o.artifacts) {
|
|
346
401
|
if (isUrl(a))
|
|
347
402
|
continue;
|
|
@@ -367,7 +422,7 @@ function gateChecks(cwd, o) {
|
|
|
367
422
|
if (o.file === undefined)
|
|
368
423
|
return checks;
|
|
369
424
|
const runs = o.ref === undefined ? readRuns(o.file) : readRunsAt(o.file, o.ref);
|
|
370
|
-
const rows = activeDoneSteps(runs, o.workflow, { step: o.step,
|
|
425
|
+
const rows = activeDoneSteps(runs, o.workflow, { step: o.step, group: o.group });
|
|
371
426
|
const row = rows.filter((r) => o.attempt === undefined || r.attempt === o.attempt).at(-1);
|
|
372
427
|
const rowProblems = [];
|
|
373
428
|
if (!row) {
|
|
@@ -400,14 +455,22 @@ function gateChecks(cwd, o) {
|
|
|
400
455
|
// finish
|
|
401
456
|
// ---------------------------------------------------------------------------
|
|
402
457
|
const POSITIONS = ["next", "current", "count"];
|
|
403
|
-
/**
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
458
|
+
/**
|
|
459
|
+
* `<step>:<next|current|count>[:all]` → the counter it names, from the active run, or
|
|
460
|
+
* from every run of the workflow with `:all`.
|
|
461
|
+
*/
|
|
462
|
+
function derivedCounter(file, workflow, spec, group) {
|
|
463
|
+
const [step, position, scope] = spec.split(":");
|
|
464
|
+
if (!step ||
|
|
465
|
+
!POSITIONS.includes(position ?? "") ||
|
|
466
|
+
(scope !== undefined && scope !== "all")) {
|
|
467
|
+
throw new CommandError(EXIT.USAGE, `"${spec}" must be <step>:<next|current|count>[:all]`);
|
|
408
468
|
}
|
|
409
469
|
const count = fs.existsSync(file)
|
|
410
|
-
? activeDoneSteps(readRuns(file), workflow, {
|
|
470
|
+
? (scope === "all" ? allRunsDoneSteps : activeDoneSteps)(readRuns(file), workflow, {
|
|
471
|
+
step,
|
|
472
|
+
group,
|
|
473
|
+
}).length
|
|
411
474
|
: 0;
|
|
412
475
|
if (position === "current" && count === 0) {
|
|
413
476
|
throw new CommandError(EXIT.NO, `${step}: no DONE row in the active run — the step's own row is missing`);
|
|
@@ -438,13 +501,12 @@ const titleCase = (key) => key.replace(/([A-Z])/g, " $1").replace(/^./, (c) => c
|
|
|
438
501
|
/** `<attempt>` filled in, once the attempt is known. */
|
|
439
502
|
const fill = (s, attempt) => attempt === undefined ? s : s.split(ATTEMPT_TOKEN).join(String(attempt));
|
|
440
503
|
const list = (v) => v ?? [];
|
|
441
|
-
function finish(ctx) {
|
|
504
|
+
async function finish(ctx) {
|
|
442
505
|
const f = ctx.flags;
|
|
443
506
|
const file = statusFile(ctx);
|
|
444
507
|
const workflow = String(f.workflow);
|
|
445
508
|
const step = String(f.step);
|
|
446
|
-
const
|
|
447
|
-
const since = str(f.since);
|
|
509
|
+
const group = positiveInt(f.group, "group");
|
|
448
510
|
const agents = list(f.agent);
|
|
449
511
|
// Attempt: given, next from the log, or another step's counter.
|
|
450
512
|
if ([f.attempt, f.attemptOf].filter((v) => v !== undefined).length > 1)
|
|
@@ -452,11 +514,11 @@ function finish(ctx) {
|
|
|
452
514
|
let attempt;
|
|
453
515
|
let derived = false;
|
|
454
516
|
if (f.attemptOf !== undefined) {
|
|
455
|
-
attempt = derivedCounter(file, workflow, String(f.attemptOf),
|
|
517
|
+
attempt = derivedCounter(file, workflow, String(f.attemptOf), group);
|
|
456
518
|
derived = true;
|
|
457
519
|
}
|
|
458
520
|
else if (f.attempt === "next") {
|
|
459
|
-
attempt = derivedCounter(file, workflow, `${step}:next`,
|
|
521
|
+
attempt = derivedCounter(file, workflow, `${step}:next`, group);
|
|
460
522
|
derived = true;
|
|
461
523
|
}
|
|
462
524
|
else {
|
|
@@ -467,7 +529,7 @@ function finish(ctx) {
|
|
|
467
529
|
const eq = spec.indexOf("=");
|
|
468
530
|
if (eq <= 0)
|
|
469
531
|
throw new CommandError(EXIT.USAGE, `--count-field "${spec}" must be key=<counter>`);
|
|
470
|
-
extras[spec.slice(0, eq)] = derivedCounter(file, workflow, spec.slice(eq + 1),
|
|
532
|
+
extras[spec.slice(0, eq)] = derivedCounter(file, workflow, spec.slice(eq + 1), group);
|
|
471
533
|
}
|
|
472
534
|
const scope = str(f.scope);
|
|
473
535
|
if (scope !== undefined)
|
|
@@ -565,7 +627,7 @@ function finish(ctx) {
|
|
|
565
627
|
if (!["auto", "none"].includes(commit))
|
|
566
628
|
throw new CommandError(EXIT.USAGE, "--commit must be auto or none");
|
|
567
629
|
if (f.docsOnly === true && commit === "auto") {
|
|
568
|
-
|
|
630
|
+
addAllButCopied(ctx.cwd);
|
|
569
631
|
const outside = runGit(ctx.cwd, ["diff", "--cached", "--name-only"])
|
|
570
632
|
.stdout.split("\n")
|
|
571
633
|
.filter((p) => p !== "" && !DOCS_ONLY.test(p));
|
|
@@ -586,32 +648,6 @@ function finish(ctx) {
|
|
|
586
648
|
runOrStepField(readRuns(file), workflow, "pushMode") === "LOCAL")
|
|
587
649
|
message += " bkit [verbose ci]";
|
|
588
650
|
}
|
|
589
|
-
const written = writeStepRow(ctx.cwd, {
|
|
590
|
-
file,
|
|
591
|
-
workflow,
|
|
592
|
-
step,
|
|
593
|
-
verdict,
|
|
594
|
-
failures,
|
|
595
|
-
attempt,
|
|
596
|
-
subPlan,
|
|
597
|
-
strategy,
|
|
598
|
-
artifacts,
|
|
599
|
-
extras,
|
|
600
|
-
parentSha: str(f.parentSha),
|
|
601
|
-
commit: commit,
|
|
602
|
-
message,
|
|
603
|
-
}, ctx.log);
|
|
604
|
-
const checks = gateChecks(ctx.cwd, {
|
|
605
|
-
file,
|
|
606
|
-
workflow,
|
|
607
|
-
step,
|
|
608
|
-
subPlan,
|
|
609
|
-
attempt,
|
|
610
|
-
artifacts,
|
|
611
|
-
verdictRequired: false,
|
|
612
|
-
allowed,
|
|
613
|
-
placeholders: [],
|
|
614
|
-
});
|
|
615
651
|
// The step's tracker comment: header fields in one fixed order.
|
|
616
652
|
let comment = null;
|
|
617
653
|
const number = str(f.number);
|
|
@@ -619,16 +655,14 @@ function finish(ctx) {
|
|
|
619
655
|
const title = str(f.title);
|
|
620
656
|
if (title === undefined)
|
|
621
657
|
throw new CommandError(EXIT.USAGE, "--number needs --title");
|
|
622
|
-
const count = str(f.
|
|
658
|
+
const count = str(f.groupCount);
|
|
623
659
|
const header = [
|
|
624
660
|
...(verdict === undefined ? [] : [["Verdict", verdict]]),
|
|
625
661
|
...(failures === undefined ? [] : [["Failures", String(failures)]]),
|
|
626
662
|
...(scope === undefined ? [] : [["Scope", scope]]),
|
|
627
|
-
...(
|
|
663
|
+
...(group === undefined
|
|
628
664
|
? []
|
|
629
|
-
: [
|
|
630
|
-
["Sub-plan", `${subPlan}${count === undefined ? "" : `/${count}`}`],
|
|
631
|
-
]),
|
|
665
|
+
: [["Group", `${group}${count === undefined ? "" : `/${count}`}`]]),
|
|
632
666
|
...(derived && attempt !== undefined
|
|
633
667
|
? [["Attempt", String(attempt)]]
|
|
634
668
|
: []),
|
|
@@ -661,6 +695,41 @@ function finish(ctx) {
|
|
|
661
695
|
bodyFile: f.commentBody === true ? fileArtifacts[0] : undefined,
|
|
662
696
|
});
|
|
663
697
|
}
|
|
698
|
+
// --post: post, then record the engine-action row, then the step row and commit
|
|
699
|
+
// carry both. A re-run with the same key and body is deduped, never posted twice.
|
|
700
|
+
let tracker;
|
|
701
|
+
if (f.post === true) {
|
|
702
|
+
if (comment === null)
|
|
703
|
+
throw new CommandError(EXIT.USAGE, "--post needs --number");
|
|
704
|
+
const key = actionKey(workflow, fs.existsSync(file) ? runNumber(readRuns(file), workflow) : 1, step, group, attempt, "comment");
|
|
705
|
+
tracker = await postForVerb(ctx, comment, { fid: fidOfStatusFile(file), file, key });
|
|
706
|
+
}
|
|
707
|
+
const written = writeStepRow(ctx.cwd, {
|
|
708
|
+
file,
|
|
709
|
+
workflow,
|
|
710
|
+
step,
|
|
711
|
+
verdict,
|
|
712
|
+
failures,
|
|
713
|
+
attempt,
|
|
714
|
+
group,
|
|
715
|
+
strategy,
|
|
716
|
+
artifacts,
|
|
717
|
+
extras,
|
|
718
|
+
parentSha: str(f.parentSha),
|
|
719
|
+
commit: commit,
|
|
720
|
+
message,
|
|
721
|
+
}, ctx.log);
|
|
722
|
+
const checks = gateChecks(ctx.cwd, {
|
|
723
|
+
file,
|
|
724
|
+
workflow,
|
|
725
|
+
step,
|
|
726
|
+
group,
|
|
727
|
+
attempt,
|
|
728
|
+
artifacts,
|
|
729
|
+
verdictRequired: false,
|
|
730
|
+
allowed,
|
|
731
|
+
placeholders: [],
|
|
732
|
+
});
|
|
664
733
|
const pass = checks.every((c) => c.ok);
|
|
665
734
|
for (const c of checks.filter((x) => !x.ok))
|
|
666
735
|
ctx.log(`${c.check}: ${c.detail}`);
|
|
@@ -670,10 +739,14 @@ function finish(ctx) {
|
|
|
670
739
|
attempt: attempt ?? null,
|
|
671
740
|
fields,
|
|
672
741
|
row: written.row,
|
|
742
|
+
parentSha: written.row.parentSha,
|
|
673
743
|
commit: written.commit,
|
|
674
744
|
pass,
|
|
675
745
|
checks,
|
|
676
746
|
comment,
|
|
747
|
+
// Written after the step's commit, so the commit never carries it.
|
|
748
|
+
commentFile: commentFileOf(ctx.cwd, comment),
|
|
749
|
+
...(tracker === undefined ? {} : { tracker }),
|
|
677
750
|
});
|
|
678
751
|
if (written.code !== EXIT.OK)
|
|
679
752
|
return written.code;
|
|
@@ -699,7 +772,11 @@ const COMMIT_FLAGS = [
|
|
|
699
772
|
type: "string",
|
|
700
773
|
help: "commit the step started from (default: HEAD now, before this commit)",
|
|
701
774
|
},
|
|
702
|
-
{
|
|
775
|
+
{
|
|
776
|
+
name: "commit",
|
|
777
|
+
type: "string",
|
|
778
|
+
help: "auto (default: git add -A, never the worktree.copy entries, + commit) or none",
|
|
779
|
+
},
|
|
703
780
|
{ name: "message", type: "string", help: "commit message (required unless --commit=none)" },
|
|
704
781
|
];
|
|
705
782
|
export const stepsCommand = {
|
|
@@ -729,7 +806,7 @@ export const stepsCommand = {
|
|
|
729
806
|
type: "string",
|
|
730
807
|
help: "non-negative integer (0 included), or `next` to derive it from the log",
|
|
731
808
|
},
|
|
732
|
-
|
|
809
|
+
GROUP_FLAG,
|
|
733
810
|
{ name: "strategy", type: "string", help: "STANDARD|PIVOT|FINAL" },
|
|
734
811
|
{
|
|
735
812
|
name: "artifact",
|
|
@@ -749,10 +826,13 @@ export const stepsCommand = {
|
|
|
749
826
|
row: "the appended step-done row",
|
|
750
827
|
commit: "the new commit's sha, or null with --commit=none",
|
|
751
828
|
},
|
|
829
|
+
textOmit: ["row"],
|
|
752
830
|
exitCodes: {
|
|
753
831
|
[EXIT_NO_STATUS]: "--attempt=next could not read status.jsonl",
|
|
754
832
|
[EXIT_ARTIFACT]: "an --artifact is missing, empty, or outside the working directory",
|
|
755
833
|
[EXIT_COMMIT]: "the row was written but the commit failed",
|
|
834
|
+
[EXIT_FOREIGN_PATH]: "nothing written, nothing committed: a path that was dirty before an in-place run changed during it",
|
|
835
|
+
[EXIT_NO_RECORD]: "a debug run on dev/main with no shared-checkout record: nothing written or committed",
|
|
756
836
|
},
|
|
757
837
|
run: (ctx) => {
|
|
758
838
|
const f = ctx.flags;
|
|
@@ -775,7 +855,7 @@ export const stepsCommand = {
|
|
|
775
855
|
if (strategy !== undefined && !STRATEGIES.includes(strategy)) {
|
|
776
856
|
throw new CommandError(EXIT.USAGE, "--strategy must be STANDARD|PIVOT|FINAL");
|
|
777
857
|
}
|
|
778
|
-
const
|
|
858
|
+
const group = positiveInt(f.group, "group");
|
|
779
859
|
const commit = str(f.commit) ?? "auto";
|
|
780
860
|
if (!["auto", "none"].includes(commit))
|
|
781
861
|
throw new CommandError(EXIT.USAGE, "--commit must be auto or none");
|
|
@@ -784,7 +864,7 @@ export const stepsCommand = {
|
|
|
784
864
|
if (bad.length > 0)
|
|
785
865
|
throw new CommandError(EXIT_ARTIFACT, bad.join("; "));
|
|
786
866
|
const attempt = f.attempt === "next"
|
|
787
|
-
? derivedCounter(file, workflow, `${step}:next`,
|
|
867
|
+
? derivedCounter(file, workflow, `${step}:next`, group)
|
|
788
868
|
: nonNegativeInt(f.attempt, "attempt");
|
|
789
869
|
const written = writeStepRow(ctx.cwd, {
|
|
790
870
|
file,
|
|
@@ -794,7 +874,7 @@ export const stepsCommand = {
|
|
|
794
874
|
verdict,
|
|
795
875
|
failures,
|
|
796
876
|
attempt,
|
|
797
|
-
|
|
877
|
+
group,
|
|
798
878
|
strategy,
|
|
799
879
|
artifacts,
|
|
800
880
|
extras: Object.fromEntries(list(f.field).map(extraField)),
|
|
@@ -847,18 +927,13 @@ export const stepsCommand = {
|
|
|
847
927
|
type: "string",
|
|
848
928
|
help: "<step>:<next|current|count> — the attempt is that step's counter in the active run",
|
|
849
929
|
},
|
|
850
|
-
{
|
|
851
|
-
name: "since",
|
|
852
|
-
type: "string",
|
|
853
|
-
help: "run field holding a timestamp (soakEntryAt); only rows after it count",
|
|
854
|
-
},
|
|
855
930
|
{
|
|
856
931
|
name: "count-field",
|
|
857
932
|
type: "string",
|
|
858
933
|
repeatable: true,
|
|
859
|
-
help: "key=<step>:<next|current|count>[
|
|
934
|
+
help: "key=<step>:<next|current|count>[:all] — a row field holding another counter; :all counts every run",
|
|
860
935
|
},
|
|
861
|
-
|
|
936
|
+
GROUP_FLAG,
|
|
862
937
|
{
|
|
863
938
|
name: "strategy",
|
|
864
939
|
type: "string",
|
|
@@ -899,7 +974,11 @@ export const stepsCommand = {
|
|
|
899
974
|
},
|
|
900
975
|
{ name: "number", type: "string", help: "step number: print the step's tracker comment" },
|
|
901
976
|
{ name: "title", type: "string", help: "step title for the comment heading" },
|
|
902
|
-
{
|
|
977
|
+
{
|
|
978
|
+
...POST_FLAG,
|
|
979
|
+
help: "post the comment (needs --number) to the issue the status file's FID names, before the row and commit; prints `tracker`",
|
|
980
|
+
},
|
|
981
|
+
{ name: "group-count", type: "string", help: "y of the comment's Group x/y" },
|
|
903
982
|
{
|
|
904
983
|
name: "link-ref",
|
|
905
984
|
type: "string",
|
|
@@ -929,13 +1008,17 @@ export const stepsCommand = {
|
|
|
929
1008
|
attempt: "the attempt recorded, or null",
|
|
930
1009
|
fields: "the other header fields the agents' prompts declare (Spike, Mode, Affected)",
|
|
931
1010
|
row: "the appended step-done row",
|
|
1011
|
+
parentSha: "the row's parentSha: HEAD before the step's commit",
|
|
932
1012
|
commit: "the new commit's sha, or null with --commit=none",
|
|
933
1013
|
pass: "every gate check passed",
|
|
934
1014
|
checks: "[{check, ok, detail}] per gate check",
|
|
935
1015
|
comment: "the step's tracker comment body (with --number), else null",
|
|
1016
|
+
commentFile: COMMENT_FILE_OUTPUT,
|
|
1017
|
+
tracker: TRACKER_OUTPUT,
|
|
936
1018
|
reask: "verdict read failed: {agent, artifact} to re-ask (exit 4 / 5 / 6 only)",
|
|
937
1019
|
problem: "why the verdict read failed (exit 4 / 5 / 6 only)",
|
|
938
1020
|
},
|
|
1021
|
+
textOmit: ["row", { key: "checks", when: (_checks, out) => out.pass === true }],
|
|
939
1022
|
exitCodes: {
|
|
940
1023
|
[EXIT_NO_STATUS]: "status.jsonl is not valid NDJSON",
|
|
941
1024
|
[EXIT_EMPTY]: "an --agent's artifact is missing or empty (nothing written)",
|
|
@@ -943,6 +1026,8 @@ export const stepsCommand = {
|
|
|
943
1026
|
[EXIT_INVALID]: "an --agent's header is invalid (no verdict:end, a value outside its set, Failures disagreeing with Verdict) — re-ask it (nothing written)",
|
|
944
1027
|
[EXIT_ARTIFACT]: "an --artifact is missing, empty, or outside the working directory (nothing written)",
|
|
945
1028
|
[EXIT_COMMIT]: "the row was written but the commit failed",
|
|
1029
|
+
[EXIT_FOREIGN_PATH]: "nothing written, nothing committed: a path that was dirty before an in-place run changed during it",
|
|
1030
|
+
[EXIT_NO_RECORD]: "a debug run on dev/main with no shared-checkout record: nothing written or committed",
|
|
946
1031
|
[EXIT_OUTSIDE_DOCS]: "--docs-only and the step staged a file outside the artifact tree (nothing written)",
|
|
947
1032
|
},
|
|
948
1033
|
run: finish,
|
|
@@ -990,7 +1075,7 @@ export const stepsCommand = {
|
|
|
990
1075
|
},
|
|
991
1076
|
WORKFLOW_FLAG,
|
|
992
1077
|
STEP_FLAG,
|
|
993
|
-
|
|
1078
|
+
GROUP_FLAG,
|
|
994
1079
|
{
|
|
995
1080
|
name: "attempt",
|
|
996
1081
|
type: "string",
|
|
@@ -1020,6 +1105,11 @@ export const stepsCommand = {
|
|
|
1020
1105
|
help: "NAME=value — the held placeholder must be non-empty",
|
|
1021
1106
|
},
|
|
1022
1107
|
{ name: "fid", type: "string", help: "the FID must match the wired tracker's shape" },
|
|
1108
|
+
{
|
|
1109
|
+
name: "issue",
|
|
1110
|
+
type: "string",
|
|
1111
|
+
help: 'the run\'s issue id, or "" for a run with no issue (then the FID must be issue-less); needs --fid',
|
|
1112
|
+
},
|
|
1023
1113
|
{ name: "month", type: "string", help: "month bucket of the lock (with --token)" },
|
|
1024
1114
|
{
|
|
1025
1115
|
name: "token",
|
|
@@ -1035,7 +1125,7 @@ export const stepsCommand = {
|
|
|
1035
1125
|
const f = ctx.flags;
|
|
1036
1126
|
const file = str(f.file) === undefined ? undefined : statusFile(ctx);
|
|
1037
1127
|
const workflow = String(f.workflow);
|
|
1038
|
-
const
|
|
1128
|
+
const group = positiveInt(f.group, "group");
|
|
1039
1129
|
if (f.attempt !== undefined && f.attemptOf !== undefined)
|
|
1040
1130
|
throw new CommandError(EXIT.USAGE, "give --attempt or --attempt-of, not both");
|
|
1041
1131
|
if (f.attemptOf !== undefined && file === undefined)
|
|
@@ -1046,19 +1136,20 @@ export const stepsCommand = {
|
|
|
1046
1136
|
if (ref !== undefined && f.attemptOf !== undefined)
|
|
1047
1137
|
throw new CommandError(EXIT.USAGE, "--attempt-of reads the file on disk; give --attempt with --ref");
|
|
1048
1138
|
const attempt = f.attemptOf !== undefined
|
|
1049
|
-
? derivedCounter(file, workflow, String(f.attemptOf),
|
|
1139
|
+
? derivedCounter(file, workflow, String(f.attemptOf), group)
|
|
1050
1140
|
: nonNegativeInt(f.attempt, "attempt");
|
|
1051
1141
|
const checks = gateChecks(ctx.cwd, {
|
|
1052
1142
|
file,
|
|
1053
1143
|
ref,
|
|
1054
1144
|
workflow,
|
|
1055
1145
|
step: String(f.step),
|
|
1056
|
-
|
|
1146
|
+
group,
|
|
1057
1147
|
attempt,
|
|
1058
1148
|
artifacts: list(f.artifact).map((a) => fill(a, attempt)),
|
|
1059
1149
|
verdictRequired: f.verdictRequired === true,
|
|
1060
1150
|
allowed: allowedVerdicts(f),
|
|
1061
1151
|
fid: str(f.fid),
|
|
1152
|
+
issue: str(f.issue),
|
|
1062
1153
|
month: str(f.month),
|
|
1063
1154
|
token: str(f.token),
|
|
1064
1155
|
placeholders: list(f.placeholder),
|