Skip to content

test: Finish three test migrations their PRs left behind - #5177

Merged
Sinity merged 1 commit into
masterfrom
test/finish-three-migrations
Sep 15, 2026
Merged

Sinity merged 1 commit into
masterfrom
test/finish-three-migrations

Conversation

@Sinity

@Sinity Sinity commented Sep 15, 2026

Copy link
Copy Markdown
Owner

Summary

Three unrelated tests on master still describe the world before a landed product change. Each names the PR that moved the product. None is a product defect; in each case the product is right and the test was left behind.

Evidence

Receipt .cache/verify/runs/20260914T233651Z-all-207009-89ddea6b (verify_all, job 1699, 22,540 selected, 29 failed).

Caveat on that receipt: its run.json records git_head: f7964acd12b25134c0e2e4cd8f73f9e6557a4a4f — the tip of branch rebase-5165, not master and not an ancestor of it — and final_git_head: 724d17535. The shared checkout advanced across 7 merged PRs during the run, so it is not evidence of a frozen tree. I re-ran all 29 node ids at true master HEAD: 17 reproduce, 12 do not. These 3 are among the 17.

Per-failure classification

Failure Classification Which PR moved the product
test_schema_policy_contracts::test_read_only_archive_open_does_not_bootstrap_missing_tiers stale test #5162 (817eec6f4) typed the refusal as ArchiveTierUnavailableError
test_write_path_state_machine::test_positional_branch_point_alias_is_typed_dangling stale test (premise no longer constructible) #5103 (398c60458) made id-less message identity content-derived
test_compare_command::test_compare_with_verdict_records_and_is_readable_via_calibration stale test #5172 (724d17535) routed CLI facade writes through declared daemon operations

Solution

#5162 leftover. ArchiveTierUnavailableError is a DatabaseError, not an sqlite3 exception, so it propagated straight through pytest.raises(sqlite3.OperationalError). #5162 landed its own replacement (test_absent_index_tier_is_typed.py); this was the other half. The test's actual subject — assert not any(tmp_path.glob("*.db")), that a read-only open of nothing creates nothing — is untouched.

#5103 leftover — the one worth reading closely. The old test renumbered the parent (A,B → X,A,B) so the child's p:<position>.<variant> branch-point alias would land on a different row. Under content-derived identity that alias no longer exists: message_id is now 'c:' || content_identity || '.' || content_occurrence, so "B" resolves to the same real message wherever it sits, the content witness matches, and the composed prefix X, A, B was legitimately correct. The writer was not wrongly resolving anything — there was no longer a dangling reference to detect.

The dangling rule itself is intact and still worth proving, so I rebuilt the premise rather than relaxing the rule: the replacement now drops "B" outright, so the child's branch point genuinely vanishes and the envelope must truncate to the child's own tail. Renamed to test_vanished_branch_point_is_typed_dangling to say what it actually tests.

#5172 leftover. Requiring a daemon for compare --verdict is not an over-reach — it is the stated single-writer route, and judge moved the same way. #5172 migrated test_judge_command, test_mark_note_identity, test_verb_cardinality, test_cli_action_contracts and test_assertion_candidates, but missed this file. The verdict case moves onto the same cli_daemon_archive stack (a real DaemonOperationRuntime behind a real UDS listener), so the file's whole stated premise — a real production caller for blind_items, ClaimWithControls, compute_calibration and upsert_comparative_judgment_assertion — survives rather than being mocked away. Its sibling test_compare_without_verdict… still passes untouched because it records nothing.

Anti-vacuity

  • Read-only open: restore bootstrap on the read-only path (initialize = not read_only) and the no-*.db assertion goes red. Keeping the expected type narrow (rather than the DatabaseError base) keeps it red if the boundary re-leaks a raw driver error.
  • Vanished branch point: delete the content-witness guard in write.py (if witness is not None: … composed = own; break) and the child composes the wrong parent prefix instead of truncating. This is the condition the test always named — it just could not reach it any more.
  • Compare: mock the facade instead of supplying a daemon and the file's premise is lost; stub the storage chokepoint and the --calibration agreement rate goes wrong.

Verification

devtools test tests/unit/storage/test_write_path_state_machine.py tests/unit/storage/test_schema_policy_contracts.py
devtools test: PASSED exit=0 diagnosis=pytest_passed receipt=.cache/verify/runs/20260915T014134Z-focused-test-325111-9b54466f/run.json

devtools test tests/unit/cli/test_compare_command.py
devtools test: PASSED exit=0 diagnosis=pytest_passed receipt=.cache/verify/runs/20260915T014228Z-focused-test-325880-7bf93813/run.json

Schema closure

out  tests/unit/cli/test_compare_command.py
out  tests/unit/storage/test_write_path_state_machine.py
out  tests/unit/storage/test_schema_policy_contracts.py

All OUT. Test-only change; no product file touched. Does not need to land before an archive rebuild.

Residuals

  • CLAUDE.md's identity section still documents the retired p: positional fallback that fix: Derive id-less message identity from content, not position #5103 replaced with c:. Not corrected here — it is doc text, not a closure input, and belongs with whoever owns that section.
  • test_cli_operation_authority.py covers the daemon-down refusal matrix for mark and judge but not compare. Adding that case is worthwhile follow-up; it is new coverage rather than part of this red→green repair, so I have not claimed it.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DYUNBGoE652b3nfmq3CtqK

Three unrelated tests still describe the world before a landed product change.
None is a product defect; each names which PR moved the product and what the
test now proves instead.

#5162 typed the absent-index-tier refusal as `ArchiveTierUnavailableError` and
landed its own replacement test, but `test_read_only_archive_open_does_not_
bootstrap_missing_tiers` still expected the raw `sqlite3.OperationalError`.
Its subject -- that a read-only open of nothing creates nothing -- is
unchanged; the narrow expected type keeps it red if the boundary ever
re-leaks a driver error.

#5103 made an id-less message's identity content-derived, which retired the
`p:<position>.<variant>` alias `test_positional_branch_point_alias_is_typed_
dangling` depended on. It renumbered the parent so the child's alias would
land on a different row; under content identity "B" resolves to the same real
message wherever it sits, so the composed prefix was legitimately correct and
the test's premise was no longer constructible. The rule is intact and still
worth proving, so the premise is rebuilt rather than the rule relaxed: the
replacement now drops the child's branch point outright. Renamed to say what
it actually tests.

#5172 routed CLI facade writes through declared daemon operations and migrated
five test files onto the real-daemon fixture, missing `test_compare_command`.
Its verdict-recording case moves onto the same `cli_daemon_archive` stack that
#5172 gave `test_mark_note_identity` -- a real runtime behind a real UDS
listener, so the file's whole premise (a production caller for `blind_items`,
`ClaimWithControls`, `compute_calibration` and
`upsert_comparative_judgment_assertion`) survives instead of being mocked away.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01DYUNBGoE652b3nfmq3CtqK
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitai Bot commented Sep 15, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 49 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 7fdbf02d-1782-4470-a26d-72f2bb5b5971

📥 Commits

Reviewing files that changed from the base of the PR and between 724d175 and eded079.

📒 Files selected for processing (3)
  • tests/unit/cli/test_compare_command.py
  • tests/unit/storage/test_schema_policy_contracts.py
  • tests/unit/storage/test_write_path_state_machine.py

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ✅ Completed 2026-09-15T01:46:45.962189Z eded079 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Sinity
Sinity merged commit 4105e36 into master Sep 15, 2026
3 checks passed
@Sinity
Sinity deleted the test/finish-three-migrations branch September 15, 2026 01:51
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.

1 participant