Skip to content

test(flow): compare exact contract digest for unset record.surface (#2133) - #2150

Open
yunusarda-sudo wants to merge 1 commit into
OpenAdaptAI:mainfrom
yunusarda-sudo:test/record-surface-contract-digest-equality
Open

yunusarda-sudo wants to merge 1 commit into
OpenAdaptAI:mainfrom
yunusarda-sudo:test/record-surface-contract-digest-equality

Conversation

@yunusarda-sudo

Copy link
Copy Markdown
Contributor

Resolves #2133

Summary of Changes

Follow-up to the review of #1576: test_an_unset_surface_keeps_the_contract_digest previously verified only that effect probes were unprefixed (assert all("surface:" not in (e.probe or "") for e in effects)), but did not test the PR's core invariant that an unset record.surface leaves the contract digest unchanged.

  1. Exact contract digest comparison (packages/flow/tests/test_record_surface.py):
    • Constructed both configurations: without_field (omitting record.surface) and with_none (record.surface = None).
    • Verified that both produce unprefixed probes.
    • Evaluated verify_config_sha256(verifier_identity(parsed.verifier), list(parsed.effects)) on both configurations and asserted that the computed contract digests are identical.

Verification

  • Executed PYTHONPATH=packages/flow uv run pytest packages/flow/tests/test_record_surface.py (10/10 passed).
  • Executed uv run ruff check packages/flow/tests/test_record_surface.py (clean).
  • Executed uv run ruff format --check packages/flow/tests/test_record_surface.py (clean).

…penAdaptAI#2133)

Signed-off-by: Yunus Ardaguney <yunusarda-sudo@users.noreply.github.com>

This branch has not been deployed

No deployments
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.

test_an_unset_surface_keeps_the_contract_digest never compares a digest

1 participant