rdmsm4x-changelog-20260905-1103-ramdisk-m4-it6-remediation
rdmsm4x-changelog-20260905-1103-ramdisk-m4-it6-remediation
Summary: Resolved unmount pre-flight dynamic discovery, strict collision rejection, multi-entity APFS container teardown, and test isolation flakiness in macOS-ramDisk-app on rdmsm4x.
- Timestamp: 2026-09-05 11:03:00 EDT
- Host: rdmsm4x (Apple Silicon M4 Max, macOS 27.0)
- Agent: teamwork_preview_worker_m4_it6_1
- Target Estate: ~/dev/apps/macOS-ramDisk-app
- Commit: 738c0ef ("fix(ramdisk): unmount pre-flight dynamic discovery, strict collision rejection, and multi-entity APFS teardown")
- Remotes Updated: fleet (git.ecs0.net), backup (GitHub), origin (GitHub)
Scope & Changes
- Sources/ramdisk/main.swift:
- In unmount command, performed dynamic mount discovery
DarwinStoragePrimitive.findMountedVolumes(matchingPrefix: "/Volumes/RAMDisk")before evaluatingguard engine.volumeState.isMounted. - Latched
engine.volumeStateandengine.config.mountPathto the resolved active mount point. - Required sustained consecutive clean checks
(
consecutiveCleanChecks >= 3, 300ms quiet state) in descriptor drain loop before early exit. - Enforced safe refusal exit code 1 with structured JSON when exclusive write locks exist.
- In unmount command, performed dynamic mount discovery
- Sources/RAMDiskCore/RAMDiskEngine.swift:
- Updated
releaseWorkspaceCleanly()descriptor drain loop to requireconsecutiveCleanChecks >= 3.
- Updated
- Sources/RAMDiskCore/StoragePrimitive.swift:
- Added
clearMountPathStub(_ mountPath: String)withlsof -t +Dhandle termination, specific metadata unlinking (.fseventsd,.DS_Store), recursive removal,/bin/rm -rf, and 2.0s VFS teardown drain. - Enforced strict collision rejection in
formatVolume: force unmount collision path (/Volumes/RAMDisk 1), clear stub/Volumes/RAMDisk, and remount strictly viadiskutil mount <volumeDev>. Never return collision paths. - Extended device settling probe to 5.0s with exponential backoff retries and APFS container deletion fallback.
- Reverse topological detachment in
detachVolume(mounts, containers, partitions, root physical parent disks).
- Added
- Tests/E2ETests/run_e2e_tests.sh:
- Updated
cleanup_ramdisks()to terminate handles before unmount, force eject APFS containers + physical parents, remove stubs, and verify triple-point settlement.
- Updated
- Tests/E2ETests/e2e_framework.py:
- Updated
ensure_unmounted()with duallsof/fusertermination, reverse APFS container + root disk ejection, directory stub clearing, and triple-point settlement check. - Increased CLI unmount timeout to 15.0s in
unmount_volume.
- Updated
- Tests/E2ETests/test_tier4_real_world_scenarios.py:
- Replaced isolated unmount calls at scenario startups (T4.1, T4.2,
T4.4, T4.5) with
ensure_unmounted().
- Replaced isolated unmount calls at scenario startups (T4.1, T4.2,
T4.4, T4.5) with
Verification Evidence
- AST Invariants: All 6 literal strings verified verbatim on rdmsm4x (exit code 0).
- Unit Tests:
swift build && swift testpassed 4/4 tests. - ThreadSanitizer:
swift test --sanitize=threadpassed with 0 data races. - Rapid Stress: 15/15 consecutive cycles mounted
strictly at
/Volumes/RAMDiskwith 0 collisions. - Safe Refusal: Confirmed exit code 1 with structured
JSON error and
activeLocksCount: 1. - E2E Consistency: Executed
zsh Tests/E2ETests/run_e2e_tests.sh3 consecutive times:- Run 1: 192/192 PASSED (34s, exit code 0)
- Run 2: 192/192 PASSED (32s, exit code 0)
- Run 3: 192/192 PASSED (33s, exit code 0)
- Zero Residual State:
mount | grep -i ramdisk,hdiutil info | grep -i 'ram://', andls -la /Volumes | grep -i ramdiskall returned exit code 1. - Git State:
git status --porcelainis 0 dirty; ahead-behind on fleet/main, backup/main, and origin/main is 0 0.