Skip to content

Add constraints to IoAwaitable - #383

Merged
akrzemi1 merged 2 commits into
cppalliance:developfrom
akrzemi1:ioawaitable
Aug 24, 2026
Merged

Add constraints to IoAwaitable#383
akrzemi1 merged 2 commits into
cppalliance:developfrom
akrzemi1:ioawaitable

Conversation

@akrzemi1

Copy link
Copy Markdown
Contributor

This add constraints to IoAwaitabe, so that the concept reflects what is needed for a type to be used in Capy-coroutines:

  • await_ready,
  • await_resume,
  • move construction.

This add constraints to IoAwaitabe, so that the concept reflects
what is needed for a type to be used in Capy-coroutines:

 * `await_ready`,
 * `await_resume`,
 * move construction.
@akrzemi1

Copy link
Copy Markdown
Contributor Author

This addresses #356.

@cppalliance-bot

cppalliance-bot commented Aug 23, 2026

Copy link
Copy Markdown

An automated preview of the documentation is available at https://383.capy.prtest3.cppalliance.org/index.html

If more commits are pushed to the pull request, the docs will rebuild at the same URL.

2026-08-23 23:43:19 UTC

@cppalliance-bot

cppalliance-bot commented Aug 23, 2026

Copy link
Copy Markdown

GCOVR code coverage report https://383.capy.prtest3.cppalliance.org/gcovr/index.html
LCOV code coverage report https://383.capy.prtest3.cppalliance.org/genhtml/index.html
Coverage Diff Report https://383.capy.prtest3.cppalliance.org/diff-report/index.html

Build time: 2026-08-23 23:56:36 UTC

@codecov

codecov Bot commented Aug 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.09%. Comparing base (59296c7) to head (9b957fd).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop     #383   +/-   ##
========================================
  Coverage    98.09%   98.09%           
========================================
  Files          130      130           
  Lines         6291     6291           
========================================
  Hits          6171     6171           
  Misses         120      120           
Flag Coverage Δ
linux 98.08% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
include/boost/capy/task.hpp 100.00% <ø> (ø)

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 59296c7...9b957fd. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@vinniefalco

Copy link
Copy Markdown
Member

Typo in "funciton"

Should it be convertible to bool instead of same_as<bool>?

The return value excludes typed handles (e.g. std::coroutine_handle<U>). We might want a note or something.

The Doxygen comment example drops the old semantic-requirements list about stop tokens and frame allocator propagation. Consider restoring this guidance in some form.

@akrzemi1

Copy link
Copy Markdown
Contributor Author

Typo in "funciton"

Fixed.

Should it be convertible to bool instead of same_as<bool>?

C++ awaiters are not allowed to return "convertible to bool". IoAwaitable shouldn't try to be smarter.

The return value excludes typed handles (e.g. std::coroutine_handle<U>). We might want a note or something.

My bad. I changed the concept to allow this.

The Doxygen comment example drops the old semantic-requirements list about stop tokens and frame allocator propagation. Consider restoring this guidance in some form.

They seem not to apply to the awaitable, but rather to the bodies of the resumed coroutines. Maybe instead, I will mention this in a (new) chapter which explains how to define your own coroutine?

@akrzemi1

Copy link
Copy Markdown
Contributor Author

Added an issue for restoring the removed part about the discipline of using the passed execution context:
#384

@akrzemi1
akrzemi1 merged commit 64e6c7e into cppalliance:develop Aug 24, 2026
38 of 39 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in Beast2 Aug 24, 2026
mvandeberg added a commit to mvandeberg/capy that referenced this pull request Aug 25, 2026
Maintainer decision: the Documentation workflow should not go red on doc
findings. Drops --strict from the gate step, so the job exits 0 while the
gated findings are still called out and annotated on the diff.

This required decoupling two things that were conflated. Attention (which
findings get called out and annotated) now keys on the --gate spec; failure
keys on --strict alone. Previously attention keyed on --strict, so simply
dropping it would have silently removed the annotations too -- the opposite
of the intent. --strict still works, so promoting the gate back to blocking
is a one-word change.

