DL-024.4: CompletionTracker in dld-core - #46
Merged
Conversation
jimutt
force-pushed
the
feat/dld-core-completion
branch
from
August 27, 2026 11:41
a59c90e to
ed18d30
Compare
jimutt
marked this pull request as ready for review
August 27, 2026 13:16
DL-024 item 4. The completion transaction (find verifying item with new evidence → verify → review nag or accept→repin→event → retry or block+pause) extracted from both harness loops into a single core class. The tracker owns the memoization (verifiedAtEvidence, reviewNagged) and returns a discriminated-union outcome the harness renders. Pi's loop.ts onTurnEnd drops from ~90 lines of inline transaction to a switch over the outcome. OpenCode's server.ts runCompletionTransaction drops from ~120 lines to the same. Both harnesses keep only delivery: pi notifies + cards, OpenCode sends synthetic messages. The tracker's blocked path pauses the run; the retry path clears OpenCode's dispatch guard. Empty verify output falls back to 'verification failed' — block-item.sh rejects an empty --reason. Eight new core tests pin the transaction. server.ts 535→471, loop.ts 306→259. 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-completion
branch
from
August 27, 2026 13:21
ed18d30 to
c2a3605
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 4:
CompletionTrackerin dld-core — the four-part completion transaction (verify → review-nag or accept→repin→event → retry or block+pause) extracted from both harness loops into a single tested core class.Why
The transaction was maintained twice by hand and had drifted: pi had no
infrastructurebranch, OpenCode had no pause-on-block, and the memoization (verifiedAtEvidence, reviewNagged) was per-harness. Now one implementation, one set of semantics, eight tests.What changed
CompletionTrackerwith astep()method returning a discriminated-unionCompletionOutcome.onTurnEnddrops ~90 lines → a switch over the outcome mapping toui.notify+ui.card.runCompletionTransactiondrops ~100 lines → the same switch mapping toctx.session.synthetic."verification failed"(block-item.sh rejects empty--reason).server.ts 535→471, loop.ts 306→259. Stacks on #45.
Test coverage
124 bun tests (8 for CompletionTracker), 305 bats, tsc, tessl lint — all green.