Skip to content

feat(permissions): share offline operation permission compiler (ALIEN-1112) - #791

Merged
lilienblum merged 10 commits into
mainfrom
dan/alien-1112-use-one-operation-permission-compiler-for-cli-and-setup
Sep 30, 2026
Merged

lilienblum merged 10 commits into
mainfrom
dan/alien-1112-use-one-operation-permission-compiler-for-cli-and-setup

Conversation

@lilienblum

@lilienblum lilienblum commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

alien operations permissions now compiles AWS, Google Cloud and Kubernetes operation grants offline with exact installer resource limits. The reviewed Rust catalog and compiler also run in Node and browsers through @alienplatform/permissions. Missing limits, unknown capabilities, custom inline AWS grants and unsupported wildcards fail closed. Direct compilation calls enforce the same reviewed action/scope and Kubernetes resource rules.

The CLI's infrastructure-registry shortcut is removed. Kubernetes semantic validation and installation mode selection move into alien-permissions; existing infrastructure APIs remain available through the default feature. The generated WASM package adds no runtime dependency or compilation service. Its 377 KiB artifact is committed and checked against native Rust in CI. Rust consumers build an rlib; only WASM generation requests a cdylib.

Generate with pnpm -C packages/permissions generate. Generation pins Rust 1.97.1 and the Cargo.lock wasm-bindgen version on Linux ARM64. Other hosts use Docker to produce identical bytes. Release preparation regenerates versioned WASM and includes it in qualification and dry-run artifacts. Release and dev-package publishing include the new package.

Validation:

  • Eight compiler behavior tests, seven SDK Kubernetes tests and twelve real Role/ClusterRole rendering tests pass.
  • Native/WASM parity covers all reviewed AWS IDs, both Kubernetes modes and unsafe raw AWS/GCP/Kubernetes grants. It also passes after a simulated version bump.
  • The rebuilt CLI matches setup grants for all seventeen built-ins and a custom plugin, including Terraform/Pulumi action-resource pairs and exact GCP bucket bindings.
  • Chromium imports the package and exercises AWS, bucket-scoped GCP and Kubernetes rejection with external requests blocked.
  • Thirteen release/version checks pass, along with workflow validation. pnpm -C packages/permissions pack produces a self-contained artifact that imports independently and preserves compiler rejection behavior.

CI generation and publishing use the existing packageManager version.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-30T05:26:16.698455Z 31304cf PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@greptile-apps

greptile-apps Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[High risk] Adds a new shared permissions compiler library and integrates it across the build system.

The PR appears safe to merge based on the reviewed changes.

Summary

The PR moves operation-permission compilation into a shared offline Rust compiler, exposes it through a self-contained WASM package, and updates the CLI, Kubernetes permission handling, CI generation checks, and release publishing.

  • Direct AWS, GCP, and Kubernetes compilation now applies additional reviewed-grant validation.
  • CI and release preparation generate and carry the committed WASM artifact.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Manifest[Plugin manifest] --> Resolve[Resolve reviewed capabilities]
  Resolve --> Collect[Collect cloud grants]
  Collect --> Compile[Apply installer limits and mode]
  Compile --> CLI[CLI output]
  Request[JSON request] --> Rust[Shared Rust compiler]
  Rust --> WASM[WASM package for Node and browsers]
Loading

Reviews (3) · Last reviewed commit: "fix(ci): check generated permission comp..."

Comment thread packages/permissions/scripts/generate.mjs Outdated
Comment thread crates/alien-permissions/src/operations/aws.rs
Comment thread packages/permissions/scripts/generate.mjs

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 31304cf33e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/permissions/package.json
Comment thread packages/permissions/scripts/generate.mjs Outdated
@lilienblum
lilienblum force-pushed the dan/alien-1112-use-one-operation-permission-compiler-for-cli-and-setup branch from 09afde5 to ef776fc Compare September 30, 2026 06:49
@lilienblum
lilienblum force-pushed the dan/alien-1112-use-one-operation-permission-compiler-for-cli-and-setup branch from 73d7641 to 0a890a8 Compare September 30, 2026 07:32
@lilienblum

Copy link
Copy Markdown
Contributor Author

@greptile review

Comment thread packages/permissions/scripts/generate.mjs
@lilienblum

Copy link
Copy Markdown
Contributor Author

@greptile review

@lilienblum
lilienblum merged commit ba059dc into main Sep 30, 2026
29 checks passed
@lilienblum
lilienblum deleted the dan/alien-1112-use-one-operation-permission-compiler-for-cli-and-setup branch September 30, 2026 11:02
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.

2 participants