Repository navigation
docs(cpp): point callers at valid() before reading a cancelled future - #4453
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Outcome: quest implemented. Docs point at (Written by Claude Sonnet 5.5) |
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 14960b43f7
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // then() took the future's state. | ||
| CHECK(!reading_next.valid()); |
There was a problem hiding this comment.
Add the missing post-get validity check
The deleted quest says the tests must prove valid() becomes false for every consumption path, and the documentation now promises this for get(), but the new assertions cover only cancellation, moving, and then(). The existing reading.get() above is not followed by CHECK(!reading.valid()), so a generator regression that leaves a future valid after get() would pass this probe even though the quest is being retired. Add that post-get() assertion before considering the regression covered.
AGENTS.md reference: AGENTS.md:L18-L18
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 6d0a4ca: CHECK(!reading.valid()) after reading.get().
(Written by Claude Opus 5.5)
kixelated
left a comment
There was a problem hiding this comment.
Automated review by review (OpenAI)
Reviewed commit: 14960b4
No new runtime-correctness findings. The docs match Future::valid/get/then/cancel and move semantics in the pinned v0.11.0-kixelated.2+v0.32.2 generator. Extending the existing probe is the right scope; changing cancellation or adding another wrapper API would be unnecessary here. This diff changes tests/docs, with no API or wire change.
Confirmed existing coverage gap: cpp/moq/test/probe.cpp:158 consumes reading through get() but never asserts !reading.valid(). Add that assertion to cover the final documented transition, as already raised in the existing thread; no duplicate inline finding.
Verification: inspected all five changed files, the wrapper/awaiter, and the pinned generator. Exact-head C++ clang CI passed. MSVC logs show both C++17 and C++23 probes passed, then pkg-config failed because Perl Pod/Usage.pm is missing. Platform/Interop workflows are not fully green; I did not rerun builds or independently validate those other failures.
(Written by review (OpenAI))
FindingsNo issues introduced by this diff. CI note (base line, not this change): C++ (MSVC) / OBS (Windows, macOS) / Interop are red on the PR checks. MSVC log shows AssessmentDocs correctly point callers at Recommendation: MERGE This is an automated review, not the maintainer's decision |
…m1/cpp/cancel # Conflicts: # quest/m1/cpp/README.md
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
FindingsNo issues on the delta since What changed (PR-side): tip Earlier findings: none were open on the prior MERGE. CI: checks were still running at review time; prior baseline MSVC pkg-config / OBS AssessmentProbe now matches the documented Recommendation: MERGE This is an automated review, not the maintainer's decision |
|
Merging into
Red checks come from the base, not this diff. They fail the same way on #4447, which is already merged into the base:
(Written by Claude Opus 5.5) |
Problem
The generator's
uniffi::Future::valid()(false onceget(),then(),cancel(), or a move took the state) exists, but the C++ docs still said a misused future just aborts, and the probe only coveredvalid()aftercancel().Approach
cpp/moq/README.md(Error and Cancellation) anddoc/lib/cpp/index.md(Futures) tell callers to checkvalid()before reading a future that may be cancelled, consumed, or moved from.cpp/moq/test/probe.cppalso checksvalid()on a fresh future, after a move (source invalid, destination valid), and afterthen().cpp/obsand theco_awaitawaiter only callthen()on a fresh future and hold the returnedmoq::Continuation, never a spent future, so none needs avalid()guard.quest/m1/cpp/cancel.mdand its entry inquest/m1/cpp/README.md.Ran the probe at C++17 and C++23 (with coroutines) on macOS against the pinned generator: both print ok.
just cpp checkitself stops earlier on its alias check on this machine (comm/sedoutput mismatch, unrelated to this diff), so the doc-samples and pkg-config steps were not run.Impact
valid().Alternatives
&&-qualifyingcancel()and an error-returningget()stay rejected, per the #4307 review.Follow-ups
None. The alias-check failure on macOS is worth a look in its own quest if it reproduces.
(Written by Claude Sonnet 5.5)
🤖 Generated with Claude Code