DL-024.2: Lifecycle operations in dld-core - #47
Merged
Conversation
jimutt
marked this pull request as ready for review
August 27, 2026 12:24
DL-024 item 2. pauseRun, resumeRun, stopRun, completeRun as core functions that set the status AND append the matching event. The pairing is the invariant — activeMinutes derives from run-paused / run-resumed markers, and a status change without its event silently corrupts the count. Pi's loop.ts completeRun/pauseRun/pauseAtBounds and index.ts's pause/resume/stop command path all adopt the core ops. OpenCode's server.ts replaces five inline status+event pairs with the core ops. Six new tests in run-api.test.ts pin the pairing: both calls happen, in order, and the event is skipped when the status change fails. All suites green: 110 bun, 305 bats, tsc, tessl lint. 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-lifecycle
branch
from
August 27, 2026 12:27
4b65fee to
7c88bb5
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 2: lifecycle operations in dld-core —
pauseRun,resumeRun,stopRun,completeRunthat pairsetRunStatus+appendRunEvent. The pairing is the invariant:activeMinutesderives fromrun-paused/run-resumedmarkers, and a status change without its event silently corrupts the count.Why
Pi's loop paused without writing events, so
activeMinutesover-counted paused time andmaxMinutesfired early. OpenCode paired them inline five times. Both now call the core ops.What changed
completeRun/pauseRun/pauseAtBoundsand index.ts's pause/resume/stop command path adopt them.Stacks on #44.
Test coverage
116 bun tests (6 for lifecycle ops), 305 bats, tsc, tessl lint — all green.