ADR-0072 ratified + implemented. Closes the register subsystem
inside-out arc (R1 ADR-0068 → R5 ADR-0072): the presentation axis is
now operator-visible, CI-falsifiable, and audit-traceable.
Telemetry extension
- TurnEvent + ChatResponse gain register_id + register_variant_id
(12-char SHA-256 prefix of selected (opening, closing) pair;
empty string for UNREGISTERED / no-decoration registers).
- serialize_turn_event surfaces both fields in every audit JSONL
line. Pre-R5 callers stay byte-identical (defaults are "").
Decoration result widened
- chat/register_variation.py: decorate_surface now returns
DecorationResult(surface, opening, closing, variant_id).
- decorate_surface_str alias preserves the pre-R5 string-only API
for off-runtime callers.
- chat/runtime.py updated at both call sites (stub + main).
Operator surface
- core chat --register REGISTER_ID threads into
RuntimeConfig.register_pack_id via _runtime_config_from_args.
- Invalid id ⇒ RegisterPackError caught at cmd_chat and surfaced
as a clean _die(...) before the REPL launches.
Narrative demo
- evals/register_tour/run_tour.py walks 4 prompts × 3 ratified
registers ({default_neutral_v1, terse_v1, convivial_v1}) and
asserts three load-bearing seam claims:
* all_grounding_sources_identical
* all_trace_hashes_identical (ADR-0069 invariant C, falsifiable)
* surfaces_vary_at_least_once (ADR-0071 seeded variation lift)
- core demo register-tour exit code = 0 iff every claim holds.
Tests
- tests/test_register_telemetry.py (6) — TurnEvent default,
serializer keys, runtime emits register_id/variant_id for
convivial/terse/unregistered, ChatResponse mirrors event fields.
- tests/test_register_cli.py (7) — _runtime_config_from_args
threading, invalid-id fail-fast, parser wires --register.
- tests/test_register_tour_demo.py (7) — three seam claims pinned
individually + all_claims_supported + per-cell register_id +
variant_id discipline (empty for neutral/terse, non-empty for
convivial).
- tests/test_register_variation.py extended (4 new) — DecorationResult
shape, decorate_surface_str alias, variant_id stability,
bijection between non-trivial marker pairs and variant_ids.
Lane evidence
- Full lane: 2632 passed / 4 skipped / 1 pre-existing failure
(tests/test_cli_demo.py::test_all_preamble_explains_combined_run,
unrelated to R5).
- Cognition eval byte-identical: public 100 / 100 / 91.7 / 100.
Trust boundaries (per CLAUDE.md)
- --register flag does not bypass ratification; loader validates the
pack id through _find_pack and the ratify gate at load time.
- variant_id is content-addressed; no raw markers leak into audit.
- Telemetry stays redact-safe — register_id and variant_id are
identifiers, not content, so include_content=False emits them
unconditionally.
- No new mutation surface; pack files on disk are not modified.
72 lines
2.6 KiB
Python
72 lines
2.6 KiB
Python
"""Register tour demo — load-bearing seam claim (ADR-0072 / R5).
|
|
|
|
Pins the three seam claims:
|
|
|
|
* grounding_source identical across {neutral, terse, convivial} per prompt
|
|
* trace_hash identical across {neutral, terse, convivial} per prompt
|
|
* surface differs at least once (convivial vs neutral)
|
|
|
|
Any one of those failing is the R5 architectural-regression signal.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
from evals.register_tour.run_tour import _PROMPTS, _REGISTERS, run_tour
|
|
|
|
|
|
def test_tour_returns_structured_report():
|
|
report = run_tour(emit_json=True)
|
|
assert set(report) >= {
|
|
"registers", "prompts", "grid", "claims", "all_claims_supported",
|
|
}
|
|
assert list(report["registers"]) == list(_REGISTERS)
|
|
assert list(report["prompts"]) == list(_PROMPTS)
|
|
|
|
|
|
def test_tour_grounding_sources_identical_across_registers():
|
|
report = run_tour(emit_json=True)
|
|
assert report["claims"]["all_grounding_sources_identical"] is True
|
|
|
|
|
|
def test_tour_trace_hashes_identical_across_registers():
|
|
"""ADR-0069 invariant C, restated as a falsifiable demo claim."""
|
|
report = run_tour(emit_json=True)
|
|
assert report["claims"]["all_trace_hashes_identical"] is True
|
|
|
|
|
|
def test_tour_surfaces_vary_at_least_once():
|
|
"""ADR-0071 seeded variation: convivial vs neutral must differ
|
|
somewhere across the four-prompt sequence."""
|
|
report = run_tour(emit_json=True)
|
|
assert report["claims"]["surfaces_vary_at_least_once"] is True
|
|
|
|
|
|
def test_tour_all_claims_supported():
|
|
"""Canonical R5 gate — every claim must hold or exit non-zero."""
|
|
report = run_tour(emit_json=True)
|
|
assert report["all_claims_supported"] is True
|
|
|
|
|
|
def test_tour_grid_carries_register_id_per_cell():
|
|
"""Each grid cell records the register_id that produced it."""
|
|
report = run_tour(emit_json=True)
|
|
for register_id in _REGISTERS:
|
|
cells = report["grid"][register_id]
|
|
assert len(cells) == len(_PROMPTS)
|
|
for cell in cells:
|
|
assert cell["register_id"] == register_id
|
|
|
|
|
|
def test_tour_grid_variant_id_empty_when_no_decoration():
|
|
"""terse_v1 + default_neutral_v1 emit empty variant_ids; convivial_v1
|
|
emits non-empty variant_ids on non-empty surfaces."""
|
|
report = run_tour(emit_json=True)
|
|
for cell in report["grid"]["default_neutral_v1"]:
|
|
assert cell["register_variant_id"] == ""
|
|
for cell in report["grid"]["terse_v1"]:
|
|
assert cell["register_variant_id"] == ""
|
|
convivial_non_empty = [
|
|
c for c in report["grid"]["convivial_v1"]
|
|
if c["surface"]
|
|
]
|
|
assert any(c["register_variant_id"] != "" for c in convivial_non_empty)
|