GeezerVison is showing github.com — feat(queue): standing issue↔queue coverage reconciliation (#7016) by dezren39 · Pull Request #7697 · developing-today/code
Conversation
dezren39
commented
Nov 8, 2026
•
edited by blacksmith-sh
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Closes #7016
Problem
Nothing reconciles the open-issue set against fleet-queue coverage. Issues enter the queue only when a creator-class lane files them (file + enqueue in the same pass); anything filed another way — a work lane filing a blocker mid-task, an audit lane, by hand, or predating the queue (epics) — silently never gets a queue item, so no lane ever dispositions it. The 2026-11-07 reconciliation found 23 such issues across the four repos; that day's import was a one-off.
What this adds
Broker — read-only POST /coverage. Given the open-issue set the caller just enumerated, it answers per issue whether a live task (queued/claimed/parked/blocked) holds its repo-health dedupe key in the named queue. Per Drew's doctrine (2026-11-07): a done task is not coverage (done means triage or a landed slice, not a resolved issue), and neither is a task in a *-shadow queue. It never writes tasks or events.
scripts/fleet/queue-reconcile/ — the scheduled job:
- enumerates open issues with
gh api --paginate (PRs filtered out; a partial page would read as coverage that does not exist),
- asks the broker for the diff,
- with
--import, enqueues a triage packet per uncovered issue through the sanctioned CLI path, dedupe-keyed repo-health:v1:triage:<repo>:issue:<n> so re-runs are idempotent by construction,
- observe-only by default, matching the sweeper revalidator's two-step rollout,
- a fetch or broker failure exits 3 and names the repo in an ERRORS section — it never reports as "0 uncovered".
systemd units (hourly at :41, Persistent) + a row in doc/fleet-schedule-registry.md per the same-pass rule.
AGENTS.md: the file-and-enqueue rule for issues filed outside a creator run.
Acceptance
- A scheduled reconciliation exists —
queue-coverage-reconcile.timer, hourly, persistent.
- Its first run reports 0 uncovered — pending deployment: the units are repo-shipped but not installed, and the running broker does not yet serve
/coverage (it needs a rebuild + restart). Verified end-to-end today: GitHub enumeration succeeds, the broker answers unknown command /coverage, and the script exits 3 with the repo named rather than reporting a false zero. Once the broker is redeployed the timer's first cycle produces the real number in ~/.local/state/queue-reconcile/latest.md.
- The file-and-enqueue rule is written into
AGENTS.md.
Unrelated fix included
validate.rs: FLEET_REPOS is declared [&str; 10] but holds 9 entries, so the fleet-queue lib test target does not compile at main with --all-features. CI does not build this crate, so the defect was invisible there. One-character fix; it blocks the test target this change needs.
Tests
cargo test -p fleet-queue --all-features
100 passed (lib), 2 passed (integration), 0 failed
python3 -I scripts/fleet/queue-reconcile/test_check_coverage.py
6 passed
New coverage: 4 parser cases + 2 proptest properties on the dedupe-key parser (canonical keys round-trip for every class and dispatch suffix; another repo's key never matches), and 6 offline script tests (observe imports nothing, import enqueues exactly the uncovered set, full coverage imports nothing, fetch failure is an error not a zero, packet shape, report written).
The packet the script builds validates against the live broker: repo-queue validate → packet valid (repo-task/v1).
![Autofix with [code]smith](/api/image?u=https%3A%2F%2Fcamo.githubusercontent.com%2F33b6f70f3541c4e93f4503d29cbfec051fa1b040d8e0ae9313a51c4ece44a627%2F68747470733a2f2f70722d636f6d6d656e74732d6173736574732e626c61636b736d6974682e73682f636f6465736d6974682f6175746f6669782d776974682d636f6465736d6974682d6461726b2d33782e706e67)
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Nothing reconciled the open-issue set against fleet-queue coverage, so
issues filed outside a creator run never got a queue item and no lane
ever dispositioned them. The 2026-11-07 import of 23 such issues was a
one-off; this is the standing version.
- broker: new read-only POST /coverage verb. Given the open-issue set
the caller just enumerated, it answers per issue whether a LIVE task
(queued/claimed/parked/blocked) holds its repo-health dedupe key in
the named queue. A done task is not coverage, and neither is a task
in another queue (Drew's doctrine, 2026-11-07).
- scripts/fleet/queue-reconcile/: check_coverage.py enumerates open
issues via `gh api --paginate`, asks the broker for the diff, and
(with --import) enqueues a triage packet per uncovered issue through
the sanctioned CLI path, dedupe-keyed so re-runs are idempotent.
Observe-only by default, matching the sweeper's revalidator rollout.
A fetch or broker failure exits 3 and names the repo in an ERRORS
section — it never reports as "0 uncovered".
- systemd units (hourly :41, persistent) plus a registry row.
- AGENTS.md: the file-and-enqueue rule for issues filed outside a
creator run.
Also fixes a pre-existing compile error in validate.rs: FLEET_REPOS is
declared [&str; 10] but holds 9 entries, so the fleet-queue lib test
target does not build at main with --all-features. CI does not build
this crate, so the defect was invisible there. One-character fix.
Tests: cargo test -p fleet-queue --all-features — 100 lib + 2
integration pass, incl. 4 new parser cases and 2 proptest properties
(canonical keys round-trip for every class and dispatch suffix; another
repo's key never matches). python3 -I test_check_coverage.py — 6 pass,
offline via --fixture and a stub fleet binary.
Closes #7016
coderabbitai
Bot
commented
Nov 8, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Warning
Review limit reached
You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.
Next included review available in 8 minutes.
Check out review usage here.
View limit details
-
Limit details: You’ve used the included review currently available.
Learn how review limits work.
Review configuration:
Run configuration
-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: defaults
- Review profile: CHILL
- Plan: Advanced
- Run ID:
11501df1-f80c-4ed8-a943-529c95e93cce
Commits
-
Reviewing files that changed from the base of the PR and between 0405be4 and 7f31fad.
Files selected for processing: 8
-
AGENTS.md
doc/fleet-schedule-registry.md
pkgs/fleet/crates/fleet-queue/src/turso_queue.rs
scripts/fleet/queue-reconcile/README.md
scripts/fleet/queue-reconcile/check_coverage.py
scripts/fleet/queue-reconcile/systemd/queue-coverage-reconcile.service
scripts/fleet/queue-reconcile/systemd/queue-coverage-reconcile.timer
scripts/fleet/queue-reconcile/test_check_coverage.py
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Share
-
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Codex Review Summary: ❌ Failed
This comment shows the latest Codex review activity on this pull request.
| Review |
Status |
Commit |
Review trigger |
| 📝 Code Review |
❌ Failed 2026-11-09T05:36:59.103531Z We couldn’t complete this review. Comment @codex review to try again. |
7f31fad |
New commits |
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review" or "@codex security review".
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b1356769ad
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Comment on lines
+1004
to
+1005
|
|
let marker = format!(":{repo}:issue:");
|
|
|
let start = key.find(&marker)? + marker.len();
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Recognize legacy repository aliases when matching coverage
For renamed pilot repos, existing live tasks can still carry dedupe keys using developing-today/opencode, developing-today/openchamber, or dezren39/nix, as documented in validate.rs:13-15. This exact marker search only recognizes the current repository name supplied by the reconciliation script, despite the preceding comment promising alias support. Those tasks are therefore reported as uncovered, and import mode creates duplicate triage work under a different dedupe key rather than recognizing the existing live task. Normalize the known aliases or match all equivalent names before declaring an issue uncovered.
AGENTS.md reference: AGENTS.md:L74-L78
Useful? React with 👍 / 👎.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Comment on lines
+223
to
+227
|
|
out = subprocess.run(
|
|
|
[fleet, "queue", "enqueue", str(tmp), "--queue", queue],
|
|
|
capture_output=True,
|
|
|
text=True,
|
|
|
timeout=120,
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reuse the selected broker connection for imports
When --import is combined with --broker-url or --token-file, coverage uses those options, but this enqueue subprocess receives neither setting. The fleet client independently resolves its broker from REPO_QUEUE_BROKER_URL, its local configuration, or the session proxy, and independently loads its token (pkgs/fleet/crates/fleet-queue/src/client.rs:68-103). Consequently, a run can report successful imports into a different broker while the inspected broker remains uncovered, or fail authentication despite the supplied token being valid. Pass the selected broker URL and token-file path to the child through REPO_QUEUE_BROKER_URL and REPO_QUEUE_TOKEN_FILE.
Useful? React with 👍 / 👎.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Comment on lines
+220
to
+221
|
|
tmp = Path(os.environ.get("TMPDIR", "/tmp")) / f"coverage-{packet['payload']['issue']['number']}.json"
|
|
|
tmp.write_text(json.dumps(packet))
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Allocate a unique temporary file for each enqueue
When an ad-hoc import overlaps the scheduled import or another manual invocation, both processes use the same temporary pathname for a given issue number. One can overwrite the other's packet before its fleet subprocess reads it, or delete the file during cleanup. For equal issue numbers in different repositories, the subprocess can consequently read the other repository's packet while retaining its original --queue argument; broker validation does not check repository-to-queue correspondence, so this can enqueue work into the wrong pilot queue. Allocate a unique temporary file per enqueue rather than sharing a deterministic pathname.
AGENTS.md reference: AGENTS.md:L75-L77
Useful? React with 👍 / 👎.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Comment on lines
+227
to
+229
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Handle enqueue subprocess exceptions before continuing
If an enqueue exceeds 120 seconds or the fleet executable cannot launch, subprocess.run raises TimeoutExpired or OSError rather than returning a nonzero exit code. The finally only removes the temporary file, so the exception escapes through main, skipping all remaining issues and repositories as well as report generation, leaving the previous latest.md in place. The timeout is reachable during a slow broker response because the fleet client's direct transport permits a 300-second read (pkgs/fleet/crates/fleet-queue/src/client.rs:108). Catch these exceptions and return a failed enqueue result so the existing error aggregation and reporting path can execute.
Useful? React with 👍 / 👎.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
)
- match legacy repo-name aliases (developing-today/opencode,
developing-today/openchamber, dezren39/nix) when deciding coverage,
so a live task under an old name is not reported uncovered and
re-imported under a new dedupe key;
- pass the selected broker URL and token file through
REPO_QUEUE_BROKER_URL / REPO_QUEUE_TOKEN_FILE to the enqueue child,
so imports cannot land in a different broker than the one inspected;
- use a unique temp packet per enqueue, so overlapping runs cannot
overwrite or delete each other's packet (or enqueue another repo's
packet into the wrong queue);
- treat an enqueue launch failure or timeout as a failed enqueue
instead of escaping main and skipping the remaining issues and the
report.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…e-coverage-reconciliation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Nov 21, 2026
|
AUDIT-7 Lane 4 finding (2026-11-25): PR #7697 shipped the reconciliation script and units but its own body says the first-run acceptance was pending because the units were not installed and the running broker returned unknown command /coverage. Current systemd readback is not-found / inactive. Filed issue #14929 and queued task 23719 to deploy and verify the first complete run. PR #7697 is labelled audit:gap-filed.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Nov 25, 2026
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
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.
|