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
2 changes: 1 addition & 1 deletion .aii/config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# AII sidecar — InstituteOS metadata. Schema: aii_platform.aii_sidecar
meta:
sidecar_version: 1.2.1
updated: '2026-11-10'
updated: '2026-11-12'
repo:
name: ActiveBlockference
slug: activeblockference
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,8 @@ jobs:
id: runtime
run: |
set -euo pipefail
PIN=specs/gnn-pin.json
PY=$(uv python find --no-project 3.12)
REPO=$("$PY" -c "import json;print(json.load(open('$PIN'))['repository'])")
COMMIT=$("$PY" -c "import json;print(json.load(open('$PIN'))['commit'])")
REPO=$(uv run --no-sync python -c "from blockference.gnn import load_pin; print(load_pin()['repository'])")
COMMIT=$(uv run --no-sync python -c "from blockference.gnn import load_pin; print(load_pin()['commit'])")
uv venv --python 3.12 "$RUNNER_TEMP/gnn-runtime"
# The install follows specs/gnn-pin.json; a pin bump re-points it.
uv pip install --python "$RUNNER_TEMP/gnn-runtime/bin/python" \
Expand Down
17 changes: 14 additions & 3 deletions blockference/gnn.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from __future__ import annotations

import json
import re
from collections.abc import Iterable, Mapping, Sequence
from dataclasses import dataclass
from pathlib import Path
Expand Down Expand Up @@ -152,9 +153,19 @@ def spec_arrays(parameters: GridWorldSpecParameters | None = None) -> dict[str,


def load_pin(path: Path | None = None) -> dict[str, Any]:
"""Return the recorded upstream GNN pin."""

return json.loads((path or GNN_PIN_PATH).read_text(encoding="utf-8"))
"""Return the upstream pin, rejecting records outside the local pin contract."""

pin = json.loads((path or GNN_PIN_PATH).read_text(encoding="utf-8"))
if not isinstance(pin, dict):
raise ValueError("invalid GNN pin: expected a JSON object")
if pin.get("schema") != "gnn-importer-pin/v1":
raise ValueError("invalid GNN pin schema: expected gnn-importer-pin/v1")
if pin.get("tag") != "v5.0.3":
raise ValueError("invalid GNN pin tag: expected v5.0.3")
commit = pin.get("commit")
if not isinstance(commit, str) or re.fullmatch(r"[0-9a-fA-F]{40}", commit) is None:
raise ValueError("invalid GNN pin commit: expected a full 40-hex revision")
return pin


def _format_value(value: float) -> str:
Expand Down
22 changes: 11 additions & 11 deletions docs/_generated/gate-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Measured wall times from recorded canonical gate observations on `macOS-27.0.1-arm64-arm-64bit` with Python 3.12.16 at `2026-11-12T13:56:34Z`.

First successful measurements retained for each arm. Package initially failed twice because offline pandas wheel metadata was unavailable; only package and the not-yet-run render arm were then run after SHA-256-verified acquisition of the exact pandas wheel in uv.lock. Those failures remain in this receipt’s runs. UV_FIND_LINKS pointed to that verified local wheelhouse for the successful package run. Baseline and after test selections differ by the new regression cases. No speedup is claimed.
First successful measurements retained for each arm. Package initially failed twice because offline pandas wheel metadata was unavailable; only package and the not-yet-run render arm were then run after SHA-256-verified acquisition of the exact pandas wheel in uv.lock. Those failures remain in this receipt’s runs. UV_FIND_LINKS pointed to that verified local wheelhouse for the successful package run. Baseline and after test selections differ by the new regression cases. No speedup is claimed. Audit refresh retains the earlier observations and two failed full-suite runs in runs; the notebook validator initially recursed into gitignored, untracked GNN migration build output. That output was moved aside without tracked changes for the successful 103-test run, then restored. Current lint, types, docs, GNN, render and full-suite observations are refreshed; other arm observations remain historical. The fresh render artifact was identified by the gate producer from source commit 2193be7b0be3fc429f4a8d159d4b96b249b12060.

Refresh with:

Expand All @@ -20,16 +20,16 @@ uv run python scripts/gate_metrics.py --record-timings /tmp/gate-after.json

| Arm | Before (s) | Before status | After (s) | After status | After command |
| --- | --- | --- | --- | --- | --- |
| `lint` | 0.11 | passed | 0.08 | passed | `uv run ruff check blockference tests GRTs scripts` |
| `types` | 0.61 | passed | 0.3 | passed | `uv run mypy blockference` |
| `lint` | 0.11 | passed | 0.03 | passed | `uv run ruff check blockference tests GRTs scripts` |
| `types` | 0.61 | passed | 1.06 | passed | `uv run mypy blockference` |
| `test` | 33.27 | passed | 4.82 | passed | `uv run pytest -m not slow` |
| `test-full` | 55.38 | passed | 31.17 | passed | `uv run pytest --cov=blockference --cov-report=term --cov-report=xml --cov-fail-under=90` |
| `docs` | 7.45 | passed | 3.56 | passed | `uv run python scripts/check_docs_links.py` |
| `test-full` | 55.38 | passed | 44.22 | passed | `uv run pytest --cov=blockference --cov-report=term --cov-report=xml --cov-fail-under=90` |
| `docs` | 7.45 | passed | 5.28 | passed | `uv run python scripts/check_docs_links.py` |
| `manuscript` | 6.04 | passed | 3.24 | passed | `uv run python scripts/manuscript_variables.py --check` |
| `gnn` | 2.78 | passed | 1.51 | passed | `uv run python scripts/export_gnn_spec.py --check` |
| `gnn` | 2.78 | passed | 2.0 | passed | `uv run python scripts/export_gnn_spec.py --check` |
| `smoke` | 3.48 | passed | 2.55 | passed | `uv run blockference pipeline --config configs/smoke.yml --output-root /private/tmp/activeblockference-estate.8EbtJ4/tmp/activeblockference-gate-vx7lf7ds/output --run-name gate_smoke` |
| `package` | 0.08 | failed | 14.86 | passed | `uv build` |
| `render` | 4.04 | passed | 6.18 | passed | `uv run python scripts/build_manuscript.py --render pdf` |
| `render` | 4.04 | passed | 4.46 | passed | `uv run python scripts/build_manuscript.py --render pdf` |

Baseline workloads that are not equivalent to their arms:

Expand All @@ -43,13 +43,13 @@ The baseline and current receipts are historical evidence. Timings include host

| Selection | Collected tests |
| --- | --- |
| full suite | 92 |
| fast (`-m "not slow"`) | 79 |
| full suite | 103 |
| fast (`-m "not slow"`) | 90 |
| slow (`-m slow`) | 13 |

Recorded run: 92 passed, 0 skipped.
Recorded run: 103 passed, 0 skipped.

`test-full` recorded 90.94% line coverage of `blockference` (floor 90%).
`test-full` recorded 91.02% line coverage of `blockference` (floor 90%).

## Receipts

Expand Down
129 changes: 119 additions & 10 deletions docs/_generated/gate-timings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@
"uv run python scripts/check_docs_links.py",
"uv run python scripts/gate_metrics.py --check"
],
"seconds": 3.56,
"seconds": 5.28,
"status": "passed"
},
"gnn": {
"commands": [
"uv run python scripts/export_gnn_spec.py --check",
"uv run python scripts/validate_gnn_spec.py --gnn-runtime /private/tmp/gnn-rt-503/bin/python --json"
],
"seconds": 1.51,
"seconds": 2.0,
"status": "passed"
},
"lint": {
"commands": [
"uv run ruff check blockference tests GRTs scripts"
],
"seconds": 0.08,
"seconds": 0.03,
"status": "passed"
},
"manuscript": {
Expand All @@ -45,10 +45,16 @@
"status": "passed"
},
"render": {
"artifact": {
"bytes": 262701,
"path": "docs/_build/manuscript/activeblockference.pdf",
"sha256": "77ee9b6ef9c83cc8b26ce5bd9130baa851ce5168b5d4207f3e2b3e16ce884f88",
"source_commit": "2193be7b0be3fc429f4a8d159d4b96b249b12060"
},
"commands": [
"uv run python scripts/build_manuscript.py --render pdf"
],
"seconds": 6.18,
"seconds": 4.46,
"status": "passed"
},
"smoke": {
Expand All @@ -71,19 +77,19 @@
"commands": [
"uv run pytest --cov=blockference --cov-report=term --cov-report=xml --cov-fail-under=90"
],
"seconds": 31.17,
"seconds": 44.22,
"status": "passed"
},
"types": {
"commands": [
"uv run mypy blockference"
],
"seconds": 0.3,
"seconds": 1.06,
"status": "passed"
}
},
"completed": "2026-11-12T14:02:13Z",
"conditions": "First successful measurements retained for each arm. Package initially failed twice because offline pandas wheel metadata was unavailable; only package and the not-yet-run render arm were then run after SHA-256-verified acquisition of the exact pandas wheel in uv.lock. Those failures remain in this receipt\u2019s runs. UV_FIND_LINKS pointed to that verified local wheelhouse for the successful package run. Baseline and after test selections differ by the new regression cases. No speedup is claimed.",
"completed": "2026-11-12T15:01:53Z",
"conditions": "First successful measurements retained for each arm. Package initially failed twice because offline pandas wheel metadata was unavailable; only package and the not-yet-run render arm were then run after SHA-256-verified acquisition of the exact pandas wheel in uv.lock. Those failures remain in this receipt\u2019s runs. UV_FIND_LINKS pointed to that verified local wheelhouse for the successful package run. Baseline and after test selections differ by the new regression cases. No speedup is claimed. Audit refresh retains the earlier observations and two failed full-suite runs in runs; the notebook validator initially recursed into gitignored, untracked GNN migration build output. That output was moved aside without tracked changes for the successful 103-test run, then restored. Current lint, types, docs, GNN, render and full-suite observations are refreshed; other arm observations remain historical. The fresh render artifact was identified by the gate producer from source commit 2193be7b0be3fc429f4a8d159d4b96b249b12060.",
"generated": "2026-11-12T13:56:34Z",
"host": "macOS-27.0.1-arm64-arm-64bit",
"python": "3.12.16",
Expand Down Expand Up @@ -209,12 +215,115 @@
"host": "macOS-27.0.1-arm64-arm-64bit",
"python": "3.12.16",
"schema": "activeblockference-gate/v1"
},
{
"arms": {
"lint": {
"commands": [
"uv run ruff check blockference tests GRTs scripts"
],
"seconds": 0.03,
"status": "passed"
},
"test-full": {
"commands": [
"uv run pytest --cov=blockference --cov-report=term --cov-report=xml --cov-fail-under=90"
],
"error": "Command '['uv', 'run', 'pytest', '--cov=blockference', '--cov-report=term', '--cov-report=xml', '--cov-fail-under=90']' returned non-zero exit status 1.",
"seconds": 17.61,
"status": "failed"
},
"types": {
"commands": [
"uv run mypy blockference"
],
"seconds": 1.06,
"status": "passed"
}
},
"generated": "2026-11-12T14:59:48Z",
"host": "macOS-27.0.1-arm64-arm-64bit",
"python": "3.12.16",
"schema": "activeblockference-gate/v1"
},
{
"arms": {
"test-full": {
"commands": [
"uv run pytest --cov=blockference --cov-report=term --cov-report=xml --cov-fail-under=90"
],
"error": "Command '['uv', 'run', 'pytest', '--cov=blockference', '--cov-report=term', '--cov-report=xml', '--cov-fail-under=90']' returned non-zero exit status 1.",
"seconds": 24.86,
"status": "failed"
}
},
"generated": "2026-11-12T15:00:39Z",
"host": "macOS-27.0.1-arm64-arm-64bit",
"python": "3.12.16",
"schema": "activeblockference-gate/v1"
},
{
"arms": {
"docs": {
"commands": [
"uv run python scripts/check_docs_links.py",
"uv run python scripts/gate_metrics.py --check"
],
"seconds": 5.28,
"status": "passed"
},
"gnn": {
"commands": [
"uv run python scripts/export_gnn_spec.py --check",
"uv run python scripts/validate_gnn_spec.py --gnn-runtime /private/tmp/gnn-rt-503/bin/python --json"
],
"seconds": 2.0,
"status": "passed"
},
"render": {
"artifact": {
"bytes": 262701,
"path": "docs/_build/manuscript/activeblockference.pdf",
"sha256": "77ee9b6ef9c83cc8b26ce5bd9130baa851ce5168b5d4207f3e2b3e16ce884f88",
"source_commit": "2193be7b0be3fc429f4a8d159d4b96b249b12060"
},
"commands": [
"uv run python scripts/build_manuscript.py --render pdf"
],
"seconds": 4.46,
"status": "passed"
}
},
"generated": "2026-11-12T15:01:36Z",
"host": "macOS-27.0.1-arm64-arm-64bit",
"python": "3.12.16",
"schema": "activeblockference-gate/v1"
},
{
"arms": {
"test-full": {
"commands": [
"uv run pytest --cov=blockference --cov-report=term --cov-report=xml --cov-fail-under=90"
],
"seconds": 44.22,
"status": "passed"
}
},
"generated": "2026-11-12T15:01:53Z",
"host": "macOS-27.0.1-arm64-arm-64bit",
"python": "3.12.16",
"schema": "activeblockference-gate/v1",
"tests": {
"coverage_percent": 91.02,
"passed": 103,
"skipped": 0
}
}
],
"schema": "activeblockference-gate/v1",
"tests": {
"coverage_percent": 90.94,
"passed": 92,
"coverage_percent": 91.02,
"passed": 103,
"skipped": 0
}
}
6 changes: 5 additions & 1 deletion docs/gate.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,11 @@ the workflow installs the locked environment directly.
`release_check.py --timings PATH` writes the actual commands, statuses, and
elapsed times for the selected run, including a failed arm. Use a fresh receipt
path for each run; selecting `render` separately records the explicit local PDF
build without adding it to CI.
build without adding it to CI. A passing render arm also records `artifact`:
the repository-relative PDF path, exact byte count, SHA-256, and source commit
(`git rev-parse HEAD`). Commit source changes before recording a release render
so that commit identifies the rendered source. The PDF remains ignored; the
receipt identifies the local bytes without publishing the binary.

