feat(code-editing): Step 5 — rollback + multi-file deploy + revocation flagging - #68
Merged
Merged
Conversation
…n flagging
The cheap step on the Step 1-4 foundation. Completes the code-editing backend.
- Rollback (core.agent_versions.rollback_to): instant + safe pointer repoint to a prior
version — its image is already built, so no rebuild. Deliberately NOT forward-only
(rollback goes backward by design); rejects rolling back to a failed/building version.
Endpoint POST /cloud/agents/{id}/rollback {version_id|version_no}.
- Multi-file deploy: POST /cloud/agents/{id}/deploy {files:{path:content}, requirements}
→ the Step-4 redeploy orchestrator (which already takes a files map). + GET /versions
(history + active pointer, what rollback targets). Flag-gated like all versioned dispatch.
- Package revocation flagging (migration 071: revoked_packages + agent_versions.dep_flagged):
core/package_revocation.py revoke_package() flags every version whose baked requirements
include the package; is_revoked/revoked_pins block NEW builds in the redeploy orchestrator;
admin POST /admin/packages/revoke + GET /admin/packages/flagged.
PROVEN (real Postgres, scripts/agent_redeploy_proof.py now 15/15): + D rollback (repoint,
status flip, failed-version rejected) + E revocation (flags exactly the affected version,
not unrelated ones; is_revoked; flagged_versions surfacing). Migration 071 ephemeral-pg
proof: additive, idempotent, reversible. 7 new unit tests. Full suite 623 passed.
Flag-gated + inert (AGENT_VERSIONED_DISPATCH_ENABLED off). After this, backend Steps 1-5
complete; remaining: Step 4b (real mirror + E2E build proof) before flip, then frontend.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The cheap step on the Step 1–4 foundation — and it completes the code-editing backend. Flag-gated + inert (
AGENT_VERSIONED_DISPATCH_ENABLEDoff). No merge — for review.Rollback (mostly "repoint active_version_id", as designed)
core.agent_versions.rollback_to— instant + safe: the target version's image is already built, so rollback is a pure pointer repoint, no rebuild. Deliberately not forward-only (rollback goes backward by design); rejects rolling back to afailed/buildingversion (nothing usable to serve).POST /cloud/agents/{id}/rollback {version_id | version_no}Multi-file deploy (the orchestrator already takes a files map)
POST /cloud/agents/{id}/deploy {files: {path: content}, requirements}→ the Step-4redeployorchestrator unchanged.GET /cloud/agents/{id}/versions→ history + active pointer (what rollback targets).RedeployError→ HTTP via the shared_redeploy_httpmapper.Package-revocation flagging
Migration 071:
revoked_packagestable +agent_versions.dep_flagged.revoke_package(name, version?, reason?)records the revocation and flags every version whose baked requirements include it (so affected agents can be rebuilt).is_revoked/revoked_pinsblock NEW builds from using a revoked package (wired into the redeploy orchestrator — a package can be allowlisted yet later revoked).POST /admin/packages/revoke+GET /admin/packages/flagged.Proven against real Postgres —
scripts/agent_redeploy_proof.pynow 15/15(A–C from Step 4 still pass.) Migration 071 ephemeral-pg proof: additive, idempotent, reversible. 7 new unit tests. Full suite 623 passed.
Where this leaves the backend
Steps 1–5 complete. Remaining before users touch it:
AGENT_VERSIONED_DISPATCH_ENABLED.AGENT_GATEWAY_EGRESS_ENABLEDis still gated on the E2B Firecracker-token reply.)🤖 Generated with Claude Code