Repository navigation
Conversation
The backup slot is a path the apply walk writes, and `_check_apply_paths` only ran the operator allowlist guard over it. A regular file at `$AGENTDESCENT_HOME/backups` therefore passed both previews and then failed the real tree write with the backup's errno printed against `dest`, a directory that is perfectly good -- the #1208 defect on the last leaf.
This branch has not been deployed
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.
Fixes #1226
What changed
show --diff,apply --dry-run,apply,apply --install-toandapply --fromnow refuse a tree write whose backup directory cannot be created, before anything is written, with one sentence naming the blocker:Before, with a regular file at
$AGENTDESCENT_HOME/backups: the previews exited 0 and advertised the write;applyand--install-toexited 2 withcannot write <dest>: Not a directory(the backup's errno printed against a destination that is a good directory);apply --fromexited 2 withcannot write <slot>: Not a directory.The backup slot was the one path the walk writes that
_check_apply_pathschecked only against the operator allowlist; the filesystem refusals covereddestand everywrittenleaf. The fix is that one call overbackup, in the same funnel, so no surface can drift.A text artifact is unaffected (its
.bak-Nsits besidedest) and--no-backupneeds no slot; both are pinned by control rows.Reads at this tip
Both readers name
71aa5c3cfbe7d1d1c736536a7f79b83a77b2d827:Blocking: none. Delta isevolution.py:1672-1673(one call in_check_apply_paths); instrumented all five surfaces against a blocked root — onecheckevent withbackup != Noneon each, five identical refusals, zero write primitives, dest bytes+mtime unchanged, blocked root untouched.--no-backup, a dangling symlink atbackups, a file atbackups/<name>-<digest>andAGENTDESCENT_HOMEitself a symlink are all handled; the planted race fails closed (message mislabelled againstdest, pre-existing).backupsa symlink to a directory outside home is not refused — pre-existing, unchanged by this commit, out of this card. 21 passed; hygiene grep clean.Blocking: none. Red first at base3759b546+ only the new file →2 failed, 3 passed(test_tree_surfaces_name_the_blocked_backup_rootline 120assert show_error,test_apply_from_names_the_blocked_backup_rootline 103assert 0 == 2); tip →5 passed; deleting the added line from the tip tree reproduces2 failed, 3 passed, so the rows pin the fix itself. All five surfaces returncannot write <slot>: '<backup root>' is a file, not a directorywith dest bytes+mtime identical, blocked root intact and nobackups/created; family 18 passed.No UI surface(CLI text only).CSI_API_KEY, which is not set — so 2/2 is this card's ceiling, not 3/3.success+deployandapply labels (live only)skipped, zero failures.Verification at the tip
Tip SHA: 71aa5c3
Ran:
3759b546, new file only:2 failed, 3 passed in 4.27s(the two refusal rows; the three controls already held)5 passed in 7.82stest_apply_blocked_parent.py,test_apply_blocked_child.py,test_apply_blocked_leaf.py,test_apply_backup_blocked.py):18 passed in 7.61spython -m tools.changelog_fragments check→ 5 fragments OKpython -m tools.gen_api_docs --check→ docs/api.md is up to datepytest -qat the tip:19 failed, 8016 passed, 51 skipped— all 19 fail identically on base3759b546(6test_era_srbenchMemoryErrorin the sandbox, 12test_sandbox_containerdocker-engine rows, 1test_genesis_exampletoolchain mount), so they are this host, not this PRNot run:
mkdocs build --strict— no file underdocs/ormkdocs.ymlchanges in this PR