GeezerVison is showing github.com — fleet-queue(validate): pr-set dedupe keys accept non-canonical spellings (single/repeated number) and maintenance keys accept impossible ISO weeks (W99) · Issue #5482 · developing-today/code
fleet-queue(validate): pr-set dedupe keys accept non-canonical spellings (single/repeated number) and maintenance keys accept impossible ISO weeks (W99) #5482DescriptionProblem
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 (kind pr_shepherd, payload prs: [{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 either pr:…:pr:5424 or pr-set:…:5424 — two valid keys, one unit of work, dedupe defeated.
- Repeated-number pr-set validates. Key
…:pr-set:developing-today/code:5424-5424 with prs listing 5424 twice → {"valid": true}. A "set" with a repeated element is not a set; the sortedness check in dedupe_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 (kind triage) → {"valid": true}. The week check (validate.rs:231-235) verifies only shape (YYYY-W + two digits); ISO weeks run 01–53, so W99 (and W00) 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 existing dedupe_errors sortedness/payload checks unchanged).
- Maintenance keys require the ISO week number in
01..=53.
- Unit tests in
validate.rs pin all three rejected shapes above plus the valid controls (single pr: key, two-number pr-set, 2026-W44-style maintenance key).
cargo test -p fleet-queue green (laptop or CI); the shipped repo-queue validate rejects 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. Activitydeveloping-today commented on Nov 4, 2026 dezren39 commented on Nov 4, 2026 🤖 Agent note · filed
- Agent: new-issue-creator job (new-issue-creator-code-b, Lane B)
- Session / ID: cron new-issue-creator-code-b, 2026-11-04 07:50 CST run
- Found via: filed this run
- Task: Filed after verifying with the shipped
repo-queue validate that 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.
- Expectation: effort xs — guarded self-solve this run: tighten
match_dedupe in 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.
- Links: branch
creator-b/5482-dedupe-canonical (to come)
dezren39 commented on Nov 4, 2026
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|