trust-factor W re-measurement: contention-safe sweep harness - #415
Conversation
…40 caps Second invisible-failure vector for the trust-factor sweep (issue #368 follow-up): a neighboring session sharing this machine reported that leaked throwaway SQLite test databases (226-357 MB/run) filled the host disk to 100% on 2026-08-09, taking PostgreSQL down and starving even the Bash tool's own stdout file. A cell can finish cleanly and still return degraded numbers because its volume filled under it -- the same failure shape as CPU contention, a different resource, and it left no more trace in the artifact than contention did. Fix: benchmarks/lib/disk_space_snapshot.py (new) -- free/total bytes on the repo-root filesystem and, best-effort, Docker's storage root, via shutil.disk_usage + `docker info`. Wired into write_manifest.py exactly like machine_load_snapshot: captured at cell start (write_start_snapshot) and cell end (build_manifest), as disk_space_at_start/disk_space_at_end. Also split benchmarks/lib/machine_load_snapshot.py out of write_manifest.py: the new local CLAUDE.md Code Style gate (scripts/check_craftsmanship.py, merged to main while this work was in flight) caps methods at 40 lines and files at 300, and machine_load_snapshot() (78 lines) + build_manifest() (49 lines) both already exceeded that before this commit -- pre-existing debt this change surfaced rather than introduced, fixed here since the gate now blocks any diff touching this file until it passes. Every function in the resulting three files is under the cap; verified via `python scripts/check_craftsmanship.py <files>`. 10 tests split/added across tests_py/benchmarks/test_machine_load_snapshot.py (new), test_disk_space_snapshot.py (new), and test_write_manifest_machine_load.py (now wiring-only). 33 tests total across the six touched files, all green. ruff clean. Co-Authored-By: Claude <noreply@anthropic.com>
…n fix (#368, #410) The original gated arm could not discriminate W: every LME/LoCoMo/BEAM memory landed on capture_origin='unknown' (memory_ingest.py dropped the field before PR #410), so the uniform demotion left WRRF order invariant. After #410 wires a realistic capture_origin mix into the benchmark harness, re-run the same 5-cell grid (1.0/0.8/0.7/0.6/0.5) in --quick mode and publish what it shows: a real, monotonic LoCoMo relevance cost at the shipped W=0.7 (-0.0165 MRR, -2.54pp R@10 vs the W=1.0 control), with two explicit reserves — quick mode is not floor-comparable (reproduce.sh:94-95), and no measurement links the adversarial-arm defense to a real-benchmark benefit. Owner decision: W stays at 0.7, cost published as measured. Commits the artifacts (PROGRESS.json, per-cell repro_dir + MANIFEST + benchmark JSON) and the resumable per-cell sweep architecture (trust_factor_sweep.sh rewrite + benchmarks/lib/sweep_progress.py) that produced them, so the branch reproduces without depending on the worktree they were run in. Co-Authored-By: Claude <noreply@anthropic.com>
Bring in today's merged PRs before the craftsmanship/marketplace gates. Co-Authored-By: Claude <noreply@anthropic.com>
CI Lint failure on PR #415 — sweep_progress.py was committed from the worktree without ever going through the formatter. No logic change: one line collapsed under the ruff line-length rule. Co-Authored-By: Claude <noreply@anthropic.com>
|
ZETETIC-REVIEW: APPROVE Head reviewed: Move 0 — Ledger reconciliation / seen-defect checkNo unmapped branches, no seen-defect rationalization phrases ("pre-existing," "unrelated," "out of scope") anywhere in the diff or PR body. Pass. (Note: the PR description itself is stale — written mid-flight with unchecked "still coming" boxes — see Non-blocking below; this is a hygiene gap, not a rationalized defect.) Stakes (Move 7)Medium — The five verification points1. Table numbers vs. committed artifacts — verified exactly, all five cells:
All five 2. Cost arithmetic — recomputed independently: 0.8208665699782451 − 0.8044053662073968 = 0.016461... ≈ 0.0165 MRR ✓; (0.9593908629441624 − 0.934010152284264) × 100 = 2.5381... ≈ 2.54 points R@10 ✓. Both match the doc exactly. 3. Both reserves stated, not buried — confirmed. Quick-mode/floor-gate reserve is item 1 under a dedicated "### What this does NOT establish" heading immediately after the results table, cites 4. Self-contradiction check (the #414 failure mode) — the retained original diagnosis is honest, not smuggled-in validation. The original "### Decision" section (pre-fix) still reads "no floor was relaxed... W = 0.7," but it is immediately followed by "### What this measurement does and does not establish," which correctly identifies that the gated arm's floors could not discriminate W at all because every benchmark memory landed on 5. Reproducibility from the branch alone — Contract drift note (non-blocking)
Move 4 — test adequacy
Non-blocking
VerdictAPPROVE. All five committed table values verified exactly against their JSON artifacts; the cost arithmetic checks out to the fourth decimal; both reserves are stated prominently, not buried; the retained original diagnosis is honestly superseded rather than left to imply a false validation; the tooling is reproducible from the branch alone and its targeted tests, ruff, and both repo gates are clean on the current head. W=0.7 remains the owner's call, correctly published with its known cost and its known gaps. |
Summary
Continuation of #410 (already merged — the
ingest_memory()capture_originfix). This PR carries the harness hardening required to re-measure the
trust-factor W grid on a machine that was, for most of the night, shared
with other agents running full test suites — plus the re-measured grid
itself once it completes.
What's in this PR so far
benchmarks/lib/machine_load_snapshot.py(new, split out ofwrite_manifest.pyto satisfy the local craftsmanship gate's 40-linemethod cap) — load average, concurrent pytest processes, concurrent
Docker containers.
benchmarks/lib/disk_space_snapshot.py(new) — free/total bytes on therepo-root filesystem and Docker's storage root. A neighboring session
sharing this machine reported leaked test databases filling the host
disk to 100% on 2026-08-09, taking PostgreSQL down mid-measurement — the
same invisible-failure shape as CPU contention, a different resource.
benchmarks/reproduce.sh/write_manifest.py— both snapshots aretaken at cell START (before
start_db) and cell END, recorded in everyMANIFEST.jsonalongsidegit_sha.ruff check/formatclean.
python scripts/check_craftsmanship.pyclean on every touchedfile.
What's still coming (same PR, do not merge yet)
control cell W=1.0 reproducing the pre-recall fuses relevance and heat only — no trust or provenance dimension in WRRF, so a poisoned memory outranks a good one #368 published numbers.
docs/provenance/trust-factor-calibration.mdupdated with a new datedsection stating explicitly what invalidated the old gated arm
(capture_origin never set → uniform demotion) and what this
re-measurement establishes.
Background (why a harness PR before the numbers)
Two sweep attempts were discarded outright before this branch existed —
not because a cell crashed, but because contention (CPU load above the
core count, confirmed via
ps aux/uptime) can produce a cell thatfinishes cleanly and still returns degraded numbers, indistinguishable
from a clean run without instrumentation. Per this project's own rule, a
measurement from a harness carrying a known defect is invalid and gets
redone, not patched after the fact. The load/disk snapshots in this PR are
that instrumentation — every future cell now self-documents whether it ran
clean.
Test plan
uv run --no-sync pytest -qon the touched files — 33 passedpython scripts/check_craftsmanship.py <touched files>— cleanruff check/ruff format --check— cleandocs/provenance/trust-factor-calibration.mdupdatedCo-Authored-By: Claude noreply@anthropic.com