Install: a prefix module owns its whole folder, so StrongsHebrew installs (#77) #78
No reviewers
Labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
schaefera/utStudyBIble!78
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/strongs-datapath"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #77
What
DataPathnow owns every file in its folder when that folder is the module's own: at least 4 components deep and named as the stem, ASCII case-insensitive. StrongsHebrew'sstrongs.docno longer makescheck()refuse the package.remove_datadeletes the whole folder, so #10 part 2b removes the extra files too. A prefix in a shared folder keeps the strict stem rule and the stem-file deletion.DataPath::owns_its_folder()holds the rule. Its doc notes that a conf can already claim any folder via aDirDataPath, so a hostile conf can name nothing new.Blast radius / rollback
Trunk (
sword/src/install*). To undo, revert this merge: no migration and no data format change.Proof
owns_its_folder() -> false,a_prefix_module_may_ship_other_files_in_its_own_folder_and_removal_takes_themandwhich_prefix_folders_are_the_modules_ownfailed. Both pass now.remove_deletes_the_files_of_a_prefix_data_pathmoved to a shared folder, because in an own folder removal now takes everything.cargo makeis green. CI is green ondcca5e0: rust, preset-check, audit, app, e2e and click.install()over 70 CrossWire rawzip packages (ignored testsurvey_refusals,UTSB_SURVEY_ZIPS=<dir>).KLVen_iklingonandKLViklingon_en, which fail the separate conf-name rule. Neither is in a preset.Phone (docs/09 "On the phone")
Build
dcca5e0installed over WiFi. The owner confirmed that StrongsHebrew installs from "+" and shows as installed (comment 1848). The app can't use it yet; that comes with F2 (#42).Resource budgets (docs/07)
No effect on memory or start-up work: the change is an install-time check only.
Review / audit
claude-review APPROVED
dcca5e0(review 260). Review-Confidence: 100 (comment 1852).🤖 Generated with Claude Code
Fresh-context review, round 1, trunk depth (sword/src/install*). Commit
dcca5e02f6, range origin/main...HEAD (base8e2ece7, head is a descendant of origin/main).Files reviewed: sword/src/install/package.rs, sword/src/install/package/tests.rs
Verdict: APPROVED. No high or medium findings.
Ownership (install side):
.., absolute paths and anything outside modules/ (Component filter), and requires at least 4 path parts. owns_its_folder() additionally needs the prefix dir to have 4 or more components and its last component to equal the stem (ASCII case-insensitive). So a prefix can only claim modules////, a folder a Dir DataPath could already claim at the same depth. Nothing is widened beyond what a conf could already name.a_prefix_in_a_shared_folder_keeps_the_strict_stem_rule.strongshebrewx/) and sibling folders (other/) are refused because owns() uses Path::starts_with (component-wise) against the exact dir. Unpack only creates regular files (no symlinks), so remove_dir_all cannot follow a link out of the folder.remove_data safety:
remove_deletes_only_the_stem_files_of_a_prefix_in_a_shared_folderasserts the lookalike file is kept. The existingremove_refuses_a_conf_that_names_more_than_its_own_datastill covers hostile confs.Tests:
a_prefix_module_may_ship_other_files_in_its_own_folder_and_removal_takes_themandwhich_prefix_folders_are_the_modules_ownfail without the change (the first on check() refusing strongs.doc, the second on the missing method). The refusal and shared-folder tests are regression guards that also pass on base, which is the right shape for them. I rancargo test -p sword --lib install::package: 17 passed, 1 ignored.Issue #77 items:
survey_refusalsis committed.Non-blocking notes (not defects):
Review audit (fresh agent) for head
dcca5e02f6, Review-Tier: trunk.Review-Confidence: 80
Deductions:
dcca5e0.Missed defect: none found (riskiest hunk, remove_data/owns_its_folder in sword/src/install/package.rs, re-checked: the folder must be 4+ components deep and named as the stem; shared folders still go through the stem-file branch).
Reason: the review is sound; re-run this audit once CI is green on head (the score should then be 100), and the docs/09 phone check is still open.
On the phone: build
dcca5e0, installed over WiFi at 17:59. Please try it before this PR leaves draft (docs/09):There is no in-app removal yet (#10 part 2b). Removing the extra files is covered by the unit test
a_prefix_module_may_ship_other_files_in_its_own_folder_and_removal_takes_them.Gate: claude-review APPROVED
dcca5e0. CI pending. I merge once CI is green and you have ticked the list above.🤖 Generated with Claude Code
Phone check by the owner on
dcca5e0: StrongsHebrew installs from "+" and shows as installed. The app can't use it yet; that comes with F2, the lexicon sheet in #42. I'll take this PR out of draft and merge it once CI is green.🤖 Generated with Claude Code
Review audit (fresh agent, re-run) for head
dcca5e02f6, Review-Tier: trunk. Supersedes comment 1845.Review-Confidence: 100
Deductions:
dcca5e0shows state success, all 6 jobs green (CI / rust, Presets / preset-check, CI / audit, CI / app, CI / e2e, CI / click).Missed defect: none found (riskiest hunk, remove_data/owns_its_folder in sword/src/install/package.rs, unchanged since the earlier audit: the folder must be 4+ components deep and named as the stem; shared folders still use the stem-file branch). The reviewed commit equals head, and no code changed since.
Reason: the review is sound and CI is green on head; the owner's phone check of StrongsHebrew is recorded in comment 1848.
WIP: Install: a prefix module owns its whole folder, so StrongsHebrew installs (#77)to Install: a prefix module owns its whole folder, so StrongsHebrew installs (#77)