Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,24 @@ legally usable and at least 300,000 characters including spaces; copyrighted tex
not committed merely because it is accessible online. Shorter texts and excerpts are
still valid analyzer inputs, but their results carry representativeness warnings.

## Open a real diagnostic report

From a checkout with Python 3.13, generate a readable offline report from the existing
full-work Anna Karenina comparison — no novel download is needed:

```bash
python -m scriptorium.frozen_diagnostic_report \
benchmarks/fantlab/work270306-wikisource-diagnostic.json \
--title "Anna Karenina — full-work diagnostic" \
--output anna-diagnostic.html
```

Open `anna-diagnostic.html` in a browser. It shows 28 historical expected/actual/delta
rows, explicit units and missing values, source hashes and diagnostic-only evidence
labels. This is a presentation of existing results, not a new analyzer run or FantLab
parity. Output is create-only; use a new filename on repeat runs. See
[`docs/FROZEN_DIAGNOSTIC_REPORT.md`](docs/FROZEN_DIAGNOSTIC_REPORT.md).

## What works today

Scriptorium now has a standard-library-only deterministic analysis core:
Expand Down
70 changes: 70 additions & 0 deletions docs/FROZEN_DIAGNOSTIC_REPORT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Read a frozen full-work diagnostic

From a repository checkout with Python 3.13, turn the existing aggregate Anna Karenina
comparison into a standalone report without downloading the novel:

```bash
python -m scriptorium.frozen_diagnostic_report \
benchmarks/fantlab/work270306-wikisource-diagnostic.json \
--title "Anna Karenina — full-work diagnostic" \
--output anna-diagnostic.html
```

Open `anna-diagnostic.html` in a browser. It needs no network, JavaScript, remote fonts
or external assets. Omit `--output` to write HTML to standard output. The file option is
create-only: an existing output is never overwritten, including after invalid input.
Use a new filename for a second report. Without `--title`, the candidate ID is shown.

## What the report contains

The existing historical diagnostic has 28 rows: 23 numeric actuals and five missing
actuals, with 26 `unresolved` and two `not_run` results. Tables group general, dialogue,
vocabulary and punctuation metrics and show units, expected values, actual values and
raw deltas. Captions, row/column headers, a skip link, focus styles and keyboard-focusable
horizontal table regions keep the wide tables inspectable on small screens.

Replay hashes, chapter count, analyzer revision, Python version and hosted-run identity
are retained. Omitted families and observations are explicitly historical: the report
is not a new replay and does not imply that an old provider limitation is current.

## Scientific boundary

This renderer accepts the reviewed `scriptorium-frozen-diagnostic-v1` shape only. Its
source edition is unknown; parity admissibility remains false. The displayed M2 `0/5`
is the value recorded in that historical artifact, not a live project-progress query.
Numeric resemblance, including a zero delta, is never promoted to pass/fail or a
similarity score. No analyzer formula, source body or historical JSON is modified.

Display uses up to six decimal places and scientific notation for very small nonzero
values. This is readability formatting, **not** FantLab display rounding or a tolerance
change. Percentage deltas are percentage points; missing values are not zero.
Integer delta arithmetic is exact. The `1e-9` absolute consistency check for floating
raw deltas handles serialized arithmetic only; it cannot admit a parity result.

## Validation and privacy

The CLI rejects duplicate JSON keys, unexpected fields, invalid hashes/locators,
non-finite or out-of-range numbers, delta inconsistency, `not_run` with an actual value,
pass/fail promotion, source-text publication flags, and source-match/M2 upgrades.
All artifact-controlled strings are HTML-escaped.

Inputs must already be curated source-free aggregate artifacts. This is not a manuscript
sanitizer: reviewed observations and reason strings are intentionally displayed, so a
producer must not put private source prose in those fields. The renderer never fetches
source text or uploads anything. Generated HTML stays local and is not committed.

## Verification and publication

```bash
python -m unittest discover -s tests -p 'test_frozen_diagnostic_report.py' -v
python -m unittest discover -s tests -v
```

The focused suite includes the exact canonical diagnostic blob and deterministic output,
large-integer precision, tiny deltas, escaping, invalid-input rejection and preservation
of an existing output. The existing Pages PR workflow runs the full repository suite and
a byte-identical static-site rebuild on the PR head.

This unit supplies a standalone report, not a new live Pages route. Adding the report to
the publication allow-list and renderer is a subsequent integration; Pages activation
and the existing deployment interlock are unchanged.
15 changes: 15 additions & 0 deletions project/CHANGELOG.d/2026-10-06-scrip-site-007.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## 2026-10-06 — readable frozen diagnostic report (#267)

- Adopt SCRIP-SITE-007 into a normal product PR: standalone offline HTML/CLI for the
existing source-free full-work diagnostic, with units, explicit missing values,
historical evidence labels, replay identity and keyboard-accessible tables.
- Reject malformed/overstated input, duplicate keys, non-finite values and delta drift;
preserve integer precision and tiny nonzero deltas; keep output create-only.
- Add 23 focused regressions, including the unchanged canonical Anna diagnostic blob.
- Reconcile the Oct 2 owner selection correction into the compact product backlog:
independent report/CLI/Pages work does not wait on corpus or bookkeeping blockers.
- SCRIP-SITE-008's old local patch-transform self-test is not integration evidence: its
dedented replacement produces an IndentationError on the renderer function shape.
Correct and verify it against actual repository files before adoption.
- No analyzer formulas, historical benchmark JSON, corpus gates, M2 tolerances or Pages
activation/settings are changed. New code still requires later exact-head acceptance.
38 changes: 28 additions & 10 deletions project/STATE_AND_QUEUE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# STATE_AND_QUEUE — Scriptorium

STATE_REVISION: 289
STATE_REVISION: 290
PHASE: M1 — Deterministic FantLab surface
LAST_COMMITTED_RUN_AT: 2026-10-02T09:12:28Z
LAST_RESULT: SCRIP-CORPUS-087 / Issue #263 / PR #264 completed. Independent exact-head review re-read the six-file recovery patch at `950404bb86c191b7eacdf21eb34c231f1d906fc4`, confirmed 24/24 pull-request-triggered workflow runs completed successfully with no submitted reviews or unresolved review threads, and found no semantic merge blocker. PR #264 was squash-merged with expected-head protection as `a9df79ec04664011f6dddf3593031424b15c1073`; Issue #263 closed completed. Embedded text-layer status remains unverified; literary body, >=300k admission, FantLab-input identity, diagnostics, M2 and parity remain closed.
Expand All @@ -9,15 +9,21 @@ LAST_VERIFIED_PROGRESS: M1 deterministic metric families remain executable infer
## Current unit

```text
UNIT_ID: SCRIP-CORPUS-087
ISSUE: #263 (closed completed)
STATUS: COMPLETE
PR: #264 (squash-merged as a9df79ec04664011f6dddf3593031424b15c1073)
REVIEWED_HEAD: 950404bb86c191b7eacdf21eb34c231f1d906fc4
NEXT_ACTION: Resume normal-flow P1 SCRIP-CORPUS continuation.
Prefer an executable Petersburg/Perelman/Darwin-Rachinsky extraction or provenance unit that strengthens a >=300k candidate while keeping unsupported parity gates closed.
UNIT_ID: SCRIP-SITE-007
ISSUE: #267
STATUS: REVIEW_PENDING
PR: Resolve the linked product PR from Issue #267; GitHub owns current head/check/merge facts.
BASE: abe7bb889ef98437ba9faef5a79b023499556991
NEXT_ACTION: Later exact-head acceptance of the readable frozen diagnostic report.
Inspect code/tests and applicable full-suite/Pages CI; do not merge in the authoring run.
Keep the existing historical diagnostic and all source-match/parity gates unchanged.
```

PR #266 is merged as `abe7bb889ef98437ba9faef5a79b023499556991`; it is not a pending
recovery blocker. The older LAST_RESULT above describes the completed corpus unit.
The report PR adopts useful local work with 23 focused tests; hosted acceptance and
actual merge/publication are separate native GitHub effects, not implied here.

## Current milestone gate

M0 is closed. M1 remains open. General, dialogue, vocabulary and punctuation metric families are executable inferred candidates. POS retains separate work-page-compatible and diagnostic-only methodology surfaces; runtime `N` noun/cardinal ambiguity is unresolved.
Expand All @@ -26,11 +32,23 @@ M2 remains open at **0/5 source-matched works**. Public-source freezing, bibliog

## Queue

Recovery/review-ready work and failing required checks preempt normal selection.
The 2026-10-02 owner correction authorizes solo product/backlog ownership and independent
analyzer, CLI and public-experience delivery. Recovery and failing checks preempt only
when executable; unchanged corpus, write or bookkeeping blockers are scoped dependencies,
not a global ordering rule. Preserve scientific/security and later-run acceptance gates.

Next user-visible milestone: a reader can open a real full-work diagnostic with units,
missing values and provenance, then reach it through the static site; a local-text CLI
must remain usable independently of source-matched corpus admission. This incremental
milestone does not declare M1/M2 complete.

| Priority | Unit | Mode | Deliverable | Gate / dependency |
| --- | --- | --- | --- | --- |
| P1 | SCRIP-CORPUS continuation | corpus / provenance | Add or strengthen legally usable >=300k candidates, prioritizing diversity beyond 19th-century Russian classics; Petersburg, Perelman and Darwin/Rachinsky have candidate-specific extraction/renderer work available | Preserve translation/edition identity and legal provenance; renderer/OCR work must keep body/admission/FantLab/M2 gates closed until separately verified |
| P1 | SCRIP-SITE-007 / #267 | acceptance / delivery | Accept the offline frozen diagnostic HTML/CLI on its fresh PR head | Full applicable tests/checks; later-run acceptance; no source-match promotion |
| P2 | SCRIP-SITE-008 | public experience | Integrate the reviewed report into the existing Pages allow-list and work route | Reuse report primitives; correct the old local patcher's indentation error; test actual renderer, full build and byte-identical rebuild; deployment rights block live publication only |
| P3 | SCRIP-METRIC-003 | analyzer / CLI | Local UTF-8 text to readable report and JSON using current deterministic metrics | Adopt/revalidate pending local work against actual core modules; private text stays local; dictionary-dependent unknowns stay explicit |
| P4 | SCRIP-SITE-009 | public experience | Reader-first homepage and README with real actions and evidence labels | Revalidate pending local work against accepted Pages items; no invented analyses or capabilities |
| P5 | SCRIP-CORPUS continuation | corpus / provenance | Strengthen a legally usable >=300k diversity candidate with a new executable extraction/provenance result | Preserve translation/edition identity; candidate-specific body/FantLab gates; unchanged scans do not block P1-P4 |

## Retained corpus / provenance orientation

Expand Down
Loading
Loading