← 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)
- Git context is per command, not per text.
redact.tstreats every 40-hex value as a git SHA, and keeps 10 characters, when the call text holdsgitanywhere. Ingit pull && ./deploy <40-hex key>the key keeps 40 bits. Decide the git context per command segment (split on;,&&,||,|). - Uppercase 40-hex.
SHA1_HEXhas noiflag, so an uppercase 40-hex value is neither shortened nor redacted. The 64-hex and longer rules are case-insensitive. - 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_VALUEandSECRET_FLAGno longer match and its first words can be stored. Close or drop an unbalanced quote at the cut. - Over-redaction. The secret-name list in
KEY_VALUEhas no left boundary, sobypass=1,monkey=xand--sort-key=nameare masked. That fails closed, but it loses text the classifier (#4157) may want. Add a boundary before short names (pass,key,sig).
Import robustness
- A transient read while whoami fails stamps the session as failed.
identityForreads the previous record inside the sametryas parsing. A datastore error that is not aDeno.errorsinstance (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 fromreadResourceas transient. - 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. - 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. - 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
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.