Skip to content

Neon branch-per-attempt disposable DB fork for APR execution (implements #7649) #7858

Description

@JSONbored

Problem

#7649 ratified Neon branch-per-attempt as the disposable data-fork mechanism for APR execution — a per-attempt copy-on-write database branch, mirroring worktree-pool.ts's per-attempt code checkout. No implementation exists yet.

Area

packages/loopover-engine/src/miner/ (wherever worktree-pool.ts's attempt lifecycle is orchestrated), control-plane/ (Hyperdrive connection routing).

Proposal

At the start of an AMS attempt against an APR repo, create a Neon branch off that tenant's database (via Neon's branching API), route that attempt's DB connection through Hyperdrive at the branch instead of the tenant's primary database, and discard the branch when the attempt concludes (merged or abandoned) — never auto-merging branch data back into the primary. Mirror worktree-pool.ts's create/discard lifecycle hooks so this activates and tears down at the same points in an attempt's lifecycle as the code-side fork already does.

Deliverables

  • Branch creation at attempt start, keyed to the attempt (not the tenant globally — concurrent attempts against the same APR repo get independent branches).
  • The attempt's DB connection routed at the branch via Hyperdrive.
  • Branch discarded on attempt conclusion (merged or abandoned), never auto-merged into primary.
  • Tests: two concurrent attempts don't see each other's writes; a destructive query inside one attempt's branch never reaches the tenant's primary database.

Resources

Boundaries

APR data-fork only — BYOR's target database (customer-owned) is explicitly out of scope, per #7649's own boundaries.

maintainer-only — data-safety mechanism handling real tenant data, not a first-pass contributor task.

Metadata

Metadata

Assignees

Labels

maintainer-onlyOwner-only work — yields no Gittensor points.roadmapOn the Wave-2 agent-layer roadmap board (project 9)

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions