Run the board reconcile twice, because adds and Status cannot land in one pass - #158
Merged
Merged
Conversation
… one pass The workflow added in #157 left newly added items at the wrong Status for a full day, and the cause is an ordering problem rather than a flaky API. Adding an item triggers project 9's own "Item added to project" workflow, which stamps a default Status asynchronously. `apply_governance.py` builds its entire plan before executing any of it, so on a run that adds anything it has already decided the Status actions before those items exist on the board. The default lands after the run finishes, and nothing corrects it until the next run. Measured on the 2026-09-17 backfill. The first pass added 40 items and made 1 Status change. A second pass immediately afterwards found 5 more waiting: #135 and #131, both labelled `status:accepted`, and #126, #113 and #112, all open pull requests. None of those five has the default as its correct Status, which is exactly the population a single pass strands. Nightly, that is up to 24 hours of a board that reads Needs triage for work that is accepted or in flight, which is the failure the board exists to prevent. The reconciler is idempotent and converges, verified by a third pass reporting zero actions, so the second pass costs one API listing on any run that added nothing. Once "Auto-add to project" is enabled on the project that is every run. Signed-off-by: Rock Lambros <rock@rockcyber.com>
rocklambros
requested review from
GangGreenTemperTatum,
afogel,
bar-capsule,
fewdisc,
mamicidal and
sclintonowasp
as code owners
September 17, 2026 21:57
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.
Follow-up to #157, fixing a defect I found by testing the merged workflow rather than one a reviewer would have caught from the diff.
The defect
A reconcile run that adds items cannot also set their Status.
Adding an item triggers project 9's own
Item added to projectworkflow, which stamps a default Status asynchronously.apply_governance.pybuilds its entire plan before executing any of it, so on a run that adds anything it has already decided the Status actions before those items exist on the board. The default lands after the run finishes and nothing corrects it until the next run.Measured, not theorised
On the 2026-09-17 backfill the first pass made 40 adds and 1 Status change. A second pass run immediately afterwards found 5 more Status corrections waiting:
status:acceptedstatus:acceptedNone of those five has the default as its correct Status, which is precisely the population a single pass strands. A third pass reported zero actions, so the tool converges, it just cannot converge in one run when it is also adding.
Nightly, that is up to 24 hours of a board reading Needs triage for work that is accepted or in flight. That is the failure the board exists to prevent, so shipping #157 without this would have left the automation quietly wrong in the one case it most needed to be right.
The fix
Run the board step twice under
--apply. The dry-run path still runs once and returns, since printing the same plan twice helps nobody.The reconciler is idempotent, so the second pass costs one API listing on a run that added nothing. Once
Auto-add to projectis enabled on the project, that is every run.Note on review
I did not admin-merge this one. #157 was merged under the administrative authorisation given for it specifically, and extending that to a second change on my own judgement is the kind of thing that should be asked for rather than assumed. The workflow is inert until the App and environment exist, so there is no urgency in merging this ahead of a normal review.