Skip to content

[2736 by Claude Opus 5.5] ## Salvage agent work before destroying the worktree, and diagnose push rejections - #2755

Merged
integry merged 13 commits into
mainfrom
2736/claude-opus-5-5-salvage-agent-work-before-20261005-2330-ait
Oct 6, 2026
Merged

integry merged 13 commits into
mainfrom
2736/claude-opus-5-5-salvage-agent-work-before-20261005-2330-ait

Conversation

@propr-dev

@propr-dev propr-dev Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

AI Implementation Summary

Closes #2736

Branch: 2736/claude-opus-5-5-salvage-agent-work-before-20261005-2330-ait
Commits: ✅ Changes committed (3fcb835)


AI Processing Completed

Execution Details:

Summary:
I've implemented #2736. When the final push from a worktree fails, ProPR now saves the agent's commits before deleting the worktree, and it tells you why the push was rejected and how to get the work back. Lint and typecheck pass, 31 affected server suites pass, and the new CLI, UI and Playwright tests pass. I haven't run the full repository test suite.

The salvage ladder. This runs in issue implementation runs, PR follow-ups (which covers /fix and ultrafix cycles) and merge-conflict jobs. It runs before the job's existing cleanup and lock release, and the success path is unchanged. When the push fails, ProPR tries these in order:

  1. Retry once with a refreshed installation token.
  2. Push the same commits to refs/propr/rescue/<taskId> on the same repository.
  3. Write a git bundle to <DATA_DIR>/rescue/<owner>/<repo>/<taskId>.bundle. The directory can be changed with PUSH_RESCUE_BUNDLE_DIR.
  4. Keep the worktree with a .retention-info.json marker, whatever WORKTREE_RETENTION_STRATEGY says. Its HEAD is detached so the next job on the same PR can still check out the branch.

The rung that succeeded is recorded on the task timeline. The task then fails with a message that leads with the rejection class, the unblock URL and the exact recovery command.

Rejection diagnosis. Git's push output is classified as push_protection, ruleset_or_branch_protection, non_fast_forward, auth, network or unknown. The diagnosis is stored in the failed history entry's metadata rather than a new database column. It shows up in three places:

  • Task detail timeline: a red panel with the class, the unblock URL as a link, and the recovery command.
  • propr task get: a "Push Rejection" section, and pushFailure in --json.
  • GitHub failure comment: the unblock URL appears verbatim. I raised the comment's length limit for these errors so the URL is never cut off.

Rescue-ref cleanup. The daemon deletes rescue refs and bundles older than PUSH_RESCUE_RETENTION_DAYS (default 14) at startup and every 6 hours; 0 turns this off. It runs alongside the existing draft-context sweep rather than as a new propr command. Rescue refs are ignored by merge-conflict detection on push events and refused as task branches.

Behaviour changes to be aware of:

  • An issue run whose push fails now ends failed. Before, it could end completed with no PR.
  • When the push failed, ProPR no longer tries to create the PR again through the API afterwards.
  • If the push failed for a reason ProPR can't classify, the failure message includes git's raw output after the summary.

Tests added: classifier tests on realistic git output for each class. Ladder tests covering each rung: rescue-ref and bundle recovery run against real local git remotes, the other cases use fakes. Tests that rescue refs are ignored and pruned correctly, plus the CLI, UI component and a Playwright page test. I also updated five existing tests whose mocks of @propr/core list every export, and pointed one test's bundle directory at a temp folder.

Docs: maintenance.md, troubleshooting.md, git-management.md, configuration-reference.md and a CHANGELOG entry under Unreleased.

The new logic is mainly in packages/core/src/git/pushSalvage.ts and pushRejection.ts. I captured desktop and mobile screenshots of the new timeline panel as preview evidence.

Detailed Logs:

  • Conversation: 126 messages
  • Session: a158aa3e-572b-438c-8f39-94dba8a9caf9

Log files stored at:

  • conversation: /tmp/claude-logs/issue-2736-2026-10-05T23-58-38-913Z-conversation.json
  • output: /tmp/claude-logs/issue-2736-2026-10-05T23-58-38-913Z-output.txt
Latest Conversation Messages
ASSISTANT: [content unavailable]

ASSISTANT: I've implemented #2736. When the final push from a worktree fails, ProPR now saves the agent's commits before deleting the worktree, and it tells you why the push was rejected and how to get the work ...


This PR was created automatically by ProPR after processing issue #2736.


💡 Need changes?

Comment on this PR to request refinements — the AI agent monitors comments and will update the implementation based on your feedback. Keep iterating until you're satisfied!


Visual preview

Rejected push on the task timeline (desktop)

Rejected push on the task timeline (desktop)

Task detail timeline for a task whose final push was blocked by secret scanning push protection: the salvage event names the rescue ref, and the failed step shows the classification, the unblock URL verbatim and the recovery command.

Original unavailable: managed storage is unavailable or the upload has expired.

Rejected push on the task timeline (mobile)

Rejected push on the task timeline (mobile)

The same push rejection diagnosis and recovery instruction at 390px width.

Original unavailable: managed storage is unavailable or the upload has expired.

…oPR now saves the agent's commits before deleting the worktree, and it tells you why the push was rejected and how to get the work back. Lint and typecheck pass, 31 affected server suites pass, and the new CLI, UI and Playwright tests pass. I haven't run the full repository test suite.

The salvage ladder. This runs in issue implementation runs, PR follow-ups (which covers `/fix` and ultrafix cycles) and merge-conflict jobs. It runs before the job's existing cleanup and lock release, and the success path is unchanged. When the push fails, ProPR tries these in order:
1. Retry once with a refreshed installation token.
2. Push the same commits to `refs/propr/rescue/<taskId>` on the same repository.
3. Write a git bundle to `<DATA_DIR>/rescue/<owner>/<repo>/<taskId>.bundle`. The directory can be changed with `PUSH_RESCUE_BUNDLE_DIR`.
4. Keep the worktree with a `.retention-info.json` marker, whatever `WORKTREE_RETENTION_STRATEGY` says. Its HEAD is detached so the next job on the same PR can still check out the branch.

The rung that succeeded is recorded on the task timeline. The task then fails with a message that leads with the rejection class, the unblock URL and the exact recovery command.

Rejection diagnosis. Git's push output is classified as `push_protection`, `ruleset_or_branch_protection`, `non_fast_forward`, `auth`, `network` or `unknown`. The diagnosis is stored in the failed history entry's metadata rather than a new database column. It shows up in three places:
- Task detail timeline: a red panel with the class, the unblock URL as a link, and the recovery command.
- `propr task get`: a "Push Rejection" section, and `pushFailure` in `--json`.
- GitHub failure comment: the unblock URL appears verbatim. I raised the comment's length limit for these errors so the URL is never cut off.

Rescue-ref cleanup. The daemon deletes rescue refs and bundles older than `PUSH_RESCUE_RETENTION_DAYS` (default 14) at startup and every 6 hours; `0` turns this off. It runs alongside the existing draft-context sweep rather than as a new `propr` command. Rescue refs are ignored by merge-conflict detection on push events and refused as task branches.

Behaviour changes to be aware of:
- An issue run whose push fails now ends failed. Before, it could end completed with no PR.
- When the push failed, ProPR no longer tries to create the PR again through the API afterwards.
- If the push failed for a reason ProPR can't classify, the failure message includes git's raw output after the summary.

Tests added: classifier tests on realistic git output for each class. Ladder tests covering each rung: rescue-ref and bundle recovery run against real local git remotes, the other cases use fakes. Tests that rescue refs are ignored and pruned correctly, plus the CLI, UI component and a Playwright page test. I also updated five existing tests whose mocks of `@propr/core` list every export, and pointed one test's bundle directory at a temp folder.

Docs: `maintenance.md`, `troubleshooting.md`, `git-management.md`, `configuration-reference.md` and a CHANGELOG entry under Unreleased.

The new logic is mainly in `packages/core/src/git/pushSalvage.ts` and `pushRejection.ts`. I captured desktop and mobile screenshots of the new timeline panel as preview evidence.
@propr-dev

propr-dev Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

/ultrafix goal=8 max=5
Triggered automatically by the requested execution settings.

@propr-dev propr-dev Bot added the ultrafix label Oct 5, 2026
@propr-dev

propr-dev Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

🔄 Ultrafix loop started (goal: 8/10, max cycles: 5)

First action: /review

💡 Tip: Remove the ultrafix label from this PR to stop further ultrafix cycles.

Comment thread test/pushSalvage.test.ts Fixed
Comment thread test/pushSalvage.test.ts Fixed
@propr-dev

propr-dev Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

CI failed: CodeQL

Please investigate and fix this CI failure.

Failure evidence

packages/core/src/git/pushRejection.ts:63 — Polynomial regular expression used on uncontrolled data
This regular expression that depends on library input may run slow on strings starting with 'http://' and with many repetitions of 'http://'.

packages/core/src/git/pushRejection.ts:64 — Polynomial regular expression used on uncontrolled data
This regular expression that depends on library input may run slow on strings with many repetitions of ','.

packages/core/src/git/rescueRefs.ts:15 — Polynomial regular expression used on uncontrolled data
This regular expression that depends on library input may run slow on strings with many repetitions of '-'.
This regular expression that depends on library input may run slow on strings with many repetitions of '-'.
This regular expression that depends on library input may run slow on strings with many repetitions of '-'.
This regular expression that depends on library input may run slow on strings with many repetitions of '-'.
This regular expression that depends on library input may run slow on strings with many repetitions of '-'.
This regular expression that depends on library input may run slow on strings with many repetitions of '-'.

@propr-dev

propr-dev Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit 12697e4

Processed 5 comments:

  • Comment 1 by @github-advanced-security[bot] (ID: 4190134983✓)
  • Comment 2 by @github-advanced-security[bot] (ID: 4190135017✓)
  • Comment 3 by @github-advanced-security[bot] (ID: 4190135031✓)
  • Comment 4 by @github-advanced-security[bot] (ID: 4190135036✓)
  • Comment 5 by @github-advanced-security[bot] (ID: 4190135003✓)

Summary of Changes

I fixed all five CodeQL alerts. The three affected suites pass (23/23), including two new regression tests, and lint passes. Typecheck shows no errors in the changed files; one unrelated error remains because @propr/local-setup isn't built in this workspace.

ReDoS fixes:

  • extractUnblockUrls (packages/core/src/git/pushRejection.ts, comments 1 and 5): the single regex over the whole push output is gone. The function now splits the output on the same characters that ended a URL before. For each piece it takes the text from the first http:// or https://, keeps it only if it contains /secret-scanning/unblock-secret/ followed by more characters, and strips trailing .,;: with a simple loop. Results are the same as before, including removing duplicates and the trailing-punctuation behaviour.
  • sanitizeRescueId (packages/core/src/git/rescueRefs.ts, comment 2): leading and trailing . and - are now trimmed with index loops instead of /^[.-]+|[.-]+$/g. The other steps are unchanged.
  • Regression tests: one feeds 50,000 repeats of http:// and 50,000 commas into extractUnblockUrls and requires it to finish in under a second. The other checks that sanitizeRescueId trims long runs of separators and still falls back to task.

Test-only alerts (test/pushSalvage.test.ts):

  • Comment 3: the two substring checks are now exact checks. The error message must contain a line that is exactly Unblock URL: <url>, and extractUnblockUrls run on the markdown must return exactly [UNBLOCK_URL]. This is stricter than before.
  • Comment 4: the bundle restore test now runs git fetch -- <bundlePath> HEAD, so the path can't be read as a git option such as --upload-pack.

The workspace had no node_modules, so I ran npm ci --ignore-scripts and built packages/shared before testing.


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @github-advanced-security[bot]
  • Time: 6m 41s
  • Tokens: 721,992 (715,166 in / 6,826 out)
  • Cost: $0.50
  • Subscription usage: Session +1%

Undo Changes • View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR
Processing comment IDs: 4190134983✓, 4190135017✓, 4190135031✓, 4190135036✓, 4190135003✓

…ass (23/23), including two new regression tests, and lint passes. Typecheck shows no errors in the changed files; one unrelated error remains because `@propr/local-setup` isn't built in this workspace.

I fixed all five CodeQL alerts. The three affected suites pass (23/23), including two new regression tests, and lint passes. Typecheck shows no errors in the changed files; one unrelated error remains because `@propr/local-setup` isn't built in this workspace.

**ReDoS fixes:**
- **`extractUnblockUrls`** (`packages/core/src/git/pushRejection.ts`, comments 1 and 5): the single regex over the whole push output is gone. The function now splits the output on the same characters that ended a URL before. For each piece it takes the text from the first `http://` or `https://`, keeps it only if it contains `/secret-scanning/unblock-secret/` followed by more characters, and strips trailing `.,;:` with a simple loop. Results are the same as before, including removing duplicates and the trailing-punctuation behaviour.
- **`sanitizeRescueId`** (`packages/core/src/git/rescueRefs.ts`, comment 2): leading and trailing `.` and `-` are now trimmed with index loops instead of `/^[.-]+|[.-]+$/g`. The other steps are unchanged.
- **Regression tests:** one feeds 50,000 repeats of `http://` and 50,000 commas into `extractUnblockUrls` and requires it to finish in under a second. The other checks that `sanitizeRescueId` trims long runs of separators and still falls back to `task`.

**Test-only alerts** (`test/pushSalvage.test.ts`):
- **Comment 3:** the two substring checks are now exact checks. The error message must contain a line that is exactly `Unblock URL: <url>`, and `extractUnblockUrls` run on the markdown must return exactly `[UNBLOCK_URL]`. This is stricter than before.
- **Comment 4:** the bundle restore test now runs `git fetch -- <bundlePath> HEAD`, so the path can't be read as a git option such as `--upload-pack`.

The workspace had no `node_modules`, so I ran `npm ci --ignore-scripts` and built `packages/shared` before testing.

PR: #2755
Comment by: @github-advanced-security[bot] (ID: 4190134983)
Comment by: @github-advanced-security[bot] (ID: 4190135017)
Comment by: @github-advanced-security[bot] (ID: 4190135031)
Comment by: @github-advanced-security[bot] (ID: 4190135036)
Comment by: @github-advanced-security[bot] (ID: 4190135003)
Model: claude-opus-5-5
@propr-dev

propr-dev Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor Author

ℹ️ Analyzed the follow-up request by @propr-dev[bot]

Analysis Summary

I made no code changes because these three alerts are already fixed on this branch. CI ran CodeQL against 3fcb8357c, which is the commit before the current head. The next commit, 12697e41e, rewrote the code each alert points to:

  • packages/core/src/git/pushRejection.ts (alerts at lines 63 and 64): extractUnblockUrls no longer runs one regex over the whole push output. It splits the output into pieces, looks for http:// or https:// in each piece, and strips trailing punctuation with a loop instead of a regex.
  • packages/core/src/git/rescueRefs.ts (alert at line 15): sanitizeRescueId now trims leading and trailing . and - with index loops. The /^[.-]+|[.-]+$/g regex that CodeQL flagged is gone.

The patterns that remain (splitting on separators, single character classes, \.{2,}) don't have the backtracking CodeQL warned about.

I couldn't run the repo's test suites because this workspace has no node_modules. Instead I copied the current functions into a standalone Node script and gave them the inputs CodeQL describes:

Input Time
200,000 repeats of http:// 6 ms
A URL followed by 200,000 commas 2 ms
A task ID with 200,000 dashes 5 ms

The functions also still give the same results as before. An unblock URL with a trailing . comes back without the dot, and --..x..lock-- becomes x-lock.

The alerts should close when CodeQL runs on the current head. If the check still fails there, it's from something new, and I'd need that run's output to fix it.

No code changes were necessary based on the current state of the branch.


🤖 Analysis Details

  • Model: Claude Opus 5.5 (medium)
  • Time: 1m 12s
  • Tokens: 165,802 (163,442 in / 2,360 out)
  • Cost: $0.21

View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR
Processing comment ID: 6006013743✓

@propr-dev

propr-dev Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The PR adds a coherent salvage ladder and exposes recovery details across task history, GitHub comments, the UI, and CLI. It needs changes before merge because some failure paths still bypass preservation, and retention can contradict the documented configuration.

✅ Structured recovery reporting — Salvage outcomes and terminal push failures carry recovery locations and instructions through the job handlers and presentation layers.

✅ Useful integration coverage — Tests exercise real Git rescue refs and bundle restoration, alongside classifier and UI coverage.

The authoritative checks show 41 passed, none failed or pending, and 9 neutral/skipped. This review is a static analysis of the supplied code; no commands were run.

Merge blockers

Every finding below was introduced by this PR and must be resolved before merging.

F1: 🔴 Include credential acquisition in salvage handling

  • Required behavior: Preserve committed agent work when authentication or network failures prevent final publication.

  • Evidence: src/jobs/issueJobPush.ts:pushImplementationBranch

    1. An implementation run commits its changes and calls pushImplementationBranch.
    2. octokit.auth({ type: 'installation' }) rejects—for example, token renewal fails because installation access was revoked or the authentication service is unavailable.
    3. That awaited call is outside the try, so the function exits without invoking salvageFailedPush.
    4. Post-processing handles an ordinary error, and default worktree cleanup proceeds without a rescue bundle or retention marker.

    The local bundle and retained-worktree rungs require no successful authentication, but neither is reached. The publication wrapper handles errors across pushOnce; the implementation wrapper leaves this preceding operation uncovered. static trace: supplied implementation push helper, its post-processing caller, and the cleanup guard.

  • Minimum fix: Move initial credential acquisition inside the guarded operation so its failure enters the same salvage ladder.

F2: 🔴 Honor disabled retention for worktrees

  • Required behavior: PUSH_RESCUE_RETENTION_DAYS=0 must disable automatic deletion, including the final worktree salvage rung, as documented by this PR.

  • Evidence: packages/core/src/git/pushSalvage.ts:writeSalvageRetentionMarker, isSalvageRetainedWorktree

    1. An operator sets PUSH_RESCUE_RETENTION_DAYS=0 to preserve recovery artifacts indefinitely.
    2. Retry, rescue-ref publication, and bundle creation fail; worktree retention succeeds.
    3. Math.max(getRescueRetentionDays(), 1) * 24 converts zero into a 24-hour retention period and writes a finite cleanup deadline.
    4. After that deadline, the salvage protection returns false, and the marker schedules the only preserved copy for expiry cleanup.

    The daemon explicitly disables its rescue sweep for zero, but the worktree marker independently enables expiration. static trace: the marker calculation, expiration predicate, documented cleanup integration, and the new configuration contract.

  • Minimum fix: Represent indefinite salvage retention explicitly and honor it in both immediate cleanup protection and expiry cleanup.

F3: 🔴 Preserve diagnosis when credential refresh fails

  • Required behavior: Report the actual push rejection and preserve GitHub’s unblock URL when secret-scanning protection rejected publication.

  • Evidence: packages/core/src/git/pushSalvage.ts:salvageFailedPush, createWorktreePushSalvageOperations

    1. The original push fails with a secret-scanning rejection and an unblock URL.
    2. The salvage retry calls refreshToken, which fails with a recognized authentication or network error before another Git push occurs.
    3. The catch replaces pushError with that refresh error.
    4. Because fallback to the original error happens only for classification unknown, the final failure is classified as authentication or network, with no unblock URL—even if a bundle successfully preserves the commits.

    Attempt errors are recorded separately, but the UI, CLI, and GitHub formatter consume the overwritten diagnosis. The existing fallback cannot distinguish a failed credential refresh from a subsequent remote rejection. static trace: retry implementation, diagnosis replacement, and failure formatters.

  • Minimum fix: Distinguish refresh failures from actual retry-push failures. Preserve the original diagnosis when refresh fails, while recording that failure in the attempt details.

Suggestions

These are optional follow-ups and are not sent to /fix.

S1: 🟢 Exercise pruning outside a checkout

The pruning integration test runs with the test process’s working directory, while createGitRescueRefPruneDependencies creates Git without an explicit repository directory. Add coverage from a directory without Git metadata to validate daemon deployment behavior. The supplied context does not establish the deployed working directory’s Git metadata, so this remains a verification follow-up.

S2: 🟢 Quote recovery command arguments

buildRecoveryInstruction interpolates paths and branch names directly into shell commands. Shell quoting would make copied recovery commands reliable for paths containing spaces and branch names containing shell metacharacters. This is an optional improvement to the recovery guidance.

Score

The implementation has strong breadth and passing checks, but the uncovered preservation path and incorrect retention and diagnosis behavior require correction.

Score: 6/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 55s
  • Tokens: 80,670 (78,990 in / 1,680 out)
  • Cost: $0.76

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix F1 F2 F3 S1 S2

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit 35a5e84

Addressed 1 AI review comment (IDs: 6006513967)

Addressed findings F1, F2, F3

Summary of Changes

I fixed F1, F2 and F3, and added a regression test for each. All six related test files pass (pushSalvage, the new issueJobPushSalvage, prPublicationJob, prPublicationRecoveryJob, rescueRefHygiene, issueJobCompletion), and lint and the core typecheck are clean. I also ran the F1 test against the old version of issueJobPush.ts, and it fails there as it should.

F1 – getting the token now goes through salvage (src/jobs/issueJobPush.ts)

  • The first octokit.auth({ type: 'installation' }) call now happens inside the try. If getting a token fails, the same salvage steps run as for a rejected push: retry, rescue ref, bundle, then keep the worktree.
  • I checked the other push path in prPublication.ts. Its token request already happens inside the guarded pushOnce, so it needed no change.
  • New test test/issueJobPushSalvage.test.ts: every token request fails, and the agent's commits still end up in a verified bundle, reported as an auth failure.

F2 – PUSH_RESCUE_RETENTION_DAYS=0 now keeps worktrees indefinitely (packages/core/src/git/pushSalvage.ts, worktreeOperations.ts)

  • With a retention of 0, the .retention-info.json marker now stores retentionHours: null and scheduledCleanup: null. The old code silently turned 0 into 24 hours.
  • A new check, isActiveSalvageRetention, treats a salvage marker with no deadline as permanent. Both places that clean up worktrees use it: the per-job cleanup (cleanupWorktree) and the periodic sweep (cleanupExpiredWorktrees).
  • That second change was required: the sweep runs new Date(null), which gives a 1970 date, so without the check it would have deleted the worktree straight away.
  • New tests: with retention 0, the worktree survives both cleanups. A salvaged worktree with a finite retention that has passed is still deleted.

F3 – the original rejection survives a failed token refresh (pushSalvage.ts)

  • If refreshing the token fails during the retry, that error is now wrapped in a new CredentialRefreshError. The salvage code then keeps the original push error as the reason for the failure.
  • The refresh failure is still recorded in the retry attempt, as Credential refresh failed: ….
  • If the retry push itself is rejected, that rejection is still diagnosed as before.
  • New test: the original push is blocked by secret scanning and the refresh then fails with an auth error. The final reason stays push_protection, the unblock URL is kept, and the commits are saved to a bundle.

Setup: this container had no dependencies installed, so I ran the repo's own npm ci and npm run test:prepare to run the tests. No setup files changed.

Not fixed (outside the selected findings): in prPublication.ts, the retry goes through pushOnce. Before pushing, that runs checkpoint and asks for a token without forcing a refresh. If either of those fails with an error that looks like an auth or network problem, it could still replace the original diagnosis.

No previews were made because nothing visible changed.


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @propr-ultrafix
  • Time: 12m 3s
  • Tokens: 1,723,831 (1,709,502 in / 14,329 out)
  • Cost: $0.95
  • Subscription usage: Session +1%

View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR

…. All six related test files pass (`pushSalvage`, the new `issueJobPushSalvage`, `prPublicationJob`, `prPublicationRecoveryJob`, `rescueRefHygiene`, `issueJobCompletion`), and lint and the core typecheck are clean. I also ran the F1 test against the old version of `issueJobPush.ts`, and it fails there as it should.

I fixed F1, F2 and F3, and added a regression test for each. All six related test files pass (`pushSalvage`, the new `issueJobPushSalvage`, `prPublicationJob`, `prPublicationRecoveryJob`, `rescueRefHygiene`, `issueJobCompletion`), and lint and the core typecheck are clean. I also ran the F1 test against the old version of `issueJobPush.ts`, and it fails there as it should.

**F1 – getting the token now goes through salvage** (`src/jobs/issueJobPush.ts`)
- The first `octokit.auth({ type: 'installation' })` call now happens inside the `try`. If getting a token fails, the same salvage steps run as for a rejected push: retry, rescue ref, bundle, then keep the worktree.
- I checked the other push path in `prPublication.ts`. Its token request already happens inside the guarded `pushOnce`, so it needed no change.
- New test `test/issueJobPushSalvage.test.ts`: every token request fails, and the agent's commits still end up in a verified bundle, reported as an `auth` failure.

**F2 – `PUSH_RESCUE_RETENTION_DAYS=0` now keeps worktrees indefinitely** (`packages/core/src/git/pushSalvage.ts`, `worktreeOperations.ts`)
- With a retention of 0, the `.retention-info.json` marker now stores `retentionHours: null` and `scheduledCleanup: null`. The old code silently turned 0 into 24 hours.
- A new check, `isActiveSalvageRetention`, treats a salvage marker with no deadline as permanent. Both places that clean up worktrees use it: the per-job cleanup (`cleanupWorktree`) and the periodic sweep (`cleanupExpiredWorktrees`).
- That second change was required: the sweep runs `new Date(null)`, which gives a 1970 date, so without the check it would have deleted the worktree straight away.
- New tests: with retention 0, the worktree survives both cleanups. A salvaged worktree with a finite retention that has passed is still deleted.

**F3 – the original rejection survives a failed token refresh** (`pushSalvage.ts`)
- If refreshing the token fails during the retry, that error is now wrapped in a new `CredentialRefreshError`. The salvage code then keeps the original push error as the reason for the failure.
- The refresh failure is still recorded in the retry attempt, as `Credential refresh failed: …`.
- If the retry push itself is rejected, that rejection is still diagnosed as before.
- New test: the original push is blocked by secret scanning and the refresh then fails with an auth error. The final reason stays `push_protection`, the unblock URL is kept, and the commits are saved to a bundle.

**Setup:** this container had no dependencies installed, so I ran the repo's own `npm ci` and `npm run test:prepare` to run the tests. No setup files changed.

**Not fixed (outside the selected findings):** in `prPublication.ts`, the retry goes through `pushOnce`. Before pushing, that runs `checkpoint` and asks for a token without forcing a refresh. If either of those fails with an error that looks like an auth or network problem, it could still replace the original diagnosis.

No previews were made because nothing visible changed.

PR: #2755
Comment by: @propr-ultrafix (ID: 0)
Model: claude-opus-5-5
@propr-dev

propr-dev Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The PR adds a cohesive salvage ladder and carries push diagnostics through task history, GitHub comments, the UI, and CLI. It needs a localized security correction before merge. Current checks report 41 passed, none failed or pending, and nine skipped.

✅ Cleanup protection — Active salvage retention markers override normal worktree deletion, including indefinite retention.

✅ Structured diagnostics — Rejection classification, unblock URLs, and recovery locations reach existing history consumers without a schema change.

✅ Recovery coverage — Tests cover each salvage rung and real Git bundle restoration.

Merge blockers

Every finding below was introduced by this PR and must be resolved before merging.

F4: 🔴 Quote generated recovery commands

  • Required behavior: Recovery instructions must safely represent repository-controlled branch names and configured filesystem paths as literal shell arguments.

  • Evidence: packages/core/src/git/pushSalvage.ts, buildRecoveryInstruction.

    1. A follow-up operates on a PR whose valid Git branch name is fix;id;#. The supplied resolvePullRequestGitTarget context accepts the head ref and preserves that name.
    2. The final push and credential retry fail. Successful rescue-ref or bundle salvage generates a recovery command containing git checkout -B fix;id;# FETCH_HEAD.
    3. The instruction is presented through the GitHub failure comment, task UI, and CLI. An operator copying it into a shell executes id as a separate command; another branch name could contain a destructive command.
    4. The retained-worktree instruction interpolates the same branch without quoting. Bundle and worktree paths also become unquoted shell arguments, breaking recovery for paths containing spaces or shell metacharacters.

    Git ref validity does not exclude semicolons or shell comment characters. Markdown backticks provide display formatting, not shell escaping, and credential redaction does not protect these arguments. static trace: verified against the command construction and its supplied callers and renderers; no commands were executed.

  • Minimum fix: Apply consistent POSIX shell argument quoting to every interpolated argument in all three recovery commands, including complete refspecs. Add regression coverage for shell metacharacters in valid branch names and spaces in paths.

Suggestions

These are optional follow-ups and are not sent to /fix.

S3: 🟢 Track rescue creation time

The ref sweeper measures retention from the commit’s committer date, whereas bundles and retained worktrees use salvage-time timestamps. Consider recording rescue creation time so historical commits receive the same recovery window. This is an optional retention-policy improvement: the current documentation explicitly describes commit-age pruning.

Score

The implementation has broad integration and useful recovery tests, with all current checks passing. Unsafe recovery-command generation remains a merge blocker requiring a focused fix.

Score: 6/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 1m 6s
  • Tokens: 83,800 (82,172 in / 1,628 out)
  • Cost: $0.79

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix F4 S3

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit 8472ac9

Addressed 1 AI review comment (IDs: 6007073135)

Addressed finding F4

Summary of Changes

I fixed F4: the generated recovery commands now quote branch names and paths so a shell treats them as literal text. The new tests and the rest of test/pushSalvage.test.ts and test/issueJobPushSalvage.test.ts pass (13/13), and lint and typecheck are clean.

What changed (packages/core/src/git/pushSalvage.ts)

  • New helper: quoteShellArgument wraps a value in POSIX single quotes and escapes any embedded ' as '\''. Simple values like 2736/salvage or refs/propr/rescue/task-1 stay unquoted so the message is still easy to read, and an empty value becomes ''.
  • All three recovery commands use it:
    • Rescue ref: the ref and the branch in git fetch origin <ref> && git checkout -B <branch> FETCH_HEAD.
    • Bundle: the bundle path and the branch in git fetch <bundle> HEAD && git checkout -B <branch> FETCH_HEAD.
    • Retained worktree: git -C <worktree> push origin <refspec>, with HEAD:refs/heads/<branch> quoted as one whole argument.

buildRecoveryInstruction is the only place these commands are built. The GitHub comment, task UI and CLI all show the text it produces, so they all get the fix.

New tests (test/pushSalvage.test.ts)

  • Exact output: checks each rung's command for a valid branch name fix;id>pwned;#it's, a bundle path containing a space and $HOME, and a worktree path containing a space and ;.
  • Real shell run: writes a real bundle and a real worktree into folders whose names contain a space, ; and ', then runs the bundle and worktree commands through sh -c with the branch fix;id>pwned;#. It checks that the branch is created under its exact name pointing at the agent's commit, and that no pwned file appears.
  • With the old command building put back temporarily, both new tests fail and the other 10 still pass.

To run the tests, I first had to install dependencies: node_modules was missing, so I ran the existing .propr/setup.sh. No setup files changed.

There's no preview because nothing visible changed beyond the quoting inside a recovery command.

Separate from F4, not changed: a branch name can legally contain a backtick, which would end the Markdown code span early wherever the command is shown. The shell quoting stays correct, but the displayed command could look cut off. Also, propr-ui/e2e/task-details-push-failure.pw.ts contains a hard-coded unquoted example of the instruction text; it only uses a plain branch name, so it's still accurate.


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @propr-ultrafix
  • Time: 3m 26s
  • Tokens: 649,435 (642,572 in / 6,863 out)
  • Cost: $0.44
  • Subscription usage: Session +1%

View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR

…h names and paths so a shell treats them as literal text. The new tests and the rest of `test/pushSalvage.test.ts` and `test/issueJobPushSalvage.test.ts` pass (13/13), and lint and typecheck are clean.

I fixed F4: the generated recovery commands now quote branch names and paths so a shell treats them as literal text. The new tests and the rest of `test/pushSalvage.test.ts` and `test/issueJobPushSalvage.test.ts` pass (13/13), and lint and typecheck are clean.

**What changed** (`packages/core/src/git/pushSalvage.ts`)
- **New helper:** `quoteShellArgument` wraps a value in POSIX single quotes and escapes any embedded `'` as `'\''`. Simple values like `2736/salvage` or `refs/propr/rescue/task-1` stay unquoted so the message is still easy to read, and an empty value becomes `''`.
- **All three recovery commands use it:**
  - **Rescue ref:** the ref and the branch in `git fetch origin <ref> && git checkout -B <branch> FETCH_HEAD`.
  - **Bundle:** the bundle path and the branch in `git fetch <bundle> HEAD && git checkout -B <branch> FETCH_HEAD`.
  - **Retained worktree:** `git -C <worktree> push origin <refspec>`, with `HEAD:refs/heads/<branch>` quoted as one whole argument.

`buildRecoveryInstruction` is the only place these commands are built. The GitHub comment, task UI and CLI all show the text it produces, so they all get the fix.

**New tests** (`test/pushSalvage.test.ts`)
- **Exact output:** checks each rung's command for a valid branch name `fix;id>pwned;#it's`, a bundle path containing a space and `$HOME`, and a worktree path containing a space and `;`.
- **Real shell run:** writes a real bundle and a real worktree into folders whose names contain a space, `;` and `'`, then runs the bundle and worktree commands through `sh -c` with the branch `fix;id>pwned;#`. It checks that the branch is created under its exact name pointing at the agent's commit, and that no `pwned` file appears.
- With the old command building put back temporarily, both new tests fail and the other 10 still pass.

To run the tests, I first had to install dependencies: `node_modules` was missing, so I ran the existing `.propr/setup.sh`. No setup files changed.

There's no preview because nothing visible changed beyond the quoting inside a recovery command.

**Separate from F4, not changed:** a branch name can legally contain a backtick, which would end the Markdown code span early wherever the command is shown. The shell quoting stays correct, but the displayed command could look cut off. Also, `propr-ui/e2e/task-details-push-failure.pw.ts` contains a hard-coded unquoted example of the instruction text; it only uses a plain branch name, so it's still accurate.

PR: #2755
Comment by: @propr-ultrafix (ID: 0)
Model: claude-opus-5-5
@propr-dev

propr-dev Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

CI failed: Validate Changes

Please investigate and fix this CI failure.

Failure evidence

.github:8
Process completed with exit code 1.

.github:360
Process completed with exit code 1.

.github:453 — 🎭 Playwright Run Summary
206 passed (9.7m)

@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown

Checks Failed

Validation failed during setup, tests, CLI packaging, linting, or build checks.

View Logs
Build check diagnostics for run 37397437303, attempt 1
Checkout outcome: success

--- GitHub Actions workflow lint ---
docker.io/rhysd/actionlint@sha256:b1934ee5f1c509618f2508e6eb47ee0d3520686341fec936f3b79331f9315667: Pulling from rhysd/actionlint
589002ba0eae: Pulling fs layer
c09af8888d6a: Pulling fs layer
4ccd7d76ca98: Pulling fs layer
b6b4b7b0e257: Pulling fs layer
b6b4b7b0e257: Waiting
c09af8888d6a: Download complete
4ccd7d76ca98: Verifying Checksum
4ccd7d76ca98: Download complete
589002ba0eae: Verifying Checksum
589002ba0eae: Download complete
589002ba0eae: Pull complete
b6b4b7b0e257: Verifying Checksum
b6b4b7b0e257: Download complete
c09af8888d6a: Pull complete
4ccd7d76ca98: Pull complete
b6b4b7b0e257: Pull complete
Digest: sha256:b1934ee5f1c509618f2508e6eb47ee0d3520686341fec936f3b79331f9315667
Status: Downloaded newer image for rhysd/actionlint@sha256:b1934ee5f1c509618f2508e6eb47ee0d3520686341fec936f3b79331f9315667
docker.io/rhysd/actionlint@sha256:b1934ee5f1c509618f2508e6eb47ee0d3520686341fec936f3b79331f9315667

--- Release shell script lint ---

--- Toolchain ---
v22.23.3
10.9.9

