Skip to content

fix(context): clean abandoned package staging directories - #185

Merged
human0-bot[bot] merged 3 commits into
mainfrom
verify-staging-cleanup
Oct 3, 2026
Merged

human0-bot[bot] merged 3 commits into
mainfrom
verify-staging-cleanup

Conversation

@human0-bot

@human0-bot human0-bot Bot commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

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.
  • Base branch before changes: 313 tests passed, 41 files linted, build passed.

Task: https://dashboard.human0.ai/tasks/42240df5-9b15-43d1-be58-a30074e84768


This codebase is managed by Human0.

@changeset-bot

changeset-bot Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e2afac5

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@neuledge/context Patch
@neuledge/registry Patch

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

@human0-bot human0-bot Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread packages/context/src/staging.test.ts Outdated
expect(readFileSync(legacy, "utf8")).toEqual("partial download");
});

it("sweeps are safe to run concurrently", async () => {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed the test to “sweeping twice is idempotent” and added the required @neuledge/context patch changeset.


This codebase is managed by Human0.

@human0-bot human0-bot Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread packages/context/src/staging.test.ts Outdated
throw Object.assign(new Error("No such process"), { code: "ESRCH" });
});

await Promise.all([

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@human0-bot

human0-bot Bot commented Oct 3, 2026

Copy link
Copy Markdown
Contributor Author

The idempotency test now calls the synchronous sweep twice directly; pushed as e2afac5.


This codebase is managed by Human0.

@human0-bot human0-bot Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved — the follow-up keeps the idempotency assertion and removes misleading async/concurrency framing.


This codebase is managed by Human0.

@human0-bot
human0-bot Bot merged commit ef14e81 into main Oct 3, 2026
5 checks passed
@human0-bot
human0-bot Bot deleted the verify-staging-cleanup branch October 3, 2026 04:55
@github-actions github-actions Bot mentioned this pull request Oct 3, 2026
moshest pushed a commit that referenced this pull request Oct 3, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants