Skip to content

ci(english-gonol): run full pinned corpus construct #1

ci(english-gonol): run full pinned corpus construct

ci(english-gonol): run full pinned corpus construct #1

name: english-gonol-full
on:
workflow_dispatch:
push:
branches: [main]
paths:
- "research/english-gonol/english_gonol/full_construct_run.py"
- "research/english-gonol/english_gonol/language/source.py"
- ".github/workflows/english-gonol-full.yml"
permissions:
contents: read
jobs:
full-construct:
runs-on: ubuntu-24.04
timeout-minutes: 90
steps:
- name: Checkout stack
uses: actions/checkout@v7.0.1
with:
persist-credentials: false
- name: Checkout pinned OEWN 2025 evidence
uses: actions/checkout@v7.0.1
with:
repository: globalwordnet/english-wordnet
ref: dc343f2683279ecbb13fab4e2fd778d7b162d287
path: _deps/oewn
persist-credentials: false
- name: Checkout pinned cleaned UCNS geometry
uses: actions/checkout@v7.0.1
with:
repository: The-Interdependency/ucns
ref: 4f863ad37096b7baab8f62820ad5cb937b62a3a7
path: _deps/ucns
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@v7.0.0
with:
python-version: "3.12"
- name: Install construction prerequisites
run: python -m pip install --disable-pip-version-check pytest PyYAML
- name: Preflight resources and exact producer identities
shell: bash
run: |
set -euo pipefail
test "$(git -C _deps/oewn rev-parse HEAD)" = "dc343f2683279ecbb13fab4e2fd778d7b162d287"
test "$(git -C _deps/ucns rev-parse HEAD)" = "4f863ad37096b7baab8f62820ad5cb937b62a3a7"
python - <<'PY'
import os
import shutil
disk = shutil.disk_usage(".")
pages = os.sysconf("SC_PHYS_PAGES")
page_size = os.sysconf("SC_PAGE_SIZE")
ram = pages * page_size
print(f"free_disk_gib={disk.free / 1024**3:.2f}")
print(f"physical_ram_gib={ram / 1024**3:.2f}")
if disk.free < 8 * 1024**3:
raise SystemExit("preflight: fewer than 8 GiB free; full run not started")
if ram < 5 * 1024**3:
raise SystemExit("preflight: fewer than 5 GiB RAM; full run not started")
PY
- name: Run focused construction gates
working-directory: research/english-gonol
run: |
python -m pytest -q \
tests/test_full_construct_run.py \
tests/test_source_order.py \
tests/test_gonol_language_authority.py
- name: Build complete pinned corpus construct
working-directory: research/english-gonol
shell: bash
run: |
set -euo pipefail
/usr/bin/time -v python -m english_gonol.full_construct_run \
--source-root ../../_deps/oewn/src/yaml \
--ucns-source-root ../../_deps/ucns \
--out-dir experiments/full-construct-v1 \
--overwrite 2> experiments/full-construct-v1.time.txt
- name: Verify logical replay and SQLite integrity
working-directory: research/english-gonol
shell: bash
run: |
set -euo pipefail
python - <<'PY'
import hashlib
import json
import sqlite3
from pathlib import Path
from english_gonol.full_construct_run import verify_replay
out = Path("experiments/full-construct-v1")
manifest = verify_replay(out)
db_path = out / "construct.db"
db_sha = hashlib.sha256(db_path.read_bytes()).hexdigest()
db_size = db_path.stat().st_size
db = sqlite3.connect(db_path)
try:
integrity = db.execute("PRAGMA integrity_check").fetchone()[0]
if integrity != "ok":
raise SystemExit(f"sqlite integrity failed: {integrity}")
tables = [
"characters",
"words",
"word_characters",
"definitions",
"definition_words",
"semantic_evidence",
"unresolved_semantic_evidence",
]
counts = {
table: db.execute(f"SELECT COUNT(*) FROM {table}").fetchone()[0]
for table in tables
}
finally:
db.close()
evidence = {
"schema": manifest["schema"],
"version": manifest["version"],
"receipt_sha256": manifest["receipt_sha256"],
"construct_db_sha256": db_sha,
"construct_db_bytes": db_size,
"sqlite_integrity": integrity,
"counts": counts,
"geometry_state": manifest["geometry_state"],
"invented_geometry": manifest["invented_geometry"],
"hmmm": manifest["hmmm"],
}
(out / "evidence.json").write_text(
json.dumps(evidence, indent=2, sort_keys=True) + "\n",
encoding="utf-8",
)
print(json.dumps(evidence, indent=2, sort_keys=True))
PY
- name: Publish compact evidence
working-directory: research/english-gonol
shell: bash
run: |
set -euo pipefail
{
echo "## English Gonol full construct"
echo
echo '```json'
cat experiments/full-construct-v1/evidence.json
echo '```'
echo
echo "### Resource receipt"
echo '```text'
cat experiments/full-construct-v1.time.txt
echo '```'
} >> "$GITHUB_STEP_SUMMARY"
- name: Retain compact replay evidence
uses: actions/upload-artifact@v4
with:
name: english-gonol-full-construct-evidence
retention-days: 30
if-no-files-found: error
path: |
research/english-gonol/experiments/full-construct-v1/manifest.json
research/english-gonol/experiments/full-construct-v1/evidence.json
research/english-gonol/experiments/full-construct-v1.time.txt