Skip to content

perf: isolate permission types from core - #647

Merged
alongubkin merged 2 commits into
mainfrom
alon/alien-863-permission-types
Sep 17, 2026
Merged

alongubkin merged 2 commits into
mainfrom
alon/alien-863-permission-types

Conversation

@alongubkin

Copy link
Copy Markdown
Member

Summary

  • move the unchanged permission data model into a small serde/indexmap-only crate
  • re-export every type through alien_core::permissions to preserve public paths and type identity
  • validate permission JSONC in the build script without compiling all of alien-core for the host

Impact

Controlled empty-target cargo check -p alien-permissions --timings:

  • wall time: 16.09s -> 11.69s (-27.3%)
  • host alien-core: 8.2s -> removed
  • replacement host types crate: 0.2s
  • cold target size: 751 MB -> 392 MB

The target alien-core check remains and compiled once, as expected.

Compatibility

  • original and extracted model source is identical apart from module documentation
  • alien_core::permissions::* and crate-root re-exports remain available
  • alien-core/openapi forwards schema derivation to the extracted types
  • typed JSONC parsing plus empty-ID, empty-description, and duplicate-ID build failures remain intact

Validation

  • cargo test -p alien-permissions (159 tests plus docs)
  • cargo test -p alien-core --lib permissions
  • cargo check -p alien-core --features openapi
  • cargo test -p alien-permission-types --features openapi
  • cargo package -p alien-permission-types --allow-dirty --no-verify --list
  • cargo tree -p alien-permissions --edges build contains no alien-core
  • git diff --check

Linear: ALIEN-863

@greptile-apps

greptile-apps Bot commented Sep 17, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

The PR appears safe to merge; the previously identified release-order issue is fixed and no new actionable failures were found.

Summary

This PR extracts the permission data model into a lightweight crate while preserving the existing alien_core::permissions API.

  • Adds alien-permission-types with optional OpenAPI schema support.
  • Re-exports the extracted types through alien-core.
  • Uses the lightweight crate for build-time permission validation.
  • Publishes the new crate before its consumers in the release workflow.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
    A[alien-permission-types] -->|re-exported types| B[alien-core]
    A -->|build-time validation| C[alien-permissions build script]
    B -->|runtime dependency| C
    D[release workflow] --> A
    D --> B
    D --> C
Loading

Reviews (2) · Last reviewed commit: "fix: publish permission types before con..."

Comment thread Cargo.toml
@alongubkin

Copy link
Copy Markdown
Member Author

@greptileai The P1 release finding is fixed: alien-permission-types is now in the explicit crate publication list immediately before alien-core. Both package file enumerations pass, and an order check confirms the dependency precedes its consumer. Please re-review.

@alongubkin
alongubkin merged commit 1ad705c into main Sep 17, 2026
22 checks passed
@alongubkin
alongubkin deleted the alon/alien-863-permission-types branch September 17, 2026 23:26
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