Repository navigation
fix: bound path GET receipt storage - #137
Closed
LIghtJUNction wants to merge 1 commit into
Closed
LIghtJUNction wants to merge 1 commit into
LIghtJUNction wants to merge 1 commit into
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Member
Author
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.
Motivation
/g/v1path-GET flow created a durablepath_get_receiptsrow for every freshridwithout any aggregate quota or reclamation, allowing unbounded SQLite growth and potential disk exhaustion. The intent is to limit durable receipt growth while preserving idempotent replay semantics.Description
max_path_get_receipts(default100_000) toConfigand expose it in the productionmsg.confasmax_path_get_receipts.Store.claim_path_getto atomically insert a new receipt only while the total receipt count is below the configured cap using anINSERT ... SELECT ... WHERE (SELECT COUNT(*) FROM path_get_receipts) < ?pattern and to return an HTTP 507-styleStoreErrorwhen capacity is exhausted.request_idis replayed and by keeping the existing conflict checks for payload reuse.test_receipt_capacity_rejects_new_mutations_but_allows_replaysto verify that once the cap is reached new mutation requests are rejected with a capacity error while replays of existingrids still succeed.Testing
git diff --checkwith no issues.uv run ruff check src/msgd/config.py src/msgd/store.py tests/test_path_get.pywhich passed.PYTHONPATH=src uv run pytest tests/test_path_get.pyand observed8 passed.PYTHONPATH=src uv run python -m unittest discover -s tests -qand observed146 testspassing (1 skipped).Codex Task