Repository navigation
factory: follow go-aheads itself — group policies and waits-on - #2524
Merged
Merged
Conversation
The desk turns a workstream's go-aheads into a factory group policy and sends factory.policy_set / factory.policy_get, gated on factory.group_policy, factory.capabilities.group_policy and factory.features. No codeaf served them, so the desk said "This codeaf can't apply go-aheads yet." The factory now keeps group policies in its store (factory-policies.json) and a job's waits_on, and an after-poll go-ahead pass starts a covered job that never ran once every job it waits on has merged, inside its allowance's cap and before its end, with no app attached. Each start is attributed (policy_run, auto_started "allowance <id>"); a covered job that waits carries blocked. Stopping, ending or withdrawing an allowance starts nothing further.
L8 end-to-end findings on #2524: - B1: codeaf factory serve's poll loop never ran the go-ahead pass. It now runs GoAheads on every tick, with or without a GitHub source, and its error never feeds the GitHub poll backoff. - B2: the manual, PROTOCOL.md and the change entry now say the app's own local factory follows go-aheads only while the app is open with its runner on (GitHub connected), and stops when the app quits. - B3: a full cap with less spent than the cap reads "its go-ahead's cap is held by jobs already running"; "its go-ahead's cap is spent" is kept for a cap actually spent. - D1: every job answer fills waiting_on in withVersionKept, factory.queue rows included, from the floor already loaded.
Member
Author
L8 engine findings fixed — 85b9439
Live L8 re-run —
|
AbirAbbas
added a commit
that referenced
this pull request
Nov 9, 2026
Brings in go-aheads (#2524) and Claude Code as a provider (#2505). Conflicts, resolved by keeping both sides: - The poll loops take the branch's failure log and app/v3's after-poll pass (factoryAfterPoll: start rules, then go-aheads). - routeAndPickUp keeps the branch's routing table and runs app/v3's go-ahead pass after it, even with Pick up issues off and no rules, so startOnItsOwn, which routing had replaced, is gone. - Wire and codec carry both the AgentField fields (run_on, agentfield, agentfield_steps, rejection, failure_summaries, source_ref) and the go-ahead fields (waits_on, waiting_on, policy_run, policy_group, blocked). - The manual keeps the routing sections and adds the go-ahead sections; the Pick up issues paragraph says a go-ahead still starts its jobs while the switch is off. Co-Authored-By: Claude Opus 5.5 <[email protected]>
AbirAbbas
pushed a commit
that referenced
this pull request
Nov 9, 2026
…an AgentField node (#2478) General intake (inbox, Jira, the routing table with an AI filter and priority order), the factory as an AgentField node whose triggers are its intake, AgentField runs as factory steps, named pipelines and a pipeline library, the engine idle-cost rounds, codeaf --events/--steer for watched harness runs, and app/v3 (#2524 go-aheads, #2505 Claude Code, #2544, #2545) merged in. Co-Authored-By: Claude Opus 5.5 <[email protected]>
ZeroPoint95
added a commit
that referenced
this pull request
Nov 10, 2026
Brings in the general factory's engine side (#2478), go-aheads (#2524) and twelve smaller PRs. Where both sides changed a file: - Accept as is, the decision pause, PR base sync and the test baseline stay, beside upstream's AgentField approvals, Reject and the no-repository hold - The idle-cost work on the stop check and step budget is upstream's (#2545); ours did the same job, so its version of those three files is dropped - A runner lost during a remote run that is owed its end queues the job instead of failing it, inside our markRunnerLost refactor Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
What
The desk turns a workstream's go-aheads into a factory group policy and calls
factory.policy_set/factory.policy_get, gated on hellofactory.group_policy,factory.capabilities.group_policyandfactory.featurescontaininggroup_policy. No codeaf served any of them, so the desk said "This codeaf can't apply go-aheads yet."Now the factory keeps and follows them itself:
factory-policies.jsonkeeps each group's whole policy (allowances with job ids,cap_usd,ends_atkept as sent,stopped, owner, version). Items gainWaitsOn,PolicyRun,PolicyGroupandBlocked.GET /v1/features,GET|PUT /v1/policy,POST /v1/jobs/{id}/waits_on. Waits are checked for loops.intake.GoAheadsruns after every poll, on all three poll paths (team serve, window floor, the app's own factory). It runs whether or not "Start on its own" is on. It starts a covered job only when all of these hold: the job never ran, is in Backlog and is not someone else's; every job it waits on has merged; its allowance is active (not stopped, before its end, inside its cap). Each started job holds its budget, lowered to what is left of the cap, so starts in one pass cannot together go over. Each start recordspolicy_run,auto_startedwith "allowance ", and the policy owner as the job's person. A covered job that is waiting carriesblocked {by, reason, job|allowance}. Stopping, ending or withdrawing an allowance starts nothing further. No pipeline or step names are involved.factory.policy_get,factory.policy_set,factory.waits_setandfactory.featuresin the desk's exact wire shape. Hello now announcesfactory.group_policyandfactory.waits_set, and capabilities saygroup_policyandwaits_on.Proof
TestADeskGoAheadStartsTheCoveredJobAfterItsParentMerges: real appwire → backend → HTTP → serve → store. A desk-shapedwaits_setandpolicy_setare sent, and the read-back equals what was sent. The after-poll pass leaves the child blocked. Once the parent merges, the child starts withpolicy_run.make pr-ready BASE=<merge-base with app/v3>is green. One cmd/codeaf test was flaky and passed on retry (TestFactoryRetryActionsDoNotReportStopped, unrelated).Not done
waiting_onis filled on a single job read and on thewaits_setanswer, not in queue rows.create_group(tagging jobs with a group) is not part of this change.