@pourkit/cli 0.0.0-next-20260623021955 → 0.0.0-next-20260623054630

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -6477,6 +6477,61 @@ function isAllowedDocumentationTokenReference(value) {
6477
6477
  return /^token\s*:\s*["']?<verdict>/i.test(value);
6478
6478
  }
6479
6479
 
6480
+ // issues/final-commit.ts
6481
+ init_common();
6482
+ async function runFinalCommit(options) {
6483
+ const { worktreePath, worktreeState, baseRef, title, body, logger } = options;
6484
+ if (worktreeState?.finalCommit?.completed) {
6485
+ const storedSha = worktreeState.finalCommit.sha;
6486
+ if (!storedSha) {
6487
+ throw new Error("Final Commit state is incomplete: missing stored sha");
6488
+ }
6489
+ const revParse2 = await execCapture("git", ["rev-parse", "HEAD"], {
6490
+ cwd: worktreePath,
6491
+ logger,
6492
+ label: "git rev-parse HEAD"
6493
+ });
6494
+ const currentSha = revParse2.stdout.trim();
6495
+ if (currentSha !== storedSha) {
6496
+ throw new Error(
6497
+ `Final Commit state is stale: stored sha ${storedSha} does not match current HEAD ${currentSha}`
6498
+ );
6499
+ }
6500
+ return { status: "skipped", sha: storedSha };
6501
+ }
6502
+ await assertCanonicalBaseAncestor2({
6503
+ worktreePath,
6504
+ baseRef,
6505
+ stageName: "final commit",
6506
+ logger
6507
+ });
6508
+ await execCapture("git", ["reset", "--soft", baseRef], {
6509
+ cwd: worktreePath,
6510
+ logger,
6511
+ label: "git reset"
6512
+ });
6513
+ await execCapture("git", ["add", "-A"], {
6514
+ cwd: worktreePath,
6515
+ logger,
6516
+ label: "git add"
6517
+ });
6518
+ await execCapture("git", ["commit", "--no-verify", "-m", title, "-m", body], {
6519
+ cwd: worktreePath,
6520
+ logger,
6521
+ label: "git commit"
6522
+ });
6523
+ const revParse = await execCapture("git", ["rev-parse", "HEAD"], {
6524
+ cwd: worktreePath,
6525
+ logger,
6526
+ label: "git rev-parse HEAD"
6527
+ });
6528
+ const sha = revParse.stdout.trim();
6529
+ updateWorktreeRunState(worktreePath, {
6530
+ finalCommit: { completed: true, sha }
6531
+ });
6532
+ return { status: "completed", sha };
6533
+ }
6534
+
6480
6535
  // issues/issue-worktree-resolution.ts
6481
6536
  init_common();
6482
6537
  import { join as join14 } from "path";
@@ -6895,35 +6950,20 @@ async function completeIssueRun(options) {
6895
6950
  );
6896
6951
  const prTitle = prDescriptionAgentResult.title;
6897
6952
  const prBody = prDescriptionAgentResult.body;
6898
- const stateBeforeFinalCommit = readCurrentWorktreeState();
6899
- const finalCommitFromState = stateBeforeFinalCommit?.finalCommit?.completed;
6900
- if (!finalCommitFromState) {
6901
- await finalizeWorktreeCommit({
6902
- worktreePath: executionResult.worktreePath,
6903
- baseRef: `origin/${effectiveBaseBranch}`,
6904
- title: prTitle,
6905
- body: prBody,
6906
- logger
6907
- });
6908
- if (executionResult.worktreePath) {
6909
- const revParse = await execCapture("git", ["rev-parse", "HEAD"], {
6910
- cwd: executionResult.worktreePath,
6911
- logger,
6912
- label: "git rev-parse HEAD"
6913
- });
6914
- updateWorktreeRunState(executionResult.worktreePath, {
6915
- finalCommit: {
6916
- completed: true,
6917
- sha: revParse.stdout.trim()
6918
- }
6919
- });
6920
- }
6921
- }
6922
6953
  if (!executionResult.worktreePath) {
6923
6954
  throw new Error(
6924
6955
  "Lifecycle invariant: GitHub Issue Publication requires a worktree path"
6925
6956
  );
6926
6957
  }
6958
+ const stateBeforeFinalCommit = readCurrentWorktreeState();
6959
+ await runFinalCommit({
6960
+ worktreePath: executionResult.worktreePath,
6961
+ worktreeState: stateBeforeFinalCommit,
6962
+ baseRef: `origin/${effectiveBaseBranch}`,
6963
+ title: prTitle,
6964
+ body: prBody,
6965
+ logger
6966
+ });
6927
6967
  const publication = await publishGitHubIssue({
6928
6968
  issue,
6929
6969
  branchName,
@@ -7008,30 +7048,6 @@ function extractHumanHandoffSummary(artifactContent) {
7008
7048
  function getRefactorArtifactDir(artifactPath) {
7009
7049
  return artifactPath.replace(/\/reviewers\//, "/refactors/").replace(/\/[^/]+$/, "");
7010
7050
  }
7011
- async function finalizeWorktreeCommit(options) {
7012
- const { worktreePath, baseRef, title, body, logger } = options;
7013
- await assertCanonicalBaseAncestor2({
7014
- worktreePath,
7015
- baseRef,
7016
- stageName: "final commit",
7017
- logger
7018
- });
7019
- await execCapture("git", ["reset", "--soft", baseRef], {
7020
- cwd: worktreePath,
7021
- logger,
7022
- label: "git reset"
7023
- });
7024
- await execCapture("git", ["add", "-A"], {
7025
- cwd: worktreePath,
7026
- logger,
7027
- label: "git add"
7028
- });
7029
- await execCapture("git", ["commit", "--no-verify", "-m", title, "-m", body], {
7030
- cwd: worktreePath,
7031
- logger,
7032
- label: "git commit"
7033
- });
7034
- }
7035
7051
  function makeIssueTransitions2(provider, config) {
7036
7052
  return createIssueTransitions(
7037
7053
  {
@@ -15517,11 +15533,11 @@ function createCliProgram(version) {
15517
15533
  return program;
15518
15534
  }
15519
15535
  async function resolveCliVersion() {
15520
- if (isPackageVersion("0.0.0-next-20260623021955")) {
15521
- return "0.0.0-next-20260623021955";
15536
+ if (isPackageVersion("0.0.0-next-20260623054630")) {
15537
+ return "0.0.0-next-20260623054630";
15522
15538
  }
15523
- if (isReleaseVersion("0.0.0-next-20260623021955")) {
15524
- return "0.0.0-next-20260623021955";
15539
+ if (isReleaseVersion("0.0.0-next-20260623054630")) {
15540
+ return "0.0.0-next-20260623054630";
15525
15541
  }
15526
15542
  try {
15527
15543
  const root = repoRoot();