Skip to content

feat(install): test unpublished SDK extensions with extensions = { path } - #485

Merged
adiman9 merged 9 commits into
mainfrom
feat/install-local-extensions
Oct 30, 2026
Merged

adiman9 merged 9 commits into
mainfrom
feat/install-local-extensions

Conversation

@adiman9

@adiman9 adiman9 commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

What

Test an SDK extension in your app before publishing it, without a4 sdk create:

[dependencies.programs.ore]
source = { registry = "ore" }
version = "^1.0.0"
extensions = { path = "./extensions/ore" }
  • a4 install stages the local bundle in place of the published extension for the bundle's target. It uses the same resolution as a4 sdk create --extensions: an extensions.json, or a single index.ts / extensions.rs / extensions.py entry, with the target taken from the bundle's language. The bundle's content hash goes on the lock entry as local_extension. Every published pin stays, as with local_build.
  • The override isn't resolution input. resolution_hash ignores extensions, so adding or removing it leaves arete.lock fresh.
  • These fail while a dependency uses a local extension:
    • a4 install --check: a problem for the manifest override or a leftover lock marker.
    • a4 protocol deploy: refused before it builds.
    • a4 dev promote --check: new local-extension item. The fix it prints is to publish the extension upstream, remove extensions, then a4 install --locked.
  • a4 install --locked refuses while arete.toml still has an override. Once the override is removed, it drops local_extension along with local_build and restores the published extension.
  • a4 dev up watches each bundle directory. On a change it regenerates only that dependency's SDK and updates the marker, via install_local_extensions, which resolves just that dependency at the lock's pins. That way a protocol client a4 dev generated from a local build stays as it is. When only extension files changed, it redeploys nothing. The up.rs change is a small block in watch_pass; the rest is in the new dev/local_extensions.rs.
  • Docs: cli/commands.mdx (Configuration File and the new "Testing an unpublished SDK extension" section) and cli/local-development.mdx (dev up watch and the promote table row).

Tests

  • installer: a_local_sdk_extension_is_installed_regenerated_and_restored_by_locked runs the whole roundtrip against the mock registry. It covers the published install, the override install with the marker and unchanged pins, --check, --locked and the deploy refusal, a dev regeneration after an edit, an idempotent no-op, then removing the override and running --locked. That restores the published extension, and the lock entry equals the published one again.
  • manifest: which dependencies may declare extensions, and that the resolution hash ignores it.
  • lockfile: validation of local_extension.
  • dev::local_extensions: the watcher snapshot and the changed-path selection.
  • dev::promote: the local-extension item.

Verification

The machine was overloaded, so I didn't build anything locally. I ran only rustfmt --edition 2021 on the changed files, plus prettier on the two docs pages. Compilation, clippy and every test ran only in CI.

…th }

A registry program or stack dependency in arete.toml can name a local SDK
extension bundle, `extensions = { path = "<dir>" }`. `a4 install` stages it
the way `a4 sdk create --extensions` does, in place of the published
extension for the bundle's target, and records its content hash as the lock
entry's `local_extension`; every published pin stays.

The override is not resolution input, so adding or removing it leaves
arete.lock fresh. `a4 install --check`, `a4 protocol deploy` and
`a4 dev promote --check` (new `local-extension` item) fail while it is set;
`a4 install --locked` refuses while arete.toml has one, and once it is
removed restores the published extension and clears the marker.

`a4 dev up` watches each bundle directory and regenerates only that
dependency's SDK when it changes, without redeploying anything else.
@vercel

vercel Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
arete-docs Ready Ready Preview Oct 30, 2026 3:03am UTC

Request Review

@greptile-apps

greptile-apps Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; the protocol-only deploy failure is fixed.

Summary

Adds local SDK extension overrides for registry program and stack dependencies.

  • A local extension can replace the published extension for one SDK target.
  • a4 dev up refreshes an SDK when its local extension changes.
  • Release checks flag SDKs generated with local extensions.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A["arete.toml: extensions path"] --> B["Read local bundle"]
  B --> C["Generate SDK"]
  C --> D["Record local_extension"]
  E["Bundle file changes"] --> F["Refresh selected SDK"]
  F --> D
  D --> G["Deploy and publish checks refuse"]
  H["Remove override; install --locked"] --> I["Restore published SDK and clear marker"]
Loading

Reviews (7) · Last reviewed commit: "fix(cli): a protocol-only arete.toml dec..." · Reviewed by Greptile

Comment thread cli/src/commands/dev/up.rs
Comment thread cli/src/project/installer.rs Outdated
Comment thread cli/src/project/installer.rs Outdated
…e on every bundle change

A bundle may share a directory with the protocol or stack sources: a change
counts as extension-only only for an existing file those watches don't
cover. The dev regeneration reads only the selected bundles and always
regenerates, since the content hash leaves out fields such as extensionApi.
Comment thread cli/src/project/installer.rs
A bundle directory may hold the generated SDK (path = "."); walking it made
each regeneration trigger the next. Watch the bundle's extensions.json, the
files it lists and the conventional entries instead.
# Conflicts:
#	cli/src/commands/dev/promote.rs
#	docs/src/content/docs/cli/local-development.mdx
Comment thread cli/src/project/installer.rs
Base automatically changed from feat/dev-promote-check to main October 30, 2026 02:27
Comment thread cli/src/project/installer.rs
@adiman9
adiman9 merged commit 1f99401 into main Oct 30, 2026
35 checks passed
@adiman9
adiman9 deleted the feat/install-local-extensions branch October 30, 2026 03:47

This branch was successfully deployed

1 active deployment
Preview — 2c7d6c6d Deployed Oct 30, 2026 by vercel[bot]
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