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
84 changes: 84 additions & 0 deletions .github/workflows/darwin-semantic-backlog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Darwin/Rachinsky 1864 semantic backlog

on:
pull_request:
paths:
- ".github/workflows/darwin-semantic-backlog.yml"
- "scriptorium/darwin_semantic_backlog.py"
- "scriptorium/darwin_render_profile.py"
- "tests/test_darwin_semantic_backlog.py"
- "corpus/candidates/darwin-origin-species-rachinsky-1864-ru.md"
- "corpus/candidates/source-edition-traces/darwin-origin-species-rachinsky-1864-ru.render-surface.json"
- "corpus/candidates/source-edition-traces/darwin-origin-species-rachinsky-1864-ru.render-profile.json"
- "corpus/candidates/source-edition-traces/darwin-origin-species-rachinsky-1864-ru.semantic-backlog.json"
workflow_dispatch:

permissions:
contents: read

jobs:
verify:
name: Verify source-free unresolved-semantic backlog
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout pull-request head
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
persist-credentials: false

- name: Set up Python 3.13
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.13"

- name: Run semantic backlog and render-profile regression tests
run: |
python -m unittest tests.test_darwin_semantic_backlog -v
python -m unittest tests.test_darwin_render_profile -v

- name: Deterministically rebuild and compare backlog
run: |
set -euo pipefail
mkdir -p build/repro
python -m scriptorium.darwin_semantic_backlog \
--profile corpus/candidates/source-edition-traces/darwin-origin-species-rachinsky-1864-ru.render-profile.json \
--surface corpus/candidates/source-edition-traces/darwin-origin-species-rachinsky-1864-ru.render-surface.json \
--output build/repro/darwin-origin-species-rachinsky-1864-ru.semantic-backlog.json
python - <<'PY'
import json
from pathlib import Path
expected = json.loads(Path("corpus/candidates/source-edition-traces/darwin-origin-species-rachinsky-1864-ru.semantic-backlog.json").read_text(encoding="utf-8"))
rebuilt = json.loads(Path("build/repro/darwin-origin-species-rachinsky-1864-ru.semantic-backlog.json").read_text(encoding="utf-8"))
assert rebuilt == expected
assert rebuilt["backlog_sha256"] == "4ec4f84566f5f3f8dccd1945906d1a782f4532547a13cadc8570cb5b682bdcb2"
assert rebuilt["unresolved_totals"] == {
"tag_shape_count": 5,
"tag_token_count": 518,
"template_shape_count": 38,
"template_invocation_count": 4583,
}
assert len(rebuilt["prioritized_items"]) == 43
assert rebuilt["next_research_slice"]["name"] == "ё"
assert rebuilt["next_research_slice"]["count"] == 2227
assert rebuilt["next_research_slice"]["semantic_status"] == "unresolved"
assert rebuilt["renderer_semantics_complete"] is False
assert rebuilt["renderer_implementation_ready"] is False
assert rebuilt["inter_page_composition_frozen"] is False
assert rebuilt["literary_body_count_and_digests_frozen"] is False
assert rebuilt["minimum_300k_proved"] is False
assert rebuilt["admitted_for_calibration"] is False
assert rebuilt["fantlab_source_edition_match"] == "unknown"
assert rebuilt["diagnostic_ready"] is False
assert rebuilt["m2_parity_admissible"] is False
print("SCRIPTORIUM_DARWIN_SEMANTIC_BACKLOG_SHA256=" + rebuilt["backlog_sha256"])
PY

- name: Upload source-free semantic backlog evidence
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: darwin-rachinsky-1864-semantic-backlog
path: build/repro/darwin-origin-species-rachinsky-1864-ru.semantic-backlog.json
if-no-files-found: error
retention-days: 7
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Darwin/Rachinsky 1864 — unresolved rendering semantics

This public source-free companion to `darwin-origin-species-rachinsky-1864-ru` exposes the remaining rendering-semantic work after the reviewed exact-388 Page surface and fail-closed render profile were frozen.

No literary source text, Page wikitext, template argument values, rendered prose, OCR or scan bytes are stored here. Counts come only from the already frozen render profile SHA-256 `2ebcfea51282505c28824f54f6a1795bd7e87e2f958ac59f5c843e68c2066f3d`.

## Remaining surface

The profile still has **43 unresolved shapes**:

| Research track | Shapes | Observed occurrences |
| --- | ---: | ---: |
| provider-template semantics | 37 | 4,579 |
| provider-reference semantics | 3 | 466 |
| provider-math semantics | 2 | 52 |
| inter-page semantics | 1 | 4 |

Those totals exactly preserve the reviewed boundary: **5 unresolved tag shapes / 518 tag tokens** and **38 unresolved template shapes / 4,583 invocations**.

## Mechanical next target

The deterministic backlog ranks unresolved items by descending observed occurrence count with stable tie-breaking. The first research target is template **`ё`**, arity **0 positional / 0 named**, observed **2,227 times** (2,227 / 4,583 unresolved template invocations).

This ranking is **not a semantics claim**. `ё` remains `semantic_status=unresolved`; a separate bounded unit must establish its provider behavior with independent evidence before the renderer profile may change.

The next two rows are self-closing `<references/>` (**388**) and template `ВАР` with arity 2/0 (**388**). Reference/math behavior and the inter-page-sensitive `nop` track remain independently reviewable rather than being folded into one guessed renderer policy.

## Frozen artifact

Canonical source-free artifact:

- [`source-edition-traces/darwin-origin-species-rachinsky-1864-ru.semantic-backlog.json`](source-edition-traces/darwin-origin-species-rachinsky-1864-ru.semantic-backlog.json)
- schema: `scriptorium-darwin-render-semantic-backlog-v1`
- backlog SHA-256: `4ec4f84566f5f3f8dccd1945906d1a782f4532547a13cadc8570cb5b682bdcb2`
- builder/validator: [`../../scriptorium/darwin_semantic_backlog.py`](../../scriptorium/darwin_semantic_backlog.py)

The artifact is derived only after the existing render profile validates against its frozen source surface. Any profile/surface drift fails before backlog derivation.

## Gates unchanged

