GeezerVison is showing github.com — fleet(queue): packet not_before is never validated — garbage and far-future values are forwarded verbatim, and a far-future task is born unclaimable · Issue #6426 · developing-today/code
fleet(queue): packet not_before is never validated — garbage and far-future values are forwarded verbatim, and a far-future task is born unclaimable #6426Descriptionfleet(queue): packet not_before is never validated — garbage and far-future values are forwarded verbatim, and a far-future task is born unclaimable
Evidence (verified this run, origin/main a2b4345e80927cb1d8ac652756cb219b971bf635)
The top-level packet field not_before is the one scheduling field validate_packet never looks at:
- Validator —
pkgs/fleet/crates/fleet-queue/src/validate.rs: validate_packet (:433) checks the top-level title (non-empty), priority (design scale), body (word-count warning), and every payload field — but contains no reference to not_before at all. task_from_packet (:510) forwards it verbatim at :525: "not_before": packet.get("not_before").cloned().unwrap_or(Value::Null).
- Broker —
pkgs/fleet/crates/fleet-queue/src/queue_broker.rs: /enqueue (:371) copies the task's not_before into the RPC argument p_not_before unchecked. The /park path (:439-440) does the same for the park verb's not_before.
- Client park flag —
pkgs/fleet/crates/fleet-queue/src/client.rs: cmd_park (:1053) puts the raw --not-before string into the park body with no parse or range check.
- SQL —
pm-stack/opencode-claimant/migration-0023.sql: the claim predicate (:262) admits a queued task only when not_before is null or not_before <= now(); park_task assigns v_not_before := p_not_before verbatim (:161-162) with no sanity bound.
Verified on the laptop with a probe crate against the real fleet-queue crate from origin/main (probe ~/git/fleet/probe-queue-notbefore, calling the real validate_packet + task_from_packet):
packet not_before |
validate errors |
forwarded task not_before |
| absent (control) |
[] |
null |
"2026-11-06T12:00:00Z" (control) |
[] |
"2026-11-06T12:00:00Z" |
"9999-01-01T00:00:00Z" |
[] |
"9999-01-01T00:00:00Z" |
"banana" |
[] |
"banana" |
"" |
[] |
"" |
12345 (number) |
[] |
12345 |
{"x": 1} (object) |
[] |
{"x": 1} |
true (bool) |
[] |
true |
"2000-01-01T00:00:00Z" (past) |
[] |
"2000-01-01T00:00:00Z" |
Consequences, by value:
- Far-future valid timestamp (e.g.
9999-01-01, or a year typo like 2206-…) → the task enqueues successfully and then satisfies the claim predicate never (or not for years): it sits in queued counts forever while every claim returns null — a silently dead task of exactly the shape lane shifts keep reporting ("claim returned null despite queued=144+"). Sibling of fleet(queue): packet top-level max_attempts is never validated but overrides the validated payload value — a task can be born unclaimable (max_attempts <= 0) #6423's born-unclaimable max_attempts <= 0, through a different field.
- Garbage string / empty string / non-string types → no validation error names the field; the value reaches the
timestamptz RPC parameter and fails (if it fails) as a downstream database cast error, detached from the packet field that caused it — or, for a string Postgres happens to parse (date-only forms, offset-less forms interpreted in the database timezone), is stored with a meaning the producer did not intend.
- Park
--not-before has the same gap on an already-claimed task: a typo'd far-future value parks the task effectively forever with a normal-looking success response.
Relation to existing issues
Why it matters
Every producer (creators, pr-diff-review, curators, sweeps) enqueues through this validator, and not_before is the field producers use to defer work. A single typo'd year or a script emitting epoch numbers instead of timestamps produces either a task that never runs while looking perfectly queued, or an opaque database error at enqueue time. A validation error naming not_before at the packet boundary — plus the same parse check on the park flag — closes the class at the one place all producers pass through.
Acceptance criteria
-
validate_packet rejects a top-level not_before that is not a string, is empty, or does not parse as an RFC 3339 timestamp, with an error naming packet.not_before.
- A parsed
not_before beyond a documented sane horizon (proposed: 366 days from enqueue) is rejected or warned on explicitly — the bound and error-vs-warning choice are triage's call, but a year-9999 value must not silently enqueue as a normal queued task.
-
repo-queue park --not-before <garbage> is rejected with a usage error naming --not-before (exit 2), consistent with the fleet(queue): repo-queue client parser silently overwrites duplicate flags, accepts --dry-run=false as true, and silently defaults a non-numeric --limit #5939 non-numeric rejection; valid timestamps park exactly as before.
- The broker applies the same check on
/enqueue and /park, so non-CLI callers get the same guard.
- Tests pin: absent (null), a near-future timestamp, a past timestamp (accepted — immediate eligibility is legitimate), garbage, empty string, number, object, and the horizon boundary.
Activitydeveloping-today commented on Nov 6, 2026 added kind/bugSomething isn't working (prefixed form of the classic bug label) task/triageQueue packet kind: verify, reproduce, and route this item app/fleetpkgs/fleet multicall binary + platform crates on Nov 6, 2026dezren39 commented on Nov 6, 2026 🤖 Agent note · filed
- Agent: new-issue-creator (new-issue-creator-code-a)
- Session / ID: cron job new-issue-creator-code-a, run 2026-11-06T03:05:00Z
- Found via: filed this run
- Task: Filed this issue — packet top-level not_before is never checked by validate_packet and is forwarded verbatim by task_from_packet and the broker into the enqueue RPC, so a garbage value fails only as a downstream DB cast error and a far-future value enqueues a task the claim predicate (not_before <= now()) will not admit for years. Verified against the real fleet-queue crate at origin/main a2b4345 (probe ~/git/fleet/probe-queue-notbefore on the laptop: absent/near-future/past controls and far-future/garbage/empty/number/object/bool cases all errors=[] and forwarded verbatim).
- Expectation: effort s — triage decides the parse rule and the sane-horizon bound (error vs warning); done when validate_packet rejects a non-RFC-3339 not_before naming the field, park --not-before rejects garbage likewise, and tests pin the acceptance cases.
- Links: probe ~/git/fleet/probe-queue-notbefore (laptop); related issues fleet(queue): packet top-level max_attempts is never validated but overrides the validated payload value — a task can be born unclaimable (max_attempts <= 0) #6423 (top-level max_attempts), fleet(queue): repo-queue duration flags (--lease-seconds, --extend-seconds, --delay-seconds) accept 0, negative, and unbounded values — a 0/negative lease is born expired, a negative park delay defeats the park #6420 (duration flags)
dezren39 commented on Nov 6, 2026 dezren39 commented on Nov 11, 2026 🤖 Agent note · done (fixed_merged)
- Agent: queue worker (repo-worker-code), lane code-t
- Session / ID: task 10873
- Found via: queue claim
- Task: Done — PR fix(fleet-queue): validate not_before at packet, client, and broker layers (#6426) #8489 merged as 8411117; issue fleet(queue): packet not_before is never validated — garbage and far-future values are forwarded verbatim, and a far-future task is born unclaimable #6426 closed by the merge. not_before is now validated at all three layers: validate_packet (shared validate_not_before rule — non-string/empty/non-RFC3339 and >366-day-future rejected, errors naming packet.not_before), client park/revive --not-before (usage error naming --not-before, exit 2; valid values sent unchanged), and the broker dispatch gate for /park and /revive before the RPC/turso dispatch (/enqueue covered by validate_packet in both handlers).
- Verification: cargo test -p fleet-queue --all-features on the laptop — 207 lib + 2 integration passed, 0 failed, including 4 enumerated not_before tests and 5 proptest properties (calendar/round-trip/offset-equivalence/horizon/no-panic, named oracles). Codex review: 5 findings across rounds (lowercase t/z markers, unbounded offsets, unbounded year digits, silent-zero components, P1 property-test requirement) — each fixed in-PR with a reply on its thread; the final round on head 9e644bb completed with no findings.
- Expectation: none — terminal
- Links: issue fleet(queue): packet not_before is never validated — garbage and far-future values are forwarded verbatim, and a far-future task is born unclaimable #6426 · PR fix(fleet-queue): validate not_before at packet, client, and broker layers (#6426) #8489 · branch queue/10873-6426-not-before-validation
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|