Created
Jun 24, 07:40
Started
Jun 25, 04:22
Completed
Jun 25, 05:32
DevOps handoff
Type
Bug
Shape
backend
Worktree Slug
worktree-db-name-overflow
Repositories
mcritchie-studio
Release Train
—
Branch
feat/worktree-db-name-overflow
Acceptance Criteria
Expected Test Plan
Checks Run
Agent Context
Flagged by steffon during mascot-marker rework: the worktree dev DB name 'mcritchie_studio_development_mascot_marker_no_downgrade_fallback' is exactly at PostgreSQL's 63-char identifier limit and gets truncated inconsistently, so db:check_protected_environments / db:test:prepare can't find it and the full Rails suite + CI break in long-slug worktrees. (DB-less tests dodge it.) bin/agent-worktree's DB-naming scheme should hash/truncate long slugs to reserve headroom under 63 chars (and keep dev/test names consistent).
Stage Timeline
Who handled each stage, the time it took (measured), and the model / tokens / cost reported (best-effort) — plus who's on it right now. — means the agent didn't report that metric.
Conversation
QA review feedback, agent handoffs, and follow-up notes for this task.
CONDUCTOR CI-GATE BLOCK (both seniors APPROVED the code, but missed CI): the PR's own new [integration] test 'db:test:prepare for a long-slug worktree' FAILS on CI — PG::ConnectionBad / ActiveRecord::ConnectionNotEstablished 'fe_sendauth: no password supplied' connecting to ::1:5432. It passes locally only because dev Postgres uses socket/trust auth; the shelled-out 'bin/rails db:test:prepare' subprocess does NOT inherit CI's PG credentials (host/user/password). Lone failure: 1565 runs, 1 failure. The bounded_db_slug code fix itself is correct + collision-resistant (Carl+Jasper verified, 4 new + 31-file tests green locally) — ONLY the integration test is not CI-portable. FIX: pass the DB connection to the subprocess (export DATABASE_URL, or PGHOST/PGUSER/PGPASSWORD from ENV) before invoking db:test:prepare, OR skip the [integration] test when CI PG creds are absent (keep the [unit] length/collision tests, which are CI-safe). Confirm the 'test' CI job goes GREEN before resubmitting — verify on CI, not local. Also un-draft the PR.
QA verdict: BLOCK (CI red). Core fix in bin/agent-worktree is CORRECT — verified the boundary math: the longest minted identifier (the _development_ name) lands at exactly 63 (never 64) for both mcritchie-studio and the shorter turf-monster prefix (max_len = 63 - prefix.length); fitting slugs pass through byte-for-byte (no churn); long slugs get a deterministic 8-hex SHA256 suffix; distinct long slugs sharing a 25-char prefix do NOT collide; dev/test share an identical base so db:test:prepare resolves. The 3 unit tests PASSED on CI. The block is ONE broken test, not the fix. DEFECT: the new [integration] 'db:test:prepare provisions a findable long-slug test DB' (test/commands/agent_worktree_test.rb ~L531-553) hardcodes credential-less connection strings — DATABASE_URL/TEST_DATABASE_URL = 'postgresql://localhost/<db>' and bare psql/dropdb with psql_env={PATH only}. On CI Postgres requires a password (CI sets DATABASE_URL=***localhost:5432), so the subprocess dies with 'fe_sendauth: no password supplied' BEFORE exercising the fix → 1 failure / 1565 runs (run 28146111302). It passes locally on trust-auth PG, which masked the gap. FIX: derive host/port/user/password from the CI-provided ENV['DATABASE_URL'] (URI.parse, swap only the database-name path segment) for both the db:test:prepare child env AND the trailing psql/dropdb (pass PGHOST/PGPORT/PGUSER/PGPASSWORD or a full conninfo) — or skip when ENV['DATABASE_URL'] is blank, but prefer deriving so the regression actually runs on CI. Re-run until the test job is green. Also update the stale claim — PR body + devops.checks_run say '[suite] ... 31 runs green' / 'CI green', but CI is red; correct that on resubmit. No rebase needed: branch is 0 behind origin/release with a clean merge-tree. PR left as DRAFT.
Sealed-bid sizing
Edit →Alex (PM)
—
Avi (PO)
—
Dev
—
Actual
—
We emailed a one-tap sign-in link to . It expires shortly and can only be used once.
No email? Check spam, or close this and try again.