@webpieces/pr-gate 0.4.982 → 0.4.984

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.
Files changed (37) hide show
  1. package/package.json +7 -6
  2. package/src/scripts/commands/build-dev-command.d.ts +27 -0
  3. package/src/scripts/commands/build-dev-command.js +99 -0
  4. package/src/scripts/commands/build-dev-command.js.map +1 -0
  5. package/src/scripts/commands/push-dev-command.d.ts +49 -19
  6. package/src/scripts/commands/push-dev-command.js +95 -32
  7. package/src/scripts/commands/push-dev-command.js.map +1 -1
  8. package/src/scripts/pr-gate-app.d.ts +10 -2
  9. package/src/scripts/pr-gate-app.js +15 -2
  10. package/src/scripts/pr-gate-app.js.map +1 -1
  11. package/src/scripts/pr-gate-cli-app.d.ts +1 -0
  12. package/src/scripts/pr-gate-cli-app.js +9 -2
  13. package/src/scripts/pr-gate-cli-app.js.map +1 -1
  14. package/src/scripts/workflow/build-affected.d.ts +7 -0
  15. package/src/scripts/workflow/build-affected.js +12 -4
  16. package/src/scripts/workflow/build-affected.js.map +1 -1
  17. package/src/scripts/workflow/build-gate-log.d.ts +4 -2
  18. package/src/scripts/workflow/build-gate-log.js +11 -3
  19. package/src/scripts/workflow/build-gate-log.js.map +1 -1
  20. package/src/scripts/workflow/dev-build.d.ts +31 -0
  21. package/src/scripts/workflow/dev-build.js +63 -0
  22. package/src/scripts/workflow/dev-build.js.map +1 -0
  23. package/src/scripts/workflow/dev-copy-on-main.d.ts +49 -0
  24. package/src/scripts/workflow/dev-copy-on-main.js +99 -0
  25. package/src/scripts/workflow/dev-copy-on-main.js.map +1 -0
  26. package/src/scripts/workflow/dev-deploy-refs.d.ts +13 -2
  27. package/src/scripts/workflow/dev-deploy-refs.js +17 -5
  28. package/src/scripts/workflow/dev-deploy-refs.js.map +1 -1
  29. package/src/scripts/workflow/dev-resolve-runner.d.ts +55 -8
  30. package/src/scripts/workflow/dev-resolve-runner.js +150 -22
  31. package/src/scripts/workflow/dev-resolve-runner.js.map +1 -1
  32. package/src/scripts/workflow/push-dev-state.d.ts +27 -0
  33. package/src/scripts/workflow/push-dev-state.js +41 -3
  34. package/src/scripts/workflow/push-dev-state.js.map +1 -1
  35. package/src/scripts/wp-build-dev.d.ts +2 -0
  36. package/src/scripts/wp-build-dev.js +13 -0
  37. package/src/scripts/wp-build-dev.js.map +1 -0
@@ -1 +1 @@
1
- {"version":3,"file":"push-dev-command.js","sourceRoot":"","sources":["../../../../../../../packages/tooling/pr-gate/src/scripts/commands/push-dev-command.ts"],"names":[],"mappings":";;;;AAAA,0DAOiC;AACjC,yCAA2D;AAE3D,mDAA+C;AAC/C,iEAAqE;AACrE,+DAA6E;AAC7E,uEAAkE;AAClE,+EAAyE;AAEzE,MAAM,GAAG,GAAG,0DAA0D,CAAC;AAEvE;;;GAGG;AACH,MAAa,cAAc;IACvB,6CAA6C;IAC7C,MAAM,GAAG,KAAK,CAAC;IACf,sFAAsF;IACtF,IAAI,GAAG,KAAK,CAAC;IACb,qFAAqF;IACrF,KAAK,GAAG,KAAK,CAAC;IACd,uFAAuF;IACvF,gBAAgB,GAAG,KAAK,CAAC;IACzB,gGAAgG;IAChG,OAAO,GAAG,KAAK,CAAC;IAChB,sFAAsF;IACtF,aAAa,GAAG,EAAE,CAAC;CACtB;AAbD,wCAaC;AAED;;;;;;;;;;;;;;;;;GAiBG;AAEI,IAAM,cAAc,GAApB,MAAM,cAAc;IAEF;IACA;IACA;IACA;IACA;IACA;IANrB,YACqB,cAA8B,EAC9B,OAAgB,EAChB,IAAmB,EACnB,KAAwB,EACxB,MAAwB,EACxB,UAA+B;QAL/B,mBAAc,GAAd,cAAc,CAAgB;QAC9B,YAAO,GAAP,OAAO,CAAS;QAChB,SAAI,GAAJ,IAAI,CAAe;QACnB,UAAK,GAAL,KAAK,CAAmB;QACxB,WAAM,GAAN,MAAM,CAAkB;QACxB,eAAU,GAAV,UAAU,CAAqB;IACjD,CAAC;IAEJ,KAAK,CAAC,GAAG,CAAC,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;QACZ,4CAAmB;GAP3C,cAAc,CA2P1B","sourcesContent":["import {\n CliExitError,\n DevDeployConfig,\n RepoRootFinder,\n WP_FINISH_PUSH_DEV,\n WP_PUSH_DEV,\n writeTemplate,\n} from '@webpieces/rules-config';\nimport { injectable, bindingScopeValues } from 'inversify';\n\nimport { GitExec } from '../workflow/git-exec';\nimport { DevCopy, DevDeployRefs } from '../workflow/dev-deploy-refs';\nimport { PushDevState, PushDevStateStore } from '../workflow/push-dev-state';\nimport { DevResolveRunner } from '../workflow/dev-resolve-runner';\nimport { DevDeployWatchHints } from '../workflow/dev-deploy-watch-hints';\n\nconst SEP = '━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\\n';\n\n/**\n * Which of `wp-push-dev`'s modes was asked for. Data-only (per CLAUDE.md) with plain assigned fields\n * rather than a seven-argument constructor — the bin sets what argv carried and nothing else.\n */\nexport class PushDevOptions {\n /** Delete the remote copy — the rollback. */\n remove = false;\n /** List the live copies and stop. The one mode that needs no branch preconditions. */\n list = false;\n /** Discard a conflict resolution already published on the copy, and overwrite it. */\n force = false;\n /** Replay that resolution on top of the new local commits instead of discarding it. */\n rebaseResolution = false;\n /** Compose the other copies onto this one so the shared environment can build them together. */\n resolve = false;\n /** With `--resolve`: merge ONLY this developer's branch. Empty ⇒ every other copy. */\n resolveTarget = '';\n}\n\n/**\n * `wp-push-dev` — publish a DISPOSABLE copy of this branch so a shared dev environment can build it,\n * without landing anything on `main` and without opening a PR.\n *\n * WHY THIS COMMAND HAS TO EXIST AT ALL: `pr-creation-or-push-guard` blocks every `git push`, no\n * exceptions, by design. Its own fix-hint offers \"ask a human to run the push\" for out-of-band cases —\n * which is the right answer for a genuine exception and the wrong one for a routine daily action. Without\n * a gated command there is simply no legal way for an AI to get a branch onto a dev server, so the\n * feature was undoable rather than merely awkward.\n *\n * WHY THERE IS NO BUILD, deliberately unlike `wp-start-upsert-pr`: the shared environment's CI builds the\n * COMPOSED tree (main + every listed branch). A local build here proves the branch compiles against\n * `main` alone, which is not the question — it would be both slower and reassuring about the wrong thing.\n * The gate that matters runs on the composition, in CI, where it belongs.\n *\n * WHAT IT NEVER DOES: touch the feature branch. See DevDeployRefs for the invariant and why the copy\n * exists to hold conflict resolutions that must not reach the PR.\n */\n@injectable(bindingScopeValues.Singleton)\nexport class PushDevCommand {\n constructor(\n private readonly repoRootFinder: RepoRootFinder,\n private readonly gitExec: GitExec,\n private readonly refs: DevDeployRefs,\n private readonly store: PushDevStateStore,\n private readonly runner: DevResolveRunner,\n private readonly watchHints: DevDeployWatchHints,\n ) {}\n\n async run(opts: PushDevOptions): Promise<void> {\n const repoRoot = this.repoRootFinder.resolveRepoRoot(process.cwd());\n // Refresh the AI-facing workflow doc so it is present + current for any failure message to cite —\n // same reason every other wp-* command opens this way.\n writeTemplate(repoRoot, 'webpieces.git-workflow.md');\n const cfg = this.refs.config(repoRoot);\n\n // A resolve already in flight owns the checkout; starting a second one would strand the first.\n this.assertNoResolveInProgress(repoRoot);\n\n if (opts.list) {\n await this.list(repoRoot, cfg);\n return;\n }\n\n const branch = this.refs.currentBranch(repoRoot);\n this.refs.assertPushable(cfg, branch);\n const targetRef = cfg.copyRefFor(branch);\n\n if (opts.remove) {\n await this.remove(repoRoot, cfg, branch, targetRef);\n return;\n }\n // Every remaining mode commits or merges, so the tree must be the AI's committed work and nothing\n // else. The tooling never commits for you.\n await this.gitExec.assertCleanTree(repoRoot);\n\n if (opts.resolve) {\n await this.startResolve(repoRoot, cfg, branch, targetRef, opts.resolveTarget);\n return;\n }\n await this.publish(repoRoot, cfg, branch, targetRef, opts);\n }\n\n /** `--list`: exactly the live copies, straight from the remote — never a cached local view. */\n private async list(repoRoot: string, cfg: DevDeployConfig): Promise<void> {\n const copies = await this.refs.liveCopies(repoRoot, cfg);\n if (copies.length === 0) {\n process.stdout.write(\n `\\nNo dev copies published — nothing matches \\`${cfg.copyRefGlob()}\\` on origin.\\n`\n + `Publish this branch's with: ${WP_PUSH_DEV}\\n`);\n return;\n }\n let out = '\\n' + SEP + `📋 ${String(copies.length)} dev cop${copies.length === 1 ? 'y' : 'ies'} on origin\\n` + SEP + '\\n';\n for (const copy of copies) out += ` ${copy.sha.slice(0, 8)} ${copy.ref}\\n`;\n out += `\\nYour CI composes \\`${cfg.devBranch}\\` from origin/main plus every ref above, on every run.\\n`\n + `Remove yours with: ${WP_PUSH_DEV} --remove (deletes your copy, then pushes the content-free\\n`\n + `\\`${cfg.removeMarkerRefFor('<your-branch>')}\\` marker your dev workflow triggers on and deletes)\\n`;\n process.stdout.write(out);\n }\n\n /**\n * `--remove`: delete the remote copy, then push the `<removeNamespace>/<branch>` marker (#1395). This\n * IS the rollback — nothing else has to be undone.\n *\n * WHY A MARKER AS WELL AS THE DELETION: a deletion can only be heard by a workflow's `on: delete:`,\n * which GitHub cannot filter by branch, so every branch deletion in the repo started a dev-deploy run.\n * A PUSH to `<removeNamespace>/**` is filterable. The deletion stays, unchanged, so a consumer whose\n * workflow still listens on `delete:` keeps working through the rollout window; the marker is purely\n * additive at the transport level.\n *\n * ORDER: `origin/main` is fetched BEFORE anything is deleted, so a network failure there leaves the\n * pool exactly as it was. The marker push is the last step, and the only one that can fail with the\n * copy already gone — that is the state {@link markerPushFailed} names.\n */\n private async remove(repoRoot: string, cfg: DevDeployConfig, branch: string, targetRef: string): Promise<void> {\n if (await this.refs.remoteSha(repoRoot, targetRef) === '') {\n process.stdout.write(\n `\\nNothing to remove — \\`${targetRef}\\` is not published.\\n`\n + `List what IS published with: ${WP_PUSH_DEV} --list\\n`);\n return;\n }\n const markerRef = cfg.removeMarkerRefFor(branch);\n const mainTip = await this.refs.freshMainTip(repoRoot);\n await this.gitExec.runGitChecked(['-C', repoRoot, 'push', 'origin', '--delete', `refs/heads/${targetRef}`],\n `Failed to delete the dev copy ${targetRef}`);\n // --force: the marker carries no content, so whatever an earlier, never-deleted marker pointed at\n // is worthless — and refusing a non-fast-forward here would strand the rollback half-done.\n const pushed = await this.gitExec.tryGit(\n ['-C', repoRoot, 'push', '--force', 'origin', `${mainTip}:refs/heads/${markerRef}`], repoRoot);\n if (!pushed.ok) this.markerPushFailed(cfg, branch, targetRef, markerRef, pushed.stderr);\n process.stdout.write(\n '\\n' + SEP + `🗑️ Removed ${targetRef}\\n` + SEP + '\\n'\n + `Pushed the marker \\`${markerRef}\\` (at origin/main ${mainTip.slice(0, 8)}) — your dev workflow triggers\\n`\n + `on it, deletes it, and rebuilds \\`${cfg.devBranch}\\` without \\`${branch}\\`. Your branch and any PR on it\\n`\n + 'are untouched.\\n');\n }\n\n /**\n * The one half-done state `--remove` can leave: the copy is deleted, the rebuild signal is not sent.\n * Said out loud because it is invisible otherwise — `--list` already looks right, while the deployed\n * `dev` still runs the removed branch until something else triggers a composition.\n */\n private markerPushFailed(cfg: DevDeployConfig, branch: string, targetRef: string, markerRef: string, stderr: string): never {\n throw new CliExitError(1,\n '\\n' + SEP + `⛔ Removed \\`${targetRef}\\`, but pushing the rebuild marker \\`${markerRef}\\` FAILED\\n` + SEP + '\\n'\n + `Your copy is already GONE from origin, but \\`${cfg.devBranch}\\` was NOT rebuilt: the deployed dev server\\n`\n + `still runs \\`${branch}\\` until the next composition run.\\n\\n`\n + 'git said:\\n' + (stderr === '' ? ' (no output)' : stderr.split('\\n').map((l: string): string => ` ${l}`).join('\\n')) + '\\n\\n'\n + 'Any later composition run drops your branch on its own, because the copy no longer exists — the next\\n'\n + `\\`${WP_PUSH_DEV}\\` by anyone, or a push to main if your workflow composes on that. To force one now,\\n`\n + 'once the cause above is fixed (network, auth, a branch-protection rule on the marker namespace),\\n'\n + 're-publish and remove again; the second remove pushes the marker:\\n\\n'\n + ` ${WP_PUSH_DEV}\\n ${WP_PUSH_DEV} --remove\\n`);\n }\n\n /**\n * The ordinary path: publish HEAD as `<namespace>/<branch>`.\n *\n * THE CLOBBER GUARD is the whole of the interesting logic here. If the remote copy holds commits the\n * local branch does not, somebody (quite possibly this developer, days ago) resolved a real conflict\n * over there. A silent force-push destroys work that cost a human a genuine merge resolution, so the\n * default is refusal with two named ways forward — never a \"use --force\" one-liner, which is how a\n * warning becomes a reflex.\n */\n private async publish(repoRoot: string, cfg: DevDeployConfig, branch: string, targetRef: string, opts: PushDevOptions): Promise<void> {\n const remoteSha = await this.refs.remoteSha(repoRoot, targetRef);\n if (remoteSha !== '') {\n await this.refs.fetchCopies(repoRoot, [targetRef]);\n const ahead = await this.refs.commitsOnlyOnRemote(repoRoot, targetRef);\n if (ahead > 0 && opts.rebaseResolution) {\n await this.rebaseResolution(repoRoot, branch, targetRef);\n return;\n }\n if (ahead > 0 && !opts.force) this.refuseClobber(cfg, branch, targetRef, ahead);\n }\n await this.gitExec.runGitChecked(\n ['-C', repoRoot, 'push', ...this.pushSafety(targetRef, remoteSha, opts.force),\n 'origin', `HEAD:refs/heads/${targetRef}`],\n `Failed to publish the dev copy ${targetRef}`);\n // Read AFTER the push, so the sha in the watch hints is provably the one that is now published.\n const published = await this.refs.headSha(repoRoot);\n process.stdout.write(\n '\\n' + SEP + `✅ Published ${targetRef}\\n` + SEP + '\\n'\n + `\\`${branch}\\` is now in the pool your CI composes \\`${cfg.devBranch}\\` from — it will be picked up on\\n`\n + 'the next composition run. No PR was opened and nothing landed on main.\\n\\n'\n + ` ${WP_PUSH_DEV} --list ← what else is in the pool\\n`\n + ` ${WP_PUSH_DEV} --remove ← take this branch back out\\n`\n + this.watchHints.render(cfg, targetRef, published));\n }\n\n /**\n * `--rebase-resolution`: keep the published resolution, replay it on top of the new commits.\n *\n * Implemented as a resolve whose BASE is the local HEAD and whose queue is the copy itself, so a\n * replay that conflicts again lands in exactly the same halt/`wp-finish-push-dev` state machine as\n * any other conflict, rather than inventing a second way to be stuck.\n */\n private async rebaseResolution(repoRoot: string, branch: string, targetRef: string): Promise<void> {\n const state = new PushDevState(branch, this.runner.tmpBranchFor(branch), targetRef, [targetRef]);\n process.stdout.write(\n '\\n' + SEP + `♻️ Replaying the published resolution onto \\`${branch}\\`\\n` + SEP + '\\n'\n + `Merging \\`${targetRef}\\` (which holds the resolution) into your new commits on a throwaway branch.\\n`\n + `Your feature branch \\`${branch}\\` is not touched.\\n\\n`);\n await this.runner.start(repoRoot, state, 'HEAD', [targetRef]);\n }\n\n /**\n * `--resolve`: compose the other copies onto this one, so what is published is what CI will build.\n *\n * With no argument the queue is EVERY other copy, in the same sorted order CI composes them — the\n * local resolution is then a rehearsal of the real composition, not a guess at it. With an argument\n * (the branch a CI conflict message names) it is just that one.\n */\n private async startResolve(repoRoot: string, cfg: DevDeployConfig, branch: string, targetRef: string, only: string): Promise<void> {\n if (await this.refs.remoteSha(repoRoot, targetRef) === '') {\n throw new CliExitError(2,\n '\\n' + SEP + `⛔ \\`${targetRef}\\` is not published yet\\n` + SEP + '\\n'\n + 'There is nothing to compose against. Publish your copy first, then resolve:\\n'\n + ` ${WP_PUSH_DEV}\\n ${WP_PUSH_DEV} --resolve\\n`);\n }\n const queue = await this.resolveQueue(repoRoot, cfg, targetRef, only);\n if (queue.length === 0) {\n process.stdout.write(\n `\\nNothing to compose — \\`${targetRef}\\` is the only copy in \\`${cfg.copyRefGlob()}\\`.\\n`\n + `Your CI will merge it onto origin/main by itself; there is no other branch to conflict with.\\n`);\n return;\n }\n const state = new PushDevState(branch, this.runner.tmpBranchFor(branch), targetRef, queue);\n process.stdout.write(this.runner.announce(cfg, state));\n await this.runner.start(repoRoot, state, `refs/remotes/origin/${targetRef}`, [targetRef, ...queue]);\n }\n\n // The refs to merge: one named copy, or every copy that is not mine. A named branch is accepted with\n // or without the namespace prefix, because the CI message that names it may print either.\n private async resolveQueue(repoRoot: string, cfg: DevDeployConfig, targetRef: string, only: string): Promise<string[]> {\n const copies = await this.refs.liveCopies(repoRoot, cfg);\n if (only === '') {\n return copies.filter((c: DevCopy): boolean => c.ref !== targetRef).map((c: DevCopy): string => c.ref);\n }\n const wanted = only.startsWith(`${cfg.branchNamespace}/`) ? only : cfg.copyRefFor(only);\n if (wanted === targetRef) {\n throw new CliExitError(2, `\\n⛔ \\`${only}\\` is your own copy — there is nothing to compose it with.\\n`);\n }\n if (!copies.some((c: DevCopy): boolean => c.ref === wanted)) {\n throw new CliExitError(2,\n '\\n' + SEP + `⛔ No published copy \\`${wanted}\\`\\n` + SEP + '\\n'\n + `Live copies (${WP_PUSH_DEV} --list):\\n`\n + copies.map((c: DevCopy): string => ` ${c.ref}`).join('\\n') + '\\n');\n }\n return [wanted];\n }\n\n /**\n * `--force-with-lease` pinned to the sha we just inspected, so the clobber guard's verdict cannot go\n * stale between the check and the push. Plain `--force` only when the caller explicitly asked to\n * discard, and no force at all for a brand-new copy.\n */\n private pushSafety(targetRef: string, remoteSha: string, force: boolean): string[] {\n if (remoteSha === '') return [];\n if (force) return ['--force'];\n return [`--force-with-lease=refs/heads/${targetRef}:${remoteSha}`];\n }\n\n private refuseClobber(cfg: DevDeployConfig, branch: string, targetRef: string, ahead: number): never {\n throw new CliExitError(2,\n '\\n' + SEP + `⛔ \\`${targetRef}\\` holds ${String(ahead)} commit(s) your branch does not\\n` + SEP + '\\n'\n + 'That is what a CONFLICT RESOLUTION looks like: somebody composed this copy against another\\n'\n + `developer's branch so \\`${cfg.devBranch}\\` could build, and that work exists ONLY on the copy —\\n`\n + 'by design, because it must never reach your feature branch or your PR.\\n\\n'\n + 'Publishing now would force-push over it and destroy it, so this command refuses. Pick one:\\n\\n'\n + ` ${WP_PUSH_DEV} --rebase-resolution\\n`\n + ' Replay that resolution on top of your new commits. Keeps the work; may ask you to\\n'\n + ' re-resolve the parts your new commits actually changed.\\n\\n'\n + ` ${WP_PUSH_DEV} --force\\n`\n + ' Discard it and publish your branch as-is. The composition breaks again until someone\\n'\n + ` re-resolves it with \\`${WP_PUSH_DEV} --resolve\\`.\\n\\n`\n + `See what is on the copy: git log --oneline ${branch}..refs/remotes/origin/${targetRef}\\n`);\n }\n\n // A half-finished resolve owns the checkout — it is parked on a throwaway branch, so \"the current\n // branch\" is not the feature branch this command would otherwise act on.\n private assertNoResolveInProgress(repoRoot: string): void {\n const state = this.store.read(repoRoot);\n if (state === null) return;\n throw new CliExitError(2,\n '\\n' + SEP + '⛔ A dev-deploy resolve is already in progress\\n' + SEP + '\\n'\n + `You are on the throwaway branch \\`${state.tmpBranch}\\`, mid-composition. Finish it or bail out:\\n`\n + ` ${WP_FINISH_PUSH_DEV} ← commit the resolution, resume the queue, publish\\n`\n + ` ${WP_FINISH_PUSH_DEV} --abort ← throw it away and go back to \\`${state.originalBranch}\\`\\n`);\n }\n}\n"]}
1
+ {"version":3,"file":"push-dev-command.js","sourceRoot":"","sources":["../../../../../../../packages/tooling/pr-gate/src/scripts/commands/push-dev-command.ts"],"names":[],"mappings":";;;;AAAA,0DAOiC;AACjC,yCAA2D;AAE3D,mDAA+C;AAC/C,iEAAqE;AACrE,+DAA6F;AAC7F,uEAAsF;AACtF,+EAAyE;AACzE,qDAAiD;AACjD,mEAAuF;AAEvF,MAAM,GAAG,GAAG,0DAA0D,CAAC;AAEvE;;;GAGG;AACH,MAAa,cAAc;IACvB,6CAA6C;IAC7C,MAAM,GAAG,KAAK,CAAC;IACf,sFAAsF;IACtF,IAAI,GAAG,KAAK,CAAC;IACb,qFAAqF;IACrF,KAAK,GAAG,KAAK,CAAC;IACd,uFAAuF;IACvF,gBAAgB,GAAG,KAAK,CAAC;IACzB,gGAAgG;IAChG,OAAO,GAAG,KAAK,CAAC;IAChB,sFAAsF;IACtF,aAAa,GAAG,EAAE,CAAC;CACtB;AAbD,wCAaC;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEI,IAAM,cAAc,GAApB,MAAM,cAAc;IAEF;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IARrB,YACqB,cAA8B,EAC9B,OAAgB,EAChB,IAAmB,EACnB,KAAwB,EACxB,MAAwB,EACxB,UAA+B,EAC/B,QAAkB,EAClB,UAAyB;QAPzB,mBAAc,GAAd,cAAc,CAAgB;QAC9B,YAAO,GAAP,OAAO,CAAS;QAChB,SAAI,GAAJ,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,GAAG,GAAG,GAAG,IAAI;cACzE,qCAAqC,KAAK,CAAC,SAAS,+CAA+C;cACnG,KAAK,iCAAkB,kEAAkE;cACzF,KAAK,iCAAkB,gDAAgD,KAAK,CAAC,cAAc,MAAM,CAAC,CAAC;IAC7G,CAAC;CACJ,CAAA;AAlTY,wCAAc;yBAAd,cAAc;IAD1B,IAAA,sBAAU,EAAC,8BAAkB,CAAC,SAAS,CAAC;6CAGA,6BAAc;QACrB,kBAAO;QACV,+BAAa;QACZ,kCAAiB;QAChB,qCAAgB;QACZ,4CAAmB;QACrB,oBAAQ;QACN,gCAAa;GATrC,cAAc,CAkT1B","sourcesContent":["import {\n CliExitError,\n DevDeployConfig,\n RepoRootFinder,\n WP_FINISH_PUSH_DEV,\n WP_PUSH_DEV,\n writeTemplate,\n} from '@webpieces/rules-config';\nimport { injectable, bindingScopeValues } from 'inversify';\n\nimport { GitExec } from '../workflow/git-exec';\nimport { DevCopy, DevDeployRefs } from '../workflow/dev-deploy-refs';\nimport { DevResolveMode, PushDevState, PushDevStateStore } from '../workflow/push-dev-state';\nimport { DevResolveRunner, RESOLUTION_SUBJECT } from '../workflow/dev-resolve-runner';\nimport { DevDeployWatchHints } from '../workflow/dev-deploy-watch-hints';\nimport { DevBuild } from '../workflow/dev-build';\nimport { DevCopyLanding, DevCopyOnMain, MergedPr } from '../workflow/dev-copy-on-main';\n\nconst SEP = '━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\\n';\n\n/**\n * Which of `wp-push-dev`'s modes was asked for. Data-only (per CLAUDE.md) with plain assigned fields\n * rather than a seven-argument constructor — the bin sets what argv carried and nothing else.\n */\nexport class PushDevOptions {\n /** Delete the remote copy — the rollback. */\n remove = false;\n /** List the live copies and stop. The one mode that needs no branch preconditions. */\n list = false;\n /** Discard a conflict resolution already published on the copy, and overwrite it. */\n force = false;\n /** Replay that resolution on top of the new local commits instead of discarding it. */\n rebaseResolution = false;\n /** Compose the other copies onto this one so the shared environment can build them together. */\n resolve = false;\n /** With `--resolve`: merge ONLY this developer's branch. Empty ⇒ every other copy. */\n resolveTarget = '';\n}\n\n/**\n * `wp-push-dev` — publish a DISPOSABLE copy of this branch so a shared dev environment can build it,\n * without landing anything on `main` and without opening a PR.\n *\n * WHY THIS COMMAND HAS TO EXIST AT ALL: `pr-creation-or-push-guard` blocks every `git push`, no\n * exceptions, by design. Its own fix-hint offers \"ask a human to run the push\" for out-of-band cases —\n * which is the right answer for a genuine exception and the wrong one for a routine daily action. Without\n * a gated command there is simply no legal way for an AI to get a branch onto a dev server, so the\n * feature was undoable rather than merely awkward.\n *\n * WHY IT CHECKS AGAINST `dev` FIRST (#1397): 61 of 73 failed dev publishes on one consumer failed on a git\n * conflict, which the developer only learned about after the server-side composition failed. So a plain\n * publish now does locally what CI is about to do: merge `origin/<devBranch>` into a THROWAWAY branch,\n * resolve any conflict there (the same halt / `wp-finish-push-dev` state machine `--resolve` uses), and run\n * `commands.push-dev.buildCommand` on the merged tree. A build against `main` alone would prove the wrong\n * thing; a build of only what differs from `dev` proves the right one, quickly.\n *\n * WHAT IS PUBLISHED IS NEVER THAT MERGE: the copy is the feature head plus, when something conflicted, one\n * commit recording the resolved files (DevResolveRunner.recordResolution). A copy that contained `dev`\n * would carry every other copy's history, and a later `--remove` of one of them would leave it on dev\n * through this one.\n *\n * WHAT IT NEVER DOES: touch the feature branch. See DevDeployRefs for the invariant and why the copy\n * exists to hold conflict resolutions that must not reach the PR.\n */\n@injectable(bindingScopeValues.Singleton)\nexport class PushDevCommand {\n constructor(\n private readonly repoRootFinder: RepoRootFinder,\n private readonly gitExec: GitExec,\n private readonly refs: DevDeployRefs,\n private readonly store: PushDevStateStore,\n private readonly runner: DevResolveRunner,\n private readonly watchHints: DevDeployWatchHints,\n private readonly devBuild: DevBuild,\n private readonly copyOnMain: DevCopyOnMain,\n ) {}\n\n async run(opts: PushDevOptions): Promise<void> {\n const repoRoot = this.repoRootFinder.resolveRepoRoot(process.cwd());\n // Refresh the AI-facing workflow doc so it is present + current for any failure message to cite —\n // same reason every other wp-* command opens this way.\n writeTemplate(repoRoot, 'webpieces.git-workflow.md');\n const cfg = this.refs.config(repoRoot);\n\n // A resolve already in flight owns the checkout; starting a second one would strand the first.\n this.assertNoResolveInProgress(repoRoot);\n\n if (opts.list) {\n await this.list(repoRoot, cfg);\n return;\n }\n\n const branch = this.refs.currentBranch(repoRoot);\n this.refs.assertPushable(cfg, branch);\n const targetRef = cfg.copyRefFor(branch);\n\n if (opts.remove) {\n await this.remove(repoRoot, cfg, branch, targetRef);\n return;\n }\n // Every remaining mode commits or merges, so the tree must be the AI's committed work and nothing\n // else. The tooling never commits for you.\n await this.gitExec.assertCleanTree(repoRoot);\n\n if (opts.resolve) {\n await this.startResolve(repoRoot, cfg, branch, targetRef, opts.resolveTarget);\n return;\n }\n await this.publish(repoRoot, cfg, branch, targetRef, opts);\n }\n\n /** `--list`: exactly the live copies, straight from the remote — never a cached local view. */\n private async list(repoRoot: string, cfg: DevDeployConfig): Promise<void> {\n const copies = await this.refs.liveCopies(repoRoot, cfg);\n if (copies.length === 0) {\n process.stdout.write(\n `\\nNo dev copies published — nothing matches \\`${cfg.copyRefGlob()}\\` on origin.\\n`\n + `Publish this branch's with: ${WP_PUSH_DEV}\\n`);\n return;\n }\n let out = '\\n' + SEP + `📋 ${String(copies.length)} dev cop${copies.length === 1 ? 'y' : 'ies'} on origin\\n` + SEP + '\\n';\n for (const copy of copies) out += ` ${copy.sha.slice(0, 8)} ${copy.ref}\\n`;\n out += `\\nYour CI composes \\`${cfg.devBranch}\\` from origin/main plus every ref above, on every run.\\n`\n + `Remove yours with: ${WP_PUSH_DEV} --remove (deletes your copy, then pushes the content-free\\n`\n + `\\`${cfg.removeMarkerRefFor('<your-branch>')}\\` marker your dev workflow triggers on and deletes)\\n`;\n process.stdout.write(out);\n }\n\n /**\n * `--remove`: delete the remote copy, then push the `<removeNamespace>/<branch>` marker (#1395). This\n * IS the rollback — nothing else has to be undone.\n *\n * WHY A MARKER AS WELL AS THE DELETION: a deletion can only be heard by a workflow's `on: delete:`,\n * which GitHub cannot filter by branch, so every branch deletion in the repo started a dev-deploy run.\n * A PUSH to `<removeNamespace>/**` is filterable. The deletion stays, unchanged, so a consumer whose\n * workflow still listens on `delete:` keeps working through the rollout window; the marker is purely\n * additive at the transport level.\n *\n * ALREADY ON MAIN (#1401): before anything is deleted, the copy is compared with `origin/main`. When\n * every file it changes already has the copy's content on main, removing it takes nothing off dev —\n * main keeps the change there — and would only force a pointless full recompose, so it is REFUSED\n * ({@link refuseLanded}). When only some files are, the rest is still a real rollback: it warns, naming\n * the landed files, and removes.\n *\n * ORDER: `origin/main` and the copy are fetched BEFORE anything is deleted, so a network failure there\n * leaves the pool exactly as it was. The marker push is the last step, and the only one that can fail with the\n * copy already gone — that is the state {@link markerPushFailed} names.\n */\n private async remove(repoRoot: string, cfg: DevDeployConfig, branch: string, targetRef: string): Promise<void> {\n if (await this.refs.remoteSha(repoRoot, targetRef) === '') {\n process.stdout.write(\n `\\nNothing to remove — \\`${targetRef}\\` is not published.\\n`\n + `List what IS published with: ${WP_PUSH_DEV} --list\\n`);\n return;\n }\n const markerRef = cfg.removeMarkerRefFor(branch);\n const mainTip = await this.refs.freshMainTip(repoRoot);\n await this.refs.fetchCopies(repoRoot, [targetRef]);\n const landing = await this.copyOnMain.landing(repoRoot, targetRef);\n if (landing.fullyOnMain()) {\n this.refuseLanded(targetRef, await this.copyOnMain.mergedPr(repoRoot, branch));\n }\n if (landing.partlyOnMain()) process.stdout.write(this.partlyLandedWarning(targetRef, landing));\n await this.gitExec.runGitChecked(['-C', repoRoot, 'push', 'origin', '--delete', `refs/heads/${targetRef}`],\n `Failed to delete the dev copy ${targetRef}`);\n // --force: the marker carries no content, so whatever an earlier, never-deleted marker pointed at\n // is worthless — and refusing a non-fast-forward here would strand the rollback half-done.\n const pushed = await this.gitExec.tryGit(\n ['-C', repoRoot, 'push', '--force', 'origin', `${mainTip}:refs/heads/${markerRef}`], repoRoot);\n if (!pushed.ok) this.markerPushFailed(cfg, branch, targetRef, markerRef, pushed.stderr);\n process.stdout.write(\n '\\n' + SEP + `🗑️ Removed ${targetRef}\\n` + SEP + '\\n'\n + `Pushed the marker \\`${markerRef}\\` (at origin/main ${mainTip.slice(0, 8)}) — your dev workflow triggers\\n`\n + `on it, deletes it, and rebuilds \\`${cfg.devBranch}\\` without \\`${branch}\\`. Your branch and any PR on it\\n`\n + 'are untouched.\\n');\n }\n\n /**\n * `--remove` of a copy whose every change is already on `origin/main`. Nothing was deleted and no marker\n * was pushed. There is deliberately no override: a remove cannot take back what main already holds, so\n * refusing never blocks a real rollback — that is a revert PR.\n */\n private refuseLanded(targetRef: string, pr: MergedPr | null): never {\n const landedVia = pr === null ? '' : ` (PR #${pr.num} landed ${pr.mergedAt})`;\n throw new CliExitError(2,\n '\\n' + SEP + `⛔ \\`${targetRef}\\` is already on origin/main — nothing was removed\\n` + SEP + '\\n'\n + `\\`${targetRef}\\` is already on origin/main${landedVia}, so removing the copy\\n`\n + 'would not take anything off dev — main keeps it there. The nightly reset deletes the copy.\\n'\n + 'Nothing was removed, and no rebuild marker was pushed.\\n\\n'\n + 'If that code is what broke dev, it is on main now: the fix is a revert PR against main, not a remove.\\n');\n }\n\n /** Some of the copy's files are already on main: the remove proceeds, and says what it does NOT take off. */\n private partlyLandedWarning(targetRef: string, landing: DevCopyLanding): string {\n return '\\n' + SEP + `⚠️ Part of \\`${targetRef}\\` is already on origin/main\\n` + SEP + '\\n'\n + `${String(landing.landed.length)} of the ${String(landing.changed.length)} files this copy changes already have the copy's content on\\n`\n + 'origin/main. Removing the copy does NOT take these off dev — main keeps them there:\\n'\n + landing.landed.map((f: string): string => ` ${f}`).join('\\n') + '\\n'\n + 'Only the rest of the copy is being removed. If one of the files above broke dev, the fix is a revert PR.\\n';\n }\n\n /**\n * The one half-done state `--remove` can leave: the copy is deleted, the rebuild signal is not sent.\n * Said out loud because it is invisible otherwise — `--list` already looks right, while the deployed\n * `dev` still runs the removed branch until something else triggers a composition.\n */\n private markerPushFailed(cfg: DevDeployConfig, branch: string, targetRef: string, markerRef: string, stderr: string): never {\n throw new CliExitError(1,\n '\\n' + SEP + `⛔ Removed \\`${targetRef}\\`, but pushing the rebuild marker \\`${markerRef}\\` FAILED\\n` + SEP + '\\n'\n + `Your copy is already GONE from origin, but \\`${cfg.devBranch}\\` was NOT rebuilt: the deployed dev server\\n`\n + `still runs \\`${branch}\\` until the next composition run.\\n\\n`\n + 'git said:\\n' + (stderr === '' ? ' (no output)' : stderr.split('\\n').map((l: string): string => ` ${l}`).join('\\n')) + '\\n\\n'\n + 'Any later composition run drops your branch on its own, because the copy no longer exists — the next\\n'\n + `\\`${WP_PUSH_DEV}\\` by anyone, or a push to main if your workflow composes on that. To force one now,\\n`\n + 'once the cause above is fixed (network, auth, a branch-protection rule on the marker namespace),\\n'\n + 're-publish and remove again; the second remove pushes the marker:\\n\\n'\n + ` ${WP_PUSH_DEV}\\n ${WP_PUSH_DEV} --remove\\n`);\n }\n\n /**\n * The ordinary path: check the copy against `origin/<devBranch>`, build it, then publish it as\n * `<namespace>/<branch>` (#1397). The merge, the conflict halt and the build all happen on a throwaway\n * branch through DevResolveRunner, in DevResolveMode.PREBUILD — so a conflict stops in exactly the\n * same `wp-finish-push-dev` state machine `--resolve` uses, rather than inventing a second way to be\n * stuck.\n *\n * THE CLOBBER GUARD runs first. If the remote copy holds commits the local branch does not, somebody\n * (quite possibly this developer, days ago) put real work there, and a silent force-push destroys it,\n * so the default is refusal with two named ways forward — never a \"use --force\" one-liner, which is how\n * a warning becomes a reflex. The one exception is a commit this flow wrote itself\n * ({@link RESOLUTION_SUBJECT}): the check below re-derives it against today's dev, so replacing it\n * loses nothing.\n */\n private async publish(repoRoot: string, cfg: DevDeployConfig, branch: string, targetRef: string, opts: PushDevOptions): Promise<void> {\n const remoteSha = await this.refs.remoteSha(repoRoot, targetRef);\n if (remoteSha !== '') {\n await this.refs.fetchCopies(repoRoot, [targetRef]);\n const subjects = await this.refs.subjectsOnlyOnRemote(repoRoot, targetRef);\n const ahead = subjects.filter((s: string): boolean => !s.startsWith(RESOLUTION_SUBJECT)).length;\n if (ahead > 0 && opts.rebaseResolution) {\n await this.rebaseResolution(repoRoot, branch, targetRef);\n return;\n }\n if (ahead > 0 && !opts.force) this.refuseClobber(cfg, branch, targetRef, ahead);\n }\n // Before any git write: an unconfigured dev build refuses here, with nothing merged or published.\n this.devBuild.command(repoRoot);\n if (await this.refs.remoteSha(repoRoot, cfg.devBranch) === '') {\n await this.publishWithoutDev(repoRoot, cfg, branch, targetRef, remoteSha, opts.force);\n return;\n }\n const state = new PushDevState(branch, this.runner.tmpBranchFor(branch), targetRef, [cfg.devBranch]);\n state.mode = DevResolveMode.PREBUILD;\n state.leaseSha = remoteSha;\n state.force = opts.force;\n process.stdout.write(this.runner.announcePrebuild(cfg, state));\n await this.runner.start(repoRoot, state, 'HEAD', [cfg.devBranch]);\n }\n\n /**\n * `origin/<devBranch>` does not exist yet — the very first publish in a repo whose CI has never\n * composed. There is nothing to conflict with and no base for a dev-scoped build, so the copy is\n * published as it is; refusing here would make the first dev composition impossible to start.\n */\n private async publishWithoutDev(\n repoRoot: string, cfg: DevDeployConfig, branch: string, targetRef: string, remoteSha: string, force: boolean,\n ): Promise<void> {\n const lease = remoteSha === '' ? [] : force ? ['--force'] : [`--force-with-lease=refs/heads/${targetRef}:${remoteSha}`];\n await this.gitExec.runGitChecked(['-C', repoRoot, 'push', ...lease, 'origin', `HEAD:refs/heads/${targetRef}`],\n `Failed to publish the dev copy ${targetRef}`);\n const published = await this.refs.headSha(repoRoot);\n process.stdout.write(\n '\\n' + SEP + `✅ Published ${targetRef}\\n` + SEP + '\\n'\n + `\\`origin/${cfg.devBranch}\\` does not exist yet, so there was nothing to check the copy against and no\\n`\n + `dev build ran. \\`${branch}\\` is now in the pool your CI composes \\`${cfg.devBranch}\\` from.\\n\\n`\n + ` ${WP_PUSH_DEV} --list ← what else is in the pool\\n`\n + ` ${WP_PUSH_DEV} --remove ← take this branch back out\\n`\n + this.watchHints.render(cfg, targetRef, published));\n }\n\n /**\n * `--rebase-resolution`: keep the published resolution, replay it on top of the new commits.\n *\n * Implemented as a resolve whose BASE is the local HEAD and whose queue is the copy itself, so a\n * replay that conflicts again lands in exactly the same halt/`wp-finish-push-dev` state machine as\n * any other conflict, rather than inventing a second way to be stuck.\n */\n private async rebaseResolution(repoRoot: string, branch: string, targetRef: string): Promise<void> {\n const state = new PushDevState(branch, this.runner.tmpBranchFor(branch), targetRef, [targetRef]);\n state.mode = DevResolveMode.REPLAY;\n process.stdout.write(\n '\\n' + SEP + `♻️ Replaying the published resolution onto \\`${branch}\\`\\n` + SEP + '\\n'\n + `Merging \\`${targetRef}\\` (which holds the resolution) into your new commits on a throwaway branch.\\n`\n + `Your feature branch \\`${branch}\\` is not touched.\\n\\n`);\n await this.runner.start(repoRoot, state, 'HEAD', [targetRef]);\n }\n\n /**\n * `--resolve`: compose the other copies onto this one, so what is published is what CI will build.\n *\n * With no argument the queue is EVERY other copy, in the same sorted order CI composes them — the\n * local resolution is then a rehearsal of the real composition, not a guess at it. With an argument\n * (the branch a CI conflict message names) it is just that one.\n */\n private async startResolve(repoRoot: string, cfg: DevDeployConfig, branch: string, targetRef: string, only: string): Promise<void> {\n if (await this.refs.remoteSha(repoRoot, targetRef) === '') {\n throw new CliExitError(2,\n '\\n' + SEP + `⛔ \\`${targetRef}\\` is not published yet\\n` + SEP + '\\n'\n + 'There is nothing to compose against. Publish your copy first, then resolve:\\n'\n + ` ${WP_PUSH_DEV}\\n ${WP_PUSH_DEV} --resolve\\n`);\n }\n const queue = await this.resolveQueue(repoRoot, cfg, targetRef, only);\n if (queue.length === 0) {\n process.stdout.write(\n `\\nNothing to compose — \\`${targetRef}\\` is the only copy in \\`${cfg.copyRefGlob()}\\`.\\n`\n + `Your CI will merge it onto origin/main by itself; there is no other branch to conflict with.\\n`);\n return;\n }\n const state = new PushDevState(branch, this.runner.tmpBranchFor(branch), targetRef, queue);\n state.mode = DevResolveMode.COMPOSE;\n process.stdout.write(this.runner.announce(cfg, state));\n await this.runner.start(repoRoot, state, `refs/remotes/origin/${targetRef}`, [targetRef, ...queue]);\n }\n\n // The refs to merge: one named copy, or every copy that is not mine. A named branch is accepted with\n // or without the namespace prefix, because the CI message that names it may print either.\n private async resolveQueue(repoRoot: string, cfg: DevDeployConfig, targetRef: string, only: string): Promise<string[]> {\n const copies = await this.refs.liveCopies(repoRoot, cfg);\n if (only === '') {\n return copies.filter((c: DevCopy): boolean => c.ref !== targetRef).map((c: DevCopy): string => c.ref);\n }\n const wanted = only.startsWith(`${cfg.branchNamespace}/`) ? only : cfg.copyRefFor(only);\n if (wanted === targetRef) {\n throw new CliExitError(2, `\\n⛔ \\`${only}\\` is your own copy — there is nothing to compose it with.\\n`);\n }\n if (!copies.some((c: DevCopy): boolean => c.ref === wanted)) {\n throw new CliExitError(2,\n '\\n' + SEP + `⛔ No published copy \\`${wanted}\\`\\n` + SEP + '\\n'\n + `Live copies (${WP_PUSH_DEV} --list):\\n`\n + copies.map((c: DevCopy): string => ` ${c.ref}`).join('\\n') + '\\n');\n }\n return [wanted];\n }\n\n private refuseClobber(cfg: DevDeployConfig, branch: string, targetRef: string, ahead: number): never {\n throw new CliExitError(2,\n '\\n' + SEP + `⛔ \\`${targetRef}\\` holds ${String(ahead)} commit(s) your branch does not\\n` + SEP + '\\n'\n + 'That is what a CONFLICT RESOLUTION looks like: somebody composed this copy against another\\n'\n + `developer's branch so \\`${cfg.devBranch}\\` could build, and that work exists ONLY on the copy —\\n`\n + 'by design, because it must never reach your feature branch or your PR.\\n\\n'\n + 'Publishing now would force-push over it and destroy it, so this command refuses. Pick one:\\n\\n'\n + ` ${WP_PUSH_DEV} --rebase-resolution\\n`\n + ' Replay that resolution on top of your new commits. Keeps the work; may ask you to\\n'\n + ' re-resolve the parts your new commits actually changed.\\n\\n'\n + ` ${WP_PUSH_DEV} --force\\n`\n + ' Discard it and publish your branch as-is. The composition breaks again until someone\\n'\n + ` re-resolves it with \\`${WP_PUSH_DEV} --resolve\\`.\\n\\n`\n + `See what is on the copy: git log --oneline ${branch}..refs/remotes/origin/${targetRef}\\n`);\n }\n\n // A half-finished resolve owns the checkout — it is parked on a throwaway branch, so \"the current\n // branch\" is not the feature branch this command would otherwise act on.\n private assertNoResolveInProgress(repoRoot: string): void {\n const state = this.store.read(repoRoot);\n if (state === null) return;\n throw new CliExitError(2,\n '\\n' + SEP + '⛔ A dev-deploy resolve is already in progress\\n' + SEP + '\\n'\n + `You are on the throwaway branch \\`${state.tmpBranch}\\`, mid-composition. Finish it or bail out:\\n`\n + ` ${WP_FINISH_PUSH_DEV} ← commit the resolution, resume the queue, publish\\n`\n + ` ${WP_FINISH_PUSH_DEV} --abort ← throw it away and go back to \\`${state.originalBranch}\\`\\n`);\n }\n}\n"]}
@@ -10,6 +10,7 @@ import { CheckPrCommand } from './commands/check-pr-command';
10
10
  import { ReviewUpsertPrCommand } from './commands/review-upsert-pr-command';
