Skip to content

fix(marketplace): preserve remote cache ownership - #482

Open
christso wants to merge 1 commit into
mainfrom
fix/marketplace-cache-ownership
Open

christso wants to merge 1 commit into
mainfrom
fix/marketplace-cache-ownership

Conversation

@christso

Copy link
Copy Markdown
Contributor

Summary

Replacing a remote marketplace under an existing managed name now publishes the requested repository and registry entry as one ownership-safe transaction. Same-process marketplace lifecycle operations serialize by cache path, and project registries use namespaced cache roots so one scope cannot overwrite another.

This follows the registry-write serialization in #473 and closes the remaining path where the registry could name source B while the managed cache still contained source A.

Design decisions

  • Clone and validate the requested remote in staging before touching the live cache.
  • Publish the staged cache with rollback around the registry commit. Cleanup failures remain visible as warnings instead of hiding the primary failure.
  • Derive the live cache path from the final canonical registry key. Project registries receive stable, registry-specific cache roots.
  • Keep local marketplaces user-owned and unchanged.

Validation

Red reproduction before the fix:

bun test tests/unit/core/marketplace-add-branch.test.ts --test-name-pattern "publishes the requested remote source"
0 pass, 1 fail: the registry expected source B, but the cache marker still reported source A.

Green checks on the rebased commit:

  • bun test: 1,542 passed, 6 skipped, 0 failed across 142 files.
  • bun run typecheck: passed.
  • bun run lint: passed across 94 source files.
  • bun run build: bundled 520 modules.
  • Compound Engineering review completed after implementation. All material findings were fixed; the final review had no remaining actionable findings.

Manual built-CLI E2E:

  1. Created two local bare repositories with the same manifest name (shared) and distinct origin.txt markers.
  2. Started git daemon on 127.0.0.1:19418.
  3. Ran HOME="$tmp/home" ./dist/index.js plugin marketplace add git://127.0.0.1:19418/source-a.git --name shared.
  4. Ran HOME="$tmp/home" ./dist/index.js plugin marketplace add git://127.0.0.1:19418/source-b.git --name shared.
  5. Confirmed marketplaces.json, origin.txt, and git remote get-url origin all identified source B. The cache root contained only shared; no .backup-* artifact remained.

Non-goals

  • Cross-process locking remains out of scope; this change coordinates lifecycle operations within one AllAgents process.
  • Local marketplace ownership and update behavior are unchanged.
  • Ordinary user-cache updates do not migrate unrelated legacy aliases. Refresh still handles known legacy project cache locations.

Post-Deploy Monitoring & Validation

AllAgents has no centralized runtime telemetry for local cache operations. During the first release after merge, maintainers should watch CLI output and issue reports for cache publish, rollback, or backup-cleanup warnings. For any report, compare the registry source with git remote get-url origin in the recorded cache path and check its parent for .backup-* entries. A repeated registry/cache mismatch or an unrecoverable backup is the rollback signal; the marketplace transaction should then be reverted before the next release.


Compound Engineering

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.

1 participant