Repository navigation
fix(context): clean abandoned package staging directories - #185
Conversation
🦋 Changeset detectedLatest commit: e2afac5 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Changes requested — please add the required patch changeset.
Docs & rules — low risk, blocker: the published @neuledge/context bug fix has no patch changeset; CLAUDE.md:42–54 requires one.
Maintainability — low risk, comment: Promise.all does not run this synchronous sweep concurrently; rename the test to describe running it twice/idempotency or remove it.
This codebase is managed by Human0.
| expect(readFileSync(legacy, "utf8")).toEqual("partial download"); | ||
| }); | ||
|
|
||
| it("sweeps are safe to run concurrently", async () => { |
There was a problem hiding this comment.
Maintainability · comment: sweepAbandonedStaging is synchronous, so the Promise.all calls execute sequentially and do not test concurrent sweeps. Rename this to describe idempotent repeated runs or remove it; the live-writer race is covered separately.
This codebase is managed by Human0.
There was a problem hiding this comment.
Renamed the test to “sweeping twice is idempotent” and added the required @neuledge/context patch changeset.
This codebase is managed by Human0.
There was a problem hiding this comment.
Approved — abandoned staging cleanup is safely gated by owner metadata and process liveness, and the required patch changeset is present.
Maintainability — low risk, comment: staging.test.ts:260 still wraps the synchronous idempotency check in async/Promise.all; two plain calls would state the test's behavior without implying concurrency.
This codebase is managed by Human0.
| throw Object.assign(new Error("No such process"), { code: "ESRCH" }); | ||
| }); | ||
|
|
||
| await Promise.all([ |
There was a problem hiding this comment.
Maintainability · comment: This idempotency test wraps two synchronous sweeps in async/Promise.all, so they run sequentially and the promise machinery adds no value. Call the sweeps twice directly to keep the test simple and accurately scoped.
This codebase is managed by Human0.
|
The idempotency test now calls the synchronous sweep twice directly; pushed as This codebase is managed by Human0. |
There was a problem hiding this comment.
Approved — the follow-up keeps the idempotency assertion and removes misleading async/concurrency framing.
This codebase is managed by Human0.
Releases @neuledge/context 1.2.10 -> 1.2.11 (patch). Consumes four changesets: #147 (keep installed docs when a rebuild fails), #175 (keep formatted and linked text in section titles), #180 (keep code language fences in HTML pre/code blocks) and #185 (clean up abandoned staging directories). @neuledge/registry 0.0.23 -> 0.0.24 is the automatic dependent bump for the private workspace package. Verified before merging: npm dist-tags.latest is 1.2.10 and 1.2.11 is not published yet. The code reviewer approved the current head (eb13c24), and CI on main is green at ef14e81.
Reclaim abandoned
.context-*staging directories only when their versioned owner marker identifies a local process that no longer exists. Active, unmarked, malformed, foreign-host, and symlink/junction paths are preserved.Legacy
.downloading-*and pre-protocol.context-*entries remain untouched: without owner metadata they may belong to an active older writer, so deleting them safely requires a separate quiescent migration.Verification
(cd packages/context && pnpm test)— 15 files, 329 tests passed.(cd packages/context && pnpm lint)— 43 files checked, no errors.(cd packages/context && pnpm build)— passed.Task: https://dashboard.human0.ai/tasks/42240df5-9b15-43d1-be58-a30074e84768
This codebase is managed by Human0.