refactor(team): add fast-advance notification and knowledge transfer protocol

- team-worker: add fast_advance message bus log after spawning successor,
  closing coordinator state blind spot during fast-advance
- team-worker: add Knowledge Transfer section with upstream loading,
  downstream publishing, and context_accumulator conventions
- role-spec-template: add Knowledge Transfer Protocol with Transfer
  Channels table and shared-memory.json namespaced write convention
- monitor.md (v2+v5): add fast-advance reconciliation step reading
  fast_advance messages, add State Sync section for coordinator wake
- lifecycle-v5 SKILL.md: update cadence diagram with fast_advance log
This commit is contained in:
catlog22
2026-02-28 22:53:56 +08:00
parent 67b2129f3c
commit e42597b1bc
4 changed files with 101 additions and 2 deletions

View File

@@ -192,7 +192,9 @@ Beat Cycle (single beat)
Fast-Advance (skips coordinator for simple linear successors)
======================================================================
[Worker A] Phase 5 complete
+- 1 ready task? simple successor? --> spawn team-worker B directly
+- 1 ready task? simple successor?
| --> spawn team-worker B directly
| --> log fast_advance to message bus (coordinator syncs on next wake)
+- complex case? --> SendMessage to coordinator
======================================================================
```

View File

@@ -59,7 +59,12 @@ Receive callback from [<role>]
+- None completed -> STOP
```
**Fast-advance awareness**: Check if next task is already `in_progress` (fast-advanced by worker). If yes -> skip spawning, update active_workers.
**Fast-advance reconciliation**: When processing any callback or resume:
1. Read recent `fast_advance` messages from team_msg (type="fast_advance")
2. For each: add spawned successor to `active_workers` if not already present
3. Check if expected next task is already `in_progress` (fast-advanced)
4. If yes -> skip spawning (already running)
5. If no -> normal handleSpawnNext
---
@@ -205,6 +210,13 @@ Detect orphaned in_progress task (no active_worker):
+- Reset to pending -> handleSpawnNext
```
### Fast-Advance State Sync
On every coordinator wake (handleCallback, handleResume, handleCheck):
1. Read team_msg entries with `type="fast_advance"` since last coordinator wake
2. For each entry: sync `active_workers` with the spawned successor
3. This ensures coordinator's state reflects fast-advance decisions even before the successor's callback arrives
### Consensus-Blocked Handling
```