[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7ENZGPAA7CF9C4EGHEYBR8K":3,"skill-same:01M7ENZGPAA7CF9C4EGHEYBR8K":57},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":23,"commitSha":24,"skillDirectory":25,"forksCount":13,"repositoryHtmlUrl":26,"repositoryHomepageUrl":6,"ownerHtmlUrl":27,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":28,"install":29,"resources":42},"01M7ENZGPAA7CF9C4EGHEYBR8K","sandboxer",null,"inputloop\u002Fgarden","inputloop","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F339507215?v=4","01M7ENYT15EMVBAV30YXPQDYE2","Inputloop","01M7ENYT1SM9WM5PSMQDC9PE2G",0,"GPL-3.0","https:\u002F\u002Fgithub.com\u002Finputloop\u002Fgarden\u002Fblob\u002Fmain\u002F.arc\u002F2026-08-17-inbox-clearance\u002F2026-07-09-promotions\u002Fsandboxer-patch\u002Fpatched\u002Fsandboxer\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: sandboxer\ndescription: Safe reads and writes on a mounted folder when the file tool and the disk desync. Write-side: an Edit\u002FWrite reports success but the bytes never land — use on a LARGE mounted file, a burst of edits, or any \"did that write land?\"; provides atomic write-and-verify. Read-side: bash serves stale\u002Ftruncated bytes while the file tool sees the real disk — cross-read two independent paths, never \"repair\" off one reader; edited files read stale, new files read fresh; a BAD signature from one reader is usually the reader; a timeout does not undo a write; absence from one reader is not absence. Execute-side: a stale .pyc\u002F.elc shadows fresh source, cured by clearing it or a \u002Ftmp copy; the freshen rename-dance (mv away+back) cures a stale node. Also: delete blocked on the mount, git-mount desync (restore via git show HEAD:path), stale index.lock. Triggers on \"did that write land\", \"is this read stale\", \"file looks truncated\", \"BAD signature on a mount\", \"why can't I delete this\", \"stale pyc\", \"old code keeps running\".\n---\n\n# Sandboxer — crossing the sand\n\nThe mounted folder is open sand. The file (Edit\u002FWrite) tool keeps a cached\nview of it, and that cache can drift from the real disk: the tool reports\n*updated successfully* while the bytes never arrive. A footstep that looks\nplanted but never landed. bash on the mount writes the *real* disk — so when\nthe file is large or the crossing matters, cross the sand here and verify\nyour own tracks. *Trust the disk, not the message.*\n\n## When this skill applies\n\n- Writing or editing a **large** file (HTML, code, a long document) on a\n  **mounted** folder — the hazard scales with size.\n- A **burst** of edits to one file in quick succession (a dozen rapid\n  Edits to the same large mount file can trigger desync even with no other\n  red flags).\n- Any moment you need to know **\"did that write actually land?\"** — or a\n  file looks truncated: shorter than expected, cut mid-line, missing its\n  closing tag.\n\nIt does **not** fire for ordinary small writes. Most memory notes and short\nfiles are fine through the normal file tool. This is for the big crossings.\n\n## The hazard, briefly\n\nThe desync is not caused by one single thing. Backticks in the payload\nraise the odds, but a backtick-free file truncated too — so \"no backticks\"\nis *necessary, not sufficient*. Size and bursty edit volume are the larger\ndrivers. After a desync, file-tool writes apply to the **stale cache**, not\nthe disk, and keep reporting success. That is why the tool's own word can\nnever be the proof.\n\n## The crossing (how to write safely)\n\n1. Build the full content and write it to a **VM-local** temp file (e.g.\n   under `\u002Ftmp`), where the flaky mount is out of the loop. A bash\n   heredoc is fine; prefer string concatenation over backtick template\n   literals in JS payloads to keep trigger odds low.\n2. Copy it onto the mount target **atomically and verified**:\n\n   ```\n   python3 scripts\u002Fsafe_write.py [--validate] \u002Ftmp\u002Fstaged.html TARGET_ON_MOUNT\n   ```\n\n   `safe_write.py` writes via temp-file + `fsync` + atomic `os.replace`,\n   then reopens the target and confirms its length and sha256 match the\n   source. Exit 0 means *verified, byte-identical*. Anything else: the\n   write did not land — do not trust it.\n\n   **Verify before promote.** With `--validate`, the staged temp file is\n   checked for *validity* — not just intactness — **before** the atomic\n   move, so a broken file never replaces the good one. The check is\n   language-aware (`scripts\u002Fvalidators.py`): `.el` byte-compiles, `.py`\n   runs `py_compile`, `.html` must carry its closing tag. A missing\n   toolchain (e.g. no emacs on the box) is a SKIP, never a block — the\n   byte\u002Fstructure checks still guard truncation. Exit 2 = staged file\n   failed validation, target left untouched.\n\n3. The file-tool cache is now **stale**. Before you touch this file with\n   Edit\u002FWrite again, `Read` it to resync — or just keep editing through\n   bash, which never lies about the disk.\n\n## The independent verifier\n\nWhen you only need to *check* a file (not write it), or want a second\nopinion after any write:\n\n```\npython3 scripts\u002Fverify.py FILE [--validate] [--expect-lines N] [--expect-sha SHA]\n```\n\nIt always prints byte count, line count, sha256, and the last 3 lines, and\nruns structural checks by extension (HTML: is `\u003C\u002Fhtml>` present; JS\u002FHTML:\nare `{} () []` balanced). With `--validate` it also runs the language-aware\nvalidity check (compile\u002Fparse), so \"intact\" is raised to \"intact *and*\nvalid\". A line count that *drops* after an additive edit is truncation until\nproven otherwise. Use two or more of these signals together; no single check\nis proof.\n\n## Recovery from a truncation\n\n1. Find the cut: `tail -3 FILE` and `wc -l FILE` against what you expected.\n2. Rebuild the **whole** correct content in a VM-local temp file (don't try\n   to patch the tail through the file tool — that is the path that failed).\n3. `safe_write.py TEMP TARGET`, then `verify.py TARGET` to confirm the\n   close-tags and counts are whole.\n\n### When the mount is a git repo: trust HEAD, not your memory\n\nIf the truncated files are committed, the authoritative content already\nlives in **git objects** — you don't have to reconstruct from memory, and\nyou have an exact reference to measure against. Two moves:\n\n- **Cross-check first.** Compare disk against HEAD instead of \"what you\n  expected\": `git show HEAD:path | wc -l` vs `wc -l path`, or\n  `git cat-file -s HEAD:path` vs the on-disk byte count. A disk shorter\n  than HEAD *is* the truncation, confirmed against an authority.\n- **Restore from the object, not the index.** `git show HEAD:path > path`\n  (equivalently `git cat-file -p HEAD:path > path`) writes the real disk\n  through bash and **never touches the index** — so it works even when\n  `git checkout` \u002F `git restore` are blocked by a locked index (see below).\n  Then `verify.py path` or re-compare to HEAD to confirm.\n\n### Mass desync — one truncation is rarely alone\n\nA desync isn't always one file. A single bad crossing can leave **every**\nfile you recently wrote short of HEAD at once. When you catch one truncation\non a git mount, **scan the whole working set** before declaring victory:\n\n```\ngit diff --name-only HEAD | while read f; do\n  printf '%s  disk=%s  head=%s\\n' \"$f\" \\\n    \"$(wc -l \u003C \"$f\")\" \"$(git show \"HEAD:$f\" | wc -l)\"\ndone\n```\n\nAny row where `disk \u003C head` is a truncated file; restore each with\n`git show HEAD:path > path`. One loop fixes the mass case; don't restore\njust the file that happened to throw the error.\n\n## Deleting on the mount\n\nWriting is only half the crossing. **Deletion from the sandbox is blocked** —\n`rm` on the mount returns *operation not permitted*, whether the file is held\nby a running app on the user's side (a stale `.elc` still open in their Emacs)\nor is plain cruft (`src\u002Fbattle-board.el`). bash can't remove it and the file\ntool can't either. This is not a desync you verify your way past — the disk\nsimply refuses the sandbox's hand. No amount of retrying changes the answer.\n\nTwo real paths to delete:\n\n1. **Hand it to the user's shell.** They run `rm`, a sweep target like\n   `make clean`, or `git rm` for tracked files. This is the default for build\n   cruft and anything their own tools hold open.\n2. **The Cowork delete tool** — `mcp__cowork__allow_cowork_file_delete` — when\n   the delete should happen from this side rather than theirs.\n\nEither way, **confirm the file is actually gone on disk** afterward (`ls`,\n`test -e`) — same discipline as a write: trust the disk, not the message.\n\nA stale artifact you *can't* delete has a second cost beyond the clutter: it\ncan **shadow** the fresh source you *did* write, so the runtime keeps loading\nthe old behavior and a good edit looks broken. That failure mode — and how to\nget past it without the delete — has its own section below: *When fresh source\nstill runs old*.\n\n### A locked `.git\u002Findex.lock` — same refusal, wider blast radius\n\nThe same *operation not permitted* shows up on `.git\u002Findex.lock`. A git\nprocess on the user's Windows side (an editor's VC layer, a half-finished\ncommit) leaves the lock behind; the sandbox can't `rm` it, and while it sits\nthere **every** index-touching git command fails — `checkout`, `restore`,\n`add`, `commit`. It looks like git is broken; it's just one file the disk\nwon't let go of.\n\nTwo moves, and they compose with the recovery above:\n\n1. **Don't wait on the lock to recover.** Restores that read objects and\n   write the worktree — `git show HEAD:path > path`, `git cat-file -p` —\n   never take the index lock, so a truncation can be fixed *while the lock\n   still sits there*. Reach for these before anything that stages.\n2. **Hand the lock to the user.** Only they can remove it: delete\n   `…\\.git\\index.lock` (Explorer or PowerShell `Remove-Item`) once no git\n   operation is actively running. Then staging commands work again.\n\nAs always, **confirm on disk** — `test -e .git\u002Findex.lock` should fail, and\n`git status` should run clean — before trusting that git is whole again.\n\n## When the read itself is stale — the read-side desync\n\nThe write-side desync is the file tool trusting a stale cache when it *writes*.\nIts quieter twin is on the **read**: bash on the mount hands you old or truncated\nbytes while the disk — and the file tool reading it — hold the whole, current\nfile. Same lie as the write-side, but now it corrupts what you *see*, not what\nyou save. And it is more dangerous than it looks: a phantom truncation can bait a\n**destructive \"repair\"** — you rebuild and overwrite a file that was never broken,\nclobbering good content with your reconstruction.\n\nThe tell we caught it by: the mount's `stat` reported the **same mtime to the\nnanosecond** across reads that straddled a real resave, and the byte count sat\nfrozen (3465, cut mid-word at `chal`, no trailing newline) while the file tool's\n`Read` showed the line whole. The mount reader was stuck on a stale view.\n\n**Cache-busting inside bash does not clear it.** `cp` to `\u002Ftmp`, `dd`, a fresh fd\n— all returned the same short bytes. The stale view lives in the mount layer, so\nevery bash-side reader inherits it; copying just propagates the bad bytes. The\nwrite-side habit of \"read it back in bash to confirm\" is therefore **no proof for\nreads** — the confirming reader is stale too.\n\n**The detector is a cross-read across two independent paths.** The mount (bash)\nand the file tool reach the disk by different routes; when a read matters, take\nboth and compare. `verify.py FILE` prints the mount-side fingerprint — byte count,\nline count, sha256, last 3 lines — and the `Read` tool shows the file-tool view.\nIf the tails or line counts disagree, one reader is stale. Trust the copy with the\n**complete tail \u002F newer mtime**; treat the frozen one as the lie.\n\n**The safety rule — never repair off a single reader.** Before you rebuild,\nre-distill, or overwrite anything because it *looks* truncated, confirm the cut on\nthe independent path first. A file that reads short on the mount but whole through\nthe file tool is **not** truncated — it is a stale read, and \"fixing\" it would\ndestroy the good disk copy. Measure on both paths; only the agreement is proof.\n*Trust the disk — but first make sure you are actually reading it.*\n\n## Reader trust rules — when the seam moves from bytes to operations\n\nThe desyncs above are about one file's bytes. Four rules cover the wider\npattern we keep meeting: which *reader* to trust after which *operation*.\n\n**1. The freshness law: new files read fresh; edited files read stale.**\nA file *created* this session reads correctly everywhere. A file *edited\nthrough the file tool* this session may serve stale bytes to every bash\nreader from then on (observed ×3 in one round, plus a signature sweep that\nread BAD off stale bytes while a fresh-named host copy verified Good).\nRule: after a file-tool edit, bash is no longer a valid verifier for that\nfile — verify through the file tool, or copy to a *fresh name* and verify\nthe copy.\n\n**2. Verification is a read too.** A sha or signature check runs over\nwhatever bytes its reader serves. Run over a stale read it yields false\nBROKEN — and a false BROKEN can trigger a destructive \"repair\" or a panic\nre-sign. Never declare a file broken off a single reader; confirm the\nfailure on the independent path first (same law as the phantom truncation,\napplied to ceremony).\n\n**3. Absence is a reading too.** Existence checks desync in both\ndirections: bash can list a file the file tool's Glob reports missing\n(observed 2026-07-07 on a just-renamed file), and vice versa. \"No files\nfound\" from one reader plus a hit from the other = a stale search, not a\nmissing file. Treat absence like any other claim: two independent sources\nagree, or it is data, not proof.\n\n**4. A timeout does not undo a write.** A wedged tool call that times out\nmay already have landed its appends; re-running it blind doubles them.\nVerify the target's state through a fresh reader BEFORE any retry. For\nheavy scans that time out, split the work into smaller commands rather\nthan re-running the whole thing.\n\n*Trust the disk — through the reader that can still see it.*\n\n## When fresh source still runs old — the execute-side desync\n\nThe write-side desync is the file tool trusting a stale **cache** over the\ndisk. There's a mirror image on the **run** side: the disk holds your fresh\nsource, but the *runtime* loads a stale **compiled artifact** sitting next to\nit and runs the old behavior. Same lie, opposite direction — and it reads as\n\"my edit isn't taking effect\" or \"the old code keeps running\" even though the\nsource on disk is provably correct. *Trust the disk, not the message* applies\nhere too; the message this time is the runtime's, not the file tool's.\n\nTwo runtimes do this by default:\n\n- **Python** imports `__pycache__\u002F\u003Cmod>.cpython-XX.pyc`. It normally recompiles\n  when the `.py` is newer, but that check rides on mtime — and a mounted\n  Windows folder hands back unreliable timestamps, so the **stale `.pyc`** can\n  win and your edit never runs.\n- **Emacs** prefers `foo.elc` over `foo.el` whenever the `.elc` exists, and it\n  does **not** auto-recompile. A stale `.elc` silently shadows the `.el` you\n  just fixed.\n\nConfirm it the way you confirm a truncation — measure, don't assume. Compare\ntimestamps (`ls -l mod.py __pycache__\u002F`), or make the source unmistakably\ndifferent (add a print\u002Fbanner, or raise on import) and watch whether the change\nshows up. If it doesn't, an artifact is shadowing.\n\nTwo cures:\n\n1. **Clear the stale artifact** so the runtime falls back to source and\n   recompiles — delete the `.pyc` \u002F `__pycache__`, the `.elc`, or run the\n   project's `make clean`. But deletion on the mount is often **blocked** (see\n   *Deleting on the mount* above) and the artifact may be held open by the\n   user's running app, so this usually means handing the delete to the user.\n2. **Run a copy off the mount.** When you can't delete the artifact, copy the\n   source to a VM-local path and run it there:\n\n   ```\n   cp mod.py \u002Ftmp\u002Fmod.py && python3 \u002Ftmp\u002Fmod.py\n   ```\n\n   The `\u002Ftmp` copy has no stale neighbor and lives on a normal filesystem, so\n   recompilation works again — the execute-side twin of *writing* through\n   `\u002Ftmp` to dodge the flaky mount. Bring along any sibling modules the script\n   imports. This is the fast path to prove the fresh source is correct without\n   waiting on a blocked delete.\n\nThis skill's own `validators.py` already respects the trap: after byte-compiling\nan `.el` to validate it, it deletes the `.elc` it just produced — so a\nvalidation pass never leaves a fresh shadow behind.\n\n## Relationship to Mentat\n\nSandboxer stands alone — its hazard is large or bursty writes, which are\nusually big build tasks, not note-taking. It does **not** belong inside the\n`mentat-skill`. The one genuine overlap is a *bulk* memory rewrite (many\nnotes rewritten at once): there, Mentat should **reference** Sandboxer for\nthe write-and-verify step rather than re-implement it. Reference when the\nneed is *occasional*; never merge what is only *sometimes* shared.\n\n## Known bad weather — treat the first read as suspect\n\nThe rules above fire when an anomaly *shows*. Bad weather moves the line\nearlier: once this session has seen **any** desync, or the user reports\nchanging files from their own side, every **first** bash read of a mount\npath is suspect *before* anything looks wrong. A stale mount can serve a\nwhole directory old — a deleted `.git\u002F` still listed, a resaved README at\nits old byte count with a frozen mtime — and nothing in that read will\nflag itself. (Observed 2026-07-02: bash showed `pub\u002F.git` present and\nREADME.md at 1735 bytes after the user's own shell had rm'd the one and\nsaved the other at 2080.)\n\nUnder bad weather:\n\n1. **Cross-read before trusting any first read** of a mount path — bash\n   fingerprint (`verify.py`) *and* file-tool Read — especially after the\n   user says they touched files from their side. Don't wait for a tell.\n2. **The user's shell is a third, authoritative reader.** When they paste\n   `ls`\u002F`rm`\u002Feditor output, weigh it above both sandbox paths; if either\n   sandbox reader disagrees with it, the sandbox reader is the stale one.\n3. **Frozen-to-the-nanosecond mtime across a known change is the tell**\n   that confirms it — a real resave moves the clock.\n\nBad weather clears with the session, not with one good read: stay on\ncross-reads for the remainder once weather is declared.\n","# Sandboxer — crossing the sand\n\nThe mounted folder is open sand. The file (Edit\u002FWrite) tool keeps a cached\nview of it, and that cache can drift from the real disk: the tool reports\n*updated successfully* while the bytes never arrive. A footstep that looks\nplanted but never landed. bash on the mount writes the *real* disk — so when\nthe file is large or the crossing matters, cross the sand here and verify\nyour own tracks. *Trust the disk, not the message.*\n\n## When this skill applies\n\n- Writing or editing a **large** file (HTML, code, a long document) on a\n  **mounted** folder — the hazard scales with size.\n- A **burst** of edits to one file in quick succession (a dozen rapid\n  Edits to the same large mount file can trigger desync even with no other\n  red flags).\n- Any moment you need to know **\"did that write actually land?\"** — or a\n  file looks truncated: shorter than expected, cut mid-line, missing its\n  closing tag.\n\nIt does **not** fire for ordinary small writes. Most memory notes and short\nfiles are fine through the normal file tool. This is for the big crossings.\n\n## The hazard, briefly\n\nThe desync is not caused by one single thing. Backticks in the payload\nraise the odds, but a backtick-free file truncated too — so \"no backticks\"\nis *necessary, not sufficient*. Size and bursty edit volume are the larger\ndrivers. After a desync, file-tool writes apply to the **stale cache**, not\nthe disk, and keep reporting success. That is why the tool's own word can\nnever be the proof.\n\n## The crossing (how to write safely)\n\n1. Build the full content and write it to a **VM-local** temp file (e.g.\n   under `\u002Ftmp`), where the flaky mount is out of the loop. A bash\n   heredoc is fine; prefer string concatenation over backtick template\n   literals in JS payloads to keep trigger odds low.\n2. Copy it onto the mount target **atomically and verified**:\n\n   ```\n   python3 scripts\u002Fsafe_write.py [--validate] \u002Ftmp\u002Fstaged.html TARGET_ON_MOUNT\n   ```\n\n   `safe_write.py` writes via temp-file + `fsync` + atomic `os.replace`,\n   then reopens the target and confirms its length and sha256 match the\n   source. Exit 0 means *verified, byte-identical*. Anything else: the\n   write did not land — do not trust it.\n\n   **Verify before promote.** With `--validate`, the staged temp file is\n   checked for *validity* — not just intactness — **before** the atomic\n   move, so a broken file never replaces the good one. The check is\n   language-aware (`scripts\u002Fvalidators.py`): `.el` byte-compiles, `.py`\n   runs `py_compile`, `.html` must carry its closing tag. A missing\n   toolchain (e.g. no emacs on the box) is a SKIP, never a block — the\n   byte\u002Fstructure checks still guard truncation. Exit 2 = staged file\n   failed validation, target left untouched.\n\n3. The file-tool cache is now **stale**. Before you touch this file with\n   Edit\u002FWrite again, `Read` it to resync — or just keep editing through\n   bash, which never lies about the disk.\n\n## The independent verifier\n\nWhen you only need to *check* a file (not write it), or want a second\nopinion after any write:\n\n```\npython3 scripts\u002Fverify.py FILE [--validate] [--expect-lines N] [--expect-sha SHA]\n```\n\nIt always prints byte count, line count, sha256, and the last 3 lines, and\nruns structural checks by extension (HTML: is `\u003C\u002Fhtml>` present; JS\u002FHTML:\nare `{} () []` balanced). With `--validate` it also runs the language-aware\nvalidity check (compile\u002Fparse), so \"intact\" is raised to \"intact *and*\nvalid\". A line count that *drops* after an additive edit is truncation until\nproven otherwise. Use two or more of these signals together; no single check\nis proof.\n\n## Recovery from a truncation\n\n1. Find the cut: `tail -3 FILE` and `wc -l FILE` against what you expected.\n2. Rebuild the **whole** correct content in a VM-local temp file (don't try\n   to patch the tail through the file tool — that is the path that failed).\n3. `safe_write.py TEMP TARGET`, then `verify.py TARGET` to confirm the\n   close-tags and counts are whole.\n\n### When the mount is a git repo: trust HEAD, not your memory\n\nIf the truncated files are committed, the authoritative content already\nlives in **git objects** — you don't have to reconstruct from memory, and\nyou have an exact reference to measure against. Two moves:\n\n- **Cross-check first.** Compare disk against HEAD instead of \"what you\n  expected\": `git show HEAD:path | wc -l` vs `wc -l path`, or\n  `git cat-file -s HEAD:path` vs the on-disk byte count. A disk shorter\n  than HEAD *is* the truncation, confirmed against an authority.\n- **Restore from the object, not the index.** `git show HEAD:path > path`\n  (equivalently `git cat-file -p HEAD:path > path`) writes the real disk\n  through bash and **never touches the index** — so it works even when\n  `git checkout` \u002F `git restore` are blocked by a locked index (see below).\n  Then `verify.py path` or re-compare to HEAD to confirm.\n\n### Mass desync — one truncation is rarely alone\n\nA desync isn't always one file. A single bad crossing can leave **every**\nfile you recently wrote short of HEAD at once. When you catch one truncation\non a git mount, **scan the whole working set** before declaring victory:\n\n```\ngit diff --name-only HEAD | while read f; do\n  printf '%s  disk=%s  head=%s\\n' \"$f\" \\\n    \"$(wc -l \u003C \"$f\")\" \"$(git show \"HEAD:$f\" | wc -l)\"\ndone\n```\n\nAny row where `disk \u003C head` is a truncated file; restore each with\n`git show HEAD:path > path`. One loop fixes the mass case; don't restore\njust the file that happened to throw the error.\n\n## Deleting on the mount\n\nWriting is only half the crossing. **Deletion from the sandbox is blocked** —\n`rm` on the mount returns *operation not permitted*, whether the file is held\nby a running app on the user's side (a stale `.elc` still open in their Emacs)\nor is plain cruft (`src\u002Fbattle-board.el`). bash can't remove it and the file\ntool can't either. This is not a desync you verify your way past — the disk\nsimply refuses the sandbox's hand. No amount of retrying changes the answer.\n\nTwo real paths to delete:\n\n1. **Hand it to the user's shell.** They run `rm`, a sweep target like\n   `make clean`, or `git rm` for tracked files. This is the default for build\n   cruft and anything their own tools hold open.\n2. **The Cowork delete tool** — `mcp__cowork__allow_cowork_file_delete` — when\n   the delete should happen from this side rather than theirs.\n\nEither way, **confirm the file is actually gone on disk** afterward (`ls`,\n`test -e`) — same discipline as a write: trust the disk, not the message.\n\nA stale artifact you *can't* delete has a second cost beyond the clutter: it\ncan **shadow** the fresh source you *did* write, so the runtime keeps loading\nthe old behavior and a good edit looks broken. That failure mode — and how to\nget past it without the delete — has its own section below: *When fresh source\nstill runs old*.\n\n### A locked `.git\u002Findex.lock` — same refusal, wider blast radius\n\nThe same *operation not permitted* shows up on `.git\u002Findex.lock`. A git\nprocess on the user's Windows side (an editor's VC layer, a half-finished\ncommit) leaves the lock behind; the sandbox can't `rm` it, and while it sits\nthere **every** index-touching git command fails — `checkout`, `restore`,\n`add`, `commit`. It looks like git is broken; it's just one file the disk\nwon't let go of.\n\nTwo moves, and they compose with the recovery above:\n\n1. **Don't wait on the lock to recover.** Restores that read objects and\n   write the worktree — `git show HEAD:path > path`, `git cat-file -p` —\n   never take the index lock, so a truncation can be fixed *while the lock\n   still sits there*. Reach for these before anything that stages.\n2. **Hand the lock to the user.** Only they can remove it: delete\n   `…\\.git\\index.lock` (Explorer or PowerShell `Remove-Item`) once no git\n   operation is actively running. Then staging commands work again.\n\nAs always, **confirm on disk** — `test -e .git\u002Findex.lock` should fail, and\n`git status` should run clean — before trusting that git is whole again.\n\n## When the read itself is stale — the read-side desync\n\nThe write-side desync is the file tool trusting a stale cache when it *writes*.\nIts quieter twin is on the **read**: bash on the mount hands you old or truncated\nbytes while the disk — and the file tool reading it — hold the whole, current\nfile. Same lie as the write-side, but now it corrupts what you *see*, not what\nyou save. And it is more dangerous than it looks: a phantom truncation can bait a\n**destructive \"repair\"** — you rebuild and overwrite a file that was never broken,\nclobbering good content with your reconstruction.\n\nThe tell we caught it by: the mount's `stat` reported the **same mtime to the\nnanosecond** across reads that straddled a real resave, and the byte count sat\nfrozen (3465, cut mid-word at `chal`, no trailing newline) while the file tool's\n`Read` showed the line whole. The mount reader was stuck on a stale view.\n\n**Cache-busting inside bash does not clear it.** `cp` to `\u002Ftmp`, `dd`, a fresh fd\n— all returned the same short bytes. The stale view lives in the mount layer, so\nevery bash-side reader inherits it; copying just propagates the bad bytes. The\nwrite-side habit of \"read it back in bash to confirm\" is therefore **no proof for\nreads** — the confirming reader is stale too.\n\n**The detector is a cross-read across two independent paths.** The mount (bash)\nand the file tool reach the disk by different routes; when a read matters, take\nboth and compare. `verify.py FILE` prints the mount-side fingerprint — byte count,\nline count, sha256, last 3 lines — and the `Read` tool shows the file-tool view.\nIf the tails or line counts disagree, one reader is stale. Trust the copy with the\n**complete tail \u002F newer mtime**; treat the frozen one as the lie.\n\n**The safety rule — never repair off a single reader.** Before you rebuild,\nre-distill, or overwrite anything because it *looks* truncated, confirm the cut on\nthe independent path first. A file that reads short on the mount but whole through\nthe file tool is **not** truncated — it is a stale read, and \"fixing\" it would\ndestroy the good disk copy. Measure on both paths; only the agreement is proof.\n*Trust the disk — but first make sure you are actually reading it.*\n\n## Reader trust rules — when the seam moves from bytes to operations\n\nThe desyncs above are about one file's bytes. Four rules cover the wider\npattern we keep meeting: which *reader* to trust after which *operation*.\n\n**1. The freshness law: new files read fresh; edited files read stale.**\nA file *created* this session reads correctly everywhere. A file *edited\nthrough the file tool* this session may serve stale bytes to every bash\nreader from then on (observed ×3 in one round, plus a signature sweep that\nread BAD off stale bytes while a fresh-named host copy verified Good).\nRule: after a file-tool edit, bash is no longer a valid verifier for that\nfile — verify through the file tool, or copy to a *fresh name* and verify\nthe copy.\n\n**2. Verification is a read too.** A sha or signature check runs over\nwhatever bytes its reader serves. Run over a stale read it yields false\nBROKEN — and a false BROKEN can trigger a destructive \"repair\" or a panic\nre-sign. Never declare a file broken off a single reader; confirm the\nfailure on the independent path first (same law as the phantom truncation,\napplied to ceremony).\n\n**3. Absence is a reading too.** Existence checks desync in both\ndirections: bash can list a file the file tool's Glob reports missing\n(observed 2026-07-07 on a just-renamed file), and vice versa. \"No files\nfound\" from one reader plus a hit from the other = a stale search, not a\nmissing file. Treat absence like any other claim: two independent sources\nagree, or it is data, not proof.\n\n**4. A timeout does not undo a write.** A wedged tool call that times out\nmay already have landed its appends; re-running it blind doubles them.\nVerify the target's state through a fresh reader BEFORE any retry. For\nheavy scans that time out, split the work into smaller commands rather\nthan re-running the whole thing.\n\n*Trust the disk — through the reader that can still see it.*\n\n## When fresh source still runs old — the execute-side desync\n\nThe write-side desync is the file tool trusting a stale **cache** over the\ndisk. There's a mirror image on the **run** side: the disk holds your fresh\nsource, but the *runtime* loads a stale **compiled artifact** sitting next to\nit and runs the old behavior. Same lie, opposite direction — and it reads as\n\"my edit isn't taking effect\" or \"the old code keeps running\" even though the\nsource on disk is provably correct. *Trust the disk, not the message* applies\nhere too; the message this time is the runtime's, not the file tool's.\n\nTwo runtimes do this by default:\n\n- **Python** imports `__pycache__\u002F\u003Cmod>.cpython-XX.pyc`. It normally recompiles\n  when the `.py` is newer, but that check rides on mtime — and a mounted\n  Windows folder hands back unreliable timestamps, so the **stale `.pyc`** can\n  win and your edit never runs.\n- **Emacs** prefers `foo.elc` over `foo.el` whenever the `.elc` exists, and it\n  does **not** auto-recompile. A stale `.elc` silently shadows the `.el` you\n  just fixed.\n\nConfirm it the way you confirm a truncation — measure, don't assume. Compare\ntimestamps (`ls -l mod.py __pycache__\u002F`), or make the source unmistakably\ndifferent (add a print\u002Fbanner, or raise on import) and watch whether the change\nshows up. If it doesn't, an artifact is shadowing.\n\nTwo cures:\n\n1. **Clear the stale artifact** so the runtime falls back to source and\n   recompiles — delete the `.pyc` \u002F `__pycache__`, the `.elc`, or run the\n   project's `make clean`. But deletion on the mount is often **blocked** (see\n   *Deleting on the mount* above) and the artifact may be held open by the\n   user's running app, so this usually means handing the delete to the user.\n2. **Run a copy off the mount.** When you can't delete the artifact, copy the\n   source to a VM-local path and run it there:\n\n   ```\n   cp mod.py \u002Ftmp\u002Fmod.py && python3 \u002Ftmp\u002Fmod.py\n   ```\n\n   The `\u002Ftmp` copy has no stale neighbor and lives on a normal filesystem, so\n   recompilation works again — the execute-side twin of *writing* through\n   `\u002Ftmp` to dodge the flaky mount. Bring along any sibling modules the script\n   imports. This is the fast path to prove the fresh source is correct without\n   waiting on a blocked delete.\n\nThis skill's own `validators.py` already respects the trap: after byte-compiling\nan `.el` to validate it, it deletes the `.elc` it just produced — so a\nvalidation pass never leaves a fresh shadow behind.\n\n## Relationship to Mentat\n\nSandboxer stands alone — its hazard is large or bursty writes, which are\nusually big build tasks, not note-taking. It does **not** belong inside the\n`mentat-skill`. The one genuine overlap is a *bulk* memory rewrite (many\nnotes rewritten at once): there, Mentat should **reference** Sandboxer for\nthe write-and-verify step rather than re-implement it. Reference when the\nneed is *occasional*; never merge what is only *sometimes* shared.\n\n## Known bad weather — treat the first read as suspect\n\nThe rules above fire when an anomaly *shows*. Bad weather moves the line\nearlier: once this session has seen **any** desync, or the user reports\nchanging files from their own side, every **first** bash read of a mount\npath is suspect *before* anything looks wrong. A stale mount can serve a\nwhole directory old — a deleted `.git\u002F` still listed, a resaved README at\nits old byte count with a frozen mtime — and nothing in that read will\nflag itself. (Observed 2026-07-02: bash showed `pub\u002F.git` present and\nREADME.md at 1735 bytes after the user's own shell had rm'd the one and\nsaved the other at 2080.)\n\nUnder bad weather:\n\n1. **Cross-read before trusting any first read** of a mount path — bash\n   fingerprint (`verify.py`) *and* file-tool Read — especially after the\n   user says they touched files from their side. Don't wait for a tell.\n2. **The user's shell is a third, authoritative reader.** When they paste\n   `ls`\u002F`rm`\u002Feditor output, weigh it above both sandbox paths; if either\n   sandbox reader disagrees with it, the sandbox reader is the stale one.\n3. **Frozen-to-the-nanosecond mtime across a known change is the tell**\n   that confirms it — a real resave moves the clock.\n\nBad weather clears with the session, not with one good read: stay on\ncross-reads for the remainder once weather is declared.\n",{},"main","0b0a0f665f67605c3bc1d43500eea26ef3079a97",".arc\u002F2026-08-17-inbox-clearance\u002F2026-07-09-promotions\u002Fsandboxer-patch\u002Fpatched\u002Fsandboxer","https:\u002F\u002Fgithub.com\u002Finputloop\u002Fgarden","https:\u002F\u002Fgithub.com\u002Finputloop","2026-10-14 18:29:39",{"source":7,"skillName":5,"commands":30,"prompt":40,"zipAvailable":41},[31,34,37],{"tool":32,"command":33},"npx","npx skills add inputloop\u002Fgarden --skill sandboxer",{"tool":35,"command":36},"bunx","bunx skills add inputloop\u002Fgarden --skill sandboxer",{"tool":38,"command":39},"pnpm","pnpm dlx skills add inputloop\u002Fgarden --skill sandboxer","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Finputloop\u002Fgarden\u002Fblob\u002Fmain\u002F.arc\u002F2026-08-17-inbox-clearance\u002F2026-07-09-promotions\u002Fsandboxer-patch\u002Fpatched\u002Fsandboxer\u002FSKILL.md",true,[43,49,53],{"path":44,"resourceType":45,"resourceTypeDesc":46,"sizeBytes":47,"sourceHtmlUrl":48},"scripts\u002Fsafe_write.py","SCRIPT","脚本",3399,"https:\u002F\u002Fgithub.com\u002Finputloop\u002Fgarden\u002Fblob\u002Fmain\u002F.arc\u002F2026-08-17-inbox-clearance\u002F2026-07-09-promotions\u002Fsandboxer-patch\u002Fpatched\u002Fsandboxer\u002Fscripts\u002Fsafe_write.py",{"path":50,"resourceType":45,"resourceTypeDesc":46,"sizeBytes":51,"sourceHtmlUrl":52},"scripts\u002Fvalidators.py",2510,"https:\u002F\u002Fgithub.com\u002Finputloop\u002Fgarden\u002Fblob\u002Fmain\u002F.arc\u002F2026-08-17-inbox-clearance\u002F2026-07-09-promotions\u002Fsandboxer-patch\u002Fpatched\u002Fsandboxer\u002Fscripts\u002Fvalidators.py",{"path":54,"resourceType":45,"resourceTypeDesc":46,"sizeBytes":55,"sourceHtmlUrl":56},"scripts\u002Fverify.py",4312,"https:\u002F\u002Fgithub.com\u002Finputloop\u002Fgarden\u002Fblob\u002Fmain\u002F.arc\u002F2026-08-17-inbox-clearance\u002F2026-07-09-promotions\u002Fsandboxer-patch\u002Fpatched\u002Fsandboxer\u002Fscripts\u002Fverify.py",[58,64,70,77,84,91],{"skillNo":59,"name":60,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":61,"categories":62,"keywords":63,"publishedAt":18},"01M7EPTX6X52ZPGVQZHKVJ7FAZ","alpha","https:\u002F\u002Fgithub.com\u002Finputloop\u002Fgarden\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Flane-d\u002Fbr1in\u002Fours\u002Fskills\u002Falpha\u002FSKILL.md",[],[],{"skillNo":65,"name":66,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":18},"01M7EPTWCTS80QHFQ2ND3A1CW1","gamma","https:\u002F\u002Fgithub.com\u002Finputloop\u002Fgarden\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Flane-d\u002Fbr1in\u002Fours\u002FSOFT-SKILLS\u002Fgamma\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":18},"01M7EPTV3K3SCTRP0DR6BMMKR0","quiet","A fixture skill that declares no preferences, so skill.quiet.* has no reader.","https:\u002F\u002Fgithub.com\u002Finputloop\u002Fgarden\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Flane-a\u002Fdeclared\u002Fsoft\u002Fquiet\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":18},"01M7EPTSG0VE67F6PFAC0XJDQ4","demo","A fixture skill for tests\u002Fprefs-declared-spec.rb; it declares two preferences inline.","https:\u002F\u002Fgithub.com\u002Finputloop\u002Fgarden\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Flane-a\u002Fdeclared\u002Fsoft\u002Fdemo\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":18},"01M7EPTP0PM5WPTFBHPXBCFM5C","concise","Synthesized by polygram from memory tag 'concise'. explicitly flagged. Review and tighten this description before relying on it for triggering.","https:\u002F\u002Fgithub.com\u002Finputloop\u002Fgarden\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fconcise\u002FSKILL.md",[],[],{"skillNo":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":18},"01M7EPTAETQ62DJA8ZFEEBBZF0","writing-forms","Which writing form a dated deliverable takes in the shop, and the five techniques every form shares. Use whenever someone is about to write a dated deliverable — \"which form is this?\", \"write it up\", \"land a note \u002F card \u002F model \u002F lens\", \"what shape does a … take\", \"is there a form for this\", or when a new PREFIX-date-slug filename is about to be minted. Carries the rule that a deliverable picks ONE form and says so in its filename, points at the register c\u002Fwf (columns d\u002Fc\u002Fwf) as the source of truth, names the most-used forms, the five cross-cutting techniques (two piles · cite at the act · a falsifier on every concern · the pair rule · his words), how a new form is born, and the fence on notes other sessions wrote. Not rolls (report kinds and their guards), not reformat-prompt (the REFORMAT pair), not run-card (the RUNCARD), not skill-creator (skills). Owns the FORM, not the content.","https:\u002F\u002Fgithub.com\u002Finputloop\u002Fgarden\u002Fblob\u002Fmain\u002Fskills\u002Fwriting-forms\u002FSKILL.md",[],[]]