Skip to content

fix: resolve seven regressions from the merged PR audit - #159

Merged
ScriptedAlchemy merged 1 commit into
mainfrom
fix/last40-merge-audit-2026-11-18
Nov 18, 2026
Merged

ScriptedAlchemy merged 1 commit into
mainfrom
fix/last40-merge-audit-2026-11-18

Conversation

@ScriptedAlchemy

@ScriptedAlchemy ScriptedAlchemy commented Nov 18, 2026 •

Copy link
Copy Markdown
Owner

The audit of the last 40 merged PRs found seven regressions still present on main: worktree recovery could delete newly arrived files, a seeded worktree development home could prune the original home's checkpoints, live branch updates bypassed the fork's safety checks, failed inference configuration writes could leave mixed state, conversation-summary recovery could stall in two cases, and Morph evaluations could miss valid OpenCode credentials.

This PR combines all confirmed corrections, as requested. Every finding was reproduced on unchanged production source before its fix. Regression cases extend existing owning tests; the Morph helper gets an isolated configuration test.

Corrections

Area Failure Correction Origin
Worktree recovery The folder was checked, then reread after project/settings work; newly created user files were included in recursive deletion. Revalidate immediately before cleanup and remove only the entries from that validated snapshot. Abort safely if user content, a checkout, or a missing folder replaces it. #124, retained through #149
Checkpoint cleanup A seeded worktree development database keeps original thread/scope IDs and repository paths. Deleting its copied thread could delete the original home's Git checkpoint refs. Apply the existing worktree development-home ownership boundary to checkpoint pruning. Installed-home pruning remains covered by the same real-Git test. #124
Live branch synchronization The upstream watcher wrote thread branch metadata directly, bypassing the fork's repository, default-branch, active-run, and recreation checks. Reuse WorktreeBranches.sync after the existing stale-event check, through the existing provided service layer. #124
Inference routing A failed route-state write could leave provider settings enabled and switched while the old route pool remained. Partial writes and readers during cutover also need consistent rollback/publication. Commit route state and provider settings through one protected operation, roll back failed writes, and read settings/pool snapshots consistently. Network requests remain outside the route snapshot lock. #146 / #157
Summary roll-up recovery A failed roll-up with every raw source already covered has waitingMessages = 0, so it was permanently excluded from recovery. Retry failed passes independently of uncovered raw-message count, retaining the model, project, pending-work, backoff, and retry-limit gates. #144 / #132
Summary retry reset Turning summaries off and back on during the final retry cleared the retry budget, but the old in-flight pass wrote the exhausted budget back. Let the durable reset clear the retry round as well as the chunk-failure ledger. #144 / #132
Morph evaluation credentials The fallback helper accepted OpenCode v2 providers.morph.settings but rejected the supported v1 provider.morph.options format. Read v1 options when v2 settings are absent; keep environment credentials and v2 precedence. #128

Regression evidence

  • Live branch watcher: unchanged source failed five unsafe scenarios; the safe and dispatch-conflict controls passed. The fixed watcher and shared service passed all 25 cases, including real Git checks in the shared service suite.
  • Summary recovery: the failed-roll-up row failed while the existing leaf case passed. Gating the final retry across off/on reproduced the reset race for both leaf and roll-up work. All 71 tests in the three owning summary suites passed after the fixes.
  • Worktree restore: the existing leftover-folder test reproduced recursive deletion of notes.md created during project lookup. The fixed table also covers a newly appearing .git and a vanished folder.
  • Checkpoint cleanup: the real-Git development-home case lost four refs on unchanged source; the installed-home control passed. The fixed development home preserves all refs while the installed home still prunes its own tombstones.
  • Complete restoration/provider-turn-start and storage-cleanup suites passed 395 tests after both fixes.
  • Inference: unchanged 7ef0e6d4 fails the primary-route write regression; the original fallback and catalog blocks separately fail published-then-error cases. The final 11 proxy/route/HTTP tests pass, including later settings-write failure, readers before and after settings commit, health during publication, and cancellation. Independent review checked the host → route → settings lock order and that network work stays outside the route snapshot lock.
  • Morph: a real Python invocation against a temporary v1 config failed before the fix while the v2/environment controls passed. All three configuration cases and the existing caller timeout case passed afterward, without a model or network request.

Audit scope

Pinned base: 7ef0e6d44b886604bc04b5048fcf55356399e671. The scope is the latest 40 merged PRs authored by ScriptedAlchemy, selected by merge time from the full closed-PR inventory:

#158, #157, #156, #155, #154, #153, #152, #151, #150, #149, #146, #148, #147, #144, #145, #142, #143, #141, #139, #140, #137, #138, #135, #136, #134, #127, #133, #131, #129, #125, #132, #130, #128, #126, #124, #122, #123, #121, #115, #117.

Reviews covered inference and provider execution, model evaluations, memory/LCM and migrations, group chat and subagent state, mobile composer behavior, process/platform changes, dependency/CI changes, and upstream integration. The two large upstream syncs received targeted integration review across these areas; this is not a claim of exhaustive manual inspection of every imported upstream line. The already merged #157/#158 corrections remain intact and are not counted again. The withdrawn #142 empty-config suspicion was not reopened.

Validation

  • 1,246 distinct focused tests passed across 44 files during the audit, with repeated red/green runs excluded. One existing runtime-conditional test was skipped.
  • 653 tests passed across eight files on the combined branch, selected by vp run check:changed origin/main --concurrency 1. This includes the changed service tests, runtime-layer integration, and Agent Context Budget. These cases overlap the audit totals above and are not added to them.
  • The combined gate passed the project-memory addon build, formatting, lint, both knip passes, generated GraphQL checks, and its selected tests.
  • Its cached typecheck launcher could not start because this environment denies seccomp_unotify. The same package command, effect-tsgo tsrs --noEmit, was then run directly in apps/server, evals, and scripts; all three exited 0. The direct checks caught one Effect diagnostic in restoration; corrected it to Effect.undefined and reran the affected checks. No CI configuration or validation gate was weakened.
  • The final tree also passes git diff --check. GitHub CI will validate the published PR head.

The audit also passed 176 group/model-evaluation tests, 30 mobile unit tests, and 42 client group-state tests. Native Windows/macOS/iOS/Android behavior and private/live-model behavior were reviewed from source where relevant, but were not independently exercised on those runtimes. Eleven unrelated baseline cases are blocked by the environment: one GitHubRest Unix-socket fixture cannot bind (EPERM), and ten desktop WSL configuration cases cannot enumerate network interfaces (the same error reproduces in standalone Node). These are not counted as passing. No model-facing prompts changed.

Inference rollback remains best effort if storage continues failing: the original error and previous in-memory pool are retained, and a sanitized warning reports a failed rollback. The worktree cleanup fix closes the reproduced lookup-to-cleanup gap; it does not claim an atomic filesystem transaction.

Model: GPT-6 Astra Pro. Harness: ChatGPT with GitHub connector and isolated local Git worktrees.

Protect worktree files and shared checkpoint refs, preserve safe branch metadata,
coordinate inference route persistence, recover summary retries, and support
legacy OpenCode Morph credentials. Add regression coverage for all seven findings.
@changeset-bot

changeset-bot Bot commented Nov 18, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 6c0865e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@ScriptedAlchemy
ScriptedAlchemy merged commit 68193a2 into main Nov 18, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant