feat(rivetkit-agent-os): phase 2 — stat action arm + structured-payload wrapper tests for cross-encoding parity#5193
Conversation
…ad wrapper tests for cross-encoding parity
This was referenced Jun 8, 2026
Contributor
Author
This was referenced Jun 8, 2026
Contributor
Code Review### OverviewThis PR adds the stat filesystem action to the agent-os action dispatcher and introduces cross-encoding parity tests for structured (non-byte) payloads modeled after VirtualStat. The action implementation is clean and the test coverage strategy is sound.### IssuesWeak ino u64 overflow test. Both the Rust roundtrip and TS parity tests note that ino must not silently truncate to f53, yet use 9_876_543_210 which is safely representable in f64 (2^53 is roughly 9 quadrillion, so this value is about 6 orders of magnitude below the danger zone). The test passes for the wrong reason: the encoder could silently downcast to f64 and these assertions would still be green. Use a value above 2^53 to actually exercise the invariant, e.g. 9_007_199_254_740_993 (2^53 + 1) or 18_000_000_000_000_000.Struct duplication between test files. VirtualStatFixture (in encoding_fixtures.rs) and the inline VirtualStat (in encoding_roundtrip.rs) are nearly identical 15-field structs. Defining them once in a shared test helper, or importing agent_os_client::VirtualStat directly if it derives Serialize, would eliminate the drift risk. As-is, a field added to the real VirtualStat requires three parallel updates.virtual_stat.json missing trailing newline. The fixture file is committed without a terminal newline. Minor but consistent repo convention.Phase 2 comments will rot. Per repo convention, delta-context comments like Phase 2 gate are ephemeral - future readers will not know what Phase 2 was. Strip the phase framing; the behavior is self-evident from the assertion names.### Nits- Em dash in filesystem.rs doc comment. CLAUDE.md says not to use em dashes; separate with a period instead. The existing readFile comment has the same issue but should not be propagated.- is_symbolic_link is false in the fixture test and true in the roundtrip test. Independent tests so not a correctness issue, but aligning avoids confusion when cross-referencing.- The TS test comment says Rust encode to TS decode path losslessly but the fixture is loaded as pre-decoded JSON, so the CBOR leg is covered by the Rust fixture generator, not the TS test. Worth clarifying inline.### SummaryThe action wiring (stat arm in dispatch, filesystem::stat helper) is correct and follows existing patterns. Main ask before merge: fix the ino test value so the u64-precision assertion actually exercises the invariant it claims to cover. |
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.
No description provided.