문제 c15345c·db5728b·0eba082의 dev 전용 Vite 미들웨어(dev server가 설치된 기능의 contract set으로 manifest를 냄)를 넣은 뒤로, dev server를 쓰는 capability e2e가 "requestfailed:GET:/release-manifest.json:net::ERR_ABORTED"로 떨어졌다. 같은 호스트에서 번갈아 쟀다: 미들웨어 있음 5/30·2/30 실패, 없음 0/30·0/30(부하가 더 높았다). trace에서는 첫 manifest 요청이 200 헤더 뒤 끊기고 65 ms 뒤 두 번째 요청이 성공한다. 원인을 끝까지 좁히지는 못했다. 감시 이벤트(파일 쓰기)를 없애도 같았다. 고른 방법 - 미들웨어를 지운다. dev server는 커밋된 public/release-manifest.json을 그대로 낸다. - 그 파일의 contractSet을 설치된 기능으로 다시 쓰는 일을 명시적 단계로 둔다: `create:feature`가 생성 뒤 scripts/write-dev-release-manifest.ts를 돌리고, 기능 제거 드릴이 지운 뒤 돌린다. 매뉴얼의 되돌리기·기능 지우기 절과 errors.md에 같은 명령을 적었다. 레지스트리 기준선과 같은 방식이다. - tests/unit/dev-release-manifest.test.ts가 커밋된 파일이 설치된 기능의 contract set과 같은지 보고, 다르면 다시 쓰는 명령을 말한다. - 함께: vite.config.ts가 artifacts/·dist/·.tmp/를 감시하지 않는다. Playwright trace의 .html이 열린 페이지를 모두 다시 불러오게 했다(dev server 로그의 page reload). - 버린 대안: dev 부팅에서 contract set 검사 건너뛰기. 검사하는 테스트와 같은 조건을 dev만 따로 두게 된다. 위험·한계 - 기능을 손으로 지우고 명령을 잊으면 dev server가 부팅하지 못한다. test:unit이 그 상태를 이름과 명령으로 알린다. 검증 - test:unit 2,880건, dev-release-manifest·create-feature 테스트 45건, check:types, lint, verify:documentation 통과. - 생성 기능을 넣은 clone의 dev capability e2e와 merge 단계 14개는 이 커밋 뒤 깨끗한 clone에서 돈다. Refs: docs/reviews/2026-11-03-maturity-review/README.md 14.5 14.6 X2 #3, 16-09
26 lines
1.2 KiB
TypeScript
26 lines
1.2 KiB
TypeScript
import { readFile, writeFile } from "node:fs/promises";
|
|
|
|
import { buildContractSet } from "./generate-contract-set.ts";
|
|
|
|
export const DEV_RELEASE_MANIFEST = "public/release-manifest.json";
|
|
|
|
/**
|
|
* The release manifest the dev server serves (public/release-manifest.json)
|
|
* with the contract set of the features installed now. Boot checks that set
|
|
* against the installed declarations, so a placeholder with a fixed set
|
|
* refused every app with one more feature (CONTRACT_SET_PACKAGE_MISSING) in
|
|
* `corepack pnpm dev` and in the dev-server browser tests. `create:feature`
|
|
* and the feature removal drill rewrite it; a project commits it with the
|
|
* feature, as it does the registry baseline. A build never serves it: the
|
|
* built manifest comes from scripts/generate-build-manifest.ts.
|
|
*/
|
|
export async function devReleaseManifest(source = DEV_RELEASE_MANIFEST): Promise<string> {
|
|
const manifest = JSON.parse(await readFile(source, "utf8")) as Record<string, unknown>;
|
|
manifest["contractSet"] = buildContractSet();
|
|
return `${JSON.stringify(manifest, null, 2)}\n`;
|
|
}
|
|
|
|
if (process.argv[1]?.endsWith("write-dev-release-manifest.ts")) {
|
|
await writeFile(DEV_RELEASE_MANIFEST, await devReleaseManifest(), "utf8");
|
|
}
|