Skip to content
Merged
115 changes: 115 additions & 0 deletions .github/workflows/darwin-var-revision-identities.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
name: Darwin VAR frozen revision identities

on:
pull_request:
paths:
- ".github/workflows/darwin-var-revision-identities.yml"
- "scriptorium/single_page_revision.py"
- "scriptorium/darwin_var_revision_identities.py"
- "tests/test_darwin_var_revision_identities.py"
- "corpus/candidates/source-edition-traces/darwin-origin-species-rachinsky-1864-ru.var-revision-identities-evidence.json"
workflow_dispatch:

permissions:
contents: read

jobs:
capture:
name: Capture six exact Wikisource revision identities
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 standard-library test suite
run: python -m unittest discover -s tests -v

- name: Capture provider-returned source-free identities
run: |
set -euo pipefail
mkdir -p build/repro
python - <<'PY'
import json
from pathlib import Path
from scriptorium.single_page_revision import fetch_pinned_revision

# The dependency evidence uses MediaWiki's English namespace alias in Lua
# require() strings. The Russian Wikisource API canonicalizes those page
# titles to the local `Модуль:` namespace, so preserve both identities.
resources = [
("Шаблон:ВАР", "Шаблон:ВАР", 3684602),
("Модуль:Дореформенная орфография", "Модуль:Дореформенная орфография", 5721277),
("Module:Header", "Модуль:Header", 5746249),
("Module:BEED", "Модуль:BEED", 5746253),
("Module:Util", "Модуль:Util", 5750249),
("Module:RomanNumber", "Модуль:RomanNumber", 3684553),
]
observed = []
for closure_title, provider_title, revision_id in resources:
item = fetch_pinned_revision(title=provider_title, revision_id=revision_id)
item["closure_title"] = closure_title
observed.append(item)
assert [
(item["closure_title"], item["title"], item["revision_id"])
for item in observed
] == resources
assert all(len(item["mediawiki_sha1"]) == 40 for item in observed)
payload = {
"schema_version": "scriptorium-darwin-var-provider-revision-identities-v1",
"provider": "Russian Wikisource",
"source_text_included": False,
"resources": observed,
}
path = Path("build/repro/darwin-var-provider-revision-identities.json")
path.write_text(json.dumps(payload, ensure_ascii=False, indent=2, sort_keys=True) + "\n", encoding="utf-8")
print("SCRIPTORIUM_DARWIN_VAR_IDENTITIES=" + json.dumps(payload, ensure_ascii=False, sort_keys=True, separators=(",", ":")))
PY

- name: Compare capture to committed identity contract
run: |
set -euo pipefail
python - <<'PY'
import json
from pathlib import Path
from scriptorium.darwin_var_revision_identities import validate_evidence

observed = json.loads(Path("build/repro/darwin-var-provider-revision-identities.json").read_text(encoding="utf-8"))
evidence = json.loads(Path("corpus/candidates/source-edition-traces/darwin-origin-species-rachinsky-1864-ru.var-revision-identities-evidence.json").read_text(encoding="utf-8"))
validate_evidence(evidence)
expected = evidence["resources"]
assert observed["source_text_included"] is False
assert len(observed["resources"]) == len(expected) == 6
for got, want in zip(observed["resources"], expected, strict=True):
for key in (
"closure_title",
"title",
"page_id",
"revision_id",
"revision_timestamp",
"mediawiki_sha1",
"wikitext_character_count",
"wikitext_utf8_byte_count",
"wikitext_sha256",
):
assert got[key] == want[key], (key, got[key], want[key])
assert evidence["identity_gate"]["mediawiki_sha1_complete"] is True
assert evidence["identity_gate"]["replay_ready"] is False
print("SCRIPTORIUM_DARWIN_VAR_EVIDENCE_SHA256=" + evidence["evidence_sha256"])
PY

- name: Upload source-free identity capture
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: darwin-var-provider-revision-identities
path: build/repro/darwin-var-provider-revision-identities.json
if-no-files-found: error
retention-days: 7
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Darwin/Rachinsky 1864 — `{{ВАР}}` provider revision identities

This source-free companion advances the independently reviewed SCRIP-CORPUS-083 observed-live `{{ВАР}}` closure by binding all six exact revisions to official Russian Wikisource identity metadata. It is an identity-completion artifact, not a full `{{ВАР}}` replay, historical-transclusion claim, or renderer promotion.

The frozen closure remains:

`Шаблон:ВАР@3684602` → `Модуль:Дореформенная орфография@5721277` → `Module:Header@5746249` → `Module:BEED@5746253` + `Module:Util@5750249`; loading BEED also loads `Module:RomanNumber@3684553`.

