Skip to content

feat(loop-worktree): expose public lock API - #407

Merged
cobusgreyling merged 1 commit into
cobusgreyling:mainfrom
shixi-li:codex/public-loop-worktree-lock
Jul 29, 2026
Merged

feat(loop-worktree): expose public lock API#407
cobusgreyling merged 1 commit into
cobusgreyling:mainfrom
shixi-li:codex/public-loop-worktree-lock

Conversation

@shixi-li

Copy link
Copy Markdown
Contributor

Summary

Expose the advisory lock coordinator through the supported
@cobusgreyling/loop-worktree/lock subpath, following the explicit follow-up
welcomed in #399.

Why

loop-sandbox currently reaches into
@cobusgreyling/loop-worktree/dist/lock.js. That private build path makes
consumers depend on package layout rather than a public contract. This PR
establishes the package contract without changing lock runtime behavior.

The loop-sandbox import migration is intentionally deferred until
loop-worktree@1.3.0 is published and #398 has settled, avoiding a
cross-package release dependency and overlapping changes.

Changes

  • add root and ./lock conditional exports with declaration mappings
  • retain ./dist/* and ./package.json compatibility exports
  • add typesVersions support for classic TypeScript module resolution
  • bump loop-worktree to 1.3.0, align the previously stale lockfile, and
    update the publish checklist
  • document the public library imports
  • run the existing lock suite through the public package self-reference
  • add a packed, clean-consumer test covering root, public lock, legacy deep
    imports, and NodeNext/classic TypeScript resolution
  • invoke npm portably in the consumer test and keep cleanup compatible with
    the full declared Node 18 range

Scope

This PR does not modify loop-sandbox, manifest concurrency, or the open #398
work.

Validation

  • cd tools/loop-worktree && npm test — 32/32 passed
  • cd tools/loop-audit && npm run build && node dist/cli.js ../.. — 100/100 L3
  • git diff --check

Follow-up to #399.

@shixi-li
shixi-li force-pushed the codex/public-loop-worktree-lock branch from 64942cb to 52476ed Compare July 29, 2026 09:10
@shixi-li
shixi-li marked this pull request as ready for review July 29, 2026 09:11
@shixi-li
shixi-li requested a review from cobusgreyling as a code owner July 29, 2026 09:11
@shixi-li

Copy link
Copy Markdown
Contributor Author

Rebased this PR onto current main (081fca1) and marked it ready for review.

The rebase was conflict-free, and git range-diff confirms that the PR commits remain patch-equivalent. The scope is unchanged: the public loop-worktree/lock export, package export map, tests, and documentation.

Validation on the rebased head 52476ed:

  • tools/loop-worktree: npm test — 32/32 passed.
  • tools/loop: npm test — 10/10 passed.
  • tools/loop-audit: npm run build — passed.
  • node tools/loop-audit/dist/cli.js . — 100/100 (L3), passed.
  • node tools/loop/dist/cli.js status . — passed.
  • bash scripts/before-after-demo.sh — passed through all stages.
  • node tools/loop/dist/cli.js doctor . reports the repository's existing Sync score of 90 and exits 1. I ran the same built CLI against a clean worktree at unmodified main; it produced the identical Sync warning and exit code, so this is not introduced by this PR.

This follows the maintainer's explicit invitation on #399 for a public loop-worktree/lock export. The broader loop-sandbox migration remains intentionally out of scope, as documented in the PR.

Ready for maintainer review.

@cobusgreyling cobusgreyling left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Review

Clean package-contract PR for the advisory lock coordinator:

  • Public @cobusgreyling/loop-worktree/lock export map + typesVersions
  • Tests import via the public subpath; new pack/export test covers the contract
  • README documents the stable entry point
  • Version bump 1.2.0 → 1.3.0 + RELEASE_NOTES_DRAFT publish note
  • Scope correctly defers loop-sandbox import migration

Merge. Thanks @shixi-li — good follow-up to #399.

@cobusgreyling
cobusgreyling merged commit 5df729a into cobusgreyling:main Jul 29, 2026
2 checks passed
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.

2 participants