text stringlengths 3 8.33k | repo stringclasses 52
values | path stringlengths 6 141 | language stringclasses 35
values | sha stringlengths 64 64 | chunk_index int32 0 273 | n_tokens int32 1 896 |
|---|---|---|---|---|---|---|
] | None
ErrorCallback = Callable[[str, str], None] | None
```
**2. PipelineContext frozen dataclass:**
```python
import dataclasses
from pathlib import Path
from jku_kb.config import Settings
@dataclasses.dataclass(frozen=True)
class PipelineContext:
settings: Settings
cache_dir: Path
progress_callback: ... | jku-encyclopedia | .planning/milestones/v1.1-phases/08-foundation-registry-orchestrator-test-baseline/08-02-PLAN.md | Markdown | d7807ca147b9e5629ea5d5d1344851a8d9669d985853191cc275019d4c03413b | 2 | 896 |
):**
```python
from jku_kb.models import Modality
def _guess_modality(path: Path) -> Modality:
"""Guess modality from file extension."""
ext = path.suffix.lower()
if ext in (".pdf",):
return Modality.DOCUMENT
if ext in (".mp4", ".webm", ".mov", ".m4v"):
return Modality.VIDEO
if ext ... | jku-encyclopedia | .planning/milestones/v1.1-phases/08-foundation-registry-orchestrator-test-baseline/08-02-PLAN.md | Markdown | b5eb95deb482ec56d0094a17b4dcf3cd13e184b9315b9c8bd4cf6ad98b303ae4 | 3 | 896 |
.py
</files>
<read_first>
- src/jku_kb/orchestrator.py (full file — this is the source being decomposed)
- src/jku_kb/orchestrator/helpers.py (just created in Task 1)
- src/jku_kb/scrapers/__init__.py (for get_scraper import)
- src/jku_kb/cli.py (lines 1-30 for imports from orchestrator)
</read_fi... | jku-encyclopedia | .planning/milestones/v1.1-phases/08-foundation-registry-orchestrator-test-baseline/08-02-PLAN.md | Markdown | fd088c9f7dff5062462ccf47a6187b6bbc918afa1b3c2abd5857e6af36e5cf42 | 4 | 896 |
1 for r in fetch_results if r.fetch_status == FetchStatus.FETCHED)
failed = sum(1 for r in fetch_results if r.fetch_status == FetchStatus.FAILED)
if ctx.progress_callback is not None:
ctx.progress_callback(source_id, success)
return sou... | jku-encyclopedia | .planning/milestones/v1.1-phases/08-foundation-registry-orchestrator-test-baseline/08-02-PLAN.md | Markdown | 6c7b2a94c4435b5026ebd8ef560f1f51ea03c6502312d92b771cd83e1be41e50 | 5 | 896 |
Use ManifestWriter for buffered writes
with ManifestWriter(done_manifest) as done_writer, \
ManifestWriter(chunks_manifest_path) as chunks_writer:
with open(manifest_path, "rb") as mf:
for line in mf:
line = line.strip()
... | jku-encyclopedia | .planning/milestones/v1.1-phases/08-foundation-registry-orchestrator-test-baseline/08-02-PLAN.md | Markdown | 4e774ad4602e22c1057b147f8b8c1fdb0e9a11879ee1b25c8368f451df4ea0c9 | 6 | 896 |
done_ids = _load_done_ids(done_manifest) # PERF-04: bulk read once
chunks: list[Chunk] = []
with open(chunks_manifest, "rb") as f:
for line in f:
line = line.strip()
if not line:
continue
... | jku-encyclopedia | .planning/milestones/v1.1-phases/08-foundation-registry-orchestrator-test-baseline/08-02-PLAN.md | Markdown | 7d41d5eacc846ba67eb3b05b31a14c44fe96fd3c19d7c5bd7a9e05cca888ea9c | 7 | 896 |
not None:
ctx.progress_callback("similarity_edges", sim_count)
if mode in ("all", "next-chunk"):
next_count = await build_next_chunk_edges(neo4j)
results["next_chunk_edges"] = next_count
if ctx.progress_callback is not None:
ctx.progress_callb... | jku-encyclopedia | .planning/milestones/v1.1-phases/08-foundation-registry-orchestrator-test-baseline/08-02-PLAN.md | Markdown | 48e65abfe33043d0fb24d2645dd62b298dbfe22bde28bdcbf2b0569b04c212d1 | 8 | 896 |
progress_callback, error_callback=error_callback,
)
log.info("phase1_complete", results=discover_results)
if phase_callback is not None:
phase_callback("fetch")
fetch_results = await self.run_phase_fetch(
source_ids, max_items_per_source,
progress_cal... | jku-encyclopedia | .planning/milestones/v1.1-phases/08-foundation-registry-orchestrator-test-baseline/08-02-PLAN.md | Markdown | 9c918412b3382a97b1bd4fb25a57517870aa385f43955c855f4f6be2d9ef8cb5 | 9 | 896 |
assert 'wayback_jku' not in o.all_source_ids
print('OK: all imports work, orchestrator functional')
" && echo "--- Line counts ---" && wc -l src/jku_kb/orchestrator/*.py</automated>
</verify>
<acceptance_criteria>
- src/jku_kb/orchestrator.py does NOT exist (deleted)
- src/jku_kb/orchestrator/__init__.py ex... | jku-encyclopedia | .planning/milestones/v1.1-phases/08-foundation-registry-orchestrator-test-baseline/08-02-PLAN.md | Markdown | 4f07b2eb2bc31c9386de2aa1078cee72480900bcec7554216d42ceeff2e2f631 | 10 | 782 |
---
phase: 08-foundation-registry-orchestrator-test-baseline
plan: 02
subsystem: orchestrator
tags: [orchestrator, refactor, perf, manifest, pipeline, registry]
requires:
- phase: 08-01
provides: "Decorator-based scraper registry with get_scraper(), validate_registry(), and @register_scraper"
provides:
- "orc... | jku-encyclopedia | .planning/milestones/v1.1-phases/08-foundation-registry-orchestrator-test-baseline/08-02-SUMMARY.md | Markdown | 9091a10511e5ff3562e52a53728ff0b9d2837138f5ad19e1f40bd131dba70223 | 0 | 896 |
Create orchestrator/helpers.py** - `08b2762` (feat)
2. **Task 2: Split orchestrator.py into package with phase modules** - `6231008` (feat)
**Plan metadata:** (see final commit below)
## Files Created/Modified
- `src/jku_kb/orchestrator/__init__.py` (199 lines) - PipelineOrchestrator class, phase delegation methods,... | jku-encyclopedia | .planning/milestones/v1.1-phases/08-foundation-registry-orchestrator-test-baseline/08-02-SUMMARY.md | Markdown | e17b3ae79e092cd36b2a8fd4fc2266120fa873769914794b97aa326e789e79ee | 1 | 725 |
---
phase: 08-foundation-registry-orchestrator-test-baseline
plan: 03
type: execute
wave: 3
depends_on: ["08-01", "08-02"]
files_modified:
- tests/unit/test_orchestrator.py
- tests/unit/test_scrapers/test_wayback.py
- tests/unit/test_registry.py
- tests/unit/test_manifest_writer.py
- tests/unit/test_wayback_r... | jku-encyclopedia | .planning/milestones/v1.1-phases/08-foundation-registry-orchestrator-test-baseline/08-03-PLAN.md | Markdown | 70e3fa0d0ea4d54662f0b59db233121ff259dccf0ae752b5832c1349a3682bf3 | 0 | 896 |
ProgressCallback, ErrorCallback,
)
```
<!-- Registry API from Plan 01 -->
From src/jku_kb/scrapers/__init__.py:
```python
_REGISTRY: dict[str, type] = {}
def register_scraper(source_id: str): ...
def get_scraper(source_id: str, settings: Settings) -> Any: ...
def validate_registry(configured_source_ids: list[str]) -> ... | jku-encyclopedia | .planning/milestones/v1.1-phases/08-foundation-registry-orchestrator-test-baseline/08-03-PLAN.md | Markdown | 7b5399b51bf5e311a4d290229da5d2f095b5ded566cc1b497cb685718fb1217b | 1 | 896 |
github_jku", "openalex_jku", "arxiv_jku",
"risc_reports", "jku_web", "youtube_jku", "jku_podcasts",
"semantic_scholar_jku", "europe_pmc_jku", "zenodo_jku",
"huggingface_jku", "wikidata_jku",
}
assert set(_REGISTRY.keys()) == expected
def test_get_scraper_returns_instance(settings):
... | jku-encyclopedia | .planning/milestones/v1.1-phases/08-foundation-registry-orchestrator-test-baseline/08-03-PLAN.md | Markdown | b044a1665ef832ef62e2afd41cb55ebca3a0e183afe78c02cf5e595398d3141e | 2 | 896 |
PipelineOrchestrator
orch = PipelineOrchestrator(Settings())
assert "wayback_jku" not in orch.all_source_ids
def test_wayback_not_in_domain_rate_limits():
"""web.archive.org must not appear in DOMAIN_RATE_LIMITS."""
from jku_kb.scrapers.base import DOMAIN_RATE_LIMITS
assert "web.archive.org" not in... | jku-encyclopedia | .planning/milestones/v1.1-phases/08-foundation-registry-orchestrator-test-baseline/08-03-PLAN.md | Markdown | 9d5b7d40d5b6350c8d444b14a11ba71b03e5e2f6b333aa816b82516483b3d17f | 3 | 896 |
references remaining in tests (except test_wayback_removed.py which tests for absence)
grep -r "wayback" tests/ --include="*.py" -l | grep -v test_wayback_removed && echo "WARN: wayback still referenced" || echo "OK: clean"
# No _get_scraper references in tests (old method)
grep -r "_get_scraper" tests/ --include="*.p... | jku-encyclopedia | .planning/milestones/v1.1-phases/08-foundation-registry-orchestrator-test-baseline/08-03-PLAN.md | Markdown | af37ffcd07a39338dbd97f98842d72a77cca65eb992a706c6d87b564febc95fe | 4 | 236 |
---
phase: 08-foundation-registry-orchestrator-test-baseline
plan: 03
subsystem: testing
tags: [tests, registry, orchestrator, wayback, manifest-writer, pytest, mocking]
requires:
- phase: 08-01
provides: "Decorator-based scraper registry, get_scraper(), validate_registry(), Wayback removed"
- phase: 08-02
... | jku-encyclopedia | .planning/milestones/v1.1-phases/08-foundation-registry-orchestrator-test-baseline/08-03-SUMMARY.md | Markdown | 9aceff8c65f081833f712f9cbb83f1e7ec8793dc8a123e6bf0f849e50acdadef | 0 | 896 |
/unit/test_registry.py` - 8 tests for scraper registry API
- `tests/unit/test_manifest_writer.py` - 5 tests for ManifestWriter buffered writer
- `tests/unit/test_wayback_removed.py` - 3 SRC-01 verification tests
- `tests/unit/test_orchestrator.py` - Updated 27 failing tests with correct patch targets
- `tests/unit/test... | jku-encyclopedia | .planning/milestones/v1.1-phases/08-foundation-registry-orchestrator-test-baseline/08-03-SUMMARY.md | Markdown | 7e4d8313cfd7b94082d2288867596489e90b9741bad2302bcb4f4c4155938644 | 1 | 717 |
# Phase 8: Foundation -- Registry, Orchestrator & Test Baseline - Context
**Gathered:** 2026-03-21
**Status:** Ready for planning
<domain>
## Phase Boundary
Establish the new architecture foundation by extracting the scraper registry, decomposing the 639-line orchestrator into phase modules, removing the Wayback scr... | jku-encyclopedia | .planning/milestones/v1.1-phases/08-foundation-registry-orchestrator-test-baseline/08-CONTEXT.md | Markdown | a5c9fe7b68788506b025671c12972ec672290f30cfe6bd47d84aaa7e1cb7f341 | 0 | 896 |
jku_kb/config.py` -- Settings model, will gain SourceConfig for institute variants
</canonical_refs>
<code_context>
## Existing Code Insights
### Reusable Assets
- `BaseScraper` (scrapers/base.py): Already provides rate limiting, retry, caching, manifest tracking -- registry decorator wraps classes that extend this
... | jku-encyclopedia | .planning/milestones/v1.1-phases/08-foundation-registry-orchestrator-test-baseline/08-CONTEXT.md | Markdown | d6abbb9eb0a486471260fb0639d60fffe34edd1a62e14e3065caba27cb791d3b | 1 | 363 |
# Phase 8: Foundation -- Registry, Orchestrator & Test Baseline - Research
**Researched:** 2026-03-21
**Domain:** Python package architecture, decorator registry pattern, async pipeline decomposition, buffered I/O
**Confidence:** HIGH
<user_constraints>
## User Constraints (from CONTEXT.md)
### Locked Decisions
**R... | jku-encyclopedia | .planning/milestones/v1.1-phases/08-foundation-registry-orchestrator-test-baseline/08-RESEARCH.md | Markdown | 4fd77f26c84a3a72de3ba8dad478042f9c11fd810203b2254a98529a09e1631f | 0 | 896 |
registry, orchestrator factory, `all_source_ids` list |
| PERF-01 | Manifest writes batched (buffer N items, flush periodically) instead of opening/writing/closing per item | `ManifestWriter` context manager in `helpers.py`; buffer + flush pattern; currently `_mark_done()` opens file per call |
| PERF-04 | Per-item ove... | jku-encyclopedia | .planning/milestones/v1.1-phases/08-foundation-registry-orchestrator-test-baseline/08-RESEARCH.md | Markdown | b7f15cb31c842e8ffc6dd92e631caa95fade811b09d7f4e3af18eb3f81c92b9e | 1 | 896 |
── orchestrator/
│ ├── __init__.py # PipelineOrchestrator class, run() entry point
│ ├── discover.py # run_phase_discover() function
│ ├── fetch.py # run_phase_fetch() function
│ ├── chunk.py # run_phase_chunk() function
│ ├── embed.py # run_phase_embed() ... | jku-encyclopedia | .planning/milestones/v1.1-phases/08-foundation-registry-orchestrator-test-baseline/08-RESEARCH.md | Markdown | 225bb3b667414b76288d3f4366f3d501129a7b79a4e8052dac9aac868acdeaee | 2 | 896 |
web_crawl import WebCrawlScraper
return WebCrawlScraper(
settings,
source_id=source_id,
start_urls=variant.start_urls,
max_pages=variant.max_pages,
)
raise ValueError(f"No scraper registered for source_id={source_id!r}")
```
### Pattern 3: Frozen Pipe... | jku-encyclopedia | .planning/milestones/v1.1-phases/08-foundation-registry-orchestrator-test-baseline/08-RESEARCH.md | Markdown | 617244441ef8c103e186663b8fe80b6993a85cd870fe2d1a6ef5c00ce6a65cd4 | 3 | 896 |
**Circular import via registry**: `scrapers/__init__.py` must NOT import `BaseScraper` from `base.py` at module level if `base.py` imports from `scrapers/__init__.py`. The decorator is a class wrapper — no base class knowledge needed in `__init__.py`.
- **Timer-based flushing in ManifestWriter**: The locked decision ex... | jku-encyclopedia | .planning/milestones/v1.1-phases/08-foundation-registry-orchestrator-test-baseline/08-RESEARCH.md | Markdown | bf9100375e06cc8193804013354efd3ff573a42bbd7d96f138567bb1068e0203 | 4 | 896 |
*Warning signs:** `ImportError: cannot import name '_load_done_ids' from 'jku_kb.orchestrator'` in test run.
### Pitfall 3: CLI Still Calling `orchestrator._get_scraper()` Directly
**What goes wrong:** `cli.py` line 574 calls `orchestrator._get_scraper(source_id)` directly. After refactor this method is removed.
**Why... | jku-encyclopedia | .planning/milestones/v1.1-phases/08-foundation-registry-orchestrator-test-baseline/08-RESEARCH.md | Markdown | a230f1ee073cbe9f0a87aed2bf25331bd6e701532dc3f93544b4fd9c9cbd2371 | 5 | 896 |
be updated.
### Current CLI Direct Scraper Access (Must Be Updated for SRC-01/REF-01)
```python
# cli.py line 574 (current)
scraper = orchestrator._get_scraper(source_id)
```
Must become:
```python
from jku_kb.scrapers import get_scraper
scraper = get_scraper(source_id, settings)
```
### `@register_scraper` Applied t... | jku-encyclopedia | .planning/milestones/v1.1-phases/08-foundation-registry-orchestrator-test-baseline/08-RESEARCH.md | Markdown | bb2c18728b1c5c55f0fcbf48ef73300a31c4eb1f6e013fe4a21bc1de88f92a44 | 6 | 896 |
arbitrary `bytes` records (not just `item_id` strings), or create a second lightweight buffered writer for `chunks_manifest.jsonl`. The simpler option is a single `BufferedJsonlWriter` that accepts `bytes` and a `ManifestWriter` subclass. The planner should decide based on line count constraints.
## Validation Archite... | jku-encyclopedia | .planning/milestones/v1.1-phases/08-foundation-registry-orchestrator-test-baseline/08-RESEARCH.md | Markdown | 70023dba5fa95064b866b3b1f90f7fd19d26e155bb6d0257a37a9b8ae4a1eafc | 7 | 896 |
--no-header -q`
- **Per wave merge:** `uv run pytest tests/ --no-header -q`
- **Phase gate:** Full suite green (0 failures, 0 errors) before `/gsd:verify-work`
### Wave 0 Gaps
- [ ] `tests/unit/test_registry.py` — covers REF-01: registry population, `get_scraper()`, `validate_registry()`, config-driven variants
- [ ] ... | jku-encyclopedia | .planning/milestones/v1.1-phases/08-foundation-registry-orchestrator-test-baseline/08-RESEARCH.md | Markdown | 6ce48db314ed44750efc8472585dff13de00fdf40c824d50a33b04dfc335086f | 8 | 469 |
---
status: complete
phase: 08-foundation-registry-orchestrator-test-baseline
source: [08-01-SUMMARY.md, 08-02-SUMMARY.md, 08-03-SUMMARY.md]
started: 2026-03-22T18:15:00Z
updated: 2026-03-22T18:22:00Z
---
## Current Test
[testing complete]
## Tests
### 1. Full Test Suite Passes
expected: Run `uv run pytest` — all t... | jku-encyclopedia | .planning/milestones/v1.1-phases/08-foundation-registry-orchestrator-test-baseline/08-UAT.md | Markdown | 6b4bf07238c15f72b4c835b8fbd5ea4ba986587d0554fe8dae4389c649a7f937 | 0 | 491 |
---
phase: 8
slug: foundation-registry-orchestrator-test-baseline
status: draft
nyquist_compliant: false
wave_0_complete: false
created: 2026-03-21
---
# Phase 8 — Validation Strategy
> Per-phase validation contract for feedback sampling during execution.
---
## Test Infrastructure
| Property | Value |
|----------... | jku-encyclopedia | .planning/milestones/v1.1-phases/08-foundation-registry-orchestrator-test-baseline/08-VALIDATION.md | Markdown | 51496d02e5dd0b57f85ec87efed2a15b9e33b1304dab94a1a5fdf436e11d3600 | 0 | 896 |
phase behaviors have automated verification.*
---
## Validation Sign-Off
- [ ] All tasks have `<automated>` verify or Wave 0 dependencies
- [ ] Sampling continuity: no 3 consecutive tasks without automated verify
- [ ] Wave 0 covers all MISSING references
- [ ] No watch-mode flags
- [ ] Feedback latency < 15s
- [ ] ... | jku-encyclopedia | .planning/milestones/v1.1-phases/08-foundation-registry-orchestrator-test-baseline/08-VALIDATION.md | Markdown | 4b7502246d4f32de0c7792536fdaa911fe1dc08a3ad2fcceb29d6f1f2021b182 | 1 | 88 |
---
phase: 09-scraper-hardening-dry-patterns-quality-gates
plan: 01
type: execute
wave: 1
depends_on: []
files_modified:
- src/jku_kb/scrapers/base.py
- src/jku_kb/models.py
- data/sources.json
autonomous: true
requirements: [REF-03, SRC-05]
must_haves:
truths:
- "BaseScraper has a concrete fetch() templat... | jku-encyclopedia | .planning/milestones/v1.1-phases/09-scraper-hardening-dry-patterns-quality-gates/09-01-PLAN.md | Markdown | 44a4d68bfb6bf4a27325ab7ba7f5c8b8c51a3ecced818702889cd51afc513ab8 | 0 | 896 |
= 0
content_hash: str = ""
fetch_status: FetchStatus = FetchStatus.FETCHED
error_message: str = ""
class FetchStatus(StrEnum):
PENDING = "pending"
FETCHED = "fetched"
FAILED = "failed"
SKIPPED = "skipped"
class ManifestEntry(BaseModel):
item_id: str
source_id: str
url: str
... | jku-encyclopedia | .planning/milestones/v1.1-phases/09-scraper-hardening-dry-patterns-quality-gates/09-01-PLAN.md | Markdown | ce1ee2beaf82e1af4f9870d4438006f5df6f8efbc672cb39b2a8239b7efb9479 | 1 | 896 |
fetch_failed", item_id=item.item_id, error=str(exc))
return FetchResult(
item_id=item.item_id,
source_id=self.source_id,
fetch_status=FetchStatus.FAILED,
error_message=str(exc),
)
```
**5. Add extract_year() static method right after _error_result():**
```python
@staticmethod
de... | jku-encyclopedia | .planning/milestones/v1.1-phases/09-scraper-hardening-dry-patterns-quality-gates/09-01-PLAN.md | Markdown | 5f1a9d93cad0289c5b67f47515b4807b4241ff2ffd153f6bcfe5d15fa2548752 | 2 | 896 |
""Full source configuration entry from sources.json.
Uses extra='allow' to accept all existing source fields without
modeling them explicitly. Only quality-relevant fields are typed.
"""
model_config = ConfigDict(extra="allow")
source_id: str
name: str
category: str
url: str
quali... | jku-encyclopedia | .planning/milestones/v1.1-phases/09-scraper-hardening-dry-patterns-quality-gates/09-01-PLAN.md | Markdown | 18bed228c798bd1823737c4e437213799ab3ed000f201bf18d81779b7076d4c7 | 3 | 896 |
, health_url="https://ssw.jku.at/Teaching/"
- risc_web: expected_min_items=20, min_text_length=50, health_url="https://www3.risc.jku.at/education/courses/"
Format each quality block as:
```json
"quality": {
"expected_min_items": <value>,
"min_text_length": <value>,
"health_url": <value or null>
}
```
</action>... | jku-encyclopedia | .planning/milestones/v1.1-phases/09-scraper-hardening-dry-patterns-quality-gates/09-01-PLAN.md | Markdown | e9e2fac7aee222ac65fd5edec77b9c02d8cea766c1ea113eec0e26cafb4e5c5c | 4 | 849 |
---
phase: 09-scraper-hardening-dry-patterns-quality-gates
plan: 01
subsystem: scraper
tags: [pydantic, template-method, base-scraper, quality-gates, sources-json]
# Dependency graph
requires:
- phase: 08-foundation-registry-orchestrator-test-baseline
provides: "BaseScraper ABC, scraper registry, 509 passing tes... | jku-encyclopedia | .planning/milestones/v1.1-phases/09-scraper-hardening-dry-patterns-quality-gates/09-01-SUMMARY.md | Markdown | efc45ec5b6f11fae37896f2a61081a833c0a2e10aab7aac0eb8ecdceba870871 | 0 | 896 |
jku_sitemap) since these predate the scraper registry source_ids and changing them would break existing data references
- _do_fetch() intentionally NOT @abstractmethod -- backward compatibility requires existing scrapers that override fetch() directly to continue working; Plan 09-02 will migrate all scrapers to _do_fet... | jku-encyclopedia | .planning/milestones/v1.1-phases/09-scraper-hardening-dry-patterns-quality-gates/09-01-SUMMARY.md | Markdown | 87fb221c851f023018013f9099d7e77b51efacc0554e530ed459105c26b71cd8 | 1 | 193 |
---
phase: 09-scraper-hardening-dry-patterns-quality-gates
plan: 02
type: execute
wave: 2
depends_on: ["09-01"]
files_modified:
- src/jku_kb/scrapers/base.py
- src/jku_kb/scrapers/arxiv.py
- src/jku_kb/scrapers/openalex.py
- src/jku_kb/scrapers/web_crawl.py
- src/jku_kb/scrapers/wikidata.py
- src/jku_kb/scr... | jku-encyclopedia | .planning/milestones/v1.1-phases/09-scraper-hardening-dry-patterns-quality-gates/09-02-PLAN.md | Markdown | db8c0eadac774c0b4aee4e89de63af5e06466ab3485eb4d161ada0984bfd3855 | 0 | 896 |
/09-scraper-hardening-dry-patterns-quality-gates/09-RESEARCH.md
@.planning/phases/09-scraper-hardening-dry-patterns-quality-gates/09-01-SUMMARY.md
<interfaces>
<!-- After Plan 09-01, BaseScraper has these methods (executor: read base.py to see exact signatures) -->
From src/jku_kb/scrapers/base.py (after 09-01):
```p... | jku-encyclopedia | .planning/milestones/v1.1-phases/09-scraper-hardening-dry-patterns-quality-gates/09-02-PLAN.md | Markdown | dcdae1e614823c1a12c67bd43fc4b817419f0fdb8e8d2169f75d4385e098dd4e | 1 | 896 |
.fetch() handles this.
- The guard block typically looks like:
```python
if self._is_already_fetched(item.item_id):
dest = self.cache_dir / f"{item.item_id}.ext"
return FetchResult(item_id=item.item_id, source_id=self.source_id,
local_path=str(dest), fetch_status=FetchStatus.FET... | jku-encyclopedia | .planning/milestones/v1.1-phases/09-scraper-hardening-dry-patterns-quality-gates/09-02-PLAN.md | Markdown | bd5dcf214d6fc382dc0a88f08ee8495d1f917c7efee1d0016336623c9bf81743 | 2 | 896 |
.py | Yes | Yes | No | |
After each scraper is modified, verify it still has valid Python syntax by checking imports and indentation.
</action>
<verify>
<automated>cd C:/Development/Private/jku-encyclopedia && uv run python -c "from jku_kb.scrapers import arxiv, openalex, web_crawl, wikidata, youtube, podcast,... | jku-encyclopedia | .planning/milestones/v1.1-phases/09-scraper-hardening-dry-patterns-quality-gates/09-02-PLAN.md | Markdown | 13a31e6e660e1302551aa3743a8c1b816b90e9fd011e9899ceb6efc0c9b6276c | 3 | 896 |
's fetch() downloads multiple video tracks with per-track existence checks. Convert as follows:
1. Rename `async def fetch(self, item: RawItem)` to `async def _do_fetch(self, item: RawItem)`
2. Update docstring to: `"""Download video tracks for an episode. Called by BaseScraper.fetch() template method."""`
3. Keep ALL... | jku-encyclopedia | .planning/milestones/v1.1-phases/09-scraper-hardening-dry-patterns-quality-gates/09-02-PLAN.md | Markdown | 09699157d1f5dd2503e0fc19b8b74480b5ec0a36b841aba84322dd94a7500f78 | 4 | 896 |
) with internal caching preserved. _do_fetch() is @abstractmethod in BaseScraper. FakeScraper updated. All 509+ tests pass.</done>
</task>
</tasks>
<verification>
- `grep -r "async def fetch(self, item" src/jku_kb/scrapers/ --include="*.py" | grep -v base.py` -- should return ZERO results (no scraper overrides fetch(... | jku-encyclopedia | .planning/milestones/v1.1-phases/09-scraper-hardening-dry-patterns-quality-gates/09-02-PLAN.md | Markdown | f7d703f1af34653b4d02e4f6dc0f873528b04d94e4fb4c049a357fe7b7f9531a | 5 | 318 |
---
phase: 09-scraper-hardening-dry-patterns-quality-gates
plan: 02
subsystem: scrapers
tags: [python, template-method, dry, abstract-method, refactoring]
# Dependency graph
requires:
- phase: 09-01
provides: "BaseScraper.fetch() template method, _do_fetch() placeholder, extract_year(), _error_result()"
provides... | jku-encyclopedia | .planning/milestones/v1.1-phases/09-scraper-hardening-dry-patterns-quality-gates/09-02-SUMMARY.md | Markdown | 44ca527716e1ee4a086e28395a3791c0d31142120a2e2e1e09225930d253e2e8 | 0 | 896 |
, youtube, podcast, semantic_scholar, europe_pmc, zenodo, huggingface, pdf_fetch) from `async def fetch()` overrides to `async def _do_fetch()` implementations
- Migrated 2 special scrapers (github, opencast) preserving per-artifact caching logic inside `_do_fetch()` while still benefiting from template method error wr... | jku-encyclopedia | .planning/milestones/v1.1-phases/09-scraper-hardening-dry-patterns-quality-gates/09-02-SUMMARY.md | Markdown | 386c6e46683eef6e80799d475986d45c41f6c7a73ad1adaacff3b69031196176 | 1 | 896 |
# Next Phase Readiness
- All 13 scrapers implement the template method pattern consistently
- `_do_fetch()` is enforced via `@abstractmethod` — future scrapers cannot accidentally override `fetch()` directly
- Year extraction is centralized in `BaseScraper.extract_year()` for 6 scrapers; podcast remains using regex (d... | jku-encyclopedia | .planning/milestones/v1.1-phases/09-scraper-hardening-dry-patterns-quality-gates/09-02-SUMMARY.md | Markdown | 5824856c9c1aac52c75ab41f259669bc8d6ba76a56e08d4d2e5fb9f73fef645b | 2 | 121 |
---
phase: 09-scraper-hardening-dry-patterns-quality-gates
plan: 03
type: execute
wave: 2
depends_on: ["09-01"]
files_modified:
- src/jku_kb/quality.py
- src/jku_kb/orchestrator/discover.py
autonomous: true
requirements: [SRC-05, SRC-06, SRC-08]
must_haves:
truths:
- "Health probes run in parallel via asynci... | jku-encyclopedia | .planning/milestones/v1.1-phases/09-scraper-hardening-dry-patterns-quality-gates/09-03-PLAN.md | Markdown | ecdc9e3dd3cefbfad94ba7f04b664499ad96fe889ef6bfc6429d2df4d4c0b026 | 0 | 896 |
) + list(ctx.settings.source_variants.keys())
async def run_phase_discover(ctx: PipelineContext) -> dict[str, int]:
source_ids = ctx.source_ids or _get_all_source_ids(ctx)
# ... discover loop with asyncio.gather
```
From src/jku_kb/orchestrator/helpers.py:
```python
@dataclass(frozen=True)
class PipelineConte... | jku-encyclopedia | .planning/milestones/v1.1-phases/09-scraper-hardening-dry-patterns-quality-gates/09-03-PLAN.md | Markdown | ff174fc02a4622b2539d9c20a44bebf29aaf6cd13f0ce704efa9443521b0ce65 | 1 | 896 |
.
```python
async def probe_source_health(
source_id: str,
health_url: str,
timeout: float = 10.0,
) -> HealthResult:
"""Probe a single source endpoint for reachability."""
start = time.monotonic()
try:
async with httpx.AsyncClient(
timeout=httpx.Timeout(timeout, connect=5.0... | jku-encyclopedia | .planning/milestones/v1.1-phases/09-scraper-hardening-dry-patterns-quality-gates/09-03-PLAN.md | Markdown | 8fca2b9f70a8c2aedfa3c46305aef5bb063c2706357752c68db1f05627d9f1cd | 2 | 896 |
1%}",
)
if len(valid) < quality.expected_min_items:
log.warning(
"below_expected_min_items",
source_id=source_id,
valid=len(valid),
expected=quality.expected_min_items,
)
return valid
```
</action>
<verify>
<automated>cd C:/Develop... | jku-encyclopedia | .planning/milestones/v1.1-phases/09-scraper-hardening-dry-patterns-quality-gates/09-03-PLAN.md | Markdown | 2b817c9cd7cd84885a0968054e73cbf47926cd287c255d3bc02a46ee2e2ac2d2 | 3 | 896 |
.source_id,
error=result.error,
latency_ms=result.latency_ms,
)
unhealthy_ids.add(result.source_id)
# Filter to healthy sources only
active_ids = [sid for sid in source_ids if sid not in unhealthy_ids]
if unhealthy_ids:
log.info(
"... | jku-encyclopedia | .planning/milestones/v1.1-phases/09-scraper-hardening-dry-patterns-quality-gates/09-03-PLAN.md | Markdown | 54656c9b4845ef5cbf7a621310f04b254f47133b919bb6fc1f8b05e3dc472002 | 4 | 896 |
q` -- all tests pass
</verification>
<success_criteria>
1. quality.py exists with health probe, content validation, and threshold enforcement functions
2. orchestrator/discover.py calls health probes before discovery and content validation after each source's discovery
3. Unhealthy sources are logged and skipped (not ... | jku-encyclopedia | .planning/milestones/v1.1-phases/09-scraper-hardening-dry-patterns-quality-gates/09-03-PLAN.md | Markdown | 5f6d24ba78b4be8e8189c94595e66157a6ce3b9358c22c85a9b4bdd8dd4284dc | 5 | 135 |
---
phase: 09-scraper-hardening-dry-patterns-quality-gates
plan: 03
subsystem: quality
tags: [httpx, asyncio, health-probes, content-validation, quality-gates]
# Dependency graph
requires:
- phase: 09-01
provides: SourceQuality, SourceEntry, HealthResult models in models.py; quality blocks in sources.json
provid... | jku-encyclopedia | .planning/milestones/v1.1-phases/09-scraper-hardening-dry-patterns-quality-gates/09-03-SUMMARY.md | Markdown | da8a135101a56355b0454c495c3e602454547a47673be2bdf31f2acab24e2a6c | 0 | 896 |
but the test settings fixture is a MagicMock without a real file path
- **Fix:** Added _discover_quality_patches() helper that mocks load_source_entries, run_health_probes, validate_discovered_items, and get_quality_for_source at the discover module level. Applied to all 3 affected tests.
- **Files modified:** tests/un... | jku-encyclopedia | .planning/milestones/v1.1-phases/09-scraper-hardening-dry-patterns-quality-gates/09-03-SUMMARY.md | Markdown | 4d898c7d4a87aef48e3ff8e87d7494b5922db8a0db741c3930af1376874e6bf1 | 1 | 261 |
---
phase: 09-scraper-hardening-dry-patterns-quality-gates
plan: 04
type: execute
wave: 3
depends_on: ["09-01", "09-02", "09-03"]
files_modified:
- tests/unit/test_quality.py
- tests/unit/test_base_scraper.py
autonomous: true
requirements: [TEST-02]
must_haves:
truths:
- "Health probe tests cover successful ... | jku-encyclopedia | .planning/milestones/v1.1-phases/09-scraper-hardening-dry-patterns-quality-gates/09-04-PLAN.md | Markdown | 24b0a6ae463d4273a8eb83bdfab26d99f11ce9e9c0bf18ff9a3ee3f96c95e784 | 0 | 896 |
`python
class BaseScraper(ABC):
async def fetch(self, item: RawItem) -> FetchResult:
"""Template method: guard -> _do_fetch() -> error wrap."""
@abstractmethod
async def _do_fetch(self, item: RawItem) -> FetchResult: ...
def _error_result(self, item: RawItem, exc: Exception) -> FetchResult: ...
... | jku-encyclopedia | .planning/milestones/v1.1-phases/09-scraper-hardening-dry-patterns-quality-gates/09-04-PLAN.md | Markdown | 49174dea6653da52f814275847d5eb1d546128673adb6b73931e51adeba926f6 | 1 | 896 |
httpx import Response
from jku_kb.models import HealthResult, RawItem, SourceEntry, SourceQuality
from jku_kb.quality import (
get_quality_for_source,
load_source_entries,
probe_source_health,
run_health_probes,
validate_discovered_items,
)
```
**Helper function:**
```python
def _make_items(count:... | jku-encyclopedia | .planning/milestones/v1.1-phases/09-scraper-hardening-dry-patterns-quality-gates/09-04-PLAN.md | Markdown | ba2d90d0ce058526d4aa04e9d94d1ad6ac5ce81ac03d0d71bae6814fe78c02f9 | 2 | 896 |
test_base_scraper.py</name>
<files>tests/unit/test_base_scraper.py</files>
<read_first>
- tests/unit/test_base_scraper.py
- src/jku_kb/scrapers/base.py
- src/jku_kb/models.py
</read_first>
<behavior>
- TestExtractYear: "2024-01-15" returns 2024
- TestExtractYear: "2023" returns 2023
- Te... | jku-encyclopedia | .planning/milestones/v1.1-phases/09-scraper-hardening-dry-patterns-quality-gates/09-04-PLAN.md | Markdown | 8c67787d1a035d1682f1b1414270bfd00c83bf250c1eaa0bac7dbf2955eac2e5 | 3 | 896 |
(1, source_id="failing_source")[0]
result = await scraper.fetch(item)
assert result.fetch_status == FetchStatus.FAILED
assert "Network error" in result.error_message
```
NOTE: The `_make_items` helper may need a `source_id` parameter. If it doesn't have one already, either:
- Add `source_id` p... | jku-encyclopedia | .planning/milestones/v1.1-phases/09-scraper-hardening-dry-patterns-quality-gates/09-04-PLAN.md | Markdown | 1e21552527cacedd5462d275cb7252f41758c01d0cfaac9feffaa5037b3c5636 | 4 | 743 |
---
phase: 09-scraper-hardening-dry-patterns-quality-gates
plan: "04"
subsystem: testing
tags: [pytest, respx, structlog, asyncio, health-probes, content-validation, template-method]
requires:
- phase: 09-01
provides: SourceQuality, SourceEntry, HealthResult models + quality.py module skeleton
- phase: 09-02
... | jku-encyclopedia | .planning/milestones/v1.1-phases/09-scraper-hardening-dry-patterns-quality-gates/09-04-SUMMARY.md | Markdown | 3e7952f59cceb838e487eb9ff1f28d2ed90b19733bbdbf588f40da22050a0bdf | 0 | 896 |
assert structured log events rather than patching loggers or parsing log strings
- `FailingScraper` defined inline inside `test_exception_in_do_fetch_returns_failed` to test the exception path without modifying the module-level FakeScraper
## Deviations from Plan
None - plan executed exactly as written.
## Issues En... | jku-encyclopedia | .planning/milestones/v1.1-phases/09-scraper-hardening-dry-patterns-quality-gates/09-04-SUMMARY.md | Markdown | 2885b74b3614fbb8cb18d8457991b8109dd6151f773fe33059ab3d771b605f7e | 1 | 218 |
# Phase 9: Scraper Hardening -- DRY Patterns & Quality Gates - Context
**Gathered:** 2026-03-21
**Status:** Ready for planning
<domain>
## Phase Boundary
Consolidate common scraper patterns into BaseScraper (template method for fetch, year extraction, error conversion) and build the source quality infrastructure wit... | jku-encyclopedia | .planning/milestones/v1.1-phases/09-scraper-hardening-dry-patterns-quality-gates/09-CONTEXT.md | Markdown | f85af76e70adc4903a91aa934d6c01354ba9cdc13db5caf911dc184bae3208c9 | 0 | 896 |
/ROADMAP.md` — Phase 9 goal, success criteria, dependencies on Phase 8
### Current implementation (to be refactored)
- `src/jku_kb/scrapers/base.py` — BaseScraper ABC with `_is_already_fetched`, `fetch()`, `discover()` abstract methods
- `src/jku_kb/scrapers/__init__.py` — Registry with `@register_scraper`, `get_scrap... | jku-encyclopedia | .planning/milestones/v1.1-phases/09-scraper-hardening-dry-patterns-quality-gates/09-CONTEXT.md | Markdown | 03f06f030bc4fef21325366a2c4857edafecbaf96972d14ed36d96ac5514a83c | 1 | 740 |
# Phase 9: Scraper Hardening -- DRY Patterns & Quality Gates - Research
**Researched:** 2026-03-21
**Domain:** Python async scraper refactoring, Pydantic model extension, HTTP health probing, content validation
**Confidence:** HIGH
## Summary
Phase 9 consolidates duplicated code across 13 scraper files into BaseScra... | jku-encyclopedia | .planning/milestones/v1.1-phases/09-scraper-hardening-dry-patterns-quality-gates/09-RESEARCH.md | Markdown | 23ce1d53a154dafdc7098b8b159235e947ef8a4d2a7b9186068508a956362783 | 0 | 896 |
6 scrapers), error conversion (5+ scrapers) |
| REF-04 | All scraper files follow consistent structure | Enforced layout order documented; all 13 files analyzed for current structure |
| SRC-05 | Expected_min_items threshold in config; discovery flags sources below threshold | SourceQuality model with per-source thresh... | jku-encyclopedia | .planning/milestones/v1.1-phases/09-scraper-hardening-dry-patterns-quality-gates/09-RESEARCH.md | Markdown | a27e54b47adb93f464c7e2ed9da48c8c65b4413a918c578f9da591f57ffa635a | 1 | 896 |
check_thresholds()
orchestrator/
discover.py # Extended: health probe + content validation integration
data/
sources.json # Extended: quality block per active source
tests/
unit/
test_quality.py # NEW: health probe, content validation, threshold tests
test_base_scraper.py... | jku-encyclopedia | .planning/milestones/v1.1-phases/09-scraper-hardening-dry-patterns-quality-gates/09-RESEARCH.md | Markdown | 0d82e74e26406b48c6f319507c7f803ad57cda72a9ca823794eb240d7402a4d7 | 2 | 896 |
ok=response.status_code < 500,
latency_ms=elapsed,
status_code=response.status_code,
)
except Exception as exc:
elapsed = (time.monotonic() - start) * 1000
return HealthResult(
source_id=source_id,
ok=False,
latency_ms=e... | jku-encyclopedia | .planning/milestones/v1.1-phases/09-scraper-hardening-dry-patterns-quality-gates/09-RESEARCH.md | Markdown | bb360f5b9a3270089d23db1cad9023962f99e430e27e7522dfee951614b6f56c | 3 | 896 |
existence checks per-file, different caching strategy |
| opencast | NO | Per-track file existence checks, multi-file download |
**Template method impact:** The guard can be auto-derived from `self._manifest[item.item_id].local_path` for 11 scrapers. GitHub and OpenCast have specialized caching -- their `_do_fetch()` ... | jku-encyclopedia | .planning/milestones/v1.1-phases/09-scraper-hardening-dry-patterns-quality-gates/09-RESEARCH.md | Markdown | 3eefe05cbe76161ad2eeab59be42e39e58f8746bdb405622266638f23b5e5322 | 4 | 896 |
()` from base.py | Already handles per-domain throttling |
**Key insight:** This phase is almost entirely a refactoring and new-infrastructure phase. All building blocks (httpx, Pydantic, asyncio, structlog) are already in the project. No new dependencies needed.
## Common Pitfalls
### Pitfall 1: Breaking the fetch(... | jku-encyclopedia | .planning/milestones/v1.1-phases/09-scraper-hardening-dry-patterns-quality-gates/09-RESEARCH.md | Markdown | 219c3723c0ddf540068bca3aab677240478da474b4d64b0b55d5a952b34687b7 | 5 | 896 |
reject most of them.
**Why it happens:** Content validation checks RawItem.description + title, but some sources have thin metadata by design.
**How to avoid:** Set per-source `min_text_length` appropriately. Wikidata, GitHub, and HuggingFace should have `min_text_length=0` or very low thresholds. The SourceQuality def... | jku-encyclopedia | .planning/milestones/v1.1-phases/09-scraper-hardening-dry-patterns-quality-gates/09-RESEARCH.md | Markdown | ed96753d009ec266006c753b5ccbebe950d92340244baabc92548227bce6bb36 | 6 | 896 |
add FetchStatus.REJECTED.** Reuse the existing flow.
**Rationale:** Content validation runs post-discover, before fetch. Rejected items are simply excluded from the list passed to the fetch phase -- they never enter the fetch pipeline and never get a FetchStatus at all. The validation summary logging (discovered count... | jku-encyclopedia | .planning/milestones/v1.1-phases/09-scraper-hardening-dry-patterns-quality-gates/09-RESEARCH.md | Markdown | 4368e0ba0ed415b31eba9ef7639ad33fc6c75aeaee9e86f99b10d51d788905c3 | 7 | 896 |
place quality.py**
- What we know: Health probes and content validation are new functionality that doesn't fit neatly into existing modules
- What's unclear: Whether to create a new `quality.py` module at `src/jku_kb/quality.py` or add functions to the orchestrator package
- Recommendation: Create `src/jku_kb/... | jku-encyclopedia | .planning/milestones/v1.1-phases/09-scraper-hardening-dry-patterns-quality-gates/09-RESEARCH.md | Markdown | b8d1b554e8df99a04f0ec15c1dd867d5cab6f16f4ce2828159256b2d4992e11a | 8 | 896 |
%) logs warning | unit | `python -m pytest tests/unit/test_quality.py -x -q -k "rejection_rate"` | Wave 0 |
| TEST-02 | SourceQuality and SourceEntry model validation | unit | `python -m pytest tests/unit/test_quality.py -x -q -k "model"` | Wave 0 |
### Sampling Rate
- **Per task commit:** `python -m pytest tests/unit... | jku-encyclopedia | .planning/milestones/v1.1-phases/09-scraper-hardening-dry-patterns-quality-gates/09-RESEARCH.md | Markdown | 556841c34abcaa2b4b8273afe5457f39e06e2bcae1e8d4e21be512b08615a5a0 | 9 | 531 |
---
status: complete
phase: 09-scraper-hardening-dry-patterns-quality-gates
source: [09-01-SUMMARY.md, 09-02-SUMMARY.md, 09-03-SUMMARY.md, 09-04-SUMMARY.md]
started: 2026-03-22T18:23:00Z
updated: 2026-03-22T18:30:00Z
---
## Current Test
[testing complete]
## Tests
### 1. Full Test Suite Passes (547+ tests)
expected... | jku-encyclopedia | .planning/milestones/v1.1-phases/09-scraper-hardening-dry-patterns-quality-gates/09-UAT.md | Markdown | adc95288952afd86b099e2a352f73bbeb18226c12d77f55995a8ce62d75d24f4 | 0 | 392 |
---
phase: 9
slug: scraper-hardening-dry-patterns-quality-gates
status: draft
nyquist_compliant: false
wave_0_complete: false
created: 2026-03-21
---
# Phase 9 — Validation Strategy
> Per-phase validation contract for feedback sampling during execution.
---
## Test Infrastructure
| Property | Value |
|----------|-... | jku-encyclopedia | .planning/milestones/v1.1-phases/09-scraper-hardening-dry-patterns-quality-gates/09-VALIDATION.md | Markdown | 001ba2536c40658e938b653929cfd33134383aabc4bf6b7af6ee89eade21f5b9 | 0 | 896 |
· ✅ green · ❌ red · ⚠️ flaky*
---
## Wave 0 Requirements
- [ ] `tests/unit/test_quality.py` — NEW: stubs for SRC-05, SRC-06, SRC-08, TEST-02 (health probes, content validation, thresholds, quality models)
- [ ] Extensions to `tests/unit/test_base_scraper.py` — stubs for REF-03 (template method, extract_year, _error_... | jku-encyclopedia | .planning/milestones/v1.1-phases/09-scraper-hardening-dry-patterns-quality-gates/09-VALIDATION.md | Markdown | 3ed38c95856a8ebe118a73338ed4044e46856f6252b8c0141c28c198eb5a4a5f | 1 | 208 |
---
phase: 09-scraper-hardening-dry-patterns-quality-gates
verified: 2026-03-21T00:00:00Z
status: passed
score: 18/18 must-haves verified
re_verification: false
---
# Phase 09: Scraper Hardening, DRY Patterns, Quality Gates — Verification Report
**Phase Goal:** Consolidate common scraper patterns into BaseScraper and... | jku-encyclopedia | .planning/milestones/v1.1-phases/09-scraper-hardening-dry-patterns-quality-gates/09-VERIFICATION.md | Markdown | 1cbef920b5dd2348b2010eb75488da34cc265f949d3a4f224d9eecb79120060c | 0 | 896 |
warning | VERIFIED | quality.py line 154: `if rejection_rate > 0.5: log.warning("high_rejection_rate", ...)` |
| 17 | Sources below expected_min_items emit warning | VERIFIED | quality.py lines 160-166: `if len(valid) < quality.expected_min_items: log.warning("below_expected_min_items", ...)` |
| 18 | Comprehensive tes... | jku-encyclopedia | .planning/milestones/v1.1-phases/09-scraper-hardening-dry-patterns-quality-gates/09-VERIFICATION.md | Markdown | 161ff5216f3abeacebce540155a7e51afa95f8410ce20c09926e74cb5a13fc17 | 1 | 896 |
`src/jku_kb/orchestrator/discover.py` | `src/jku_kb/quality.py` | calls run_health_probes and validate_discovered_items | VERIFIED | discover.py lines 11-16: imports all four quality functions; both called in run_phase_discover() |
| `tests/unit/test_quality.py` | `src/jku_kb/quality.py` | tests all 5 exported function... | jku-encyclopedia | .planning/milestones/v1.1-phases/09-scraper-hardening-dry-patterns-quality-gates/09-VERIFICATION.md | Markdown | 43f16ccdc60eccc5e7b977b8f87f8eb79755172d78246339ce7a5a05cbaff1c0 | 2 | 896 |
`_is_already_fetched` guard, no inline error-to-FetchResult conversion, and no inline year extraction (where BaseScraper.extract_year() was applicable). The `_do_fetch()` method is marked `@abstractmethod` in BaseScraper, and FakeScraper in the test suite implements `_do_fetch()`.
- **Plan 09-03** created `src/jku_kb/... | jku-encyclopedia | .planning/milestones/v1.1-phases/09-scraper-hardening-dry-patterns-quality-gates/09-VERIFICATION.md | Markdown | d15f4f9137e3e1b79e75e97efb1ca219269eba0764c60d4bb21dbc7398b9b278 | 3 | 219 |
---
phase: 10-source-fixes-performance-tuning
plan: 01
type: execute
wave: 1
depends_on: []
files_modified:
- src/jku_kb/scrapers/base.py
- src/jku_kb/scrapers/__init__.py
- src/jku_kb/scrapers/wikidata.py
- src/jku_kb/scrapers/web_crawl.py
- src/jku_kb/scrapers/opencast.py
- src/jku_kb/scrapers/github.py
... | jku-encyclopedia | .planning/milestones/v1.1-phases/10-source-fixes-performance-tuning/10-01-PLAN.md | Markdown | f7b99284faca1059a9e04ddc2af2a97266a5e9b1a1e9d20c8607e8fc71c913e9 | 0 | 896 |
.md
@C:/Users/julia/.claude/get-shit-done/templates/summary.md
</execution_context>
<context>
@.planning/PROJECT.md
@.planning/ROADMAP.md
@.planning/STATE.md
<interfaces>
<!-- Key types and contracts the executor needs. -->
From src/jku_kb/scrapers/base.py:
```python
class BaseScraper(ABC):
def __init__(self, se... | jku-encyclopedia | .planning/milestones/v1.1-phases/10-source-fixes-performance-tuning/10-01-PLAN.md | Markdown | cb1b81e8d9b8ae3862340f910753c9ce4420cbe77836826631f2b4675d0d3fd2 | 1 | 896 |
py,
src/jku_kb/scrapers/opencast.py,
src/jku_kb/scrapers/github.py,
src/jku_kb/scrapers/openalex.py,
src/jku_kb/scrapers/arxiv.py,
src/jku_kb/scrapers/pdf_fetch.py,
src/jku_kb/scrapers/huggingface.py,
src/jku_kb/scrapers/youtube.py,
src/jku_kb/scrapers/podcast.py,
src/jku_kb/scrapers... | jku-encyclopedia | .planning/milestones/v1.1-phases/10-source-fixes-performance-tuning/10-01-PLAN.md | Markdown | b4076d15cd5280874c661b04c937536f00c1d1dbf25b7d93a333326c8ced80c9 | 2 | 896 |
: Path
progress_callback: ProgressCallback = None
error_callback: ErrorCallback = None
source_ids: list[str] | None = None
max_items_per_source: int | None = None
shared_client: httpx.AsyncClient | None = None
```
**5. get_scraper() factory (scrapers/__init__.py line 19):** Add `client` kwarg and f... | jku-encyclopedia | .planning/milestones/v1.1-phases/10-source-fixes-performance-tuning/10-01-PLAN.md | Markdown | a9c2e122e3d45b7049fb0893f5fbc58dd5ba0dc053cd76e197d736e6592a4d7f | 3 | 896 |
- `src/jku_kb/scrapers/semantic_scholar.py` — `def __init__(self, settings: Settings, client=None): super().__init__(settings, "semantic_scholar_jku", client=client)`
- `src/jku_kb/scrapers/europe_pmc.py` — `def __init__(self, settings: Settings, client=None): super().__init__(settings, "europe_pmc_jku", client=client)... | jku-encyclopedia | .planning/milestones/v1.1-phases/10-source-fixes-performance-tuning/10-01-PLAN.md | Markdown | ac2523caab734ee5978349ba16ee5bb8140da5cc21f30d291330953f6aebb00f | 4 | 896 |
()` (line 150):** Pass `client=None` explicitly (status doesn't need shared client).
**12. Tests (test_base_scraper.py):** Add 3 new tests in a new class `TestSharedClient`:
```python
class TestSharedClient:
"""Tests for PERF-02 shared httpx.AsyncClient."""
@pytest.mark.asyncio
async def test_shared_clie... | jku-encyclopedia | .planning/milestones/v1.1-phases/10-source-fixes-performance-tuning/10-01-PLAN.md | Markdown | 8a2d98c6eb357e588c04c6c86b29c6188b5abc4b572e179bbd1e926f12dc1c94 | 5 | 896 |
unit/test_scrapers/test_wikidata.py
</files>
<read_first>
src/jku_kb/scrapers/wikidata.py,
tests/unit/test_scrapers/test_wikidata.py,
src/jku_kb/scrapers/base.py,
src/jku_kb/models.py
</read_first>
<action>
**1. Add module-level constants for claim mapping (wikidata.py, after SPARQL query):**
`... | jku-encyclopedia | .planning/milestones/v1.1-phases/10-source-fixes-performance-tuning/10-01-PLAN.md | Markdown | 62dbabb916813f10cf68dc09ca653e1f6df4e0fcaa42ab03c8ed998af2b55b53 | 6 | 896 |
:
"""Extract human-readable values from a list of Wikidata claim statements."""
values: list[str] = []
for stmt in statements:
try:
snak = stmt.get("mainsnak", {})
if snak.get("snaktype") != "value":
continue
dv = snak["datavalue"]["value"]
... | jku-encyclopedia | .planning/milestones/v1.1-phases/10-source-fixes-performance-tuning/10-01-PLAN.md | Markdown | 84eb695fd67aef4a14ce7daf4d6af6b52ec9beda6f1d38bd66f8de1bf492fc19 | 7 | 896 |
]:`
- wikidata.py `_do_fetch` contains `Special:EntityData`
- wikidata.py `_do_fetch` contains `_format_entity_as_markdown`
- wikidata.py does NOT contain `text = f"Wikidata: {item.title}` (old stub removed)
- test_wikidata.py contains `class TestWikidataFetch` or `test_do_fetch_calls_entity_data_endpoi... | jku-encyclopedia | .planning/milestones/v1.1-phases/10-source-fixes-performance-tuning/10-01-PLAN.md | Markdown | 134725d3e23e9bf58119bb435fe080d7ed587d4f73020bf3e68164c7cf21d3a8 | 8 | 600 |
---
phase: 10-source-fixes-performance-tuning
plan: "01"
subsystem: scrapers
tags: [httpx, connection-pooling, wikidata, entity-data, performance, scraping]
requires:
- phase: 09-scraper-hardening
provides: BaseScraper template method with _do_fetch(), all 13 scrapers migrated
provides:
- Shared httpx.AsyncCl... | jku-encyclopedia | .planning/milestones/v1.1-phases/10-source-fixes-performance-tuning/10-01-SUMMARY.md | Markdown | ee5aa3591af97f92d8f202d7c54b2be653bee27f832ae433365c68f32a68fe9e | 0 | 896 |
pre-wired with include_patterns and exclude_patterns params (consolidating scrapers/__init__.py changes to prevent merge conflicts with plan 10-02)
- Wikidata _do_fetch() replaced 3-line stub with full REST EntityData call; output is structured markdown with section headings (## Employer, ## Fields of Work, ## ORCID, #... | jku-encyclopedia | .planning/milestones/v1.1-phases/10-source-fixes-performance-tuning/10-01-SUMMARY.md | Markdown | c8ac9e14ef0581ec8589fa1736cc750d5620120f5c6e71338da0b7c0240b3082 | 1 | 896 |
.
## Issues Encountered
None beyond the deviation above.
## Next Phase Readiness
- Plan 10-02 can safely use `include_patterns`/`exclude_patterns` in SourceConfig — get_scraper() and WebCrawlScraper are already pre-wired to accept and forward these fields
- Shared client infrastructure complete; future phases can u... | jku-encyclopedia | .planning/milestones/v1.1-phases/10-source-fixes-performance-tuning/10-01-SUMMARY.md | Markdown | 74aca315b017f21606b05a4a85ae77f61028df0aa91a9c002d729c77fd94f6a6 | 2 | 93 |
---
phase: 10-source-fixes-performance-tuning
plan: 02
type: execute
wave: 2
depends_on: ['01']
files_modified:
- src/jku_kb/config.py
- src/jku_kb/models.py
- src/jku_kb/scrapers/web_crawl.py
- data/sources.json
- tests/unit/test_scrapers/test_web_crawl.py
autonomous: true
requirements:
- SRC-03
- SRC-04... | jku-encyclopedia | .planning/milestones/v1.1-phases/10-source-fixes-performance-tuning/10-02-PLAN.md | Markdown | 30578cf97aecf04f894bfd25b4366f597f65e69f4c1f744befac375df26bd72e | 0 | 896 |
`python
class SourceEntry(BaseModel):
model_config = ConfigDict(extra="allow")
source_id: str
name: str
category: str
url: str
quality: SourceQuality = Field(default_factory=SourceQuality)
```
From src/jku_kb/scrapers/web_crawl.py (AFTER plan 10-01 changes):
```python
class WebCrawlScraper(Base... | jku-encyclopedia | .planning/milestones/v1.1-phases/10-source-fixes-performance-tuning/10-02-PLAN.md | Markdown | 516840e7e38cd2d76a5e131096753c26e3c2201877d171f77246c1d180ed2b99 | 1 | 896 |
https://www.bioinf.jku.at/teaching/"],
max_pages=500,
include_patterns=["/teaching/", "/research/", "/publications/", "/software/"],
exclude_patterns=["/people/contact", "/imprint", "/datenschutz"],
),
"fmv_jku": SourceConfig(
scraper_class="web_crawl",
start_urls=["https... | jku-encyclopedia | .planning/milestones/v1.1-phases/10-source-fixes-performance-tuning/10-02-PLAN.md | Markdown | b1ff808c60d484ec1ec2841284d5204b8cae8415b3243a7320f086cf7410a822 | 2 | 896 |
/research/", "/publications/", "/biere/"],
"exclude_patterns": ["/contact", "/imprint", "/team/"]
```
For `ssw_teaching` entry in sources.json:
```json
"include_patterns": ["/Teaching/", "/Research/", "/Publications/", "/Projects/"],
"exclude_patterns": ["/Contact", "/Imprint", "/Team/"]
```
For any `cp_jku` or `cp_t... | jku-encyclopedia | .planning/milestones/v1.1-phases/10-source-fixes-performance-tuning/10-02-PLAN.md | Markdown | 2729f6bf3619b68124979c4479f7b6dc83a6efa37682ccf2adcf60323103d63e | 3 | 896 |
for url in sorted(urls)[: self.max_pages]:
parsed = urlparse(url)
if not parsed.netloc.endswith(".jku.at"):
continue
if not _url_passes_filter(url, self.include_patterns, self.exclude_patterns):
rejected += 1
continue
item_id = _url_to_id(url)
... | jku-encyclopedia | .planning/milestones/v1.1-phases/10-source-fixes-performance-tuning/10-02-PLAN.md | Markdown | 0fabc764499ebf7535a2d26f3f72edf4e6155cdd5d17edb3c6f3e6138a5eaec4 | 4 | 896 |
", "/publications/", "/biere/"]
excludes = ["/contact", "/imprint", "/team/"]
assert _url_passes_filter("https://fmv.jku.at/teaching/ss2025/sat.html", patterns, excludes)
def test_fmv_team_excluded(self):
"""fmv /team/ pages are rejected."""
patterns = ["/teaching/", "/research/", "... | jku-encyclopedia | .planning/milestones/v1.1-phases/10-source-fixes-performance-tuning/10-02-PLAN.md | Markdown | 06be0a209055b39e06b4e104753e438f915f1cb4bb68342974ef9fa2097ea1ed | 5 | 896 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.