docs(scheduler-agent): update design doc with cluster verification results

- Design doc v1.2: Phase 0-1 cluster verification status (read + submit OK,
  control HTTP 500 open bug-1490), bug table for whitelist/job_status fixes,
  mcp_operator queue:control note.
- Root + frontend CLAUDE.md: reflect verified state and apiserver bugs found.
- wolf memory/anatomy/buglog: log deployment session, bug-1489/bug-1490.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
lei.chen 2026-08-01 09:54:49 +00:00
parent e36ed63ca0
commit 9fe14c1512
6 changed files with 135 additions and 30 deletions

View file

@ -8,8 +8,8 @@ Go-based REST API server (Gin) and CLI tool (Cobra) that expose cluster manageme
|--------|------|-------------|
| `apiserver` | `src/frontend/apiserver/` | `cmd/main.go` |
| `xcecli` | `src/frontend/xcecli/` | `cmd/main.go` |
| `schedulerclient` (Phase 0, ✅ done) | `src/frontend/schedulerclient/` | library, no entry point — read-only Go client for the scheduler agent's MCP Server, calls `apiserver`'s REST API. `go vet`/`go build`/`go test` clean (33 tests). See module source: `types.go` (URM types), `client.go` (interface), `httpclient.go` (resty impl), `statusmap.go`+`_test.go` (TDD, status mapping). |
| `mcp-server` (Phase 0, ✅ done) | `src/frontend/mcp-server/` | `cmd/main.go` — read-only MCP Server exposing 6 tools (`scheduler_list_jobs`/`get`/`list_queues`/`list_nodes`/`job_logs`/`cluster_metrics`); pure Go, `CGO_ENABLED=0`, uses `schedulerclient` as API client, authenticates via `XCE_API_KEY` env var. Uses `github.com/mark3labs/mcp-go@v0.57.0` for MCP stdio transport. `go build`/`go vet` clean, binary ~11MB. |
| `schedulerclient` (Phase 0-1, ✅ done) | `src/frontend/schedulerclient/` | library, no entry point — read + write Go client for the scheduler agent's MCP Server, calls `apiserver`'s REST API. `go vet`/`go build`/`go test` clean (45 tests). Read: `types.go` (URM types), `client.go` (interface), `httpclient.go` (resty impl), `statusmap.go`+`_test.go` (TDD, status mapping). Write (Phase 1): `write.go`+`_test.go` — `JobSpec`, `SubmitJob`/`CancelJob`/`HoldJob`/`ReleaseJob`, `doPost` (HTTP 200 + envelope-code dual check). |
| `mcp-server` (Phase 0-1, ✅ done) | `src/frontend/mcp-server/` | `cmd/main.go` — MCP Server exposing 10 tools (6 read-only + 4 write: `scheduler_submit`/`cancel`/`hold`/`release`); pure Go, `CGO_ENABLED=0`, uses `schedulerclient` as API client, authenticates via `XCE_API_KEY` env var. Uses `github.com/mark3labs/mcp-go@v0.57.0` for MCP stdio transport. `internal/templates.go` — job template registry + `general_serial` (通用串行脚本); `scheduler_submit` has `dry_run` review mode (returns resolved JobSpec before submitting). Read-only tools annotated ReadOnlyHint=true; write tools DestructiveHint=true. `go build`/`go vet`/`go test` clean, binary ~12MB. |
## Build & Test
```bash