--- Dependency installation ---
npm warn deprecated [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated [email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
npm warn deprecated [email protected]: Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting [email protected]

added 1120 packages, and audited 1129 packages in 21s

322 packages are looking for funding
  run `npm fund` for details

8 high severity vulnerabilities

To address all issues possible (including breaking changes), run:
  npm audit fix --force

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.

--- CLI release package ---
Verifying propr-cli release package...

> [email protected] cli:pack
> node packages/cli/scripts/build-publish.mjs


> @propr/[email protected] build
> tsc


> @propr/[email protected] build
> tsc


> @propr/[email protected] build
> tsc && node scripts/copy-assets.mjs

copy-assets: copied 9 file(s) into the CLI package.

Staged [email protected] at /home/runner/work/propr/propr/dist-publish/propr-cli
npm notice
npm notice 📦  [email protected]
npm notice Tarball Contents
npm notice 26.3kB README.md
npm notice 36.3kB dist/agentSkill.js
npm notice 754B dist/api/agentRuntime.js
npm notice 7.1kB dist/api/agents.js
npm notice 2.6kB dist/api/agentTank.js
npm notice 11.7kB dist/api/client.js
npm notice 5.0kB dist/api/errors.js
npm notice 16.6kB dist/api/goals.js
npm notice 5.5kB dist/api/implement.js
npm notice 2.4kB dist/api/index.js
npm notice 1.9kB dist/api/logs.js
npm notice 5.7kB dist/api/plans.js
npm notice 4.2kB dist/api/relay.js
npm notice 10.4kB dist/api/repos.js
npm notice 11.4kB dist/api/settings.js
npm notice 1.6kB dist/api/syntheticPools.js
npm notice 1.8kB dist/api/system.js
npm notice 5.8kB dist/api/tasks.js
npm notice 2.9kB dist/api/todos.js
npm notice 86B dist/api/types.js
npm notice 313B dist/api/visualPreviewAuth.js
npm notice 26.1kB dist/assets/env.example.txt
npm notice 5.7kB dist/auth/githubLogin.js
npm notice 19.5kB dist/commands/agentCommands.js
npm notice 4.2kB dist/commands/agentPoolCommands.js
npm notice 4.3kB dist/commands/agentSkillCommands.js
npm notice 28.7kB dist/commands/agentValidation.js
npm notice 66.7kB dist/commands/checkCommands.js
npm notice 8.9kB dist/commands/configCommands.js
npm notice 14.6kB dist/commands/connectCommand.js
npm notice 5.5kB dist/commands/githubAppApi.js
npm notice 27.7kB dist/commands/githubAppCommands.js
npm notice 57.9kB dist/commands/goalCommands.js
npm notice 2.4kB dist/commands/imageCommands.js
npm notice 7.2kB dist/commands/implementCommands.js
npm notice 1.7kB dist/commands/index.js
npm notice 6.9kB dist/commands/initCommands.js
npm notice 14.1kB dist/commands/initStack.js
npm notice 6.1kB dist/commands/logCommands.js
npm notice 24.9kB dist/commands/planCommands.js
npm notice 8.4kB dist/commands/relayCommands.js
npm notice 30.1kB dist/commands/repoCommands.js
npm notice 7.5kB dist/commands/runtimeCommands.js
npm notice 16.5kB dist/commands/settingCommands.js
npm notice 4.1kB dist/commands/setup/agentHostActions.js
npm notice 123B dist/commands/setup/agents.js
npm notice 4.5kB dist/commands/setup/engine.js
npm notice 51B dist/commands/setup/github.js
npm notice 15.3kB dist/commands/setup/hostActions.js
npm notice 27.3kB dist/commands/setup/sequential.js
npm notice 51B dist/commands/setup/state.js
npm notice 51B dist/commands/setup/types.js
npm notice 10.7kB dist/commands/setupCommand.js
npm notice 4.4kB dist/commands/stackCommands.js
npm notice 1.4kB dist/commands/startCommand.js
npm notice 13.5kB dist/commands/systemCommands.js
npm notice 3.5kB dist/commands/tankCommands.js
npm notice 44.2kB dist/commands/taskCommands.js
npm notice 29.6kB dist/commands/todoCommands.js
npm notice 31.0kB dist/commands/tunnelCommand.js
npm notice 2.7kB dist/commands/uiDocsCommands.js
npm notice 8.3kB dist/completion.js
npm notice 20.0kB dist/config/ConfigManager.js
npm notice 276B dist/config/index.js
npm notice 989B dist/config/rootKey.js
npm notice 345B dist/config/types.js
npm notice 42.9kB dist/connectIdentity.js
npm notice 25.0kB dist/connectRootAuthority.js
npm notice 32.5kB dist/connectWindowsAuthority.js
npm notice 2.2kB dist/desktopDiscovery.js
npm notice 12.4kB dist/desktopLocalSetup.js
npm notice 16.7kB dist/index.js
npm notice 4.5kB dist/native/darwin-authority-broker.c
npm notice 8.9kB dist/native/directory-operations.c
npm notice 50.1kB dist/native/prebuilds/darwin-arm64/connect-authority-broker
npm notice 54.2kB dist/native/prebuilds/darwin-arm64/directory-operations.node
npm notice 17.1kB dist/native/prebuilds/darwin-x64/connect-authority-broker
npm notice 24.3kB dist/native/prebuilds/darwin-x64/directory-operations.node
npm notice 28.9kB dist/native/prebuilds/linux-arm64/directory-operations.node
npm notice 17.4kB dist/native/prebuilds/linux-x64/directory-operations.node
npm notice 1.2kB dist/native/README.md
npm notice 3.1kB dist/orchestrator/format.js
npm notice 13.4kB dist/orchestrator/index.js
npm notice 302B dist/orchestrator/manifest.json
npm notice 118.3kB dist/orchestrator/orchestrator.mjs
npm notice 408B dist/orchestrator/types.js
npm notice 237B dist/skill/propr/agents/openai.yaml
npm notice 8.7kB dist/skill/propr/SKILL.md
npm notice 4.5kB dist/tui/AgentTableApp.js
npm notice 4.5kB dist/tui/app.js
npm notice 11.6kB dist/tui/CheckApp.js
npm notice 5.1kB dist/tui/render.js
npm notice 32.5kB dist/tui/SetupApp.js
npm notice 18.4kB dist/tui/SetupApp.test.js
npm notice 8.2kB dist/tui/StartApp.js
npm notice 3.6kB dist/utils/apiErrorPresentation.js
npm notice 12.0kB dist/utils/directoryDescriptor.js
npm notice 739B dist/utils/dockerPort.js
npm notice 5.0kB dist/utils/envFile.js
npm notice 520B dist/utils/index.js
npm notice 5.7kB dist/utils/io.js
npm notice 1.5kB dist/utils/nativeArtifact.js
npm notice 544B dist/utils/parseState.js
npm notice 417B dist/utils/positiveInteger.js
npm notice 4.5kB dist/utils/privateFilesystem.js
npm notice 4.2kB dist/utils/resolveProject.js
npm notice 7.2kB dist/vendor/local-setup/agents.js
npm notice 62.7kB dist/vendor/local-setup/engine.js
npm notice 5.0kB dist/vendor/local-setup/envFile.js
npm notice 9.1kB dist/vendor/local-setup/github.js
npm notice 188B dist/vendor/local-setup/index.js
npm notice 27.0kB dist/vendor/local-setup/publicInstanceIdentity.js
npm notice 14.6kB dist/vendor/local-setup/state.js
npm notice 2.8kB dist/vendor/local-setup/types.js
npm notice 1.0kB dist/vendor/shared/accountStatusTimestamp.js
npm notice 7.6kB dist/vendor/shared/activityEvents.js
npm notice 3.4kB dist/vendor/shared/agentLogin.js
npm notice 3.1kB dist/vendor/shared/agentTank.js
npm notice 1.8kB dist/vendor/shared/analyticsTimeframe.js
npm notice 2.0kB dist/vendor/shared/antigravityCompatibility.js
npm notice 5.1kB dist/vendor/shared/apiOrigin.js
npm notice 8.5kB dist/vendor/shared/connectDiscovery.js
npm notice 254B dist/vendor/shared/demoMode.js
npm notice 4.3kB dist/vendor/shared/desktopPairing.js
npm notice 481B dist/vendor/shared/desktopTokenRevocation.js
npm notice 8.9kB dist/vendor/shared/events.js
npm notice 2.5kB dist/vendor/shared/githubAppManifest.js
npm notice 1.6kB dist/vendor/shared/githubAuthMode.js
npm notice 2.0kB dist/vendor/shared/githubEventIntakeMode.js
npm notice 11.6kB dist/vendor/shared/goalBlockers.js
npm notice 6.0kB dist/vendor/shared/goalCheckpoints.js
npm notice 4.0kB dist/vendor/shared/goalCreation.js
npm notice 4.9kB dist/vendor/shared/goalWait.js
npm notice 11.7kB dist/vendor/shared/index.js
npm notice 214B dist/vendor/shared/instanceAuthorization.js
npm notice 54B dist/vendor/shared/instanceCatalog.js
npm notice 4.0kB dist/vendor/shared/intakeModePrerequisites.js
npm notice 2.9kB dist/vendor/shared/labelUtils.js
npm notice 16.6kB dist/vendor/shared/modelDefinitions.js
npm notice 3.5kB dist/vendor/shared/notificationLinks.js
npm notice 51.3kB dist/vendor/shared/notifications.js
npm notice 866B dist/vendor/shared/projectSlug.js
npm notice 3.8kB dist/vendor/shared/proprCompatibility.js
npm notice 13.0kB dist/vendor/shared/proprServiceUrls.js
npm notice 2.2kB dist/vendor/shared/publishedVisualPreviews.js
npm notice 2.6kB dist/vendor/shared/reasoningLevels.js
npm notice 1.2kB dist/vendor/shared/repositoryIcon.js
npm notice 1.4kB dist/vendor/shared/repositoryIconUrl.js
npm notice 3.7kB dist/vendor/shared/repositoryPresentation.js
npm notice 9.5kB dist/vendor/shared/reviewContextBudget.js
npm notice 5.8kB dist/vendor/shared/reviewFeedbackIds.js
npm notice 1.7kB dist/vendor/shared/reviewPrompt.js
npm notice 861B dist/vendor/shared/sessionSecret.js
npm notice 603B dist/vendor/shared/statusKeys.js
npm notice 7.5kB dist/vendor/shared/syntheticAgents.js
npm notice 2.2kB dist/vendor/shared/taskIdentifiers.js
npm notice 1.5kB dist/vendor/shared/taskLifecycle.js
npm notice 957B dist/vendor/shared/text.js
npm notice 5.6kB dist/vendor/shared/usageTips.js
npm notice 503B dist/vendor/shared/usageTypes.js
npm notice 1.1kB dist/vendor/shared/userWhitelist.js
npm notice 758B dist/vendor/shared/validateRelayUrl.js
npm notice 2.2kB dist/vendor/shared/validateRoutingUrl.js
npm notice 7.1kB dist/vendor/shared/visualPreviewCapacity.js
npm notice 9.3kB dist/vendor/shared/voice.js
npm notice 222B dist/vendor/shared/workEvidence.js
npm notice 622B package.json
npm notice Tarball Details
npm notice name: propr-cli
npm notice version: 0.9.0
npm notice filename: propr-cli-0.9.0.tgz
npm notice package size: 423.9 kB
npm notice unpacked size: 1.8 MB
npm notice shasum: e23bef139d55e6e39c435c361ff79f960405af86
npm notice integrity: sha512-6YHgNvo5fOiUQ[...]LcHAWXbuKpz7w==
npm notice total files: 167
npm notice
propr-cli-0.9.0.tgz

Dry run only. Re-run with --publish to publish to npm.
✅ propr-cli release package verified
Starting changed-area validation process...
Reusing this job's @propr/shared build from CLI packaging.
Reusing this job's @propr/local-setup build from CLI packaging.

--- Core Service: Lint & Build ---
✅ Core Lint passed
✅ Core Source Build passed

--- UI: Typecheck, Lint & Build ---
✅ Client Package validation passed
✅ UI Typecheck passed
✅ UI Lint passed
✅ UI Build passed

--- Docs: Typecheck & Build ---
✅ Docs Typecheck passed
✅ Docs Build passed

--- Core Package: Build & Lint ---
✅ Core Package Build passed
❌ Core Package Lint FAILED

/home/runner/work/propr/propr/packages/core/src/git/pushSalvage.ts
  100:38  error  Unnecessary escape character: \/  no-useless-escape

✖ 1 problem (1 error, 0 warnings)

--- CLI: Lint ---
✅ CLI Lint passed

--- API: Build & Lint ---
✅ API Build passed
✅ API Lint passed

--- Stage outcomes ---
Workflow lint: success
Release shell lint: success
Pre-setup gate: skipped
Node setup: success
Toolchain: success
Dependency install: success
Release metadata: success
CLI packaging: success
Change detection: success
Changed-area checks: failure

View Workflow

@propr-dev

propr-dev Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit f2bb868

Processed 2 comments:

  • Comment 1 by @propr-dev[bot] (ID: 6007358571✓)
  • Comment 2 by @github-actions[bot] (ID: 6007358999✓)

Summary of Changes

I fixed the CI failure. The core package lint failed on one unnecessary escape (\/) in the shell-quoting regex at packages/core/src/git/pushSalvage.ts:100. I removed it, and the regex is now /^[A-Za-z0-9_/.:@%+=,-]+$/. A / inside a character class doesn't need escaping, so the regex matches exactly the same strings as before.

After the change, the core package lint (eslint . in packages/core) passes. The 13 tests in test/pushSalvage.test.ts and test/issueJobPushSalvage.test.ts also pass. I didn't re-run the rest of the CI checks.

To run those checks, I had to install dependencies and build @propr/shared first, because the workspace had neither. This change has no visible effect, so I didn't create any previews.


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @propr-dev[bot], @github-actions[bot]
  • Time: 1m 9s
  • Tokens: 310,203 (308,773 in / 1,430 out)
  • Cost: $0.25

Undo Changes • View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR
Processing comment IDs: 6007358571✓, 6007358999✓

… unnecessary escape (`\/`) in the shell-quoting regex at `packages/core/src/git/pushSalvage.ts:100`. I removed it, and the regex is now `/^[A-Za-z0-9_/.:@%+=,-]+$/`. A `/` inside a character class doesn't need escaping, so the regex matches exactly the same strings as before.

I fixed the CI failure. The core package lint failed on one unnecessary escape (`\/`) in the shell-quoting regex at `packages/core/src/git/pushSalvage.ts:100`. I removed it, and the regex is now `/^[A-Za-z0-9_/.:@%+=,-]+$/`. A `/` inside a character class doesn't need escaping, so the regex matches exactly the same strings as before.

After the change, the core package lint (`eslint .` in `packages/core`) passes. The 13 tests in `test/pushSalvage.test.ts` and `test/issueJobPushSalvage.test.ts` also pass. I didn't re-run the rest of the CI checks.

To run those checks, I had to install dependencies and build `@propr/shared` first, because the workspace had neither. This change has no visible effect, so I didn't create any previews.

PR: #2755
Comment by: @propr-dev[bot] (ID: 6007358571)
Comment by: @github-actions[bot] (ID: 6007358999)
Model: claude-opus-5-5

integry commented Oct 6, 2026

Copy link
Copy Markdown
Owner

/ultrafix goal=8 max=3

@propr-dev

propr-dev Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

🔄 Ultrafix loop started (goal: 8/10, max cycles: 3)

First action: /review

💡 Tip: Remove the ultrafix label from this PR to stop further ultrafix cycles.

@integry

integry commented Oct 6, 2026

Copy link
Copy Markdown
Owner

/review

@propr-dev

propr-dev Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @integry

Posted 1 review:

View Task Details

@integry

integry commented Oct 6, 2026

Copy link
Copy Markdown
Owner

/fix F9

@propr-dev

propr-dev Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit daaac9d

Addressed 1 AI review comment (IDs: 6009670369)

Addressed finding F9

Summary of Changes

I fixed F9: the bundle sweep can no longer delete a rescue bundle that a worker writes into a directory the sweep has just emptied. I added a regression test that fails on the previous code and passes now. Lint is clean for packages/core, the typecheck shows no errors in rescueRefs.ts, and the salvage suites (rescueRefHygiene, pushSalvage, issueJobPushSalvage) pass.

The fix is in pruneRescueBundles in packages/core/src/git/rescueRefs.ts:

  • Empty directories: the sweep used to list a directory, see it was empty, then delete it and everything in it. It now uses a delete that only works on empty directories (fs.rmdir). If a worker writes a bundle in between, the delete fails with ENOTEMPTY and the bundle stays. That error, EEXIST and ENOENT (the directory is already gone) are ignored. The same helper runs at every directory level the sweep visits.
  • Directories that vanish mid-sweep: listing a directory that has disappeared returns nothing instead of stopping the whole sweep.

Tests in test/rescueRefHygiene.test.ts:

  • One test follows the review's scenario. The last expired bundle is deleted, then a worker writes a new bundle into that directory just before the sweep removes it. The test checks the new bundle survives.
  • A second test makes a directory disappear before the sweep removes it and checks the sweep still finishes. It also passes on the old code, so it only covers the new error handling and isn't a regression test.

Callers checked: the only caller is the daemon sweep in src/daemon/rescueRefSweep.ts, which needs no change. On the worker side, salvagePush in pushSalvage.ts creates the directory and then writes the bundle. If the sweep removes the still-empty directory between those two steps, writing the bundle fails. That doesn't lose work, because the salvage then keeps the worktree instead. This window is a race between two separate processes that share no lock, and making it atomic was out of scope, so I left it.

Setup: dependencies weren't installed in this workspace, so I ran npm ci before the tests would run. No setup files changed.

This change has no visual effect, so there's no preview.


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @integry
  • Time: 2m 0s
  • Tokens: 658,168 (651,896 in / 6,272 out)
  • Cost: $0.45

Undo Changes • View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR
Processing comment ID: 6009682003✓

…bundle that a worker writes into a directory the sweep has just emptied. I added a regression test that fails on the previous code and passes now. Lint is clean for `packages/core`, the typecheck shows no errors in `rescueRefs.ts`, and the salvage suites (`rescueRefHygiene`, `pushSalvage`, `issueJobPushSalvage`) pass.

I fixed F9: the bundle sweep can no longer delete a rescue bundle that a worker writes into a directory the sweep has just emptied. I added a regression test that fails on the previous code and passes now. Lint is clean for `packages/core`, the typecheck shows no errors in `rescueRefs.ts`, and the salvage suites (`rescueRefHygiene`, `pushSalvage`, `issueJobPushSalvage`) pass.

**The fix** is in `pruneRescueBundles` in `packages/core/src/git/rescueRefs.ts`:
- **Empty directories:** the sweep used to list a directory, see it was empty, then delete it and everything in it. It now uses a delete that only works on empty directories (`fs.rmdir`). If a worker writes a bundle in between, the delete fails with `ENOTEMPTY` and the bundle stays. That error, `EEXIST` and `ENOENT` (the directory is already gone) are ignored. The same helper runs at every directory level the sweep visits.
- **Directories that vanish mid-sweep:** listing a directory that has disappeared returns nothing instead of stopping the whole sweep.

**Tests** in `test/rescueRefHygiene.test.ts`:
- One test follows the review's scenario. The last expired bundle is deleted, then a worker writes a new bundle into that directory just before the sweep removes it. The test checks the new bundle survives.
- A second test makes a directory disappear before the sweep removes it and checks the sweep still finishes. It also passes on the old code, so it only covers the new error handling and isn't a regression test.

**Callers checked:** the only caller is the daemon sweep in `src/daemon/rescueRefSweep.ts`, which needs no change. On the worker side, `salvagePush` in `pushSalvage.ts` creates the directory and then writes the bundle. If the sweep removes the still-empty directory between those two steps, writing the bundle fails. That doesn't lose work, because the salvage then keeps the worktree instead. This window is a race between two separate processes that share no lock, and making it atomic was out of scope, so I left it.

**Setup:** dependencies weren't installed in this workspace, so I ran `npm ci` before the tests would run. No setup files changed.

This change has no visual effect, so there's no preview.

PR: #2755
Comment by: @integry (ID: 6009682003)
Model: claude-opus-5-5
@integry

integry commented Oct 6, 2026

Copy link
Copy Markdown
Owner

/review

@propr-dev

propr-dev Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @integry

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The PR adds a coherent salvage ladder and exposes recovery details across task history, GitHub comments, the CLI, and the UI. It needs changes before merge because the rescue push bypasses an existing credential boundary and remote-ref pruning depends on an unrelated local Git repository.

✅ Verified bundle recovery — Bundles are fetched into an empty repository and checked against the expected HEAD before being accepted as successful salvage.

✅ Useful failure reporting — Structured rejection diagnoses and recovery instructions propagate through the changed failure handlers and consumers.

✅ Safer retention markers — Exclusive temporary-file creation followed by rename avoids writing through a repository-controlled marker symlink.

This review is based on static inspection only; no commands were run. No current-head check runs were reported.

Merge blockers

Every finding below was introduced by this PR and must be resolved before merging.

F10: 🔴 Rescue pushes bypass credential-helper isolation

  • Required behavior: Host-side salvage must preserve the existing boundary against executing repository-controlled credential helpers or exposing worker installation credentials.

  • Evidence: packages/core/src/git/pushSalvage.ts, createWorktreePushSalvageOperations.pushRescueRef

    1. A worktree has a repository-configured credential.helper; the original branch push fails, and the refreshed retry also fails.
    2. Normal pushes call configureGitAuthentication, which clears credential helpers through process-local configuration.
    3. The new rescue operation creates a separate Git client and pushes using a URL containing the installation token, without applying that configuration.
    4. When rescue authentication succeeds, Git’s credential approval invokes configured helpers with the credentials. An executable helper can therefore run on the worker and receive its installation token.

    The hook suppression does not suppress credential helpers; the supplied createHooklessGit configuration explicitly permits them. Normal-push authentication settings belong to a different Git client and do not protect this operation. static trace: the new rescue operation compared with the supplied configureGitAuthentication and createHooklessGit implementations. proposed regression: configure a recording credential helper and verify that rescue authentication never invokes it.

  • Minimum fix: Apply the existing process-local authentication configuration to the rescue Git client and push to the credential-free repository URL.

F11: 🔴 Remote-ref deletion requires a local repository

  • Required behavior: The daemon must prune expired rescue refs independently of its working directory.

  • Evidence: packages/core/src/git/rescueRefs.ts, createGitRescueRefPruneDependencies; src/daemon/rescueRefSweep.ts, sweepPushRescues

    1. The daemon runs from a directory outside a Git repository, while managed clones live under the configured clone directory.
    2. The sweep creates a Git client without a repository directory. Its ls-remote succeeds and discovers expired rescue refs because that command supports operation outside a repository.
    3. Deletion invokes git push <url> :<ref> from the same directory. Unlike ls-remote, git push requires a local Git repository and fails before deleting the ref.
    4. Every later sweep repeats the failure, leaving expired rescue refs indefinitely.

    The per-ref catch records a failure but supplies no usable repository context. The existing test does not explicitly exercise execution outside a Git checkout. static trace: the client’s omitted base directory and the list/delete commands in the changed implementation. proposed regression: run the prune dependencies from a temporary non-repository directory against a fixture remote and assert deletion succeeds.

  • Minimum fix: Perform deletion from an explicitly initialized disposable bare repository, with cleanup, or use a remote deletion mechanism that requires no local repository.

Suggestions

These are optional follow-ups and are not sent to /fix.

S7: 🟢 Align bundle documentation with implementation

docs/docs/architecture/git-management.md still describes bundles containing only commits absent from remote-tracking refs. The implementation now deliberately bundles full HEAD history and verifies independent restoration. Update that explanation to match; this is documentation cleanup and does not affect runtime correctness.

Score

The salvage flow and recovery verification are substantial improvements, but the credential boundary regression and broken pruning outside a checkout require correction before merge.

Score: 6/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 59s
  • Tokens: 90,975 (89,374 in / 1,601 out)
  • Cost: $0.86

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix F10 F11 S7

🤖 Review by ProPR

@integry

integry commented Oct 6, 2026

Copy link
Copy Markdown
Owner

/fix F10 F11

@propr-dev

propr-dev Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit 0c09c7b

Addressed 1 AI review comment (IDs: 6009962975)

Addressed findings F10, F11

Summary of Changes

I fixed F10 and F11. Each now has a regression test that fails on the previous code and passes with the fix.

F10: the rescue push now authenticates like a normal push (packages/core/src/git/pushSalvage.ts)

  • pushRescueRef now applies configureGitAuthentication to its own Git client. That passes the token as a process-local github.com auth header and clears credential helpers instead of running them.
  • It pushes to the plain repository URL; the token is no longer embedded in it.

F11: deleting expired rescue refs no longer depends on the daemon's working directory (packages/core/src/git/rescueRefs.ts)

  • Each listing and deletion now runs inside a temporary empty Git repository that is deleted afterwards. git push needs a repository to run in, and the daemon's directory may not be one.
  • The sweep had the same F10 defect: the token was embedded in the URL with no helper isolation. I applied the same fix there, so both commands use the process-local auth and the plain URL.

Tests

  • I added test/gitHttpServer.ts, a small test server that serves repositories over HTTP. Like GitHub, it asks for credentials and records any it receives. Tests against a local folder can't reach that code path.
  • Rescue push (test/pushSalvage.test.ts): a repository-configured credential helper is never run, and the token is never sent as URL credentials.
  • Sweep outside a Git repository (test/rescueRefHygiene.test.ts): with the working directory set to a non-repository folder, the expired ref is deleted. On the previous code this failed with fatal: not a git repository.
  • Sweep credentials: the same check as the rescue push, for listing refs.
  • On the previous code, the rescue-push and sweep-credentials tests failed because the token was sent as URL credentials.

Results

  • The three salvage suites (pushSalvage, rescueRefHygiene, issueJobPushSalvage) pass, 28/28. They need PROPR_DEMO_MODE=true; without it they abort on the missing GitHub-auth configuration.
  • Lint passes for packages/core.
  • The typecheck shows no errors in the changed files. The remaining errors elsewhere come from @propr/shared not being built in this workspace.
  • I ran npm ci because dependencies weren't installed; no setup files changed.

Limits

  • I couldn't show a helper actually running on the old code: the Git version here (2.39) didn't call it in my manual test. The tests prove the token is no longer sent as URL credentials, and the fix removes the helpers whatever the Git version does.
  • The fixed rescue push and sweep now only send the token to github.com, so the new tests can only check that nothing leaks, not that a push succeeds. A successful rescue push is still covered by the existing local-remote test.

Separate pre-existing issue (not changed): remoteHasAnyRefs in packages/core/src/git/seedCommit.ts also puts the token in the URL for ls-remote without clearing credential helpers. This PR doesn't touch that file, so I left it alone.


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @integry
  • Time: 5m 43s
  • Tokens: 2,484,802 (2,458,700 in / 26,102 out)
  • Cost: $1.39

Undo Changes • View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR
Processing comment ID: 6009990431✓

…ils on the previous code and passes with the fix.

I fixed F10 and F11. Each now has a regression test that fails on the previous code and passes with the fix.

**F10: the rescue push now authenticates like a normal push** (`packages/core/src/git/pushSalvage.ts`)
- `pushRescueRef` now applies `configureGitAuthentication` to its own Git client. That passes the token as a process-local `github.com` auth header and clears credential helpers instead of running them.
- It pushes to the plain repository URL; the token is no longer embedded in it.

**F11: deleting expired rescue refs no longer depends on the daemon's working directory** (`packages/core/src/git/rescueRefs.ts`)
- Each listing and deletion now runs inside a temporary empty Git repository that is deleted afterwards. `git push` needs a repository to run in, and the daemon's directory may not be one.
- The sweep had the same F10 defect: the token was embedded in the URL with no helper isolation. I applied the same fix there, so both commands use the process-local auth and the plain URL.

**Tests**
- I added `test/gitHttpServer.ts`, a small test server that serves repositories over HTTP. Like GitHub, it asks for credentials and records any it receives. Tests against a local folder can't reach that code path.
- **Rescue push** (`test/pushSalvage.test.ts`): a repository-configured credential helper is never run, and the token is never sent as URL credentials.
- **Sweep outside a Git repository** (`test/rescueRefHygiene.test.ts`): with the working directory set to a non-repository folder, the expired ref is deleted. On the previous code this failed with `fatal: not a git repository`.
- **Sweep credentials**: the same check as the rescue push, for listing refs.
- On the previous code, the rescue-push and sweep-credentials tests failed because the token was sent as URL credentials.

**Results**
- The three salvage suites (`pushSalvage`, `rescueRefHygiene`, `issueJobPushSalvage`) pass, 28/28. They need `PROPR_DEMO_MODE=true`; without it they abort on the missing GitHub-auth configuration.
- Lint passes for `packages/core`.
- The typecheck shows no errors in the changed files. The remaining errors elsewhere come from `@propr/shared` not being built in this workspace.
- I ran `npm ci` because dependencies weren't installed; no setup files changed.

**Limits**
- I couldn't show a helper actually running on the old code: the Git version here (2.39) didn't call it in my manual test. The tests prove the token is no longer sent as URL credentials, and the fix removes the helpers whatever the Git version does.
- The fixed rescue push and sweep now only send the token to `github.com`, so the new tests can only check that nothing leaks, not that a push succeeds. A successful rescue push is still covered by the existing local-remote test.

**Separate pre-existing issue (not changed):** `remoteHasAnyRefs` in `packages/core/src/git/seedCommit.ts` also puts the token in the URL for `ls-remote` without clearing credential helpers. This PR doesn't touch that file, so I left it alone.

PR: #2755
Comment by: @integry (ID: 6009990431)
Model: claude-opus-5-5
@integry

integry commented Oct 6, 2026

Copy link
Copy Markdown
Owner

/review

@propr-dev

propr-dev Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @integry

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The PR adds a coherent salvage ladder, structured push diagnostics, recovery instructions, and retention cleanup. It needs changes before merge because repository-controlled content can activate indefinite worktree retention.

✅ Verified bundle recovery — Bundle creation is followed by a fetch into an empty repository and a HEAD comparison before salvage is reported successful.

✅ Consistent diagnostics — Structured push failures reach task history, CLI output, UI details, and GitHub failure comments.

✅ Credential isolation — Rescue pushes and remote pruning use process-local authentication with credential helpers cleared.

This review used static analysis of the supplied code. No commands or tests were run. No current-head check runs were reported.

Merge blockers

Every finding below was introduced by this PR and must be resolved before merging.

F12: 🔴 Repository files can disable cleanup indefinitely

  • Required behavior: Worktree retention must reflect a worker-established salvage decision; untrusted repository contents must not independently override cleanup.

  • Evidence: packages/core/src/git/worktreeOperations.ts, cleanupWorktree and processWorktreeItem; packages/core/src/git/pushSalvage.ts, isSalvageRetainedWorktree and isActiveSalvageRetention.

    1. A PR contains a committed .retention-info.json with {"reason":"push_salvage","scheduledCleanup":null}. Checking out that PR places the file in the task worktree.
    2. The job finishes successfully, without running salvage. The newly added cleanupWorktree guard nevertheless reads the repository-authored file and returns before applying always_delete.
    3. Subsequent expiration sweeps also accept that file through isActiveSalvageRetention and retain the worktree indefinitely.
    4. Repeated jobs using that repository content leave additional worktrees behind, defeating automatic reclamation and allowing persistent disk consumption.

    The reader checks only reason and scheduledCleanup; it verifies neither provenance nor a worker-recorded salvage decision. The symlink-safe marker writer protects host files during writing, but does not authenticate an existing marker. Task locks do not prevent a committed file from entering each checkout.

    static trace: both cleanup paths trust the same repository-controlled JSON predicate. No reproduction was executed.

  • Minimum fix: Store the authoritative salvage-retention decision in worker-controlled storage outside the checkout, keyed to the worktree, and consult that record in both cleanup paths. An in-worktree marker may remain informational but must not independently authorize retention.

Suggestions

These are optional follow-ups and are not sent to /fix.

S8: 🟢 Update the bundle documentation

docs/docs/architecture/git-management.md describes bundles containing only commits absent from remote-tracking refs. The implementation now deliberately bundles full HEAD history and verifies independent restoration. Updating that sentence would clarify storage requirements and recovery guarantees; this documentation discrepancy does not affect runtime correctness.

S9: 🟢 Consider pruning unmonitored fork rescues

Publication correctly targets the PR’s head repository, including forks, while src/daemon/rescueRefSweep.ts discovers repositories through getRepos(). A writable fork need not be monitored, so its rescue refs can fall outside the sweep. Tracking actual rescue destinations would broaden retention coverage. This is optional because the maintenance documentation explicitly limits remote sweeping to monitored repositories.

Score

The implementation has substantial focused coverage and clear recovery reporting, but the new retention trust issue requires correction before merge. Current-head validation remains unreported.

Score: 6/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 2m 28s
  • Tokens: 94,932 (91,092 in / 3,840 out)
  • Cost: $0.99

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix F12 S8 S9

🤖 Review by ProPR

@integry

integry commented Oct 6, 2026

Copy link
Copy Markdown
Owner

/fix F12

@propr-dev

propr-dev Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit 4caa013

Addressed 1 AI review comment (IDs: 6011602049)

Addressed finding F12

Summary of Changes

I fixed F12. A .retention-info.json file committed to a repository can no longer stop a worktree from being cleaned up.

What changed

  • Where the decision lives: when the last salvage step keeps a worktree, the worker now writes a record into its own storage outside the checkout. The record is named after the worktree's real path and repeats that path inside it. The location is a new setting, PUSH_RESCUE_WORKTREE_RECORD_DIR, which defaults to <DATA_DIR>/rescue-worktrees (rescueRefs.ts).
  • The file in the worktree: writeSalvageRetentionMarker still writes .retention-info.json with the same symlink-safe method, but only for information. If that write fails, it logs a warning instead of failing the step. A failure to write the real record still fails the step.
  • Both cleanup paths:
    • cleanupWorktree decides through isSalvageRetainedWorktree, which now reads only the worker's record.
    • processWorktreeItem (the expiry sweep) checks the record first. An active record keeps the worktree. An expired one removes both the worktree and the record. A salvage marker in the worktree with no record falls through to the old date-based handling, so a forged scheduledCleanup: null is treated as expired and deleted.
  • Record cleanup: cleanupExpiredWorktrees also deletes records whose worktree no longer exists. A record is only ever written for a worktree that already exists, so a missing path means the worktree is gone for good.
  • The docs and CHANGELOG now describe where the record lives.

Tests (test/pushSalvage.test.ts)

  • A forged marker is deleted by both cleanupWorktree (with always_delete on a successful job) and the expiry sweep.
  • A salvaged worktree stays retained after its .retention-info.json is deleted. Once an operator deletes the worktree, the sweep removes its record, so a new directory at the same path with a forged marker is cleaned up.
  • Both tests fail on the old code and pass now.
  • The three salvage suites (pushSalvage, issueJobPushSalvage, rescueRefHygiene) pass, 30/30, and lint is clean for the changed core files.
  • Typecheck shows no errors in these files; its only errors are that @propr/shared isn't built here. I ran npm ci --ignore-scripts first because dependencies weren't installed; no setup files changed.

Design note: I first also tied each record to the directory's inode, but Linux reused the inode as soon as the directory was recreated, so that check didn't work. I dropped it. Each job's worktree path already includes a timestamp and a random suffix, so two jobs never share a path.

Separate issues I noticed but didn't fix (outside F12, and older than this PR):

  • The expiry sweep still trusts the old date-based .retention-info.json written for keep_on_failure / keep_for_hours. A committed file with a far-future scheduledCleanup or an unparseable date would keep that worktree from being swept.
  • Nothing in production code calls cleanupExpiredWorktrees; it's only exported. So the expiry sweep and its record cleanup only run where someone invokes it.

No preview images were made, since nothing visible changed.


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @integry
  • Time: 3m 47s
  • Tokens: 1,500,318 (1,480,614 in / 19,704 out)
  • Cost: $1.02
  • Subscription usage: Session +1%

Undo Changes • View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR
Processing comment ID: 6011608194✓

…epository can no longer stop a worktree from being cleaned up.

I fixed F12. A `.retention-info.json` file committed to a repository can no longer stop a worktree from being cleaned up.

**What changed**
- **Where the decision lives:** when the last salvage step keeps a worktree, the worker now writes a record into its own storage outside the checkout. The record is named after the worktree's real path and repeats that path inside it. The location is a new setting, `PUSH_RESCUE_WORKTREE_RECORD_DIR`, which defaults to `<DATA_DIR>/rescue-worktrees` (`rescueRefs.ts`).
- **The file in the worktree:** `writeSalvageRetentionMarker` still writes `.retention-info.json` with the same symlink-safe method, but only for information. If that write fails, it logs a warning instead of failing the step. A failure to write the real record still fails the step.
- **Both cleanup paths:**
  - `cleanupWorktree` decides through `isSalvageRetainedWorktree`, which now reads only the worker's record.
  - `processWorktreeItem` (the expiry sweep) checks the record first. An active record keeps the worktree. An expired one removes both the worktree and the record. A salvage marker in the worktree with no record falls through to the old date-based handling, so a forged `scheduledCleanup: null` is treated as expired and deleted.
- **Record cleanup:** `cleanupExpiredWorktrees` also deletes records whose worktree no longer exists. A record is only ever written for a worktree that already exists, so a missing path means the worktree is gone for good.
- The docs and CHANGELOG now describe where the record lives.

**Tests** (`test/pushSalvage.test.ts`)
- A forged marker is deleted by both `cleanupWorktree` (with `always_delete` on a successful job) and the expiry sweep.
- A salvaged worktree stays retained after its `.retention-info.json` is deleted. Once an operator deletes the worktree, the sweep removes its record, so a new directory at the same path with a forged marker is cleaned up.
- Both tests fail on the old code and pass now.
- The three salvage suites (`pushSalvage`, `issueJobPushSalvage`, `rescueRefHygiene`) pass, 30/30, and lint is clean for the changed core files.
- Typecheck shows no errors in these files; its only errors are that `@propr/shared` isn't built here. I ran `npm ci --ignore-scripts` first because dependencies weren't installed; no setup files changed.

**Design note:** I first also tied each record to the directory's inode, but Linux reused the inode as soon as the directory was recreated, so that check didn't work. I dropped it. Each job's worktree path already includes a timestamp and a random suffix, so two jobs never share a path.

**Separate issues I noticed but didn't fix (outside F12, and older than this PR):**
- The expiry sweep still trusts the old date-based `.retention-info.json` written for `keep_on_failure` / `keep_for_hours`. A committed file with a far-future `scheduledCleanup` or an unparseable date would keep that worktree from being swept.
- Nothing in production code calls `cleanupExpiredWorktrees`; it's only exported. So the expiry sweep and its record cleanup only run where someone invokes it.

No preview images were made, since nothing visible changed.

PR: #2755
Comment by: @integry (ID: 6011608194)
Model: claude-opus-5-5
@integry

integry commented Oct 6, 2026

Copy link
Copy Markdown
Owner

/review

@propr-dev

propr-dev Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @integry

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The PR adds a coherent salvage ladder and exposes push diagnoses through task history, GitHub comments, the CLI, and UI. It is merge-ready within the reviewed scope.

✅ Recoverable bundles — Bundle creation includes HEAD’s full history and verifies recovery into an empty repository before declaring success.

✅ Protected retention — Cleanup honors worker-controlled records outside the checkout; repository-provided markers cannot independently claim salvage retention.

✅ Useful failure reporting — Structured failure metadata preserves the rejection class, unblock URLs, and recovery instructions across the changed consumers.

This was a static review of the supplied diff and context. No commands or tests were run. No current-head check runs were reported.

Merge blockers

No merge blockers.

Suggestions

These are optional follow-ups and are not sent to /fix.

S10: 🟢 Align bundle documentation

In docs/docs/architecture/git-management.md, salvage step 3 still describes excluding remote-tracking commits. The implementation now bundles full HEAD history and verifies independent recovery. Updating this sentence would accurately explain the stronger implementation; the documentation discrepancy does not affect runtime correctness.

Score

The implementation addresses the objective with substantial targeted coverage and no verified merge blockers. Runtime validation remains unconfirmed in this review.

Score: 8/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 48s
  • Tokens: 93,330 (92,289 in / 1,041 out)
  • Cost: $0.86

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix S10

🤖 Review by ProPR

@integry

integry commented Oct 6, 2026

Copy link
Copy Markdown
Owner

Local verification on head 4caa013 (clean npm ci, npm run test:prepare): lint, root and UI typecheck pass; all 11 changed test files and the UI test pass.

One non-blocking observation: test/pushSalvage.test.ts and test/rescueRefHygiene.test.ts fail on a host whose environment exports SSH_ASKPASS (Use of "SSH_ASKPASS" is not permitted without enabling allowUnsafeAskPass from simple-git); they pass with it unset. The rescue push/prune path would hit the same refusal on such a worker host. Consider stripping SSH_ASKPASS/GIT_ASKPASS from the environment handed to simple-git in the salvage and prune helpers, the way hooklessGit already restricts the environment it allows. Fine as a follow-up.

@propr-dev

propr-dev Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit d84e245

Summary of Changes

Rescue pushes and rescue-ref pruning now work on a host that exports SSH_ASKPASS or GIT_ASKPASS. The two suites you flagged pass with both variables set.

The fix: both the salvage path (pushSalvage.ts) and the prune path (rescueRefs.ts) build their git environment in one shared function, configureGitAuthentication in packages/core/src/git/repoBranching.ts. It copies the host environment and already removed the editor and pager variables that simple-git rejects. It now also removes GIT_ASKPASS and SSH_ASKPASS. Credentials come only from the injected authorization header, so an askpass program is never needed. Because this function is shared, the normal branch push and the clone/fetch authentication also stop inheriting these variables; they would have hit the same refusal on such a host.

Regression test: I added "git prune dependencies work on a host that exports askpass programs" to test/rescueRefHygiene.test.ts. It sets both variables, prunes an expired rescue ref through the real git path, and restores the environment afterwards.

Verification:

  • Without the fix: with SSH_ASKPASS set, pushSalvage and rescueRefHygiene fail with your exact error, and the new test fails on GIT_ASKPASS even with nothing set in the shell.
  • With the fix: with both variables set, the rescueRefHygiene, pushSalvage and issueJobPushSalvage suites pass, 31/31.
  • Lint: core lint is clean. The root eslint config doesn't lint the changed files, so that check doesn't cover them.

To get tests running I ran npm ci and built @propr/shared, which changed no files. I didn't add a preview because nothing in this change is visible to a user.


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @integry
  • Time: 1m 45s
  • Tokens: 622,354 (617,736 in / 4,618 out)
  • Cost: $0.40
  • Subscription usage: Session +1%

Undo Changes • View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR
Processing comment ID: 6011761673✓

…t exports `SSH_ASKPASS` or `GIT_ASKPASS`. The two suites you flagged pass with both variables set.

Rescue pushes and rescue-ref pruning now work on a host that exports `SSH_ASKPASS` or `GIT_ASKPASS`. The two suites you flagged pass with both variables set.

**The fix:** both the salvage path (`pushSalvage.ts`) and the prune path (`rescueRefs.ts`) build their git environment in one shared function, `configureGitAuthentication` in `packages/core/src/git/repoBranching.ts`. It copies the host environment and already removed the editor and pager variables that simple-git rejects. It now also removes `GIT_ASKPASS` and `SSH_ASKPASS`. Credentials come only from the injected authorization header, so an askpass program is never needed. Because this function is shared, the normal branch push and the clone/fetch authentication also stop inheriting these variables; they would have hit the same refusal on such a host.

**Regression test:** I added "git prune dependencies work on a host that exports askpass programs" to `test/rescueRefHygiene.test.ts`. It sets both variables, prunes an expired rescue ref through the real git path, and restores the environment afterwards.

**Verification:**
- **Without the fix:** with `SSH_ASKPASS` set, `pushSalvage` and `rescueRefHygiene` fail with your exact error, and the new test fails on `GIT_ASKPASS` even with nothing set in the shell.
- **With the fix:** with both variables set, the `rescueRefHygiene`, `pushSalvage` and `issueJobPushSalvage` suites pass, 31/31.
- **Lint:** core lint is clean. The root eslint config doesn't lint the changed files, so that check doesn't cover them.

To get tests running I ran `npm ci` and built `@propr/shared`, which changed no files. I didn't add a preview because nothing in this change is visible to a user.

PR: #2755
Comment by: @integry (ID: 6011761673)
Model: claude-opus-5-5
@integry

integry commented Oct 6, 2026

Copy link
Copy Markdown
Owner

/merge

@propr-dev

propr-dev Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor Author

🔀 Resolved merge conflicts from main into 2736/claude-opus-5-5-salvage-agent-work-before-20261005-2330-ait in commit 5d5e8c3

Conflicting Files

  • CHANGELOG.md
  • packages/core/src/git/repoBranching.ts

Resolution Summary

I resolved the conflicts in both files, and no conflict markers remain anywhere in the repository. A syntax-only TypeScript check of repoBranching.ts reports no errors. I couldn't run a full typecheck or the git tests because dependencies aren't installed in this workspace.

1. packages/core/src/git/repoBranching.ts

What the conflict was about: Both branches changed how configureGitAuthentication cleans up the worker's environment before running git.

  • The PR copied process.env and deleted named variables one at a time: GIT_PAGER, PAGER, EDITOR, GIT_EDITOR and GIT_SEQUENCE_EDITOR. It also deleted GIT_ASKPASS and SSH_ASKPASS (from commit d84e245) so rescue pushes work on hosts that export askpass programs.
  • main replaced the deletions with a filter, isGuardedGitEnvironmentKey. It drops every GIT_* variable plus editor, pager, prefix, ssh_askpass and visual. This is the same set simple-git refuses to run with.

How I resolved it: I took main's filter.

Why: It already removes every variable the PR deleted, including GIT_ASKPASS and SSH_ASKPASS, so the PR's fix still applies. It also covers more variables, such as VISUAL, PREFIX and any other GIT_*. Keeping the PR's lines wasn't possible anyway, because they used an environment variable that main's code no longer declares.

2. CHANGELOG.md

What the conflict was about: Both branches added new entries at the top of ## [Unreleased] → ### Added.

  • The PR added "Push salvage and rejection diagnosis".
  • main added "Managed agent in Linux desktop previews" and "Complete bundled third-party notices".

How I resolved it: I kept all three entries, with the PR's entry first and main's two after it, followed by the existing entries.

Why: These entries describe separate features, so none of them should be dropped.


🤖 Resolution Details

  • Model: claude-opus-5-5
  • Time: 1m 11s

View Task Execution


System-triggered merge conflict resolution

…agent-work-before-20261005-2330-ait

Automatically resolved merge conflicts after merging target branch into PR branch.
Resolved conflicts in:
- CHANGELOG.md
- packages/core/src/git/repoBranching.ts

PR: #2755
Model: claude-opus-5-5
@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown

Full Test Suite Results

Validation failed during: Test shard (shard 3).

  • Dependency install: success
  • Workspace build: success
  • Docs validation: success
  • Shard coverage verification: success
  • Hosted native Electron units: success
  • Shard 1/4: passed in 581.1s on gitfix-rootless-6
  • Shard 2/4: passed in 1033.2s on gitfix-rootless-5
  • Shard 3/4: failed during Test shard in 626.5s on gitfix-rootless-2
    • packages/core/test/usageTips.test.ts: exit 1
  • Shard 4/4: passed in 705.0s on gitfix-rootless-3
View shard 3/4 output
...(truncated)

sueJob uses modelName from job data
      ---
      duration_ms: 0.428284
      type: 'test'
      ...
    # Subtest: processGitHubIssueJob handles missing modelName gracefully
    ok 2 - processGitHubIssueJob handles missing modelName gracefully
      ---
      duration_ms: 0.250332
      type: 'test'
      ...
    1..2
ok 3 - Worker - Model-Specific Job Processing
  ---
  duration_ms: 1.04504
  type: 'suite'
  ...
# Subtest: Worker - Concurrent Execution Prevention
    # Subtest: different models get different delay times
    ok 1 - different models get different delay times
      ---
      duration_ms: 0.430934
      type: 'test'
      ...
    # Subtest: concurrent job simulation shows different timings
    ok 2 - concurrent job simulation shows different timings
      ---
      duration_ms: 126.303898
      type: 'test'
      ...
    1..2
ok 4 - Worker - Concurrent Execution Prevention
  ---
  duration_ms: 127.040524
  type: 'suite'
  ...
1..4
# tests 11
# suites 4
# pass 11
# fail 0
# cancelled 0
# skipped 0
# todo 0
# duration_ms 1255.648438
[167/171] passed test/worker.modelSpecific.test.ts in 1.6s

[168/171] test/workerStateManager.test.ts
TAP version 13
# (node:1950920) ExperimentalWarning: Module mocking is an experimental feature and might change at any time
# (Use `node --trace-warnings ...` to show where the warning was created)
# Subtest: createTaskState creates state with correct structure
ok 1 - createTaskState creates state with correct structure
  ---
  duration_ms: 4.097458
  type: 'test'
  ...
# Subtest: createTaskState stores state in Redis with TTL
ok 2 - createTaskState stores state in Redis with TTL
  ---
  duration_ms: 0.450714
  type: 'test'
  ...
# Subtest: createTaskState uses default TTL when not specified
ok 3 - createTaskState uses default TTL when not specified
  ---
  duration_ms: 0.336633
  type: 'test'
  ...
# Subtest: createTaskState inserts task into database
ok 4 - createTaskState inserts task into database
  ---
  duration_ms: 0.362774
  type: 'test'
  ...
# Subtest: createTaskState generates correlation ID when not provided
ok 5 - createTaskState generates correlation ID when not provided
  ---
  duration_ms: 0.337254
  type: 'test'
  ...
# Subtest: createTaskState publishes real-time event
ok 6 - createTaskState publishes real-time event
  ---
  duration_ms: 0.373514
  type: 'test'
  ...
# Subtest: createTaskState handles missing optional issueRef fields
ok 7 - createTaskState handles missing optional issueRef fields
  ---
  duration_ms: 0.348963
  type: 'test'
  ...
# Subtest: createTaskState sets correct initial history entry
ok 8 - createTaskState sets correct initial history entry
  ---
  duration_ms: 0.374693
  type: 'test'
  ...
# Subtest: createTaskState handles database error gracefully
ok 9 - createTaskState handles database error gracefully
  ---
  duration_ms: 0.794447
  type: 'test'
  ...
# Subtest: createTaskState generates unique task keys
ok 10 - createTaskState generates unique task keys
  ---
  duration_ms: 0.906439
  type: 'test'
  ...
# Subtest: createTaskState stores valid JSON in Redis
ok 11 - createTaskState stores valid JSON in Redis
  ---
  duration_ms: 0.524554
  type: 'test'
  ...
# Subtest: createTaskState uses correct repository format in database
ok 12 - createTaskState uses correct repository format in database
  ---
  duration_ms: 0.306013
  type: 'test'
  ...
# Subtest: createTaskStateIfAbsent preserves a state that became processing before the atomic create
ok 13 - createTaskStateIfAbsent preserves a state that became processing before the atomic create
  ---
  duration_ms: 1.244342
  type: 'test'
  ...
# Subtest: updateTaskState throws when task not found
ok 14 - updateTaskState throws when task not found
  ---
  duration_ms: 0.860898
  type: 'test'
  ...
# Subtest: updateTaskState transitions state and appends to history
ok 15 - updateTaskState transitions state and appends to history
  ---
  duration_ms: 1.05473
  type: 'test'
  ...
# Subtest: updateTaskState publishes real-time event
ok 16 - updateTaskState publishes real-time event
  ---
  duration_ms: 0.508634
  type: 'test'
  ...
# Subtest: updateTaskState increments attempts on retry
ok 17 - updateTaskState increments attempts on retry
  ---
  duration_ms: 0.548665
  type: 'test'
  ...
# Subtest: updateTaskState does not increment attempts when not a retry
ok 18 - updateTaskState does not increment attempts when not a retry
  ---
  duration_ms: 0.500475
  type: 'test'
  ...
# Subtest: updateTaskState stores error metadata
ok 19 - updateTaskState stores error metadata
  ---
  duration_ms: 0.520195
  type: 'test'
  ...
# Subtest: updateTaskState uses default error category when not specified
ok 20 - updateTaskState uses default error category when not specified
  ---
  duration_ms: 0.454274
  type: 'test'
  ...
# Subtest: updateTaskState stores worktreeInfo metadata
ok 21 - updateTaskState stores worktreeInfo metadata
  ---
  duration_ms: 6.813894
  type: 'test'
  ...
# Subtest: updateTaskState stores claudeResult metadata
ok 22 - updateTaskState stores claudeResult metadata
  ---
  duration_ms: 0.584525
  type: 'test'
  ...
# Subtest: updateTaskState stores prResult metadata
ok 23 - updateTaskState stores prResult metadata
  ---
  duration_ms: 0.714206
  type: 'test'
  ...
# Subtest: updateTaskState persists to Redis with TTL renewal
ok 24 - updateTaskState persists to Redis with TTL renewal
  ---
  duration_ms: 0.548625
  type: 'test'
  ...
# Subtest: updateTaskState inserts history record into database
ok 25 - updateTaskState inserts history record into database
  ---
  duration_ms: 0.475604
  type: 'test'
  ...
# Subtest: updateTaskState uses default reason when not provided
ok 26 - updateTaskState uses default reason when not provided
  ---
  duration_ms: 0.372013
  type: 'test'
  ...
# Subtest: updateTaskState stores historyMetadata in history entry
ok 27 - updateTaskState stores historyMetadata in history entry
  ---
  duration_ms: 0.401443
  type: 'test'
  ...
# Subtest: updateTaskState handles database error gracefully
ok 28 - updateTaskState handles database error gracefully
  ---
  duration_ms: 0.451324
  type: 'test'
  ...
# Subtest: updateTaskState includes commitHash in database metadata
ok 29 - updateTaskState includes commitHash in database metadata
  ---
  duration_ms: 0.448784
  type: 'test'
  ...
# Subtest: markTaskFailed sets state to FAILED
ok 30 - markTaskFailed sets state to FAILED
  ---
  duration_ms: 0.490984
  type: 'test'
  ...
# Subtest: markTaskFailed stores error message in lastError
ok 31 - markTaskFailed stores error message in lastError
  ---
  duration_ms: 0.606336
  type: 'test'
  ...
# Subtest: markTaskFailed defaults errorCategory to unknown when not specified
ok 32 - markTaskFailed defaults errorCategory to unknown when not specified
  ---
  duration_ms: 0.467105
  type: 'test'
  ...
# Subtest: markTaskFailed uses provided errorCategory from metadata
ok 33 - markTaskFailed uses provided errorCategory from metadata
  ---
  duration_ms: 0.449094
  type: 'test'
  ...
# Subtest: markTaskFailed sets appropriate failure reason
ok 34 - markTaskFailed sets appropriate failure reason
  ---
  duration_ms: 0.440394
  type: 'test'
  ...
# Subtest: markTaskFailed appends failure to history
ok 35 - markTaskFailed appends failure to history
  ---
  duration_ms: 0.474364
  type: 'test'
  ...
# Subtest: markTaskFailed preserves additional metadata
ok 36 - markTaskFailed preserves additional metadata
  ---
  duration_ms: 0.523355
  type: 'test'
  ...
# Subtest: markTaskFailed publishes real-time event
ok 37 - markTaskFailed publishes real-time event
  ---
  duration_ms: 0.465634
  type: 'test'
  ...
# Subtest: markTaskFailed persists failure to Redis
ok 38 - markTaskFailed persists failure to Redis
  ---
  duration_ms: 0.521875
  type: 'test'
  ...
# Subtest: markTaskFailed inserts failure record into database
ok 39 - markTaskFailed inserts failure record into database
  ---
  duration_ms: 1.843187
  type: 'test'
  ...
# Subtest: markTaskFailed throws when task not found
ok 40 - markTaskFailed throws when task not found
  ---
  duration_ms: 0.338684
  type: 'test'
  ...
# Subtest: markTaskFailed handles different error categories
ok 41 - markTaskFailed handles different error categories
  ---
  duration_ms: 1.422423
  type: 'test'
  ...
# Subtest: markTaskFailed updates timestamp in lastError
ok 42 - markTaskFailed updates timestamp in lastError
  ---
  duration_ms: 0.487604
  type: 'test'
  ...
# Subtest: getResumableTask returns null when task not found
ok 43 - getResumableTask returns null when task not found
  ---
  duration_ms: 0.268103
  type: 'test'
  ...
# Subtest: getResumableTask returns null for COMPLETED state
ok 44 - getResumableTask returns null for COMPLETED state
  ---
  duration_ms: 0.277663
  type: 'test'
  ...
# Subtest: getResumableTask returns null for PENDING state
ok 45 - getResumableTask returns null for PENDING state
  ---
  duration_ms: 0.261603
  type: 'test'
  ...
# Subtest: getResumableTask returns null for FAILED state
ok 46 - getResumableTask returns null for FAILED state
  ---
  duration_ms: 3.18039
  type: 'test'
  ...
# Subtest: getResumableTask returns null for CANCELLED state
ok 47 - getResumableTask returns null for CANCELLED state
  ---
  duration_ms: 0.359653
  type: 'test'
  ...
# Subtest: getResumableTask returns task in PROCESSING state for recovery
ok 48 - getResumableTask returns task in PROCESSING state for recovery
  ---
  duration_ms: 0.292932
  type: 'test'
  ...
# Subtest: getResumableTask returns task in CLAUDE_EXECUTION state
ok 49 - getResumableTask returns task in CLAUDE_EXECUTION state
  ---
  duration_ms: 0.264662
  type: 'test'
  ...
# Subtest: getResumableTask returns task in POST_PROCESSING state
ok 50 - getResumableTask returns task in POST_PROCESSING state
  ---
  duration_ms: 0.274693
  type: 'test'
  ...
# Subtest: getResumableTask marks task as stale if updated more than 30 minutes ago
ok 51 - getResumableTask marks task as stale if updated more than 30 minutes ago
  ---
  duration_ms: 0.353313
  type: 'test'
  ...
# Subtest: getResumableTask returns isStale=false for recently updated tasks
ok 52 - getResumableTask returns isStale=false for recently updated tasks
  ---
  duration_ms: 0.309853
  type: 'test'
  ...
# Subtest: getResumableTask logs warning for stale tasks
ok 53 - getResumableTask logs warning for stale tasks
  ---
  duration_ms: 3.871377
  type: 'test'
  ...
# Subtest: getResumableTask returns correct staleDuration for stale tasks
ok 54 - getResumableTask returns correct staleDuration for stale tasks
  ---
  duration_ms: 0.496635
  type: 'test'
  ...
# Subtest: getResumableTask does not return staleDuration for non-stale tasks
ok 55 - getResumableTask does not return staleDuration for non-stale tasks
  ---
  duration_ms: 0.285753
  type: 'test'
  ...
# Subtest: getResumableTask preserves all task state data
ok 56 - getResumableTask preserves all task state data
  ---
  duration_ms: 0.334783
  type: 'test'
  ...
# Subtest: getResumableTask handles task at exactly 30 minute threshold
ok 57 - getResumableTask handles task at exactly 30 minute threshold
  ---
  duration_ms: 0.249202
  type: 'test'
  ...
# Subtest: getResumableTask does not log warning for non-stale tasks
ok 58 - getResumableTask does not log warning for non-stale tasks
  ---
  duration_ms: 0.229062
  type: 'test'
  ...
# Subtest: cleanupOldTasks removes tasks older than maxAge
ok 59 - cleanupOldTasks removes tasks older than maxAge
  ---
  duration_ms: 0.467434
  type: 'test'
  ...
# Subtest: cleanupOldTasks skips tasks within maxAge
ok 60 - cleanupOldTasks skips tasks within maxAge
  ---
  duration_ms: 0.281293
  type: 'test'
  ...
# Subtest: cleanupOldTasks skips PROCESSING state tasks even if old
ok 61 - cleanupOldTasks skips PROCESSING state tasks even if old
  ---
  duration_ms: 0.277583
  type: 'test'
  ...
# Subtest: cleanupOldTasks skips PENDING state tasks even if old
ok 62 - cleanupOldTasks skips PENDING state tasks even if old
  ---
  duration_ms: 0.272013
  type: 'test'
  ...
# Subtest: cleanupOldTasks skips CLAUDE_EXECUTION state tasks even if old
ok 63 - cleanupOldTasks skips CLAUDE_EXECUTION state tasks even if old
  ---
  duration_ms: 0.272142
  type: 'test'
  ...
# Subtest: cleanupOldTasks skips POST_PROCESSING state tasks even if old
ok 64 - cleanupOldTasks skips POST_PROCESSING state tasks even if old
  ---
  duration_ms: 0.433514
  type: 'test'
  ...
# Subtest: cleanupOldTasks removes old FAILED tasks
ok 65 - cleanupOldTasks removes old FAILED tasks
  ---
  duration_ms: 0.359403
  type: 'test'
  ...
# Subtest: cleanupOldTasks removes old CANCELLED tasks
ok 66 - cleanupOldTasks removes old CANCELLED tasks
  ---
  duration_ms: 0.310723
  type: 'test'
  ...
# Subtest: cleanupOldTasks handles corrupted JSON gracefully
ok 67 - cleanupOldTasks handles corrupted JSON gracefully
  ---
  duration_ms: 0.300553
  type: 'test'
  ...
# Subtest: cleanupOldTasks uses custom maxAge parameter
ok 68 - cleanupOldTasks uses custom maxAge parameter
  ---
  duration_ms: 0.289303
  type: 'test'
  ...
# Subtest: cleanupOldTasks skips task when maxAge is longer than task age
ok 69 - cleanupOldTasks skips task when maxAge is longer than task age
  ---
  duration_ms: 0.265582
  type: 'test'
  ...
# Subtest: cleanupOldTasks handles multiple tasks with mixed states and ages
ok 70 - cleanupOldTasks handles multiple tasks with mixed states and ages
  ---
  duration_ms: 2.432923
  type: 'test'
  ...
# Subtest: cleanupOldTasks returns 0 when no keys exist
ok 71 - cleanupOldTasks returns 0 when no keys exist
  ---
  duration_ms: 0.370524
  type: 'test'
  ...
# Subtest: cleanupOldTasks skips keys with null values
ok 72 - cleanupOldTasks skips keys with null values
  ---
  duration_ms: 0.243812
  type: 'test'
  ...
# Subtest: cleanupOldTasks logs debug message for each cleaned task
ok 73 - cleanupOldTasks logs debug message for each cleaned task
  ---
  duration_ms: 0.319553
  type: 'test'
  ...
# Subtest: cleanupOldTasks logs info message with summary
ok 74 - cleanupOldTasks logs info message with summary
  ---
  duration_ms: 0.260542
  type: 'test'
  ...
# Subtest: cleanupOldTasks uses key prefix pattern for searching
ok 75 - cleanupOldTasks uses key prefix pattern for searching
  ---
  duration_ms: 0.193832
  type: 'test'
  ...
# Subtest: cleanupOldTasks handles Redis errors during delete gracefully
ok 76 - cleanupOldTasks handles Redis errors during delete gracefully
  ---
  duration_ms: 0.372024
  type: 'test'
  ...
# Subtest: cleanupOldTasks determines age based on updatedAt not createdAt
ok 77 - cleanupOldTasks determines age based on updatedAt not createdAt
  ---
  duration_ms: 0.335103
  type: 'test'
  ...
# Subtest: cleanupOldTasks handles task at exactly maxAge boundary
ok 78 - cleanupOldTasks handles task at exactly maxAge boundary
  ---
  duration_ms: 0.267802
  type: 'test'
  ...
# Subtest: updateTaskStateIfCurrent atomically updates a matching task snapshot
ok 79 - updateTaskStateIfCurrent atomically updates a matching task snapshot
  ---
  duration_ms: 0.692277
  type: 'test'
  ...
# Subtest: updateTaskStateIfCurrent does not publish a lost compare-and-set race
ok 80 - updateTaskStateIfCurrent does not publish a lost compare-and-set race
  ---
  duration_ms: 0.409894
  type: 'test'
  ...
# Subtest: stale metadata updates retry without resurrecting a finalized task
ok 81 - stale metadata updates retry without resurrecting a finalized task
  ---
  duration_ms: 103.667655
  type: 'test'
  ...
# Subtest: ordinary state writers cannot move a terminal task back to processing
ok 82 - ordinary state writers cannot move a terminal task back to processing
  ---
  duration_ms: 0.589486
  type: 'test'
  ...
# Subtest: a retry writer that loses to cancellation cannot resurrect the task
ok 83 - a retry writer that loses to cancellation cannot resurrect the task
  ---
  duration_ms: 10.758761
  type: 'test'
  ...
# Subtest: terminal reasons persist in Redis, history, and task update events
ok 84 - terminal reasons persist in Redis, history, and task update events
  ---
  duration_ms: 1.903468
  type: 'test'
  ...
# Subtest: transport timeout errors do not claim the agent exceeded its overall time limit
ok 85 - transport timeout errors do not claim the agent exceeded its overall time limit
  ---
  duration_ms: 6.033987
  type: 'test'
  ...
# Subtest: requeued bookkeeping cancellation can resume the original task without losing its correlation
ok 86 - requeued bookkeeping cancellation can resume the original task without losing its correlation
  ---
  duration_ms: 0.758547
  type: 'test'
  ...
# Subtest: rescheduled bookkeeping cancellation can resume the original task without losing its correlation
ok 87 - rescheduled bookkeeping cancellation can resume the original task without losing its correlation
  ---
  duration_ms: 0.286902
  type: 'test'
  ...
# Subtest: closure cancellation losing a CAS race to a published PR result preserves successful post-processing
ok 88 - closure cancellation losing a CAS race to a published PR result preserves successful post-processing
  ---
  duration_ms: 12.7867
  type: 'test'
  ...
# Subtest: closure cancellation accepts a retried task with no PR: {"status":"failed","prCreated":false}
ok 89 - closure cancellation accepts a retried task with no PR: {"status":"failed","prCreated":false}
  ---
  duration_ms: 0.982719
  type: 'test'
  ...
# Subtest: closure cancellation accepts a retried task with no PR: {"status":"failed"}
ok 90 - closure cancellation accepts a retried task with no PR: {"status":"failed"}
  ---
  duration_ms: 0.467305
  type: 'test'
  ...
# Subtest: closure cancellation accepts a retried task with no PR: {}
ok 91 - closure cancellation accepts a retried task with no PR: {}
  ---
  duration_ms: 0.353943
  type: 'test'
  ...
# Subtest: a failed task records withdrawal only when its live queued retry was removed
ok 92 - a failed task records withdrawal only when its live queued retry was removed
  ---
  duration_ms: 0.810798
  type: 'test'
  ...
1..92
# tests 92
# suites 0
# pass 92
# fail 0
# cancelled 0
# skipped 0
# todo 0
# duration_ms 951.436616
[168/171] passed test/workerStateManager.test.ts in 1.2s

[169/171] test/workEvidenceMarker.test.ts
TAP version 13
# Subtest: work evidence marker
    # Subtest: builds stable, deduplicated evidence independent of visible comment copy
    ok 1 - builds stable, deduplicated evidence independent of visible comment copy
      ---
      duration_ms: 0.873608
      type: 'test'
      ...
    # Subtest: drops synthetic and invalid comment IDs
    ok 2 - drops synthetic and invalid comment IDs
      ---
      duration_ms: 0.178251
      type: 'test'
      ...
    1..2
ok 1 - work evidence marker
  ---
  duration_ms: 2.276021
  type: 'suite'
  ...
1..1
# tests 2
# suites 1
# pass 2
# fail 0
# cancelled 0
# skipped 0
# todo 0
# duration_ms 658.071967
[169/171] passed test/workEvidenceMarker.test.ts in 0.9s

[170/171] test/worktreeLifecycle.integration.test.ts
TAP version 13
# Subtest: Worktree Lifecycle Integration Tests
    # Subtest: Worktree Structure Creation
        # Subtest: creates worktree with proper directory structure
        ok 1 - creates worktree with proper directory structure
          ---
          duration_ms: 293.490258
          type: 'test'
          ...
        # Subtest: .git file exists in worktree (not a directory)
        ok 2 - .git file exists in worktree (not a directory)
          ---
          duration_ms: 347.659508
          type: 'test'
          ...
        # Subtest: .git file contains valid gitdir reference
        ok 3 - .git file contains valid gitdir reference
          ---
          duration_ms: 260.61115
          type: 'test'
          ...
        # Subtest: worktree creates unique directories for different issues
        ok 4 - worktree creates unique directories for different issues
          ---
          duration_ms: 295.240755
          type: 'test'
          ...
        # Subtest: worktree includes model suffix when model name provided
        ok 5 - worktree includes model suffix when model name provided
          ---
          duration_ms: 279.212724
          type: 'test'
          ...
        1..5
    ok 1 - Worktree Structure Creation
      ---
      duration_ms: 1477.975541
      type: 'suite'
      ...
    # Subtest: Checkout Conflict Handling
        # Subtest: handles creating worktree when branch already exists locally
        ok 1 - handles creating worktree when branch already exists locally
          ---
          duration_ms: 314.025681
          type: 'test'
          ...
        # Subtest: handles creating worktree when directory already exists
        ok 2 - handles creating worktree when directory already exists
          ---
          duration_ms: 250.437393
          type: 'test'
          ...
        # Subtest: concurrent worktree creation for same issue with different models
        ok 3 - concurrent worktree creation for same issue with different models
          ---
          duration_ms: 317.707596
          type: 'test'
          ...
        # Subtest: worktree branch points to correct HEAD
        ok 4 - worktree branch points to correct HEAD
          ---
          duration_ms: 273.149307
          type: 'test'
          ...
        1..4
    ok 2 - Checkout Conflict Handling
      ---
      duration_ms: 1156.178695
      type: 'suite'
      ...
    # Subtest: Worktree Cleanup
        # Subtest: worktree can be removed with git worktree remove
        ok 1 - worktree can be removed with git worktree remove
          ---
          duration_ms: 311.985251
          type: 'test'
          ...
        # Subtest: worktree directory can be cleaned via fs.remove
        ok 2 - worktree directory can be cleaned via fs.remove
          ---
          duration_ms: 261.508518
          type: 'test'
          ...
        # Subtest: associated branch can be deleted after worktree removal
        ok 3 - associated branch can be deleted after worktree removal
          ---
          duration_ms: 330.621236
          type: 'test'
          ...
        # Subtest: git worktree list reflects created and removed worktrees
        ok 4 - git worktree list reflects created and removed worktrees
          ---
          duration_ms: 330.94746
          type: 'test'
          ...
        1..4
    ok 3 - Worktree Cleanup
      ---
      duration_ms: 1235.63512
      type: 'suite'
      ...
    # Subtest: Edge Cases
        # Subtest: handles special characters in issue title
        ok 1 - handles special characters in issue title
          ---
          duration_ms: 241.728111
          type: 'test'
          ...
        # Subtest: handles very long issue titles
        ok 2 - handles very long issue titles
          ---
          duration_ms: 287.998185
          type: 'test'
          ...
        # Subtest: worktree metadata exists in main repo .git/worktrees
        ok 3 - worktree metadata exists in main repo .git/worktrees
          ---
          duration_ms: 286.139799
          type: 'test'
          ...
        1..3
    ok 4 - Edge Cases
      ---
      duration_ms: 816.329239
      type: 'suite'
      ...
    # Subtest: Worktree Cleanup with Retention Strategies
        # Subtest: keep_on_failure strategy creates retention marker when success is false
        ok 1 - keep_on_failure strategy creates retention marker when success is false
          ---
          duration_ms: 276.194064
          type: 'test'
          ...
        # Subtest: keep_on_failure strategy removes worktree when success is true
        ok 2 - keep_on_failure strategy removes worktree when success is true
          ---
          duration_ms: 322.923643
          type: 'test'
          ...
        # Subtest: always_delete strategy removes worktree regardless of success
        ok 3 - always_delete strategy removes worktree regardless of success
          ---
          duration_ms: 312.464416
          type: 'test'
          ...
        # Subtest: keep_for_hours strategy creates marker and then removes worktree
        ok 4 - keep_for_hours strategy creates marker and then removes worktree
          ---
          duration_ms: 326.366395
          type: 'test'
          ...
        # Subtest: retention marker contains correct scheduled cleanup time
        ok 5 - retention marker contains correct scheduled cleanup time
          ---
          duration_ms: 241.050674
          type: 'test'
          ...
        1..5
    ok 5 - Worktree Cleanup with Retention Strategies
      ---
      duration_ms: 1479.73118
      type: 'suite'
      ...
    # Subtest: Expired Worktree Cleanup
        # Subtest: cleanupExpiredWorktrees removes worktrees past scheduled cleanup time
        ok 1 - cleanupExpiredWorktrees removes worktrees past scheduled cleanup time
          ---
          duration_ms: 250.945167
          type: 'test'
          ...
        # Subtest: cleanupExpiredWorktrees retains worktrees before scheduled cleanup time
        ok 2 - cleanupExpiredWorktrees retains worktrees before scheduled cleanup time
          ---
          duration_ms: 251.593173
          type: 'test'
          ...
        # Subtest: cleanupExpiredWorktrees handles multiple worktrees with mixed expiration
        ok 3 - cleanupExpiredWorktrees handles multiple worktrees with mixed expiration
          ---
          duration_ms: 265.872607
          type: 'test'
          ...
        # Subtest: cleanupExpiredWorktrees handles non-existent base path gracefully
        ok 4 - cleanupExpiredWorktrees handles non-existent base path gracefully
          ---
          duration_ms: 206.511109
          type: 'test'
          ...
        # Subtest: cleanupExpiredWorktrees handles corrupted retention info gracefully
        ok 5 - cleanupExpiredWorktrees handles corrupted retention info gracefully
          ---
          duration_ms: 244.957401
          type: 'test'
          ...
        1..5
    ok 6 - Expired Worktree Cleanup
      ---
      duration_ms: 1220.490443
      type: 'suite'
      ...
    # Subtest: Safe Worktree Pruning
        # Subtest: detects and prunes stale metadata when worktree directory is missing
        ok 1 - detects and prunes stale metadata when worktree directory is missing
          ---
          duration_ms: 245.476985
          type: 'test'
          ...
        # Subtest: skips young stale entries that are below minimum age threshold
        ok 2 - skips young stale entries that are below minimum age threshold
          ---
          duration_ms: 264.415683
          type: 'test'
          ...
        # Subtest: handles non-existent .git/worktrees directory gracefully
        ok 3 - handles non-existent .git/worktrees directory gracefully
          ---
          duration_ms: 325.664308
          type: 'test'
          ...
        # Subtest: prunes entries without gitdir file when old enough
        ok 4 - prunes entries without gitdir file when old enough
          ---
          duration_ms: 231.594925
          type: 'test'
          ...
        # Subtest: skips entries without gitdir file when too young
        ok 5 - skips entries without gitdir file when too young
          ---
          duration_ms: 251.31061
          type: 'test'
          ...
        # Subtest: preserves valid worktree metadata for existing directories
        ok 6 - preserves valid worktree metadata for existing directories
          ---
          duration_ms: 248.329922
          type: 'test'
          ...
        # Subtest: handles mixed scenarios with valid, stale-old, and stale-young entries
        ok 7 - handles mixed scenarios with valid, stale-old, and stale-young entries
          ---
          duration_ms: 334.482211
          type: 'test'
          ...
        # Subtest: respects configurable minimum age threshold
        ok 8 - respects configurable minimum age threshold
          ---
          duration_ms: 244.587506
          type: 'test'
          ...
        1..8
    ok 7 - Safe Worktree Pruning
      ---
      duration_ms: 2146.762449
      type: 'suite'
      ...
    1..7
ok 1 - Worktree Lifecycle Integration Tests
  ---
  duration_ms: 9534.27945
  type: 'suite'
  ...
1..1
# tests 34
# suites 8
# pass 34
# fail 0
# cancelled 0
# skipped 0
# todo 0
# duration_ms 10091.260714
[170/171] passed test/worktreeLifecycle.integration.test.ts in 10.3s

[171/171] propr-ui#3/4 (workspace test script)

> [email protected] test
> vitest run --shard=3/4


�[1m�[30m�[46m RUN �[49m�[39m�[22m �[36mv5.0.0 �[39m�[90m/var/lib/propr-ci/worker2/work/propr/propr/propr-ui�[39m

 �[32m✓�[39m src/hooks/useRepositoryManagement.test.tsx �[2m(�[22m�[2m26 tests�[22m�[2m)�[22m�[33m 2722�[2mms�[22m�[39m
 �[32m✓�[39m src/components/Dashboard.test.tsx �[2m(�[22m�[2m23 tests�[22m�[2m)�[22m�[33m 3053�[2mms�[22m�[39m
   �[32m✓�[39m Dashboard �[2m(23)�[22m
     �[33m�[2m✓�[22m�[39m shows running goals beside tasks and links to the scoped goal list and goal details�[33m 610�[2mms�[22m�[39m
     �[33m�[2m✓�[22m�[39m filters completed work by title through the heading search box�[33m 444�[2mms�[22m�[39m
�[90mstderr�[2m | src/components/TaskPlanner/setupWizardHooks.test.tsx�[2m > �[22m�[2msetupWizardHooks branch resolution�[2m > �[22m�[2mclears the resolved base branch when branch lookup fails in new mode
�[22m�[39mFailed to load branches: Error: GitHub unavailable
    at �[90m/var/lib/propr-ci/worker2/work/propr/propr/propr-ui/�[39msrc/components/TaskPlanner/setupWizardHooks.test.tsx:246:43
    at file:///var/lib/propr-ci/worker2/work/propr/propr/node_modules/�[4mvitest�[24m/dist/chunks/run.CQOUYP-x.js:1628:35
    at file:///var/lib/propr-ci/worker2/work/propr/propr/node_modules/�[4mvitest�[24m/dist/chunks/run.CQOUYP-x.js:2783:26
    at file:///var/lib/propr-ci/worker2/work/propr/propr/node_modules/�[4mvitest�[24m/dist/chunks/run.CQOUYP-x.js:3319:20
    at new Promise (<anonymous>)
    at runWithCancel (file:///var/lib/propr-ci/worker2/work/propr/propr/node_modules/�[4mvitest�[24m/dist/chunks/run.CQOUYP-x.js:3314:10)
    at file:///var/lib/propr-ci/worker2/work/propr/propr/node_modules/�[4mvitest�[24m/dist/chunks/run.CQOUYP-x.js:3299:20
    at new Promise (<anonymous>)
    at runWithTimeout (file:///var/lib/propr-ci/worker2/work/propr/propr/node_modules/�[4mvitest�[24m/dist/chunks/run.CQOUYP-x.js:3257:10)
    at file:///var/lib/propr-ci/worker2/work/propr/propr/node_modules/�[4mvitest�[24m/dist/chunks/run.CQOUYP-x.js:3876:64

�[90mstderr�[2m | src/components/TaskPlanner/setupWizardHooks.test.tsx�[2m > �[22m�[2msetupWizardHooks branch resolution�[2m > �[22m�[2mcontinues generation when persisting the resolved baseBranch fails after draft creation
�[22m�[39mFailed to persist draft setup snapshot: Error: Transient update failure
    at �[90m/var/lib/propr-ci/worker2/work/propr/propr/propr-ui/�[39msrc/components/TaskPlanner/setupWizardHooks.test.tsx:323:97
    at file:///var/lib/propr-ci/worker2/work/propr/propr/node_modules/�[4mvitest�[24m/dist/chunks/run.CQOUYP-x.js:2763:52
    at runWithSuite (file:///var/lib/propr-ci/worker2/work/propr/propr/node_modules/�[4mvitest�[24m/dist/chunks/run.CQOUYP-x.js:3248:8)
    at Object.collect (file:///var/lib/propr-ci/worker2/work/propr/propr/node_modules/�[4mvitest�[24m/dist/chunks/run.CQOUYP-x.js:2763:22)
    at Object.collect (file:///var/lib/propr-ci/worker2/work/propr/propr/node_modules/�[4mvitest�[24m/dist/chunks/run.CQOUYP-x.js:2768:51)
�[90m    at processTicksAndRejections (node:internal/process/task_queues:103:5)�[39m
    at file:///var/lib/propr-ci/worker2/work/propr/propr/node_modules/�[4mvitest�[24m/dist/chunks/run.CQOUYP-x.js:3449:26
    at collectTests (file:///var/lib/propr-ci/worker2/work/propr/propr/node_modules/�[4mvitest�[24m/dist/chunks/run.CQOUYP-x.js:3422:3)
    at startTests (file:///var/lib/propr-ci/worker2/work/propr/propr/node_modules/�[4mvitest�[24m/dist/chunks/run.CQOUYP-x.js:4156:17)
    at file:///var/lib/propr-ci/worker2/work/propr/propr/node_modules/�[4mvitest�[24m/dist/chunks/base.BTS5G301.js:90:6

�[90mstderr�[2m | src/components/TaskPlanner/setupWizardHooks.test.tsx�[2m > �[22m�[2msetupWizardHooks branch resolution�[2m > �[22m�[2mpersists editable draft settings to context_config after debounce
�[22m�[39mFailed to persist draft settings: Error: Transient update failure
    at �[90m/var/lib/propr-ci/worker2/work/propr/propr/propr-ui/�[39msrc/components/TaskPlanner/setupWizardHooks.test.tsx:323:97
    at file:///var/lib/propr-ci/worker2/work/propr/propr/node_modules/�[4mvitest�[24m/dist/chunks/run.CQOUYP-x.js:2763:52
    at runWithSuite (file:///var/lib/propr-ci/worker2/work/propr/propr/node_modules/�[4mvitest�[24m/dist/chunks/run.CQOUYP-x.js:3248:8)
    at Object.collect (file:///var/lib/propr-ci/worker2/work/propr/propr/node_modules/�[4mvitest�[24m/dist/chunks/run.CQOUYP-x.js:2763:22)
    at Object.collect (file:///var/lib/propr-ci/worker2/work/propr/propr/node_modules/�[4mvitest�[24m/dist/chunks/run.CQOUYP-x.js:2768:51)
�[90m    at processTicksAndRejections (node:internal/process/task_queues:103:5)�[39m
    at file:///var/lib/propr-ci/worker2/work/propr/propr/node_modules/�[4mvitest�[24m/dist/chunks/run.CQOUYP-x.js:3449:26
    at collectTests (file:///var/lib/propr-ci/worker2/work/propr/propr/node_modules/�[4mvitest�[24m/dist/chunks/run.CQOUYP-x.js:3422:3)
    at startTests (file:///var/lib/propr-ci/worker2/work/propr/propr/node_modules/�[4mvitest�[24m/dist/chunks/run.CQOUYP-x.js:4156:17)
    at file:///var/lib/propr-ci/worker2/work/propr/propr/node_modules/�[4mvitest�[24m/dist/chunks/base.BTS5G301.js:90:6

 �[32m✓�[39m src/components/TaskPlanner/setupWizardHooks.test.tsx �[2m(�[22m�[2m24 tests�[22m�[2m)�[22m�[33m 429�[2mms�[22m�[39m
�[90mstderr�[2m | src/desktop/LocalSetupWizard.integration.test.tsx�[2m > �[22m�[2mproduction local setup journey�[2m > �[22m�[2mshows the authenticated identity, installation types, and explicit recovery controls
�[22m�[39mAn update to LocalSetupWizard inside a test was not wrapped in act(...).

When testing, code that causes React state updates should be wrapped into act(...):

act(() => {
  /* fire events that update state */
});
/* assert on the output */

This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act
An update to LocalSetupWizard inside a test was not wrapped in act(...).

When testing, code that causes React state updates should be wrapped into act(...):

act(() => {
  /* fire events that update state */
});
/* assert on the output */

This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act

 �[32m✓�[39m src/desktop/electronAdapters.test.ts �[2m(�[22m�[2m18 tests�[22m�[2m)�[22m�[32m 252�[2mms�[22m�[39m
�[90mstderr�[2m | src/desktop/LocalSetupWizard.integration.test.tsx�[2m > �[22m�[2mproduction local setup journey�[2m > �[22m�[2mhands completion into pairing, authenticated reprobe, and the current dashboard flow
�[22m�[39mAn update to LocalSetupWizard inside a test was not wrapped in act(...).

When testing, code that causes React state updates should be wrapped into act(...):

act(() => {
  /* fire events that update state */
});
/* assert on the output */

This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act
An update to LocalSetupWizard inside a test was not wrapped in act(...).

When testing, code that causes React state updates should be wrapped into act(...):

act(() => {
  /* fire events that update state */
});
/* assert on the output */

This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act

�[90mstderr�[2m | src/desktop/LocalSetupWizard.integration.test.tsx�[2m > �[22m�[2mproduction local setup journey�[2m > �[22m�[2mrequires a supported choice when a legacy saved setup used Demo mode
�[22m�[39mAn update to LocalSetupWizard inside a test was not wrapped in act(...).

When testing, code that causes React state updates should be wrapped into act(...):

act(() => {
  /* fire events that update state */
});
/* assert on the output */

This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act
An update to LocalSetupWizard inside a test was not wrapped in act(...).

When testing, code that causes React state updates should be wrapped into act(...):

act(() => {
  /* fire events that update state */
});
/* assert on the output */

This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act

�[90mstderr�[2m | src/desktop/LocalSetupWizard.integration.test.tsx�[2m > �[22m�[2mproduction local setup journey�[2m > �[22m�[2mshows and confirms corrected WebSocket intake for stale ProPR Connect recovery
�[22m�[39mAn update to LocalSetupWizard inside a test was not wrapped in act(...).

When testing, code that causes React state updates should be wrapped into act(...):

act(() => {
  /* fire events that update state */
});
/* assert on the output */

This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act
An update to LocalSetupWizard inside a test was not wrapped in act(...).

When testing, code that causes React state updates should be wrapped into act(...):

act(() => {
  /* fire events that update state */
});
/* assert on the output */

This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act

 �[32m✓�[39m src/desktop/LocalSetupWizard.integration.test.tsx �[2m(�[22m�[2m19 tests�[22m�[2m)�[22m�[33m 2851�[2mms�[22m�[39m
   �[32m✓�[39m production local setup journey �[2m(19)�[22m
     �[33m�[2m✓�[22m�[39m shows the authenticated identity, installation types, and explicit recovery controls�[33m 589�[2mms�[22m�[39m
�[90mstdout�[2m | src/components/TaskDetails/useTaskData.test.ts�[2m > �[22m�[2mtask detail history refreshes�[2m > �[22m�[2mturns the fixture baseline of three burst invalidations into one additional history request
�[22m�[39m[useTaskData] Received task update via WebSocket: { taskId: �[32m'task-1'�[39m, state: �[32m'processing'�[39m }
[useTaskData] Received task update via WebSocket: { taskId: �[32m'task-1'�[39m, state: �[32m'processing'�[39m }
[useTaskData] Received task update via WebSocket: { taskId: �[32m'task-1'�[39m, state: �[32m'processing'�[39m }

 �[32m✓�[39m src/components/TaskDetails/useTaskData.test.ts �[2m(�[22m�[2m23 tests�[22m�[2m)�[22m�[32m 166�[2mms�[22m�[39m
 �[32m✓�[39m src/components/TaskPlanner/setupWizardHooks.persistence.test.tsx �[2m(�[22m�[2m10 tests�[22m�[2m)�[22m�[32m 84�[2mms�[22m�[39m
 �[32m✓�[39m src/components/ConnectPlusBanner.test.tsx �[2m(�[22m�[2m19 tests�[22m�[2m)�[22m�[33m 2422�[2mms�[22m�[39m
   �[32m✓�[39m Connect Plus banners �[2m(19)�[22m
     �[33m�[2m✓�[22m�[39m shows the compact Dashboard promotion only to an authorized Community admin�[33m 351�[2mms�[22m�[39m
     �[33m�[2m✓�[22m�[39m invalidates a dismissal after an A to B to A capacity transition�[33m 324�[2mms�[22m�[39m
     �[33m�[2m✓�[22m�[39m invalidates a dismissal after a non-capacity state�[33m 327�[2mms�[22m�[39m
 �[32m✓�[39m src/components/TaskDetails/ExecutionEventLog.test.tsx �[2m(�[22m�[2m20 tests�[22m�[2m)�[22m�[33m 853�[2mms�[22m�[39m
 �[32m✓�[39m src/pages/McpLogsPage.test.tsx �[2m(�[22m�[2m15 tests�[22m�[2m)�[22m�[33m 2162�[2mms�[22m�[39m
   �[32m✓�[39m McpLogsPage �[2m(15)�[22m
     �[33m�[2m✓�[22m�[39m renders the newest-first table and the window summary�[33m 499�[2mms�[22m�[39m
 �[32m✓�[39m src/components/Dashboard/DashboardSummary.test.tsx �[2m(�[22m�[2m14 tests�[22m�[2m)�[22m�[33m 828�[2mms�[22m�[39m
   �[32m✓�[39m dashboard narrative �[2m(14)�[22m
     �[33m�[2m✓�[22m�[39m ticks freshness without requests and retains its age after failures or while paused�[33m 435�[2mms�[22m�[39m
 �[32m✓�[39m src/components/AgentTankSidebar.test.tsx �[2m(�[22m�[2m15 tests�[22m�[2m)�[22m�[33m 1351�[2mms�[22m�[39m
   �[32m✓�[39m AgentTankSidebar Claude metrics �[2m(2)�[22m
     �[33m�[2m✓�[22m�[39m renders the Fable weekly quota alongside Session, Weekly and Sonnet�[33m 346�[2mms�[22m�[39m
�[90mstderr�[2m | src/pages/SettingsPage/AgentsListSection.test.tsx�[2m > �[22m�[2mAgentsListSection web login�[2m > �[22m�[2mfolds legacy models within each provider until requested
�[22m�[39mAn update to AgentsListSection inside a test was not wrapped in act(...).

When testing, code that causes React state updates should be wrapped into act(...):

act(() => {
  /* fire events that update state */
});
/* assert on the output */

This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act

�[90mstderr�[2m | src/pages/SettingsPage/AgentsListSection.test.tsx�[2m > �[22m�[2mAgentsListSection web login�[2m > �[22m�[2mshows Sonnet 5.5 as current and folds older Sonnet models
�[22m�[39mAn update to AgentsListSection inside a test was not wrapped in act(...).

When testing, code that causes React state updates should be wrapped into act(...):

act(() => {
  /* fire events that update state */
});
/* assert on the output */

This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act

�[90mstderr�[2m | src/pages/SettingsPage/AgentsListSection.test.tsx�[2m > �[22m�[2mAgentsListSection web login�[2m > �[22m�[2moffers login for supported agents and opens their dialog
�[22m�[39mAn update to AgentsListSection inside a test was not wrapped in act(...).

When testing, code that causes React state updates should be wrapped into act(...):

act(() => {
  /* fire events that update state */
});
/* assert on the output */

This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act
An update to AgentsListSection inside a test was not wrapped in act(...).

When testing, code that causes React state updates should be wrapped into act(...):

act(() => {
  /* fire events that update state */
});
/* assert on the output */

This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act

 �[32m✓�[39m src/pages/SettingsPage/AgentsListSection.test.tsx �[2m(�[22m�[2m11 tests�[22m�[2m)�[22m�[33m 1885�[2mms�[22m�[39m
   �[32m✓�[39m AgentsListSection web login �[2m(5)�[22m
     �[33m�[2m✓�[22m�[39m folds legacy models within each provider until requested�[33m 605�[2mms�[22m�[39m
     �[33m�[2m✓�[22m�[39m saves a newly managed agent before opening its login dialog�[33m 305�[2mms�[22m�[39m
�[90mstdout�[2m | src/hooks/useDraft.test.tsx�[2m > �[22m�[2museDraft�[2m > �[22m�[2mapplies generation socket snapshots without refetching the draft
�[22m�[39m[useDraft] Received draft update via WebSocket: {
  eventType: �[32m'draft:update'�[39m,
  draftId: �[32m'draft-1'�[39m,
  step: �[32m'context'�[39m,
  status: �[32m'in_progress'�[39m,
  timestamp: �[32m'2026-05-05T00:00:05Z'�[39m,
  draftStatus: �[32m'generating'�[39m,
  generationTrace: { steps: [ �[36m[Object]�[39m, �[36m[Object]�[39m ] }
}

�[90mstdout�[2m | src/hooks/useDraft.test.tsx�[2m > �[22m�[2museDraft�[2m > �[22m�[2mresyncs once when a socket event reports a terminal draft status
�[22m�[39m[useDraft] Received draft update via WebSocket: {
  eventType: �[32m'draft:update'�[39m,
  draftId: �[32m'draft-1'�[39m,
  step: �[32m'llm'�[39m,
  status: �[32m'completed'�[39m,
  timestamp: �[32m'2026-05-05T00:00:10Z'�[39m,
  draftStatus: �[32m'review'�[39m,
  generationTrace: { steps: [ �[36m[Object]�[39m, �[36m[Object]�[39m, �[36m[Object]�[39m ] }
}

�[90mstdout�[2m | src/hooks/useDraft.test.tsx�[2m > �[22m�[2museDraft�[2m > �[22m�[2minstalls the next run ID before accepting its first socket snapshot
�[22m�[39m[useDraft] Received draft update via WebSocket: {
  eventType: �[32m'draft:update'�[39m,
  draftId: �[32m'draft-1'�[39m,
  runId: �[32m'generation-run-2'�[39m,
  step: �[32m'context'�[39m,
  status: �[32m'in_progress'�[39m,
  timestamp: �[32m'2026-05-05T00:00:10Z'�[39m,
  draftStatus: �[32m'generating'�[39m,
  generationTrace: { runId: �[32m'generation-run-2'�[39m, steps: [ �[36m[Object]�[39m ] }
}

�[90mstdout�[2m | src/hooks/useDraft.test.tsx�[2m > �[22m�[2museDraft�[2m > �[22m�[2mapplies terminal draft status from the socket before the follow-up fetch resolves
�[22m�[39m[useDraft] Received draft update via WebSocket: {
  eventType: �[32m'draft:update'�[39m,
  draftId: �[32m'draft-1'�[39m,
  step: �[32m'complete'�[39m,
  status: �[32m'completed'�[39m,
  timestamp: �[32m'2026-05-05T00:00:10Z'�[39m,
  draftStatus: �[32m'review'�[39m,
  generationTrace: { steps: [ �[36m[Object]�[39m, �[36m[Object]�[39m, �[36m[Object]�[39m ] }
}

 �[32m✓�[39m src/hooks/useDraft.test.tsx �[2m(�[22m�[2m6 tests�[22m�[2m)�[22m�[33m 327�[2mms�[22m�[39m
 �[32m✓�[39m src/pages/SettingsPage/DesktopNotificationSettingsSection.test.tsx �[2m(�[22m�[2m8 tests�[22m�[2m)�[22m�[33m 972�[2mms�[22m�[39m
   �[32m✓�[39m Desktop notification settings �[2m(8)�[22m
     �[33m�[2m✓�[22m�[39m shows an independent section with quiet defaults and explicit enrollment�[33m 390�[2mms�[22m�[39m
 �[32m✓�[39m src/components/TaskDetails/index.embedded.test.tsx �[2m(�[22m�[2m8 tests�[22m�[2m)�[22m�[33m 938�[2mms�[22m�[39m
   �[32m✓�[39m TaskDetails embedded beside the task list �[2m(8)�[22m
     �[33m�[2m✓�[22m�[39m shows the task it is given, leaves the title to the list and reports a delete instead of navigating�[33m 465�[2mms�[22m�[39m
 �[32m✓�[39m src/components/Dashboard/HappeningNowSection.test.tsx �[2m(�[22m�[2m6 tests�[22m�[2m)�[22m�[33m 904�[2mms�[22m�[39m
   �[32m✓�[39m Happening now sub-phase line �[2m(5)�[22m
     �[33m�[2m✓�[22m�[39m gives every running row a sub-phase line, and none of them a spinner�[33m 418�[2mms�[22m�[39m
�[90mstderr�[2m | src/components/Repositories/RepoMediaPanel.test.tsx�[2m > �[22m�[2mrepository Media tab�[2m > �[22m�[2momits tab and requests for disabled/legacy repositories (false)
�[22m�[39mAn update to RepoActionContainer inside a test was not wrapped in act(...).

When testing, code that causes React state updates should be wrapped into act(...):

act(() => {
  /* fire events that update state */
});
/* assert on the output */

This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act
An update to RepoActionContainer inside a test was not wrapped in act(...).

When testing, code that causes React state updates should be wrapped into act(...):

act(() => {
  /* fire events that update state */
});
/* assert on the output */

This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act
An update to RepoActionContainer inside a test was not wrapped in act(...).

When testing, code that causes React state updates should be wrapped into act(...):

act(() => {
  /* fire events that update state */
});
/* assert on the output */

This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act

�[90mstderr�[2m | src/components/Repositories/RepoMediaPanel.test.tsx�[2m > �[22m�[2mrepository Media tab�[2m > �[22m�[2momits tab and requests for disabled/legacy repositories (undefined)
�[22m�[39mAn update to RepoActionContainer inside a test was not wrapped in act(...).

When testing, code that causes React state updates should be wrapped into act(...):

act(() => {
  /* fire events that update state */
});
/* assert on the output */

This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act
An update to RepoActionContainer inside a test was not wrapped in act(...).

When testing, code that causes React state updates should be wrapped into act(...):

act(() => {
  /* fire events that update state */
});
/* assert on the output */

This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act
An update to RepoActionContainer inside a test was not wrapped in act(...).

When testing, code that causes React state updates should be wrapped into act(...):

act(() => {
  /* fire events that update state */
});
/* assert on the output */

This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act

�[90mstderr�[2m | src/components/Repositories/RepoMediaPanel.test.tsx�[2m > �[22m�[2mrepository Media tab�[2m > �[22m�[2mclears media on repository change and disabling, ignoring stale requests
�[22m�[39mAn update to RepoActionContainer inside a test was not wrapped in act(...).

When testing, code that causes React state updates should be wrapped into act(...):

act(() => {
  /* fire events that update state */
});
/* assert on the output */

This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act
An update to RepoActionContainer inside a test was not wrapped in act(...).

When testing, code that causes React state updates should be wrapped into act(...):

act(() => {
  /* fire events that update state */
});
/* assert on the output */

This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act

 �[32m✓�[39m src/components/Repositories/RepoMediaPanel.test.tsx �[2m(�[22m�[2m12 tests�[22m�[2m)�[22m�[33m 1637�[2mms�[22m�[39m
 �[32m✓�[39m src/App.hostedFlow.test.tsx �[2m(�[22m�[2m5 tests�[22m�[2m)�[22m�[33m 2314�[2mms�[22m�[39m
   �[32m✓�[39m HostedFlowRouteSync �[2m(5)�[22m
     �[33m�[2m✓�[22m�[39m preserves the validated active flow across actual React Router navigation without duplicating query parameters�[33m 1876�[2mms�[22m�[39m
 �[32m✓�[39m src/pages/SettingsPage/ReviewContextSettings.test.tsx �[2m(�[22m�[2m8 tests�[22m�[2m)�[22m�[33m 516�[2mms�[22m�[39m
   �[32m✓�[39m ReviewContextSettings �[2m(6)�[22m
     �[33m�[2m✓�[22m�[39m replaces the numeric token field with a labelled 10% step slider�[33m 336�[2mms�[22m�[39m
 �[32m✓�[39m src/hooks/useHeaderStats.status.test.tsx �[2m(�[22m�[2m5 tests�[22m�[2m)�[22m�[33m 307�[2mms�[22m�[39m
 �[32m✓�[39m src/hooks/useLiveRefreshScheduler.test.tsx �[2m(�[22m�[2m7 tests�[22m�[2m)�[22m�[32m 83�[2mms�[22m�[39m
�[90mstderr�[2m | src/components/AddRepositoryModal.test.tsx�[2m > �[22m�[2mAddRepositoryModal�[2m > �[22m�[2mkeeps branch selection in the scroll-owned form and submits through one form path
�[22m�[39mIn HTML, <button> cannot be a descendant of <button>.
This will cause a hydration error.

  <AddRepositoryModal isOpen={true} newRepo="integry/propr" newAlias="Production" newBaseBranch="release/20..." ...>
    <div className="fixed inse..." onClick={function handleBackdropClick}>
      <div ref={{...}} role="dialog" aria-modal="true" aria-labelledby="_r_9_" tabIndex={-1} className="bg-white r...">
        <div>
        <form onSubmit={function handleSubmit} className="flex min-h...">
          <div data-testid="add-reposi..." className="min-h-0 fl...">
            <div>
            <div>
            <div>
              <label>
              <BaseBranchSelector repoName="integry/propr" value="release/20..." onChange={function Mock} ...>
                <div className="relative" ref={{...}}>
>                 <button
>                   id="_r_d_"
>                   type="button"
>                   onClick={function handleOpen}
>                   disabled={false}
>                   aria-labelledby="_r_e_ _r_h_"
>                   aria-describedby="_r_f_"
>                   aria-haspopup="listbox"
>                   aria-expanded={false}
>                   className="w-full px-3 py-2 text-left bg-white border border-gray-300 rounded-md font-mono text-sm..."
>                 >
                    <span>
                    <div className="flex items...">
>                     <button
>                       type="button"
>                       onClick={function handleClear}
>                       className="p-0.5 hover:bg-gray-200 rounded text-gray-400 hover:text-gray-600"
>                       title="Clear selection"
>                     >
                      ...
              ...
            ...
          ...

<button> cannot contain a nested <button>.
See this log for the ancestor stack trace.

 �[32m✓�[39m src/components/AddRepositoryModal.test.tsx �[2m(�[22m�[2m5 tests�[22m�[2m)�[22m�[33m 863�[2mms�[22m�[39m
   �[32m✓�[39m AddRepositoryModal �[2m(5)�[22m
     �[33m�[2m✓�[22m�[39m exposes one labelled dialog with reachable header and form actions�[33m 448�[2mms�[22m�[39m
 �[32m✓�[39m src/pages/SettingsPage/VisualPreviewAuthSection.test.tsx �[2m(�[22m�[2m6 tests�[22m�[2m)�[22m�[33m 569�[2mms�[22m�[39m
 �[32m✓�[39m src/components/SystemHealthPush.test.tsx �[2m(�[22m�[2m3 tests�[22m�[2m)�[22m�[33m 564�[2mms�[22m�[39m
 �[32m✓�[39m src/components/SummaryBrowser/index.test.tsx �[2m(�[22m�[2m3 tests�[22m�[2m)�[22m�[32m 277�[2mms�[22m�[39m
 �[32m✓�[39m src/components/Goals/goalTimeline.test.ts �[2m(�[22m�[2m9 tests�[22m�[2m)�[22m�[32m 18�[2mms�[22m�[39m
 �[32m✓�[39m src/pages/AccessManagementPage.test.tsx �[2m(�[22m�[2m3 tests�[22m�[2m)�[22m�[33m 536�[2mms�[22m�[39m
   �[32m✓�[39m AccessManagementPage �[2m(3)�[22m
     �[33m�[2m✓�[22m�[39m loads assignments and adds a GitHub user�[33m 397�[2mms�[22m�[39m
 �[32m✓�[39m src/api/apiClient.accounts.test.ts �[2m(�[22m�[2m5 tests�[22m�[2m)�[22m�[32m 30�[2mms�[22m�[39m
 �[32m✓�[39m src/components/AgentChat/ModelSelector.test.tsx �[2m(�[22m�[2m4 tests�[22m�[2m)�[22m�[33m 943�[2mms�[22m�[39m
   �[32m✓�[39m ModelSelector keyboard navigation �[2m(4)�[22m
     �[33m�[2m✓�[22m�[39m scrolls to and selects an active option beyond the initial viewport�[33m 649�[2mms�[22m�[39m
 �[32m✓�[39m src/desktop/DesktopExperience.shortcut-readiness.test.tsx �[2m(�[22m�[2m2 tests�[22m�[2m)�[22m�[33m 508�[2mms�[22m�[39m
   �[32m✓�[39m DesktopExperience shortcut readiness �[2m(2)�[22m
     �[33m�[2m✓�[22m�[39m handles the management shortcut in the commit that makes a delayed connection ready�[33m 464�[2mms�[22m�[39m
 �[32m✓�[39m src/api/compatibility.test.ts �[2m(�[22m�[2m6 tests�[22m�[2m)�[22m�[32m 257�[2mms�[22m�[39m
 �[32m✓�[39m src/components/TaskPlanner/PlanEditor.responsive.test.tsx �[2m(�[22m�[2m5 tests�[22m�[2m)�[22m�[32m 98�[2mms�[22m�[39m
 �[32m✓�[39m src/App.hostedCompletion.test.tsx �[2m(�[22m�[2m2 tests�[22m�[2m)�[22m�[33m 328�[2mms�[22m�[39m
 �[32m✓�[39m src/desktop/browserAdapters.test.ts �[2m(�[22m�[2m6 tests�[22m�[2m)�[22m�[32m 32�[2mms�[22m�[39m
 �[32m✓�[39m src/components/TaskDetails/PushFailureDetails.test.tsx �[2m(�[22m�[2m4 tests�[22m�[2m)�[22m�[33m 633�[2mms�[22m�[39m
   �[32m✓�[39m Push failure diagnosis on the task timeline �[2m(4)�[22m
     �[33m�[2m✓�[22m�[39m shows the classification, unblock URL and recovery (rail)�[33m 510�[2mms�[22m�[39m
 �[32m✓�[39m src/pages/SummaryBrowserPage.test.tsx �[2m(�[22m�[2m2 tests�[22m�[2m)�[22m�[32m 123�[2mms�[22m�[39m
 �[32m✓�[39m src/components/Analytics/activityAxis.test.ts �[2m(�[22m�[2m5 tests�[22m�[2m)�[22m�[32m 38�[2mms�[22m�[39m
 �[32m✓�[39m src/components/Dashboard/workTitle.test.ts �[2m(�[22m�[2m5 tests�[22m�[2m)�[22m�[32m 13�[2mms�[22m�[39m
 �[32m✓�[39m src/desktop/DesktopPresentationBoundary.test.tsx �[2m(�[22m�[2m1 test�[22m�[2m)�[22m�[33m 376�[2mms�[22m�[39m
   �[32m✓�[39m DesktopPresentationBoundary deep-link subscription �[2m(1)�[22m
     �[33m�[2m✓�[22m�[39m subscribes once, tears down, and does not replay a consumed candidate after remount�[33m 371�[2mms�[22m�[39m
 �[32m✓�[39m src/api/usageTipsApi.test.ts �[2m(�[22m�[2m4 tests�[22m�[2m)�[22m�[32m 13�[2mms�[22m�[39m
 �[32m✓�[39m src/pages/SettingsPage/AgentTankSection.test.tsx �[2m(�[22m�[2m6 tests�[22m�[2m)�[22m�[33m 370�[2mms�[22m�[39m
�[90mstderr�[2m | src/pages/DesktopPairingPage.test.tsx�[2m > �[22m�[2mDesktopPairingPage�[2m > �[22m�[2mshows the server-provided client name and requires an explicit approval click
�[22m�[39mIn HTML, <div> cannot be a descendant of <p>.
This will cause a hydration error.

  <MemoryRouter initialEntries={[...]}>
    <Router basename={undefined} location={{pathname:"...", ...}} navigationType="POP" navigator={{index:0, ...}} ...>
      <AuthProvider user={{id:"101", ...}}>
        <DesktopPairingPage>
          <main className="flex min-h...">
            <section className="w-full max...">
              <img>
              <h1>
              <p>
>             <p className="mt-3 text-sm">
                <GitHubAccountIdentity account={{id:"101", ...}}>
                  <span className="inline-fle...">
                    <UserAvatar user={{id:"101", ...}} className="flex h-6 w..." fallbackClassName="bg-slate-1..." ...>
                      <AvatarFallback accessibleName="alice avatar" className="flex h-6 w..." ...>
>                       <div
>                         className="flex h-6 w-6 flex-none items-center justify-center rounded-full border border-sla..."
>                         aria-hidden={true}
>                       >
                    ...
              ...

<p> cannot contain a nested <div>.
See this log for the ancestor stack trace.

 �[32m✓�[39m src/pages/DesktopPairingPage.test.tsx �[2m(�[22m�[2m2 tests�[22m�[2m)�[22m�[33m 376�[2mms�[22m�[39m
   �[32m✓�[39m DesktopPairingPage �[2m(2)�[22m
     �[33m�[2m✓�[22m�[39m shows the server-provided client name and requires an explicit approval click�[33m 340�[2mms�[22m�[39m
 �[32m✓�[39m src/desktop/PackagedAcceptanceLocalSetup.test.tsx �[2m(�[22m�[2m3 tests�[22m�[2m)�[22m�[33m 604�[2mms�[22m�[39m
   �[32m✓�[39m packaged acceptance local-setup surfaces �[2m(3)�[22m
     �[33m�[2m✓�[22m�[39m drives the fixed prerequisites into the stable progress surface�[33m 567�[2mms�[22m�[39m
 �[32m✓�[39m src/contexts/SystemStatusContext.push.test.tsx �[2m(�[22m�[2m1 test�[22m�[2m)�[22m�[32m 43�[2mms�[22m�[39m
 �[32m✓�[39m src/hooks/useSystemReadiness.test.tsx �[2m(�[22m�[2m1 test�[22m�[2m)�[22m�[32m 59�[2mms�[22m�[39m
 �[32m✓�[39m src/components/TaskDetails/ThinkingLog.test.tsx �[2m(�[22m�[2m4 tests�[22m�[2m)�[22m�[33m 413�[2mms�[22m�[39m
 �[32m✓�[39m src/components/RepositoryListItem.test.tsx �[2m(�[22m�[2m2 tests�[22m�[2m)�[22m�[32m 297�[2mms�[22m�[39m
�[90mstderr�[2m | src/hooks/useDecoratedRepoOptions.test.tsx�[2m > �[22m�[2museDecoratedRepoOptions�[2m > �[22m�[2mpasses through undefined options
�[22m�[39mAn update to TestComponent inside a test was not wrapped in act(...).

When testing, code that causes React state updates should be wrapped into act(...):

act(() => {
  /* fire events that update state */
});
/* assert on the output */

This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act

 �[32m✓�[39m src/hooks/useDecoratedRepoOptions.test.tsx �[2m(�[22m�[2m2 tests�[22m�[2m)�[22m�[32m 78�[2mms�[22m�[39m
�[90mstderr�[2m | src/components/TaskList/Filters.test.tsx�[2m > �[22m�[2mFilters�[2m > �[22m�[2mnames the selected repository without its owner
�[22m�[39mAn update to RepoFilter inside a test was not wrapped in act(...).

When testing, code that causes React state updates should be wrapped into act(...):

act(() => {
  /* fire events that update state */
});
/* assert on the output */

This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act

�[90mstderr�[2m | src/components/TaskList/Filters.test.tsx�[2m > �[22m�[2mFilters�[2m > �[22m�[2mkeeps the owner when two owners share a repository name
�[22m�[39mAn update to RepoFilter inside a test was not wrapped in act(...).

When testing, code that causes React state updates should be wrapped into act(...):

act(() => {
  /* fire events that update state */
});
/* assert on the output */

This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act

�[90mstderr�[2m | src/components/TaskList/Filters.test.tsx�[2m > �[22m�[2mFilters�[2m > �[22m�[2mleaves the filter dropdowns to do the filtering, with no separate filter icon
�[22m�[39mAn update to RepoFilter inside a test was not wrapped in act(...).

When testing, code that causes React state updates should be wrapped into act(...):

act(() => {
  /* fire events that update state */
});
/* assert on the output */

This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act

 �[32m✓�[39m src/components/TaskList/Filters.test.tsx �[2m(�[22m�[2m3 tests�[22m�[2m)�[22m�[33m 517�[2mms�[22m�[39m
   �[32m✓�[39m Filters �[2m(3)�[22m
     �[33m�[2m✓�[22m�[39m names the selected repository without its owner�[33m 430�[2mms�[22m�[39m
 �[32m✓�[39m src/hooks/useAgentTankSuggestion.test.tsx �[2m(�[22m�[2m2 tests�[22m�[2m)�[22m�[32m 87�[2mms�[22m�[39m
 �[32m✓�[39m src/components/TaskDetails/SectionLabelHeader.test.tsx �[2m(�[22m�[2m5 tests�[22m�[2m)�[22m�[33m 386�[2mms�[22m�[39m
 �[32m✓�[39m src/components/ActivitySparkline.test.tsx �[2m(�[22m�[2m3 tests�[22m�[2m)�[22m�[32m 297�[2mms�[22m�[39m
 �[32m✓�[39m src/pages/SettingsPage/UsageTipsSettingsSection.test.tsx �[2m(�[22m�[2m2 tests�[22m�[2m)�[22m�[32m 98�[2mms�[22m�[39m
 �[32m✓�[39m src/components/workflowSelectionInput.test.ts �[2m(�[22m�[2m3 tests�[22m�[2m)�[22m�[32m 9�[2mms�[22m�[39m
 �[32m✓�[39m src/utils/notificationIntents.test.ts �[2m(�[22m�[2m7 tests�[22m�[2m)�[22m�[32m 8�[2mms�[22m�[39m

�[2m Test Files �[22m �[1m�[32m56 passed�[39m�[22m�[90m (56)�[39m
�[2m      Tests �[22m �[1m�[32m428 passed�[39m�[22m�[90m (428)�[39m
�[2m   Start at �[22m 08:18:31
�[2m   Duration �[22m 81.38s�[2m (environment 48%, tests 24%, import 11%, transform 8%, setup 8%)�[22m

�[2mEnvironment �[22m �[33mjsdom was created 56 times�[39m�[2m · 72.92s total, 48% of tracked time�[22m
�[2m            �[22m �[2mcreate it once per worker with �[22m�[33mpool: 'vmThreads'�[39m�[2m (keeps per-file isolation) or �[22m�[33misolate: false�[39m�[2m (shares it across files)�[22m
�[2m            �[22m �[2mlearn more: https://vitest.dev/guide/improving-performance#test-environments�[22m


> [email protected] posttest
> npm run test:docker-context


> [email protected] test:docker-context
> node --test scripts/docker-context-inputs.test.mjs

TAP version 13
# Subtest: focused UI selectors are forwarded only to Vitest
ok 1 - focused UI selectors are forwarded only to Vitest
  ---
  duration_ms: 1.11769
  type: 'test'
  ...
# Subtest: the UI Docker context contains its complete non-type external source import closure
ok 2 - the UI Docker context contains its complete non-type external source import closure
  ---
  duration_ms: 141.095362
  type: 'test'
  ...
1..2
# tests 2
# suites 0
# pass 2
# fail 0
# cancelled 0
# skipped 0
# todo 0
# duration_ms 259.865868
[171/171] passed propr-ui#3/4 (workspace test script) in 83.0s

### Shard 3/4: 170/171 passed in 626.5s

Assigned 171 of 684 discovered units.

| Duration | Status | Unit |
| ---: | --- | --- |
| 83.0s | passed | `propr-ui#3/4` (workspace) |
| 40.9s | passed | `apps/desktop/scripts/packaged-acceptance-account.test.mjs` |
| 32.1s | passed | `apps/desktop/src/profile-store.crash-recovery.test.ts` |
| 19.2s | passed | `apps/desktop/src/saved-accounts.test.ts` |
| 17.3s | passed | `test/connectCliIntegration.test.ts` |
| 15.5s | passed | `test/notificationSchema.test.ts` |
| 13.7s | passed | `packages/api/test/mcpAccessLogDispatch.test.ts` |
| 13.4s | passed | `apps/desktop/scripts/release-artifacts.test.mjs` |
| 11.6s | passed | `packages/cli/src/commands/initCommands.test.ts` |
| 10.8s | passed | `packages/api/test/mcpIntegration.test.ts` |
| 10.3s | passed | `test/worktreeLifecycle.integration.test.ts` |
| 9.7s | passed | `packages/api/test/notificationProjectionService.test.ts` |
| 9.3s | failed | `packages/core/test/usageTips.test.ts` |
| 9.2s | passed | `packages/api/test/dashboardReadService.test.ts` |
| 7.5s | passed | `test/previewRuntimeSmokeCleanup.test.mjs` |


1/171 test runs failed in shard 3/4 after 626.5s:
- packages/core/test/usageTips.test.ts: exit 1

Details truncated; see the uploaded artifacts for complete failure rows and logs.

View Workflow
View uploaded artifacts

@propr-dev

propr-dev Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit 40f1755

Summary of Changes

I fixed the shard 3 failure. It was a flaky test, not a bug in this PR. Neither the test nor sqliteRetry.ts is changed on this branch.

What failed: one test in packages/core/test/usageTips.test.ts, "separate SQLite connections serialize distinct events and deduplication survives reopening", stopped with BEGIN IMMEDIATE; - database is locked (SQLITE_BUSY) after 7.75s on the CI host. The test has two connections race to write the same SQLite file. It gave the retry layer only 1 second in total across 6 attempts, so if the other connection held the write lock for more than about a second, the test gave up. A slow disk write on a busy runner can easily take that long.

Fix: in packages/core/test/usageTips.test.ts, I changed the test's retry settings from { maxTotalMs: 1000 } to { maxAttempts: 50, maxTotalMs: 30_000 }, with a short comment saying why. The test exists to check that writes are serialized and deduplicated. The retry limits themselves are covered in sqliteRetry.test.ts, so a larger budget here hides nothing.

Verification:

  • Reproduced the CI error: I kept the write lock held from a third connection for 2 seconds. With the old settings the write failed with the same BEGIN IMMEDIATE; - database is locked error. With the new settings it waited and succeeded after about 2.2s.
  • Full file: all 23 tests in usageTips.test.ts pass.
  • Under CPU load: the old version passed 8 out of 8 runs, so heavy CPU alone doesn't trigger it. That fits a slow disk write being the cause.
  • Not done: I haven't re-run the full suite or shard 3.

To run the tests locally I installed dependencies with npm ci --ignore-scripts, which skipped building the native SQLite module, so I rebuilt it with npm rebuild better-sqlite3. The lockfile is unchanged and the only modified file is the test.

This doesn't change anything visible, so there's no visual preview.


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @github-actions[bot]
  • Time: 20m 15s
  • Tokens: 1,820,612 (1,812,732 in / 7,880 out)
  • Cost: $0.88
  • Subscription usage: Session +1%

Undo Changes • View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR
Processing comment ID: 6012402601✓

… in this PR. Neither the test nor `sqliteRetry.ts` is changed on this branch.

I fixed the shard 3 failure. It was a flaky test, not a bug in this PR. Neither the test nor `sqliteRetry.ts` is changed on this branch.

**What failed:** one test in `packages/core/test/usageTips.test.ts`, "separate SQLite connections serialize distinct events and deduplication survives reopening", stopped with `BEGIN IMMEDIATE; - database is locked` (`SQLITE_BUSY`) after 7.75s on the CI host. The test has two connections race to write the same SQLite file. It gave the retry layer only 1 second in total across 6 attempts, so if the other connection held the write lock for more than about a second, the test gave up. A slow disk write on a busy runner can easily take that long.

**Fix:** in `packages/core/test/usageTips.test.ts`, I changed the test's retry settings from `{ maxTotalMs: 1000 }` to `{ maxAttempts: 50, maxTotalMs: 30_000 }`, with a short comment saying why. The test exists to check that writes are serialized and deduplicated. The retry limits themselves are covered in `sqliteRetry.test.ts`, so a larger budget here hides nothing.

**Verification:**
- **Reproduced the CI error:** I kept the write lock held from a third connection for 2 seconds. With the old settings the write failed with the same `BEGIN IMMEDIATE; - database is locked` error. With the new settings it waited and succeeded after about 2.2s.
- **Full file:** all 23 tests in `usageTips.test.ts` pass.
- **Under CPU load:** the old version passed 8 out of 8 runs, so heavy CPU alone doesn't trigger it. That fits a slow disk write being the cause.
- **Not done:** I haven't re-run the full suite or shard 3.

To run the tests locally I installed dependencies with `npm ci --ignore-scripts`, which skipped building the native SQLite module, so I rebuilt it with `npm rebuild better-sqlite3`. The lockfile is unchanged and the only modified file is the test.

This doesn't change anything visible, so there's no visual preview.

PR: #2755
Comment by: @github-actions[bot] (ID: 6012402601)
Model: claude-opus-5-5
@integry
integry merged commit 45c46f9 into main Oct 6, 2026
50 checks passed
@integry
integry deleted the 2736/claude-opus-5-5-salvage-agent-work-before-20261005-2330-ait branch October 6, 2026 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

## Salvage agent work before destroying the worktree, and diagnose push rejections

2 participants