Commit Graph

95 Commits

Author SHA1 Message Date
jordan
4f01015132 feat: implement project access enforcement and management API
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
- Fix no-op RequireProjectAccess middleware to enforce project_ids
- Apply project access middleware to all project-scoped routes
- Filter GET /projects by allowed project IDs for restricted keys
- Add GET /me endpoint with key identity, scopes, and project access info
- Add PATCH /keys/{id} for partial key updates (name, scopes, project_ids, allowed_ips, expires_in)
- Add GET/POST/DELETE /projects/{id}/access for project-centric access management
- Auto-grant creating key access when using POST /project/create-and-build
- Accept grant_to_key_ids in create-and-build to grant multiple keys on project creation
- Move newProvisionerWithDeps test helper from production code to test file

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-21 15:38:37 -07:00
jordan
a8c8a0a14d feat: add GCS-based persistent media storage, AI generation pipeline, and composable skeleton packages
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Adds complete media storage pipeline with GCS presigned uploads, AI image/video/text generation
via queue-based workers, realtime SSE event streaming, and comprehensive skeleton packages
(storage, mediagen, textgen, generation, realtime, persona, routing, ai-client). Includes
security fixes for media delete authorization, nil pointer guards in handlers, video persistence
via download-then-upload, consistent signed URLs, and Image→ImageIcon rename to avoid DOM collision.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 21:29:09 -07:00
jordan
7249575dea feat(sessions): add command execution endpoint and activity tracking
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
- Add POST /sessions/:id/exec endpoint for executing commands in sessions
- Add session activity tracking (last_activity_at timestamp)
- Add database migration 024 for session activity column
- Add comprehensive tests for session handlers and service layer
- Add wildcard TLS certificate for preview.threesix.ai subdomain
- Add infrastructure mocks for testing preview service
- Refactor preview cleanup logic to remove unused methods
- Add AIOS core documentation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-02-13 08:41:05 -07:00
jordan
a9ad3d8304 chore: accumulated platform hardening and CI fixes
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
CI / Woodpecker:
- Add explicit depends_on to all .woodpecker.yml steps (rdev + templates)
- Fix skip_tls_verify -> skip-tls-verify (correct Kaniko flag name)
- Add replicasets get/list to deployer RBAC for rollout status
- Skeleton template: add failure:ignore on docs steps, Traefik TLS
  annotations on ingress, depends_on on verify step

Component templates:
- Fix container name in deploy steps (PROJECT_NAME-COMPONENT_NAME)
- Replace kubectl scale with kubectl patch for replicas
- Add post-deploy image verification and rollout status checks
- Applied consistently across all 5 component templates

Adapters:
- gitea: Add HTTP client timeout (30s), context cancellation checks,
  handle 404 on GetRepo/DeleteRepo
- zot: Add retry with exponential backoff (doWithRetry), limit response
  body reads to 10MB
- cockroach: Use net.JoinHostPort for IPv6-safe DSN construction
- woodpecker: Fix error wrapping (%v -> %w)
- redis: Fix error wrapping (%v -> %w)
- deployer: Add context cancellation checks

Services:
- apikey_service: Fix error wrapping (%v -> %w)
- component_deploy: Fix error wrapping (%v -> %w)
- project_infra: Fix error wrapping (%v -> %w)
- webhook/dispatcher: Fix error wrapping (%v -> %w)

Other:
- CLAUDE.md: Add guide links for Gitea, Go 1.25, Woodpecker v3,
  Traefik v3, Zot registry
- circuitbreaker: Add test for error wrapping
- docs: Update deployment, troubleshooting, and runbook docs
- health: Fix error wrapping (%v -> %w)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 23:16:56 -07:00
jordan
f8554a5e6f fix(ci): prevent Woodpecker PVC false failures
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Woodpecker's K8s backend creates a PVC per pipeline for workspace sharing.
If the agent misses cleanup, stale PVCs cause "already exists" errors that
mark pipelines as failed despite all steps succeeding.

