docs: clarify semantic control documentation#27
Merged
Conversation
Signed-off-by: Robin He <git@hybscloud.com>
Signed-off-by: Robin He <git@hybscloud.com>
Signed-off-by: Robin He <git@hybscloud.com>
Signed-off-by: Robin He <git@hybscloud.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR clarifies iox’s semantic-control model (ErrMore / ErrWouldBlock vs real failures), documents “count-first” handling and helper-based classification, and codifies the boundary between wrapped API classification and exact-sentinel hot-path policy dispatch.
Changes:
- Documented semantic-control classification guidance across GoDoc and READMEs (including canonical control-loop examples).
- Added
IsFailure(err)predicate and expanded semantics tests around classification. - Added a policy test asserting wrapped
ErrMoreis returned (classifiable viaerrors.Is) but does not trigger exact-sentinel policy retry.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| semantics.go | Adds IsFailure and clarifies Outcome/Classify semantics regarding numeric ordering and wrapped sentinels. |
| semantics_test.go | Extends predicate/classification test matrix and adds a wrapped-ErrMore classification test. |
| policy_test.go | Adds coverage that wrapped ErrMore does not trigger exact-sentinel policy retry behavior. |
| io.go | Clarifies CopyN’s “bounded copy exactly n bytes” abstraction boundary in docs. |
| doc.go | Expands package-level documentation on semantic errors as control outcomes and helper-based classification. |
| README.md | Updates English docs with count-first guidance, canonical loop, helper-based classification, and exact-sentinel dispatch notes. |
| README.zh-CN.md | Mirrors the clarified semantics docs and examples in Simplified Chinese. |
| README.ja.md | Mirrors the clarified semantics docs and examples in Japanese. |
| README.fr.md | Mirrors the clarified semantics docs and examples in French. |
| README.es.md | Mirrors the clarified semantics docs and examples in Spanish. |
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.
Summary
This PR clarifies the public
ioxsemantic-control documentation forErrMore,ErrWouldBlock, and real failures. It documents count-first handling, helper-based classification, and the boundary between wrapped API classification and exact hot-path sentinel dispatch.Changes
ioxsemantic helper predicates over directerrors.Iscalls when classifyingioxsemantic-control outcomes.iox.IsMore(err)andiox.IsWouldBlock(err).