From 482ff0697b01438a71d2aeecdf41a3bb090c8f4d Mon Sep 17 00:00:00 2001 From: Pranav Bhave <90584946+Cubits11@users.noreply.github.com> Date: Fri, 13 Nov 2026 15:49:54 -0500 Subject: [PATCH] publication: the reader-test approval gate is retired by owner decision, 2026-11-13 The deployment gate required five unfamiliar human readers, four passing each of three tasks, before it would publish. Zero participant records were collected. The last deployment that published is 50b2898 on 2026-10-17; eleven pushes to main since stopped at this gate, and from 7764a42 it was the only blocker. The owner removes the rule and ships the updated site without it. No replacement approval step is added. publication_gate.py now checks the title attestation and the phone-film receipts only; --bind and --template are gone with the study they served. readers.json, an empty study record, is deleted. readiness.json records the decision under reader_test, with the dates it was in force and what it does not license. The kit is marked retired and kept as the record of what the rule asked. Not changed: the deployment step name in verify.yml and one docstring line in verification_manifest.py still mention reader evidence. Both are trust-root files and change only through a separate migration. The film cold-viewer rule for feed releases is a separate rule and stays. --- publication/reader-test-kit.md | 2 +- publication/readers.json | 38 -------- publication/readiness.json | 67 ++++--------- scripts/publication_gate.py | 171 +++------------------------------ tests/test_publication_gate.py | 167 +++++--------------------------- 5 files changed, 61 insertions(+), 384 deletions(-) delete mode 100644 publication/readers.json diff --git a/publication/reader-test-kit.md b/publication/reader-test-kit.md index 645273c..890b544 100644 --- a/publication/reader-test-kit.md +++ b/publication/reader-test-kit.md @@ -1,6 +1,6 @@ # Five unfamiliar readers — owner-run test -Status: NOT RUN. Publication remains blocked. No participant results have been supplied. +Status: RETIRED 2026-11-13 by owner decision. This kit no longer gates publication, and nothing reads it. The site ships without a reader test; no replacement approval step exists. Zero participant records were collected under it. The `--bind` and `--template` commands named below were removed from `scripts/publication_gate.py` with the gate. The decision, the dates the rule was in force, and what it does not license are recorded under `reader_test` in `publication/readiness.json`. The text below is kept unchanged as the record of what the rule asked. The owner will recruit and run this test. Use five distinct people who have not seen this site, its films, this repair discussion, or the answer criteria. They must be humans; assistants and agents do not count. Keep all five results, including failures. Do not replace a failed reader after seeing an answer. diff --git a/publication/readers.json b/publication/readers.json deleted file mode 100644 index 0d15ade..0000000 --- a/publication/readers.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "schema_version": 1, - "protocol_sha256": "a7e6891cbb1824c6b3bbee70352624ad6801ae43589e000ca0bd9e579fd8e0ce", - "artifact_sha256": { - "assets/check-status.js": "0e65f7a2e2edea55ed2a85330568c55dd0a6d9d5741e51df100eff6765d66664", - "assets/fonts/fragment-mono.woff2": "4f4dc27f4a770c0d02fde800daa836c8adc0d1e423b28da74baaf0d1cc3ab96c", - "assets/fonts/fraunces-italic.woff2": "4af9c759c8059b53923b4b50ba377ba51029876e1af1ea757efb07bc67d97896", - "assets/fonts/fraunces-roman.woff2": "48282a415ec22e31beaf0a0666e6fae0c8cbddcd0b1f6e729f27c3ade8a64e43", - "assets/fonts/instrument-sans-roman.woff2": "6219bc4bfdfc5d9b2201dcdf046218b122a758f932e25ed5f168f929b7ca2311", - "assets/site.css": "3fa7eec04ac845fb83c3f3994e7d6070cf0d1b94a07cca9a9ecb524b0e45213e", - "assets/site.js": "1083834b07b4b3cb3c5013bb31a4aadcc332ab04f4ca18dc62d9a26baabe3b3a", - "assets/status.css": "57518fadff67af7af1293db6eebf23731f39c28be686953c03e626e5bcb58193", - "assets/world.css": "46f52f4c04eb65c499b2519e886548fbeb87c14e0bb4871aa0ec88234f486cc6", - "films/same-scores-different-worlds/renders/same-scores-different-worlds__master.mp4": "ebeae99a0036fd97b25007ee3c9f3cc43cd96864c2d7aa8491ff7c8df82f01f8", - "films/same-scores-different-worlds/renders/same-scores-different-worlds__master.poster.png": "e658c99d776a65b50d0e9c3dc4ff8ea6322b5a010aeed1605b3f06385f167708", - "films/same-scores-different-worlds/renders/same-scores-different-worlds__vertical.mp4": "4ab8d50a81597be56c7bca18af1c862cd60d8c3040c3a1f5b642c92b45600806", - "films/same-scores-different-worlds/renders/same-scores-different-worlds__vertical.poster.png": "11ead959d46beee9911dc6147bac35945d8034f3581a9e3d3f40e24264ed545f", - "films/the-missing-column-census/index.html": "1056cc3a30d9e94ce8d145dc6eab0f88dd70c912cf61aafbe3a53e16067f0c7d", - "films/the-missing-column-census/renders/the-missing-column-census__master.mp4": "29849f294ffd2b3c94a6f64c65f86211cb61b35e9be620914b20394634fe4dd5", - "films/the-missing-column-census/renders/the-missing-column-census__master.poster.png": "489be85673af0f660833da4be6124c96f911c5fcd9a8c3691d928dc6012b676e", - "films/the-missing-column-census/renders/the-missing-column-census__vertical.mp4": "e1ab8ce89182b22a4a6d7058aa14782ea606cc405b01dfdb1e42c0559491431e", - "films/the-missing-column-census/renders/the-missing-column-census__vertical.poster.png": "f5252a5364030ad9ad2043bd9c9385176756df96220c94c9955e2630a359662b", - "index.html": "dd45ed6e74833a8e078d3d28d49d012c177a88b043e55fbf47a09eda909ba1f9", - "try/index.html": "b311c2897cbb52c65f8b94213482d1e8040eeec39be3ad740fdf1eaa8e299e91" - }, - "facilitator": { - "id": null, - "attests_humans": false, - "attests_unfamiliar": false, - "attests_distinct": false, - "recorded_on": null - }, - "rater": { - "id": null, - "criteria": {} - }, - "participants": [] -} diff --git a/publication/readiness.json b/publication/readiness.json index 3097f56..24439df 100644 --- a/publication/readiness.json +++ b/publication/readiness.json @@ -1,7 +1,5 @@ { "schema_version": 1, - "status": "BLOCKED", - "status_note": "Draft candidate. No unfamiliar-reader evidence has been collected and the external title has not been published.", "title": { "target": "What AI Guardrail Scores Cannot Tell You", "project": "Cubits11/ghost-visualizer", @@ -33,49 +31,26 @@ "inspection_note": "Merged to Cubits11/ghost-visualizer main as bf8d87b (PR #1) on 2026-10-17. index.html and CinematicShell.tsx <h1> were read at that revision through the GitHub contents API, and all four title source files hash identically to the prepared sources above. GV-001 was re-pinned to it in cubits11.github.io PR #30 (842e06d). Owner attestation still required: set status to owner_verified_published, with verified_by and verified_on." } }, - "protocol": { - "status": "CONFIRMED", - "confirmation_source": "Owner instructions in the active chat, 2026-10-17: \"fix the kit to Missing Column, Counted (not trailer)\", then \"Rewrite the criterion. Do not keep the trailer, and do not keep the shared-misses criterion on Counted.\" Supersedes the earlier trailer selection and the shared-misses task.", - "sample_size": 5, - "minimum_successes_per_task": 4, - "homepage_seconds": 20, - "film": "the-missing-column-census", - "film_selection": "The Missing Column, Counted (the census film, 40 s). It shows that most examined public evaluations do not record what happened to both guards on the same item: 14 of 20 lack the joint column, 5 of 20 keep some joint evidence, 0 at matched thresholds with full exposure. The film task tests that, not the shared-misses construction, which this film does not show.", - "tasks": [ - "homepage_joint", - "film_missing_column", - "proof_activation" + "reader_test": { + "status": "retired", + "decided_by": "owner, 2026-11-13", + "decision": "The five-reader approval gate is removed. The updated site ships without a reader test. No replacement approval step is added.", + "rule": "Five distinct unfamiliar human readers, with at least four passing each of three tasks (homepage subject and contact within 20 seconds, the Missing Column, Counted film in one sentence, one activation of the proof link), recorded in publication/readers.json before scripts/publication_gate.py would let the deployment job publish.", + "in_force": "2026-10-17 (2949acd) to 2026-11-13. The last deployment that published is 50b2898 on 2026-10-17. Eleven pushes to main from 506a8fa to c1642d6 stopped at the deployment gate; from 7764a42 onward this rule was the only blocker.", + "participants_recorded": 0, + "protocol_sha256_at_retirement": "a7e6891cbb1824c6b3bbee70352624ad6801ae43589e000ca0bd9e579fd8e0ce", + "last_revision_with_rule": "c1642d6355b45a099d17ca263242cd46ca64d836", + "removed": [ + "the readers check, --bind and --template in scripts/publication_gate.py", + "publication/readers.json (an empty study record)", + "the reader cases in tests/test_publication_gate.py" ], - "rater_criteria": { - "subject": "the answer identifies AI guardrails and the question of their shared failures, combined misses, or what separate scores leave unknown. Equivalent plain language counts. A generic answer such as \u201can AI website\u201d is insufficient.", - "contact": "the reader identifies the owner's working email link/address on the homepage. They need not send email. The homepage task passes only if both subject and contact succeed within the same 20-second window.", - "missing_column": "the sentence states both parts. (1) What is missing: the joint record, meaning what happened to both guards on the same item (equivalently, the joint column or joint evidence). (2) The scale: most evaluations lack it, or 14 of 20 lack it, or only 5 of 20 keep any. Exact numbers and specialist terms are unnecessary. Passing examples: \u201cMost evaluations don't record what happened to both guards on the same item.\u201d \u201c14 out of 20 evaluations don't have the joint column.\u201d \u201cOnly 5 of 20 keep any joint evidence, none at matched thresholds.\u201d Failing examples: \u201cGuards fail together sometimes.\u201d (no joint record, no scale; could be said without watching). \u201cIndividual scores don't tell you how often guards fail together.\u201d (true, but it is the shared-misses answer, not what this film counts). \u201cThe film was about AI safety.\u201d (no content). An answer missing either part fails.", - "proof": "one actual activation of the real post-player proof link reaches `/try/`. An instruction, a visible URL, or a facilitator's click is not a completed task." - }, - "limits": "Exactly five distinct unfamiliar humans. Human authenticity, unfamiliarity and raw-answer fidelity are facilitator attestations; automation cannot verify them. The film explanation and proof task have no time cutoff." - }, - "protocol_sha256": "a7e6891cbb1824c6b3bbee70352624ad6801ae43589e000ca0bd9e579fd8e0ce", - "artifact_sha256": { - "assets/check-status.js": "0e65f7a2e2edea55ed2a85330568c55dd0a6d9d5741e51df100eff6765d66664", - "assets/fonts/fragment-mono.woff2": "4f4dc27f4a770c0d02fde800daa836c8adc0d1e423b28da74baaf0d1cc3ab96c", - "assets/fonts/fraunces-italic.woff2": "4af9c759c8059b53923b4b50ba377ba51029876e1af1ea757efb07bc67d97896", - "assets/fonts/fraunces-roman.woff2": "48282a415ec22e31beaf0a0666e6fae0c8cbddcd0b1f6e729f27c3ade8a64e43", - "assets/fonts/instrument-sans-roman.woff2": "6219bc4bfdfc5d9b2201dcdf046218b122a758f932e25ed5f168f929b7ca2311", - "assets/site.css": "3fa7eec04ac845fb83c3f3994e7d6070cf0d1b94a07cca9a9ecb524b0e45213e", - "assets/site.js": "1083834b07b4b3cb3c5013bb31a4aadcc332ab04f4ca18dc62d9a26baabe3b3a", - "assets/status.css": "57518fadff67af7af1293db6eebf23731f39c28be686953c03e626e5bcb58193", - "assets/world.css": "46f52f4c04eb65c499b2519e886548fbeb87c14e0bb4871aa0ec88234f486cc6", - "films/same-scores-different-worlds/renders/same-scores-different-worlds__master.mp4": "ebeae99a0036fd97b25007ee3c9f3cc43cd96864c2d7aa8491ff7c8df82f01f8", - "films/same-scores-different-worlds/renders/same-scores-different-worlds__master.poster.png": "e658c99d776a65b50d0e9c3dc4ff8ea6322b5a010aeed1605b3f06385f167708", - "films/same-scores-different-worlds/renders/same-scores-different-worlds__vertical.mp4": "4ab8d50a81597be56c7bca18af1c862cd60d8c3040c3a1f5b642c92b45600806", - "films/same-scores-different-worlds/renders/same-scores-different-worlds__vertical.poster.png": "11ead959d46beee9911dc6147bac35945d8034f3581a9e3d3f40e24264ed545f", - "films/the-missing-column-census/index.html": "1056cc3a30d9e94ce8d145dc6eab0f88dd70c912cf61aafbe3a53e16067f0c7d", - "films/the-missing-column-census/renders/the-missing-column-census__master.mp4": "29849f294ffd2b3c94a6f64c65f86211cb61b35e9be620914b20394634fe4dd5", - "films/the-missing-column-census/renders/the-missing-column-census__master.poster.png": "489be85673af0f660833da4be6124c96f911c5fcd9a8c3691d928dc6012b676e", - "films/the-missing-column-census/renders/the-missing-column-census__vertical.mp4": "e1ab8ce89182b22a4a6d7058aa14782ea606cc405b01dfdb1e42c0559491431e", - "films/the-missing-column-census/renders/the-missing-column-census__vertical.poster.png": "f5252a5364030ad9ad2043bd9c9385176756df96220c94c9955e2630a359662b", - "index.html": "dd45ed6e74833a8e078d3d28d49d012c177a88b043e55fbf47a09eda909ba1f9", - "try/index.html": "b311c2897cbb52c65f8b94213482d1e8040eeec39be3ad740fdf1eaa8e299e91" - }, - "readers_path": "publication/readers.json" + "kept": "publication/reader-test-kit.md, marked retired, as the record of what the rule asked. The title and phone-film checks still gate the deployment job, as do the claim, reproduction and deployed-site jobs.", + "not_changed": "The deployment step name in .github/workflows/verify.yml and one docstring sentence in scripts/verification_manifest.py still mention reader evidence. Both are trust-root files under security/evidence-policy.json and change only through a separate migration.", + "non_claims": [ + "Shipping without the test does not establish that unfamiliar readers understand the site.", + "REL-001 (unfamiliar-reader effects) stays untested.", + "The film cold-viewer rule for feed releases (campaigns.yaml, distribution/launch-units.yaml) is a separate rule and is not changed by this decision." + ] + } } diff --git a/scripts/publication_gate.py b/scripts/publication_gate.py index 2693b5a..0421d5b 100644 --- a/scripts/publication_gate.py +++ b/scripts/publication_gate.py @@ -1,23 +1,22 @@ #!/usr/bin/env python3 -"""Enforce the owner's publication hold; missing human evidence is BLOCKED. - -This gate checks records and artifact bindings. It cannot establish that a -participant is human, unfamiliar, distinct, or quoted faithfully: those remain -facilitator attestations. Ordinary consistency CI runs this gate's unit tests, -not a fictitious passing reader study. The deployment job runs the actual gate. +"""Check the title and phone-film records before the deployment job publishes. + +The five-reader approval requirement was retired by owner decision on +2026-11-13 (publication/readiness.json, `reader_test`). This gate no longer +reads reader records, and nothing replaces them. It checks the published +title attestation and every film's phone receipt; it does not establish that +any reader understands the site. Ordinary consistency CI runs this gate's unit +tests; the deployment job runs the actual gate. """ from __future__ import annotations import argparse -import copy import datetime as dt import hashlib -from html.parser import HTMLParser import json import math from pathlib import Path import re import sys -from urllib.parse import unquote, urlsplit import yaml ROOT = Path(__file__).resolve().parents[1] @@ -25,10 +24,8 @@ import facts_digest # noqa: E402 TITLE = 'What AI Guardrail Scores Cannot Tell You' -FILM = 'the-missing-column-census' # Files a receipt binds whole; the facts it read are bound by facts_subset (facts_digest.py). REQUIRED_INPUTS = ('film.html','films/lib/film.js','films/lib/tokens.css') -HUMAN_LIMIT = 'Human identity, unfamiliarity, distinctness and raw-answer fidelity are facilitator attestations, not independently verified by automation.' class Blocked(ValueError): @@ -44,10 +41,6 @@ def sha(path): return hashlib.sha256(path.read_bytes()).hexdigest() -def digest(value): - return hashlib.sha256(json.dumps(value,sort_keys=True,separators=(',',':'),ensure_ascii=False).encode()).hexdigest() - - def read(path): return json.loads(path.read_text()) @@ -75,18 +68,6 @@ def dated(value): return False -def protocol_check(ready): - p=ready['protocol'] - need(p['status']=='CONFIRMED' and text(p['confirmation_source']), 'reader protocol awaits confirmation') - need(p['sample_size']==5 and p['minimum_successes_per_task']==4 and p['homepage_seconds']==20, - 'confirmed protocol requires five readers, four successes per task and a joint 20-second homepage task') - need(p['film']==FILM and text(p['film_selection']), 'Missing Column film selection is unresolved') - need(p['tasks']==['homepage_joint','film_missing_column','proof_activation'], 'all three confirmed reader tasks are required') - need(set(p['rater_criteria'])=={'subject','contact','missing_column','proof'} - and all(text(s) for s in p['rater_criteria'].values()), 'rater criteria must be recorded before the study') - return p - - def title_check(root, ready, source_root=None): t=ready['title'] need(t['target']==TITLE and t['project']=='Cubits11/ghost-visualizer' and t['source_status']=='prepared_local', 'precise title source preparation is missing') @@ -149,147 +130,25 @@ def phone_receipts(root): return receipts -class Resources(HTMLParser): - def __init__(self): - super().__init__(); self.paths=[] - def handle_starttag(self,tag,attrs): - a=dict(attrs) - for key in ('src','poster','data-phone-poster'): - if a.get(key): self.paths.append(a[key]) - if tag=='link' and a.get('rel')=='stylesheet' and a.get('href'): - self.paths.append(a['href']) - - -def binding_paths(root, ready, receipts): - slug=ready['protocol']['film'] - paths={'index.html','try/index.html',f'films/{slug}/index.html'} - # Bind what the participant sees, including every referenced local player - # rendition, poster, stylesheet, script and stylesheet font/image resource. - for name in list(paths): - if not name.endswith('index.html'): continue - parser=Resources(); parser.feed((root/name).read_text()) - for url in parser.paths: - parts=urlsplit(url) - if parts.scheme or parts.netloc or not parts.path: continue - path=unquote(parts.path) - relative=path.lstrip('/') if path.startswith('/') else str(Path(name).parent/path) - paths.add(confined(root,relative).relative_to(root.resolve()).as_posix()) - for name in list(paths): - if not name.endswith('.css'): continue - for url in re.findall(r'url\([\'"]?([^\)\'\"]+)',(root/name).read_text()): - if urlsplit(url).scheme or url.startswith('data:'): continue - relative=url.lstrip('/') if url.startswith('/') else str(Path(name).parent/url) - paths.add(confined(root,relative).relative_to(root.resolve()).as_posix()) - # Source, facts, manifests and receipt bookkeeping are checked separately - # by phone_receipts. Only changed participant-visible bytes require a new - # reader study; a fresh receipt for identical media does not. - return sorted(paths) - - -def current_binding(root,ready,receipts): - return {name:sha(confined(root,name)) for name in binding_paths(root,ready,receipts)} - - -def readers_check(root,ready,receipts): - p=protocol_check(ready) - readers=read(confined(root,ready['readers_path'])) - need(readers['schema_version']==1, 'unsupported reader-evidence schema') - participants=readers['participants'] - need(isinstance(participants,list) and len(participants)==5, f'five actual unfamiliar-reader records required; found {len(participants) if isinstance(participants,list) else "invalid"}') - need(ready['protocol_sha256']==readers['protocol_sha256']==digest(p), 'reader protocol binding is missing or drifted') - expected=current_binding(root,ready,receipts) - need(ready['artifact_sha256']==readers['artifact_sha256']==expected, 'tested artifacts are unbound or have changed since the reader test') - facilitator=readers['facilitator'] - need(text(facilitator['id']) and dated(facilitator['recorded_on']) - and all(facilitator.get(key) is True for key in ('attests_humans','attests_unfamiliar','attests_distinct')), - 'facilitator must attest five distinct unfamiliar humans; automation cannot establish this') - rater=readers['rater'] - need(text(rater['id']) and rater['criteria']==p['rater_criteria'], 'rater and pre-recorded criteria must be preserved') - identifiers=set(); counts={'homepage_joint':0,'film_missing_column':0,'proof_activation':0} - for participant in participants: - pid=participant['id'] - need(text(pid) and pid not in identifiers, 'reader identifiers must be distinct and nonempty') - identifiers.add(pid) - need(participant['kind']=='human' and participant['unfamiliar'] is True and dated(participant['recorded_at']), f'{pid}: agent, familiar or undated participant record') - home,film,proof=(participant[k] for k in ('homepage','film','proof')) - need(number(home['elapsed_seconds']) and all(text(home[k]) for k in ('subject_answer','contact_answer','rater_notes')) - and type(home['subject_pass']) is bool and type(home['contact_pass']) is bool, f'{pid}: homepage raw answers, elapsed time and ratings are required') - counts['homepage_joint']+=int(home['subject_pass'] and home['contact_pass'] and home['elapsed_seconds']<=20) - need(film['slug']==p['film'] and type(film['watched_full']) is bool and text(film['explanation']) - and type(film['one_sentence']) is bool and type(film['pass']) is bool and text(film['rater_notes']), f'{pid}: full named film, raw explanation and rating are required') - if 'elapsed_seconds' in film and film['elapsed_seconds'] is not None: - need(number(film['elapsed_seconds']),f'{pid}: optional film response time must be nonnegative') - counts['film_missing_column']+=int(film['watched_full'] and film['pass'] and film['one_sentence']) - need(type(proof['activation_count']) is int and proof['activation_count']>=0 and proof['method'] in ('keyboard','click','none') - and text(proof['destination']) and type(proof['pass']) is bool - and text(proof['observation']) and text(proof['rater_notes']), f'{pid}: proof activation observation and rating are required') - counts['proof_activation']+=int(proof['pass'] and proof['activation_count']==1 and proof['destination']=='/try/') - need(all(value>=4 for value in counts.values()), f'unfamiliar-reader gate failed: {counts}; each task requires four of five') - return counts - - def evaluate(root=ROOT, title_source=None): - root=root.resolve(); blockers=[]; counts=None + root=root.resolve(); blockers=[] try: ready=read(root/'publication/readiness.json') need(ready['schema_version']==1,'unsupported publication-readiness schema') except (Blocked,OSError,ValueError,KeyError,TypeError) as exc: - return {'status':'BLOCKED','blockers':[f'readiness record: {exc}'],'human_evidence_limit':HUMAN_LIMIT} - for label,check in (('protocol',lambda:protocol_check(ready)),('title',lambda:title_check(root,ready,title_source))): - try: check() - except (Blocked,OSError,ValueError,KeyError,TypeError) as exc: blockers.append(f'{label}: {exc}') - try: receipts=phone_receipts(root) - except (Blocked,OSError,ValueError,KeyError,TypeError) as exc: - blockers.append(f'phone films: {exc}'); receipts=None - # Missing participants is reported even while phone renders are unfinished. - try: - readers=read(confined(root,ready['readers_path'])) - need(isinstance(readers['participants'],list) and len(readers['participants'])==5, - f'five actual unfamiliar-reader records required; found {len(readers["participants"]) if isinstance(readers["participants"],list) else "invalid"}') - if receipts is not None: counts=readers_check(root,ready,receipts) - except (Blocked,OSError,ValueError,KeyError,TypeError) as exc: blockers.append(f'readers: {exc}') - return {'status':'BLOCKED' if blockers else 'READY','blockers':blockers,'reader_successes':counts,'human_evidence_limit':HUMAN_LIMIT} - - -def bind(root=ROOT): - """Pin the candidate before collection; never rebind existing observations.""" - ready=read(root/'publication/readiness.json'); protocol_check(ready) - readers_path=confined(root,ready['readers_path']); readers=read(readers_path) - need(readers['participants']==[], 'cannot rebind an existing reader study; record its result and start a dated new study') - receipts=phone_receipts(root) - ready['protocol_sha256']=readers['protocol_sha256']=digest(ready['protocol']) - ready['artifact_sha256']=readers['artifact_sha256']=current_binding(root,ready,receipts) - (root/'publication/readiness.json').write_text(json.dumps(ready,indent=2)+'\n') - readers_path.write_text(json.dumps(readers,indent=2)+'\n') - return readers - - -def template(root=ROOT): - ready=read(root/'publication/readiness.json'); data=copy.deepcopy(read(confined(root,ready['readers_path']))) - need(data['participants']==[], 'template is available only before observations are recorded') - data['rater']['criteria']=ready['protocol']['rater_criteria'] - data['participants']=[{'id':f'P{i:02d}','kind':None,'unfamiliar':None,'recorded_at':None, - 'homepage':{'elapsed_seconds':None,'subject_answer':'','contact_answer':'','subject_pass':None,'contact_pass':None,'rater_notes':''}, - 'film':{'slug':ready['protocol']['film'],'watched_full':None,'explanation':'','one_sentence':None,'pass':None,'rater_notes':'','elapsed_seconds':None}, - 'proof':{'activation_count':None,'method':None,'destination':'','pass':None,'observation':'','rater_notes':''}} - for i in range(1,6)] - return data + return {'status':'BLOCKED','blockers':[f'readiness record: {exc}']} + try: title_check(root,ready,title_source) + except (Blocked,OSError,ValueError,KeyError,TypeError) as exc: blockers.append(f'title: {exc}') + try: phone_receipts(root) + except (Blocked,OSError,ValueError,KeyError,TypeError) as exc: blockers.append(f'phone films: {exc}') + return {'status':'BLOCKED' if blockers else 'READY','blockers':blockers} def main(argv=None): parser=argparse.ArgumentParser(description=__doc__) parser.add_argument('--root',type=Path,default=ROOT) parser.add_argument('--title-source',type=Path,help='optional isolated external source directory to check prepared source hashes') - actions=parser.add_mutually_exclusive_group(); actions.add_argument('--bind',action='store_true',help='bind current artifacts before any reader observations') - actions.add_argument('--template',action='store_true',help='print an unfilled worksheet; never creates reader evidence') args=parser.parse_args(argv) - try: - if args.bind: - bind(args.root.resolve()); print('Candidate bound before collection. No reader evidence created.'); return 0 - if args.template: - print(json.dumps(template(args.root.resolve()),indent=2)); return 0 - except (Blocked,OSError,ValueError,KeyError,TypeError) as exc: - print(f'BLOCKED: {exc}'); return 2 report=evaluate(args.root,args.title_source) print(json.dumps(report,indent=2)) return 0 if report['status']=='READY' else 2 diff --git a/tests/test_publication_gate.py b/tests/test_publication_gate.py index 11a72bd..cd400df 100644 --- a/tests/test_publication_gate.py +++ b/tests/test_publication_gate.py @@ -1,4 +1,8 @@ -"""Synthetic publication records exercise the hold; they are not reader evidence.""" +"""Synthetic publication records exercise the title and phone-film checks. + +The five-reader requirement was retired by owner decision on 2026-11-13; one +case below holds that the gate no longer reads reader records. +""" import contextlib import copy import importlib.util @@ -11,6 +15,7 @@ ROOT=Path(__file__).resolve().parents[1] spec=importlib.util.spec_from_file_location('publication_gate',ROOT/'scripts/publication_gate.py') gate=importlib.util.module_from_spec(spec);spec.loader.exec_module(gate) +FILM='the-missing-column-census' def write(path,value): @@ -30,30 +35,24 @@ def setUp(self): 'verified_source_sha256':{k:self.ready['title']['source_sha256'][k] for k in ('index.html','src/components/CinematicShell.tsx')}, 'verified_by':'SYNTHETIC TEST FIXTURE','verified_on':'2026-10-17', - 'limit':gate.HUMAN_LIMIT} + 'limit':'Synthetic fixture; not an owner attestation.'} patch=(ROOT/self.ready['title']['patch']).read_bytes() (self.root/'publication').mkdir() (self.root/self.ready['title']['patch']).write_bytes(patch) self.ready['title']['patch_sha256']=gate.sha(self.root/self.ready['title']['patch']) for name,content in { - 'assets/site.css':"body{font:16px sans-serif} @font-face{src:url('fonts/test.woff2')}", - 'assets/site.js':'/* synthetic fixture */','assets/fonts/test.woff2':'synthetic font fixture', - 'index.html':'<link rel="stylesheet" href="/assets/site.css"><script src="/assets/site.js"></script><p>Synthetic homepage fixture</p>', - 'try/index.html':'<link rel="stylesheet" href="/assets/site.css"><p>Synthetic proof fixture</p>', 'films/lib/film.js':'/* synthetic runtime */','films/lib/tokens.css':'/* synthetic tokens */', 'films/data/facts.json':json.dumps({'facts':{'SYNTHETIC.read':{'value':[14,20]},'SYNTHETIC.unread':{'value':5}}}), }.items(): path=self.root/name;path.parent.mkdir(parents=True,exist_ok=True);path.write_text(content) slugs=list(gate.read(ROOT/'films/curation.json')['films']) + self.assertIn(FILM,slugs) write(self.root/'films/curation.json',{'films':{s:{'phone_composition':True} for s in slugs}}) for slug in slugs: folder=self.root/'films'/slug;folder.mkdir() (folder/'manifest.yaml').write_text('render:\n formats: [vertical]\n') (folder/'film.html').write_text('<p>Synthetic film source fixture</p>') - (folder/'index.html').write_text(f'<link rel="stylesheet" href="/assets/site.css"><video poster="/films/{slug}/renders/{slug}__master.poster.png" data-phone-poster="/films/{slug}/renders/{slug}__vertical.poster.png"><source src="/films/{slug}/renders/{slug}__vertical.mp4"><source src="/films/{slug}/renders/{slug}__master.mp4"></video>') video=folder/'renders'/f'{slug}__vertical.mp4';video.parent.mkdir();video.write_bytes(b'synthetic unit-test byte fixture, not a rendered film') - for suffix in ('master.mp4','master.poster.png','vertical.poster.png'): - (folder/'renders'/f'{slug}__{suffix}').write_bytes(b'synthetic visible asset fixture') receipt={'film':slug,'format':'vertical','width':1080,'height':1920, 'phone_text':{'media_width_css_px':280,'minimum_css_px':14,'minimum_canvas_px':54,'audited_draws':10}, 'determinism':{'identical':True},'text_overflows':[], @@ -64,144 +63,26 @@ def setUp(self): 'outputs':{'master':str(video.relative_to(folder)),'master_sha256':gate.sha(video)}} write(folder/'renders'/f'{slug}__vertical.receipt.json',receipt) self.save_ready() - readers={'schema_version':1,'protocol_sha256':None,'artifact_sha256':{}, - 'facilitator':{'id':None,'attests_humans':False,'attests_unfamiliar':False,'attests_distinct':False,'recorded_on':None}, - 'rater':{'id':None,'criteria':{}},'participants':[]} - write(self.root/'publication/readers.json',readers) - gate.bind(self.root) - self.ready=gate.read(self.root/'publication/readiness.json') - self.readers=gate.template(self.root) - self.readers['facilitator']={'id':'SYNTHETIC-FACILITATOR','attests_humans':True,'attests_unfamiliar':True,'attests_distinct':True,'recorded_on':'2026-10-17'} - self.readers['rater']['id']='SYNTHETIC-RATER' - for reader in self.readers['participants']: - reader.update(kind='human',unfamiliar=True,recorded_at='2026-10-17T12:00:00-04:00') - reader['homepage']={'elapsed_seconds':20,'subject_answer':'Synthetic raw answer: AI guardrail scores and overlapping failures.','contact_answer':'Synthetic raw answer: displayed email link.','subject_pass':True,'contact_pass':True,'rater_notes':'Synthetic fixture matched the pre-recorded criteria.'} - reader['film']={'slug':gate.FILM,'watched_full':True,'explanation':'Synthetic answer: most evaluations, 14 of 20, do not record what happened to both guards on the same item.','one_sentence':True,'pass':True,'rater_notes':'Synthetic fixture matched the pre-recorded criteria.','elapsed_seconds':90} - reader['proof']={'activation_count':1,'method':'keyboard','destination':'/try/','pass':True,'observation':'Synthetic observation: activated the below-player link once and reached /try/.','rater_notes':'Synthetic fixture matched the pre-recorded criteria.'} - self.save_readers() def save_ready(self): write(self.root/'publication/readiness.json',self.ready) - def save_readers(self): write(self.root/'publication/readers.json',self.readers) def check(self): return gate.evaluate(self.root) def blocked(self,phrase): report=self.check();self.assertEqual(report['status'],'BLOCKED');self.assertTrue(any(phrase in b for b in report['blockers']),report) - def test_complete_synthetic_records_can_satisfy_record_gate(self): - report=self.check();self.assertEqual(report['status'],'READY',report) - self.assertEqual(report['reader_successes'],{'homepage_joint':5,'film_missing_column':5,'proof_activation':5}) - self.assertIn('not independently verified by automation',report['human_evidence_limit']) + def test_complete_synthetic_records_satisfy_the_gate(self): + report=self.check();self.assertEqual(report['status'],'READY',report);self.assertEqual(report['blockers'],[]) - def test_four_of_five_passes_each_task(self): - reader=self.readers['participants'][0] - reader['homepage']['subject_pass']=False;reader['film']['pass']=False;reader['proof']['pass']=False - self.save_readers();self.assertEqual(self.check()['status'],'READY') + def test_reader_records_are_not_required(self): + self.assertFalse((self.root/'publication/readers.json').exists()) + self.assertEqual(self.ready['reader_test']['status'],'retired') + self.assertEqual(self.check()['status'],'READY') - def test_missing_readers_blocks_and_cli_exits_two(self): - self.readers['participants']=[];self.save_readers();self.blocked('five actual unfamiliar-reader') + def test_blocked_gate_exits_two(self): + path=self.root/'films/curation.json';data=gate.read(path);data['films'][FILM]['phone_composition']=False;write(path,data) with contextlib.redirect_stdout(io.StringIO()) as output: code=gate.main(['--root',str(self.root)]) self.assertEqual(code,2);self.assertIn('BLOCKED',output.getvalue()) - def test_homepage_requires_joint_success_not_separate_four_of_fives(self): - self.readers['participants'][0]['homepage']['subject_pass']=False - self.readers['participants'][1]['homepage']['contact_pass']=False - self.save_readers();self.blocked('gate failed') - - def test_two_homepage_timeouts_fail_even_with_correct_answers(self): - for reader in self.readers['participants'][:2]:reader['homepage']['elapsed_seconds']=20.01 - self.save_readers();self.blocked('gate failed') - - def test_film_explanation_has_no_invented_twenty_second_cutoff(self): - for reader in self.readers['participants']:reader['film']['elapsed_seconds']=1000 - self.save_readers();self.assertEqual(self.check()['status'],'READY') - - def test_failed_explanations_block(self): - for reader in self.readers['participants'][:2]:reader['film']['pass']=False - self.save_readers();self.blocked('gate failed') - - def test_multiple_sentence_answers_do_not_count_as_successes(self): - for reader in self.readers['participants'][:2]:reader['film']['one_sentence']=False - self.save_readers();self.blocked('gate failed') - - def test_one_incomplete_film_counts_as_a_failure_without_discarding_the_reader(self): - self.readers['participants'][0]['film']['watched_full']=False - self.readers['participants'][0]['film']['pass']=False - self.save_readers();report=self.check();self.assertEqual(report['status'],'READY');self.assertEqual(report['reader_successes']['film_missing_column'],4) - - def test_one_observed_no_activation_is_preserved_as_a_failure(self): - self.readers['participants'][0]['proof'].update(method='none',activation_count=0,destination='NOT_REACHED',**{'pass':False}) - self.save_readers();report=self.check();self.assertEqual(report['status'],'READY');self.assertEqual(report['reader_successes']['proof_activation'],4) - - def test_wrong_film_is_not_substituted(self): - self.readers['participants'][0]['film']['slug']='the-missing-column-trailer' - self.save_readers();self.blocked('full named film') - - def test_two_proof_activations_do_not_count_as_one(self): - for reader in self.readers['participants'][:2]:reader['proof']['activation_count']=2 - self.save_readers();self.blocked('gate failed') - - def test_foreign_try_destination_does_not_count(self): - for reader in self.readers['participants'][:2]:reader['proof']['destination']='https://example.com/try/' - self.save_readers();self.blocked('gate failed') - - def test_agent_is_rejected_even_when_labeled_as_a_pass(self): - self.readers['participants'][0]['kind']='agent';self.save_readers();self.blocked('agent, familiar or undated') - - def test_duplicate_reader_ids_are_rejected(self): - self.readers['participants'][1]['id']=self.readers['participants'][0]['id'];self.save_readers();self.blocked('identifiers must be distinct') - - def test_familiar_reader_is_rejected(self): - self.readers['participants'][0]['unfamiliar']=False;self.save_readers();self.blocked('agent, familiar or undated') - - def test_unknown_reader_schema_is_not_accepted(self): - self.readers['schema_version']=99;self.save_readers();self.blocked('unsupported reader-evidence schema') - - def test_facilitator_attestation_is_required(self): - self.readers['facilitator']['attests_humans']=False;self.save_readers();self.blocked('facilitator must attest') - - def test_raw_answers_cannot_be_replaced_by_grades(self): - self.readers['participants'][0]['homepage']['subject_answer']='';self.save_readers();self.blocked('raw answers') - - def test_rater_criteria_cannot_drift(self): - self.readers['rater']['criteria']['missing_column']='Any positive reaction passes.';self.save_readers();self.blocked('pre-recorded criteria') - - def test_tested_css_drift_requires_a_new_study(self): - (self.root/'assets/site.css').write_text('body{font-size:4px}');self.blocked('tested artifacts are unbound or have changed') - - def test_tested_html_drift_requires_a_new_study(self): - (self.root/'index.html').write_text('<p>Different visible homepage</p>');self.blocked('tested artifacts are unbound or have changed') - - def test_tested_video_drift_blocks_even_when_its_receipt_is_fresh(self): - folder=self.root/'films'/gate.FILM - video=folder/'renders'/f'{gate.FILM}__vertical.mp4';video.write_bytes(b'different visible film') - path=folder/'renders'/f'{gate.FILM}__vertical.receipt.json';receipt=gate.read(path);receipt['outputs']['master_sha256']=gate.sha(video);write(path,receipt) - self.blocked('tested artifacts are unbound or have changed') - - def test_phone_poster_drift_is_bound_even_when_selected_by_script(self): - (self.root/'films'/gate.FILM/'renders'/f'{gate.FILM}__vertical.poster.png').write_bytes(b'different visible poster') - self.blocked('tested artifacts are unbound or have changed') - - def test_receipt_and_manifest_bookkeeping_do_not_require_new_readers(self): - folder=self.root/'films'/gate.FILM - path=folder/'renders'/f'{gate.FILM}__vertical.receipt.json';receipt=gate.read(path);receipt['rendered_on']='2026-10-18';write(path,receipt) - (folder/'manifest.yaml').write_text('render:\n formats: [vertical]\n# Bookkeeping comment; visible film unchanged.\n') - self.assertEqual(self.check()['status'],'READY') - - def test_fresh_source_binding_for_identical_visible_media_keeps_reader_binding(self): - folder=self.root/'films'/gate.FILM - (folder/'film.html').write_text('<p>Synthetic film source fixture</p><!-- harmless source comment -->') - path=folder/'renders'/f'{gate.FILM}__vertical.receipt.json';receipt=gate.read(path);receipt['inputs']['film.html']=gate.sha(folder/'film.html');write(path,receipt) - self.assertEqual(self.check()['status'],'READY') - - def test_protocol_drift_invalidates_existing_results(self): - self.ready['protocol']['rater_criteria']['subject']='Any answer passes.';self.save_ready();self.blocked('protocol binding') - - def test_rebinding_collected_results_is_refused(self): - with self.assertRaisesRegex(gate.Blocked,'cannot rebind an existing reader study'):gate.bind(self.root) - - def test_unconfirmed_protocol_blocks(self): - self.ready['protocol']['status']='PENDING';self.save_ready();self.blocked('awaits confirmation') - def test_local_title_preparation_does_not_claim_public_title_changed(self): self.ready['title']['public_application']['status']='public_not_updated';self.save_ready();self.blocked('public title application is still pending') @@ -212,22 +93,22 @@ def test_reviewable_title_patch_must_keep_its_hash(self): (self.root/self.ready['title']['patch']).write_text('placeholder');self.blocked('external title patch changed') def test_phone_composition_must_be_finished_for_all_twelve(self): - path=self.root/'films/curation.json';data=gate.read(path);data['films'][gate.FILM]['phone_composition']=False;write(path,data);self.blocked('phone composition is unfinished') + path=self.root/'films/curation.json';data=gate.read(path);data['films'][FILM]['phone_composition']=False;write(path,data);self.blocked('phone composition is unfinished') def test_phone_receipt_requires_actual_font_audit(self): - path=self.root/'films'/gate.FILM/'renders'/f'{gate.FILM}__vertical.receipt.json';data=gate.read(path);data.pop('phone_text');write(path,data);self.blocked('14px text audit') + path=self.root/'films'/FILM/'renders'/f'{FILM}__vertical.receipt.json';data=gate.read(path);data.pop('phone_text');write(path,data);self.blocked('14px text audit') def test_small_phone_type_is_rejected(self): - path=self.root/'films'/gate.FILM/'renders'/f'{gate.FILM}__vertical.receipt.json';data=gate.read(path);data['phone_text'].update(minimum_css_px=13,minimum_canvas_px=13*1080/280);write(path,data);self.blocked('14px text audit') + path=self.root/'films'/FILM/'renders'/f'{FILM}__vertical.receipt.json';data=gate.read(path);data['phone_text'].update(minimum_css_px=13,minimum_canvas_px=13*1080/280);write(path,data);self.blocked('14px text audit') def test_phone_pixel_equivalence_is_required(self): - path=self.root/'films'/gate.FILM/'renders'/f'{gate.FILM}__vertical.receipt.json';data=gate.read(path);data['capture']['pixel_equivalent']=False;write(path,data);self.blocked('five passing canvas/browser equivalence samples') + path=self.root/'films'/FILM/'renders'/f'{FILM}__vertical.receipt.json';data=gate.read(path);data['capture']['pixel_equivalent']=False;write(path,data);self.blocked('five passing canvas/browser equivalence samples') def test_five_pixel_equivalence_samples_are_required(self): - path=self.root/'films'/gate.FILM/'renders'/f'{gate.FILM}__vertical.receipt.json';data=gate.read(path);data['capture']['pixel_equivalence_samples']=4;write(path,data);self.blocked('five passing canvas/browser equivalence samples') + path=self.root/'films'/FILM/'renders'/f'{FILM}__vertical.receipt.json';data=gate.read(path);data['capture']['pixel_equivalence_samples']=4;write(path,data);self.blocked('five passing canvas/browser equivalence samples') def test_phone_source_drift_is_rejected(self): - (self.root/'films'/gate.FILM/'film.html').write_text('changed source');self.blocked('stale phone receipt input') + (self.root/'films'/FILM/'film.html').write_text('changed source');self.blocked('stale phone receipt input') def set_fact(self,fid,value): path=self.root/'films/data/facts.json';doc=gate.read(path);doc['facts'][fid]['value']=value;write(path,doc) @@ -239,12 +120,12 @@ def test_a_fact_the_phone_cut_never_read_does_not_stale_it(self): self.set_fact('SYNTHETIC.unread',6);self.assertEqual(self.check()['status'],'READY') def test_whole_file_facts_receipt_is_refused(self): - path=self.root/'films'/gate.FILM/'renders'/f'{gate.FILM}__vertical.receipt.json';data=gate.read(path) + path=self.root/'films'/FILM/'renders'/f'{FILM}__vertical.receipt.json';data=gate.read(path) data.pop('facts_subset');data['inputs']['films/data/facts.json']=gate.sha(self.root/'films/data/facts.json');write(path,data) self.blocked('input bindings are incomplete') def test_phone_video_drift_is_rejected(self): - (self.root/'films'/gate.FILM/'renders'/f'{gate.FILM}__vertical.mp4').write_bytes(b'changed');self.blocked('video bytes differ') + (self.root/'films'/FILM/'renders'/f'{FILM}__vertical.mp4').write_bytes(b'changed');self.blocked('video bytes differ') def test_deployment_guard_precedes_pages_configuration_and_upload(self): workflow=(ROOT/'.github/workflows/verify.yml').read_text().split('\n deploy:\n',1)[1].split('\n deployed:\n',1)[0]