Skip to content

test: realign tests with contracts that landed PRs changed - #5813

Merged
Sinity merged 1 commit into
masterfrom
test/realign-superseded-contracts
Sep 29, 2026
Merged

Sinity merged 1 commit into
masterfrom
test/realign-superseded-contracts

Conversation

@Sinity

@Sinity Sinity commented Sep 29, 2026

Copy link
Copy Markdown
Owner

Summary

Realigns 11 tests that fail on master. Each encodes a contract that a merged PR changed on purpose. Production code is unchanged.

Problem

These tests failed at master 1beb2e5 (baseline agentctl job 2441, devtools test --on-default-branch). Beads: polylogue-cp3z5 (lineage validation) and polylogue-bn8gg (facade record_context_ledger). The other items are in polylogue-6bhuy, which also lists items owned by sibling PRs.

Test Contract change
tests/unit/devtools/test_lineage_validation.py (all 21) The hand-built index lacks messages.fields_digest and the derived schema identity stamp. Every reader refuses an unstamped derived tier as SchemaSkew ("expected , found None").
test_facade_contracts.py::test_no_undiscovered_async_methods record_context_ledger (#5722) and get_session_summaries are in no contract set.
test_facade_contracts.py::test_archive_facet_buckets_count_unique_sessions_for_duplicate_hits #5703 moved deduplication into the search-scope walk. The unscoped path yields each session once by construction, so the duplicate case is a search hit.
test_preamble.py::test_precompact_uses_scheduler_and_records_real_boundary_context The precompact path awaits record_context_ledger (#5722). The mock was a plain MagicMock attribute, and the other test in the file set it twice.
test_manual_contract.py::test_published_examples_use_live_operation_vocabularies_and_preconditions read's view is now Literal[...] | None. typing.get_args on the union yields the Literal and NoneType, not the members.
test_write_effects.py::test_deferred_insight_invalidation_follows_a_repointed_index #5727 moved profile invalidation into the admitted transaction, so no deferred reopen by path is left to follow.
test_mutation_actuators.py::...::test_production_tag_and_metadata_writes_use_user_overlay_policy #5727 made tag writes that change a row invalidate the search cache.
tests/unit/cli/test_status.py::...::test_sinex_status_reads_the_active_archive_file_set #5722: publication mode comes from the loaded config, and the file set from resolve_runtime_config().
tests/unit/cli/commands/test_status.py::...::test_configured_override_url_is_not_refused #5722: a non-built-in daemon URL is read over HTTP GET /api/status.

Solution

Each test now exercises the current contract and keeps its anti-vacuity condition:

  • Lineage validation. The fixture declares fields_digest and stamps the current identity with the production stamp_derived_schema_identity.
  • Facade. Both methods are classified. get_session_summaries gains coverage in test_archive_tiers_api_reads_native_sessions: requested ids key the result, and an unresolved id is omitted. The facet test drives two hits for one session through the search scope.
  • Manual contract. The vocabulary is read through unions, and the test asserts "messages" is in it, so an empty read cannot pass.
  • Write effects. The test now proves the invalidation commits and rolls back with the caller's transaction. An effect that opened its own connection would survive the rollback.
  • Tag overlay. Expects exactly one invalidation per changed tag write, and none for metadata writes or the no-op re-add.
  • Status. The URL-override test runs a real local HTTP server and asserts only /api/status was requested.

Verification

  • agentctl job start polylogue pytest_focused --workspace <wt> -- tests/unit/devtools/test_lineage_validation.py tests/unit/api/test_facade_contracts.py tests/unit/context/test_preamble.py tests/unit/agent_integration/test_manual_contract.py tests/unit/archive/test_write_effects.py tests/unit/operations/test_mutation_actuators.py tests/unit/cli/test_status.py tests/unit/cli/commands/test_status.py: job 2632, devtools test: PASSED exit=0, 582 passed. Five tests passed only on rerun. Each failed first with DaemonWriterOwnerLoopStopped ... daemon.operation_journals.startup or a 5 s bridge TimeoutError in the test daemon stack; that race is fixed in fix(reset): confirm databases, not their transient WAL sidecars #5810.
  • agentctl job start polylogue verify_quick --workspace <wt>: job 2633, succeeded.

Self-review

  • Production route. Each rewritten test calls the production function (stamp_derived_schema_identity, _invalidate_insights_effect on a real connection, _status_operation_result against a real HTTP listener, ArchiveStore tag writes). None asserts a mock's own behaviour.
  • Loosening. No assertion was dropped. The facet and write-effects tests change input shape to match the current route, and each keeps a condition that fails if the named behaviour regresses.
  • Scope. Test-only; no derived-identity closure file changes.

Residuals

None known for these tests. The daemon-stack startup race behind the five reruns is addressed in #5810.

🤖 Generated with Claude Code

https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg

Each of these tests failed on master because a merged PR changed the
contract it encodes; production behavior is unchanged here.

- lineage validation: the hand-built index lacked messages.fields_digest
  and the derived-identity stamp every reader now requires (SchemaSkew).
- facade contracts: record_context_ledger (#5722) and
  get_session_summaries were in no contract set; facet buckets now
  deduplicate search hits in the scope walk (#5703).
- preamble: the precompact path awaits record_context_ledger (#5722).
- manual contract: read's view is Optional[Literal], so the vocabulary is
  read through the union.
- write effects: insight invalidation rides the admitted transaction
  (#5727); the test now proves commit/rollback with the caller.
- tag overlay: tag writes that change a row drop the search cache (#5727).
- status: sinex status resolves the runtime file set, and a non-built-in
  daemon URL is read over HTTP /api/status (#5722).

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
@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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 29, 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-29T09:11:32.285071Z 8a3d369 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 enabled auto-merge (squash) September 29, 2026 09:09
@Sinity
Sinity merged commit ef10e59 into master Sep 29, 2026
2 of 3 checks passed
@Sinity
Sinity deleted the test/realign-superseded-contracts branch September 29, 2026 09:11
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