已关闭
Add Web UI job supervision for sync and RAG jobs #95
urandon创建于  16 天前关闭于  16 天前
urandon
urandon成员
16 天前 创建

Parent: #52
Depends on: admin observation API; read-only operator views

Design: https://gitcode.com/urandon/gitcode-mcp/wiki/Admin-Web-UI-Design-2026-08-25.md

Goal

Add safe supervision for daemon-owned sync and RAG jobs.

Scope

  • Jobs list/detail with cache/repo/type/state/failure filters.
  • Structured progress timeline: collection/page/counters, throughput/ETA, rate-limit/backoff, contention, retry schedule, and interruption.
  • Browser reload/reconnect by stable job id using snapshot plus SSE invalidation.
  • Safe cancel for supported jobs through the shared job manager.
  • Retry as a new idempotent/coalesced job; never imply that interrupted work resumed in place if a new job was created.
  • Show work/coalescing identity and cache writer ownership without exposing private paths.
  • Add mutation receipts and exact current/terminal state after actions.
  • Define and test bounded server retention/pagination for jobs and progress.

Acceptance criteria

  1. A user can supervise a long sync or RAG run after closing/reopening the browser and after daemon restart.
  2. Cancel is graceful and leaves durable frontiers/generations consistent.
  3. Retry cannot duplicate already active equivalent work and returns the coalesced/new job id.
  4. Rate limiting, cache contention, retry wait, interruption, cancellation, failure, superseded, and success are distinguishable.
  5. Mutations require session, CSRF, capability check, target identity, and idempotency key.
  6. Playwright covers reconnect, cancel, coalesce/retry, expired event cursor, and interrupted jobs.
  7. go test ./..., frontend checks, and git diff --check pass.

Non-goals

  • Arbitrary priority editing or manual lock breaking.
  • Unbounded raw log retention.
likedislike
urandonurandon成员
16 天前 添加了label:enhancement
urandon
urandon成员
16 天前 评论:

Starting the job-supervision slice after merging !98.

Implementation plan:

  1. Add an admin job action adapter over the in-process JobManager/MaintenanceManager; no CLI/MCP subprocesses.
  2. Extend job DTOs with public-safe work/coalescing identity, cancellable/retryable reasons, progress cursor/retention metadata, throughput/ETA where derivable, and explicit interrupted/cancelled/superseded states.
  3. Add versioned CSRF-protected cancel/retry endpoints requiring session, same-origin, target identity, capability eligibility, and caller idempotency key. Retry will reconcile the original maintenance registration and report whether equivalent work was coalesced or a new job id was created.
  4. Persist bounded idempotency receipts with the daemon-owned job snapshot so browser reload/restart cannot replay a different intent.
  5. Add URL-backed job filters/detail and structured timeline; controls name the cache/repo and show the exact receipt/current state.
  6. Test reconnect/reload, graceful cancel, retry coalescing, stale/duplicate idempotency, terminal/unsupported targets, expired SSE cursors, interrupted jobs, bounded retention/progress, CSRF/origin/session, and responsive browser flows.

No arbitrary priority/lock controls, raw logs, release/tag, or routine source install.

likedislike
urandonurandon成员
16 天前 关联了pull request:Add safe admin job supervision
urandon
urandon成员
16 天前 评论:

Implemented in !99: https://gitcode.com/urandon/gitcode-mcp/pull/99

Completion report:

  • daemon-owned sync/RAG jobs now expose stable public work references, action eligibility, bounded progress retention, throughput/ETA where derivable, and failure-class filtering
  • cancel and retry require an authenticated browser session, same-origin validation, CSRF, a retained target, supported type/state, and a bounded idempotency key
  • action receipts persist only key/intent hashes, are bounded to 256 entries, replay safely after daemon restart, and distinguish cancelled/cancellation_requested plus created/coalesced/no_work_needed
  • retry is a safe current maintenance reconciliation, not a promise to reproduce an obsolete historical execution
  • Jobs now has URL-preserved state/type/cache/repository/failure filters, reload-safe detail, structured bounded timeline, rate-limit/retry/interruption state, explicit target confirmation, and receipt/error feedback
  • browser retries reuse the same idempotency key after an interrupted response
  • the real modal restores focus; Light/Dark/System remain supported with System default

Verification:

  • go test ./...
  • go test -race ./internal/adminhttp ./internal/servicectl
  • go vet ./...
  • frontend typecheck and unit tests
  • Playwright Chromium: cancel, retry coalescing, interrupted response replay, filters, deep-link reload, interruption and rate-limit states; 6 passed, live-only case skipped without its environment
  • deterministic embedded asset rebuild
  • visual QA at the selected 1487x1058 reference viewport and 390px responsive coverage
  • git diff --check

No tag, release, or go install was produced; this is one slice of the admin epic.

likedislike
urandonurandon成员
16 天前 关闭了 issue
urandonurandon成员
16 天前 关联了里程碑:Admin Web UI
urandonurandon成员
16 天前 添加了label:admin-ui
urandonurandon成员
16 天前 添加了label:service
urandonurandon成员
16 天前 添加了label:sync
urandonurandon成员
16 天前 添加了label:rag