This slice does not implement rendering and does not advance corpus or FantLab parity gates. The following remain false/unknown: `renderer_semantics_complete`, `renderer_implementation_ready`, `inter_page_composition_frozen`, `literary_body_count_and_digests_frozen`, `minimum_300k_proved`, `admitted_for_calibration`, `diagnostic_ready`, `m2_parity_admissible`; `fantlab_source_edition_match=unknown`. M2 remains **0/5**.
16 changes: 14 additions & 2 deletions corpus/candidates/darwin-origin-species-rachinsky-1864-ru.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,22 @@ Independent exact-head review re-read all settled CI on `ee97e29af7225131002b6e0

## Fail-closed rendering decision profile

**SCRIP-CORPUS-045 / Draft PR #178** adds `scriptorium-darwin-page-render-profile-v1`, bound cryptographically to the reviewed exact-388 source-free surface freeze before any shape classification is accepted. The profile covers all **18 tag shapes / 5,164 tag tokens** and all **38 template shapes / 4,583 template invocations**. Its canonical profile SHA-256 is **`2ebcfea51282505c28824f54f6a1795bd7e87e2f958ac59f5c843e68c2066f3d`**.
**SCRIP-CORPUS-045 / merged PR #178** adds `scriptorium-darwin-page-render-profile-v1`, bound cryptographically to the reviewed exact-388 source-free surface freeze before any shape classification is accepted. The profile covers all **18 tag shapes / 5,164 tag tokens** and all **38 template shapes / 4,583 template invocations**. Its canonical profile SHA-256 is **`2ebcfea51282505c28824f54f6a1795bd7e87e2f958ac59f5c843e68c2066f3d`**.

The decision table defines only conservative local markup handling: ordinary `big`, `div`, `small`, `sub` and `sup` wrappers preserve inner text; `<noinclude>` is excluded from transcluded content; ProofreadPage `pagequality` metadata is dropped. It intentionally leaves **5 tag shapes / 518 tokens** unresolved for provider semantics: `<math>` open/close, `<ref>` open/close and self-closing `<references/>`. All **38 template shapes / 4,583 invocations** remain unresolved rather than inferring expansion from names; `nop` is additionally marked as inter-page-sensitive.

This is a **frozen decision boundary, not a renderer**. `rendering_profile_frozen=true` coexists deliberately with `renderer_semantics_complete=false`, `renderer_implementation_ready=false`, `rendering_equivalence_claimed=false`, and `inter_page_composition_frozen=false`. Any changed count, new/missing shape, stale surface digest or wrong candidate identity fails closed. No Page wikitext, template argument values, rendered prose, OCR, DjVu/PDF bytes or literary text are committed.

## Source-free unresolved-semantic backlog

**SCRIP-CORPUS-046 / Draft PR #180** derives a deterministic research backlog only after validating the frozen render-profile/source-surface boundary. The durable artifact preserves all **43 unresolved shapes**: **5 tag shapes / 518 tokens** and **38 template shapes / 4,583 invocations**.

The backlog groups them into four independently reviewable tracks: provider-template (**37 shapes / 4,579 occurrences**), provider-reference (**3 / 466**), provider-math (**2 / 52**), and inter-page (**1 / 4**). Items are ranked mechanically by descending observed occurrence count with stable tie-breaking. The current next research target is template **`ё`**, arity **0 positional / 0 named**, observed **2,227 times**. That target remains explicitly `semantic_status=unresolved`; selection priority is not a semantics claim.

Canonical backlog SHA-256 is **`4ec4f84566f5f3f8dccd1945906d1a782f4532547a13cadc8570cb5b682bdcb2`**. The source-free public companion is [`darwin-origin-species-rachinsky-1864-ru-semantic-backlog.md`](darwin-origin-species-rachinsky-1864-ru-semantic-backlog.md), and the machine-readable artifact is [`source-edition-traces/darwin-origin-species-rachinsky-1864-ru.semantic-backlog.json`](source-edition-traces/darwin-origin-species-rachinsky-1864-ru.semantic-backlog.json).

This backlog does **not** implement rendering or advance any downstream gate. `renderer_semantics_complete=false`, `renderer_implementation_ready=false`, `inter_page_composition_frozen=false`, `literary_body_count_and_digests_frozen=false`, `minimum_300k_proved=false`, `admitted_for_calibration=false`, `diagnostic_ready=false`, `m2_parity_admissible=false`, and `fantlab_source_edition_match=unknown` remain mandatory.

## Independent scan binary identity

**SCRIP-CORPUS-037 / merged PR #162** independently retrieved the exact Wikimedia Commons DjVu backing this ProofreadPage family and streamed it through Scriptorium without writing the binary into the repository. The hosted capture observed **27,368,263 bytes** and SHA-1 `75ef508588194ae74874272ce290f3ec1043ea9b`, exactly matching the provider metadata that had already been frozen from the source surface.
Expand Down Expand Up @@ -128,13 +138,15 @@ FantLab work **`work969964`** identifies Darwin's 1859 English monograph. The cu
- [`source-edition-traces/darwin-origin-species-rachinsky-1864-ru.render-surface.json`](source-edition-traces/darwin-origin-species-rachinsky-1864-ru.render-surface.json) — deterministic source-free 388-Page construct inventory with no source payload.
- [`source-edition-traces/darwin-origin-species-rachinsky-1864-ru.render-surface.source-graph.json`](source-edition-traces/darwin-origin-species-rachinsky-1864-ru.render-surface.source-graph.json) — provenance edges from frozen Page identities through literary composition and hosted markup audit to the durable inventory and frozen decision profile.
- [`source-edition-traces/darwin-origin-species-rachinsky-1864-ru.render-profile.json`](source-edition-traces/darwin-origin-species-rachinsky-1864-ru.render-profile.json) — deterministic fail-closed source-free rendering decision profile with explicit unresolved semantics and closed downstream gates.
- [`source-edition-traces/darwin-origin-species-rachinsky-1864-ru.semantic-backlog.json`](source-edition-traces/darwin-origin-species-rachinsky-1864-ru.semantic-backlog.json) — deterministic source-free unresolved-semantic priority backlog; every listed shape remains unresolved.
- [`source-edition-traces/darwin-origin-species-rachinsky-1864-ru.scan-identity.json`](source-edition-traces/darwin-origin-species-rachinsky-1864-ru.scan-identity.json) — independently verified source-free DjVu byte count, SHA-1 cross-check and SHA-256; scan bytes are not stored.
- [`../../scriptorium/darwin_body_contract.py`](../../scriptorium/darwin_body_contract.py) — deterministic source-free 388/30 composition contract generator and fail-closed validator.
- [`../../scriptorium/darwin_render_surface.py`](../../scriptorium/darwin_render_surface.py) — exact-revision identity-verifying hosted construct audit.
- [`../../scriptorium/darwin_render_surface_freeze.py`](../../scriptorium/darwin_render_surface_freeze.py) — deterministic compact freeze reducer/validator.
- [`../../scriptorium/darwin_render_profile.py`](../../scriptorium/darwin_render_profile.py) — deterministic fail-closed source-free decision-profile builder/validator.
- [`../../scriptorium/darwin_semantic_backlog.py`](../../scriptorium/darwin_semantic_backlog.py) — deterministic source-free unresolved-semantic backlog builder/validator.
- [`../../scriptorium/darwin_scan_identity.py`](../../scriptorium/darwin_scan_identity.py) — streaming scan-identity capture/replay with provider cross-checks and no binary persistence.

## Next evidence

A later bounded unit should resolve and independently freeze the provider/template/reference/math semantics explicitly left unresolved by `scriptorium-darwin-page-render-profile-v1`; inter-page separator/composition semantics should remain a separately reviewable decision. Only after deterministic rendering exists should a separate identity/admission unit compute source-free counts/digests and independently prove the >=300,000-character threshold. FantLab parity remains a separate, stricter source-matching problem.
The mechanically selected next renderer-research slice is template `ё` (2,227 observed invocations), but its semantics remain unresolved. A later bounded unit should establish provider behavior with independent evidence before the render profile changes. Reference/math behavior and inter-page separator/composition semantics remain separate reviewable decisions. Only after deterministic rendering exists should a separate identity/admission unit compute source-free counts/digests and independently prove the >=300,000-character threshold. FantLab parity remains a separate, stricter source-matching problem.
Loading
Loading