feat(domain): integrate coasts dev server with feature flag and coastfile auto-generation#437
Open
feat(domain): integrate coasts dev server with feature flag and coastfile auto-generation#437
Conversation
Fix relatedLinks in spec.yaml to use structured { title, url } objects
matching the TypeSpec RelatedLink model. Add scaffold plan, research,
tasks, and feature YAML artifacts.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Address rejection feedback: Shep manages any repo, not just itself. Removed Coastfile auto-generation (repos own their Coastfiles). Added Coastfile-exists prerequisite check, multi-worktree concurrency requirement, and workDir-scoped CoastsService operations. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Update requirements to use `coast installation-prompt` CLI command to obtain the official Coastfile generation prompt, then pass it to the AI agent system for intelligent per-repo Coastfile generation. Removes the previous requirement that repos must have a pre-existing Coastfile. Key changes: - New FR-8: Coastfile auto-generation flow using agent system - New FR-13: Installation prompt caching - Updated ICoastsService with generateCoastfile, getInstallationPrompt, and hasCoastfile methods - Updated dev-server branching logic to generate Coastfile when missing - Added NFR-12 for generated Coastfile quality validation - Resolved open question 6 in favor of auto-generation Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…sts dev server Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… dev server Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Wire coastsDevServer boolean feature flag through all 8 layers: TypeSpec model, SQLite migration 042, settings mapper, settings repository, feature-flags resolution with env var fallback, React context defaults, and web UI toggle in feature flags settings section. Update all tests and stories to include the new flag field. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Define the ICoastsService application-layer output port with 10 methods (checkPrerequisites, build, run, stop, lookup, isRunning, checkout, getInstallationPrompt, generateCoastfile, hasCoastfile) plus supporting types PrerequisiteCheckResult and CoastInstance. Add barrel export and type-level tests validating all method signatures and type shapes. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…di registration Implement CoastsService wrapping the coast CLI binary via injected ExecFunction for containerized runtime isolation. Includes parallel prerequisite checks (coast binary, Docker, coastd daemon), coast CLI operations (build, run, stop, checkout, lookup), installation prompt caching, and AI-powered Coastfile generation via IStructuredAgentCaller. Register ICoastsService in the DI container with factory-based injection. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…erver Add coastsDevServer feature flag branching in dev-server.ts after DI initialization. When enabled: checks prerequisites, generates Coastfile if missing, builds and runs via coast CLI. When disabled (default), bare Next.js path is completely unchanged (NFR-1 zero regression). Extracted startCoastsDevServer and shutdownCoasts into coasts-dev-server.ts for testability. Shutdown handler detects Coasts mode via null check and calls coastsService.stop() with error handling. Added dev:coasts convenience script to package.json. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ogic Tests startCoastsDevServer and shutdownCoasts with mocked ICoastsService covering all branching scenarios: flag enabled with prerequisites met, missing prerequisites, coastfile generation, build/run failures, and graceful shutdown in both coasts and bare modes. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The coastsDevServer feature flag was defined in FLAG_KEYS and FLAG_LABELS but missing from the manually rendered SwitchRow list in settings-page-client.tsx, causing the toggle to not appear in the actual settings page. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Evidence includes: - App screenshot showing Coasts Dev Server toggle in settings - Full settings page screenshot - CoastsService unit tests (30 passing) - Coasts dev-server module tests (16 passing) - Dev-server branching integration tests (12 passing) - Full test suite results (5080 tests, zero regressions) - Build output (clean compilation) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…rmalize yaml Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
5b0c90c to
576f0c7
Compare
Pass isWindows=false explicitly in test beforeEach to prevent auto-detection short-circuiting on Windows CI. Replace path assertion with path.join for cross-platform compatibility. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ation Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…tion Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…tfile generation Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
coastsDevServerfeature flag across the full stack: TypeSpec model, SQLite migration, settings mapper, feature flags state, web UI toggle, and context defaultsICoastsServiceoutput port interface with methods for prerequisite checks, build/run/stop lifecycle, coast instance lookup, and Coastfile auto-generation via AI agent systemCoastsServiceinfrastructure service wrapping the coast CLI binary viachild_process.spawnwith proper error handling, timeouts, and subprocess safetycoast runinstead of barenext()coasts-dev-server.tsmodule withstartCoastsDevServer()andshutdownCoasts()for clean separation of Coasts-mode startup/shutdowndev:coastsconvenience script topackage.jsonCoastsServicein the DI containerWhat This Enables
When users enable the
coastsDevServerfeature flag, the Shep dev server uses Coasts for containerized runtime isolation per worktree. Each worktree gets its own isolated dev server instance with dedicated ports, volumes, and services — enabling true parallel feature development without port conflicts or shared state.If a target repo lacks a Coastfile, Shep auto-generates one by running
coast installation-promptto obtain the official generation prompt, then passing it to the AI agent system to produce a tailored Coastfile based on the repo's actual structure.Architecture
ICoastsServiceinterface in application layer,CoastsServiceimplementation in infrastructure layerIAgentExecutorProviderper mandatory agent resolution ruleCoastsServiceregistered asICoastsServicetoken in the DI containerEvidence
Test plan
pnpm build)pnpm test:unit)pnpm test:int)pnpm lint:fix)false(no behavior change for existing users)🤖 Generated with Claude Code