From 7f07180c71f9772238bd3ef94aaa96fd7170be17 Mon Sep 17 00:00:00 2001 From: Marcel Date: Tue, 12 May 2026 09:38:49 +0200 Subject: [PATCH] docs(adr-012): add enforcement note and libLoader revisit signal - Explicitly states no lint rule is planned; CI guard is the backstop (addresses Elicit OQ-001 from PR #536 round 4) - Adds a "when to revisit" note: extract shared DynamicImportLoader if 3+ components adopt the libLoader pattern (addresses Markus Keller round-4 observation on PR #536) Co-Authored-By: Claude Sonnet 4.6 --- docs/adr/012-browser-test-mocking-strategy.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/adr/012-browser-test-mocking-strategy.md b/docs/adr/012-browser-test-mocking-strategy.md index bc03a44d..763a7649 100644 --- a/docs/adr/012-browser-test-mocking-strategy.md +++ b/docs/adr/012-browser-test-mocking-strategy.md @@ -86,3 +86,5 @@ These modules are resolved at static import time (before any test runs). Their ` - New browser-mode specs that need to stub an external library **must not** use `vi.mock(externalLib, factory)`. Add a loader/factory parameter to the underlying hook or service instead. - The CI `unit-tests` job includes a permanent grep guard that fails the build if `rpc is closed` appears in any coverage run log. This catches regressions before they reach the acceptance criterion. - Acceptance criterion for #535: 60 consecutive green `workflow_dispatch` CI runs against `main` after the fix is merged, with zero `rpc is closed` lines in any log. +- **Enforcement:** No automated lint rule is planned; the CI coverage guard is the regression backstop. If a lint rule is added later (e.g. an ESLint rule flagging `vi.mock` of non-virtual modules in browser-mode spec files), update this ADR. +- **When to revisit the LibLoader home:** If three or more components adopt this pattern, consider extracting a shared `$lib/types/lib-loader.ts` or a generic `DynamicImportLoader` type to avoid parallel type definitions across modules.