Skip to content

feat(.claude): sync spec-orchestrator staleness prevention#91

Closed
zircote wants to merge 7 commits intomainfrom
feat/sync-spec-orchestrator-staleness
Closed

feat(.claude): sync spec-orchestrator staleness prevention#91
zircote wants to merge 7 commits intomainfrom
feat/sync-spec-orchestrator-staleness

Conversation

@zircote
Copy link
Owner

@zircote zircote commented Feb 22, 2026

Summary

  • Adds staleness prevention section (just-in-time spawning, progress polling, teammate heartbeat)
  • Adds anti-takeover Rules 15-16 and escalation procedure for unresponsive teammates
  • Adds mid-task heartbeat to teammate prompt template

Synced from rust-template commit 172fd98.

Copilot AI review requested due to automatic review settings February 22, 2026 06:10
@github-actions
Copy link
Contributor

Benchmark Results

No benchmarks configured. Add benchmarks to benches/ directory.

Full results available in CI artifacts.

@github-actions
Copy link
Contributor

Code Coverage Report

Overall Coverage: 0%

Summary

Filename                      Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
client.rs                        1444                67    95.36%         118                13    88.98%         923                35    96.21%           0                 0         -
format.rs                        2172                 3    99.86%         132                 1    99.24%        1292                 1    99.92%           0                 0         -
main.rs                           326               241    26.07%          14                 8    42.86%         225               168    25.33%           0                 0         -
mcp/analytics.rs                  408                 2    99.51%          24                 0   100.00%         331                 0   100.00%           0                 0         -
mcp/mod.rs                        144                55    61.81%          23                15    34.78%         128                65    49.22%           0                 0         -
mcp/prompts.rs                   1908                33    98.27%         126                 6    95.24%        1043                12    98.85%           0                 0         -
mcp/resources.rs                 1317                20    98.48%          93                 1    98.92%         865                 6    99.31%           0                 0         -
mcp/tools.rs                     2146                90    95.81%         116                18    84.48%        1333                47    96.47%           0                 0         -
models.rs                        1079                31    97.13%          78                10    87.18%         762                14    98.16%           0                 0         -
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                           10944               542    95.05%         724                72    90.06%        6902               348    94.96%           0                 0         -

Full HTML report available in CI artifacts.

@codecov
Copy link

codecov bot commented Feb 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.83%. Comparing base (bb2f81c) to head (c06befa).

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #91   +/-   ##
=======================================
  Coverage   95.83%   95.83%           
=======================================
  Files           9        9           
  Lines        6499     6499           
=======================================
  Hits         6228     6228           
  Misses        271      271           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR syncs staleness prevention improvements and anti-takeover safeguards for the spec-orchestrator command from the rust-template repository (commit 172fd98). The spec-orchestrator is a comprehensive command for orchestrating parallel agent teams to implement large specifications through discovery, task planning, and wave-based execution phases.

Changes:

  • Adds comprehensive staleness prevention section (3.3.1) with just-in-time spawning, progress polling, and teammate heartbeat guidance
  • Adds Rules 15-17 covering anti-takeover principles, complete prompts, and staleness prevention
  • Adds escalation procedure for unresponsive teammates in Troubleshooting section
  • Adds mid-task heartbeat to teammate prompt template for long-running tasks
  • Updates agent tool lists (test-engineer, rust-developer, code-reviewer) to include team collaboration tools

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
.claude/commands/spec-orchestrator.md New 858-line orchestrator command with comprehensive guidance on distributed spec discovery, task planning, parallel execution with teammates, and staleness prevention mechanisms
.claude/agents/test-engineer.md Adds team collaboration tools (LSP, SendMessage, TaskList, TaskGet, TaskUpdate) and reformats description to single line
.claude/agents/rust-developer.md Adds team collaboration tools (SendMessage, TaskList, TaskGet, TaskUpdate) and reformats description to single line
.claude/agents/code-reviewer.md Adds team collaboration tools (Write, Edit, LSP, SendMessage, TaskList, TaskGet, TaskCreate, TaskUpdate) and reformats description to single line

Comment on lines +815 to +817
15. **NEVER take over teammate work** — If teammates appear idle or "stale," you MUST NOT write code, run tests, or complete tasks yourself. The orchestrator's ONLY role is coordination. If you find yourself about to write implementation code, STOP — you are violating this rule. Follow the escalation procedure in Troubleshooting instead.
16. **Every teammate prompt must be complete and self-contained** — When spawning multiple teammates, each `Task` call must contain the FULL prompt. Do NOT abbreviate prompts for teammates 2+ (e.g., "same as impl-1"). Each `Task` call is independent with no shared context.
17. **Prevent staleness with just-in-time spawning** — Spawn teammates when their wave's tasks are unblocked, not all at once upfront. Reuse active teammates across waves via `SendMessage`. Shut down idle teammates between long waits and spawn fresh ones with full turn budgets for the next wave. Poll `TaskList` every 60-90 seconds during execution to detect stuck teammates early.
Copy link

Copilot AI Feb 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR description states "Adds anti-takeover Rules 15-16" but the actual changes add Rules 15, 16, AND 17. Rule 17 addresses staleness prevention with just-in-time spawning. The PR description should be updated to mention "Rules 15-17" for accuracy.

Copilot uses AI. Check for mistakes.
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot open a new pull request to apply changes based on this feedback

Copy link
Contributor

Copilot AI commented Feb 22, 2026

@zircote I've opened a new pull request, #93, to work on those changes. Once the pull request is ready, I'll request review from you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants