(acc: DigestAccumulator, path: string)
| 543 | } |
| 544 | |
| 545 | export function pushDigestFile(acc: DigestAccumulator, path: string): void { |
| 546 | if (path.length === 0) return; |
| 547 | // Re-insert to move an existing path to newest, then evict the oldest — |
| 548 | // the most recently touched files are the ones the handoff cares about. |
| 549 | acc.filesTouched.delete(path); |
| 550 | acc.filesTouched.add(path); |
| 551 | if (acc.filesTouched.size > FOREIGN_SESSION_DIGEST_MAX_FILES) { |
| 552 | const oldest = acc.filesTouched.values().next().value; |
| 553 | if (oldest !== undefined) acc.filesTouched.delete(oldest); |
| 554 | } |
| 555 | } |
| 556 | |
| 557 | export function finishDigest( |
| 558 | acc: DigestAccumulator, |
no test coverage detected