Skip to content

docs(gift): stop saying the gift hook runs on every authenticated request - #454

Merged
argszero merged 1 commit into
mainfrom
docs/gift-trigger-carriers
Dec 3, 2026
Merged

argszero merged 1 commit into
mainfrom
docs/gift-trigger-carriers

Conversation

@argszero

@argszero argszero commented Dec 3, 2026

Copy link
Copy Markdown
Owner

Summary

Three carriers state that gift::ensure_daily_gift runs on every authenticated request, and that admins and operators always hold gift_balance > 0. Both halves are false. They drifted in with #261 (13898d6).

What the code does, measured on 94dd76e:

  • Three production call sites, none of them on the auth path: gateway.rs:320 (forward), gateway.rs:556 (forward_stream), routes/wallet.rs:211 (GET /api/wallet). AuthUser::from_request_parts calls dao::touch_api_key, not the gift hook.
  • The grant is limited to GIFT_DAYS = 10 days after registration (gift.rs:17, expiring at 23:59:59 each day), so "always" only holds inside that window.

Authority followed. gift.rs:6-7 states the rule: every read point that needs the spendable balance including today's gift calls ensure_daily_gift itself before reading, and the trigger points are that function's call sites rather than a list. That module header governs, and the carriers now follow it.

The change

Prose only, three files, +7/-5. The wording names the mechanism instead of restating a count that nothing keeps true:

  • ui/README.md:666-668
  • src/state_gate.rs:10770-10772
  • CHANGELOG.md:136 — the v0.7.26 entry's parenthetical. Corrected in place rather than left false, following the convention that entry itself sets: it corrects v0.7.10's disproved "raised to 70MB" claim a few paragraphs down.

Untouched on purpose, because there the same phrase is true: src/dao.rs:389/670/691 and CHANGELOG.md:149 describe dao::touch_api_key, which really does run on every authenticated request.

Tests

cargo test: 616 passed, 0 failed — the same count as the base commit, because no test asserts this prose. This axis is deliberately kept ungated (a prose claim about current behaviour is corrected as data, not pinned by a guard). cargo fmt --check and cargo clippy --all-targets -- -D warnings are clean.

citation_gate still passes: the new wording's backticked tokens (forward, forward_stream, GET /api/wallet) do not look like file names to look_like_file, so they are not read as citations.

What I could not measure. For a prose correction, "the test fails without the change" has no analogue: there is no assertion to revert and no run that would go red. The evidence here is the code reading above, not a failing-then-passing test.

…uest

Three carriers claimed gift::ensure_daily_gift runs on every authenticated
request and that admins and operators always hold gift_balance > 0. Its three
production call sites are forward, forward_stream and GET /api/wallet; the
hook is not on the auth path, and the grant only exists for GIFT_DAYS (10)
days after registration. gift.rs:6-7 already states the rule the carriers
now follow.
@argszero
argszero merged commit 0a517d4 into main Dec 3, 2026
2 checks passed
@argszero argszero mentioned this pull request Dec 3, 2026
argszero added a commit that referenced this pull request Dec 3, 2026
Five commits since v0.7.35 (#449, #451, #452, #453, #454). No schema change
(18 either side). The version string moves in the five carriers the deploy
gate guards: Cargo.toml, Cargo.lock, Dockerfile, docker-compose.yml and the
new CHANGELOG heading.

Co-authored-by: argszero <argszero@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant