已关闭
[Bug][surface parity] Align configured/default and explicit sync collection selection #217
urandon创建于  15 天前关闭于  15 天前
urandon
urandon成员
15 天前 创建

Origin and duplicate triage

Discovered while qualifying #212 follow-ups on merged main2e8e271bd08bd4d444e90291f2c019eb7bfc33ba. Relevant and deterministically reproduced offline through actual CLI dispatch and MCP stdio. Cached duplicate search for sync/scope inspected existing history, #209, #212 and #216; no open issue owns this selector-routing mismatch. #215 concerns work/page bounds, not collection selection.

Minimal reproduction

Use an isolated in-memory binding fixture with issues scope only and a synthetic provider returning one issue. No credentials or live GitCode traffic.

  1. CLI sync with no collection selector: exit0, one success, complete. MCP sync_live with no selector: one success but mixed traversal and one unavailable-wiki diagnostic.
  2. Explicit CLI sync --issues --wiki: typed invalid_query for unavailable wiki. Explicit MCP sync_live({issues:true,wiki:true}): one success, complete, no diagnostic; requested wiki was silently skipped.

The two-case regression fails on the named main SHA. Source explanation: CLI omission delegates BulkSyncAll (configured-scope selection) while MCP omission invokes issues/wiki separately. Conversely MCP explicit issues+wiki delegates BulkSyncAll, silently scope-filtering explicit intent, while CLI explicit selectors call each selected collection. This is not a provider parsing, credential or RAG defect.

Proposed bounded contract / acceptance

  • Publish and share one collection-selection contract before implementation: omission uses configured eligible default scopes; explicit selectors remain explicit and never silently disappear. Unsupported requested scope returns a typed diagnostic/error, consistently across CLI/MCP.
  • Keep existing finite foreground preview/explicit coverage bounds, exact-target rules, issue/PR comment selector compatibility and durable daemon budgets intact. No new sync framework.
  • Exercise actual CLI/MCP entrypoints with issues-only, wiki-only and both-scope bindings; omitted and explicit selectors; missing/unsupported scope; complete/partial outcomes and provider attempt counts. Assert the actual selected work, not just metadata.
  • Assess default daemon/private IPC/Admin cohorts and record intentional differences or required convergence; no silent UI omission.
  • No remote write, implicit setup, cache reset or schema migration.
  • Focused/full offline tests, affected races, independent exact-SHA review and branch/main CI before merge.

Follow-up dependency of #212 and release wave #214/v0.4.1. Separate PR after #216, before release provenance #211. Original #215 PR remains unchanged; its resulting main CI is still being observed.

likedislike
urandonurandon成员
15 天前 关联了里程碑:Bugfix and surface consistency v0.4.1
urandonurandon成员
15 天前 添加了label:bugclimcp
urandon
urandon成员
15 天前 评论:

Fresh triage and shared-selection design

The original two-case CLI/MCP fixture fails unchanged on mainc6f44dbfeeec20f446e6e7aef705aeb60a521057 after #216 merge: omission gives CLI complete/no diagnostic versus MCP mixed/wiki diagnostic; explicit issues+wiki gives CLI invalid_query versus MCP silent success. No provider network is involved. This remains separate from the now-delivered paging/budget fixes.

Proposed shared service-layer contract:

  • Omitted collection selectors choose only eligible configured defaults: issues and/or wiki according to the canonical binding's existing scopes. Empty eligible selection is a typed validation error, not a successful no-op. No pulls or comments become implicit.
  • Explicit selectors are never scope-filtered silently. Validate the entire selected set before provider work; an unsupported scope yields typed invalid_query(field=scope), with no provider calls or partial supported-collection side effects. Preserve canonical collection order and existing legacy comment-alias interpretation/exact-target restrictions.
  • Put selection/default/validation logic in one service-owned helper/contract, not a new dispatch registry. CLI, MCP and new manual daemon requests use the same resolved selection. Preserve #215 finite preview/explicit coverage/time budgets independently.

