test: harden G2 conformance invariants - #5
Open
BunsDev wants to merge 3 commits into
Open
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR strengthens the G2 conformance and property-test suites by removing hard-coded assumptions about session identifiers, asserting stronger durability invariants (especially around reconciliation and request-digest mismatches), and expanding content-size validation to the full signed 64-bit range.
Changes:
- Introduces
scripted_fixture_with_session_idand updates suites/tests to accept opaque, caller-chosen session IDs. - Hardens invariants around reconciliation and request-digest mismatch handling to ensure durable adoption state is not mutated by failed/forged operations.
- Expands
ContentAddressedReferencesize validation from JS safe-integer bounds toi64::MAX, and updates tests accordingly.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| crates/psyche-test-support/tests/state_machine.rs | Updates state-machine property tests to use opaque session IDs and to assert durable adoption invariants across reconciliation and digest-mismatch paths. |
| crates/psyche-test-support/tests/conformance.rs | Adds a conformance test ensuring all reusable suites pass with an opaque (non-session-1) session id. |
| crates/psyche-test-support/src/suites/mod.rs | Re-exports scripted_fixture_with_session_id for suite consumers. |
| crates/psyche-test-support/src/suites/coven.rs | Implements configurable session IDs in the scripted fixture and strengthens cursor/reconciliation/adoption durability assertions; updates max content-size expectations. |
| crates/psyche-test-support/src/lib.rs | Re-exports scripted_fixture_with_session_id at the crate root. |
| crates/psyche-coven/tests/bindings.rs | Updates binding tests to match the new i64::MAX content-size boundary. |
| crates/psyche-coven/src/port.rs | Changes ContentAddressedReference validation to allow up to i64::MAX bytes and rejects overflow beyond that. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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
Test plan
PROPTEST_CASES=2048 cargo test -p psyche-coven -p psyche-test-supportcargo clippy -p psyche-coven -p psyche-test-support --all-targets -- -D warningspython3 scripts/check-g2-evidence-test.py -q