Two-part fix:
1. Scale woodpecker-agent from 2 to 1 replica (eliminates PVC name race
   between agents processing the same repo)
2. Add CronJob that garbage-collects wp-* PVCs older than 30 minutes
   every 5 minutes (handles crash/restart edge cases)

Includes dedicated ServiceAccount and least-privilege RBAC (PVC list/delete
only in threesix namespace).

Ref: https://github.com/woodpecker-ci/woodpecker/issues/1594

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 22:00:03 -07:00
jordan
d63f827713 fix(rbac): grant woodpecker-deployer access to statefulsets
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
The CI deploy step runs `kubectl set image statefulset/claudebox` but
the woodpecker-deployer Role only included `deployments`. Add
`statefulsets` to the allowed resources.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 19:35:28 -07:00
jordan
70143fa1cd fix(ci): add watch permission for Woodpecker CI deployments
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Woodpecker CI was timing out when watching deployment rollout status
due to missing RBAC permissions. The deployments were succeeding but
CI couldn't verify completion.

Changes:
- Add 'watch' verb to woodpecker-deployer Role
- Add threesix/default service account to RoleBinding
- Consolidate woodpecker-deployer RBAC into base/rbac.yaml

This resolves the "Failed to watch: deployments.apps is forbidden"
errors in CI logs while maintaining successful deployment rollouts.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-02-09 01:14:00 -07:00
jordan
5d86bb7c57 feat: enable Claude Code OTEL telemetry in claudebox containers
Add OpenTelemetry environment variables to export Claude Code logs
and metrics to the existing OTEL collector. Provides visibility into
long-running builds.

