Skip to content

Tests never open the live database - #9

Merged
mgoldey merged 1 commit into
mainfrom
fix/tests-never-open-live-db
Sep 12, 2026
Merged

mgoldey merged 1 commit into
mainfrom
fix/tests-never-open-live-db

Conversation

@mgoldey

@mgoldey mgoldey commented Sep 12, 2026

Copy link
Copy Markdown
Owner

What

tests/test_citations.py::test_cite_check_says_it_only_checked_the_keys and test_cite_check_response_states_what_it_checked failed on a clean merged tip with:

RuntimeError: database schema version 10 is newer than this code supports (max 9)

Both call the cite.check tool, whose @tool wrapper opens the default DB. The hermetic fixture deletes RSS_DB but nothing repointed the skill-data fallback, so resolve_db_path opened the live ~/.hermes/skills/science-recommendations/data/hermes.db, which another session had migrated to schema 10 while every checkout's code knew 9.

Fix

  • conftest._hermetic_env repoints attestation.db.SKILL_DATA_DB at an absent path under tmp_path and clears ATTEST_DB alongside RSS_DB, so no test can fall through to the live file. The four resolve_db_path tests that exercise the fallback already set their own SKILL_DATA_DB and are unaffected.
  • The two cite.check tests pin RSS_DB to a file under tmp_path, so they are hermetic even from a checkout that has a ./hermes.db in its cwd.

Verified

All seven non-test hooks pass; full pytest 1801 passed, 2 skipped (previously 1801 passed, 2 failed).

🤖 Generated with Claude Code

…SKILL_DATA_DB at an absent tmp path and clears ATTEST_DB too, and the two cite.check tests pin RSS_DB to their own file. On 2026-09-11 both opened ~/.hermes/.../hermes.db through resolve_db_path's skill-data fallback, found another session had migrated it to schema 10 while the code knew 9, and failed on a clean merged tip -- a test reading machine state fails for reasons unrelated to the branch. The tests that exercise the fallback itself already repoint SKILL_DATA_DB and are unaffected; the full suite is 1801 passed.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@mgoldey
mgoldey merged commit aa4b221 into main Sep 12, 2026
7 checks passed
@mgoldey
mgoldey deleted the fix/tests-never-open-live-db branch September 12, 2026 20:41
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