Repository navigation
docs(id): land the validated-reply contract in world_net module docs (#6670) #6780
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,6 +8,33 @@ | |
| //! Iroh proves *which node* connected. That is logged for operators but never | ||
| //! grants anything: the join capability inside the session is the only | ||
| //! authority over a world. | ||
| //! | ||
| //! ## The validated-reply contract (#6669) | ||
| //! | ||
| //! Every `WorldClient` reply extraction in this module follows one | ||
| //! contract — a reply is not its defaults: | ||
| //! | ||
| //! 1. A field that constitutes the answer is required and typed. | ||
| //! Missing or mistyped is a malformed-reply error naming the | ||
| //! field ("host sent a malformed …", "host omitted …"). Success | ||
| //! fields are never defaulted: a default that is also a real | ||
| //! value is a fabricated answer. | ||
| //! 2. Optional means absent-or-null, never mistyped: absent/`null` | ||
| //! => `None`, a correctly typed value => `Some`, anything else | ||
| //! => the rule-1 error (the `parse_module_info_reply` shape). | ||
|
Comment on lines
+22
to
+24
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| //! 3. Typed payloads are decoded at extraction, not cloned: | ||
| //! validate-then-return (`parse_caps_reply`, | ||
| //! `parse_caps_ceiling_reply`, `parse_policy_reply`). | ||
| //! 4. A list reply's entries are part of the answer: a malformed | ||
| //! entry fails the listing. A listing is complete or it errors. | ||
| //! 5. Extraction lives in `WorldClient`, never in callers. Callers | ||
| //! consume validated answers; a caller's typed decode of a | ||
| //! returned value is consumption, not validation. | ||
| //! | ||
| //! The closing inventory that dispositioned every public | ||
| //! `WorldClient` method against these rules is recorded on issue | ||
| //! #6670. A lax extraction found later is filed as a follow-up | ||
| //! issue, not patched silently and not defaulted around. | ||
|
|
||
| use std::collections::HashMap; | ||
| use std::sync::{ | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Script executed:
Repository: developing-today/code
Length of output: 3857
Script executed:
Repository: developing-today/code
Length of output: 12484
Script executed:
Repository: developing-today/code
Length of output: 16352
Web query:
site:github.com/developing-today/code/issues/6670 WorldClient validated reply inventory set_execution_profile 6777Result:
Document the profile reply exception.
set_execution_profileaccepts anexecution_profilereply with a missing or mistypedupdate, despite the stated guarantee. Describe the contract as a target and note this exception until#6777is fixed.