Done Work Item
Infra provider adapter pattern — refactor Hetzner + Cloudflare scripts to IInfraProviderAdapter, extract reusable provider library, and wire provisioning actions into operator cockpit UI
Refactor provision-hetzner-build-factory.ps1 and configure-cloudflare-build-factory-dns.ps1 to implement a formal IInfraProviderAdapter contract (PowerShell interface + JSON schema). Extract a reusable provider library module (scripts/lib/infra-provider-adapter.ps1) that any product repo can import without copy-paste. Expose provisioning and DNS actions (create-server, delete-server, create-dns-record, delete-dns-record, get-server-status) as operator cockpit API routes and surface them in the cockpit UI (settings or infrastructure panel). Goal: a future product can provision a new VPS + DNS record from the cockpit UI in one operator action, with the provider (Hetzner, Cloudflare, or other) swappable via config without touching implementation code.
Execution Context
- ID
- wi-BF-291
- Branch
- bf/BF-291-infra-provider-adapter
- Validation
- ./scripts/validate-local.ps1
- PR
- https://github.com/SingletonTheory/build-factory-bootstrap/pull/276
Lifecycle Metadata
- Lane
- Done
- Work type
- feature
- Source
- done
- Status
- done
- State
- done
- Done criteria
- 9
Queue Truth
Freshness: Fresh (snapshot age 0s)
Drift: none.
Reconciliation Guidance
- No reconciliation required; item truth signals are consistent.
Prompt Context
./work-items/prompts/wi-BF-291.prompt.md
Refactor provision-hetzner-build-factory.ps1 and configure-cloudflare-build-factory-dns.ps1 to implement a formal IInfraProviderAdapter contract (PowerShell interface + JSON schema). Extract a reusable provider library module (scripts/lib/infra-provider-adapter.ps1) that any product repo can import without copy-paste. Expose provisioning and DNS actions (create-server, delete-server, create-dns-record, delete-dns-record, get-server-status) as operator cockpit API routes and surface them in the cockpit UI (settings or infrastructure panel). Goal: a future product can provision a new VPS + DNS record from the cockpit UI in one operator action, with the provider (Hetzner, Cloudflare, or other) swappable via config without touching implementation code.
Available Actions
- Start executionBlocked
Queue execution handoff for this work item.
Recovery guidance
- Cause
- Done items stay closed; Start execution cannot move them backward.
- Policy context
- Lane transition policy blocks Start execution when the item is already Done.
- Next step
- Create a net-new work item if more delivery is needed instead of reopening this one.
- Safe retry
- Do not retry Start execution on a done item.
identity: start-execution
permission: factory.work-item.execute
policy gate lane-transition: blocked (Done items stay closed; Start execution cannot move them backward.)
POST /api/control-plane/items/wi-BF-291/actions/start-execution
- Request reviewBlocked
Mark this item ready for review lane handoff.
Recovery guidance
- Cause
- Done items stay closed; Request review cannot move them backward.
- Policy context
- Lane transition policy blocks Request review when the item is already Done.
- Next step
- Create a net-new work item if more delivery is needed instead of reopening this one.
- Safe retry
- Do not retry Request review on a done item.
identity: request-review
permission: factory.work-item.request-review
policy gate lane-transition: blocked (Done items stay closed; Request review cannot move them backward.)
POST /api/control-plane/items/wi-BF-291/actions/request-review
- Prepare releaseEnabled
Run release-preparation checks for the work item.
identity: prepare-release
permission: factory.work-item.prepare-release
policy gate lane-eligibility: pass
policy gate pull-request: pass
POST /api/control-plane/items/wi-BF-291/actions/prepare-release
- Record historyEnabled
Capture history snapshots for audit and validation views.
identity: record-history
permission: factory.work-item.record-history
policy gate context-visibility: pass
POST /api/control-plane/items/wi-BF-291/actions/record-history