Skip to main content
← Back to list
01Issue
BugOpenExtensionsPublic
AssigneesNone

Relationships

#4210 agent-sessions: revisit the import's remaining review findings (redaction edge cases, import robustness)

Opened by skunk-ape · 10/30/2026

Follow-up to #4156. The @swamp/agent-sessions import (swamp-extensions agent-sessions/) shipped after six rework rounds of verification review. The seventh round, on 99d2305b8, passed with these non-blocking findings, left open by decision. Revisit them together.

Redaction (privacy)

  1. Git context is per command, not per text. redact.ts treats every 40-hex value as a git SHA, and keeps 10 characters, when the call text holds git anywhere. In git pull && ./deploy <40-hex key> the key keeps 40 bits. Decide the git context per command segment (split on ;, &&, ||, |).
  2. Uppercase 40-hex. SHA1_HEX has no i flag, so an uppercase 40-hex value is neither shortened nor redacted. The 64-hex and longer rules are case-insensitive.
  3. Quoted secret cut by the input bound. Redaction reads the first 4000 characters, and heredocs are stripped from the first 16000. A quoted multi-word secret that straddles the cut loses its closing quote, so KEY_VALUE and SECRET_FLAG no longer match and its first words can be stored. Close or drop an unbalanced quote at the cut.
  4. Over-redaction. The secret-name list in KEY_VALUE has no left boundary, so bypass=1, monkey=x and --sort-key=name are masked. That fails closed, but it loses text the classifier (#4157) may want. Add a boundary before short names (pass, key, sig).

Import robustness

  1. A transient read while whoami fails stamps the session as failed. identityFor reads the previous record inside the same try as parsing. A datastore error that is not a Deno.errors instance (a lock timeout, say) is treated as a deterministic failure. The session is stamped and not retried until its transcript or the importer changes. Treat errors from readResource as transient.
  2. Unattributed sessions churn while whoami stays down. A session written without identity is stamped |unattributed, so it is re-parsed and rewritten on every import until whoami answers. It costs time only, since swamp keeps one version. Skip the rewrite when the fingerprint is unchanged and whoami failed again.
  3. Duplicate session ids. Two transcripts with the same session id, case-folded (a session copied or resumed under another cwd folder), map to one record and one index slot. Both re-import on every run, and the last write wins. Dedupe or warn in discoverSessions.
  4. Sessions from merged worktrees stop being tracked after git fetch --prune. A glob-matched session counts only while its branch exists. Once the branch is pruned it is left out, and its index and children entries are pruned, so stale-child cleanup forgets it. Its records are kept. Consider keeping index entries for sessions that discovery refused only for a missing branch.

Pointers

  • Review run with the full findings: verify-reviews 6a35721c-c9b3-4a0c-ad3f-7b9569e04316 (round 7). Build run: 3ff967ae-7c1c-4ea7-9fce-07148b4337ee.
  • Code: agent-sessions/extensions/models/_lib/redact.ts, _lib/importer.ts, _lib/claude_code/discover.ts.
02Bog Flow
◉OPEN○TRIAGED○IN PROGRESS○SHIPPED

Open

10/30/2026, 10:48:08 PM

No activity in this phase yet.

03Sludge Pulse
Editable. Press Enter to edit.

system commented 10/30/2026, 10:48:08 PM

Classified automatically when this issue was filed.

  • Source: Extensions

If you feel this classification is incorrect, add a ripple to tell us so.

Sign in to post a ripple.