Skip to content

feat(code-editing): Step 5 — rollback + multi-file deploy + revocation flagging - #68

Merged
WayforthOfficial merged 1 commit into
mainfrom
feat/rollback-multifile-revocation-step5
Jun 27, 2026
Merged

feat(code-editing): Step 5 — rollback + multi-file deploy + revocation flagging#68
WayforthOfficial merged 1 commit into
mainfrom
feat/rollback-multifile-revocation-step5

Conversation

@WayforthOfficial

Copy link
Copy Markdown
Owner

The cheap step on the Step 1–4 foundation — and it completes the code-editing backend. Flag-gated + inert (AGENT_VERSIONED_DISPATCH_ENABLED off). No merge — for review.

Rollback (mostly "repoint active_version_id", as designed)

core.agent_versions.rollback_toinstant + 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 a failed/building version (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-4 redeploy orchestrator unchanged.
  • GET /cloud/agents/{id}/versions → history + active pointer (what rollback targets).
  • Flag-gated; size-capped; RedeployError → HTTP via the shared _redeploy_http mapper.

Package-revocation flagging

Migration 071: revoked_packages table + 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_pins block NEW builds from using a revoked package (wired into the redeploy orchestrator — a package can be allowlisted yet later revoked).
  • Admin POST /admin/packages/revoke + GET /admin/packages/flagged.

Proven against real Postgres — scripts/agent_redeploy_proof.py now 15/15

D. rollback to a prior version (no rebuild)
  PASS  rollback repointed active to v1
  PASS  rolled-back version is now active
  PASS  rollback to a 'failed' version rejected
E. package revocation flags affected versions
  PASS  revoke flagged exactly the version using badpkg
  PASS  unrelated version (httpx) NOT flagged
  PASS  is_revoked(badpkg==1.0) true
  PASS  flagged_versions surfaces the affected version

(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:

  • Step 4b: stand up the minimal real mirror + prove the real egress-locked build E2E, then flip AGENT_VERSIONED_DISPATCH_ENABLED.
  • Frontend (6–7, Lovable).
  • (Separately, the egress-lock flag AGENT_GATEWAY_EGRESS_ENABLED is still gated on the E2B Firecracker-token reply.)

🤖 Generated with Claude Code

…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>
@railway-app
railway-app Bot temporarily deployed to wayforth / wayforth-pr-68 June 27, 2026 20:27 Destroyed
@WayforthOfficial
WayforthOfficial merged commit 1f38665 into main Jun 27, 2026
2 of 3 checks passed
@WayforthOfficial
WayforthOfficial deleted the feat/rollback-multifile-revocation-step5 branch June 27, 2026 20:34
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.

2 participants