Also re-anchors the reseed's gate-spec extractor. It located the spec by
grepping the workflow for `check-no-new-violations.mjs --strict`, which this
commit removes; it now anchors on the step name. Left unfixed the reseed
would have aborted with "could not extract any --gate spec" -- it fails
closed, but it would have failed. Verified the extractor still recovers all
six specs.

The gate step's comment claimed the expected state was two when_any.hpp C2
refusals. Those no longer exist -- they were resolved before cppalliance#383, and the
live gated findings are cppalliance#383's own. Corrected.

Trade-off, recorded: new gated violations no longer block, so they can
accumulate until a reseed grandfathers them. That is the mechanism behind
the existing backlog. The annotations and the job summary are now the only
thing prompting a fix.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
mvandeberg added a commit to mvandeberg/capy that referenced this pull request Aug 25, 2026
… the stale "blocking" claims

The pre-authorised reseed exception named two when_any.hpp C2 refusals from
the doc-improvement branch. Those findings no longer exist -- later docstring
work resolved them before cppalliance#383 landed, and the hard C2 slice measured 0 at
64e6c7e^. A reseed run in that window would have reported `none gated` and
needed no exception at all. Anyone following the old text would have been
told to treat the real findings as regressions.

The exception is now cppalliance#383's eight, listed verbatim so the report can be
checked against them rather than trusted: seven C2 sentences over the limit
(one of 64 words) across concept/io_awaitable.hpp, 2b.syntax.adoc and
4d.io-awaitable.adoc, plus one Capy.NoFluff "In order to". Bisected to
64e6c7e -- hard C2 was 0 at its parent, 7 at the commit. Recorded as what
it is: accepting real findings against merged prose as backlog rather than
blocking on an already-merged PR, not a judgement that the prose is fine.
They surface in --show-baseline from the moment the reseed lands.

Also retires the section that described the slice as those two refusals, and
corrects four places still calling the gate "blocking" -- 4d78475 made it
report-only and did not update the docs. Adds an explicit note under "How the
gate works" saying the gate reports rather than blocks, what that costs, and
that restoring it is one --strict away.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
mvandeberg added a commit to mvandeberg/capy that referenced this pull request Aug 25, 2026
Retires 3778 stale fingerprints: 2356 vale_adoc, 1152 vale_docstrings, 193
mrdocs_warnings, 64 doc_lint A1 (+1 D2), 12 a11y. The vale removals are
dominated by rules deliberately demoted in .vale.ini (584 Google.Headings,
59 Google.Will, 56 Google.EmDash) plus the vocabulary work; the gated rules
retire in proportion to the Phase-4 pass (61 Capy.SimpleTense, 17
Capy.Terminology, 9 Capy.NoFluff). doc_lint's 64 A1 are the :page-mode:
sweep. All six per-check rows reconcile as committed - removed + added =
candidate, so nothing was silently truncated.

Adds 124. Eight match the gate spec, and they are the one hand-granted
exception this reseed exists for:

  - sentence_length :: C2:lint/.docstrings/concept/io_awaitable.hpp.adoc:cppalliance#1..cppalliance#4
  - sentence_length :: C2:modules/ROOT/pages/2.cpp20-coroutines/2b.syntax.adoc:cppalliance#1,cppalliance#2
  - sentence_length :: C2:modules/ROOT/pages/4.coroutines/4d.io-awaitable.adoc:cppalliance#1
  - vale_adoc       :: modules/ROOT/pages/4.coroutines/4d.io-awaitable.adoc:cppalliance#2:Capy.NoFluff

All eight arrived with 64e6c7e, "Add constraints to IoAwaitable (cppalliance#383)":
the hard C2 slice measured 0 at its parent and 7 at the commit, and the
Capy.NoFluff addition is in the same commit's edit to 4d.io-awaitable.adoc.
Seven over-length sentences (one of 64 words) and one "In order to". They
are real findings against merged prose. Accepting them is a maintainer
decision to carry them as backlog rather than block an already-merged PR --
not a judgement that the prose is correct. They appear in --show-baseline
output from here on, which is where they should be picked up.

