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 |
|---|---|---|---|---|---|---|
---
phase: 01-core-infrastructure
plan: 04
subsystem: testing
tags: [respx, httpx, mocking, fixtures, pytest]
requires:
- phase: 01-core-infrastructure (PLAN-01)
provides: structured logging foundation
provides:
- mock_http_client pytest fixture for HTTP request interception
- HTTP mocking pattern for all sc... | jku-encyclopedia | .planning/milestones/v1.0-phases/01-core-infrastructure/01-04-SUMMARY.md | Markdown | 57bfe3bee79345b3f667d0c32d91c3523a1dea224d4f5e74220f08c8e7651cce | 0 | 592 |
---
phase: 01-core-infrastructure
plan: 05
subsystem: testing
tags: [pytest, pydantic-settings, structlog, config-testing]
requires:
- phase: 01-core-infrastructure
provides: warn_if_missing_keys function, Settings class with 19 fields
provides:
- 22 unit tests for Settings defaults, validation, properties, an... | jku-encyclopedia | .planning/milestones/v1.0-phases/01-core-infrastructure/01-05-SUMMARY.md | Markdown | 574e2b5ec71ee7306f7cef487efd26bda10b55e004fe8999088924e7ab059f7e | 0 | 579 |
---
phase: 01-core-infrastructure
plan: 06
subsystem: testing
tags: [pytest, structlog, json-logging, logging-testing]
requires:
- phase: 01-core-infrastructure
provides: setup_logging with JSONRenderer, get_logger with context binding
provides:
- 11 unit tests for JSON output format, context binding, and log ... | jku-encyclopedia | .planning/milestones/v1.0-phases/01-core-infrastructure/01-06-SUMMARY.md | Markdown | aa487c73c38c5f8282741ec400e3a87288e5396d41f9cda281dcea663e2ac1a7 | 0 | 570 |
---
phase: 01-core-infrastructure
plan: 07
subsystem: testing
tags: [pytest, basescraper, respx, httpx, manifest, rate-limiting]
requires:
- phase: 01-core-infrastructure
provides: mock_http_client fixture, BaseScraper ABC, RawItem/FetchResult/ManifestEntry models
provides:
- 25 unit tests for BaseScraper via ... | jku-encyclopedia | .planning/milestones/v1.0-phases/01-core-infrastructure/01-07-SUMMARY.md | Markdown | b8361b22b96b6b673108f804225f4aa9668bcc6d0dd491dbc8bc3e590124ef9c | 0 | 672 |
# Phase 1: Core Infrastructure - Context
**Gathered:** 2026-03-17
**Status:** Ready for planning
<domain>
## Phase Boundary
Establish the foundation that every other component depends on: configuration loading, domain models, structured logging, BaseScraper abstraction, Docker infrastructure, and test fixtures.
Mos... | jku-encyclopedia | .planning/milestones/v1.0-phases/01-core-infrastructure/01-CONTEXT.md | Markdown | afcaf16379cb3f811509d3bea8e4dde68276be5669461b26c03c2f14f6e49415 | 0 | 896 |
dependencies
### No external specs — requirements fully captured in decisions above
</canonical_refs>
<code_context>
## Existing Code Insights
### Reusable Assets
- `structlog.stdlib.BoundLogger` — already the logger type used throughout; `get_logger(name, **context)` is the established factory
- `Settings` (pydant... | jku-encyclopedia | .planning/milestones/v1.0-phases/01-core-infrastructure/01-CONTEXT.md | Markdown | f8ea34358485c85aae6b6b7dfc0bb3f85b8c3ad1e3fb487aa660bfe4a58fff5b | 1 | 439 |
# Phase 1: Core Infrastructure — Research
**Researched:** 2026-03-17
**Phase requirements:** INFRA-01, INFRA-02, INFRA-03, INFRA-04, INFRA-05
**Scope:** Gap-fill on ~5,000 lines of existing code — NOT a greenfield build
---
## 1. Scope Summary
Phase 1 establishes the foundation that every subsequent phase depends o... | jku-encyclopedia | .planning/milestones/v1.0-phases/01-core-infrastructure/01-RESEARCH.md | Markdown | 16cd0a280f62b2a95f3d64e30fa39ba76520caa446e282ac1bacc226c2559fad | 0 | 896 |
Settings) taking `Settings` as a parameter.
**Gap 2 — .env.example incomplete:**
Current `.env.example` has 14 fields. Missing fields from `Settings`:
- `EMBEDDING_BATCH_SIZE` (default: 10)
- `EMBEDDING_CONCURRENCY` (default: 5)
- `EMBEDDING_MODEL` (default: `gemini-embedding-exp-03-07`)
- `QDRANT_COLLECTION` (default... | jku-encyclopedia | .planning/milestones/v1.0-phases/01-core-infrastructure/01-RESEARCH.md | Markdown | 028a7346a0f06d08e3a6f5642ea6ed856c790bf5ac4dd36e1f09bfcf482273f8 | 1 | 896 |
Z"}
```
**Important key name detail:** `structlog.stdlib.add_log_level` produces `"level"` key in actual JSON output. However, `structlog.testing.capture_logs()` produces `"log_level"` key in captured dicts. Tests must account for this discrepancy:
- When testing via `capture_logs()` → check `entry["log_level"]`
- Whe... | jku-encyclopedia | .planning/milestones/v1.0-phases/01-core-infrastructure/01-RESEARCH.md | Markdown | f50deb548165783ccaf77a7ade129fe3b4e0400e7e1f3cc4b078e2eb2f02591b | 2 | 896 |
requiring `cypher-shell` (which needs auth configuration):
```yaml
healthcheck:
test: ["CMD-SHELL", "wget -qO- http://localhost:7474 || exit 1"]
interval: 10s
timeout: 5s
retries: 10
start_period: 30s
```
Neo4j needs a longer `start_period` because JVM startup + database recovery can take 15-30 seconds. `ret... | jku-encyclopedia | .planning/milestones/v1.0-phases/01-core-infrastructure/01-RESEARCH.md | Markdown | c5022c31d484140397d433438b88c763be6b6d94dfc2fa43ea7a9e60aead3c5e | 3 | 896 |
*respx pattern for httpx.AsyncClient mocking:**
```python
import respx
@pytest.fixture
def mock_http_client() -> respx.MockRouter:
"""Provide a respx mock router for HTTP request interception."""
with respx.mock(assert_all_called=False) as router:
yield router
```
Usage in tests:
```python
async def ... | jku-encyclopedia | .planning/milestones/v1.0-phases/01-core-infrastructure/01-RESEARCH.md | Markdown | 2f4d1643290dd719653211355e6aa569311143acdaacbe6bc6ea25a70bba688e | 4 | 896 |
("github_token is empty — GitHub API rate limits will be restrictive")
```
Called from `cli.py` entry points after `setup_logging()`:
```python
settings = get_settings()
setup_logging(settings.log_level)
warn_if_missing_keys(settings)
```
### respx — Fixture Pattern
```python
import httpx
import respx
@pytest.fixtu... | jku-encyclopedia | .planning/milestones/v1.0-phases/01-core-infrastructure/01-RESEARCH.md | Markdown | 6e520b7661d95d642ed9dc07d5aff7c0276fa789e877cc7d0818339eabda3120 | 5 | 896 |
|
| `pydantic-settings` | >= 2.7 | 2.13.1 | .env loading | Yes |
| `structlog` | >= 24.4 | 25.5.0 | Logging | Yes |
| `httpx` | >= 0.28 | (installed) | HTTP client | Yes |
| `aiolimiter` | >= 1.1 | (installed) | Rate limiting | Yes |
| `tenacity` | >= 9.0 | (installed) | Retry | Yes |
| `orjson` | >= 3.10 | (installed)... | jku-encyclopedia | .planning/milestones/v1.0-phases/01-core-infrastructure/01-RESEARCH.md | Markdown | 173b491c255bd9f58858ad159b99a8975e94373d0a03ea746ad79fed71f1f7ae | 6 | 896 |
5-7 can be parallelized after step 4.
---
## 10. Open Questions (Resolved by Context Decisions)
| Question | Resolution |
|----------|------------|
| ConsoleRenderer vs JSONRenderer? | Always JSON — no TTY detection, no ConsoleRenderer |
| How strict on missing API keys? | Lazy — warn, don't crash. Pipeline can run ... | jku-encyclopedia | .planning/milestones/v1.0-phases/01-core-infrastructure/01-RESEARCH.md | Markdown | 4cfa6220239198c550865cea0b3a0bfda42966ec18314895a4467a833fdf5a59 | 7 | 896 |
` produces valid JSON lines on stdout | Unit | `test_logging.py` |
| JSON output contains `"event"`, `"level"`, `"timestamp"`, `"logger"` keys | Unit | `test_logging.py` |
| `get_logger("name", source_id="x")` binds `source_id` to all subsequent log entries | Unit | `test_logging.py` |
| Log level filtering: DEBUG supp... | jku-encyclopedia | .planning/milestones/v1.0-phases/01-core-infrastructure/01-RESEARCH.md | Markdown | 29ae6d876a7cbe0c01b815250513ceef47cb134116a0f33bb3153d21f4af4217 | 8 | 896 |
, real Docker services | Pre-release |
### Coverage Targets
| Module | Target | Current | Notes |
|--------|--------|---------|-------|
| `config.py` | 90%+ | 0% (no test file) | All branches including warning function |
| `logging.py` | 90%+ | 0% (no test file) | Both setup and get_logger paths |
| `models.py` | 85%... | jku-encyclopedia | .planning/milestones/v1.0-phases/01-core-infrastructure/01-RESEARCH.md | Markdown | a411c48056692953d0aa8318de591be72d824f5dada1f2037f3eb0b520cf4fc0 | 9 | 778 |
---
phase: 1
slug: core-infrastructure
status: draft
nyquist_compliant: false
wave_0_complete: false
created: 2026-03-17
---
# Phase 1 — Validation Strategy
> Per-phase validation contract for feedback sampling during execution.
---
## Test Infrastructure
| Property | Value |
|----------|-------|
| **Framework** |... | jku-encyclopedia | .planning/milestones/v1.0-phases/01-core-infrastructure/01-VALIDATION.md | Markdown | 70748a90e5a6d9b0918ea1d51813b2e606808aaf99ad3d9e0406b2a51b542fd1 | 0 | 896 |
--------|-------------|------------|-------------------|
| Docker Compose health checks | INFRA-04 | Requires Docker daemon | Run `docker compose up -d`, wait 30s, verify `docker compose ps` shows "healthy" for both services |
| Neo4j browser access | INFRA-04 | UI verification | Open http://localhost:7474 in browser |... | jku-encyclopedia | .planning/milestones/v1.0-phases/01-core-infrastructure/01-VALIDATION.md | Markdown | fece24784a018e59aa4752a73ae4e8ac5da32bb010de009ad9966e030782afd6 | 1 | 201 |
---
status: complete
phase: 01-core-infrastructure
source: 01-01-SUMMARY.md, 01-03-SUMMARY.md, 01-04-SUMMARY.md, 01-05-SUMMARY.md, 01-06-SUMMARY.md, 01-07-SUMMARY.md, PLAN-02-config-warning-env-SUMMARY.md
started: 2026-03-18T12:00:00Z
updated: 2026-03-18T12:08:00Z
---
## Current Test
[testing complete]
## Tests
###... | jku-encyclopedia | .planning/milestones/v1.0-phases/01-core-infrastructure/1-UAT.md | Markdown | 704ce56850dea0ee33f2bfe2f1864c2115d957d547bd63018c199f098094abe7 | 0 | 588 |
# Plan: Fix Structured Logging (INFRA-03)
```yaml
wave: 1
depends_on: []
files_modified:
- src/jku_kb/logging.py
requirements:
- INFRA-03
autonomous: true
```
## Goal
Fix `setup_logging()` to emit JSON lines via `structlog.processors.JSONRenderer`, apply `log_level` to structlog's `filter_by_level` processor, an... | jku-encyclopedia | .planning/milestones/v1.0-phases/01-core-infrastructure/PLAN-01-logging-fix.md | Markdown | 58afbd796e5b8f8a116d268f133c7a164bd6169542d7a9ca4c63de267d697795 | 0 | 896 |
>
## Verification
```bash
# Verify JSONRenderer in use
grep -q "JSONRenderer" src/jku_kb/logging.py && echo "PASS: JSONRenderer present"
grep -q "ConsoleRenderer" src/jku_kb/logging.py && echo "FAIL: ConsoleRenderer still present" || echo "PASS: ConsoleRenderer removed"
# Verify JSON output
uv run python -c "
from j... | jku-encyclopedia | .planning/milestones/v1.0-phases/01-core-infrastructure/PLAN-01-logging-fix.md | Markdown | 432e88aecb4e322b0222ac073c0786e6c728e3c50c8bb5a2fa550c6f04c7482b | 1 | 121 |
---
phase: 01-core-infrastructure
plan: 02
subsystem: config
tags: [pydantic-settings, structlog, env, cli]
requires:
- phase: none
provides: standalone foundation task
provides:
- warn_if_missing_keys() function for CLI startup
- Complete .env.example documenting all 19 Settings fields
- CLI run command w... | jku-encyclopedia | .planning/milestones/v1.0-phases/01-core-infrastructure/PLAN-02-config-warning-env-SUMMARY.md | Markdown | 2e734a18dfca2aa10792345b25d33b4bc6bcb96ff01e33339310ba068b724555 | 0 | 721 |
# Plan: Add Config Warning Function and Complete .env.example (INFRA-01)
```yaml
wave: 1
depends_on: []
files_modified:
- src/jku_kb/config.py
- .env.example
requirements:
- INFRA-01
autonomous: true
```
## Goal
Add a `warn_if_missing_keys()` standalone function to `config.py` that logs warnings when `gemini_a... | jku-encyclopedia | .planning/milestones/v1.0-phases/01-core-infrastructure/PLAN-02-config-warning-env.md | Markdown | 9bf66719858dfcc9d64a0034904f598c702b59c5dd54d352bb1b97e2c584451f | 0 | 896 |
-embedding-exp-03-07
# --- Similarity ---
SIMILARITY_TOP_K=20
SIMILARITY_THRESHOLD=0.75
```
The 6 new fields being added are:
- `QDRANT_COLLECTION=jku_knowledge_base`
- `EMBEDDING_BATCH_SIZE=10`
- `EMBEDDING_CONCURRENCY=5`
- `EMBEDDING_MODEL=gemini-embedding-exp-03-07`
- `SIMILARITY_TOP_K=20`
- `SIMILARITY_THRESHOLD=... | jku-encyclopedia | .planning/milestones/v1.0-phases/01-core-infrastructure/PLAN-02-config-warning-env.md | Markdown | 1155e09162fb8b88a8c7fdfc4ac76f555a3d560009edb0a6d32cd74b1387fb9a | 1 | 762 |
# Plan: Add Docker Health Checks (INFRA-04)
```yaml
wave: 1
depends_on: []
files_modified:
- docker-compose.yml
requirements:
- INFRA-04
autonomous: true
```
## Goal
Add HTTP-based health checks to both Qdrant and Neo4j services in `docker-compose.yml` so that `docker compose ps` reports service health and futur... | jku-encyclopedia | .planning/milestones/v1.0-phases/01-core-infrastructure/PLAN-03-docker-healthchecks.md | Markdown | f38c128a3d64351c04cab593c20b245b24c0a71854dead1e4ffab01a2f0f390c | 0 | 777 |
# Plan: Add HTTP Mock Fixture to conftest.py (Test Infrastructure)
```yaml
wave: 2
depends_on:
- PLAN-01-logging-fix.md
files_modified:
- tests/conftest.py
requirements:
- INFRA-05
autonomous: true
```
## Goal
Add a `mock_http_client` fixture to `tests/conftest.py` using `respx` to establish the HTTP mocking p... | jku-encyclopedia | .planning/milestones/v1.0-phases/01-core-infrastructure/PLAN-04-conftest-mock-fixture.md | Markdown | 6b8d94b0d3d819f4adac3ee985b1150358d6a67c39db84619b09c62035c65537 | 0 | 705 |
# Plan: Create test_config.py (INFRA-01 Tests)
```yaml
wave: 3
depends_on:
- PLAN-02-config-warning-env.md
files_modified:
- tests/unit/test_config.py
requirements:
- INFRA-01
autonomous: true
```
## Goal
Create `tests/unit/test_config.py` with unit tests verifying Settings loading, default values, validation ... | jku-encyclopedia | .planning/milestones/v1.0-phases/01-core-infrastructure/PLAN-05-test-config.md | Markdown | 107cb96edac665ede0bacc0606713cc63b3ed4c30f968bf771ae8f90f3895ce0 | 0 | 896 |
= Settings(_env_file=None, max_concurrent_requests=1)
assert s1.max_concurrent_requests == 1
s50 = Settings(_env_file=None, max_concurrent_requests=50)
assert s50.max_concurrent_requests == 50
def test_similarity_threshold_range(self):
with pytest.raises(ValidationError):
... | jku-encyclopedia | .planning/milestones/v1.0-phases/01-core-infrastructure/PLAN-05-test-config.md | Markdown | 8737487065d129cf35171d0b783c27e59c165aa4627ba24be484c0d5dcc6f3e6 | 1 | 896 |
/unit/test_config.py` contains `class TestSettingsValidation`
- `tests/unit/test_config.py` contains `class TestWarnIfMissingKeys`
- `tests/unit/test_config.py` contains `from jku_kb.config import Settings, get_settings, warn_if_missing_keys`
- `tests/unit/test_config.py` contains `_env_file=None` (disables .env loadin... | jku-encyclopedia | .planning/milestones/v1.0-phases/01-core-infrastructure/PLAN-05-test-config.md | Markdown | 75e117ae0936003d9712166aa80fcc99ef6501231c0f3bfe92bd0d0ca0dfb8c0 | 2 | 176 |
# Plan: Create test_logging.py (INFRA-03 Tests)
```yaml
wave: 3
depends_on:
- PLAN-01-logging-fix.md
files_modified:
- tests/unit/test_logging.py
requirements:
- INFRA-03
autonomous: true
```
## Goal
Create `tests/unit/test_logging.py` with unit tests verifying JSON output format, context binding with `source_... | jku-encyclopedia | .planning/milestones/v1.0-phases/01-core-infrastructure/PLAN-06-test-logging.md | Markdown | f275ed1a150cb5c29182746306449c873245681a056b61a5168269b301f39424 | 0 | 896 |
)
for handler in root.handlers:
handler.stream = stream
log = structlog.get_logger("test_level")
log.warning("warn_event")
output = stream.getvalue().strip()
lines = [line for line in output.split("\n") if line.strip()]
parsed = json.loads(lines[-1])
... | jku-encyclopedia | .planning/milestones/v1.0-phases/01-core-infrastructure/PLAN-06-test-logging.md | Markdown | d9f5a053ee3d7d243e3a8b07e6126eef1e7e3b69adad911f492943133183e221 | 1 | 896 |
(self):
"""WARNING messages should pass when level is WARNING."""
stream = StringIO()
logging.basicConfig(
format="%(message)s",
stream=stream,
level=logging.WARNING,
force=True,
)
structlog.reset_defaults()
setup_logging("W... | jku-encyclopedia | .planning/milestones/v1.0-phases/01-core-infrastructure/PLAN-06-test-logging.md | Markdown | 5bb1068c5994502918c8050556f94ac65e883a6297a557efb6131e64948d82a1 | 2 | 533 |
# Plan: Create test_base_scraper.py (INFRA-05 Tests)
```yaml
wave: 3
depends_on:
- PLAN-04-conftest-mock-fixture.md
files_modified:
- tests/unit/test_base_scraper.py
requirements:
- INFRA-02
- INFRA-05
autonomous: true
```
## Goal
Create `tests/unit/test_base_scraper.py` with a `FakeScraper(BaseScraper)` sub... | jku-encyclopedia | .planning/milestones/v1.0-phases/01-core-infrastructure/PLAN-07-test-base-scraper.md | Markdown | 504f3d6e7ff9fe78cd93dde8c3d299f0ac16efc99444c0cd8174ff1bb6e6a713 | 0 | 896 |
(count)
]
@pytest.fixture
def fake_settings(tmp_path: Path) -> Settings:
"""Settings with tmp_path directories for isolated file I/O."""
return Settings(
_env_file=None,
cache_dir=tmp_path / "cache",
data_dir=tmp_path / "data",
log_level="DEBUG",
)
class TestExtractDo... | jku-encyclopedia | .planning/milestones/v1.0-phases/01-core-infrastructure/PLAN-07-test-base-scraper.md | Markdown | 6f3cddf9039636b9c4f2df2a9dc94f52a05984bd40f2f5b89a4241ac97cf3fb2 | 1 | 896 |
,
)
scraper._manifest["item_missing_file"] = entry
assert scraper._is_already_fetched("item_missing_file") is False
def test_returns_false_for_pending_status(self, fake_settings):
scraper = FakeScraper(fake_settings)
entry = ManifestEntry(
item_id="pending_item",... | jku-encyclopedia | .planning/milestones/v1.0-phases/01-core-infrastructure/PLAN-07-test-base-scraper.md | Markdown | c6b050a9fce573bd2b88eda3c60115e78106174da403fe620d114bd06e972235 | 2 | 896 |
" not in scraper2.fetch_calls
assert "item_1" not in scraper2.fetch_calls
assert "item_2" in scraper2.fetch_calls
assert "item_3" in scraper2.fetch_calls
assert len(results2) == 2
class TestScraperInit:
def test_creates_cache_directory(self, fake_settings):
scraper = FakeSc... | jku-encyclopedia | .planning/milestones/v1.0-phases/01-core-infrastructure/PLAN-07-test-base-scraper.md | Markdown | 8a551046c1bd30c0da89df598c2c14a8d220b8c9bd8a11d1817045451c3c8972 | 3 | 613 |
# Phase 01 Verification: Core Infrastructure
**Verified:** 2026-03-17
**Phase goal:** Establish the foundation that every other component depends on -- configuration, data models, logging, base scraper abstraction, Docker infrastructure, and test fixtures.
**Requirement IDs:** INFRA-01, INFRA-02, INFRA-03, INFRA-04, I... | jku-encyclopedia | .planning/milestones/v1.0-phases/01-core-infrastructure/VERIFICATION.md | Markdown | 957d8c50c38bfe56c3cb37fdaca84f4ab1513ef2ef6c6ddfb2ebcd30c2d2ff60 | 0 | 896 |
class FetchResult(BaseModel)` with 8 fields | PASS |
| `EmbeddingResult` model defined | `src/jku_kb/models.py:171` -- `class EmbeddingResult(BaseModel)` with 5 fields | PASS |
| `Source` (SourceConfig) model defined | `src/jku_kb/models.py:68` -- `class SourceConfig(BaseModel)` with 22 fields | PASS |
| All models val... | jku-encyclopedia | .planning/milestones/v1.0-phases/01-core-infrastructure/VERIFICATION.md | Markdown | 2ed1005e3c1757b58e2576917a0fdca6372d22df7fbe4c869b45d322ae5d97a1 | 1 | 896 |
| Qdrant service has `healthcheck` block using `wget` against `/healthz` | `docker-compose.yml:12` -- `wget -qO- http://localhost:6333/healthz` | PASS |
| Neo4j service has `healthcheck` block using `wget` against port 7474 | `docker-compose.yml:29` -- `wget -qO- http://localhost:7474` | PASS |
| No `depends_on` betwee... | jku-encyclopedia | .planning/milestones/v1.0-phases/01-core-infrastructure/VERIFICATION.md | Markdown | 43633bfd0882c5728a129c984ecd41fcd6c2c60c8b9c025e82261310518cf312 | 2 | 896 |
`stop_after_attempt(5)`, `wait_exponential` | PASS |
| BaseScraper has local file caching | `scrapers/base.py:178-196` -- `_download_file()` with streaming + hashing | PASS |
| BaseScraper has manifest tracking | `scrapers/base.py:86-112` -- `_load_manifest`, `_save_manifest`, `_update_manifest_entry` | PASS |
| BaseSc... | jku-encyclopedia | .planning/milestones/v1.0-phases/01-core-infrastructure/VERIFICATION.md | Markdown | 615bd07695d3205047ec15077ed13c8b581eadf31faf78fd113d130010a670bf | 3 | 896 |
`docker compose config --quiet` exits 0 | PASS |
| 4 | BaseScraper subclass can make rate-limited HTTP requests, cache responses, track manifest, and resume after simulated crash | `FakeScraper` tests: run orchestration, manifest persistence, resume-after-crash all pass | PASS |
| 5 | structlog produces JSON-formatted ... | jku-encyclopedia | .planning/milestones/v1.0-phases/01-core-infrastructure/VERIFICATION.md | Markdown | 5e61cc003e2c33b03da15254364747c74e4b52d14a046fd23ef711a87bfb4014 | 4 | 290 |
---
phase: 02-priority-scrapers-dedup
plan: 01
type: execute
wave: 1
depends_on: []
files_modified:
- src/jku_kb/scrapers/opencast.py
- tests/fixtures/opencast_page.json
- tests/unit/test_scrapers/test_opencast.py
autonomous: true
requirements: [OPEN-01, OPEN-02, OPEN-03, OPEN-04, OPEN-05]
must_haves:
truths:
... | jku-encyclopedia | .planning/milestones/v1.0-phases/02-priority-scrapers-dedup/02-01-PLAN.md | Markdown | 9774869bdc799a258c386d395cfc68a338c2d64c46cdf06ee6a6f1b784a1f12f | 0 | 896 |
Response:
def _is_already_fetched(self, item_id: str) -> bool:
@staticmethod
def compute_hash(data: bytes) -> str:
```
From tests/conftest.py:
```python
@pytest.fixture
def settings(tmp_path: Path) -> Settings: # test settings with tmp dirs
@pytest.fixture
def mock_http_client() -> respx.MockRouter: # re... | jku-encyclopedia | .planning/milestones/v1.0-phases/02-priority-scrapers-dedup/02-01-PLAN.md | Markdown | cdb5702d13c52145e8f3d061000afb897915a4cebebc5d6606984a226c067eaf | 1 | 896 |
Create RawItem with attachment type `cover/search+preview` (not in allowed list). Assert empty results.
**TestMetadataExtraction** (covers OPEN-02): Keep existing TestEpisodeToRawItem tests, add:
- `test_attachments_extracted`: Assert item.metadata["attachments"] has correct count and types from SAMPLE_EPISODE.
... | jku-encyclopedia | .planning/milestones/v1.0-phases/02-priority-scrapers-dedup/02-01-PLAN.md | Markdown | c3bd43ec908bed1c93bebb575b371eec55c85975d2bbb3ca4c27cf7710b77897 | 2 | 896 |
await self._download_file(url, dest)`, log success, add to downloaded list.
- On exception: log error, clean up partial file, continue to next track.
- If no tracks downloaded: return `FetchResult(item_id=item.item_id, source_id=self.source_id, fetch_status=FetchStatus.SKIPPED, error_message="No tracks download... | jku-encyclopedia | .planning/milestones/v1.0-phases/02-priority-scrapers-dedup/02-01-PLAN.md | Markdown | a6e925723482b6c6e5327a26d4e9775842c19f471374758ddd2823a9a5a7bc37 | 3 | 637 |
---
phase: 02-priority-scrapers-dedup
plan: 01
subsystem: scraper
tags: [opencast, video, dual-track, pagination, fixtures, pytest, respx, asyncmock]
requires:
- phase: 01-core-infrastructure
provides: BaseScraper with _download_file, RawItem/FetchResult models, respx mock fixture
provides:
- OpenCast scraper... | jku-encyclopedia | .planning/milestones/v1.0-phases/02-priority-scrapers-dedup/02-01-SUMMARY.md | Markdown | f760b9a5e67aed13fa700e5a612de3dcd5490fda06c096cf8b0d9af22328a3e6 | 0 | 896 |
a list entry, not logic changes
- Missing presentation track logged at DEBUG not WARNING — single-camera lectures without slides are normal, not errors
- fetch_attachments() called unconditionally inside fetch() — the plan requires attachment integration is not optional
- Primary path set to first successfully-download... | jku-encyclopedia | .planning/milestones/v1.0-phases/02-priority-scrapers-dedup/02-01-SUMMARY.md | Markdown | a188758b5085b3049a24f39be7b34615e8be9a230fed2e71e605e5dfe3a35bc9 | 1 | 465 |
---
phase: 02-priority-scrapers-dedup
plan: 02
type: execute
wave: 1
depends_on: []
files_modified:
- src/jku_kb/scrapers/github.py
- tests/fixtures/github_repos.json
- tests/fixtures/github_tree.json
- tests/unit/test_scrapers/test_github.py
autonomous: true
requirements: [GH-01, GH-02, GH-03]
must_haves:
t... | jku-encyclopedia | .planning/milestones/v1.0-phases/02-priority-scrapers-dedup/02-02-PLAN.md | Markdown | b3ae0ee04ebf15d3e2df0866068c3bf90a41b35ac2fea08136952b71d7098316 | 0 | 896 |
iic-jku", "ics-jku", "JKU-ICG", "SSW-JKU", "jku-win-dke"]
API_BASE = "https://api.github.com"
# _repo_to_raw_item sets metadata["fork"] = repo.get("fork", False) but does NOT filter forks
# fetch() gets README + file_tree.json but NOT source files
```
From tests/conftest.py:
```python
@pytest.fixture
def settings(tmp_... | jku-encyclopedia | .planning/milestones/v1.0-phases/02-priority-scrapers-dedup/02-02-PLAN.md | Markdown | a9c5356563e491c63a4143605bffd5f84db10a5d7625a8edf7abcbae374dca60 | 1 | 896 |
},
{"path": "tests", "type": "tree"}
]
}
```
3. Extend `tests/unit/test_scrapers/test_github.py`:
**TestIsSourceFile** (pure function tests for file selection logic):
- `test_accepts_py_in_src`: `_is_source_file("src/model.py", "blob")` returns True
- `test_accepts_ipynb_in_src`: `_is_sourc... | jku-encyclopedia | .planning/milestones/v1.0-phases/02-priority-scrapers-dedup/02-02-PLAN.md | Markdown | 8829164f996dc5cd73e4c2f968e42aee2957ca24c19aa6bcc15bea914c2b43f8 | 2 | 896 |
`
- tests/unit/test_scrapers/test_github.py contains `class TestFetchSourceFiles`
- tests/unit/test_scrapers/test_github.py contains `test_fetch_skips_fork_repo`
- tests/unit/test_scrapers/test_github.py contains `test_fetch_caps_source_files_at_100`
- `uv run pytest tests/unit/test_scrapers/test_github... | jku-encyclopedia | .planning/milestones/v1.0-phases/02-priority-scrapers-dedup/02-02-PLAN.md | Markdown | f1aee28da693da9aea9393f510240cad3e3f5c45348157b7fdebab8b0a71d473 | 3 | 896 |
, log: `self.log.info("source_files_capped", repo=repo_name, total=original_count, cap=MAX_SOURCE_FILES_PER_REPO)`.
- For each source file entry:
- `file_dest = dest_dir / entry["path"]`.
- If `file_dest.exists()`: continue (cache hit).
- `file_dest.parent.mkdir(parents=True, exist_ok=True)`.
... | jku-encyclopedia | .planning/milestones/v1.0-phases/02-priority-scrapers-dedup/02-02-PLAN.md | Markdown | e9561dbf849065e351cfd907de0b0facc0b48c6c175025f93f215f288e1c37df | 4 | 692 |
---
phase: 02-priority-scrapers-dedup
plan: "02"
subsystem: scrapers
tags: [github, scraper, fork-filtering, source-files, rate-limit, tdd]
dependency_graph:
requires: []
provides: [github-scraper-hardened]
affects: [src/jku_kb/scrapers/github.py]
tech_stack:
added: []
patterns: [tdd, respx-mocking, async-tes... | jku-encyclopedia | .planning/milestones/v1.0-phases/02-priority-scrapers-dedup/02-02-SUMMARY.md | Markdown | d2a29dac797d12c596fdeb0c18eb561cfcfc2e6c3735ef26503191437b7c143c | 0 | 896 |
`) as `side_effect` to return fixture on page 1 and empty list on subsequent pages.
2. **`_is_source_file` accepts any non-skip directory**: The plan specified accepting files in `SOURCE_DIRS` (src/, lib/) or "any non-skip directory" — this was implemented as accepting any path where no component is in `SKIP_DIRS`. Th... | jku-encyclopedia | .planning/milestones/v1.0-phases/02-priority-scrapers-dedup/02-02-SUMMARY.md | Markdown | f2c3642015940d02cf44c9301b2f2b4b1065de5212457a9b0e33c369d7cf778a | 1 | 587 |
---
phase: 02-priority-scrapers-dedup
plan: 03
type: execute
wave: 1
depends_on: []
files_modified:
- src/jku_kb/scrapers/base.py
- src/jku_kb/storage/dedup.py
- tests/unit/test_dedup.py
- tests/unit/test_scrapers/test_base_scraper.py
autonomous: true
requirements: [DEDUP-01, DEDUP-02, DEDUP-03, DEDUP-04]
must... | jku-encyclopedia | .planning/milestones/v1.0-phases/02-priority-scrapers-dedup/02-03-PLAN.md | Markdown | f3bcbb7c11457d656f8c99d56854d7a2dd23ed11c0b889638b7b59c85a240f7e | 0 | 896 |
settings(tmp_path: Path) -> Settings:
@pytest.fixture
def mock_http_client() -> respx.MockRouter:
```
</interfaces>
</context>
<tasks>
<task type="auto" tdd="true">
<name>Task 1: Add audit JSONL writing to DeduplicationEngine and test it</name>
<files>src/jku_kb/storage/dedup.py, tests/unit/test_dedup.py</files>
... | jku-encyclopedia | .planning/milestones/v1.0-phases/02-priority-scrapers-dedup/02-03-PLAN.md | Markdown | 096648a9b72ee511b2770e7889c328c2f33bb552da7848c3120bb1b596eb6d63 | 1 | 896 |
— should not raise.
- `test_is_duplicate_returns_match_reason`: Engine with DOI match returns `("item_1", "doi")`. Engine with title match returns `("item_1", "title_author_year")`.
</action>
<verify>
<automated>uv run pytest tests/unit/test_dedup.py -x -q</automated>
</verify>
<acceptance_criteria>
... | jku-encyclopedia | .planning/milestones/v1.0-phases/02-priority-scrapers-dedup/02-03-PLAN.md | Markdown | 1a6d443dec24deee3066719c1596cc91d9613b2273b1f5edc72752fd3eabcaba | 2 | 896 |
). Assert `cache_dir/dedup_decisions.jsonl` exists with 1 line containing item 2's id.
- `test_run_dedup_audit_file_content`: After run with dedup, read audit JSONL. Parse each line. Assert fields: `ts`, `item_id`, `source_id`, `duplicate_of`, `match_reason`, `action`.
- `test_run_dedup_logs_stats`: Capture log o... | jku-encyclopedia | .planning/milestones/v1.0-phases/02-priority-scrapers-dedup/02-03-PLAN.md | Markdown | 74949bf68b7ae378ef1aa838af0861ff72e589531ae378236720b7ac8237229c | 3 | 567 |
---
phase: 02-priority-scrapers-dedup
plan: "03"
subsystem: dedup-pipeline
tags: [dedup, scraper, audit, jsonl, pipeline-integration]
dependency_graph:
requires: [02-01, 02-02]
provides: [dedup-pipeline-integration, audit-trail]
affects: [src/jku_kb/storage/dedup.py, src/jku_kb/scrapers/base.py]
tech_stack:
add... | jku-encyclopedia | .planning/milestones/v1.0-phases/02-priority-scrapers-dedup/02-03-SUMMARY.md | Markdown | 6ab8d26817ff298480b170a337ba4b82f3460e39f54e4e0bfc91353baa8af586 | 0 | 896 |
and required updating all callers (tests, base.py) atomically.
2. **write_dedup_decision() as standalone function:** Kept as a module-level function rather than a method on DeduplicationEngine. The engine focuses on detection/indexing; the audit write is a side-effect of a pipeline decision, not of the engine itself.
... | jku-encyclopedia | .planning/milestones/v1.0-phases/02-priority-scrapers-dedup/02-03-SUMMARY.md | Markdown | d187cb0c78423ff3d9a17802c325036d0c47b5f6a9f3c8ecca9fb5e4e8edde50 | 1 | 184 |
---
phase: 02-priority-scrapers-dedup
plan: 04
type: execute
wave: 2
depends_on: [01, 02, 03]
files_modified:
- src/jku_kb/probe.py
- tests/unit/test_probe.py
- tests/integration/test_live_apis.py
autonomous: false
requirements: [OPEN-05, GH-01, GH-02]
must_haves:
truths:
- "Concurrency probe tests levels ... | jku-encyclopedia | .planning/milestones/v1.0-phases/02-priority-scrapers-dedup/02-04-PLAN.md | Markdown | afe31201add72eb894e98b5fa5e9cf22860b9cbdae6d0566f12adc270c378a1c | 0 | 896 |
with recommendation.
Returns:
{
"results": {1: {"median_ms": N, "p95_ms": N, "errors": N}, ...},
"recommended": int, # highest level with 0 errors and p95 < MAX_P95_MS
}
"""
log = structlog.get_logger("probe")
test_levels = levels or PROBE_LEVELS
results: di... | jku-encyclopedia | .planning/milestones/v1.0-phases/02-priority-scrapers-dedup/02-04-PLAN.md | Markdown | 78d4f808c8d85f6e234a692d9481f5d6a3d5b63a94a84ca50cca47b90f5ced1b | 1 | 896 |
test_live_apis.py</files>
<read_first>
- tests/integration/test_live_apis.py
- src/jku_kb/scrapers/opencast.py
- src/jku_kb/scrapers/github.py
- tests/fixtures/opencast_page.json
- tests/fixtures/github_repos.json
</read_first>
<action>
Extend `tests/integration/test_live_apis.py`:
1. **TestO... | jku-encyclopedia | .planning/milestones/v1.0-phases/02-priority-scrapers-dedup/02-04-PLAN.md | Markdown | b63c6b23043ec11c093fb011bc749275bb77c90d4cdf75e2c3c26f506129ed96 | 2 | 896 |
Expected: Returns results dict with recommended concurrency level
</how-to-verify>
<resume-signal>Type "approved" or describe issues</resume-signal>
<action>Human verification checkpoint — run the commands listed in how-to-verify and confirm results match expectations.</action>
<verify><automated>uv run pytest ... | jku-encyclopedia | .planning/milestones/v1.0-phases/02-priority-scrapers-dedup/02-04-PLAN.md | Markdown | a6dc865a2bbb80aa764854cb180dd9c5b04d4a4e4949416c95d8239a8f12f931 | 3 | 318 |
---
phase: 02-priority-scrapers-dedup
plan: 04
subsystem: testing
tags: [httpx, asyncio, respx, opencast, github, concurrency, integration-tests]
# Dependency graph
requires:
- phase: 02-priority-scrapers-dedup
provides: OpenCast scraper, GitHub scraper, dedup engine (plans 01-03)
provides:
- Concurrency prob... | jku-encyclopedia | .planning/milestones/v1.0-phases/02-priority-scrapers-dedup/02-04-SUMMARY.md | Markdown | 99536f8625d0c0b2aebe50203ab3124695e1d2c4e78ec56b48e46491b6ee7a3a | 0 | 896 |
## Deviations from Plan
**1. [Schema Mismatch] OpenCast API response format differs from test expectations**
- **Found during:** Task 3 (human verification)
- **Issue:** Tests expected `data["search-results"]["result"]` with `id`/`dcTitle` at episode top level. Actual API returns `data["result"]` with `mediapackage.id... | jku-encyclopedia | .planning/milestones/v1.0-phases/02-priority-scrapers-dedup/02-04-SUMMARY.md | Markdown | 6ecf596997179fedb468856d47107d8b2f02a570586a771b335fdb6c4bb3e26a | 1 | 454 |
# Phase 2: Priority Scrapers & Dedup - Context
**Gathered:** 2026-03-19
**Status:** Ready for planning
<domain>
## Phase Boundary
Build production-ready OpenCast and GitHub scrapers and wire up the deduplication engine to run after discovery, before fetch. Validates the scraper pattern established in Phase 1 before ... | jku-encyclopedia | .planning/milestones/v1.0-phases/02-priority-scrapers-dedup/02-CONTEXT.md | Markdown | ac619dc3c5f2f2195ee49fc0df0c34e5fea5b0a431444c09c6102eb5b771902f | 0 | 896 |
(DOI, arXiv ID, title+author+year)
- `tests/unit/test_dedup.py` — Existing dedup unit tests (7 tests)
### Source configuration
- `data/sources.json` — Source map with API endpoints, rate limits, pagination details, and scraping notes
### Requirements
- `.planning/REQUIREMENTS.md` — OPEN-01..05, GH-01..03, DEDUP-01..0... | jku-encyclopedia | .planning/milestones/v1.0-phases/02-priority-scrapers-dedup/02-CONTEXT.md | Markdown | 55f156fe7172130e169d6ad778124ff87dfebcacee353a4996796bb37d8b8e0c | 1 | 519 |
# Phase 2: Priority Scrapers & Dedup - Research
**Researched:** 2026-03-19
**Domain:** HTTP scraping (OpenCast, GitHub APIs), async Python, deduplication pipelines
**Confidence:** HIGH
## Summary
Phase 2 is primarily a **hardening and gap-filling** phase, not greenfield. Roughly 525 lines of existing code across `op... | jku-encyclopedia | .planning/milestones/v1.0-phases/02-priority-scrapers-dedup/02-RESEARCH.md | Markdown | 0f008c9d774dd706fc914fab700252192ba01466a48400d600aa4980900089e2 | 0 | 896 |
.live`:
- OpenCast: fetch 1 API page (limit=1 episode), verify response schema (tracks, metadata fields). No video download in tests.
- GitHub: list repos from 1 org (e.g., ml-jku), verify response has repos with expected fields. Validates auth and pagination.
### Claude's Discretion
- Exact concurrency probe impl... | jku-encyclopedia | .planning/milestones/v1.0-phases/02-priority-scrapers-dedup/02-RESEARCH.md | Markdown | 2932d9e44e6f69070330d002ba709cf6a5bd6134e99791426d29d4335c2efbcf | 1 | 896 |
in BaseScraper |
| tenacity | >=9.0 | Retry with exponential backoff | Already wired in `_request_with_retry()`, 5 attempts |
| orjson | >=3.10 | Fast JSON serialization | Used in manifest JSONL writes; preferred over stdlib json |
| pydantic v2 | >=2.10 | Data validation / models | All models are Pydantic BaseModel; n... | jku-encyclopedia | .planning/milestones/v1.0-phases/02-priority-scrapers-dedup/02-RESEARCH.md | Markdown | 037478786f5473631f9e127704f9a81e32681d2d2ac16b7437c1ff091cb25c6a | 2 | 896 |
must be injected between discover and fetch.
**What:** After `discover()` returns items, pass each through `DeduplicationEngine.is_duplicate()`. Items that return a non-None original_id are skipped (logged + written to audit JSONL). Unique items proceed to fetch.
**Integration point:** `BaseScraper.run()` signature a... | jku-encyclopedia | .planning/milestones/v1.0-phases/02-priority-scrapers-dedup/02-RESEARCH.md | Markdown | 011e1fbb37889fec8eb352b2b9094be17b7fef44f186ca9af1deadf024da5979 | 3 | 896 |
** A dict of `{concurrency: {median_ms, p95_ms, errors}}`. Log results at INFO level. Return recommended concurrency (highest level with 0 errors and p95 < 2000ms).
**Implementation note:** Use `asyncio.gather()` with a `Semaphore` for parallelism control, not the rate limiter (which controls requests/second, not simu... | jku-encyclopedia | .planning/milestones/v1.0-phases/02-priority-scrapers-dedup/02-RESEARCH.md | Markdown | ef0987ef972243832e6895610476f7c5da1899b5bea3d2264fe70878281c4aaa | 4 | 896 |
signs:** 403 responses with `rate limit exceeded` in body, or `X-RateLimit-Remaining: 0`.
### Pitfall 3: Dedup Engine State Across Sources
**What goes wrong:** If `DeduplicationEngine` is instantiated fresh for each scraper run, cross-source dedup is lost. Phase 2 only needs within-source dedup for OpenCast and GitHub... | jku-encyclopedia | .planning/milestones/v1.0-phases/02-priority-scrapers-dedup/02-RESEARCH.md | Markdown | b8bf252ae6f49ca8c01155adb5bfe365e3ae6c801840a3cda1f19cf32f2a1bc0 | 5 | 896 |
size, content_hash = await self._download_file(url, dest)
downloaded.append((str(dest), track_type))
except Exception as e:
self.log.error("track_download_failed", item_id=item.item_id,
track_type=track_type, error=str(e))
if not downloaded:
return ... | jku-encyclopedia | .planning/milestones/v1.0-phases/02-priority-scrapers-dedup/02-RESEARCH.md | Markdown | cdf1f1a748c807572828dbbff4ddba95190060a632ced2563bd0fc89dffc479e | 6 | 896 |
"errors": errors,
}
return results
```
## State of the Art
| Old Approach | Current Approach | When Changed | Impact |
|--------------|------------------|--------------|--------|
| `requests` (sync) | `httpx` (async) | 2022+ | Non-blocking I/O; required for asyncio concurrency |
| Manual sleep for rat... | jku-encyclopedia | .planning/milestones/v1.0-phases/02-priority-scrapers-dedup/02-RESEARCH.md | Markdown | 5afcba53ea5b572f8430c21c1349681cd7d003461e582f55483e78e07b2d3fef | 7 | 896 |
unit | `uv run pytest tests/unit/test_scrapers/test_opencast.py::TestEpisodeToRawItem -x` | ✅ (partial) |
| OPEN-03 | Both track types discovered and stored | unit | `uv run pytest tests/unit/test_scrapers/test_opencast.py -k tracks -x` | ✅ (partial) |
| OPEN-04 | Attachment URLs discovered (thumbnails, captions) | uni... | jku-encyclopedia | .planning/milestones/v1.0-phases/02-priority-scrapers-dedup/02-RESEARCH.md | Markdown | b3853f9fbd682c77213d1910b5093f7b8aaffd24f617b77b6c3eb2db690cb4b1 | 8 | 896 |
.py`, `base.py`, `storage/dedup.py` — authoritative state of existing implementation
- Direct test inspection: `tests/unit/test_scrapers/test_opencast.py`, `test_github.py`, `tests/unit/test_dedup.py` — existing coverage mapped
- `pyproject.toml` — package versions, pytest config, asyncio_mode confirmed
- `tests/confte... | jku-encyclopedia | .planning/milestones/v1.0-phases/02-priority-scrapers-dedup/02-RESEARCH.md | Markdown | 0edcabcddf5ab8070b354cabeee6a9a970a12bb51a3861ec5c8894e4152c28bd | 9 | 359 |
---
phase: 2
slug: priority-scrapers-dedup
status: draft
nyquist_compliant: false
wave_0_complete: false
created: 2026-03-19
---
# Phase 2 — Validation Strategy
> Per-phase validation contract for feedback sampling during execution.
---
## Test Infrastructure
| Property | Value |
|----------|-------|
| **Framework... | jku-encyclopedia | .planning/milestones/v1.0-phases/02-priority-scrapers-dedup/02-VALIDATION.md | Markdown | f504a22208c1420d3a21a0bf21ebb537bf8d7e10d8d66fb1d85fa1902a3ca330 | 0 | 896 |
k dedup -x` | ❌ W0 | ⬜ pending |
| 02-03-04 | 03 | 1 | DEDUP-04 | unit | `uv run pytest tests/unit/test_dedup.py -k audit -x` | ❌ W0 | ⬜ pending |
| 02-04-01 | 04 | 2 | OPEN-01+02 | live | `uv run pytest tests/integration/test_live_apis.py::TestOpenCastLive -x` | ✅ (extend) | ⬜ pending |
| 02-04-02 | 04 | 2 | GH-01+02 ... | jku-encyclopedia | .planning/milestones/v1.0-phases/02-priority-scrapers-dedup/02-VALIDATION.md | Markdown | 3928890913236a85876ffef6b24239aa879084ddcffa3bfed98c3f7ed6558d46 | 1 | 561 |
---
phase: 02-priority-scrapers-dedup
verified: 2026-03-19T10:30:00Z
status: human_needed
score: 11/12 must-haves verified
human_verification:
- test: "Run `uv run jku-kb discover --source media_jku_opencast` against live OpenCast"
expected: "Enumerates episodes with complete metadata (title, creator, date, descr... | jku-encyclopedia | .planning/milestones/v1.0-phases/02-priority-scrapers-dedup/02-VERIFICATION.md | Markdown | a55d5056f3177136601508077644938b946e940aaa7f6c44a84ae7a851190fd3 | 0 | 896 |
|
| 12 | Live integration tests validate OpenCast and GitHub API schemas | HUMAN | Tests exist, collect cleanly (10 collected), marked `@pytest.mark.live`; cannot verify without live network |
**Score:** 11/12 truths verified (one partial — test assertion weakness, not implementation gap)
---
### Required Artifacts
... | jku-encyclopedia | .planning/milestones/v1.0-phases/02-priority-scrapers-dedup/02-VERIFICATION.md | Markdown | 51929d812bc21228419e1dbc167b370f9d179cab28788ab05ea49513c92a0776 | 1 | 896 |
; download result accumulated to `downloaded_paths` |
| `src/jku_kb/scrapers/opencast.py` | `src/jku_kb/models.py` | `FetchResult` with local_path for primary track | WIRED | `FetchResult(item_id=..., local_path=str(primary_path), ...)` at lines 136-143 |
| `src/jku_kb/scrapers/github.py` | `src/jku_kb/scrapers/base.py... | jku-encyclopedia | .planning/milestones/v1.0-phases/02-priority-scrapers-dedup/02-VERIFICATION.md | Markdown | b4ee61434c48aa57911b2db4c8d554adb855c4a9e14559c819268e0a24826748 | 2 | 896 |
= (10.0, 20)` in base.py; test assertion is weak (see Anti-Patterns) |
| DEDUP-01 | 02-03 | Match items by DOI | SATISFIED | `_doi_index` + `_normalize_doi()`; `test_same_doi_is_duplicate`, `test_normalized_doi` |
| DEDUP-02 | 02-03 | Match by normalized title + author + year | SATISFIED | `_title_author_hash()`; `test... | jku-encyclopedia | .planning/milestones/v1.0-phases/02-priority-scrapers-dedup/02-VERIFICATION.md | Markdown | e0d089eb7154fdf661555d7b93c51e8eb056d31dfd1d8fc172cc3a559593d986 | 3 | 866 |
---
phase: 03-remaining-scrapers
plan: 01
type: execute
wave: 1
depends_on: []
files_modified:
- src/jku_kb/scrapers/openalex.py
- src/jku_kb/scrapers/arxiv.py
- src/jku_kb/scrapers/semantic_scholar.py
- src/jku_kb/scrapers/europe_pmc.py
- src/jku_kb/scrapers/zenodo.py
- tests/unit/test_scrapers/test_openal... | jku-encyclopedia | .planning/milestones/v1.0-phases/03-remaining-scrapers/03-01-PLAN.md | Markdown | c1d6a3706a6dff14ef29afe57b2592e10adfcd2c34c62e8f46ea0065f91d14bd | 0 | 896 |
...
async def _rate_limited_get(self, url: str, params: dict[str, Any] | None = None, **kwargs: Any) -> httpx.Response: ...
async def _download_file(self, url: str, dest: Path) -> tuple[int, str]: ...
def _is_already_fetched(self, item_id: str) -> bool: ...
@abstractmethod
async def discover(self) -... | jku-encyclopedia | .planning/milestones/v1.0-phases/03-remaining-scrapers/03-01-PLAN.md | Markdown | fea2648a977438568a688fce26c15d3cfe859dbde6e5601fe7143818fe4718c3 | 1 | 896 |
8. Ensure `status_code != 200` check after every `_rate_limited_get()` call with `self.log.error("api_error", status=response.status_code)`
**openalex.py — specific fixes:**
- Wrap the `_rate_limited_get` call in discover() loop with try/except (currently missing)
- No other structural changes needed; cursor paginatio... | jku-encyclopedia | .planning/milestones/v1.0-phases/03-remaining-scrapers/03-01-PLAN.md | Markdown | a58deff994cd0e597bdd4a5f48dfbaab835d2c30308530c5a5cf89fbeab6472d | 2 | 896 |
`
- arxiv.py contains `self._is_already_fetched` (not manual dest.exists() for cache check)
- Existing test_openalex.py and test_models.py tests still pass (regression check)
</acceptance_criteria>
<done>All 5 academic scrapers match Phase 2 quality standard with try/except wraps, structured logging, and co... | jku-encyclopedia | .planning/milestones/v1.0-phases/03-remaining-scrapers/03-01-PLAN.md | Markdown | 8a686297941c2523c31a51344d02c88cb7ff00ef615198d2c57dd41272abd7a4 | 3 | 896 |
`test_discover_follows_token_pagination(settings, mock_http_client)`: first call returns `{"data": [...], "token": "next123"}`, second call returns `{"data": [...], "token": null}`. Verify 2 requests made and all items collected.
- `test_discover_handles_api_error(settings, mock_http_client)`: mock returns 500, verify ... | jku-encyclopedia | .planning/milestones/v1.0-phases/03-remaining-scrapers/03-01-PLAN.md | Markdown | 6c848a76655043ff09f3f3d5a948b7a6f18343c1f4b5890a506f0b86ca665f70 | 4 | 896 |
0
- At least 15 total tests across the 5 files (3+ per scraper)
</acceptance_criteria>
<done>All 5 academic scrapers have unit tests covering discover(), helper functions, and error handling. At least 15 tests passing.</done>
</task>
<task type="auto">
<name>Task 3: Add live integration tests for 5 academic ... | jku-encyclopedia | .planning/milestones/v1.0-phases/03-remaining-scrapers/03-01-PLAN.md | Markdown | f265ccc2da5be581c97c894e79d02a5e89f9326acf23001675f786a56590d0a2 | 5 | 896 |
py contains `class TestEuropePMCLive`
- tests/integration/test_live_apis.py contains `class TestZenodoLive`
- All 4 new test classes use `@pytest.mark.live` decorator
- All test methods contain `pytest.skip` for timeout/429 handling
- TestSemanticScholarLive uses `paper/search/bulk` endpoint (not /paper... | jku-encyclopedia | .planning/milestones/v1.0-phases/03-remaining-scrapers/03-01-PLAN.md | Markdown | f2a12903bc3058cb5c6e8078ad29f841a1dde477b838ad79e1b5e0e6f7a660dc | 6 | 433 |
---
phase: 03-remaining-scrapers
plan: 01
subsystem: scrapers
tags: [scrapers, academic-apis, openalex, arxiv, semantic-scholar, europe-pmc, zenodo, unit-tests, live-tests]
dependency_graph:
requires: []
provides: [openalex-scraper, arxiv-scraper, semantic-scholar-scraper, europe-pmc-scraper, zenodo-scraper]
affe... | jku-encyclopedia | .planning/milestones/v1.0-phases/03-remaining-scrapers/03-01-SUMMARY.md | Markdown | 3c574862c271f00b41bc4176680755926dc4bb2fd3775054b00e7f4073be870b | 0 | 896 |
: Extended with `TestOpenAlexDiscover` class (discover_single_page, discover_handles_api_error)
- **test_arxiv.py**: Created with 8 tests covering `_parse_atom_feed`, `_entry_to_raw_item`, and discover()
- **test_semantic_scholar.py**: Created with 6 tests covering `_paper_to_raw_item`, bulk endpoint verification, toke... | jku-encyclopedia | .planning/milestones/v1.0-phases/03-remaining-scrapers/03-01-SUMMARY.md | Markdown | 74af0fc46f081c9c594538e51312605453169f8014d4ec298526229b14c528fb | 1 | 777 |
---
phase: 03-remaining-scrapers
plan: 02
type: execute
wave: 2
depends_on: ["01"]
files_modified:
- src/jku_kb/scrapers/youtube.py
- src/jku_kb/scrapers/podcast.py
- src/jku_kb/scrapers/huggingface.py
- src/jku_kb/scrapers/wikidata.py
- src/jku_kb/scrapers/wayback.py
- src/jku_kb/scrapers/web_crawl.py
- ... | jku-encyclopedia | .planning/milestones/v1.0-phases/03-remaining-scrapers/03-02-PLAN.md | Markdown | 92262e9d250f392bbdca6f44628cbd2d2f720316453be8d3c39654f2deaada0d | 0 | 896 |
test files + 7 live test classes (including YouTube with skip guard)
</objective>
<execution_context>
@C:/Users/julia/.claude/get-shit-done/workflows/execute-plan.md
@C:/Users/julia/.claude/get-shit-done/templates/summary.md
</execution_context>
<context>
@.planning/PROJECT.md
@.planning/ROADMAP.md
@.planning/STATE.m... | jku-encyclopedia | .planning/milestones/v1.0-phases/03-remaining-scrapers/03-02-PLAN.md | Markdown | a71db044c25bc1b628744e5fbe666f250b50f9f0417cd856df8b472a151db582 | 1 | 896 |
>
<action>
NOTE: This is hardening of existing code plus one new scraper — TDD inversion is accepted (create/harden first, then write tests in Task 2). Task 1 verify runs Plan 01's tests as regression check.
**youtube.py — CREATE from scratch:**
Create `src/jku_kb/scrapers/youtube.py` (~120 lines). Full specificati... | jku-encyclopedia | .planning/milestones/v1.0-phases/03-remaining-scrapers/03-02-PLAN.md | Markdown | 78faa1063cd078b7ba28b1796eefebd8a4663359acd722f3bcb58589d745e64a | 2 | 896 |
", "feed_url": "https://hoersaal-einblicke-jku-studierende-im-gespraech.podigee.io/feed/mp3"},
{"name": "Hoersaal Ausblicke", "feed_url": "https://hoersaal-ausblicke-jku.podigee.io/feed/mp3"},
]
```
- Ensure `feedparser.parse(response.text)` is used (NOT `feedparser.parse(url)`) to keep HTTP async
- In fetch(... | jku-encyclopedia | .planning/milestones/v1.0-phases/03-remaining-scrapers/03-02-PLAN.md | Markdown | da6041ef518b411b8b3f94abac5b212621e0c10daec8907428676b5f24fe5f76 | 3 | 896 |
publications/download/risc_" in href and href.endswith(".pdf")`
- Use `urljoin("https://www3.risc.jku.at/", href)` to construct full RISC PDF URLs
- Add structured logging for each PDF source: RISC count, gruppen count, web-discovered count
</action>
<verify>
<automated>cd /c/Development/Private/jku-encyclopedi... | jku-encyclopedia | .planning/milestones/v1.0-phases/03-remaining-scrapers/03-02-PLAN.md | Markdown | 619594b71302a1242d11bd416f163ac4827c927cf092144ddf6a30f25de59a78 | 4 | 896 |
{"relatedPlaylists": {"uploads": "UU5plXSNkgOhC_NVQ3hSfTGQ"}}}]}`
- `PLAYLIST_ITEMS_FIXTURE = {"items": [{"snippet": {"title": "JKU Lecture 1", "description": "...", "publishedAt": "2024-01-15T10:00:00Z", "resourceId": {"videoId": "abc123"}, "thumbnails": {"high": {"url": "https://i.ytimg.com/vi/abc123/hqdefault.jpg"}}... | jku-encyclopedia | .planning/milestones/v1.0-phases/03-remaining-scrapers/03-02-PLAN.md | Markdown | a94279e91ee08961ec2a7bf8daf13f95ef263bac7d81bcd6098f147c41835013 | 5 | 896 |
org/cdx/search/cdx`. Verify items returned. Verify wayback URL constructed correctly as `https://web.archive.org/web/20230101120000/https://www.jku.at/fileadmin/test.pdf`.
- `test_discover_follows_resume_key(settings, mock_http_client)`: first response has resumeKey row at end `[["resumeKey123"]]`, second response has ... | jku-encyclopedia | .planning/milestones/v1.0-phases/03-remaining-scrapers/03-02-PLAN.md | Markdown | 9448fa67a6f6f992e9ceb8bb23f0f506efae86fb46baa4bda89795d21b49b6f6 | 6 | 896 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.