문제
tests/fixtures/architecture/forbidden/**에는 fixture 전용 ESLint 블록이
붙어 있었다. 모든 계층의 금지 import와 fetch·localStorage·sessionStorage
금지를 합친 것이다. check-architecture.ts는 fixture마다 ESLint 종료 코드가
0이 아니면 거부됐다고 셌다. 그래서 운영 src/presentation/** 블록에서 계층
import 금지와 fetch 금지를 지워도(변이 M2) check:architecture는 "9 forbidden
rejected"로 통과했다. 전역 fetch·localStorage 금지는 이 ESLint 블록 말고 지키는
검사가 없다.
고른 방법
- 새 scripts/lib/architecture-lint-fixtures.ts가 fixture마다 그것이 대표하는
운영 경로(lintAs, 예: src/presentation/__architecture_fixture__/…)와 거부해야
하는 규칙(rejectedBy)을 적는다. ESLint API lintText(code, { filePath })로
그 경로의 운영 설정을 그대로 적용한다. 금지 fixture는 그 규칙이 보고해야
통과하고, 허용 fixture는 계층 규칙(no-restricted-imports·globals)이 아무것도
보고하지 않아야 통과한다. 목록에 없는 fixture 파일도 실패로 센다.
- domain fixture는 domain 코드가 실제로 사는 src/features/*/domain 블록으로
검사한다(최상위 src/domain 폴더는 없다).
- fixture 전용 ESLint 블록을 지운다. check-architecture.ts에서 쓰이지 않게 된
pnpm 하위 프로세스 실행과 npm_execpath 요구를 지운다.
- 버린 대안: 금지 fixture 삭제. import 방향은 그래프가 지키지만 전역 금지의
검출이 0이 된다. 종료 코드만 보고 운영 경로로 옮기기. 다른 규칙(화면 문구
등)이 걸려도 거부로 센다.
위험·한계
- 계층 규칙 이름이 바뀌면 fixture 표의 rejectedBy도 같이 고쳐야 한다(고치지
않으면 실패로 드러난다).
- 출력 문구가 "3 allowed PASS, 9 forbidden rejected by the production rule for
their layer"로 바뀐다. 이 문구를 읽는 스크립트는 없다.
검증
- RED: 수정 전 변이 M2(운영 presentation 블록의 계층 import 금지와 fetch 금지
삭제)에서 check:architecture exit 0, "9 forbidden rejected".
- 수정 뒤 같은 변이에서 check:architecture exit 1, presentation fixture 5개가
"was accepted"로 실패. 되돌린 뒤 exit 0.
- 새 tests/unit/architecture-lint-fixtures.test.ts 3건(운영 설정 통과,
overrideConfig로 규칙을 끄면 실패, 목록 밖 fixture 실패) 통과.
architecture-report 3건 통과. check:types 통과, eslint 통과.
Refs: docs/reviews/2026-11-03-maturity-review/12-guardrails-ci.md 12-04
문제
zod-is-reached-through-contracts-zod 규칙의 to.path가 ^zod$다. src 파일이
"zod/v4"를 import하면 check:architecture가 rc=0으로 통과한다(실험 Z1). 그
모듈은 src/contracts/zod.ts의 jitless 설정보다 먼저 스키마를 만들 수 있고,
그러면 운영 CSP가 zod의 Function 탐침을 부팅마다 보고한다(F-7).
고른 방법
to.path를 ^zod(/|$)로 넓힌다. 그래프 fixture에 "zod/v4"를 import하는 파일과
그것이 거절되는지 보는 회귀 검사를 더했다. layers.md 규칙 표도 고쳤다.
버린 대안
- eslint no-restricted-imports에 zod 패턴 추가: 같은 규칙을 두 도구에
둔다. 경계 규칙은 dependency-cruiser가 정본이다.
위험·한계
- src 안에 zod 하위 경로 import는 지금 없다(grep). 다운스트림이 쓰고
있으면 check:architecture가 실패한다. src/contracts/zod.ts의 z로 바꾼다.
검증
- 수정 뒤: 참조 기능 스키마 파일 import를 "zod/v4"로 바꾸면
"Architecture violation [zod-is-reached-through-contracts-zod]: ... ->
zod/v4"로 실패, "zod"도 실패.
- 규칙을 ^zod$로 되돌리면 새 회귀 검사 "zod subpath import outside
src/contracts/zod.ts is rejected"가 실패한다.
- check:architecture(29 regression checks PASS), check:types, eslint,
verify:documentation 통과.
Refs: docs/reviews/2026-11-03-maturity-review/07-contracts.md P-07-06
zod probed Function("") on its first object schema, which the production CSP
(no unsafe-eval) reported on every boot. Schema code now imports z from
src/contracts/zod.ts, enforced by a dependency-cruiser rule, and the CSP smoke
drops its init-script workaround.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Graph violations printed only the rule name and file pair, and ESLint only the
pattern. The graph now prints the import specifier and the rule's comment,
every rule has one, and ESLint pattern groups carry a message.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every adapter group's second-level index.ts counted as a public barrel although
only storage/indexeddb and storage/opfs need one. layers.md called the
cross-context-invalidation kernel edge frozen while any adapter could use it.
Exceptions now name the exempt path, reason, owner and revisit condition.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A glob loaded adapter modules without naming one, so the graph, ESLint and the
type check all passed it. It is now a parse failure like a non-literal import().
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dependency-cruiser 18 cannot parse TypeScript 7, so it cruised no module, passed,
and its report and the docs claimed it checked the layers. The import graph is
the only checker; .dependency-cruiser.json stays as its rule file (D-11).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Icon vendor, design-system deep import and realtime composition were regular
expressions beside graph rules, and the regex missed relative deep imports
inside presentation. They are graph rules with fixtures now, with the
components/ui facades and page-templates named. package-script-graph.ts stays;
the reason is recorded.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The graph checks one edge at a time, so presentation reached a concrete adapter
through a re-export in a feature root file or a context with every rule passing.
Those modules may no longer import src/adapters, and presentation may no longer
import apps or contexts (app-router.tsx is the named exception).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>