GeezerVison is showing github.com — id(currency): RateAuthorisation::validate accepts internally inconsistent bodies — min>max, empty/inverted window, fee_bps>10000, empty/same ledgers · Issue #4071 · developing-today/code
id(currency): RateAuthorisation::validate accepts internally inconsistent bodies — min>max, empty/inverted window, fee_bps>10000, empty/same ledgers #4071Labels app/idPackage/app: id (pkgs/ or apps/ in this repo)effort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobtask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests DescriptionSummary
RateAuthorisation::validate in the new pkgs/id/src/currency.rs (PR #3888, main c3fda1c4) checks exactly two things — issuer == event author and rate_den != 0 (currency.rs:170-180). Every other internally inconsistent body folds as Live: the fold's only validity gate is this function (currency.rs:313-320), so a signed authorisation that can never legitimately convert — or that misprices every conversion — is indistinguishable from a good one for every consumer of the fold.
Evidence (verified this run, laptop probe)
Probe: ~/git/fleet/probe-2026-11-01-laneB-currency/ on the laptop — verbatim validate from currency.rs (reference copy sha256 8f68982526219dff920586495a076d2c1a33f87fe3b6716a74e561ea821b9493 @ c3fda1c4). All of these return Ok(()):
validate(min>max) -> Ok(()) min_amount 10000, max_amount 1
validate(expires_at==not_before (empty window)) -> Ok(()) 2000 / 2000
validate(expires_at<not_before) -> Ok(()) 2000 / 3000
validate(fee_bps 99999 (>100%)) -> Ok(()) fee is 999.99%
validate(empty ledgers) -> Ok(()) source_ledger "" and dest_ledger ""
validate(source==dest ledger) -> Ok(()) ABC -> ABC
validate(rate_num 0 (zero rate)) -> Ok(()) every conversion yields 0
validate(total_cap 0) -> Ok(()) cap permits nothing
validate(empty allowlist (allows nobody)) -> Ok(()) AuthorisedCallers::Allowlist([])
test validate_accepts_internally_inconsistent_bodies ... ok
(Sanity: the two documented checks do fire — rate_den = 0 returns ZeroRateDenominator.)
Why it matters
validate is the library-level contract the fold, and later the Phase 2 gateway checks (#3801: window, min/max, remaining volume at submission), rely on. A body with min_amount > max_amount, an empty/inverted validity window, or fee_bps > 10000 can never be caught downstream as "invalid" — the gateway's live-state checks would evaluate a nonsense window and nonsense bounds as if they were policy, and different consumers can disagree about shapes like a zero rate or a same-ledger "conversion". The field docs in this same file state the invariants in prose ("Rate denominator; non-zero in a valid authorisation", "Mandatory expiry", "Optional fee in basis points") — rate_den is the only one enforced.
Acceptance criteria
-
validate rejects, with named ValidateError variants: min_amount > max_amount; expires_at <= not_before; fee_bps > Some(10000); empty source_ledger or dest_ledger; source_ledger == dest_ledger.
- Shapes that are arguably legitimate-but-dead (zero
rate_num, zero total_cap, empty allowlist) are either rejected with named variants or explicitly documented as valid in the field docs — one stated rule, tested either way.
- Tests cover each rejected shape; existing currency tests still pass; the fold ignores the newly invalid bodies (covered by the existing fold-filter test pattern).
Distinct from: #3801 (gateway submission-time checks against accounts/tiers — it assumes a valid folded object), #4069 (duplicate-version fold tie-break, same file, different defect), #4063 (app_manifest parser validation, different module). Activityadded kind/bugSomething isn't working (prefixed form of the classic bug label) task/triageQueue packet kind: verify, reproduce, and route this item app/idPackage/app: id (pkgs/ or apps/ in this repo) effort/sSmall: expected under 2 hours of work on Nov 1, 2026dezren39 commented on Nov 1, 2026 🤖 Agent note · filed
- Agent: new-issue-creator-code-b
- Session / ID: new-issue-creator-code-b cron run 2026-11-01 17:20 CST
- Found via: filed this run
- Task: Filed this issue:
RateAuthorisation::validate in the new pkgs/id/src/currency.rs (PR feat(id): currency.rate_authorisation + revoke types and fold (#3800) #3888, main c3fda1c) checks only issuer and rate_den != 0 (currency.rs:170-180), so bodies with min>max, expires_at<=not_before, fee_bps 99999, empty ledgers, source==dest, zero rate, zero cap, or an empty allowlist all fold as Live. Verified on the laptop (probe ~/git/fleet/probe-2026-11-01-laneB-currency/, sha256-matched currency.rs): all nine shapes return Ok(()); the rate_den=0 control is rejected.
- Expectation: effort s; done when validate rejects the inconsistent shapes with named variants (or documents the arguably-dead ones as valid), each covered by a test.
- Links: id(currency): fold_authorisation duplicate highest version folds by input order — no deterministic tie-break #4069 id(currency): fold_authorisation duplicate highest version folds by input order — no deterministic tie-break #4069 · id(currency): gateway verification flow + revocation-set check for RateAuthorisation (Phase 2 of #2290) #3801 id(currency): gateway verification flow + revocation-set check for RateAuthorisation (Phase 2 of #2290) #3801 · id: design: RateAuthorisation as a signed ID-graph object — schema, signing, revocation #2290 id: design: RateAuthorisation as a signed ID-graph object — schema, signing, revocation #2290
dezren39 commented on Nov 10, 2026
Agent note · handed off — Agent: repo queue worker, lane code-u (repo-worker-code), task 8834.
Task 8834 (small_fix) for issue #4071 handed off to the opencode claimant per runbook §1b (execution-lane assignment row 1662 = opencode). Handoff reason: scheduled shift is time-bounded; claimant is the persistent execution session. Verified fresh (2026-11-10T06:44Z): issue #4071 OPEN, no hard-stop labels, no status/needs-triage; PR #5181 OPEN with no labels. Checkpointed handed_off and parked task 8834 for 1200s. Resume condition (unchanged): after PR #5181 merges/closes or Drew explicitly releases ownership. Branch: queue/8834-4071-rateauthorisation-validation. dezren39 commented on Nov 10, 2026
🤖 Agent note · handed off
dezren39 commented on Nov 10, 2026 🤖 Agent note · handed off
- Agent: repo queue worker, lane code-y (repo-worker-code)
- Session / ID: cron repo-queue-worker-shift-y run 2026-11-10; task 8834
- Task: task 8834 (small_fix) for issue id(currency): RateAuthorisation::validate accepts internally inconsistent bodies — min>max, empty/inverted window, fee_bps>10000, empty/same ledgers #4071 — reject internally inconsistent RateAuthorisation bodies; PR fix(id): reject invalid rate authorisations #5181 OPEN.
- Fresh check: issue id(currency): RateAuthorisation::validate accepts internally inconsistent bodies — min>max, empty/inverted window, fee_bps>10000, empty/same ledgers #4071 OPEN, no held/user/owned/do-not-merge/do-not-auto-edit labels, no status/needs-triage. PR fix(id): reject invalid rate authorisations #5181 OPEN, no hard-stop labels.
- Execution lane: opencode (lane row 1662). Handoff reason: scheduled shift is time-bounded; claimant is the persistent execution session.
- Next: claimant launches the bound opencode session. Checkpointed handed_off; parking task 8834 for 20 minutes for the claimant window.
MetadataMetadataapp/idPackage/app: id (pkgs/ or apps/ in this repo)effort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobtask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests DevelopmentNo branches or pull requestsIssue actions
|