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 |
|---|---|---|---|---|---|---|
. Either remove this test or change it to assert the file is NOT written by discover().
Tests like `test_discover_parses_sitemap` and `test_discover_respects_domain_boundary` may mock per-page fetches — remove those mocks since discover no longer fetches individual pages. Only sitemap XML fetch mocks should remain.
... | jku-encyclopedia | .planning/milestones/v1.1-phases/10-source-fixes-performance-tuning/10-02-PLAN.md | Markdown | 5826c307612fa7b01616b8a12a6fa5a5bddf6426636b97c9634a11ad62ba4007 | 6 | 896 |
endswith(".jku.at"):
continue
pdf_links.append({
"url": full_url,
"discovered_from": page_url,
"page_title": str(page_title) if page_title else "",
})
except Exception:
pass # Graceful: PDF extraction is non-critical si... | jku-encyclopedia | .planning/milestones/v1.1-phases/10-source-fixes-performance-tuning/10-02-PLAN.md | Markdown | 9d53c06847183227f4a63c99184a5fdd1f83b24f2646d3a6b1d7c85e349a4613 | 7 | 896 |
www.jku.at/paper.pdf"
def test_extract_pdf_links_ignores_external_domain(self):
html = '<html><body><a href="https://external.com/paper.pdf">PDF</a></body></html>'
links = _extract_pdf_links_from_html(html, "https://www.jku.at/page")
assert len(links) == 0
```
**6. Update existing test `te... | jku-encyclopedia | .planning/milestones/v1.1-phases/10-source-fixes-performance-tuning/10-02-PLAN.md | Markdown | 1afaa1f868460d6a72a98c49c7e9e8dedfec1325969f4975d81c85543f397b37 | 8 | 838 |
---
phase: 10-source-fixes-performance-tuning
plan: "02"
subsystem: scraping
tags: [web-crawl, url-filtering, pdf-extraction, performance, pydantic, sources-json]
requires:
- phase: 10-01
provides: WebCrawlScraper.__init__ pre-wired with include_patterns/exclude_patterns; get_scraper() variant forwarding
provid... | jku-encyclopedia | .planning/milestones/v1.1-phases/10-source-fixes-performance-tuning/10-02-SUMMARY.md | Markdown | 557e150349dc6b3974f653727fa3ea08f10e7ad9378146d395da899fb9fe7e9b | 0 | 896 |
.json when no patterns explicitly provided
- 21 new tests covering _url_passes_filter semantics, all 5 institute URL patterns (bioinf, fmv, ssw, cp, risc), and PDF extraction in _do_fetch(); full test suite 585 passing
## Task Commits
1. **Task 1 (infrastructure): SourceConfig + SourceEntry + sources.json patterns** ... | jku-encyclopedia | .planning/milestones/v1.1-phases/10-source-fixes-performance-tuning/10-02-SUMMARY.md | Markdown | 9382beb9f670bca2a125471dacbe4b8a0e782f793328882b5d77c91b82163b9e | 1 | 615 |
# Phase 10: Source Fixes & Performance Tuning - Context
**Gathered:** 2026-03-21
**Status:** Ready for planning
<domain>
## Phase Boundary
Fix underperforming sources (Wikidata 3-line stubs, noisy JKU and institute web crawls) using the improved BaseScraper patterns from Phase 9, and optimize HTTP connection pooling... | jku-encyclopedia | .planning/milestones/v1.1-phases/10-source-fixes-performance-tuning/10-CONTEXT.md | Markdown | 6d81cf222693fa9770b03bcb0996e17a5e15dffb61140fa45337f0e7b2f37ec7 | 0 | 896 |
entirely or refactored into a `_do_fetch()` helper
- Test strategy for source fixes (unit tests for URL filtering, mock Wikidata API responses)
</decisions>
<canonical_refs>
## Canonical References
**Downstream agents MUST read these before planning or implementing.**
### Requirements
- `.planning/REQUIREMENTS.md` ... | jku-encyclopedia | .planning/milestones/v1.1-phases/10-source-fixes-performance-tuning/10-CONTEXT.md | Markdown | f69fce5dba8a920ad88f16190c71fe0d47672924c6b8d4d6a2fa35c651d7756a | 1 | 799 |
# Phase 10: Source Fixes & Performance Tuning - Research
**Researched:** 2026-03-21
**Domain:** Python async HTTP (httpx), Wikidata REST API, web crawl URL filtering, connection pooling
**Confidence:** HIGH
## Summary
This phase modifies three existing files (`wikidata.py`, `web_crawl.py`, `base.py`) and extends two... | jku-encyclopedia | .planning/milestones/v1.1-phases/10-source-fixes-performance-tuning/10-RESEARCH.md | Markdown | 4c304bf7a3f424fc5f37b7297321852d920134771632b87c3632276265617125 | 0 | 896 |
in a later run; no cross-scraper coupling
- Page fetch count reduction is measurable vs. baseline (current approach fetches every page during discover)
**HTTP connection pooling (PERF-02)**
- Shared `httpx.AsyncClient` via `PipelineContext` — single client for the entire pipeline run
- Client lifetime: entire run (dis... | jku-encyclopedia | .planning/milestones/v1.1-phases/10-source-fixes-performance-tuning/10-RESEARCH.md | Markdown | 5dafd3c0141ec3b3ffbd235d57eb36e99c4dce8595dae2890aece33920f2e4b5 | 1 | 896 |
implementation is purely internal refactoring plus config extension.
**Version verification:** Confirmed from existing test files and `base.py` — httpx, respx, pydantic v2, and pytest-asyncio are all active project dependencies.
---
## Architecture Patterns
### Recommended File Change Map
```
src/jku_kb/
├── scrape... | jku-encyclopedia | .planning/milestones/v1.1-phases/10-source-fixes-performance-tuning/10-RESEARCH.md | Markdown | 03ec94e7e445e44551a7a03bc56a02ac7e6f2d6b168cbe9a490079c3024f7828 | 2 | 896 |
are silently dropped (never become items).
### Pattern 3: SourceConfig Extension for URL Patterns
```python
# config.py — extend SourceConfig
class SourceConfig(BaseModel):
"""Configuration for a parameterised source variant (e.g. institute web crawls)."""
scraper_class: str
start_urls: list[str]
max_... | jku-encyclopedia | .planning/milestones/v1.1-phases/10-source-fixes-performance-tuning/10-RESEARCH.md | Markdown | c431a762c39a69462ca4c3b5491ec6f91e3fa02e572cf8335cb434db1ca5f52f | 3 | 896 |
SPARQL for per-entity enrichment:** SPARQL queries have query complexity limits and can return truncated `VALUES` lists. REST EntityData returns complete claims for one QID with no truncation risk.
- **Mutating PipelineContext:** It's a frozen dataclass; don't try to set `shared_client` post-construction. Create a fres... | jku-encyclopedia | .planning/milestones/v1.1-phases/10-source-fixes-performance-tuning/10-RESEARCH.md | Markdown | c5bc447c1265b4ca2d713aa2b4426dc4404c0ae05e3289ce64915c3e2c6126dd | 4 | 896 |
new test verifying `_do_fetch()` appends PDF links during fetch.
### Pitfall 4: Wikidata Claims With No English Label
**What goes wrong:** Some entity QIDs referenced in claims (e.g. employer, field of work) have no English label — only German or no label at all.
**Why it happens:** Wikidata is community-maintained; G... | jku-encyclopedia | .planning/milestones/v1.1-phases/10-source-fixes-performance-tuning/10-RESEARCH.md | Markdown | 9e4184e6c68090d38c87c5feaffa43643ad403d6ddd097f1f8a0d20fe74917a2 | 5 | 896 |
"affiliation"),
"P496": ("ORCID", "orcid"),
"P1960": ("Google Scholar ID", "scholar_id"),
}
def _format_entity_as_markdown(qid: str, entity: dict) -> str:
"""Format a Wikidata entity as structured markdown text."""
label = (
entity.get("labels", {}).get("en", {}).get("value")
or entity... | jku-encyclopedia | .planning/milestones/v1.1-phases/10-source-fixes-performance-tuning/10-RESEARCH.md | Markdown | bc19fcd25c25d185f8fd88573fe5955653e3ce9483e0cbe293b234e90fc4b8fd | 6 | 896 |
self.exclude_patterns):
rejected += 1
continue
item_id = _url_to_id(url)
items.append(RawItem(
item_id=item_id,
source_id=self.source_id,
url=url,
title="",
modality=Modality.TEXT,
file_type="html",
)... | jku-encyclopedia | .planning/milestones/v1.1-phases/10-source-fixes-performance-tuning/10-RESEARCH.md | Markdown | 2af6829babcf98a68423d830a86f5cd17a28dd22487f6f8d8ba34e0dd1e620fd | 7 | 896 |
["/teaching/", "/research/", "/publications/", "/datasets/"],
"exclude_patterns": ["/contact", "/imprint", "/news/"]
```
**ssw_jku** (`ssw.jku.at`, starts at `/Teaching/`):
```json
"include_patterns": ["/Teaching/", "/Research/", "/Publications/", "/Projects/"],
"exclude_patterns": ["/Contact", "/Imprint", "/Team/"]
`... | jku-encyclopedia | .planning/milestones/v1.1-phases/10-source-fixes-performance-tuning/10-RESEARCH.md | Markdown | c6bd3399333499423e8595cb84490c09fe343a14aae9328839492bcc2d985d51 | 8 | 896 |
` to the factory and pass through
2. **Whether `_collect_pdf_links()` is removed entirely or kept as private helper**
- What we know: The method is currently called from `discover()` (to be removed) and from `_do_fetch()` (to be added)
- What's unclear: If the logic is simple enough, inline into `_do_fetch()`; i... | jku-encyclopedia | .planning/milestones/v1.1-phases/10-source-fixes-performance-tuning/10-RESEARCH.md | Markdown | 25c4ea5179bfffef9dcbe65504a44e2e677bb6c566338efaf72cafa37084071f | 9 | 896 |
(new test in existing file) |
| PERF-03 | `discover()` makes no per-page HTTP requests | unit | `pytest tests/unit/test_scrapers/test_web_crawl.py::TestWebCrawlDiscover -x` | ✅ (update existing tests) |
| PERF-03 | `_do_fetch()` writes PDF links to `pdf_discovery.jsonl` | unit | `pytest tests/unit/test_scrapers/test_we... | jku-encyclopedia | .planning/milestones/v1.1-phases/10-source-fixes-performance-tuning/10-RESEARCH.md | Markdown | e7de814ebe24bead8d7ff7303225a04083cb9097acba199e48b592c1cecb549b | 10 | 696 |
---
status: complete
phase: 10-source-fixes-performance-tuning
source: [10-01-SUMMARY.md, 10-02-SUMMARY.md]
started: 2026-03-22T18:30:00Z
updated: 2026-03-22T18:32:00Z
---
## Current Test
[testing complete]
## Tests
### 1. Full Test Suite Passes
expected: Run `uv run pytest` — all tests pass, 0 failures.
result: pa... | jku-encyclopedia | .planning/milestones/v1.1-phases/10-source-fixes-performance-tuning/10-UAT.md | Markdown | d27581391077d23b3760a8e02aae1c3a201c9bb48b7c05c1d79bf068e62e0c51 | 0 | 314 |
---
phase: 10
slug: source-fixes-performance-tuning
status: draft
nyquist_compliant: false
wave_0_complete: false
created: 2026-03-21
---
# Phase 10 — Validation Strategy
> Per-phase validation contract for feedback sampling during execution.
---
## Test Infrastructure
| Property | Value |
|----------|-------|
| *... | jku-encyclopedia | .planning/milestones/v1.1-phases/10-source-fixes-performance-tuning/10-VALIDATION.md | Markdown | f002440a16ea1f01265ad6491900f84cc30b6fced2421d2281bbff2b42254b92 | 0 | 896 |
------------|
| JKU URL patterns match real sitemap | SRC-03 | Live site verification | Fetch JKU sitemap, confirm include/exclude patterns filter correctly |
| Institute URL patterns match real sitemaps | SRC-04 | Live site verification | Fetch institute sitemaps, confirm patterns filter correctly |
---
## Validatio... | jku-encyclopedia | .planning/milestones/v1.1-phases/10-source-fixes-performance-tuning/10-VALIDATION.md | Markdown | 7f585d78717a8feca88fc9359b14a164275f3bf7bfb8296ed80a532efaf6deea | 1 | 147 |
---
phase: 11-cli-dashboard-health-report-final-qa
plan: 00
type: execute
wave: 0
depends_on: []
files_modified:
- tests/unit/test_cli.py
autonomous: true
requirements:
- TEST-03
must_haves:
truths:
- "Test stubs exist for all Phase 11 CLI features before implementation begins"
- "Each stub is marked xfa... | jku-encyclopedia | .planning/milestones/v1.1-phases/11-cli-dashboard-health-report-final-qa/11-00-PLAN.md | Markdown | 0280d8bfb5f580ad6fcb34900e09b83f3c8ff73d89009348a35465aa31368f0c | 0 | 896 |
xfail(reason="Phase 11 stub - implementation pending")
def test_init_pipeline_all_sources():
from jku_kb.cli import _init_pipeline
assert False, "stub"
@pytest.mark.xfail(reason="Phase 11 stub - implementation pending")
def test_init_pipeline_single_source():
from jku_kb.cli import _init_pipeline
asser... | jku-encyclopedia | .planning/milestones/v1.1-phases/11-cli-dashboard-health-report-final-qa/11-00-PLAN.md | Markdown | 69c5e54df150a1e124d1a6ad573161a310c6919512a935bf452791d62588f351 | 1 | 527 |
---
phase: 11-cli-dashboard-health-report-final-qa
plan: 00
subsystem: testing
tags: [pytest, xfail, cli, test-stubs, wave-0]
# Dependency graph
requires: []
provides:
- 12 xfail test stubs for Phase 11 CLI features (LiveDashboard, health command, _init_pipeline, ETA, manifest stats)
affects: [11-01, 11-02]
# Tech ... | jku-encyclopedia | .planning/milestones/v1.1-phases/11-cli-dashboard-health-report-final-qa/11-00-SUMMARY.md | Markdown | 6f48cf38b2efe37785313843f2201066603e3f6dbd6c6a22e5e5377434d54436 | 0 | 608 |
---
phase: 11-cli-dashboard-health-report-final-qa
plan: 01
type: execute
wave: 1
depends_on: ["11-00"]
files_modified:
- src/jku_kb/cli.py
autonomous: true
requirements:
- CLI-02
must_haves:
truths:
- "All 6 pipeline commands (discover, fetch, chunk, embed, link, run) call _init_pipeline() instead of repeat... | jku-encyclopedia | .planning/milestones/v1.1-phases/11-cli-dashboard-health-report-final-qa/11-01-PLAN.md | Markdown | e4c71c0c906c89c21f4442ad023ce532ddaca364d8c8669b612b5e17fce11813 | 0 | 896 |
= None,
) -> tuple["Settings", "PipelineOrchestrator", list[str] | None, list[str]]:
"""Shared init for all pipeline commands. Returns (settings, orchestrator, source_ids, effective_ids)."""
settings = get_settings()
if concurrency is not None:
settings.max_concurrent_requests = concurrency
if b... | jku-encyclopedia | .planning/milestones/v1.1-phases/11-cli-dashboard-health-report-final-qa/11-01-PLAN.md | Markdown | b9139a1257a34d8491b0fbc4cedccb31754e6aba8596df34abe24d445d6e2179 | 1 | 896 |
its own table but could be simplified.
Keep `_run()`, `_phase_panel()`, `_summary_line()`, `PhaseProgress`, and `_print_pipeline_summary()` unchanged -- they will be modified in plan 02 (LiveDashboard).
Preserve the `status()`, `probe()`, `export()`, `stats()`, and `validate()` commands unchanged -- they don't follow... | jku-encyclopedia | .planning/milestones/v1.1-phases/11-cli-dashboard-health-report-final-qa/11-01-PLAN.md | Markdown | 3ca56b8e8113232712d322fc33f4d27feb323d62d2ca2adb8272d5f29ebedfd3 | 2 | 584 |
---
phase: 11-cli-dashboard-health-report-final-qa
plan: 01
subsystem: cli
tags: [typer, rich, refactoring, DRY, pipeline-commands]
# Dependency graph
requires:
- phase: 11-00
provides: xfail test stubs for _init_pipeline
provides:
- _init_pipeline() shared helper for all 6 pipeline commands
- _print_phase_r... | jku-encyclopedia | .planning/milestones/v1.1-phases/11-cli-dashboard-health-report-final-qa/11-01-SUMMARY.md | Markdown | a759e5d82fb644d5825973d9f5cb820dffbc27e0aa7923cfaf55839186311f7e | 0 | 896 |
line table blocks from 3 commands, while adding ~30 lines of helper functions) yields a net savings of ~38 lines. All functional acceptance criteria are met.
### Auto-fixed Issues
**1. [Rule 2 - Missing Critical] Added warn_if_missing_keys to all pipeline commands**
- **Found during:** Task 1 (refactoring discover/fe... | jku-encyclopedia | .planning/milestones/v1.1-phases/11-cli-dashboard-health-report-final-qa/11-01-SUMMARY.md | Markdown | 2dd529a80c600467fb9ab20ae8d837e29e65256a72b8bfd62fae2ad9672e8196 | 1 | 380 |
---
phase: 11-cli-dashboard-health-report-final-qa
plan: 02
type: execute
wave: 2
depends_on: ["11-01"]
files_modified:
- src/jku_kb/cli.py
autonomous: true
requirements:
- CLI-01
- CLI-03
- CLI-04
must_haves:
truths:
- "jku-kb run displays a single Rich Live table with per-source rows updated in-place w... | jku-encyclopedia | .planning/milestones/v1.1-phases/11-cli-dashboard-health-report-final-qa/11-02-PLAN.md | Markdown | 69a45477b424c3fe73d34c9da3425ad3480a6f81245e0b1dc588489ea556197d | 0 | 896 |
context>
<tasks>
<task type="auto">
<name>Task 1: Create LiveDashboard class with ETA and color coding</name>
<files>src/jku_kb/cli.py</files>
<read_first>
- src/jku_kb/cli.py (post plan-01 refactored version)
- .planning/phases/11-cli-dashboard-health-report-final-qa/11-RESEARCH.md (Rich Live patterns,... | jku-encyclopedia | .planning/milestones/v1.1-phases/11-cli-dashboard-health-report-final-qa/11-02-PLAN.md | Markdown | 027a344b77c4dc7461a6f2f2585ea7d539894d2ae6952efad275b1d1d8f085d6 | 1 | 896 |
:
self._console = console
self._phase_name = phase_name
self._totals = totals or {}
self._total_expected = sum(self._totals.values()) if self._totals else 0
self._rows: dict[str, _RowState] = {
sid: _RowState(source_id=sid) for sid in source_ids
}
self... | jku-encyclopedia | .planning/milestones/v1.1-phases/11-cli-dashboard-health-report-final-qa/11-02-PLAN.md | Markdown | 8880c1a1c40c92dded43444034027c672e29744e8c52f4e9d1ffd641a9c0320c | 2 | 896 |
cli.py does NOT contain `from rich.progress import`
- `python -c "from jku_kb.cli import LiveDashboard"` exits 0
</acceptance_criteria>
<done>LiveDashboard class exists with progress_callback, error_callback, ETA/throughput, color coding. PhaseProgress removed.</done>
</task>
<task type="auto">
<name>Task 2:... | jku-encyclopedia | .planning/milestones/v1.1-phases/11-cli-dashboard-health-report-final-qa/11-02-PLAN.md | Markdown | 0141de550589728ef8e3d5cffeab0b1d3cb095633d6394a6b3aa7c0922e09591 | 3 | 896 |
{}
with LiveDashboard(console, effective_ids, "fetch", totals=fetch_totals) as dashboard:
```
Update all test patches: test_cli.py patches `PhaseProgress` — search for `patch("jku_kb.cli.PhaseProgress"` and replace with `patch("jku_kb.cli.LiveDashboard"`. The mock needs `__enter__` returning a mock with `progress_call... | jku-encyclopedia | .planning/milestones/v1.1-phases/11-cli-dashboard-health-report-final-qa/11-02-PLAN.md | Markdown | fc04dfff51648cf97ad6d0ce2a52826d9cb42a9ae34a0f947e6f476c8df6ac69 | 4 | 495 |
---
phase: 11-cli-dashboard-health-report-final-qa
plan: 02
subsystem: ui
tags: [rich, live-dashboard, cli, eta, progress]
requires:
- phase: 11-01
provides: _init_pipeline() helper and refactored CLI commands
provides:
- LiveDashboard class with per-source rows, color-coded status, ETA
- _build_dashboard_ta... | jku-encyclopedia | .planning/milestones/v1.1-phases/11-cli-dashboard-health-report-final-qa/11-02-SUMMARY.md | Markdown | 0f986b23c62bd9df7ecea6831748ad0c22aa356fe9f0ff263107db8f4532bda1 | 0 | 709 |
---
phase: 11-cli-dashboard-health-report-final-qa
plan: 03
type: execute
wave: 2
depends_on: ["11-00", "11-01"]
files_modified:
- src/jku_kb/cli.py
autonomous: true
requirements:
- SRC-07
must_haves:
truths:
- "jku-kb health command shows all sources with last run date, item count, avg content size, error r... | jku-encyclopedia | .planning/milestones/v1.1-phases/11-cli-dashboard-health-report-final-qa/11-03-PLAN.md | Markdown | 81d26b4da3b15cf81beadb8ccba020bae0218547391e7e39134ba160aadc953e | 0 | 896 |
.
def _load_done_ids(manifest_path: Path) -> set[str]: ...
```
Manifest JSONL format (fetch_done.jsonl):
```json
{"item_id": "abc123", "ts": "2026-03-20T14:30:00Z"}
```
</interfaces>
</context>
<tasks>
<task type="auto">
<name>Task 1: Add health command helper functions</name>
<files>src/jku_kb/cli.py</files>
... | jku-encyclopedia | .planning/milestones/v1.1-phases/11-cli-dashboard-health-report-final-qa/11-03-PLAN.md | Markdown | 3df4c5c1e114e4aad4f7b1789afef8a4f7a55ae71a3b0ac5e0bf6f7bc9249aac | 1 | 896 |
.py (or wherever models are imported).
</action>
<verify>
<automated>cd /c/Development/Private/jku-encyclopedia && python -c "from jku_kb.cli import _read_manifest_stats, _compute_avg_file_size, _compute_health_status; print('imports ok')" && python -m pytest tests/unit/test_cli.py::test_compute_health_status t... | jku-encyclopedia | .planning/milestones/v1.1-phases/11-cli-dashboard-health-report-final-qa/11-03-PLAN.md | Markdown | 1da8f4239bed1c57caff7cae074b0ca5c529a4dc3046e70fe7df887c2d3b693f | 2 | 896 |
"Last Run", min_width=12)
table.add_column("Items", justify="right", min_width=8)
table.add_column("Avg Size", justify="right", min_width=10)
table.add_column("Error Rate", justify="right", min_width=10)
n_pass = n_warn = n_fail = 0
filtered_entries = [e for e in entries if source_ids is None or e.... | jku-encyclopedia | .planning/milestones/v1.1-phases/11-cli-dashboard-health-report-final-qa/11-03-PLAN.md | Markdown | 63ae9464034e6e8cebbf8541eca79b66b95402c3d13ddb0a00b713a2627a481f | 3 | 896 |
/tasks>
<verification>
- `python -c "from jku_kb.cli import app, health, _compute_health_status"` succeeds
- `pytest tests/unit/test_cli.py -q --tb=short` passes (existing tests unbroken)
- `grep -c "def health" src/jku_kb/cli.py` returns 1
- `grep "run_health_probes" src/jku_kb/cli.py` shows module-level import and u... | jku-encyclopedia | .planning/milestones/v1.1-phases/11-cli-dashboard-health-report-final-qa/11-03-PLAN.md | Markdown | 183f9eba668f4def605fcc01184d80cbb07efeeaf2181be6f9753f388257301f | 4 | 222 |
---
phase: 11-cli-dashboard-health-report-final-qa
plan: 03
subsystem: ui
tags: [rich, health-command, cli, probes, manifest]
requires:
- phase: 11-01
provides: _init_pipeline() helper and refactored CLI commands
- phase: 9
provides: quality.py run_health_probes(), load_source_entries(), SourceQuality mode... | jku-encyclopedia | .planning/milestones/v1.1-phases/11-cli-dashboard-health-report-final-qa/11-03-SUMMARY.md | Markdown | 02a4b609f08413efac548bd932dfac127b89a4b555e39ca7279da1bf9bf0b8ae | 0 | 704 |
---
phase: 11-cli-dashboard-health-report-final-qa
plan: 04
type: execute
wave: 3
depends_on: ["11-00", "11-02", "11-03"]
files_modified:
- tests/unit/test_cli.py
autonomous: true
requirements:
- TEST-03
- TEST-04
must_haves:
truths:
- "New tests cover LiveDashboard class (progress_callback, error_callback... | jku-encyclopedia | .planning/milestones/v1.1-phases/11-cli-dashboard-health-report-final-qa/11-04-PLAN.md | Markdown | 1dea4e1040bd8891a45ec028c38d27e8280c940750fb8c13a7de40e9199935e6 | 0 | 896 |
) -> str: ...
def _compute_health_status(item_count, quality, health_ok) -> str: ...
def health(source, verbose) -> None: ... # @app.command()
```
CRITICAL mock target note:
- `load_source_entries` and `run_health_probes` are imported at MODULE LEVEL in cli.py
(via `from jku_kb.quality import load_source_entries, r... | jku-encyclopedia | .planning/milestones/v1.1-phases/11-cli-dashboard-health-report-final-qa/11-04-PLAN.md | Markdown | 0d796d622de0d1339963c78dfa9e1653bd6e2b6c4d2a43549ba141df14199206 | 1 | 896 |
test_throughput_display():
from jku_kb.cli import _compute_throughput
result = _compute_throughput(100, 10.0)
assert "10.0 items/sec" in result
def test_throughput_zero_items():
from jku_kb.cli import _compute_throughput
assert _compute_throughput(0, 10.0) == ""
```
**_read_manifest_stats tests:**... | jku-encyclopedia | .planning/milestones/v1.1-phases/11-cli-dashboard-health-report-final-qa/11-04-PLAN.md | Markdown | 3fe5033813120e12de9edd175af0c6819020992f4ca68f69adcb3f86501abdf8 | 2 | 896 |
ConnectionTimeout" in dashboard._rows["src_a"].error
def test_live_dashboard_dynamic_source():
from jku_kb.cli import LiveDashboard
from unittest.mock import MagicMock
mock_console = MagicMock()
dashboard = LiveDashboard(mock_console, ["src_a"], "link")
dashboard._live = MagicMock()
import time... | jku-encyclopedia | .planning/milestones/v1.1-phases/11-cli-dashboard-health-report-final-qa/11-04-PLAN.md | Markdown | 2a8998b0a9940f3fb3d50539e375aab81110c561877d98ce3ce7fc4f8db2c087 | 3 | 896 |
latency_ms=50.0)]
with (
patch("jku_kb.cli.get_settings", return_value=mock_settings),
patch("jku_kb.cli.setup_logging"),
patch("jku_kb.cli.load_source_entries", return_value=entries),
patch("jku_kb.cli.run_health_probes", new_callable=AsyncMock, return_value=probes),
patch("... | jku-encyclopedia | .planning/milestones/v1.1-phases/11-cli-dashboard-health-report-final-qa/11-04-PLAN.md | Markdown | 59ec55a935075d89a4ad44be767a8bdb9921baf4d0aa3a57b183ba2046b5470b | 4 | 896 |
actual import paths in the refactored cli.py
</action>
<verify>
<automated>cd /c/Development/Private/jku-encyclopedia && python -m pytest tests/ --cov=jku_kb --cov-fail-under=80 -q --tb=short 2>&1 | tail -10</automated>
</verify>
<acceptance_criteria>
- `pytest tests/ -q --tb=short` exits with 0 failure... | jku-encyclopedia | .planning/milestones/v1.1-phases/11-cli-dashboard-health-report-final-qa/11-04-PLAN.md | Markdown | 96401426d8620b2d7c1c64f91565ea2b81714ed979481de20b8be9bd13d24ad0 | 5 | 377 |
---
phase: 11-cli-dashboard-health-report-final-qa
plan: 04
subsystem: testing
tags: [pytest, coverage, cli, dashboard, health, unit-tests]
# Dependency graph
requires:
- phase: 11-00
provides: "xfail test stubs for Phase 11 features"
- phase: 11-02
provides: "LiveDashboard implementation and initial real ... | jku-encyclopedia | .planning/milestones/v1.1-phases/11-cli-dashboard-health-report-final-qa/11-04-SUMMARY.md | Markdown | 4dc7f54c2b53b2d49660ef7417d791b81e1deda6cddd20f1be606daac04a3764 | 0 | 807 |
# Phase 11: CLI Dashboard, Health Report & Final QA - Context
**Gathered:** 2026-03-22
**Status:** Ready for planning
<domain>
## Phase Boundary
Deliver the Rich Live dashboard CLI with unified command framework, the `jku-kb health` command, and comprehensive test coverage verifying all v1.1 features. This phase cov... | jku-encyclopedia | .planning/milestones/v1.1-phases/11-cli-dashboard-health-report-final-qa/11-CONTEXT.md | Markdown | c73a1766720dea7b288083184853695b074b60c5b9611a43f85a5c9d91a7fc76 | 0 | 896 |
` §Decisions — Phase 8: PipelineContext frozen dataclass; Phase 9: quality models and thresholds; Phase 10: shared httpx client
</canonical_refs>
<code_context>
## Existing Code Insights
### Reusable Assets
- `PhaseProgress` class (cli.py:53): Wraps rich.progress.Progress with progress_callback/error_callback — need... | jku-encyclopedia | .planning/milestones/v1.1-phases/11-cli-dashboard-health-report-final-qa/11-CONTEXT.md | Markdown | 06746f5484ef495d5237ea822df7d13fb2e79b96611a19dee1ffb08a083d6f2f | 1 | 429 |
# Phase 11: CLI Dashboard, Health Report & Final QA - Research
**Researched:** 2026-03-22
**Domain:** Rich TUI (Live/Table/Progress), Typer CLI refactoring, pytest CLI testing, manifest-based health data
**Confidence:** HIGH
---
<user_constraints>
## User Constraints (from CONTEXT.md)
### Locked Decisions
**Dashbo... | jku-encyclopedia | .planning/milestones/v1.1-phases/11-cli-dashboard-health-report-final-qa/11-RESEARCH.md | Markdown | c30446548dd5688ea9e02fe3eb2c33859ccda47272ad2596963f433a246d428b | 0 | 896 |
+ `phase_start_time`; ETA = `remaining / throughput`; update in phase header row of the Live table |
| SRC-07 | `jku-kb health` command shows all sources with last run date, item count, avg content size, error rate, and pass/fail | Combine `run_health_probes()` (reachability) with manifest JSONL scan (item counts, time... | jku-encyclopedia | .planning/milestones/v1.1-phases/11-cli-dashboard-health-report-final-qa/11-RESEARCH.md | Markdown | dc0ad96f227265c3a1e2d0d9204f2a7ec5098cf20fb4f403ba32376cbdcf1a21 | 1 | 896 |
No new packages needed.** Everything is in pyproject.toml.
---
## Architecture Patterns
### Recommended Project Structure (after CLI-02 dedup)
Decision point for Claude's discretion: keep cli.py as a single file if final line count stays under 800, otherwise extract to a `cli/` package. Current cli.py is 770 lines.... | jku-encyclopedia | .planning/milestones/v1.1-phases/11-cli-dashboard-health-report-final-qa/11-RESEARCH.md | Markdown | 680abaac603fad7c740c1092ba6509f8861f343b5a92b88d245048208085b969 | 2 | 896 |
init
- Additional duplication: result table rendering pattern repeated in each command (~25 lines each = ~150 lines)
- Total: ~390 lines → target ~400 lines CLI-02 is achievable
### Pattern 3: Health Command Data Aggregation
**What:** Combine live probes (reachability) with historical manifest JSONL data for the `jku... | jku-encyclopedia | .planning/milestones/v1.1-phases/11-cli-dashboard-health-report-final-qa/11-RESEARCH.md | Markdown | bd8127fef911249869fb81c8a4b6f707e8782903bee9137c04872af235e91aaf | 3 | 896 |
-----|-------------|-----|
| In-place terminal updates | ANSI escape sequences | `rich.live.Live` | Handles terminal size, cursor positioning, Windows compatibility |
| Thread-safe terminal refresh | Custom lock + print loop | `Live._RefreshThread` (built in) | Auto-starts with `Live.__enter__`, stops with `__exit__` |... | jku-encyclopedia | .planning/milestones/v1.1-phases/11-cli-dashboard-health-report-final-qa/11-RESEARCH.md | Markdown | 51d52b86ca1e050c7ca99a9fd77aac695b7d2a189d3ff91a60ca39b14e5c7aeb | 4 | 896 |
last-line assumption for "Last Run"
**What goes wrong:** `fetch_done.jsonl` is append-only (ManifestWriter opens in `"ab"` mode). Reading the last line gives the most recent fetch timestamp. But if the file was partially written (pipeline crashed mid-run), the last line might be corrupt JSON.
**Why it happens:** `Manif... | jku-encyclopedia | .planning/milestones/v1.1-phases/11-cli-dashboard-health-report-final-qa/11-RESEARCH.md | Markdown | 8bd36e6039c4431f420e0dd32f20761224de93a781029567125a4a1bbfe125d4 | 5 | 896 |
exited — table is now static output
# Print compact summary line AFTER exit
console.print(f" [dim]Discover:[/dim] [bold]{total:,}[/bold] items [dim]({elapsed:.1f}s)[/dim]")
# Next Live context starts for fetch phase
with Live(...) as live:
...
```
### Health Command Table
```python
# Source: pattern from existi... | jku-encyclopedia | .planning/milestones/v1.1-phases/11-cli-dashboard-health-report-final-qa/11-RESEARCH.md | Markdown | 098f16891ffd6ae5e141517db7183bf8d408a6f487ab08fc22ba9b17c87eb319 | 6 | 896 |
`rich.progress.Progress` | `LiveDashboard` wraps `rich.live.Live` + `Table` | This phase | No scrolling; single table for all sources |
| Per-command settings/orchestrator init (~40 lines each) | `_init_pipeline()` shared helper | This phase | ~400 lines eliminated per CLI-02 |
| No health command | `jku-kb health` com... | jku-encyclopedia | .planning/milestones/v1.1-phases/11-cli-dashboard-health-report-final-qa/11-RESEARCH.md | Markdown | 549b63a15bfece2195b837c085dd6d82f828173c87939a97a290a9fd179c8e04 | 7 | 896 |
x` | ❌ Wave 0 |
| CLI-02 | `_init_pipeline()` returns correct tuple for specific source | unit | `pytest tests/unit/test_cli.py::test_init_pipeline_single_source -x` | ❌ Wave 0 |
| CLI-03 | Dashboard rows show green/yellow/red markup based on status | unit | `pytest tests/unit/test_cli.py::test_dashboard_color_coding -... | jku-encyclopedia | .planning/milestones/v1.1-phases/11-cli-dashboard-health-report-final-qa/11-RESEARCH.md | Markdown | 3b2bcc76fa2d4f7303879d716d6220cafe9cc8c9273eecc84261bc34d8ed8f27 | 8 | 896 |
data/sources.json` — sources have `quality.expected_min_items`, `quality.health_url` fields
### Secondary (MEDIUM confidence)
- Rich 14.3.3 table.py — Table has no `update_cell()` API; must rebuild table on each refresh (confirmed by source inspection; table rows are stored as `list[_Row]`, no mutation path)
---
## ... | jku-encyclopedia | .planning/milestones/v1.1-phases/11-cli-dashboard-health-report-final-qa/11-RESEARCH.md | Markdown | eff715b7a88bb8276e730153a374419c0af133aaa33c46cade876531ca40cc46 | 9 | 180 |
---
status: complete
phase: 11-cli-dashboard-health-report-final-qa
source: [11-00-SUMMARY.md, 11-01-SUMMARY.md, 11-02-SUMMARY.md, 11-03-SUMMARY.md, 11-04-SUMMARY.md]
started: 2026-03-22T18:32:00Z
updated: 2026-03-22T18:35:00Z
---
## Current Test
[testing complete]
## Tests
### 1. Full Test Suite Passes (606 tests)... | jku-encyclopedia | .planning/milestones/v1.1-phases/11-cli-dashboard-health-report-final-qa/11-UAT.md | Markdown | 01483a97d2ddcd456e22e1e4ca492ec076f63a3ebdd33cd68d492bbe9de94e62 | 0 | 480 |
---
phase: 11
slug: cli-dashboard-health-report-final-qa
status: draft
nyquist_compliant: true
wave_0_complete: true
created: 2026-03-22
---
# Phase 11 — Validation Strategy
> Per-phase validation contract for feedback sampling during execution.
---
## Test Infrastructure
| Property | Value |
|----------|-------|
... | jku-encyclopedia | .planning/milestones/v1.1-phases/11-cli-dashboard-health-report-final-qa/11-VALIDATION.md | Markdown | 347af990032e1a6d16d5435e5c6f58fc3985b6934e8c29f7069af9c627547045 | 0 | 896 |
-07 | unit | `pytest tests/unit/test_cli.py::test_compute_health_status -x` | ❌ W0 | ⬜ pending |
| 11-03-01 | 03 | 2 | TEST-03 | unit | `pytest tests/unit/test_registry.py -q` | ✅ | ⬜ pending |
| 11-03-02 | 03 | 2 | TEST-03 | unit | `pytest tests/unit/test_orchestrator.py -q` | ✅ | ⬜ pending |
| 11-03-03 | 03 | 2 | TES... | jku-encyclopedia | .planning/milestones/v1.1-phases/11-cli-dashboard-health-report-final-qa/11-VALIDATION.md | Markdown | f9dc53ab4fbd2c762ac7dc4f008cb5d8e63e4b24b184153ae2b2477c9518346a | 1 | 476 |
---
phase: 11-cli-dashboard-health-report-final-qa
verified: 2026-03-22T17:30:00Z
status: passed
score: 5/5 must-haves verified
human_verification:
- test: "Run jku-kb run --phase discover and observe terminal"
expected: "Single Rich Live table updates per-source rows in-place with no scrolling or layout shifts"
... | jku-encyclopedia | .planning/milestones/v1.1-phases/11-cli-dashboard-health-report-final-qa/11-VERIFICATION.md | Markdown | d757a3920108c58446efc5f282c756538c827fb85d1fc14e1827bf336247481d | 0 | 896 |
, `class _RowState`, `def _read_manifest_stats(`, `def _compute_avg_file_size(`, `def _compute_health_status(`, `def _print_phase_result(`, `def _summary_line(` |
| `tests/unit/test_cli.py` | Comprehensive tests for all Phase 11 features | VERIFIED | 1139 lines; 47 test functions covering LiveDashboard (3 tests), ETA (... | jku-encyclopedia | .planning/milestones/v1.1-phases/11-cli-dashboard-health-report-final-qa/11-VERIFICATION.md | Markdown | 9af631a66ee21277dd87a50a75bf868a13922384007b125647228cc772cbbc9e | 1 | 896 |
discover; both integrated in `LiveDashboard.progress_callback()` |
| SRC-07 | 11-03 | Health command with last run, items, avg size, error rate, pass/fail | SATISFIED | `def health()` at cli.py:870; all 6 columns present; summary footer format matches spec |
| TEST-03 | 11-00, 11-04 | Tests cover registry, orchestrator... | jku-encyclopedia | .planning/milestones/v1.1-phases/11-cli-dashboard-health-report-final-qa/11-VERIFICATION.md | Markdown | 0b0c5f79e628b604634d26dfbacc313080d966ea287dcd00c7a0d96f164648e5 | 2 | 733 |
---
phase: 17-source-cleanup-crawl-optimization
plan: 01
type: execute
wave: 1
depends_on: []
files_modified:
- src/jku_kb/config.py
- data/sources.json
- tests/unit/test_config.py
- tests/unit/test_scrapers/test_web_crawl.py
autonomous: true
requirements:
- CLEAN-01
must_haves:
truths:
- "get_scraper(... | jku-encyclopedia | .planning/milestones/v3.0-phases/17-source-cleanup-crawl-optimization/17-01-PLAN.md | Markdown | 276c41236b8336fdffbd9b0529b97d70a63842e718f9ef2ea20d9c851c06e319 | 0 | 896 |
"https://ssw.jku.at/Teaching/",
"https://ssw.jku.at/Research/",
"https://ssw.jku.at/General/Staff/",
],
max_pages=500,
include_patterns=[],
exclude_patterns=[],
),
```
3. Delete the `"risc_web"` entry (lines 133-143):
```python
... | jku-encyclopedia | .planning/milestones/v3.0-phases/17-source-cleanup-crawl-optimization/17-01-PLAN.md | Markdown | 0555f99ae4b9d33d4a2a619876b5f21a7dc16f5465fdc4c7e0d5239ca3b8a8a9 | 1 | 896 |
dead source tests)
</read_first>
<action>
In `tests/unit/test_config.py`:
1. Update `test_existing_variants_have_recursive_default` (line 223-228):
- Change the docstring from "All 5 institute source_variants" to "All 2 institute source_variants"
- Change the loop tuple from `("bioinf_jku", "fmv_jku", "cp_jk... | jku-encyclopedia | .planning/milestones/v3.0-phases/17-source-cleanup-crawl-optimization/17-01-PLAN.md | Markdown | 5135f414123b7327f4981ca3e28403604de005f851cb47772a26b17776d5450e | 2 | 837 |
---
phase: 17-source-cleanup-crawl-optimization
plan: 01
subsystem: config
tags: [source-variants, crawl-config, dead-code-removal]
# Dependency graph
requires: []
provides:
- "Clean source_variants dict with only 3 active web crawl sources"
- "Clean sources.json without dead cp_jku, ssw_jku, risc_web entries"
aff... | jku-encyclopedia | .planning/milestones/v3.0-phases/17-source-cleanup-crawl-optimization/17-01-SUMMARY.md | Markdown | 98fa9c10811b398c753806b9ac75306f2a71e6a0ca6d0a6d4a1373c70cd993d2 | 0 | 628 |
---
phase: 17-source-cleanup-crawl-optimization
plan: 02
type: execute
wave: 1
depends_on: []
files_modified:
- src/jku_kb/scrapers/html_crawler.py
- src/jku_kb/scrapers/web_crawl.py
- tests/unit/test_scrapers/test_html_crawler.py
autonomous: true
requirements:
- CLEAN-02
- CLEAN-03
- CLEAN-04
must_haves:
... | jku-encyclopedia | .planning/milestones/v3.0-phases/17-source-cleanup-crawl-optimization/17-02-PLAN.md | Markdown | 121270049d529213e08161f4a8fb97249dfa408fa96ee189f415b5735d5aa869 | 0 | 896 |
= 50,
max_wall_clock: float = 1800.0,
) -> list[str]:
```
From src/jku_kb/scrapers/base.py:
```python
async def _rate_limited_head(self, url: str, **kwargs: Any) -> httpx.Response:
"""Make a HEAD request with rate limiting."""
domain = _extract_domain(url)
limiter = get_limiter(domain)
client = awa... | jku-encyclopedia | .planning/milestones/v3.0-phases/17-source-cleanup-crawl-optimization/17-02-PLAN.md | Markdown | f69f4298270e467c4e6812859c004c2702598d5278e46c665d60f6c08e4c4e31 | 1 | 896 |
def crawl_html(
start_url: str,
fetch: Callable[[str], Awaitable[httpx.Response]],
url_passes_filter: Callable[[str], bool],
max_pages: int = 500,
max_consecutive_failures: int = 50,
max_wall_clock: float = 1800.0,
per_page_timeout: float = 30.0,
head_fetch: Callable[[str], Awaitable[htt... | jku-encyclopedia | .planning/milestones/v3.0-phases/17-source-cleanup-crawl-optimization/17-02-PLAN.md | Markdown | 1ddb5872c30d3feb05a6b430df925891b05d796183a07b4bdad745b91c2505e8 | 2 | 896 |
in web_crawl.py and add tests</name>
<files>src/jku_kb/scrapers/web_crawl.py, tests/unit/test_scrapers/test_html_crawler.py</files>
<read_first>
- src/jku_kb/scrapers/web_crawl.py (see crawl_html call sites at lines 107-112 and 128-133)
- src/jku_kb/scrapers/html_crawler.py (see updated signature with per_p... | jku-encyclopedia | .planning/milestones/v3.0-phases/17-source-cleanup-crawl-optimization/17-02-PLAN.md | Markdown | de9351d024f943a6073d4331e9d80d330f2fbd5bf2ae346f2eed61ad25507cdc | 3 | 896 |
'
'<a href="/page">page</a>'
'</body></html>'
)
links = _extract_links(html, "https://a.jku.at/")
# Only /page should be returned
assert len(links) == 1
assert links[0].endswith("/page")
```
Add the following test methods to the `TestCrawlHtml` class:
``... | jku-encyclopedia | .planning/milestones/v3.0-phases/17-source-cleanup-crawl-optimization/17-02-PLAN.md | Markdown | d7d2491f2d0758169dd4cf7764d7e68be76bb818b20318856242f145f5ec2c71 | 4 | 896 |
discovered = await crawl_html(
start, main_fetch, lambda url: True,
max_pages=10, head_fetch=head_fetch_that_fails,
)
# Despite HEAD failure, page should still be discovered via GET
assert "https://a.jku.at/page-a" in discovered
@pytest.mark.asyncio
async def tes... | jku-encyclopedia | .planning/milestones/v3.0-phases/17-source-cleanup-crawl-optimization/17-02-PLAN.md | Markdown | e072efeadd7136c9ff5b2d9a1981a43c0f5b2d2fbfca0acf7b0e77f0ed0b55df | 5 | 730 |
---
phase: 17-source-cleanup-crawl-optimization
plan: 02
subsystem: crawl
tags: [html-crawler, timeout, content-type, binary-extensions, asyncio]
# Dependency graph
requires: []
provides:
- "SKIP_EXTENSIONS with 40 extensions covering data/model/archive/binary files"
- "crawl_html per_page_timeout param (30s defau... | jku-encyclopedia | .planning/milestones/v3.0-phases/17-source-cleanup-crawl-optimization/17-02-SUMMARY.md | Markdown | 03a7ed0dad75924c2137aabed755d7443e58d61aee09bb2912c38355e9f6932f | 0 | 896 |
.TimeoutError caught separately from generic Exception -- makes timeout behavior explicit and testable
## Deviations from Plan
None - plan executed exactly as written.
## Issues Encountered
None.
## User Setup Required
None - no external service configuration required.
## Next Phase Readiness
- Phase 17 complete: ... | jku-encyclopedia | .planning/milestones/v3.0-phases/17-source-cleanup-crawl-optimization/17-02-SUMMARY.md | Markdown | 8ab59d7769805ab33de783183163ed55af09d1cf69a0cfe24449111137f4c586 | 1 | 143 |
# Phase 17: Source Cleanup & Crawl Optimization - Research
**Researched:** 2026-03-24
**Domain:** Python async web crawler optimization, httpx streaming, source configuration management
**Confidence:** HIGH
## Summary
Phase 17 is a focused cleanup and optimization phase with four requirements: removing three dead so... | jku-encyclopedia | .planning/milestones/v3.0-phases/17-source-cleanup-crawl-optimization/17-RESEARCH.md | Markdown | 64238668568dee2ca610177c235626014be8c75ed7a9aba7b4e946e8bb4d1589 | 0 | 896 |
- **CLEAN-03** can wrap `fetch(url)` in `asyncio.wait_for(fetch(url), timeout=per_page_timeout)` inside `crawl_html` without changing the callable signature.
- **CLEAN-04** is more complex because the current `fetch` callable returns a fully-downloaded `httpx.Response`. To abort early on non-HTML content-type, we need ... | jku-encyclopedia | .planning/milestones/v3.0-phases/17-source-cleanup-crawl-optimization/17-RESEARCH.md | Markdown | 6d256a3f9335415a232aa0e1babd2fea31ebbe99cb8bab187dddb29614b90d2a | 1 | 896 |
: Tests Asserting Dead Source Existence
**What goes wrong:** Removing source_variants breaks tests that assert their existence.
**Why it happens:** test_config.py and test_web_crawl.py have explicit assertions for cp_jku, ssw_jku, risc_web.
**How to avoid:** Remove or update ALL test assertions that reference the dead ... | jku-encyclopedia | .planning/milestones/v3.0-phases/17-source-cleanup-crawl-optimization/17-RESEARCH.md | Markdown | 58787b2a4194be5070041964941b955c3e6ef79f9ce1c6acbb9c6ed25cb43168 | 2 | 896 |
int = 500,
max_consecutive_failures: int = 50,
max_wall_clock: float = 1800.0,
per_page_timeout: float = 30.0, # NEW parameter
) -> list[str]:
# ... existing setup ...
while queue and len(discovered) < max_pages:
# ... existing checks ...
try:
resp = await asyncio.wait... | jku-encyclopedia | .planning/milestones/v3.0-phases/17-source-cleanup-crawl-optimization/17-RESEARCH.md | Markdown | 3e37566e1bd6da765fd0c326e5433eb4ece4d9504c2bd5a60575bc7594b00f6f | 3 | 896 |
--------------|--------------|--------|
| Small SKIP_EXTENSIONS (13 exts) | Expanded (40+ exts) | This phase | Prevents BFS from attempting to crawl binary files |
| No per-request timeout in crawl_html | asyncio.wait_for wrapping | This phase | Prevents 5-minute hangs on slow binary downloads |
| Full GET then content... | jku-encyclopedia | .planning/milestones/v3.0-phases/17-source-cleanup-crawl-optimization/17-RESEARCH.md | Markdown | 577440b780146d7a1b4abc639118ced765c8fec3e0f376fb8da90c3449c826ce | 4 | 896 |
Per task commit:** `python -m pytest tests/unit/test_scrapers/test_html_crawler.py tests/unit/test_scrapers/test_web_crawl.py tests/unit/test_config.py -x -q`
- **Per wave merge:** `python -m pytest tests/ -x -q`
- **Phase gate:** Full suite green before `/gsd:verify-work`
### Wave 0 Gaps
- [ ] New test: `test_crawl_h... | jku-encyclopedia | .planning/milestones/v3.0-phases/17-source-cleanup-crawl-optimization/17-RESEARCH.md | Markdown | 3ed87cf054906a5e8bf2cfd96a05a58d40013aba396fc5fb5eac1f480d324cab | 5 | 797 |
---
phase: 17
slug: source-cleanup-crawl-optimization
status: draft
nyquist_compliant: false
wave_0_complete: false
created: 2026-03-24
---
# Phase 17 — Validation Strategy
> Per-phase validation contract for feedback sampling during execution.
---
## Test Infrastructure
| Property | Value |
|----------|-------|
|... | jku-encyclopedia | .planning/milestones/v3.0-phases/17-source-cleanup-crawl-optimization/17-VALIDATION.md | Markdown | 988e8b6128937ea8336ef4e1bfc767783a43931fc4d8fadd42ab54b95bccad96 | 0 | 896 |
from `test_existing_variants_have_recursive_default`
*Existing infrastructure covers framework installation — only test stubs needed.*
---
## Manual-Only Verifications
| Behavior | Requirement | Why Manual | Test Instructions |
|----------|-------------|------------|-------------------|
| bioinf_jku discover comple... | jku-encyclopedia | .planning/milestones/v3.0-phases/17-source-cleanup-crawl-optimization/17-VALIDATION.md | Markdown | b6cf6070e37cd8d1fd437b1c1cb07b4f974922e1d2d34df0be98bf54a01d3062 | 1 | 209 |
---
phase: 17-source-cleanup-crawl-optimization
verified: 2026-03-24T23:15:00Z
status: passed
score: 9/9 must-haves verified
re_verification: false
---
# Phase 17: Source Cleanup & Crawl Optimization Verification Report
**Phase Goal:** Dead sources removed, crawler optimized with expanded binary exclusions, request t... | jku-encyclopedia | .planning/milestones/v3.0-phases/17-source-cleanup-crawl-optimization/17-VERIFICATION.md | Markdown | b31670ca0d92b7b101b24266de9a20b04e042394068dd0908314dbfd15b11a48 | 0 | 896 |
without cp_jku, ssw_jku, risc_web | VERIFIED | Lines 71-109: exactly 3 variants (jku_web, bioinf_jku, fmv_jku). 144 lines total, well under 800-line limit. |
| `data/sources.json` | Source registry without dead entries | VERIFIED | Zero matches for dead source IDs. Valid JSON confirmed by Python json.load(). Active sou... | jku-encyclopedia | .planning/milestones/v3.0-phases/17-source-cleanup-crawl-optimization/17-VERIFICATION.md | Markdown | cb96c04331fff91be291d5576b9f2527cc85115c81ab9cb3a0209684d3c7dcd1 | 1 | 896 |
| Request timeout added to html_crawler BFS crawl (30s per page) | SATISFIED | `asyncio.wait_for(fetch(url), timeout=per_page_timeout)` at line 241. Default 30.0s. TimeoutError caught and counted as failure. |
| CLEAN-04 | 17-02 | Content-type early abort -- non-HTML responses closed immediately during crawl phase | SA... | jku-encyclopedia | .planning/milestones/v3.0-phases/17-source-cleanup-crawl-optimization/17-VERIFICATION.md | Markdown | e5182e2ec9193fa2fda7e1a6bacb4d2c3631c67ad9aa50e67e5ed65613c37d72 | 2 | 619 |
---
phase: 18-media-discovery
plan: 01
type: execute
wave: 1
depends_on: []
files_modified:
- src/jku_kb/scrapers/web_crawl.py
- tests/unit/test_scrapers/test_web_crawl.py
autonomous: true
requirements:
- MEDIA-01
- MEDIA-04
- MEDIA-05
must_haves:
truths:
- "_extract_media_links_from_html() finds <img ... | jku-encyclopedia | .planning/milestones/v3.0-phases/18-media-discovery/18-01-PLAN.md | Markdown | cc51910942141bf1782b24dc9f2045b70455dbbfae7ea33498542cc1550963bf | 0 | 896 |
-> list[dict[str, str]]:
"""Extract PDF links from already-fetched HTML content.
Returns list of dicts with url, discovered_from, page_title keys.
Only returns links within *.jku.at domain.
"""
pdf_links: list[dict[str, str]] = []
try:
soup = BeautifulSoup(html, "lxml")
page_titl... | jku-encyclopedia | .planning/milestones/v3.0-phases/18-media-discovery/18-01-PLAN.md | Markdown | 4f3737d706de0be0509b36d0e5a168d0857debe93367ab95e1b385ba827aed63 | 1 | 896 |
"video", tag="a"
- test_extracts_a_href_audio: HTML with `<a href="/files/audio.mp3">Audio</a>` returns dict with modality="audio", tag="a"
- test_skips_data_uri: HTML with `<img src="data:image/png;base64,iVBOR...">` returns empty list
- test_skips_external_domain: HTML with `<img src="https://external.com... | jku-encyclopedia | .planning/milestones/v3.0-phases/18-media-discovery/18-01-PLAN.md | Markdown | 42b013bd94398503175bbda567dea8031668200f1798256439c625b3ed8db30d | 2 | 896 |
">
<source src="/media/clip.webm" type="video/webm">
</video>
<audio>
<source src="/media/track.ogg" type="audio/ogg">
</audio>
<a href="/files/photo.jpg">Photo</a>
<a href="/files/lecture.mp4">Video</a>
<a href="/page.html">Regular Lin... | jku-encyclopedia | .planning/milestones/v3.0-phases/18-media-discovery/18-01-PLAN.md | Markdown | 079ff6a92fdc7441afebdd26171b16ef140262813fc62f039550d515f07b6b9f | 3 | 896 |
mp3, .m4a, .wav, .ogg, .flac, .aac
- MEDIA_EXTENSIONS = union of all three
- DECORATIVE_PATTERNS frozenset contains "icon", "logo", "spacer", "arrow", "button", "nav"
- _is_decorative(url) returns True when filename stem contains any DECORATIVE_PATTERNS word
- _is_svg(url) returns True when path ends wi... | jku-encyclopedia | .planning/milestones/v3.0-phases/18-media-discovery/18-01-PLAN.md | Markdown | 7b21c22a0985551599923365bed0f7d61578e5e13ef3ad9271066f78abf78c80 | 4 | 896 |
, str]]:
"""Extract media links (images, video, audio) from already-fetched HTML.
Returns list of dicts with url, discovered_from, page_title, modality,
alt_text, tag keys. Filters out decorative images and SVGs.
Only returns links within *.jku.at domain.
"""
media_links... | jku-encyclopedia | .planning/milestones/v3.0-phases/18-media-discovery/18-01-PLAN.md | Markdown | 6a1c77ad75895948bac20daab41b40d2e162be448ae9d1a6c7b655a94942893f | 5 | 896 |
:`
- web_crawl.py contains `def _add_media(`
- web_crawl.py contains `def _extract_media_links_from_html(html: str, page_url: str) -> list[dict[str, str]]:`
- DECORATIVE_PATTERNS contains all 6 words: "icon", "logo", "spacer", "arrow", "button", "nav"
- _extract_media_links_from_html handles img, video,... | jku-encyclopedia | .planning/milestones/v3.0-phases/18-media-discovery/18-01-PLAN.md | Markdown | 95129a07f1d4522853eedf059fd35a08b396f064344e2e7cc448900ab94d92d6 | 6 | 445 |
---
phase: 18-media-discovery
plan: 01
subsystem: scrapers
tags: [beautifulsoup, media-extraction, html-parsing, tdd, web-crawl]
# Dependency graph
requires:
- phase: 10-web-crawl
provides: "_extract_pdf_links_from_html pattern, _do_fetch side-effect architecture"
provides:
- "Pure function _extract_media_link... | jku-encyclopedia | .planning/milestones/v3.0-phases/18-media-discovery/18-01-SUMMARY.md | Markdown | 08fe284f804ccb3702db521c62ea451b261c909b99c2fb3998b6ad891d1c5c78 | 0 | 877 |
---
phase: 18-media-discovery
plan: 02
type: execute
wave: 2
depends_on:
- 18-01
files_modified:
- src/jku_kb/scrapers/web_crawl.py
- tests/unit/test_scrapers/test_web_crawl.py
autonomous: true
requirements:
- MEDIA-02
- MEDIA-03
must_haves:
truths:
- "_do_fetch() calls _extract_media_links_from_html()... | jku-encyclopedia | .planning/milestones/v3.0-phases/18-media-discovery/18-02-PLAN.md | Markdown | 1ee5837baa60db9b39d103545abaedbc4c2df53357e079a08e0bf27735f4daed | 0 | 896 |
]]) -> None:
"""Append discovered PDF links to pdf_discovery.jsonl."""
discovery_path = self.cache_dir / "pdf_discovery.jsonl"
with open(discovery_path, "ab") as f:
for entry in pdf_links:
f.write(orjson.dumps(entry) + b"\n")
```
From src/jku_kb/scrapers/web_crawl.py (existing _do_fetch... | jku-encyclopedia | .planning/milestones/v3.0-phases/18-media-discovery/18-02-PLAN.md | Markdown | 929824078b980f0a4d0a578525c295b92cae02bd2584b84cce3f99ee0e3a853b | 1 | 896 |
(content-type text/plain) does NOT create media_discovery.jsonl.
- test_do_fetch_media_and_pdf_coexist: _do_fetch() on HTML with both `<a href="/paper.pdf">` and `<img src="/fig.png">` creates BOTH pdf_discovery.jsonl AND media_discovery.jsonl.
TestMediaDedup:
- test_dedup_across_pages: Create WebCrawlScra... | jku-encyclopedia | .planning/milestones/v3.0-phases/18-media-discovery/18-02-PLAN.md | Markdown | c3fcea67bd18ae215545d2b74c93703a3dabf0854f03d763d2804b66cf468b63 | 2 | 896 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.