Daemon/private-IPC assessment found another relevant path: normalizeDurableSyncRequest currently turns omission into issues+wiki before binding scopes are considered. New manual daemon admission should resolve defaults against the selected canonical cache binding before work-key/coalescing and persist the resulting explicit collection intent. Recovered durable workflows and maintenance policies already carry explicit collection snapshots; do not reinterpret old admitted work or silently drop its requested stages. Keep binding-fingerprint and writer-admission fences intact.

UX: Admin has no new foreground selector action to add. Existing job collection rows must reflect the actual resolved admitted workflow. Add semantic coverage for an issues-only default job and rejection of unsupported explicit scope without enqueue/provider work; maintenance's explicit policy controls retain their own validation.

Verification: issues-only/wiki-only/both-scope fixtures across actual CLI/MCP and daemon admission; omitted/explicit/missing scope and binding, canonical aliases, provider attempt counts, real selected collections, comment compatibility/exact target, coalescing/recovery snapshots, partial/cancel and unchanged bounded stages. Preserve the original failing overlay for before/after evidence. Full affected gates, independent exact-SHA review and branch/main CI remain required. This uses existing binding scopes, not new role/tool authorization #213.

likedislike
urandon
urandon成员
15 天前 评论:

Candidate and verification before independent review

Candidate bf774043f0f9a4f6e288c08b7caee7be21b6e15a on codex/issue-217-sync-selection, based on mainc6f44dbfeeec20f446e6e7aef705aeb60a521057.

Shared service-owned selection now chooses only configured issues/wiki defaults, validates the entire explicit selection before provider work, and rejects empty eligible scopes. CLI and MCP use it; new manual daemon admission resolves canonical binding scopes before work-key/coalescing and persists explicit intent. Existing recovery snapshots, maintenance policy, exact targets, comment compatibility and finite #215 budgets remain separate. No schema migration, provider write or new authorization mechanism.

Regression evidence: actual CLI/MCP tests cover issues-only/wiki-only/both omission, explicit selections/subsets, unavailable/empty scopes, missing binding, provider attempt counts, truthful selected collections and partial outcomes. Daemon fixtures cover alias-to-canonical resolution, unavailable-scope rejection before enqueue, effective collection rows and coalescing default with equivalent explicit intent. Existing writer-authority fixture now declares its intended issues scope; a separate nil-scope rejection test preserves that boundary. Early cancelled/deadline calls retain http_attempted=false rather than losing interruption diagnostics.

The original two-case triage overlay is preserved unchanged. Its omission case passes; its explicit case now receives the correct typed MCP invalid_query response, but that old probe assumes structuredContent and therefore fails decoding the intentional error envelope. Do not interpret that probe as fully passing: maintained transport tests assert the typed error and zero provider calls directly.

Passed on this candidate tree: go test ./...; go test -race ./internal/cli ./internal/mcp ./internal/service ./internal/servicectl ./internal/cache; focused selector/HTTP-attempt/cancellation/writer/coalescing regressions (three repetitions before the final additional missing-binding test); git diff --check; product documentation contracts; embedded asset validation (no asset drift); Svelte checks (zero errors/warnings); 24 UI unit tests; Playwright semantic suite 99 passed, one explicit opt-in QA skipped; semantic-only browser artifact guard. UI adds no new action: existing admitted-job collection rendering is covered. No live crawl/write was needed or claimed.

Independent exact-SHA review and branch/main CI are still pending. Issue remains open.

likedislike
urandonurandon成员
15 天前 关联了pull request:Fix configured sync collection selection across CLI, MCP and daemon
urandon
urandon成员
15 天前 评论:

Independent review of bf774043f0f9a4f6e288c08b7caee7be21b6e15a

One P2, no other P0-P3 findings: immediate MCP daemon/detach omission still hardcoded issues,wiki in its response even though the daemon admitted only configured scopes. Independent IPC regression reproduces the false metadata. Full Go/focused checks passing did not cover this response cohort. The exact-SHA branch CI run38754904365 also passed all18 steps, but neither it nor that review authorizes merge of a changed candidate.

