Skip to content

FE-1254: Repair failed slice verification#370

Merged
kostandinang merged 5 commits into
nextfrom
ka/fe-1254-slice-verification-repair
Jul 23, 2026
Merged

FE-1254: Repair failed slice verification#370
kostandinang merged 5 commits into
nextfrom
ka/fe-1254-slice-verification-repair

Conversation

@kostandinang

@kostandinang kostandinang commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Why

A recoverable worker-authored verification failure halted the run immediately instead of giving the worker a bounded chance to repair it.

What

Add a finite verify-to-repair loop in the same slice workspace. Repair state is crash-durable and replayable across serial and parallel execution, and only a passing verification cycle can integrate.

How to test

  • Full suite: 2664 passed, 2 pre-existing skips
  • npm run check
  • npm run build

kostandinang commented Jul 23, 2026

Copy link
Copy Markdown
Contributor Author

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

@kostandinang
kostandinang marked this pull request as ready for review July 23, 2026 00:47
@cursor

cursor Bot commented Jul 23, 2026

Copy link
Copy Markdown

PR Summary

High Risk
Touches core executor orchestration, Petri topology, run metadata shape, and crash-recovery paths for serial and parallel slice execution—incorrect repair authority could cause duplicate effects or unsafe worker prompts.

Overview
Failed slice verification no longer halts immediately when repair budget remains. The executor runs a finite repair ladder (up to three repair cycles, three agent/verify attempts per stage) in the same slice workspace, with cycle-qualified Petri places/transitions and sliceRepairHistory replacing flat sliceAttemptHistory.

Repair authority is canonical and crash-safe: bounded verify diagnostics are written to durable repair context (digest-checked, fail-closed validation), durable-file primitives fsync parent chains for journal/marking/context writes, and serial vs parallel paths persist pending repair in run.json or marking.json before materialization. Recovery does not replay the source verifier; the agent runner gets cycle, validated repair context (untrusted stderr/stdout only), and durable result writes.

Observers/RPC expose activeSliceCycle and phases like repair_pending; integration only proceeds from a passed verdict in the active cycle. Tests cover multi-repair drives, corruption cases, and parallel sibling behavior.

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

@kostandinang kostandinang changed the title FE-1254: Repair failed slice verification before halting FE-1254: Repair failed slice verification Jul 23, 2026
Comment thread src/executor/agent-result.ts
Base automatically changed from ka/fe-1241-brownfield-comparison-cases to next July 23, 2026 00:52
@kostandinang kostandinang self-assigned this Jul 23, 2026
@kostandinang
kostandinang force-pushed the ka/fe-1254-slice-verification-repair branch from 372f8bf to e7cf9af Compare July 23, 2026 01:06
Comment thread src/executor/test-result.ts
Comment thread src/executor/agent-result.ts
@graphite-app

graphite-app Bot commented Jul 23, 2026

Copy link
Copy Markdown

Merge activity

  • Jul 23, 1:19 AM UTC: This pull request can not be added to the Graphite merge queue. Please try rebasing and resubmitting to merge when ready.
  • Jul 23, 1:19 AM UTC: Graphite disabled "merge when ready" on this PR due to: a merge conflict with the target branch; resolve the conflict and try again..

Comment thread src/executor/orchestrate.ts
Comment thread src/executor/observer-read.ts
Comment thread src/executor/run.ts
kostandinang and others added 4 commits July 23, 2026 03:22
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@kostandinang
kostandinang force-pushed the ka/fe-1254-slice-verification-repair branch from 59edd54 to f399cbb Compare July 23, 2026 01:22

@cursor cursor 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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit f399cbb. Configure here.

Comment thread src/executor/petri-runtime.ts
Keep durable pending repair state recoverable, report only live worker phases, and remove the unused history wrapper.

Co-authored-by: Cursor <cursoragent@cursor.com>
@kostandinang
kostandinang merged commit 9b7c9bb into next Jul 23, 2026
7 checks passed
@kostandinang
kostandinang deleted the ka/fe-1254-slice-verification-repair branch July 23, 2026 01:35
@hash-worker hash-worker Bot mentioned this pull request Jul 23, 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