Repository navigation
Tidy the small copies and wrappers in the server - #44
Merged
Merged
Conversation
The two log sources share one since-window helper, one OVERLAP and one bool-safe number reader. ZANY's stores carry their own forget, so the one-line wrappers around them go. The forget paths, the token spend records and the message JSON each live in one place. The token gate raises its 429 itself. The snapshot is measured once per reply. The check-in stream sends the same message shape as the history, so the page reads both alike. Tests share one client fixture.
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.
Closes #43
Each of these now lives in one place.
since_for,OVERLAPand a bool-safenumbersit inenvironments/__init__.pyand both log sources use themStorecarries its ownforget, and the environments usepartial(read_store, ...)andpartial(watch_store, ...), so the nine wrappers andreconcile()godb._forget_keysdoes the delete loop for both forget pathsllm.record_spendcounts the tokens for a reply and for a check-ingate.checkraises the 429 itselfmessage_jsonshapes a message for the history and the check-in stream. The stream now sends role, origin and thumb too, so the page reads a check-in withfromServerlike any other messagedescribeSettings.as_dict,EmptyAnswer.tokensand the second sentence regex go, and the learner model imports move to the top ofsituation.pyclientfixture in conftest, andevents_ofbuilds each Event from its fieldsThe stream test now checks the new fields. Ruff, the 96 server tests on a throwaway Postgres 18 and the 22 client tests all pass here. Nothing changes for students or researchers, and I'll check the live site after it deploys.