Lei Chen
e4af0cac73
Phase 0: scheduleragent + mcp-server read-only agent framework
...
Complete the natural-language scheduler agent's Phase 0 read-only pipeline:
Task #2 (API Key auth mechanism):
- New store/apikey.go: APIKey store (hash, validate, expiry)
- controllers/apikey.go: GenerateAPIKey finally persists + registers RBAC role
- controllers/auth.go: GetUsernameFromToken recognizes xce_ak_ prefix
- middleware/validatehandler.go: isValidToken handles API Key
- config/rbac.yaml: mcp_readonly role (view-only permissions)
- 6 new test files covering unit + integration full-chain
Task #3 (schedulerclient Go library):
- types.go: URM types (URMJob/URMQueue/URMNode/JobStatus/Metrics)
- client.go: read-only Client interface (6 methods)
- httpclient.go: resty-based HTTP implementation
- statusmap.go + _test.go: TDD status mapping (33 tests)
Task #4 (mcp-server binary):
- cmd/main.go: entry, reads XCE_API_URL/XCE_API_KEY, registers 6 MCP tools
- internal/app.go: tool handlers wiring schedulerclient to MCP stdio
- Uses github.com/mark3labs/mcp-go@v0.57.0 for stdio transport
All: go vet clean, go build clean, schedulerclient 33/33 tests pass.
mcp-server binary ~11MB arm64, CGO_ENABLED=0.
Architecture:
Claude Code --stdio--> mcp-server --HTTP--> apiserver REST API --cgo--> C backend
Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-30 11:16:36 +08:00
febb4a6c4d
fix: preserve admin-set host state across worker re-registration in makeWorker_
...
When a worker re-joins and already exists in workermgr, makeWorker_()
now overrides the existing slot instead of returning EEXIST. Admin-set
flags (LOCKEDU, CLOSED, HIDDEN, CLOSED_BY_ADMIN) survive the override.
Add XCE_WORKER_CLOSED_BY_ADMIN flag to distinguish admin-closed hosts
from workload-closed ones. worker_ctrl sets/clears it alongside CLOSED.
Refactor worker_init/worker_destroy into copy_worker/kill_worker helpers
shared by both fresh creation and override paths.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 10:38:39 +00:00
d47b3375e7
controller will pass resource <name, value> pair than <idx, value> pair
2026-05-13 07:18:03 +00:00
ce2edf0dac
refactor: represent time fields as int64 Unix seconds throughout the stack
...
Collapses a four-step conversion chain (time_t → int64 → time.Time →
RFC3339 string → string → time.Time) to a direct int64 pass-through:
C time_t → rawJobData int64 → JobInfo int64 → JSON integer → QueryJob int64 → time.Unix() for display
Changes:
- apiserver/models/jobs.go: SubmitTime, QueueTime, StartTime, EndTime,
ReserveTime in JobInfo and JobAdditionalFields: time.Time → int64
- apiserver/models/common.go: ActionControl.SubmitTime: time.Time → int64
- backend/convert_pure.go: remove time.Unix() calls; assign int64 directly
- backend/convert_test.go: update time assertions to compare int64 values
- xcecli/models/jobs.go: SubmitTime, StartTime, EndTime, ReserveTime in
QueryJob: string/time.Time → int64; remove time import
- xcecli/common/output/time.go: replace parseJobTime(string) with
unixToTime(int64) and fmtUnixTime(int64) helpers
- xcecli/common/output/page_print_jobs.go: replace parseJobTime() calls
with unixToTime()/fmtUnixTime(); remove !startTime.IsZero() guard
(unixToTime returns false for ts<=0, making it redundant)
- xcecli/common/output/page_print_array_elements_jobs.go: replace
string-split+time.Parse submit-time block with fmtUnixTime(); remove
unused time import
Side effect: eliminates the "0001-01-01T00:00:00Z" zero-time
serialization issue at the source — zero timestamps are now 0 (integer)
and unixToTime/fmtUnixTime return false/"-" for ts<=0 without special-
casing needed in callers.
2026-05-09 07:00:49 +00:00
b94ff9eb01
feat: P2.5-7a map JOB_STAT_TRANSIENT (0x400) to TRANSIENT in job status API
2026-05-08 02:03:19 +00:00
d7afd72e5b
fix front end issues
2026-05-01 21:22:45 +08:00
00c4472d6c
Add HostConfig + Cluster fields to models and update docs
2026-04-16 09:24:22 +00:00
c9dc8c4676
Merge Go frontend (apiserver + xcecli) into meson build
2026-04-14 11:23:18 +08:00