Fix in progress: expose additive explicit daemon-owned sync_selected_collections intent separately from asynchronous outcome rows, record/copy it with new admission and preserve exact-work-key coalesced intent. MCP must use the daemon response, not its potentially different local cache or partial outcome rows. An older daemon without intent metadata returns an empty/unknown list with service_sync_selection_unavailable, never fabricated defaults. Existing recovery snapshots remain unchanged. Added real IPC tests for daemon/detach issues/wiki/legacy-unknown replies and daemon immediate/persisted/coalesced intent with slice-isolation checks. Independent original probe is retained as before-fix evidence; because it supplies outcome rows but no new intent field, the corrected legacy contract is explicitly unknown, not inference from those rows.

Re-running full/race/UI gates; new exact-SHA review and CI remain required. No merge.

likedislike
urandon
urandon成员
15 天前 评论:

Final exact-SHA independent review

Candidate a8aba5545f6a6de106976811a4a6c1e916ae2590, PR!207, base c6f44dbfeeec20f446e6e7aef705aeb60a521057.

Independent re-review verdict: no P0-P3 findings. Previous P2 is resolved: immediate MCP daemon/detach replies use explicit daemon-owned admitted intent; no inference from asynchronous outcome rows or the MCP-local cache. Reviewer checked atomic persistence, safe copies, exact-work-key coalesced legacy replies and nonmutation of retained recovery snapshots. Missing old-daemon metadata stays explicitly unknown. Original diagnostic artifacts preserved unchanged, not falsely claimed passing under a revised envelope/legacy contract.

Reviewer independently passed go test ./...; go test -race ./internal/mcp ./internal/servicectl -run 'Test.*SyncSelection' -count=3; product docs contracts; full-range whitespace. Author final full Go, affected5pkg races plus final test-only legacy coalescing race×3, asset/type/unit/semantic UI gates and artifact guard also passed. A transient newly written persistence probe initially instantiated a manager without loading its snapshot; the maintained test now decodes the actual durable snapshot instead. No production gate was weakened.

Required branch CI run38756877377 is in progress for this exact SHA. No merge or closure until it is terminal green and fresh remote head/base/review-thread checks pass, followed by resulting main CI.

likedislike
urandon
urandon成员
15 天前 评论:

Pre-merge gates clear

Independent review of a8aba5545f6a6de106976811a4a6c1e916ae2590 has no P0-P3 findings. Required exact-SHA push CI https://github.com/urandon/gitcode-mcp/actions/runs/38756877377 attempt1/job116497519537 completed success: all18steps, including native user-systemd and release fixtures. Root independently read the terminal job/step data.

Fresh canonical PR!207 readback confirms open, intended branch/head SHA and main base c6f44dbfeeec20f446e6e7aef705aeb60a521057; live branch refs agree. Refreshed PR discussions contain zero unresolved/unknown threads. Clean local tree. Proceeding to authorized merge at the expected exact head SHA; issue remains open until resulting main CI succeeds.

likedislike
urandon
urandon成员
15 天前 评论:

Delivered / acceptance complete

Merged PR!207 to main339cf49daeba3b51a01fd6bb2222b0837dc016ad after final independent review of a8aba5545f6a6de106976811a4a6c1e916ae2590 (no P0-P3) and exact branch CI https://github.com/urandon/gitcode-mcp/actions/runs/38756877377 attempt1/job116497519537, all18steps success.

Fresh resulting main CI https://github.com/urandon/gitcode-mcp/actions/runs/38757897094 attempt1/job116501100389 also completed all18steps success, including native user-systemd and release fixtures; root independently checked terminal job data. Merge parents are c6f44dbfeeec20f446e6e7aef705aeb60a521057 and reviewed a8aba5545f6a6de106976811a4a6c1e916ae2590. Merge tree d240f8f429ad5b4de48034ac4d9ef75e65065c54 equals the reviewed tree. Local main fast-forwarded and clean.

Selection parity is complete for the scoped cohort: configured defaults, whole explicit preflight, real provider attempt counts, missing/empty scope/binding, partial/cancel evidence, canonical daemon admission/coalescing, persisted/copied admitted intent and truthful MCP daemon/legacy metadata. Admin admitted outcome rows remain semantic-tested. Original issue input and diagnostic artifacts preserved. No migration, live crawl/write, new sync framework or role-policy feature. #212 dependency is now satisfied; release wave #214 still has #211 and unresolved #198 factual triage before release.

likedislike
urandonurandon成员
15 天前 关闭了 issue