Conversation
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.
Summary
Adds
ods/tests/test_pixel_model_coordinator.py— the first coverage forods/bin/pixel_model_coordinator.py, the zero-coverage transaction coordinator that owns the model-swap lifecycle (model-status/model-begin/model-apply/model-finish) on the Pixel generation path.Why this matters
Every model switch on
public-betaflows through this coordinator: it journals a transaction, takes edge + native runtime holds, plans the target contract, applies it through the worker, verifies the runtime projection, and releases with a durable completion record. A regression here leaves the runtime held, replays a half-applied config, or reports the wrong model — exactly the class of bugs the beta needs shaken out before release.The tests drive a scripted
FakeBridge(real edge/native hold state machine, realopenclaw.jsonon disk with POSIX custody, real worker) so the coordinator's actual transaction logic runs end-to-end — nothing inside the coordinator is stubbed.What is tested (32 cases)
Request validation — unknown operations, malformed request shapes, non-hex transaction ids, invalid model targets, outcome allowlist.
Lifecycle —
model-statuson a clean runtime; fullbegin → apply → commitwith journal phases,model-completed.jsoncontent, and durable applied config; rollback restoringmodel-before.json; conflicting transaction id; idempotentmodel-beginreplay on a held journal;runtime-busyrefusal; completed-transaction replay (idempotent same-outcome finish, rejected conflicting outcome).Recovery — stale
revision→model-inspection-changed; commit whileheld→model-apply-unverified; worker returning a mismatched sha →model-projection-mismatch; pinned target after a lost apply reply →model-target-changed; lostmodel-beginreply resumesacquiring → heldinstead of restarting; lostmodel-applyreply commits by proof —model-finishverifies the already-applied config without re-dispatching apply; workerpendingwith no journal →model-recovery-journal-missing.State guards —
releasingjournal rejects apply; flipped outcome →model-outcome-conflict; corrupted journal (kind/phase/sha fields) →invalid-model-transitionfail-closed on every operation; dropped edge hold →model-hold-unconfirmed; readback disagreeing with the config projection →model-runtime-mismatch; stopped native runtime →model-runtime-unavailable; config tampered between apply and commit →model-config-changed; probe returning the wrong access mode →model-access-proof-failedwith the journal preserved (fail-closed); malformedmodel-completed.json→invalid-model-completion.Overlap check
Searched open + closed PRs for
pixel_model_coordinator, "model coordinator", "model transaction journal",model-apply/model-begin/transition.json— no existing PR touches this module. #5606 (projection()float coercion) and #3121 (upgrade-model checksum) touchpixel_model_contract.py/ upgrade paths only; this PR asserts coordinator transaction semantics, a disjoint surface. Complements my own #5668 (model contract projection tests) without overlap.Validation
Test-only change — no production code modified; revert is a single file deletion.