Of the remaining 116 additions, 58 are advisory-C2 design-essay findings
(the deliberate Part C2 carve-out), and most of the rest are new corpus
rather than new defects: the buffers chapter was consolidated from six pages
into 5a.buffers.adoc, and detail/io_result_combinators.hpp arrived with the
io_result combinator rewrite. 21 are a11y; note only 6 are color-contrast,
so 15 sit outside the rationale STYLE_GUIDE.md E4 records for demoting that
check -- they look generator-produced rather than hand-authored, but E4's
wording does not cover them and they are now permanent.

Also removes the one-shot reseed blockquote, as it instructed, and the two
statements that depended on it: the "one pre-authorised exception" clause in
the never-reseed-to-go-green rule, and the section asserting sentence_length
has no baseline entry. It has one now -- 65 fingerprints, 7 C2 and 58
advisory-C2.

Candidate authored by CI (generatedAt 2026-08-25T18:03:26Z); a local run
differs by ~54 fingerprints on this machine alone, which is why it was not.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
mvandeberg added a commit to mvandeberg/capy that referenced this pull request Aug 25, 2026
The gate printed its comparison as JSON -- ~250 lines of which 8 mattered, none
carrying a line number or a quote, so you still had to grep the corpus to find
what broke. It now prints one block per finding: severity, file:line, rule, and
an excerpt. --show-baseline adds the grandfathered findings still present, as
warnings; --json restores the old dump. Under Actions each gated finding is
also a ::warning annotation on the diff.

Line numbers cannot live in the fingerprint -- keying on them once renamed 27
grandfathered findings from a comment-only insertion (df68f9b) -- so
baseline.mjs gains --details, a sidecar the comparator requests and the reseed
does not. Fingerprints are byte-identical either way. Docstring findings
resolve back to the .hpp through a line map from extract-docstrings.mjs, then
narrow within the block by locating the excerpt, since a doc comment can be 100
lines long.

The gate is report-only by maintainer decision. Attention keys on --gate and
failure on --strict, so restoring the block is one word. The Vale steps treat
exit 1 (alerts found, the steady state) as success and propagate exit 2, so an
annotation from them now means Vale actually broke. selftest.mjs runs in CI,
non-blocking -- it is the only thing between a silent linter regression and a
green run. Step names are standardised on "Docs:", "Lint:" and "Reseed:"; the
reseed locates its --gate spec by matching the gate step's name, so that anchor
moves too.

Stops linting detail/ prose, which mrdocs.yml marks implementation-defined: 11
of 73 extracted files, plus 33 doc comments in `namespace detail` blocks inside
public headers. The extractor now clears its output directory -- it never did,
so a header that stopped producing output left its last .adoc linted forever.

Vale vocabulary gains the domain prose it was missing and the coroutine
keywords. The keyword split is the point: io_result has a reference page, so
bare in prose it is a missing cpp: link and B1 says fix it; co_await has no
page, so that alert can never be actioned. One real misspelling is fixed rather
than whitelisted, and STYLE_GUIDE E4's a11y carve-out is extended to the three
rule classes it did not name.

Reseeds doc/lint/baseline.json from CI: retires 3845 stale fingerprints, adds
107. Eight match the gate spec and are PR cppalliance#383's, accepted as backlog rather
than blocking an already-merged PR. The one-shot reseed blockquote is removed
as it instructed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
mvandeberg added a commit to mvandeberg/capy that referenced this pull request Aug 25, 2026
The gate printed its comparison as JSON -- ~250 lines of which 8 mattered, none
carrying a line number or a quote, so you still had to grep the corpus to find
what broke. It now prints one block per finding: severity, file:line, rule, and
an excerpt. --show-baseline adds the grandfathered findings still present, as
warnings; --json restores the old dump. Under Actions each gated finding is
also a ::warning annotation on the diff.

