fix(plugin): remediate ML-07 R2 findings
This commit is contained in:
@@ -0,0 +1,68 @@
|
||||
# Task: Remediate accepted MakeLore ML-07 R2 findings
|
||||
|
||||
## Identity
|
||||
|
||||
- Task ID: 20260827-plugin-ml07-remediation-r2-6e9a3c41
|
||||
- Mode: Feature
|
||||
- Branch: codex/20260827-plugin-ml07-remediation-r2-6e9a3c41-plugin-ml07-remediation-r2
|
||||
- Worktree: D:\Datas\OthersProjects\makelore-plugin-ml07-remediation-r2-6e9a3c41
|
||||
- Base commit: 29cf322f1ac0500295c1afec076800aea3908eb3
|
||||
- Owner: ml07-remediator
|
||||
- Status: Ready for Integration
|
||||
|
||||
## Scope
|
||||
|
||||
- Make the Data Service adapter validate the registry-supplied parsed tool instead of consulting a second static tool-definition table.
|
||||
- Prevent stale project-scoped Plugin Center mutations from committing after a newer project load starts.
|
||||
- Add persisted Pi run/resource identity evidence across reconnect and event replay through the existing extension bridge and capability registry.
|
||||
- Refresh plugin policy only before a parent worker can materialize an assigned server-backed plugin; child and core-only resolutions must not wait.
|
||||
- Change only the delegated product files, directly corresponding tests, and this record.
|
||||
|
||||
## Intent And Constraints
|
||||
|
||||
- Preserve the fixed first-party plugin boundary: package definitions are Main-authoritative, registry dispatch is the sole non-core tool path, and Pi remains the sole coding runtime.
|
||||
- Preserve policy refresh before materializing an enabled and assigned server-backed plugin. Do not add facades, migration/checksum machinery, or a replay framework.
|
||||
- Base and sole parent must remain `29cf322f1ac0500295c1afec076800aea3908eb3`; do not touch the coordinator or user root worktrees, push, or open a PR.
|
||||
- Existing coordinator and reviewer tasks are read-only peers. The prior ML-07 remediation worktree is complete and must not be reused.
|
||||
|
||||
## Project Context Loaded
|
||||
|
||||
- Concurrent and Planning gates passed with `task_context.py`; status identifies this exact worktree, branch, base, task, and owner.
|
||||
- Read the project memory entry/current-state/architecture/domain/data-flow/success criteria and relevant ADR/task records, including the coordinator, R2 reviewers, and prior remediation.
|
||||
- Read the canonical plugin implementation spec (especially §§6-7.5, 10.2-12), detailed design (especially §§8.2-8.9, 15-17), and ML-07 plan ticket.
|
||||
- Confirmed no ownership conflict: coordinator owns integration/its record; R2 reviewers are read-only; this task exclusively owns the bounded remediation files and focused tests.
|
||||
|
||||
## Plan
|
||||
|
||||
1. Add a red adapter test proving a registry-supplied schema controls validation, then remove the adapter's static definition lookup and run adapter/manifest/registry focus tests.
|
||||
2. Add stale A-mutation/B-load store tests, then apply one generation/project guard consistently to `setEnabled` and adjacent Data Service mutation commits.
|
||||
3. Move the refresh decision to the registry's existing role/assignment resolution seam; add never-settling child/core-only tests plus a server-backed parent refresh test, and remove the unconditional composition wrapper.
|
||||
4. Extend the existing Pi extension bundle test to persist a run ID, reconnect/re-import, replay the same resource ID, and assert both calls traverse the bridge/real registry with the identical `pi:<runId>:<resourceId>` request ID. Change production replay code only if this exposes a defect.
|
||||
5. Run affected focused suites, typecheck, lint, build, and package proof proportionate to the changes; complete the task documentation gate and create one clean remediation commit.
|
||||
|
||||
## Outcome
|
||||
|
||||
- The Data Service adapter now validates and dispatches the immutable parsed tool supplied by the registry; its production dependency on `DATA_SERVICE_TOOL_DEFINITIONS` is removed while the typed ten-operation switch and domain bounds remain code-owned.
|
||||
- Project-scoped enable/configure/reset/remove-collection/remove-project mutations capture both active project and load generation. A late project A response cannot inspect, commit, or trigger a reload after project B starts loading.
|
||||
- Policy refresh now occurs inside the registry resource-resolution seam only for a parent with an assigned Skill owned by a server-backed plugin with a registered adapter. Child and parent/core-only resolution return without touching a stalled refresh; an assigned server-backed parent still refreshes before reading project enablement or policy state.
|
||||
- The existing Pi extension bundle test persists `persisted-run`, reimports the generated extension to model reconnect, replays `persisted-resource`, and sends both calls through the authenticated bridge and real capability registry. Both results retain the exact request ID `pi:persisted-run:persisted-resource`; no production replay change was needed.
|
||||
- The async/sync manifest loaders were intentionally not consolidated: their only duplication is the inherently different filesystem API flow, while both feed the same parser/validator. Refactoring that optional shape would not improve runtime authority within this bounded remediation.
|
||||
|
||||
## Verification
|
||||
|
||||
- Red evidence: adapter registry-schema test initially received success because the adapter replaced the supplied tool with the static definition; after the fix it rejects with `plugin_input_invalid` and the backend is not called.
|
||||
- Red evidence: stale A enable and four adjacent Data Service mutation tests initially overwrote B or continued into inspect; after generation/project guards both pass without stale inspect/reload.
|
||||
- Red evidence: assigned server-backed parent registry resolution initially never called refresh; after moving the decision into the registry it refreshes before enablement lookup. Never-settling refresh tests prove child and parent/core-only paths do not wait or call refresh.
|
||||
- `pnpm exec vitest run` focused affected set: 8 files, 44 tests passed (`data-service-plugin-adapter`, plugin manifest/registry/composition/routes, store, Pi extension bundle, Pi resource loader).
|
||||
- `pnpm run typecheck`: passed.
|
||||
- Focused ESLint over all changed product/test files: passed with zero warnings/errors. Full `pnpm run lint` reported zero errors and five pre-existing unrelated warnings in Home/Makelore files.
|
||||
- `pnpm run package:stage:win-x64`: passed (Vite renderer/Main/preload/utility builds and Pi runtime staging).
|
||||
- First `pnpm run verify:artifact:pi` correctly reported a missing unpacked executable because Electron builder had not yet run. After `node scripts/run-electron-builder.mjs --win --publish never`, the verifier passed, including the package-owned Data Service manifest/Skill/tools and four core Skill roots.
|
||||
|
||||
## Follow-ups
|
||||
|
||||
- Coordinator will rerun the integration ledger/full suite after applying the sole remediation commit.
|
||||
|
||||
## Promotion Candidates
|
||||
|
||||
- None recorded.
|
||||
Reference in New Issue
Block a user