已关闭
Add Web UI maintenance and repository binding plan/apply controls #96
urandon创建于  8月25日关闭于  8月25日
urandon
urandon成员
8月25日 创建

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

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

Goal

Add explicit plan/apply controls for repository bindings and daemon maintenance policy.

Scope

  • Maintenance registration list and policy editor for sync mode, bound collections, head interval/bounds, tail slice budget, RAG profile, and reconciliation interval.
  • Deterministic plan showing service actions, GitCode network reads, cache mutations, model/provider requirements, cached-text data boundary, blockers, and confirmation requirements.
  • Apply/enable/disable/reconcile through the existing maintenance use cases with current plan id and idempotency.
  • Reject stale plans when cache identity, binding, config hash, provider/model revision, or policy generation changes.
  • Binding add/update plan/apply with API URL defaulting, alias/scope validation, and ambiguous/missing-binding diagnostics.
  • Return precise CLI handoff for machine/service/model actions not safe for browser execution.
  • Derive UI action availability from capability registry plus explicit UI surface policy.

Acceptance criteria

  1. An operator can enroll and adjust one selected cache/repository without hidden network, machine, storage, or embedding-provider effects.
  2. Repeated apply is a safe replay or no-op; conflicting intent returns a typed idempotency error.
  3. Stale plans are rejected with an exact remediation/replan action.
  4. The UI never accepts an arbitrary unvalidated cache path.
  5. Repository removal/unbind is unavailable until an audited product capability exists; the UI never edits SQLite directly.
  6. Service install/start and model download require explicit supported authority or return a CLI handoff.
  7. Tests cover missing/ambiguous binding, default API URL, scope changes, stale plan, partial apply recovery, and coalesced initial jobs.
  8. go test ./..., frontend checks, and git diff --check pass.

Non-goals

  • Credential editing.
  • Cache reset/migration/delete.
  • RAG purge/delete/rebuild-all.
likedislike
urandonurandon成员
8月25日 添加了label:enhancement
urandon
urandon成员
8月25日 评论:

Implementation plan for the next admin slice:

  1. Add CSRF-bound versioned plan/apply endpoints; browser requests identify a cache only by cache_ref and the daemon resolves the already managed private path in-process. Arbitrary paths are never accepted.
  2. Reuse MaintenanceSetup plan semantics for cache identity, binding/config/provider/model/policy hashes, but enforce browser policy: no service install/start, provider start, model download, migration, reset, or direct SQLite edits. Unsafe prerequisites return exact CLI handoffs.
  3. Re-plan on every apply and reject changed plan ids as stale_plan. Apply enrollment/reconcile through MaintenanceManager with idempotency and preserve coalesced initial jobs. Add explicit disable and reconcile controls with target/state validation and receipts.
  4. Add a binding plan/apply capability with GitCode API URL defaulted to https://api.gitcode.com/api/v5, owner/name derivation from repo id, strict aliases/scopes, cache identity/version checks, stale plan rejection, and durable idempotency. Existing bindings may be updated atomically; unbind/removal remains unavailable.
  5. Extend Maintenance UI with selected cache/repository editor, effect ledger (network, cache, provider/data boundary, blockers, confirmations), review modal, apply receipts, CLI handoffs, and capability-derived disabled states.
  6. Cover missing/ambiguous binding, default URL, scope changes, stale plans, partial recovery, coalesced jobs, reload/error states, and responsive Light/Dark/System browser QA.

This remains one epic slice: no tag, release, or go install.

likedislike
urandonurandon成员
8月25日 关联了pull request:Add admin maintenance and binding controls
urandon
urandon成员
8月25日 评论:

Implemented and merged in !100: https://gitcode.com/urandon/gitcode-mcp/merge_requests/100

Delivered:

  • capability-gated maintenance policy plan/apply plus disable/reconcile controls;
  • deterministic effect ledgers, stale-plan rejection, exact confirmation, durable bounded idempotency receipts, and replay/conflict semantics;
  • atomic repository binding add/update/no-op with opaque cache refs, default/preserved GitCode API routing, normalized scopes, and alias conflict checks;
  • explicit CLI handoffs for service install/start, model download, and cache migration; browser authority does not include those operations;
  • responsive Svelte workbenches with System default and explicit Light/Dark/System theme selection.

Verification:

  • go test ./...
  • go vet ./...
  • go test -race ./internal/adminhttp ./internal/servicectl ./internal/cache
  • npm run check
  • npm test
  • npm run test:e2e -- --reporter=line: 8 passed, 1 live-environment test skipped
  • ./scripts/check-admin-ui-assets.sh
  • git diff --check

No release/tag or go install was performed; this is one slice of the UI epic.

likedislike
urandonurandon成员
8月25日 关闭了 issue
urandonurandon成员
8月25日 关联了里程碑:Admin Web UI
urandonurandon成员
8月25日 添加了label:admin-ui
urandonurandon成员
8月25日 添加了label:service
urandonurandon成员
8月25日 添加了label:admin-uicacheenhancement;删除了label:admin-uienhancement