Commit Graph
12 Commits
Author SHA1 Message Date
DongHyeonka 5d064b8ace test(features): 기능을 더해도 기능 밖 테스트와 시나리오 하네스가 깨지지 않게 한다 (16-02)
문제: 기능 하나를 더하면(리뷰 16 실험 E) 기능 밖 테스트 3개가 깨진다.
① installed-context-routing은 context 목록이 정확히
["reference-context"]이고 첫 context가 참조 context라고 단정한다.
② product-feature-switch는 정렬 첫 기능(INSTALLED_PRODUCT_FEATURE_IDS[0])을
끄고 참조 라우트를 본다. 새 기능이 앞에 정렬되면 깨진다.
③ release-manifest fixture가 contractSet.packages: []로 고정이다.
EXTERNAL_PACKAGE를 쓰는 첫 기능에서 반드시 깨진다.
또 시나리오 하네스의 operation ID 타입이 테스트 계약 3개 리터럴이고
시나리오 응답 함수가 /api/test-entities 핸들러 안에 묶여 있다. 새 기능
테스트가 자기 operation에 실패 시나리오를 쓰려면 카탈로그를 고쳐야 한다
(안 고치면 TS2345, 실행하면 catalog.ts:469 TypeError).

방법: 리뷰의 (b) 최소 개선.
① "목록에 reference-context가 있다"로 바꾸고, 라우트 검사는 id로 찾은
  context에서 한다.
② REFERENCE_FEATURE_ID를 쓴다.
③ fixture의 packages와 setDigest를 EXPECTED_CONTRACT_SET_PACKAGES에서
  만든다.
하네스: HttpScenarioOperationId를 string으로 넓혔다. 시나리오 사실(명령
여부, 응답 상한, 성공 status)은 httpScenarioOperationFacts가 설치된 V3
descriptor에서 읽는다. 시나리오 응답은 tests/mocks/handlers/
http-scenarios.ts의 createHttpScenarioHandler로 옮겼다. 경로와 method도
descriptor에서 만든다. test-entities 핸들러는 이 함수를 쓰고 카탈로그
확인(assertOperationScenario)을 그대로 거친다. 카탈로그 기대값 57개는
계속 테스트 계약 3개에만 있고, 그 타입도 3개로 둔다. 카탈로그에 없는
operation을 assertOperationScenario에 넘기면 TypeError 대신 그 사실을
말하는 오류가 난다. test-entities 핸들러는 요청의 이름·id를 되돌려 주던
응답을 카탈로그 payload로 고정했다(기대값과 같은 값이다).
새 기능 테스트의 MSW 시나리오: server.use(createHttpScenarioHandler(
<자기 설치 계약>, { scenario: "server-terminal-503", payload }))
버린 대안: (a) 현상 유지는 기능마다 4곳을 고친다. (c) 하네스를 기능별로
나누면 변경이 크고 test-evidence.json의 증거 경로가 바뀐다. 기능
operation을 카탈로그에 더하는 방식은 기능 추가를 공유 파일 수정으로
만든다.
test-evidence.json은 바꾸지 않았다(sourceContracts 토큰이 test-entities.ts에
그대로 있다). 제거 드릴의 플랫폼 보존 목록에 http-scenarios.ts를 더했고,
테스트 전략 문서 11절에 사용법을 적었다.

위험·한계:
- 앱 전체를 렌더하는 테스트에서 response-too-large는 끝나지 않는다.
  실행기가 MSW가 넘긴 본문을 cancel하는 promise가 끝나지 않는 기존
  제약이다. 카탈로그 통합 테스트는 프록시 fetcher로 우회한다.
- 같은 실험에서 기능 밖 테스트가 더 깨진다. 이 발견 범위 밖이라 두었다.
  http-operation-v2-v3-parity는 스키마 ID "NoRequest"를 센티널로 고정한다.
  스키마 ID는 전역이라 두 번째 기능은 다른 이름을 써야 하고, 그러면 이
  테스트가 깨진다. manual-a11y-evidence·documentation-readiness(라우트별
  a11y 기록, 16-01)와 second-api-feature-registries(무효화 그래프 추가가
  breaking, 16-01)도 깨진다.
- test:sample-removal, test:http-scenario-evidence는 pnpm이 필요해 돌리지
  않았다.

검증:
RED: 참조 기능을 토큰 경계로 order로 바꾼 복사본(order-context,
EXTERNAL_PACKAGE 출처 포함, 커밋 안 함)을 넣고 tests/features
tests/component tests/runtime-schema를 돌렸다. 5파일 8개 실패. 기능 밖은
① 2개(["order-context","reference-context"]), ② 2개(order-feature를 꺼서
참조 링크가 남음), ③ 1개(ReleaseManifestError)다. 나머지 3개는 복사한
테스트다. 하네스 probe는 TS2345 2건, 실행 시 TypeError(catalog.ts:469).
새 통합 테스트는 기준 하네스에서 모듈 없음으로 실패하고, 기준
assertOperationScenario는 미등록 operation에 TypeError를 낸다.
GREEN: 같은 복사본으로 같은 폴더와 카탈로그 통합 테스트를 돌렸다. 78파일
중 실패는 출처를 바꾼 복사본 provenance 1파일뿐이고 ①~③은 통과한다.
order 테스트가 createHttpScenarioHandler(LIST_ORDER_RESOURCES_CONTRACT)로
content-type-mismatch·schema-mismatch·server-terminal-503을 화면에서
확인했다(카탈로그 수정 없음).
복사본을 지운 뒤: tests/features·component·runtime-schema·unit·
integration(security-followup-archive 제외)·contract 250파일 3111개 통과,
카탈로그 57/57, check-test-evidence --scenario-only·--source-only PASS,
tsc app·test·node 통과, verify-documentation-readiness PASS_SCOPED,
check-ci-contract PASS, 바꾼 파일 eslint 통과.

Refs: docs/reviews/2026-11-01-maturity-review/16-structure-patterns.md 16-02
2026-11-03 01:49:11 +09:00
DongHyeonka 498ae87554 test(evidence): HTTP 시나리오와 타입 음성 fixture를 테스트 계약으로 옮긴다 (0929/10-02)
문제: 샘플 제거 절차(scripts/test-sample-removal.ts)의 SAMPLE_EXTRAS가
플랫폼 검사도 함께 지운다. HTTP 실패 시나리오 카탈로그(57개)와 tests/mocks,
test:http-scenario-evidence(FE-GATE-007), 기능 API 타입 음성 fixture 8개와
check:types:fixture:* 8개(FE-GATE-003)가 참조 기능 계약을 import해서
샘플 소유로 묶여 있었다. 드릴은 플랫폼 경로 4개만 확인하므로 통과하고,
제품은 가드레일이 줄었다는 것을 모른다.

방법: 카탈로그와 handler를 tests/helpers/external-contract-fixture.ts의
테스트 계약(TEST_LIST/DETAIL, 명령)으로 옮겼다. 바이트 상한·명령 여부·성공
status는 계약에서 읽는다. 명령은 효과를 분류하는 패키지처럼
TEST_CLASSIFIED_CREATE_HTTP_CONTRACT를 더해 기존 기대값(401/403/429·422·
409 CONFLICT는 NOT_APPLIED, 409 IN_FLIGHT·404·503은 MAYBE_APPLIED)을
그대로 지킨다. TEST_CREATE_HTTP_CONTRACT의 분류기는 실행기 테스트가
"분류기 없음"을 확인하는 데 쓰므로 바꾸지 않았다. 문제 스키마에 선택
code만 더했다.
타입 fixture는 fixture tsconfig만 컴파일하는 fixture-feature-contract.ts의
테스트 기능(operation ID를 literal로 좁힌 테스트 계약, "fixture-feature"
입력 등록)을 쓴다. 등록 augmentation이 app·test 프로그램에 들어가지 않는다.
참조 기능 전용 handler(성공 응답만 쓰였다)는 tests/features/reference-feature
로 옮겼다. test-evidence.json의 owner는 platform이다. SAMPLE_EXTRAS에서
이 경로·스크립트를 빼고, 드릴의 플랫폼 보존 확인 목록에 16개 경로를 더했다.
샘플이 증거 정책을 갖지 않으므로 "등록 안 됨" 오류 검사는 지웠다.
버린 대안: README에 "함께 사라지는 검사" 목록만 적는다. 비용은 0이지만
검사는 계속 사라진다.

