Skip to content

feat(operations): require generated plugin metadata (ALIEN-1134) - #810

Merged
lilienblum merged 3 commits into
mainfrom
dan/alien-1134-operations-sdk-remove-handwritten-plugin-dispatch-and-test
Sep 30, 2026
Merged

lilienblum merged 3 commits into
mainfrom
dan/alien-1134-operations-sdk-remove-handwritten-plugin-dispatch-and-test

Conversation

@lilienblum

Copy link
Copy Markdown
Contributor

Linear: ALIEN-1134

What changes for plugin authors

  • alien operations check and alien operations package require src/bin/generate-metadata.rs. Before, a plugin without it skipped the drift check. Now it fails with a message that names what to add: register each operation with OperationDefinition in a TypedOperations registry, add a generate-metadata binary that writes the registry's manifest and supports --check, or scaffold it with alien operations init <name>.
  • alien operations publish rejects a bundle whose metadata.json has operations without inputSchema and outputSchema, which typed definitions always generate. The error lists those operations and says to rebuild with alien operations package. This check runs before any upload.
  • alien operations check --manifest-only is unchanged. It validates metadata.json without building plugin code, for reviewing a plugin you do not trust.

Plugin / run_plugin

Plugin and run_plugin stay. TypedOperations implements Plugin, and run_plugin is the stdin/stdout entry point for every plugin, including the alien operations init scaffold and examples/custom-operations. No known plugin implements Plugin with a hand-written operation match. Plugins that implement it themselves only wrap a TypedOperations registry with per-invocation setup, such as validating endpoint configuration or bounding the whole invocation with a deadline. Removing the trait would mean adding those hooks to TypedOperations without improving drift protection: the invocation protocol is public, so a hand-written dispatcher does not need the trait. The protection is the metadata requirement above. The SDK docs now state when to implement Plugin.

What the next maintainer inherits

  • check.rs::TYPED_METADATA_HELP is the single remediation text used by check, package, and publish.
  • The test that kept publishing and packaging released legacy (paramsSchema-only) metadata was inverted or removed, because that path is no longer supported from the CLI. --manifest-only still validates legacy manifests.

Verification

  • cargo nextest run -p alien-cli -p alien-operations-sdk -E 'test(/operations/) | package(alien-operations-sdk)': 109 passed.
  • New tests: check::requires_a_metadata_generator_and_says_what_to_add and platform_actions::rejects_bundle_metadata_not_generated_from_typed_operations. Each fails if the requirement is reverted.
  • Real CLI runs: see the comment below.

`alien operations check` and `package` now fail when a plugin has no
`generate-metadata` binary, and say what to add. `publish` rejects bundle
metadata whose operations lack the input and output schemas typed
definitions generate.

The `Plugin` trait stays for plugins that wrap a `TypedOperations`
registry with per-invocation setup, such as endpoint configuration or a
whole-invocation deadline.
@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-30T12:24:14.511433Z ef59602 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] Makes generated metadata mandatory for all plugins.

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

Summary

The PR requires generated metadata for local plugin checks and packaging, and requires both operation schemas before publishing a bundle. The latest revision closes the previously reported null-schema gap by checking that each schema is a JSON object and adds regression coverage.

  • The previous finding is fixed; null and other non-object schemas are rejected before upload.
  • No new actionable issue was identified in the changes since the previous review.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Plugin source] --> B[Generated metadata check]
  B --> C[Package bundle]
  C --> D[Validate schema objects]
  D --> E[Publish]
Loading

Reviews (2) · Last reviewed commit: "fix(operations): reject null publish sch..."

Comment thread crates/alien-cli/src/commands/operations/platform_actions.rs Outdated

@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: ef59602558

ℹ️ 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 crates/alien-cli/src/commands/operations/platform_actions.rs Outdated
Comment thread crates/alien-cli/src/commands/operations/mod.rs
@lilienblum

Copy link
Copy Markdown
Contributor Author

Real CLI runs at 13f68ca9e (cargo build -p alien-cli --bin alien):

  1. The typed example still passes:
    $ alien operations check examples/custom-operations
    'examples/custom-operations/metadata.json' is valid: plugin 'custom-ops' v0.1.0 (mutating tier)
      doctor [read-only] — Read application health and export throttle.
      throttle-export-automation [mutating] — Set the application's export limit per minute.
    exit=0
    
  2. alien operations init demo-ops, delete src/bin/generate-metadata.rs, then alien operations check demo-ops and alien operations package demo-ops both exit 1 with:
    Configuration error: 'demo-ops' has no metadata generator; plugins must generate metadata.json from typed operations. Register each operation with `OperationDefinition` in a `TypedOperations` registry, and add `src/bin/generate-metadata.rs` (a `[[bin]]` named `generate-metadata`) that writes the registry's manifest to metadata.json and exits non-zero when run with `--check` and metadata.json differs. `alien operations init <name>` scaffolds this layout. Then run `cargo run --bin generate-metadata`.
    
  3. alien operations publish legacy.zip (a paramsSchema-only bundle) against a local platform API with a real workspace and project exits 1 before requesting an upload URL, and no plugin row is created:
    Configuration error: bundle '.../legacy.zip' has metadata that was not generated from typed operations; operations without inputSchema and outputSchema: 'status'. Register each operation with `OperationDefinition` in a `TypedOperations` registry, and add `src/bin/generate-metadata.rs` ... Then rebuild the bundle with `alien operations package`.
    

@lilienblum

Copy link
Copy Markdown
Contributor Author

@greptileai review

@lilienblum
lilienblum merged commit 0866130 into main Sep 30, 2026
22 checks passed
@lilienblum
lilienblum deleted the dan/alien-1134-operations-sdk-remove-handwritten-plugin-dispatch-and-test branch September 30, 2026 14:21
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