Skip to content

feat(resource): data-plane resource layer — Provisioner family + resources: block (spec 27) - #87

Merged
gustavobertoi merged 3 commits into
mainfrom
feat/spec27-resource-substrate
Jul 1, 2026
Merged

feat(resource): data-plane resource layer — Provisioner family + resources: block (spec 27)#87
gustavobertoi merged 3 commits into
mainfrom
feat/spec27-resource-substrate

Conversation

@gustavobertoi

Copy link
Copy Markdown
Contributor

Spec 27 — the load-bearing substrate for the local-cloud data plane. Built in a worktree, verified locally (make ci + determinism green, up-saga regression clean).

  • internal/resource — a Resource model + Provisioner interface + Registry + engine→kinds catalog; a Postgres provisioner wrapping the existing provision.EnsureProject verbatim (same idempotent guarded SQL, same predictable dev-cred, same host-port overlay) with Drop/Preflight.
  • internal/secrets.RandomPassword (crypto/rand, pure-Go) for the future generated-cred policy.
  • internal/state.RemoveProvisioned(project,kind,name) — single-resource teardown (free-text kind, no migration).
  • Declarative resources: block on the project config (additive, forward-tolerant, cross-ref-validated).
  • New resources saga phase — provisions declared resources under the flock, records ledger + event, reports drift without dropping. Runs alongside the untouched provisionPhase (so every existing orchestrate test passes unchanged — the refactor is behavior-preserving); both share one Provisioner/ledger/flock/overlay.
  • resource list|show|create|rm|gc engine-agnostic verbs + workspace destroy --purge-data (opt-in destructive).

make ci + determinism green; CGO-free; no new deps (crypto/rand is stdlib). Scope note: only the Postgres provisioner is live; Redis/MinIO/LocalStack/NATS/Kafka provisioners are catalogued + reserved (the "Full" scope that spec 29's verbs fill in); generated-cred → Pusher delivery is not wired yet (predictable dev-cred only, never on disk).

🤖 Generated with Claude Code

gustavobertoi and others added 3 commits June 30, 2026 21:30
…cred + RemoveProvisioned (spec 27)

Behavior-preserving generalization of Postgres provisioning:
- internal/resource: Resource model, Provisioner interface + Registry, Postgres
  provisioner wrapping provision.EnsureProject verbatim (same guarded/idempotent
  SQL, predictable dev-cred), plus engine->kinds catalog.
- internal/secrets: RandomPassword(n) via crypto/rand for the 'generated' policy.
- internal/state: RemoveProvisioned(project,kind,name) single-resource teardown.

The up-saga provision phase is untouched; all orchestrate tests still pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…hase (spec 27)

- internal/config: additive ResourceDecl on Project, cross-ref validated (uses
  targets a declared shared instance, kind supported by the engine, no
  (engine,kind,name) collision); forward-tolerant to unknown keys.
- internal/orchestrate: new 'resources' saga phase provisions every declared
  resource via the engine Provisioner under the flock, records ledger + event,
  and REPORTS drift without auto-dropping. Wired into BuildUp after the implicit
  postgres provision phase; gated on --no-provision. Provision phase untouched.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…rkspace destroy --purge-data (spec 27)

- internal/orchestrate: imperative CreateResource/DropResource/GCResources ops
  (lock -> overlay -> provisioner -> ledger -> event), mirroring the saga phase.
- internal/cli: engine-agnostic 'resource' command group (list/show are lock-free
  reads; create/rm/gc drive the ops; secrets masked unless --show-secrets), and a
  new destructive 'workspace destroy --purge-data' flag beside the data-preserving
  default. Registered under root.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@gustavobertoi
gustavobertoi merged commit 4cd9cb6 into main Jul 1, 2026
4 checks passed
@gustavobertoi
gustavobertoi deleted the feat/spec27-resource-substrate branch July 1, 2026 00:50
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.

1 participant