DL-024.3: startRun in dld-core with rollback - #45
Merged
Conversation
jimutt
force-pushed
the
feat/dld-core-startrun
branch
from
August 27, 2026 11:33
2069599 to
6a5fe0a
Compare
jimutt
marked this pull request as ready for review
August 27, 2026 11:54
DL-024 item 3. startRun(exec, root, args) in run-api.ts: reject when a run is active, parse args, guard preconditions, create, add items — with rollback to blocked on add-item failure so a half-populated run never goes live. OpenCode's rollback behavior becomes canonical, including the CRITICAL variant when the rollback itself fails. Pi's index.ts start case drops ~35 lines. OpenCode's server.ts drops ~65 lines. Both keep only the dispatch kick. Six new tests pin the start flow: reject-active, parse failure, guard failure, happy path, rollback, and the double-failure CRITICAL path. index.ts 367→342, server.ts 592→535. All suites green. Co-Authored-By: Kimi K3 <noreply@pi.dev> Generated-By: pi 0.84.2 Co-Authored-By: Kimi K3 <noreply@pi.dev> Generated-By: pi 0.84.2
jimutt
force-pushed
the
feat/dld-core-startrun
branch
from
August 27, 2026 13:21
6a5fe0a to
14348cb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
DL-024 item 3:
startRun(exec, root, args)in dld-core — the full start flow (reject-active → parse → guard → create → add items with rollback) extracted from both harnesses into core.Why
The start flow was implemented twice with drift: OpenCode had the half-populated rollback, pi didn't. Both harnesses now call
startRunand keep only the dispatch kick (pi:scheduleContinuation, OpenCode:ctx.session.prompt).What changed
startRunreturningStartOutcome—Result<{ slug, itemCount }>.Stacks on #44 (async Exec) and the lifecycle PR.
Test coverage
124 bun tests (12 for run-api including startRun), 305 bats, tsc, tessl lint — all green.