Files
makelore/.project-docs/30-worklog/tasks/20260827-plugin-ml07-remediation-r4-8a5b3e02.md
T

4.8 KiB

Task: Remediate accepted MakeLore ML-07 R4 finding

Identity

  • Task ID: 20260827-plugin-ml07-remediation-r4-8a5b3e02
  • Mode: Feature
  • Branch: codex/20260827-plugin-ml07-remediation-r4-8a5b3e02-plugin-ml07-remediation-r4
  • Worktree: D:\Datas\OthersProjects\makelore-plugin-ml07-remediation-r4-8a5b3e02
  • Base commit: 07ea9da858
  • Owner: ml07-remediator
  • Status: Ready for integration

Scope

  • Fix the existing Plugin Center store load-flight generation handling for the exact pending A1 → pending B → A2 sequence.
  • Add focused regression coverage for both A/B completion orders while retaining consecutive duplicate-A coalescing, stable public pending keys, ordinary A-to-B latest selection, and all R3 mutation-epoch/reload behavior.
  • Change only src/stores/coding-plugins.ts, tests/unit/coding-plugins-store.test.ts, and this task record.

Intent And Constraints

  • A2 is a renewed latest intent for project A even when it shares A1's in-flight request; that shared flight must be promoted to the newest load generation so B cannot commit and A can commit without retry.
  • Do not merely add a latest-project check to B, because the old-generation A flight would still be unable to commit. Do not blindly increment generation before returning a coalesced flight without promoting that flight, because consecutive duplicate loads would lose commit eligibility.
  • Preserve epoch-specific load invalidation, authoritative mutation reloads, stable load:<projectId> pending keys, and project-scoped mutation guards from R3. Add no UI behavior or new abstraction layer.
  • Work only in the isolated exact-base task worktree; do not touch the user root/coordinator, revert peers, push, or open a PR.

Project Context Loaded

  • Concurrent Task Gate and Planning Gate passed for the exact task ID, feature mode, branch, worktree, base 07ea9da858b4a412191747a6c80f465cf2d46d45, and owner ml07-remediator.
  • Read the project memory startup set, architecture/data-flow/domain/success criteria, ADR-006, evidence/reflection/commitment/stale indexes, coordinator scope, R4 reviewer scopes, implementation spec §§8 and 10.3, and ML-07 fixed review/remediation ticket.
  • Coordinator owns integration; R4 standards/spec tasks are read-only. No active peer has a competing semantic decision or ownership overlap with the two product/test files.
  • Plugin Center mutations must remain pending/deduplicated, project state stays Renderer-local/project-scoped, and this correction does not change Main/Pi/plugin policy authority.

Plan

  1. Add a red table test for A1 pending → B pending → A2, resolving B/A in both orders; assert A1/A2 share one request/promise, B never wins, final A contains A's response, and public pending keys contain no internal generation.
  2. Attach mutable generation ownership to each in-flight load. A repeated intent promotes the shared flight to a newly allocated latest generation before returning it; its completion remains eligible, while intervening B becomes stale.
  3. Run the store suite plus adjacent Plugin Center client/page/settings tests, typecheck, scoped/full lint, diff/doc gates, then return one clean sole-parent commit.

Outcome

  • Added intent-aware generation ownership for keyed load flights. Re-selecting a pending load promotes that existing flight to the newest generation without issuing a second request, so an intervening project load cannot commit and the renewed flight can commit without retry.
  • Preserved epoch invalidation, mutation-triggered authoritative reloads, ordinary latest-project selection, shared-flight promise identity, and stable public load:<projectId> pending keys.
  • Added both A1/B/A2 completion-order regressions. Before the implementation, the B-first case committed B immediately and the A-first case ended on B; both now end on the renewed A response.

Verification

  • RED: corepack pnpm exec vitest run tests/unit/coding-plugins-store.test.ts — 2 new failures / 13 existing passes, demonstrating both incorrect completion orders.
  • GREEN: corepack pnpm exec vitest run tests/unit/coding-plugins-store.test.ts — 15/15 passed.
  • Adjacent focused suite: corepack pnpm exec vitest run tests/unit/coding-plugins-store.test.ts tests/unit/coding-plugins-client.test.ts tests/unit/project-plugins-page.test.tsx tests/unit/data-service-plugin-settings.test.tsx — 24/24 passed across 4 files.
  • corepack pnpm run typecheck — passed.
  • corepack pnpm exec eslint src/stores/coding-plugins.ts tests/unit/coding-plugins-store.test.ts — passed with no findings.
  • corepack pnpm run lint:check — passed with 0 errors and 5 pre-existing warnings in src/pages/Home/index.tsx and src/pages/Makelore/index.tsx, outside this task's ownership.

Follow-ups

  • None recorded.

Promotion Candidates

  • None recorded.