fix(subagents): self-healing workspace staging — orphan sweep + self-gitignore - #161
Merged
Conversation
…gitignore The workspace staging root (.odek-artifacts/) had three hygiene gaps the ~/.odek janitor cannot see (it only knows the odek home): - crash/kill before relocation orphaned staging WITH content, forever - the empty staging parent persisted after every artifact-bearing task - staged deliverables were visible to the user's git (accidental commits of sub-agent output) Every artifact-bearing child run now self-heals its workspace: - startup sweep removes sibling staging subtrees older than 24h (aligned with the janitor backstop); the current task dir is never touched and fresh siblings may belong to in-flight parallel tasks - ensureStagingRoot drops a self-gitignore (* / !.gitignore) so staged content is invisible to git even when a run dies mid-write - after relocation the root is re-created tidy (gitignore only) RED first: subagent_staging_sweep_test.go — gitignore creation + idempotency, aged-vs-fresh sweep, missing-root no-op, post-relocation tidy.
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
odek | 0a1a468 | Commit Preview URL Branch Preview URL |
Aug 30 2026, 03:58 PM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes a staging-hygiene gap in the M3 artifact channel (#160, v1.33.0).
Problem
The workspace staging root (
.odek-artifacts/) had three hygiene gaps the~/.odekjanitor cannot see (it only knows the odek home):~/.odek/artifacts/, not user workspaces.Fix — every artifact-bearing child run self-heals its workspace
.gitignore(*/!.gitignore), so staged content is invisible to git even when a run dies mid-write.Normal-path behavior is unchanged (relocation already removed the task dir); this covers the abnormal paths it couldn't.
Verification
cmd/odek/subagent_staging_sweep_test.go— gitignore creation + idempotency, aged-vs-fresh sweep, current-task protection, missing-root no-op, post-relocation tidy.cmd/odeksuite: ok (darwin 72s · linux container 62s) ·-racescoped: ok ·golangci-lint: 0 issues