Repository navigation
Factory: a job can wait on other jobs' merges - #2418
Merged
Merged
Conversation
AbirAbbas
force-pushed
the
workstreams/fx-sched-waits
branch
from
November 5, 2026 18:02
98fe1b4 to
19b227d
Compare
Jobs carry the jobs they wait on, the ones not yet satisfied, whether their waits were released, and why a parent blocks them. A parent satisfies its children when its pull request merges or it ships with nothing to merge; one that fails or ends unmerged blocks them until it is fixed. The job read shows waits_on, waiting_on and blocked; Pick up issues never starts a job that waits. Co-Authored-By: Claude Opus 5.5 <[email protected]>
PUT /v1/jobs/{id}/waits_on sets or clears a Backlog job's waits, refusing
unknown jobs, the job itself, cycles and parents that ended unmerged. A
scheduler in the service rechecks waiting jobs at start, after folder changes
(at most every two seconds) and every minute, and releases a job once every
parent is satisfied. It never starts a job; a person's Start ends its waits.
/v1/about lists the waits_on feature.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
factory.waits_set sets the jobs one job waits on, outside the job-action table because its list names parents, not jobs to act on. factory.features reads what a connected factory serves from its about answer. The engine's factory capabilities say waits_on. An older factory answers factory_too_old. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ts and resets A closed issue ends its job unmerged; only a published no-change receipt satisfies children without a merge. Intake re-checks pending waits under its own admission lock. Parents the caller cannot read are refused as unknown, and a parent in another repository is named only by its job number. A start through the service retires pending waits at once, so a Drop and Bring back before the next scan cannot revive them. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…the scan loop Co-Authored-By: Claude Opus 5.5 <[email protected]>
…heck reads the plain queue Co-Authored-By: Claude Opus 5.5 <[email protected]>
…y does Co-Authored-By: Claude Opus 5.5 <[email protected]>
AbirAbbas
force-pushed
the
workstreams/fx-sched-waits
branch
from
November 5, 2026 19:17
19b227d to
b5978ca
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.
A Factory job can wait on other jobs of the same factory: it stays in Backlog until every parent's pull request has merged, then becomes startable. A parent that fails or closes unmerged blocks it, with the reason on the job. The Workstreams plan, FX-SCHED step 2 (generic Factory terms only).
What changes
WaitsOn,WaitingOn,WaitsReleased,Blocked {by, reason, since, job}. Job read:waits_on,waiting_on,blocked. The existingheldboolean (a person's queue Hold), job state,can, and the needs-you kinds (contract 2) are unchanged: a blocked job stays in Backlog.PUT /v1/jobs/{id}/waits_onsets or clears a Backlog job's waits (owner only,expectchecked). Refuses unknown jobs, the job itself, cycles, parents that already ended unmerged, more than 20, and jobs that started or were released; nothing is written on a refusal.serve/waits.go): runs at start, after factory-folder changes (at most every 2 s) and every minute; persistswaiting_on, sets or clearsblocked, and releases a job once (activity linewaits over: …). It never starts a job in this step. A person's Start on a waiting or blocked job starts it and its waits go inert./v1/aboutlistsfeatures: ["waits_on"].factory.waits_set {factory, job, waits_on, expect?}(registered outside the job-action table: its list names parents, not jobs to act on) andfactory.features {factory};factory.capabilities.waits_on. A factory without the route answersconflict/factory_too_old.Existing Factory files get only inserted lines: three
Item/Jobfields, oneFromItemcall, one intake condition, the scheduler's start/stop and route registration inserve.go, oneaboutfield, one capability field and two hello lines. No existing test edited.Validation contract → tests
waiting_on, release without a start →internal/factory/serve/waits_test.goserve/waits_test.gointernal/factory/waits_test.go,serve/waits_test.gointernal/factory/waits_test.gorundoor overrides, waits stay inert after Stop →serve/waits_test.goserve/waits_test.goserve/waits_test.gointernal/factory/intake/waits_test.gocmd/codeaf/appfactory_waits_test.go,internal/appwire/factory_waits_test.gointernal/appwire/factory_waits_test.goheldunchanged →internal/factory/api/waits_test.goNext step (separate PR): group policies that start released jobs inside an allowance and hold runs past it.
🤖 Generated with Claude Code