feat: implement infinite scrolling for native sessions and add reset functionality to queue scheduler

This commit is contained in:
catlog22
2026-02-27 21:24:44 +08:00
parent a581a2e62b
commit 9be35ed5fb
12 changed files with 263 additions and 131 deletions

View File

@@ -4,6 +4,18 @@
Parse user task description -> detect required capabilities -> build dependency graph -> design dynamic roles with role-spec metadata. Outputs structured task-analysis.json with frontmatter fields for role-spec generation.
## CRITICAL CONSTRAINT
**TEXT-LEVEL analysis only. MUST NOT read source code or explore codebase.**
**Allowed:**
- Parse user task description text
- AskUserQuestion for clarification
- Keyword-to-capability mapping
- Write `task-analysis.json`
If task context requires codebase knowledge, set `needs_research: true`. Phase 2 will spawn researcher worker.
## Phase 2: Context Loading
| Input | Source | Required |
@@ -135,6 +147,7 @@ Write `<session-folder>/task-analysis.json`:
"total_score": 3,
"level": "low"
},
"needs_research": false,
"artifacts": [
{ "name": "research-findings.md", "producer": "researcher", "path": "artifacts/research-findings.md" }
]

View File

@@ -10,7 +10,7 @@ Orchestrate the team-coordinate workflow: task analysis, dynamic role-spec gener
## Boundaries
### MUST
- Analyze user task to detect capabilities and build dependency graph
- Parse task description (text-level: keyword scanning, capability inference, dependency design)
- Dynamically generate worker role-specs from specs/role-spec-template.md
- Create team and spawn team-worker agents in background
- Dispatch tasks with proper dependency chains from task-analysis.json
@@ -22,6 +22,7 @@ Orchestrate the team-coordinate workflow: task analysis, dynamic role-spec gener
- Execute completion action when pipeline finishes
### MUST NOT
- **Read source code or perform codebase exploration** (delegate to worker roles)
- Execute task work directly (delegate to workers)
- Modify task output artifacts (workers own their deliverables)
- Call implementation subagents (code-developer, etc.) directly
@@ -30,8 +31,6 @@ Orchestrate the team-coordinate workflow: task analysis, dynamic role-spec gener
- Override consensus_blocked HIGH without user confirmation
- Spawn workers with `general-purpose` agent (MUST use `team-worker`)
> **Core principle**: coordinator is the orchestrator, not the executor. All actual work is delegated to dynamically generated worker roles via team-worker agents.
---
## Entry Router
@@ -79,6 +78,8 @@ For callback/check/resume/adapt/complete: load `commands/monitor.md` and execute
**Objective**: Parse user task, detect capabilities, build dependency graph, design roles.
**Constraint**: This is TEXT-LEVEL analysis only. No source code reading, no codebase exploration.
**Workflow**:
1. **Parse user task description**
@@ -98,6 +99,8 @@ For callback/check/resume/adapt/complete: load `commands/monitor.md` and execute
4. **Output**: Write `<session>/task-analysis.json`
5. **If `needs_research: true`**: Phase 2 will spawn researcher worker first
**Success**: Task analyzed, capabilities detected, dependency graph built, roles designed with role-spec metadata.
---
@@ -108,9 +111,15 @@ For callback/check/resume/adapt/complete: load `commands/monitor.md` and execute
**Workflow**:
1. **Generate session ID**: `TC-<slug>-<date>` (slug from first 3 meaningful words of task)
1. **Check `needs_research` flag** from task-analysis.json:
- If `true`: **Spawn researcher worker first** to gather codebase context
- Wait for researcher callback
- Merge research findings into task context
- Update task-analysis.json with enriched context
2. **Create session folder structure**:
2. **Generate session ID**: `TC-<slug>-<date>` (slug from first 3 meaningful words of task)
3. **Create session folder structure**:
```
.workflow/.team/<session-id>/
+-- role-specs/
@@ -121,26 +130,26 @@ For callback/check/resume/adapt/complete: load `commands/monitor.md` and execute
+-- .msg/
```
3. **Call TeamCreate** with team name derived from session ID
4. **Call TeamCreate** with team name derived from session ID
4. **Read `specs/role-spec-template.md`** + `task-analysis.json`
5. **Read `specs/role-spec-template.md`** + task-analysis.json
5. **For each role in task-analysis.json#roles**:
6. **For each role in task-analysis.json#roles**:
- Fill role-spec template with:
- YAML frontmatter: role, prefix, inner_loop, subagents, message_types
- Phase 2-4 content from responsibility type reference sections in template
- Task-specific instructions from task description
- Write generated role-spec to `<session>/role-specs/<role-name>.md`
6. **Register roles** in team-session.json#roles (with `role_spec` path instead of `role_file`)
7. **Register roles** in team-session.json#roles (with `role_spec` path instead of `role_file`)
7. **Initialize shared infrastructure**:
8. **Initialize shared infrastructure**:
- `wisdom/learnings.md`, `wisdom/decisions.md`, `wisdom/issues.md` (empty with headers)
- `explorations/cache-index.json` (`{ "entries": [] }`)
- `shared-memory.json` (`{}`)
- `discussions/` (empty directory)
8. **Write team-session.json** with: session_id, task_description, status="active", roles, pipeline (empty), active_workers=[], completion_action="interactive", created_at
9. **Write team-session.json** with: session_id, task_description, status="active", roles, pipeline (empty), active_workers=[], completion_action="interactive", created_at
**Success**: Session created, role-spec files generated, shared infrastructure initialized.