Commit Graph
4 Commits
Author SHA1 Message Date
Mr. MakandClaude Opus 5 e64caaf372 fix(mcp): revalidate the stdio server's lifecycle, and give the PID record durable identity (#3364)
Review round 2 (@ruvnet on #3365). The first round kept a one-way "has served
stdio" flag so a second stop() could not delete another server's record. That
flag outlived the server it described: after start -> stop, an independent
status query still reported the manager running and checkHealth() still
reported it healthy. On upstream e558f0c0f the same replay reported
{"running":true,...} and {"healthy":false,"error":"No PID file found"} — the
status half is the pre-existing #2934 fallback, the health half was ours.

The flag is now the manager's live lifecycle ('idle' | 'running' | 'stopped'):

  - while it is serving stdio the manager IS the server, so it reports itself
    and never reads or clears the record it deliberately never wrote (the 30s
    health monitor calls checkHealth());
  - once stopped it reports running: false and healthy: false rather than
    whatever PID the shared file happens to hold;
  - 'idle' — a manager that never started, which is what `mcp status`,
    `mcp health` and `mcp stop` build — keeps today's behaviour exactly,
    including the #2934 stdio fallback.

stop() no longer needs a sticky flag: a stopped manager reports not running,
so a second stop() returns at its own guard.

The PID record now carries durable instance identity, the same model #3363
reached for the policy lock: host, platform, Linux PID namespace and kernel
boot id, and the owner's process start time (/proc/<pid>/stat field 22 on
Linux, `ps -o lstart=` elsewhere). A recorded PID is believed only while all
of it still matches, so a PID the OS has since handed to another process, or
one from another boot, host or namespace, is no longer treated as a live
server — it can no longer make an http start refuse, or be SIGKILLed by
`mcp start --force`. A server retracts its record only while the file still
holds, byte for byte, what it wrote.

Format compatibility: line 1 is still the bare PID, so an older ruflo's
parseInt and `head -1` both read it unchanged; line 2 is the identity. A
bare-integer record — an older ruflo's, or `start-mcp.sh --daemon`'s — parses
with no identity and behaves exactly as today. v3/scripts/start-mcp.sh now
reads the first line.

Not covered: PID reuse and boot detection need the identity line, so a record
written by an older ruflo keeps today's exposure; Windows has neither /proc
nor ps, so its records carry no start time and PID reuse stays unqualified
there, as isProcessRunning()'s process-name check already is.

Tests: 13 added (20 total in the file), covering start -> stop -> independent
status/health denial, concurrent ownership, PID reuse and non-owned processes,
and the Windows-shaped inputs. All 13 fail on 85c68888e except the two
labelled as pinning existing behaviour.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KTedGmPKpEdArVBMMn3JaP
2026-09-20 11:55:49 -04:00
rUvandClaude Opus 4.5 bad2be3919 feat(claims): Complete ADR-016 claims module implementation
- Add @claude-flow/claims package with 161 passing tests
- Implement ClaimService, WorkStealingService, LoadBalancer
- Add domain types, events, rules per ADR-016 spec
- Create 17 MCP tools for claiming, stealing, load balancing
- Add CLI commands for issue management
- Fix type errors: ClaimStatus, status transitions, exports
- Enable auto-commit and auto-push in settings.json
- Update v3 packages and configurations

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-06 22:38:00 +00:00
rUvandClaude Opus 4.5 7c811c1c96 v3: Major cleanup, benchmarking, and documentation
## Cleanup (~1000KB removed)
- Remove /implementation/ planning docs (no longer needed)
- Remove duplicate /coordination/, /core/, /shared/, /types/ folders
- Remove stale status/tracking MDs from @claude-flow modules
- Remove /docs/reports/ status documents

## Performance Benchmarking
- Add scripts/quick-benchmark.mjs for fast performance validation
- Add __tests__/setup.ts (required by vitest config)
- Add @claude-flow/memory/framework/benchmark.ts utilities
- All benchmarks passing targets:
  - Event Bus: 6ms for 100k events (<50ms target)
  - Map Lookup: 16ms for 100k gets (<20ms target)
  - O(n) to O(1) optimization: 978x speedup confirmed

## Documentation
- Complete rewrite of v3/README.md with:
  - Architecture overview (10 ADRs)
  - Module architecture diagram
  - Full directory structure
  - Usage examples for all 10 modules
  - Performance targets and achievements
  - Installation and testing instructions

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-05 03:00:34 +00:00
rUvandClaude Sonnet 4 c21b756b18 checkpoint: File edit:
🚀 Generated with [Claude Code](https://claude.com/claude-code)
📊 V3 Development Progress Checkpoint

Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
2026-01-04 22:48:29 +00:00