feat: enhance workflow session management with status updates and CSS styling

This commit is contained in:
catlog22
2025-12-10 10:01:07 +08:00
parent 5114a942dc
commit 417f3c0f8c
8 changed files with 143 additions and 27 deletions

View File

@@ -160,6 +160,14 @@ bash(cat .workflow/active/${sessionId}/workflow-session.json)
**Output**: Store session metadata in memory
**DO NOT read task JSONs yet** - defer until execution phase (lazy loading)
#### Step 1.4: Update Session Status to Active
**Purpose**: Update workflow-session.json status from "planning" to "active" for dashboard monitoring.
```bash
# Update status atomically using jq
bash(jq '.status = "active"' .workflow/active/${sessionId}/workflow-session.json > /tmp/ws.json && mv /tmp/ws.json .workflow/active/${sessionId}/workflow-session.json)
```
**Resume Mode**: This entire phase is skipped when `--resume-session="session-id"` flag is provided.
### Phase 2: Planning Document Validation

View File

@@ -61,7 +61,7 @@ Phase 2: Context Gathering
├─ Tasks attached: Analyze structure → Identify integration → Generate package
└─ Output: contextPath + conflict_risk
Phase 3: Conflict Resolution (conditional)
Phase 3: Conflict Resolution
└─ Decision (conflict_risk check):
├─ conflict_risk ≥ medium → Execute /workflow:tools:conflict-resolution
│ ├─ Tasks attached: Detect conflicts → Present to user → Apply strategies
@@ -168,7 +168,7 @@ SlashCommand(command="/workflow:tools:context-gather --session [sessionId] \"[st
---
### Phase 3: Conflict Resolution (Optional - auto-triggered by conflict risk)
### Phase 3: Conflict Resolution
**Trigger**: Only execute when context-package.json indicates conflict_risk is "medium" or "high"

View File

@@ -166,13 +166,21 @@ Analyze workflow session for archival preparation. Session is STILL in active lo
bash(mkdir -p .workflow/archives/)
```
#### Step 3.2: Move Session to Archive
#### Step 3.2: Update Session Status to Completed
**Purpose**: Update workflow-session.json status to "completed" for dashboard display.
```bash
# Update status atomically using jq
bash(jq '.status = "completed"' .workflow/active/WFS-session-name/workflow-session.json > /tmp/ws.json && mv /tmp/ws.json .workflow/active/WFS-session-name/workflow-session.json)
```
#### Step 3.3: Move Session to Archive
```bash
bash(mv .workflow/active/WFS-session-name .workflow/archives/WFS-session-name)
```
**Result**: Session now at `.workflow/archives/WFS-session-name/`
#### Step 3.3: Update Manifest
#### Step 3.4: Update Manifest
```bash
# Read current manifest (or create empty array if not exists)
bash(test -f .workflow/archives/manifest.json && cat .workflow/archives/manifest.json || echo "[]")
@@ -200,7 +208,7 @@ manifest.push(archiveEntry);
Write('.workflow/archives/manifest.json', JSON.stringify(manifest, null, 2));
```
#### Step 3.4: Remove Archiving Marker
#### Step 3.5: Remove Archiving Marker
```bash
bash(rm .workflow/archives/WFS-session-name/.archiving)
```
@@ -464,11 +472,12 @@ Session state: PARTIALLY COMPLETE (session archived, manifest needs update)
**Phase 3: Atomic Commit** (Transactional file operations)
- Create archive directory
- Update session status to "completed"
- Move session to archive location
- Update manifest.json with archive entry
- Remove `.archiving` marker
- **All-or-nothing**: Either all succeed or session remains in safe state
- **Total**: 4 bash commands + JSON manipulation
- **Total**: 5 bash commands + JSON manipulation
**Phase 4: Project Registry Update** (Optional feature tracking)
- Check project.json exists

View File

@@ -10,7 +10,23 @@
- Complex API research → Exa Code Context
- Real-time information needs → Exa Web Search
## ⚡ CCW edit_file Tool (AI-Powered Editing)
## ⚡ CCW Tool Execution
### General Usage (JSON Parameters)
```bash
ccw tool exec <tool_name> '{"param": "value"}'
```
**Examples**:
```bash
ccw tool exec get_modules_by_depth '{}'
ccw tool exec classify_folders '{"path": "./src"}'
```
**Available Tools**: `ccw tool list`
### edit_file Tool (AI-Powered Editing)
**When to Use**: Edit tool fails 1+ times on same file