Line numbers cannot live in the fingerprint -- keying on them once renamed 27
grandfathered findings from a comment-only insertion (df68f9b) -- so
baseline.mjs gains --details, a sidecar the comparator requests and the reseed
does not. Fingerprints are byte-identical either way. Docstring findings
resolve back to the .hpp through a line map from extract-docstrings.mjs, then
narrow within the block by locating the excerpt, since a doc comment can be 100
lines long.

The gate is report-only by maintainer decision. Attention keys on --gate and
failure on --strict, so restoring the block is one word. The Vale steps treat
exit 1 (alerts found, the steady state) as success and propagate exit 2, so an
annotation from them now means Vale actually broke. selftest.mjs runs in CI,
non-blocking -- it is the only thing between a silent linter regression and a
green run. Step names are standardised on "Docs:", "Lint:" and "Reseed:"; the
reseed locates its --gate spec by matching the gate step's name, so that anchor
moves too.

Stops linting detail/ prose, which mrdocs.yml marks implementation-defined: 11
of 73 extracted files, plus 33 doc comments in `namespace detail` blocks inside
public headers. The extractor now clears its output directory -- it never did,
so a header that stopped producing output left its last .adoc linted forever.

Vale vocabulary gains the domain prose it was missing and the coroutine
keywords. The keyword split is the point: io_result has a reference page, so
bare in prose it is a missing cpp: link and B1 says fix it; co_await has no
page, so that alert can never be actioned. One real misspelling is fixed rather
than whitelisted, and STYLE_GUIDE E4's a11y carve-out is extended to the three
rule classes it did not name.

Reseeds doc/lint/baseline.json from CI: retires 3845 stale fingerprints, adds
107. Eight match the gate spec and are PR cppalliance#383's, accepted as backlog rather
than blocking an already-merged PR. The one-shot reseed blockquote is removed
as it instructed.
mvandeberg added a commit that referenced this pull request Aug 25, 2026
The gate printed its comparison as JSON -- ~250 lines of which 8 mattered, none
carrying a line number or a quote, so you still had to grep the corpus to find
what broke. It now prints one block per finding: severity, file:line, rule, and
an excerpt. --show-baseline adds the grandfathered findings still present, as
warnings; --json restores the old dump. Under Actions each gated finding is
also a ::warning annotation on the diff.

Line numbers cannot live in the fingerprint -- keying on them once renamed 27
grandfathered findings from a comment-only insertion (df68f9b) -- so
baseline.mjs gains --details, a sidecar the comparator requests and the reseed
does not. Fingerprints are byte-identical either way. Docstring findings
resolve back to the .hpp through a line map from extract-docstrings.mjs, then
narrow within the block by locating the excerpt, since a doc comment can be 100
lines long.

The gate is report-only by maintainer decision. Attention keys on --gate and
failure on --strict, so restoring the block is one word. The Vale steps treat
exit 1 (alerts found, the steady state) as success and propagate exit 2, so an
annotation from them now means Vale actually broke. selftest.mjs runs in CI,
non-blocking -- it is the only thing between a silent linter regression and a
green run. Step names are standardised on "Docs:", "Lint:" and "Reseed:"; the
reseed locates its --gate spec by matching the gate step's name, so that anchor
moves too.

Stops linting detail/ prose, which mrdocs.yml marks implementation-defined: 11
of 73 extracted files, plus 33 doc comments in `namespace detail` blocks inside
public headers. The extractor now clears its output directory -- it never did,
so a header that stopped producing output left its last .adoc linted forever.

Vale vocabulary gains the domain prose it was missing and the coroutine
keywords. The keyword split is the point: io_result has a reference page, so
bare in prose it is a missing cpp: link and B1 says fix it; co_await has no
page, so that alert can never be actioned. One real misspelling is fixed rather
than whitelisted, and STYLE_GUIDE E4's a11y carve-out is extended to the three
rule classes it did not name.

Reseeds doc/lint/baseline.json from CI: retires 3845 stale fingerprints, adds
107. Eight match the gate spec and are PR #383's, accepted as backlog rather
than blocking an already-merged PR. The one-shot reseed blockquote is removed
as it instructed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants