Phase 8 — Integration prep (cockpit_url + /admin/pool-refresh + cleanup hook + forge_id slot) #9
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Tracking issue for s2-010 (Phase 8 of the hero_onboarding arc per hero_onboarding#1).
Goal
Make
hero_onboardingdeployer-pluggable AHEAD of Track D shipping. When Track D's deployer API lands (under home#235), the integration is ~1-2 sessions (s2-015) instead of 5-6 because Phase 8 has already reserved the schema slots + plumbing.Scope
Schema additions (all
?: stradditive — no codegen-breaking changes):VmAllocation.cockpit_url— URL users follow from the dashboard's Active services table to reach the cockpit on their assigned VM. Populated fromPoolVm.cockpit_urlatallocate()time.User.forge_id— slot reservation for s2-011 Phase 9 (Forge OAuth login + dual-auth model). Not populated by s2-010 code; just present in the schema so Phase 9 doesn't need a separate migration.PoolVm.cockpit_url— operator's cockpit URL for each pool entry; flows intoVmAllocation.cockpit_urlat allocate time.New admin route
POST /admin/pool-refresh(admin-secret-gated):VM_POOL_JSONenv var (bare array OR{pool: [...]}wrapper).Arc<RwLock<Vec<PoolVm>>>(refactor from ownedVecinPoolAssignmentProvisioner).{prev_pool_size, pool_size}.PROVISIONER_DEMO+ noVM_POOL_JSON).Release cleanup hook stub:
async fn on_release(&self, allocation: &VmAllocation)onPoolAssignmentProvisioner(NOT on theProvisionertrait per D-17 stability)."deployer-release stub: would release pool_vm_id={} here".release()impl AFTER the OSIS write succeeds.reqwest.post(deployer_url + "/admin/release-vm")call — single-call-site change.Dashboard surface: 5th column "Cockpit" in the Active services table — renders
<a href="{cockpit_url}">Open →</a>when set,—otherwise. Honest fallback for v0 pool entries without a URL.Admin surface: 13th column "cockpit" in the admin
/allocationstable.Non-goals (deferred)
forge_id?schema slot.PoolVm.statusmid-flight mutation —refresh_pooldoes whole-pool swap. Per-VM maintenance toggling stays inVM_POOL_JSONregen + refresh.Trait stability (per D-17)
The
Provisionerasync-trait shape (locked at s2-009 / D-17) is unchanged at Phase 8:name()+is_demo()+allocate()+release()+status()— same 5 methods, same signatures.refresh_poolandon_releaseare impl-local methods onPoolAssignmentProvisioner, NOT trait methods. v1TfchainAutoDeployProvisionerwill not have these (its "pool" is the on-chain VM registry).provisioner_pool: Option<Arc<PoolAssignmentProvisioner>>as a second reference to the sameArcalready stored inprovisioner: Option<Arc<dyn Provisioner>>— the standardArc<T>↔Arc<dyn Trait>coercion pattern.Acceptance
cargo check --workspaceclean.cargo test --workspace— 47/47 from s2-009 + 4 new provisioner unit tests = 51/51.lab build --release --install --workspaceVICTORY 3/3.lab infocheck3/3 clean.cargo fmt --check+cargo clippy --workspace --all-targets -- -D warningsclean.scripts/smoke_pool_refresh.sh(new, ~10 checks) green.scripts/smoke_vm_allocate.sh35/35 (33 from s2-009 + 2 new cockpit_url checks).Cross-track
Zero file overlap with Track A's home#235 demo-deployer arc (currently on s137 per-user manifest writes in hero_cockpit). The new
/admin/pool-refreshAPI surface is ready for Track D to call whenever they ship the deployer-side pool feed. No Track A coordination required for Phase 8 itself.ID slots
PoolVm.status: Maintenancemechanism already exists.Reference
decisions/D-17-provisioner-trait-shape.mdin workspace.