위험: fixture 스크립트 이름(check:types:fixture:reference-operation)과
파일 이름은 그대로라 이름이 내용(TEST_GET_ENTITY)과 다르다. CI 스크립트·
gates·워크플로 스냅샷을 함께 바꿔야 해서 미뤘다. 드릴의 제외 목록에 있는
tests/unit/http-scenario-evidence.test.ts는 그대로 뒀다.
test:sample-removal 자체는 pnpm이 필요해 돌리지 않았다.

검증: RED는 기준 복사본에 드릴의 삭제 목록을 적용했다. 카탈로그 테스트·
tests/mocks·타입 fixture 16파일이 지워지고 CI 스크립트 9개가 빠지는데 보존
확인은 4/4로 통과한다. GREEN은 같은 적용 뒤 보존 확인 16/16, 잔여 이름은
드릴이 빼는 removal-fixture.test.ts 하나, 타입 fixture 8개가 기존과 같은
진단(TS2345·2741·2353·2322·2345·2322·2322·2339) 1건씩으로 실패, 카탈로그
57/57 실행·check-test-evidence --scenario-only PASS, tests/component와
카탈로그 36파일 226개 통과, tsc -p tsconfig.test.json 통과. worktree에서는
테스트 계약 사용 파일·참조 기능·카탈로그 59파일 535개, scale session 2파일
통과, 음성 fixture의 양성 대조 컴파일 통과, tsc test·node 통과,
check-ci-contract PASS, 바꾼 파일 eslint 통과.
2026-11-03 01:18:36 +09:00
DongHyeonka e4ace51099 fix(features): 기능이 하나도 없을 때도 타입 검사와 커버리지가 통과하게 한다 (15-01)
문제: 샘플 제거 드릴(test:sample-removal)이 reference feature를 지우면
설치된 기능이 0개가 된다. 15-01 이후 그 상태에서 기능 기여 타입이 never가
되어 installed-feature-adapters.ts와 테스트 2개가 타입 검사에서 실패했다.
features.load는 기능 테스트로만 검증되고 있어서, 기능 테스트가 같이
지워지면 create-application.ts 커버리지가 90% 아래로 떨어졌다. 드릴 사본에
README.md·CHANGELOG.md가 없어 문서 테스트 2개도 실패했다.

방법: never일 때도 통과하는 넓은 타입으로 받아서 읽는다(as 단언 없이 대입).
features.load는 가짜 로더로 플랫폼 테스트를 추가했다(한 번만 적재, 남의
input 거부, 실패 후 재시도). 문서 테스트 2개는 드릴 제외 목록에 넣었다.
드릴 사본에 문서를 복사하는 안은 버렸다. 기능 제거와 무관한 파일이 사본
목록에 들어간다.

위험: 넓힌 타입은 기여 타입이 바뀌어도 featureId 검사 부분은 잡지 못한다.
그 검사는 실행 시 TypeError로 남아 있다.

