Skip to content

[scratch] ISBN corpus validation harness (do not merge) - #4

Closed
raphi011 wants to merge 1 commit into
feat/epub-isbn-metadatafrom
scratch/isbn-corpus-validation
Closed

[scratch] ISBN corpus validation harness (do not merge)#4
raphi011 wants to merge 1 commit into
feat/epub-isbn-metadatafrom
scratch/isbn-corpus-validation

Conversation

@raphi011

Copy link
Copy Markdown
Owner

⚠️ Scratch / review-only — do not merge

A throwaway local validation harness for metadata.isbns (from PR #2). It runs the full public pipeline (AssetRetriever.retrievePublicationOpener.openpublication.metadata.isbns) over a real corpus of EPUBs in ~/ebooks and reports correctness flags. It reads an absolute host path and skips when the corpus is absent, so it's a no-op in CI. Based on feat/epub-isbn-metadata (the harness calls metadata.isbns, which isn't on develop yet).

What it checks

  • Summary: scanned / opened / open-failures, and ISBN-count distribution (0 / 1 / 2 / 3+).
  • Flag A — false negative: the package OPF text contains isbn (case-insensitive) but metadata.isbns is empty → a marker we don't detect.
  • Flag B — false positive: a returned value isn't a plausible ISBN (after cleaning, length ≠ 10/13, or chars outside [0-9X]).

It's a report, not a pass/fail gate (the flags need human review); the only assertion is that ≥1 book opened.

Run

xcodebuild test -scheme Readium-Package \
  -destination 'platform=iOS Simulator,name=iPhone 17' \
  -only-testing:ReadiumStreamerTests/ISBNCorpusValidationTests

Results (329-book corpus, 10.6s)

  • 329 opened, 0 failures, 289 (88%) with ≥1 ISBN. Distribution: 40 / 280 / 9 / 0.
  • Detection correct for every targeted marker (opf:scheme, value prefix, ONIX identifier-type refine) — no parser bugs.
  • 8 misses (Flag A) + 2 p…-prefixed values (Flag B), all from nonstandard markers (ISBN only in the id attribute / dc:source / unmarked; Penguin p-prefixed values returned verbatim). Decision: leave as-is — these are a deliberate non-goal for the minimal parser.

@raphi011

Copy link
Copy Markdown
Owner Author

Closing — scratch validation harness was opened by mistake; not intended as a PR. Branch kept locally for re-runs.

@raphi011 raphi011 closed this Jun 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant