Skip to content

Add test-first-loop template and Forge execution stability improvements - #5

Merged
fperegrinvs merged 14 commits into
mainfrom
multi-step-template
Feb 12, 2026
Merged

Add test-first-loop template and Forge execution stability improvements#5
fperegrinvs merged 14 commits into
mainfrom
multi-step-template

Conversation

@fperegrinvs

@fperegrinvs fperegrinvs commented Feb 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

This PR introduces two feature sets across 13 commits:

1. test-first-loop bundled template

A new multi-phase Forge template that enforces a test-first development workflow with an AI review gate.

  • Scaffold the template with template.json, schemas, hook scripts, and prompts
  • Define a 6-phase workflow with completion criteria and AI review gate
  • Add phase-view data loaders (forgeLoadPhaseView in src/services/tauri.ts) to read template phases.json and plan state.json
  • Render phase rows with Material icons in the Forge UI via getForgePhaseIconUrl

2. Forge execution stability & project gate

Stability fixes to prevent ghost sessions and ensure deterministic UI state.

  • Project-selection gate: Forge panel opens without a workspace but blocks all actions (template browsing, plan selection, execution) until a project is explicitly selected
  • Deterministic task-row status: Single-source resolution — active runningInfo.taskId wins, then phase state, then plan state. Stale in_progress rows are demoted when another task is actively running
  • Execution loop guard: Validates task IDs against knownTaskIds from the selected plan; stops execution cleanly when all tasks are exhausted instead of creating an extra session

Documentation & tests

  • Updated docs/forge.md with phase metadata, icon resolution, execution guards, and project gate behavior
  • Frontend regression tests for phase rendering and plan state
  • Template hook tests for multi-phase initialization
  • Rust multi-phase execution core regression tests
  • Script unit tests for test-first-loop hooks

Key files

Area Files
Template src-tauri/resources/forge/templates/test-first-loop/
Phase loaders src/services/tauri.ts, src/utils/forgePhaseIcons.ts
UI src/features/forge/components/Forge.tsx
Execution hooks src/features/forge/hooks/useForgeExecution.ts
Rust core src-tauri/src/shared/forge_execute_core.rs
Sidebar gate src/features/app/components/Sidebar.test.tsx
Docs docs/forge.md, docs/codebase-map.md

Test plan

  • test-first-loop template appears in bundled template list
  • Phase icons render with correct Material icon URLs; invalid IDs fall back to file.svg
  • Forge panel shows "Select a project first" when no workspace is active; all action controls are disabled
  • Task-row status resolves deterministically (active running > phase state > plan state)
  • Execution loop exits cleanly when all tasks exhausted — no extra session/thread created
  • Run vitest and cargo test suites — no regressions

🤖 Generated with Claude Code

…unning status single-source and deterministic
@fperegrinvs fperegrinvs changed the title Multi step template Add test-first-loop template and Forge execution stability improvements Feb 12, 2026
- Update Forge.templates.test.tsx: the project-selection gate now disables
  the "Open templates" button when no workspace is active, so the test
  verifies the button is disabled rather than trying to click it.
- Fix Rust phase check commands: replace `node -e "process.exit(N)"` with
  `node -e process.exitCode=N` to avoid shell parentheses interpretation
  on Unix and double-quote mangling on Windows cmd.exe.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@fperegrinvs
fperegrinvs merged commit 40e3a27 into main Feb 12, 2026
9 checks passed
@fperegrinvs
fperegrinvs deleted the multi-step-template branch February 12, 2026 05:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants