Repository navigation
L04-05: route approved execution through one cancellation-safe mutation gateway (#37) - #215
Merged
Merged
Conversation
mberrys
force-pushed
the
l04-05-execution-gateway
branch
from
October 5, 2026 12:54
c575f67 to
a87c956
Compare
mberrys
force-pushed
the
l04-05-execution-gateway
branch
from
October 5, 2026 12:59
a87c956 to
2145d5e
Compare
pdf::executeGovernedMutation() validates the approval identity and the authorization context, refuses an already-terminal replay, checks cancellation, stages the reviewed bytes beside the destination, finalizes against the staged bytes (reopen + revalidate + sign-off), runs the beforeCommit seam and a second cancel check, commits atomically through PDFSafeFileWriter, reads back, and returns a terminal PDFGovernedMutationReceipt (schema loop.governed-mutation-receipt). Any refusal, failure, or cancel before the commit leaves no destination artifact; a failure after the commit is terminal failed with the artifact present. When a history store is supplied the gateway also scans it for replay and appends the canonical Running/Failed/Accepted chain events. Adds the gateway fault-injection matrix and the docs/change fragments.
PdfTool repair, PdfTool action-list run|batch, PageMaster exports, and the
Editor Action List worker publish through executeGovernedMutation, so each
surface's refusal/failure/cancel now stops before the destination write.
PageMaster keeps its beforeOutputCommit seam wired to the gateway's
beforeCommit; the Editor worker validates the exact staged bytes it applies
rather than a second serialization. EditorHost::confirmActionListPlan
("Approve and run") now requires the armed review, so an unreviewed plan is
refused.
Adds the per-surface refusal/cancel parity tests.
mberrys
force-pushed
the
l04-05-execution-gateway
branch
from
October 5, 2026 14:04
2145d5e to
e16a8cd
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.
Summary
L04-05 (#37), slice 5 of the L04 Governed Operation Engine stack (refs #5). Every governed mutation now goes through one Core entry point,
pdf::executeGovernedMutation(), which returns a terminalPDFGovernedMutationReceipt: validate approval + authorization (#36) -> refuse an already-terminal execution -> cancel check -> stage the reviewed bytes beside the destination -> revalidate + sign off against the staged bytes ->beforeCommitseam + cancel check -> atomic commit -> read-back -> receipt. Every refusal, failure, or cancel before the commit leaves the destination untouched; the four surfaces that previously wrote the destination first and finalized afterwards (PdfTool repair, PdfTool action-list, PageMaster, the Editor worker) now stop before partial publication.Stack position
Slice 5 of 8. Base:
l04-04-approval-binding(#214). Children stack on this branch; land bottom-up.Per-criterion: already satisfied vs built here
PDFGovernedMutationReceipt(loop.governed-mutation-receipt): statuspublished/refused/failed/cancelled, reason code, plan/source/candidate identity, destination,published_sha256(empty for nonpublication), revalidation/sign-off only when publishedbeforeCommit, staging failure, commit conflict, post-commit failure semantics) + per-surface refusal/cancel cases in the PdfTool contract, PageMaster export, and Editor host suitesconfirmActionListPlan()now refuses unlessfixExecutionArmed()(the operator reviewed the exact plan digest)Required proof
python scripts/agent/check-change.py --base 2d18b060 --head e16a8cd4 --head-branch l04-05-execution-gateway --build-dir <loop-build-l04>-> status: pass, 109/109 checks (LoopLibCore/PdfTool/LoopLibInteraction/LoopEditor/loop-pdf-worker builds, mapped suites, clang-tidy, format, changelog, architecture contracts).c575f67e. The stack rebase left this slice's own diff unchanged (patch-id verified) and the only later edit is a documentation-only fragment correction, so the proof carries for the code; CI re-runs the mapped lanes on the head above.agent-fastis authoritative.Notes
Closes #37.requireRevalidation(an unsigned export with no preflight profile) andpublishOnRevalidationFailure(forcePreflight, recorded asrevalidation-forced). They are explicit, not implicit fallbacks.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.