Repository navigation
Description
Problem
pkgs/fleet/crates/fleet-queue/src/validate.rs — match_dedupe accepts dedupe-key spellings that the validator's own pattern contract forbids, so the same queue work can be enqueued under two different "deterministic" keys and the dedupe guarantee is bypassable at validation time (the DB backstop only catches identical keys, not alternate spellings of the same coverage).
The contract is in the same file, DEDUPE_PATTERNS_DOC (validate.rs:24-30, also printed verbatim in the validator's own error messages):
pr-set: repo-health:v1:pr-set:<repo>:<n>-<n>[-...] (sorted)
maintenance: repo-health:v1:maintenance:<repo>:<kind>:<YYYY-Www>
Verified this run (shipped repo-queue validate, packets derived from the known-good packet for issue #5424)
- Single-number pr-set validates. Key
repo-health:v1:pr-set:developing-today/code:5424(kindpr_shepherd, payloadprs: [{number: 5424}]) →{"valid": true}. The doc pattern requires<n>-<n>— at least two numbers. Root cause: the pr-set arm (validate.rs:203-215) splits the tail on-and only checks every part is digits; a one-element split passes. Consequence: one PR can be enqueued as eitherpr:…:pr:5424orpr-set:…:5424— two valid keys, one unit of work, dedupe defeated. - Repeated-number pr-set validates. Key
…:pr-set:developing-today/code:5424-5424withprslisting 5424 twice →{"valid": true}. A "set" with a repeated element is not a set; the sortedness check indedupe_errors(validate.rs:337-355) treats equal neighbours as sorted, and the payload comparison compares the same duplicated list, so nothing rejects it. - Impossible ISO week validates. Key
repo-health:v1:maintenance:developing-today/code:weekly:2026-W99(kindtriage) →{"valid": true}. The week check (validate.rs:231-235) verifies only shape (YYYY-W+ two digits); ISO weeks run 01–53, soW99(andW00) name no real week — a maintenance key for a week that does not exist can never collide with the correctly-spelled key for any real week, splitting maintenance dedupe by spelling.
Controls in the same run: a proper two-number pr-set key (…:100-5424) validates, and a non-numeric pr-set tail (…:abc) is rejected with the pattern doc — the matcher is live and the shapes above are genuine holes, not a disabled validator.
Why it matters
Dedupe keys are the queue's determinism contract: producers rely on validate to guarantee one canonical key per unit of work before enqueue. Every non-canonical spelling that validates is a second key for the same work — duplicate tasks for one PR set, or a maintenance task that the correctly-keyed weekly packet cannot dedupe against.
Acceptance criteria
match_dedupe's pr-set arm requires at least two numbers, all distinct (equivalently: strictly ascending at match time, with the existingdedupe_errorssortedness/payload checks unchanged).- Maintenance keys require the ISO week number in
01..=53. - Unit tests in
validate.rspin all three rejected shapes above plus the valid controls (singlepr:key, two-number pr-set,2026-W44-style maintenance key). cargo test -p fleet-queuegreen (laptop or CI); the shippedrepo-queue validaterejects the three repro packets and still accepts the controls.
Found by new-issue-creator-code-b (Lane B) during the 2026-11-04 run; verified against the live validator binary and the source at main 49d11b5.
Activity
developing-today commentedon Nov 4, 2026
CODE-1333
dezren39 commentedon Nov 4, 2026
🤖 Agent note · filed
repo-queue validatethat pr-set dedupe keys accept a single number and a repeated number, and maintenance keys accept impossible ISO week W99 — all contrary to the pattern doc in the same file.match_dedupein pkgs/fleet/crates/fleet-queue/src/validate.rs (pr-set ≥2 distinct numbers; maintenance week 01–53), pin with unit tests, PR + merge when green.creator-b/5482-dedupe-canonical(to come)fix(fleet-queue): canonical pr-set + real ISO weeks in dedupe keys (#…
dezren39 commentedon Nov 4, 2026
🤖 Agent note · done
match_dedupepr-set arm now requires ≥2 strictly-ascending numbers, and maintenance keys require a real ISO week (01–53); two unit tests pin the rejected shapes and valid controls.cargo test -p fleet-queue --all-featuresgreen on the laptop (2 passed, validate::tests),cargo fmt -p fleet-queueapplied; single-file diff (validate.rs).creator-b/5482-dedupe-canonical(deleted on merge)