Skip to content

chore(sdk): expose MCP approval bindings (ALIEN-824) - #631

Open
lilienblum wants to merge 22 commits into
mainfrom
lilienblum/alien-824-mcp-approval-sdk-sync
Open

lilienblum wants to merge 22 commits into
mainfrom
lilienblum/alien-824-mcp-approval-sdk-sync

Conversation

@lilienblum

@lilienblum lilienblum commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • sync the public Platform OpenAPI contract for version- and contract-bound MCP approvals
  • regenerate the complete TypeScript and Rust SDK surface required by the current checked-in contract, including ECS S3/SQS resource-ceiling request models
  • keep Speakeasy generation metadata aligned with committed output

Dependency

Validation

  • all Platform and OSS/Rust OpenAPI copies are byte-identical
  • official Speakeasy v1.680.11 generation completed through pnpm run generate:platform-api
  • a second clean generation produced no diff
  • pnpm -C client-sdks/platform/typescript lint
  • TypeScript SDK build with NODE_OPTIONS=--max-old-space-size=16384
  • cargo build -p alien-platform-api
  • 13 SDK contract tests
  • independent exact-head review requested after regeneration

Generator note

Speakeasy currently emits structural Zod string validators for these OpenAPI string constraints. The API contract and server enforce pluginVersion non-emptiness and the 64-character lowercase hexadecimal operation hash. This repository forbids hand-editing generated SDK output, so generator output is kept reproducible rather than patched manually.

…627)

## Summary

- define one canonical typed Operations manifest across Rust and
TypeScript
- bind version-qualified operation dispatch to an immutable result
contract persisted before execution
- validate, store, redact, and verify command results through Platform
without direct Manager reads
- harden custom bundle ZIP validation and deterministic generated SDK
output

## Stack

- based on #629 (ALIEN-845 generated Platform SDK baseline)
- companion Platform PR: pending creation
- reviewed OSS tip: b479115
- reviewed Platform tip: eaf4ca2e5648aa3b3c909c2d591e0796bbd54e33

## Validation

- cargo test -p alien-cli commands::operations (37 passed)
- cargo test -p alien-cli remote_sandbox -- --nocapture (7 passed)
- cargo test -p alien-operations-sdk
- cargo test -p alien-helm --test generator operator_manifest
- RUSTDOCFLAGS=-Dwarnings cargo doc -p alien-operations-sdk --no-deps
- RUSTFLAGS=-Dwarnings cargo check -p alien-operations-sdk --all-targets
- cargo check -p alien-cli
- fresh detached pinned Speakeasy 1.680.11 pnpm generate:platform-api
reproduction; generation, TypeScript build, lock refresh, and 13 wire
tests passed and left the checkout clean
- Platform focused operations suites: 6 files, 97 tests passed
- Platform API and platform-core TypeScript checks passed
- cargo check -p alien-managerx passed in the Platform companion
- git diff --check

Independent pr-review passed with no correctness, security,
compatibility, scope, or public-boundary blockers.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 16, 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-17T01:16:52.554161Z 7a15652 Manual request
ℹ️ 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.

@lilienblum

Copy link
Copy Markdown
Contributor Author

@codex review

@greptile-apps

greptile-apps Bot commented Sep 16, 2026

Copy link
Copy Markdown

RetriggerConfidence Score: 4/5

The PR appears safe to merge after considering two non-blocking generated-SDK consistency issues involving constraint validation and stale lock checksums.

Fix All in CodexFindings

  1. P2 Binding constraints are missing
  2. P2 Lock checksums are stale
Fix with agent prompt
### Issue 1
client-sdks/platform/typescript/src/models/createaccessrequest.ts:115-116
The OpenAPI contract requires `pluginVersion` to be non-empty and `operationContractHash` to contain exactly 64 lowercase hexadecimal characters, but these outbound validators accept any string. Since `operationsCreateAccessRequest` uses this schema to validate requests, malformed bindings are sent to the API instead of returning an SDK validation error. This is a non-blocking consistency issue between the generated client and its public contract.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

### Issue 2
client-sdks/platform/typescript/.speakeasy/gen.lock:24375
Several updated `last_write_checksum` values do not match the generated files committed in this PR. For example, this entry records `8766a646…` for `docs/sdks/operations/README.md`, while that file has the restored checksum `04d63807…`, which was also the previous lock value. Similar mismatches affect other restored endpoint and model files. This leaves the generator metadata inconsistent with the committed tree and may cause later regeneration or drift checks to treat restored files as changed against output that was never committed.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

This PR updates the shared Platform OpenAPI contract and generated SDK surfaces so access-request commands can carry MCP plugin-version and operation-contract bindings.

  • Adds optional pluginVersion and operationContractHash fields to request and response command models.
  • Synchronizes the canonical and Rust OpenAPI inputs.
  • Regenerates TypeScript models and documentation.
  • Leaves two non-blocking consistency issues in generated validation and Speakeasy lock metadata.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Contract[Platform OpenAPI contract] --> TS[TypeScript SDK generation]
  Contract --> RustInput[Rust OpenAPI input]
  TS --> Request[Create access request]
  TS --> Responses[Create / Get / List / Queue / Approve / Deny responses]
  RustInput --> RustBuild[Build-time Rust model generation]
  Request --> Bindings[pluginVersion + operationContractHash]
  Responses --> Bindings
  RustBuild --> Bindings
Loading

Reviews (1) · Last reviewed commit: "chore(sdk): expose MCP approval bindings..."

Comment on lines +115 to +116
pluginVersion: z.string().optional(),
operationContractHash: z.string().optional(),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Binding constraints are missing

The OpenAPI contract requires pluginVersion to be non-empty and operationContractHash to contain exactly 64 lowercase hexadecimal characters, but these outbound validators accept any string. Since operationsCreateAccessRequest uses this schema to validate requests, malformed bindings are sent to the API instead of returning an SDK validation error. This is a non-blocking consistency issue between the generated client and its public contract.

Knowledge Base Used: Client SDKs and TypeScript packages

Prompt To Fix With AI
This is a comment left during a code review.
Path: client-sdks/platform/typescript/src/models/createaccessrequest.ts
Line: 115-116

Comment:
**Binding constraints are missing**

The OpenAPI contract requires `pluginVersion` to be non-empty and `operationContractHash` to contain exactly 64 lowercase hexadecimal characters, but these outbound validators accept any string. Since `operationsCreateAccessRequest` uses this schema to validate requests, malformed bindings are sent to the API instead of returning an SDK validation error. This is a non-blocking consistency issue between the generated client and its public contract.

**Knowledge Base Used:** [Client SDKs and TypeScript packages](https://app.greptile.com/alien/-/custom-context/knowledge-base/alienplatform/alien/-/docs/client-sdks-and-typescript-packages.md)

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Fix in Codex

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Confirmed: the source OpenAPI contract and server enforce these constraints. Speakeasy v1.680.11 currently emits structural z.string() validators for these string constraints throughout this generated SDK. The repository policy forbids hand-editing generated files, and persistent edits are disabled, so patching just these two generated fields would make regeneration non-reproducible. I kept the official generator output unchanged; malformed values still fail at the API boundary. This generator limitation is now documented in the PR.

pristine_git_object: 8bfe2a424a7d98d235de9f1038cefa0a23b92c35
docs/sdks/operations/README.md:
last_write_checksum: sha1:04d63807f0f204e4890a8ebb18dcf96658eee0eb
last_write_checksum: sha1:8766a646ae956a1cb0fe1fb5c21d9d4385e6dde7

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Lock checksums are stale

Several updated last_write_checksum values do not match the generated files committed in this PR. For example, this entry records 8766a646… for docs/sdks/operations/README.md, while that file has the restored checksum 04d63807…, which was also the previous lock value. Similar mismatches affect other restored endpoint and model files. This leaves the generator metadata inconsistent with the committed tree and may cause later regeneration or drift checks to treat restored files as changed against output that was never committed.

Knowledge Base Used: Client SDKs and TypeScript packages

Prompt To Fix With AI
This is a comment left during a code review.
Path: client-sdks/platform/typescript/.speakeasy/gen.lock
Line: 24375

Comment:
**Lock checksums are stale**

Several updated `last_write_checksum` values do not match the generated files committed in this PR. For example, this entry records `8766a646…` for `docs/sdks/operations/README.md`, while that file has the restored checksum `04d63807…`, which was also the previous lock value. Similar mismatches affect other restored endpoint and model files. This leaves the generator metadata inconsistent with the committed tree and may cause later regeneration or drift checks to treat restored files as changed against output that was never committed.

**Knowledge Base Used:** [Client SDKs and TypeScript packages](https://app.greptile.com/alien/-/custom-context/knowledge-base/alienplatform/alien/-/docs/client-sdks-and-typescript-packages.md)

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Fix in Codex

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 4d75fc7. I restored the prior known-good lock state, regenerated the complete SDK from the checked-in OpenAPI input with official Speakeasy v1.680.11, and committed the required output. Running the repository's supported pnpm run generate:platform-api wrapper again from that clean head completed successfully and produced no diff, so the lock and committed tree are aligned.

@chatgpt-codex-connector

Copy link
Copy Markdown

💡 Codex Review

https://github.com/alienplatform/alien/blob/21b92711917d64322c3fc21c826fc1dbf580e48a/client-sdks/platform/openapi.json#L1
P1 Badge Regenerate the TypeScript model for the new ARN ceilings

When an ECS operator installation enables S3 or SQS operations, this contract now requires callers to supply s3BucketArns or sqsQueueArns, but the checked-in RenderOperatorEcsCloudFormationRequest type and outbound Zod schema remain unchanged. Because the SDK parses requests through that schema, these unknown fields are stripped even if a caller bypasses TypeScript, so the endpoint receives no resource ceilings and returns the newly documented 400 response. Either include the regenerated request model or remove these unrelated contract changes from this access-request-only sync.

AGENTS.md reference: client-sdks/AGENTS.md:L37-L42

ℹ️ 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".

@lilienblum

Copy link
Copy Markdown
Contributor Author

Fixed in 4d75fc7. The complete generated RenderOperatorEcsCloudFormationRequest model now includes s3BucketArns and sqsQueueArns, with corresponding serializers, exports, and documentation. The repository generation wrapper was then run again from the clean commit and produced no diff.

@lilienblum

Copy link
Copy Markdown
Contributor Author

@codex review

@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: 4d75fc7665

ℹ️ 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 on lines +42 to +46
s3BucketArns?: Array<string> | undefined;
/**
* Installer-owned SQS ceiling. Required when enabled SQS operations read queue attributes; the generated role contains only these queue ARNs.
*/
sqsQueueArns?: Array<string> | undefined;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Remove unrelated ECS installer changes

This approval-binding feature regeneration also adds the unrelated ECS S3/SQS resource-ceiling API and updates its documentation, response text, and error handling. Shipping those changes here couples a separate public API feature to ALIEN-824 and violates the SDK policy requiring unrelated generated endpoints/models to be restored and refreshed in a dedicated SDK-sync PR. Keep the access-request binding changes in this commit and move the ECS installer regeneration to that separate sync.

AGENTS.md reference: client-sdks/AGENTS.md:L37-L42

Useful? React with 👍 / 👎.

@lilienblum

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: 8191d55f66

ℹ️ 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".

@lilienblum

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: c5d71b052f

ℹ️ 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".

@lilienblum

Copy link
Copy Markdown
Contributor Author

@codex review Exact head c5d71b0. Please review the full exact-head diff for correctness, generated SDK compatibility, security, and missing tests.

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

ℹ️ 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 on lines +32 to +33
pluginVersion?: string | undefined;
operationContractHash?: string | undefined;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Add behavioral tests for approval binding fields

At the exact head, client-sdks/platform/scripts/typescript-sdk.test.mjs has no access-request case, so the SDK build and all 13 existing contract tests remain green if a later regeneration drops pluginVersion or operationContractHash during outbound serialization or from any inbound response model. Add a behavioral contract test that sends a plan-backed request and parses a returned command while asserting both security-binding values survive the wire round trip.

AGENTS.md reference: AGENTS.md:L457-L464

Useful? React with 👍 / 👎.

@lilienblum

Copy link
Copy Markdown
Contributor Author

@codex review

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

ℹ️ 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".

params: { sql: "select 1" },
tier: "read-only",
pluginVersion: "1.2.3",
operationContractHash: "sha256:contract-test",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Use a schema-valid hash in the round-trip test

The new OpenAPI contract restricts operationContractHash to 64 lowercase hexadecimal characters, but this fixture includes a prefix and non-hex characters. Because the mocked fetcher does not perform server validation and the current generated Zod schema omits the pattern check, the test passes with a request that the real endpoint rejects; it also becomes a false failure if a future generator starts honoring the declared pattern. Use a valid 64-character lowercase hexadecimal value so the test exercises a production-valid round trip.

AGENTS.md reference: AGENTS.md:L457-L464

Useful? React with 👍 / 👎.

@chatgpt-codex-connector

Copy link
Copy Markdown

💡 Codex Review

operationContractHash: "sha256:contract-test",

P2 Badge Use a schema-valid hash in the round-trip test

The new OpenAPI contract restricts operationContractHash to 64 lowercase hexadecimal characters, but this fixture includes a prefix and non-hex characters. Because the mocked fetcher does not perform server validation and the current generated Zod schema omits the pattern check, the test passes with a request that the real endpoint rejects; it also becomes a false failure if a future generator starts honoring the declared pattern. Use a valid 64-character lowercase hexadecimal value so the test exercises a production-valid round trip.

AGENTS.md reference: AGENTS.md:L457-L464

ℹ️ 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".

@lilienblum

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: 7a15652b95

ℹ️ 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".

Base automatically changed from lilienblum/alien-845-platform-sdk-sync to main September 17, 2026 12: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