Skip to content

feat(lastcode): commit remote update trials - #66

Closed
lastobelus wants to merge 6 commits into
lastcode/mainfrom
lastcode/issue38-e1-lite
Closed

feat(lastcode): commit remote update trials#66
lastobelus wants to merge 6 commits into
lastcode/mainfrom
lastcode/issue38-e1-lite

Conversation

@lastobelus

Copy link
Copy Markdown
Owner

The activation helper can launch a candidate server in trial mode, but the server had no matching authenticated commit endpoint and could not durably reopen work admission after the helper observed a successful trial.

This adds the exact trial identity and commit RPC contract, keeps trial admission closed until the matching durable drain is claimed and the helper's exact commit record is atomically published, and reloads that record after a server restart so retries remain idempotent. It preserves the merged pending-turn and terminal blocker behavior and adds no UI, scheduling, or activation orchestration.

The server consumes the helper's existing LASTCODE_ACTIVATION_* environment values and writes its existing runtime/activation/<requestId>/commit.json schema. Mismatched records fail closed.

Validation:

  • 152 affected server tests
  • 4 update-drain contract tests
  • 10 activation-helper lifecycle tests
  • server and contracts typechecks
  • scoped formatting, lint, and diff checks
  • normal pre-push LastCode quick CI

Implemented with GPT-5 Codex in LastCode.

@lastobelus

Copy link
Copy Markdown
Owner 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: c2d7a3af5a

ℹ️ 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 apps/server/src/cli/config.ts Outdated
Comment thread apps/server/src/updateDrain/UpdateDrainAdmission.ts
@lastobelus

Copy link
Copy Markdown
Owner 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: 201924a116

ℹ️ 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 apps/server/src/updateDrain/UpdateDrainAdmission.ts
@lastobelus
lastobelus force-pushed the lastcode/issue38-e1-lite branch from 201924a to e4034f3 Compare August 22, 2026 16:09
@lastobelus

Copy link
Copy Markdown
Owner 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: e4034f3570

ℹ️ 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 apps/server/src/updateDrain/UpdateDrainAdmission.ts Outdated
@lastobelus

Copy link
Copy Markdown
Owner 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: 71a87f7dc7

ℹ️ 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 apps/server/src/updateDrain/UpdateDrainAdmission.ts
@lastobelus

Copy link
Copy Markdown
Owner 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: 6c124e6bac

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

await executor.startPriorService(journal);
return transition(store, journal, "rolled-back", { rollbackReason: reason });
const rolledBack = transition(store, journal, "rolled-back", { rollbackReason: reason });
await executor.startPriorService(rolledBack);

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 Clear the claimed drain before starting the previous binary

When the first upgrade containing this commit times out, restoreDatabase restores a snapshot where the request is still claimed, and this line then launches the previous app. That previous binary does not contain the newly added readUpdateActivationRollback startup transition—the parent implementation treats every non-cancelled intent as closed—so it keeps admission closed and rejects cancellation and subsequent drains indefinitely. Fresh evidence beyond the resolved thread is that rollback crosses a binary-version boundary, while the proposed recovery exists only in the discarded candidate; clear the claim through a mechanism available before launching the previous version.

AGENTS.md reference: AGENTS.md:L73-L73

Useful? React with 👍 / 👎.

@lastobelus

Copy link
Copy Markdown
Owner Author

Closing without merge after an architecture correction. The trial/candidate/remote-commit protocol adds more failure surface than the update it protects, and final review exposed a cross-version rollback bridge requirement that confirms the concern. We are replacing this with a simple idle → backup → install → normal restart flow, with rollback only after an actual startup failure. The reviewed branch is preserved for reference; none of this trial protocol will ship.

@lastobelus lastobelus closed this Aug 22, 2026
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