Skip to content

test: Retarget Hermes marker tests onto the declared logical export - #5104

Merged
Sinity merged 1 commit into
masterfrom
fix/hermes-page-image-tests
Sep 14, 2026
Merged

Sinity merged 1 commit into
masterfrom
fix/hermes-page-image-tests

Conversation

@Sinity

@Sinity Sinity commented Sep 14, 2026 •

Copy link
Copy Markdown
Owner

Summary

Three tests still built a Hermes SQLite page image and asserted the
pre-#5040 marker route. They are retargeted onto the production acquisition
shape -- the declared member's canonical logical export -- which is what
the gate now admits.

Which merged PR moved the ground

PR #5040 (f84dd3b0c, "Refuse Hermes page images on ingest") added the
is_declared_logical_export gate at archive/raw_payload/decode.py:587. A
page image is no longer admitted as session content, because the replay route
(sources.revision_backfill._parse_one) already refuses one and admitting it
on ingest would mint a second source authority for content the archive holds
under its logical revision.

PR #5064 (3ad255e25) already rewrote the equivalent storage tests onto
write_logical_export + member_export_scope. These three were missed by
that pass; this follows the same precedent.

Solution

Build the retained material with write_logical_export(db, handle, scope=member_export_scope(db), immutable=True) and pass the export as the
payload with source_path naming the declared state.db. The assertions are
unchanged in substance: the marker route still fires, the artifact is still a
SESSION_DOCUMENT, and the payload still equals
hermes_state.marker_payload(...).

tests/unit/sources/test_parsers_local_agent.py grows one helper,
_write_hermes_state_export, shared by both marker tests.

Verification

devtools test tests/unit/core/test_raw_payload_decode.py \
     tests/unit/sources/test_parsers_local_agent.py \
     tests/unit/cli/test_archive_query.py tests/unit/cli/test_daemon_client.py \
     tests/unit/infra/test_archive_templates.py \
     tests/unit/insights/test_delegation_work_evidence_materializer.py \
     tests/unit/cli/test_status.py
  -> receipt 20260914T163857Z-focused-test-3135387-125edb44
     248 passed / 249 collected; the three tests in this PR all green
devtools verify --quick  -> exit 0, 15/15 gates

The one failure in that receipt was tests/unit/cli/test_status.py, a
separate group with its own PR; it is green there.

Anti-vacuity

Test Mutation that makes it red
..._still_recognizes_genuine_hermes_state_db drop the member header (scope=None): the bytes stop binding to state.db, the artifact comes back BINARY_DATABASE
..._envelope_uses_marker same; the provider falls back off Provider.HERMES
..._default_keeps_live_marker_semantics flip the sqlite_immutable default to True: the marker gains an sqlite_immutable key

Residuals

Test-only change; no product code touched, so the derived schema identity does
not move. The full corpus was not re-run.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DYUNBGoE652b3nfmq3CtqK

PR #5040 (f84dd3b) added the is_declared_logical_export gate at
archive/raw_payload/decode.py:587, so a SQLite page image is no longer
admitted as session content. Three tests still built a page image and
asserted the pre-#5040 marker route.

Rebuild them on the production acquisition shape -- write_logical_export
plus member_export_scope -- following the precedent PR #5064 (3ad255e)
set for the equivalent storage tests. The assertions are unchanged in
substance: the marker route still fires and the payload still equals
hermes_state.marker_payload.

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 14, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 8 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: aeda0720-d328-47d9-a0c2-2aeaa8f48eeb

📥 Commits

Reviewing files that changed from the base of the PR and between 513c887 and 56570b3.

📒 Files selected for processing (2)
  • tests/unit/core/test_raw_payload_decode.py
  • tests/unit/sources/test_parsers_local_agent.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.

@Sinity
Sinity merged commit fc2df51 into master Sep 14, 2026
3 checks passed
@Sinity
Sinity deleted the fix/hermes-page-image-tests branch September 14, 2026 17:07
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