dejima-epitaph save made one directory per slug before it knew whether that slug had anything to keep. A workspace's slugs include one per live worktree, and worktrees have transcripts - what they mostly do not have is a compaction summary in any of them. The store therefore read as one entry per worktree with nothing in any of them, which is what the operator hit on the first real run.
What changed
The directory is created by the first write into it, in the Python that writes the file, rather than up front in the shell loop.
An rmdir per slug clears the empty directories earlier runs already left behind. It cannot touch a slug that kept anything, so it is a cleanup and not a risk.
bin/dejima-slug-lib.sh's header still named bin/dejima-audit as the second caller sharing the definition. The cross-project finding that used workspace_slugs was removed in #115, so bin/dejima-epitaph is what shares it now.
Testing
New test in config.bats: a workspace with a live worktree whose transcript carries no summary, plus an empty directory staged as though an earlier run had left it. It asserts no directory survives for that slug and that the workspace's own epitaph is still kept.
Run against the unfixed script first, where it fails on exactly the reported symptom (empty directory left for -tmp-tmp-...-wt), then against the fix. The five existing epitaph tests still pass. Full suite green apart from runtime.bats, which needs a Docker daemon the sandbox does not have and which CI runs in its own job.
**Summary generated by LLM agent**
`dejima-epitaph save` made one directory per slug before it knew whether that slug had anything to keep. A workspace's slugs include one per live worktree, and worktrees have transcripts - what they mostly do not have is a compaction summary in any of them. The store therefore read as one entry per worktree with nothing in any of them, which is what the operator hit on the first real run.
## What changed
- The directory is created by the first write into it, in the Python that writes the file, rather than up front in the shell loop.
- An `rmdir` per slug clears the empty directories earlier runs already left behind. It cannot touch a slug that kept anything, so it is a cleanup and not a risk.
- `bin/dejima-slug-lib.sh`'s header still named `bin/dejima-audit` as the second caller sharing the definition. The cross-project finding that used `workspace_slugs` was removed in #115, so `bin/dejima-epitaph` is what shares it now.
## Testing
New test in `config.bats`: a workspace with a live worktree whose transcript carries no summary, plus an empty directory staged as though an earlier run had left it. It asserts no directory survives for that slug and that the workspace's own epitaph is still kept.
Run against the unfixed script first, where it fails on exactly the reported symptom (`empty directory left for -tmp-tmp-...-wt`), then against the fix. The five existing epitaph tests still pass. Full suite green apart from `runtime.bats`, which needs a Docker daemon the sandbox does not have and which CI runs in its own job.
A workspace's slugs include one per live worktree, and worktrees have
transcripts. What they mostly do not have is a compaction summary in any
of them, so a directory made per slug up front left the store reading as
one entry per worktree with nothing in any of them.
The directory is now made by the first write into it. An `rmdir` per
slug clears the empty ones earlier runs left behind; it cannot touch a
slug that kept anything.
Also corrects dejima-slug-lib.sh's header, which still named
bin/dejima-audit as the second caller. The cross-project finding that
used workspace_slugs was removed in #115; bin/dejima-epitaph is what
shares the definition now.
branderson
approved these changes 2026-08-13 08:43:19 -07:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary generated by LLM agent
dejima-epitaph savemade one directory per slug before it knew whether that slug had anything to keep. A workspace's slugs include one per live worktree, and worktrees have transcripts - what they mostly do not have is a compaction summary in any of them. The store therefore read as one entry per worktree with nothing in any of them, which is what the operator hit on the first real run.What changed
rmdirper slug clears the empty directories earlier runs already left behind. It cannot touch a slug that kept anything, so it is a cleanup and not a risk.bin/dejima-slug-lib.sh's header still namedbin/dejima-auditas the second caller sharing the definition. The cross-project finding that usedworkspace_slugswas removed in #115, sobin/dejima-epitaphis what shares it now.Testing
New test in
config.bats: a workspace with a live worktree whose transcript carries no summary, plus an empty directory staged as though an earlier run had left it. It asserts no directory survives for that slug and that the workspace's own epitaph is still kept.Run against the unfixed script first, where it fails on exactly the reported symptom (
empty directory left for -tmp-tmp-...-wt), then against the fix. The five existing epitaph tests still pass. Full suite green apart fromruntime.bats, which needs a Docker daemon the sandbox does not have and which CI runs in its own job.