已关闭
Add versioned admin observation API and resumable SSE events #93
urandon创建于 24 天前关闭于 23 天前
24 天前 添加了label:enhancement
urandon
23 天前 评论:
23 天前 评论:
Implementation plan for #93 (kept as a comment so the original issue input remains fixed):
- Keep
internal/adminhttpas transport/security only. Add versioned public DTOs there and inject one read-only snapshot provider from the coordinator; no CLI/MCP subprocesses and no provider/network calls. - Build the snapshot in
internal/servicectlfrom the in-process JobManager, MaintenanceManager, capability registry, and read-only cache access. Absolute cache paths and config references stay daemon-local; browser identities are cache UUID/path fingerprints. - Model service/readiness, caches/repositories, five coverage lanes, jobs, policy, diagnostics, and capabilities as separate typed cohorts. A current lane state, active contention, scheduled retry, and last stage error remain independent fields.
- Serve coarse
snapshotplus filtered cache/repository/job/maintenance/diagnostic/capability resources. Job history is deterministic and cursor/limit bounded. - Add a controller-owned bounded event ring. SSE uses opaque monotonic cursors, retained replay, keepalives, and an explicit
snapshot_requiredevent when a cursor is outside the replay window. Events are compact invalidations/progress summaries, never raw logs. - Contract tests will cover stable JSON shape, sorting/filtering/paging, public-safe serialization, observation side-effect freedom, SSE replay/expiry, auth, and existing Host/Origin boundaries.
The existing UI shell will switch from the temporary readiness DTO to the coarse snapshot and consume invalidation events without changing the selected visual direction.


23 天前 关联了pull request:Add versioned admin observation API and resumable SSE
urandon
23 天前 评论:
23 天前 评论:
Implemented in !97.
The slice now provides:
- a deterministic
admin.v1coarse snapshot plus versioned cache, repository, job, maintenance, diagnostics, and capability resources; - six UI-facing cohorts through composed product DTOs rather than CLI/SQLite mirrors;
- independent head, tail, secondary, projection/content-generation, and RAG lanes;
- current RAG truth kept independent from contention, scheduled retry, and last-stage error;
- opaque
cache_refand one-way fingerprints, typed sanitized errors, no absolute paths/raw logs/raw cached bodies; - bounded job filters/paging and structured sanitized progress;
- bounded SSE with opaque cursor, retained replay, Last-Event-ID reconnect, session expiry, and
snapshot_requiredfor expired/future cursors; - aggregate source-kind counts so periodic observation does not load cached source bodies/aliases;
- the existing Svelte shell wired to snapshot + SSE while preserving System-default Light/Dark/System theming.
Verification:
go test ./...go test -race ./internal/adminhttp ./internal/servicectlgo vet ./...git diff --check- frontend typecheck/unit/Playwright smoke
- deterministic embedded asset rebuild
- live local Playwright QA for one-time session exchange, snapshot contract, SSE, reload continuity, and path redaction
No tag/release and no routine source install were produced; this is one slice of the larger admin epic.


23 天前 关闭了 issue
23 天前 关联了里程碑:Admin Web UI
23 天前 添加了label:admin-ui
23 天前 添加了label:service
Parent: #52
Depends on: embedded admin runtime foundation
Design: https://gitcode.com/urandon/gitcode-mcp/wiki/Admin-Web-UI-Design-2026-08-25.md
Goal
Expose a stable, sanitized admin observation API whose DTOs model product truth rather than mirroring CLI commands or SQLite tables.
Scope
/api/admin/v1/snapshot, caches, cache/repository detail, jobs, maintenance, diagnostics, and capabilities read endpoints.cache_ref/fingerprints and sanitized typed errors; exclude credentials, raw payloads, raw cache content, and absolute private paths.snapshot_requiredfallback.Acceptance criteria
go test ./...andgit diff --checkpass.Non-goals