Skip to content

fix: make reconciliation recovery durable - #74

Merged
roodboi merged 4 commits into
mainfrom
codex/HACK-1033
Jul 29, 2026
Merged

fix: make reconciliation recovery durable#74
roodboi merged 4 commits into
mainfrom
codex/HACK-1033

Conversation

@roodboi

@roodboi roodboi commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • reconcile completed Linear and default-branch evidence without carrying stale evolution families
  • persist resolution proof so reconciliation/loop crashes recover deterministically
  • coordinate enrollment state migration with reconciliation/evolution writers
  • keep macOS mutation sockets within the Unix-domain path limit discovered in the 2.29.0 release smoke

Verification

  • bun test src/reconciliation.test.ts (44 pass)
  • bun test src/evolution-loop.test.ts (45 pass)
  • bun test src/projects.test.ts (127 pass)
  • bun run type-check
  • bun run check
  • isolated clean-repository enrollment apply with the source CLI

Linear: HACK-1033


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

@linear-code

linear-code Bot commented Jul 29, 2026

Copy link
Copy Markdown

HACK-1033

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9bda4bcbd1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/reconciliation.ts
Comment on lines +1283 to +1287
const containment = await gitDefaultBranchContainment({
commit: pending.recordId,
config: source,
projectRoot,
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Skip vanished commits during containment rechecks

When a previously scanned non-default-branch commit is removed by a force-push/rebase and later pruned, git merge-base --is-ancestor exits with an error rather than 1; this call propagates that error and aborts the entire reconciliation. Because the unreachable record remains in state.evidence, every subsequent scheduled or manual run retries the same commit and fails permanently instead of continuing with the remaining sources.

Useful? React with 👍 / 👎.

Comment thread src/projects.ts
Comment on lines +4313 to +4323
try {
handle = await open(path, "wx");
} catch (error) {
if (
error instanceof Error &&
"code" in error &&
(error as NodeJS.ErrnoException).code === "EEXIST"
) {
throw new Error(
`Project enrollment cannot migrate runtime state while another writer holds ${path}`
);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Recover abandoned enrollment migration locks

If enrollment is terminated after creating either runtime-migration lock, the OS closes the handle but leaves the file behind. Every later enrollment rejects the resulting EEXIST, and the reconciliation lock implementation also has no stale-owner takeover, so reconciliation for that project remains blocked indefinitely until the user discovers and manually deletes the file. Use the existing owner/liveness recovery protocol or otherwise reclaim abandoned coordination locks.

Useful? React with 👍 / 👎.

@roodboi
roodboi merged commit d7c7feb into main Jul 29, 2026
4 checks passed
@roodboi
roodboi deleted the codex/HACK-1033 branch July 29, 2026 18:21
github-actions Bot pushed a commit that referenced this pull request Jul 29, 2026
## [2.29.1](v2.29.0...v2.29.1) (2026-07-29)

### Bug Fixes

* make reconciliation recovery durable ([#74](#74)) ([d7c7feb](d7c7feb))
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 2.29.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant