feat(domain): add prototype exploration mode for iterative visual prototyping#513
Open
feat(domain): add prototype exploration mode for iterative visual prototyping#513
Conversation
9640597 to
053b00c
Compare
Contributor
aaf4a89 to
29957d6
Compare
Contributor
Contributor
…tion mode Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
15 architectural decisions covering FeatureMode enum, database migration, exploration graph topology, feedback loop mechanism, state channels, worker routing, web UI mode selector, canvas treatment, drawer tabs, promotion, CLI commands, settings, spec initialization, and node implementation strategy. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace the boolean `fast` field on the Feature entity with a FeatureMode enum (Regular, Fast, Exploration). This prevents invalid state combinations and scales cleanly to future workflow modes. Migration touches all layers: TypeSpec definition, generated output, feature mapper, use cases, worker routing, CLI commands, Web UI components, and all associated tests. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add Exploring to the SdlcLifecycle enum for the exploration/prototyping mode. Valid transitions: Exploring to Implementation (promote-fast), Exploring to Requirements (promote-regular), Exploring to Deleting (discard), plus self-loop for feedback iterations. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add iterationCount (int32, default 0) and maxIterations (optional int32) fields to the Feature entity for tracking exploration feedback loop progress. Update mapper, use cases, and all test fixtures. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Define EXPLORING_TRANSITIONS set with valid transitions from the Exploring state: Implementation (promote-fast), Requirements (promote-regular), and Deleting (discard). Exploring has no approval gates since exploration bypasses SDLC. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add SQLite migration 051 that replaces the boolean fast column with a TEXT mode column on the features table, supporting Regular, Fast, and Exploration values. Also adds iteration_count and max_iterations columns for exploration feedback loop tracking. Updates repository SQL to use mode/iteration columns instead of fast. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add iterationCount, maxIterations, feedbackHistory (accumulating), and explorationStatus channels to FeatureAgentAnnotation for exploration mode feedback loop tracking. Follows the CI fix channels pattern. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add buildPrototypeGeneratePrompt for exploration mode prototype generation with feedback history context, and buildApplyFeedbackContext for state transformation between iterations. Includes feedback summarization for older entries beyond the recent 3. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…odes Add prototype-generate node that calls the agent executor with exploration prompts and interrupts for user feedback after each iteration. Add apply-feedback node as a pure state transformation that appends feedback to history and prepares context for the next iteration. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Create createExplorationAgentGraph() factory with topology: START -> prototype-generate -> interrupt -> apply-feedback -> loop. Routes to END on promote/discard actions. Handles resume from interrupt by detecting _approvalAction and returning early before re-executing the agent, following the same pattern as executeNode() completedPhases. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ontext Update worker graph selection to route mode=Exploration to the exploration agent graph factory. Add prototype-generate node mapping to Exploring lifecycle state. Add exploration timeout mapping in node-helpers stage timeout keys. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add exploration mode handling to CreateFeatureUseCase: sets initial lifecycle to Exploring, passes 'exploration' to spec initializer, and forwards mode=Exploration to worker spawn options. Update ISpecInitializerService interface to accept 'exploration' mode. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Extend spec initializer to accept mode='exploration' which creates only feature.yaml (no spec, research, plan, or tasks YAMLs). Matches the lightweight exploration philosophy where SDLC spec artifacts are not needed until promotion. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Create PromoteExplorationUseCase that transitions an exploration feature to Regular or Fast mode via in-place mode change. Validates feature is in Exploration mode and Exploring lifecycle, scaffolds missing spec YAMLs for regular promotion, creates new agent run, and spawns the appropriate graph. Register in DI container with string-token alias. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add checkpoint database cleanup during feature deletion to remove LangGraph state files for discarded explorations. Add tests verifying exploration features in Exploring lifecycle can be deleted with proper lifecycle transition and agent cancellation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add --explore flag for creating exploration-mode features. The flag is mutually exclusive with --fast (error if both specified). Mode resolution: --explore → Exploration, --fast → Fast, --no-fast → Regular, default → workflow settings. Add i18n keys for explore, feedback, and promote commands. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add feedback command for iterating on exploration prototypes. The command validates the feature is in exploration mode and sends feedback via the existing reject/resume mechanism. Add promote command for transitioning exploration features to Regular or Fast mode via PromoteExplorationUseCase. Register both commands in the feat command group. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace the binary fast/regular Switch toggle in the feature create drawer with a ToggleGroup-based ModeSelector supporting Regular, Fast, and Exploration modes. Approval gates are hidden entirely when Exploration mode is selected since SDLC gates do not apply. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add 'exploring' to FeatureLifecyclePhase with amber color scheme and FlaskConical icon. Update feature-node.tsx to render mode-aware badge (FlaskConical for Exploration, Zap for Fast, ClipboardList for Regular). Wire mode and iterationCount fields through to FeatureNodeData from build-feature-node-data and build-graph-nodes. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Create PrototypeTab component with feedback input, promote/discard actions, and iteration count display. Add 'prototype' to FeatureTabKey and wire into feature-drawer-tabs visibility logic — shown when lifecycle is 'exploring', SDLC-specific tabs are hidden. Update deriveInitialTab to auto-select prototype tab for exploring features. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… discard Create three server actions: submitExplorationFeedback (resumes graph with iterate payload via RejectAgentRunUseCase), promoteExploration (calls PromoteExplorationUseCase for in-place mode transition), and discardExploration (validates exploration mode then calls delete use case). Wire all three into feature-drawer-client with toast feedback and optimistic canvas updates. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…n settings Replace workflow.defaultFastMode boolean with workflow.defaultMode string that accepts 'Regular', 'Fast', or 'Exploration'. This completes the boolean-to-enum migration for settings, matching the FeatureMode enum used on the Feature entity. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…edback limit Add workflow.explorationMaxIterations optional setting (default: 10) that controls the maximum feedback iterations in exploration mode. The CreateFeatureUseCase reads this from settings and sets it on the feature entity when creating exploration-mode features. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ntation Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…mentation Replace synthetic evidence with real captures from running application: - App screenshots from dev server (dashboard, create drawer, settings) - Storybook screenshots (mode selector, prototype tab, feature node) - Real test output from pnpm test:unit (5459 tests passing) - Real build output from pnpm build (zero errors) - CLI help output from built binary - TypeSpec generated types with annotations Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…mode Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…on mode Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… mode Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ory sql The settings repository INSERT and UPDATE statements still referenced the old default_fast_mode column which was dropped by migration 052. Update all three SQL references to use the renamed default_mode column. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ad of fast The E2E web test seedFeature functions still used the old `fast` column name which was dropped by migration 051. Update all three test files to use the new `mode` column with 'Regular' string value. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use primary color (bg-primary/text-primary-foreground) for the selected toggle item instead of the subtle accent color, so clicking Explore (or any mode) produces a clearly visible selected state. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…spec Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ation-mode # Conflicts: # packages/core/src/infrastructure/persistence/sqlite/mappers/settings.mapper.ts # src/presentation/web/app/actions/get-workflow-defaults.ts # src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.stories.tsx # src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.tsx # tests/unit/application/use-cases/features/create-feature.use-case.test.ts # tests/unit/infrastructure/persistence/sqlite/mappers/settings.mapper.test.ts # tests/unit/presentation/web/actions/get-workflow-defaults.test.ts # tests/unit/presentation/web/components/common/feature-create-drawer/feature-create-drawer.test.tsx # translations/de/web.json
a5dcc26 to
c98e248
Compare
Contributor
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
Adds a new Exploration mode alongside Regular and Fast modes, enabling a discovery-first workflow where users describe a vague idea, see quick disposable prototypes, iterate with feedback, and promote to a full feature once direction is clear.
Key changes
FeatureMode enum replaces boolean
fastfield — New TypeSpecFeatureModeenum (Regular,Fast,Exploration) replaces the booleanfastfield on the Feature entity. All code paths migrated from boolean checks to enum comparisons across domain, persistence, and presentation layers.Exploring lifecycle state — New
Exploringstate added toSdlcLifecycleenum with lifecycle gates defining valid transitions:Exploring → Implementation(promote to fast),Exploring → Requirements(promote to regular),Exploring → Deleting(discard), and self-loop for iterations.Exploration agent graph — New LangGraph graph factory (
createExplorationAgentGraph) with topology:START → prototype-generate → interrupt(feedback) → apply-feedback → prototype-generate → ... → END. Supports iterative prototyping with full context preservation across feedback cycles.Web UI mode selector — Three-way mode selector (Regular / Fast / Explore) with ClipboardList, Zap, and FlaskConical icons replaces the old fast-mode toggle in the feature create drawer. Approval gates are conditionally hidden when Explore mode is selected.
Prototype review tab — New
PrototypeTabcomponent in the feature drawer showing iteration count, feedback status, text feedback input, and promote/discard actions for exploration features.Canvas visual treatment — Exploration features render with distinct amber/yellow color scheme and beaker/flask icon on the canvas, visually distinguishing them from regular and fast features.
CLI commands — New
--exploreflag onshep feat new, plusshep feat feedback <id> <text>andshep feat promote <id> [--fast]commands for CLI-based exploration workflow.Settings integration —
workflow.defaultModesetting (Regular/Fast/Exploration) replaces the old booleandefaultFastMode, withexplorationMaxIterationssetting for configuring the feedback loop limit.Promote & Discard use cases —
PromoteExplorationUseCasetransitions exploration features to Regular or Fast mode with in-place mode transition. Discard reuses existing feature deletion infrastructure.Evidence
Application Screenshots
Storybook Stories
Test Results
Test plan
Built with Shep 🐑 Shep Bot