Skip to content

factory: routing says what it did, and outside work can be given a repository - #2483

Merged
santoshkumarradha merged 4 commits into
factory/general-intakefrom
factory/gi-triggers
Nov 7, 2026
Merged

santoshkumarradha merged 4 commits into
factory/general-intakefrom
factory/gi-triggers

Conversation

@santoshkumarradha

Copy link
Copy Markdown
Member

Fixes the eight engine bugs that the live audit of factory triggers found (Audit C, 2026-11-06). Each fix has a regression test.

# Fix Test
1 Start on a job with no repository is a conflict that says "say which repository the work is on", instead of an uncertain 5xx the desk dropped. factory.ErrNoRepo is checked in startRefused and classified as 409. TestStartOnAJobWithNoRepositoryIsARefusalInItsWords, TestAppFactoryAJobWithNoRepositoryIsGivenOne
2 New factory.job_set_repo {factory, job, repo, expect?}: hello word, POST /v1/jobs/{id}/repo, PROTOCOL.md and the manual. Only for a job that never ran; operator or the job's person only. It stamps that repository's steps, records RepoSetBy (a person's repository wins over a rule's), and routes the job again at once via a new serve.Config.Route. TestSetRepoGivesAJobThatNeverRanItsRepository, TestAppFactoryAJobWithNoRepositoryIsGivenOne, TestAPersonsRepositoryWinsOverARules
3 A Backlog job with no repository reads state_presentation "Waiting for a repository" with "Say which repository the work is on, or add a routing rule that sends it to one." TestABacklogJobWithNoRepositorySaysItWaitsForOne
4 A rule naming a missing pipeline never fails the intake pass, so polls no longer back off. The job stays unrouted with one routed activity row: routing rule <name>: <repo> has no pipeline <p>. routes_test answers refused with that reason, routes_set refuses the rule when the file can be read, and GitHub poll failures are logged. TestARefusedRuleWritesOneRowAndNeverFailsThePass, TestRoutesTestReportsARefusedRule, TestRoutesSetRefusesAPipelineTheRepositoryLacks, TestPreviewSaysARuleWhosePipelineIsMissingIsRefused
5 Pick up issues off no longer skips the router. It now governs only the label rule (intake.Options.LabelStarts). TestPickUpIssuesOffStillRunsTheRoutingRules, TestLabelsOffStillRoutes
6 A queued job that never ran takes job_start {pipeline}: its steps are replaced and its run is laid out again. Only a job that ran (run.Ran) is refused. The app's door goes through the same service verb. TestAQueuedJobThatNeverRanTakesAPickedPipeline
7 A Backlog rule writes routing rule <name> · Backlog. A start hold carries no autonomy_why, which was the source of the desk's "Auto stopped:" prefix. TestABacklogRuleWritesItsActivityRow, TestAStartHoldGivesNoReasonAutoStopped
8 A routed job keeps its route and steps after an edit unless a different rule matches. When one does, its pipeline applies and activity reads routing rule <new> · in place of routing rule <old> · steps …. TestAnEditedTicketKeepsItsRouteWhenNoRuleMatches, TestADifferentRuleMovesARoutedJobAndSaysSo

route.Decide stays pure, and inbox.Add is still the only door for outside work. The manual's routing, pick-up, outside-work and who-can-change sections are updated, and two new sections cover setting a repository and swapping a pipeline at Start.

Not covered here: on a team server, a signed-in teammate cannot see a job with no repository, because the repo-visibility filter hides "". Only the operator can place one there. On the desk's own factory this does not apply.

🤖 Generated with Claude Code

…pository

The audit of factory triggers (2026-11-06) found eight engine bugs:
- Start on a job with no repository is a conflict in the factory's words, never uncertain.
- factory.job_set_repo gives a job that never ran its repository and routes it again.
- A job with no repository reads "Waiting for a repository".
- A rule naming a missing pipeline writes one activity row and never fails the pass (no poll backoff); routes_test says refused; routes_set refuses it when the file can be read; GitHub poll failures are logged.
- Pick up issues off governs the label rule only; routing always runs.
- A queued job that never ran takes a picked pipeline.
- A Backlog rule writes its activity row; a start hold carries no autonomy_why.
- An edit keeps a routed job's route and steps unless a different rule matches, which is said in activity.
Pick up issues off with an empty routing table runs no intake pass at all,
as before routing; and a start hold a label made keeps its reason, so only a
routing rule's hold stops reading as Auto stopping.
@santoshkumarradha
santoshkumarradha merged commit edfb112 into factory/general-intake Nov 7, 2026
1 check passed
@santoshkumarradha
santoshkumarradha deleted the factory/gi-triggers branch November 7, 2026 01:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant