Repository navigation
Closed
Description
Unit
SCRIP-REPRO-002
Why
SCRIP-METRIC-001 is merged, so M1 now has executable deterministic metrics but still lacks the field-by-field benchmark runner required by the milestone gate. The repository already freezes fantlab-benchmark-comparison-v1 and fantlab-2022-v1; this unit must execute those contracts without weakening their provenance, display-precision, or parity rules.
Scope
- Add a standard-library benchmark module and CLI (
python -m scriptorium.benchmark). - Read an existing FantLab reference JSON plus a local UTF-8 source text; never fetch or embed book text.
- Compute raw/source and normalized SHA-256, run the merged deterministic metric profile, and emit
fantlab-benchmark-comparison-v1. - Compare only currently implemented FantLab metrics present in the reference: characters, words, mean word/sentence length, and the 14 punctuation fields.
- Preserve the exact numeric lexeme from the reference JSON as
expected.display_textso values such as10.30are not silently rewritten as10.3. - Use
exact_integerfor integer count fields. - Keep decimal fields
unresolved_precisionwhile independentdisplay_placesevidence is absent; visual numeric resemblance must not become a pass. - Enforce the existing parity gate: no
passunless edition match isexact, legal basis is recorded, and an immutable raw digest exists. - Report expected/actual/raw delta/result/reason per canonical metric ID plus source/analyzer provenance.
- Add standard-library tests for exact-match, mismatch, provenance-gated unresolved results, unresolved decimal precision, preserved display lexemes, and CLI JSON output.
- Document the CLI and update durable state/changelog. Leave the resulting PR for a later independent review.
Non-goals
- No source acquisition or scraping.
- No attempt to locate the missing
Шутихаsource edition in this unit. - No dialogue, vocabulary, morphology, POS, or page-estimate implementation.
- No invented display precision or FantLab tie-breaking rule.
- No promotion from
inferredtoreproduced.
Acceptance criteria
- A local text + FantLab reference produces a deterministic comparison artifact keyed by canonical FantLab metric IDs.
- The artifact preserves raw and normalized hashes and explicit source-edition/legal metadata.
- Exact integer equality can only pass with admissible provenance; otherwise it is unresolved.
- Integer disagreement with admissible provenance fails.
- Decimal fields with unknown precision remain
unresolved_precision/unresolvedwithnumeric_match: nulleven when values look equal. - Reference numeric lexical display text is preserved where the reference JSON records it.
- Existing tests plus new benchmark/CLI tests pass with
python -m unittest discover -s tests -vand no new runtime dependency. - Durable state ends in
REVIEWwith the exact PR/head identified for independent judgement.
Metadata
Metadata
Assignees
Labels
No labels
Activity