Commit 7e74c8d
committed
● 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
- memory/visual
- snapshots
- skills
- tldraw
- adapters
- antigravity
- claude-code
- .claude/commands
- cursor/.cursor
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | | - | |
16 | 14 | | |
17 | 15 | | |
18 | 16 | | |
| |||
This file was deleted.
This file was deleted.
Whitespace-only changes.
Whitespace-only changes.
0 commit comments