Skip to content

Enforce EXTENSION_API_VERSION: Rust matches TypeScript, fixture changes bump it #3321

Closed as not planned

Description

@mstomar125

Part of #3322 (Tauri extension points for the desktop app).

Summary

Enforce ADR-082 (proposed)'s compatibility policy for the Rust half of the extension API. This PR adds two checks:

  1. One version. nodespace_app_lib::EXTENSION_API_VERSION (Rust, from Add AppExtensions with Tauri-plugin support and a runtime-generic assemble() #3304) must equal EXTENSION_API_VERSION in the TypeScript host API (from Publish the extension host API: services, ui and testing entries, version policy #3315). A Rust test and a Vitest test each read the other side's source and compare.
  2. Fixture changes bump it. A scripts check fails when a Rust extension fixture file has changed since the merge-base with origin/main but the Rust version tuple has not. This is ADR-082's rule: "the gate fails when a fixture file changes and EXTENSION_API_VERSION does not". The fixture files are:
    • app-lib/src/extensions/fixture_tests.rs;
    • app-lib/tests/it/extension_hooks_test.rs.

Everything #3322 and #3317 build before this lands is version 1.0. The bump rule applies from here on.

Context

Scope

Rust test in app-lib/src/extensions/fixture_tests.rs: rust_and_typescript_extension_api_versions_match.

  • Read include_str!("../../../src/lib/extension-api/index.ts").
  • Extract major and minor from the EXTENSION_API_VERSION literal, with plain string scanning.
  • Assert they equal the Rust tuple. The failure message says to change both constants together.

Vitest test packages/desktop-app/src/tests/plugins/extension-api-version.test.ts.

  • Read ../app-lib/src/extensions/mod.rs (relative to the package root) with readFileSync.
  • Extract the tuple and compare it with the imported constant.

New scripts/check-extension-api-version.ts

  • Exports FIXTURE_FILES, VERSION_FILE, parseRustVersion(src) and a pure bumpFailure(changedFiles, baseVersion, headVersion).
  • Reads the base version with git show <merge-base>:<VERSION_FILE>.
  • Has a CLI under import.meta.main.

New scripts/check-extension-api-version.test.ts

  • Fixture-level unit tests.
  • A describe("real repo") case that runs the check against the working tree.

Docs

  • app-lib/src/extensions/mod.rs: state the bump rule, and that the TypeScript constant moves with the Rust one.
  • CLAUDE.md: one line in the Pro/Sync boundary section that Add the Pro-boundary ratchet check and the CLAUDE.md Pro/sync placement rule #3299 added. A change to the extension API, or to its fixture files, bumps EXTENSION_API_VERSION in Rust and TypeScript together: major for a breaking change, minor for an additive one.

Out of scope

Steps

  1. Run the CLAUDE.md startup sequence. Self-assign at pickup; the worktree is issue-<N>-extension-api-version-checks.
  2. Add both equality tests.
  3. Add the script and its test.
  4. Update the docs.
  5. Run bun run quality:fix, then bun run test:changed.

Acceptance criteria

  • Changing either constant alone fails the Rust test under bun run rust:test, and the Vitest test under bun run --cwd packages/desktop-app test.
  • Editing a fixture file without changing the Rust tuple fails bun test scripts/check-extension-api-version.test.ts, with a message naming the file and the rule.
  • Editing a fixture file together with a bump passes.
  • A clean branch passes.
  • bun run scripts/check-pro-boundary.ts passes. BASELINES are lowered to the exact new counts wherever this PR removes markers, and no count rises.
  • No GitHub issue numbers in code comments.

Tests and verification

Mutation-check each new test: break the code path it covers, confirm the test fails, then restore.

cargo test --lib -p nodespace-app-lib -- extensions::fixture_tests --test-threads=2
bun run --cwd packages/desktop-app test src/tests/plugins/extension-api-version.test.ts
bun test scripts/check-extension-api-version.test.ts
bun run quality:scripts:check
bun run test:changed

Dependencies

Risks and rollback


Plan key: C2.8 (pro-boundary DAG).

🤖 Generated with Claude Code

Activity

  1. self-assigned this
    on Sep 30, 2026
  2. added
    pro-boundary
    on Sep 30, 2026
  3. mstomar125 commented on Oct 1, 2026

    @mstomar125
    ContributorAuthor

    Request: add the skill-content input and its fixture to this gate's watched fixtures. Both come from #3404 (core#3369).

    NODESPACE_SKILL_EXTENSIONS is part of the versioned extension API (ADR-082 §7 and §8). It names a directory whose SKILL.md fragment and flat references/*.md are merged into the staged skill by scripts/build-skill.ts. Its accepted layout is exercised by the fixture directory scripts/fixtures/skill-extension/:

    • SKILL.md
    • references/fixture-guide.md

    Please list that directory, or its two files, in FIXTURE_FILES alongside the Rust fixtures, so that a later change to the input's fixture requires an EXTENSION_API_VERSION bump.

    #3404 does not bump the version. Per this issue and #3315, the initial build-out stays at 1.0, and the bump rule applies once this gate lands.

  4. mstomar125 commented on Oct 1, 2026

    @mstomar125
    ContributorAuthor

    Superseded by #3414 (umbrella against the final ADR-081–085)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

pro-boundary

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions