#!/usr/bin/env python3 """Route 140's census, take 3: every 64-hex literal in the served scripts, classified with its line quoted. Take 1 reported `self_pin: 0` for 429 files that each carry two self-pins, and its "comparison" evidence was a banner rule line -- both artefacts of the classifier, not facts about the corpus. Take 2 counted the provenance headers correctly (441 `code-sha256` + 441 `out-sha256` over 429 files) but never asked the question the route asks. This take separates the three roles the route names, and it does so by the LINE it found the constant on: self_provenance the constant is the value of `code-sha256:` / `out-sha256:` / `tree-sha256:` / `body-sha256:` in the file's own tail declared_input the constant pins a NAMED document (`path@sha`, `sha256=` with a path on the same line) -- a declaration about a document compared_in_code a non-comment line computes or holds a digest and compares it (`===`, `!==`, `assert`, `throw`, `if`), i.e. the script's own control rather than a note citation anything else: prose, a comment naming another artifact, a link Only `compared_in_code` is the object of the route, and the gate the brief sets is that the line is quoted for every classification, so a reader can disagree with the parse rather than with the number. usage: census3.py [--out dir] """ import argparse import hashlib import json import os import re import sys sys.stdout.reconfigure(encoding="utf-8", errors="replace") HERE = os.path.dirname(os.path.abspath(__file__)) RUN = os.path.dirname(HERE) CACHE = os.path.join(RUN, "job128", "cache") LIST = os.path.join(RUN, "job128", "docs-list.txt") EXTS = (".py", ".js", ".mjs", ".sh", ".ts", ".cjs", ".cjs.js") HEX = re.compile(r"\b([0-9a-f]{64})\b", re.I) COMMENT_LEADER = re.compile(r"^\s*(#|//|\*|/\*|