Repository navigation
Conversation
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Check that the [DESIGN-REVIEWED] dacc6db Description read[DESCRIPTION-READ] f94b61e5d7a0c3b92a6352857a1d27c03b8619f1d33aac30bdf13235fc36d225 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — 🟡 CONCERNSPremise-level review of First-Principles-Verdict: CONCERNS The Not justified as shipped
What this change shipsInventory (10 items) — 9 justifiedIntent: stop
[FIRST-PRINCIPLES-REVIEWED] dacc6db Description read[DESCRIPTION-READ] 63cefc089f9ef200aa10164359f4466ec1c5d09f51b71cb2b9cc37645492ff3a That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
1c58c56 to
cbebf65
Compare
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
|
GPT 6.1 F1 (
|
f332ff3 to
e7625a6
Compare
|
Design Review CONCERNS on f332ff3, both addressed in e7625a6:
|
e7625a6 to
5f1dc37
Compare
|
GPT 6.1 F1 on f332ff3 ( The expected manifest path is now Not run on Windows here; this host is Linux. The Windows backend lanes on this head are the check. |
5f1dc37 to
7536415
Compare
|
GPT 6.1 F1 on 5f1dc37 (
|
7536415 to
dacc6db
Compare
|
First Principles CONCERNS on dacc6db, item 9 ( The finding is correct. The re-export is unneeded, because only |
|
🤖 Kiro Crew Auto-Pipeline [operator: buluoray#ce473fca]: closing this PR. The operator is pausing work on T3/T4 issues for now, so this stays unmerged. The branch is kept: reopen the PR or reuse the branch if the issue is picked up again. |
Problem / Motivation
Goal:
kirocrew restore --mode replaceno longer removes live files that a snapshot recorded as omitted, unless the operator explicitly accepts that.A snapshot that could not read an entry leaves it out and names it in
MANIFEST.jsonskipped[](for exampleunreadable_entry). Replace clears each component's live files before installing the bundle's copy. When the entry is readable again at restore time, the live file is removed. Its only copy ends up inpre-restore-<ts>/, and the run reports✅ Replace complete.with exit 0. The⚠️ Omittedlines in the manifest printout were the only reader ofskipped[], and nothing acted on them (reproduced on main in the issue thread).Why it matters
Snapshot tolerates omissions so that one protected file cannot block a backup. Without a matching check at restore time, every omission the snapshot tolerated becomes a silent removal from the live data home on replace. The operator's only protection is a manifest field that no decision reads.
Not a goal
portability.apply_import_zip). It consumes the export zip format, whose manifest has noskippedfield, so it is not a reader of this declaration.What changed (motivation → approach → change)
skipped[], so a recorded omission was indistinguishable from a path the operator wanted gone.--allow-omissionsopts in.--mode replace.snapshot_restore._replace_omissions(snap, components, mc)(re-exported by thesnapshotfacade, with its helper_live_path_absent) readsskipped[]and classes each reason throughpinned_fs.omits_wanted_data, the predicate the snapshot prune guard already uses.symlinkandnot_regularare screened by design and do not count. Every other reason counts, including an unknown one.COMPONENTSfiles and trees, with Windows separators normalised. An omitted directory that is an ancestor of a restored tree counts (a full backup records an unreadableworkspaceunder that one path, and memory's subtrees live inside it)...) is never treated as absent.skipped, counts as an omission (fails closed).restore_mainchecks before--dry-run, so a preview gives the same answer as the real run. It prints the paths and the two ways forward, auditsstate_restore_rejected reason=bundle_has_omissions, and exits 1. With--allow-omissionsit proceeds and prints how many omitted paths it may remove.--allow-omissionsis added to both thekirocrew restoreparser incli.pyand the standalone parser.docs/system-specs/modules/cli.md, the shipped user guidesrc/kiro_crew/docs/snapshot-and-restore.md, and thekirocrew-commandsbuilt-in skill document the rule and the flag.Backwards compatibility
Breaking:
kirocrew restore --mode replace(including the auto-selected replace on a home withoutmemory.db) now exits 1 for a bundle whoseskipped[]covers a restored component and names a path that exists in the live data home, where it used to succeed. Writer sweep on origin/main @ 0d885e6: the only callers ofrestore_mainarecli.py(kirocrew restore) and tests.portability.pycalls_do_replacedirectly on its own zip format and is unaffected. The escape is--allow-omissionsor--mode merge.Reader: src/kiro_crew/snapshot_archive.py:_print_manifest -- entry: release (CLI) -- still prints every
skipped[]entry unchanged; this PR adds a second reader and removes none.Tests
test/test_restore_recorded_omissions.py(27 cases; the extra one is a POSIX filename containing a literal backslash).test_snapshot_refactor_contracts.pypins the new--allow-omissionsparser row, andtest_snapshot_refactor_ownership.pydeclares the two new names undersnapshot_restorereproduces the real chain. It runs the snapshot with the file'sstat/lstat/opendenied, lifts the denial, then restores:pre-restore-*directory is created;--dry-rungives the same refusal;--allow-omissionsreplaces, the file is only in the rollback directory, and the warning is printed;skippedvalues;workspace) refuses--components memoryreplace, while siblingsworkspace/notes.mdandworkspace/memoryxdo not;../outside.md,/etc/x,C:/x) are still refused.Mutations, run against the first head and this one:
_replace_omissionsto return[]reddened 11 of the original 17 cases (the other 6 assert no refusal);_live_path_absentalways False reddens the fresh-home case;Run as
PYTHONPATH=<worktree>/src python -m pytest -n0 test/test_restore_recorded_omissions.py. The shared venv imports the main checkout otherwise, which was checked.Manual verification
N/A for Linux. Unit coverage drives
restore_mainend to end. Unverified on Windows and macOS: the path normalisation is covered by the matrix, but no restore was run on those hosts. I did not runkirocrew restore --helpto see the flag rendered. The wiring was checked by readingcli.py(restore_main(parsed=args),dest="allow_omissions").Related Issues
Closes #11499. Related: #11418 (introduced the snapshot tolerance), #11700.
Pattern harvest
Rule candidate: review-prompt
Pattern: "a manifest field written to declare a gap must have a consumer that acts on it; a tolerance on the writer needs a matching guard on every destructive reader"
Decision for the owner
The decision is what
--mode replaceguarantees when the bundle's manifest records entries the snapshot could not carry. This draft refuses by default and adds an explicit--allow-omissionsopt-in, because that fails closed without stranding a legitimate restore, whereas restoring around the omitted paths would silently change what replace means.Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributions are accepted under the project's Apache-2.0 license.