Repository navigation
docs(gift): stop saying the gift hook runs on every authenticated request - #454
Merged
Merged
Conversation
…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.
Merged
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three carriers state that
gift::ensure_daily_giftruns on every authenticated request, and that admins and operators always holdgift_balance > 0. Both halves are false. They drifted in with #261 (13898d6).What the code does, measured on
94dd76e:gateway.rs:320(forward),gateway.rs:556(forward_stream),routes/wallet.rs:211(GET /api/wallet).AuthUser::from_request_partscallsdao::touch_api_key, not the gift hook.GIFT_DAYS = 10days after registration (gift.rs:17, expiring at 23:59:59 each day), so "always" only holds inside that window.Authority followed.
gift.rs:6-7states the rule: every read point that needs the spendable balance including today's gift callsensure_daily_giftitself 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-668src/state_gate.rs:10770-10772CHANGELOG.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/691andCHANGELOG.md:149describedao::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 --checkandcargo clippy --all-targets -- -D warningsare clean.citation_gatestill passes: the new wording's backticked tokens (forward,forward_stream,GET /api/wallet) do not look like file names tolook_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.