Skip to content

Remove the extension API version, its snapshot, push check and release-notes section - #3657

Merged
mstomar125 merged 2 commits into
mainfrom
issue-3651-remove-extension-api-version
Oct 6, 2026
Merged

mstomar125 merged 2 commits into
mainfrom
issue-3651-remove-extension-api-version

Conversation

@mstomar125

@mstomar125 mstomar125 commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Closes #3651

Implements ADR-082 §8 as amended 2026-10-05: extension points carry no version; a change reaches the consuming build through its core pin.

Changes

  • Removed EXTENSION_API_VERSION (TypeScript ui-extensions.ts, host API re-export, Rust app-lib/src/extensions/mod.rs and its re-export) and the Rust "is two six" pin test.
  • NodespaceExtension has no apiVersion; registration no longer checks it. A duplicate id is still refused.
  • Deleted the host API surface snapshot, extension-api-surface.test.ts, extension-api-surface.ts, extension-api-version-agreement.test.ts, and the snapshot-only helpers in source-scan.ts.
  • Deleted scripts/check-extension-api-version.{ts,test.ts} and its test-gate.ts hook.
  • scripts/release.ts no longer writes an "Extension API" section (generated or appended to --notes); release.test.ts follows.
  • The extension-api/index.ts header no longer describes a compatibility policy; it keeps the import-boundary statement.
  • Fixture tests all stay, with version pins removed. The "no export *" rule used to be enforced by the surface test; it now has its own test in extension-api-boundary.test.ts.
  • The old "runtime exports of every entry match the listed names" check went with the snapshot; it is dropped deliberately (the facade and build-plugin tests still spot-check the entries).
  • Rust doc comments that referred to bumps reworded; CLAUDE.md updated.

Verification

  • bun test scripts/: 1422 pass. bun run scripts/check-pro-boundary.ts: clean. Full frontend suite (bun run --cwd packages/desktop-app test): 5850 pass. eslint + svelte-check: 0 errors. quality:scripts:check clean.
  • Rust, machine-slot wrapped: cargo fmt --check, clippy (-D warnings -D clippy::unused-async, --all-targets) on nodespace-core, nodespace-app-lib, nodespace-daemon; fixture tests pass (app-lib extensions 30, window_capability 3, core fixture_tests 13, daemon extension_points_fixture 7).
  • Release notes dry run: buildReleaseCreateArgs({version: "1.2.3"}) yields the downloads/installation notes plus --generate-notes, no Extension API section; bun scripts/release.ts --help runs.
  • Mutation check of the new boundary test: appending export * from './ui' to extension-api/testing.ts makes it fail; restored, it passes.
  • grep for the version, snapshot, UPDATE_EXTENSION_API_SURFACE and WATCHED_PATHS is empty outside git history.

Documentation

🤖 Generated with Claude Code

@mstomar125

Copy link
Copy Markdown
Contributor Author

Review round 1

Verdict: approve with one coverage gap to close (non-blocking if you judge it acceptable). Net positive; matches #3651's acceptance criteria.

Verified

  • git grep for EXTENSION_API_VERSION, apiVersion, extension-api-surface, check-extension-api-version, UPDATE_EXTENSION_API_SURFACE, WATCHED_PATHS is empty on the branch.
  • The Rust and TypeScript constants, the re-export, the lib.rs re-export, the registration check, the four deleted surface/agreement files, the push check and its test, the test-gate.ts entry and its header comment are all gone.
  • release.ts: the git-reading code, the ExtensionApiRelease config field and the --notes appending are removed. generateReleaseNotes(version) and buildReleaseCreateArgs keep the same shape, main() no longer reads anything before the release starts, and the readFileSync/path imports are still used. The release path is correct, and it can no longer fail on a missing constant.
  • bun test scripts/: 1422 pass. Vitest for src/tests/extension-api, plugins/ui-extensions.test.ts and src/tests/build: 155 pass.
  • Rust fixture tests keep everything except extension_api_version_is_two_six, which pinned the version. No other fixture test was removed. ui-extensions.test.ts loses only the apiVersion-mismatch test and the apiVersion: 1 "old" registration, both testing the removed behaviour. The duplicate-id test stays.
  • extension-api/index.ts header keeps the no-export * rule and the core-never-imports-it rule; extension-api-boundary.test.ts stays.
  • Docs PR Create comprehensive integration tests #113 matches the code: Versioning rewritten to the pin rule, the push-check list and the lifecycle/registration wording updated. CLAUDE.md is updated in both places.

Findings

  1. Coverage loss on the export * rule (the one to fix). The deleted extension-api-surface.test.ts contained unit tests that exportedNames refuses export * and export * as, reads aliases and type-only exports, treats every .ts file as an entry, and lists a namespace re-export's members. The new boundary test only asserts that exportedNames does not throw on today's real files. If exportedNames stopped throwing on export * (a regression in source-scan.ts), the rule would silently stop being enforced and every test would stay green. The acceptance criterion says the rule stays enforced. Suggested fix: keep a small source-scan test that feeds exportedNames a source string with export * from and export * as x from and expects a throw (the helper already takes a source argument), plus the alias/type-only case. A second option is to make the boundary test assert on a synthetic string as well as the real files.
  2. Also lost, and not mentioned in the issue: "checks the runtime exports of every entry" (each listed runtime export actually exists on the imported module). The surface snapshot was the only thing that checked an entry's export list against reality. extension-api-facades.svelte.test.ts and the build-plugin test now spot-check a few. This is acceptable given the version is gone, but say so in the PR description so it reads as a deliberate drop.
  3. Nit: nodespace-extensions-plugin.test.ts now asserts only api.createLogger is a function. That is a thinner check that the alias resolves than before, but it is enough for what the test is about.
  4. Nit: the test title "exposing core functions" is vague. "exposing the host API" would be clearer.