검증: tsc -p tsconfig.test.json 통과, check:types 통과, 관련 단위 테스트
20/20 통과. 드릴은 고치기 전 실행에서 coverage PASS를 확인했고 타입 오류
2건이 남아 있었다. 그 2건을 고친 뒤 드릴 전체는 다시 돌리지 않았다.
2026-11-01 23:44:29 +09:00
donghyeon-kaandClaude Opus 5.5 70f4ff8717 fix(scale): keep the ceiling rationale next to the baseline, not in a review document (11-04, 00-02, 14-05)
The growth test read docs/reviews/, which the removal fixtures do not copy and
README lets a project delete, so three removal checks failed with ENOENT. The
rationale now lives in config/scale/feature-shape-ceilings.json and a guard
test keeps code from reading the deletable history documents.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-27 14:03:03 +09:00
donghyeon-kaandClaude Opus 5.5 4805e56ab1 Merge lane/J: test system (10-02, 10-04~10-07, 11-04~11-08, F-2, F-4, F-12, 00-03)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-27 13:28:55 +09:00
donghyeon-kaandClaude Opus 5.5 9cb46eb7fc fix(removal): remove the new reference-sample tests with the sample (11-04, 11-06)
The save spec and the feature-shape growth test and script copy or drive the
reference feature. test:sample-removal left them behind as fixture-ID residue
and the growth test failed without the acceptance doc.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-27 13:28:18 +09:00
DongHyeonkaandClaude Opus 5.5 edf44a2253 fix(config): keep public/config.json equal to the local profile (F-5, 13-15)
public/config.json is the copy dev serves and nothing compared it with
config/runtime/local.json. A unit test now requires it to equal what a local
build writes, and sample removal drops the feature override from it too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-26 00:05:06 +09:00
DongHyeonkaandClaude Opus 5.5 96391dc69a fix(scripts): report each removal check's own failure and isolate fixtures (14-08)
The JUnit report said failures="1" and put the residue list into every failed
testcase, and three scripts reused a fixed .tmp path without cleanup on error.
A shared renderer counts failures and records each check's cause (command and
exit code, or its own findings); every script uses mkdtemp and finally.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-25 23:19:09 +09:00
DongHyeonkaandClaude Opus 5.5 ad0e83c867 fix(features): make feature add and removal work from the feature directory (09-07, 14-03)
A feature directory without feature-module.ts vanished silently, registry
consumers listed only the sample's directories, and the removal gate only knew
the sample. The generator now fails unless a NOT_INSTALLED marker says so
(D-10), consumer directories are globs over every feature, and the removal
script takes --feature=<id>. starter-experience.md documents the current
ownership declarations and the files a new feature touches.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-25 23:10:19 +09:00
DongHyeonkaandClaude Opus 5.5 840de45ee7 ci: run every test file in a gate or name why not (12-04, 09-11)
tests/architecture, tests/release, tests/scripts, the top-level
tests/features files and the browser-soak contract now run in
test:coverage (FE-GATE-005); check:adapter-inventory joins FE-GATE-010
and the image resolve-signal type fixture joins FE-GATE-003 (baseline
updated). check:ci fails on a test file no gate command reaches unless
config/ci/ungated-tests.json gives a reason; only the tests/scale suite
is listed, pending 11-03. defineFeatureModule's id mismatch is tested.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-25 21:47:10 +09:00
DongHyeonkaandClaude Opus 5.5 0114b1e58b fix(ci): move CI contract counts and gate hash to an owned baseline file (14-02)
Gate/command/artifact counts and the gate-shape SHA-256 were code
constants, so any real removal or addition failed check:ci and removal
fixtures passed only in a relaxed mode. They now live in
config/ci/contract-baseline.json (owner, reason) with
update:ci-contract-baseline; update:registry-baseline wraps the existing
registry script. Removal fixtures re-baseline and run canonical check:ci
and check:registries; CI_CONTRACT_MODE, --reduced-removal-fixture and
check:registries:structure are gone. ci-quality-gates.md lists the
baselines a new project resets.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-25 21:34:12 +09:00
donghyeon-ka 6f6c48ebb7 refactor: 도메인이 100개 1000개씩 늘어나도 유지보수 쉬운 구조로 변경 2026-09-24 00:42:21 +09:00