feat(boundaries): add layouts-v2 zone so v2 shell layout can use components-v2

AD-G2 ("OrganizerLayoutV2 wraps AppShellV2") was in tension with AD-G5:
src/layouts/OrganizerLayoutV2.vue classified as the v1 `layouts` zone,
which is deliberately barred from components-v2. New `layouts-v2` zone
(src/layouts/*V2*.vue, mode:file) gets pages-v2-equivalent v2 capability;
the v1 `layouts` zone is unchanged so v2 isolation is preserved. RFC
AD-G5 amended; locked by 3 boundaries-v2.spec.ts regression tests (7/7).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-17 02:03:00 +02:00
parent 6e5c5bbec3
commit a341a60412
3 changed files with 62 additions and 3 deletions

View File

@@ -67,4 +67,38 @@ describe('boundaries — v2 zones', () => {
expect(errs.length).toBeGreaterThan(0)
})
// -------------------------------------------------------------------------
// layouts-v2 zone (RFC AD-G5): the v2 shell layout (src/layouts/*V2*.vue)
// gets pages-v2-equivalent v2 capability so AD-G2 ("OrganizerLayoutV2
// wraps AppShellV2") holds — WITHOUT widening the v1 `layouts` zone.
// These lock both halves: the new edge AND the preserved isolation.
// -------------------------------------------------------------------------
it('allows layouts-v2 → components-v2 (AD-G5: v2 shell composition)', async () => {
const errs = await boundaryErrors(
'src/layouts/OrganizerLayoutV2.vue',
'<script setup lang="ts">import AppSidebar from \'@/components-v2/layout/AppSidebar.vue\'</script><template><AppSidebar /></template>',
)
expect(errs).toHaveLength(0)
})
it('allows layouts-v2 → navigation (v2 layout sources nav data)', async () => {
const errs = await boundaryErrors(
'src/layouts/OrganizerLayoutV2.vue',
'<script setup lang="ts">import { orgNavItems } from \'@/navigation/vertical\'</script><template><div>{{ orgNavItems.length }}</div></template>',
)
expect(errs).toHaveLength(0)
})
it('forbids v1 layouts → components-v2 (AD-G5 isolation preserved)', async () => {
const errs = await boundaryErrors(
'src/layouts/OrganizerLayout.vue',
'<script setup lang="ts">import AppSidebar from \'@/components-v2/layout/AppSidebar.vue\'</script><template><AppSidebar /></template>',
)
expect(errs.length).toBeGreaterThan(0)
})
})