Repository navigation
Run an app's specs before its first preview - #80
Merged
Merged
Conversation
This was referenced Oct 11, 2026
From the next service deploy, a generated app's AGENTS.md says to run its specs before other work, and its README says to build the assets and run the specs before the first preview. The workshop notes sent the agent from Compile straight to bin/dev, and they took precedence over the app's own guides, so they would have skipped that step. The notes now set up the app and run its specs first, say what a failure in that first run means, and let the app's AGENTS.md and README govern testing. A NotImplementedError that names behavior listed under Behavior to write is work to do; any other failure is a First Draft defect. Both hold before the deploy, when apps have no stubs and every failure is a defect. System specs need a Selenium service that this Codespace leaves stopped, and only the bin/ci recipe in AGENTS.md started it. That file moves away at root Compile, so a plain bundle exec rspec failed every system spec. The notes now carry a start, use and stop recipe for every spec run. It starts the app's own Compose service, whose health check makes the wait mean ready, in the running container's Compose project, where Rails and the browser share a network. It runs the specs only once the browser is ready, always stops it, and keeps a failure's exit status. The status variable avoids zsh's read-only status.
raghubetina
force-pushed
the
spec-run-before-preview
branch
from
October 11, 2026 23:56
3bb971b to
589c884
Compare
This was referenced Oct 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
From the deploy of firstdraft/firstdraft#1103, a generated app's
AGENTS.mdsays to run its specs before other work, and its README says to build the assets and run the specs before the first preview. Two things in this Codespace would have broken that:~/.claude/CLAUDE.mdand~/.codex/AGENTS.mdsent the agent from Compile straight tobin/dev, and they took precedence over the app's own guides. After root Compile they are the only Drawing Board guidance a session sees.selenium:4444(SELENIUM_HOST,CAPYBARA_SERVER_HOST), butrunServicesleaves Selenium stopped, and only thebin/cirecipe inAGENTS.mdstarted it. That file moves under.firstdraft/design/at root Compile, so a plainbundle exec rspecfailed every system spec.This changes only
.devcontainer/workshop/app-instructions.md:AGENTS.mdand README.NotImplementedErrorthat names behavior listed under the README's Behavior to write is work to do; any other failure is a First Draft defect to tell the user about. Never edit or delete a generated spec to make it pass. Each sentence also holds before the deploy, when apps have no stubs and their README has no Behavior to write.seleniumservice, whose health check makes--waitmean ready, in the running container's Compose project, so Rails and the browser share a network. It runs the specs only once the browser is ready, always stops it, and exits nonzero if any step failed, under bash, sh and zsh (wherestatusis read-only, hencespec_run_status).Pins in
agent-versions.envare unchanged.Verified on local Docker Desktop (arm64), not in a Codespace. The Dev Containers CLI 0.89.0 started this branch with lifecycle commands skipped, from the pinned workspace image, with only
rails-appandpostgresrunning and the Codespace'sCAPYBARA_SERVER_HOST,SELENIUM_HOSTandDB_HOST. Then, without restarting the container, the Drawing Board moved under.firstdraft/design/and the Service's pinned Core tree (6eaeef54, from the archive whose SHA-256 the Compiler pins) went to the root, as root Compile does.bin/setup --skip-serverand both asset builds passed.Socket::ResolutionError, the failure this fixes.bundle exec rspec: 162 examples, 67 of them system examples, 0 failures, exit 0. Selenium waited for its health check, then stopped;rails-appandpostgreskept running.set -e, sh and zsh, and a failed project lookup or Compose start exited 1 without running specs; Selenium ended stopped every time.firstdraft/dockerfilescontract check (drawing-board/script/checkat70e6d6d) passed inside the workspace container.The simulation used a cached
selenium/standalone-chromium:latestfrom June, so it did not download the image; a Codespace pulls the current one on first start.Not run: a GitHub Codespace, a real Compile (so no Domain specs and no
NotImplementedErrorstubs), and an agent reading the notes.CI:
contractfails before it reaches this change. Runner imageubuntu24/20261004.327ships Buildx 0.37.2, which rejects the Dev Containers CLI 0.89.0 Compose build withadditional privileges requested: pass "--allow=fs.read=...Dockerfile-with-features"(devcontainers/cli#1320). #79 fails the same way; the last green run used image20260927.320.Not for merging until the owner approves: merging changes what new workshop Codespaces get.