The official MediaWiki revisions API returned a 40-hex SHA-1 for every exact revision. Russian Wikisource canonicalizes the English `Module:` namespace aliases used by Lua dependency strings to local provider titles under `Модуль:`; the evidence therefore stores both the reviewed closure alias and the provider-returned title.

| Closure title | Provider title | Revision | MediaWiki SHA-1 |
| --- | --- | ---: | --- |
| `Шаблон:ВАР` | `Шаблон:ВАР` | 3684602 | `fdb6fa7c0d4b08157bc30d44f5f77c5b9313167c` |
| `Модуль:Дореформенная орфография` | `Модуль:Дореформенная орфография` | 5721277 | `64d28378f4f620c67e1823a0d4292445d9ab293d` |
| `Module:Header` | `Модуль:Header` | 5746249 | `2ab2bfdd7e49c73c4ec9ef24e4625c1d228cfba0` |
| `Module:BEED` | `Модуль:BEED` | 5746253 | `9e9531e9178e0333bd3a939ace91e6a71e114cc5` |
| `Module:Util` | `Модуль:Util` | 5750249 | `945f8e6bf173bb5712385995255a8b6eccef38ed` |
| `Module:RomanNumber` | `Модуль:RomanNumber` | 3684553 | `51a3956469ee3fbd4ed56ce3a1f72f76f231e1d3` |

The machine-readable contract is [`source-edition-traces/darwin-origin-species-rachinsky-1864-ru.var-revision-identities-evidence.json`](source-edition-traces/darwin-origin-species-rachinsky-1864-ru.var-revision-identities-evidence.json), SHA-256 `98dc8aed94fd8b4e18f0ad3325673603cba1575c1e745e1175ab4cd3a8aa2a48`. It also retains provider page IDs, UTC revision timestamps, source-free wikitext counts, and SHA-256 digests captured without persisting source prose.

`mediawiki_sha1_complete=true`, but `replay_ready=false`. `ВАР` remains unresolved at **388 invocations**, and the effective backlog remains **4 tag shapes / 130 tag tokens** plus **37 template shapes / 2,356 template invocations**. Full candidate invocation replay, historical transclusion, an explicit version-pinned Scribunto/runtime boundary, renderer promotion, literary-body identity, `>=300k` admission, FantLab analyzer-input identity, and M2 parity all remain open.

