Bloomboff original local demonstration, 21 November 2026. No third-party service was tested. The repeating a/b identifiers are synthetic fixtures, not real repository commits.
Save the complete code below as check_build.py. Run python3 check_build.py demo. It starts a temporary loopback-only fixture server, prints four results and closes it. Python 3 is required; no extra packages.
For your own authorized endpoint: python3 check_build.py https://your-host/version.json YOUR_40_CHARACTER_COMMIT. Replace both placeholders. The endpoint must return a JSON object containing a lowercase 40-hex-character commit string. This deliberately narrow example does not support other identifier formats. Build that marker into the artifact in CI; do not fill it from a mutable startup environment variable.
The demo prints checker return codes and itself exits 0. Separately, we ran the URL command as four subprocesses against controlled fixtures and recorded these actual process exits:
| Case | Expected exit | Observed exit | Actual stdout |
|---|---|---|---|
| match | 0 | 0 | MATCH expected=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa observed=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
| mismatch | 1 | 1 | MISMATCH expected=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa observed=bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb |
| unavailable | 2 | 2 | UNRESOLVED HTTPError |
| missing | 2 | 2 | UNRESOLVED missing or malformed commit |
A matching self-reported marker is not cryptographic proof of the running binary. This checks one HTTP response from one route at one time, not every replica, edge cache, backend, model or wallet signing component. A no-cache request header is a request, not proof that all intermediaries revalidated. Redirects may be followed. Deployment signing, immutable digests, correct route selection and authorization need separate controls. A 503 or malformed marker does not prove a wrong build. TLS and network failures also return unresolved. The five-second timeout is per blocking operation, not a guaranteed total execution deadline.
#!/usr/bin/env python3
"""Bloomboff original build-marker check. Python 3; no dependencies.
Use: python3 check_build.py demo
Or: python3 check_build.py https://your-host/version.json EXPECTED_COMMIT
Only query endpoints you own or are authorized to check.
"""
import json
import re
import sys
import threading
import urllib.request
from http.server import BaseHTTPRequestHandler, HTTPServer
def check(url, expected):
if not re.fullmatch(r"[0-9a-f]{40}", expected):
return "UNRESOLVED invalid expected commit", 2
if not url.startswith(("https://", "http://")):
return "UNRESOLVED use HTTP or HTTPS", 2
try:
request = urllib.request.Request(url, headers={"Cache-Control": "no-cache"})
with urllib.request.urlopen(request, timeout=5) as response:
if response.status != 200:
return "UNRESOLVED non-200 response", 2
raw = response.read(4097)
if len(raw) > 4096:
return "UNRESOLVED response too large", 2
payload = json.loads(raw)
observed = payload.get("commit") if isinstance(payload, dict) else None
if not isinstance(observed, str) or not re.fullmatch(r"[0-9a-f]{40}", observed):
return "UNRESOLVED missing or malformed commit", 2
except Exception as error:
return "UNRESOLVED " + type(error).__name__, 2
state, exit_code = ("MATCH", 0) if observed == expected else ("MISMATCH", 1)
return state + " expected=" + expected + " observed=" + observed, exit_code
def demo():
expected = "a" * 40
class Fixture(BaseHTTPRequestHandler):
def do_GET(self):
if self.path == "/unavailable":
self.send_error(503)
return
values = {"/match": expected, "/mismatch": "b" * 40}
data = json.dumps({"commit": values[self.path]} if self.path in values else {}).encode()
self.send_response(200)
self.send_header("Content-Type", "application/json")
self.send_header("Content-Length", str(len(data)))
self.end_headers()
self.wfile.write(data)
def log_message(self, *args):
pass
server = HTTPServer(("127.0.0.1", 0), Fixture)
worker = threading.Thread(target=server.serve_forever, daemon=True)
worker.start()
try:
for route in ("match", "mismatch", "unavailable", "missing"):
message, status = check("http://127.0.0.1:" + str(server.server_port) + "/" + route, expected)
print(route + ": " + message + " | exit=" + str(status))
finally:
server.shutdown()
server.server_close()
worker.join()
if __name__ == "__main__":
if sys.argv[1:] == ["demo"]:
demo()
elif len(sys.argv) == 3:
message, status = check(sys.argv[1], sys.argv[2])
print(message)
sys.exit(status)
else:
print("Usage: python3 check_build.py demo OR python3 check_build.py URL EXPECTED_COMMIT")
sys.exit(2)
Original code and graphic: Bloomboff. You may copy, modify and redistribute this example without warranty. Documentation checked: Python urllib.request.
This is the existing experiment first run on 21 November 2026 at 04:46 UTC, described in the article’s November 23 update. The unchanged code was rerun on loopback on 23 November to check this copyable package. It is not a new experiment or a test of any external service.
Save the checker above as check_build.py and the exact fixture below as experiment.py, in the same directory. Run:
python3 experiment.py
Python 3 and its standard library are sufficient. The fixture binds only to 127.0.0.1, chooses an available port and closes its server afterwards. It calls the checker for /a/version.json and /b/version.json, then hashes the distinct /a/page and /b/page response bodies. These checker return codes are function results, not separate subprocess exits. The experiment command exits 0 after its assertions pass.
| Route | Marker result | Checker code | Response-body SHA-256 |
|---|---|---|---|
| /a | MATCH | 0 | 599a7e84b761333be279213c16ca5652ab4c4961e55e1ab05e7653dd47d56f01 |
| /b | MATCH | 0 | 0c4eb38e3c1115f8bd1f24b71c0709987a800f50b1d86b5c6416f45ba76a1556 |
Both expected and observed markers contain forty lowercase a characters. Route A serves <h1>Version A</h1>\n; route B serves <h1>Version B</h1>\n. Here \n denotes one newline byte, not a literal backslash and n. The timestamp, Python version and temporary port are environment-dependent; the static response-body digests above are reproducible.
import hashlib,json,sys,threading,urllib.request,datetime
from http.server import BaseHTTPRequestHandler,HTTPServer
from check_build import check
MARKER='a'*40
BODIES={'/a/page':b'<h1>Version A</h1>\n','/b/page':b'<h1>Version B</h1>\n'}
class Fixture(BaseHTTPRequestHandler):
def do_GET(self):
data=json.dumps({'commit':MARKER}).encode() if self.path in ('/a/version.json','/b/version.json') else BODIES.get(self.path)
if data is None:self.send_error(404);return
self.send_response(200);self.send_header('Content-Length',str(len(data)));self.end_headers();self.wfile.write(data)
def log_message(self,*args):pass
server=HTTPServer(('127.0.0.1',0),Fixture);worker=threading.Thread(target=server.serve_forever,daemon=True);worker.start()
try:
rows=[]
for name in ('a','b'):
base='http://127.0.0.1:'+str(server.server_port)+'/'+name
result,code=check(base+'/version.json',MARKER)
with urllib.request.urlopen(base+'/page',timeout=5)as r:body=r.read()
rows.append({'endpoint':name,'markerResult':result,'exitCode':code,'body':body.decode(),'bodySHA256':hashlib.sha256(body).hexdigest()})
assert all(r['exitCode']==0 for r in rows) and rows[0]['bodySHA256']!=rows[1]['bodySHA256']
print(json.dumps({'observedAtUTC':datetime.datetime.now(datetime.timezone.utc).isoformat(),'python':sys.version,'fixture':'Two routes on one loopback server, synthetic identical commit marker, intentionally different static page bodies','results':rows,'scope':'Marker agreement does not establish identical served bytes. Response digest alone is not trusted artifact attestation; dynamic pages can differ legitimately. No third-party service tested.'},indent=2))
finally:server.shutdown();server.server_close();worker.join()
check_build.py: baedd100782936e3d7e3995d291b220756a2288082b3af1b1c120492dfd785e9 experiment.py: 5113412a0486e3db789fe2f97ced023bc77c6650d3f61ea0b46fa78894f9fd68
A matching self-reported marker does not establish identical served bytes. A response digest alone is not trusted artifact attestation: it needs an independently trusted expected artifact and a suitable comparison. Dynamic pages can legitimately differ. No commercial platform, wallet or external service was tested.