Skip to content

fix: acknowledge completed pull execution receipts - #873

Merged
alongubkin merged 5 commits into
mainfrom
alon/alien-1221-completed-claim-ack
Oct 5, 2026
Merged

alongubkin merged 5 commits into
mainfrom
alon/alien-1221-completed-claim-ack

Conversation

@alongubkin

@alongubkin alongubkin commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

When an executor commits a terminal result but loses the sync response, its next request still carries the completed execution claim. Renewal rejects that claim indefinitely, preventing it from fetching new work.

On a typed claim or lease rejection during renewal or reconciliation, ask a claim-capable deployment store whether the exact receipt is already complete. Return an acknowledgment-only response, preserving the configured tunnel endpoint, so the executor drops its durable receipt and acquires work on its next sync. Stores that do not issue claims deliberately decline recovery. Unrelated errors retain their behavior.

The generated release contract gains an explicit completed-receipt mode; no new sync endpoint is introduced and renewal continues to require a live lease.

Validation: all 42 Manager sync unit tests passed with sqlite/openapi enabled. An HTTP/SQLite Operator test checks durable receipt clearing and the next request without a claim. API contracts were generated with the API OpenAPI generator and pnpm run generate:api-copy-openapi.

Linear: ALIEN-1221

@alongubkin

Copy link
Copy Markdown
Member Author

@greptileai review

@alongubkin

Copy link
Copy Markdown
Member Author

@greptile review

@greptile-apps

greptile-apps Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Critical risk] Adds execution claim acknowledgment to the sync protocol.

The PR appears safe to merge; no outstanding finding or new actionable issue was identified.

Summary

The PR adds recovery for completed execution receipts when claim or lease renewal or reconciliation rejects a replayed claim.

  • The Manager checks whether the exact receipt is complete and returns an acknowledgment-only response that preserves the configured tunnel URL.
  • The Operator test verifies that the acknowledgment clears the durable receipt and that the next sync omits the claim.
  • The release contracts document completed-receipt acknowledgment.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Operator syncs with execution receipt] --> B[Manager renews or reconciles]
  B -->|Accepted| C[Continue ordinary sync]
  B -->|Typed claim or lease rejection| D{Exact receipt complete?}
  D -->|Yes| E[Return acknowledgment with tunnel URL]
  E --> F[Operator clears durable receipt]
  F --> G[Next sync requests work without claim]
  D -->|No| H[Return original rejection]
Loading

Reviews (7) · Last reviewed commit: "fix: retain release session wire compati..."

Comment thread crates/alien-manager/src/routes/sync.rs
Comment thread crates/alien-manager/src/routes/sync.rs Outdated
@alongubkin

Copy link
Copy Markdown
Member Author

@greptile review. Both findings are fixed: recovery handles reconciliation rejections and preserves the configured tunnel endpoint. Added a real HTTP/SQLite Operator receipt compatibility test. Please review the latest commit.

Comment thread crates/alien-manager/src/traits/deployment_store.rs
Comment thread crates/alien-manager/src/routes/sync.rs
@alongubkin

Copy link
Copy Markdown
Member Author

@greptile review. The latest generated contract reuses sync release with an explicit acknowledge-completed mode and removes the extra endpoint. The claim-capable embedder hook is documented; SQLite does not issue execution claims. Please reassess the latest commit.

@greptile-apps

This comment has been minimized.

@alongubkin

Copy link
Copy Markdown
Member Author

The latest outside-diff finding conflates two different API surfaces. client-sdks/platform/openapi.json and its Rust copies describe the upstream API consumed by embedders; they do not describe or route requests to the Manager release handler. The Manager API has its own contract under client-sdks/manager and its ReleaseRequest does not gain this mode. The upstream release server implements the scoped exact-terminal acknowledgment mode; the Manager store hook is the capability boundary, and the Manager handler remains strict. The generated upstream contract was copied from its source generator, not hand-edited. @greptile please reassess this finding and the latest commit.

@alongubkin

Copy link
Copy Markdown
Member Author

@greptileai review. Please reassess the outside-diff finding in comment 5987334141: it compares an upstream API client contract against an unrelated Manager server route. These upstream client contracts are not served by the Manager. Its own contract under client-sdks/manager is unchanged. No Manager client can send the new mode through these upstream client files. The upstream source handler implements exact terminal pull acknowledgment before ordinary release.

@alongubkin

Copy link
Copy Markdown
Member Author

@greptileai review. The upstream release contracts and Manager API are separate surfaces; the outside-diff concern uses the wrong server handler. The latest contract also preserves the original release session type. Manager sqlite/openapi tests and the Operator HTTP/SQLite receipt test pass.

@alongubkin
alongubkin merged commit a8e8b20 into main Oct 5, 2026
25 of 27 checks passed
@alongubkin
alongubkin deleted the alon/alien-1221-completed-claim-ack branch October 5, 2026 03:42
alongubkin added a commit that referenced this pull request Oct 5, 2026
…'s changelog (#876)

## What

Two release-flow bugs that would hit the next stable release:

1. **The next version PR fails "Release qualification".** Prepare now
bumps `infra/helm/alien-manager/Chart.yaml` and
`infra/aws-ecs-manager/variables.tf`, but the detect step's file
allowlist in `release-qualification.yml` doesn't list them, so it fails
with "Release PR contains non-version files".
2. **Each GitHub release body lists the previous release's changes.**
`generate-changelog` runs `git-cliff --latest` before the new tag
exists, so it renders the range ending at the previous tag. The v3.3.26
body lists #707–#756, which shipped in v3.3.25.

## How

1. Add both files to the allowlist, and normalize their version fields
(`version`/`appVersion` in the chart, the `alien-manager:v…` image
default in the module) so any other change to them still fails the
check.
2. Use `--unreleased --tag v<version>`: the commits since the last tag,
rendered under the new version.

## Verification

- On a scratch commit that applies prepare's own `sed` bumps for 3.3.27
to `main`: the old allowlist rejects exactly the two files; the new
allowlist and the metadata check pass. A second scratch commit that also
changes `type:` in the chart and the image registry in the module fails
with "Release PR changes non-version metadata".
- `git-cliff 2.14.2` with `cliff.toml` on `main`: `--latest` renders
#753–#779 (the v3.3.26 range); `--unreleased --tag v3.3.27` renders
#553–#873, the 68 commits since v3.3.26.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
alongubkin added a commit that referenced this pull request Oct 5, 2026
)

Refreshes `client-sdks/platform/openapi.json` and the Rust copies with
`runtimeMetadata.pendingPreparedReleaseId` (added in #878). The
generated Rust platform client rejects unknown runtime metadata fields,
so it needs the field before a control plane returns it. The spec also
picks up two small API changes already live on the control plane
(`SyncReleaseRequest.mode` removed; a response description).

Spec files only, like #873; the TypeScript SDK is regenerated at
release.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
alongubkin added a commit that referenced this pull request Oct 5, 2026
A later API spec refresh removed the optional completed-receipt release
mode introduced in #873. Restore that generated contract so typed
clients can send `acknowledge-completed` without dropping the field.

The spec restores only the optional mode and the release response
description. Regenerated the TypeScript release model and related
documentation so its outbound serializer preserves the mode. Existing
ordinary release requests remain valid. All three OpenAPI copies are
identical and were copied from the source API generator output; no
generated schema was hand-edited.

Generation: `SPEAKEASY_BIN=<temporary CLI 1.799.0> pnpm run
generate:platform-api`. Unrelated generated SDK changes were restored as
required by the SDK guidelines.

Validation: structural comparison shows only those two spec changes;
`git diff --check` passes. All 27 existing SDK tests passed, and direct
outbound serialization verifies that completion mode is retained and
omitted mode stays omitted. The completed-receipt behavior was validated
in #873. ALIEN-1221.
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