Skip to content

Copy roots by file layout; check-root tests derive scratch under their own HOME - #2785

Merged
trissim merged 2 commits into
mainfrom
fix/check-root-carry-history
Oct 23, 2026
Merged

trissim merged 2 commits into
mainfrom
fix/check-root-carry-history

Conversation

@trissim

@trissim trissim commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Two reds on main (1da51e0) with no owner.

test_check_root (2 tests). Not environmental, it was the test reading the machine. The scratch_root fixture built StorageRule() before durable_home set the test's HOME, so it derived the developer's real ~/.cache/agent-scratch. After dc7557a (#2776) scratch_base reads HOME when the rule is built, so the registry's rule (test HOME) and the fixture (real HOME) disagreed and check_root.py:64-69 correctly refused. The owner already derives from the declared storage rule; the fixture now depends on durable_home and derives from that same rule.

test_carry_bus_history. HistoryArchive.files_in decoded history_sources.json in today's HistorySource schema only to learn where archived roots live. StoreBackup.copy_tree → RootFile.owned_files → files_in therefore refused any predecessor-shape root before a carry could run. It was red across today's commits on whichever predecessor field the decoder met first (54b2e14, 57b51b6 and their parents all red). Archived roots are now found by where attach puts them (archive_directory, one spelling). The copy step is now byte-level by owner identity.

That exposed the next red behind it: archived bus.sqlite3-wal/-shm were reported as unnamed changed files, because archived files never resolved to their own owner. RootFile.owned_files now takes primaries from primaries_in, which recurses through the new archived_roots hook. Each archived store's companions then fold into that store. Carry walks (declarations_in, existing_in) are untouched, so carries never rewrite an archive.

🤖 Generated with Claude Code

Citation fixture and others added 2 commits October 23, 2026 09:55
… HOME

HistoryArchive.files_in decoded the whole history catalogue in today's
HistorySource shape only to learn where archived roots live. Every rehearsal
copy (StoreBackup.copy_tree -> RootFile.owned_files) therefore refused a root
still in an older shape before any carry could read it; test_carry_bus_history
has been red all day on whichever predecessor field the decoder met first.
Archived roots are wherever attach puts them, so archive_directory owns that
layout once and files_in lists it without decoding.

scratch_root derived the agent-scratch directory from StorageRule() before
durable_home set the test's HOME, so it wrote under the developer's real
~/.cache/agent-scratch; once dc7557a made the rule read HOME when built, the
registry's rule and the fixture disagreed and CheckRoot refused the root.
scratch_root now requests durable_home and derives from the rule under it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… them

With the copy no longer refusing predecessor roots, the carry rehearsal met
the red behind it: an archived bus.sqlite3's -wal and -shm were reported as
changed files no step names. Archived files were keyed to HistoryArchive in
owned_files but never became primaries, so their store never claimed its
companions. RootFile.archived_roots declares the whole roots a declaration
keeps; owned_files takes primaries from primaries_in, which recurses through
them. Carry walks (declarations_in, existing_in) still see only the top root,
so no carry rewrites an archive.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@trissim
trissim marked this pull request as ready for review October 23, 2026 14:01
Copilot AI balanced review requested due to automatic review settings October 23, 2026 14:01

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@trissim
trissim merged commit 0240b6d into main Oct 23, 2026
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants