Repository navigation
feat(module): seal restricted routed-read initialization per instance - #52
Conversation
Contract 1.15 adds a no-argument RuntimeMode handshake and a routed_read_only initialization mode that serves only confidential RoutedRead, RuntimeMode, and the static capability and toolkit reads, refusing every other member before decoding its arguments. The mode allocates no client slot, preference store or archive, and rejects a stored route or state directory during admission so a host can require Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Update the vendored tinybus submodule to the latest upstream commit. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Update the pinned tinybus and tinybus-module dependencies to 0.1.3 and advance the vendored submodule to the matching commit. The lockfile also picks up a windows-sys bump and the new libc dependency pulled in by tinybus. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Add static-link tests asserting that compiled instances keep the mode they were admitted with, that reinitializing with the same mode still succeeds, and that a restricted instance refuses a mode change before it opens any state directory. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
The restricted module tests now also wait until the host reports a module in the Ready state before proceeding, instead of breaking as soon as attestation succeeds. This avoids races where the module is attested but not yet ready for the subsequent operations. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Add a setup factory that records the first admitted runtime mode and rejects later reinitializations requesting a different one, since TinyBus reuses the same callback and the mode must stay fixed for the instance. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
The inline boxed future type in the setup_factory return signature was replaced with a SetupFuture type alias, making the signature easier to read without changing behaviour. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Wrap the TinyBus mention in the setup_factory doc comment in backticks so rustdoc renders it as code rather than plain text. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
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. |
Add doc comments to the restricted TinyBus service methods and the verify_module example so the intent of each entry point is clear. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Tiny Sweeper reviewTiny Sweeper completed its review; deterministic results follow. State: Incomplete Review snapshot
Completeness: Incomplete What changedThe change introduces contract minor 1.15 and a RuntimeMode member that returns the instance's actual mode and the crate's contract version, with Compatibilty semantics now treating (1, 14) as incompatible and (1, 15) as compatible. Initialization accepts an optional runtime_mode field; when routed_read_only is selected, a supplied route or state_dir causes a parse-time rejection, and setup is routed to a separate restricted interface that registers no client slot, preference store, or archive, serves confidential RoutedRead, RuntimeMode, ListCapabilities and ListAgentReadyToolkits, and denies every other contract member as typed unknown-method before argument decoding. A per-instance setup factory records the first admitted mode and rejects any later reinitialization requesting a different mode before setup can replace the service or open state, so classic instances stay classic and restricted instances stay restricted. Dependencies on tinybus and tinybus-module move to 0.1.3, the README documents the handshake and restricted surface, a new audit document records the publication dependency and regression evidence, and the dynamic verifier now loads a restricted instance in a fresh process to check deny-by-default dispatch, the mode handshake, and mandatory confidential delivery. Features
Tests
FindingsNo active actionable findings. Lower-confidence notes
Could not review: crates/tinyconnectors/examples/verify_module.rs Before merge
How this fits togetherflowchart LR
n0["methods<br/>changed"]:::changed
n1["verify_restricted_surface"]:::impacted
n2["...separate_users_and_preserve_daily_history"]:::impacted
n3["..._performs_confidential_read_without_state"]:::impacted
n4["serve_via_setup"]:::impacted
n5["INTERFACE"]:::impacted
n1 -->|uses| n0
n1 -->|uses| n5
n2 -->|uses| n0
n2 -->|calls| n4
n2 -->|tests| n4
n3 -->|uses| n5
n4 -->|uses| n5
classDef changed fill:#0d4429,stroke:#238636,color:#e6edf3
classDef impacted fill:#161b22,stroke:#6e7681,color:#c9d1d9
classDef flagged fill:#5a1e02,stroke:#d93f0b,color:#ffffff
classDef blocking fill:#67060c,stroke:#f85149,color:#ffffff
Agent review detailscritique
security
tests
commits
description
Evidence and run details
|
There was a problem hiding this comment.
tinysweeper found nothing blocking, but could not review everything, so this is not an approval: crates/tinyconnectors/src/tinybus_module/mod.rs, tinysweeper/description.
$0.0079 · 1,775,872 in / 79,113 out · 248,384 cached (14%) · ladder/vectors-oai3, deepseek-v4.1-flash, , glm-5.3-flash · 748 embedded
critique: $0.0039 · 1,133,112 in / 25,296 out · 156,416 cached (14%) · deepseek-v4.1-flash
security: $0.0028 · 586,400 in / 33,651 out · 91,904 cached (16%) · deepseek-v4.1-flash,
tests: $0.0005 · 24,688 in / 10,944 out · 64 cached (0%) · glm-5.3-flash
description: $0.0003 · 16,912 in / 4,065 out · 0 cached (0%) · deepseek-v4.1-flash
There was a problem hiding this comment.
tinysweeper found nothing blocking, but could not review everything, so this is not an approval: crates/tinyconnectors/examples/verify_module.rs.
$0.0088 · 1,931,943 in / 95,256 out · 548,224 cached (28%) · ladder/vectors-oai3, deepseek-v4.1-flash, · 748 embedded
critique: $0.0029 · 947,856 in / 30,047 out · 265,728 cached (28%) · deepseek-v4.1-flash,
security: $0.0054 · 805,462 in / 59,804 out · 235,392 cached (29%) · deepseek-v4.1-flash
tests: $0.0002 · 84,207 in / 1,987 out · 27,904 cached (33%) · deepseek-v4.1-flash
description: $0.0001 · 60,929 in / 805 out · 19,200 cached (32%) · deepseek-v4.1-flash
Restricted module initialization
Publication dependency
TinyBus PR49 is now canonically merged at
3834e3a792bbda20795dc33b21f882eb69dda82d. A fresh canonical fetch and ancestor check proved that the exact pinned dependencyeb1c7448b9cdea72dd4e9d4281f8f0739f0308dfis upstream available. The workspace uses TinyBus 0.1.3. This PR is ready for review; all individual commits are preserved. No module release or downstream host consumption is claimed.After review, a documentation-only follow-up adds comments to the restricted methods and verifier. Strict rustdoc, formatting, diff checks, and all eight hosted Rust/docs/MSRV/supply-chain jobs pass at
c76b224a06829627266db6ff4ce7332c73dd38dc. The preceding implementation review found no actionable issues; the latest CodeRabbit job reports success with review rate limiting.Runtime behavior
Contract minor 1.15 adds RuntimeMode, reporting the actual instance mode and contract version. A safe per-instance setup factory seals the first admitted mode. Reinitialization within that mode remains compatible; attempts to change it fail before setup can replace the service or open state.
Classic mode retains its existing route, provider, preferences and archive behavior. The explicit
routed_read_onlymode rejects stored routes and state directories during configuration parsing. Its separate interface has no client slot, preference store or archive. It supports:Every other member is denied before payload decoding. Ordinary delivery of RoutedRead remains refused, even on this separate interface. The immutable per-call route owns its local client for the whole operation and never uses Configure or shared credential/cache markers. Stateful operations and provider policy remain unavailable pending admitted owned state; no supplied model policy or default preferences substitute for that authority.
Regression evidence
Actual compiled module mode-sealing tests failed with the legacy callback, including after selecting corrected SDK49. Three regressions were then confirmed against ready instances: restricted-to-classic transition, independent classic/restricted modes with compatible same-mode reinitialization, and refusal before state opening. An initial fixture that raced module readiness was corrected before recording the final RED. The per-instance factory seal makes all three GREEN.
Other tests cover readonly directory nonmutation, all denied members, confidentiality-required delivery, truthful capabilities, initialization validation, contract version/serde compatibility and classic behavior. The dynamic verifier loads classic and restricted modes in separate processes, because the cdylib owns a process-global tracing subscriber. A restricted dynamic run with a read-only working directory exited0 and left the directory empty.
Fresh verification
All commands completed successfully in the standalone owning worktree, without changing OpenHuman's shared dependencies:
Logs are under
target/debug-logs/restricted-*. Final behavior RED isrestricted-mode-all-red-final.log; corresponding GREEN isrestricted-mode-sealing-green.log. This tracked summary preserves the result if build output is cleaned.Summary by CodeRabbit