Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions polylogue/maintenance/pathology_zoo.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ def _invariant(
_CHATGPT = "chatgpt-export"
_DESIGN = "claude-design-session"
_GEMINI = "aistudio-drive"
_CLAUDE_VINTAGE_NATIVE_ID = "9ed2056f-b415-4f51-b18e-5265f21a67bf"
_CLAUDE_VINTAGE_LOGICAL_SOURCE_KEY = f"claude-ai:{_CLAUDE_VINTAGE_NATIVE_ID}"


PATHOLOGY_ZOO_MANIFEST: tuple[PathologyZooMember, ...] = (
Expand Down Expand Up @@ -270,9 +272,10 @@ def _invariant(
THEN 1 ELSE 0 END
FROM raw_sessions AS r
JOIN raw_session_memberships AS m ON m.raw_id = r.raw_id
WHERE r.native_id = ?
WHERE r.origin = ?
AND m.logical_source_key = ?
""",
("9ed2056f-b415-4f51-b18e-5265f21a67bf",),
(_CLAUDE_AI, _CLAUDE_VINTAGE_LOGICAL_SOURCE_KEY),
(1,),
),
evidence_note=(
Expand Down
10 changes: 8 additions & 2 deletions tests/infra/claude_vintage_live_proof.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
from polylogue.sources.revision_backfill import backfill_historical_revision_evidence
from polylogue.storage.sqlite.archive_tiers.bootstrap import initialize_active_archive_root
from tests.infra.pathology_zoo import (
CLAUDE_VINTAGE_LIVE_PROOF_LOGICAL_SOURCE_KEY,
CLAUDE_VINTAGE_LIVE_PROOF_ORIGIN,
CLAUDE_VINTAGE_LIVE_PROOF_SESSION_ID,
write_claude_vintage_live_proof_pair,
)
Expand Down Expand Up @@ -185,10 +187,14 @@ def _read_membership_rows(archive_root: Path) -> tuple[dict[str, object], ...]:
SELECT r.source_path, m.normalized_content_hash, m.decision
FROM raw_sessions AS r
JOIN raw_session_memberships AS m ON m.raw_id = r.raw_id
WHERE m.logical_source_key = ?
WHERE r.origin = ?
AND m.logical_source_key = ?
ORDER BY r.source_path
""",
(f"claude-ai:{CLAUDE_VINTAGE_LIVE_PROOF_SESSION_ID}",),
(
CLAUDE_VINTAGE_LIVE_PROOF_ORIGIN,
CLAUDE_VINTAGE_LIVE_PROOF_LOGICAL_SOURCE_KEY,
),
).fetchall()
return tuple(
{
Expand Down
26 changes: 23 additions & 3 deletions tests/infra/pathology_zoo.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from unittest.mock import patch

from polylogue.config import Source
from polylogue.core.enums import Origin
from polylogue.maintenance.pathology_zoo import (
PATHOLOGY_ZOO_MANIFEST as PRODUCTION_PATHOLOGY_ZOO_MANIFEST,
)
Expand All @@ -32,6 +33,10 @@
from polylogue.sources.hooks import drain_hook_event_spool, enqueue_hook_event
from tests.infra.source_builders import SyntheticAntigravityLanguageServerClient

CLAUDE_VINTAGE_LIVE_PROOF_SESSION_ID = "9ed2056f-b415-4f51-b18e-5265f21a67bf"
CLAUDE_VINTAGE_LIVE_PROOF_ORIGIN = Origin.CLAUDE_AI_EXPORT.value
CLAUDE_VINTAGE_LIVE_PROOF_LOGICAL_SOURCE_KEY = f"claude-ai:{CLAUDE_VINTAGE_LIVE_PROOF_SESSION_ID}"


@dataclass(frozen=True, slots=True)
class PathologyZoo:
Expand Down Expand Up @@ -115,8 +120,24 @@ def apply(self, archive_root: Path) -> None:
),
"claude-vintage-live-proof": PathologyZooMutation(
"source",
"DELETE FROM raw_sessions WHERE native_id = ? AND source_path LIKE ?",
("9ed2056f-b415-4f51-b18e-5265f21a67bf", "%claude-live-proof-new.json"),
"""
DELETE FROM raw_sessions
WHERE raw_id = (
SELECT r.raw_id
FROM raw_sessions AS r
JOIN raw_session_memberships AS m ON m.raw_id = r.raw_id
WHERE r.origin = ?
AND m.logical_source_key = ?
AND r.source_path LIKE ?
ORDER BY r.source_path DESC
LIMIT 1
)
""",
(
Origin.CLAUDE_AI_EXPORT.value,
f"claude-ai:{CLAUDE_VINTAGE_LIVE_PROOF_SESSION_ID}",
"%claude-live-proof-new.json",
),
),
"lifecycle-anchor-drift": PathologyZooMutation(
"index",
Expand Down Expand Up @@ -226,7 +247,6 @@ def _chatgpt_node(
return node


CLAUDE_VINTAGE_LIVE_PROOF_SESSION_ID = "9ed2056f-b415-4f51-b18e-5265f21a67bf"
CLAUDE_VINTAGE_LIVE_PROOF_MESSAGE_IDS = (
"64878c9e-2642-437b-a384-0961184f84ea",
"4c341ad3-dbd9-4224-9ab4-dcb4f833b3f9",
Expand Down
Loading