11
11
  import { ReapWorktreeCommand } from './commands/reap-worktree-command';
12
12
  import { BuildCommand, BuildOptions } from './commands/build-command';
13
+ import { BuildDevCommand } from './commands/build-dev-command';
13
14
  import { AwaitReviewsCommand } from './commands/await-reviews-command';
14
15
  import { ReviewBudgetCheckOptions, WriteReviewCommand, WriteReviewOptions } from './commands/write-review-command';
15
16
  import { WriteReviewFixesCommand, WriteReviewFixesOptions } from './commands/write-review-fixes-command';
@@ -38,6 +39,7 @@ export declare class PrGateApp {
38
39
  private readonly reviewUpsertPrCommand;
39
40
  private readonly reapWorktreeCommand;
40
41
  private readonly buildCommand;
42
+ private readonly buildDevCommand;
41
43
  private readonly awaitReviewsCommand;
42
44
  private readonly writeReviewCommand;
43
45
  private readonly writeReviewFixesCommand;
@@ -48,7 +50,7 @@ export declare class PrGateApp {
48
50
  private readonly upsertHotfixPrCommand;
49
51
  private readonly pushDevStateStore;
50
52
  private readonly repoRootFinder;
51
- constructor(startUpdateCommand: StartUpdateCommand, finishUpdateCommand: FinishUpdateCommand, startUpsertPrCommand: StartUpsertPrCommand, finishUpsertPrCommand: FinishUpsertPrCommand, cleanupCommand: CleanupCommand, syncMainCommand: SyncMainCommand, landPrCommand: LandPrCommand, checkPrCommand: CheckPrCommand, reviewUpsertPrCommand: ReviewUpsertPrCommand, reapWorktreeCommand: ReapWorktreeCommand, buildCommand: BuildCommand, awaitReviewsCommand: AwaitReviewsCommand, writeReviewCommand: WriteReviewCommand, writeReviewFixesCommand: WriteReviewFixesCommand, awaitChecksCommand: AwaitChecksCommand, pushDevCommand: PushDevCommand, finishPushDevCommand: FinishPushDevCommand, humanPostPrCommand: HumanPostPrCommand, upsertHotfixPrCommand: UpsertHotfixPrCommand, pushDevStateStore: PushDevStateStore, repoRootFinder: RepoRootFinder);
53
+ constructor(startUpdateCommand: StartUpdateCommand, finishUpdateCommand: FinishUpdateCommand, startUpsertPrCommand: StartUpsertPrCommand, finishUpsertPrCommand: FinishUpsertPrCommand, cleanupCommand: CleanupCommand, syncMainCommand: SyncMainCommand, landPrCommand: LandPrCommand, checkPrCommand: CheckPrCommand, reviewUpsertPrCommand: ReviewUpsertPrCommand, reapWorktreeCommand: ReapWorktreeCommand, buildCommand: BuildCommand, buildDevCommand: BuildDevCommand, awaitReviewsCommand: AwaitReviewsCommand, writeReviewCommand: WriteReviewCommand, writeReviewFixesCommand: WriteReviewFixesCommand, awaitChecksCommand: AwaitChecksCommand, pushDevCommand: PushDevCommand, finishPushDevCommand: FinishPushDevCommand, humanPostPrCommand: HumanPostPrCommand, upsertHotfixPrCommand: UpsertHotfixPrCommand, pushDevStateStore: PushDevStateStore, repoRootFinder: RepoRootFinder);
52
54
  /**
53
55
  * Refuse `command` while a `wp-push-dev --resolve` is half-finished.
54
56
  *
@@ -58,7 +60,7 @@ export declare class PrGateApp {
58
60
  * tenth. PushDevStateStore owns the blocked list AND renders the hint from it, so the two cannot drift.
59
61
  */
60
62
  private assertNoResolveInProgress;
61
- /** `wp-push-dev`: publish a DISPOSABLE copy of this branch for the shared dev environment. No PR, no build. */
63
+ /** `wp-push-dev`: check this branch against dev, build it, and publish a DISPOSABLE copy of it. No PR. */
62
64
  pushDev(opts?: PushDevOptions): Promise<void>;
63
65
  /** `wp-finish-push-dev`: commit a resolved dev composition and publish it (conflict path only). */
64
66
  finishPushDev(opts?: FinishPushDevOptions): Promise<void>;
@@ -74,6 +76,12 @@ export declare class PrGateApp {
74
76
  * `wp-push-dev --resolve`: it mutates nothing and reads no branch state.
75
77
  */
76
78
  build(opts: BuildOptions): Promise<void>;
79
+ /**
80
+ * `wp-build-dev`: merge `origin/<devBranch>` into a throwaway, run `commands.push-dev.buildCommand` on
81
+ * it, and go back — the check `wp-push-dev` runs before publishing, without the publish (#1397).
82
+ * Blocked during a resolve: it parks the checkout on a throwaway of its own.
83
+ */
84
+ buildDev(): Promise<void>;
77
85
  /**
78
86
  * `wp-await-reviews`: BLOCK until every reviewer verdict this branch owes has landed, then print
79
87
  * them. Not blocked during a `wp-push-dev --resolve`: it reads verdict files and mutates nothing.
@@ -15,6 +15,7 @@ const check_pr_command_1 = require("./commands/check-pr-command");
15
15
  const review_upsert_pr_command_1 = require("./commands/review-upsert-pr-command");
16
16
  const reap_worktree_command_1 = require("./commands/reap-worktree-command");
17
17
  const build_command_1 = require("./commands/build-command");
18
+ const build_dev_command_1 = require("./commands/build-dev-command");
18
19
  const await_reviews_command_1 = require("./commands/await-reviews-command");
19
20
  const write_review_command_1 = require("./commands/write-review-command");
20
21
  const write_review_fixes_command_1 = require("./commands/write-review-fixes-command");
@@ -43,6 +44,7 @@ let PrGateApp = class PrGateApp {
43
44
  reviewUpsertPrCommand;
44
45
  reapWorktreeCommand;
45
46
  buildCommand;
47
+ buildDevCommand;
46
48
  awaitReviewsCommand;
47
49
  writeReviewCommand;
48
50
  writeReviewFixesCommand;
@@ -53,7 +55,7 @@ let PrGateApp = class PrGateApp {
53
55
  upsertHotfixPrCommand;
54
56
  pushDevStateStore;
55
57
  repoRootFinder;
56
- constructor(startUpdateCommand, finishUpdateCommand, startUpsertPrCommand, finishUpsertPrCommand, cleanupCommand, syncMainCommand, landPrCommand, checkPrCommand, reviewUpsertPrCommand, reapWorktreeCommand, buildCommand, awaitReviewsCommand, writeReviewCommand, writeReviewFixesCommand, awaitChecksCommand, pushDevCommand, finishPushDevCommand, humanPostPrCommand, upsertHotfixPrCommand, pushDevStateStore, repoRootFinder) {
58
+ constructor(startUpdateCommand, finishUpdateCommand, startUpsertPrCommand, finishUpsertPrCommand, cleanupCommand, syncMainCommand, landPrCommand, checkPrCommand, reviewUpsertPrCommand, reapWorktreeCommand, buildCommand, buildDevCommand, awaitReviewsCommand, writeReviewCommand, writeReviewFixesCommand, awaitChecksCommand, pushDevCommand, finishPushDevCommand, humanPostPrCommand, upsertHotfixPrCommand, pushDevStateStore, repoRootFinder) {
57
59
  this.startUpdateCommand = startUpdateCommand;
58
60
  this.finishUpdateCommand = finishUpdateCommand;
59
61
  this.startUpsertPrCommand = startUpsertPrCommand;
@@ -65,6 +67,7 @@ let PrGateApp = class PrGateApp {
65
67
  this.reviewUpsertPrCommand = reviewUpsertPrCommand;
66
68
  this.reapWorktreeCommand = reapWorktreeCommand;
67
69
  this.buildCommand = buildCommand;
70
+ this.buildDevCommand = buildDevCommand;
68
71
  this.awaitReviewsCommand = awaitReviewsCommand;
69
72
  this.writeReviewCommand = writeReviewCommand;
70
73
  this.writeReviewFixesCommand = writeReviewFixesCommand;
@@ -89,7 +92,7 @@ let PrGateApp = class PrGateApp {
89
92
  return;
90
93
  this.pushDevStateStore.assertIdle(this.repoRootFinder.resolveRepoRoot(process.cwd()), command);
91
94
  }
92
- /** `wp-push-dev`: publish a DISPOSABLE copy of this branch for the shared dev environment. No PR, no build. */
95
+ /** `wp-push-dev`: check this branch against dev, build it, and publish a DISPOSABLE copy of it. No PR. */
93
96
  pushDev(opts = new push_dev_command_1.PushDevOptions()) {
94
97
  return this.pushDevCommand.run(opts);
95
98
  }
@@ -113,6 +116,15 @@ let PrGateApp = class PrGateApp {
113
116
  build(opts) {
114
117
  return this.buildCommand.run(opts);
115
118
  }
119
+ /**
120
+ * `wp-build-dev`: merge `origin/<devBranch>` into a throwaway, run `commands.push-dev.buildCommand` on
121
+ * it, and go back — the check `wp-push-dev` runs before publishing, without the publish (#1397).
122
+ * Blocked during a resolve: it parks the checkout on a throwaway of its own.
123
+ */
124
+ buildDev() {
125
+ this.assertNoResolveInProgress('wp-build-dev');
126
+ return this.buildDevCommand.run();
127
+ }
116
128
  /**
117
129
  * `wp-await-reviews`: BLOCK until every reviewer verdict this branch owes has landed, then print
118
130
  * them. Not blocked during a `wp-push-dev --resolve`: it reads verdict files and mutates nothing.
@@ -230,6 +242,7 @@ exports.PrGateApp = PrGateApp = tslib_1.__decorate([
230
242
  review_upsert_pr_command_1.ReviewUpsertPrCommand,
231
243
  reap_worktree_command_1.ReapWorktreeCommand,
232
244
  build_command_1.BuildCommand,
245
+ build_dev_command_1.BuildDevCommand,
233
246
  await_reviews_command_1.AwaitReviewsCommand,
234
247
  write_review_command_1.WriteReviewCommand,
235
248
  write_review_fixes_command_1.WriteReviewFixesCommand,
@@ -1 +1 @@
1
- {"version":3,"file":"pr-gate-app.js","sourceRoot":"","sources":["../../../../../../packages/tooling/pr-gate/src/scripts/pr-gate-app.ts"],"names":[],"mappings":";;;;AAAA,0DAAyD;AACzD,yCAA2D;AAC3D,0EAAqE;AACrE,4EAAuE;AACvE,gFAA0E;AAC1E,kFAA4E;AAC5E,gEAA4D;AAE5D,oEAA+D;AAC/D,gEAA0E;AAC1E,kEAA6D;AAC7D,kFAA4E;AAC5E,4EAAuE;AACvE,4DAAsE;AACtE,4EAAuE;AACvE,0EAAmH;AACnH,sFAAyG;AACzG,0EAAyF;AACzF,kEAA6E;AAC7E,gFAAgG;AAChG,4EAAsE;AACtE,kFAA4E;AAC5E,8DAA8D;AAC9D,0DAAyD;AAEzD;;;;;GAKG;AAGI,IAAM,SAAS,GAAf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/C,OAAO,IAAI,CAAC,eAAe,CAAC,GAAG,EAAE,CAAC;IACtC,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,OAAsB;QACzB,IAAI,CAAC,yBAAyB,CAAC,YAAY,CAAC,CAAC;QAC7C,OAAO,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAC3C,CAAC;IAED;;;;OAIG;IACH,cAAc;QACV,IAAI,CAAC,yBAAyB,CAAC,qBAAqB,CAAC,CAAC;QACtD,OAAO,IAAI,CAAC,qBAAqB,CAAC,GAAG,EAAE,CAAC;IAC5C,CAAC;IAED,+GAA+G;IAC/G,OAAO;QACH,OAAO,IAAI,CAAC,cAAc,CAAC,GAAG,EAAE,CAAC;IACrC,CAAC;CACJ,CAAA;AAzLY,8BAAS;oBAAT,SAAS;IAFrB,IAAA,6BAAc,GAAE;IAChB,IAAA,sBAAU,EAAC,8BAAkB,CAAC,SAAS,CAAC;6CAGI,yCAAkB;QACjB,2CAAmB;QAClB,8CAAoB;QACnB,gDAAqB;QAC5B,gCAAc;QACb,mCAAe;QACjB,+BAAa;QACZ,iCAAc;QACP,gDAAqB;QACvB,2CAAmB;QAC1B,4BAAY;QACL,2CAAmB;QACpB,yCAAkB;QACb,oDAAuB;QAC5B,yCAAkB;QACtB,iCAAc;QACR,8CAAoB;QACtB,0CAAkB;QACf,gDAAqB;QACzB,kCAAiB;QACpB,6BAAc;GAtB1C,SAAS,CAyLrB","sourcesContent":["import { DocumentDesign } from '@webpieces/rules-config';\nimport { injectable, bindingScopeValues } from 'inversify';\nimport { StartUpdateCommand } from './commands/start-update-command';\nimport { FinishUpdateCommand } from './commands/finish-update-command';\nimport { StartUpsertPrCommand } from './commands/start-upsert-pr-command';\nimport { FinishUpsertPrCommand } from './commands/finish-upsert-pr-command';\nimport { CleanupCommand } from './commands/cleanup-command';\nimport { CleanupOptions } from './commands/cleanup-options';\nimport { SyncMainCommand } from './commands/sync-main-command';\nimport { LandPrCommand, LandPrRequest } from './commands/land-pr-command';\nimport { CheckPrCommand } from './commands/check-pr-command';\nimport { ReviewUpsertPrCommand } from './commands/review-upsert-pr-command';\nimport { ReapWorktreeCommand } from './commands/reap-worktree-command';\nimport { BuildCommand, BuildOptions } from './commands/build-command';\nimport { AwaitReviewsCommand } from './commands/await-reviews-command';\nimport { ReviewBudgetCheckOptions, WriteReviewCommand, WriteReviewOptions } from './commands/write-review-command';\nimport { WriteReviewFixesCommand, WriteReviewFixesOptions } from './commands/write-review-fixes-command';\nimport { AwaitChecksCommand, AwaitChecksOptions } from './commands/await-checks-command';\nimport { PushDevCommand, PushDevOptions } from './commands/push-dev-command';\nimport { FinishPushDevCommand, FinishPushDevOptions } from './commands/finish-push-dev-command';\nimport { HumanPostPrCommand } from './commands/human-post-pr-command';\nimport { UpsertHotfixPrCommand } from './commands/upsert-hotfix-pr-command';\nimport { PushDevStateStore } from './workflow/push-dev-state';\nimport { RepoRootFinder } from '@webpieces/rules-config';\n\n/**\n * The pr-gate application root. `container.get(PrGateApp)` resolves the entire workflow DAG (the command\n * classes → the injected git/merge/dashboard services). `@DocumentDesign` marks it the\n * top-of-DAG the DI-design analyzer roots on, so `role:app` pr-gate draws its design. Each `bin/*`\n * entry resolves THIS and calls the matching command method.\n */\n@DocumentDesign()\n@injectable(bindingScopeValues.Singleton)\nexport class PrGateApp {\n constructor(\n private readonly startUpdateCommand: StartUpdateCommand,\n private readonly finishUpdateCommand: FinishUpdateCommand,\n private readonly startUpsertPrCommand: StartUpsertPrCommand,\n private readonly finishUpsertPrCommand: FinishUpsertPrCommand,\n private readonly cleanupCommand: CleanupCommand,\n private readonly syncMainCommand: SyncMainCommand,\n private readonly landPrCommand: LandPrCommand,\n private readonly checkPrCommand: CheckPrCommand,\n private readonly reviewUpsertPrCommand: ReviewUpsertPrCommand,\n private readonly reapWorktreeCommand: ReapWorktreeCommand,\n private readonly buildCommand: BuildCommand,\n private readonly awaitReviewsCommand: AwaitReviewsCommand,\n private readonly writeReviewCommand: WriteReviewCommand,\n private readonly writeReviewFixesCommand: WriteReviewFixesCommand,\n private readonly awaitChecksCommand: AwaitChecksCommand,\n private readonly pushDevCommand: PushDevCommand,\n private readonly finishPushDevCommand: FinishPushDevCommand,\n private readonly humanPostPrCommand: HumanPostPrCommand,\n private readonly upsertHotfixPrCommand: UpsertHotfixPrCommand,\n private readonly pushDevStateStore: PushDevStateStore,\n private readonly repoRootFinder: RepoRootFinder,\n ) {}\n\n /**\n * Refuse `command` while a `wp-push-dev --resolve` is half-finished.\n *\n * Enforced HERE, at the one place every bin funnels through, rather than in each command: a resolve\n * parks the checkout on a throwaway branch, so every command below would act on a branch that is not\n * the one it thinks it is. Putting the check in nine constructors is nine chances to forget it in the\n * tenth. PushDevStateStore owns the blocked list AND renders the hint from it, so the two cannot drift.\n */\n private assertNoResolveInProgress(command: string): void {\n if (!this.pushDevStateStore.isBlockedDuringResolve(command)) return;\n this.pushDevStateStore.assertIdle(\n this.repoRootFinder.resolveRepoRoot(process.cwd()),\n command,\n );\n }\n\n /** `wp-push-dev`: publish a DISPOSABLE copy of this branch for the shared dev environment. No PR, no build. */\n pushDev(opts: PushDevOptions = new PushDevOptions()): Promise<void> {\n return this.pushDevCommand.run(opts);\n }\n\n /** `wp-finish-push-dev`: commit a resolved dev composition and publish it (conflict path only). */\n finishPushDev(opts: FinishPushDevOptions = new FinishPushDevOptions()): Promise<void> {\n return this.finishPushDevCommand.run(opts);\n }\n\n /**\n * INTERNAL (`wp-reap-worktree.js`, no `bin` entry): remove ONE named worktree and its branch.\n * `wp-land-pr` spawns it with cwd = the primary clone so the tree it just landed from can be\n * reaped by a process that is not standing in it.\n */\n reapWorktree(args: string[]): Promise<void> {\n return this.reapWorktreeCommand.run(args);\n }\n\n /**\n * `wp-build`: run this repo's ONE configured build (`commands.pr-gate.buildCommand`) — the same\n * command, resolved by the same resolver, that the PR gate's build stage runs. Not blocked during a\n * `wp-push-dev --resolve`: it mutates nothing and reads no branch state.\n */\n build(opts: BuildOptions): Promise<void> {\n return this.buildCommand.run(opts);\n }\n\n /**\n * `wp-await-reviews`: BLOCK until every reviewer verdict this branch owes has landed, then print\n * them. Not blocked during a `wp-push-dev --resolve`: it reads verdict files and mutates nothing.\n */\n awaitReviews(): Promise<void> {\n return this.awaitReviewsCommand.run();\n }\n\n /**\n * `wp-write-review`: a reviewer subagent submits ONE checklist verdict, with provenance (issue #863).\n * Not blocked during a `wp-push-dev --resolve`: it writes only this branch's review state.\n */\n writeReview(opts: WriteReviewOptions): Promise<void> {\n return this.writeReviewCommand.run(opts);\n }\n\n /** `wp-write-review --check`: may this checklist still be reviewed on this branch (issue #1051)? */\n checkReviewBudget(opts: ReviewBudgetCheckOptions): Promise<void> {\n return this.writeReviewCommand.check(opts);\n }\n\n /** `wp-write-review-fixes`: the coordinator records committed fixes without editing a reviewer verdict. */\n writeReviewFixes(opts: WriteReviewFixesOptions): Promise<void> {\n return this.writeReviewFixesCommand.run(opts);\n }\n\n /**\n * `wp-await-checks --pr <n>`: BLOCK until that PR's checks stop running, then print where they\n * landed. Read-only against GitHub, so it too is allowed during a resolve.\n */\n awaitChecks(opts: AwaitChecksOptions): Promise<void> {\n return this.awaitChecksCommand.run(opts);\n }\n\n /** `wp-start-update`: 3-point squash-update from main (no PR). */\n startUpdate(): Promise<void> {\n this.assertNoResolveInProgress('wp-start-update');\n return this.startUpdateCommand.run();\n }\n\n /** `wp-finish-update`: validate + finalize a resolved 3-point merge (no PR). */\n finishUpdate(): Promise<void> {\n this.assertNoResolveInProgress('wp-finish-update');\n return this.finishUpdateCommand.run();\n }\n\n /** `wp-start-upsert-pr`: update from main (3-point merge), hand off summary.json. No build gate, no push. */\n startUpsertPr(): Promise<void> {\n this.assertNoResolveInProgress('wp-start-upsert-pr');\n return this.startUpsertPrCommand.run();\n }\n\n /** `wp-finish-upsert-pr`: finalize merge, authoritative build gate, dashboard, create/update PR. */\n finishUpsertPr(): Promise<void> {\n this.assertNoResolveInProgress('wp-finish-upsert-pr');\n return this.finishUpsertPrCommand.run();\n }\n\n /** `wp-human-post-pr`: human-attested post with optional local build and no automated review. */\n humanPostPr(): Promise<void> {\n this.assertNoResolveInProgress('wp-human-post-pr');\n return this.humanPostPrCommand.run();\n }\n\n /**\n * `wp-upsert-hotfix-pr`: the one command for a `/hotfix/` branch — `hotfix-ci` gate, no merge from\n * main, one fast-forward push, upsert the bannered PR, never auto-merge (issue #1057).\n */\n upsertHotfixPr(): Promise<void> {\n this.assertNoResolveInProgress('wp-upsert-hotfix-pr');\n return this.upsertHotfixPrCommand.run();\n }\n\n /**\n * `wp-cleanup`: reap what is provably merged AND every zero-commit husk, then report the rest with\n * the exact flags that take it. `options` carries what argv said — see CleanupOptions.\n */\n cleanup(options: CleanupOptions): Promise<void> {\n this.assertNoResolveInProgress('wp-cleanup');\n return this.cleanupCommand.run(options);\n }\n\n /**\n * `wp-sync-main`: go to main, fast-forward it, reap dead worktrees and branches, and sweep\n * the orphan directories a project move leaves behind. Replaces `git checkout main && git pull\n * origin main` outright — see SyncMainCommand for why the old pair must stop being accepted\n * rather than surviving beside this.\n */\n syncMain(): Promise<void> {\n this.assertNoResolveInProgress('wp-sync-main');\n return this.syncMainCommand.run();\n }\n\n /**\n * `wp-land-pr`: squash-merge a PR into main with the compact commit body — this branch's by default,\n * or the one `--pr <n>` names, which is how a coordinator finishes a gone agent's work.\n */\n landPr(request: LandPrRequest): Promise<void> {\n this.assertNoResolveInProgress('wp-land-pr');\n return this.landPrCommand.run(request);\n }\n\n /**\n * `wp-review-upsert-pr`: STAGE ② — validate the 3-point merge, run the build gate, extract this\n * branch's diff, and brief the reviewer subagents. Unlike the report-only command it replaces, this CAN\n * fail — before any reviewer is spawned, so a broken branch costs no reviewer tokens.\n */\n reviewUpsertPr(): Promise<void> {\n this.assertNoResolveInProgress('wp-review-upsert-pr');\n return this.reviewUpsertPrCommand.run();\n }\n\n /** `wp-check-pr`: READ-ONLY CI check — verify the PR body carries a valid HMAC gate token for its head sha. */\n checkPr(): Promise<void> {\n return this.checkPrCommand.run();\n }\n}\n"]}
1
+ {"version":3,"file":"pr-gate-app.js","sourceRoot":"","sources":["../../../../../../packages/tooling/pr-gate/src/scripts/pr-gate-app.ts"],"names":[],"mappings":";;;;AAAA,0DAAyD;AACzD,yCAA2D;AAC3D,0EAAqE;AACrE,4EAAuE;AACvE,gFAA0E;AAC1E,kFAA4E;AAC5E,gEAA4D;AAE5D,oEAA+D;AAC/D,gEAA0E;AAC1E,kEAA6D;AAC7D,kFAA4E;AAC5E,4EAAuE;AACvE,4DAAsE;AACtE,oEAA+D;AAC/D,4EAAuE;AACvE,0EAAmH;AACnH,sFAAyG;AACzG,0EAAyF;AACzF,kEAA6E;AAC7E,gFAAgG;AAChG,4EAAsE;AACtE,kFAA4E;AAC5E,8DAA8D;AAC9D,0DAAyD;AAEzD;;;;;GAKG;AAGI,IAAM,SAAS,GAAf,MAAM,SAAS;IAEG;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IAtBrB,YACqB,kBAAsC,EACtC,mBAAwC,EACxC,oBAA0C,EAC1C,qBAA4C,EAC5C,cAA8B,EAC9B,eAAgC,EAChC,aAA4B,EAC5B,cAA8B,EAC9B,qBAA4C,EAC5C,mBAAwC,EACxC,YAA0B,EAC1B,eAAgC,EAChC,mBAAwC,EACxC,kBAAsC,EACtC,uBAAgD,EAChD,kBAAsC,EACtC,cAA8B,EAC9B,oBAA0C,EAC1C,kBAAsC,EACtC,qBAA4C,EAC5C,iBAAoC,EACpC,cAA8B;QArB9B,uBAAkB,GAAlB,kBAAkB,CAAoB;QACtC,wBAAmB,GAAnB,mBAAmB,CAAqB;QACxC,yBAAoB,GAApB,oBAAoB,CAAsB;QAC1C,0BAAqB,GAArB,qBAAqB,CAAuB;QAC5C,mBAAc,GAAd,cAAc,CAAgB;QAC9B,oBAAe,GAAf,eAAe,CAAiB;QAChC,kBAAa,GAAb,aAAa,CAA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AAT,SAAS;IAFrB,IAAA,6BAAc,GAAE;IAChB,IAAA,sBAAU,EAAC,8BAAkB,CAAC,SAAS,CAAC;6CAGI,yCAAkB;QACjB,2CAAmB;QAClB,8CAAoB;QACnB,gDAAqB;QAC5B,gCAAc;QACb,mCAAe;QACjB,+BAAa;QACZ,iCAAc;QACP,gDAAqB;QACvB,2CAAmB;QAC1B,4BAAY;QACT,mCAAe;QACX,2CAAmB;QACpB,yCAAkB;QACb,oDAAuB;QAC5B,yCAAkB;QACtB,iCAAc;QACR,8CAAoB;QACtB,0CAAkB;QACf,gDAAqB;QACzB,kCAAiB;QACpB,6BAAc;GAvB1C,SAAS,CAoMrB","sourcesContent":["import { DocumentDesign } from '@webpieces/rules-config';\nimport { injectable, bindingScopeValues } from 'inversify';\nimport { StartUpdateCommand } from './commands/start-update-command';\nimport { FinishUpdateCommand } from './commands/finish-update-command';\nimport { StartUpsertPrCommand } from './commands/start-upsert-pr-command';\nimport { FinishUpsertPrCommand } from './commands/finish-upsert-pr-command';\nimport { CleanupCommand } from './commands/cleanup-command';\nimport { CleanupOptions } from './commands/cleanup-options';\nimport { SyncMainCommand } from './commands/sync-main-command';\nimport { LandPrCommand, LandPrRequest } from './commands/land-pr-command';\nimport { CheckPrCommand } from './commands/check-pr-command';\nimport { ReviewUpsertPrCommand } from './commands/review-upsert-pr-command';\nimport { ReapWorktreeCommand } from './commands/reap-worktree-command';\nimport { BuildCommand, BuildOptions } from './commands/build-command';\nimport { BuildDevCommand } from './commands/build-dev-command';\nimport { AwaitReviewsCommand } from './commands/await-reviews-command';\nimport { ReviewBudgetCheckOptions, WriteReviewCommand, WriteReviewOptions } from './commands/write-review-command';\nimport { WriteReviewFixesCommand, WriteReviewFixesOptions } from './commands/write-review-fixes-command';\nimport { AwaitChecksCommand, AwaitChecksOptions } from './commands/await-checks-command';\nimport { PushDevCommand, PushDevOptions } from './commands/push-dev-command';\nimport { FinishPushDevCommand, FinishPushDevOptions } from './commands/finish-push-dev-command';\nimport { HumanPostPrCommand } from './commands/human-post-pr-command';\nimport { UpsertHotfixPrCommand } from './commands/upsert-hotfix-pr-command';\nimport { PushDevStateStore } from './workflow/push-dev-state';\nimport { RepoRootFinder } from '@webpieces/rules-config';\n\n/**\n * The pr-gate application root. `container.get(PrGateApp)` resolves the entire workflow DAG (the command\n * classes → the injected git/merge/dashboard services). `@DocumentDesign` marks it the\n * top-of-DAG the DI-design analyzer roots on, so `role:app` pr-gate draws its design. Each `bin/*`\n * entry resolves THIS and calls the matching command method.\n */\n@DocumentDesign()\n@injectable(bindingScopeValues.Singleton)\nexport class PrGateApp {\n constructor(\n private readonly startUpdateCommand: StartUpdateCommand,\n private readonly finishUpdateCommand: FinishUpdateCommand,\n private readonly startUpsertPrCommand: StartUpsertPrCommand,\n private readonly finishUpsertPrCommand: FinishUpsertPrCommand,\n private readonly cleanupCommand: CleanupCommand,\n private readonly syncMainCommand: SyncMainCommand,\n private readonly landPrCommand: LandPrCommand,\n private readonly checkPrCommand: CheckPrCommand,\n private readonly reviewUpsertPrCommand: ReviewUpsertPrCommand,\n private readonly reapWorktreeCommand: ReapWorktreeCommand,\n private readonly buildCommand: BuildCommand,\n private readonly buildDevCommand: BuildDevCommand,\n private readonly awaitReviewsCommand: AwaitReviewsCommand,\n private readonly writeReviewCommand: WriteReviewCommand,\n private readonly writeReviewFixesCommand: WriteReviewFixesCommand,\n private readonly awaitChecksCommand: AwaitChecksCommand,\n private readonly pushDevCommand: PushDevCommand,\n private readonly finishPushDevCommand: FinishPushDevCommand,\n private readonly humanPostPrCommand: HumanPostPrCommand,\n private readonly upsertHotfixPrCommand: UpsertHotfixPrCommand,\n private readonly pushDevStateStore: PushDevStateStore,\n private readonly repoRootFinder: RepoRootFinder,\n ) {}\n\n /**\n * Refuse `command` while a `wp-push-dev --resolve` is half-finished.\n *\n * Enforced HERE, at the one place every bin funnels through, rather than in each command: a resolve\n * parks the checkout on a throwaway branch, so every command below would act on a branch that is not\n * the one it thinks it is. Putting the check in nine constructors is nine chances to forget it in the\n * tenth. PushDevStateStore owns the blocked list AND renders the hint from it, so the two cannot drift.\n */\n private assertNoResolveInProgress(command: string): void {\n if (!this.pushDevStateStore.isBlockedDuringResolve(command)) return;\n this.pushDevStateStore.assertIdle(\n this.repoRootFinder.resolveRepoRoot(process.cwd()),\n command,\n );\n }\n\n /** `wp-push-dev`: check this branch against dev, build it, and publish a DISPOSABLE copy of it. No PR. */\n pushDev(opts: PushDevOptions = new PushDevOptions()): Promise<void> {\n return this.pushDevCommand.run(opts);\n }\n\n /** `wp-finish-push-dev`: commit a resolved dev composition and publish it (conflict path only). */\n finishPushDev(opts: FinishPushDevOptions = new FinishPushDevOptions()): Promise<void> {\n return this.finishPushDevCommand.run(opts);\n }\n\n /**\n * INTERNAL (`wp-reap-worktree.js`, no `bin` entry): remove ONE named worktree and its branch.\n * `wp-land-pr` spawns it with cwd = the primary clone so the tree it just landed from can be\n * reaped by a process that is not standing in it.\n */\n reapWorktree(args: string[]): Promise<void> {\n return this.reapWorktreeCommand.run(args);\n }\n\n /**\n * `wp-build`: run this repo's ONE configured build (`commands.pr-gate.buildCommand`) — the same\n * command, resolved by the same resolver, that the PR gate's build stage runs. Not blocked during a\n * `wp-push-dev --resolve`: it mutates nothing and reads no branch state.\n */\n build(opts: BuildOptions): Promise<void> {\n return this.buildCommand.run(opts);\n }\n\n /**\n * `wp-build-dev`: merge `origin/<devBranch>` into a throwaway, run `commands.push-dev.buildCommand` on\n * it, and go back — the check `wp-push-dev` runs before publishing, without the publish (#1397).\n * Blocked during a resolve: it parks the checkout on a throwaway of its own.\n */\n buildDev(): Promise<void> {\n this.assertNoResolveInProgress('wp-build-dev');\n return this.buildDevCommand.run();\n }\n\n /**\n * `wp-await-reviews`: BLOCK until every reviewer verdict this branch owes has landed, then print\n * them. Not blocked during a `wp-push-dev --resolve`: it reads verdict files and mutates nothing.\n */\n awaitReviews(): Promise<void> {\n return this.awaitReviewsCommand.run();\n }\n\n /**\n * `wp-write-review`: a reviewer subagent submits ONE checklist verdict, with provenance (issue #863).\n * Not blocked during a `wp-push-dev --resolve`: it writes only this branch's review state.\n */\n writeReview(opts: WriteReviewOptions): Promise<void> {\n return this.writeReviewCommand.run(opts);\n }\n\n /** `wp-write-review --check`: may this checklist still be reviewed on this branch (issue #1051)? */\n checkReviewBudget(opts: ReviewBudgetCheckOptions): Promise<void> {\n return this.writeReviewCommand.check(opts);\n }\n\n /** `wp-write-review-fixes`: the coordinator records committed fixes without editing a reviewer verdict. */\n writeReviewFixes(opts: WriteReviewFixesOptions): Promise<void> {\n return this.writeReviewFixesCommand.run(opts);\n }\n\n /**\n * `wp-await-checks --pr <n>`: BLOCK until that PR's checks stop running, then print where they\n * landed. Read-only against GitHub, so it too is allowed during a resolve.\n */\n awaitChecks(opts: AwaitChecksOptions): Promise<void> {\n return this.awaitChecksCommand.run(opts);\n }\n\n /** `wp-start-update`: 3-point squash-update from main (no PR). */\n startUpdate(): Promise<void> {\n this.assertNoResolveInProgress('wp-start-update');\n return this.startUpdateCommand.run();\n }\n\n /** `wp-finish-update`: validate + finalize a resolved 3-point merge (no PR). */\n finishUpdate(): Promise<void> {\n this.assertNoResolveInProgress('wp-finish-update');\n return this.finishUpdateCommand.run();\n }\n\n /** `wp-start-upsert-pr`: update from main (3-point merge), hand off summary.json. No build gate, no push. */\n startUpsertPr(): Promise<void> {\n this.assertNoResolveInProgress('wp-start-upsert-pr');\n return this.startUpsertPrCommand.run();\n }\n\n /** `wp-finish-upsert-pr`: finalize merge, authoritative build gate, dashboard, create/update PR. */\n finishUpsertPr(): Promise<void> {\n this.assertNoResolveInProgress('wp-finish-upsert-pr');\n return this.finishUpsertPrCommand.run();\n }\n\n /** `wp-human-post-pr`: human-attested post with optional local build and no automated review. */\n humanPostPr(): Promise<void> {\n this.assertNoResolveInProgress('wp-human-post-pr');\n return this.humanPostPrCommand.run();\n }\n\n /**\n * `wp-upsert-hotfix-pr`: the one command for a `/hotfix/` branch — `hotfix-ci` gate, no merge from\n * main, one fast-forward push, upsert the bannered PR, never auto-merge (issue #1057).\n */\n upsertHotfixPr(): Promise<void> {\n this.assertNoResolveInProgress('wp-upsert-hotfix-pr');\n return this.upsertHotfixPrCommand.run();\n }\n\n /**\n * `wp-cleanup`: reap what is provably merged AND every zero-commit husk, then report the rest with\n * the exact flags that take it. `options` carries what argv said — see CleanupOptions.\n */\n cleanup(options: CleanupOptions): Promise<void> {\n this.assertNoResolveInProgress('wp-cleanup');\n return this.cleanupCommand.run(options);\n }\n\n /**\n * `wp-sync-main`: go to main, fast-forward it, reap dead worktrees and branches, and sweep\n * the orphan directories a project move leaves behind. Replaces `git checkout main && git pull\n * origin main` outright — see SyncMainCommand for why the old pair must stop being accepted\n * rather than surviving beside this.\n */\n syncMain(): Promise<void> {\n this.assertNoResolveInProgress('wp-sync-main');\n return this.syncMainCommand.run();\n }\n\n /**\n * `wp-land-pr`: squash-merge a PR into main with the compact commit body — this branch's by default,\n * or the one `--pr <n>` names, which is how a coordinator finishes a gone agent's work.\n */\n landPr(request: LandPrRequest): Promise<void> {\n this.assertNoResolveInProgress('wp-land-pr');\n return this.landPrCommand.run(request);\n }\n\n /**\n * `wp-review-upsert-pr`: STAGE ② — validate the 3-point merge, run the build gate, extract this\n * branch's diff, and brief the reviewer subagents. Unlike the report-only command it replaces, this CAN\n * fail — before any reviewer is spawned, so a broken branch costs no reviewer tokens.\n */\n reviewUpsertPr(): Promise<void> {\n this.assertNoResolveInProgress('wp-review-upsert-pr');\n return this.reviewUpsertPrCommand.run();\n }\n\n /** `wp-check-pr`: READ-ONLY CI check — verify the PR body carries a valid HMAC gate token for its head sha. */\n checkPr(): Promise<void> {\n return this.checkPrCommand.run();\n }\n}\n"]}
@@ -19,6 +19,7 @@ export declare class PrGateCliApp {
19
19
  private parse;
20
20
  private noArgs;
21
21
  private buildUsage;
22
+ private buildDevUsage;
22
23
  private finishUpsertUsage;
23
24
  private humanPostUsage;
24
25
  private hotfixUsage;
@@ -119,6 +119,10 @@ let PrGateCliApp = class PrGateCliApp {
119
119
  await this.app.build(new build_command_1.BuildOptions(args.has(FORCE)));
120
120
  return true;
121
121
  }
122
+ if (binName === 'wp-build-dev') {
123
+ await this.noArgs(invocation, this.buildDevUsage(), () => this.app.buildDev());
124
+ return true;
125
+ }
122
126
  if (binName === 'wp-cleanup') {
123
127
  const args = this.parse(invocation, this.cleanupUsage.declare());
124
128
  await this.app.cleanup(new cleanup_options_1.CleanupOptions(new cleanup_options_1.DeleteSelection(cleanup_options_1.FLAG_DELETE_BRANCHES, args.has(cleanup_options_1.FLAG_DELETE_BRANCHES), args.value(cleanup_options_1.FLAG_DELETE_BRANCHES)), new cleanup_options_1.DeleteSelection(cleanup_options_1.FLAG_DELETE_WORKTREES, args.has(cleanup_options_1.FLAG_DELETE_WORKTREES), args.value(cleanup_options_1.FLAG_DELETE_WORKTREES)), args.has(cleanup_options_1.FLAG_REPORT), args.has(cleanup_options_1.FLAG_INTERACTIVE), args.has(cleanup_options_1.FLAG_IGNORE_STALE_LOCKS)));
@@ -184,6 +188,9 @@ let PrGateCliApp = class PrGateCliApp {
184
188
  new rules_config_1.CliFlag(FORCE, 'Build even though this machine is already at its concurrent-build limit.'),
185
189
  ]);
186
190
  }
191
+ buildDevUsage() {
192
+ return new rules_config_1.CliUsage('wp-build-dev', 'Merge origin/dev into a throwaway branch and run commands.push-dev.buildCommand on it — wp-push-dev`s pre-publish check, without publishing.');
193
+ }
187
194
  finishUpsertUsage() {
188
195
  return new rules_config_1.CliUsage('wp-finish-upsert-pr', 'Finalize the merge, run the authoritative build gate, render the dashboard, and create/update the PR.');
189
196
  }
@@ -218,7 +225,7 @@ let PrGateCliApp = class PrGateCliApp {
218
225
  return new rules_config_1.CliUsage('wp-land-pr', 'Squash-merge a PR into main with its description as the commit body.', [new rules_config_1.CliFlag(PR, 'The PR number to land.', true)]);
219
226
  }
220
227
  pushDevUsage() {
221
- return new rules_config_1.CliUsage('wp-push-dev', 'Publish a disposable copy of this branch for shared dev.', [
228
+ return new rules_config_1.CliUsage('wp-push-dev', 'Check this branch against origin/dev (throwaway merge + commands.push-dev.buildCommand), then publish a disposable copy of it for shared dev.', [
222
229
  new rules_config_1.CliFlag(LIST, 'List published dev copies.'),
223
230
  new rules_config_1.CliFlag(REMOVE, "Delete this branch's dev copy, then push the <removeNamespace>/<branch> marker"
224
231
  + ' (default dev-remove) that triggers the dev rebuild.'),
@@ -228,7 +235,7 @@ let PrGateCliApp = class PrGateCliApp {
228
235
  ]);
229
236
  }
230
237
  finishPushDevUsage() {
231
- return new rules_config_1.CliUsage('wp-finish-push-dev', 'Commit a resolved dev composition and publish it.', [new rules_config_1.CliFlag(ABORT, 'Throw the resolve away without publishing.')]);
238
+ return new rules_config_1.CliUsage('wp-finish-push-dev', 'Commit a resolved dev merge, run the dev build when publishing, and publish the copy.', [new rules_config_1.CliFlag(ABORT, 'Throw the resolve away without publishing.')]);
232
239
  }
233
240
  awaitChecksUsage() {
234
241
  return new rules_config_1.CliUsage('wp-await-checks', 'Block until checks on one PR stop running.', [
@@ -1 +1 @@
1
- {"version":3,"file":"pr-gate-cli-app.js","sourceRoot":"","sources":["../../../../../../packages/tooling/pr-gate/src/scripts/pr-gate-cli-app.ts"],"names":[],"mappings":";;;;AAAA,mDAA6B;AAE7B,0DAAqI;AACrI,iEAA6D;AAC7D,yCAA2D;AAE3D,0EAAkE;AAClE,4DAAwD;AACxD,gEASoC;AACpC,gFAA0E;AAC1E,gEAA2D;AAC3D,kEAA6D;AAC7D,0EAIyC;AACzC,sFAG+C;AAC/C,+CAA0C;AAG1C,MAAM,KAAK,GAAG,SAAS,CAAC;AACxB,MAAM,KAAK,GAAG,SAAS,CAAC;AACxB,MAAM,SAAS,GAAG,aAAa,CAAC;AAChC,MAAM,IAAI,GAAG,QAAQ,CAAC;AACtB,MAAM,KAAK,GAAG,SAAS,CAAC;AACxB,MAAM,IAAI,GAAG,QAAQ,CAAC;AACtB,MAAM,EAAE,GAAG,MAAM,CAAC;AAClB,MAAM,iBAAiB,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lag, CliUsage, RuleFailError, renderRuleFailForHuman } from '@webpieces/rules-config';\nimport { toError } from '@webpieces/tooling-common/to-error';\nimport { bindingScopeValues, injectable } from 'inversify';\n\nimport { AwaitChecksArgs } from './commands/await-checks-command';\nimport { BuildOptions } from './commands/build-command';\nimport {\n CleanupOptions,\n CleanupUsage,\n DeleteSelection,\n FLAG_DELETE_BRANCHES,\n FLAG_DELETE_WORKTREES,\n FLAG_IGNORE_STALE_LOCKS,\n FLAG_INTERACTIVE,\n FLAG_REPORT,\n} from './commands/cleanup-options';\nimport { FinishPushDevOptions } from './commands/finish-push-dev-command';\nimport { LandPrRequest } from './commands/land-pr-command';\nimport { PushDevOptions } from './commands/push-dev-command';\nimport {\n ReviewBudgetCheckOptions,\n WriteReviewInput,\n WriteReviewOptions,\n} from './commands/write-review-command';\nimport {\n WriteReviewFixesInput,\n WriteReviewFixesOptions,\n} from './commands/write-review-fixes-command';\nimport { PrGateApp } from './pr-gate-app';\nimport { PrGateCliInvocation } from './pr-gate-cli-invocation';\n\nconst ABORT = '--abort';\nconst CHECK = '--check';\nconst CHECKLIST = '--checklist';\nconst FILE = '--file';\nconst FORCE = '--force';\nconst LIST = '--list';\nconst PR = '--pr';\nconst REBASE_RESOLUTION = '--rebase-resolution';\nconst REMOVE = '--remove';\nconst RESOLVE = '--resolve';\n\n/** Stable application boundary for every published `wp-*` command. */\n@injectable(bindingScopeValues.Singleton)\nexport class PrGateCliApp {\n constructor(\n private readonly app: PrGateApp,\n private readonly cleanupUsage: CleanupUsage,\n private readonly writeReviewInput: WriteReviewInput,\n private readonly writeReviewFixesInput: WriteReviewFixesInput,\n ) {}\n\n async run(invocation: PrGateCliInvocation): Promise<void> {\n // eslint-disable-next-line @webpieces/no-unmanaged-exceptions\n try {\n await this.dispatch(path.basename(invocation.binName), invocation);\n } catch (err: unknown) {\n const error = toError(err);\n if (err instanceof CliExitError) {\n if (err.message !== '') {\n (err.exitCode === 0 ? invocation.stdout : invocation.stderr).write(\n err.message + '\\n',\n );\n }\n invocation.processExit.exit(err.exitCode);\n return;\n }\n const message =\n err instanceof RuleFailError ? renderRuleFailForHuman(err) : error.message;\n invocation.stderr.write(message + '\\n');\n invocation.processExit.exit(1);\n }\n }\n\n private async dispatch(binName: string, invocation: PrGateCliInvocation): Promise<void> {\n if (await this.dispatchUpdateCommand(binName, invocation)) return;\n if (await this.dispatchPrCommand(binName, invocation)) return;\n if (await this.dispatchRepoCommand(binName, invocation)) return;\n if (await this.dispatchReviewCommand(binName, invocation)) return;\n throw new CliExitError(2, `Unknown PR-gate command: ${binName}`);\n }\n\n private async dispatchUpdateCommand(\n binName: string,\n invocation: PrGateCliInvocation,\n ): Promise<boolean> {\n if (binName === 'wp-finish-upsert-pr') {\n await this.noArgs(\n invocation,\n this.finishUpsertUsage(),\n (): Promise<void> => this.app.finishUpsertPr(),\n );\n return true;\n }\n if (binName === 'wp-start-upsert-pr') {\n await this.noArgs(\n invocation,\n this.startUpsertUsage(),\n (): Promise<void> => this.app.startUpsertPr(),\n );\n return true;\n }\n if (binName === 'wp-start-update') {\n await this.noArgs(\n invocation,\n this.startUpdateUsage(),\n (): Promise<void> => this.app.startUpdate(),\n );\n return true;\n }\n if (binName === 'wp-finish-update') {\n await this.noArgs(\n invocation,\n this.finishUpdateUsage(),\n (): Promise<void> => this.app.finishUpdate(),\n );\n return true;\n }\n if (binName === 'wp-sync-main') {\n await this.noArgs(\n invocation,\n this.syncMainUsage(),\n (): Promise<void> => this.app.syncMain(),\n );\n return true;\n }\n return false;\n }\n\n private async dispatchPrCommand(\n binName: string,\n invocation: PrGateCliInvocation,\n ): Promise<boolean> {\n if (binName === 'wp-human-post-pr') {\n await this.noArgs(\n invocation,\n this.humanPostUsage(),\n (): Promise<void> => this.app.humanPostPr(),\n );\n return true;\n }\n if (binName === 'wp-upsert-hotfix-pr') {\n await this.noArgs(\n invocation,\n this.hotfixUsage(),\n (): Promise<void> => this.app.upsertHotfixPr(),\n );\n return true;\n }\n if (binName === 'wp-check-pr') {\n await this.noArgs(\n invocation,\n this.checkPrUsage(),\n (): Promise<void> => this.app.checkPr(),\n );\n return true;\n }\n if (binName === 'wp-review-upsert-pr') {\n await this.noArgs(\n invocation,\n this.reviewUpsertUsage(),\n (): Promise<void> => this.app.reviewUpsertPr(),\n );\n return true;\n }\n if (binName === 'wp-await-reviews') {\n await this.noArgs(\n invocation,\n this.awaitReviewsUsage(),\n (): Promise<void> => this.app.awaitReviews(),\n );\n return true;\n }\n return false;\n }\n\n private async dispatchRepoCommand(\n binName: string,\n invocation: PrGateCliInvocation,\n ): Promise<boolean> {\n if (binName === 'wp-build') {\n const args = this.parse(invocation, this.buildUsage());\n await this.app.build(new BuildOptions(args.has(FORCE)));\n return true;\n }\n if (binName === 'wp-cleanup') {\n const args = this.parse(invocation, this.cleanupUsage.declare());\n await this.app.cleanup(\n new CleanupOptions(\n new DeleteSelection(\n FLAG_DELETE_BRANCHES,\n args.has(FLAG_DELETE_BRANCHES),\n args.value(FLAG_DELETE_BRANCHES),\n ),\n new DeleteSelection(\n FLAG_DELETE_WORKTREES,\n args.has(FLAG_DELETE_WORKTREES),\n args.value(FLAG_DELETE_WORKTREES),\n ),\n args.has(FLAG_REPORT),\n args.has(FLAG_INTERACTIVE),\n args.has(FLAG_IGNORE_STALE_LOCKS),\n ),\n );\n return true;\n }\n if (binName === 'wp-land-pr') {\n const args = this.parse(invocation, this.landUsage());\n await this.app.landPr(new LandPrRequest(args.has(PR), args.value(PR)));\n return true;\n }\n if (binName === 'wp-push-dev') {\n const args = this.parse(invocation, this.pushDevUsage());\n const opts = new PushDevOptions();\n opts.list = args.has(LIST);\n opts.remove = args.has(REMOVE);\n opts.force = args.has(FORCE);\n opts.rebaseResolution = args.has(REBASE_RESOLUTION);\n opts.resolve = args.has(RESOLVE);\n opts.resolveTarget = args.value(RESOLVE);\n await this.app.pushDev(opts);\n return true;\n }\n if (binName === 'wp-finish-push-dev') {\n const args = this.parse(invocation, this.finishPushDevUsage());\n await this.app.finishPushDev(new FinishPushDevOptions(args.has(ABORT)));\n return true;\n }\n if (binName === 'wp-await-checks') {\n const args = this.parse(invocation, this.awaitChecksUsage());\n await this.app.awaitChecks(new AwaitChecksArgs().parse(args.value(PR)));\n return true;\n }\n return false;\n }\n\n private async dispatchReviewCommand(\n binName: string,\n invocation: PrGateCliInvocation,\n ): Promise<boolean> {\n if (binName === 'wp-write-review') {\n const args = this.parse(invocation, this.writeReviewUsage());\n if (args.has(CHECK)) {\n await this.app.checkReviewBudget(\n new ReviewBudgetCheckOptions(args.value(CHECKLIST), invocation.cwd),\n );\n return true;\n }\n const json = this.writeReviewInput.read(args.value(FILE), invocation.stdin);\n await this.app.writeReview(\n new WriteReviewOptions(args.value(CHECKLIST), json, invocation.cwd),\n );\n return true;\n }\n if (binName === 'wp-write-review-fixes') {\n const args = this.parse(invocation, this.writeReviewFixesUsage());\n const json = this.writeReviewFixesInput.read(args.value(FILE), invocation.stdin);\n await this.app.writeReviewFixes(new WriteReviewFixesOptions(json, invocation.cwd));\n return true;\n }\n return false;\n }\n\n private parse(invocation: PrGateCliInvocation, usage: CliUsage): CliArgSet {\n return new CliArgs().parseArgs(invocation.argv, usage);\n }\n\n private async noArgs(\n invocation: PrGateCliInvocation,\n usage: CliUsage,\n action: () => Promise<void>,\n ): Promise<void> {\n this.parse(invocation, usage);\n await action();\n }\n\n private buildUsage(): CliUsage {\n return new CliUsage(\n 'wp-build',\n 'Run this repo`s configured build (commands.pr-gate.buildCommand) — the same command the PR gate runs.',\n [\n new CliFlag(\n FORCE,\n 'Build even though this machine is already at its concurrent-build limit.',\n ),\n ],\n );\n }\n\n private finishUpsertUsage(): CliUsage {\n return new CliUsage(\n 'wp-finish-upsert-pr',\n 'Finalize the merge, run the authoritative build gate, render the dashboard, and create/update the PR.',\n );\n }\n private humanPostUsage(): CliUsage {\n return new CliUsage(\n 'wp-human-post-pr',\n 'Interactively attest that a human is posting the current clean, current-main feature branch.',\n );\n }\n private hotfixUsage(): CliUsage {\n return new CliUsage(\n 'wp-upsert-hotfix-pr',\n 'Publish the current /hotfix/ branch through the hotfix gate.',\n );\n }\n private startUpsertUsage(): CliUsage {\n return new CliUsage(\n 'wp-start-upsert-pr',\n 'Update from main and hand off the PR review stage.',\n );\n }\n private startUpdateUsage(): CliUsage {\n return new CliUsage(\n 'wp-start-update',\n '3-point squash-update this feature branch from main (no PR).',\n );\n }\n private finishUpdateUsage(): CliUsage {\n return new CliUsage(\n 'wp-finish-update',\n 'Validate + finalize a resolved 3-point merge (no PR).',\n );\n }\n private syncMainUsage(): CliUsage {\n return new CliUsage(\n 'wp-sync-main',\n 'Go to main, fast-forward it, reap dead worktrees and branches, and sweep orphan directories.',\n );\n }\n private checkPrUsage(): CliUsage {\n return new CliUsage(\n 'wp-check-pr',\n 'CI check: verify this PR was created through the webpieces gated flow (valid gate token).',\n );\n }\n private reviewUpsertUsage(): CliUsage {\n return new CliUsage(\n 'wp-review-upsert-pr',\n 'Validate the merge, build, extract the diff, and brief required reviewers.',\n );\n }\n private awaitReviewsUsage(): CliUsage {\n return new CliUsage('wp-await-reviews', 'Block until every reviewer verdict has landed.');\n }\n\n private landUsage(): CliUsage {\n return new CliUsage(\n 'wp-land-pr',\n 'Squash-merge a PR into main with its description as the commit body.',\n [new CliFlag(PR, 'The PR number to land.', true)],\n );\n }\n\n private pushDevUsage(): CliUsage {\n return new CliUsage(\n 'wp-push-dev',\n 'Publish a disposable copy of this branch for shared dev.',\n [\n new CliFlag(LIST, 'List published dev copies.'),\n new CliFlag(\n REMOVE,\n \"Delete this branch's dev copy, then push the <removeNamespace>/<branch> marker\"\n + ' (default dev-remove) that triggers the dev rebuild.',\n ),\n new CliFlag(\n RESOLVE,\n 'Compose other published copies, optionally one named branch.',\n true,\n ),\n new CliFlag(REBASE_RESOLUTION, 'Replay an existing resolution onto new commits.'),\n new CliFlag(FORCE, 'Discard the published resolution and overwrite it.'),\n ],\n );\n }\n\n private finishPushDevUsage(): CliUsage {\n return new CliUsage(\n 'wp-finish-push-dev',\n 'Commit a resolved dev composition and publish it.',\n [new CliFlag(ABORT, 'Throw the resolve away without publishing.')],\n );\n }\n\n private awaitChecksUsage(): CliUsage {\n return new CliUsage('wp-await-checks', 'Block until checks on one PR stop running.', [\n new CliFlag(PR, 'REQUIRED. The PR number to wait on.', true),\n ]);\n }\n\n private writeReviewUsage(): CliUsage {\n return new CliUsage('wp-write-review', 'Submit one reviewer verdict for one checklist.', [\n new CliFlag(CHECKLIST, 'REQUIRED. The checklist id.', true),\n new CliFlag(FILE, 'The verdict JSON file. Omit to read stdin.', true),\n new CliFlag(CHECK, 'Only check whether this checklist may still be reviewed.'),\n ]);\n }\n\n private writeReviewFixesUsage(): CliUsage {\n return new CliUsage(\n 'wp-write-review-fixes',\n 'Record the coordinator response to red findings.',\n [new CliFlag(FILE, 'JSON file. Omit to read stdin.', true)],\n );\n }\n}\n"]}
1
+ {"version":3,"file":"pr-gate-cli-app.js","sourceRoot":"","sources":["../../../../../../packages/tooling/pr-gate/src/scripts/pr-gate-cli-app.ts"],"names":[],"mappings":";;;;AAAA,mDAA6B;AAE7B,0DAAqI;AACrI,iEAA6D;AAC7D,yCAA2D;AAE3D,0EAAkE;AAClE,4DAAwD;AACxD,gEASoC;AACpC,gFAA0E;AAC1E,gEAA2D;AAC3D,kEAA6D;AAC7D,0EAIyC;AACzC,sFAG+C;AAC/C,+CAA0C;AAG1C,MAAM,KAAK,GAAG,SAAS,CAAC;AACxB,MAAM,KAAK,GAAG,SAAS,CAAC;AACxB,MAAM,SAAS,GAAG,aAAa,CAAC;AAChC,MAAM,IAAI,GAAG,QAAQ,CAAC;AACtB,MAAM,KAAK,GAAG,SAAS,CAAC;AACxB,MAAM,IAAI,GAAG,QAAQ,CAAC;AACtB,MAAM,EAAE,GAAG,MAAM,CAAC;AAClB,MAAM,iBAAiB,GAAG,qBAAqB,CAAC;AAChD,MAAM,MAAM,GAAG,UAAU,CAAC;AAC1B,MAAM,OAAO,GAAG,WAAW,CAAC;AAE5B,sEAA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XY,oCAAY;uBAAZ,YAAY;IADxB,IAAA,sBAAU,EAAC,8BAAkB,CAAC,SAAS,CAAC;6CAGX,uBAAS;QACA,8BAAY;QACR,uCAAgB;QACX,kDAAqB;GALxD,YAAY,CAqXxB","sourcesContent":["import * as path from 'path';\n\nimport { CliArgs, CliArgSet, CliExitError, CliFlag, CliUsage, RuleFailError, renderRuleFailForHuman } from '@webpieces/rules-config';\nimport { toError } from '@webpieces/tooling-common/to-error';\nimport { bindingScopeValues, injectable } from 'inversify';\n\nimport { AwaitChecksArgs } from './commands/await-checks-command';\nimport { BuildOptions } from './commands/build-command';\nimport {\n CleanupOptions,\n CleanupUsage,\n DeleteSelection,\n FLAG_DELETE_BRANCHES,\n FLAG_DELETE_WORKTREES,\n FLAG_IGNORE_STALE_LOCKS,\n FLAG_INTERACTIVE,\n FLAG_REPORT,\n} from './commands/cleanup-options';\nimport { FinishPushDevOptions } from './commands/finish-push-dev-command';\nimport { LandPrRequest } from './commands/land-pr-command';\nimport { PushDevOptions } from './commands/push-dev-command';\nimport {\n ReviewBudgetCheckOptions,\n WriteReviewInput,\n WriteReviewOptions,\n} from './commands/write-review-command';\nimport {\n WriteReviewFixesInput,\n WriteReviewFixesOptions,\n} from './commands/write-review-fixes-command';\nimport { PrGateApp } from './pr-gate-app';\nimport { PrGateCliInvocation } from './pr-gate-cli-invocation';\n\nconst ABORT = '--abort';\nconst CHECK = '--check';\nconst CHECKLIST = '--checklist';\nconst FILE = '--file';\nconst FORCE = '--force';\nconst LIST = '--list';\nconst PR = '--pr';\nconst REBASE_RESOLUTION = '--rebase-resolution';\nconst REMOVE = '--remove';\nconst RESOLVE = '--resolve';\n\n/** Stable application boundary for every published `wp-*` command. */\n@injectable(bindingScopeValues.Singleton)\nexport class PrGateCliApp {\n constructor(\n private readonly app: PrGateApp,\n private readonly cleanupUsage: CleanupUsage,\n private readonly writeReviewInput: WriteReviewInput,\n private readonly writeReviewFixesInput: WriteReviewFixesInput,\n ) {}\n\n async run(invocation: PrGateCliInvocation): Promise<void> {\n // eslint-disable-next-line @webpieces/no-unmanaged-exceptions\n try {\n await this.dispatch(path.basename(invocation.binName), invocation);\n } catch (err: unknown) {\n const error = toError(err);\n if (err instanceof CliExitError) {\n if (err.message !== '') {\n (err.exitCode === 0 ? invocation.stdout : invocation.stderr).write(\n err.message + '\\n',\n );\n }\n invocation.processExit.exit(err.exitCode);\n return;\n }\n const message =\n err instanceof RuleFailError ? renderRuleFailForHuman(err) : error.message;\n invocation.stderr.write(message + '\\n');\n invocation.processExit.exit(1);\n }\n }\n\n private async dispatch(binName: string, invocation: PrGateCliInvocation): Promise<void> {\n if (await this.dispatchUpdateCommand(binName, invocation)) return;\n if (await this.dispatchPrCommand(binName, invocation)) return;\n if (await this.dispatchRepoCommand(binName, invocation)) return;\n if (await this.dispatchReviewCommand(binName, invocation)) return;\n throw new CliExitError(2, `Unknown PR-gate command: ${binName}`);\n }\n\n private async dispatchUpdateCommand(\n binName: string,\n invocation: PrGateCliInvocation,\n ): Promise<boolean> {\n if (binName === 'wp-finish-upsert-pr') {\n await this.noArgs(\n invocation,\n this.finishUpsertUsage(),\n (): Promise<void> => this.app.finishUpsertPr(),\n );\n return true;\n }\n if (binName === 'wp-start-upsert-pr') {\n await this.noArgs(\n invocation,\n this.startUpsertUsage(),\n (): Promise<void> => this.app.startUpsertPr(),\n );\n return true;\n }\n if (binName === 'wp-start-update') {\n await this.noArgs(\n invocation,\n this.startUpdateUsage(),\n (): Promise<void> => this.app.startUpdate(),\n );\n return true;\n }\n if (binName === 'wp-finish-update') {\n await this.noArgs(\n invocation,\n this.finishUpdateUsage(),\n (): Promise<void> => this.app.finishUpdate(),\n );\n return true;\n }\n if (binName === 'wp-sync-main') {\n await this.noArgs(\n invocation,\n this.syncMainUsage(),\n (): Promise<void> => this.app.syncMain(),\n );\n return true;\n }\n return false;\n }\n\n private async dispatchPrCommand(\n binName: string,\n invocation: PrGateCliInvocation,\n ): Promise<boolean> {\n if (binName === 'wp-human-post-pr') {\n await this.noArgs(\n invocation,\n this.humanPostUsage(),\n (): Promise<void> => this.app.humanPostPr(),\n );\n return true;\n }\n if (binName === 'wp-upsert-hotfix-pr') {\n await this.noArgs(\n invocation,\n this.hotfixUsage(),\n (): Promise<void> => this.app.upsertHotfixPr(),\n );\n return true;\n }\n if (binName === 'wp-check-pr') {\n await this.noArgs(\n invocation,\n this.checkPrUsage(),\n (): Promise<void> => this.app.checkPr(),\n );\n return true;\n }\n if (binName === 'wp-review-upsert-pr') {\n await this.noArgs(\n invocation,\n this.reviewUpsertUsage(),\n (): Promise<void> => this.app.reviewUpsertPr(),\n );\n return true;\n }\n if (binName === 'wp-await-reviews') {\n await this.noArgs(\n invocation,\n this.awaitReviewsUsage(),\n (): Promise<void> => this.app.awaitReviews(),\n );\n return true;\n }\n return false;\n }\n\n private async dispatchRepoCommand(\n binName: string,\n invocation: PrGateCliInvocation,\n ): Promise<boolean> {\n if (binName === 'wp-build') {\n const args = this.parse(invocation, this.buildUsage());\n await this.app.build(new BuildOptions(args.has(FORCE)));\n return true;\n }\n if (binName === 'wp-build-dev') {\n await this.noArgs(invocation, this.buildDevUsage(), (): Promise<void> => this.app.buildDev());\n return true;\n }\n if (binName === 'wp-cleanup') {\n const args = this.parse(invocation, this.cleanupUsage.declare());\n await this.app.cleanup(\n new CleanupOptions(\n new DeleteSelection(\n FLAG_DELETE_BRANCHES,\n args.has(FLAG_DELETE_BRANCHES),\n args.value(FLAG_DELETE_BRANCHES),\n ),\n new DeleteSelection(\n FLAG_DELETE_WORKTREES,\n args.has(FLAG_DELETE_WORKTREES),\n args.value(FLAG_DELETE_WORKTREES),\n ),\n args.has(FLAG_REPORT),\n args.has(FLAG_INTERACTIVE),\n args.has(FLAG_IGNORE_STALE_LOCKS),\n ),\n );\n return true;\n }\n if (binName === 'wp-land-pr') {\n const args = this.parse(invocation, this.landUsage());\n await this.app.landPr(new LandPrRequest(args.has(PR), args.value(PR)));\n return true;\n }\n if (binName === 'wp-push-dev') {\n const args = this.parse(invocation, this.pushDevUsage());\n const opts = new PushDevOptions();\n opts.list = args.has(LIST);\n opts.remove = args.has(REMOVE);\n opts.force = args.has(FORCE);\n opts.rebaseResolution = args.has(REBASE_RESOLUTION);\n opts.resolve = args.has(RESOLVE);\n opts.resolveTarget = args.value(RESOLVE);\n await this.app.pushDev(opts);\n return true;\n }\n if (binName === 'wp-finish-push-dev') {\n const args = this.parse(invocation, this.finishPushDevUsage());\n await this.app.finishPushDev(new FinishPushDevOptions(args.has(ABORT)));\n return true;\n }\n if (binName === 'wp-await-checks') {\n const args = this.parse(invocation, this.awaitChecksUsage());\n await this.app.awaitChecks(new AwaitChecksArgs().parse(args.value(PR)));\n return true;\n }\n return false;\n }\n\n private async dispatchReviewCommand(\n binName: string,\n invocation: PrGateCliInvocation,\n ): Promise<boolean> {\n if (binName === 'wp-write-review') {\n const args = this.parse(invocation, this.writeReviewUsage());\n if (args.has(CHECK)) {\n await this.app.checkReviewBudget(\n new ReviewBudgetCheckOptions(args.value(CHECKLIST), invocation.cwd),\n );\n return true;\n }\n const json = this.writeReviewInput.read(args.value(FILE), invocation.stdin);\n await this.app.writeReview(\n new WriteReviewOptions(args.value(CHECKLIST), json, invocation.cwd),\n );\n return true;\n }\n if (binName === 'wp-write-review-fixes') {\n const args = this.parse(invocation, this.writeReviewFixesUsage());\n const json = this.writeReviewFixesInput.read(args.value(FILE), invocation.stdin);\n await this.app.writeReviewFixes(new WriteReviewFixesOptions(json, invocation.cwd));\n return true;\n }\n return false;\n }\n\n private parse(invocation: PrGateCliInvocation, usage: CliUsage): CliArgSet {\n return new CliArgs().parseArgs(invocation.argv, usage);\n }\n\n private async noArgs(\n invocation: PrGateCliInvocation,\n usage: CliUsage,\n action: () => Promise<void>,\n ): Promise<void> {\n this.parse(invocation, usage);\n await action();\n }\n\n private buildUsage(): CliUsage {\n return new CliUsage(\n 'wp-build',\n 'Run this repo`s configured build (commands.pr-gate.buildCommand) — the same command the PR gate runs.',\n [\n new CliFlag(\n FORCE,\n 'Build even though this machine is already at its concurrent-build limit.',\n ),\n ],\n );\n }\n\n private buildDevUsage(): CliUsage {\n return new CliUsage(\n 'wp-build-dev',\n 'Merge origin/dev into a throwaway branch and run commands.push-dev.buildCommand on it — wp-push-dev`s pre-publish check, without publishing.',\n );\n }\n\n private finishUpsertUsage(): CliUsage {\n return new CliUsage(\n 'wp-finish-upsert-pr',\n 'Finalize the merge, run the authoritative build gate, render the dashboard, and create/update the PR.',\n );\n }\n private humanPostUsage(): CliUsage {\n return new CliUsage(\n 'wp-human-post-pr',\n 'Interactively attest that a human is posting the current clean, current-main feature branch.',\n );\n }\n private hotfixUsage(): CliUsage {\n return new CliUsage(\n 'wp-upsert-hotfix-pr',\n 'Publish the current /hotfix/ branch through the hotfix gate.',\n );\n }\n private startUpsertUsage(): CliUsage {\n return new CliUsage(\n 'wp-start-upsert-pr',\n 'Update from main and hand off the PR review stage.',\n );\n }\n private startUpdateUsage(): CliUsage {\n return new CliUsage(\n 'wp-start-update',\n '3-point squash-update this feature branch from main (no PR).',\n );\n }\n private finishUpdateUsage(): CliUsage {\n return new CliUsage(\n 'wp-finish-update',\n 'Validate + finalize a resolved 3-point merge (no PR).',\n );\n }\n private syncMainUsage(): CliUsage {\n return new CliUsage(\n 'wp-sync-main',\n 'Go to main, fast-forward it, reap dead worktrees and branches, and sweep orphan directories.',\n );\n }\n private checkPrUsage(): CliUsage {\n return new CliUsage(\n 'wp-check-pr',\n 'CI check: verify this PR was created through the webpieces gated flow (valid gate token).',\n );\n }\n private reviewUpsertUsage(): CliUsage {\n return new CliUsage(\n 'wp-review-upsert-pr',\n 'Validate the merge, build, extract the diff, and brief required reviewers.',\n );\n }\n private awaitReviewsUsage(): CliUsage {\n return new CliUsage('wp-await-reviews', 'Block until every reviewer verdict has landed.');\n }\n\n private landUsage(): CliUsage {\n return new CliUsage(\n 'wp-land-pr',\n 'Squash-merge a PR into main with its description as the commit body.',\n [new CliFlag(PR, 'The PR number to land.', true)],\n );\n }\n\n private pushDevUsage(): CliUsage {\n return new CliUsage(\n 'wp-push-dev',\n 'Check this branch against origin/dev (throwaway merge + commands.push-dev.buildCommand), then publish a disposable copy of it for shared dev.',\n [\n new CliFlag(LIST, 'List published dev copies.'),\n new CliFlag(\n REMOVE,\n \"Delete this branch's dev copy, then push the <removeNamespace>/<branch> marker\"\n + ' (default dev-remove) that triggers the dev rebuild.',\n ),\n new CliFlag(\n RESOLVE,\n 'Compose other published copies, optionally one named branch.',\n true,\n ),\n new CliFlag(REBASE_RESOLUTION, 'Replay an existing resolution onto new commits.'),\n new CliFlag(FORCE, 'Discard the published resolution and overwrite it.'),\n ],\n );\n }\n\n private finishPushDevUsage(): CliUsage {\n return new CliUsage(\n 'wp-finish-push-dev',\n 'Commit a resolved dev merge, run the dev build when publishing, and publish the copy.',\n [new CliFlag(ABORT, 'Throw the resolve away without publishing.')],\n );\n }\n\n private awaitChecksUsage(): CliUsage {\n return new CliUsage('wp-await-checks', 'Block until checks on one PR stop running.', [\n new CliFlag(PR, 'REQUIRED. The PR number to wait on.', true),\n ]);\n }\n\n private writeReviewUsage(): CliUsage {\n return new CliUsage('wp-write-review', 'Submit one reviewer verdict for one checklist.', [\n new CliFlag(CHECKLIST, 'REQUIRED. The checklist id.', true),\n new CliFlag(FILE, 'The verdict JSON file. Omit to read stdin.', true),\n new CliFlag(CHECK, 'Only check whether this checklist may still be reviewed.'),\n ]);\n }\n\n private writeReviewFixesUsage(): CliUsage {\n return new CliUsage(\n 'wp-write-review-fixes',\n 'Record the coordinator response to red findings.',\n [new CliFlag(FILE, 'JSON file. Omit to read stdin.', true)],\n );\n }\n}\n"]}
@@ -44,6 +44,13 @@ export declare class BuildAffected {
44
44
  runBuildGate(repoRoot: string, opts: BuildGateOptions): Promise<void>;
45
45
  /** The human escape hatch uses the same gate but follows build.log on the terminal while it runs. */
46
46
  runBuildGateStreaming(repoRoot: string, opts: BuildGateOptions): Promise<void>;
47
+ /**
48
+ * The same gate — log file, heartbeat, ledger rows, failure rendering — for a command the CALLER
49
+ * resolved. Used only by the dev build (#1397), whose command is `commands.push-dev.buildCommand` and
50
+ * has no default (DevBuild owns that read and its refusal). Everything after the command is shared,
51
+ * so a dev build fails exactly the way `wp-build` does.
52
+ */
53
+ runBuildGateWith(repoRoot: string, buildCommand: string, opts: BuildGateOptions): Promise<void>;
47
54
  private run;
48
55
  /**
49
56
  * The failure text: this gate's own headline, then the pointer at the log the build already wrote.
@@ -73,14 +73,22 @@ let BuildAffected = class BuildAffected {
73
73
  * because a log file was busy.
74
74
  */
75
75
  async runBuildGate(repoRoot, opts) {
76
- return this.run(repoRoot, opts, false);
76
+ return this.run(repoRoot, this.resolveBuildCommand(repoRoot), opts, false);
77
77
  }
78
78
  /** The human escape hatch uses the same gate but follows build.log on the terminal while it runs. */
79
79
  async runBuildGateStreaming(repoRoot, opts) {
80
- return this.run(repoRoot, opts, true);
80
+ return this.run(repoRoot, this.resolveBuildCommand(repoRoot), opts, true);
81
81
  }
82
- async run(repoRoot, opts, stream) {
83
- const buildCommand = this.resolveBuildCommand(repoRoot);
82
+ /**
83
+ * The same gate — log file, heartbeat, ledger rows, failure rendering — for a command the CALLER
84
+ * resolved. Used only by the dev build (#1397), whose command is `commands.push-dev.buildCommand` and
85
+ * has no default (DevBuild owns that read and its refusal). Everything after the command is shared,
86
+ * so a dev build fails exactly the way `wp-build` does.
87
+ */
88
+ async runBuildGateWith(repoRoot, buildCommand, opts) {
89
+ return this.run(repoRoot, buildCommand, opts, false);
90
+ }
91
+ async run(repoRoot, buildCommand, opts, stream) {
84
92
  // TWO lines on the happy path — the command, then the result. The old framing spent a banner and a
85
93
  // paragraph explaining how to reproduce a build that was about to pass anyway; that explanation is
86
94
  // only useful when the build FAILS, so it now lives solely on the failure path below.