Docs drift sweep: post-v0.5.10 audit follow-up (#45)#52
Merged
Conversation
…amples with spec Closes the non-blocked remainder of the post-v0.5.10 full-docs audit (issue #45). Every fix is spec-authoritative — LANGUAGE_SPEC.md wins and the doc page moves to match it; no spec files are touched. Guides: channel send/recv examples now propagate Result with `?` (§8.5); select arms use the real `pattern = expr` grammar instead of the invented `recv channel` prefix form (§8.6, §16); the send_timeout match gains the missing SendError::Dead arm (§8.11a exhaustiveness); `println` swapped for the actual `print(format(...))` prelude intrinsic (§13.0); `spawn async` examples use the required block form with `.await` inside (§8.9, §16) and the JoinHandle typing follows the §8.9 convention (JoinHandle<T>, `.await?` yields T); the §8.11 per-sender FIFO guarantee is now stated in the actors guide. Web3: the reentrancy-guard gas note now carries §11.3a's SLOAD/SSTORE pre-1153 fallback language instead of declaring those forks unsupported; the onchain prohibition paragraph adds async/.await and Shared<T>; the unsupported "no references in public function parameters" rule (an §8.2 actor rule transplanted into §11) is deleted; evm-vs-svm relabels caller/self_address as universal with signer/program_id as SVM-additive (§11.2); storage-and-state drops a dynamic-length-key rule §11.1a does not state and de-version-stamps the key wording; events.md drops a stale "deferred to v0.5.0" stamp. Runbooks: the owned-params rule is scoped to &mut self methods with the &self may-take-refs carve-out (§8.2) plus a Shared<T> pointer (§4.4a); cross-target-builds splits the std::math row into integer (all targets) and float (native/wasm) per §13.2; testing-strategies de-version-stamps a "in v0.5.5" claim. Reference: the @mailbox blurb now matches §8.11a wake semantics (plain send drops silently and returns unit; only send_timeout errors) and cites §8.11a; type-conversion-rules adds the §3.11 NaN/±infinity trunc_sat rules; compiler-errors adds `vacant` to the Status vocabulary and `compile warning` to the Kind vocabulary. Stdlib: net/io gain the standard onchain-prohibition sentence; math fixes `onchain module` to `onchain mod` and adds a coarse-grained W0010 pointer; test adds i128/u128 to the Gen table and the `assert` re-export (§13.3.8); collections gains its missing targets line; crypto mentions the Blake3 lockfile dependency (§14.3). Examples/migration: from-solidity's nested-map row uses the canonical keccak256(abi.encode(key, map_slot)); cli-tool gains an fs-error From path, @derive(Deserialize) on Config, and a clone-before-match restructure to fix the borrow-then-move conflict; hello-world softens "must return" to "conventionally returns" since the spec does not mandate main's signature. Items 7, 20, 30, 32 from the issue were already absorbed by the v0.5.12 merge; item 37 was legalized by v0.5.11 contextual keywords; item 9 (log API growth) is deferred as stdlib design work, not drift. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
2 issues found across 23 files
Confidence score: 5/5
- In
docs/examples/cli-tool.md, using unqualifiedFsErrorinstead offs::FsErrorcan confuse readers copying the example and lead to avoidable compile/type-resolution errors in their own code — align it withjson::JsonError/use std::fs;before merging. - In
docs/reference/attributes.md, the§8.11acitation points to the wrong subsection, which could misdirect users on death-while-blocked mailbox semantics and cause incorrect implementation assumptions — update the reference to the correct section before merging.
Architecture diagram
sequenceDiagram
participant Dev as Developer
participant Doc as Doc Site
participant Spec as LANGUAGE_SPEC.md
participant Compiler as Compiler
participant Runtime as Runtime
participant OnChain as On-Chain VM
participant OffChain as Off-Chain Runtime
Note over Dev,OffChain: Docs Drift Audit Post-v0.5.10
Dev->>Doc: Edit docs/ files (23 files)
Dev->>Spec: Reference authoritative spec sections
Note over Doc,Spec: Cross-target build constraints
Doc->>Compiler: Enforce on-chain restrictions
Compiler->>OnChain: Block std::io, std::net
Compiler->>OnChain: Block async/.await, Shared<T>
Compiler->>OnChain: Block actor/spawn/send intrinsics
Compiler->>OffChain: Allow std::math floats, @fast_math
Compiler->>OffChain: Emit W0010 for u256 emulation
Note over Doc,Compiler: Actor & concurrency (spec §8)
Doc->>Runtime: Define mailbox semantics
Runtime->>Runtime: Lock across .await points
Runtime->>Runtime: Per-sender FIFO ordering
alt Destination dies while sender blocked
Runtime->>Dev: Plain send: drop & return ()
Runtime->>Dev: send_timeout: Err(SendError::Dead)
Runtime->>Dev: request/reply: Err(ActorError::Dead)
end
Note over Doc,Compiler: Type system & conversions (spec §3)
Spec->>Doc: Float->int trunc_sat rules
Doc->>Compiler: Non-finite -> 0/MAX/MIN
Spec->>Doc: i128/u128 type support
Doc->>Compiler: Register types in stdlib test
Note over Doc,OnChain: Storage layout (spec §11)
Spec->>Doc: Nested map key derivation
Doc->>OnChain: keccak256(abi.encode(key, map_slot))
Spec->>Doc: Remove dynamic-length key rule
Spec->>Doc: Value-typed keys only
Note over Doc,Runtime: Reentrancy guard (spec §11.3a)
Doc->>OnChain: Pre-1153 fallback to SLOAD/SSTORE
OnChain->>OnChain: Journal provides unwind-on-revert
Doc->>OnChain: Flag never observable across transactions
Note over Doc,Compiler: Diagnostic codes (spec §18)
Doc->>Compiler: Add compile warning kind
Compiler->>Doc: Classify W<NNNN> codes
Doc->>Compiler: Add vacant status
Compiler->>Doc: E1114 slot reserved never reassigned
Note over Doc,OffChain: Stdlib API surface
Doc->>OffChain: std::collections all targets
Doc->>OffChain: std::crypto Blake3 planned
Doc->>OffChain: std::test re-exports assert
Doc->>OffChain: assert_eq/ne/matches test-prelude only
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Two cubic findings on the drift-sweep PR, both valid: - cli-tool.md: Io(FsError) now Io(fs::FsError), matching the qualified ParseError(json::JsonError) pattern in the same enum and the use std::fs; import. (The FsError type itself is still unnamed by the spec - tracked in #54.) - attributes.md: the death-while-blocked mailbox semantics live in section 8.11 (Runtime Architecture), not 8.11a (Blocking Operations in Handlers, which is the FFI rule). The original audit mislabeled the subsection and the sweep propagated it; the v0.4.3 changelog row's own citation confirms 8.11. Semantics text unchanged. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
0 issues found across 2 files (changes from recent commits).
Requires human review: Contains structural changes to documentation, including code samples, cross-references, and type conversion rules. These involve domain knowledge about the spec, grammar, and correctness of examples, which require human review to ensure accuracy.
Re-trigger cubic
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
Docs-only drift sweep implementing the post-v0.5.10 full-docs audit (issue #45). Every fix is spec-authoritative:
LANGUAGE_SPEC.mdwins, the doc page moves. Nodocs/spec-plans/files, noscripts/, and no AGENTS.md files are touched (a parallel PR owns AGENTS.md).Scope changes since the issue was filed. Spec v0.5.11 (contextual keywords, grammar repair) and v0.5.12 (semantic reconciliation,
ActorIdDebug, struct literals) merged while this issue was open, which changes the disposition of five items:docs/guide/actors-and-concurrency.mdanddocs/runbooks/actor-debugging.mdalready formatActorIdwith{:?}, anddocs/stdlib/test.md:124already readsErr(ActorError::Dead)with the panic message read from the dead snapshot (DeathCause::RuntimeFailure { panic }). No edits needed.docs/stdlib/chain.md:62already reads version-neutrally ("No delegatecall (not yet specified; ...)").docs/examples/rest-api.md:58uses.send(...)in method-call position, which is an ordinary identifier under the contextual-keyword rules (§2.3/§2.7:sendis a keyword only as the first token of a send-statement). No edit needed.log::info/log::warn/log::errorusage is not a contradiction (std::logexists, native/wasm targets); growingdocs/stdlib/log.mdbeyond its stub is stdlib API design work, not drift, and is left for a dedicated issue.Spec-side notes surfaced by this sweep (no spec edits smuggled in):
onchain-overview.mdhas no basis in §11. If that rule is actually intended for on-chainpubfunctions, it needs a spec amendment — flagging here rather than keeping unsourced doc prose.storage-and-state.mdis not stated in §11.1a (SplooshMapkeys are currently value-typed, so the rule was unreachable anyway). IfString/byteskeys land later, §11.1a should gain the Solidity raw-bytes-concat rule first.load_configexample shares the From-path hole fixed incli-tool.md— it propagatesfs::read(...).context(...)?into anAppErrorthat declares no fs-error variant, and the fs error type itself is never named anywhere in the spec ordocs/stdlib/fs.md. Spec-side finding only; not edited here.Per-item disposition
send)Closes #45
Test plan
docs/(excludingdocs/spec-plans/); all zero hits:recv channel_,spawn async fetch_data,JoinHandle<Result<,Pre-1153 forks are not supported,No references in public function parameters,value-typed in v0.4.4,Dynamic-length keys,deferred to v0.5.0,for all public actor method parameters,in v0.5.5,keccak256(key ++ slot),onchain module,must return .Result,wake with Err(SendError::Dead),tx.send("hello".into());. The single remainingprintlnhit isfrom-rust.md's Rust-side mapping column (correct as-is).SendError::Deadarm + per-sender FIFO line in the actors guide,Shared<T>pointer in the ownership runbook, onchain-prohibition sentence innet.md/io.md,vacantincompiler-errors.md, W0010 pointer inmath.md, Blake3 incrypto.md,i128/u128+assertre-export intest.md, targets line incollections.md,trunc_satrules intype-conversion-rules.md.spawn async block) and the cited spec sections (§3.11, §6.3/§6.4, §8.2, §8.5, §8.6, §8.9, §8.11/§8.11a, §11.1a, §11.2, §11.3a, §13.0, §13.2, §13.3.6/§13.3.8, §14.3, §18.4).python scripts/check_prompt_budget.pyexits 0 (pre-existing WARN tier on_COREat 99.0%; no PROMPT files touched by this PR).🤖 Generated with Claude Code
Summary by cubic
Docs drift sweep aligning guides, web3, runbooks, reference, stdlib, and examples with the spec after v0.5.10 (incl. v0.5.11–v0.5.12). Completes the post‑v0.5.10 docs audit in #45.
Bug Fixes
send/recvnow returnResultin examples;send_timeoutincludesSendError::Dead; per‑sender FIFO stated;selectusespattern = expr.spawn async { ... }with inner.await;JoinHandle<T>typing fixed;print(format(...))replacesprintln.async/.awaitandShared<T>;std::io/std::netmarked unavailable; removed the unsupported “no refs in public params” rule.keccak256(abi.encode(key, map_slot)); reentrancy guard notes SLOAD/SSTORE fallback; event ABI note updated; EVM/SVM table marksctx::caller()/ctx::self_address()as universal.Refactors
@mailboxsemantics clarified: full mailbox blocks; on death, plainsenddrops and returns(),send_timeoutreturnsErr(SendError::Dead), request/reply returnsErr(ActorError::Dead); citation corrected to §8.11.trunc_sat; compiler error guide adds “compile warning” kind andvacantstatus.std::collections,std::mathints vs floats), on‑chain bans forstd::io/std::net; math notesW0010for off‑chainu256; crypto mentions Blake3; test addsi128/u128andassert.Deserialize, wiresFrom<fs::FsError>, and clones before matching; hello world softensmainreturn wording.Written for commit 91930f7. Summary will update on new commits.