Observed behavior: In src/security-files.ts, atomicWritePrivateFile rename path inner descriptor finally can replace a primary operation failure with a secondary cleanup failure.
Expected behavior: Keep primary failure/classification and secondary cleanup evidence; attempt cleanup once.
Root cause: Unguarded or error-replacing finally cleanup. Static evidence at d1e1267; not yet reproduced dynamically.
How to reproduce: Inject operations.write throwing primary, with operations.close genuinely closing descriptor then throwing an independent cleanup error. The unguarded finally close replaces the primary write failure.
Found during #1086/#1095/#1119 planning review; distinct boundary, outside current cleanup PR scope and campaign inventory.
Environment:
- Agent: Codex GPT-6 Astra owner
- Connector: CLI
- OS: Linux
Related cleanup-precedence PR: #1147 (this distinct boundary remains outside that PR).
Observed behavior: In
src/security-files.ts,atomicWritePrivateFile rename path inner descriptor finallycan replace a primary operation failure with a secondary cleanup failure.Expected behavior: Keep primary failure/classification and secondary cleanup evidence; attempt cleanup once.
Root cause: Unguarded or error-replacing finally cleanup. Static evidence at d1e1267; not yet reproduced dynamically.
How to reproduce: Inject operations.write throwing primary, with operations.close genuinely closing descriptor then throwing an independent cleanup error. The unguarded finally close replaces the primary write failure.
Found during #1086/#1095/#1119 planning review; distinct boundary, outside current cleanup PR scope and campaign inventory.
Environment:
Related cleanup-precedence PR: #1147 (this distinct boundary remains outside that PR).