diff --git a/.env.example b/.env.example index 43145bf..6d1bf67 100644 --- a/.env.example +++ b/.env.example @@ -75,10 +75,20 @@ PORT=7401 # load. SIDECAR_WORKERS=2 -# ----- Build library ----- -# SQLite path for persisted trajectories. Empty disables persistence and -# the get_similar_past_builds tool (useful for stateless test deployments). -BUILDLIBRARY_PATH=./buildlibrary.db +# ----- Build library (PostgreSQL) ----- +# Connection string for the build library. Required; the API refuses to +# start without it. docker-compose and the Helm bundled Postgres default +# to these credentials; override for managed Postgres. +DATABASE_URL=postgres://robuilder:robuilder@localhost:5432/robuilder?sslmode=disable +POSTGRES_USER=robuilder +POSTGRES_PASSWORD=robuilder +POSTGRES_DB=robuilder + +# Lease-based job recovery (multi-pod safe). Defaults shown. +GENERATION_LEASE_TTL=90s +GENERATION_LEASE_SWEEP_INTERVAL=30s +# Requeue cap for jobs whose worker died mid-run. 0 disables retry. +GENERATION_MAX_ATTEMPTS=0 # ----- Generation worker pool ----- # Number of goroutines that pull from the generations queue concurrently. diff --git a/README.md b/README.md index 34f4d8f..4d145a7 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ authored for them. │ │ HTTP handler │ → │ Orchestrator │ │ │ └──────────────┘ │ ↪ LLM provider (Claude / OpenAI) │ │ │ │ ↪ Tool registry │ │ -│ │ ↪ Build library (SQLite) │ │ +│ │ ↪ Build library (PostgreSQL) │ │ │ │ ↪ Scoring client → ─────┐ │ │ │ └───────────────────────────│──────────┘ │ └─────────────────────────────────────────────────│────────────┘ @@ -59,7 +59,7 @@ cmd/ one Go binary per directory verify-mapping/ spot-check tool internal/ api/ HTTP handlers, OpenAPI types - buildlibrary/ SQLite persistence + buildlibrary/ PostgreSQL persistence catalog/ //go:embed item/mob/skill data data/ emulator-source parsers sources/hercules/ @@ -103,7 +103,7 @@ What's wired up today: | Servers | UARO profile shipped; alternates by dropping a YAML under `configs/servers/` | | Playstyle | PvM tuned; `pvp` / `balanced_*` accepted but less validated | | LLM provider | Anthropic (default) and OpenAI-compatible (LM Studio, llama.cpp, Ollama, vLLM, ...) | -| Persistence | SQLite at `BUILDLIBRARY_PATH` | +| Persistence | PostgreSQL at `DATABASE_URL` | --- @@ -213,8 +213,8 @@ task run:api ```bash task docker:up # builds both images, runs in the foreground -task docker:down # stops; named volume `ro-builder-buildlibrary` survives -task docker:nuke # stops AND drops the buildlibrary volume +task docker:down # stops; named volume `ro-builder-pgdata` survives +task docker:nuke # stops AND drops the pgdata volume ``` The sidecar's calc backend defaults to rocalc. Set `CALC_BACKEND=stub` in your shell env (or `.env`) before @@ -442,8 +442,8 @@ Not yet done, roughly in priority order: - [ ] Vector search over saved trajectories' reasoning text. Today's `get_similar_past_builds` uses class+scenario lookup. - [ ] Add RAG with injecting get_similar_past_builds into initial system prompt -- [ ] Postgres migration for the build library. SQLite pins the API to `replicas: 1` and `strategy: Recreate`; HPA / PDB - are excluded from the Helm chart until this lands. +- [x] Postgres migration for the build library. The API is now stateless; horizontal scaling is supported via the + lease-based generation queue (SKIP LOCKED claim, requeue with cap), configurable replicas, and HPA/PDB in the Helm chart. - [ ] General prompt tuning - less tokens, more progress. - [ ] More golden fixtures beyond Taekwon Kid. The shim handles all 45 supported classes already - [ ] Golden fixtures for Full Support builds diff --git a/Taskfile.yml b/Taskfile.yml index 00f2e0b..4432c59 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -211,7 +211,7 @@ tasks: - task: test:sidecar:backend:rocalc test:sidecar:shim:rocalc: - desc: 'Shim contract tests against rocalc. Proves rocalc satisfies the contract. Needs vendor/.' + desc: 'Shim contract tests against rocalc. Proves rocalc satisfies the contract. Needs vendor/ .' dir: '{{.SIDECAR_DIR}}' env: CALC_BACKEND: rocalc @@ -227,7 +227,7 @@ tasks: - node --test test/shim/*.test.ts test:sidecar:backend:rocalc: - desc: 'Rocalc-specific tests (numerics, classes). Needs vendor/.' + desc: 'Rocalc-specific tests (numerics, classes). Needs vendor/ .' dir: '{{.SIDECAR_DIR}}' env: CALC_BACKEND: rocalc @@ -329,7 +329,7 @@ tasks: - docker compose down docker:nuke: - desc: Stop, remove containers AND named volumes (drops the persisted buildlibrary) + desc: Stop, remove containers AND named volumes (drops the postgres data volume) cmds: - docker compose down -v @@ -340,7 +340,7 @@ tasks: # # Day-zero: `task tilt:bootstrap` (one-shot; installs sealed-secrets # controller, creates namespace), then `task tilt:seal` (encrypts your - # .env's LLM_API_KEY), then `task tilt:up`. + # .env's LLM_API_KEY and Postgres creds), then `task tilt:up`. # # The compose path (docker:*) is intact and remains the CI test target. @@ -351,7 +351,7 @@ tasks: - ./scripts/k8s-bootstrap.sh tilt:seal: - desc: 'Encrypt LLM_API_KEY from .env into deploy/k8s/sealed-secrets/local.sealed-secret.yaml.' + desc: 'Encrypt LLM_API_KEY + Postgres creds from .env into the local SealedSecret.' cmds: - ./scripts/seal-secret.sh @@ -361,12 +361,12 @@ tasks: - tilt up tilt:down: - desc: 'Stop Tilt-managed resources. The PVC (buildlibrary) survives.' + desc: 'Stop Tilt-managed resources. The Postgres PVC survives.' cmds: - tilt down tilt:nuke: - desc: 'Stop Tilt + delete the namespace (drops the PVC and the buildlibrary).' + desc: 'Stop Tilt + delete the namespace (drops the Postgres PVC).' cmds: - tilt down - kubectl delete namespace ro-builder --ignore-not-found diff --git a/Tiltfile b/Tiltfile index ab533f4..0bc5725 100644 --- a/Tiltfile +++ b/Tiltfile @@ -110,10 +110,15 @@ k8s_yaml(yaml) _secret_dep = ['sealed-secret'] if _sealed_secret_ready else [] +k8s_resource( + 'ro-builder-postgres', + labels=['db'], +) + k8s_resource( 'ro-builder-api', port_forwards=['8080:8080'], - resource_deps=_secret_dep + ['api-binary'], + resource_deps=_secret_dep + ['api-binary', 'ro-builder-postgres'], labels=['app'], ) diff --git a/cmd/api/healthz.go b/cmd/api/healthz.go index 4ddff67..641c34e 100644 --- a/cmd/api/healthz.go +++ b/cmd/api/healthz.go @@ -5,7 +5,7 @@ import ( ) // healthzHandler is a liveness probe target. Returns 200 with a minimal JSON -// body. Intentionally does not touch SQLite or the sidecar; those failure +// body. Intentionally does not touch the database or the sidecar; those failure // modes belong to richer probes (or to /readyz, when we add one). func healthzHandler(w http.ResponseWriter, r *http.Request) { if r.Method != http.MethodGet { diff --git a/cmd/api/main.go b/cmd/api/main.go index 8349824..9484f5a 100644 --- a/cmd/api/main.go +++ b/cmd/api/main.go @@ -5,9 +5,10 @@ // // Required environment: // -// BUILDLIBRARY_PATH - SQLite file path for the build library. The DB -// holds the generations queue + saved trajectories. -// Required; the binary refuses to start without it. +// DATABASE_URL - PostgreSQL connection string for the build library +// (e.g. postgres://user:pass@host:5432/robuilder?sslmode=disable). +// Holds the generations queue + saved trajectories. +// Required; the binary refuses to start without it. // // Optional environment: // @@ -24,6 +25,9 @@ // GENERATION_POLL_INTERVAL - worker fallback poll cadence (default 5s) // GENERATION_SHUTDOWN_TIMEOUT - drain window on SIGTERM/SIGINT (default 5m) // GENERATION_MAX_ITERS - orchestrator tool-use cap (default 60) +// GENERATION_LEASE_TTL - job lease duration (default 90s) +// GENERATION_LEASE_SWEEP_INTERVAL - expired-lease sweep cadence (default 30s) +// GENERATION_MAX_ATTEMPTS - requeue cap; 0 disables retry (default 0) // LOG_LEVEL - debug|info|warn|error (default info) // LOG_FORMAT - text|json (default text) package main @@ -64,9 +68,9 @@ func main() { } func run() error { - libPath := os.Getenv("BUILDLIBRARY_PATH") - if libPath == "" { - return errors.New("BUILDLIBRARY_PATH is required") + dsn := os.Getenv("DATABASE_URL") + if dsn == "" { + return errors.New("DATABASE_URL is required") } logger := buildLogger() @@ -104,17 +108,20 @@ func run() error { } logger.Info("server profiles loaded", slog.Any("profiles", profileKeys)) - lib, err := buildlibrary.Open(libPath) + lib, err := buildlibrary.Open(context.Background(), dsn) if err != nil { - return fmt.Errorf("buildlibrary open at %s: %w", libPath, err) + return fmt.Errorf("buildlibrary open: %w", err) } defer func() { _ = lib.Close() }() - n, err := lib.RecoverOrphans(context.Background()) + + maxAttempts := envInt("GENERATION_MAX_ATTEMPTS", 0) + rq, fl, err := lib.RecoverExpiredLeases(context.Background(), maxAttempts) if err != nil { - return fmt.Errorf("recover orphans at startup: %w", err) + return fmt.Errorf("recover expired leases at startup: %w", err) } - if n > 0 { - logger.Warn("recovered orphaned generations", slog.Int("count", n)) + if rq > 0 || fl > 0 { + logger.Warn("recovered expired leases at startup", + slog.Int("requeued", rq), slog.Int("failed", fl)) } llmCfg := llm.LoadConfigFromEnv() @@ -158,12 +165,18 @@ func run() error { WithCatalog(cat). WithMaxIters(maxIters) + leaseTTL := envDuration("GENERATION_LEASE_TTL", 90*time.Second) + sweepInterval := envDuration("GENERATION_LEASE_SWEEP_INTERVAL", 30*time.Second) + pool = workers.New(workers.Config{ - Library: lib, - Runner: orchestratorRunner{orch: orch}, - Save: makeSaveCallback(lib, cat), - Workers: numWorkers, - PollInterval: pollInterval, + Library: lib, + Runner: orchestratorRunner{orch: orch}, + Save: makeSaveCallback(lib, cat), + Workers: numWorkers, + PollInterval: pollInterval, + LeaseTTL: leaseTTL, + SweepInterval: sweepInterval, + MaxAttempts: maxAttempts, }) pool.Start() @@ -267,12 +280,13 @@ func (e *apiEnqueuer) ShutdownTimeoutSeconds() int { return int(e.shutdownTimeou // successful generation to the saved_trajectories table keyed to the // generation's id. func makeSaveCallback(lib *buildlibrary.Library, cat *catalog.Catalog) workers.SaveCallback { - return func(ctx context.Context, id string, req orchestrator.GenerateRequest, res *orchestrator.GenerateResult) error { + return func(ctx context.Context, id, owner string, req orchestrator.GenerateRequest, res *orchestrator.GenerateResult) error { if res == nil || res.Primary == nil { return errors.New("nil result; nothing to save") } in := buildlibrary.SaveInput{ ID: id, + Owner: owner, Class: req.Class, Server: req.Server, Playstyle: req.Playstyle, diff --git a/cmd/api/maintest_test.go b/cmd/api/maintest_test.go new file mode 100644 index 0000000..3e60b76 --- /dev/null +++ b/cmd/api/maintest_test.go @@ -0,0 +1,47 @@ +package main + +import ( + "context" + "flag" + "fmt" + "os" + "testing" + "time" + + "github.com/testcontainers/testcontainers-go" + "github.com/testcontainers/testcontainers-go/modules/postgres" + "github.com/testcontainers/testcontainers-go/wait" +) + +// testDSN points at the shared package-level Postgres container. Empty +// under -short (no container started). +var testDSN string + +func TestMain(m *testing.M) { + flag.Parse() + if testing.Short() { + os.Exit(m.Run()) + } + ctx := context.Background() + ctr, err := postgres.Run(ctx, "pgvector/pgvector:pg17", + postgres.WithDatabase("robuilder_test"), + postgres.WithUsername("test"), + postgres.WithPassword("test"), + testcontainers.WithWaitStrategy( + wait.ForLog("database system is ready to accept connections"). + WithOccurrence(2).WithStartupTimeout(60*time.Second)), + ) + if err != nil { + fmt.Fprintln(os.Stderr, "testcontainers postgres start:", err) + os.Exit(1) + } + dsn, err := ctr.ConnectionString(ctx, "sslmode=disable") + if err != nil { + fmt.Fprintln(os.Stderr, "connection string:", err) + os.Exit(1) + } + testDSN = dsn + code := m.Run() + _ = ctr.Terminate(ctx) + os.Exit(code) +} diff --git a/cmd/api/readyz_test.go b/cmd/api/readyz_test.go index 6b17ae2..c0e432a 100644 --- a/cmd/api/readyz_test.go +++ b/cmd/api/readyz_test.go @@ -1,10 +1,10 @@ package main import ( + "context" "encoding/json" "net/http" "net/http/httptest" - "path/filepath" "testing" "time" @@ -28,11 +28,17 @@ func fakeSidecar(t *testing.T, status int) string { func openTempLibrary(t *testing.T) *buildlibrary.Library { t.Helper() - lib, err := buildlibrary.Open(filepath.Join(t.TempDir(), "test.db")) + if testing.Short() { + t.Skip("requires Postgres (testcontainers); skipped under -short") + } + lib, err := buildlibrary.Open(context.Background(), testDSN) if err != nil { t.Fatalf("buildlibrary.Open: %v", err) } t.Cleanup(func() { _ = lib.Close() }) + if err := lib.Truncate(context.Background()); err != nil { + t.Fatalf("truncate: %v", err) + } return lib } diff --git a/deploy/helm/ro-builder/README.md b/deploy/helm/ro-builder/README.md index d822d01..185c4ce 100644 --- a/deploy/helm/ro-builder/README.md +++ b/deploy/helm/ro-builder/README.md @@ -43,8 +43,9 @@ happens outside the chart's lifecycle. See `values.yaml` for the full schema and defaults. Key sections: -- `api.*`: image, resources, persistence, probes. Always `replicas: 1` - with `strategy: Recreate` (SQLite is single-writer). +- `api.*`: image, resources, persistence, probes. `api.replicas` is + configurable; `api.autoscaling` enables HPA. The default strategy is + `RollingUpdate` (the API is stateless against Postgres). - `sidecar.*`: image, replicas, workers, autoscaling, probes. Stateless. - `sidecar.calcBackend`: calc backend selection; see `calc-sidecar/src/backends/registry.ts`. Use `stub` for chart smoke @@ -56,9 +57,10 @@ See `values.yaml` for the full schema and defaults. Key sections: - `ingress.*`, `networkPolicy.*`, `metrics.serviceMonitor.*`: gated, default off. -## Why replicas: 1 on the API? +## Database -The buildlibrary is SQLite-backed. SQLite is single-writer and lives in -a process-local file. Multiple API pods would either fight for the PVC -lock (RWO mode) or, if they shared one, corrupt the DB. Horizontal scale -unblocks once the buildlibrary migrates to Postgres. +The API is stateless and connects to Postgres via `DATABASE_URL`, read +from the `ro-builder-env` Secret. `postgresql.enabled` (default `true`) +deploys a bundled in-cluster Postgres StatefulSet. To use a managed +Postgres instead, set `postgresql.enabled: false` and point `DATABASE_URL` +at the external host in your sealed secret. diff --git a/deploy/helm/ro-builder/templates/_helpers.tpl b/deploy/helm/ro-builder/templates/_helpers.tpl index a9dd914..3d0d70d 100644 --- a/deploy/helm/ro-builder/templates/_helpers.tpl +++ b/deploy/helm/ro-builder/templates/_helpers.tpl @@ -54,3 +54,7 @@ across Deployment, Service, ServiceAccount, etc. {{- define "ro-builder.sidecarName" -}} {{- printf "%s-sidecar" (include "ro-builder.fullname" .) -}} {{- end -}} + +{{- define "ro-builder.postgresName" -}} +{{- printf "%s-postgres" (include "ro-builder.fullname" .) -}} +{{- end -}} diff --git a/deploy/helm/ro-builder/templates/api-deployment.yaml b/deploy/helm/ro-builder/templates/api-deployment.yaml index 37592ef..6c74720 100644 --- a/deploy/helm/ro-builder/templates/api-deployment.yaml +++ b/deploy/helm/ro-builder/templates/api-deployment.yaml @@ -5,11 +5,11 @@ metadata: labels: {{- include "ro-builder.labels" (dict "component" "api" "root" .) | nindent 4 }} spec: - replicas: 1 + {{- if not .Values.api.autoscaling.enabled }} + replicas: {{ .Values.api.replicas }} + {{- end }} strategy: - # Recreate; the PVC is RWO, so the new pod can't bind the volume - # until the old one releases it. RollingUpdate would deadlock. - type: Recreate + type: RollingUpdate selector: matchLabels: {{- include "ro-builder.selectorLabels" (dict "component" "api" "root" .) | nindent 6 }} @@ -47,9 +47,6 @@ spec: name: {{ include "ro-builder.fullname" . }}-env - secretRef: name: {{ .Values.secrets.externalSecretName }} - volumeMounts: - - name: buildlibrary - mountPath: /data livenessProbe: httpGet: path: /healthz @@ -74,7 +71,3 @@ spec: drop: - ALL readOnlyRootFilesystem: true - volumes: - - name: buildlibrary - persistentVolumeClaim: - claimName: {{ include "ro-builder.apiName" . }}-buildlibrary diff --git a/deploy/helm/ro-builder/templates/api-hpa.yaml b/deploy/helm/ro-builder/templates/api-hpa.yaml new file mode 100644 index 0000000..ff6ec84 --- /dev/null +++ b/deploy/helm/ro-builder/templates/api-hpa.yaml @@ -0,0 +1,22 @@ +{{- if .Values.api.autoscaling.enabled -}} +apiVersion: autoscaling/v2 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "ro-builder.apiName" . }} + labels: + {{- include "ro-builder.labels" (dict "component" "api" "root" .) | nindent 4 }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "ro-builder.apiName" . }} + minReplicas: {{ .Values.api.autoscaling.minReplicas }} + maxReplicas: {{ .Values.api.autoscaling.maxReplicas }} + metrics: + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: {{ .Values.api.autoscaling.targetCPUUtilizationPercentage }} +{{- end }} diff --git a/deploy/helm/ro-builder/templates/api-pdb.yaml b/deploy/helm/ro-builder/templates/api-pdb.yaml new file mode 100644 index 0000000..17e751a --- /dev/null +++ b/deploy/helm/ro-builder/templates/api-pdb.yaml @@ -0,0 +1,13 @@ +{{- if or (gt (int .Values.api.replicas) 1) .Values.api.autoscaling.enabled -}} +apiVersion: policy/v1 +kind: PodDisruptionBudget +metadata: + name: {{ include "ro-builder.apiName" . }} + labels: + {{- include "ro-builder.labels" (dict "component" "api" "root" .) | nindent 4 }} +spec: + minAvailable: 1 + selector: + matchLabels: + {{- include "ro-builder.selectorLabels" (dict "component" "api" "root" .) | nindent 6 }} +{{- end }} diff --git a/deploy/helm/ro-builder/templates/api-pvc.yaml b/deploy/helm/ro-builder/templates/api-pvc.yaml deleted file mode 100644 index b5a17ba..0000000 --- a/deploy/helm/ro-builder/templates/api-pvc.yaml +++ /dev/null @@ -1,17 +0,0 @@ -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: {{ include "ro-builder.apiName" . }}-buildlibrary - labels: - {{- include "ro-builder.labels" (dict "component" "api" "root" .) | nindent 4 }} -spec: - # SQLite is single-writer; RWO is the right mode and the only one - # that's safe given the api workload's replicas=1 + strategy=Recreate. - accessModes: - - ReadWriteOnce - resources: - requests: - storage: {{ .Values.api.persistence.size }} - {{- if .Values.api.persistence.storageClassName }} - storageClassName: {{ .Values.api.persistence.storageClassName | quote }} - {{- end }} diff --git a/deploy/helm/ro-builder/templates/configmap.yaml b/deploy/helm/ro-builder/templates/configmap.yaml index 90e066f..f923030 100644 --- a/deploy/helm/ro-builder/templates/configmap.yaml +++ b/deploy/helm/ro-builder/templates/configmap.yaml @@ -11,7 +11,6 @@ data: # putting it here would be dead weight since the api never reads it. ADDR: ":8080" SIDECAR_URL: "http://{{ include "ro-builder.sidecarName" . }}:7401" - BUILDLIBRARY_PATH: "/data/buildlibrary.db" # Pass-through env from values.yaml. Empty strings are intentional; # the binary's own default kicks in for any key set to "" here. diff --git a/deploy/helm/ro-builder/templates/postgres-service.yaml b/deploy/helm/ro-builder/templates/postgres-service.yaml new file mode 100644 index 0000000..3f25a3b --- /dev/null +++ b/deploy/helm/ro-builder/templates/postgres-service.yaml @@ -0,0 +1,16 @@ +{{- if .Values.postgresql.enabled -}} +apiVersion: v1 +kind: Service +metadata: + name: {{ include "ro-builder.postgresName" . }} + labels: + {{- include "ro-builder.labels" (dict "component" "postgres" "root" .) | nindent 4 }} +spec: + type: ClusterIP + ports: + - port: 5432 + targetPort: postgres + name: postgres + selector: + {{- include "ro-builder.selectorLabels" (dict "component" "postgres" "root" .) | nindent 4 }} +{{- end }} diff --git a/deploy/helm/ro-builder/templates/postgres-statefulset.yaml b/deploy/helm/ro-builder/templates/postgres-statefulset.yaml new file mode 100644 index 0000000..ad16cb1 --- /dev/null +++ b/deploy/helm/ro-builder/templates/postgres-statefulset.yaml @@ -0,0 +1,66 @@ +{{- if .Values.postgresql.enabled -}} +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: {{ include "ro-builder.postgresName" . }} + labels: + {{- include "ro-builder.labels" (dict "component" "postgres" "root" .) | nindent 4 }} +spec: + serviceName: {{ include "ro-builder.postgresName" . }} + replicas: 1 + selector: + matchLabels: + {{- include "ro-builder.selectorLabels" (dict "component" "postgres" "root" .) | nindent 6 }} + template: + metadata: + labels: + {{- include "ro-builder.selectorLabels" (dict "component" "postgres" "root" .) | nindent 8 }} + spec: + securityContext: + fsGroup: 999 + runAsUser: 999 + runAsNonRoot: true + containers: + - name: postgres + image: {{ .Values.postgresql.image | quote }} + ports: + - name: postgres + containerPort: 5432 + env: + - name: POSTGRES_USER + value: {{ .Values.postgresql.auth.username | quote }} + - name: POSTGRES_DB + value: {{ .Values.postgresql.auth.database | quote }} + - name: POSTGRES_PASSWORD + valueFrom: + secretKeyRef: + name: {{ .Values.secrets.externalSecretName }} + key: POSTGRES_PASSWORD + - name: PGDATA + value: /var/lib/postgresql/data/pgdata + volumeMounts: + - name: data + mountPath: /var/lib/postgresql/data + readinessProbe: + exec: + command: ["pg_isready", "-U", {{ .Values.postgresql.auth.username | quote }}, "-d", {{ .Values.postgresql.auth.database | quote }}] + initialDelaySeconds: 5 + periodSeconds: 5 + livenessProbe: + exec: + command: ["pg_isready", "-U", {{ .Values.postgresql.auth.username | quote }}, "-d", {{ .Values.postgresql.auth.database | quote }}] + initialDelaySeconds: 15 + periodSeconds: 10 + failureThreshold: 5 + volumeClaimTemplates: + - metadata: + name: data + spec: + accessModes: ["ReadWriteOnce"] + {{- if .Values.postgresql.storage.storageClassName }} + storageClassName: {{ .Values.postgresql.storage.storageClassName | quote }} + {{- end }} + resources: + requests: + storage: {{ .Values.postgresql.storage.size | quote }} +{{- end }} diff --git a/deploy/helm/ro-builder/values.local.yaml b/deploy/helm/ro-builder/values.local.yaml index 59b3560..d664ac3 100644 --- a/deploy/helm/ro-builder/values.local.yaml +++ b/deploy/helm/ro-builder/values.local.yaml @@ -1,7 +1,5 @@ # Overrides for docker-desktop's k8s. Committed; not sensitive. api: - persistence: - storageClassName: hostpath resources: requests: cpu: 50m diff --git a/deploy/helm/ro-builder/values.prod.yaml.example b/deploy/helm/ro-builder/values.prod.yaml.example index cb239a5..62d94aa 100644 --- a/deploy/helm/ro-builder/values.prod.yaml.example +++ b/deploy/helm/ro-builder/values.prod.yaml.example @@ -16,9 +16,12 @@ api: resources: requests: { cpu: 250m, memory: 256Mi } limits: { cpu: "2", memory: 1Gi } - persistence: - size: 10Gi - storageClassName: gp3 # adjust per cluster + replicas: 2 + autoscaling: + enabled: true + # minReplicas: 2 + # maxReplicas: 8 + # targetCPUUtilizationPercentage: 70 sidecar: image: diff --git a/deploy/helm/ro-builder/values.yaml b/deploy/helm/ro-builder/values.yaml index 83eb300..7bd9966 100644 --- a/deploy/helm/ro-builder/values.yaml +++ b/deploy/helm/ro-builder/values.yaml @@ -21,10 +21,12 @@ api: limits: cpu: "1" memory: 512Mi - persistence: - size: 1Gi - # Empty = cluster default. docker-desktop uses "hostpath". - storageClassName: "" + replicas: 1 + autoscaling: + enabled: false + minReplicas: 1 + maxReplicas: 4 + targetCPUUtilizationPercentage: 70 probes: liveness: initialDelaySeconds: 5 @@ -91,6 +93,23 @@ env: GENERATION_POLL_INTERVAL: "" GENERATION_SHUTDOWN_TIMEOUT: "" GENERATION_MAX_ITERS: "" + GENERATION_LEASE_TTL: "" + GENERATION_LEASE_SWEEP_INTERVAL: "" + GENERATION_MAX_ATTEMPTS: "" + +postgresql: + # When true, the chart runs an in-cluster Postgres StatefulSet. Set false + # to use managed/external Postgres; then supply DATABASE_URL via the + # ro-builder-env Secret and the chart runs no Postgres. + enabled: true + image: pgvector/pgvector:pg17 + storage: + size: 5Gi + storageClassName: "" + auth: + username: robuilder + database: robuilder + # Password comes from the ro-builder-env Secret key POSTGRES_PASSWORD. secrets: # The chart only references the Secret by name. The actual Secret is diff --git a/deploy/k8s/sealed-secrets/README.md b/deploy/k8s/sealed-secrets/README.md index b75a19c..5881903 100644 --- a/deploy/k8s/sealed-secrets/README.md +++ b/deploy/k8s/sealed-secrets/README.md @@ -8,7 +8,8 @@ Encrypted secrets for ro-builder. Decrypted in-cluster by the - `local.sealed-secret.yaml.example`: committed placeholder for the local (docker-desktop) cluster's sealed secret. - `local.sealed-secret.yaml`: gitignored. Produced by `task tilt:seal`, - contains the real encrypted `LLM_API_KEY` from your `.env`. + contains the real encrypted `LLM_API_KEY`, `POSTGRES_PASSWORD`, and + `DATABASE_URL` from your `.env`. - `prod.sealed-secret.yaml.example`: committed template for a prod cluster. Sealing for prod is operator-only and happens out of band. @@ -18,9 +19,9 @@ Encrypted secrets for ro-builder. Decrypted in-cluster by the `kube-system`. The controller generates a cluster-bound RSA key pair on first start. 2. `task tilt:seal` reads your local `.env`, builds an in-memory Secret - manifest with `LLM_API_KEY`, pipes it through `kubeseal` (which - fetches the controller's public key), and writes the encrypted - `SealedSecret` to `local.sealed-secret.yaml`. + manifest with `LLM_API_KEY`, `POSTGRES_PASSWORD`, and `DATABASE_URL`, + pipes it through `kubeseal` (which fetches the controller's public key), + and writes the encrypted `SealedSecret` to `local.sealed-secret.yaml`. 3. Tilt applies `local.sealed-secret.yaml` alongside the Helm chart. The controller decrypts it into a normal `Secret` named `ro-builder-env` that the api Deployment mounts via `envFrom`. diff --git a/deploy/k8s/sealed-secrets/local.sealed-secret.yaml.example b/deploy/k8s/sealed-secrets/local.sealed-secret.yaml.example index ef77eff..bf9d1b7 100644 --- a/deploy/k8s/sealed-secrets/local.sealed-secret.yaml.example +++ b/deploy/k8s/sealed-secrets/local.sealed-secret.yaml.example @@ -12,6 +12,8 @@ metadata: spec: encryptedData: LLM_API_KEY: AgBPLACEHOLDER== + POSTGRES_PASSWORD: AgBPLACEHOLDER== + DATABASE_URL: AgBPLACEHOLDER== template: metadata: name: ro-builder-env diff --git a/deploy/k8s/sealed-secrets/prod.sealed-secret.yaml.example b/deploy/k8s/sealed-secrets/prod.sealed-secret.yaml.example index 376d92e..fc32317 100644 --- a/deploy/k8s/sealed-secrets/prod.sealed-secret.yaml.example +++ b/deploy/k8s/sealed-secrets/prod.sealed-secret.yaml.example @@ -9,6 +9,8 @@ metadata: spec: encryptedData: LLM_API_KEY: AgBPLACEHOLDER== + POSTGRES_PASSWORD: AgBPLACEHOLDER== + DATABASE_URL: AgBPLACEHOLDER== template: metadata: name: ro-builder-env diff --git a/docker-compose.yml b/docker-compose.yml index 63d63b7..958c783 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,9 +8,28 @@ # task docker:down # stop + remove # # .env at the repo root supplies LLM_API_KEY (and any other LLM_* -# overrides). docker-compose picks it up automatically. +# overrides) as well as POSTGRES_USER / POSTGRES_PASSWORD / POSTGRES_DB +# (optional; defaults are robuilder/robuilder/robuilder). +# docker-compose picks it up automatically. services: + postgres: + image: pgvector/pgvector:pg17 + container_name: ro-builder-postgres + restart: unless-stopped + environment: + POSTGRES_USER: ${POSTGRES_USER:-robuilder} + POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-robuilder} + POSTGRES_DB: ${POSTGRES_DB:-robuilder} + healthcheck: + test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-robuilder} -d ${POSTGRES_DB:-robuilder}"] + interval: 5s + timeout: 5s + retries: 12 + start_period: 5s + volumes: + - pgdata:/var/lib/postgresql/data + sidecar: build: context: . @@ -52,6 +71,8 @@ services: depends_on: sidecar: condition: service_healthy + postgres: + condition: service_healthy ports: - "${API_HOST_PORT:-8080}:8080" # SIDECAR_URL is set in the Dockerfile to the compose service name. @@ -60,6 +81,7 @@ services: # Keep this list in sync with .env.example as new LLM_* / GENERATION_* # knobs are added. environment: + DATABASE_URL: postgres://${POSTGRES_USER:-robuilder}:${POSTGRES_PASSWORD:-robuilder}@postgres:5432/${POSTGRES_DB:-robuilder}?sslmode=disable LLM_API_KEY: ${LLM_API_KEY:-} LLM_PROVIDER: ${LLM_PROVIDER:-anthropic} LLM_MODEL: ${LLM_MODEL:-} @@ -71,11 +93,12 @@ services: GENERATION_POLL_INTERVAL: ${GENERATION_POLL_INTERVAL:-} GENERATION_SHUTDOWN_TIMEOUT: ${GENERATION_SHUTDOWN_TIMEOUT:-} GENERATION_MAX_ITERS: ${GENERATION_MAX_ITERS:-} + GENERATION_LEASE_TTL: ${GENERATION_LEASE_TTL:-} + GENERATION_LEASE_SWEEP_INTERVAL: ${GENERATION_LEASE_SWEEP_INTERVAL:-} + GENERATION_MAX_ATTEMPTS: ${GENERATION_MAX_ATTEMPTS:-} LOG_LEVEL: ${LOG_LEVEL:-} LOG_FORMAT: ${LOG_FORMAT:-} - volumes: - - buildlibrary:/data volumes: - buildlibrary: - name: ro-builder-buildlibrary + pgdata: + name: ro-builder-pgdata diff --git a/docker/api.Dockerfile b/docker/api.Dockerfile index 14130f4..5ca485b 100644 --- a/docker/api.Dockerfile +++ b/docker/api.Dockerfile @@ -1,7 +1,7 @@ # Multi-stage build for the ro-builder API binary. The catalog and server # profile YAMLs are embedded into the binary via //go:embed, so the -# runtime image needs only the binary itself plus a writable directory -# for the SQLite buildlibrary.db. +# runtime image needs only the binary itself and connects to PostgreSQL +# over the network (no local writable state). # --- builder --- FROM golang:1.26-alpine AS builder @@ -29,8 +29,7 @@ FROM alpine:3.20 # ca-certificates lets the binary make HTTPS calls (Anthropic API); # tzdata covers any time-zone formatting in logs. RUN apk add --no-cache ca-certificates tzdata && \ - addgroup -S -g 1000 app && adduser -S -u 1000 -G app app && \ - mkdir -p /data && chown -R app:app /data + addgroup -S -g 1000 app && adduser -S -u 1000 -G app app USER app WORKDIR /home/app @@ -40,13 +39,8 @@ COPY --from=builder /out/api /usr/local/bin/api # Defaults match docker-compose.yml. ADDR and SIDECAR_URL can be # overridden per-deploy without rebuilding. ENV ADDR=":8080" \ - SIDECAR_URL="http://sidecar:7401" \ - BUILDLIBRARY_PATH="/data/buildlibrary.db" + SIDECAR_URL="http://sidecar:7401" EXPOSE 8080 -# /data holds the SQLite library; persist via a named volume so -# generated trajectories survive container restarts. -VOLUME ["/data"] - ENTRYPOINT ["/usr/local/bin/api"] diff --git a/docs/architecture/ro-builder.excalidraw b/docs/architecture/ro-builder.excalidraw new file mode 100644 index 0000000..5f9ef6d --- /dev/null +++ b/docs/architecture/ro-builder.excalidraw @@ -0,0 +1,9022 @@ +{ + "type": "excalidraw", + "version": 2, + "source": "http://localhost:5000", + "elements": [ + { + "id": "frame_1", + "type": "frame", + "x": 0, + "y": 0, + "width": 1710, + "height": 1340, + "angle": 0, + "strokeColor": "#bbbbbb", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "roundness": null, + "seed": 920370032, + "version": 14, + "versionNonce": 141142649, + "isDeleted": false, + "boundElements": [], + "updated": 1780290110231, + "link": null, + "locked": false, + "name": "1 · Use-case flows", + "index": "a0" + }, + { + "id": "rectangle_2", + "type": "rectangle", + "x": 60, + "y": 44, + "width": 230, + "height": 1272, + "angle": 0, + "strokeColor": "transparent", + "backgroundColor": "#f1f3f5", + "fillStyle": "solid", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 0, + "opacity": 13, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 2252023330, + "version": 2, + "versionNonce": 1928387513, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "index": "a1" + }, + { + "id": "rectangle_3", + "type": "rectangle", + "x": 290, + "y": 44, + "width": 230, + "height": 1272, + "angle": 0, + "strokeColor": "transparent", + "backgroundColor": "#a5d8ff", + "fillStyle": "solid", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 0, + "opacity": 13, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 2340457892, + "version": 2, + "versionNonce": 367433815, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "index": "a2" + }, + { + "id": "rectangle_4", + "type": "rectangle", + "x": 520, + "y": 44, + "width": 230, + "height": 1272, + "angle": 0, + "strokeColor": "transparent", + "backgroundColor": "#d0bfff", + "fillStyle": "solid", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 0, + "opacity": 13, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 1240767094, + "version": 2, + "versionNonce": 330235033, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "index": "a3" + }, + { + "id": "rectangle_5", + "type": "rectangle", + "x": 750, + "y": 44, + "width": 230, + "height": 1272, + "angle": 0, + "strokeColor": "transparent", + "backgroundColor": "#b2f2bb", + "fillStyle": "solid", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 0, + "opacity": 13, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 1696368920, + "version": 2, + "versionNonce": 4158839, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "index": "a4" + }, + { + "id": "rectangle_6", + "type": "rectangle", + "x": 980, + "y": 44, + "width": 230, + "height": 1272, + "angle": 0, + "strokeColor": "transparent", + "backgroundColor": "#ffd8a8", + "fillStyle": "solid", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 0, + "opacity": 13, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 1839942154, + "version": 2, + "versionNonce": 1035338105, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "index": "a5" + }, + { + "id": "rectangle_7", + "type": "rectangle", + "x": 1210, + "y": 44, + "width": 230, + "height": 1272, + "angle": 0, + "strokeColor": "transparent", + "backgroundColor": "#ffec99", + "fillStyle": "solid", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 0, + "opacity": 13, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 1412407756, + "version": 2, + "versionNonce": 566210199, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "index": "a6" + }, + { + "id": "rectangle_8", + "type": "rectangle", + "x": 1440, + "y": 44, + "width": 230, + "height": 1272, + "angle": 0, + "strokeColor": "transparent", + "backgroundColor": "#fcc2d7", + "fillStyle": "solid", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 0, + "opacity": 13, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 2978433246, + "version": 2, + "versionNonce": 508127833, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "index": "a7" + }, + { + "id": "rectangle_9", + "type": "rectangle", + "x": 72, + "y": 44, + "width": 206, + "height": 46, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "#f1f3f5", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": { + "type": 3 + }, + "seed": 4200532928, + "version": 2, + "versionNonce": 1427882935, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_a" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "index": "a8" + }, + { + "id": "text_a", + "type": "text", + "x": 77, + "y": 55.125, + "width": 196, + "height": 23.75, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 2319969010, + "version": 2, + "versionNonce": 1849472825, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 19, + "fontFamily": 2, + "text": "User", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "rectangle_9", + "originalText": "User", + "lineHeight": 1.25, + "autoResize": false, + "index": "a9" + }, + { + "id": "rectangle_b", + "type": "rectangle", + "x": 302, + "y": 44, + "width": 206, + "height": 46, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "#a5d8ff", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": { + "type": 3 + }, + "seed": 2351512308, + "version": 2, + "versionNonce": 712520919, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_c" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "index": "aA" + }, + { + "id": "text_c", + "type": "text", + "x": 307, + "y": 55.125, + "width": 196, + "height": 23.75, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 1897382982, + "version": 2, + "versionNonce": 2146658329, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 19, + "fontFamily": 2, + "text": "Go API", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "rectangle_b", + "originalText": "Go API", + "lineHeight": 1.25, + "autoResize": false, + "index": "aB" + }, + { + "id": "rectangle_d", + "type": "rectangle", + "x": 532, + "y": 44, + "width": 206, + "height": 46, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "#d0bfff", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": { + "type": 3 + }, + "seed": 3017401192, + "version": 2, + "versionNonce": 963215863, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_e" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "index": "aC" + }, + { + "id": "text_e", + "type": "text", + "x": 537, + "y": 55.125, + "width": 196, + "height": 23.75, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 1721805018, + "version": 2, + "versionNonce": 224460025, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 19, + "fontFamily": 2, + "text": "DB", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "rectangle_d", + "originalText": "DB", + "lineHeight": 1.25, + "autoResize": false, + "index": "aD" + }, + { + "id": "rectangle_f", + "type": "rectangle", + "x": 762, + "y": 44, + "width": 206, + "height": 46, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "#b2f2bb", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": { + "type": 3 + }, + "seed": 1237186844, + "version": 2, + "versionNonce": 854862615, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_g" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "index": "aE" + }, + { + "id": "text_g", + "type": "text", + "x": 767, + "y": 55.125, + "width": 196, + "height": 23.75, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 1029680302, + "version": 2, + "versionNonce": 1174992345, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 19, + "fontFamily": 2, + "text": "Catalog", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "rectangle_f", + "originalText": "Catalog", + "lineHeight": 1.25, + "autoResize": false, + "index": "aF" + }, + { + "id": "rectangle_h", + "type": "rectangle", + "x": 992, + "y": 44, + "width": 206, + "height": 46, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "#ffd8a8", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": { + "type": 3 + }, + "seed": 2509746192, + "version": 2, + "versionNonce": 864858167, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_i" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "index": "aG" + }, + { + "id": "text_i", + "type": "text", + "x": 997, + "y": 55.125, + "width": 196, + "height": 23.75, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 2134451138, + "version": 2, + "versionNonce": 486462137, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 19, + "fontFamily": 2, + "text": "Sidecar", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "rectangle_h", + "originalText": "Sidecar", + "lineHeight": 1.25, + "autoResize": false, + "index": "aH" + }, + { + "id": "rectangle_j", + "type": "rectangle", + "x": 1222, + "y": 44, + "width": 206, + "height": 46, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "#ffec99", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": { + "type": 3 + }, + "seed": 223509572, + "version": 2, + "versionNonce": 1427607895, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_k" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "index": "aI" + }, + { + "id": "text_k", + "type": "text", + "x": 1227, + "y": 55.125, + "width": 196, + "height": 23.75, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 38576662, + "version": 2, + "versionNonce": 1457918873, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 19, + "fontFamily": 2, + "text": "calc", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "rectangle_j", + "originalText": "calc", + "lineHeight": 1.25, + "autoResize": false, + "index": "aJ" + }, + { + "id": "rectangle_l", + "type": "rectangle", + "x": 1452, + "y": 44, + "width": 206, + "height": 46, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "#fcc2d7", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": { + "type": 3 + }, + "seed": 3304526264, + "version": 2, + "versionNonce": 15289975, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_m" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "index": "aK" + }, + { + "id": "text_m", + "type": "text", + "x": 1457, + "y": 55.125, + "width": 196, + "height": 23.75, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 2164849578, + "version": 2, + "versionNonce": 1475491961, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 19, + "fontFamily": 2, + "text": "LLM", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "rectangle_l", + "originalText": "LLM", + "lineHeight": 1.25, + "autoResize": false, + "index": "aL" + }, + { + "id": "text_n", + "type": "text", + "x": 60, + "y": 84, + "width": 600, + "height": 20, + "angle": 0, + "strokeColor": "#1971c2", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 64971884, + "version": 3, + "versionNonce": 705579703, + "isDeleted": true, + "boundElements": [], + "updated": 1780290126847, + "link": null, + "locked": false, + "fontSize": 16, + "fontFamily": 2, + "text": "Band A — POST /generate (full LLM pipeline)", + "textAlign": "left", + "verticalAlign": "top", + "containerId": null, + "originalText": "Band A — POST /generate (full LLM pipeline)", + "lineHeight": 1.25, + "autoResize": true, + "index": "aM" + }, + { + "id": "rectangle_o", + "type": "rectangle", + "x": 541, + "y": 120, + "width": 188, + "height": 752, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "#d0bfff", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": { + "type": 3 + }, + "seed": 3380626558, + "version": 2, + "versionNonce": 837206361, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_p" + }, + { + "type": "arrow", + "id": "arrow_1o" + }, + { + "type": "arrow", + "id": "arrow_1t" + }, + { + "type": "arrow", + "id": "arrow_22" + }, + { + "type": "arrow", + "id": "arrow_2g" + }, + { + "type": "arrow", + "id": "arrow_2k" + }, + { + "type": "arrow", + "id": "arrow_2o" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "index": "aN" + }, + { + "id": "text_p", + "type": "text", + "x": 546, + "y": 469.75, + "width": 178, + "height": 52.5, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 3005917280, + "version": 2, + "versionNonce": 1440963767, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 14, + "fontFamily": 2, + "text": "Build library\n(generations +\nsaved_trajectories)", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "rectangle_o", + "originalText": "Build library\n(generations +\nsaved_trajectories)", + "lineHeight": 1.25, + "autoResize": false, + "index": "aO" + }, + { + "id": "rectangle_q", + "type": "rectangle", + "x": 771, + "y": 120, + "width": 188, + "height": 752, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "#b2f2bb", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": { + "type": 3 + }, + "seed": 1476120722, + "version": 2, + "versionNonce": 1914121785, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_r" + }, + { + "type": "arrow", + "id": "arrow_20" + }, + { + "type": "arrow", + "id": "arrow_2q" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "index": "aP" + }, + { + "id": "text_r", + "type": "text", + "x": 776, + "y": 469.75, + "width": 178, + "height": 52.5, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 2574340500, + "version": 2, + "versionNonce": 1088728535, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 14, + "fontFamily": 2, + "text": "Catalog\n(item / skill / mob,\nembedded)", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "rectangle_q", + "originalText": "Catalog\n(item / skill / mob,\nembedded)", + "lineHeight": 1.25, + "autoResize": false, + "index": "aQ" + }, + { + "id": "rectangle_s", + "type": "rectangle", + "x": 81, + "y": 120, + "width": 188, + "height": 48, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "#f1f3f5", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": { + "type": 3 + }, + "seed": 1892692966, + "version": 2, + "versionNonce": 795279129, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_t" + }, + { + "type": "arrow", + "id": "arrow_1m" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "index": "aR" + }, + { + "id": "text_t", + "type": "text", + "x": 86, + "y": 135.25, + "width": 178, + "height": 17.5, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 2545488904, + "version": 2, + "versionNonce": 501144311, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 14, + "fontFamily": 2, + "text": "① POST /generate", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "rectangle_s", + "originalText": "① POST /generate", + "lineHeight": 1.25, + "autoResize": false, + "index": "aS" + }, + { + "id": "rectangle_u", + "type": "rectangle", + "x": 311, + "y": 120, + "width": 188, + "height": 60, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "#a5d8ff", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": { + "type": 3 + }, + "seed": 225526394, + "version": 2, + "versionNonce": 1481225209, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_v" + }, + { + "type": "arrow", + "id": "arrow_1m" + }, + { + "type": "arrow", + "id": "arrow_1o" + }, + { + "type": "arrow", + "id": "arrow_1q" + }, + { + "type": "arrow", + "id": "arrow_1s" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "index": "aT" + }, + { + "id": "text_v", + "type": "text", + "x": 316, + "y": 132.5, + "width": 178, + "height": 35, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 1537795004, + "version": 2, + "versionNonce": 1901487127, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 14, + "fontFamily": 2, + "text": "Handler:\nvalidate request", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "rectangle_u", + "originalText": "Handler:\nvalidate request", + "lineHeight": 1.25, + "autoResize": false, + "index": "aU" + }, + { + "id": "rectangle_w", + "type": "rectangle", + "x": 81, + "y": 204, + "width": 188, + "height": 48, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "#f1f3f5", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": { + "type": 3 + }, + "seed": 818286670, + "version": 2, + "versionNonce": 1086508249, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_x" + }, + { + "type": "arrow", + "id": "arrow_1q" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "index": "aV" + }, + { + "id": "text_x", + "type": "text", + "x": 86, + "y": 219.25, + "width": 178, + "height": 17.5, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 989656240, + "version": 2, + "versionNonce": 994036023, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 14, + "fontFamily": 2, + "text": "202 { id }", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "rectangle_w", + "originalText": "202 { id }", + "lineHeight": 1.25, + "autoResize": false, + "index": "aW" + }, + { + "id": "rectangle_y", + "type": "rectangle", + "x": 311, + "y": 204, + "width": 188, + "height": 60, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "#a5d8ff", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": { + "type": 3 + }, + "seed": 1992094050, + "version": 2, + "versionNonce": 1885718969, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_z" + }, + { + "type": "arrow", + "id": "arrow_1s" + }, + { + "type": "arrow", + "id": "arrow_1t" + }, + { + "type": "arrow", + "id": "arrow_1v" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "index": "aX" + }, + { + "id": "text_z", + "type": "text", + "x": 316, + "y": 216.5, + "width": 178, + "height": 35, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 742046436, + "version": 2, + "versionNonce": 150964823, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 14, + "fontFamily": 2, + "text": "Worker pool:\nclaim job", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "rectangle_y", + "originalText": "Worker pool:\nclaim job", + "lineHeight": 1.25, + "autoResize": false, + "index": "aY" + }, + { + "id": "rectangle_10", + "type": "rectangle", + "x": 311, + "y": 288, + "width": 188, + "height": 60, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "#a5d8ff", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": { + "type": 3 + }, + "seed": 4078926262, + "version": 2, + "versionNonce": 810953369, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_11" + }, + { + "type": "arrow", + "id": "arrow_1v" + }, + { + "type": "arrow", + "id": "arrow_1w" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "index": "aZ" + }, + { + "id": "text_11", + "type": "text", + "x": 316, + "y": 300.5, + "width": 178, + "height": 35, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 279243352, + "version": 2, + "versionNonce": 1198139255, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 14, + "fontFamily": 2, + "text": "Orchestrator:\nassemble prompt", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "rectangle_10", + "originalText": "Orchestrator:\nassemble prompt", + "lineHeight": 1.25, + "autoResize": false, + "index": "aa" + }, + { + "id": "rectangle_12", + "type": "rectangle", + "x": 1461, + "y": 288, + "width": 188, + "height": 79, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "#fcc2d7", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": { + "type": 3 + }, + "seed": 3014032714, + "version": 2, + "versionNonce": 1497853817, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_13" + }, + { + "type": "arrow", + "id": "arrow_1w" + }, + { + "type": "arrow", + "id": "arrow_1y" + }, + { + "type": "arrow", + "id": "arrow_2c" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "index": "ab" + }, + { + "id": "text_13", + "type": "text", + "x": 1466, + "y": 301.25, + "width": 178, + "height": 52.5, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 3278862092, + "version": 2, + "versionNonce": 1422139543, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 14, + "fontFamily": 2, + "text": "Complete(\nhistory, tools)\n→ proposes", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "rectangle_12", + "originalText": "Complete(\nhistory, tools)\n→ proposes", + "lineHeight": 1.25, + "autoResize": false, + "index": "ac" + }, + { + "id": "rectangle_14", + "type": "rectangle", + "x": 311, + "y": 372, + "width": 188, + "height": 48, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "#a5d8ff", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": { + "type": 3 + }, + "seed": 2035159070, + "version": 2, + "versionNonce": 1635588185, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_15" + }, + { + "type": "arrow", + "id": "arrow_1y" + }, + { + "type": "arrow", + "id": "arrow_20" + }, + { + "type": "arrow", + "id": "arrow_22" + }, + { + "type": "arrow", + "id": "arrow_24" + }, + { + "type": "arrow", + "id": "arrow_28" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "index": "ad" + }, + { + "id": "text_15", + "type": "text", + "x": 316, + "y": 387.25, + "width": 178, + "height": 17.5, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 2721289472, + "version": 2, + "versionNonce": 1388443063, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 14, + "fontFamily": 2, + "text": "Tool dispatch", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "rectangle_14", + "originalText": "Tool dispatch", + "lineHeight": 1.25, + "autoResize": false, + "index": "ae" + }, + { + "id": "rectangle_16", + "type": "rectangle", + "x": 1001, + "y": 456, + "width": 188, + "height": 60, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "#ffd8a8", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": { + "type": 3 + }, + "seed": 2095679026, + "version": 2, + "versionNonce": 717923641, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_17" + }, + { + "type": "arrow", + "id": "arrow_24" + }, + { + "type": "arrow", + "id": "arrow_26" + }, + { + "type": "arrow", + "id": "arrow_2a" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "index": "af" + }, + { + "id": "text_17", + "type": "text", + "x": 1006, + "y": 468.5, + "width": 178, + "height": 35, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 2191767604, + "version": 2, + "versionNonce": 948446935, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 14, + "fontFamily": 2, + "text": "POST /score\nShimPool → worker", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "rectangle_16", + "originalText": "POST /score\nShimPool → worker", + "lineHeight": 1.25, + "autoResize": false, + "index": "ag" + }, + { + "id": "rectangle_18", + "type": "rectangle", + "x": 1231, + "y": 456, + "width": 188, + "height": 79, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "#ffec99", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": { + "type": 3 + }, + "seed": 1391948678, + "version": 2, + "versionNonce": 278107673, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_19" + }, + { + "type": "arrow", + "id": "arrow_26" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "index": "ah" + }, + { + "id": "text_19", + "type": "text", + "x": 1236, + "y": 469.25, + "width": 178, + "height": 52.5, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 1233097896, + "version": 2, + "versionNonce": 615199735, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 14, + "fontFamily": 2, + "text": "rocalc: translate IDs,\nJSDOM eval,\nread derived+combat", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "rectangle_18", + "originalText": "rocalc: translate IDs,\nJSDOM eval,\nread derived+combat", + "lineHeight": 1.25, + "autoResize": false, + "index": "ai" + }, + { + "id": "rectangle_1a", + "type": "rectangle", + "x": 311, + "y": 548, + "width": 188, + "height": 60, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "#a5d8ff", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": { + "type": 3 + }, + "seed": 1119202330, + "version": 2, + "versionNonce": 902523641, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_1b" + }, + { + "type": "arrow", + "id": "arrow_28" + }, + { + "type": "arrow", + "id": "arrow_2a" + }, + { + "type": "arrow", + "id": "arrow_2c" + }, + { + "type": "arrow", + "id": "arrow_2e" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "index": "aj" + }, + { + "id": "text_1b", + "type": "text", + "x": 316, + "y": 560.5, + "width": 178, + "height": 35, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 2529697372, + "version": 2, + "versionNonce": 1865391383, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 14, + "fontFamily": 2, + "text": "submit_trajectory:\ncanonical score + gates", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "rectangle_1a", + "originalText": "submit_trajectory:\ncanonical score + gates", + "lineHeight": 1.25, + "autoResize": false, + "index": "ak" + }, + { + "id": "rectangle_1c", + "type": "rectangle", + "x": 311, + "y": 632, + "width": 188, + "height": 48, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "#a5d8ff", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": { + "type": 3 + }, + "seed": 2759148526, + "version": 2, + "versionNonce": 318088153, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_1d" + }, + { + "type": "arrow", + "id": "arrow_2e" + }, + { + "type": "arrow", + "id": "arrow_2g" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "index": "al" + }, + { + "id": "text_1d", + "type": "text", + "x": 316, + "y": 647.25, + "width": 178, + "height": 17.5, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 993233232, + "version": 2, + "versionNonce": 2072633911, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 14, + "fontFamily": 2, + "text": "Save result", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "rectangle_1c", + "originalText": "Save result", + "lineHeight": 1.25, + "autoResize": false, + "index": "am" + }, + { + "id": "rectangle_1e", + "type": "rectangle", + "x": 311, + "y": 728, + "width": 188, + "height": 48, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "#a5d8ff", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": { + "type": 3 + }, + "seed": 456036098, + "version": 2, + "versionNonce": 1143324857, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_1f" + }, + { + "type": "arrow", + "id": "arrow_2i" + }, + { + "type": "arrow", + "id": "arrow_2k" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "index": "an" + }, + { + "id": "text_1f", + "type": "text", + "x": 316, + "y": 743.25, + "width": 178, + "height": 17.5, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 1793149316, + "version": 2, + "versionNonce": 1251902295, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 14, + "fontFamily": 2, + "text": "read status", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "rectangle_1e", + "originalText": "read status", + "lineHeight": 1.25, + "autoResize": false, + "index": "ao" + }, + { + "id": "rectangle_1g", + "type": "rectangle", + "x": 81, + "y": 728, + "width": 188, + "height": 60, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "#f1f3f5", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": { + "type": 3 + }, + "seed": 3176472918, + "version": 2, + "versionNonce": 385827225, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_1h" + }, + { + "type": "arrow", + "id": "arrow_2i" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "index": "ap" + }, + { + "id": "text_1h", + "type": "text", + "x": 86, + "y": 740.5, + "width": 178, + "height": 35, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 3779990264, + "version": 2, + "versionNonce": 1287782519, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 14, + "fontFamily": 2, + "text": "poll\nGET /generations/{id}", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "rectangle_1g", + "originalText": "poll\nGET /generations/{id}", + "lineHeight": 1.25, + "autoResize": false, + "index": "aq" + }, + { + "id": "rectangle_1i", + "type": "rectangle", + "x": 311, + "y": 812, + "width": 188, + "height": 48, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "#a5d8ff", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": { + "type": 3 + }, + "seed": 2162937578, + "version": 2, + "versionNonce": 1488299641, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_1j" + }, + { + "type": "arrow", + "id": "arrow_2m" + }, + { + "type": "arrow", + "id": "arrow_2o" + }, + { + "type": "arrow", + "id": "arrow_2q" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "index": "ar" + }, + { + "id": "text_1j", + "type": "text", + "x": 316, + "y": 827.25, + "width": 178, + "height": 17.5, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 1787287980, + "version": 2, + "versionNonce": 1941494167, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 14, + "fontFamily": 2, + "text": "read + enrich build", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "rectangle_1i", + "originalText": "read + enrich build", + "lineHeight": 1.25, + "autoResize": false, + "index": "as" + }, + { + "id": "rectangle_1k", + "type": "rectangle", + "x": 81, + "y": 812, + "width": 188, + "height": 48, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "#f1f3f5", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": { + "type": 3 + }, + "seed": 2128128958, + "version": 2, + "versionNonce": 1678536537, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_1l" + }, + { + "type": "arrow", + "id": "arrow_2m" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "index": "at" + }, + { + "id": "text_1l", + "type": "text", + "x": 86, + "y": 827.25, + "width": 178, + "height": 17.5, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 2241974688, + "version": 2, + "versionNonce": 79138487, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 14, + "fontFamily": 2, + "text": "GET /builds/{id}", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "rectangle_1k", + "originalText": "GET /builds/{id}", + "lineHeight": 1.25, + "autoResize": false, + "index": "au" + }, + { + "id": "arrow_1m", + "type": "arrow", + "x": 269, + "y": 144, + "width": 42, + "height": 0, + "angle": 0, + "strokeColor": "#343a40", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 3782806482, + "version": 2, + "versionNonce": 1867979833, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_1n" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + 42, + 0 + ] + ], + "lastCommittedPoint": null, + "startBinding": { + "mode": "orbit", + "elementId": "rectangle_s", + "fixedPoint": [ + 0.5737218280042354, + 0.4262781719957651 + ] + }, + "endBinding": { + "mode": "orbit", + "elementId": "rectangle_u", + "fixedPoint": [ + 0.39995576348287265, + 0.3999557634828728 + ] + }, + "startArrowhead": null, + "endArrowhead": "arrow", + "elbowed": false, + "index": "av" + }, + { + "id": "text_1n", + "type": "text", + "x": 248, + "y": 136, + "width": 84, + "height": 16, + "angle": 0, + "strokeColor": "#495057", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 342388436, + "version": 2, + "versionNonce": 711106519, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 11, + "fontFamily": 2, + "text": "POST /generate", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "arrow_1m", + "originalText": "POST /generate", + "lineHeight": 1.25, + "autoResize": false, + "index": "aw" + }, + { + "id": "arrow_1o", + "type": "arrow", + "x": 499, + "y": 150, + "width": 42, + "height": 0, + "angle": 0, + "strokeColor": "#343a40", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 2457174822, + "version": 2, + "versionNonce": 444149017, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_1p" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + 42, + 0 + ] + ], + "lastCommittedPoint": null, + "startBinding": { + "mode": "orbit", + "elementId": "rectangle_u", + "fixedPoint": [ + 1, + 0.5001 + ] + }, + "endBinding": { + "mode": "orbit", + "elementId": "rectangle_o", + "fixedPoint": [ + 0.03989317696216899, + 0.039893176962169596 + ] + }, + "startArrowhead": null, + "endArrowhead": "arrow", + "elbowed": false, + "index": "ax" + }, + { + "id": "text_1p", + "type": "text", + "x": 475, + "y": 142, + "width": 90, + "height": 16, + "angle": 0, + "strokeColor": "#495057", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 1280664904, + "version": 2, + "versionNonce": 1187941623, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 11, + "fontFamily": 2, + "text": "INSERT (queued)", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "arrow_1o", + "originalText": "INSERT (queued)", + "lineHeight": 1.25, + "autoResize": false, + "index": "ay" + }, + { + "id": "arrow_1q", + "type": "arrow", + "x": 311, + "y": 150, + "width": 42, + "height": 64, + "angle": 0, + "strokeColor": "#343a40", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "dashed", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 4225099194, + "version": 2, + "versionNonce": 1021714937, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_1r" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + -42, + 64 + ] + ], + "lastCommittedPoint": null, + "startBinding": { + "mode": "orbit", + "elementId": "rectangle_u", + "fixedPoint": [ + 0.17873625669908494, + 0.17873625669908505 + ] + }, + "endBinding": { + "mode": "orbit", + "elementId": "rectangle_w", + "fixedPoint": [ + 1, + 0.5001 + ] + }, + "startArrowhead": null, + "endArrowhead": "arrow", + "elbowed": false, + "index": "az" + }, + { + "id": "text_1r", + "type": "text", + "x": 260, + "y": 174, + "width": 60, + "height": 16, + "angle": 0, + "strokeColor": "#495057", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 1556326652, + "version": 2, + "versionNonce": 92263959, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 11, + "fontFamily": 2, + "text": "202 { id }", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "arrow_1q", + "originalText": "202 { id }", + "lineHeight": 1.25, + "autoResize": false, + "index": "b00" + }, + { + "id": "arrow_1s", + "type": "arrow", + "x": 405, + "y": 180, + "width": 0, + "height": 24, + "angle": 0, + "strokeColor": "#343a40", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 1884637070, + "version": 2, + "versionNonce": 1939962585, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + 0, + 24 + ] + ], + "lastCommittedPoint": null, + "startBinding": { + "mode": "orbit", + "elementId": "rectangle_u", + "fixedPoint": [ + 0.5001, + 0.5001 + ] + }, + "endBinding": { + "mode": "orbit", + "elementId": "rectangle_y", + "fixedPoint": [ + 0.5001, + 0.5001 + ] + }, + "startArrowhead": null, + "endArrowhead": "arrow", + "elbowed": false, + "index": "b01" + }, + { + "id": "arrow_1t", + "type": "arrow", + "x": 499, + "y": 234, + "width": 42, + "height": 0, + "angle": 0, + "strokeColor": "#343a40", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 2120445424, + "version": 2, + "versionNonce": 761985847, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_1u" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + 42, + 0 + ] + ], + "lastCommittedPoint": null, + "startBinding": { + "mode": "orbit", + "elementId": "rectangle_y", + "fixedPoint": [ + 1, + 0.5001 + ] + }, + "endBinding": { + "mode": "orbit", + "elementId": "rectangle_o", + "fixedPoint": [ + 0.1515940724562435, + 0.15159407245624434 + ] + }, + "startArrowhead": null, + "endArrowhead": "arrow", + "elbowed": false, + "index": "b02" + }, + { + "id": "text_1u", + "type": "text", + "x": 475, + "y": 226, + "width": 90, + "height": 16, + "angle": 0, + "strokeColor": "#495057", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 251002018, + "version": 2, + "versionNonce": 1866381241, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 11, + "fontFamily": 2, + "text": "claim → running", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "arrow_1t", + "originalText": "claim → running", + "lineHeight": 1.25, + "autoResize": false, + "index": "b03" + }, + { + "id": "arrow_1v", + "type": "arrow", + "x": 405, + "y": 264, + "width": 0, + "height": 24, + "angle": 0, + "strokeColor": "#343a40", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 1609443364, + "version": 2, + "versionNonce": 854883415, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + 0, + 24 + ] + ], + "lastCommittedPoint": null, + "startBinding": { + "mode": "orbit", + "elementId": "rectangle_y", + "fixedPoint": [ + 0.5001, + 0.5001 + ] + }, + "endBinding": { + "mode": "orbit", + "elementId": "rectangle_10", + "fixedPoint": [ + 0.5001, + 0.5001 + ] + }, + "startArrowhead": null, + "endArrowhead": "arrow", + "elbowed": false, + "index": "b04" + }, + { + "id": "arrow_1w", + "type": "arrow", + "x": 499, + "y": 318, + "width": 962, + "height": 0, + "angle": 0, + "strokeColor": "#343a40", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 903190774, + "version": 2, + "versionNonce": 31545497, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_1x" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + 962, + 0 + ] + ], + "lastCommittedPoint": null, + "startBinding": { + "mode": "orbit", + "elementId": "rectangle_10", + "fixedPoint": [ + 0.5137185207190681, + 0.4862814792809331 + ] + }, + "endBinding": { + "mode": "orbit", + "elementId": "rectangle_12", + "fixedPoint": [ + 0.3797417007544054, + 0.37974170075440516 + ] + }, + "startArrowhead": null, + "endArrowhead": "arrow", + "elbowed": false, + "index": "b05" + }, + { + "id": "text_1x", + "type": "text", + "x": 950, + "y": 310, + "width": 60, + "height": 16, + "angle": 0, + "strokeColor": "#495057", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 605719448, + "version": 2, + "versionNonce": 166779255, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 11, + "fontFamily": 2, + "text": "Complete()", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "arrow_1w", + "originalText": "Complete()", + "lineHeight": 1.25, + "autoResize": false, + "index": "b06" + }, + { + "id": "arrow_1y", + "type": "arrow", + "x": 1461, + "y": 327.5, + "width": 962, + "height": 54.5, + "angle": 0, + "strokeColor": "#343a40", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 3628134538, + "version": 2, + "versionNonce": 1832705401, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_1z" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + -962, + 54.5 + ] + ], + "lastCommittedPoint": null, + "startBinding": { + "mode": "orbit", + "elementId": "rectangle_12", + "fixedPoint": [ + 0.433132331930019, + 0.43313233193001793 + ] + }, + "endBinding": { + "mode": "orbit", + "elementId": "rectangle_14", + "fixedPoint": [ + 1, + 0.5001 + ] + }, + "startArrowhead": null, + "endArrowhead": "arrow", + "elbowed": false, + "index": "b07" + }, + { + "id": "text_1z", + "type": "text", + "x": 956, + "y": 346.75, + "width": 48, + "height": 16, + "angle": 0, + "strokeColor": "#495057", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 1691389004, + "version": 2, + "versionNonce": 933532311, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 11, + "fontFamily": 2, + "text": "tool_use", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "arrow_1y", + "originalText": "tool_use", + "lineHeight": 1.25, + "autoResize": false, + "index": "b08" + }, + { + "id": "arrow_20", + "type": "arrow", + "x": 499, + "y": 396, + "width": 272, + "height": 0, + "angle": 0, + "strokeColor": "#343a40", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 1275598686, + "version": 2, + "versionNonce": 1888798297, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_21" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + 272, + 0 + ] + ], + "lastCommittedPoint": null, + "startBinding": { + "mode": "orbit", + "elementId": "rectangle_14", + "fixedPoint": [ + 0.7585564262909847, + 0.2414435737090166 + ] + }, + "endBinding": { + "mode": "orbit", + "elementId": "rectangle_q", + "fixedPoint": [ + 0.3670200731894287, + 0.3670200731894281 + ] + }, + "startArrowhead": null, + "endArrowhead": "arrow", + "elbowed": false, + "index": "b09" + }, + { + "id": "text_21", + "type": "text", + "x": 566, + "y": 388, + "width": 138, + "height": 16, + "angle": 0, + "strokeColor": "#495057", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 4020067904, + "version": 2, + "versionNonce": 616834999, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 11, + "fontFamily": 2, + "text": "lookup_* / search_items", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "arrow_20", + "originalText": "lookup_* / search_items", + "lineHeight": 1.25, + "autoResize": false, + "index": "b0A" + }, + { + "id": "arrow_22", + "type": "arrow", + "x": 499, + "y": 396, + "width": 42, + "height": 0, + "angle": 0, + "strokeColor": "#343a40", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 1645371762, + "version": 2, + "versionNonce": 381457209, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_23" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + 42, + 0 + ] + ], + "lastCommittedPoint": null, + "startBinding": { + "mode": "orbit", + "elementId": "rectangle_14", + "fixedPoint": [ + 0.8711894389939127, + 0.1288105610060898 + ] + }, + "endBinding": { + "mode": "orbit", + "elementId": "rectangle_o", + "fixedPoint": [ + 0.36701803775357117, + 0.3670180377535716 + ] + }, + "startArrowhead": null, + "endArrowhead": "arrow", + "elbowed": false, + "index": "b0B" + }, + { + "id": "text_23", + "type": "text", + "x": 451, + "y": 388, + "width": 138, + "height": 16, + "angle": 0, + "strokeColor": "#495057", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 795309428, + "version": 2, + "versionNonce": 796137687, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 11, + "fontFamily": 2, + "text": "get_similar_past_builds", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "arrow_22", + "originalText": "get_similar_past_builds", + "lineHeight": 1.25, + "autoResize": false, + "index": "b0C" + }, + { + "id": "arrow_24", + "type": "arrow", + "x": 499, + "y": 396, + "width": 502, + "height": 70, + "angle": 0, + "strokeColor": "#343a40", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 3727844038, + "version": 2, + "versionNonce": 1142408217, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_25" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + 502, + 70 + ] + ], + "lastCommittedPoint": null, + "startBinding": { + "mode": "orbit", + "elementId": "rectangle_14", + "fixedPoint": [ + 0.685823816186107, + 0.3141761838138943 + ] + }, + "endBinding": { + "mode": "orbit", + "elementId": "rectangle_16", + "fixedPoint": [ + 0.26371112801901636, + 0.2637111280190178 + ] + }, + "startArrowhead": null, + "endArrowhead": "arrow", + "elbowed": false, + "index": "b0D" + }, + { + "id": "text_25", + "type": "text", + "x": 717, + "y": 423, + "width": 66, + "height": 16, + "angle": 0, + "strokeColor": "#495057", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 2002945512, + "version": 2, + "versionNonce": 2101929463, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 11, + "fontFamily": 2, + "text": "score_build", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "arrow_24", + "originalText": "score_build", + "lineHeight": 1.25, + "autoResize": false, + "index": "b0E" + }, + { + "id": "arrow_26", + "type": "arrow", + "x": 1189, + "y": 486, + "width": 42, + "height": 0, + "angle": 0, + "strokeColor": "#343a40", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 2721705818, + "version": 2, + "versionNonce": 77191417, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_27" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + 42, + 0 + ] + ], + "lastCommittedPoint": null, + "startBinding": { + "mode": "orbit", + "elementId": "rectangle_16", + "fixedPoint": [ + 0.5898358979319833, + 0.41016410206801673 + ] + }, + "endBinding": { + "mode": "orbit", + "elementId": "rectangle_18", + "fixedPoint": [ + 0.3797069649411658, + 0.37970696494116574 + ] + }, + "startArrowhead": null, + "endArrowhead": "arrow", + "elbowed": false, + "index": "b0F" + }, + { + "id": "text_27", + "type": "text", + "x": 1180, + "y": 478, + "width": 60, + "height": 16, + "angle": 0, + "strokeColor": "#495057", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 2739110812, + "version": 2, + "versionNonce": 222760727, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 11, + "fontFamily": 2, + "text": "drive calc", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "arrow_26", + "originalText": "drive calc", + "lineHeight": 1.25, + "autoResize": false, + "index": "b0G" + }, + { + "id": "arrow_28", + "type": "arrow", + "x": 405, + "y": 420, + "width": 0, + "height": 128, + "angle": 0, + "strokeColor": "#343a40", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 541989678, + "version": 2, + "versionNonce": 432427481, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_29" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + 0, + 128 + ] + ], + "lastCommittedPoint": null, + "startBinding": { + "mode": "orbit", + "elementId": "rectangle_14", + "fixedPoint": [ + 0.5001, + 0.5001 + ] + }, + "endBinding": { + "mode": "orbit", + "elementId": "rectangle_1a", + "fixedPoint": [ + 0.5001, + 0.5001 + ] + }, + "startArrowhead": null, + "endArrowhead": "arrow", + "elbowed": false, + "index": "b0H" + }, + { + "id": "text_29", + "type": "text", + "x": 333, + "y": 476, + "width": 144, + "height": 16, + "angle": 0, + "strokeColor": "#495057", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 3233063568, + "version": 2, + "versionNonce": 165876791, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 11, + "fontFamily": 2, + "text": "loop until submit passes", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "arrow_28", + "originalText": "loop until submit passes", + "lineHeight": 1.25, + "autoResize": false, + "index": "b0I" + }, + { + "id": "arrow_2a", + "type": "arrow", + "x": 499, + "y": 578, + "width": 502, + "height": 72, + "angle": 0, + "strokeColor": "#343a40", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "dashed", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 3900389954, + "version": 2, + "versionNonce": 1219538617, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_2b" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + 502, + -72 + ] + ], + "lastCommittedPoint": null, + "startBinding": { + "mode": "orbit", + "elementId": "rectangle_1a", + "fixedPoint": [ + 0.6629869571770454, + 0.6629869571770466 + ] + }, + "endBinding": { + "mode": "orbit", + "elementId": "rectangle_16", + "fixedPoint": [ + 0.2681973116063057, + 0.7318026883936947 + ] + }, + "startArrowhead": null, + "endArrowhead": "arrow", + "elbowed": false, + "index": "b0J" + }, + { + "id": "text_2b", + "type": "text", + "x": 705, + "y": 534, + "width": 90, + "height": 16, + "angle": 0, + "strokeColor": "#495057", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 3054065348, + "version": 2, + "versionNonce": 1526822231, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 11, + "fontFamily": 2, + "text": "canonical score", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "arrow_2a", + "originalText": "canonical score", + "lineHeight": 1.25, + "autoResize": false, + "index": "b0K" + }, + { + "id": "arrow_2c", + "type": "arrow", + "x": 499, + "y": 578, + "width": 962, + "height": 221, + "angle": 0, + "strokeColor": "#343a40", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "dashed", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": { + "type": 2 + }, + "seed": 1703469206, + "version": 2, + "versionNonce": 1744596889, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_2d" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + 962, + -221 + ] + ], + "lastCommittedPoint": null, + "startBinding": { + "mode": "orbit", + "elementId": "rectangle_1a", + "fixedPoint": [ + 0.7131777350486203, + 0.7131777350486194 + ] + }, + "endBinding": { + "mode": "orbit", + "elementId": "rectangle_12", + "fixedPoint": [ + 0.25218433011942226, + 0.7478156698805825 + ] + }, + "startArrowhead": null, + "endArrowhead": "arrow", + "elbowed": false, + "index": "b0L" + }, + { + "id": "text_2d", + "type": "text", + "x": 929, + "y": 459.5, + "width": 102, + "height": 16, + "angle": 0, + "strokeColor": "#495057", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 439505976, + "version": 2, + "versionNonce": 2012656247, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 11, + "fontFamily": 2, + "text": "gate fail ↺ retry", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "arrow_2c", + "originalText": "gate fail ↺ retry", + "lineHeight": 1.25, + "autoResize": false, + "index": "b0M" + }, + { + "id": "arrow_2e", + "type": "arrow", + "x": 405, + "y": 608, + "width": 0, + "height": 24, + "angle": 0, + "strokeColor": "#343a40", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 487449130, + "version": 2, + "versionNonce": 769463417, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_2f" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + 0, + 24 + ] + ], + "lastCommittedPoint": null, + "startBinding": { + "mode": "orbit", + "elementId": "rectangle_1a", + "fixedPoint": [ + 0.5001, + 0.5001 + ] + }, + "endBinding": { + "mode": "orbit", + "elementId": "rectangle_1c", + "fixedPoint": [ + 0.5001, + 0.5001 + ] + }, + "startArrowhead": null, + "endArrowhead": "arrow", + "elbowed": false, + "index": "b0N" + }, + { + "id": "text_2f", + "type": "text", + "x": 345, + "y": 612, + "width": 120, + "height": 16, + "angle": 0, + "strokeColor": "#495057", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 2985397996, + "version": 2, + "versionNonce": 2038909847, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 11, + "fontFamily": 2, + "text": "gates pass → lock in", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "arrow_2e", + "originalText": "gates pass → lock in", + "lineHeight": 1.25, + "autoResize": false, + "index": "b0O" + }, + { + "id": "arrow_2g", + "type": "arrow", + "x": 499, + "y": 656, + "width": 42, + "height": 0, + "angle": 0, + "strokeColor": "#343a40", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 113529598, + "version": 2, + "versionNonce": 1041636697, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_2h" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + 42, + 0 + ] + ], + "lastCommittedPoint": null, + "startBinding": { + "mode": "orbit", + "elementId": "rectangle_1c", + "fixedPoint": [ + 0.9107945844756846, + 0.9107945844756836 + ] + }, + "endBinding": { + "mode": "orbit", + "elementId": "rectangle_o", + "fixedPoint": [ + 0.2872365773439772, + 0.7127634226560227 + ] + }, + "startArrowhead": null, + "endArrowhead": "arrow", + "elbowed": false, + "index": "b0P" + }, + { + "id": "text_2h", + "type": "text", + "x": 439, + "y": 648, + "width": 162, + "height": 16, + "angle": 0, + "strokeColor": "#495057", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 1179532000, + "version": 2, + "versionNonce": 1810350263, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 11, + "fontFamily": 2, + "text": "SaveAndComplete (completed)", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "arrow_2g", + "originalText": "SaveAndComplete (completed)", + "lineHeight": 1.25, + "autoResize": false, + "index": "b0Q" + }, + { + "id": "arrow_2i", + "type": "arrow", + "x": 269, + "y": 758, + "width": 42, + "height": 0, + "angle": 0, + "strokeColor": "#343a40", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 3474818834, + "version": 2, + "versionNonce": 2012940857, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_2j" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + 42, + 0 + ] + ], + "lastCommittedPoint": null, + "startBinding": { + "mode": "orbit", + "elementId": "rectangle_1g", + "fixedPoint": [ + 0.5606734616781872, + 0.5606734616781864 + ] + }, + "endBinding": { + "mode": "orbit", + "elementId": "rectangle_1e", + "fixedPoint": [ + 0.3750648179544067, + 0.6249351820455923 + ] + }, + "startArrowhead": null, + "endArrowhead": "arrow", + "elbowed": false, + "index": "b0R" + }, + { + "id": "text_2j", + "type": "text", + "x": 278, + "y": 750, + "width": 24, + "height": 16, + "angle": 0, + "strokeColor": "#495057", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 3360214036, + "version": 2, + "versionNonce": 1622970839, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 11, + "fontFamily": 2, + "text": "poll", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "arrow_2i", + "originalText": "poll", + "lineHeight": 1.25, + "autoResize": false, + "index": "b0S" + }, + { + "id": "arrow_2k", + "type": "arrow", + "x": 499, + "y": 752, + "width": 42, + "height": 0, + "angle": 0, + "strokeColor": "#343a40", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 420876902, + "version": 2, + "versionNonce": 74406681, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_2l" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + 42, + 0 + ] + ], + "lastCommittedPoint": null, + "startBinding": { + "mode": "orbit", + "elementId": "rectangle_1e", + "fixedPoint": [ + 1, + 0.5001 + ] + }, + "endBinding": { + "mode": "orbit", + "elementId": "rectangle_o", + "fixedPoint": [ + 0.15957587630220932, + 0.8404241236977905 + ] + }, + "startArrowhead": null, + "endArrowhead": "arrow", + "elbowed": false, + "index": "b0T" + }, + { + "id": "text_2l", + "type": "text", + "x": 487, + "y": 744, + "width": 66, + "height": 16, + "angle": 0, + "strokeColor": "#495057", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 4123981448, + "version": 2, + "versionNonce": 1092239095, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 11, + "fontFamily": 2, + "text": "read status", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "arrow_2k", + "originalText": "read status", + "lineHeight": 1.25, + "autoResize": false, + "index": "b0U" + }, + { + "id": "arrow_2m", + "type": "arrow", + "x": 269, + "y": 836, + "width": 42, + "height": 0, + "angle": 0, + "strokeColor": "#343a40", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 323602682, + "version": 2, + "versionNonce": 602312697, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_2n" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + 42, + 0 + ] + ], + "lastCommittedPoint": null, + "startBinding": { + "mode": "orbit", + "elementId": "rectangle_1k", + "fixedPoint": [ + 0.5001, + 0.5001 + ] + }, + "endBinding": { + "mode": "orbit", + "elementId": "rectangle_1i", + "fixedPoint": [ + 0.5001, + 0.5001 + ] + }, + "startArrowhead": null, + "endArrowhead": "arrow", + "elbowed": false, + "index": "b0V" + }, + { + "id": "text_2n", + "type": "text", + "x": 275, + "y": 828, + "width": 30, + "height": 16, + "angle": 0, + "strokeColor": "#495057", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 4092571196, + "version": 2, + "versionNonce": 1602570263, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 11, + "fontFamily": 2, + "text": "fetch", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "arrow_2m", + "originalText": "fetch", + "lineHeight": 1.25, + "autoResize": false, + "index": "b0W" + }, + { + "id": "arrow_2o", + "type": "arrow", + "x": 499, + "y": 836, + "width": 42, + "height": 0, + "angle": 0, + "strokeColor": "#343a40", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 4098342606, + "version": 2, + "versionNonce": 1013197017, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_2p" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + 42, + 0 + ] + ], + "lastCommittedPoint": null, + "startBinding": { + "mode": "orbit", + "elementId": "rectangle_1i", + "fixedPoint": [ + 1, + 0.5001 + ] + }, + "endBinding": { + "mode": "orbit", + "elementId": "rectangle_o", + "fixedPoint": [ + 0.04787276289066286, + 0.9521272371093371 + ] + }, + "startArrowhead": null, + "endArrowhead": "arrow", + "elbowed": false, + "index": "b0X" + }, + { + "id": "text_2p", + "type": "text", + "x": 475, + "y": 828, + "width": 90, + "height": 16, + "angle": 0, + "strokeColor": "#495057", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 2454660912, + "version": 2, + "versionNonce": 1240608055, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 11, + "fontFamily": 2, + "text": "read trajectory", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "arrow_2o", + "originalText": "read trajectory", + "lineHeight": 1.25, + "autoResize": false, + "index": "b0Y" + }, + { + "id": "arrow_2q", + "type": "arrow", + "x": 499, + "y": 836, + "width": 272, + "height": 0, + "angle": 0, + "strokeColor": "#343a40", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 841369570, + "version": 2, + "versionNonce": 662414777, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_2r" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + 272, + 0 + ] + ], + "lastCommittedPoint": null, + "startBinding": { + "mode": "orbit", + "elementId": "rectangle_1i", + "fixedPoint": [ + 0.892181938523534, + 0.8921819385235329 + ] + }, + "endBinding": { + "mode": "orbit", + "elementId": "rectangle_q", + "fixedPoint": [ + 0.047872497392602256, + 0.9521275026073974 + ] + }, + "startArrowhead": null, + "endArrowhead": "arrow", + "elbowed": false, + "index": "b0Z" + }, + { + "id": "text_2r", + "type": "text", + "x": 599, + "y": 828, + "width": 72, + "height": 16, + "angle": 0, + "strokeColor": "#495057", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 735761764, + "version": 2, + "versionNonce": 1539665495, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 11, + "fontFamily": 2, + "text": "enrich names", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "arrow_2q", + "originalText": "enrich names", + "lineHeight": 1.25, + "autoResize": false, + "index": "b0a" + }, + { + "id": "line_2s", + "type": "line", + "x": 60, + "y": 890, + "width": 1610, + "height": 0, + "angle": 0, + "strokeColor": "#adb5bd", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 1, + "strokeStyle": "dashed", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 2304178230, + "version": 2, + "versionNonce": 1079019161, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + 1610, + 0 + ] + ], + "lastCommittedPoint": null, + "startBinding": null, + "endBinding": null, + "startArrowhead": null, + "endArrowhead": null, + "index": "b0b", + "polygon": false + }, + { + "id": "text_2t", + "type": "text", + "x": 60, + "y": 900, + "width": 600, + "height": 20, + "angle": 0, + "strokeColor": "#e8590c", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 1488809176, + "version": 3, + "versionNonce": 150712601, + "isDeleted": true, + "boundElements": [], + "updated": 1780290128788, + "link": null, + "locked": false, + "fontSize": 16, + "fontFamily": 2, + "text": "Band B — POST /score (deterministic, LLM-free)", + "textAlign": "left", + "verticalAlign": "top", + "containerId": null, + "originalText": "Band B — POST /score (deterministic, LLM-free)", + "lineHeight": 1.25, + "autoResize": true, + "index": "b0c" + }, + { + "id": "rectangle_2u", + "type": "rectangle", + "x": 81, + "y": 928, + "width": 188, + "height": 60, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "#f1f3f5", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": { + "type": 3 + }, + "seed": 649765834, + "version": 2, + "versionNonce": 831933305, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_2v" + }, + { + "type": "arrow", + "id": "arrow_34" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "index": "b0d" + }, + { + "id": "text_2v", + "type": "text", + "x": 86, + "y": 940.5, + "width": 178, + "height": 35, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 3851608460, + "version": 2, + "versionNonce": 308348055, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 14, + "fontFamily": 2, + "text": "POST /score\n(full build)", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "rectangle_2u", + "originalText": "POST /score\n(full build)", + "lineHeight": 1.25, + "autoResize": false, + "index": "b0e" + }, + { + "id": "rectangle_2w", + "type": "rectangle", + "x": 311, + "y": 928, + "width": 188, + "height": 60, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "#a5d8ff", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": { + "type": 3 + }, + "seed": 2297781918, + "version": 2, + "versionNonce": 59798617, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_2x" + }, + { + "type": "arrow", + "id": "arrow_34" + }, + { + "type": "arrow", + "id": "arrow_36" + }, + { + "type": "arrow", + "id": "arrow_3a" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "index": "b0f" + }, + { + "id": "text_2x", + "type": "text", + "x": 316, + "y": 940.5, + "width": 178, + "height": 35, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 3286001536, + "version": 2, + "versionNonce": 321018295, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 14, + "fontFamily": 2, + "text": "validate →\nscoring client", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "rectangle_2w", + "originalText": "validate →\nscoring client", + "lineHeight": 1.25, + "autoResize": false, + "index": "b0g" + }, + { + "id": "rectangle_2y", + "type": "rectangle", + "x": 1001, + "y": 928, + "width": 188, + "height": 60, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "#ffd8a8", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": { + "type": 3 + }, + "seed": 3976363186, + "version": 2, + "versionNonce": 1779597625, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_2z" + }, + { + "type": "arrow", + "id": "arrow_36" + }, + { + "type": "arrow", + "id": "arrow_38" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "index": "b0h" + }, + { + "id": "text_2z", + "type": "text", + "x": 1006, + "y": 940.5, + "width": 178, + "height": 35, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 3887362740, + "version": 2, + "versionNonce": 1463552727, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 14, + "fontFamily": 2, + "text": "POST /score\nShimPool → worker", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "rectangle_2y", + "originalText": "POST /score\nShimPool → worker", + "lineHeight": 1.25, + "autoResize": false, + "index": "b0i" + }, + { + "id": "rectangle_30", + "type": "rectangle", + "x": 1231, + "y": 928, + "width": 188, + "height": 60, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "#ffec99", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": { + "type": 3 + }, + "seed": 1510511110, + "version": 2, + "versionNonce": 1384116761, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_31" + }, + { + "type": "arrow", + "id": "arrow_38" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "index": "b0j" + }, + { + "id": "text_31", + "type": "text", + "x": 1236, + "y": 940.5, + "width": 178, + "height": 35, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 1187165992, + "version": 2, + "versionNonce": 188913655, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 14, + "fontFamily": 2, + "text": "rocalc:\ntranslate + eval", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "rectangle_30", + "originalText": "rocalc:\ntranslate + eval", + "lineHeight": 1.25, + "autoResize": false, + "index": "b0k" + }, + { + "id": "rectangle_32", + "type": "rectangle", + "x": 81, + "y": 1024, + "width": 188, + "height": 60, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "#f1f3f5", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": { + "type": 3 + }, + "seed": 2691527322, + "version": 2, + "versionNonce": 835471097, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_33" + }, + { + "type": "arrow", + "id": "arrow_3a" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "index": "b0l" + }, + { + "id": "text_33", + "type": "text", + "x": 86, + "y": 1036.5, + "width": 178, + "height": 35, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 1819289820, + "version": 2, + "versionNonce": 1429897495, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 14, + "fontFamily": 2, + "text": "200\nstructured breakdown", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "rectangle_32", + "originalText": "200\nstructured breakdown", + "lineHeight": 1.25, + "autoResize": false, + "index": "b0m" + }, + { + "id": "arrow_34", + "type": "arrow", + "x": 269, + "y": 958, + "width": 42, + "height": 0, + "angle": 0, + "strokeColor": "#343a40", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 3760861806, + "version": 2, + "versionNonce": 310050777, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_35" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + 42, + 0 + ] + ], + "lastCommittedPoint": null, + "startBinding": { + "mode": "orbit", + "elementId": "rectangle_2u", + "fixedPoint": [ + 0.5001, + 0.5001 + ] + }, + "endBinding": { + "mode": "orbit", + "elementId": "rectangle_2w", + "fixedPoint": [ + 0.5001, + 0.5001 + ] + }, + "startArrowhead": null, + "endArrowhead": "arrow", + "elbowed": false, + "index": "b0n" + }, + { + "id": "text_35", + "type": "text", + "x": 257, + "y": 950, + "width": 66, + "height": 16, + "angle": 0, + "strokeColor": "#495057", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 1465580496, + "version": 2, + "versionNonce": 647513655, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 11, + "fontFamily": 2, + "text": "POST /score", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "arrow_34", + "originalText": "POST /score", + "lineHeight": 1.25, + "autoResize": false, + "index": "b0o" + }, + { + "id": "arrow_36", + "type": "arrow", + "x": 499, + "y": 958, + "width": 502, + "height": 0, + "angle": 0, + "strokeColor": "#343a40", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 1784620418, + "version": 2, + "versionNonce": 1654627513, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_37" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + 502, + 0 + ] + ], + "lastCommittedPoint": null, + "startBinding": { + "mode": "orbit", + "elementId": "rectangle_2w", + "fixedPoint": [ + 0.5001, + 0.5001 + ] + }, + "endBinding": { + "mode": "orbit", + "elementId": "rectangle_2y", + "fixedPoint": [ + 0.5001, + 0.5001 + ] + }, + "startArrowhead": null, + "endArrowhead": "arrow", + "elbowed": false, + "index": "b0p" + }, + { + "id": "text_37", + "type": "text", + "x": 735, + "y": 950, + "width": 30, + "height": 16, + "angle": 0, + "strokeColor": "#495057", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 2483725316, + "version": 2, + "versionNonce": 1312843607, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 11, + "fontFamily": 2, + "text": "score", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "arrow_36", + "originalText": "score", + "lineHeight": 1.25, + "autoResize": false, + "index": "b0q" + }, + { + "id": "arrow_38", + "type": "arrow", + "x": 1189, + "y": 958, + "width": 42, + "height": 0, + "angle": 0, + "strokeColor": "#343a40", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 304603094, + "version": 2, + "versionNonce": 31301017, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_39" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + 42, + 0 + ] + ], + "lastCommittedPoint": null, + "startBinding": { + "mode": "orbit", + "elementId": "rectangle_2y", + "fixedPoint": [ + 0.5001, + 0.5001 + ] + }, + "endBinding": { + "mode": "orbit", + "elementId": "rectangle_30", + "fixedPoint": [ + 0.5001, + 0.5001 + ] + }, + "startArrowhead": null, + "endArrowhead": "arrow", + "elbowed": false, + "index": "b0r" + }, + { + "id": "text_39", + "type": "text", + "x": 1180, + "y": 950, + "width": 60, + "height": 16, + "angle": 0, + "strokeColor": "#495057", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 3370374520, + "version": 2, + "versionNonce": 1250387063, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 11, + "fontFamily": 2, + "text": "drive calc", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "arrow_38", + "originalText": "drive calc", + "lineHeight": 1.25, + "autoResize": false, + "index": "b0s" + }, + { + "id": "arrow_3a", + "type": "arrow", + "x": 311, + "y": 958, + "width": 42, + "height": 76, + "angle": 0, + "strokeColor": "#343a40", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "dashed", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 1085224298, + "version": 2, + "versionNonce": 258507385, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_3b" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + -42, + 76 + ] + ], + "lastCommittedPoint": null, + "startBinding": { + "mode": "orbit", + "elementId": "rectangle_2w", + "fixedPoint": [ + 0.15565613553115706, + 0.1556561355311563 + ] + }, + "endBinding": { + "mode": "orbit", + "elementId": "rectangle_32", + "fixedPoint": [ + 0.6970358161083617, + 0.6970358161083595 + ] + }, + "startArrowhead": null, + "endArrowhead": "arrow", + "elbowed": false, + "index": "b0t" + }, + { + "id": "text_3b", + "type": "text", + "x": 251, + "y": 988, + "width": 78, + "height": 16, + "angle": 0, + "strokeColor": "#495057", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 660374572, + "version": 2, + "versionNonce": 1529986455, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 11, + "fontFamily": 2, + "text": "200 breakdown", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "arrow_3a", + "originalText": "200 breakdown", + "lineHeight": 1.25, + "autoResize": false, + "index": "b0u" + }, + { + "id": "line_3c", + "type": "line", + "x": 58.33333333333326, + "y": 1096, + "width": 1610, + "height": 0, + "angle": 0, + "strokeColor": "#adb5bd", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 1, + "strokeStyle": "dashed", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 1619212862, + "version": 23, + "versionNonce": 241649367, + "isDeleted": false, + "boundElements": [], + "updated": 1780290136520, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + 1610, + 0 + ] + ], + "lastCommittedPoint": null, + "startBinding": null, + "endBinding": null, + "startArrowhead": null, + "endArrowhead": null, + "index": "b0v", + "polygon": false + }, + { + "id": "text_3d", + "type": "text", + "x": 60, + "y": 1086, + "width": 600, + "height": 20, + "angle": 0, + "strokeColor": "#0b7285", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 1987044384, + "version": 3, + "versionNonce": 1056969239, + "isDeleted": true, + "boundElements": [], + "updated": 1780290130098, + "link": null, + "locked": false, + "fontSize": 16, + "fontFamily": 2, + "text": "Band C — GET /builds / /builds/{id} (library read)", + "textAlign": "left", + "verticalAlign": "top", + "containerId": null, + "originalText": "Band C — GET /builds / /builds/{id} (library read)", + "lineHeight": 1.25, + "autoResize": true, + "index": "b0w" + }, + { + "id": "rectangle_3e", + "type": "rectangle", + "x": 81, + "y": 1114, + "width": 188, + "height": 48, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "#f1f3f5", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": { + "type": 3 + }, + "seed": 1948861010, + "version": 2, + "versionNonce": 1141045305, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_3f" + }, + { + "type": "arrow", + "id": "arrow_3o" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "index": "b0x" + }, + { + "id": "text_3f", + "type": "text", + "x": 86, + "y": 1129.25, + "width": 178, + "height": 17.5, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 2857527636, + "version": 2, + "versionNonce": 737313751, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 14, + "fontFamily": 2, + "text": "GET /builds /{id}", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "rectangle_3e", + "originalText": "GET /builds /{id}", + "lineHeight": 1.25, + "autoResize": false, + "index": "b0y" + }, + { + "id": "rectangle_3g", + "type": "rectangle", + "x": 311, + "y": 1114, + "width": 188, + "height": 60, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "#a5d8ff", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": { + "type": 3 + }, + "seed": 3958497702, + "version": 2, + "versionNonce": 625576217, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_3h" + }, + { + "type": "arrow", + "id": "arrow_3o" + }, + { + "type": "arrow", + "id": "arrow_3q" + }, + { + "type": "arrow", + "id": "arrow_3s" + }, + { + "type": "arrow", + "id": "arrow_3u" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "index": "b0z" + }, + { + "id": "text_3h", + "type": "text", + "x": 316, + "y": 1126.5, + "width": 178, + "height": 35, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 1030080456, + "version": 2, + "versionNonce": 1421996279, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 14, + "fontFamily": 2, + "text": "list / read\n+ enrich names", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "rectangle_3g", + "originalText": "list / read\n+ enrich names", + "lineHeight": 1.25, + "autoResize": false, + "index": "b10" + }, + { + "id": "rectangle_3i", + "type": "rectangle", + "x": 541, + "y": 1114, + "width": 188, + "height": 48, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "#d0bfff", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": { + "type": 3 + }, + "seed": 252505146, + "version": 2, + "versionNonce": 1162542585, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_3j" + }, + { + "type": "arrow", + "id": "arrow_3q" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "index": "b11" + }, + { + "id": "text_3j", + "type": "text", + "x": 546, + "y": 1129.25, + "width": 178, + "height": 17.5, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 3194811260, + "version": 2, + "versionNonce": 1197914647, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 14, + "fontFamily": 2, + "text": "saved_trajectories", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "rectangle_3i", + "originalText": "saved_trajectories", + "lineHeight": 1.25, + "autoResize": false, + "index": "b12" + }, + { + "id": "rectangle_3k", + "type": "rectangle", + "x": 771, + "y": 1114, + "width": 188, + "height": 60, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "#b2f2bb", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": { + "type": 3 + }, + "seed": 2346546702, + "version": 2, + "versionNonce": 1393219289, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_3l" + }, + { + "type": "arrow", + "id": "arrow_3s" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "index": "b13" + }, + { + "id": "text_3l", + "type": "text", + "x": 776, + "y": 1126.5, + "width": 178, + "height": 35, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 1207967856, + "version": 2, + "versionNonce": 1490378551, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 14, + "fontFamily": 2, + "text": "catalog\n(name enrich)", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "rectangle_3k", + "originalText": "catalog\n(name enrich)", + "lineHeight": 1.25, + "autoResize": false, + "index": "b14" + }, + { + "id": "rectangle_3m", + "type": "rectangle", + "x": 81, + "y": 1210, + "width": 188, + "height": 60, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "#f1f3f5", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": { + "type": 3 + }, + "seed": 59626274, + "version": 2, + "versionNonce": 1360827321, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_3n" + }, + { + "type": "arrow", + "id": "arrow_3u" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "index": "b15" + }, + { + "id": "text_3n", + "type": "text", + "x": 86, + "y": 1222.5, + "width": 178, + "height": 35, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 3577791140, + "version": 2, + "versionNonce": 1265786967, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 14, + "fontFamily": 2, + "text": "200\nlist / enriched build", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "rectangle_3m", + "originalText": "200\nlist / enriched build", + "lineHeight": 1.25, + "autoResize": false, + "index": "b16" + }, + { + "id": "arrow_3o", + "type": "arrow", + "x": 269, + "y": 1138, + "width": 42, + "height": 0, + "angle": 0, + "strokeColor": "#343a40", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 2766378870, + "version": 2, + "versionNonce": 597931161, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_3p" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + 42, + 0 + ] + ], + "lastCommittedPoint": null, + "startBinding": { + "mode": "orbit", + "elementId": "rectangle_3e", + "fixedPoint": [ + 0.5737218280042359, + 0.4262781719957663 + ] + }, + "endBinding": { + "mode": "orbit", + "elementId": "rectangle_3g", + "fixedPoint": [ + 0.3999557634828705, + 0.39995576348286854 + ] + }, + "startArrowhead": null, + "endArrowhead": "arrow", + "elbowed": false, + "index": "b17" + }, + { + "id": "text_3p", + "type": "text", + "x": 257, + "y": 1130, + "width": 66, + "height": 16, + "angle": 0, + "strokeColor": "#495057", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 2815266328, + "version": 2, + "versionNonce": 554843511, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 11, + "fontFamily": 2, + "text": "GET /builds", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "arrow_3o", + "originalText": "GET /builds", + "lineHeight": 1.25, + "autoResize": false, + "index": "b18" + }, + { + "id": "arrow_3q", + "type": "arrow", + "x": 499, + "y": 1144, + "width": 42, + "height": 0, + "angle": 0, + "strokeColor": "#343a40", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 710121226, + "version": 2, + "versionNonce": 1582545273, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_3r" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + 42, + 0 + ] + ], + "lastCommittedPoint": null, + "startBinding": { + "mode": "orbit", + "elementId": "rectangle_3g", + "fixedPoint": [ + 0.5606734616781839, + 0.5606734616781789 + ] + }, + "endBinding": { + "mode": "orbit", + "elementId": "rectangle_3i", + "fixedPoint": [ + 0.3750648179544125, + 0.62493518204559 + ] + }, + "startArrowhead": null, + "endArrowhead": "arrow", + "elbowed": false, + "index": "b19" + }, + { + "id": "text_3r", + "type": "text", + "x": 508, + "y": 1136, + "width": 24, + "height": 16, + "angle": 0, + "strokeColor": "#495057", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 855013068, + "version": 2, + "versionNonce": 754546327, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 11, + "fontFamily": 2, + "text": "read", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "arrow_3q", + "originalText": "read", + "lineHeight": 1.25, + "autoResize": false, + "index": "b1A" + }, + { + "id": "arrow_3s", + "type": "arrow", + "x": 499, + "y": 1144, + "width": 272, + "height": 0, + "angle": 0, + "strokeColor": "#343a40", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 3478513118, + "version": 2, + "versionNonce": 1383080537, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_3t" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + 272, + 0 + ] + ], + "lastCommittedPoint": null, + "startBinding": { + "mode": "orbit", + "elementId": "rectangle_3g", + "fixedPoint": [ + 0.5001, + 0.5001 + ] + }, + "endBinding": { + "mode": "orbit", + "elementId": "rectangle_3k", + "fixedPoint": [ + 0.5001, + 0.5001 + ] + }, + "startArrowhead": null, + "endArrowhead": "arrow", + "elbowed": false, + "index": "b1B" + }, + { + "id": "text_3t", + "type": "text", + "x": 617, + "y": 1136, + "width": 36, + "height": 16, + "angle": 0, + "strokeColor": "#495057", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 1076932800, + "version": 2, + "versionNonce": 1708952503, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 11, + "fontFamily": 2, + "text": "enrich", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "arrow_3s", + "originalText": "enrich", + "lineHeight": 1.25, + "autoResize": false, + "index": "b1C" + }, + { + "id": "arrow_3u", + "type": "arrow", + "x": 311, + "y": 1144, + "width": 42, + "height": 76, + "angle": 0, + "strokeColor": "#343a40", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "dashed", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 284809202, + "version": 2, + "versionNonce": 1556901689, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_3v" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + -42, + 76 + ] + ], + "lastCommittedPoint": null, + "startBinding": { + "mode": "orbit", + "elementId": "rectangle_3g", + "fixedPoint": [ + 0.15565613553117882, + 0.15565613553117524 + ] + }, + "endBinding": { + "mode": "orbit", + "elementId": "rectangle_3m", + "fixedPoint": [ + 0.6970358161083121, + 0.6970358161083141 + ] + }, + "startArrowhead": null, + "endArrowhead": "arrow", + "elbowed": false, + "index": "b1D" + }, + { + "id": "text_3v", + "type": "text", + "x": 260, + "y": 1174, + "width": 60, + "height": 16, + "angle": 0, + "strokeColor": "#495057", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_1", + "roundness": null, + "seed": 1087025140, + "version": 2, + "versionNonce": 2011167959, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 11, + "fontFamily": 2, + "text": "200 result", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "arrow_3u", + "originalText": "200 result", + "lineHeight": 1.25, + "autoResize": false, + "index": "b1E" + }, + { + "id": "frame_3w", + "type": "frame", + "x": 1850, + "y": 0, + "width": 980, + "height": 1080, + "angle": 0, + "strokeColor": "#bbbbbb", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "roundness": null, + "seed": 1304035654, + "version": 2, + "versionNonce": 1942757401, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "name": "2 · High-level architecture", + "index": "b1F" + }, + { + "id": "rectangle_3x", + "type": "rectangle", + "x": 1890, + "y": 130, + "width": 600, + "height": 540, + "angle": 0, + "strokeColor": "#495057", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_3w", + "roundness": { + "type": 3 + }, + "seed": 14690408, + "version": 2, + "versionNonce": 379079159, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "index": "b1G" + }, + { + "id": "text_3y", + "type": "text", + "x": 1906, + "y": 142, + "width": 568, + "height": 24, + "angle": 0, + "strokeColor": "#495057", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_3w", + "roundness": null, + "seed": 2559587802, + "version": 2, + "versionNonce": 1969403129, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 17, + "fontFamily": 2, + "text": "Go API · cmd/api (deployable unit)", + "textAlign": "left", + "verticalAlign": "top", + "containerId": null, + "originalText": "Go API · cmd/api (deployable unit)", + "lineHeight": 1.25, + "autoResize": true, + "index": "b1H" + }, + { + "id": "rectangle_3z", + "type": "rectangle", + "x": 1920, + "y": 190, + "width": 240, + "height": 54, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "#a5d8ff", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_3w", + "roundness": { + "type": 3 + }, + "seed": 797838876, + "version": 2, + "versionNonce": 252310295, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_40" + }, + { + "type": "arrow", + "id": "arrow_4h" + }, + { + "type": "arrow", + "id": "arrow_4j" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "index": "b1I" + }, + { + "id": "text_40", + "type": "text", + "x": 1925, + "y": 208.25, + "width": 230, + "height": 17.5, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_3w", + "roundness": null, + "seed": 1397328302, + "version": 2, + "versionNonce": 890482137, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 14, + "fontFamily": 2, + "text": "HTTP handlers", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "rectangle_3z", + "originalText": "HTTP handlers", + "lineHeight": 1.25, + "autoResize": false, + "index": "b1J" + }, + { + "id": "rectangle_41", + "type": "rectangle", + "x": 1920, + "y": 280, + "width": 240, + "height": 54, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "#a5d8ff", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_3w", + "roundness": { + "type": 3 + }, + "seed": 1885771024, + "version": 2, + "versionNonce": 430536759, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_42" + }, + { + "type": "arrow", + "id": "arrow_4h" + }, + { + "type": "arrow", + "id": "arrow_4i" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "index": "b1K" + }, + { + "id": "text_42", + "type": "text", + "x": 1925, + "y": 289.5, + "width": 230, + "height": 35, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_3w", + "roundness": null, + "seed": 1679446210, + "version": 2, + "versionNonce": 1240631993, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 14, + "fontFamily": 2, + "text": "Worker pool\n(async /generate)", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "rectangle_41", + "originalText": "Worker pool\n(async /generate)", + "lineHeight": 1.25, + "autoResize": false, + "index": "b1L" + }, + { + "id": "rectangle_43", + "type": "rectangle", + "x": 1920, + "y": 380, + "width": 240, + "height": 60, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "#a5d8ff", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_3w", + "roundness": { + "type": 3 + }, + "seed": 3928305988, + "version": 2, + "versionNonce": 1817925975, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_44" + }, + { + "type": "arrow", + "id": "arrow_4i" + }, + { + "type": "arrow", + "id": "arrow_4l" + }, + { + "type": "arrow", + "id": "arrow_4m" + }, + { + "type": "arrow", + "id": "arrow_4t" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "index": "b1M" + }, + { + "id": "text_44", + "type": "text", + "x": 1925, + "y": 392.5, + "width": 230, + "height": 35, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_3w", + "roundness": null, + "seed": 443686678, + "version": 2, + "versionNonce": 480431001, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 14, + "fontFamily": 2, + "text": "Orchestrator\n(LLM tool-loop)", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "rectangle_43", + "originalText": "Orchestrator\n(LLM tool-loop)", + "lineHeight": 1.25, + "autoResize": false, + "index": "b1N" + }, + { + "id": "rectangle_45", + "type": "rectangle", + "x": 2220, + "y": 280, + "width": 240, + "height": 54, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "#a5d8ff", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_3w", + "roundness": { + "type": 3 + }, + "seed": 2258802360, + "version": 2, + "versionNonce": 208934519, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_46" + }, + { + "type": "arrow", + "id": "arrow_4m" + }, + { + "type": "arrow", + "id": "arrow_4n" + }, + { + "type": "arrow", + "id": "arrow_4p" + }, + { + "type": "arrow", + "id": "arrow_4r" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "index": "b1O" + }, + { + "id": "text_46", + "type": "text", + "x": 2225, + "y": 298.25, + "width": 230, + "height": 17.5, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_3w", + "roundness": null, + "seed": 386910378, + "version": 2, + "versionNonce": 894955641, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 14, + "fontFamily": 2, + "text": "Tool registry", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "rectangle_45", + "originalText": "Tool registry", + "lineHeight": 1.25, + "autoResize": false, + "index": "b1P" + }, + { + "id": "rectangle_47", + "type": "rectangle", + "x": 2220, + "y": 380, + "width": 240, + "height": 60, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "#a5d8ff", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_3w", + "roundness": { + "type": 3 + }, + "seed": 1476966764, + "version": 2, + "versionNonce": 1622683543, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_48" + }, + { + "type": "arrow", + "id": "arrow_4l" + }, + { + "type": "arrow", + "id": "arrow_4v" + }, + { + "type": "arrow", + "id": "arrow_5j" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "index": "b1Q" + }, + { + "id": "text_48", + "type": "text", + "x": 2225, + "y": 392.5, + "width": 230, + "height": 35, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_3w", + "roundness": null, + "seed": 3411370366, + "version": 2, + "versionNonce": 1238727001, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 14, + "fontFamily": 2, + "text": "LLM provider\n(Anthropic / OpenAI)", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "rectangle_47", + "originalText": "LLM provider\n(Anthropic / OpenAI)", + "lineHeight": 1.25, + "autoResize": false, + "index": "b1R" + }, + { + "id": "rectangle_49", + "type": "rectangle", + "x": 2220, + "y": 480, + "width": 240, + "height": 54, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "#a5d8ff", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_3w", + "roundness": { + "type": 3 + }, + "seed": 3611741536, + "version": 2, + "versionNonce": 56370359, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_4a" + }, + { + "type": "arrow", + "id": "arrow_4j" + }, + { + "type": "arrow", + "id": "arrow_4n" + }, + { + "type": "arrow", + "id": "arrow_5f" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "index": "b1S" + }, + { + "id": "text_4a", + "type": "text", + "x": 2225, + "y": 498.25, + "width": 230, + "height": 17.5, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_3w", + "roundness": null, + "seed": 1675378066, + "version": 2, + "versionNonce": 191817273, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 14, + "fontFamily": 2, + "text": "Scoring client", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "rectangle_49", + "originalText": "Scoring client", + "lineHeight": 1.25, + "autoResize": false, + "index": "b1T" + }, + { + "id": "rectangle_4b", + "type": "rectangle", + "x": 1920, + "y": 490, + "width": 240, + "height": 60, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "#d0bfff", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_3w", + "roundness": { + "type": 3 + }, + "seed": 4022683284, + "version": 2, + "versionNonce": 1409578455, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_4c" + }, + { + "type": "arrow", + "id": "arrow_4p" + }, + { + "type": "arrow", + "id": "arrow_4t" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "index": "b1U" + }, + { + "id": "text_4c", + "type": "text", + "x": 1925, + "y": 502.5, + "width": 230, + "height": 35, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_3w", + "roundness": null, + "seed": 843641062, + "version": 2, + "versionNonce": 889698073, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 14, + "fontFamily": 2, + "text": "Build library\n(PostgreSQL)", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "rectangle_4b", + "originalText": "Build library\n(PostgreSQL)", + "lineHeight": 1.25, + "autoResize": false, + "index": "b1V" + }, + { + "id": "rectangle_4d", + "type": "rectangle", + "x": 1920, + "y": 580, + "width": 240, + "height": 54, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "#b2f2bb", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_3w", + "roundness": { + "type": 3 + }, + "seed": 207214856, + "version": 2, + "versionNonce": 1237689079, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_4e" + }, + { + "type": "arrow", + "id": "arrow_4r" + }, + { + "type": "arrow", + "id": "arrow_5n" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "index": "b1W" + }, + { + "id": "text_4e", + "type": "text", + "x": 1925, + "y": 589.5, + "width": 230, + "height": 35, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_3w", + "roundness": null, + "seed": 3932114810, + "version": 2, + "versionNonce": 1494445049, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 14, + "fontFamily": 2, + "text": "Embedded catalog\n(//go:embed)", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "rectangle_4d", + "originalText": "Embedded catalog\n(//go:embed)", + "lineHeight": 1.25, + "autoResize": false, + "index": "b1X" + }, + { + "id": "rectangle_4f", + "type": "rectangle", + "x": 2220, + "y": 580, + "width": 240, + "height": 54, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "#b2f2bb", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_3w", + "roundness": { + "type": 3 + }, + "seed": 2575005884, + "version": 2, + "versionNonce": 86256663, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_4g" + }, + { + "type": "arrow", + "id": "arrow_4v" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "index": "b1Y" + }, + { + "id": "text_4g", + "type": "text", + "x": 2225, + "y": 589.5, + "width": 230, + "height": 35, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_3w", + "roundness": null, + "seed": 1180069198, + "version": 2, + "versionNonce": 1872069849, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 14, + "fontFamily": 2, + "text": "Server profiles\n(YAML, embedded)", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "rectangle_4f", + "originalText": "Server profiles\n(YAML, embedded)", + "lineHeight": 1.25, + "autoResize": false, + "index": "b1Z" + }, + { + "id": "arrow_4h", + "type": "arrow", + "x": 2040, + "y": 244, + "width": 0, + "height": 36, + "angle": 0, + "strokeColor": "#343a40", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_3w", + "roundness": null, + "seed": 2964740528, + "version": 2, + "versionNonce": 571773239, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + 0, + 36 + ] + ], + "lastCommittedPoint": null, + "startBinding": { + "mode": "orbit", + "elementId": "rectangle_3z", + "fixedPoint": [ + 0.5001, + 0.5001 + ] + }, + "endBinding": { + "mode": "orbit", + "elementId": "rectangle_41", + "fixedPoint": [ + 0.5001, + 0.5001 + ] + }, + "startArrowhead": null, + "endArrowhead": "arrow", + "elbowed": false, + "index": "b1a" + }, + { + "id": "arrow_4i", + "type": "arrow", + "x": 2040, + "y": 334, + "width": 0, + "height": 46, + "angle": 0, + "strokeColor": "#343a40", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_3w", + "roundness": null, + "seed": 3865878114, + "version": 2, + "versionNonce": 606175673, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + 0, + 46 + ] + ], + "lastCommittedPoint": null, + "startBinding": { + "mode": "orbit", + "elementId": "rectangle_41", + "fixedPoint": [ + 0.5001, + 0.5001 + ] + }, + "endBinding": { + "mode": "orbit", + "elementId": "rectangle_43", + "fixedPoint": [ + 0.5001, + 0.5001 + ] + }, + "startArrowhead": null, + "endArrowhead": "arrow", + "elbowed": false, + "index": "b1b" + }, + { + "id": "arrow_4j", + "type": "arrow", + "x": 2160, + "y": 217, + "width": 60, + "height": 273, + "angle": 0, + "strokeColor": "#343a40", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "dashed", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_3w", + "roundness": null, + "seed": 3781160932, + "version": 2, + "versionNonce": 1241207383, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_4k" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + 60, + 273 + ] + ], + "lastCommittedPoint": null, + "startBinding": { + "mode": "orbit", + "elementId": "rectangle_3z", + "fixedPoint": [ + 0.9387230311385167, + 0.061276968861485495 + ] + }, + "endBinding": { + "mode": "orbit", + "elementId": "rectangle_49", + "fixedPoint": [ + 0.10525274873902125, + 0.8947472512609764 + ] + }, + "startArrowhead": null, + "endArrowhead": "arrow", + "elbowed": false, + "index": "b1c" + }, + { + "id": "text_4k", + "type": "text", + "x": 2172, + "y": 345.5, + "width": 36, + "height": 16, + "angle": 0, + "strokeColor": "#495057", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_3w", + "roundness": null, + "seed": 2142992054, + "version": 2, + "versionNonce": 1675289241, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 11, + "fontFamily": 2, + "text": "/score", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "arrow_4j", + "originalText": "/score", + "lineHeight": 1.25, + "autoResize": false, + "index": "b1d" + }, + { + "id": "arrow_4l", + "type": "arrow", + "x": 2160, + "y": 410, + "width": 60, + "height": 0, + "angle": 0, + "strokeColor": "#343a40", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_3w", + "roundness": null, + "seed": 1250619224, + "version": 2, + "versionNonce": 95219575, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + 60, + 0 + ] + ], + "lastCommittedPoint": null, + "startBinding": { + "mode": "orbit", + "elementId": "rectangle_43", + "fixedPoint": [ + 0.5001, + 0.5001 + ] + }, + "endBinding": { + "mode": "orbit", + "elementId": "rectangle_47", + "fixedPoint": [ + 0.5001, + 0.5001 + ] + }, + "startArrowhead": null, + "endArrowhead": "arrow", + "elbowed": false, + "index": "b1e" + }, + { + "id": "arrow_4m", + "type": "arrow", + "x": 2160, + "y": 410, + "width": 60, + "height": 86, + "angle": 0, + "strokeColor": "#343a40", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_3w", + "roundness": null, + "seed": 2924202570, + "version": 2, + "versionNonce": 729098105, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + 60, + -86 + ] + ], + "lastCommittedPoint": null, + "startBinding": { + "mode": "orbit", + "elementId": "rectangle_43", + "fixedPoint": [ + 0.8479533191081771, + 0.8479533191081762 + ] + }, + "endBinding": { + "mode": "orbit", + "elementId": "rectangle_45", + "fixedPoint": [ + 0.26083354545355064, + 0.26083354545355064 + ] + }, + "startArrowhead": null, + "endArrowhead": "arrow", + "elbowed": false, + "index": "b1f" + }, + { + "id": "arrow_4n", + "type": "arrow", + "x": 2340, + "y": 334, + "width": 0, + "height": 146, + "angle": 0, + "strokeColor": "#343a40", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_3w", + "roundness": null, + "seed": 2050706444, + "version": 2, + "versionNonce": 1332603031, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_4o" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + 0, + 146 + ] + ], + "lastCommittedPoint": null, + "startBinding": { + "mode": "orbit", + "elementId": "rectangle_45", + "fixedPoint": [ + 0.5001, + 0.5001 + ] + }, + "endBinding": { + "mode": "orbit", + "elementId": "rectangle_49", + "fixedPoint": [ + 0.5001, + 0.5001 + ] + }, + "startArrowhead": null, + "endArrowhead": "arrow", + "elbowed": false, + "index": "b1g" + }, + { + "id": "text_4o", + "type": "text", + "x": 2307, + "y": 399, + "width": 66, + "height": 16, + "angle": 0, + "strokeColor": "#495057", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_3w", + "roundness": null, + "seed": 4268338462, + "version": 2, + "versionNonce": 355717209, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 11, + "fontFamily": 2, + "text": "score_build", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "arrow_4n", + "originalText": "score_build", + "lineHeight": 1.25, + "autoResize": false, + "index": "b1h" + }, + { + "id": "arrow_4p", + "type": "arrow", + "x": 2220, + "y": 307, + "width": 60, + "height": 193, + "angle": 0, + "strokeColor": "#343a40", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_3w", + "roundness": null, + "seed": 3319413248, + "version": 2, + "versionNonce": 1693629879, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_4q" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + -60, + 193 + ] + ], + "lastCommittedPoint": null, + "startBinding": { + "mode": "orbit", + "elementId": "rectangle_45", + "fixedPoint": [ + 0.07987081687379222, + 0.07987081687379369 + ] + }, + "endBinding": { + "mode": "orbit", + "elementId": "rectangle_4b", + "fixedPoint": [ + 0.8424163636562109, + 0.8424163636562109 + ] + }, + "startArrowhead": null, + "endArrowhead": "arrow", + "elbowed": false, + "index": "b1i" + }, + { + "id": "text_4q", + "type": "text", + "x": 2148, + "y": 395.5, + "width": 84, + "height": 16, + "angle": 0, + "strokeColor": "#495057", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_3w", + "roundness": null, + "seed": 20476722, + "version": 2, + "versionNonce": 652893497, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 11, + "fontFamily": 2, + "text": "similar builds", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "arrow_4p", + "originalText": "similar builds", + "lineHeight": 1.25, + "autoResize": false, + "index": "b1j" + }, + { + "id": "arrow_4r", + "type": "arrow", + "x": 2220, + "y": 307, + "width": 60, + "height": 283, + "angle": 0, + "strokeColor": "#343a40", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_3w", + "roundness": null, + "seed": 267005236, + "version": 2, + "versionNonce": 1499459287, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_4s" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + -60, + 283 + ] + ], + "lastCommittedPoint": null, + "startBinding": { + "mode": "orbit", + "elementId": "rectangle_45", + "fixedPoint": [ + 0, + 0.5001 + ] + }, + "endBinding": { + "mode": "orbit", + "elementId": "rectangle_4d", + "fixedPoint": [ + 0.8979771251932467, + 0.8979771251932473 + ] + }, + "startArrowhead": null, + "endArrowhead": "arrow", + "elbowed": false, + "index": "b1k" + }, + { + "id": "text_4s", + "type": "text", + "x": 2169, + "y": 440.5, + "width": 42, + "height": 16, + "angle": 0, + "strokeColor": "#495057", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_3w", + "roundness": null, + "seed": 2156310662, + "version": 2, + "versionNonce": 1610370585, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 11, + "fontFamily": 2, + "text": "lookups", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "arrow_4r", + "originalText": "lookups", + "lineHeight": 1.25, + "autoResize": false, + "index": "b1l" + }, + { + "id": "arrow_4t", + "type": "arrow", + "x": 2040, + "y": 440, + "width": 0, + "height": 50, + "angle": 0, + "strokeColor": "#343a40", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_3w", + "roundness": null, + "seed": 788191656, + "version": 2, + "versionNonce": 1732901879, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_4u" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + 0, + 50 + ] + ], + "lastCommittedPoint": null, + "startBinding": { + "mode": "orbit", + "elementId": "rectangle_43", + "fixedPoint": [ + 0.5001, + 0.5001 + ] + }, + "endBinding": { + "mode": "orbit", + "elementId": "rectangle_4b", + "fixedPoint": [ + 0.5001, + 0.5001 + ] + }, + "startArrowhead": null, + "endArrowhead": "arrow", + "elbowed": false, + "index": "b1m" + }, + { + "id": "text_4u", + "type": "text", + "x": 2007, + "y": 457, + "width": 66, + "height": 16, + "angle": 0, + "strokeColor": "#495057", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_3w", + "roundness": null, + "seed": 635582746, + "version": 2, + "versionNonce": 123544313, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 11, + "fontFamily": 2, + "text": "save / load", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "arrow_4t", + "originalText": "save / load", + "lineHeight": 1.25, + "autoResize": false, + "index": "b1n" + }, + { + "id": "arrow_4v", + "type": "arrow", + "x": 2340, + "y": 440, + "width": 0, + "height": 140, + "angle": 0, + "strokeColor": "#ced4da", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "dashed", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_3w", + "roundness": null, + "seed": 1776104284, + "version": 2, + "versionNonce": 45442327, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + 0, + 140 + ] + ], + "lastCommittedPoint": null, + "startBinding": { + "mode": "orbit", + "elementId": "rectangle_47", + "fixedPoint": [ + 0.5001, + 0.5001 + ] + }, + "endBinding": { + "mode": "orbit", + "elementId": "rectangle_4f", + "fixedPoint": [ + 0.5001, + 0.5001 + ] + }, + "startArrowhead": null, + "endArrowhead": "arrow", + "elbowed": false, + "index": "b1o" + }, + { + "id": "rectangle_4w", + "type": "rectangle", + "x": 1890, + "y": 730, + "width": 600, + "height": 300, + "angle": 0, + "strokeColor": "#495057", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_3w", + "roundness": { + "type": 3 + }, + "seed": 686563566, + "version": 2, + "versionNonce": 965762009, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "index": "b1p" + }, + { + "id": "text_4x", + "type": "text", + "x": 1906, + "y": 742, + "width": 568, + "height": 24, + "angle": 0, + "strokeColor": "#495057", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_3w", + "roundness": null, + "seed": 3172429392, + "version": 2, + "versionNonce": 722905655, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 17, + "fontFamily": 2, + "text": "Calc sidecar · Node (deployable unit)", + "textAlign": "left", + "verticalAlign": "top", + "containerId": null, + "originalText": "Calc sidecar · Node (deployable unit)", + "lineHeight": 1.25, + "autoResize": true, + "index": "b1q" + }, + { + "id": "rectangle_4y", + "type": "rectangle", + "x": 1920, + "y": 790, + "width": 240, + "height": 54, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "#ffd8a8", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_3w", + "roundness": { + "type": 3 + }, + "seed": 3639393282, + "version": 2, + "versionNonce": 917076153, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_4z" + }, + { + "type": "arrow", + "id": "arrow_58" + }, + { + "type": "arrow", + "id": "arrow_5f" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "index": "b1r" + }, + { + "id": "text_4z", + "type": "text", + "x": 1925, + "y": 799.5, + "width": 230, + "height": 35, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_3w", + "roundness": null, + "seed": 3717791364, + "version": 2, + "versionNonce": 2102545239, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 14, + "fontFamily": 2, + "text": "server.ts\nPOST /score", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "rectangle_4y", + "originalText": "server.ts\nPOST /score", + "lineHeight": 1.25, + "autoResize": false, + "index": "b1s" + }, + { + "id": "rectangle_50", + "type": "rectangle", + "x": 1920, + "y": 880, + "width": 240, + "height": 54, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "#ffd8a8", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_3w", + "roundness": { + "type": 3 + }, + "seed": 363306582, + "version": 2, + "versionNonce": 1884027289, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_51" + }, + { + "type": "arrow", + "id": "arrow_58" + }, + { + "type": "arrow", + "id": "arrow_59" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "index": "b1t" + }, + { + "id": "text_51", + "type": "text", + "x": 1925, + "y": 889.5, + "width": 230, + "height": 35, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_3w", + "roundness": null, + "seed": 749639672, + "version": 2, + "versionNonce": 96258167, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 14, + "fontFamily": 2, + "text": "ShimPool\n(SIDECAR_WORKERS)", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "rectangle_50", + "originalText": "ShimPool\n(SIDECAR_WORKERS)", + "lineHeight": 1.25, + "autoResize": false, + "index": "b1u" + }, + { + "id": "rectangle_52", + "type": "rectangle", + "x": 2220, + "y": 880, + "width": 240, + "height": 60, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "#ffec99", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_3w", + "roundness": { + "type": 3 + }, + "seed": 191863786, + "version": 2, + "versionNonce": 1470848633, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_53" + }, + { + "type": "arrow", + "id": "arrow_59" + }, + { + "type": "arrow", + "id": "arrow_5b" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "index": "b1v" + }, + { + "id": "text_53", + "type": "text", + "x": 2225, + "y": 892.5, + "width": 230, + "height": 35, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_3w", + "roundness": null, + "seed": 288763564, + "version": 2, + "versionNonce": 1377477015, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 14, + "fontFamily": 2, + "text": "Worker threads\nJSDOM + backend", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "rectangle_52", + "originalText": "Worker threads\nJSDOM + backend", + "lineHeight": 1.25, + "autoResize": false, + "index": "b1w" + }, + { + "id": "rectangle_54", + "type": "rectangle", + "x": 2220, + "y": 790, + "width": 240, + "height": 54, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "#ffec99", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_3w", + "roundness": { + "type": 3 + }, + "seed": 3329935550, + "version": 2, + "versionNonce": 1804281689, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_55" + }, + { + "type": "arrow", + "id": "arrow_5b" + }, + { + "type": "arrow", + "id": "arrow_5d" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "index": "b1x" + }, + { + "id": "text_55", + "type": "text", + "x": 2225, + "y": 799.5, + "width": 230, + "height": 35, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_3w", + "roundness": null, + "seed": 1779627680, + "version": 2, + "versionNonce": 1134581431, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 14, + "fontFamily": 2, + "text": "Backend registry\n(rocalc / stub)", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "rectangle_54", + "originalText": "Backend registry\n(rocalc / stub)", + "lineHeight": 1.25, + "autoResize": false, + "index": "b1y" + }, + { + "id": "rectangle_56", + "type": "rectangle", + "x": 2220, + "y": 960, + "width": 240, + "height": 44, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "#ffec99", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_3w", + "roundness": { + "type": 3 + }, + "seed": 1903589586, + "version": 2, + "versionNonce": 104780857, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_57" + }, + { + "type": "arrow", + "id": "arrow_5d" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "index": "b1z" + }, + { + "id": "text_57", + "type": "text", + "x": 2225, + "y": 973.25, + "width": 230, + "height": 17.5, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_3w", + "roundness": null, + "seed": 232874964, + "version": 2, + "versionNonce": 552757207, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 14, + "fontFamily": 2, + "text": "mapping.json", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "rectangle_56", + "originalText": "mapping.json", + "lineHeight": 1.25, + "autoResize": false, + "index": "b20" + }, + { + "id": "arrow_58", + "type": "arrow", + "x": 2040, + "y": 844, + "width": 0, + "height": 36, + "angle": 0, + "strokeColor": "#343a40", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_3w", + "roundness": null, + "seed": 1398489126, + "version": 2, + "versionNonce": 1806296345, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + 0, + 36 + ] + ], + "lastCommittedPoint": null, + "startBinding": { + "mode": "orbit", + "elementId": "rectangle_4y", + "fixedPoint": [ + 0.5001, + 0.5001 + ] + }, + "endBinding": { + "mode": "orbit", + "elementId": "rectangle_50", + "fixedPoint": [ + 0.5001, + 0.5001 + ] + }, + "startArrowhead": null, + "endArrowhead": "arrow", + "elbowed": false, + "index": "b21" + }, + { + "id": "arrow_59", + "type": "arrow", + "x": 2160, + "y": 907, + "width": 60, + "height": 0, + "angle": 0, + "strokeColor": "#343a40", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_3w", + "roundness": null, + "seed": 2347444808, + "version": 2, + "versionNonce": 1747277047, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_5a" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + 60, + 0 + ] + ], + "lastCommittedPoint": null, + "startBinding": { + "mode": "orbit", + "elementId": "rectangle_50", + "fixedPoint": [ + 0.5345426715757242, + 0.46545732842427395 + ] + }, + "endBinding": { + "mode": "orbit", + "elementId": "rectangle_52", + "fixedPoint": [ + 0.44994599927998896, + 0.44994599927999274 + ] + }, + "startArrowhead": null, + "endArrowhead": "arrow", + "elbowed": false, + "index": "b22" + }, + { + "id": "text_5a", + "type": "text", + "x": 2166, + "y": 899, + "width": 48, + "height": 16, + "angle": 0, + "strokeColor": "#495057", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_3w", + "roundness": null, + "seed": 3766547130, + "version": 2, + "versionNonce": 390060537, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 11, + "fontFamily": 2, + "text": "dispatch", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "arrow_59", + "originalText": "dispatch", + "lineHeight": 1.25, + "autoResize": false, + "index": "b23" + }, + { + "id": "arrow_5b", + "type": "arrow", + "x": 2340, + "y": 880, + "width": 0, + "height": 36, + "angle": 0, + "strokeColor": "#343a40", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_3w", + "roundness": null, + "seed": 2723888636, + "version": 2, + "versionNonce": 1623039511, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_5c" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + 0, + -36 + ] + ], + "lastCommittedPoint": null, + "startBinding": { + "mode": "orbit", + "elementId": "rectangle_52", + "fixedPoint": [ + 0.5001, + 0 + ] + }, + "endBinding": { + "mode": "orbit", + "elementId": "rectangle_54", + "fixedPoint": [ + 0.5001, + 1 + ] + }, + "startArrowhead": null, + "endArrowhead": "arrow", + "elbowed": false, + "index": "b24" + }, + { + "id": "text_5c", + "type": "text", + "x": 2310, + "y": 854, + "width": 60, + "height": 16, + "angle": 0, + "strokeColor": "#495057", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_3w", + "roundness": null, + "seed": 1928504462, + "version": 2, + "versionNonce": 1241789145, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 11, + "fontFamily": 2, + "text": "createShim", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "arrow_5b", + "originalText": "createShim", + "lineHeight": 1.25, + "autoResize": false, + "index": "b25" + }, + { + "id": "arrow_5d", + "type": "arrow", + "x": 2340, + "y": 844, + "width": 0, + "height": 116, + "angle": 0, + "strokeColor": "#343a40", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_3w", + "roundness": null, + "seed": 498193136, + "version": 2, + "versionNonce": 1840235319, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_5e" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + 0, + 116 + ] + ], + "lastCommittedPoint": null, + "startBinding": { + "mode": "orbit", + "elementId": "rectangle_54", + "fixedPoint": [ + 0.5001, + 0.5001 + ] + }, + "endBinding": { + "mode": "orbit", + "elementId": "rectangle_56", + "fixedPoint": [ + 0.5001, + 0.5001 + ] + }, + "startArrowhead": null, + "endArrowhead": "arrow", + "elbowed": false, + "index": "b26" + }, + { + "id": "text_5e", + "type": "text", + "x": 2304, + "y": 894, + "width": 72, + "height": 16, + "angle": 0, + "strokeColor": "#495057", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_3w", + "roundness": null, + "seed": 2114103714, + "version": 2, + "versionNonce": 1485467577, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 11, + "fontFamily": 2, + "text": "iRO ↔ rocalc", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "arrow_5d", + "originalText": "iRO ↔ rocalc", + "lineHeight": 1.25, + "autoResize": false, + "index": "b27" + }, + { + "id": "arrow_5f", + "type": "arrow", + "x": 2220, + "y": 507, + "width": 60, + "height": 293, + "angle": 0, + "strokeColor": "#1971c2", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "dashed", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_3w", + "roundness": { + "type": 2 + }, + "seed": 360209700, + "version": 2, + "versionNonce": 526402647, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_5g" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + -60, + 293 + ] + ], + "lastCommittedPoint": null, + "startBinding": { + "mode": "orbit", + "elementId": "rectangle_49", + "fixedPoint": [ + 0, + 0.5001 + ] + }, + "endBinding": { + "mode": "orbit", + "elementId": "rectangle_4y", + "fixedPoint": [ + 0.9010362818591015, + 0.9010362818591005 + ] + }, + "startArrowhead": null, + "endArrowhead": "arrow", + "elbowed": false, + "index": "b28" + }, + { + "id": "text_5g", + "type": "text", + "x": 2157, + "y": 645.5, + "width": 66, + "height": 16, + "angle": 0, + "strokeColor": "#495057", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_3w", + "roundness": null, + "seed": 1360958966, + "version": 2, + "versionNonce": 955650201, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 11, + "fontFamily": 2, + "text": "HTTP /score", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "arrow_5f", + "originalText": "HTTP /score", + "lineHeight": 1.25, + "autoResize": false, + "index": "b29" + }, + { + "id": "rectangle_5h", + "type": "rectangle", + "x": 2550, + "y": 380, + "width": 230, + "height": 64, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "#ffe3e3", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_3w", + "roundness": { + "type": 3 + }, + "seed": 3124072600, + "version": 2, + "versionNonce": 94609783, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_5i" + }, + { + "type": "arrow", + "id": "arrow_5j" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "index": "b2A" + }, + { + "id": "text_5i", + "type": "text", + "x": 2555, + "y": 385.75, + "width": 220, + "height": 52.5, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_3w", + "roundness": null, + "seed": 3185786250, + "version": 2, + "versionNonce": 1358599545, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 14, + "fontFamily": 2, + "text": "LLM API\n(Anthropic /\nOpenAI-compatible)", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "rectangle_5h", + "originalText": "LLM API\n(Anthropic /\nOpenAI-compatible)", + "lineHeight": 1.25, + "autoResize": false, + "index": "b2B" + }, + { + "id": "arrow_5j", + "type": "arrow", + "x": 2460, + "y": 410, + "width": 90, + "height": 0, + "angle": 0, + "strokeColor": "#343a40", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "dashed", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_3w", + "roundness": null, + "seed": 681664844, + "version": 2, + "versionNonce": 1102994071, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_5k" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + 90, + 0 + ] + ], + "lastCommittedPoint": null, + "startBinding": { + "mode": "orbit", + "elementId": "rectangle_47", + "fixedPoint": [ + 0.5188351390246188, + 0.48116486097538125 + ] + }, + "endBinding": { + "mode": "orbit", + "elementId": "rectangle_5h", + "fixedPoint": [ + 0.46870186886097975, + 0.4687018688609781 + ] + }, + "startArrowhead": null, + "endArrowhead": "arrow", + "elbowed": false, + "index": "b2C" + }, + { + "id": "text_5k", + "type": "text", + "x": 2490, + "y": 402, + "width": 30, + "height": 16, + "angle": 0, + "strokeColor": "#495057", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_3w", + "roundness": null, + "seed": 896578654, + "version": 2, + "versionNonce": 64716377, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 11, + "fontFamily": 2, + "text": "HTTPS", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "arrow_5j", + "originalText": "HTTPS", + "lineHeight": 1.25, + "autoResize": false, + "index": "b2D" + }, + { + "id": "rectangle_5l", + "type": "rectangle", + "x": 1920, + "y": 44, + "width": 300, + "height": 50, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "#e9ecef", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_3w", + "roundness": { + "type": 3 + }, + "seed": 4128834368, + "version": 2, + "versionNonce": 1483009975, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_5m" + }, + { + "type": "arrow", + "id": "arrow_5n" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "index": "b2E" + }, + { + "id": "text_5m", + "type": "text", + "x": 1925, + "y": 60.25, + "width": 290, + "height": 17.5, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_3w", + "roundness": null, + "seed": 821972594, + "version": 2, + "versionNonce": 7097145, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 14, + "fontFamily": 2, + "text": "Emulator db (Hercules / rAthena)", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "rectangle_5l", + "originalText": "Emulator db (Hercules / rAthena)", + "lineHeight": 1.25, + "autoResize": false, + "index": "b2F" + }, + { + "id": "arrow_5n", + "type": "arrow", + "x": 2070, + "y": 94, + "width": 0, + "height": 486, + "angle": 0, + "strokeColor": "#868e96", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "dashed", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_3w", + "roundness": { + "type": 2 + }, + "seed": 1783818868, + "version": 2, + "versionNonce": 1136386263, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "text_5o" + } + ], + "updated": 1780289515342, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + 0, + 486 + ] + ], + "lastCommittedPoint": null, + "startBinding": { + "mode": "orbit", + "elementId": "rectangle_5l", + "fixedPoint": [ + 0.5048223807889175, + 0.5048223807889175 + ] + }, + "endBinding": { + "mode": "orbit", + "elementId": "rectangle_4d", + "fixedPoint": [ + 0.6249950463635912, + 0.3750049536364128 + ] + }, + "startArrowhead": null, + "endArrowhead": "arrow", + "elbowed": false, + "index": "b2G" + }, + { + "id": "text_5o", + "type": "text", + "x": 1980, + "y": 329, + "width": 180, + "height": 16, + "angle": 0, + "strokeColor": "#495057", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_3w", + "roundness": null, + "seed": 4188970950, + "version": 2, + "versionNonce": 1326480409, + "isDeleted": false, + "boundElements": [], + "updated": 1780289515342, + "link": null, + "locked": false, + "fontSize": 11, + "fontFamily": 2, + "text": "cmd/build-catalog (build-time)", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "arrow_5n", + "originalText": "cmd/build-catalog (build-time)", + "lineHeight": 1.25, + "autoResize": false, + "index": "b2H" + }, + { + "id": "text_5p", + "type": "text", + "x": 2550, + "y": 490, + "width": 227.69230769230697, + "height": 30.833333333333222, + "angle": 0, + "strokeColor": "#495057", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": "frame_3w", + "roundness": null, + "seed": 2589117160, + "version": 201, + "versionNonce": 1486498297, + "isDeleted": true, + "boundElements": [], + "updated": 1780290157737, + "link": null, + "locked": false, + "fontSize": 12.333333333333293, + "fontFamily": 2, + "text": "Legend\n■ Go ■ data store ■ calc/Node ■ external", + "textAlign": "left", + "verticalAlign": "top", + "containerId": null, + "originalText": "Legend\n■ Go ■ data store ■ calc/Node ■ external", + "lineHeight": 1.25, + "autoResize": true, + "index": "b2I" + }, + { + "id": "vORFZUQJeVYwney0STtQ2", + "type": "text", + "x": 281.16666666666714, + "y": -33.99999999999943, + "width": 8, + "height": 25, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "index": "b2J", + "roundness": null, + "seed": 783076695, + "version": 3, + "versionNonce": 2015507001, + "isDeleted": true, + "boundElements": null, + "updated": 1780290104728, + "link": null, + "locked": false, + "text": "", + "fontSize": 20, + "fontFamily": 5, + "textAlign": "left", + "verticalAlign": "top", + "containerId": null, + "originalText": "", + "autoResize": true, + "lineHeight": 1.25 + } + ], + "appState": { + "gridSize": 20, + "gridStep": 5, + "gridModeEnabled": false, + "viewBackgroundColor": "#ffffff", + "lockedMultiSelections": {} + }, + "files": {} +} \ No newline at end of file diff --git a/go.mod b/go.mod index eacc4b7..375dbdf 100644 --- a/go.mod +++ b/go.mod @@ -11,44 +11,93 @@ require ( gopkg.in/yaml.v2 v2.4.0 ) -require modernc.org/sqlite v1.50.0 +require ( + github.com/getkin/kin-openapi v0.135.0 + github.com/golang-migrate/migrate/v4 v4.19.1 + github.com/jackc/pgx/v5 v5.10.0 + github.com/oapi-codegen/runtime v1.4.0 + github.com/testcontainers/testcontainers-go v0.43.0 + github.com/testcontainers/testcontainers-go/modules/postgres v0.43.0 +) require ( + dario.cat/mergo v1.0.2 // indirect + github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c // indirect + github.com/Microsoft/go-winio v0.6.2 // indirect github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect + github.com/cenkalti/backoff/v4 v4.3.0 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/containerd/errdefs v1.0.0 // indirect + github.com/containerd/errdefs/pkg v0.3.0 // indirect + github.com/containerd/log v0.1.0 // indirect + github.com/containerd/platforms v0.2.1 // indirect + github.com/cpuguy83/dockercfg v0.3.2 // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/distribution/reference v0.6.0 // indirect github.com/dlclark/regexp2 v1.12.0 // indirect + github.com/docker/go-connections v0.6.0 // indirect + github.com/docker/go-units v0.5.0 // indirect github.com/dprotaso/go-yit v0.0.0-20220510233725-9ba8df137936 // indirect - github.com/dustin/go-humanize v1.0.1 // indirect - github.com/getkin/kin-openapi v0.135.0 // indirect + github.com/ebitengine/purego v0.10.0 // indirect + github.com/felixge/httpsnoop v1.0.4 // indirect + github.com/go-logr/logr v1.4.3 // indirect + github.com/go-logr/stdr v1.2.2 // indirect + github.com/go-ole/go-ole v1.2.6 // indirect github.com/go-openapi/jsonpointer v0.22.4 // indirect github.com/go-openapi/swag/jsonname v0.25.4 // indirect github.com/go-sourcemap/sourcemap v2.1.4+incompatible // indirect github.com/google/pprof v0.0.0-20260402051712-545e8a4df936 // indirect github.com/google/uuid v1.6.0 // indirect + github.com/jackc/pgerrcode v0.0.0-20220416144525-469b46aa5efa // indirect + github.com/jackc/pgpassfile v1.0.0 // indirect + github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect + github.com/jackc/puddle/v2 v2.2.2 // indirect github.com/josharian/intern v1.0.0 // indirect + github.com/klauspost/compress v1.18.5 // indirect + github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect + github.com/magiconair/properties v1.8.10 // indirect github.com/mailru/easyjson v0.9.1 // indirect - github.com/mattn/go-isatty v0.0.20 // indirect + github.com/moby/docker-image-spec v1.3.1 // indirect + github.com/moby/go-archive v0.2.0 // indirect + github.com/moby/moby/api v1.54.2 // indirect + github.com/moby/moby/client v0.4.0 // indirect + github.com/moby/patternmatcher v0.6.1 // indirect + github.com/moby/sys/sequential v0.6.0 // indirect + github.com/moby/sys/user v0.4.0 // indirect + github.com/moby/sys/userns v0.1.0 // indirect + github.com/moby/term v0.5.2 // indirect github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect - github.com/ncruces/go-strftime v1.0.0 // indirect github.com/oapi-codegen/oapi-codegen/v2 v2.7.0 // indirect - github.com/oapi-codegen/runtime v1.4.0 // indirect github.com/oasdiff/yaml v0.0.9 // indirect github.com/oasdiff/yaml3 v0.0.9 // indirect + github.com/opencontainers/go-digest v1.0.0 // indirect + github.com/opencontainers/image-spec v1.1.1 // indirect github.com/perimeterx/marshmallow v1.1.5 // indirect - github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect + github.com/shirou/gopsutil/v4 v4.26.5 // indirect + github.com/sirupsen/logrus v1.9.4 // indirect github.com/speakeasy-api/jsonpath v0.6.3 // indirect github.com/speakeasy-api/openapi v1.19.2 // indirect + github.com/stretchr/testify v1.11.1 // indirect + github.com/tklauser/go-sysconf v0.3.16 // indirect + github.com/tklauser/numcpus v0.11.0 // indirect github.com/vmware-labs/yaml-jsonpath v0.3.2 // indirect github.com/woodsbury/decimal128 v1.4.0 // indirect + github.com/yusufpapurcu/wmi v1.2.4 // indirect + go.opentelemetry.io/auto/sdk v1.2.1 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0 // indirect + go.opentelemetry.io/otel v1.41.0 // indirect + go.opentelemetry.io/otel/metric v1.41.0 // indirect + go.opentelemetry.io/otel/trace v1.41.0 // indirect go.yaml.in/yaml/v3 v3.0.4 // indirect - golang.org/x/mod v0.34.0 // indirect + golang.org/x/crypto v0.51.0 // indirect + golang.org/x/mod v0.35.0 // indirect golang.org/x/sync v0.20.0 // indirect - golang.org/x/sys v0.42.0 // indirect - golang.org/x/text v0.36.0 // indirect - golang.org/x/tools v0.43.0 // indirect + golang.org/x/sys v0.45.0 // indirect + golang.org/x/text v0.37.0 // indirect + golang.org/x/tools v0.44.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - modernc.org/libc v1.72.0 // indirect - modernc.org/mathutil v1.7.1 // indirect - modernc.org/memory v1.11.0 // indirect ) tool github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen diff --git a/go.sum b/go.sum index c623bee..80d73ea 100644 --- a/go.sum +++ b/go.sum @@ -1,34 +1,88 @@ +dario.cat/mergo v1.0.2 h1:85+piFYR1tMbRrLcDwR18y4UKJ3aH1Tbzi24VRW1TK8= +dario.cat/mergo v1.0.2/go.mod h1:E/hbnu0NxMFBjpMIE34DRGLWqDy0g5FuKDhCb31ngxA= +github.com/AdaLogics/go-fuzz-headers v0.0.0-20240806141605-e8a1dd7889d6 h1:He8afgbRMd7mFxO99hRNu+6tazq8nFF9lIwo9JFroBk= +github.com/AdaLogics/go-fuzz-headers v0.0.0-20240806141605-e8a1dd7889d6/go.mod h1:8o94RPi1/7XTJvwPpRSzSUedZrtlirdB3r9Z20bi2f8= +github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c h1:udKWzYgxTojEKWjV8V+WSxDXJ4NFATAsZjh8iIbsQIg= +github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/Masterminds/semver/v3 v3.2.1 h1:RN9w6+7QoMeJVGyfmbcgs28Br8cvmnucEXnY0rYXWg0= github.com/Masterminds/semver/v3 v3.2.1/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= +github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= +github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/RaveNoX/go-jsoncommentstrip v1.0.0/go.mod h1:78ihd09MekBnJnxpICcwzCMzGrKSKYe4AqU6PDYYpjk= github.com/apapsch/go-jsonmerge/v2 v2.0.0 h1:axGnT1gRIfimI7gJifB699GoE/oq+F2MU7Dml6nw9rQ= github.com/apapsch/go-jsonmerge/v2 v2.0.0/go.mod h1:lvDnEdqiQrp0O42VQGgmlKpxL1AP2+08jFMw88y4klk= github.com/bmatcuk/doublestar v1.1.1/go.mod h1:UD6OnuiIn0yFxxA2le/rnRU1G4RaI4UvFv1sNto9p6w= +github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= +github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/containerd/errdefs v1.0.0 h1:tg5yIfIlQIrxYtu9ajqY42W3lpS19XqdxRQeEwYG8PI= +github.com/containerd/errdefs v1.0.0/go.mod h1:+YBYIdtsnF4Iw6nWZhJcqGSg/dwvV7tyJ/kCkyJ2k+M= +github.com/containerd/errdefs/pkg v0.3.0 h1:9IKJ06FvyNlexW690DXuQNx2KA2cUJXx151Xdx3ZPPE= +github.com/containerd/errdefs/pkg v0.3.0/go.mod h1:NJw6s9HwNuRhnjJhM7pylWwMyAkmCQvQ4GpJHEqRLVk= +github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= +github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo= +github.com/containerd/platforms v0.2.1 h1:zvwtM3rz2YHPQsF2CHYM8+KtB5dvhISiXh5ZpSBQv6A= +github.com/containerd/platforms v0.2.1/go.mod h1:XHCb+2/hzowdiut9rkudds9bE5yJ7npe7dG/wG+uFPw= +github.com/cpuguy83/dockercfg v0.3.2 h1:DlJTyZGBDlXqUZ2Dk2Q3xHs/FtnooJJVaad2S9GKorA= +github.com/cpuguy83/dockercfg v0.3.2/go.mod h1:sugsbF4//dDlL/i+S+rtpIWp+5h0BHJHfjj5/jFyUJc= +github.com/creack/pty v1.1.24 h1:bJrF4RRfyJnbTJqzRLHzcGaZK1NeM5kTC9jGgovnR1s= +github.com/creack/pty v1.1.24/go.mod h1:08sCNb52WyoAwi2QDyzUCTgcvVFhUzewun7wtTfvcwE= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dhui/dktest v0.4.6 h1:+DPKyScKSEp3VLtbMDHcUq6V5Lm5zfZZVb0Sk7Ahom4= +github.com/dhui/dktest v0.4.6/go.mod h1:JHTSYDtKkvFNFHJKqCzVzqXecyv+tKt8EzceOmQOgbU= +github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk= +github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= github.com/dlclark/regexp2 v1.12.0 h1:0j4c5qQmnC6XOWNjP3PIXURXN2gWx76rd3KvgdPkCz8= github.com/dlclark/regexp2 v1.12.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= +github.com/docker/docker v28.3.3+incompatible h1:Dypm25kh4rmk49v1eiVbsAtpAsYURjYkaKubwuBdxEI= +github.com/docker/docker v28.3.3+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/go-connections v0.6.0 h1:LlMG9azAe1TqfR7sO+NJttz1gy6KO7VJBh+pMmjSD94= +github.com/docker/go-connections v0.6.0/go.mod h1:AahvXYshr6JgfUJGdDCs2b5EZG/vmaMAntpSFH5BFKE= +github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= +github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/dop251/goja v0.0.0-20260311135729-065cd970411c h1:OcLmPfx1T1RmZVHHFwWMPaZDdRf0DBMZOFMVWJa7Pdk= github.com/dop251/goja v0.0.0-20260311135729-065cd970411c/go.mod h1:MxLav0peU43GgvwVgNbLAj1s/bSGboKkhuULvq/7hx4= github.com/dprotaso/go-yit v0.0.0-20191028211022-135eb7262960/go.mod h1:9HQzr9D/0PGwMEbC3d5AB7oi67+h4TsQqItC1GVYG58= github.com/dprotaso/go-yit v0.0.0-20220510233725-9ba8df137936 h1:PRxIJD8XjimM5aTknUK9w6DHLDox2r2M3DI4i2pnd3w= github.com/dprotaso/go-yit v0.0.0-20220510233725-9ba8df137936/go.mod h1:ttYvX5qlB+mlV1okblJqcSMtR4c52UKxDiX9GRBS8+Q= -github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= -github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= +github.com/ebitengine/purego v0.10.0 h1:QIw4xfpWT6GWTzaW5XEKy3HXoqrJGx1ijYHzTF0/ISU= +github.com/ebitengine/purego v0.10.0/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= +github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= +github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/getkin/kin-openapi v0.135.0 h1:751SjYfbiwqukYuVjwYEIKNfrSwS5YpA7DZnKSwQgtg= github.com/getkin/kin-openapi v0.135.0/go.mod h1:6dd5FJl6RdX4usBtFBaQhk9q62Yb2J0Mk5IhUO/QqFI= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= +github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= +github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-openapi/jsonpointer v0.22.4 h1:dZtK82WlNpVLDW2jlA1YCiVJFVqkED1MegOUy9kR5T4= github.com/go-openapi/jsonpointer v0.22.4/go.mod h1:elX9+UgznpFhgBuaMQ7iu4lvvX1nvNsesQ3oxmYTw80= github.com/go-openapi/swag/jsonname v0.25.4 h1:bZH0+MsS03MbnwBXYhuTttMOqk+5KcQ9869Vye1bNHI= github.com/go-openapi/swag/jsonname v0.25.4/go.mod h1:GPVEk9CWVhNvWhZgrnvRA6utbAltopbKwDu8mXNUMag= +github.com/go-openapi/testify/v2 v2.0.2 h1:X999g3jeLcoY8qctY/c/Z8iBHTbwLz7R2WXd6Ub6wls= +github.com/go-openapi/testify/v2 v2.0.2/go.mod h1:HCPmvFFnheKK2BuwSA0TbbdxJ3I16pjwMkYkP4Ywn54= github.com/go-sourcemap/sourcemap v2.1.4+incompatible h1:a+iTbH5auLKxaNwQFg0B+TCYl6lbukKPc7b5x0n1s6Q= github.com/go-sourcemap/sourcemap v2.1.4+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= +github.com/go-test/deep v1.0.8 h1:TDsG77qcSprGbC6vTN8OuXp5g+J+b5Pcguhf7Zt61VM= +github.com/go-test/deep v1.0.8/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/golang-migrate/migrate/v4 v4.19.1 h1:OCyb44lFuQfYXYLx1SCxPZQGU7mcaZ7gH9yH4jSFbBA= +github.com/golang-migrate/migrate/v4 v4.19.1/go.mod h1:CTcgfjxhaUtsLipnLoQRWCrjYXycRz/g5+RWDuYgPrE= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= @@ -42,30 +96,72 @@ github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20260402051712-545e8a4df936 h1:EwtI+Al+DeppwYX2oXJCETMO23COyaKGP6fHVpkpWpg= github.com/google/pprof v0.0.0-20260402051712-545e8a4df936/go.mod h1:MxpfABSjhmINe3F1It9d+8exIHFvUqtLIRCdOGNXqiI= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= -github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/jackc/pgerrcode v0.0.0-20220416144525-469b46aa5efa h1:s+4MhCQ6YrzisK6hFJUX53drDT4UsSW3DEhKn0ifuHw= +github.com/jackc/pgerrcode v0.0.0-20220416144525-469b46aa5efa/go.mod h1:a/s9Lp5W7n/DD0VrVoyJ00FbP2ytTPDVOivvn2bMlds= +github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= +github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= +github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 h1:iCEnooe7UlwOQYpKFhBabPMi4aNAfoODPEFNiAnClxo= +github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM= +github.com/jackc/pgx/v5 v5.10.0 h1:VhSvgU2jSli8o3AqIEOTJr7rZwAEUVo4E4XhR94Zfr0= +github.com/jackc/pgx/v5 v5.10.0/go.mod h1:mal1tBGAFfLHvZzaYh77YS/eC6IX9OWbRV1QIIM0Jn4= +github.com/jackc/puddle/v2 v2.2.2 h1:PR8nw+E/1w0GLuRFSmiioY6UooMp6KJv0/61nB7icHo= +github.com/jackc/puddle/v2 v2.2.2/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/juju/gnuflag v0.0.0-20171113085948-2ce1bb71843d/go.mod h1:2PavIy+JPciBPrBUjwbNvtwB6RQlve+hkpll6QSNmOE= +github.com/klauspost/compress v1.18.5 h1:/h1gH5Ce+VWNLSWqPzOVn6XBO+vJbCNGvjoaGBFW2IE= +github.com/klauspost/compress v1.18.5/go.mod h1:cwPg85FWrGar70rWktvGQj8/hthj3wpl0PGDogxkrSQ= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= +github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 h1:6E+4a0GO5zZEnZ81pIr0yLvtUWk2if982qA3F3QD6H4= +github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= +github.com/magiconair/properties v1.8.10 h1:s31yESBquKXCV9a/ScB3ESkOjUYYv+X0rg8SYxI99mE= +github.com/magiconair/properties v1.8.10/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= github.com/mailru/easyjson v0.9.1 h1:LbtsOm5WAswyWbvTEOqhypdPeZzHavpZx96/n553mR8= github.com/mailru/easyjson v0.9.1/go.mod h1:1+xMtQp2MRNVL/V1bOzuP3aP8VNwRW55fQUto+XFtTU= -github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= -github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mdelapenya/tlscert v0.2.0 h1:7H81W6Z/4weDvZBNOfQte5GpIMo0lGYEeWbkGp5LJHI= +github.com/mdelapenya/tlscert v0.2.0/go.mod h1:O4njj3ELLnJjGdkN7M/vIVCpZ+Cf0L6muqOG4tLSl8o= +github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0= +github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo= +github.com/moby/go-archive v0.2.0 h1:zg5QDUM2mi0JIM9fdQZWC7U8+2ZfixfTYoHL7rWUcP8= +github.com/moby/go-archive v0.2.0/go.mod h1:mNeivT14o8xU+5q1YnNrkQVpK+dnNe/K6fHqnTg4qPU= +github.com/moby/moby/api v1.54.2 h1:wiat9QAhnDQjA7wk1kh/TqHz2I1uUA7M7t9SAl/JNXg= +github.com/moby/moby/api v1.54.2/go.mod h1:+RQ6wluLwtYaTd1WnPLykIDPekkuyD/ROWQClE83pzs= +github.com/moby/moby/client v0.4.0 h1:S+2XegzHQrrvTCvF6s5HFzcrywWQmuVnhOXe2kiWjIw= +github.com/moby/moby/client v0.4.0/go.mod h1:QWPbvWchQbxBNdaLSpoKpCdf5E+WxFAgNHogCWDoa7g= +github.com/moby/patternmatcher v0.6.1 h1:qlhtafmr6kgMIJjKJMDmMWq7WLkKIo23hsrpR3x084U= +github.com/moby/patternmatcher v0.6.1/go.mod h1:hDPoyOpDY7OrrMDLaYoY3hf52gNCR/YOUYxkhApJIxc= +github.com/moby/sys/sequential v0.6.0 h1:qrx7XFUd/5DxtqcoH1h438hF5TmOvzC/lspjy7zgvCU= +github.com/moby/sys/sequential v0.6.0/go.mod h1:uyv8EUTrca5PnDsdMGXhZe6CCe8U/UiTWd+lL+7b/Ko= +github.com/moby/sys/user v0.4.0 h1:jhcMKit7SA80hivmFJcbB1vqmw//wU61Zdui2eQXuMs= +github.com/moby/sys/user v0.4.0/go.mod h1:bG+tYYYJgaMtRKgEmuueC0hJEAZWwtIbZTB+85uoHjs= +github.com/moby/sys/userns v0.1.0 h1:tVLXkFOxVu9A64/yh59slHVv9ahO9UIev4JZusOLG/g= +github.com/moby/sys/userns v0.1.0/go.mod h1:IHUYgu/kao6N8YZlp9Cf444ySSvCmDlmzUcYfDHOl28= +github.com/moby/term v0.5.2 h1:6qk3FJAFDs6i/q3W/pQ97SX192qKfZgGjCQqfCJkgzQ= +github.com/moby/term v0.5.2/go.mod h1:d3djjFCrjnB+fl8NJux+EJzu0msscUP+f8it8hPkFLc= github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw= github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= -github.com/ncruces/go-strftime v1.0.0 h1:HMFp8mLCTPp341M/ZnA4qaf7ZlsbTc+miZjCLOFAw7w= -github.com/ncruces/go-strftime v1.0.0/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJmn9CehxcKcls= +github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= +github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/oapi-codegen/oapi-codegen/v2 v2.7.0 h1:/8daqIYZfwnsHEAZdHUu9m0D5LA+5DoJCP7zLlT5Cs0= github.com/oapi-codegen/oapi-codegen/v2 v2.7.0/go.mod h1:qzFy6iuobJw/hD1aRILee4G87/ShmhR0xYCwcUtZMCw= @@ -78,41 +174,91 @@ github.com/oasdiff/yaml3 v0.0.9/go.mod h1:y5+oSEHCPT/DGrS++Wc/479ERge0zTFxaF8PbG github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.10.2/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= +github.com/onsi/gomega v1.19.0 h1:4ieX6qQjPP/BfC3mpsAtIGGlxTWPeA3Inl/7DtXw1tw= github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= +github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= +github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= +github.com/opencontainers/image-spec v1.1.1 h1:y0fUlFfIZhPF1W537XOLg0/fcx6zcHCJwooC2xJA040= +github.com/opencontainers/image-spec v1.1.1/go.mod h1:qpqAh3Dmcf36wStyyWU+kCeDgrGnAve2nCC8+7h8Q0M= github.com/perimeterx/marshmallow v1.1.5 h1:a2LALqQ1BlHM8PZblsDdidgv1mWi1DgC2UmX50IvK2s= github.com/perimeterx/marshmallow v1.1.5/go.mod h1:dsXbUu8CRzfYP5a87xpp0xq9S3u0Vchtcl8we9tYaXw= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE= -github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt9k/+g42oCprj/FisM4qX9L3sZB3upGN2ZU= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= +github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= +github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= +github.com/shirou/gopsutil/v4 v4.26.5 h1:RPcBXkpz7kOj9PqGFQOlBPZHsyaPvPVQc098y9RmCNM= +github.com/shirou/gopsutil/v4 v4.26.5/go.mod h1:LZ6ewCSkBqUpvSOf+LsTGnRinC6iaNUNMGBtDkJBaLQ= +github.com/sirupsen/logrus v1.9.4 h1:TsZE7l11zFCLZnZ+teH4Umoq5BhEIfIzfRDZ1Uzql2w= +github.com/sirupsen/logrus v1.9.4/go.mod h1:ftWc9WdOfJ0a92nsE2jF5u5ZwH8Bv2zdeOC42RjbV2g= github.com/speakeasy-api/jsonpath v0.6.3 h1:c+QPwzAOdrWvzycuc9HFsIZcxKIaWcNpC+xhOW9rJxU= github.com/speakeasy-api/jsonpath v0.6.3/go.mod h1:2cXloNuQ+RSXi5HTRaeBh7JEmjRXTiaKpFTdZiL7URI= github.com/speakeasy-api/openapi v1.19.2 h1:md90tE71/M8jS3cuRlsuWP5Aed4xoG5PSRvXeZgCv/M= github.com/speakeasy-api/openapi v1.19.2/go.mod h1:UfKa7FqE4jgexJZuj51MmdHAFGmDv0Zaw3+yOd81YKU= github.com/spkg/bom v0.0.0-20160624110644-59b7046e48ad/go.mod h1:qLr4V1qq6nMqFKkMo8ZTx3f+BZEkzsRUY10Xsm2mwU0= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.5.3 h1:jmXUvGomnU1o3W/V5h2VEradbpJDwGrzugQQvL0POH4= +github.com/stretchr/objx v0.5.3/go.mod h1:rDQraq+vQZU7Fde9LOZLr8Tax6zZvy4kuNKF+QYS+U0= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= +github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= +github.com/testcontainers/testcontainers-go v0.43.0 h1:oEQx5MW2DGd9z3AeEQfB2lPM0eLs7ztyaGRu75bFo5A= +github.com/testcontainers/testcontainers-go v0.43.0/go.mod h1:+VxkT2NQnKOZPKi6praMuMKYHYyOGXr0XSBSlSMCzFo= +github.com/testcontainers/testcontainers-go/modules/postgres v0.43.0 h1:ShNOFYAF4lKHvdIG258hi69bSxC88uXnxJkJvNs/IVs= +github.com/testcontainers/testcontainers-go/modules/postgres v0.43.0/go.mod h1:vdq5/RqmGfWeefzyfcVI/pID1rzmc1TDvqXa15bPJks= +github.com/tklauser/go-sysconf v0.3.16 h1:frioLaCQSsF5Cy1jgRBrzr6t502KIIwQ0MArYICU0nA= +github.com/tklauser/go-sysconf v0.3.16/go.mod h1:/qNL9xxDhc7tx3HSRsLWNnuzbVfh3e7gh/BmM179nYI= +github.com/tklauser/numcpus v0.11.0 h1:nSTwhKH5e1dMNsCdVBukSZrURJRoHbSEQjdEbY+9RXw= +github.com/tklauser/numcpus v0.11.0/go.mod h1:z+LwcLq54uWZTX0u/bGobaV34u6V7KNlTZejzM6/3MQ= +github.com/ugorji/go/codec v1.2.12 h1:9LC83zGrHhuUA9l16C9AHXAqEV/2wBQ4nkvumAE65EE= +github.com/ugorji/go/codec v1.2.12/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= github.com/vmware-labs/yaml-jsonpath v0.3.2 h1:/5QKeCBGdsInyDCyVNLbXyilb61MXGi9NP674f9Hobk= github.com/vmware-labs/yaml-jsonpath v0.3.2/go.mod h1:U6whw1z03QyqgWdgXxvVnQ90zN1BWz5V+51Ewf8k+rQ= github.com/woodsbury/decimal128 v1.4.0 h1:xJATj7lLu4f2oObouMt2tgGiElE5gO6mSWUjQsBgUlc= github.com/woodsbury/decimal128 v1.4.0/go.mod h1:BP46FUrVjVhdTbKT+XuQh2xfQaGki9LMIRJSFuh6THU= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0= +github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= +go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64= +go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0 h1:F7Jx+6hwnZ41NSFTO5q4LYDtJRXBf2PD0rNBkeB/lus= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0/go.mod h1:UHB22Z8QsdRDrnAtX4PntOl36ajSxcdUMt1sF7Y6E7Q= +go.opentelemetry.io/otel v1.41.0 h1:YlEwVsGAlCvczDILpUXpIpPSL/VPugt7zHThEMLce1c= +go.opentelemetry.io/otel v1.41.0/go.mod h1:Yt4UwgEKeT05QbLwbyHXEwhnjxNO6D8L5PQP51/46dE= +go.opentelemetry.io/otel/metric v1.41.0 h1:rFnDcs4gRzBcsO9tS8LCpgR0dxg4aaxWlJxCno7JlTQ= +go.opentelemetry.io/otel/metric v1.41.0/go.mod h1:xPvCwd9pU0VN8tPZYzDZV/BMj9CM9vs00GuBjeKhJps= +go.opentelemetry.io/otel/sdk v1.36.0 h1:b6SYIuLRs88ztox4EyrvRti80uXIFy+Sqzoh9kFULbs= +go.opentelemetry.io/otel/sdk v1.36.0/go.mod h1:+lC+mTgD+MUWfjJubi2vvXWcVxyr9rmlshZni72pXeY= +go.opentelemetry.io/otel/sdk/metric v1.36.0 h1:r0ntwwGosWGaa0CrSt8cuNuTcccMXERFwHX4dThiPis= +go.opentelemetry.io/otel/sdk/metric v1.36.0/go.mod h1:qTNOhFDfKRwX0yXOqJYegL5WRaW376QbB7P4Pb0qva4= +go.opentelemetry.io/otel/trace v1.41.0 h1:Vbk2co6bhj8L59ZJ6/xFTskY+tGAbOnCtQGVVa9TIN0= +go.opentelemetry.io/otel/trace v1.41.0/go.mod h1:U1NU4ULCoxeDKc09yCWdWe+3QoyweJcISEVa1RBzOis= go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc= go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.51.0 h1:IBPXwPfKxY7cWQZ38ZCIRPI50YLeevDLlLnyC5wRGTI= +golang.org/x/crypto v0.51.0/go.mod h1:8AdwkbraGNABw2kOX6YFPs3WM22XqI4EXEd8g+x7Oc8= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.34.0 h1:xIHgNUUnW6sYkcM5Jleh05DvLOtwc6RitGHbDk4akRI= -golang.org/x/mod v0.34.0/go.mod h1:ykgH52iCZe79kzLLMhyCUzhMci+nQj+0XkbXpNYtVjY= +golang.org/x/mod v0.35.0 h1:Ww1D637e6Pg+Zb2KrWfHQUnH2dQRLBQyAtpr/haaJeM= +golang.org/x/mod v0.35.0/go.mod h1:+GwiRhIInF8wPm+4AoT6L0FA1QWAad3OMdTRx4tFYlU= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -120,6 +266,8 @@ golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.53.0 h1:d+qAbo5L0orcWAr0a9JweQpjXF19LMXJE8Ey7hwOdUA= +golang.org/x/net v0.53.0/go.mod h1:JvMuJH7rrdiCfbeHoo3fCQU24Lf5JJwT9W3sJFulfgs= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -129,32 +277,36 @@ golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.42.0 h1:omrd2nAlyT5ESRdCLYdm3+fMfNFE/+Rf4bDIQImRJeo= -golang.org/x/sys v0.42.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= +golang.org/x/sys v0.45.0 h1:dO4czNzziLiiXplLQgBCEpCvXQ3dnkn0SdaZSYdQ+FY= +golang.org/x/sys v0.45.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.43.0 h1:S4RLU2sB31O/NCl+zFN9Aru9A/Cq2aqKpTZJ6B+DwT4= +golang.org/x/term v0.43.0/go.mod h1:lrhlHNdQJHO+1qVYiHfFKVuVioJIheAc3fBSMFYEIsk= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.36.0 h1:JfKh3XmcRPqZPKevfXVpI1wXPTqbkE5f7JA92a55Yxg= -golang.org/x/text v0.36.0/go.mod h1:NIdBknypM8iqVmPiuco0Dh6P5Jcdk8lJL0CUebqK164= +golang.org/x/text v0.37.0 h1:Cqjiwd9eSg8e0QAkyCaQTNHFIIzWtidPahFWR83rTrc= +golang.org/x/text v0.37.0/go.mod h1:a5sjxXGs9hsn/AJVwuElvCAo9v8QYLzvavO5z2PiM38= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.43.0 h1:12BdW9CeB3Z+J/I/wj34VMl8X+fEXBxVR90JeMX5E7s= -golang.org/x/tools v0.43.0/go.mod h1:uHkMso649BX2cZK6+RpuIPXS3ho2hZo4FVwfoy1vIk0= +golang.org/x/tools v0.44.0 h1:UP4ajHPIcuMjT1GqzDWRlalUEoY+uzoZKnhOjbIPD2c= +golang.org/x/tools v0.44.0/go.mod h1:KA0AfVErSdxRZIsOVipbv3rQhVXTnlU6UhKxHd1seDI= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -167,10 +319,12 @@ google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzi google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -182,31 +336,7 @@ gopkg.in/yaml.v3 v3.0.0-20191026110619-0b21df46bc1d/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -modernc.org/cc/v4 v4.27.3 h1:uNCgn37E5U09mTv1XgskEVUJ8ADKpmFMPxzGJ0TSo+U= -modernc.org/cc/v4 v4.27.3/go.mod h1:3YjcbCqhoTTHPycJDRl2WZKKFj0nwcOIPBfEZK0Hdk8= -modernc.org/ccgo/v4 v4.32.4 h1:L5OB8rpEX4ZsXEQwGozRfJyJSFHbbNVOoQ59DU9/KuU= -modernc.org/ccgo/v4 v4.32.4/go.mod h1:lY7f+fiTDHfcv6YlRgSkxYfhs+UvOEEzj49jAn2TOx0= -modernc.org/fileutil v1.4.0 h1:j6ZzNTftVS054gi281TyLjHPp6CPHr2KCxEXjEbD6SM= -modernc.org/fileutil v1.4.0/go.mod h1:EqdKFDxiByqxLk8ozOxObDSfcVOv/54xDs/DUHdvCUU= -modernc.org/gc/v2 v2.6.5 h1:nyqdV8q46KvTpZlsw66kWqwXRHdjIlJOhG6kxiV/9xI= -modernc.org/gc/v2 v2.6.5/go.mod h1:YgIahr1ypgfe7chRuJi2gD7DBQiKSLMPgBQe9oIiito= -modernc.org/gc/v3 v3.1.2 h1:ZtDCnhonXSZexk/AYsegNRV1lJGgaNZJuKjJSWKyEqo= -modernc.org/gc/v3 v3.1.2/go.mod h1:HFK/6AGESC7Ex+EZJhJ2Gni6cTaYpSMmU/cT9RmlfYY= -modernc.org/goabi0 v0.2.0 h1:HvEowk7LxcPd0eq6mVOAEMai46V+i7Jrj13t4AzuNks= -modernc.org/goabi0 v0.2.0/go.mod h1:CEFRnnJhKvWT1c1JTI3Avm+tgOWbkOu5oPA8eH8LnMI= -modernc.org/libc v1.72.0 h1:IEu559v9a0XWjw0DPoVKtXpO2qt5NVLAnFaBbjq+n8c= -modernc.org/libc v1.72.0/go.mod h1:tTU8DL8A+XLVkEY3x5E/tO7s2Q/q42EtnNWda/L5QhQ= -modernc.org/mathutil v1.7.1 h1:GCZVGXdaN8gTqB1Mf/usp1Y/hSqgI2vAGGP4jZMCxOU= -modernc.org/mathutil v1.7.1/go.mod h1:4p5IwJITfppl0G4sUEDtCr4DthTaT47/N3aT6MhfgJg= -modernc.org/memory v1.11.0 h1:o4QC8aMQzmcwCK3t3Ux/ZHmwFPzE6hf2Y5LbkRs+hbI= -modernc.org/memory v1.11.0/go.mod h1:/JP4VbVC+K5sU2wZi9bHoq2MAkCnrt2r98UGeSK7Mjw= -modernc.org/opt v0.1.4 h1:2kNGMRiUjrp4LcaPuLY2PzUfqM/w9N23quVwhKt5Qm8= -modernc.org/opt v0.1.4/go.mod h1:03fq9lsNfvkYSfxrfUhZCWPk1lm4cq4N+Bh//bEtgns= -modernc.org/sortutil v1.2.1 h1:+xyoGf15mM3NMlPDnFqrteY07klSFxLElE2PVuWIJ7w= -modernc.org/sortutil v1.2.1/go.mod h1:7ZI3a3REbai7gzCLcotuw9AC4VZVpYMjDzETGsSMqJE= -modernc.org/sqlite v1.50.0 h1:eMowQSWLK0MeiQTdmz3lqoF5dqclujdlIKeJA11+7oM= -modernc.org/sqlite v1.50.0/go.mod h1:m0w8xhwYUVY3H6pSDwc3gkJ/irZT/0YEXwBlhaxQEew= -modernc.org/strutil v1.2.1 h1:UneZBkQA+DX2Rp35KcM69cSsNES9ly8mQWD71HKlOA0= -modernc.org/strutil v1.2.1/go.mod h1:EHkiggD70koQxjVdSBM3JKM7k6L0FbGE5eymy9i3B9A= -modernc.org/token v1.1.0 h1:Xl7Ap9dKaEs5kLoOQeQmPWevfnk/DM5qcLcYlA8ys6Y= -modernc.org/token v1.1.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= +gotest.tools/v3 v3.5.2 h1:7koQfIKdy+I8UTetycgUqXWSDwpgv193Ka+qRsmBY8Q= +gotest.tools/v3 v3.5.2/go.mod h1:LtdLGcnqToBH83WByAAi/wiwSFCArdFIUV/xxN4pcjA= +pgregory.net/rapid v1.2.0 h1:keKAYRcjm+e1F0oAuU5F5+YPAWcyxNNRK2wud503Gnk= +pgregory.net/rapid v1.2.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= diff --git a/internal/api/builds_test.go b/internal/api/builds_test.go index f846eca..4bcff43 100644 --- a/internal/api/builds_test.go +++ b/internal/api/builds_test.go @@ -7,9 +7,9 @@ import ( "io" "net/http" "net/http/httptest" - "path/filepath" "strings" "testing" + "time" "github.com/levonn-dev/ro-builder/internal/buildlibrary" "github.com/levonn-dev/ro-builder/internal/catalog" @@ -19,11 +19,17 @@ import ( func openTempLibrary(t *testing.T) *buildlibrary.Library { t.Helper() - lib, err := buildlibrary.Open(filepath.Join(t.TempDir(), "test.db")) + if testing.Short() { + t.Skip("requires Postgres (testcontainers); skipped under -short") + } + lib, err := buildlibrary.Open(context.Background(), testDSN) if err != nil { t.Fatalf("buildlibrary.Open: %v", err) } t.Cleanup(func() { _ = lib.Close() }) + if err := lib.Truncate(context.Background()); err != nil { + t.Fatalf("truncate: %v", err) + } return lib } @@ -53,7 +59,9 @@ func buildsServer(t *testing.T, lib *buildlibrary.Library, cat *catalog.Catalog) // seedSavedBuild inserts a small TK trajectory referencing real catalog // item / card / skill ids so the enrichment has something to resolve. // Returns the saved id. Snapshot carries a passing gate so the library's -// save guard accepts it. +// save guard accepts it. Uses Enqueue + ClaimNext + SaveAndComplete so +// the generation row ends up in status=completed, matching what a real +// worker produces. func seedSavedBuild(t *testing.T, lib *buildlibrary.Library) string { t.Helper() ctx := context.Background() @@ -61,11 +69,16 @@ func seedSavedBuild(t *testing.T, lib *buildlibrary.Library) string { if err != nil { t.Fatalf("Enqueue: %v", err) } - if err := lib.MarkCompleted(ctx, id); err != nil { - t.Fatalf("MarkCompleted: %v", err) + // Claim the job so SaveAndComplete can mark it completed. + // SaveAndComplete requires status='running' and a matching lease_owner. + const testOwner = "test-worker" + gen, err := lib.ClaimNext(ctx, testOwner, 30*time.Second) + if err != nil || gen == nil { + t.Fatalf("ClaimNext: gen=%v err=%v", gen, err) } in := buildlibrary.SaveInput{ ID: id, + Owner: testOwner, Class: "taekwon_kid", Server: "uaro", Playstyle: "pvm", @@ -100,8 +113,8 @@ func seedSavedBuild(t *testing.T, lib *buildlibrary.Library) string { }, FinalText: "test build", } - if _, err := lib.Save(ctx, in); err != nil { - t.Fatalf("Save: %v", err) + if _, err := lib.SaveAndComplete(ctx, in); err != nil { + t.Fatalf("SaveAndComplete: %v", err) } return id } @@ -319,9 +332,6 @@ func TestListBuilds_FiltersByClass(t *testing.T) { if err != nil { t.Fatalf("Enqueue novice: %v", err) } - if err := lib.MarkCompleted(context.Background(), noviceID); err != nil { - t.Fatalf("MarkCompleted novice: %v", err) - } other := buildlibrary.SaveInput{ ID: noviceID, Class: "novice", diff --git a/internal/api/generate_test.go b/internal/api/generate_test.go index 346f99a..852efa5 100644 --- a/internal/api/generate_test.go +++ b/internal/api/generate_test.go @@ -8,6 +8,7 @@ import ( "net/http/httptest" "strings" "testing" + "time" "github.com/levonn-dev/ro-builder/internal/buildlibrary" "github.com/levonn-dev/ro-builder/internal/scoring" @@ -155,7 +156,11 @@ func TestGenerationStatus_ReturnsCompletedWithBuildID(t *testing.T) { if err != nil { t.Fatalf("Enqueue: %v", err) } - if err := lib.MarkCompleted(ctx, id); err != nil { + g, err := lib.ClaimNext(ctx, "test-worker", 90*time.Second) + if err != nil || g == nil { + t.Fatalf("ClaimNext: %v (g=%v)", err, g) + } + if err := lib.MarkCompleted(ctx, id, "test-worker"); err != nil { t.Fatalf("MarkCompleted: %v", err) } srv := newTestServer(t).WithLibrary(lib) @@ -190,7 +195,11 @@ func TestGenerationStatus_ReturnsFailedWithGenericError(t *testing.T) { if err != nil { t.Fatalf("Enqueue: %v", err) } - if err := lib.MarkFailed(ctx, id, buildlibrary.FailureMaxItersExhausted, "60 iters", nil); err != nil { + gf, err := lib.ClaimNext(ctx, "test-worker", 90*time.Second) + if err != nil || gf == nil { + t.Fatalf("ClaimNext: %v (g=%v)", err, gf) + } + if err := lib.MarkFailed(ctx, id, "test-worker", buildlibrary.FailureMaxItersExhausted, "60 iters", nil); err != nil { t.Fatalf("MarkFailed: %v", err) } srv := newTestServer(t).WithLibrary(lib) diff --git a/internal/api/maintest_test.go b/internal/api/maintest_test.go new file mode 100644 index 0000000..791d9fb --- /dev/null +++ b/internal/api/maintest_test.go @@ -0,0 +1,47 @@ +package api + +import ( + "context" + "flag" + "fmt" + "os" + "testing" + "time" + + "github.com/testcontainers/testcontainers-go" + "github.com/testcontainers/testcontainers-go/modules/postgres" + "github.com/testcontainers/testcontainers-go/wait" +) + +// testDSN points at the shared package-level Postgres container. Empty +// under -short (no container started). +var testDSN string + +func TestMain(m *testing.M) { + flag.Parse() + if testing.Short() { + os.Exit(m.Run()) + } + ctx := context.Background() + ctr, err := postgres.Run(ctx, "pgvector/pgvector:pg17", + postgres.WithDatabase("robuilder_test"), + postgres.WithUsername("test"), + postgres.WithPassword("test"), + testcontainers.WithWaitStrategy( + wait.ForLog("database system is ready to accept connections"). + WithOccurrence(2).WithStartupTimeout(60*time.Second)), + ) + if err != nil { + fmt.Fprintln(os.Stderr, "testcontainers postgres start:", err) + os.Exit(1) + } + dsn, err := ctr.ConnectionString(ctx, "sslmode=disable") + if err != nil { + fmt.Fprintln(os.Stderr, "connection string:", err) + os.Exit(1) + } + testDSN = dsn + code := m.Run() + _ = ctr.Terminate(ctx) + os.Exit(code) +} diff --git a/internal/api/server.go b/internal/api/server.go index 2e37542..f0f3ea7 100644 --- a/internal/api/server.go +++ b/internal/api/server.go @@ -31,7 +31,7 @@ import ( // genericInternalError is the user-facing string returned in 500 responses // from library-backed endpoints. The actual error is logged server-side via // slog with the handler name and request id so operators can correlate, but -// the wire response carries no SQLite paths, schema names, or constraint +// the wire response carries no database connection strings, schema names, or constraint // details. Pair every use with a slog.Error call that captures the same // request context. const genericInternalError = "internal server error" @@ -63,7 +63,7 @@ const userFacingGenerationFailure = "We couldn't generate a build matching your // and /generations endpoints return "not configured" 500s without a // Library. main.go constructs the Enqueuer only when LLM_API_KEY is // set; without it /generate returns 503 while /score remains available. -// BUILDLIBRARY_PATH is required at startup, so the Library is always +// DATABASE_URL is required at startup, so the Library is always // present in normal runs. type Server struct { scoring *scoring.Client diff --git a/internal/buildlibrary/find.go b/internal/buildlibrary/find.go index 91e6580..972a523 100644 --- a/internal/buildlibrary/find.go +++ b/internal/buildlibrary/find.go @@ -8,10 +8,7 @@ import ( "fmt" ) -// FindParams narrows a Find call. Empty / zero fields are ignored -// (Class="" returns trajectories across all classes). Limit defaults to -// 5 if zero, capped at 50; the LLM should not need a hundred reference -// points for a single decision. +// FindParams narrows a Find call. type FindParams struct { Class string Server string @@ -23,10 +20,7 @@ const ( maxFindLimit = 50 ) -// Find returns the most recent saved trajectories matching the params, -// as lightweight summaries. The full trajectory JSON is loadable -// separately via Get(id); keeps the LLM's context window from filling -// with stale build details when only a quick scan is needed. +// Find returns the most recent saved trajectories matching the params. func (l *Library) Find(ctx context.Context, p FindParams) ([]Summary, error) { if l == nil || l.db == nil { return nil, errors.New("buildlibrary.Find: nil library") @@ -45,15 +39,19 @@ FROM saved_trajectories WHERE 1=1 ` args := []any{} + n := 0 if p.Class != "" { - q += " AND class = ?" + n++ + q += fmt.Sprintf(" AND class = $%d", n) args = append(args, p.Class) } if p.Server != "" { - q += " AND server = ?" + n++ + q += fmt.Sprintf(" AND server = $%d", n) args = append(args, p.Server) } - q += " ORDER BY created_at DESC LIMIT ?" + n++ + q += fmt.Sprintf(" ORDER BY created_at DESC LIMIT $%d", n) args = append(args, limit) rows, err := l.db.QueryContext(ctx, q, args...) @@ -82,8 +80,7 @@ WHERE 1=1 return out, nil } -// Get loads a full SavedTrajectory by id, including the marshaled -// Primary and Alternatives. ErrNotFound when no row matches. +// Get loads a full SavedTrajectory by id. func (l *Library) Get(ctx context.Context, id string) (*SavedTrajectory, error) { if l == nil || l.db == nil { return nil, errors.New("buildlibrary.Get: nil library") @@ -92,7 +89,7 @@ func (l *Library) Get(ctx context.Context, id string) (*SavedTrajectory, error) SELECT id, created_at, class, server, playstyle, mode, description, primary_json, alternatives_json, final_text, gate_summary, calc_version, catalog_version -FROM saved_trajectories WHERE id = ? +FROM saved_trajectories WHERE id = $1 ` var ( st SavedTrajectory @@ -126,12 +123,10 @@ FROM saved_trajectories WHERE id = ? return &st, nil } -// ErrNotFound is returned by Get when no trajectory with the given id -// exists. Callers can errors.Is against it. +// ErrNotFound is returned by Get when no trajectory with the given id exists. var ErrNotFound = errors.New("buildlibrary: trajectory not found") -// Count returns the total number of saved trajectories. Useful for -// startup logs ("library has 142 entries") and tests. +// Count returns the total number of saved trajectories. func (l *Library) Count(ctx context.Context) (int, error) { if l == nil || l.db == nil { return 0, errors.New("buildlibrary.Count: nil library") diff --git a/internal/buildlibrary/generations.go b/internal/buildlibrary/generations.go index c6ba9e7..1e23885 100644 --- a/internal/buildlibrary/generations.go +++ b/internal/buildlibrary/generations.go @@ -35,18 +35,15 @@ const ( FailureValidationLate FailureReason = "validation_error_late" FailureInterruptedRestart FailureReason = "interrupted_on_restart" FailureShutdownInterrupt FailureReason = "shutdown_interrupted" + FailureLeaseExpired FailureReason = "lease_expired" ) -// Generation is the typed projection of one row in the generations -// table. Times are nil-able where the schema is. -// -// For nullable string-ish columns (failure_reason, error_detail), an -// empty value means NULL in the DB. The FailureReason enum's -// constants are all non-empty, so callers can use `g.FailureReason -// == ""` to detect "not yet set." Same convention for ErrorDetail. -// TraceJSON uses a nil slice instead of an empty slice; for -// downstream JSON encoders both produce a null, so nil is the canonical -// "not set" representation. +// enqueueAdvisoryLockKey serializes EnqueueIfUnderCap's count-then-insert +// across all connections and pods via pg_advisory_xact_lock. The value is +// arbitrary but must be stable. +const enqueueAdvisoryLockKey int64 = 4201 + +// Generation is the typed projection of one row in the generations table. type Generation struct { ID string Status GenStatus @@ -63,16 +60,14 @@ type Generation struct { // ErrGenerationNotFound is returned by GetGeneration when no row matches the id. var ErrGenerationNotFound = errors.New("generation not found") -// ErrAlreadyTerminal is returned by MarkCompleted / MarkFailed when -// the row is no longer in a queued/running state; i.e., it was -// already transitioned to a terminal status by a prior call. Workers -// suppress this with errors.Is during shutdown drain to avoid logging -// expected race conditions as real errors. +// ErrAlreadyTerminal is returned by MarkCompleted / MarkFailed when the row +// is no longer in a running state with the expected owner. This covers both +// "already completed/failed" and "lease was reassigned to another worker." +// Workers suppress this with errors.Is during shutdown drain. var ErrAlreadyTerminal = errors.New("generation already in terminal state") // Enqueue inserts a new generations row with status=queued and returns -// the generated id (128-bit hex). request is the original API request -// payload preserved verbatim. +// the generated id (128-bit hex). func (l *Library) Enqueue(ctx context.Context, request json.RawMessage) (string, error) { if l == nil || l.db == nil { return "", errors.New("buildlibrary.Enqueue: nil library") @@ -83,7 +78,7 @@ func (l *Library) Enqueue(ctx context.Context, request json.RawMessage) (string, } _, err = l.db.ExecContext(ctx, `INSERT INTO generations (id, status, created_at, request_json) - VALUES (?, 'queued', ?, ?)`, + VALUES ($1, 'queued', $2, $3::jsonb)`, id, time.Now().UTC(), string(request)) if err != nil { return "", fmt.Errorf("insert generation: %w", err) @@ -100,7 +95,7 @@ func (l *Library) GetGeneration(ctx context.Context, id string) (*Generation, er row := l.db.QueryRowContext(ctx, `SELECT id, status, created_at, started_at, completed_at, request_json, attempts, failure_reason, error_detail, trace_json - FROM generations WHERE id = ?`, id) + FROM generations WHERE id = $1`, id) var g Generation var startedAt, completedAt sql.NullTime @@ -132,8 +127,7 @@ func (l *Library) GetGeneration(ctx context.Context, id string) (*Generation, er } // InFlightCount returns the number of generations currently in status -// 'queued' or 'running'. Used by the POST handler for queue cap -// backpressure. +// 'queued' or 'running'. func (l *Library) InFlightCount(ctx context.Context) (int, error) { if l == nil || l.db == nil { return 0, errors.New("buildlibrary.InFlightCount: nil library") @@ -146,29 +140,30 @@ func (l *Library) InFlightCount(ctx context.Context) (int, error) { return n, nil } -// ClaimNext atomically transitions the oldest queued generation to -// status=running and returns its row. Returns (nil, nil) when no rows -// are queued; callers treat that as "go back to sleep." -// -// Multiple workers calling ClaimNext concurrently race on SQLite's -// writer lock; exactly one wins each available row, the others get -// (nil, nil). -func (l *Library) ClaimNext(ctx context.Context) (*Generation, error) { +// ClaimNext atomically claims the oldest queued generation for `owner`, +// setting status=running and a lease that expires after leaseTTL. Uses +// FOR UPDATE SKIP LOCKED so concurrent workers (across pods) grab distinct +// rows without blocking. Returns (nil, nil) when nothing is queued. +func (l *Library) ClaimNext(ctx context.Context, owner string, leaseTTL time.Duration) (*Generation, error) { if l == nil || l.db == nil { return nil, errors.New("buildlibrary.ClaimNext: nil library") } now := time.Now().UTC() row := l.db.QueryRowContext(ctx, ` UPDATE generations - SET status='running', started_at=?, attempts=attempts+1 + SET status='running', started_at=$1, attempts=attempts+1, + lease_expires_at=$2, lease_owner=$3 WHERE id = ( SELECT id FROM generations WHERE status='queued' - ORDER BY created_at LIMIT 1 + ORDER BY created_at + FOR UPDATE SKIP LOCKED + LIMIT 1 ) RETURNING id, status, created_at, started_at, completed_at, request_json, attempts, failure_reason, error_detail, trace_json -`, now) +`, now, now.Add(leaseTTL), owner) + var g Generation var startedAt, completedAt sql.NullTime var failureReason, errorDetail, traceJSON sql.NullString @@ -198,23 +193,36 @@ RETURNING id, status, created_at, started_at, completed_at, return &g, nil } -// MarkCompleted flips an in-flight generation to status=completed and -// records the completion timestamp. The caller must have already -// written the corresponding saved_trajectories row (it FK-references -// this id) before calling MarkCompleted. -func (l *Library) MarkCompleted(ctx context.Context, id string) error { - return l.markTerminal(ctx, id, GenStatusCompleted, "", "", nil) +// RenewLease extends the lease on a running generation the caller owns. +// Returns false (without error) when the row is no longer running or no +// longer owned by `owner` (lease lost); the caller should abort the job. +func (l *Library) RenewLease(ctx context.Context, id, owner string, leaseTTL time.Duration) (bool, error) { + if l == nil || l.db == nil { + return false, errors.New("buildlibrary.RenewLease: nil library") + } + res, err := l.db.ExecContext(ctx, ` +UPDATE generations SET lease_expires_at=$1 + WHERE id=$2 AND status='running' AND lease_owner=$3`, + time.Now().UTC().Add(leaseTTL), id, owner) + if err != nil { + return false, fmt.Errorf("buildlibrary.RenewLease: %w", err) + } + n, _ := res.RowsAffected() + return n == 1, nil +} + +// MarkCompleted flips an in-flight generation owned by `owner` to +// status=completed. owner must match the lease owner that claimed it. +func (l *Library) MarkCompleted(ctx context.Context, id, owner string) error { + return l.markTerminal(ctx, id, owner, GenStatusCompleted, "", "", nil) } -// MarkFailed flips an in-flight generation to status=failed with the -// given reason + detail + (optionally) the LLM conversation trace for -// forensics. Reason must be one of the FailureReason constants; the -// status table treats it as a closed enum. -func (l *Library) MarkFailed(ctx context.Context, id string, reason FailureReason, detail string, trace json.RawMessage) error { - return l.markTerminal(ctx, id, GenStatusFailed, reason, detail, trace) +// MarkFailed flips an in-flight generation owned by `owner` to status=failed. +func (l *Library) MarkFailed(ctx context.Context, id, owner string, reason FailureReason, detail string, trace json.RawMessage) error { + return l.markTerminal(ctx, id, owner, GenStatusFailed, reason, detail, trace) } -func (l *Library) markTerminal(ctx context.Context, id string, status GenStatus, reason FailureReason, detail string, trace json.RawMessage) error { +func (l *Library) markTerminal(ctx context.Context, id, owner string, status GenStatus, reason FailureReason, detail string, trace json.RawMessage) error { if l == nil || l.db == nil { return errors.New("buildlibrary.markTerminal: nil library") } @@ -233,9 +241,10 @@ func (l *Library) markTerminal(ctx context.Context, id string, status GenStatus, } res, err := l.db.ExecContext(ctx, ` UPDATE generations - SET status=?, completed_at=?, failure_reason=?, error_detail=?, trace_json=? - WHERE id=? AND status IN ('queued','running')`, - string(status), now, reasonArg, detailArg, traceArg, id) + SET status=$1, completed_at=$2, failure_reason=$3, error_detail=$4, + trace_json=$5::jsonb, lease_expires_at=NULL, lease_owner=NULL + WHERE id=$6 AND status='running' AND lease_owner=$7`, + string(status), now, reasonArg, detailArg, traceArg, id, owner) if err != nil { return fmt.Errorf("buildlibrary.markTerminal (%s): %w", status, err) } @@ -246,46 +255,17 @@ UPDATE generations return nil } -// RecoverOrphans flips every generations row in status='running' to -// status='failed' with reason='interrupted_on_restart'. Run once at -// startup before any worker begins polling. Returns the number of rows -// recovered. -func (l *Library) RecoverOrphans(ctx context.Context) (int, error) { - if l == nil || l.db == nil { - return 0, errors.New("buildlibrary.RecoverOrphans: nil library") - } - res, err := l.db.ExecContext(ctx, ` -UPDATE generations - SET status='failed', - completed_at=?, - failure_reason=?, - error_detail='process restarted while job was running' - WHERE status='running'`, - time.Now().UTC(), string(FailureInterruptedRestart)) - if err != nil { - return 0, fmt.Errorf("buildlibrary.RecoverOrphans: %w", err) - } - n, _ := res.RowsAffected() - return int(n), nil -} - // ErrQueueAtCapacity is returned by EnqueueIfUnderCap when the number -// of in-flight generations (status IN ('queued','running')) is at or -// above the supplied cap. The caller (POST handler) maps this to HTTP -// 429. +// of in-flight generations is at or above the supplied cap. var ErrQueueAtCapacity = errors.New("generation queue at capacity") // EnqueueIfUnderCap atomically checks count(*) WHERE status IN // ('queued','running') against maxInFlight and inserts a queued row if // under. Returns ErrQueueAtCapacity if the cap is met or exceeded. // -// Uses BEGIN IMMEDIATE on a dedicated connection so the count check -// and insert serialize against concurrent callers. database/sql's -// BeginTx defaults to BEGIN DEFERRED, which would let two callers -// both take a SHARED-lock snapshot showing count=maxInFlight-1 and -// both insert; the cap would be exceeded. BEGIN IMMEDIATE acquires -// the RESERVED writer lock at BEGIN time, so concurrent callers wait -// for the busy_timeout the DSN sets (5s) before proceeding. +// Uses pg_advisory_xact_lock so the count check and insert serialize +// against concurrent callers across all pods; the lock auto-releases at +// commit/rollback. func (l *Library) EnqueueIfUnderCap(ctx context.Context, maxInFlight int, request json.RawMessage) (string, error) { if l == nil || l.db == nil { return "", errors.New("buildlibrary.EnqueueIfUnderCap: nil library") @@ -298,24 +278,23 @@ func (l *Library) EnqueueIfUnderCap(ctx context.Context, maxInFlight int, reques return "", fmt.Errorf("generate id: %w", err) } - conn, err := l.db.Conn(ctx) + tx, err := l.db.BeginTx(ctx, nil) if err != nil { - return "", fmt.Errorf("acquire conn: %w", err) - } - defer func() { _ = conn.Close() }() - - if _, err := conn.ExecContext(ctx, "BEGIN IMMEDIATE"); err != nil { - return "", fmt.Errorf("begin immediate: %w", err) + return "", fmt.Errorf("begin: %w", err) } committed := false defer func() { if !committed { - _, _ = conn.ExecContext(context.Background(), "ROLLBACK") + _ = tx.Rollback() } }() + if _, err := tx.ExecContext(ctx, `SELECT pg_advisory_xact_lock($1)`, enqueueAdvisoryLockKey); err != nil { + return "", fmt.Errorf("advisory lock: %w", err) + } + var n int - if err := conn.QueryRowContext(ctx, + if err := tx.QueryRowContext(ctx, `SELECT count(*) FROM generations WHERE status IN ('queued','running')`, ).Scan(&n); err != nil { return "", fmt.Errorf("count in-flight: %w", err) @@ -323,22 +302,71 @@ func (l *Library) EnqueueIfUnderCap(ctx context.Context, maxInFlight int, reques if n >= maxInFlight { return "", ErrQueueAtCapacity } - if _, err := conn.ExecContext(ctx, + if _, err := tx.ExecContext(ctx, `INSERT INTO generations (id, status, created_at, request_json) - VALUES (?, 'queued', ?, ?)`, + VALUES ($1, 'queued', $2, $3::jsonb)`, id, time.Now().UTC(), string(request), ); err != nil { return "", fmt.Errorf("insert generation: %w", err) } - if _, err := conn.ExecContext(ctx, "COMMIT"); err != nil { + if err := tx.Commit(); err != nil { return "", fmt.Errorf("commit: %w", err) } committed = true return id, nil } -// newID returns a 128-bit hex token. Used by Enqueue for the generation -// id. Saved trajectories reuse the same id their generation owns. +// RecoverExpiredLeases handles generations whose lease has expired (worker +// died or stalled). With maxAttempts > 0 it requeues rows that still have +// retry budget (attempts < maxAttempts); the remainder (budget exhausted, +// or retry disabled with maxAttempts == 0) are failed with reason +// lease_expired. Idempotent and safe to run concurrently across pods. +// Returns counts of requeued and failed rows. +func (l *Library) RecoverExpiredLeases(ctx context.Context, maxAttempts int) (requeued, failed int, err error) { + if l == nil || l.db == nil { + return 0, 0, errors.New("buildlibrary.RecoverExpiredLeases: nil library") + } + tx, err := l.db.BeginTx(ctx, nil) + if err != nil { + return 0, 0, fmt.Errorf("begin: %w", err) + } + committed := false + defer func() { + if !committed { + _ = tx.Rollback() + } + }() + + now := time.Now().UTC() + rq, err := tx.ExecContext(ctx, ` +UPDATE generations + SET status='queued', lease_expires_at=NULL, lease_owner=NULL + WHERE status='running' AND lease_expires_at < $1 + AND $2 > 0 AND attempts < $2`, now, maxAttempts) + if err != nil { + return 0, 0, fmt.Errorf("requeue: %w", err) + } + rqN, _ := rq.RowsAffected() + + fl, err := tx.ExecContext(ctx, ` +UPDATE generations + SET status='failed', completed_at=$1, failure_reason=$2, + error_detail='lease expired (worker died or stalled)', + lease_expires_at=NULL, lease_owner=NULL + WHERE status='running' AND lease_expires_at < $1`, now, string(FailureLeaseExpired)) + if err != nil { + return 0, 0, fmt.Errorf("fail: %w", err) + } + flN, _ := fl.RowsAffected() + + if err := tx.Commit(); err != nil { + return 0, 0, fmt.Errorf("commit: %w", err) + } + committed = true + return int(rqN), int(flN), nil +} + +// newID returns a 128-bit hex token. func newID() (string, error) { var buf [16]byte if _, err := rand.Read(buf[:]); err != nil { diff --git a/internal/buildlibrary/generations_test.go b/internal/buildlibrary/generations_test.go index 32fb10a..cdfbe36 100644 --- a/internal/buildlibrary/generations_test.go +++ b/internal/buildlibrary/generations_test.go @@ -4,13 +4,14 @@ import ( "context" "encoding/json" "errors" + "reflect" "sync" "testing" "time" ) func TestEnqueue_InsertsQueuedRow(t *testing.T) { - lib := openTempLibrary(t) + lib := newTestLibrary(t) ctx := context.Background() id, err := lib.Enqueue(ctx, json.RawMessage(`{"class":"novice"}`)) @@ -28,7 +29,15 @@ func TestEnqueue_InsertsQueuedRow(t *testing.T) { if g.Status != GenStatusQueued { t.Fatalf("status: got %q, want %q", g.Status, GenStatusQueued) } - if string(g.RequestJSON) != `{"class":"novice"}` { + // Postgres JSONB may reformat whitespace; compare parsed content instead. + var gotJSON, wantJSON map[string]any + if err := json.Unmarshal(g.RequestJSON, &gotJSON); err != nil { + t.Fatalf("unmarshal request_json: %v", err) + } + if err := json.Unmarshal([]byte(`{"class":"novice"}`), &wantJSON); err != nil { + t.Fatalf("unmarshal want: %v", err) + } + if !reflect.DeepEqual(gotJSON, wantJSON) { t.Fatalf("request_json round-trip mismatch: got %s", string(g.RequestJSON)) } if g.CreatedAt.IsZero() { @@ -37,7 +46,7 @@ func TestEnqueue_InsertsQueuedRow(t *testing.T) { } func TestGetGeneration_NotFound(t *testing.T) { - lib := openTempLibrary(t) + lib := newTestLibrary(t) _, err := lib.GetGeneration(context.Background(), "does-not-exist") if !errors.Is(err, ErrGenerationNotFound) { t.Fatalf("err: got %v, want ErrGenerationNotFound", err) @@ -45,7 +54,7 @@ func TestGetGeneration_NotFound(t *testing.T) { } func TestInFlightCount_QueuedAndRunning(t *testing.T) { - lib := openTempLibrary(t) + lib := newTestLibrary(t) ctx := context.Background() // Insert: 2 queued, 1 running, 1 completed, 1 failed @@ -55,9 +64,9 @@ func TestInFlightCount_QueuedAndRunning(t *testing.T) { completedID := mustEnqueue(t, lib, ctx) failedID := mustEnqueue(t, lib, ctx) - mustExec(t, lib, "UPDATE generations SET status='running', started_at=? WHERE id=?", time.Now().UTC(), runningID) - mustExec(t, lib, "UPDATE generations SET status='completed', completed_at=? WHERE id=?", time.Now().UTC(), completedID) - mustExec(t, lib, "UPDATE generations SET status='failed', completed_at=? WHERE id=?", time.Now().UTC(), failedID) + mustExec(t, lib, "UPDATE generations SET status='running', started_at=$1 WHERE id=$2", time.Now().UTC(), runningID) + mustExec(t, lib, "UPDATE generations SET status='completed', completed_at=$1 WHERE id=$2", time.Now().UTC(), completedID) + mustExec(t, lib, "UPDATE generations SET status='failed', completed_at=$1 WHERE id=$2", time.Now().UTC(), failedID) n, err := lib.InFlightCount(ctx) if err != nil { @@ -85,16 +94,16 @@ func mustExec(t *testing.T, lib *Library, query string, args ...any) { } func TestClaimNext_ReturnsOldestQueued(t *testing.T) { - lib := openTempLibrary(t) + lib := newTestLibrary(t) ctx := context.Background() // Insert three; the middle one is the oldest (manually set created_at). id1 := mustEnqueue(t, lib, ctx) id2 := mustEnqueue(t, lib, ctx) id3 := mustEnqueue(t, lib, ctx) - mustExec(t, lib, "UPDATE generations SET created_at=? WHERE id=?", time.Now().Add(-time.Hour).UTC(), id2) + mustExec(t, lib, "UPDATE generations SET created_at=$1 WHERE id=$2", time.Now().Add(-time.Hour).UTC(), id2) - claimed, err := lib.ClaimNext(ctx) + claimed, err := lib.ClaimNext(ctx, "worker", time.Minute) if err != nil { t.Fatalf("ClaimNext: %v", err) } @@ -112,24 +121,13 @@ func TestClaimNext_ReturnsOldestQueued(t *testing.T) { } } -func TestClaimNext_EmptyWhenNoQueued(t *testing.T) { - lib := openTempLibrary(t) - claimed, err := lib.ClaimNext(context.Background()) - if err != nil { - t.Fatalf("ClaimNext: %v", err) - } - if claimed != nil { - t.Fatalf("expected nil claim on empty queue, got %v", claimed) - } -} - func TestMarkCompleted_StampsCompletedAt(t *testing.T) { - lib := openTempLibrary(t) + lib := newTestLibrary(t) ctx := context.Background() id := mustEnqueue(t, lib, ctx) - mustExec(t, lib, "UPDATE generations SET status='running', started_at=? WHERE id=?", time.Now().UTC(), id) + mustExec(t, lib, "UPDATE generations SET status='running', started_at=$1, lease_owner='owner-A' WHERE id=$2", time.Now().UTC(), id) - if err := lib.MarkCompleted(ctx, id); err != nil { + if err := lib.MarkCompleted(ctx, id, "owner-A"); err != nil { t.Fatalf("MarkCompleted: %v", err) } g, err := lib.GetGeneration(ctx, id) @@ -145,11 +143,12 @@ func TestMarkCompleted_StampsCompletedAt(t *testing.T) { } func TestMarkFailed_StoresReasonAndDetail(t *testing.T) { - lib := openTempLibrary(t) + lib := newTestLibrary(t) ctx := context.Background() id := mustEnqueue(t, lib, ctx) + mustExec(t, lib, "UPDATE generations SET status='running', lease_owner='owner-A', started_at=$1 WHERE id=$2", time.Now().UTC(), id) - if err := lib.MarkFailed(ctx, id, FailureMaxItersExhausted, "loop hit cap=60", nil); err != nil { + if err := lib.MarkFailed(ctx, id, "owner-A", FailureMaxItersExhausted, "loop hit cap=60", nil); err != nil { t.Fatalf("MarkFailed: %v", err) } g, err := lib.GetGeneration(ctx, id) @@ -170,32 +169,8 @@ func TestMarkFailed_StoresReasonAndDetail(t *testing.T) { } } -func TestRecoverOrphans_FlipsRunningToFailed(t *testing.T) { - lib := openTempLibrary(t) - ctx := context.Background() - id1 := mustEnqueue(t, lib, ctx) - id2 := mustEnqueue(t, lib, ctx) - mustExec(t, lib, "UPDATE generations SET status='running', started_at=? WHERE id=?", time.Now().UTC(), id1) - - n, err := lib.RecoverOrphans(ctx) - if err != nil { - t.Fatalf("RecoverOrphans: %v", err) - } - if n != 1 { - t.Fatalf("recovered count: got %d, want 1", n) - } - g1, _ := lib.GetGeneration(ctx, id1) - g2, _ := lib.GetGeneration(ctx, id2) - if g1.Status != GenStatusFailed || g1.FailureReason != FailureInterruptedRestart { - t.Fatalf("orphan row not recovered: status=%s reason=%s", g1.Status, g1.FailureReason) - } - if g2.Status != GenStatusQueued { - t.Fatalf("queued row was disturbed: status=%s", g2.Status) - } -} - func TestEnqueueIfUnderCap_RejectsAtCap(t *testing.T) { - lib := openTempLibrary(t) + lib := newTestLibrary(t) ctx := context.Background() // Fill the queue to cap=2. @@ -213,12 +188,12 @@ func TestEnqueueIfUnderCap_RejectsAtCap(t *testing.T) { } func TestEnqueueIfUnderCap_RunningCounts(t *testing.T) { - lib := openTempLibrary(t) + lib := newTestLibrary(t) ctx := context.Background() // One queued, then claim it so it becomes running. id, _ := lib.EnqueueIfUnderCap(ctx, 5, json.RawMessage(`{}`)) - if _, err := lib.ClaimNext(ctx); err != nil { + if _, err := lib.ClaimNext(ctx, "w", time.Minute); err != nil { t.Fatalf("ClaimNext: %v", err) } _ = id @@ -235,20 +210,21 @@ func TestEnqueueIfUnderCap_RunningCounts(t *testing.T) { } func TestMarkCompleted_AlreadyTerminalReturnsSentinel(t *testing.T) { - lib := openTempLibrary(t) + lib := newTestLibrary(t) ctx := context.Background() id := mustEnqueue(t, lib, ctx) - if err := lib.MarkCompleted(ctx, id); err != nil { + mustExec(t, lib, "UPDATE generations SET status='running', lease_owner='owner-A', started_at=$1 WHERE id=$2", time.Now().UTC(), id) + if err := lib.MarkCompleted(ctx, id, "owner-A"); err != nil { t.Fatalf("first MarkCompleted: %v", err) } - err := lib.MarkCompleted(ctx, id) + err := lib.MarkCompleted(ctx, id, "owner-A") if !errors.Is(err, ErrAlreadyTerminal) { t.Fatalf("second MarkCompleted: want errors.Is(ErrAlreadyTerminal), got %v", err) } } func TestEnqueueIfUnderCap_ConcurrentDoesNotExceedCap(t *testing.T) { - lib := openTempLibrary(t) + lib := newTestLibrary(t) ctx := context.Background() const cap = 10 diff --git a/internal/buildlibrary/leases_test.go b/internal/buildlibrary/leases_test.go new file mode 100644 index 0000000..9ff822a --- /dev/null +++ b/internal/buildlibrary/leases_test.go @@ -0,0 +1,296 @@ +package buildlibrary + +import ( + "context" + "errors" + "fmt" + "testing" + "time" + + "github.com/levonn-dev/ro-builder/internal/domain" +) + +// expireLease force-expires the lease on a running generation by setting +// lease_expires_at in the past. +func expireLease(t *testing.T, lib *Library, id string) { + t.Helper() + mustExec(t, lib, "UPDATE generations SET lease_expires_at=$1 WHERE id=$2", + time.Now().Add(-time.Minute).UTC(), id) +} + +func TestClaimNext_SetsLeaseAndOwner(t *testing.T) { + lib := newTestLibrary(t) + ctx := context.Background() + + mustEnqueue(t, lib, ctx) + const owner = "worker-1" + const ttl = time.Minute + + claimed, err := lib.ClaimNext(ctx, owner, ttl) + if err != nil { + t.Fatalf("ClaimNext: %v", err) + } + if claimed == nil { + t.Fatal("expected a claimed generation, got nil") + } + + // Verify lease fields in DB. + var leaseOwner string + var leaseExpires time.Time + err = lib.db.QueryRowContext(ctx, + `SELECT lease_owner, lease_expires_at FROM generations WHERE id=$1`, claimed.ID, + ).Scan(&leaseOwner, &leaseExpires) + if err != nil { + t.Fatalf("query lease: %v", err) + } + if leaseOwner != owner { + t.Errorf("lease_owner: got %q, want %q", leaseOwner, owner) + } + if leaseExpires.IsZero() { + t.Error("lease_expires_at should not be zero") + } + if claimed.Attempts != 1 { + t.Errorf("Attempts: got %d, want 1", claimed.Attempts) + } +} + +func TestClaimNext_EmptyWhenNoQueued(t *testing.T) { + lib := newTestLibrary(t) + claimed, err := lib.ClaimNext(context.Background(), "w", time.Minute) + if err != nil { + t.Fatalf("ClaimNext: %v", err) + } + if claimed != nil { + t.Fatalf("expected nil claim on empty queue, got %v", claimed) + } +} + +func TestRenewLease_TrueWhenOwnedFalseOtherwise(t *testing.T) { + lib := newTestLibrary(t) + ctx := context.Background() + mustEnqueue(t, lib, ctx) + + claimed, err := lib.ClaimNext(ctx, "worker-1", time.Minute) + if err != nil || claimed == nil { + t.Fatalf("ClaimNext: %v (claimed=%v)", err, claimed) + } + + // Renew with correct owner: should return true. + ok, err := lib.RenewLease(ctx, claimed.ID, "worker-1", time.Minute) + if err != nil { + t.Fatalf("RenewLease correct owner: %v", err) + } + if !ok { + t.Error("RenewLease correct owner: expected true, got false") + } + + // Renew with wrong owner: should return false. + ok, err = lib.RenewLease(ctx, claimed.ID, "worker-2", time.Minute) + if err != nil { + t.Fatalf("RenewLease wrong owner: %v", err) + } + if ok { + t.Error("RenewLease wrong owner: expected false, got true") + } +} + +func TestClaimNext_ConcurrentClaimsDistinctRows(t *testing.T) { + lib := newTestLibrary(t) + ctx := context.Background() + + const n = 5 + for i := 0; i < n; i++ { + mustEnqueue(t, lib, ctx) + } + + type result struct { + id string + err error + } + ch := make(chan result, n) + for i := 0; i < n; i++ { + owner := fmt.Sprintf("worker-%d", i) + go func(owner string) { + g, err := lib.ClaimNext(ctx, owner, time.Minute) + if err != nil { + ch <- result{err: err} + return + } + if g == nil { + ch <- result{err: fmt.Errorf("got nil from ClaimNext for %s", owner)} + return + } + ch <- result{id: g.ID} + }(owner) + } + + seen := make(map[string]bool) + for i := 0; i < n; i++ { + r := <-ch + if r.err != nil { + t.Errorf("worker error: %v", r.err) + continue + } + if seen[r.id] { + t.Errorf("duplicate claim: id %s claimed twice", r.id) + } + seen[r.id] = true + } +} + +func TestRecoverExpiredLeases_Cap0FailsExpired(t *testing.T) { + lib := newTestLibrary(t) + ctx := context.Background() + + // Two running generations with expired leases, maxAttempts=0 means no requeue. + id1 := mustEnqueue(t, lib, ctx) + id2 := mustEnqueue(t, lib, ctx) + mustExec(t, lib, "UPDATE generations SET status='running', lease_owner='w', started_at=$1 WHERE id=$2", time.Now().UTC(), id1) + mustExec(t, lib, "UPDATE generations SET status='running', lease_owner='w', started_at=$1 WHERE id=$2", time.Now().UTC(), id2) + expireLease(t, lib, id1) + expireLease(t, lib, id2) + + requeued, failed, err := lib.RecoverExpiredLeases(ctx, 0) + if err != nil { + t.Fatalf("RecoverExpiredLeases: %v", err) + } + if requeued != 0 { + t.Errorf("requeued: got %d, want 0", requeued) + } + if failed != 2 { + t.Errorf("failed: got %d, want 2", failed) + } + + g1, _ := lib.GetGeneration(ctx, id1) + if g1.Status != GenStatusFailed || g1.FailureReason != FailureLeaseExpired { + t.Errorf("id1: status=%s reason=%s", g1.Status, g1.FailureReason) + } +} + +func TestRecoverExpiredLeases_CapRequeuesThenFails(t *testing.T) { + lib := newTestLibrary(t) + ctx := context.Background() + + // id1 has attempts=1 (under cap=3), id2 has attempts=3 (at cap). + id1 := mustEnqueue(t, lib, ctx) + id2 := mustEnqueue(t, lib, ctx) + mustExec(t, lib, "UPDATE generations SET status='running', attempts=1, lease_owner='w', started_at=$1 WHERE id=$2", time.Now().UTC(), id1) + mustExec(t, lib, "UPDATE generations SET status='running', attempts=3, lease_owner='w', started_at=$1 WHERE id=$2", time.Now().UTC(), id2) + expireLease(t, lib, id1) + expireLease(t, lib, id2) + + requeued, failed, err := lib.RecoverExpiredLeases(ctx, 3) + if err != nil { + t.Fatalf("RecoverExpiredLeases: %v", err) + } + if requeued != 1 { + t.Errorf("requeued: got %d, want 1", requeued) + } + if failed != 1 { + t.Errorf("failed: got %d, want 1", failed) + } + + g1, _ := lib.GetGeneration(ctx, id1) + if g1.Status != GenStatusQueued { + t.Errorf("id1 should be queued, got %s", g1.Status) + } + g2, _ := lib.GetGeneration(ctx, id2) + if g2.Status != GenStatusFailed { + t.Errorf("id2 should be failed, got %s", g2.Status) + } +} + +func TestRecoverExpiredLeases_LeavesLiveLeasesAlone(t *testing.T) { + lib := newTestLibrary(t) + ctx := context.Background() + + // One expired, one live. + expiredID := mustEnqueue(t, lib, ctx) + liveID := mustEnqueue(t, lib, ctx) + mustExec(t, lib, "UPDATE generations SET status='running', lease_owner='w', started_at=$1 WHERE id=$2", time.Now().UTC(), expiredID) + mustExec(t, lib, "UPDATE generations SET status='running', lease_owner='w', started_at=$1 WHERE id=$2", time.Now().UTC(), liveID) + expireLease(t, lib, expiredID) + // liveID keeps its lease active. + mustExec(t, lib, "UPDATE generations SET lease_expires_at=$1 WHERE id=$2", time.Now().Add(time.Hour).UTC(), liveID) + + _, failed, err := lib.RecoverExpiredLeases(ctx, 0) + if err != nil { + t.Fatalf("RecoverExpiredLeases: %v", err) + } + if failed != 1 { + t.Errorf("failed: got %d, want 1", failed) + } + + live, _ := lib.GetGeneration(ctx, liveID) + if live.Status != GenStatusRunning { + t.Errorf("liveID should still be running, got %s", live.Status) + } +} + +func TestSaveAndComplete_OwnerScoping(t *testing.T) { + lib := newTestLibrary(t) + ctx := context.Background() + + passingInput := func(id, owner string) SaveInput { + return SaveInput{ + ID: id, + Owner: owner, + Class: "taekwon_kid", + Server: "uaro", + Playstyle: "pvm", + Mode: "pre-renewal", + Primary: domain.Trajectory{ + Class: "taekwon_kid", + Snapshots: []domain.Snapshot{ + okSnapshot("taekwon_kid", nil), + }, + }, + } + } + + // Case 1: matching owner -> success, generation marked completed. + id1 := mustEnqueue(t, lib, ctx) + claimed1, err := lib.ClaimNext(ctx, "worker-A", time.Minute) + if err != nil || claimed1 == nil { + t.Fatalf("ClaimNext id1: %v (claimed=%v)", err, claimed1) + } + if claimed1.ID != id1 { + t.Fatalf("claimed wrong id: got %s want %s", claimed1.ID, id1) + } + if _, err := lib.SaveAndComplete(ctx, passingInput(id1, "worker-A")); err != nil { + t.Fatalf("SaveAndComplete correct owner: %v", err) + } + g1, err := lib.GetGeneration(ctx, id1) + if err != nil { + t.Fatalf("GetGeneration id1: %v", err) + } + if g1.Status != GenStatusCompleted { + t.Errorf("id1 status: got %q, want %q", g1.Status, GenStatusCompleted) + } + + // Case 2: wrong owner -> ErrAlreadyTerminal, tx rolled back, no saved_trajectories row. + id2 := mustEnqueue(t, lib, ctx) + claimed2, err := lib.ClaimNext(ctx, "worker-A", time.Minute) + if err != nil || claimed2 == nil { + t.Fatalf("ClaimNext id2: %v (claimed=%v)", err, claimed2) + } + if claimed2.ID != id2 { + t.Fatalf("claimed wrong id: got %s want %s", claimed2.ID, id2) + } + _, err = lib.SaveAndComplete(ctx, passingInput(id2, "worker-B")) + if !errors.Is(err, ErrAlreadyTerminal) { + t.Fatalf("SaveAndComplete wrong owner: expected ErrAlreadyTerminal, got %v", err) + } + // Generation row stays running (the tx rolled back). + g2, err := lib.GetGeneration(ctx, id2) + if err != nil { + t.Fatalf("GetGeneration id2: %v", err) + } + if g2.Status != GenStatusRunning { + t.Errorf("id2 status: got %q, want running", g2.Status) + } + // No saved_trajectories row written (the INSERT was inside the rolled-back tx). + if _, err := lib.Get(ctx, id2); !errors.Is(err, ErrNotFound) { + t.Errorf("Get id2: expected ErrNotFound, got %v", err) + } +} diff --git a/internal/buildlibrary/library.go b/internal/buildlibrary/library.go index 702472e..78d897f 100644 --- a/internal/buildlibrary/library.go +++ b/internal/buildlibrary/library.go @@ -1,79 +1,90 @@ // Package buildlibrary persists generated trajectories the orchestrator // produces, so future requests can retrieve them as reference points. // -// The library is the organic replacement for hand-authored archetypes: -// real, validated builds accumulate over time and the LLM draws on them -// or diverges, never picking from a fixed template list. -// -// Currently SQLite-backed (one table, simple recency-ordered retrieval), -// pure-Go via modernc.org/sqlite (no CGO, cross-compiles cleanly). +// PostgreSQL-backed via database/sql + the pgx stdlib driver (pure-Go, +// CGO-free). Schema is managed by embedded golang-migrate migrations, +// applied on Open. Two tables: an async-generation queue (with lease +// columns for multi-pod-safe claim/recovery) and the saved trajectories. // Vector search over reasoning text is a future enhancement. // // Save semantics: only trajectories whose scored snapshots clear all -// quality gates (no fail / fail_hard severity) get persisted. Warns -// flow through as breakdown context. The library doesn't accept junk. +// quality gates (no fail / fail_hard severity) get persisted. package buildlibrary import ( "context" "database/sql" + "embed" + "errors" "fmt" - "strings" "time" - _ "modernc.org/sqlite" + "github.com/golang-migrate/migrate/v4" + pgxmigrate "github.com/golang-migrate/migrate/v4/database/pgx/v5" + "github.com/golang-migrate/migrate/v4/source/iofs" + _ "github.com/jackc/pgx/v5/stdlib" "github.com/levonn-dev/ro-builder/internal/domain" ) -// Library wraps a SQLite database file. Construct with Open; close with -// Close. Methods are safe to call concurrently; SQLite handles -// serialization internally and the connection pool is sized for it. +//go:embed migrations/*.sql +var migrationsFS embed.FS + +// Library wraps a PostgreSQL connection pool. Construct with Open; close +// with Close. Methods are safe for concurrent use. type Library struct { db *sql.DB } -// Open opens (or creates) the SQLite database at path and runs schema -// migration. Idempotent: opening an existing library is a no-op -// beyond opening the file. Path "" is rejected; callers must supply -// an explicit location so production deploys don't accidentally write -// to /tmp. -func Open(path string) (*Library, error) { - if path == "" { - return nil, fmt.Errorf("buildlibrary.Open: path is required") - } - // Apply FK enforcement via the DSN so the driver re-applies the - // PRAGMA to every connection it opens. With MaxOpenConns=4, the pool - // may spawn fresh connections; a one-shot ExecContext only reaches - // the first connection and leaves the others with FK checks off. - // _pragma= is supported by modernc.org/sqlite. - sep := "?" - if strings.Contains(path, "?") { - sep = "&" +// Open connects to the Postgres database at dsn, verifies the connection, +// and applies embedded migrations. dsn "" is rejected; callers must supply +// an explicit connection string. +func Open(ctx context.Context, dsn string) (*Library, error) { + if dsn == "" { + return nil, fmt.Errorf("buildlibrary.Open: dsn is required") } - dsn := path + sep + "_pragma=foreign_keys(on)&_pragma=busy_timeout(5000)" - db, err := sql.Open("sqlite", dsn) + db, err := sql.Open("pgx", dsn) if err != nil { - return nil, fmt.Errorf("open sqlite at %s: %w", path, err) + return nil, fmt.Errorf("open postgres: %w", err) } - // Connection pool sized for low-concurrency single-process use. The - // API serves one /generate at a time per request, and saves are - // fire-and-forget after the response goes out; no need for a deep - // pool. - db.SetMaxOpenConns(4) - db.SetMaxIdleConns(2) - if err := db.PingContext(context.Background()); err != nil { + db.SetMaxOpenConns(10) + db.SetMaxIdleConns(5) + db.SetConnMaxIdleTime(5 * time.Minute) + if err := db.PingContext(ctx); err != nil { _ = db.Close() - return nil, fmt.Errorf("ping sqlite at %s: %w", path, err) + return nil, fmt.Errorf("ping postgres: %w", err) } - if err := migrate(db); err != nil { + if err := runMigrations(db); err != nil { _ = db.Close() - return nil, fmt.Errorf("migrate %s: %w", path, err) + return nil, fmt.Errorf("migrate: %w", err) } return &Library{db: db}, nil } -// Close releases the database file. +// runMigrations applies embedded migrations using the app's *sql.DB. +// golang-migrate takes a cluster advisory lock for the duration, so +// concurrent pod startups serialize safely (one migrates, others no-op). +// We never call m.Close(): that would close the shared *sql.DB. +func runMigrations(db *sql.DB) error { + src, err := iofs.New(migrationsFS, "migrations") + if err != nil { + return fmt.Errorf("open migrations fs: %w", err) + } + drv, err := pgxmigrate.WithInstance(db, &pgxmigrate.Config{}) + if err != nil { + return fmt.Errorf("migrate driver: %w", err) + } + m, err := migrate.NewWithInstance("iofs", src, "pgx5", drv) + if err != nil { + return fmt.Errorf("migrate init: %w", err) + } + if err := m.Up(); err != nil && !errors.Is(err, migrate.ErrNoChange) { + return fmt.Errorf("migrate up: %w", err) + } + return nil +} + +// Close releases the database connection pool. func (l *Library) Close() error { if l == nil || l.db == nil { return nil @@ -82,8 +93,7 @@ func (l *Library) Close() error { } // Ping verifies the underlying connection is healthy. Used by the -// /readyz probe; a panicked sqlite handle or unreachable file shows up -// here before any real query touches it. +// /readyz probe. func (l *Library) Ping(ctx context.Context) error { if l == nil || l.db == nil { return fmt.Errorf("buildlibrary: not opened") @@ -91,63 +101,13 @@ func (l *Library) Ping(ctx context.Context) error { return l.db.PingContext(ctx) } -func migrate(db *sql.DB) error { - ctx := context.Background() - - // Detect whether the schema has already been applied. If - // `generations` exists, this DB was opened by a previous run and - // migration is a no-op. - var count int - if err := db.QueryRowContext(ctx, - `SELECT count(*) FROM sqlite_master WHERE type='table' AND name='generations'`, - ).Scan(&count); err != nil { - return fmt.Errorf("probe schema: %w", err) - } - - if count == 0 { - // Fresh DB: create both tables with the FK constraint inline. - const initial = ` -PRAGMA foreign_keys=ON; - -CREATE TABLE generations ( - id TEXT PRIMARY KEY, - status TEXT NOT NULL CHECK (status IN ('queued','running','completed','failed')), - created_at TIMESTAMP NOT NULL, - started_at TIMESTAMP, - completed_at TIMESTAMP, - request_json TEXT NOT NULL, - attempts INTEGER NOT NULL DEFAULT 0, - failure_reason TEXT, - error_detail TEXT, - trace_json TEXT -); -CREATE INDEX idx_generations_status_created - ON generations(status, created_at); - -CREATE TABLE saved_trajectories ( - id TEXT PRIMARY KEY, - created_at TIMESTAMP NOT NULL, - class TEXT NOT NULL, - server TEXT NOT NULL, - playstyle TEXT NOT NULL, - mode TEXT NOT NULL, - description TEXT, - primary_json TEXT NOT NULL, - alternatives_json TEXT, - final_text TEXT, - gate_summary TEXT NOT NULL, - calc_version TEXT, - catalog_version INTEGER, - FOREIGN KEY (id) REFERENCES generations(id) -); -CREATE INDEX idx_saved_trajectories_lookup - ON saved_trajectories (server, class, created_at DESC); -` - if _, err := db.ExecContext(ctx, initial); err != nil { - return fmt.Errorf("apply initial schema: %w", err) - } +// Truncate removes all rows from both tables. Used in tests to reset state. +func (l *Library) Truncate(ctx context.Context) error { + if l == nil || l.db == nil { + return errors.New("buildlibrary.Truncate: nil library") } - return nil + _, err := l.db.ExecContext(ctx, `TRUNCATE saved_trajectories, generations CASCADE`) + return err } // SavedTrajectory is the full record as stored. Marshaled JSON columns diff --git a/internal/buildlibrary/library_test.go b/internal/buildlibrary/library_test.go index 7389dc8..abdcb96 100644 --- a/internal/buildlibrary/library_test.go +++ b/internal/buildlibrary/library_test.go @@ -2,11 +2,8 @@ package buildlibrary import ( "context" - "crypto/rand" - "encoding/hex" "errors" "fmt" - "path/filepath" "testing" "time" @@ -14,21 +11,6 @@ import ( "github.com/levonn-dev/ro-builder/internal/scoring" ) -// openTempLibrary opens a fresh on-disk library in t.TempDir() and -// schedules cleanup. Used by every test below to avoid cross-test -// state leaks; in-memory mode (`:memory:`) is tempting but doesn't -// match the production code path that opens a file. -func openTempLibrary(t *testing.T) *Library { - t.Helper() - dir := t.TempDir() - lib, err := Open(filepath.Join(dir, "test.db")) - if err != nil { - t.Fatalf("Open: %v", err) - } - t.Cleanup(func() { _ = lib.Close() }) - return lib -} - // insertParentGeneration writes a minimal `generations` row with the // given id so Save tests can satisfy the FK without depending on the // Generations repository abstraction (which is exercised in its own @@ -36,8 +18,8 @@ func openTempLibrary(t *testing.T) *Library { func insertParentGeneration(t *testing.T, lib *Library, id string) { t.Helper() _, err := lib.db.ExecContext(context.Background(), - `INSERT INTO generations (id, status, created_at, request_json) - VALUES (?, 'running', ?, '{}')`, + `INSERT INTO generations (id, status, created_at, request_json, lease_owner) + VALUES ($1, 'running', $2, '{}', 'test-owner')`, id, time.Now().UTC()) if err != nil { t.Fatalf("insertParentGeneration: %v", err) @@ -45,7 +27,7 @@ func insertParentGeneration(t *testing.T, lib *Library, id string) { } // scoredSnapshot is the test default; has a non-nil Score so the save -// guard's "≥1 scored snapshot in Primary" check passes, and a default +// guard's ">=1 scored snapshot in Primary" check passes, and a default // passing gate so the gates-required guard passes too. Tests that // explicitly want to test those guards pass their own gates / use // unscoredSnapshot. @@ -78,7 +60,7 @@ func okSnapshot(class string, gates []domain.GateResult) domain.Snapshot { } func TestSaveAndGet_Roundtrip(t *testing.T) { - lib := openTempLibrary(t) + lib := newTestLibrary(t) ctx := context.Background() const genID = "test-gen-id-1" @@ -127,7 +109,7 @@ func TestSaveAndGet_Roundtrip(t *testing.T) { } func TestSave_RejectsFailingGates(t *testing.T) { - lib := openTempLibrary(t) + lib := newTestLibrary(t) ctx := context.Background() const genID = "test-gen-id-1" @@ -163,7 +145,7 @@ func TestSave_RejectsFailingGates(t *testing.T) { } func TestSave_RejectsFailingGatesInAlternatives(t *testing.T) { - lib := openTempLibrary(t) + lib := newTestLibrary(t) ctx := context.Background() const genID = "test-gen-id-1" @@ -192,7 +174,7 @@ func TestSave_RejectsFailingGatesInAlternatives(t *testing.T) { // Warns flow through. The library accepts a trajectory carrying warn // results; those are breakdown context, not rejection signals. func TestSave_AcceptsWarnsOnly(t *testing.T) { - lib := openTempLibrary(t) + lib := newTestLibrary(t) ctx := context.Background() const genID = "test-gen-id-1" @@ -222,7 +204,7 @@ func TestSave_AcceptsWarnsOnly(t *testing.T) { } func TestFind_FiltersByClassAndServer(t *testing.T) { - lib := openTempLibrary(t) + lib := newTestLibrary(t) ctx := context.Background() saves := []SaveInput{ @@ -254,7 +236,7 @@ func TestFind_FiltersByClassAndServer(t *testing.T) { } func TestFind_RecencyOrder(t *testing.T) { - lib := openTempLibrary(t) + lib := newTestLibrary(t) ctx := context.Background() // Two records of the same class; second insert should appear first. @@ -284,11 +266,9 @@ func TestFind_RecencyOrder(t *testing.T) { // Save rejects trajectories whose Primary has zero scored snapshots; // canonical scoring couldn't run for any of them, so there's nothing -// useful to persist. Before this guard, run-7-style outputs (LLM -// submitted, calc rejected every snapshot's skills, library still saved -// an unscored trajectory) slipped through. +// useful to persist. func TestSave_RejectsZeroScoredSnapshots(t *testing.T) { - lib := openTempLibrary(t) + lib := newTestLibrary(t) ctx := context.Background() const genID = "test-gen-id-1" @@ -314,12 +294,9 @@ func TestSave_RejectsZeroScoredSnapshots(t *testing.T) { } // Save rejects trajectories whose Primary has scored snapshots but no -// gates evaluated. That state means the orchestrator was wired without -// WithCatalog; scoring ran, but the gates evaluator was skipped, so -// the library would otherwise persist trajectories that bypass the -// quality floors (hit rate, EHP, requirements_met) entirely. +// gates evaluated. func TestSave_RejectsScoredSnapshotsWithoutGates(t *testing.T) { - lib := openTempLibrary(t) + lib := newTestLibrary(t) ctx := context.Background() const genID = "test-gen-id-1" @@ -344,12 +321,9 @@ func TestSave_RejectsScoredSnapshotsWithoutGates(t *testing.T) { } } -// Mixed scored + unscored snapshots in Primary should pass; the LLM's -// trajectory commonly has scored checkpoints (job changes, lvl 85, -// endgame) interleaved with unscored intermediate snapshots. As long -// as ≥1 is scored, save proceeds. +// Mixed scored + unscored snapshots in Primary should pass. func TestSave_AcceptsPartiallyScoredPrimary(t *testing.T) { - lib := openTempLibrary(t) + lib := newTestLibrary(t) ctx := context.Background() const genID = "test-gen-id-1" @@ -378,115 +352,10 @@ func TestSave_AcceptsPartiallyScoredPrimary(t *testing.T) { } func TestGet_NotFound(t *testing.T) { - lib := openTempLibrary(t) + lib := newTestLibrary(t) ctx := context.Background() _, err := lib.Get(ctx, "00000000000000000000000000000000") if !errors.Is(err, ErrNotFound) { t.Errorf("expected ErrNotFound, got: %v", err) } } - -func TestOpen_RejectsEmptyPath(t *testing.T) { - if _, err := Open(""); err == nil { - t.Error("expected error from Open(\"\")") - } -} - -func TestMigrate_ForeignKeysEnforced(t *testing.T) { - lib := openTempLibrary(t) - _, err := lib.db.ExecContext(context.Background(), - `INSERT INTO saved_trajectories (id, created_at, class, server, playstyle, mode, primary_json, gate_summary) - VALUES ('orphan', ?, 'novice', 'uaro', 'pvm', 'pre-renewal', '{}', '{}')`, - time.Now().UTC()) - if err == nil { - t.Fatalf("expected FK violation on saved_trajectories without matching generations row, got nil") - } -} - -func TestMigrate_GenerationsTableExists(t *testing.T) { - lib := openTempLibrary(t) - var name string - err := lib.db.QueryRowContext(context.Background(), - `SELECT name FROM sqlite_master WHERE type='table' AND name='generations'`).Scan(&name) - if err != nil { - t.Fatalf("generations table not found: %v", err) - } -} - -func TestMigrate_OpenTwicePreservesSavedTrajectories(t *testing.T) { - dir := t.TempDir() - dbPath := filepath.Join(dir, "test.db") - - // First open: schema applied, both tables created. - lib, err := Open(dbPath) - if err != nil { - t.Fatalf("first Open: %v", err) - } - - // Insert a generation + a corresponding saved_trajectory row so we - // can detect data loss across a re-Open. - if _, err := lib.db.ExecContext(context.Background(), - `INSERT INTO generations (id, status, created_at, request_json) - VALUES ('keep-me', 'completed', ?, '{}')`, - time.Now().UTC()); err != nil { - t.Fatalf("insert generation: %v", err) - } - if _, err := lib.db.ExecContext(context.Background(), - `INSERT INTO saved_trajectories (id, created_at, class, server, playstyle, mode, primary_json, gate_summary) - VALUES ('keep-me', ?, 'novice', 'uaro', 'pvm', 'pre-renewal', '{}', '{}')`, - time.Now().UTC()); err != nil { - t.Fatalf("insert saved_trajectory: %v", err) - } - _ = lib.Close() - - // Second open: should be a no-op for saved_trajectories. - lib2, err := Open(dbPath) - if err != nil { - t.Fatalf("second Open: %v", err) - } - t.Cleanup(func() { _ = lib2.Close() }) - - var n int - if err := lib2.db.QueryRowContext(context.Background(), - `SELECT count(*) FROM saved_trajectories WHERE id='keep-me'`).Scan(&n); err != nil { - t.Fatalf("query: %v", err) - } - if n != 1 { - t.Fatalf("saved_trajectories row destroyed by second Open: got %d, want 1", n) - } -} - -func TestMigrate_FKHoldsAcrossPoolConnections(t *testing.T) { - lib := openTempLibrary(t) - ctx := context.Background() - - // Issue several parallel writes through the connection pool to - // exercise multiple distinct connections. Each must reject the - // orphan insert. - const N = 8 - errs := make(chan error, N) - for i := 0; i < N; i++ { - go func() { - _, err := lib.db.ExecContext(ctx, - `INSERT INTO saved_trajectories (id, created_at, class, server, playstyle, mode, primary_json, gate_summary) - VALUES ('orphan-`+randID(t)+`', ?, 'x', 'x', 'x', 'x', '{}', '{}')`, - time.Now().UTC()) - errs <- err - }() - } - for i := 0; i < N; i++ { - if err := <-errs; err == nil { - t.Fatalf("attempt %d: expected FK violation, got nil", i) - } - } -} - -// randID returns a short random hex string for test row keys. -func randID(t *testing.T) string { - t.Helper() - var b [4]byte - if _, err := rand.Read(b[:]); err != nil { - t.Fatalf("rand: %v", err) - } - return hex.EncodeToString(b[:]) -} diff --git a/internal/buildlibrary/maintest_test.go b/internal/buildlibrary/maintest_test.go new file mode 100644 index 0000000..d5a268a --- /dev/null +++ b/internal/buildlibrary/maintest_test.go @@ -0,0 +1,85 @@ +package buildlibrary + +import ( + "context" + "flag" + "fmt" + "os" + "testing" + "time" + + "github.com/testcontainers/testcontainers-go" + "github.com/testcontainers/testcontainers-go/modules/postgres" + "github.com/testcontainers/testcontainers-go/wait" +) + +// testDSN points at the shared package-level Postgres container. Empty +// under -short (no container started). +var testDSN string + +func TestMain(m *testing.M) { + flag.Parse() + if testing.Short() { + os.Exit(m.Run()) + } + ctx := context.Background() + ctr, err := postgres.Run(ctx, "pgvector/pgvector:pg17", + postgres.WithDatabase("robuilder_test"), + postgres.WithUsername("test"), + postgres.WithPassword("test"), + testcontainers.WithWaitStrategy( + wait.ForLog("database system is ready to accept connections"). + WithOccurrence(2).WithStartupTimeout(60*time.Second)), + ) + if err != nil { + fmt.Fprintln(os.Stderr, "testcontainers postgres start:", err) + os.Exit(1) + } + dsn, err := ctr.ConnectionString(ctx, "sslmode=disable") + if err != nil { + fmt.Fprintln(os.Stderr, "connection string:", err) + os.Exit(1) + } + testDSN = dsn + code := m.Run() + _ = ctr.Terminate(ctx) + os.Exit(code) +} + +// newTestLibrary opens a Library against the shared container and +// truncates both tables so each test starts clean. Skips under -short. +func newTestLibrary(t *testing.T) *Library { + t.Helper() + if testing.Short() { + t.Skip("requires Postgres (testcontainers); skipped under -short") + } + lib, err := Open(context.Background(), testDSN) + if err != nil { + t.Fatalf("Open: %v", err) + } + t.Cleanup(func() { _ = lib.Close() }) + if err := lib.Truncate(context.Background()); err != nil { + t.Fatalf("truncate: %v", err) + } + return lib +} + +func TestOpen_AppliesMigrationsAndCountsEmpty(t *testing.T) { + lib := newTestLibrary(t) + if err := lib.Ping(context.Background()); err != nil { + t.Fatalf("Ping: %v", err) + } + n, err := lib.Count(context.Background()) + if err != nil { + t.Fatalf("Count: %v", err) + } + if n != 0 { + t.Fatalf("Count = %d, want 0", n) + } +} + +func TestOpen_RejectsEmptyDSN(t *testing.T) { + if _, err := Open(context.Background(), ""); err == nil { + t.Error("expected error from Open with empty dsn") + } +} diff --git a/internal/buildlibrary/migrations/000001_init.down.sql b/internal/buildlibrary/migrations/000001_init.down.sql new file mode 100644 index 0000000..d6841b4 --- /dev/null +++ b/internal/buildlibrary/migrations/000001_init.down.sql @@ -0,0 +1,2 @@ +DROP TABLE IF EXISTS saved_trajectories; +DROP TABLE IF EXISTS generations; diff --git a/internal/buildlibrary/migrations/000001_init.up.sql b/internal/buildlibrary/migrations/000001_init.up.sql new file mode 100644 index 0000000..bedde53 --- /dev/null +++ b/internal/buildlibrary/migrations/000001_init.up.sql @@ -0,0 +1,33 @@ +CREATE TABLE generations ( + id TEXT PRIMARY KEY, + status TEXT NOT NULL CHECK (status IN ('queued','running','completed','failed')), + created_at TIMESTAMPTZ NOT NULL, + started_at TIMESTAMPTZ, + completed_at TIMESTAMPTZ, + request_json JSONB NOT NULL, + attempts INTEGER NOT NULL DEFAULT 0, + failure_reason TEXT, + error_detail TEXT, + trace_json JSONB, + lease_expires_at TIMESTAMPTZ, + lease_owner TEXT +); +CREATE INDEX idx_generations_status_created ON generations (status, created_at); +CREATE INDEX idx_generations_lease ON generations (status, lease_expires_at); + +CREATE TABLE saved_trajectories ( + id TEXT PRIMARY KEY REFERENCES generations(id), + created_at TIMESTAMPTZ NOT NULL, + class TEXT NOT NULL, + server TEXT NOT NULL, + playstyle TEXT NOT NULL, + mode TEXT NOT NULL, + description TEXT, + primary_json JSONB NOT NULL, + alternatives_json JSONB, + final_text TEXT, + gate_summary JSONB NOT NULL, + calc_version TEXT, + catalog_version INTEGER +); +CREATE INDEX idx_saved_trajectories_lookup ON saved_trajectories (server, class, created_at DESC); diff --git a/internal/buildlibrary/save.go b/internal/buildlibrary/save.go index 0dabaed..fd9b78f 100644 --- a/internal/buildlibrary/save.go +++ b/internal/buildlibrary/save.go @@ -22,6 +22,7 @@ import ( // async job tracking row and the saved trajectory share the same key. type SaveInput struct { ID string // required; must match an existing generations.id + Owner string // lease owner that claimed this generation; scopes the completion UPDATE Class string Server string Playstyle string @@ -34,6 +35,15 @@ type SaveInput struct { CatalogVersion int } +// insertSavedTrajectory is the shared INSERT used by Save and SaveAndComplete. +const insertSavedTrajectory = ` +INSERT INTO saved_trajectories + (id, created_at, class, server, playstyle, mode, description, + primary_json, alternatives_json, final_text, gate_summary, + calc_version, catalog_version) +VALUES ($1, $2, $3, $4, $5, $6, $7, $8::jsonb, $9::jsonb, $10, $11::jsonb, $12, $13) +` + // ErrFailingGates is returned by Save when at least one scored snapshot // in Primary or Alternatives carries a fail / fail_hard gate result. // The library rejects rather than persisting junk. @@ -93,14 +103,7 @@ func (l *Library) Save(ctx context.Context, in SaveInput) (string, error) { return "", fmt.Errorf("marshal gate_summary: %w", err) } - const stmt = ` -INSERT INTO saved_trajectories - (id, created_at, class, server, playstyle, mode, description, - primary_json, alternatives_json, final_text, gate_summary, - calc_version, catalog_version) -VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) -` - if _, err := l.db.ExecContext(ctx, stmt, + if _, err := l.db.ExecContext(ctx, insertSavedTrajectory, in.ID, time.Now().UTC(), in.Class, in.Server, in.Playstyle, in.Mode, in.Description, string(primaryJSON), nullableJSON(altsJSON), in.FinalText, string(summaryJSON), @@ -113,9 +116,11 @@ VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) // SaveAndComplete atomically inserts the trajectory into saved_trajectories // AND marks the corresponding generation as completed, inside a single -// BEGIN IMMEDIATE transaction. A process crash between the two writes -// cannot leave an orphaned saved_trajectories row whose generation shows -// as failed in RecoverOrphans. +// transaction. A process crash between the two writes cannot leave an +// orphaned saved_trajectories row whose generation shows as failed in +// RecoverOrphans. The UPDATE is scoped to lease_owner=in.Owner so a stale +// worker that lost its lease cannot accidentally complete a job it no +// longer owns. // // Prefer this over calling Save + MarkCompleted separately. Save is kept // for callers (tests, tooling) that do not own a generation row. @@ -146,29 +151,18 @@ func (l *Library) SaveAndComplete(ctx context.Context, in SaveInput) (string, er return "", fmt.Errorf("marshal gate_summary: %w", err) } - conn, err := l.db.Conn(ctx) + tx, err := l.db.BeginTx(ctx, nil) if err != nil { - return "", fmt.Errorf("acquire conn: %w", err) - } - defer func() { _ = conn.Close() }() - - if _, err := conn.ExecContext(ctx, "BEGIN IMMEDIATE"); err != nil { - return "", fmt.Errorf("begin immediate: %w", err) + return "", fmt.Errorf("begin: %w", err) } committed := false defer func() { if !committed { - _, _ = conn.ExecContext(context.Background(), "ROLLBACK") + _ = tx.Rollback() } }() - const insertStmt = ` -INSERT INTO saved_trajectories - (id, created_at, class, server, playstyle, mode, description, - primary_json, alternatives_json, final_text, gate_summary, - calc_version, catalog_version) -VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)` - if _, err := conn.ExecContext(ctx, insertStmt, + if _, err := tx.ExecContext(ctx, insertSavedTrajectory, in.ID, time.Now().UTC(), in.Class, in.Server, in.Playstyle, in.Mode, in.Description, string(primaryJSON), nullableJSON(altsJSON), in.FinalText, string(summaryJSON), @@ -177,10 +171,11 @@ VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)` return "", fmt.Errorf("insert: %w", err) } - res, err := conn.ExecContext(ctx, ` + res, err := tx.ExecContext(ctx, ` UPDATE generations - SET status='completed', completed_at=? - WHERE id=? AND status IN ('queued','running')`, time.Now().UTC(), in.ID) + SET status='completed', completed_at=$1, lease_expires_at=NULL, lease_owner=NULL + WHERE id=$2 AND status='running' AND lease_owner=$3`, + time.Now().UTC(), in.ID, in.Owner) if err != nil { return "", fmt.Errorf("mark completed: %w", err) } @@ -188,7 +183,7 @@ UPDATE generations return "", fmt.Errorf("buildlibrary.SaveAndComplete id=%s: %w", in.ID, ErrAlreadyTerminal) } - if _, err := conn.ExecContext(ctx, "COMMIT"); err != nil { + if err := tx.Commit(); err != nil { return "", fmt.Errorf("commit: %w", err) } committed = true diff --git a/internal/scoring/client_test.go b/internal/scoring/client_test.go index ebb931b..21c19e5 100644 --- a/internal/scoring/client_test.go +++ b/internal/scoring/client_test.go @@ -291,6 +291,9 @@ func TestIntegration_DefaultNoviceMatchesShimBaseline(t *testing.T) { MaxHP: 40, MaxSP: 11, StatPointsRemaining: 48, + // Default Novice with all stats at 1; gear + cards = none, so + // TotalStats matches the raw stat allocation exactly. + TotalStats: Stats{Str: 1, Agi: 1, Vit: 1, Int: 1, Dex: 1, Luk: 1}, } if resp.Derived != want { t.Errorf("derived: got %+v want %+v", resp.Derived, want) diff --git a/internal/workers/maintest_test.go b/internal/workers/maintest_test.go new file mode 100644 index 0000000..fd6a156 --- /dev/null +++ b/internal/workers/maintest_test.go @@ -0,0 +1,45 @@ +package workers + +import ( + "context" + "flag" + "fmt" + "os" + "testing" + "time" + + "github.com/testcontainers/testcontainers-go" + "github.com/testcontainers/testcontainers-go/modules/postgres" + "github.com/testcontainers/testcontainers-go/wait" +) + +var testDSN string + +func TestMain(m *testing.M) { + flag.Parse() + if testing.Short() { + os.Exit(m.Run()) + } + ctx := context.Background() + ctr, err := postgres.Run(ctx, "pgvector/pgvector:pg17", + postgres.WithDatabase("robuilder_test"), + postgres.WithUsername("test"), + postgres.WithPassword("test"), + testcontainers.WithWaitStrategy( + wait.ForLog("database system is ready to accept connections"). + WithOccurrence(2).WithStartupTimeout(60*time.Second)), + ) + if err != nil { + fmt.Fprintln(os.Stderr, "testcontainers postgres start:", err) + os.Exit(1) + } + dsn, err := ctr.ConnectionString(ctx, "sslmode=disable") + if err != nil { + fmt.Fprintln(os.Stderr, "connection string:", err) + os.Exit(1) + } + testDSN = dsn + code := m.Run() + _ = ctr.Terminate(ctx) + os.Exit(code) +} diff --git a/internal/workers/pool.go b/internal/workers/pool.go index 3a67e30..15ac34a 100644 --- a/internal/workers/pool.go +++ b/internal/workers/pool.go @@ -7,6 +7,8 @@ package workers import ( "context" + "crypto/rand" + "encoding/hex" "encoding/json" "errors" "fmt" @@ -29,15 +31,19 @@ type Runner interface { // SaveCallback is invoked after a successful Generate to persist the // trajectory to saved_trajectories. nil disables saving; useful in -// tests; production wires it. -type SaveCallback func(ctx context.Context, id string, req orchestrator.GenerateRequest, res *orchestrator.GenerateResult) error +// tests; production wires it. owner is the lease owner that claimed +// the generation and must be threaded into the save transaction. +type SaveCallback func(ctx context.Context, id, owner string, req orchestrator.GenerateRequest, res *orchestrator.GenerateResult) error type Config struct { - Library *buildlibrary.Library - Runner Runner - Save SaveCallback - Workers int // default 1 - PollInterval time.Duration // default 5s + Library *buildlibrary.Library + Runner Runner + Save SaveCallback + Workers int // default 1 + PollInterval time.Duration // default 5s + LeaseTTL time.Duration // default 90s + SweepInterval time.Duration // default 30s + MaxAttempts int // 0 disables requeue (expired leases fail) } type Pool struct { @@ -55,6 +61,7 @@ type Pool struct { cancelJob context.CancelFunc wg sync.WaitGroup shuttingDown chan struct{} + ownerBase string } func New(cfg Config) *Pool { @@ -64,6 +71,15 @@ func New(cfg Config) *Pool { if cfg.PollInterval <= 0 { cfg.PollInterval = 5 * time.Second } + if cfg.LeaseTTL <= 0 { + cfg.LeaseTTL = 90 * time.Second + } + if cfg.SweepInterval <= 0 { + cfg.SweepInterval = 30 * time.Second + } + var buf [8]byte + _, _ = rand.Read(buf[:]) + ownerBase := hex.EncodeToString(buf[:]) pollCtx, cancelPoll := context.WithCancel(context.Background()) jobCtx, cancelJob := context.WithCancel(context.Background()) return &Pool{ @@ -74,10 +90,19 @@ func New(cfg Config) *Pool { jobCtx: jobCtx, cancelJob: cancelJob, shuttingDown: make(chan struct{}), + ownerBase: ownerBase, } } +// detachedCtx returns a context for cleanup/heartbeat DB writes that must +// outlive a cancelled job context but must not block shutdown forever. +func detachedCtx() (context.Context, context.CancelFunc) { + return context.WithTimeout(context.Background(), 10*time.Second) +} + func (p *Pool) Start() { + p.wg.Add(1) + go p.runSweeper() for i := 0; i < p.cfg.Workers; i++ { p.wg.Add(1) go p.runWorker(i) @@ -85,6 +110,32 @@ func (p *Pool) Start() { p.Notify() } +func (p *Pool) runSweeper() { + defer p.wg.Done() + logger := slog.Default().With(slog.String("component", "lease-sweeper")) + sweep := func() { + rq, fl, err := p.cfg.Library.RecoverExpiredLeases(context.Background(), p.cfg.MaxAttempts) + if err != nil { + logger.Warn("sweep failed", slog.String("error", err.Error())) + return + } + if rq > 0 || fl > 0 { + logger.Info("recovered expired leases", slog.Int("requeued", rq), slog.Int("failed", fl)) + } + } + sweep() // immediate first pass + t := time.NewTicker(p.cfg.SweepInterval) + defer t.Stop() + for { + select { + case <-p.pollCtx.Done(): + return + case <-t.C: + sweep() + } + } +} + // Notify rings the doorbell. Used by the POST handler after enqueueing // and by the cascade from workers that just claimed a job. func (p *Pool) Notify() { @@ -127,6 +178,7 @@ func (p *Pool) Shutdown(timeout time.Duration) error { func (p *Pool) runWorker(id int) { defer p.wg.Done() + owner := fmt.Sprintf("%s-%d", p.ownerBase, id) logger := slog.Default().With(slog.Int("worker_id", id)) for { select { @@ -136,14 +188,13 @@ func (p *Pool) runWorker(id int) { case <-time.After(p.cfg.PollInterval): } - g, err := p.cfg.Library.ClaimNext(p.jobCtx) + g, err := p.cfg.Library.ClaimNext(p.jobCtx, owner, p.cfg.LeaseTTL) if err != nil { if errors.Is(err, context.Canceled) { return } logger.Warn("claim failed", slog.String("error", err.Error())) - // Short backoff so sustained SQLite lock contention doesn't - // busy-spin and flood the log with one warn per attempt. + // Short backoff so transient DB errors don't busy-spin and flood the log. time.Sleep(250 * time.Millisecond) continue } @@ -151,13 +202,19 @@ func (p *Pool) runWorker(id int) { continue } p.Notify() // cascade; wake another idle worker - p.runJob(logger, g) + p.runJob(logger, g, owner) } } -func (p *Pool) runJob(logger *slog.Logger, g *buildlibrary.Generation) { +func (p *Pool) runJob(logger *slog.Logger, g *buildlibrary.Generation, owner string) { + jobCtxJob, cancel := context.WithCancel(p.jobCtx) + hbDone := make(chan struct{}) + go p.heartbeat(jobCtxJob, g.ID, owner, cancel, hbDone) + var stopOnce sync.Once + stopHeartbeat := func() { stopOnce.Do(func() { cancel(); <-hbDone }) } + jobLog := logger.With(slog.String("generation_id", g.ID)) - jobCtx := logging.WithLogger(p.jobCtx, jobLog) + jobCtx := logging.WithLogger(jobCtxJob, jobLog) // A panic in Runner.Run (LLM client, sidecar decode, nil-map deref) // otherwise leaves the row in 'running' forever. Recover, mark the @@ -168,16 +225,25 @@ func (p *Pool) runJob(logger *slog.Logger, g *buildlibrary.Generation) { return } stack := debug.Stack() - _ = p.cfg.Library.MarkFailed(context.Background(), g.ID, + ctx, cfn := detachedCtx() + defer cfn() + _ = p.cfg.Library.MarkFailed(ctx, g.ID, owner, buildlibrary.FailureProviderError, "panic: "+fmt.Sprint(r), nil) jobLog.Error("panic in runJob", slog.Any("panic", r), slog.String("stack", string(stack))) }() + // Safety net: stops heartbeat on any exit path including panic (LIFO, + // runs before the panic-recovery defer above so the lease is clear + // before MarkFailed writes). + defer stopHeartbeat() + var req orchestrator.GenerateRequest if err := json.Unmarshal(g.RequestJSON, &req); err != nil { - _ = p.cfg.Library.MarkFailed(context.Background(), g.ID, + ctx, cfn := detachedCtx() + defer cfn() + _ = p.cfg.Library.MarkFailed(ctx, g.ID, owner, buildlibrary.FailureValidationLate, "request_json malformed: "+err.Error(), nil) jobLog.Error("decode request_json", slog.String("error", err.Error())) return @@ -185,6 +251,12 @@ func (p *Pool) runJob(logger *slog.Logger, g *buildlibrary.Generation) { jobLog.Info("job claimed") res, err := p.cfg.Runner.Run(jobCtx, req) + + // Stop the heartbeat before any terminal DB write so a tick between + // the write clearing the lease and the deferred cancel cannot log a + // spurious "lease lost" warning. + stopHeartbeat() + if err != nil { reason := buildlibrary.FailureProviderError detail := err.Error() @@ -203,9 +275,9 @@ func (p *Pool) runJob(logger *slog.Logger, g *buildlibrary.Generation) { reason = buildlibrary.FailureShutdownInterrupt detail = "shutdown drain timeout exceeded" } - // Use a non-cancelled ctx for the cleanup write; the jobCtx - // may already be done. - if mErr := p.cfg.Library.MarkFailed(context.Background(), g.ID, reason, detail, traceJSON(res)); mErr != nil && !errors.Is(mErr, buildlibrary.ErrAlreadyTerminal) { + ctx, cfn := detachedCtx() + defer cfn() + if mErr := p.cfg.Library.MarkFailed(ctx, g.ID, owner, reason, detail, traceJSON(res)); mErr != nil && !errors.Is(mErr, buildlibrary.ErrAlreadyTerminal) { jobLog.Error("mark failed", slog.String("error", mErr.Error())) } jobLog.Warn("job failed", slog.String("reason", string(reason)), slog.String("detail", detail)) @@ -220,8 +292,12 @@ func (p *Pool) runJob(logger *slog.Logger, g *buildlibrary.Generation) { // Save is expected to call SaveAndComplete, which atomically writes // saved_trajectories AND marks the generation completed. Do not call // MarkCompleted separately; the transaction already did it. - if err := p.cfg.Save(context.Background(), g.ID, req, res); err != nil { - if mErr := p.cfg.Library.MarkFailed(context.Background(), g.ID, + saveCtx, saveCfn := detachedCtx() + defer saveCfn() + if err := p.cfg.Save(saveCtx, g.ID, owner, req, res); err != nil { + ctx, cfn := detachedCtx() + defer cfn() + if mErr := p.cfg.Library.MarkFailed(ctx, g.ID, owner, buildlibrary.FailureValidationLate, "save failed: "+err.Error(), traceJSON(res)); mErr != nil && !errors.Is(mErr, buildlibrary.ErrAlreadyTerminal) { jobLog.Error("mark failed (save error path)", slog.String("error", mErr.Error())) } @@ -233,7 +309,9 @@ func (p *Pool) runJob(logger *slog.Logger, g *buildlibrary.Generation) { } // Save is nil (tests or no-persist mode): mark completed directly. - if err := p.cfg.Library.MarkCompleted(context.Background(), g.ID); err != nil { + ctx, cfn := detachedCtx() + defer cfn() + if err := p.cfg.Library.MarkCompleted(ctx, g.ID, owner); err != nil { if !errors.Is(err, buildlibrary.ErrAlreadyTerminal) { jobLog.Error("mark completed", slog.String("error", err.Error())) } @@ -242,6 +320,39 @@ func (p *Pool) runJob(logger *slog.Logger, g *buildlibrary.Generation) { jobLog.Info("job completed") } +// heartbeat renews g's lease every LeaseTTL/3 while the job runs. If a +// renewal reports the lease lost (RowsAffected 0), it cancels the job +// context so the in-flight Runner aborts. Closes done on return. +func (p *Pool) heartbeat(ctx context.Context, id, owner string, cancel context.CancelFunc, done chan struct{}) { + defer close(done) + interval := p.cfg.LeaseTTL / 3 + if interval <= 0 { + interval = time.Second + } + t := time.NewTicker(interval) + defer t.Stop() + for { + select { + case <-ctx.Done(): + return + case <-t.C: + ctx, cfn := detachedCtx() + ok, err := p.cfg.Library.RenewLease(ctx, id, owner, p.cfg.LeaseTTL) + cfn() + if err != nil { + slog.Default().Warn("lease renew error", + slog.String("generation_id", id), slog.String("error", err.Error())) + continue + } + if !ok { + slog.Default().Warn("lease lost; aborting job", slog.String("generation_id", id)) + cancel() + return + } + } + } +} + // traceJSON marshals the trace (if any) on a result so MarkFailed can // store it for forensics. Returns nil on no result or on marshal error. func traceJSON(res *orchestrator.GenerateResult) json.RawMessage { diff --git a/internal/workers/pool_test.go b/internal/workers/pool_test.go index 7ae24ab..9e19171 100644 --- a/internal/workers/pool_test.go +++ b/internal/workers/pool_test.go @@ -3,7 +3,6 @@ package workers import ( "context" "encoding/json" - "path/filepath" "sync" "testing" "time" @@ -48,12 +47,17 @@ func (r *fakeRunner) callCount() int { func newTestLib(t *testing.T) *buildlibrary.Library { t.Helper() - dir := t.TempDir() - lib, err := buildlibrary.Open(filepath.Join(dir, "test.db")) + if testing.Short() { + t.Skip("requires Postgres (testcontainers); skipped under -short") + } + lib, err := buildlibrary.Open(context.Background(), testDSN) if err != nil { t.Fatalf("Open: %v", err) } t.Cleanup(func() { _ = lib.Close() }) + if err := lib.Truncate(context.Background()); err != nil { + t.Fatalf("truncate: %v", err) + } return lib } @@ -162,6 +166,38 @@ func TestPool_ShutdownTimeoutCancelsJob(t *testing.T) { }) } +func TestPool_HeartbeatKeepsLongJobAlive(t *testing.T) { + ctx := context.Background() + lib := newTestLib(t) + id, _ := lib.Enqueue(ctx, json.RawMessage(`{"class":"novice"}`)) + + // Job runs 1.5s, lease TTL 600ms (heartbeat ~200ms), sweeper every + // 150ms. Without renewal the sweeper would fail the job at ~600ms; + // the heartbeat keeps it alive so it completes. + runner := &fakeRunner{ + result: &orchestrator.GenerateResult{Primary: &domain.Trajectory{Class: "novice"}}, + delay: 1500 * time.Millisecond, + } + pool := New(Config{ + Library: lib, Runner: runner, Workers: 1, + PollInterval: 50 * time.Millisecond, + LeaseTTL: 600 * time.Millisecond, + SweepInterval: 150 * time.Millisecond, + MaxAttempts: 0, + }) + pool.Start() + t.Cleanup(func() { _ = pool.Shutdown(3 * time.Second) }) + pool.Notify() + + waitFor(t, 3*time.Second, func() bool { + g, err := lib.GetGeneration(ctx, id) + return err == nil && g.Status == buildlibrary.GenStatusCompleted + }) + if runner.callCount() != 1 { + t.Fatalf("runner calls: got %d, want 1", runner.callCount()) + } +} + func waitFor(t *testing.T, max time.Duration, cond func() bool) { t.Helper() deadline := time.Now().Add(max) diff --git a/scripts/e2e.sh b/scripts/e2e.sh index ef5999f..308d80f 100755 --- a/scripts/e2e.sh +++ b/scripts/e2e.sh @@ -67,6 +67,7 @@ cleanup() { kill "$SIDECAR_PID" 2>/dev/null || true fi wait 2>/dev/null || true + docker rm -f "${E2E_PG_NAME:-}" >/dev/null 2>&1 || true if (( code != 0 )); then echo echo "[e2e] FAILED (exit $code); diagnostics follow:" @@ -86,12 +87,26 @@ trap cleanup EXIT # 7401/8080 doesn't fight this script. E2E_SIDECAR_PORT=17401 E2E_API_PORT=18080 -E2E_DB="$TMP/buildlibrary.db" SIDECAR_URL="http://localhost:$E2E_SIDECAR_PORT" API_URL="http://localhost:$E2E_API_PORT" +E2E_PG_NAME="ro-builder-e2e-pg-$$" +E2E_PG_PORT=15432 +docker run -d --rm --name "$E2E_PG_NAME" \ + -e POSTGRES_USER=robuilder -e POSTGRES_PASSWORD=robuilder -e POSTGRES_DB=robuilder \ + -p "$E2E_PG_PORT:5432" pgvector/pgvector:pg17 >/dev/null +E2E_DATABASE_URL="postgres://robuilder:robuilder@localhost:$E2E_PG_PORT/robuilder?sslmode=disable" +for _ in $(seq 1 60); do + if docker exec "$E2E_PG_NAME" pg_isready -U robuilder -d robuilder >/dev/null 2>&1; then break; fi + sleep 0.5 +done +if ! docker exec "$E2E_PG_NAME" pg_isready -U robuilder -d robuilder >/dev/null 2>&1; then + echo "[e2e] postgres did not become ready within 30s" >&2 + exit 1 +fi + echo "[e2e] tempdir: $TMP" -echo "[e2e] sidecar :$E2E_SIDECAR_PORT api :$E2E_API_PORT db $E2E_DB" +echo "[e2e] sidecar :$E2E_SIDECAR_PORT api :$E2E_API_PORT pg localhost:$E2E_PG_PORT" # --- sidecar --- echo "[e2e] starting sidecar" @@ -138,7 +153,7 @@ echo "[e2e] starting api" ( ADDR=":$E2E_API_PORT" \ SIDECAR_URL="$SIDECAR_URL" \ - BUILDLIBRARY_PATH="$E2E_DB" \ + DATABASE_URL="$E2E_DATABASE_URL" \ exec "$TMP/api" ) >"$TMP/api.log" 2>&1 & API_PID=$! diff --git a/scripts/generate.sh b/scripts/generate.sh index 5e3be2d..da4d08f 100755 --- a/scripts/generate.sh +++ b/scripts/generate.sh @@ -63,6 +63,7 @@ cleanup() { if [[ -n "${API_PID:-}" ]]; then kill "$API_PID" 2>/dev/null || true; fi if [[ -n "${SIDECAR_PID:-}" ]]; then kill "$SIDECAR_PID" 2>/dev/null || true; fi wait 2>/dev/null || true + docker rm -f "${GEN_PG_NAME:-}" >/dev/null 2>&1 || true if (( code != 0 )) && [[ -f "$TMP/api.log" ]]; then echo echo "[generate] FAILED (exit $code); api.log tail:" @@ -77,9 +78,24 @@ trap cleanup EXIT # the dev defaults (7401/8080) and e2e.sh's reserved ports (17401/18080). GEN_SIDECAR_PORT="$(shuf -i 20000-29999 -n 1)" GEN_API_PORT="$(shuf -i 30000-39999 -n 1)" +GEN_PG_PORT="$(shuf -i 40000-49999 -n 1)" SIDECAR_URL="http://localhost:$GEN_SIDECAR_PORT" API_URL="http://localhost:$GEN_API_PORT" -GEN_DB="$TMP/buildlibrary.db" + +GEN_PG_NAME="ro-builder-gen-pg-$$" +echo "[generate] starting postgres on :$GEN_PG_PORT" +docker run -d --rm --name "$GEN_PG_NAME" \ + -e POSTGRES_USER=robuilder -e POSTGRES_PASSWORD=robuilder -e POSTGRES_DB=robuilder \ + -p "$GEN_PG_PORT:5432" pgvector/pgvector:pg17 >/dev/null +GEN_DATABASE_URL="postgres://robuilder:robuilder@localhost:$GEN_PG_PORT/robuilder?sslmode=disable" +for _ in $(seq 1 60); do + if docker exec "$GEN_PG_NAME" pg_isready -U robuilder -d robuilder >/dev/null 2>&1; then break; fi + sleep 0.5 +done +if ! docker exec "$GEN_PG_NAME" pg_isready -U robuilder -d robuilder >/dev/null 2>&1; then + echo "[generate] postgres did not become ready within 30s" >&2 + exit 1 +fi echo "[generate] request: $REQUEST_LABEL" @@ -105,7 +121,7 @@ echo "[generate] building + starting api on :$GEN_API_PORT" go build -o "$TMP/api" ./cmd/api >"$TMP/api-build.log" 2>&1 \ || { echo "[generate] api build failed"; tail -20 "$TMP/api-build.log" >&2; exit 1; } ( - ADDR=":$GEN_API_PORT" SIDECAR_URL="$SIDECAR_URL" BUILDLIBRARY_PATH="$GEN_DB" \ + ADDR=":$GEN_API_PORT" SIDECAR_URL="$SIDECAR_URL" DATABASE_URL="$GEN_DATABASE_URL" \ exec "$TMP/api" ) >"$TMP/api.log" 2>&1 & API_PID=$! diff --git a/scripts/k8s-e2e.sh b/scripts/k8s-e2e.sh index 4c7f50a..fad8257 100755 --- a/scripts/k8s-e2e.sh +++ b/scripts/k8s-e2e.sh @@ -58,14 +58,19 @@ main() { # shell env (Taskfile.yml's dotenv loads .env automatically when invoked # via `task tilt:e2e`; when run directly, source .env first or export the # var). If LLM_API_KEY is unset, we use 'stub' and skip the /generate slice. + # DB creds use fixed local defaults (POSTGRES_PASSWORD=robuilder) matching + # the bundled Postgres StatefulSet; DATABASE_URL uses the release-scoped + # service name. if [[ -z "${LLM_API_KEY:-}" && -f .env ]]; then # shellcheck disable=SC1091 LLM_API_KEY=$(grep -E '^LLM_API_KEY=' .env | head -n1 | cut -d= -f2- | tr -d '"' | tr -d "'") export LLM_API_KEY fi - log "Applying namespaced Secret (LLM_API_KEY: ${LLM_API_KEY:+set}${LLM_API_KEY:-stub})..." + log "Applying namespaced Secret (LLM_API_KEY: ${LLM_API_KEY:+set}${LLM_API_KEY:-stub}; POSTGRES_PASSWORD + DATABASE_URL: bundled defaults)..." kubectl -n "$NAMESPACE" create secret generic ro-builder-env \ --from-literal=LLM_API_KEY="${LLM_API_KEY:-stub}" \ + --from-literal=POSTGRES_PASSWORD=robuilder \ + --from-literal=DATABASE_URL="postgres://robuilder:robuilder@${RELEASE}-postgres:5432/robuilder?sslmode=disable" \ --dry-run=client -o yaml | kubectl apply -f - log "Installing chart ($RELEASE in $NAMESPACE)..." diff --git a/scripts/seal-secret.sh b/scripts/seal-secret.sh index 32b7a31..f714c0d 100755 --- a/scripts/seal-secret.sh +++ b/scripts/seal-secret.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# scripts/seal-secret.sh; encrypt LLM_API_KEY from .env into a SealedSecret. +# scripts/seal-secret.sh; encrypt LLM_API_KEY + Postgres creds from .env into a SealedSecret. # # Output: deploy/k8s/sealed-secrets/local.sealed-secret.yaml (gitignored). # Re-run any time .env changes. @@ -22,14 +22,21 @@ main() { # Source .env in a subshell so we don't pollute the caller's env. # shellcheck disable=SC1090 - local LLM_API_KEY + local LLM_API_KEY POSTGRES_PASSWORD DATABASE_URL LLM_API_KEY=$(grep -E '^LLM_API_KEY=' "$ENV_FILE" | head -n1 | cut -d= -f2- | tr -d '"' | tr -d "'") + POSTGRES_PASSWORD=$(grep -E '^POSTGRES_PASSWORD=' "$ENV_FILE" | head -n1 | cut -d= -f2- | tr -d '"' | tr -d "'") if [[ -z "$LLM_API_KEY" ]]; then err "LLM_API_KEY is empty in $ENV_FILE. Fill it in before sealing." exit 1 fi + # Default POSTGRES_PASSWORD to 'robuilder' if not set in .env. + POSTGRES_PASSWORD="${POSTGRES_PASSWORD:-robuilder}" + # In-cluster DATABASE_URL points at the bundled Postgres service, not localhost. + local PG_HOST="ro-builder-postgres" + DATABASE_URL="postgres://robuilder:${POSTGRES_PASSWORD}@${PG_HOST}:5432/robuilder?sslmode=disable" + if ! command -v kubeseal >/dev/null 2>&1; then err "kubeseal not found on PATH. Run scripts/k8s-bootstrap.sh first." exit 1 @@ -45,6 +52,8 @@ main() { plaintext=$(kubectl create secret generic "$SECRET_NAME" \ --namespace "$NAMESPACE" \ --from-literal=LLM_API_KEY="$LLM_API_KEY" \ + --from-literal=POSTGRES_PASSWORD="$POSTGRES_PASSWORD" \ + --from-literal=DATABASE_URL="$DATABASE_URL" \ --dry-run=client -o yaml) log "Sealing against the cluster's controller key..."