Import receipts before regenerating the checked metrics page:

Expand Down
8 changes: 7 additions & 1 deletion docs/gnn.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,13 @@ The receipt is written to `docs/_build/gnn/validation-receipt.json`
* `render_spec(parameters)` — the document text.
* `parameters_from_parsed(payload)` / `declared_arrays(payload)` — read a
pinned parser payload back into parameters and matrices.
* `load_pin()` — the recorded upstream pin.
* `load_pin()` — the recorded upstream pin, requiring schema
`gnn-importer-pin/v1`, tag `v5.0.3`, and a full 40-hex commit. Invalid records
raise `ValueError` naming the field. This interim local reader remains in use
because the estate pin predates `gnn.importers`; shared-reader adoption requires
a pin containing that upstream API, not a vendored copy.
CI provisioning uses this same reader in the locked package environment,
rather than independently loading unvalidated JSON.

## Scope

Expand Down
27 changes: 27 additions & 0 deletions scripts/release_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
from __future__ import annotations

import argparse
import hashlib
import json
import os
import platform
Expand All @@ -38,6 +39,11 @@
import time
from pathlib import Path

if __package__:
from scripts.build_manuscript import RENDER_TARGETS
else:
from build_manuscript import RENDER_TARGETS

ROOT = Path(__file__).resolve().parents[1]
SCHEMA = "activeblockference-gate/v1"

