fix(u6): fold the cold code-review panel — four-arm convergence on three surface clauses
/heid-code-review panel 01M35CK8YKEKMV7T15JXEF6A8N, verdict NOT drift-zero. Three findings arrived from all four arms independently, and they share a shape: a contract clause written as prose and never converted into an assertion. That is the lens working. - The panel dropped the added date the contract promised to show. - `bench ls` printed no ids, and the URL it printed was truncated to 52 columns so the line was not pasteable into `bench state|rm`. The test's docstring claimed it printed ids and asserted nothing of the kind. - `bench import` printed the description instead of the raw URL beside each normalized id, hiding the collapse the clause exists to expose. - An IPv6 literal lost its brackets: http://[::1]:8080/a normalized to http://::1:8080/a, a broken identity that no re-post can match. Bracketed literals are re-wrapped; an unbracketed one is refused rather than guessed. - A deeply-nested JSON RecursionError escaped read_benches' except pair. The byte cap does not help -- 200k open brackets is 200 KB. - An empty board hid the whole benches panel, registration form included. - The link refusal classified by captured-text emptiness, which bash can erase; it now answers with a B:/N sentinel so no name reads as "not a booth". INV-4's tie-break falsifier could not fail: _write_all serializes with sort_keys=True, so both insertion orders came back already id-sorted and removing the tie-break left the test green. It now calls order_benches directly. Same class as the five vacuous U4 falsifiers, found by a cold reader rather than by us. Also from the arms' per-invariant vacuity pass: INV-6 had no vector pinning a non-default port as part of the identity; INV-3 asserted only that links/ was absent; INV-8's hashed sequence omitted a read verb; INV-9's AST walk is defeated by a string import. All closed. Contract amended where the code was right: `updated` means last mutation, the id cap is write-only because the id is the locator controls post back, INV-8's file list includes the lock sidecar it always mandated. Every line number is out of the prose -- the panel found two already stale. 565 -> 593 tests. Nothing declined.
This commit is contained in:
+32
-3
@@ -218,12 +218,20 @@ booth_src() {
|
||||
# the board's dead-row marker and `bench import` use that same function and a
|
||||
# second implementation in the shell would classify the host-agnostic and
|
||||
# percent-encoded cases differently (INV-2).
|
||||
# Prints `B:<name>` for a booth URL and `N` for anything else.
|
||||
#
|
||||
# A SENTINEL, NOT AN EMPTY STRING. Command substitution strips trailing
|
||||
# newlines, so a predicate that answers with the bare name cannot distinguish
|
||||
# "not a booth" from "a booth whose name bash just erased" — and the guard
|
||||
# then fails OPEN on that edge, which is the one direction a guard must never
|
||||
# fail. The prefix makes the answer unambiguous whatever the name contains.
|
||||
booth_target_of() {
|
||||
BOOTH_SRC="$(booth_src)" BOOTH_Q="$1" python3 -c '
|
||||
import os, sys
|
||||
sys.path.insert(0, os.environ["BOOTH_SRC"])
|
||||
from booth.links import booth_target # stdlib only — no venv needed
|
||||
sys.stdout.write(booth_target(os.environ["BOOTH_Q"]) or "")
|
||||
name = booth_target(os.environ["BOOTH_Q"])
|
||||
sys.stdout.write("N" if name is None else "B:" + name)
|
||||
'
|
||||
}
|
||||
|
||||
@@ -344,6 +352,13 @@ case "$cmd" in
|
||||
} >&2
|
||||
exit 3
|
||||
fi
|
||||
case "$refused_name" in
|
||||
N) refused_name="" ;;
|
||||
B:*) refused_name="${refused_name#B:}" ;;
|
||||
*)
|
||||
echo "booth link: the booth check answered something unrecognised; nothing was posted." >&2
|
||||
exit 3 ;;
|
||||
esac
|
||||
if [ -n "$refused_name" ]; then
|
||||
{
|
||||
echo "booth link: that is a booth, and a booth announces itself now."
|
||||
@@ -463,7 +478,12 @@ def die(msg, code=2):
|
||||
def row(b):
|
||||
# ONE LINE PER BENCH, in the rendered order — state first, so a retired
|
||||
# bench sinks, then name, then id as a total tie-break (INV-4).
|
||||
return "%-9s %-28s %-52s %s" % (b.state, b.name[:28], b.url[:52], b.owner)
|
||||
# THE ID IS PRINTED WHOLE AND UNTRUNCATED, because it is the locator
|
||||
# `bench state` and `bench rm` take: a truncated one is not an id, it is a
|
||||
# string that looks like one and silently addresses nothing. The name and
|
||||
# the added date are the truncatable columns.
|
||||
return "%-9s %-10s %-16s %-24s %s" % (
|
||||
b.state, b.added[:10], b.owner[:16], b.name[:24], b.id)
|
||||
|
||||
if sub == "add":
|
||||
if len(argv) < 2: die("bench add <url> <name>")
|
||||
@@ -478,6 +498,9 @@ elif sub == "ls":
|
||||
die("the registry could not be read: %s" % err, 3)
|
||||
if not benches:
|
||||
print("no benches registered yet")
|
||||
else:
|
||||
print("%-9s %-10s %-16s %-24s %s"
|
||||
% ("STATE", "ADDED", "OWNER", "NAME", "ID (pass to state|rm)"))
|
||||
for b in benches:
|
||||
print(row(b))
|
||||
elif sub in ("state", "rm"):
|
||||
@@ -518,7 +541,13 @@ elif sub == "import":
|
||||
print("CANDIDATES — would be registered (%d rows, %d distinct):"
|
||||
% (len(candidates), len({i for i, _ in candidates})))
|
||||
for i, e in candidates:
|
||||
print(" %-52s %s" % (i, e["desc"][:60]))
|
||||
# THE NORMALIZED ID BESIDE THE RAW URL, which is the whole point of the
|
||||
# proposal: five rows of `talk` collapsing to one is only visible if you
|
||||
# can see which five raw URLs produced the one id. The description is
|
||||
# the thing to drop here, not the URL.
|
||||
print(" %-52s %s" % (i, e["url"]))
|
||||
if e["desc"]:
|
||||
print(" %-52s %s" % ("", e["desc"][:70]))
|
||||
print()
|
||||
print("REFUSED — normalization said no (%d):" % len(refused))
|
||||
for e, why in refused:
|
||||
|
||||
Reference in New Issue
Block a user