Skip to content

FE-1261: Recover prepared execution journals - #373

Merged
kostandinang merged 2 commits into
nextfrom
kostandin/fe-1261-refresh-prepared-state
Jul 24, 2026
Merged

FE-1261: Recover prepared execution journals#373
kostandinang merged 2 commits into
nextfrom
kostandin/fe-1261-refresh-prepared-state

Conversation

@kostandinang

@kostandinang kostandinang commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Stack context

Follow-up to #371 under FE-1261. The original PR merged while its latest automated review was still reporting.

Why

drive() prepared Petri observation on disk but immediately reconciled with the stale pre-preparation metadata object. A run advanced by a direct lifecycle tool could therefore halt with petri_journal_gap instead of repairing the journal.

What

  • Refresh run.json after observation preparation before lifecycle reconciliation.
  • Cover an unprepared run advanced directly to worktree_created, proving reconciliation and forward progress.

Verification

  • Affected executor suite: 272/272 passing.
  • Production build and type check passing.

@cursor

cursor Bot commented Jul 23, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Touches the core drive() reconciliation path in the executor; scope is narrow (metadata refresh after preparation) but incorrect behavior could still affect run progression and journal repair.

Overview
Fixes a bug where drive() prepared Petri observation on disk but still reconciled lifecycle steps against the stale in-memory run.json snapshot from the start of the loop iteration.

After preparePetriObservation, the drive loop now re-reads run.json and updates state before reconcilePreparedLifecycleJournal. That way runs advanced by direct lifecycle tools (e.g. worktree already created while metadata still looked unprepared) reconcile against current provenance instead of halting with petri_journal_gap.

Adds an orchestrate test for an unprepared run with a worktree already in place, asserting reconciliation fires worktree_create and populate and reaches worktree_populated with petriObservationPrepared: true.

Reviewed by Cursor Bugbot for commit 2561716. Bugbot is set up for automated code reviews on this repo. Configure here.

Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@kostandinang kostandinang changed the title FE-1261: Refresh state after Petri preparation FE-1261: Recover prepared execution journals Jul 23, 2026
@kostandinang kostandinang self-assigned this Jul 24, 2026
@kostandinang
kostandinang merged commit ca2bf27 into next Jul 24, 2026
7 checks passed
@kostandinang
kostandinang deleted the kostandin/fe-1261-refresh-prepared-state branch July 24, 2026 08:11
@hash-worker hash-worker Bot mentioned this pull request Jul 24, 2026
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