Skip to content

Assert lazy registry validation through public reads - #2957

Merged
trissim merged 1 commit into
mainfrom
fix/lazy-registry-read-assertions
Oct 23, 2026
Merged

trissim merged 1 commit into
mainfrom
fix/lazy-registry-read-assertions

Conversation

@trissim

@trissim trissim commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Lazy registry decoding moved validation to reads, but three assertions still expected it during construction or a private decode that never accessed the damaged row. Assert the same RelationViolationError through the public reads instead.

  • tests/test_turn_record.py:39-41 writes forged JSON to the copied registry, then calls RegistryStore(...).read_entry('worker'). The file contains no _decode call.
  • tests/test_declarations.py:382 calls Registration(...).require("a") after the existing torn-guard os.pwrite injection. Both pending/commit cases and all other assertions remain.
  • No src changes, eager reads, broader exceptions or changed fault injection.

Validation: inspected ThreadRows.getitem/decode_row (registry_document.py:291-301), RegistryStore.read_entry (registry_store.py:278) and Registration.init (registration.py:71). No local tests, ratchets or suites ran. The commander's supplied proof already covered the lazy refusal and both torn-guard cases. Ruff check ran on both changed files: test_declarations.py 25 -> 25 existing findings; test_turn_record.py 1 -> 1. No findings on added or changed lines. git diff --check passed.

Diff against origin/main:

 tests/test_declarations.py | 2 +-
 tests/test_turn_record.py  | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

Assumed: read_entry is the public per-thread read required here, as its declaration states. #2943 remains open and touches other hunks in these files; this branch preserves those existing lines, and will merge main and resolve any conflict if #2943 lands first.

@trissim
trissim marked this pull request as ready for review October 23, 2026 23:31
Copilot AI balanced review requested due to automatic review settings October 23, 2026 23:31

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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@trissim
trissim enabled auto-merge October 23, 2026 23:31
@trissim
trissim merged commit 922ac87 into main Oct 23, 2026
14 checks passed
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