fix: review follow-ups for the session archive set

- WorkspaceRegistry.archiveSession no longer wraps persistence-listing
  failures as WorkspaceUnknownSessionError: only a definite miss (live
  lookup, header index, then a fresh list) maps to session-not-found;
  storage faults propagate as internal errors, with a negative test.
- The archived-current sweep moves from the unary path into the
  projection: any install path (local echo, another tab's frame, a
  reconnect baseline) clears a selection that landed in the archive set.
- An archive set installed while workspace.list is in flight supersedes
  the stale baseline's set instead of being rolled back by it.
- The workspace-management e2e anchors the archived row by its session
  actions button and asserts the single-stray fixture assumption loudly.
- Drop the stale touchSession rows from the workspace READMEs (the
  method was removed with its Agent Note).
This commit is contained in:
imccyu
2026-07-31 03:44:35 +08:00
committed by imccyu
parent c00f0dccda
commit d3e8f17a54
15 changed files with 103 additions and 26 deletions

View File

@@ -866,6 +866,16 @@ describe('registry-global session archive', () => {
expect(storedState(result.pool).archivedSessionIds).toEqual(['stray', 'live-only'])
})
it('propagates a persistence-listing failure instead of reporting an unknown session', async () => {
const result = await harness({ sessions: [] })
result.list.mockRejectedValueOnce(new Error('persistence backend down'))
// The storage fault is the error — never WorkspaceUnknownSessionError,
// which the API layer would misreport as session-not-found.
await expect(result.registry.archiveSession(SessionId('unlisted')))
.rejects.toThrow(/persistence backend down/)
expect(storedState(result.pool).archivedSessionIds).toEqual([])
})
it('restores the archive set across restarts and defaults it for pre-field media', async () => {
const dir = await makeDir('archive-restart')
const pool = new MemoryMediaPool()