Repository navigation
fix(platform): check a managed dispatch before anything is written - #4995
Merged
Merged
Conversation
Managed configuration writes a project's dispatch last, after the schedules the same declaration may switch off, and the platform checked what a dispatch names (the project's agents, the standing roles' open tasks, the labels of its filters and gates, its schedules) only when it saved it. A dispatch it refused there left the rest applied: a fleet's old automations switched off and no dispatch started in their place. The save's checks are now one step, which a new check route runs without writing anything (no document, audit, pass or hint), answering what the save would answer or the fields it would refuse. The CLI asks it for every changed dispatch while planning and in apply's pass before any write, so a dispatch the platform would refuse stops the declaration before anything is written. The refusal names the declared fields, such as gates.0.labels.0, never the platform's words. TASK-R61, with the docs in English, German and French, the manual reference and a line in the v0.5.92 notes; both halves ship in v0.5.92 with the endpoint itself.
yannickmonney
enabled auto-merge
October 15, 2026 07:22
yannickmonney
added this pull request to the merge queue
Oct 15, 2026
This was referenced Oct 15, 2026
5 tasks done
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.
Managed configuration writes a project's dispatch last, after the schedules the same declaration may switch off. The platform checked what a dispatch names only when it saved it, so a dispatch it refused at that point left the rest of the declaration applied. The project's agents, the standing roles' open tasks, the labels of its filters and gates, and its schedules were all checked only then. For the Ops fleet this would have meant six automations switched off and no dispatch in their place, had the project lacked the
optional-cilabel itscigate names.What changes
prepareDispatchSave. They cover who may administer the project, an active project, the reviewed hash, a stored document this image can read, and what the document names.POST /api/app/tasks/dispatch/by-project/{projectId}/configuration/checkruns that step and writes nothing: no document, audit, pass or hint. It answers{ok: true, changed, hash}, exactly what the save would answer, or{ok: false, issues}. A caller who may not administer the project, or a stale hash, is refused as the save refuses them.checkResourceChangeasks the check for every changedproject-dispatch. That happens while planning, and in apply's pass over all resources before the journal and any write. A refused dispatch stops the declaration before anything is written. The refusal names the declared fields (gates.0.labels.0, deduplicated, and only paths shaped like the declaration's). Native text never becomes a diagnostic. An unchanged dispatch is never asked about.Both halves belong in v0.5.92, the release that introduces the dispatch facet, so no CLI ever meets a platform with the facet but without the check.
Proof
checkFleetDispatch97/97 locally. The new check refuses the gate's missing label atgates.0.labels.0, the stored dispatch and its audit count stay unchanged, and once the label exists the check answers the hash the save then stores.dispatch-config.test.ts12/12. Routing the check through the real save fails 2 of them.src/lib/config299/299 andsrc/lib/deployment955 (0 fail). Removing the CLI wiring fails 4.tasks,rest,openapiand guards: 3,006 tests, guards 288/288 (domain-spec 15/15).lint:manual,lint:links, and the v0.5.92 notes validator all pass.