Thanks for the detailed report and reproduction project, @RbBtSn0w.
I can confirm the root cause in the codebase. The ModuleMapMapper generates a “Copy Module Map” script phase for framework products that unconditionally creates a top-level Modules directory inside the framework bundle [1]:
mkdir -p "$TARGET_BUILD_DIR/$WRAPPER_NAME/Modules"
cp -f ... "$TARGET_BUILD_DIR/$WRAPPER_NAME/Modules/module.modulemap"
This doesn’t account for macOS versioned framework layouts (Versions/A/Modules with a root symlink), which is what causes the “unsealed contents present in the root directory” codesigning failure.
Additionally, PackageInfoMapper validates that systemLibrary targets have a module.modulemap but doesn’t assign them a special product type [2] — so they can end up materialized as regular frameworks depending on how products are declared, triggering the module map copy logic.
This looks like a legitimate bug. To help debug further, you could try installing this skill following the steps in the agent-skills repo and use a coding agent (Claude, Codex, etc.) to investigate the generated project and explore potential fixes. If that doesn’t yield a solution, the reproduction project you’ve already provided should be very helpful for the maintainers.
To reply, just mention @dosu.
Docs are dead. Just use Dosu.