Skip to content

test: Update daemon-client doubles to the post-#5043 contract - #5105

Merged
Sinity merged 1 commit into
masterfrom
fix/daemon-client-doubles
Sep 14, 2026
Merged

Sinity merged 1 commit into
masterfrom
fix/daemon-client-doubles

Conversation

@Sinity

@Sinity Sinity commented Sep 14, 2026

Copy link
Copy Markdown
Owner

Summary

Three CLI tests asserted the daemon client's pre-#5043 construction shape.
The test doubles are updated to the real connection contract and the
credential assertion is retargeted onto the laziness the PR introduced. The
typed-indeterminate mutation assertions are unchanged.

Which merged PR moved the ground

PR #5043 (d995eb4e4, "Read verbs no longer take the exclusive
maintenance-writer lease") made two changes these tests depend on:

  • cli/operation_kernel.py:256 now passes auth_token as a lazy callable
    rather than an already-resolved value, so an absent socket costs nothing --
    least of all a write into the archive root.
  • daemon_client.py:175 now calls connection.connect() explicitly before
    resolving credentials.

TimedOutConnection and InterruptedConnection defined connected but no
connect, so both raised AttributeError instead of reaching the
indeterminate path; test_confirmed_delete_uses_an_unbounded_daemon_wait
compared the captured kwargs to {"auth_token": None}, which is now a lambda.

Solution

  • Add connect() to both connection doubles. This restores the intended
    route: connect succeeds, getresponse raises TimeoutError /
    KeyboardInterrupt, and the client must still raise
    DaemonMutationIndeterminateError. Those assertions are untouched -- a
    connected daemon with no receipt is never interchangeable with no daemon.
  • In test_confirmed_delete_uses_an_unbounded_daemon_wait, assert the kernel
    passes exactly one kwarg named auth_token, that it is callable, and that
    calling it resolves to the monkeypatched None. This is strictly stronger
    than the old equality: it pins both the argument set and the deferral.

Verification

devtools test tests/unit/cli/test_archive_query.py tests/unit/cli/test_daemon_client.py
     (run together with the other retargeted files,
      receipt 20260914T163857Z-focused-test-3135387-125edb44)
  -> all three tests in this PR green; no regression in either file
devtools verify --quick  -> exit 0, 15/15 gates

Anti-vacuity

Test Mutation that makes it red
both ..._is_typed_indeterminate let the client convert a connected-but-receiptless mutation into an ordinary abort or a no-daemon result
..._unbounded_daemon_wait resolve the token eagerly again (callable goes False), or pass any extra kwarg (the key assertion goes red)

Residuals

Test-only change. The doubles remain minimal stand-ins for
_UnixHTTPConnection; they do not track its full surface, only the calls
_request_json_response makes.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DYUNBGoE652b3nfmq3CtqK

PR #5043 (d995eb4) made auth_token a lazy callable in
cli/operation_kernel.py:256 and added an explicit connection.connect()
at daemon_client.py:175, so credentials are resolved only after the
socket is reached.

TimedOutConnection and InterruptedConnection defined connected but no
connect, so both raised AttributeError instead of reaching the
indeterminate path; give them connect(). The typed-indeterminate
assertions are untouched.

test_confirmed_delete_uses_an_unbounded_daemon_wait compared the kernel's
kwargs to {'auth_token': None}, which is now a lambda. Assert instead
that exactly one kwarg named auth_token is passed, that it is callable,
and that calling it resolves to None -- strictly stronger than the old
equality, and it pins the deferral #5043 introduced.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01DYUNBGoE652b3nfmq3CtqK
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitai Bot commented Sep 14, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 7 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: aeb71b33-926b-43bf-a02c-6b1263183738

📥 Commits

Reviewing files that changed from the base of the PR and between 513c887 and c361fa7.

📒 Files selected for processing (2)
  • tests/unit/cli/test_archive_query.py
  • tests/unit/cli/test_daemon_client.py

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 14, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ✅ Completed 2026-09-14T16:59:40.038587Z c361fa7 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Sinity
Sinity merged commit f1125f5 into master Sep 14, 2026
3 checks passed
@Sinity
Sinity deleted the fix/daemon-client-doubles branch September 14, 2026 17:07
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