Skip to content

feat(cli): db + s3 resource verbs (spec 29) - #88

Merged
gustavobertoi merged 3 commits into
mainfrom
feat/spec29a-db-s3-verbs
Jul 1, 2026
Merged

feat(cli): db + s3 resource verbs (spec 29)#88
gustavobertoi merged 3 commits into
mainfrom
feat/spec29a-db-s3-verbs

Conversation

@gustavobertoi

Copy link
Copy Markdown
Contributor

Spec 29 (db + object-storage half) — the first imperative resource verbs on the spec-27 substrate. Built in a worktree, verified locally (make ci + determinism + CGO=0 4-target cross-build green; MinIO came up healthy end-to-end).

  • dbcreate (tenant db owned by the project role), user create (--role read|write|admin), grant, list, drop, gc. Extends provision.Postgres with existence-guarded EnsureRole/Grant/EnsureDatabase. Graduates the reserved db stub.
  • s3mb/rb/ls, lifecycle set --expire-days/--transition, versioning on|off, policy, cors. New pure-Go MinIO/S3 provisioner via aws-sdk-go-v2/service/s3 (path-style, behind a mockable S3API seam), reached over a new minio-provision 127.0.0.1 host-port overlay (port base 49000). Buckets are project-prefixed (--no-prefix escape).
  • aws -- — thin argv passthrough to the host aws CLI with --endpoint-url/--region + dev creds prefilled (never reimplements AWS; clear absent-binary error).

Every mutation flows through the flock; reads lock-free; tenant-scoped. New dep: aws-sdk-go-v2 (S3) — pure-Go, confirmed CGO-free in the static cross-build. make vuln is unchanged pre-existing go1.26-toolchain noise (aws-sdk not called).

Follow-ups (noted): aws --help starts the engine to resolve the endpoint (should short-circuit bare help); s3 rb --force object-purge loop; generated-cred → Pusher delivery (Full scope). Messaging verbs are Phase 3b.

🤖 Generated with Claude Code

gustavobertoi and others added 3 commits June 30, 2026 22:00
Extend provision.Postgres with EnsureRole/Grant/EnsureDatabase (existence-
guarded, idempotent) and dispatch resource.Postgres.Ensure by kind: role/user
create a tenant LOGIN role (optional GRANT read|write|admin on a target db),
database with an owner param does CREATE DATABASE ... OWNER <role> with no new
role. Table-driven mock-Conn tests for each path.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…29 stage 2)

New internal/resource/minio.go: bucket create/remove/list + object lifecycle
(expiry + optional transition), versioning toggle, bucket policy, and CORS via
the pure-Go aws-sdk-go-v2 S3 client (path-style, MinIO root creds) behind a
mockable S3API seam. Wire it into the orchestrate registry with a 127.0.0.1
minio-provision overlay (port base 49000, container port 9000, distinct from
postgres 45432); generalize writeProvisionOverlay with a container-port arg and
add UpDeps.S3Factory + orchestrate/minio_ops.go bucket helpers. Fake-S3 unit
tests for every op + an orchestrate wiring test.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
db group (graduates the reserved db stub): create/user create/grant/list/drop/
gc — tenant-scoped Postgres databases + roles/grants through the resource_ops
lock->overlay->provisioner->ledger->event flow, --json + confirm-gated drop/gc.
s3 group: mb/rb/ls/lifecycle set|get|rm/versioning/policy set|get/cors set|get on
the MinIO provisioner, project-prefixed buckets with --no-prefix. aws -- shim:
argv passthrough over the host aws binary with --endpoint-url/--region prepended
and dev creds injected via child env (never argv), clear error when absent.
Table-driven CLI tests: registration, flags, --json, arg passthrough, absent-
binary error, prefix + transition + cors parsing.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@gustavobertoi
gustavobertoi merged commit b39e4d8 into main Jul 1, 2026
4 checks passed
@gustavobertoi
gustavobertoi deleted the feat/spec29a-db-s3-verbs branch July 1, 2026 01:23
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