Repository navigation
fix: clean disposable resources after development tasks - #443
Merged
Merged
Conversation
devSejung
marked this pull request as ready for review
November 4, 2026 07:49
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.
Closes #442
What Problem This Solves
Fixes an issue where developers repeatedly exhaust disk space because verification work leaves source clones, temporary inputs, worktrees, and tagged Docker images without one completion owner. Manual cleanup could not safely distinguish disposable work from another active task.
Why This Change Was Made
Add a dependency-free Node/Git developer workflow:
create, boundedrun, managedimage, explicitfinish,recover,list,sweep, and report-onlyaudit. Worktrees share the primary Git repository; task-local temporary inputs and namespace-tagged verification images have recorded ownership in a separate development-only SQLite registry. This bootstrap registry uses fixed parameterized native SQLite primitives because setup/cleanup must work before package installation; product runtime databases and schema versions are untouched.The existing development cleanup remains the sweep entry point. Per-task OS-owned locks serialize lifecycle operations; shared Git mutations have their own lock. Windows uses named pipes and Linux uses abstract Unix sockets, avoiding observed TCP ephemeral-port collisions and stale lock files. A hard-killed controller does not imply completion: uncertain tasks require explicit confirmation that their descendants stopped.
Image cleanup never force-removes images or implicitly prunes unmanaged parents. Dirty, untracked, ignored, hidden-index-modified, or container-referenced work is preserved. The existing Windows dependency-link guard is accepted only for exact unchanged tracked link placeholders. Docker build success is verified against an actual local owned image and the recorded engine.
User Impact
scripts/README.md, linked fromPLATFORMCLAW.mdand producer policy inscripts/AGENTS.md.This is AI-assisted. Existing operator changes and services were preserved.
Evidence
Source base:
0c813eea16424a69d1c49f55853de42199f454dc(main including the composer alignment fix, PR #441). Final candidate bytes were matched by SHA-256 across all 11 changed files between the Windows worktree and isolated Linux proof checkout.pnpm install --frozen-lockfile:OPENCLAW_CHECK_CHANGED_REMOTE_CHILD=1 node scripts/platformclaw-check.mjs --changedpassed. This includes 112 focused tests (20 lifecycle, 62 runtime contracts, 21 CI-plan, 9 shared-check), formatting, script declarations, root test types, dependency/patch/policy guards, and lint of 910 scripts. No gate/skip flags were used to turn failures into passes..gitinstallation path and four-hour/bounded arguments passed with task registration stubbed; the operator's actual scheduled task was not changed.--help) failed before the fix and passes after verification was added.git diff --checkpassed. Independent autoreview: final P0–P2scoped-clean(exit 0). Repaired findings included hidden Git index changes, implicit parent image pruning, grouped Docker publication flags, and hidden Windows.gitinstallation. Manual boundary checks additionally found and repaired exit-0/no-image reporting and TCP lock collisions.Production LOC delta: +729 (including the 684-line dependency-free lifecycle owner); tests +410, documentation/instructions +158. Growth is justified by the previously missing developer resource owner and its safety boundary, not a product/runtime feature. There are no new packages or package installs in Windows linked worktrees.
Setup after merge
From the updated primary checkout (not a removable linked worktree):
Boundaries and follow-ups
Legacy independent clones/proof artifacts need separate ownership classification; timestamps or matching names alone do not authorize deletion. Most audited sibling clones share Git objects through alternates, and junctions are not duplicate dependency bytes. The actual host has 17 sibling clones plus the primary checkout, not 18 complete copies of history.
Existing release rollback provenance and deployment/archive retention remain release-owner follow-ups; this PR does not claim to fix those or bound total disk/VHDX size. Managed commands support Windows/Linux and must not daemonize. Final release images/archives, operator containers, data volumes, and VHDX compaction remain separate lifecycle contracts.