Expand Down Expand Up @@ -276,6 +282,24 @@ def _selected(arms: list[str]) -> list[str]:
return [arm for arm in ARM_ORDER if arm in expanded]


def _render_artifact() -> dict[str, object]:
"""Identify the PDF bytes produced by the successful render command."""

pdf = RENDER_TARGETS["pdf"]
with pdf.open("rb") as handle:
digest = hashlib.file_digest(handle, "sha256").hexdigest()
commit = subprocess.run(
["git", "rev-parse", "HEAD"], cwd=ROOT, check=True, text=True,
capture_output=True, stdin=subprocess.DEVNULL,
).stdout.strip()
return {
"path": pdf.relative_to(ROOT).as_posix(),
"bytes": pdf.stat().st_size,
"sha256": digest,
"source_commit": commit,
}


def _write_receipt(path: Path, receipt: dict[str, object]) -> None:
path.parent.mkdir(parents=True, exist_ok=True)
path.write_text(json.dumps(receipt, indent=2, sort_keys=True) + "\n", encoding="utf-8")
Expand Down Expand Up @@ -365,6 +389,7 @@ def main(argv: list[str] | None = None) -> int:
)
if arm == "test-full":
tests["coverage_percent"] = _coverage_percent()
artifact = _render_artifact() if arm == "render" else None
except (subprocess.CalledProcessError, FileNotFoundError, RuntimeError, ValueError) as exc:
failed = True
arms_receipt[arm] = {
Expand All @@ -381,6 +406,8 @@ def main(argv: list[str] | None = None) -> int:
"status": "passed",
"commands": [" ".join(command) for command in commands],
}
if artifact is not None:
arms_receipt[arm]["artifact"] = artifact
print(f"{arm} passed in {elapsed:.2f}s", flush=True)

receipt["arms"] = arms_receipt
Expand Down
Loading
Loading