Repository navigation
test(certainty): settling an uncertain fax frees its number and trunk at once - #126
Merged
Merged
Conversation
Issue #86 was seen through `faxbot status`, which reads the outbound board (GET /outbound/now), and `faxbot status ID`, which reads GET /fax/{id}; the HTTP settle test checked only Sent's details (GET /admin/fax-jobs/{id}). The test now checks all three before and after settling through POST /certainty/items/{id}/settle: before, each shows "Needs review" and the board lists the fax under needs_you; after, both fax reads show the settled state with no review notice, and the board no longer lists it. One board aggregate serves every viewer for outbound_now.AGGREGATE_SECONDS (2 seconds), so the test drops the cached aggregate before its second board read, as the next poll would see it; test_outbound_now.py does the same. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DMontgomery40
marked this pull request as ready for review
October 30, 2026 20:20
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. |
DMontgomery40
added a commit
that referenced
this pull request
Oct 30, 2026
…-81 (merge train: #126 lands first)
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.
Settling an uncertain fax ends it at once: tests for #86
The fix for #86 is already on main. It landed in #93 (
outbound_store.settle_uncertain_on, called fromcertainty_service.settle). When a person settles a fax as delivered or not delivered, its delivery ends assuccessorfailedin the same transaction, and anoperator_settledevent goes into its history. The fax leavescapacity.HOLDING, so the next fax to the same number can go straight away. #100 ended once the faxes settled before #93, #111 made "can't tell" end the fax too, and #109 made the board's Needs you follow the settling list.This PR adds no product code. It adds the tests the issue asks for, and fixes one README sentence:
test_certainty.py: the settle test'slanefixture now runs on a cloud provider (Phaxio) and on your own SIP trunk with one line. Before settling, the fax holds its number, and on the trunk the line is full. After settling as delivered, not delivered or can't tell, nothing holds the number and the trunk has a free line. The second fax to the same number gets no waiting sentence and the worker claims it. Nothing is sent again.test_certainty_http.py: the person settles throughPOST /certainty/items/{id}/settlewithsend_againfalse. The test then reads the fax three ways: Sent's details (GET /admin/fax-jobs/{id}),faxbot status ID(GET /fax/{id}) and the board thatfaxbot statusshows (GET /outbound/now). Before settling, the two fax reads show "Needs review" with its notice and the board lists the fax under Needs you. After settling, the two fax reads show what the person decided ("Failed" for not delivered, "Delivered" for delivered) with no review notice. The board no longer lists the fax under Needs you, nothing holds its number and no new fax was made.One board read is shared by every viewer for
outbound_now.AGGREGATE_SECONDS(2 seconds). That is by design, and the console polls every 5 seconds. The HTTP test therefore clears the cached board before its last read, astest_outbound_now.pydoes. This meansfaxbot statuscan still list a settled fax for up to 2 seconds after the settle.Checks on this head (2b0cbd3, on top of main 7446857)
make test-local PYTEST_ARGS='tests/test_certainty.py tests/test_certainty_http.py tests/test_outbound_now.py'(SQLite): 75 passed, 61 skipped. The skips are the PostgreSQL variants of the shareddatabasefixture: no PostgreSQL URL was set, and this PR has no schema change.secret-scan.sh origin/main: no suspicious added lines.-k, then restored the file withgit checkout:certainty_service.settleno longer callssettle_uncertain_on, which is how settling behaved before fix(certainty): settling an uncertain fax ends it and frees its number at once (#86) #93. 8 failed: all six SQLitelanecases (Phaxio and trunk, three outcomes) and both HTTP cases. Each failed on the delivery state still beingreconciliation_required._open_itemcounts settled items as open. 2 failed: both HTTP cases, at the board assertion. This assertion checks that the board follows the item's state; it does not depend on the delivery being released.capacity.HOLDINGalso countsfailedandsuccess, so a settled fax keeps holding its number. 8 failed: all sixlanecases and both HTTP cases, at the holds assertion.Not checked
Closes #86
🤖 Generated with Claude Code