Skip to content

test: harden G2 conformance invariants - #5

Open
BunsDev wants to merge 3 commits into
mainfrom
fix/psyche-g2-conformance-hardening
Open

test: harden G2 conformance invariants#5
BunsDev wants to merge 3 commits into
mainfrom
fix/psyche-g2-conformance-hardening

Conversation

@BunsDev

@BunsDev BunsDev commented Aug 9, 2026

Copy link
Copy Markdown
Member

Summary

  • restore the full signed 64-bit content metadata range while preserving JSON-safe cursor boundaries
  • make reusable conformance and property suites authority-opaque for session identifiers
  • fail fast on stalled or overshooting cursors and bind every returned reconciliation to the unchanged durable adoption
  • strengthen request-digest properties with durable-state invariants

Test plan

  • PROPTEST_CASES=2048 cargo test -p psyche-coven -p psyche-test-support
  • cargo clippy -p psyche-coven -p psyche-test-support --all-targets -- -D warnings
  • python3 scripts/check-g2-evidence-test.py -q

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings August 9, 2026 10:52

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_id and 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 ContentAddressedReference size validation from JS safe-integer bounds to i64::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.

BunsDev and others added 2 commits August 9, 2026 06:11
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants