(filePath: string)
| 124 | await fs.mkdir(path.dirname(abs), { recursive: true }); |
| 125 | await writeFileAtomic(abs, content, { encoding: 'utf-8' }); |
| 126 | |
| 127 | this.ops.push({ |
| 128 | operation: isCreate ? 'create' : 'write', |
| 129 | path: abs, |
| 130 | beforeHash, |
| 131 | afterHash, |
| 132 | beforeContent: beforeContent ?? undefined, |
| 133 | afterContent: content, |
| 134 | }); |
| 135 | |
| 136 | logger.debug('Transaction write', { txnId: this.id, path: abs, isCreate }); |
| 137 | } |
| 138 | |
| 139 | async delete(filePath: string): Promise<void> { |
| 140 | this.ensureOpen(); |
| 141 | const abs = path.resolve(filePath); |
| 142 | // Scope gate — same contract as write() above. |
| 143 | { |
| 144 | const denial = checkWriteScope(abs); |
| 145 | if (denial) { |
no test coverage detected