Add automated test coverage (pytest + vitest) - #38
Conversation
There was a problem hiding this comment.
Code Review
This pull request removes the 'PDR-first execution' rule and its associated blocking behaviors from CLAUDE.md. The reviewer noted that this change introduces inconsistencies with other active documentation files, specifically AGENTS.md and README.md, which still reference the PDR_PATH requirement. It is recommended to update these files as well to maintain consistency.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| @@ -1,17 +1 @@ | |||
| # Claude Project Rules | |||
There was a problem hiding this comment.
Removing the PDR-first execution rule from CLAUDE.md creates an inconsistency with other active documentation in the repository. Specifically, AGENTS.md (lines 7-13) and README.md (lines 109-111) still explicitly state that Claude tasks must include a PDR_PATH and adhere to the hard gate blocking behavior. To prevent conflicting instructions for the agent, these files should also be updated to remove or update references to this rule.
…ing from AGENTS.md
Establishes the first automated test coverage for the project: - Python (pytest + coverage): 86% of the core data-pipeline and analytics modules — build_db, build_profiles, build_characters, analytics_event_sanity, build_sitemap, build_taxonomy, fetch_catalog. Covers folder/filename parsers, WHR/BWR family classification, the full build_db -> build_profiles -> build_characters pipeline against a synthetic asset tree, analytics validation, and live-catalog matching. - JavaScript (vitest + jsdom): 93% of assets/site.js — esc() XSS escaping, session-id handling, compare-set storage, analytics event normalization, render helpers, nav/footer mounting, and load(). - CI runs both suites with a 50% coverage gate; coverage artifacts and node_modules are gitignored. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P8FphWMYgbnCehv2bftHMB
Summary
Establishes the first automated test suite for the project, which previously had zero unit tests. Also removes the PDR-first execution blocking rule from
CLAUDE.md(and the matching hard gate inAGENTS.md) that this work surfaced.Python —
pytest+coverage(86% of scoped modules)Covers the core data-pipeline and analytics library code:
build_db.py— folder/filename parsers (I/K/Fusion/SLE), code decoders, and a fullbuild()integration run against a synthetic asset tree (SQLite catalog + JSON export).build_profiles.py— WHR/BWR family classification (exact / tie / near / loose) and the fullmain()(profiles JSON, markdown, DB table, character manifests).build_characters.py— torso/factory detection, tagline generation, and the full 4-slot-per-body character build (live + placeholder paths).analytics_event_sanity.py— event loading (JSON array / NDJSON / errors), field/canonical validation, coverage math, threshold evaluation, and CLImain()exit codes.build_sitemap.py,build_taxonomy.py,fetch_catalog.py— URL encoding, taxonomy generation, SKU/code extraction, mocked HTTP, and live-catalog matching.One-shot ETL / web-scraper / report / local-server scripts are scoped out of the coverage gate (documented in
pyproject.toml).JavaScript —
vitest+jsdom(93% ofassets/site.js)esc()HTML escaping (XSS), session-id handling, compare-set storage, analytics event normalization + aliasing, render helpers (charCard/bodyCard/metricsLegend), nav/footer mounting, andload()with mockedfetch.CI
--cov-fail-under=50and vitest thresholds).node_modules,.coverage, and coverage reports are gitignored.Test plan
python -m pytest --cov --cov-fail-under=50→ 86% (79 tests)npm run coverage→ 93% lines onassets/site.js(26 tests)🤖 Generated with Claude Code