Repository navigation
The replay graded persistence as recorded, so 37 OS updates filed while the apple tier was dead still read as 37 HIGH swaps - #59
Open
opencdlee-dotcom wants to merge 1 commit into
Conversation
…le the apple tier was dead still read as 37 HIGH swaps `backtest replay --reobserve` re-derived trust and custody for the four binary sensors only; persistence and agent-surface findings were routed exactly as recorded. Persistence was then the largest residue (54 interrupts), and most of it was a blind spot of the harness, not of the code: "program bytes X -> Y" findings on /bin/bash, /usr/bin/open and friends, recorded HIGH `signed-other` while `_classify_mac` could not say `apple`, which the current sensor emits as one LOW `os-vendor` OS update. A change finding is a diff, so re-observing one rebuilds the pair it was a diff of and asks the sensor itself: - persistence: the new side is the sensor's own snapshot of the item now, accepted only where it still prints what the record says it changed to; the old side is what the record says it changed from. The shape of the recorded line is found by rendering every shape `_persistence_change_detail` can print with tokens in the old-side slots, never by a parser written beside it. `check_persistence` then grades the pair: os-update, publisher-stable / relocated, payload custody, demote. Where the grade may turn on an old field no line carries (the old signer for publisher-stable, the old program bytes for relocated, the old payload path after an argv edit), it comes from the live baseline while that still holds the recorded old side; otherwise every value it could have had is tried, and two answers are reported, not guessed. - agent-surface: `diff_agent_surface` re-grades an exec target, a materialized target, or an instruction-file directive against the bytes the record names, only while they are still the bytes on disk. A new exec entry is graded on the config file's bytes, which no record carries, so it is counted and replayed as recorded. `check_persistence` grades a NEW item with no custody rung at all, and the replay reproduces that rather than inventing one. The stats line gains a "not re-derivable: N" count by reason, the dropped column covers both categories, a persistence table prints what changed (`HIGH/- -> LOW/os-vendor: N`), and the self-check asserts every finding in a re-derivable category was re-observed, gone, or counted. Also touched: tests/conftest.py registers the new macOS-only test class (SIP and the sealed system volume are the premise of an OS update). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Step S0b of
PRECISION-PLAN-2026-09-23.md:backtest replay --reobservenow re-derives persistence and agent-surface findings with the current code. Before this change it replayed them exactly as recorded.What it does
A change finding records a diff. To re-observe one, the replay rebuilds the pair that was diffed and hands it to the sensor. It does not use a second grader.
snapshot_persistence()of the item as it is now. The replay only accepts it if it still prints what the record says the item changed to._persistence_change_detailcan print, with tokens in the old-side slots. The shape that matches the recorded line gives the old values.check_persistence(old, rec)grades the pair. That covers the OS update, publisher-stable / relocated, payload custody and_demote.check_persistencegives a NEW item no custody rung, and the replay does the same. The step asked for a custody path here. That would have been a grader the sensor does not have, so the harness would show a fix the product lacks. That belongs in S5 or S7.diff_agent_surfacere-grades exec targets, materialized targets and instruction-file directives against the bytes named in the fingerprint. It only does this while those are still the bytes on disk._custody: the intent ledger first, then git. Both are read-only.droppedcolumn covers both categories.recorded -> current.Numbers (live store, 30 days,
backtest replay --days 30 --reobserve)Persistence change table:
Not re-derivable, replayed as recorded (2392):
What still interrupts, and why the replay leaves it
uv, andcheck_persistencegrades NEW items with no custody rung. That is a sensor gap (S5/S7), not a harness gap.Tests
tests/test_backtest_replay_persistence.py(10 tests). It covers:signed-otherprogram-bytes swap on /bin/bash re-observed as LOWos-vendor. This case is macOS-only, registered in_MAC_ONLY_CLASSES._git_provenance), which is demoted. It is checked both with and without the baseline, plus a payload that has moved on since the record.python3 -m pytest tests/test_backtest_replay.py tests/test_backtest_replay_persistence.py -q: 21 passed.test_cross_platform.pyunder SIM_BODY=win has 3 failures, and the merge base has the same 3.2164 passed, 6 skipped, 30 xfailed, 41 subtests passed in 994.39s.🤖 Generated with Claude Code