feat(runtime): korg parallel — verifiable parallel runs (fan → pick winner → seal)#20
Open
New1Direction wants to merge 1 commit into
Open
feat(runtime): korg parallel — verifiable parallel runs (fan → pick winner → seal)#20New1Direction wants to merge 1 commit into
New1Direction wants to merge 1 commit into
Conversation
…inner → seal) Fan one task across N isolated git worktrees, run the honest run_once pipeline in each, pick a winner deterministically (compiles → smallest real diff, ties to lowest index), and seal the whole fan-out as ONE korg-ledger@v1 journal that korg-verify accepts — provable parallel runs, not just compared ones. - crates/korg-runtime/src/parallel.rs: select_winner (pure, unit-tested), build_fanout_events (hash-chained causal DAG via ledger_chain primitives), run_parallel (worktree-per-candidate, loser cleanup, winner kept on a mergeable branch). - src/main.rs: `korg parallel <task> [-n N] [--repo P]` subcommand. Verified: 6/6 unit tests; e2e `korg parallel ... -n 2` on the fixture → korg-verify: 'journal VALID — 4 events, hash-chain + DAG intact'. The live multi-candidate fan-out (--provider ollama) is the user's to run.
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
korg parallel "<task>" -n N— fan one task across N isolated git worktrees, run the honestrun_oncepipeline in each, pick a winner deterministically, and seal the entire fan-out as onekorg-ledger@v1journal thatkorg-verifyaccepts.This is "compare N attempts" (table-stakes for agent IDEs) plus the thing only Korg can do: the parallel run is independently verifiable, not just eyeballed.
How
crates/korg-runtime/src/parallel.rsselect_winner— deterministic: compiles → smallest real diff → lowest index (no extra model call). Unit-tested.build_fanout_events— a hash-chained causal DAG (parallel_prompt → candidate×N → winner_selected) built from the sameledger_chainprimitivesrun_onceuses, so it verifies byte-identically.run_parallel— worktree-per-candidate, loser cleanup, winner kept on a mergeable branch.src/main.rs—korg parallel <task> [-n N] [--repo P], mirroringrun-once's provider/repo handling (--provider ollamafor live diverse candidates).Verified
korg parallel "..." -n 2on the bundled fixture →korg-verify: "journal VALID — 4 events, hash-chain + DAG intact".Not in this PR (follow-ups)
korgcertcertificate over the fan-out journal (onekorg-sealstep).