The next bounded step is to replay the candidate `{{ВАР}}` branch against exactly these six identities under an explicit version-pinned runtime boundary; no later live descendants may silently substitute for the frozen revisions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
{
"candidate_id": "darwin-origin-species-rachinsky-1864-ru",
"capture_provenance": {
"api_surface": "MediaWiki revisions API: rvprop=ids|timestamp|sha1|content, rvslots=main",
"provider": "Russian Wikisource",
"source_text_persisted": false
},
"evidence_sha256": "98dc8aed94fd8b4e18f0ad3325673603cba1575c1e745e1175ab4cd3a8aa2a48",
"fantlab_source_edition_match": "unknown",
"historical_transclusion_proven": false,
"identity_gate": {
"mediawiki_sha1_complete": true,
"missing_mediawiki_sha1_titles": [],
"provider_title_aliases_explicit": true,
"reason": "all six exact observed-live revisions are bound to provider-returned identities, but a full candidate invocation replay and an explicit version-pinned Scribunto/runtime boundary are still missing",
"replay_ready": false,
"revision_ids_complete": true
},
"literary_body_count_and_digests_frozen": false,
"m2_parity_admissible": false,
"minimum_300k_proved": false,
"offline_version_pinned_runtime_proven": false,
"prior_closure": {
"evidence_sha256": "245f77bf3d99d6610ca5fbbe4fcdcdb4ef68bebca612c5bb81db6c2d77f26509",
"schema_version": "scriptorium-darwin-var-live-snapshot-closure-v1"
},
"promotion_decision": {
"backlog_item_removed": false,
"effective_backlog_changed": false,
"full_var_candidate_branch_replayed": false,
"next_evidence_required": "perform a separately bounded full candidate invocation replay against these six exact identities with an explicit version-pinned Scribunto/runtime boundary",
"render_profile_rule_promoted": false,
"var_invocations_unresolved": 388
},
"renderer_implementation_ready": false,
"renderer_semantics_complete": false,
"researched_on": "2026-09-24",
"resources": [
{
"closure_title": "Шаблон:ВАР",
"mediawiki_sha1": "fdb6fa7c0d4b08157bc30d44f5f77c5b9313167c",
"page_id": 122258,
"revision_id": 3684602,
"revision_timestamp": "2019-06-04T20:36:46Z",
"title": "Шаблон:ВАР",
"wikitext_character_count": 206,
"wikitext_sha256": "583f46a8f7fa2444456abede564817e134d313fb20d5cabfa2f2c48591c54707",
"wikitext_utf8_byte_count": 269
},
{
"closure_title": "Модуль:Дореформенная орфография",
"mediawiki_sha1": "64d28378f4f620c67e1823a0d4292445d9ab293d",
"page_id": 378940,
"revision_id": 5721277,
"revision_timestamp": "2026-06-08T13:06:13Z",
"title": "Модуль:Дореформенная орфография",
"wikitext_character_count": 1553,
"wikitext_sha256": "d0199f6df8f5f789e6a5aec0e450dae6d35c3448adca411481244e40aec3004d",
"wikitext_utf8_byte_count": 1588
},
{
"closure_title": "Module:Header",
"mediawiki_sha1": "2ab2bfdd7e49c73c4ec9ef24e4625c1d228cfba0",
"page_id": 361783,
"revision_id": 5746249,
"revision_timestamp": "2026-09-10T02:29:30Z",
"title": "Модуль:Header",
"wikitext_character_count": 54598,
"wikitext_sha256": "b3950aa5a04e8a8f3bec71c6c82843643dfdc1a1a82f3788f48830f21e434ecb",
"wikitext_utf8_byte_count": 67792
},
{
"closure_title": "Module:BEED",
"mediawiki_sha1": "9e9531e9178e0333bd3a939ace91e6a71e114cc5",
"page_id": 362284,
"revision_id": 5746253,
"revision_timestamp": "2026-09-10T03:41:25Z",
"title": "Модуль:BEED",
"wikitext_character_count": 10647,
"wikitext_sha256": "108fee006a43f146302aafda316f05f15198932c3389487ed7c760c83a7c4875",
"wikitext_utf8_byte_count": 11979
},
{
"closure_title": "Module:Util",
"mediawiki_sha1": "945f8e6bf173bb5712385995255a8b6eccef38ed",
"page_id": 980298,
"revision_id": 5750249,
"revision_timestamp": "2026-09-18T07:31:28Z",
"title": "Модуль:Util",
"wikitext_character_count": 1328,
"wikitext_sha256": "a69fdcf9cf4dbbfe34d3e41585f2bcd418eee4efbe6e5c42d82e450cc4045a90",
"wikitext_utf8_byte_count": 1585
},
{
"closure_title": "Module:RomanNumber",
"mediawiki_sha1": "51a3956469ee3fbd4ed56ce3a1f72f76f231e1d3",
"page_id": 378544,
"revision_id": 3684553,
"revision_timestamp": "2019-06-04T20:13:27Z",
"title": "Модуль:RomanNumber",
"wikitext_character_count": 1152,
"wikitext_sha256": "90edb9a1d3bf5d283112fd58e28ee60f2569ae0fe7850e936a17f4e23869cf45",
"wikitext_utf8_byte_count": 1212
}
],
"schema_version": "scriptorium-darwin-var-provider-revision-identities-v1",
"source_text_included": false
}
10 changes: 10 additions & 0 deletions project/CHANGELOG.d/SCRIP-CORPUS-084.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
## 2026-09-24 — Darwin `{{ВАР}}` provider revision identities

- Selected SCRIP-CORPUS-084 / Issue #257 from the normal-flow P2 corpus queue after confirming no interrupted/open PR or issue recovery work.
- Added a dedicated source-free GitHub Actions capture for exactly the six SCRIP-CORPUS-083 observed-live revisions using the existing fail-closed MediaWiki revision fetch primitive.
- The first capture run correctly failed because Russian Wikisource canonicalizes `Module:` aliases to the local `Модуль:` namespace. The workflow was repaired to bind both the reviewed closure alias and provider-returned canonical title instead of weakening title validation.
- Successful provider capture bound all six exact revision IDs to page IDs, UTC timestamps, 40-hex MediaWiki SHA-1 values, source-free wikitext counts, and SHA-256 digests without committing source prose.
- Added deterministic evidence builder/validator, six focused regressions, and a public source-free companion. Evidence SHA-256: `98dc8aed94fd8b4e18f0ad3325673603cba1575c1e745e1175ab4cd3a8aa2a48`.
- `mediawiki_sha1_complete=true`, but `replay_ready=false`: full `{{ВАР}}` candidate replay, historical transclusion, explicit version-pinned Scribunto/runtime identity, renderer promotion, backlog reduction, literary-body identity, >=300k admission, FantLab-input identity and M2 parity remain outside this unit and closed.
- `ВАР` remains unresolved at 388 invocations; effective backlog remains 4 tag shapes / 130 tag tokens and 37 template shapes / 2,356 template invocations. M2 remains 0/5.
- Draft PR #258 remains for a later independent exact-head review; this authoring run does not self-approve or merge its substantive change.
Loading
Loading