- claudebox-worker: sidecar in rdev-worker deployment
- claudebox-standalone: StatefulSet for direct access

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 19:43:47 -07:00
jordan
bc010c4746 feat: add RWX storage class and full SDLC lifecycle cookbook
- Add longhorn-rwx StorageClass for RWX volume support
- Add slackpath-5-full-lifecycle.yaml cookbook tree (all 10 SDLC phases)
- Update worker-pool.md documentation
- Consolidate PVC configuration, remove separate pvc-shared-claude.yaml
- Update rdev-worker and kustomization for new PVC structure

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 11:37:57 -07:00
jordan
d7a6f37593 fix: worker graceful shutdown and RWO PVC compatibility
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
- Add WaitGroup for graceful shutdown of in-flight tasks
- Change replicas to 1 with Recreate strategy (RWO PVC limitation)
- Optimize Dockerfile: combine RUN commands for smaller layers
- Add compiled binaries to .gitignore

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 00:35:00 -07:00
jordan
dc00921703 ci: add Woodpecker CI for self-hosted builds
- Add .woodpecker.yml with build steps for api, worker, claudebox
- Update K8s manifests to use registry.threesix.ai/rdev/*
- Remove ghcr-secret imagePullSecrets (Zot is unauthenticated)

Builds will run on Woodpecker using kaniko, pushing to our internal
Zot registry. This eliminates the QEMU cross-compilation issues on
Apple Silicon.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 19:26:44 -07:00
jordan
3b35900a2d feat: enterprise worker pool with HTTP sidecar pattern
Implements horizontally-scalable worker pool architecture:
- claudebox-sidecar: HTTP server for Claude Code, git, and SDLC ops
- rdev-worker: standalone worker binary polling rdev-api for tasks
- HTTP client adapter for sidecar communication
- HPA with custom Prometheus metrics for autoscaling
- ServiceMonitor for metrics scraping

Code review fixes applied:
- URL-encode query parameters in GitStatus (Critical #1)
- Remove unused shellQuote function (Critical #2)
- Use stdlib strings.Split/TrimSpace (Critical #3)
- Add version injection via ldflags (Warning #4)
- Add debug logging for swallowed git/sdlc errors (Warning #5, #6)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 16:21:11 -07:00
jordan
da482b48b4 release: v0.10.56 - fix: worker template unused pkg/config import 2026-02-05 13:46:45 -07:00
jordan
0c7282b9eb release: v0.10.55 - fix: Dockerfile templates use GOWORK=off for independent component builds 2026-02-05 13:09:35 -07:00
jordan
a7fcba3587 release: v0.10.54 - fix: go.work race condition with batch components 2026-02-05 12:46:22 -07:00
jordan
19837f7251 release: v0.10.53 - fix: shell-quote SDLC command args to handle spaces in titles 2026-02-05 00:44:34 -07:00
jordan
022184ef6a chore: update claudebox to v0.4.0 (includes sdlc binary) 2026-02-05 00:18:02 -07:00
jordan
4766a54314 release: v0.10.52 - feat: SDLC worker routing for skeleton projects with auto-init 2026-02-05 00:16:29 -07:00
jordan
46c8bfeec2 release: v0.10.51 - feat: inject provisioned credentials into component deployments 2026-02-05 00:09:43 -07:00
jordan
34e12ff3d5 release: v0.10.50 - fix: resolve systemic debt in worker and skeleton templates 2026-02-04 23:57:55 -07:00
jordan
619a57c240 release: v0.10.49 - fix: add workspace package paths to app-react and app-astro tailwind configs 2026-02-04 01:03:14 -07:00
jordan
78e8eb5f27 release: v0.10.48 - feat: multi-component ingress routing with path-based routing 2026-02-03 23:03:22 -07:00
jordan
f8433a1d16 release: v0.10.47 - fix: make go.work.sum optional in component Dockerfiles 2026-02-03 19:58:49 -07:00
jordan
86b372fa08 release: v0.10.46 - feat: add diagnostics endpoint and external health monitoring 2026-02-03 19:22:56 -07:00
jordan
9128dd23b5 release: v0.10.45 - chore: remove hardcoded fallback projects 2026-02-03 19:07:38 -07:00
jordan
5c615fd54c release: v0.10.44 - fix: composable monorepo CI builds + health improvements 2026-02-03 19:04:33 -07:00
jordan
9a1309a0c5 feat: fix composable monorepo CI builds + health endpoint improvements
Composable monorepo CI fixes:
- Add empty go.sum.tmpl files for pkg, service, worker, and cli components
- Fix Dockerfile.tmpl glob patterns (COPY go.work.sum* is invalid in Kaniko)
- Add deps step to CI that runs go work sync and go mod tidy before builds
- Fix scalar-go dependency version (v0.1.2 doesn't exist, use v0.13.0)

Health endpoint improvements:
- Add registry health check (zot OCI /v2/ endpoint)
- Add health metrics for CI, registry, and Git
- Add /health/ci endpoint for Woodpecker health

Visual verification scaffolding:
- Add Playwright pod and scripts ConfigMap
- Add vision.md and implementation breakdown plan

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 18:46:51 -07:00
jordan
9a0591e67d release: v0.10.43 - feat: add WorkerService.FailTask for audit updates + visual verification scaffolding 2026-02-03 00:09:19 -07:00
jordan
b2152b7967 release: v0.10.42 - feat: add work task error classification and user-facing error codes 2026-02-03 00:07:38 -07:00
jordan
cce4314a39 release: v0.10.41 - feat: add artifact pass/fail/needs-fix lifecycle for SDLC execution phases 2026-02-02 22:15:34 -07:00
jordan
fc2cfa139c release: v0.10.40 - feat: add worker pool infrastructure for composable projects 2026-02-02 19:56:04 -07:00
jordan
aaf66764fb feat: add worker pool infrastructure for composable projects
- Add POST /workers/register and POST /workers/{workerId}/heartbeat endpoints
- Start worker health checker goroutine in main.go
- Fix network policy to allow K8s API server access (includes real endpoint IPs)
- Add rdev.orchard9.ai/role: worker label to claudebox StatefulSet

This enables the embedded WorkExecutor to reach claudebox-0 for executing
builds on composable projects that don't have dedicated pods.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 19:55:37 -07:00
jordan
fc0f6db184 release: v0.10.39 - fix: resolve chi route conflicts for SDLC endpoints 2026-02-02 19:17:51 -07:00
jordan
1a69298e9c release: v0.10.38 - feat: add feature development E2E test and SDLC API deployment 2026-02-02 19:13:45 -07:00
jordan
c280a92012 feat: add operations audit system and template improvements
Operations Audit (new feature):
- Add Operation domain model with status tracking (pending, running, completed, failed, cancelled)
- Add OperationRepository with PostgreSQL implementation
- Add OperationService for CRUD and lifecycle management
- Add operations handlers (list, get, cancel endpoints)
- Add migration 015_operations.sql for operations table
- Add operation cleanup worker for stale operation handling
- Add ErrOperationNotFound to domain errors

Template Improvements:
- Add CLAUDE.md configuration files to astro-landing, default, and go-api templates
- Fix PORT template variable usage in nginx configs for app templates
- Add replace directives for local pkg module in Go templates
- Simplify Go service/worker Dockerfiles for workspace builds
- Fix TypeScript error in logger template

Other:
- Refactor landing-test.sh cookbook script
- Update CLAUDE.md version reference

Note: Some files exceed 500-line limit (pre-existing debt + new feature)
- component.go: 550 lines (unchanged, pre-existing)
- main.go: 522 lines (added operations wiring)
- operation_repo.go: 569 lines (new, needs splitting)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 19:08:57 -07:00
jordan
56fd376922 release: v0.10.37 - fix: use PORT template variable for nginx in app templates 2026-02-01 14:16:17 -07:00
jordan
20f14c3810 release: v0.10.36 - fix: skip project-level deployment for composable projects 2026-02-01 14:08:45 -07:00
jordan
ab43869317 release: v0.10.35 - fix: use registry.threesix.ai as default registry URL 2026-02-01 14:00:27 -07:00
jordan
13c7111a8b release: v0.10.34 - fix: add replace directives for local pkg module in Go templates 2026-02-01 13:52:44 -07:00
jordan
f8e6a6e25c release: v0.10.33 - fix: build from workspace root to find go.work 2026-02-01 13:45:30 -07:00
jordan
931c7c0074 release: v0.10.32 - fix: use git.threesix.ai module path and add GOPRIVATE 2026-02-01 13:39:05 -07:00
jordan
88ae77e9d0 release: v0.10.31 - fix: restore git in Go Dockerfiles for external deps 2026-02-01 13:11:33 -07:00
jordan
79f1fefd9e release: v0.10.30 - fix: simplify Go Dockerfiles to handle workspace deps 2026-02-01 13:04:36 -07:00
jordan
cee736e781 release: v0.10.29 - fix: install git in Go service/worker Dockerfiles 2026-02-01 12:57:29 -07:00
jordan
eb70704c6b release: v0.10.28 - fix: TypeScript error in logger template 2026-02-01 12:51:03 -07:00
jordan
552c36233d release: v0.10.27 - fix: woodpecker step YAML multi-line command syntax 2026-02-01 12:45:37 -07:00
jordan
25ce2ebd65 release: v0.10.25 - feat: add pipeline steps API for debugging diagnostics 2026-02-01 12:44:47 -07:00
jordan
05a64c51e7 release: v0.10.27 - fix: woodpecker step YAML multi-line command syntax 2026-02-01 12:42:18 -07:00
jordan
35dc4d26a4 release: v0.10.25 - feat: add pipeline steps API for debugging diagnostics 2026-02-01 12:41:04 -07:00
jordan
ccc3f13ced release: v0.10.26 - fix: sanitize component path for K8s labels 2026-02-01 12:28:08 -07:00