feat: add Apec adapter scaffold

This commit is contained in:
Antoine 2026-06-01 14:30:34 +02:00
parent 5fefa3aab1
commit 47619abc08
2 changed files with 30 additions and 0 deletions

View File

@ -0,0 +1,20 @@
from __future__ import annotations
from dataclasses import dataclass
@dataclass(slots=True)
class ApecSearchResult:
url: str
source_job_id: str | None = None
class ApecAdapter:
def __init__(self, max_listings: int = 50) -> None:
self.max_listings = max_listings
def search(self, queries: list[str]) -> list[ApecSearchResult]:
return []
def fetch_listing_html(self, url: str) -> str:
return ""

View File

@ -45,3 +45,13 @@ def test_apec_run_paths_builds_expected_layout(tmp_path: Path) -> None:
assert paths["listings"] == run_dir / "listings.yaml"
assert paths["run_meta"] == run_dir / "run-meta.yaml"
assert paths["snapshots"] == run_dir / "snapshots"
def test_apec_run_artifacts_include_snapshot_and_meta(tmp_path: Path) -> None:
paths = apec_run_paths(tmp_path, run_id="2026-06-01T10-00-00Z")
paths["snapshots"].mkdir(parents=True, exist_ok=True)
snapshot = paths["snapshots"] / "job-123.html"
snapshot.write_text("<html>snapshot</html>", encoding="utf-8")
assert snapshot.read_text(encoding="utf-8") == "<html>snapshot</html>"