refactor: apply verified over-engineering cuts from repo audit - #34
stephschofield wants to merge 1 commit into
Conversation
|
CI green after 043417f: hermetic pass, import-smoke pass, pr-path-guard pass, live-integration skipping. Suite 1141 passed / 17 skipped / 0 failed. |
Why the first CI run failed — a latent bug in the guard, not in these cutsWorth a look during review: this affected every future maintainer PR involving a delete or rename, not just this one.
Reproduced standalone before changing anything: validate_pr_changes('someone', ['D\tREADME_OLD.md', 'M\tsrc/atv_bench/cli.py'])
# -> {'ok': False, 'is_submission_pr': False, ...}
Fix (043417f): scope the R/C/D rejection to Test written first (confirmed RED), then fixed. Attack vectors re-verified as still blocked:
Three regression tests added, pinning both the maintainer-delete case and the Note on the audit that produced this PRThe source ledger was generated against a checkout 15 commits stale (217 files / 72k insertions of drift). All 31 findings were re-verified against HEAD before anything was applied — 8 were invalid, including the second-largest claim: deleting Verification against open PRsEach open PR was merged onto this branch in an isolated worktree and the full hermetic suite run:
No conflicts, no failures, no PR touches the cut surface. Happy to split the guard fix into its own PR off |
Removes dead code and collapses copy-pasted blocks. Behavior-neutral; full hermetic suite passes at parity (1138 passed). Deleted: - DEMO_FIX_PLAN.md, IMPLEMENTATION_PLAN.md (both superseded; all items verified shipped) - dead symbols: demo._MATCHES, unused ANCHOR_IDENTITY/functools/socket/sys imports, duplicate "passwd" in _SECRET_KEYWORDS, stale _invoke docstring - elo private aliases (_MIN_MATCHES/_MAX_CI_WIDTH/_MIN_PUBLISH_SPREAD) that shadowed the public names for no external caller Collapsed: - read_json/read_toml -> shared _read_parsed (identical confinement flow) - probe.py model-parse ladder x3 -> _read_model - probe.py enabledPlugins block x2 -> _read_enabled_plugins - demo_match_cmd duplicate bot resolve + is_file guard - _safe_harness_name one-line wrapper inlined Stdlib: - _shannon_entropy -> collections.Counter - _within_root -> Path.is_relative_to - AtvError.__str__ no-op removed (BaseException already returns args[0]) - _normalize_utc_z redundant fast path; datetime import hoisted to module Deliberately NOT applied (audit was run against a 15-commit-stale tree; 8 of 31 findings were invalid against HEAD): - adapters/ deletion: now imported by 7 src modules - demo scripts: numpy/scipy ARE declared deps now - games.get_game/is_live, store.load_submissions: real test callers - MatchSpec.bot_sha256 required, --name-only mode, Budget fields, Usage.turns, AdapterRequest.to_dict, os.environ drop: all still wired - scan.py _UNSAFE_NAME/_MAX_NAME_LEN: provably redundant but left as belt-and-braces on a red-teamed injection validator
043417f to
5abe022
Compare
Guard fix split out into #35This PR is now stacked on #35 ( The Merge order: #35 first, then this PR retargets to The earlier comment explaining the guard bug applies to #35 now, not here. |
Adversarial review: 1 HIGH confirmed — "behavior-neutral" is false. Fix stacked in #38Most of this audit verifies clean, and I checked the claims rather than trusting them: 506 deletions / 61 insertions is exact; all four DEMO_FIX_PLAN items confirmed shipped ( One cut is not behavior-neutral. HIGH —
|
| input | main |
this PR |
|---|---|---|
2026-07-15T15:36:06.123456Z |
...06.123456Z |
...06Z ❌ |
2026-07-15T15:36:06.500Z |
...06.500Z |
...06Z ❌ |
2026-07-15T15:36:06-05:00 |
...20:36:06Z |
...20:36:06Z ✅ |
Reachable, not theoretical. leaderboard.py:75's schema explicitly admits fractional seconds — ^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?Z$ — and publish build --updated-at (publish.py:432) passes caller input straight through. The truncated value is one the schema itself declares valid.
Why 1123 tests missed it: every timestamp fixture uses whole seconds, and the one normalization test asserts only doc["updated_at"].endswith("Z") — which a truncated value still satisfies. The assertion cannot tell the regression from correct behavior.
#38 restores the fast path with a comment explaining why it is not dead weight, and adds exact-equality tests plus a guard that the fast path doesn't shadow the offset conversion. RED 2 failed, 4 passed → GREEN 42 passed.
Minor: the body's "1138 passed / 17 skipped" does not reproduce; measured 1123 passed / 35 skipped at head 5abe022.
#38 targets this branch, so merging it makes this PR mergeable without a force-push.
Fleet review complete — consolidated report + merge orderAll 6 open PRs reviewed against body alignment, security/code quality, CI, and conflicts. Every finding went through an independent refuter, and every surviving HIGH was re-tested by hand before being posted. 9 of 18 findings did not survive — recorded in the report alongside the confirmations, because a review that logs only what it confirms isn't auditable. Full report: Confirmed defects → fixes shipped (TDD, RED first)
The one a conflict check can't see#29 and #33 rewrite the same
#29 must merge before #33, resolving to Recommended merge orderEach fix PR targets its parent branch, so merging the fix first makes the parent mergeable with no force-push. Not merged — needs a second maintainerThe only push-capable account ( |
🎅 Santa Loop Review — Round 1SANTA VERDICT: NICE — ship it. One low-severity honesty nit on the "behavior-neutral" claim (below); nothing blocking.
Rubric
Verification performed (Reviewer A)The load-bearing checks on a deletion PR, all run against head
Agreement
Critical issuesNone. No deleted code was load-bearing; no regression found. Suggestions
Dual independent adversarial review — no shared context between reviewers. |

