Repository navigation
feat(manager): keep the manager alive until its final post - #695
Conversation
|
Keeps one manager per pull request alive until its final post: it waits for CI, the judge and code review itself, shows the one triage comment as In progress, and the hub's CI hold is gone. Ran locally on 8bb1357: lint (no new warnings), manager/workflows/contracts tests 615 pass, hub tests with Postgres 440 pass, Findings:
Not ready: the first two findings change when a verdict is final. |
|
Re-review at a31f711. The manager now reads its wait from the head's facts ( Ran locally: lint (22 warnings, same as before, none new); typecheck not run ( Most of the earlier findings are addressed. The following remain or are new:
Earlier findings now resolved: the mixed unconfirmed rules, CI-reading policies waiting, the changed-since note, the dead Not ready: it conflicts with main, there is the re-judge gap, and there is the stopped-pass judge deploy. |
a31f711 to
c6823a6
Compare
|
Re-review at c6823a6, rebased on main. The CI state is now the one record of a CI hold, a replayed judge verdict has its Dos made again from the pass's facts, a stopped manager deploys no judge, and Checks:
All three findings from the last review are closed:
There is no new logic that infers from reason text. One finding:
Not ready until the replay waits for CI, or the owner accepts relying on the webhook for that case. |
|
Fixed in d59e216: a stored judge verdict is no longer posted while the head waits on the host again; that pass waits like the evaluate path, and a manager test covers it. |
|
Re-review at d59e216. Before replaying a stored judgement, the manager now checks whether the head is waiting on the host. The stopped-waiting branch runs after the replay. Verified:
One low finding:
|
The manager waits for its head's CI and reviewers itself and ends once its final verdict is up; the hub no longer holds heads for CI. Rules Triage could not check for its own reasons no longer hold the judge.
A head with no checks yet waits as pending while CI green is on, for two minutes from its first pass, then is read again and decided as having no CI.
…opens A pass that mails the judge also deploys code review when the rules step opens its gate and its when names every verdict; the review is still posted with the final verdict.
…waits A pass that ends waiting for CI, the judge or code review writes the triage comment as In progress, naming what it waits for, and the verdict edits it in place. The chain covers the five-minute re-read and the in-progress comment.
…omment The in-progress comment keeps the header of the verdict it replaces, so the next verdict still notes what changed since it.
Any unconfirmed rule of the host's now holds the verdict, whatever else is unconfirmed, and so does CI still running when a step reads it through a CI condition, approve or merge.
A rerun on the same head, including one through the in-progress comment, takes the note from the last verdict's header rather than the comment's text.
The reconciler counts only managers judging or reviewing toward the tenant's in-flight cap; one parked on its head's CI does not.
Whether a head waits on the host is read from its facts (CI pending where the policy reads CI, mergeability not computed where conflicts are checked); the inference over rule results is gone. A review started while CI is awaited keeps the CI wait. Early code review goes out with the judge only under when.rules any. A manager lives three hours from its claim; the pass after that decides, says what it stopped waiting for and holds every Do.
…y no judge once stopped
7082a7d to
6b6ae0a
Compare
A pull request's manager now stays alive until its head has its final verdict, and the hub no longer holds heads for CI. While the manager waits, the one triage comment shows the review as in progress.
Why the second pass on #688 posted nothing
hostPendinginrender.tscounted every machine rule that could not be checked as waiting on the host. That included code patterns on a patch Triage could not read in full, which never resolves. So on the pass after CI finished, the judge was held back and the verdict came out aswaiting. The mirror wrote only the waiting marker, which it skips while Needs Human Review is on the pull request, and a waiting verdict records no row. The manager polled once, found nothing and ended, and no later event arrived. The first post only happened because the reconciler's last retry carriednoWait. Prod logs (take, done, take, done with no deployment) and the pull request's timeline show this sequence.What changed
hostPending,waitsOnHost) is deleted. A head waits when its CI is still running (checks: "pending") and the policy reads CI anywhere: CI green, or a step's CI condition, approve or merge. It also waits when mergeability is not computed and no-merge-conflicts is on. Otherwise it never waits on CI. A rule Triage could not check itself, such as code patterns on an unread patch, neither waits nor stops the wait. The judge, done and the in-progress comment all read the same facts (hostAwaited).waitwhile the head waits for CI, or while a judge or code review it mailed has not reported. The manager ends once the head has its final verdict and the actions ran or were held. A check finishing, a reviewer's result or a new head reaches the live manager, and a new head starts the pass over.check_runthat never arrives. After 60 minutes it decides withnoWait. Its passes run out after 3 hours.when.rules: any) and itswhennames every verdict. Underrules: passthe judge's rules could still shut the gate, so review waits for the verdict. A review that starts while CI is awaited reports the CI wait too, so the 60-minute timer keeps running and the comment names both. The review is still posted with the final verdict.waitingSinceandheadSince. The portal's Waiting for CI now comes from the live manager.triage_waiting_ci, thewaitingtriage-state status and its events) and thekind: "waiting"mail are removed. Every window goes to the listener when it closes.ci: "pending" | "failure" | "cancelled" | "none") instead of being recognised from its reason text.CI_REASONS,PENDING_CIandCI_NOT_PASSEDare deleted. The comment's "Waiting for checks to finish" line groups byci === "pending". A Do held for a person, or one Triage cannot run itself, carries noci. The verdict records onlyci, and the portal works out "will run when CI finishes" (heldUntil) fromci === "pending".verdictOnFacts). So CI that turns green on the same commit lets an approve or merge run without running the judge again.decided()no longer reads actions.hostAwaitedreturns a fact (ci-starting,ci-pending,mergeability), andrender.tsturns it into text once, from the CI rule's own reasons inchecks.ts.How it was verified
All results below are on the rebased head.
bun run test:unit: 1454 pass, 0 fail. The manager tests cover:noWait;rules: passreview not deploying with the judge;cistate;ci: "pending"reads as "will run when CI finishes", and one withci: "failure"does not.bun run test:postgres: 154 pass, 1 fail. The failure is the email verification test inserver.postgres.test.ts, which this PR does not change; that file passes 11 of 11 when run alone. The hub suite on its own passes 443 of 443. Both runs that failed were made while another agent ran Postgres shards on the same local database.bun run test:dom: 11 pass.bun run test:chain: 13 pass, 0 fail, across 11 files. The chain covers:waiting.test.ts): one manager shows Waiting with the in-progress comment, judges oncecheck_runcompletes, posts the verdict into the same comment and ends;reread.test.ts): the waiting manager reads the head again within 5 minutes, and the verdict replaces the in-progress comment;woken.test.ts,judged.test.ts): the manager waits for its judge, and the verdict replaces the in-progress comment.bun run lint: 22 warnings, the same as on main.tsc --noEmit: 0 errors on triage-workflows, triage-manager, hub, web andtests/chain.Accepted
The manager is held to the local sidecar cap and sandbox overflow (CL-11587). A waiting manager holds its slot for up to 3 hours. ARCHITECTURE says what happens at the cap.
Waiting heads are re-read every 5 minutes.
Rebased onto feat(web): say in one line what Triage is waiting on or needs from you #693: a manager waiting for CI shows Waiting on CI ahead of awaiting its reviewers.
Code review is not covered by the chain test. The chain has no isolated provisioner and no review model, so code review deployed with the judge is covered by the manager tests.
Closes CL-11611