fix: stops a project-root storage path deleting project files - #34
Merged
Conversation
composer.json/package.json match the record-name pattern, so a storage.filesystem.path misconfigured to the project root let reset and rollup delete them as stale records — found when killed Infection mutants of the default path did exactly that to the real checkout, twice. Storage now refuses any directory containing a composer.json. Also hardens the gitkeep-label and mkdir-mode tests (8 escaped mutants, MSI back over the 90% floor) and makes RelativePathConfigTest clean the /tmp-side leftovers a killed path mutant writes.
Soviann
enabled auto-merge (squash)
July 20, 2026 09:52
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
What
Release-0.4.0 pre-flight found
make mutationfailing the 90% MSI floor (89.78%) — and, far worse, deletingcomposer.jsonfrom the real checkout, twice.The data-loss guard (the headline)
composer.json/package.jsonmatchRECORD_NAME_PATTERN(<identifier>.json), so astorage.filesystem.pathmisconfigured to the project root letsdeploytasks:reset/rolluplist them as stale records and delete them. This is exactly what happened locally: a killedConcatOperandRemovalmutant on the default path ('%kernel.project_dir%/var/deploy-tasks'→'%kernel.project_dir%') pointed storage at the checkout root, and the test teardown'sreset()atecomposer.jsonbefore the mutant died.FilesystemStorage::assertDedicatedStorageDir()now refuses (with an actionableStorageException) any storage directory containing acomposer.json— on both the listing path (records()→all/reset/removeAll) and the targeted path (filePath()→has/get/save/remove). TDD'd (both tests red first). CHANGELOG → Security;docs/storage.mddocuments the dedicated-directory requirement.MSI back over the floor
8 escaped mutants killed in
DeployTasksInstallHostCommand(from #32's new code):substr()off-by-one and unwrap mutants ingitkeepLabel();{projectDir}-adjacentsibling-prefix test pins the trailing-slash boundary instr_starts_with();0o755permission pin kills themkdirmode mutants.Test-pollution fix
RelativePathConfigTestnow cleans its/tmp-side scratch dirs insetUp: a killed path-anchoring mutant writes/tmp/var/rel-deploy-stateagainst the CWD before dying, which failed the next honest run'sassertFileDoesNotExist(bit us twice today).Verification
Full local
make mutationafter the change: Covered MSI 90%+, exit 0, andcomposer.jsonintact (previous two runs deleted it). Suite at 1120 tests, CS Fixer + PHPStan clean.