Applies the surviving findings from a repo-wide over-engineering audit. Behavior-neutral: no feature, guard, or error path changes.
506 deletions, 61 insertions. Suite at parity: 1138 passed, 17 skipped, 0 failed.
What was cut
Deleted
DEMO_FIX_PLAN.md,IMPLEMENTATION_PLAN.md— both superseded; all four DEMO_FIX_PLAN items verified shipped (F1→arena/render.py, F2→referee.pyobserver, F3→cli.py, F4→leaderboard.build_insights)demo._MATCHES, unusedANCHOR_IDENTITY/functools/socket/sysimports, duplicate"passwd"in_SECRET_KEYWORDS, stale_invokedocstringeloprivate aliases_MIN_MATCHES/_MAX_CI_WIDTH/_MIN_PUBLISH_SPREAD, which shadowed the public names for no external callerCollapsed duplication
read_json/read_toml→ shared_read_parsed(byte-identical confinement/symlink/empty/error flow, parser differed only)probe.pymodel-parse ladder ×3 →_read_modelprobe.pyenabledPluginsblock ×2 →_read_enabled_pluginsdemo_match_cmdduplicate bot-resolve +is_fileguard (dead second copy after the browser branch returns)_safe_harness_nameone-line wrapper inlined at its single call siteStdlib
_shannon_entropy→collections.Counter_within_root→Path.is_relative_toAtvError.__str__no-op removed (BaseException.__str__already returnsargs[0])_normalize_utc_zredundant fast path removed; function-localdatetimeimport hoistedDeliberately NOT applied
The audit was generated against a checkout 15 commits stale, so every finding was re-verified against HEAD. 8 of 31 were invalid and are left alone:
adapters/numpy>=1.26/scipy>=1.11are declaredgames.get_game/is_livetest_wave_c_arenas.py,test_wave_a_games.pystore.load_submissionsMatchSpec.bot_sha256requiredtest_bot_identity_binding.pyasserts the optional path--name-onlylegacy modeleague.yml:86Budgetfields,Usage.turns,AdapterRequest.to_dictos.environdropcontained_run, not baresubprocess.runTwo more skipped on judgment:
scan.py's_UNSAFE_NAME/_MAX_NAME_LENare provably unreachable behind the_SAFE_NAMEallowlist, but they're belt-and-braces on a red-teamed injection validator — not worth thinning for 9 lines. And the duplicatedleaderboard/view/index.htmlwas left as a copy rather than symlinked, since git symlinks are unreliable on the Windows checkouts PR #29 targets.Verification against open PRs
Each open PR was merged onto this branch in an isolated worktree and the full hermetic suite run, to confirm no PR depends on removed code:
No conflicts, no failures, no PR touches the cut surface.
Note on the arena drift tripwire
Editing
src/atv_bench/arena/referee.pycorrectly trippedtest_baked_referee_is_byte_identical_to_tested_src; the bakedarena/pkg/copy was re-synced. The tripwire did its job.