Skip to content

Commit 451b5a6

Browse files
committed
검사: 저장소 표면 하한의 오염을 차단
구조 게이트가 Git 추적 파일과 새 비무시 파일만 세도록 검사 표면을 고정했다. ignored 빌드 cache와 로컬 지침 파일이 CI보다 높은 수를 만들던 경로를 닫았다. mainPlan 삭제로 실제 줄어든 문서 기반 법의 하한은 깨끗한 checkout 수에 맞췄다. 검증: npm test 3154/3154, diff whitespace 검사 통과.
1 parent 77c95dd commit 451b5a6

2 files changed

Lines changed: 25 additions & 13 deletions

File tree

tests/gateFloor.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
"sections": {
44
"표면": 16,
55
"계약": 18,
6-
"em dash": 410,
7-
"제어문자": 409,
8-
"문서 주체": 404,
6+
"em dash": 401,
7+
"제어문자": 400,
8+
"문서 주체": 395,
99
"네이밍": 297,
1010
"성능 주장": 13,
1111
"digest 법": 443,
@@ -26,22 +26,22 @@
2626
"셰이더": 10,
2727
"컴퓨터 조립": 4,
2828
"worker": 9,
29-
"링크": 47,
29+
"링크": 44,
3030
"구조": 33,
3131
"진입 표면 언어": 7,
3232
"CI 배관": 11,
3333
"커밋 규칙": 22,
3434
"탐지기 자기 시험": 8,
35-
"흔적 금지": 407,
35+
"흔적 금지": 399,
3636
"결과 기록": 6
3737
},
3838
"whyLaws": "법 단위 하한. 섹션 총계만 대조하면 섹션 안의 법 하나를 통째로 지워도 다른 법이 파일 수만큼 늘어나며 그 자리를 메운다(2026-07-27 실측: [digest 법] 하한 443, 실제 555, 여유 112 = 그 안의 네 법 중 어느 하나를 삭제해도 GREEN). 10개 이상인 법은 자기 하한을 갖고, 문턱을 넘는 새 법은 자동으로 등재를 요구받는다. 값은 실측이며 내리려면 같은 커밋에서 이 숫자를 고쳐야 한다.",
3939
"laws": {
4040
"PyProcError only": 113,
4141
"camelCase": 297,
4242
"digest 법": 113,
43-
"links ok": 47,
44-
"no em dash": 409,
43+
"links ok": 44,
44+
"no em dash": 400,
4545
"공유 헬퍼 import 실존": 112,
4646
"로케일 비교자 0": 188,
4747
"마크 참조 고정": 10,
@@ -54,11 +54,11 @@
5454
"숫자 자랑 0": 21,
5555
"엔진 내부 접근 법": 106,
5656
"음성": 15,
57-
"제어문자 0": 409,
58-
"주체 중립": 404,
57+
"제어문자 0": 400,
58+
"주체 중립": 395,
5959
"채널 행 고정": 10,
6060
"코덱 법": 109,
61-
"흔적 0": 406,
61+
"흔적 0": 398,
6262
"election": 10
6363
}
6464
}

tests/run.mjs

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,30 @@ import { assertWebMachineStructure } from "./support/structureWebMachine.mjs";
2222
const ROOT = join(dirname(fileURLToPath(import.meta.url)), "..");
2323
const gate = createGateCounter();
2424
const { check, checkAsync, section } = gate;
25+
const trackedResult = spawnSync("git", ["ls-files", "--cached", "--others", "--exclude-standard", "-z"], {
26+
cwd: ROOT,
27+
encoding: "utf8",
28+
timeout: 10000,
29+
});
30+
if (trackedResult.status !== 0) throw new Error(trackedResult.stderr || "검사 표면을 읽지 못했다");
31+
const repositorySurfaceFiles = new Set(trackedResult.stdout.split("\0").filter(Boolean).map((file) => file.replaceAll("\\", "/")));
2532

26-
// 재귀로 지정 확장자 파일 수집(node_modules 제외).
33+
// 재귀로 지정 확장자 파일 수집(node_modules와 생성 cache 제외).
2734
function collect(dir, exts, acc = []) {
2835
for (const entry of readdirSync(dir)) {
2936
// vendor/는 fetchEngine이 받은 서드파티 배포판(gitignore) = 우리 린트 표면이 아니다.
30-
if (entry === "node_modules" || entry === "vendor" || entry.startsWith(".git")) continue;
37+
// .cache/도 빌드 증거와 내려받은 release 문서가 쌓이는 gitignore 산출물이다. 이를 세면
38+
// 로컬 검사 수가 깨끗한 CI보다 커져 파일 삭제 하한을 거짓으로 만족시킨다.
39+
if (entry === "node_modules" || entry === "vendor" || entry === ".cache" || entry.startsWith(".git")) continue;
3140
const full = join(dir, entry);
3241
// assets/ 디렉터리는 엔진 배포판과 바이너리 fixture가 사는 곳(전부 gitignore)이다.
3342
// vendor/와 같은 이유로 린트 표면 밖이다. 파일 assets.js는 이 규칙에 걸리지 않는다.
3443
if (statSync(full).isDirectory() && entry === "assets") continue;
3544
if (statSync(full).isDirectory()) collect(full, exts, acc);
36-
else if (exts.some((e) => entry.endsWith(e))) acc.push(full);
45+
else {
46+
const relative = full.slice(ROOT.length + 1).replaceAll("\\", "/");
47+
if (repositorySurfaceFiles.has(relative) && exts.some((e) => entry.endsWith(e))) acc.push(full);
48+
}
3749
}
3850
return acc;
3951
}

0 commit comments

Comments
 (0)