fix: Preserve user intent in test workflow session creation

- Add Step 1.0 to test-gen.md to load source session task_description
- Add Step 1.0 to test-fix-gen.md (Session Mode) to load original user intent
- Include originalTaskDescription in session creation to enable semantic CLI selection
- Fixes data flow gap identified by Gemini review: user's CLI tool preferences
  (e.g., "use Codex for fixes") now propagate through test workflow sessions

This ensures semantic CLI tool selection works correctly in derivative test sessions
by preserving the original user's task description from the source session.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
catlog22
2025-11-29 17:06:13 +08:00
parent 132eec900c
commit d82bf5a823
4 changed files with 74 additions and 18 deletions

View File

@@ -143,13 +143,25 @@ This command is a **pure planning coordinator**:
#### Phase 1: Create Test Session
**Step 1.1: Dispatch** - Create test workflow session
**Step 1.0: Load Source Session Intent (Session Mode Only)** - Preserve user's original task description for semantic CLI selection
```javascript
// Session Mode
SlashCommand(command="/workflow:session:start --new \"Test validation for [sourceSessionId]\"")
// Session Mode: Read source session metadata to get original task description
Read(".workflow/active/[sourceSessionId]/workflow-session.json")
// OR if context-package exists:
Read(".workflow/active/[sourceSessionId]/.process/context-package.json")
// Prompt Mode
// Extract: metadata.task_description or project/description field
// This preserves user's CLI tool preferences (e.g., "use Codex for fixes")
```
**Step 1.1: Dispatch** - Create test workflow session with preserved intent
```javascript
// Session Mode - Include original task description to enable semantic CLI selection
SlashCommand(command="/workflow:session:start --new \"Test validation for [sourceSessionId]: [originalTaskDescription]\"")
// Prompt Mode - User's description already contains their intent
SlashCommand(command="/workflow:session:start --new \"Test generation for: [description]\"")
```
@@ -158,8 +170,8 @@ SlashCommand(command="/workflow:session:start --new \"Test generation for: [desc
**Expected Behavior**:
- Creates new session: `WFS-test-[slug]`
- Writes `workflow-session.json` metadata:
- **Session Mode**: Includes `workflow_type: "test_session"`, `source_session_id: "[sourceId]"`
- **Prompt Mode**: Includes `workflow_type: "test_session"` only
- **Session Mode**: Includes `workflow_type: "test_session"`, `source_session_id: "[sourceId]"`, description with original user intent
- **Prompt Mode**: Includes `workflow_type: "test_session"` only (user's description already contains intent)
- Returns new session ID
**Parse Output**:

View File

@@ -57,19 +57,35 @@ allowed-tools: SlashCommand(*), TodoWrite(*), Read(*), Bash(*)
### Phase 1: Create Test Session
**Step 1.1: Dispatch** - Create new test workflow session
**Step 1.0: Load Source Session Intent** - Preserve user's original task description for semantic CLI selection
```javascript
SlashCommand(command="/workflow:session:start --new \"Test validation for [sourceSessionId]\"")
// Read source session metadata to get original task description
Read(".workflow/active/[sourceSessionId]/workflow-session.json")
// OR if context-package exists:
Read(".workflow/active/[sourceSessionId]/.process/context-package.json")
// Extract: metadata.task_description or project/description field
// This preserves user's CLI tool preferences (e.g., "use Codex for fixes")
```
**Input**: `sourceSessionId` from user argument (e.g., `WFS-user-auth`)
**Step 1.1: Dispatch** - Create new test workflow session with preserved intent
```javascript
// Include original task description to enable semantic CLI selection
SlashCommand(command="/workflow:session:start --new \"Test validation for [sourceSessionId]: [originalTaskDescription]\"")
```
**Input**:
- `sourceSessionId` from user argument (e.g., `WFS-user-auth`)
- `originalTaskDescription` from source session metadata (preserves CLI tool preferences)
**Expected Behavior**:
- Creates new session with pattern `WFS-test-[source-slug]` (e.g., `WFS-test-user-auth`)
- Writes metadata to `workflow-session.json`:
- `workflow_type: "test_session"`
- `source_session_id: "[sourceSessionId]"`
- Description includes original user intent for semantic CLI selection
- Returns new session ID for subsequent phases
**Parse Output**:

View File

@@ -143,13 +143,25 @@ This command is a **pure planning coordinator**:
#### Phase 1: Create Test Session
**Step 1.1: Dispatch** - Create test workflow session
**Step 1.0: Load Source Session Intent (Session Mode Only)** - Preserve user's original task description for semantic CLI selection
```javascript
// Session Mode
SlashCommand(command="/workflow:session:start --new \"Test validation for [sourceSessionId]\"")
// Session Mode: Read source session metadata to get original task description
Read(".workflow/active/[sourceSessionId]/workflow-session.json")
// OR if context-package exists:
Read(".workflow/active/[sourceSessionId]/.process/context-package.json")
// Prompt Mode
// Extract: metadata.task_description or project/description field
// This preserves user's CLI tool preferences (e.g., "use Codex for fixes")
```
**Step 1.1: Dispatch** - Create test workflow session with preserved intent
```javascript
// Session Mode - Include original task description to enable semantic CLI selection
SlashCommand(command="/workflow:session:start --new \"Test validation for [sourceSessionId]: [originalTaskDescription]\"")
// Prompt Mode - User's description already contains their intent
SlashCommand(command="/workflow:session:start --new \"Test generation for: [description]\"")
```
@@ -158,8 +170,8 @@ SlashCommand(command="/workflow:session:start --new \"Test generation for: [desc
**Expected Behavior**:
- Creates new session: `WFS-test-[slug]`
- Writes `workflow-session.json` metadata:
- **Session Mode**: Includes `workflow_type: "test_session"`, `source_session_id: "[sourceId]"`
- **Prompt Mode**: Includes `workflow_type: "test_session"` only
- **Session Mode**: Includes `workflow_type: "test_session"`, `source_session_id: "[sourceId]"`, description with original user intent
- **Prompt Mode**: Includes `workflow_type: "test_session"` only (user's description already contains intent)
- Returns new session ID
**Parse Output**:

View File

@@ -57,19 +57,35 @@ allowed-tools: SlashCommand(*), TodoWrite(*), Read(*), Bash(*)
### Phase 1: Create Test Session
**Step 1.1: Dispatch** - Create new test workflow session
**Step 1.0: Load Source Session Intent** - Preserve user's original task description for semantic CLI selection
```javascript
SlashCommand(command="/workflow:session:start --new \"Test validation for [sourceSessionId]\"")
// Read source session metadata to get original task description
Read(".workflow/active/[sourceSessionId]/workflow-session.json")
// OR if context-package exists:
Read(".workflow/active/[sourceSessionId]/.process/context-package.json")
// Extract: metadata.task_description or project/description field
// This preserves user's CLI tool preferences (e.g., "use Codex for fixes")
```
**Input**: `sourceSessionId` from user argument (e.g., `WFS-user-auth`)
**Step 1.1: Dispatch** - Create new test workflow session with preserved intent
```javascript
// Include original task description to enable semantic CLI selection
SlashCommand(command="/workflow:session:start --new \"Test validation for [sourceSessionId]: [originalTaskDescription]\"")
```
**Input**:
- `sourceSessionId` from user argument (e.g., `WFS-user-auth`)
- `originalTaskDescription` from source session metadata (preserves CLI tool preferences)
**Expected Behavior**:
- Creates new session with pattern `WFS-test-[source-slug]` (e.g., `WFS-test-user-auth`)
- Writes metadata to `workflow-session.json`:
- `workflow_type: "test_session"`
- `source_session_id: "[sourceSessionId]"`
- Description includes original user intent for semantic CLI selection
- Returns new session ID for subsequent phases
**Parse Output**: