Stop a stale server from answering for this tree

The smoke script's build fingerprint asserted on the MCP reply, but the Go
layer decodes the HTTP answer into its own struct and re-emits a missing field
as zero, so a server from before the memory tiers still passed. Point the
fingerprint at the Python answer instead: /api/memory/working answers 404 on
4c6af87 and 200 here, both measured by starting each build myself.

Record the miss side of the rename rule. Whether a bare number renames its
subject depends on that memory's own sentence, so 「温度」 and 「温度24」 never
compare and an update goes unnoticed; both memories stay on the answer page,
so the miss costs a notice rather than a wrong number. Pin it with a test and
keep the mechanism, since comparing an unrenamed subject as a fallback would
put room numbers back in the ring as readings.

Correct the direction of the rule in the record: the rename slot is the token
after the subject word, not before it. A leading number becomes the subject
rather than fusing forward, which 「3 room holds 22 degrees」 shows by taking
「3」 as its subject.

门禁:pytest 384 passed;六文件 83(conflicts 27);三文件 35;ruff clean;
filesize clean;audit 32/2/6 clean;mypy 冷缓存 24 errors / 9 files(净 0);
pyright 0;go 全套 + gofmt 空;npm 产物未变;smoke PASS。
This commit is contained in:
ZacharyZhang-NY committed 2026-10-09 12:54:06 -04:00
1 parent 11e31eb7e3
commit 3d131e6a7e
3 files changed
+31 -5

No files matched your search

+14 -2
View File
@@ -61,6 +61,18 @@ if [ "$ready" -ne 1 ]; then
exit 1
fi
# Fingerprint the answering build where the fields actually come from: the Python answer itself.
# /api/memory/working exists only on builds that carry the memory tiers, so a server left over from
# an older tree answers 404 here. Checking the MCP reply instead would prove nothing — the Go layer
# decodes into its own struct and re-emits a missing field as 0, so an old server still passes.
status="$(curl -s -o /dev/null -w '%{http_code}' \
"http://127.0.0.1:${port}/api/memory/working?holder=fingerprint&session=probe")"
if [ "$status" != "200" ]; then
echo "FAIL: port ${port} answers /api/status but returns HTTP $status for /api/memory/working;"
echo " the server on it predates the memory tiers — stop it and re-run"
exit 1
fi
# The gate, proved before anything else: a query needs nothing, a write needs the token.
status="$(curl -s -o "$home/refused.json" -w '%{http_code}' -X POST "http://127.0.0.1:${port}/api/memory" \
-H 'content-type: application/json' -d '{"text":"a write with no token"}')"
@@ -174,8 +186,8 @@ statement = "keys are in the hall drawer"
remembered = tool("remember", {"text": statement, "scenario": "home"})["atom"]
if "recall_count" not in remembered:
raise SystemExit(
"FAIL: the API answered with no recall_count; a server left over from before the memory tiers "
"took the port after our guard passed — stop it and re-run"
"FAIL: the MCP reply carries no recall_count; the Go binary is not built from this tree — "
"the server's own build is proved above, this proves the other half of the path"
)
if not remembered["holder_id"]:
raise SystemExit(f"FAIL: the server stamped no holder: {remembered}")