Repository navigation
Description
Bug
fleet-queue packet validation (pkgs/fleet/crates/fleet-queue/src/validate.rs, match_dedupe, lines 147–215 at main 864ed8a4a) accepts non-canonical numeric spellings in dedupe_keys for the plain-number families: the number check is all_digits(s) followed by s.parse(), with no requirement that the spelling be the canonical decimal rendering of the parsed value, and no minimum of 1.
So all of these validate (valid: true) against a payload naming issue/PR/origin 5424:
repo-health:v1:fix:developing-today/code:issue:05424repo-health:v1:fix:developing-today/code:issue:0005424repo-health:v1:pr:developing-today/code:pr:05424(pr_shepherd packet,prs: [{number: 5424}])repo-health:v1:set:05424:owed:developing-today/code(pr_shepherd packet,set.origin_issue: 5424)repo-health:v1:fix:developing-today/code:issue:0against a payload withissue.number: 0— issue/PR numbers start at 1, so 0 names nothing.
This is the same canonicality class #5482 fixed for the pr-set and maintenance families (single/repeated pr-set numbers, impossible ISO weeks), left open for the plain-number families (fix, triage, pr, set origin — and pr-set parts spelled with leading zeros, e.g. 0100-5424, pass the same parse() path).
Why it matters
The dedupe_key is the queue's deduplication identity: the database treats the key string as the identity of a unit of work. …issue:5424 and …issue:05424 are different strings, so a packet spelled with leading zeros gets a fresh dedupe identity for the same issue — exactly the duplicate-work evasion the canonical-spelling rules in DEDUPE_PATTERNS_DOC (same file) exist to prevent. The validator is the gate that is supposed to keep non-canonical keys out; for these families it approves them and even confirms the parsed number matches the payload, so nothing downstream flags the second spelling.
Evidence (verified this run)
Shipped validator (laptop fleet multicall binary at main 864ed8a4a, invoked as repo-queue validate) on packets derived from the known-good packet-5424-fix.json (probe dir on laptop: ~/git/fleet/probe-dedupe-zero):
- control packet (
issue:5424):valid: true issue:05424,issue:0005424:valid: true- pr-family
pr:05424and set-familyset:05424:owed:…:valid: true issue:0with payloadissue.number: 0:valid: true- control for the overflow path: a 26-digit issue number is correctly rejected (parse failure surfaces as a number mismatch), so the gap is specifically canonical spelling / zero, not numeric parsing in general.
Dedup: #5482 (closed) covered only pr-set shapes and maintenance weeks; searches for leading-zero/canonical dedupe coverage returned no open or closed issue for the plain-number families.
Acceptance criteria
match_deduperejects any numeric component whose spelling is not the canonical decimal rendering of its value (no leading zeros) in thefix,triage,pr,pr-set, andsetfamilies.- Numeric components must be ≥ 1 (issue/PR/origin numbers start at 1);
issue:0/pr:0/set:0:owed:…do not validate. - Canonical keys (e.g.
issue:5424,pr-set:100-5424,set:5424:owed:…) validate exactly as before. - Unit tests in
validate.rspin the rejected spellings (leading zeros per family, zero) and the accepted canonical controls. cargo test -p fleet-queue --all-featuresgreen (laptop or CI; no builds on the sandbox).
Activity
developing-today commentedon Nov 4, 2026
CODE-1346
dezren39 commentedon Nov 4, 2026
🤖 Agent note · state: filed
match_dedupeaccepts leading-zero dedupe spellings (issue:05424,pr:05424,set:05424:owed:…) and number 0 in the plain-number families, giving the same issue a second dedupe identity; verified with the shippedrepo-queue validateon packets derived from packet-5424-fix.json (probe on laptop:~/git/fleet/probe-dedupe-zero, main864ed8a4a). Follow-on to fleet-queue(validate): pr-set dedupe keys accept non-canonical spellings (single/repeated number) and maintenance keys accept impossible ISO weeks (W99) #5482, which canonicalized only pr-set/maintenance.match_dedupe, pinning unit tests,cargo test -p fleet-queueon the laptop, PR + merge when green.fix(fleet-queue): dedupe keys require canonical plain numbers (#5510) (…
dezren39 commentedon Nov 4, 2026
🤖 Agent note · state: done
2b520e5fd—match_dedupenow routes every plain-number dedupe component throughcanonical_number(canonical decimal spelling, ≥ 1) across the fix/triage/pr/set families and pr-set parts. One clarification to the issue body:repo-queue validateis broker-mediated (client.rs validate_via_broker→ queue-broker/validate→validate_packet), so the pre-fix probe exercised the live broker's deployed validator, whose source is thevalidate.rsat the cited main commit; the fix takes effect for live traffic at the next queue-broker redeploy from main (same property as fleet-queue(validate): pr-set dedupe keys accept non-canonical spellings (single/repeated number) and maintenance keys accept impossible ISO weeks (W99) #5482's fix).cargo test -p fleet-queue --all-featuresgreen on the laptop (newplain_number_keys_are_canonicaltest + both fleet-queue(validate): pr-set dedupe keys accept non-canonical spellings (single/repeated number) and maintenance keys accept impossible ISO weeks (W99) #5482 tests),cargo fmt -p fleet-queue --checkclean; end-to-end probe with the worktree queue-broker on a scratch loopback bind: controlissue:5424validates,issue:05424/issue:0005424/pr:05424/set:05424:owed:…/issue:0all rejected.