Skip to content

Commit 7e74c8d

Browse files
● tldraw: address review — relocate snapshot store, harden concurrency, drop duplicates
Relocate Move persistence out of .agent/memory/visual/ into the skill itself at .agent/skills/tldraw/store.py. The previous layout implied a fifth memory layer, but there is no lifecycle, clustering, dream-cycle, or recall integration — it's skill-local storage, not memory. Naming now matches behavior. Concurrency * JSONL mutations acquire an advisory exclusive flock on Unix and a process-local threading.RLock on Windows (fcntl unavailable). * Archive does read-modify-rewrite inside a single lock scope. * Atomic-write tmp names include 6 bytes of entropy so two threads writing the same target in the same millisecond can't race on the tmp file. * Snapshot id retries are bounded (_MAX_RESAMPLE = 8) so a degenerate RNG can't spin forever. Security load_snapshot / archive_snapshot validate the sid against ^[A-Za-z0-9_-]+$ before any os.path.join. Blocks traversal inputs like "../etc/passwd" at the API boundary. Robustness Malformed JSONL lines are logged to stderr and skipped rather than silently swallowed — the store exists to surface corruption, not hide it. Duplicates removed * adapters/{antigravity,claude-code}/.mcp.json and adapters/cursor/.cursor/mcp.json were byte-identical to adapters/_shared/tldraw-mcp.json. install.sh and install.ps1 now copy the shared file into the target per adapter. * Deleted .agent/skills/tldraw/KNOWLEDGE.md (placeholder) and adapters/claude-code/.claude/commands/tldraw.md (redundant with the skill). Gitignore INDEX.md, snapshots/, and snapshots.jsonl under the skill are runtime output — gitignored so installs start clean. The PR-local validation harness (test_tldraw_visual_memory.py) is also gitignored Tests (local) 66/66 passing. New coverage: 16-thread concurrent snapshot writes with post-hoc jsonl parse + count check, malformed-line recovery.
1 parent 29b063d commit 7e74c8d

18 files changed

Lines changed: 449 additions & 537 deletions

File tree

.agent/AGENTS.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ same memory, skills, and protocols.
1111
- `memory/semantic/DECISIONS.md` — past architectural choices
1212
- `memory/semantic/LESSONS.md` — distilled patterns (rendered from `lessons.jsonl`)
1313
- `memory/episodic/AGENT_LEARNINGS.jsonl` — raw experience log (top-k by salience)
14-
- `memory/visual/INDEX.md` — durable canvas snapshots from the tldraw skill
15-
(fifth layer, opt-in via the `tldraw` feature flag)
1614

1715
## Review Queue (host-agent responsibility)
1816

.agent/memory/visual/INDEX.md

Lines changed: 0 additions & 8 deletions
This file was deleted.

.agent/memory/visual/README.md

Lines changed: 0 additions & 68 deletions
This file was deleted.

.agent/memory/visual/snapshots.jsonl

Whitespace-only changes.

.agent/memory/visual/snapshots/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)