(
ctx: MemoryScopeContext,
scope: MemoryScope,
relPath: string
)
| 521 | } |
| 522 | |
| 523 | private async recordDelete( |
| 524 | ctx: MemoryScopeContext, |
| 525 | scope: MemoryScope, |
| 526 | relPath: string |
| 527 | ): Promise<void> { |
| 528 | try { |
| 529 | const key = this.logicalKeyFor(ctx, scope, relPath); |
| 530 | if (key === null) return; |
| 531 | // Subtree-aware: deleting a directory drops metadata for everything in it, |
| 532 | // so a future file at the same path never resurrects stale pins/stats. |
| 533 | await this.metaService.removeKeys(key); |
| 534 | } catch (error) { |
| 535 | log.debug("[MemoryService] failed to drop memory usage stats on delete", { |
| 536 | scope, |
| 537 | relPath, |
| 538 | error, |
| 539 | }); |
| 540 | } |
| 541 | } |
| 542 | |
| 543 | private getStore(ctx: MemoryScopeContext, scope: MemoryScope): MemoryStore { |
| 544 | switch (scope) { |
no test coverage detected