Re-review: only if finding 1 is fixed in a way other than the suggested one; otherwise a quick check of the added test is enough.

@mstomar125

Copy link
Copy Markdown
Contributor Author

Review round 1 (addendum): finding 0, which I missed above. The grep criterion is not met.

Comments still describe a versioned extension API, so "no remaining mention of the version" is not true in spirit even though the exact tokens are gone:

  • packages/desktop-app/src/lib/plugins/extension-lifecycle.ts:19: "These are part of the versioned extension API. Moving one is a breaking change."
  • packages/desktop-app/src/lib/plugins/ui-extensions.ts:70: "...is part of the versioned extension API and is..."
  • packages/desktop-app/src/lib/extension-api/testing.ts:3: "Part of the versioned host API; see the..." (the pointer is to the policy comment that this PR removed from index.ts)
  • packages/desktop-app/app-lib/src/lib.rs:111 and packages/desktop-app/src/lib/services/daemon-status.ts:47: "not part of the versioned extension API". These two should be reworded so the distinction (core-internal, not an extension point) still reads.

Please reword these to match ADR-082 §8 (no version, no compatibility promise). Re-review: only a quick check of these edits plus finding 1.

@mstomar125

Copy link
Copy Markdown
Contributor Author

Address review round 1

  1. Fixed: extension-api-boundary.test.ts now has a test feeding exportedNames synthetic source: export * and export * as throw, aliases and type-only exports are listed. Mutation: replacing the throw in source-scan.ts with continue makes it fail; restored, 11/11 pass.
  2. Fixed: reworded the remaining "versioned" comments (ui-extensions.ts, extension-lifecycle.ts, daemon-status.ts, extension-api/ui.ts, extension-api/testing.ts, app-lib/src/lib.rs).
  3. PR description now says the runtime-exports check was dropped on purpose.
  4. Nit: test title now "exposing the host API". The createLogger assertion is kept as is.

Full frontend suite 5851 pass, eslint and svelte-check clean, cargo fmt clean.

@mstomar125

Copy link
Copy Markdown
Contributor Author

Review round 2

Verdict: approve. Both round 1 items are closed; nothing further needed.

Checked (last commit only)

  • Finding 1: the new test in extension-api-boundary.test.ts feeds exportedNames synthetic source. export * and export * as throw, and the /export \*/ regex matches the real message in source-scan.ts:72. An alias (a as b), a type-only export and a plain const are listed with the right isType flags and in source order. Together with the real-file "does not throw" test, a regression in the throw is now caught.
  • Finding 0: a grep for "versioned" and "breaking change" in the extension-api, plugins and services sources and app-lib is empty. The rewordings keep the distinction: the two core-internal event comments still say they are not an extension point (ADR-082 §3.5, §8), and testing.ts and ui.ts now point at ./index.ts rather than a removed policy.
  • Nit 4: test title is now "exposing the host API".
  • bun run --cwd packages/desktop-app test src/tests/extension-api: 22 pass.

Nit, non-blocking: the ExtensionLifecycle doc in ui-extensions.ts was joined into one long line ("...is documented in extension-lifecycle.ts, which also implements the dispatch."). Rewrap it if prettier or lint does not already accept it.

@mstomar125

Copy link
Copy Markdown
Contributor Author

Merge queue: #3657 was taken out of the queue — it conflicts with main in: CLAUDE.md. Merge or rebase origin/main, resolve the conflicts, push, and re-run bun run merge 3657.

@mstomar125
mstomar125 force-pushed the issue-3651-remove-extension-api-version branch from de79aeb to 4e5f7e2 Compare October 6, 2026 09:14
@mstomar125

Copy link
Copy Markdown
Contributor Author

Rebased onto current main (4e5f7e25). The one conflict was in CLAUDE.md, where main renamed the Pro-boundary check; I kept main's wording and dropped only the extension-API check. Re-ran bun test scripts/ (1426 pass), the sync-boundary check, and the full frontend suite (5851 pass). A grep for the removed names finds nothing.

🤖 Generated with Claude Code

mstomar125 and others added 2 commits October 6, 2026 11:23
…e-notes section

Extension points carry no version (ADR-082 section 8, as amended). Deletes
EXTENSION_API_VERSION (TypeScript and Rust), NodespaceExtension.apiVersion and
its registration check, the host API surface snapshot with its test and helper,
the version-agreement test, scripts/check-extension-api-version.* and its gate
hook, and the Extension API release-notes section. Every extension point and
fixture test stays; the no-export-star rule for the host API moves into the
boundary test.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…t still called the API versioned

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@mstomar125
mstomar125 force-pushed the issue-3651-remove-extension-api-version branch from 4e5f7e2 to 4f5e9bc Compare October 6, 2026 09:24
@mstomar125
mstomar125 merged commit 0b80235 into main Oct 6, 2026
@mstomar125
mstomar125 deleted the issue-3651-remove-extension-api-version branch October 6, 2026 09:24
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.

Remove the extension API version, its snapshot, its push check and its release-notes section (ADR-082 §8)

1 participant