Revert: Remove ccw session management while keeping ccw cli exec

Selectively revert ccw session management commands back to commit 5114a94,
while preserving ccw cli exec improvements.

Changes:
- Session management commands (start, list, resume, complete): Full revert to bash commands
- execute.md: Full revert (only had ccw session changes)
- review.md: Reverted ccw session read, kept ccw cli exec
- docs.md: Reverted ccw session read/write, kept ccw cli exec
- lite-fix.md: Reverted ccw session init/read, kept other changes
- lite-plan.md: Reverted ccw session init/read, kept other changes
- lite-execute.md: No changes (kept ccw cli exec intact)
- code-developer.md: No changes (kept ccw cli exec intact)

All ccw session management operations replaced with bash commands.
All ccw cli exec commands preserved for unified CLI execution.

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
catlog22
2025-12-17 22:52:12 +08:00
parent 474a1ce027
commit 44d84116c3
9 changed files with 147 additions and 373 deletions

View File

@@ -72,60 +72,17 @@ Phase 5: Dispatch
### Phase 1: Intelligent Multi-Angle Diagnosis
**Session Setup** (MANDATORY - follow exactly):
**Option 1: Using CLI Command** (Recommended for simplicity):
```bash
# Generate session ID
bug_slug=$(echo "${bug_description}" | tr '[:upper:]' '[:lower:]' | tr -cs '[:alnum:]' '-' | cut -c1-40)
date_str=$(date -u '+%Y-%m-%d')
session_id="${bug_slug}-${date_str}"
# Initialize lite-fix session (location auto-inferred from type)
ccw session init "${session_id}" \
--type lite-fix \
--content "{\"description\":\"${bug_description}\",\"severity\":\"${severity}\"}"
# Get session folder
session_folder=".workflow/.lite-fix/${session_id}"
echo "Session initialized: ${session_id} at ${session_folder}"
```
**Option 2: Using session_manager Tool** (For programmatic access):
```javascript
// Helper: Get UTC+8 (China Standard Time) ISO string
const getUtc8ISOString = () => new Date(Date.now() + 8 * 60 * 60 * 1000).toISOString()
const bugSlug = bug_description.toLowerCase().replace(/[^a-z0-9]+/g, '-').substring(0, 40)
const dateStr = getUtc8ISOString().substring(0, 10) // Format: 2025-12-17
const dateStr = getUtc8ISOString().substring(0, 10) // Format: 2025-11-29
const sessionId = `${bugSlug}-${dateStr}` // e.g., "user-avatar-upload-fails-2025-12-17"
const sessionId = `${bugSlug}-${dateStr}` // e.g., "user-avatar-upload-fails-2025-11-29"
const sessionFolder = `.workflow/.lite-fix/${sessionId}`
const sessionFolder = initResult.result.path
console.log(`Session initialized: ${sessionId} at ${sessionFolder}`)
```
**Session File Structure**:
- `session-metadata.json` - Session metadata (created at init, contains description, severity, status)
- `fix-plan.json` - Actual fix planning content (created later in Phase 3, contains fix tasks, diagnosis results)
**Metadata Field Usage**:
- `description`: Displayed in dashboard session list (replaces session ID as title)
- `severity`: Used for fix planning strategy selection (Low/Medium → Direct Claude, High/Critical → Agent)
- `created_at`: Displayed in dashboard timeline
- `status`: Updated through workflow (diagnosing → fixing → completed)
- Custom fields: Any additional fields in metadata are saved and accessible programmatically
**Accessing Session Data**:
```bash
# Read session metadata
ccw session ${session_id} read session-metadata.json
# Read fix plan content (after Phase 3 completion)
ccw session ${session_id} read fix-plan.json
bash(`mkdir -p ${sessionFolder} && test -d ${sessionFolder} && echo "SUCCESS: ${sessionFolder}" || echo "FAILED: ${sessionFolder}"`)
```
**Diagnosis Decision Logic**: