Repository navigation
docs: the pipeline-binary protocol - #523
Merged
Merged
Conversation
docs/pipeline-protocol.md writes down what the scheduler, the runners and the UI need from a pipeline binary: the subcommands and which placement needs each, describe's JSON and the registry hash, the environment, the run store's rows and rules (claim, heartbeat, ownership, fence, interrupt, cancel, timeouts, the outdated notice), the tables' summary keys, find_commit and pinned reads, the step output encoding, versions and exit codes. Each rule cites the code and says whether it is contract or incidental. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017TycszSbyw92Efu4ZeCYL6
This was referenced Nov 17, 2026
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.
Closes #518.
This adds
docs/pipeline-protocol.md, the contract between the prebuiltmorca(scheduler, runners, UI) and a pipeline binary. It's the first step towards pure-Rust pipelines (#522). Every rule cites the code at morca-mojo 0.34.0 and is marked contract (something outside the binary relies on it) or incidental (what the Mojo binary happens to do).It covers:
default/controlneedsdescribe,resume,sense/keysfor sensors and keyed pipelines, andkeep-log.MORCA_*variable, who sets it on each runner, and what the binary does with it.RunStoremethod with its SQL, and the rules for claiming, interrupting, heartbeats, ownership checks, the commit fence, cancels, timeouts, the outdated notice, DB retries, migrations and the HTTP store.orca.*summary keys and their readers,find_commit's matching rule, recorded reads/commits and pinned reads.The README's docs table links to it. Docs only, so it's labelled
no-changelog.Mismatches found while writing it (not fixed here)
morca registerrefuses output that doesn't start with exactly{"pipeline":(src/morca/_internal/registering.mojo:70).built_withsearches for"morca": "(src/morca/_internal/version.mojo:22-23). A serde_json binary's compact output would fail both. The doc tells implementers to match the spacing. Parsing the JSON instead would be more robust; that's worth considering before morca-sdk: whole pipelines in Rust, with no Mojo toolchain #521.MORCA_VERSIONis the only version check. A Rust binary would have to claim a morca-mojo version to register. A separate protocol version in describe would fix that. It's noted in the doc's Versions section as a suggestion, not a rule.state.mojodocstring names the wrong schema. It says everything lives in themorcaschema (src/morca/_internal/state.mojo:3), but every query usesorca. Itsclaimdocstring (:193-197) also leaves outdeferred, which the SQL accepts.keep-loglog line contradicts what the code does. Whenkeep-logexits nonzero, the scheduler printskeep-log exited N keeping <stage>but then removes the stage file (src/morca/_internal/tick.mojo:51-56). The worker does keep it (worker.mojo:472-478).keep-log's crash handling never runs for local and control runs. On those runnersMORCA_RUNisn't set, sokeep-logcan't fail a crashed run's attempts. The scheduler does that itself at reap time (scheduler.mojo:942-970), so nothing is lost. EC2 setsMORCA_RUNand relies on it.cancel_at(sqlite_store.mojo:111-160). A cancel only takes effect between attempts.🤖 Generated with Claude Code
https://claude.ai/code/session_017TycszSbyw92Efu4ZeCYL6