🎉 init: 小龙的工作空间

This commit is contained in:
大海
2026-06-06 10:40:48 +08:00
commit a188ee1426
3201 changed files with 231817 additions and 0 deletions
+58
View File
@@ -0,0 +1,58 @@
# Metrics — Score Definitions
> Moved from GOVERNANCE.md §7 + PORTFOLIO.md §56 to deduplicate.
> Core formulas only. For full calculation context see GOVERNANCE.md §7.
---
## Project Health Score (GOVERNANCE.md §7)
```
Delivery Score = min(100, (completed / planned) × 100 × schedule_adjustment)
Quality Score = max(0, 100 - (failed_reviews / total_reviews) × 100)
Parallelism Score = min(100, (avg_active / max_possible) × 100)
Dependency Score = max(0, 100 - (waiting_time / total_time) × 100)
Learning Score = min(100, reflections × 10 + patterns_promoted × 5)
Health Score = Delivery×0.30 + Quality×0.25 + Parallelism×0.15 + Dependency×0.15 + Learning×0.15
```
### Rating
| Range | Rating | Meaning |
|-------|--------|---------|
| 90100 | EXCELLENT | 在掌控中 |
| 8089 | GOOD | 良好,可优化 |
| 7079 | ACCEPTABLE | 有风险 |
| 6069 | AT RISK | 需干预 |
| < 60 | CRITICAL | 立即停止,RECOVERY MODE |
## Portfolio Health Score (PORTFOLIO.md §6)
```
Portfolio_Health = Σ(Project_Health_i × Agent_Count_i) / Σ(Agent_Count_i)
```
### Rating
Same as Project Health Score.
## Agent Utilization (PORTFOLIO.md §4)
```
Utilization = Busy_Agents / Total_Agents
```
| Range | Rating |
|-------|--------|
| ≥ 90% | Optimal |
| ≥ 80% | Good |
| ≥ 70% | Acceptable |
| < 70% | Waste |
## Specific Formulas (PORTFOLIO.md §5)
```
Execution_Score = max(0, 100 - staled_heartbeats_ratio × 50 - stalled_transitions × 20)
Risk_Score = max(0, 100 - active_blockers × 15 - critical_blockers × 30 - avg_blocker_age_hours × 2)
```
+54
View File
@@ -0,0 +1,54 @@
# Quality Gates — Reference & Checklist
> Moved from AGENTS.md §5 / GOVERNANCE.md §9 / PORTFOLIO.md §13 to deduplicate.
> Main protocol files reference this file with `protocol-reference/quality-gates.md`.
---
## AGENTS.md Pre-flight Compliance Check
Must pass before any complex task is closed:
```
- [ ] PLAN contains `### Injected Risks (from Learning Context)` section
- [ ] At least 2 knowledge sources were searched (ctx_search / memory_search / playbooks)
- [ ] Matching domain checklist from §3c is included in PLAN
- [ ] If failure occurred: structured Reflection was written to reflections/YYYY-MM-DD-<task>.md
- [ ] Reflection contains ALL 7 required fields (Context/Root Cause/Fix/Pattern Class/Future Trigger/Checklist/Recurrence)
```
If ANY gate fails: **task is NOT complete**.
## GOVERNANCE.md Governance Quality Gate
Must pass before any project output:
```
- [ ] All tasks have a status (NOT_STARTED / IN_PROGRESS / BLOCKED / WAITING_DEPENDENCY / READY_FOR_REVIEW / VERIFIED / FAILED / ARCHIVED)
- [ ] All tasks have heartbeat logs (progress.log entries within stale threshold)
- [ ] All READY_FOR_REVIEW tasks have been reviewed
- [ ] All BLOCKED tasks have blocker.md with root cause
- [ ] All FAILED tasks have documentation (blocker.md or reflection)
- [ ] All replans have evidence in execution-audit.md
- [ ] Health Score has been calculated and is ≥ 60
- [ ] No stale tasks (all progress.log entries are fresh)
```
If ANY gate fails: **❌ GOVERNANCE FAILED — project governance failed. No output.**
## PORTFOLIO.md Portfolio Quality Gate
Must pass before any portfolio output:
```
- [ ] All projects have a status (PLANNING / ACTIVE / BLOCKED / RECOVERY / PAUSED / COMPLETED / ARCHIVED)
- [ ] All projects have a Health Score
- [ ] All projects have a Priority (P0P3)
- [ ] All projects have an ROI Score
- [ ] All projects have Agent Allocation (Agents ≥ 1)
- [ ] All projects have a recent Audit entry
- [ ] Portfolio Health has been calculated
- [ ] No duplicate work detected without action
```
If ANY gate fails: **❌ PORTFOLIO GOVERNANCE FAILED — Portfolio governance failed.**
+147
View File
@@ -0,0 +1,147 @@
# Templates — Block / Replan / Audit / Portfolio / Dashboard / Recovery
> Full template examples extracted from GOVERNANCE.md and PORTFOLIO.md.
> Main protocol files reference these by path instead of inlining.
---
## progress.log Heartbeat
```json
{"ts":"YYYY-MM-DDTHH:mm:ss+08:00","status":"IN_PROGRESS","completed":["T1"],"remaining":["T2","T3"],"risk":"","next_action":"execute T2"}
```
## blocker.md
```markdown
# Blocker
- **blocker**: <一句话描述>
- **root_cause**: <根本原因>
- **owner**: <负责人>
- **mitigation**: <缓解方案>
- **dependency**: <依赖>
- **created_at**: <ISO-8601>
- **resolved_at**: <可选>
- **escalated**: <YES/NO>
```
## execution-audit.md
```markdown
# Execution Audit — YYYY-MM-DD
## Summary
- completion_rate: XX%
- blocked_rate: XX%
- stale_rate: XX%
- failure_rate: XX%
- replan_count: N
- avg_cycle_time: Xh
## Task Status Matrix
| Agent-ID | Task ID | Status | Last Heartbeat | Cycle Time |
|----------|---------|--------|---------------|------------|
| AP-01 | T1 | IN_PROGRESS | YYYY-MM-DD HH:mm | — |
## Blockers (Active)
| Blocker | Owner | Age | Escalated |
|---------|-------|-----|-----------|
## Replans
### Replan #N (YYYY-MM-DD HH:mm)
- trigger: <R1R8>
- cause: <原因>
- before: <原始>
- after: <修订>
- impact: <影响>
## Health Score
- Delivery: X | Quality: X | Parallelism: X | Dependency: X | Learning: X
- Final: XX → <Rating>
```
## recovery-report.md
```markdown
# Recovery Report
- trigger: <A1/A2/A3>
- entered_at: <ISO-8601>
## Failed
| Agent-ID | Task | Failure Count | Root Cause |
## Blocked
| Agent-ID | Task | Blocked Since | Blocker |
## Root Cause Chain
1. <首次偏差>
2. <累积效应>
3. <触发点>
## Recovery Plan
| Task ID | Name | Depends On | Status |
|---------|------|------------|--------|
```
## portfolio.md (Registry)
```markdown
# Portfolio Registry
| Project-ID | Name | Status | Priority | Health | Agents | Progress | Last Updated | ROI |
|------------|------|--------|----------|--------|--------|----------|-------------|-----|
| P-001 | Alpha | ACTIVE | P1 | 85 | 3 | 65% | YYYY-MM-DD | 2.4 |
```
## portfolio-audit.md
```markdown
# Portfolio Audit — YYYY-MM-DD
## Active Projects
| Project-ID | Name | Health | Priority | Progress | Last Heartbeat | Risk Flag |
|------------|------|--------|----------|----------|----------------|-----------|
## Completed / Blocked / Recovery (per-section)
## Resource Report
- Total Agents: N | Busy: N | Idle: N (Utilization: XX%) | Blocked: N | Recovery: N
## Duplicate Work Report
| Pattern Class | Projects | Action Status |
## Top Risks
1. <risk> — <project>
## Portfolio Health: XX → <Rating>
```
## dashboard.md
```markdown
# Executive Dashboard — YYYY-MM-DD
## Portfolio Health: XX → <Rating>
## Top Projects
| Rank | Project | Health | Priority | Progress | Trend |
## Top Risks / Top Opportunities (per-section)
## Agent Utilization: <Rating> — Busy: N / Idle: N / Blocked: N / Recovery: N
## Learning Reuse
| Pattern | Reuse Count | Saved Effort |
## Quick Actions
- [ ] <action>
```
## Replan Log Entry
```markdown
### Replan #N (YYYY-MM-DD HH:mm)
- **trigger**: <R1R8>
- **cause**: <失败原因>
- **before**: <原始 Task Tree 摘要>
- **after**: <修订后 Task Tree 摘要>
- **impact**: <影响到的 Agent Package 列表>
```