Define ownership and retirement of MSVC companions omitted by a successful rebuild
Motivation
A successful new image can coexist with import/debug companions from an earlier build because commit skips every companion not present in staging. Whether an old file should be retired depends on output ownership.
Reproduction and evidence
Audited canonical master 69a67c6e0fb700f37ee6114f5a66d37ee13771a5 (0.0.1-alpha-dev). Matching checkout-built compiler/std were used for compiler probes on Linux amd64 with Rust 1.89.0 and LLVM 21.1.8. Artifact inspection, mocked/projection checks and foreign-target object emission are identified below and are not native execution on those operating systems.
Executed the unchanged output-set logic with old demo.dll/demo.lib/demo.pdb and only a new staged demo.dll. commit returns Ok; DLL is new and LIB/PDB remain old. This is a transaction fixture, not native Windows linker execution, and does not establish that blindly deleting all neighboring files is safe.
Scope
Define how the output set identifies companions it owns and handles exports/debug configuration changes across successful rebuilds.
Starting points: src/link_outputs.rs:176.
Design discussion required
Recommended: retain a recoverable ownership record for generated companions and retire only previously owned outputs as part of the transaction. Alternatives require an explicit conservative preservation/stale-output warning policy. Decide ownership before adding deletion.
Please mention @LunaStev to discuss the design before starting implementation.
Completion criteria
- [ ] The resulting set has the approved behavior for omitted prior companions.
- [ ] Do not delete unrelated/user-owned neighboring files.
- [ ] Cover exports removed, debug output disabled, custom companion paths and commit failure.
Related: #536. Related broad trackers or completed implementations are context, not claims that their entire scope is unfinished.