mirror of
https://github.com/motajs/template.git
synced 2026-10-22 15:20:17 +08:00
docs(09-22): 修订第 3 轮审查(双装饰器对照构建 / jsDoc 基线门禁 / 根目录跳过过滤)
This commit is contained in:
parent
2f181c8f2e
commit
dd56f741bb
@ -20,43 +20,44 @@ estimate:
|
||||
confidence: low
|
||||
must_haves:
|
||||
truths:
|
||||
- "**本计划第一个 block 点是 Task 0 的 `blocking-human` 汇报关卡(AGENTS.md / D-03)**:先汇报「任务 11 后续修复 —— 构建脚本的 content 过滤 + 修饰器删除」的要做什么 / 为什么 / 大致怎么做 / 影响范围,列明最小范围(`script/build-plugin.ts` 新增修饰器删除插件、`script/build-game.ts` 注入两处、`script/build-resource.ts` 增加 content 过滤、`script/build-plugin.test.ts` 扩展 + 新增 `script/build-resource.test.ts`)、逐文件夹的 content 过滤规则、修饰器删除口径(TS AST 精确切片、不删 import)、验证方式、已知边界与待批准命名(OI-1 / OI-2 / OI-3),然后停下等待「可以执行」。"
|
||||
- "**本计划第一个 block 点是 Task 0 的 `blocking-human` 汇报关卡(AGENTS.md / D-03)**:先汇报「任务 11 后续修复 —— 构建脚本的 content 过滤 + 修饰器删除」的要做什么 / 为什么 / 大致怎么做 / 影响范围,列明最小范围(`script/build-plugin.ts` 新增修饰器删除插件、`script/build-game.ts` 注入两处、`script/build-resource.ts` 增加 content 过滤、`script/build-plugin.test.ts` 扩展 + 新增 `script/build-resource.test.ts`)、逐文件夹的 content 过滤规则(含根目录显式跳过过滤)、修饰器删除口径(TS AST 精确切片、不删 import)、验证方式(含对照式双装饰器构建与加固后的 jsDoc 门禁)、已知边界与待批准命名(OI-1 / OI-2 / OI-3),然后停下等待「可以执行」。"
|
||||
- "**content 结构规则(用户裁定 1 / D-96):** `src/content` → `dist/content`;**根目录文件照常输出**(`.jsonc` 压缩、`item.ts` 原样);**`defaults/` 照常输出并压缩**(不排除、不按清单过滤);**其余子文件夹(`maps` / `texture` / `animation` / `audio` / `font`)只保留被各自 `.list.jsonc` 引用的文件**,未引用的剔除;**`.list.jsonc` 自身压缩输出**;无 `.list.jsonc` 的子文件夹全量输出。"
|
||||
- "**根目录显式跳过清单过滤(INFO-5):** `buildContent` 调用 `processDirectory` 时必须传根标记(`isRoot` / `filter: false`),**根目录本身永不按清单取舍**——根目录全量输出不依赖「当前根目录没有 `.list.jsonc`」这一现状,也不依赖将来是否出现根 `.list.jsonc`;只有**子目录**才做 `.list.jsonc` 检测。"
|
||||
- "**清单匹配口径(用户裁定 1):** 解析 `.list.jsonc`(去注释后 `JSON.parse`)后递归收集**所有字符串值**,以「**完整文件名**」或「**去扩展名主文件名**」匹配保留(如 `terrains0.png` 命中完整名、`empty` 命中 `empty.jsonc`、`test` 命中 `test.anim`)。"
|
||||
- "**jsonc 压缩(用户裁定 1 / D-96):** 去掉**所有** `//` 注释压成**纯 JSON**(含系统标记行),后缀**仍为 `.jsonc`**;**不分块、不 zip**;字体仍 fontmin 子集化(无字体二进制时跳过)。"
|
||||
- "**jsonc 压缩(用户裁定 1 / D-96):** 去掉**所有整行** `//` 注释(`line.trim().startsWith('//')`,**含系统标记行** `// --- SYSTEM PREFIX END --- //`)压成**纯 JSON**,后缀**仍为 `.jsonc`**;**不得改动 `minifyJSONC` 的现有行为**——只按整行剥离 `//` 注释,不剥离行尾注释、不改解析/序列化方式;**不分块、不 zip**;字体仍 fontmin 子集化(无字体二进制时跳过)。"
|
||||
- "**修饰器删除(用户裁定 2):** 构建时删除**所有** `@shouldReplay(...)` / `@ignoreReplay(...)` 装饰器应用,**数据端构建与渲染端构建都删**(`buildData` 与 `buildClient` 各注入一次);**不得手动删 import**,交给 Vite/ESBuild 依赖分析。"
|
||||
- "**删除方式必须可靠(用户裁定 2):** 以 **TypeScript AST**(`ts.createSourceFile` + `ts.canHaveDecorators` / `ts.getDecorators`)定位装饰器节点,按 `getStart()` / `getEnd()` **逆序切片删除**;**字符串字面量、注释、以及非目标装饰器中出现的同名文本一律不得被删**;仅处理项目自身 `.ts` / `.tsx`(**跳过 `node_modules`**),不处理 `.vue`。"
|
||||
- "**构建范围与顺序不变(用户裁定 3 / 4 / D-93):** 只改构建脚本与其测试;**不改** `script/build-lib.ts`、`package.json`、`index.html`、`dev.md`、`src/**`、`public/**`、数据端/渲染端源码(`packages-user/**`、`packages/**`)、`vite.config.ts`、lockfile、`script/dev.ts`;**不改构建顺序**(准备 → 渲染端 → 数据端 → content → LICENSE);**不做特殊失败处理**(无 BLOCKED 分支、无 baseline / 范围门禁、无外部状态检查)。"
|
||||
- "**开发环境不受影响:** 修饰器删除插件 `apply: 'build'`(`pnpm dev` 仍保留装饰器,`script/dev.ts` 不改);插件 `enforce: 'pre'`,其 `transform` 早于 Vite 的 TS/JSX 转译。"
|
||||
- "**测试是必需产物:** 扩展 `script/build-plugin.test.ts`(新增 `describe`,不改动既有 `dataIsolationPlugin` 用例)并新增 `script/build-resource.test.ts`;每个 `it` 前一行注释(AGENTS.md);content 测试用临时 fixture 目录,不触碰 `src/content`。"
|
||||
- "**验证可运行且范围诚实(Nyquist):** 修饰器删除用「纯函数文本断言 + **对照式**真实 `vite.build()`」双证——同一 fixture 在**不带插件**的对照构建里产物必须含 `mota_replay_probe` 与 `shouldReplay` 标记,在**带插件**的构建里必须不含(缺对照即成空断言);另含字符串/注释不误删、`node_modules` 跳过。content 过滤以 fixture 行为测试证明(`defaults` 全量、清单引用保留、未引用剔除、无清单子文件夹全量、`.list.jsonc` 压缩去注释、jsonc 去注释)。另加真实 `src/content` 的「清单覆盖率」检查、按函数切片的结构门禁、`build-resource.ts` 的「既有注释零删除」git diff 门禁,以及 `script/build-*.ts` 范围内的 `eslint`。结构门禁只断言**行为与导出形态**(AST API 标记、`enforce` / `apply`、导入绑定与注入位置),不硬编码提议命名。所有 `node -e` 门禁**只用单引号字面量**(PowerShell 5.1 下 `\"` 会提前闭合字符串,实测确定性 SyntaxError)。命令一律 `cmd /c \"pnpm exec ...\"`(PowerShell 5.1 下裸 `pnpm` 会因 `pnpm.ps1` 的 `PSSecurityException` 失败)。"
|
||||
- "**命名须先获批(D-04):** OI-1(`removeReplayDecorators` / `replayDecoratorPlugin` / `name: 'mota-replay-decorator'`)、OI-2(`LIST_FILE_NAME` / `DEFAULTS_DIRECTORY` / `readListNames` / `collectListedNames` / `isListedFile`)、OI-3(`script/build-resource.test.ts` 文件名)。未获批前不得落码。**若用户在 Task 0 指定了与提议不同的命名,必须先按新命名修订本计划(门禁命令、测试用例与 SUMMARY 关键字同步)并重新获批后执行**——门禁本身按行为与导出形态断言,不会自动跟随改名。"
|
||||
- "**验证可运行且范围诚实(Nyquist):** 修饰器删除用「纯函数文本断言 + **对照式双装饰器**真实 `vite.build()`」双证——同一 fixture 必须**导出一个类**、两个方法分别带 `@shouldReplay('...')` 与 `@ignoreReplay('...')`、各自返回**不同**的唯一字面量(`mota_replay_probe` / `mota_ignore_probe`),且 `shouldReplay` / `ignoreReplay` **工厂函数只在 fixture 内本地定义、不得导出**(否则实验组也会保留名字,对照失效)。**对照构建** `plugins: []` 产物必须 `toContain('shouldReplay')`、`toContain('ignoreReplay')`、`toContain('mota_replay_probe')`、`toContain('mota_ignore_probe')` 且两个方法名都在;**实验构建**(带插件)必须 `not.toContain('shouldReplay')`、`not.toContain('ignoreReplay')`、`toContain('mota_replay_probe')`、`toContain('mota_ignore_probe')` 且两个方法名都在(缺任一侧即成空断言);另含字符串/注释不误删、`node_modules` 跳过。content 过滤以 fixture 行为测试证明(`defaults` 全量、清单引用保留、未引用剔除、无清单子文件夹全量、**根目录即使出现 `.list.jsonc` 也全量**、`.list.jsonc` 压缩去注释、jsonc 去注释)。另加真实 `src/content` 的「清单覆盖率」检查、按函数切片的结构门禁、`build-resource.ts` **与 `build-plugin.ts`** 的「既有注释零删除」git 门禁(以 `git show HEAD:<file>` 的注释行集合为基线逐行比对,**不依赖暂存状态**),以及 `script/build-*.ts` 范围内的 `eslint`。结构门禁只断言**行为与导出形态**(AST API 标记、`enforce` / `apply`、导入绑定与注入位置),不硬编码提议命名。所有 `node -e` 门禁**只用单引号字面量**(PowerShell 5.1 下 `\"` 会提前闭合字符串,实测确定性 SyntaxError)。命令一律 `cmd /c \"pnpm exec ...\"`(PowerShell 5.1 下裸 `pnpm` 会因 `pnpm.ps1` 的 `PSSecurityException` 失败)。"
|
||||
- "**命名须先获批(D-04):** OI-1(`removeReplayDecorators` / `replayDecoratorPlugin` / `name: 'mota-replay-decorator'`,以及新增的模块级常量 `REPLAY_DECORATORS`(目标装饰器名集合)/ `SCRIPT_EXTENSIONS`(`.ts` / `.tsx` 后缀集合)/ `NODE_MODULES_SEGMENT`(`node_modules` 路径判定))、OI-2(`LIST_FILE_NAME` / `DEFAULTS_DIRECTORY` / `readListNames` / `collectListedNames` / `isListedFile` / `processDirectory` 新增的 `isRoot` 参数)、OI-3(`script/build-resource.test.ts` 文件名)。未获批前不得落码。**若用户在 Task 0 指定了与提议不同的命名,必须先按新命名修订本计划(门禁命令、测试用例与 SUMMARY 关键字同步)并重新获批后执行**——门禁本身按行为、值标记与导出形态断言,不会自动跟随改名。"
|
||||
artifacts:
|
||||
- path: script/build-plugin.ts
|
||||
provides: "在既有 `dataIsolationPlugin` 之外新增:`removeReplayDecorators(code: string, fileName: string): string`(TS AST 定位并逆序切片删除 `@shouldReplay` / `@ignoreReplay` 装饰器)与 `replayDecoratorPlugin(): Plugin`(`name: 'mota-replay-decorator'`、`enforce: 'pre'`、`apply: 'build'`、`transform(code, id)` 仅处理项目内 `.ts` / `.tsx`,跳过 `node_modules`)(命名待批准,OI-1)"
|
||||
provides: "在既有 `dataIsolationPlugin` 之外新增:模块级常量 `REPLAY_DECORATORS` / `SCRIPT_EXTENSIONS` / `NODE_MODULES_SEGMENT`(均为内部常量、不导出)、`removeReplayDecorators(code: string, fileName: string): string`(TS AST 定位并逆序切片删除 `@shouldReplay` / `@ignoreReplay` 装饰器)与 `replayDecoratorPlugin(): Plugin`(`name: 'mota-replay-decorator'`、`enforce: 'pre'`、`apply: 'build'`、`transform(code, id)` 仅处理项目内 `.ts` / `.tsx`,跳过 `node_modules`)(命名待批准,OI-1)"
|
||||
- path: script/build-plugin.test.ts
|
||||
provides: "既有测试**扩展**:新增 `replayDecoratorPlugin` / `removeReplayDecorators` 的 `describe`——纯函数断言(删装饰器、保留字符串与注释中的同名文本、参数含引号/括号整段删除)+ **对照式**真实 `vite.build()`(同一 fixture:**不带插件**的对照产物必须含 `mota_replay_probe` 与 `shouldReplay` / `ignoreReplay` 标记;带插件产物必须不含这些标记且方法名仍存在);每个 `it` 前一行注释"
|
||||
provides: "既有测试**扩展**:新增 `replayDecoratorPlugin` / `removeReplayDecorators` 的 `describe`——纯函数断言(删装饰器、保留字符串与注释中的同名文本、参数含引号/括号整段删除)+ **对照式双装饰器**真实 `vite.build()`(同一 fixture:**导出的类**上两个方法分别带 `@shouldReplay` / `@ignoreReplay` 并各自返回 `mota_replay_probe` / `mota_ignore_probe`,两个工厂函数在 fixture 内**本地定义且不导出**;**不带插件**的对照产物必须含 `shouldReplay` / `ignoreReplay` / 两个唯一字面量 / 两个方法名;带插件产物必须 **不含** `shouldReplay` 与 `ignoreReplay`,且两个唯一字面量与两个方法名**仍在**);每个 `it` 前一行注释"
|
||||
- path: script/build-game.ts
|
||||
provides: "注入:`buildClient` 的 `plugins` 增加 `replayDecoratorPlugin()`(在 `legacy(...)` 之前)、`buildData` 的 `plugins` 变为 `[dataIsolationPlugin(), replayDecoratorPlugin()]`;构建顺序、产物落点、失败处理、其余配置一律不变"
|
||||
- path: script/build-resource.ts
|
||||
provides: "content 过滤:`LIST_FILE_NAME`(`.list.jsonc`)、`DEFAULTS_DIRECTORY`(`defaults`)、`readListNames`、`collectListedNames`、`isListedFile`;`processDirectory` 在有清单的目录内按清单保留文件、`defaults` 与无清单目录全量输出、`.list.jsonc` 始终压缩输出(命名待批准,OI-2)"
|
||||
provides: "content 过滤:`LIST_FILE_NAME`(`.list.jsonc`)、`DEFAULTS_DIRECTORY`(`defaults`)、`readListNames`、`collectListedNames`、`isListedFile`;`processDirectory` 增加 `isRoot` 参数(`buildContent` 传根标记,**根目录永不按清单取舍**);有清单的目录内按清单保留文件、`defaults` 与无清单目录全量输出、`.list.jsonc` 始终压缩输出(命名待批准,OI-2)"
|
||||
- path: script/build-resource.test.ts
|
||||
provides: "**新增**行为测试:临时 fixture 验证根文件、`defaults/` 全量、`maps/` 与 `texture/` 与 `font/` 的清单保留/剔除、**无清单子文件夹全量**、`.list.jsonc` 压缩且剥离 `//` 注释(fixture 清单原文带注释)、`item.ts` 原样拷贝;每个 `it` 前一行注释(文件名待批准,OI-3)"
|
||||
provides: "**新增**行为测试:临时 fixture 验证根文件、**根目录即使存在 `.list.jsonc` 也全量输出**、`defaults/` 全量、`maps/` 与 `texture/` 与 `font/` 的清单保留/剔除、**无清单子文件夹全量**、`.list.jsonc` 压缩且剥离整行 `//` 注释(fixture 清单原文带注释)、`item.ts` 原样拷贝;每个 `it` 前一行注释(文件名待批准,OI-3)"
|
||||
- path: .planning/phases/09-minimum-browser-runnable/09-22-SUMMARY.md
|
||||
provides: "执行摘要:content 逐文件夹过滤规则与清单匹配口径、修饰器删除口径(TS AST + 双端注入 + 不删 import)、命名获批情形、门禁结果、`open_items` 处置、已知边界(未端到端跑全量 `build:game`;生产产物不再做录像安全检查;`index.html` 仍引用 `/styles.css`)"
|
||||
key_links:
|
||||
- "`replayDecoratorPlugin()`(`script/build-plugin.ts`)↔ `buildClient` 与 `buildData` 的 `plugins` 数组(`script/build-game.ts`)—— 用户裁定 2「双端都删」的唯一执行点"
|
||||
- "`removeReplayDecorators` 的 AST 切片 ↔ `@shouldReplay('...')` 装饰器文本 —— 只删装饰器节点范围,字符串/注释中的同名文本不会被误删"
|
||||
- "`removeReplayDecorators` 的 AST 切片 ↔ `@shouldReplay('...')` / `@ignoreReplay('...')` 装饰器文本 —— 只删装饰器节点范围,字符串/注释中的同名文本不会被误删"
|
||||
- "`replayDecoratorPlugin` 的 `apply: 'build'` ↔ `script/dev.ts` 未改 —— 开发环境仍保留装饰器"
|
||||
- "`readListNames`(`minifyJSONC` + `JSON.parse` + `collectListedNames`)↔ `isListedFile` 的「完整文件名 / 去扩展名主文件名」双匹配 —— 用户裁定 1 的保留口径"
|
||||
- "`processDirectory` 的 `.list.jsonc` 检测 ↔ `DEFAULTS_DIRECTORY` 豁免 —— `defaults/` 永远全量输出"
|
||||
- "清单解析(`minifyJSONC` 剥离整行 `//` 注释 + `JSON.parse` + 递归收集字符串值)↔ 「完整文件名 / 去扩展名主文件名」双精确匹配 —— 用户裁定 1 的保留口径"
|
||||
- "`processDirectory` 的 `.list.jsonc` 检测 ↔ `defaults` 豁免与根目录 `isRoot` 跳过 —— `defaults/` 与根目录永远全量输出"
|
||||
- "`.list.jsonc` 自身始终走 `minifyJSONC` 输出 ↔ 其余文件按清单取舍 —— 清单文件不会因未被自己引用而丢失"
|
||||
- "`dist/content/**` 落点 ↔ `MotaDataLoader.resolveURL` 的 `content/**` 与 `src/data/constant.ts` 的 `CORE_URL='content/core.jsonc'` —— 目录契约不变"
|
||||
assumptions:
|
||||
- "**当前清单已覆盖现有素材:** `texture/.list.jsonc` 引用了 `texture/` 下全部 48 个 PNG(含 `magictower.png`);`maps/.list.jsonc` 引用了全部 5 个地图 jsonc;`animation`(`[\"test\"]`)与 `font`(`[\"testFont.ttf\"]`)目录内无对应素材;`audio/.list.jsonc` 为 `{}`(解析后无字符串),`audio/` 当前为空。故过滤不会减少现有 `dist/content` 的实际素材(由 Task 2 的清单覆盖率门禁证明)。"
|
||||
- "**PowerShell 5.1 参数传递:** 所有 `node -e` 门禁只用单引号字面量,不出现 `\"`(双引号会提前闭合字符串)、不出现 `$` 与反引号(会被插值 / 转义);确需引号字符时用 `String.fromCharCode(39)` 构造。`cmd /c \"pnpm exec ...\"` 形式保留(裸 `pnpm` 会因 `pnpm.ps1` 的 `PSSecurityException` 失败)。"
|
||||
- "**计数基线(已实测):** `src/content` 共 23 个 `.jsonc`(5 个根 + 8 个 `defaults` + 5 个地图 + 5 个 `.list.jsonc`)、`texture/` 共 48 个 PNG;`@shouldReplay` 应用共 69 处(20 个 `.ts` 文件,另有 1 处仅出现在 `packages-user/data-common/src/replay/func.ts` 的注释里,不算应用);`@ignoreReplay` 无实际应用。"
|
||||
- "**`defaults/` 无 `.list.jsonc`:** 现为 8 个 `.jsonc`;按用户裁定 1 显式豁免,即使将来出现清单也全量输出。"
|
||||
- "**计数基线(已实测):** `src/content` 共 23 个 `.jsonc`(5 个根 + 8 个 `defaults` + 5 个地图 + 5 个 `.list.jsonc`)、`texture/` 共 48 个 PNG;`@shouldReplay` = **69 次应用 / 20 个 `.ts` 文件**;`packages-user/data-common/src/replay/func.ts` 另有 **1 行注释含 2 处 `@shouldReplay` 文本**(第 5 行,非应用),其第 34 行注释含 `@ignoreReplay`(亦非应用);`@ignoreReplay` **无实际应用**。"
|
||||
- "**`defaults/` 与根目录均无 `.list.jsonc`:** `defaults/` 现为 8 个 `.jsonc`,按用户裁定 1 显式豁免,即使将来出现清单也全量输出;根目录现为 5 个 `.jsonc` + `item.ts`,由 `isRoot` 显式跳过过滤,不依赖「根目录当前没有清单」这一现状。"
|
||||
- "**TypeScript AST 可用:** 仓库 `typescript@6.0.3` 为 devDependency;`ts.canHaveDecorators` / `ts.getDecorators` 可用,装饰器位于 `modifiers`;标准装饰器无需开启 `experimentalDecorators` 即可解析(`tsconfig.json` 未开启)。"
|
||||
- "**插件时序:** `enforce: 'pre'` 的 `transform` 早于 Vite 的 `vite:esbuild` TS 转译与 `@vitejs/plugin-vue-jsx`,因此删装饰器发生在任何编译之前;`apply: 'build'` 保证 `pnpm dev` 不受影响。"
|
||||
- "**import 由依赖分析处理:** 删除装饰器后 `shouldReplay` / `ignoreReplay` 的绑定变为未使用,由 Rollup/esbuild tree-shaking 移除;**不手动删 import**(用户裁定 2)。"
|
||||
@ -66,7 +67,7 @@ must_haves:
|
||||
- "**行号会漂移:** `build-game.ts` 的门禁按**函数名切片**(`buildClient` < `buildData` < `buildGame` 的定义顺序)而非固定行号。"
|
||||
prohibitions:
|
||||
- "不得在用户回复通过 Task 0 关卡之前执行任何任务或派发执行子代理。"
|
||||
- "**未经批准的命名一律不得使用:** `removeReplayDecorators` / `replayDecoratorPlugin` / `name: 'mota-replay-decorator'`(OI-1)、`LIST_FILE_NAME` / `DEFAULTS_DIRECTORY` / `readListNames` / `collectListedNames` / `isListedFile`(OI-2)、`script/build-resource.test.ts`(OI-3)。**若用户指定了其它命名,必须先用新命名修订本计划(含门禁命令与测试用例)并重新获批**,不得沿用旧名跑门禁、也不得只改代码不改计划。"
|
||||
- "**未经批准的命名一律不得使用:** `removeReplayDecorators` / `replayDecoratorPlugin` / `name: 'mota-replay-decorator'` / 新增常量 `REPLAY_DECORATORS` / `SCRIPT_EXTENSIONS` / `NODE_MODULES_SEGMENT`(OI-1)、`LIST_FILE_NAME` / `DEFAULTS_DIRECTORY` / `readListNames` / `collectListedNames` / `isListedFile` / `isRoot` 参数(OI-2)、`script/build-resource.test.ts`(OI-3)。**若用户指定了其它命名,必须先用新命名修订本计划(含门禁命令与测试用例)并重新获批**,不得沿用旧名跑门禁、也不得只改代码不改计划。"
|
||||
- "**不得手动删除源码中的 import:** 不得改 `packages-user/**`、`packages/**`、`src/**` 里的任何 import 语句(用户裁定 2 / 3)。"
|
||||
- "**不得让 `defaults/` 参与清单过滤:** 不得排除、不得按清单取舍、不得跳过压缩。"
|
||||
- "**不得把清单匹配做成模糊匹配:** 只允许「完整文件名」或「去扩展名主文件名」两种精确匹配;不得用包含/前缀/正则通配去保留文件。"
|
||||
@ -79,12 +80,15 @@ must_haves:
|
||||
- "**既有注释 / jsDoc 一律逐字保留(AGENTS.md):** `script/build-resource.ts` 中 `processDirectory` / `minifyJSONC` / `compressFont` / `buildContent` 与接口成员的 jsDoc 不得改写或删除;`script/build-plugin.ts` 中 `dataIsolationPlugin`、`SPECIFIER_BANS` / `PATH_BANS` / `findBan` 的注释同理。新逻辑的说明只能写在新函数 / 新常量上。"
|
||||
- "**不得在 `node -e` 门禁里用 `\\\"` 转义双引号:** PowerShell 5.1 会提前闭合字符串并抛 SyntaxError;内联脚本只允许单引号字面量(需引号字符时用 `String.fromCharCode(39)`),且不得出现 `$` 与反引号。"
|
||||
- "**不得删掉对照构建:** 不带插件的对照构建缺失时,`not.toContain` 就是空断言(编译产物本就不含 `@shouldReplay` 语法)。"
|
||||
- "**不得用 `not.toContain('@shouldReplay')` 作为唯一证据:** 必须同时对「对照产物含标记」「实验产物不含标记 + 方法名/literal 仍在」两侧断言。"
|
||||
- "**不得让对照 fixture 失效:** fixture 必须**导出一个类**、两个方法分别带 `@shouldReplay` / `@ignoreReplay` 并各自返回**不同**的唯一字面量(`mota_replay_probe` / `mota_ignore_probe`),`shouldReplay` / `ignoreReplay` 工厂函数**必须在 fixture 内本地定义且不得导出**——导出或把工厂放到别的模块,都会让实验组也保留名字,对照变成无效断言。"
|
||||
- "**不得只断言删除效果:** 必须同时断言两侧——对照(`plugins: []`)含 `shouldReplay`、`ignoreReplay`、两个唯一字面量与两个方法名;实验组不含 `shouldReplay` / `ignoreReplay`,但两个唯一字面量与两个方法名**仍在**(证明只删装饰器、没删类与方法)。"
|
||||
- "**不得把根目录纳入清单过滤:** `buildContent` 调用 `processDirectory` 时必须显式传根标记(`isRoot` / `filter: false`),根目录文件不得因将来出现根 `.list.jsonc` 而被过滤。"
|
||||
- "**不得改动 `minifyJSONC` 的行为:** 只允许沿用现有的「整行 `//` 注释剥离」(含系统标记行);不得改为剥离行尾注释、不得改解析 / 序列化方式。"
|
||||
- "**不得新增依赖、不改 lockfile。**"
|
||||
- "**不得伪造门禁:** 不得手写 `dist` 产物冒充构建结果;不得用「全量 `build:game` 已通过」之类的表述掩盖未端到端运行的事实。"
|
||||
open_items:
|
||||
- "**OI-1(修饰器删除插件命名):** 提议导出 `removeReplayDecorators(code: string, fileName: string): string` 与 `replayDecoratorPlugin(): Plugin`,插件 `name: 'mota-replay-decorator'`。备选:`stripReplayDecorators` / `removeReplayDecoratorPlugin`、`name: 'mota-replay-decorator-strip'`。**待批准**(D-04)。"
|
||||
- "**OI-2(content 过滤内部命名):** 提议模块内常量 `LIST_FILE_NAME`(`.list.jsonc`)、`DEFAULTS_DIRECTORY`(`defaults`),内部函数 `readListNames(listFile: string): Promise<Set<string>>`、`collectListedNames(value: unknown, output: Set<string>): void`、`isListedFile(name: string, names: Set<string>): boolean`。备选:`LIST_NAME` / `LISTED_NAME_CACHE`、`loadListNames` / `pickStrings` / `keepFile`。**待批准**。既有 `buildContent` / `minifyJSONC` / `IContentBuildOptions` / `IContentBuildStats` 与 `IContentBuildCounter` **不改名**。"
|
||||
- "**OI-1(修饰器删除插件命名):** 提议导出 `removeReplayDecorators(code: string, fileName: string): string` 与 `replayDecoratorPlugin(): Plugin`,插件 `name: 'mota-replay-decorator'`;并新增**不导出**的模块级常量 `REPLAY_DECORATORS`(目标装饰器名集合 `['shouldReplay', 'ignoreReplay']`)、`SCRIPT_EXTENSIONS`(`['.ts', '.tsx']`)、`NODE_MODULES_SEGMENT`(`node_modules` 路径判定正则)。备选:`stripReplayDecorators` / `removeReplayDecoratorPlugin`、`name: 'mota-replay-decorator-strip'`;常量备选 `DECORATOR_NAMES` / `TS_EXTENSIONS` / `NODE_MODULES_PATTERN`,或**全部改为函数内内联字面量、不新增模块级常量**。**待批准**(D-04)。门禁只断言值标记与导出形态,不绑定这些常量名。"
|
||||
- "**OI-2(content 过滤内部命名):** 提议模块内常量 `LIST_FILE_NAME`(`.list.jsonc`)、`DEFAULTS_DIRECTORY`(`defaults`),内部函数 `readListNames(listFile: string): Promise<Set<string>>`、`collectListedNames(value: unknown, output: Set<string>): void`、`isListedFile(name: string, names: Set<string>): boolean`,以及 `processDirectory` 新增的 `isRoot: boolean = false` 参数(`buildContent` 传 `true`)。备选:`LIST_NAME` / `LISTED_NAME_CACHE`、`loadListNames` / `pickStrings` / `keepFile`、`isRootCall` / `filter`。**待批准**。既有 `buildContent` / `minifyJSONC` / `IContentBuildOptions` / `IContentBuildStats` 与 `IContentBuildCounter` **不改名**。"
|
||||
- "**OI-3(测试文件):** 扩展既有 `script/build-plugin.test.ts`;新增 `script/build-resource.test.ts`(与被测文件同名,测试文件按 AGENTS.md 由 AI 维护)。**报备**(如需改名请一并指明)。"
|
||||
- "**已知边界(不在本计划):** ① 未端到端运行全量 `build:game`(渲染端仍有用户 WIP 的 stale import),验证只到单测 + 结构门禁 + 真实 content 清单覆盖率;② 生产构建删掉录像安全检查装饰器属用户裁定 2 的预期结果,运行期不再产生 `@shouldReplay` 的收集信息;③ `index.html` 仍引用 `/styles.css`(09-21 已记录),本计划不改。"
|
||||
---
|
||||
@ -98,7 +102,7 @@ Phase 9 · 任务 11 · 第 22 个计划 —— **构建脚本的 content 过滤
|
||||
**做法(最小):**
|
||||
- `script/build-plugin.ts`:在既有 `dataIsolationPlugin` 之外新增一个修饰器删除插件(TS AST 定位 + 逆序切片)与其纯函数。
|
||||
- `script/build-game.ts`:`buildClient` 与 `buildData` 各注入该插件;其余配置、顺序、产物落点不变。
|
||||
- `script/build-resource.ts`:`processDirectory` 增加「有 `.list.jsonc` 的目录按清单取舍文件」的判断(`defaults/` 与无清单目录全量、`.list.jsonc` 自身始终压缩输出)。
|
||||
- `script/build-resource.ts`:`processDirectory` 增加「有 `.list.jsonc` 的目录按清单取舍文件」的判断(`defaults/` 与无清单目录全量、根目录 `isRoot` 跳过过滤、`.list.jsonc` 自身始终压缩输出)。
|
||||
- 测试:扩展 `script/build-plugin.test.ts`;新增 `script/build-resource.test.ts`(fixture 行为测试)。
|
||||
|
||||
**约束:** 用户裁定 3 / 4 —— 只改构建脚本;不改 `build-lib.ts` / `package.json` / `index.html` / `dev.md` / `src/**` / `public/**` / 数据端与渲染端源码 / `vite.config.ts` / lockfile / `script/dev.ts`;不改构建顺序;不做特殊失败处理。
|
||||
@ -148,21 +152,21 @@ Phase 9 · 任务 11 · 第 22 个计划 —— **构建脚本的 content 过滤
|
||||
|
||||
② **范围(最小):** `script/build-plugin.ts`(新增插件 + 纯函数)、`script/build-game.ts`(`buildClient` / `buildData` 各注入一次)、`script/build-resource.ts`(清单过滤)、`script/build-plugin.test.ts`(扩展)、`script/build-resource.test.ts`(新增)、`09-22-SUMMARY.md`。**其余文件一律不动**(含 `build-lib.ts` / `package.json` / `index.html` / `dev.md` / `src/**` / `public/**` / `packages-user/**` / `packages/**` / `vite.config.ts` / lockfile / `script/dev.ts`)。
|
||||
|
||||
③ **content 逐文件夹规则(用户裁定 1):** 根目录文件照常(`.jsonc` 压缩、`item.ts` 原样);`defaults/` 全量输出并压缩(显式豁免清单过滤);`maps` / `texture` / `animation` / `audio` / `font` 只保留被各自 `.list.jsonc` 引用的文件,未引用剔除;`.list.jsonc` 自身始终压缩输出;无清单的子文件夹全量输出。匹配口径 = 去注释 `JSON.parse` 后递归收集**所有字符串**,按「完整文件名」或「去扩展名主文件名」精确匹配(`empty` → `empty.jsonc`、`test` → `test.anim`、`terrains0.png` → 同名文件)。
|
||||
③ **content 逐文件夹规则(用户裁定 1):** 根目录文件照常(`.jsonc` 压缩、`item.ts` 原样),且**根目录显式跳过清单过滤**(传根标记,不依赖「根目录当前没有 `.list.jsonc`」,将来出现也不过滤);`defaults/` 全量输出并压缩(显式豁免清单过滤);`maps` / `texture` / `animation` / `audio` / `font` 只保留被各自 `.list.jsonc` 引用的文件,未引用剔除;`.list.jsonc` 自身始终压缩输出;无清单的子文件夹全量输出。匹配口径 = 去注释 `JSON.parse` 后递归收集**所有字符串**,按「完整文件名」或「去扩展名主文件名」精确匹配(`empty` → `empty.jsonc`、`test` → `test.anim`、`terrains0.png` → 同名文件)。jsonc 压缩沿用 `minifyJSONC` 现有行为:只剥离**整行** `//` 注释(含系统标记行),不改其实现。
|
||||
|
||||
④ **修饰器删除口径(用户裁定 2):** 构建时删除**所有** `@shouldReplay(...)` / `@ignoreReplay(...)` 应用(当前 `@shouldReplay` 共 **69 处应用 / 20 个文件**,`@ignoreReplay` 无应用),**数据端与渲染端都删**(`buildData` + `buildClient` 各注入一次);用 **TypeScript AST**(`ts.createSourceFile` + `ts.canHaveDecorators` / `ts.getDecorators`)取装饰器节点范围后**逆序切片删除**,字符串 / 注释中的同名文本不删;仅处理项目自身 `.ts` / `.tsx`,跳过 `node_modules`,不处理 `.vue`;**不手动删 import**(交给依赖分析 tree-shaking)。插件 `apply: 'build'`,故 `pnpm dev` 行为不变。
|
||||
④ **修饰器删除口径(用户裁定 2):** 构建时删除**所有** `@shouldReplay(...)` / `@ignoreReplay(...)` 应用(当前 `@shouldReplay` = **69 次应用 / 20 个 `.ts` 文件**;`packages-user/data-common/src/replay/func.ts` 另有 1 行注释含 2 处 `@shouldReplay` 文本,非应用;`@ignoreReplay` 无实际应用),**数据端与渲染端都删**(`buildData` + `buildClient` 各注入一次);用 **TypeScript AST**(`ts.createSourceFile` + `ts.canHaveDecorators` / `ts.getDecorators`)取装饰器节点范围后**逆序切片删除**,字符串 / 注释中的同名文本不删;仅处理项目自身 `.ts` / `.tsx`,跳过 `node_modules`,不处理 `.vue`;**不手动删 import**(交给依赖分析 tree-shaking)。插件 `apply: 'build'`,故 `pnpm dev` 行为不变。
|
||||
|
||||
⑤ **验证方式:** `script/build-plugin.test.ts` 扩展为「纯函数断言(删装饰器、字符串/注释不误删、带引号与括号的参数整段删除)+ **对照式**真实 `vite.build()`(同一 fixture 构建两次:不带插件的对照组产物必须含 `mota_replay_probe` 与 `shouldReplay` / `ignoreReplay` 标记,带插件的实验组必须不含这些标记且 `mota_replay_probe` 与方法名仍在)」;`script/build-resource.test.ts` 用临时 fixture 验证根文件、`defaults/` 全量、`maps` / `texture` / `font` 的保留与剔除、**无清单子文件夹全量**、`.list.jsonc` 压缩且剥离 `//` 注释、`item.ts` 原样;另加真实 `src/content` 的清单覆盖率检查(每个清单目录内非清单文件都必须被清单命中,防止过滤掉现有素材)、`build-game` 按函数切片的结构门禁(只断言导入绑定与注入位置,不绑定提议命名)、`build-resource.ts` 的「既有注释零删除」git diff 门禁,以及 `script/build-*.ts` 范围内的 `eslint`;命令一律 `cmd /c "pnpm exec ..."`,内联 `node -e` 只用单引号字面量。
|
||||
⑤ **验证方式:** `script/build-plugin.test.ts` 扩展为「纯函数断言(删装饰器、字符串/注释不误删、带引号与括号的参数整段删除)+ **对照式双装饰器**真实 `vite.build()`(同一 fixture 构建两次:fixture **导出一个类**,两个方法分别带 `@shouldReplay` / `@ignoreReplay` 并各自返回不同唯一字面量 `mota_replay_probe` / `mota_ignore_probe`,`shouldReplay` / `ignoreReplay` 工厂在 fixture 内**本地定义、不导出**;**对照** `plugins: []` 产物必须含 `shouldReplay`、`ignoreReplay`、两个唯一字面量与两个方法名,**实验组**必须不含 `shouldReplay` / `ignoreReplay`,但两个唯一字面量与两个方法名**仍在**——两侧缺一即空断言)」;`script/build-resource.test.ts` 用临时 fixture 验证根文件、**根目录即使存在 `.list.jsonc` 也全量输出**、`defaults/` 全量、`maps` / `texture` / `font` 的保留与剔除、**无清单子文件夹全量**、`.list.jsonc` 压缩且剥离整行 `//` 注释、`item.ts` 原样;另加真实 `src/content` 的清单覆盖率检查(每个清单目录内非清单文件都必须被清单命中,防止过滤掉现有素材)、`build-game` 按函数切片的结构门禁(只断言导入绑定与注入位置,不绑定提议命名)、`build-resource.ts` **与 `build-plugin.ts`** 的「既有注释零删除」门禁(从 `git show HEAD:<file>` 取注释行集合逐行比对,**不受暂存状态影响**,并校验基线注释行数下限防空洞),以及 `script/build-*.ts` 范围内的 `eslint`;命令一律 `cmd /c "pnpm exec ..."`,内联 `node -e` 只用单引号字面量。
|
||||
|
||||
⑥ **已知边界(原样告知):** ① **不端到端运行全量 `build:game`**(渲染端仍有用户 WIP 的 stale import;09-21 已记录),验证只到单测 + 结构门禁 + 真实清单覆盖率;② 生产构建不再有录像安全检查装饰器,属预期结果;③ `index.html` 仍引用 `/styles.css`,本计划不产出、不改;④ `animation` / `audio` / `font` 目录当前无对应素材(清单为空或无文件),过滤不会影响现有产物。
|
||||
|
||||
⑦ **待批准命名(须用户确认):** OI-1(`removeReplayDecorators` / `replayDecoratorPlugin` / `name: 'mota-replay-decorator'`);OI-2(`LIST_FILE_NAME` / `DEFAULTS_DIRECTORY` / `readListNames` / `collectListedNames` / `isListedFile`);OI-3(新增测试文件 `script/build-resource.test.ts`、扩展 `script/build-plugin.test.ts`)。未获批前不落码。**若您给出其它命名,我会先修订本计划(含门禁命令与测试用例)再重新汇报**——门禁按行为与导出形态断言,不随改名自动跟随。
|
||||
⑦ **待批准命名(须用户确认):** OI-1(`removeReplayDecorators` / `replayDecoratorPlugin` / `name: 'mota-replay-decorator'`,以及新增模块级常量 `REPLAY_DECORATORS` / `SCRIPT_EXTENSIONS` / `NODE_MODULES_SEGMENT`——若您不同意新增常量名,我改为函数内内联字面量);OI-2(`LIST_FILE_NAME` / `DEFAULTS_DIRECTORY` / `readListNames` / `collectListedNames` / `isListedFile`,以及 `processDirectory` 新增的 `isRoot` 参数);OI-3(新增测试文件 `script/build-resource.test.ts`、扩展 `script/build-plugin.test.ts`)。未获批前不落码。**若您给出其它命名,我会先修订本计划(含门禁命令与测试用例)再重新汇报**——门禁按行为、值标记与导出形态断言,不随改名自动跟随。
|
||||
|
||||
⑧ **不在本增量:** 不改 `src/**`(含改动数据端源码或手删 import)、不改 `packages-user/**`、不改 `script/dev.ts`、不改 `package.json` / `dev.md`、不新增依赖、不改构建顺序与产物落点、不做特殊失败处理。
|
||||
</action>
|
||||
<decision>是否按本计划(09-22,最小范围)执行「任务 11 后续修复」——在 `script/build-plugin.ts` 新增基于 TypeScript AST 的 `@shouldReplay` / `@ignoreReplay` 删除插件并注入 `buildClient` 与 `buildData`(不手删 import)、在 `script/build-resource.ts` 增加「除 `defaults/` 外的素材子文件夹按各自 `.list.jsonc` 只保留被引用文件、`.list.jsonc` 自身压缩输出」的过滤、补两个测试文件与 SUMMARY;**仅改上述脚本与测试,其余文件一律不动**,并接受三项已知边界(不端到端跑全量 `build:game`、生产产物无录像安全检查、`/styles.css` 仍旧缺失)。</decision>
|
||||
<context>
|
||||
AGENTS.md / D-03 / D-04 要求执行前与命名先获批;`.planning/config.json` 为 `mode: yolo`,故本关卡显式 `blocking-human` 且 `autonomous: false`。执行期含写操作(3 个脚本 + 2 个测试 + 1 个 SUMMARY),无删除。`texture/.list.jsonc` 已覆盖 `texture/` 下全部 48 个 PNG,`maps/.list.jsonc` 覆盖全部 5 个地图,故本次过滤不会减少现有素材——这一点由 Task 2 的清单覆盖率门禁证明。`@shouldReplay` 应用共 **69 处**(20 个 `.ts` 文件:`packages-user/data-base`、`data-system`、`src/data/plugin/shop`;另有 1 处仅出现在 `packages-user/data-common/src/replay/func.ts` 的注释中,不算应用),`@ignoreReplay` 当前无实际应用(仅定义与注释),插件需同时支持两者。
|
||||
AGENTS.md / D-03 / D-04 要求执行前与命名先获批;`.planning/config.json` 为 `mode: yolo`,故本关卡显式 `blocking-human` 且 `autonomous: false`。执行期含写操作(3 个脚本 + 2 个测试 + 1 个 SUMMARY),无删除。`texture/.list.jsonc` 已覆盖 `texture/` 下全部 48 个 PNG,`maps/.list.jsonc` 覆盖全部 5 个地图,故本次过滤不会减少现有素材——这一点由 Task 2 的清单覆盖率门禁证明。`@shouldReplay` = **69 次应用 / 20 个 `.ts` 文件**(`packages-user/data-base`、`data-system`、`src/data/plugin/shop`);`packages-user/data-common/src/replay/func.ts` 另有 **1 行注释含 2 处 `@shouldReplay` 文本**(非应用),同文件第 34 行注释含 `@ignoreReplay`;`@ignoreReplay` **当前无实际应用**(仅定义与注释),插件需同时支持两者。
|
||||
</context>
|
||||
<options>
|
||||
<option id="execute-default">
|
||||
@ -187,9 +191,9 @@ Phase 9 · 任务 11 · 第 22 个计划 —— **构建脚本的 content 过滤
|
||||
- 汇报涵盖:两条要解决的问题、最小范围与「其余文件一律不动」清单、content 逐文件夹规则与清单匹配口径、修饰器删除口径(AST + 双端注入 + 不手删 import + `apply: 'build'`)、验证方式、三项已知边界、OI-1 / OI-2 / OI-3 命名
|
||||
- 已说明:若用户改命名,须先修订本计划(门禁按行为/导出形态断言,不会自动跟随改名)再执行
|
||||
- 已说明:`processDirectory` 等既有 jsDoc 逐字保留,新逻辑说明只写在新函数 / 新常量上
|
||||
- 已说明:修饰器删除的验收依赖「带插件 vs 不带插件」的对照构建,不依赖 `@shouldReplay` 语法文本
|
||||
- 已说明:修饰器删除的验收依赖「带插件 vs 不带插件」的**双装饰器**对照构建(fixture 导出类、两方法各返回唯一字面量、工厂本地不导出),不依赖 `@shouldReplay` 语法文本
|
||||
- 已说明生产构建不再有录像安全检查装饰器(属用户裁定 2 的预期结果)
|
||||
- 已说明 `defaults/` 显式豁免过滤、`.list.jsonc` 自身始终压缩输出
|
||||
- 已说明 `defaults/` 显式豁免过滤、**根目录经 `isRoot` 跳过过滤**、`.list.jsonc` 自身始终压缩输出、`minifyJSONC` 行为不改
|
||||
- 已说明本计划不端到端运行全量 `build:game`
|
||||
</acceptance_criteria>
|
||||
<done>用户明确回复「可以执行」;在此之前未执行任何任务、未修改任何仓库文件、未派发任何执行子代理</done>
|
||||
@ -211,7 +215,7 @@ Phase 9 · 任务 11 · 第 22 个计划 —— **构建脚本的 content 过滤
|
||||
<action>
|
||||
(1) **`script/build-plugin.ts` 追加(OI-1 获批后命名):**
|
||||
- 顶部 `import` 区追加 `import ts from 'typescript';`(dev.md:`import` 必须集中在文件首部且中间不插注释/空行;不使用 `import type`)。
|
||||
- 模块内声明**不导出**的常量:目标装饰器名集合 `['shouldReplay', 'ignoreReplay']`(`readonly`)、源文件后缀判定(`.ts` / `.tsx`)、`node_modules` 路径判定(同时接受 `/` 与 `\\`)。
|
||||
- 模块内声明**不导出**的常量(命名见 OI-1):目标装饰器名集合 `REPLAY_DECORATORS = ['shouldReplay', 'ignoreReplay']`(`readonly`)、源文件后缀集合 `SCRIPT_EXTENSIONS = ['.ts', '.tsx']`、`node_modules` 路径判定 `NODE_MODULES_SEGMENT`(`/[/\\]node_modules[/\\]/`,同时接受 `/` 与 `\`)。若用户不批准新增常量名,则改为在函数内使用内联字面量,不得引入未获批的模块级命名。
|
||||
- 导出纯函数 `removeReplayDecorators(code: string, fileName: string): string`:
|
||||
- 用 `ts.createSourceFile(fileName, code, ts.ScriptTarget.Latest, true, fileName.endsWith('.tsx') ? ts.ScriptKind.TSX : ts.ScriptKind.TS)` 建立 AST。
|
||||
- 深度遍历:对每个节点用 `ts.canHaveDecorators(node)` + `ts.getDecorators(node)` 取装饰器;仅当装饰器表达式是**标识符**(`@shouldReplay`)或**调用表达式**(`@shouldReplay('...')`,callee 为标识符)且标识符文本在目标集合内时,记录 `[decorator.getStart(sourceFile), decorator.getEnd()]`。
|
||||
@ -235,8 +239,8 @@ Phase 9 · 任务 11 · 第 22 个计划 —— **构建脚本的 content 过滤
|
||||
- **字符串不误删:** 字符串字面量中出现同名文本(如日志文案)时保持原样。
|
||||
- **注释不误删:** 单行注释中出现同名文本时保持原样。
|
||||
- **`node_modules` 与非源文件跳过:** 取 `const plugin = replayDecoratorPlugin()` 后,把 `plugin.transform` 归一成可调用函数(函数直接用;对象则取其 `handler`),用 `id` 为 `<root>/node_modules/dep/a.ts` 与 `<root>/a.css` 各调用一次,断言返回值为 `null`(代码未被改写);再以 `<root>/src/a.ts` 调用一次并断言装饰器被删。测试文件内的类型断言按需要书写,测试文件不受 dev.md 的类型约束。
|
||||
- **对照式真实 `vite.build()`(W3,否决空断言):** fixture = 「本地定义同形的 `shouldReplay` / `ignoreReplay` 函数 + 一个类,类方法上有 `@shouldReplay('...')` 装饰器,方法体返回唯一字面量 `mota_replay_probe`」。以库模式 ESM 构建**两次**(`configFile:false`、`write:false`、`minify:false`):**对照组** `plugins: []`,**实验组** `plugins: [replayDecoratorPlugin()]`。断言:对照组产物**必须**含 `shouldReplay` 与 `mota_replay_probe`(若对照缺失即用例自失败,证明 token 在未处理时确实存在);实验组产物**不得**含 `shouldReplay` / `ignoreReplay`,且**仍含** `mota_replay_probe` 与方法名。**不得**只断言「产物不含 `@shouldReplay` 语法」——编译产物本来就不会保留该语法,那样等于空断言。
|
||||
- 断言只依赖文本 / rejects / resolve 与产物代码关键字,不依赖 chunk 文件名或顺序。
|
||||
- **对照式双装饰器真实 `vite.build()`(W1,否决空断言):** fixture 单个入口模块,必须满足:① 在模块内**本地定义**(**不 `export`**)同形的 `shouldReplay(message: string)` 与 `ignoreReplay(_msg: string)` 工厂函数;② `export class` 导出一个类;③ 两个方法分别带 `@shouldReplay('...')` 与 `@ignoreReplay('...')`,方法体各自返回**不同**的唯一字面量(`mota_replay_probe` / `mota_ignore_probe`),方法名固定(如 `replayProbe` / `ignoreProbe`)。以库模式 ESM 构建**两次**(`configFile:false`、`write:false`、`minify:false`):**对照组** `plugins: []`,**实验组** `plugins: [replayDecoratorPlugin()]`。断言:对照组产物**必须** `toContain('shouldReplay')`、`toContain('ignoreReplay')`、`toContain('mota_replay_probe')`、`toContain('mota_ignore_probe')`,且两个方法名都在(若对照缺失即用例自失败,证明 token 在未处理时确实存在);实验组产物**必须** `not.toContain('shouldReplay')`、`not.toContain('ignoreReplay')`,且**仍** `toContain('mota_replay_probe')`、`toContain('mota_ignore_probe')`、两个方法名都在(证明只删装饰器与失去引用的工厂函数,未删类与方法)。**不得**只断言「产物不含 `@shouldReplay` 语法」(编译产物本来就不保留该语法);**不得**导出两个工厂、也不得只给单个方法加装饰器——那样任一侧都会退化为空断言。
|
||||
- 断言只依赖文本 / rejects / resolve 与产物代码关键字,不依赖 chunk 文件名或顺序;断言里的名字与字面量统一用**单引号**(结构门禁按 `'...'` 形式识别正向 / 负向断言),避免门禁漏检。
|
||||
</action>
|
||||
<behavior>
|
||||
- `removeReplayDecorators` 对 `@shouldReplay('x')` + 方法的类片段 → 输出不含 `@shouldReplay`,方法声明保留。
|
||||
@ -244,21 +248,21 @@ Phase 9 · 任务 11 · 第 22 个计划 —— **构建脚本的 content 过滤
|
||||
- 对含嵌套括号 / 双引号参数的装饰器 → 整段(到匹配的右括号)被删,无残留 `)` 或字符串碎片。
|
||||
- 字符串字面量与注释中的同名文本 → 原样保留。
|
||||
- 插件对 `node_modules` 路径与非 `.ts` / `.tsx` 文件 → 不改动(返回 `null`)。
|
||||
- 对照构建(`plugins: []`)产物 → 含 `shouldReplay` 与 `mota_replay_probe`;带插件构建产物 → `shouldReplay` / `ignoreReplay` 消失、`mota_replay_probe` 与方法名仍在。
|
||||
- 对照构建(`plugins: []`)产物 → 含 `shouldReplay`、`ignoreReplay`、`mota_replay_probe`、`mota_ignore_probe` 与两个方法名;带插件构建产物 → `shouldReplay` / `ignoreReplay` 消失(工厂失去引用被 tree-shaking),`mota_replay_probe` / `mota_ignore_probe` 与两个方法名仍在。
|
||||
</behavior>
|
||||
<reversibility rating="reversible">仅新增两个导出、两处 `plugins` 数组注入与测试用例;`git checkout` 三个文件即整体回退,未改产物落点与构建顺序。</reversibility>
|
||||
<verify>
|
||||
<automated>cmd /c "pnpm exec vitest run script/build-plugin.test.ts"</automated>
|
||||
<fails_when>non-zero exit,或任一断言失败(装饰器未被删 / 参数残留碎片 / 字符串或注释中的同名文本被误删 / 对照产物缺 `shouldReplay` 或 `mota_replay_probe`(token 前提不成立)/ 带插件产物仍含 `shouldReplay` / `ignoreReplay` / 带插件产物丢了 `mota_replay_probe` 或方法名 / 既有 `dataIsolationPlugin` 用例回归)</fails_when>
|
||||
<automated>node -e "const fs=require('fs');const bad=[];const q=String.fromCharCode(39);const t=fs.readFileSync('script/build-plugin.ts','utf8');const need=['ts.createSourceFile','canHaveDecorators','getDecorators','node_modules','shouldReplay','ignoreReplay','dataIsolationPlugin','transform(','code: string','fileName: string','): string','): Plugin','enforce: '+q+'pre'+q,'apply: '+q+'build'+q];for(const x of need){if(t.indexOf(x)<0)bad.push('build-plugin.ts missing: '+x)}const exports=[...t.matchAll(/export function (\w+)/g)].map(m=>m[1]);if(exports.length<3)bad.push('build-plugin.ts must export dataIsolationPlugin plus two strip APIs, found '+exports.length);if(exports.indexOf('dataIsolationPlugin')<0)bad.push('dataIsolationPlugin export lost');const tp=fs.readFileSync('script/build-plugin.test.ts','utf8');for(const x of ['@shouldReplay','@ignoreReplay','node_modules','mota_replay_probe','build(','not.toContain']){if(tp.indexOf(x)<0)bad.push('build-plugin.test.ts missing: '+x)}if(tp.indexOf('plugins: []')<0&&tp.indexOf('plugins:[]')<0)bad.push('test must include a control vite.build without the plugin');const g=fs.readFileSync('script/build-game.ts','utf8');const s=g.indexOf('async function buildClient('),d=g.indexOf('async function buildData('),b=g.indexOf('async function buildGame(');if(s<0||d<0||b<0||!(s<d&&d<b))bad.push('function order changed; slicing gate needs buildClient < buildData < buildGame');else{const idx=g.indexOf('./build-plugin');if(idx<0)bad.push('build-game.ts must import from ./build-plugin');else{const start=g.lastIndexOf('import',idx),open=g.indexOf('{',start),close=g.indexOf('}',open);const bindings=g.slice(open+1,close).split(',').map(v=>v.trim()).filter(Boolean);const extra=bindings.filter(n=>n!=='dataIsolationPlugin');if(bindings.indexOf('dataIsolationPlugin')<0)bad.push('dataIsolationPlugin import lost');if(extra.length!==1)bad.push('exactly one new binding expected from ./build-plugin, got '+extra.length);else{const client=g.slice(s,d),data=g.slice(d,b);if(client.indexOf(extra[0])<0)bad.push('buildClient must inject the replay decorator plugin');if(data.indexOf(extra[0])<0)bad.push('buildData must inject the replay decorator plugin');if(data.indexOf('dataIsolationPlugin')<0)bad.push('buildData must keep dataIsolationPlugin');if(client.indexOf('dataIsolation'+'Plugin')>=0)bad.push('dataIsolationPlugin must stay out of buildClient')}}}if(bad.length>0){console.error('REPLAY PLUGIN GATE FAILED :: '+bad.join(' ; '));process.exit(1)}console.log('OK replay plugin: AST strip + dual-sided wiring')"</automated>
|
||||
<fails_when>non-zero exit,或 stderr 含 "REPLAY PLUGIN GATE FAILED"(插件缺 AST 定位(`ts.createSourceFile` / `canHaveDecorators` / `getDecorators`)/ 缺 `enforce: 'pre'` 或 `apply: 'build'` / 缺 `node_modules` 跳过 / 导出数少于 3 或丢了 `dataIsolationPlugin` / 缺 `code: string` + `fileName: string` + `): string` 或 `): Plugin` 导出形态 / 测试缺关键用例字样 / 测试缺 `mota_replay_probe` 或缺少不带插件的对照构建(`plugins: []`)/ 函数定义顺序不满足切片前提 / `./build-plugin` 的导入绑定不是「`dataIsolationPlugin` + 恰好 1 个新插件」/ `buildClient` 或 `buildData` 片段缺该新插件 / `buildData` 丢了 `dataIsolationPlugin` / `dataIsolationPlugin` 被接进 `buildClient`)</fails_when>
|
||||
<fails_when>non-zero exit,或任一断言失败(装饰器未被删 / 参数残留碎片 / 字符串或注释中的同名文本被误删 / 对照产物缺 `shouldReplay` 或 `ignoreReplay` 或某个唯一字面量(token 前提不成立)/ 带插件产物仍含 `shouldReplay` / `ignoreReplay` / 带插件产物丢了 `mota_replay_probe`、`mota_ignore_probe` 或方法名 / 既有 `dataIsolationPlugin` 用例回归)</fails_when>
|
||||
<automated>node -e "const fs=require('fs');const bad=[];const q=String.fromCharCode(39);const t=fs.readFileSync('script/build-plugin.ts','utf8');const need=['ts.createSourceFile','canHaveDecorators','getDecorators','node_modules','shouldReplay','ignoreReplay','dataIsolationPlugin','transform(','code: string','fileName: string','): string','): Plugin','enforce: '+q+'pre'+q,'apply: '+q+'build'+q];for(const x of need){if(t.indexOf(x)<0)bad.push('build-plugin.ts missing: '+x)}const exported=[...t.matchAll(/export function (\w+)/g)].map(m=>m[1]);if(exported.length<3)bad.push('build-plugin.ts must export dataIsolationPlugin plus two strip APIs, found '+exported.length);if(exported.indexOf('dataIsolationPlugin')<0)bad.push('dataIsolationPlugin export lost');const tp=fs.readFileSync('script/build-plugin.test.ts','utf8');for(const x of ['@shouldReplay','@ignoreReplay','node_modules','mota_replay_probe','mota_ignore_probe','export class','build(','not.toContain']){if(tp.indexOf(x)<0)bad.push('build-plugin.test.ts missing: '+x)}if(tp.indexOf('plugins: []')<0&&tp.indexOf('plugins:[]')<0)bad.push('test must include a control vite.build without the plugin');const cnt=(s,sub)=>s.split(sub).length-1;const pos='.toContain('+q,neg='.not.toContain('+q;for(const name of ['shouldReplay','ignoreReplay','mota_replay_probe','mota_ignore_probe']){if(cnt(tp,pos+name+q+')')-cnt(tp,neg+name+q+')')<1)bad.push('test must positively assert '+name+' in the control build')}for(const name of ['shouldReplay','ignoreReplay']){if(cnt(tp,neg+name+q+')')<1)bad.push('test must negatively assert '+name+' in the plugin build')}for(const fn of ['shouldReplay','ignoreReplay']){if(tp.indexOf('function '+fn+'(')<0)bad.push('fixture must locally define '+fn);if(tp.indexOf('export function '+fn)>-1)bad.push('fixture must NOT export '+fn)}const g=fs.readFileSync('script/build-game.ts','utf8');const s=g.indexOf('async function buildClient('),d=g.indexOf('async function buildData('),b=g.indexOf('async function buildGame(');if(s<0||d<0||b<0||!(s<d&&d<b))bad.push('function order changed; slicing gate needs buildClient < buildData < buildGame');else{const idx=g.indexOf('./build-plugin');if(idx<0)bad.push('build-game.ts must import from ./build-plugin');else{const start=g.lastIndexOf('import',idx),open=g.indexOf('{',start),close=g.indexOf('}',open);const bindings=g.slice(open+1,close).split(',').map(v=>v.trim()).filter(Boolean);const extra=bindings.filter(n=>n!=='dataIsolationPlugin');if(bindings.indexOf('dataIsolationPlugin')<0)bad.push('dataIsolationPlugin import lost');if(extra.length!==1)bad.push('exactly one new binding expected from ./build-plugin, got '+extra.length);else{const client=g.slice(s,d),data=g.slice(d,b);if(client.indexOf(extra[0])<0)bad.push('buildClient must inject the replay decorator plugin');if(data.indexOf(extra[0])<0)bad.push('buildData must inject the replay decorator plugin');if(data.indexOf('dataIsolationPlugin')<0)bad.push('buildData must keep dataIsolationPlugin');if(client.indexOf('dataIsolation'+'Plugin')>=0)bad.push('dataIsolationPlugin must stay out of buildClient')}}}if(bad.length>0){console.error('REPLAY PLUGIN GATE FAILED :: '+bad.join(' ; '));process.exit(1)}console.log('OK replay plugin: AST strip + dual-sided wiring')"</automated>
|
||||
<fails_when>non-zero exit,或 stderr 含 "REPLAY PLUGIN GATE FAILED"(插件缺 AST 定位(`ts.createSourceFile` / `canHaveDecorators` / `getDecorators`)/ 缺 `enforce: 'pre'` 或 `apply: 'build'` / 缺 `node_modules` 跳过 / 导出数少于 3 或丢了 `dataIsolationPlugin` / 缺 `code: string` + `fileName: string` + `): string` 或 `): Plugin` 导出形态 / 测试缺关键用例字样或 `mota_ignore_probe` / 测试缺 `export class` 形态 / 测试缺少不带插件的对照构建(`plugins: []`)/ 测试缺少对 `shouldReplay` / `ignoreReplay` / `mota_replay_probe` / `mota_ignore_probe` 的**正向**断言 / 测试缺少对 `shouldReplay` / `ignoreReplay` 的**负向**断言 / 测试导出了 `shouldReplay` 或 `ignoreReplay` 工厂(对照会失效)/ 函数定义顺序不满足切片前提 / `./build-plugin` 的导入绑定不是「`dataIsolationPlugin` + 恰好 1 个新插件」/ `buildClient` 或 `buildData` 片段缺该新插件 / `buildData` 丢了 `dataIsolationPlugin` / `dataIsolationPlugin` 被接进 `buildClient`)</fails_when>
|
||||
</verify>
|
||||
<acceptance_criteria>
|
||||
- `script/build-plugin.ts` 新增 `removeReplayDecorators` 与 `replayDecoratorPlugin`(命名按 OI-1 获批结果),`enforce: 'pre'` + `apply: 'build'`,仅处理项目内 `.ts` / `.tsx`,跳过 `node_modules`
|
||||
- 删除基于 TypeScript AST 的节点范围逆序切片;字符串、注释、非目标装饰器不受影响
|
||||
- `script/build-game.ts` 在 `buildClient` 与 `buildData` 各注入一次;`buildData` 仍保持 `dataIsolationPlugin` 首位;构建顺序与其余配置未改
|
||||
- 既有 `dataIsolationPlugin` 的行为与用例零回归
|
||||
- `script/build-plugin.test.ts` 覆盖「删两类装饰器、参数含引号/括号、字符串不误删、注释不误删、`node_modules` 跳过、**对照式** `vite.build()`(`plugins: []` 对照产物含 `shouldReplay` + `mota_replay_probe`;带插件产物两者皆无装饰器标记且 `mota_replay_probe` 仍在)」;每个 `it` 前一行注释
|
||||
- `script/build-plugin.test.ts` 覆盖「删两类装饰器、参数含引号/括号、字符串不误删、注释不误删、`node_modules` 跳过、**对照式双装饰器** `vite.build()`(fixture 导出类 + 两个方法各带一种装饰器各返回唯一字面量 + 工厂本地不导出;`plugins: []` 对照产物含 `shouldReplay` / `ignoreReplay` / 两个唯一字面量 / 两个方法名,带插件产物不含 `shouldReplay` / `ignoreReplay` 但两个唯一字面量与两个方法名仍在)」;每个 `it` 前一行注释
|
||||
- 既有注释未被改写:`dataIsolationPlugin` / `SPECIFIER_BANS` / `PATH_BANS` / `findBan` 的注释逐字保留;新增 jsDoc 只出现在新函数上
|
||||
- 未手删任何 import;未改 `packages-user/**` / `packages/**` / `src/**` / `script/dev.ts`
|
||||
</acceptance_criteria>
|
||||
@ -284,15 +288,18 @@ Phase 9 · 任务 11 · 第 22 个计划 —— **构建脚本的 content 过滤
|
||||
- `collectListedNames(value: unknown, output: Set<string>): void`:字符串 → `add`;数组 → 逐项递归;非空对象 → 遍历 `Object.values` 递归;其它(数字/布尔/null)忽略。
|
||||
- `isListedFile(name: string, names: Set<string>): boolean`:`names.has(name)` 或 `names.has(name 去掉最后一个扩展名后的主名)`;只做这两种精确匹配。
|
||||
- **既有 jsDoc 逐字保留(AGENTS.md 禁改既有注释):** `processDirectory` / `minifyJSONC` / `compressFont` / `buildContent` 与接口成员上已有的 jsDoc 不得改写、不得删除、不得换行重排;「按清单过滤」的说明只写到上述新函数与 `LIST_FILE_NAME` / `DEFAULTS_DIRECTORY` 的 jsDoc 上。
|
||||
- 改造 `processDirectory(sourceDir, outputDir, chars, counter)`:
|
||||
- 先 `readdir`;`const isDefaults = basename(sourceDir) === DEFAULTS_DIRECTORY;`;`const listEntry = entries.find(entry => entry.isFile() && entry.name === LIST_FILE_NAME);`;`const names = !isDefaults && listEntry ? await readListNames(join(sourceDir, listEntry.name)) : null;`
|
||||
- 遍历时:目录 → 照旧递归;文件 → **`.list.jsonc` 自身永不被过滤**(先于过滤判断,走 `.jsonc` 压缩分支);若 `names` 存在且 `!isListedFile(entry.name, names)` → `continue`(不拷贝、不计入 `counter.files`);其余分支保持现状(`.jsonc` → `minifyJSONC`、字体扩展名 → `compressFont`、其它 → `copy`)。
|
||||
- 改造 `processDirectory(sourceDir, outputDir, chars, counter, isRoot = false)`(第五个参数为根标记,命名待 OI-2 批准):
|
||||
- 先 `readdir`;`const isDefaults = basename(sourceDir) === DEFAULTS_DIRECTORY;`;`const filterEnabled = !isRoot && !isDefaults;`;`const listEntry = filterEnabled ? entries.find(entry => entry.isFile() && entry.name === LIST_FILE_NAME) : undefined;`;`const names = listEntry ? await readListNames(join(sourceDir, listEntry.name)) : null;`
|
||||
- **根目录永不按清单取舍:** `isRoot === true` 时 `names` 恒为 `null`,即使根目录将来出现 `.list.jsonc` 也全量输出;递归调用子目录时传 `false`(只有 `buildContent` 传 `true`)。
|
||||
- 遍历时:目录 → 照旧递归(传 `false`);文件 → **`.list.jsonc` 自身永不被过滤**(先于过滤判断,走 `.jsonc` 压缩分支);若 `names` 存在且 `!isListedFile(entry.name, names)` → `continue`(不拷贝、不计入 `counter.files`);其余分支保持现状(`.jsonc` → `minifyJSONC`、字体扩展名 → `compressFont`、其它 → `copy`)。
|
||||
- **`defaults/` 与无 `.list.jsonc` 的目录行为不变**(全量输出)。
|
||||
- `minifyJSONC`、`buildContent`、`IContentBuildOptions`、`IContentBuildStats`、`IContentBuildCounter` 的名称与签名**一律不改**;不改字体分支的告警文案。
|
||||
- `buildContent` 调用 `processDirectory(options.sourceDir, options.outputDir, options.chars, counter, true)` —— 只给根调用加标记,其余逻辑与统计不变。
|
||||
- `minifyJSONC`、`buildContent`、`IContentBuildOptions`、`IContentBuildStats`、`IContentBuildCounter` 的名称与签名**一律不改**;**不改 `minifyJSONC` 行为**(仍只按整行 `line.trim().startsWith('//')` 剥离注释,含系统标记行;不剥离行尾注释、不改 `JSON.parse` + `JSON.stringify` 流程);不改字体分支的告警文案。
|
||||
- 保持 dev.md 约定:字面量非空判断用 `isNil`、对象用 `!`;尽量不用 `?.`。
|
||||
|
||||
(2) **新增 `script/build-resource.test.ts`(OI-3):** `mkdtemp` 建临时 fixture,`afterEach` 清理;每个 `it` 前一行注释:
|
||||
- **根目录 jsonc:** `core.jsonc` 含 `// Type: ...` 与系统标记行 → 输出同名 `.jsonc`,`JSON.parse` 成功、文本不含 `//`。
|
||||
- **根目录即使存在 `.list.jsonc` 也全量输出:** fixture 根放 `.list.jsonc`(内容 `["core"]`)+ `core.jsonc` + `other.jsonc` → `core.jsonc` 与 `other.jsonc` **都存在**(证明根目录 `isRoot` 跳过过滤,root 行为不依赖「当前根目录没有清单」这一现状)。
|
||||
- **`defaults/` 全量:** `defaults/env.jsonc` 含注释且不被任何清单引用 → 仍输出且已压缩。
|
||||
- **`maps/` 清单(fixture 清单原文带 `//` 注释):** `.list.jsonc` 写成「`// Type: string[], without .jsonc suffix` + `// --- SYSTEM PREFIX END --- //` + `["keep"]`」三部分,同目录放 `keep.jsonc` 与 `drop.jsonc` → `keep.jsonc` 输出、`drop.jsonc` **不存在**、`.list.jsonc` 输出且 `JSON.parse` 成功、输出文本**不含 `//`**(注释与系统标记行被剥离)。
|
||||
- **`texture/` 清单(对象形态 + 完整文件名):** `.list.jsonc` = `{"textures":[{"type":"grid","source":"a.png"}]}` + `a.png` + `b.png` → `a.png` 存在且与源字节一致、`b.png` 不存在。
|
||||
@ -302,7 +309,7 @@ Phase 9 · 任务 11 · 第 22 个计划 —— **构建脚本的 content 过滤
|
||||
- **统计:** 返回值 `files` 等于输出目录实际文件数、`jsonc` 等于压缩的 `.jsonc` 数(含 `.list.jsonc`)、`fonts` 为 0。
|
||||
- 测试用 `chars: ''`;不触碰仓库 `src/content`。
|
||||
|
||||
(3) **`09-22-SUMMARY.md`:** 记录范围(只动构建脚本与测试)、content 逐文件夹规则与清单匹配口径、修饰器删除口径(TypeScript AST + 双端注入 + 不手删 import + `apply: 'build'`)、命名获批情形、门禁结果(两个单测 + 对照式 `vite.build()`(含对照组含标记的证据)+ 结构门禁 + 既有注释零删除 + 真实 `src/content` 清单覆盖率 + 范围内的 `eslint`)、`open_items` 处置,并**明确记录已知边界**:未端到端运行全量 `build:game`(渲染端仍有 stale import)、生产构建不再有录像安全检查、`index.html` 仍引用 `/styles.css`。需出现关键字:`defaults`、`.list.jsonc`、`node_modules`、`build:game`、`D-96`、`shouldReplay`。
|
||||
(3) **`09-22-SUMMARY.md`:** 记录范围(只动构建脚本与测试)、content 逐文件夹规则与清单匹配口径(含根目录 `isRoot` 跳过)、修饰器删除口径(TypeScript AST + 双端注入 + 不手删 import + `apply: 'build'`)、命名获批情形、门禁结果(两个单测 + 对照式**双装饰器** `vite.build()`(含对照组含 `shouldReplay` / `ignoreReplay` / 两个唯一字面量的证据)+ 结构门禁 + `git show HEAD` 基线注释零丢失 + 真实 `src/content` 清单覆盖率 + 范围内的 `eslint`)、`open_items` 处置,并**明确记录已知边界**:未端到端运行全量 `build:game`(渲染端仍有 stale import)、生产构建不再有录像安全检查、`index.html` 仍引用 `/styles.css`。需出现关键字:`defaults`、`.list.jsonc`、`node_modules`、`build:game`、`D-96`、`shouldReplay`。
|
||||
</action>
|
||||
<behavior>
|
||||
- 根 `.jsonc` → 输出纯 JSON,后缀仍 `.jsonc`。
|
||||
@ -310,32 +317,33 @@ Phase 9 · 任务 11 · 第 22 个计划 —— **构建脚本的 content 过滤
|
||||
- 有 `.list.jsonc` 的目录 → 清单命中(完整名或去扩展名主名)的文件保留,未命中文件不出现在输出。
|
||||
- `.list.jsonc` 自身 → 始终输出且已压缩。
|
||||
- 无 `.list.jsonc` 的非 `defaults` 子文件夹与根目录 → 全量输出(`.jsonc` 压缩、其它原样)。
|
||||
- fixture 的 `.list.jsonc` 原文含 `//` 注释与系统标记行 → 输出可 `JSON.parse` 且不含 `//`。
|
||||
- 根目录即使出现 `.list.jsonc` → 仍全量输出(`isRoot` 跳过过滤)。
|
||||
- fixture 的 `.list.jsonc` 原文含整行 `//` 注释与系统标记行 → 输出可 `JSON.parse` 且不含 `//`。
|
||||
- 统计值 → 与实际输出文件数一致。
|
||||
</behavior>
|
||||
<reversibility rating="reversible">`build-resource.ts` 为单文件改造 + 新增一个测试文件;`git checkout` / 删除测试文件即回退,产物落点与构建顺序不变。</reversibility>
|
||||
<verify>
|
||||
<automated>cmd /c "pnpm exec vitest run script/build-resource.test.ts"</automated>
|
||||
<fails_when>non-zero exit,或任一断言失败(`defaults/` 被过滤 / 清单引用文件被剔除 / 未引用文件仍被输出 / `.list.jsonc` 被剔除或未压缩 / 根 `.jsonc` 未压成纯 JSON / `item.ts` 拷贝内容不一致 / 统计值与实际输出不一致)</fails_when>
|
||||
<automated>node -e "const fs=require('fs'),cp=require('child_process');const bad=[];const t=fs.readFileSync('script/build-resource.ts','utf8');for(const x of ['.list.jsonc','defaults','basename','JSON.parse','minifyJSONC','buildContent','Fontmin','chars: string','IContentBuildOptions','IContentBuildStats']){if(t.indexOf(x)<0)bad.push('build-resource.ts missing: '+x)}try{const diff=cp.execSync('git diff -U0 -- script/build-resource.ts',{encoding:'utf8'});const removed=diff.split('\n').filter(l=>l.slice(0,1)==='-'&&l.slice(0,3)!=='---');const comments=removed.filter(l=>l.indexOf('*')>=0?true:l.trim().slice(0,2)==='//');if(comments.length>0)bad.push('existing comments/jsDoc of build-resource.ts must stay untouched, removed comment lines: '+comments.length)}catch(e){bad.push('git diff check failed: '+e.message)}if(!fs.existsSync('script/build-resource.test.ts'))bad.push('script/build-resource.test.ts missing');const sp='.planning/phases/09-minimum-browser-runnable/09-22-SUMMARY.md';if(!fs.existsSync(sp))bad.push('09-22-SUMMARY.md missing');else{const sm=fs.readFileSync(sp,'utf8');for(const tok of ['defaults','.list.jsonc','node_modules','build:game','D-96','shouldReplay']){if(sm.indexOf(tok)<0)bad.push('SUMMARY must record token: '+tok)}}if(bad.length>0){console.error('CONTENT FILTER GATE FAILED :: '+bad.join(' ; '));process.exit(1)}console.log('OK content filter: list retention + jsDoc untouched + SUMMARY tokens')"</automated>
|
||||
<fails_when>non-zero exit,或 stderr 含 "CONTENT FILTER GATE FAILED"(`build-resource.ts` 缺 `.list.jsonc` / `defaults` / `basename` / `JSON.parse` 等标记 / 既有导出改成别名或丢失(`minifyJSONC` / `buildContent` / `IContentBuildOptions` / `IContentBuildStats`)/ `chars: string` 丢失 / **git diff 显示既有注释或 jsDoc 被删除或改写** / 缺测试文件 / 缺 SUMMARY 或 SUMMARY 未记录 `defaults`、`.list.jsonc`、`node_modules`、`build:game`、`D-96`、`shouldReplay`)</fails_when>
|
||||
<automated>node -e "const fs=require('fs'),cp=require('child_process');const bad=[];const t=fs.readFileSync('script/build-resource.ts','utf8');for(const x of ['.list.jsonc','defaults','basename','JSON.parse','minifyJSONC','buildContent','Fontmin','chars: string','IContentBuildOptions','IContentBuildStats']){if(t.indexOf(x)<0)bad.push('build-resource.ts missing: '+x)}const commentMarks=['//','/*','*'];const isComment=l=>commentMarks.some(m=>l.startsWith(m));for(const f of ['script/build-resource.ts','script/build-plugin.ts']){let head='';try{head=cp.execSync('git show HEAD:'+f,{encoding:'utf8'})}catch(e){bad.push('cannot read HEAD version of '+f+': '+e.message)}const baseSet=new Set(head.split(/\r?\n/).map(l=>l.trim()).filter(isComment));const mins={'script/build-resource.ts':8,'script/build-plugin.ts':5};const min=mins[f] ? mins[f] : 1;if(baseSet.size<min)bad.push(f+' baseline comment lines too few ('+baseSet.size+'<'+min+'), comment gate would be vacuous');const curSet=new Set(fs.readFileSync(f,'utf8').split(/\r?\n/).map(l=>l.trim()));const lost=[...baseSet].filter(l=>!curSet.has(l));if(lost.length>0)bad.push(f+' lost '+lost.length+' existing comment/jsDoc line(s), first: '+lost[0])}if(!fs.existsSync('script/build-resource.test.ts'))bad.push('script/build-resource.test.ts missing');const sp='.planning/phases/09-minimum-browser-runnable/09-22-SUMMARY.md';if(!fs.existsSync(sp))bad.push('09-22-SUMMARY.md missing');else{const sm=fs.readFileSync(sp,'utf8');for(const tok of ['defaults','.list.jsonc','node_modules','build:game','D-96','shouldReplay']){if(sm.indexOf(tok)<0)bad.push('SUMMARY must record token: '+tok)}}if(bad.length>0){console.error('CONTENT FILTER GATE FAILED :: '+bad.join(' ; '));process.exit(1)}console.log('OK content filter: list retention + HEAD-baseline comments intact + SUMMARY tokens')"</automated>
|
||||
<fails_when>non-zero exit,或 stderr 含 "CONTENT FILTER GATE FAILED"(`build-resource.ts` 缺 `.list.jsonc` / `defaults` / `basename` / `JSON.parse` 等值标记 / 既有导出改成别名或丢失(`minifyJSONC` / `buildContent` / `IContentBuildOptions` / `IContentBuildStats`)/ `chars: string` 丢失 / **`git show HEAD:<file>` 基线中的既有注释或 jsDoc 行在 `build-resource.ts` 或 `build-plugin.ts` 中缺失(被删除或改写)** / 基线注释行数低于下限(门禁可能空洞)/ 缺测试文件 / 缺 SUMMARY 或 SUMMARY 未记录 `defaults`、`.list.jsonc`、`node_modules`、`build:game`、`D-96`、`shouldReplay`)</fails_when>
|
||||
<automated>node -e "const fs=require('fs'),path=require('path');const bad=[];function names(f){const t=fs.readFileSync(f,'utf8').split(/\r?\n/).filter(l=>!l.trim().startsWith('//')).join('\n');const set=new Set();(function walk(v){if(typeof v==='string')set.add(v);else if(Array.isArray(v))v.forEach(walk);else if(v&&typeof v==='object')Object.values(v).forEach(walk)})(JSON.parse(t));return set}for(const d of ['animation','audio','font','maps','texture']){const dir=path.join('src','content',d);const list=path.join(dir,'.list.jsonc');if(!fs.existsSync(list)){bad.push('missing '+list);continue}const set=names(list);for(const e of fs.readdirSync(dir,{withFileTypes:true})){if(e.isDirectory()||e.name==='.list.jsonc')continue;const stem=e.name.slice(0,e.name.length-path.extname(e.name).length);if(!set.has(e.name)&&!set.has(stem))bad.push('unlisted asset would be dropped: '+path.join(dir,e.name))}}if(bad.length>0){console.error('CONTENT COVERAGE GATE FAILED :: '+bad.join(' ; '));process.exit(1)}console.log('OK content coverage: every existing asset under the 5 list folders is referenced by its list')"</automated>
|
||||
<fails_when>non-zero exit,或 stderr 含 "CONTENT COVERAGE GATE FAILED":某个素材子文件夹缺 `.list.jsonc`,或该目录内存在既未被完整文件名、也未被去扩展名主文件名命中的现存素材(真实施加过滤后会丢文件)</fails_when>
|
||||
<automated>cmd /c "pnpm exec eslint script/build-plugin.ts script/build-resource.ts script/build-game.ts script/build-plugin.test.ts script/build-resource.test.ts"</automated>
|
||||
<fails_when>non-zero exit:五个改动文件在 `eslint` 下报错(dev.md 要求 eslint 零报错;当前被测的四个既有文件实测为 0 报告,新增代码须维持)</fails_when>
|
||||
</verify>
|
||||
<acceptance_criteria>
|
||||
- `script/build-resource.ts` 按用户裁定 1 实现:根目录照常、`defaults/` 全量、有清单的子文件夹只保留被引用文件、`.list.jsonc` 自身始终压缩输出、无清单目录全量
|
||||
- 清单解析走 `minifyJSONC`(去注释)+ `JSON.parse` + 递归收集字符串;匹配仅「完整文件名」与「去扩展名主文件名」两种精确方式
|
||||
- `script/build-resource.ts` 按用户裁定 1 实现:根目录照常(且 `isRoot` 显式跳过过滤)、`defaults/` 全量、有清单的子文件夹只保留被引用文件、`.list.jsonc` 自身始终压缩输出、无清单目录全量
|
||||
- 清单解析走 `minifyJSONC`(去注释)+ `JSON.parse` + 递归收集字符串;匹配仅「完整文件名」与「去扩展名主文件名」两种精确方式;`minifyJSONC` 行为未改(只剥离整行 `//` 注释)
|
||||
- 既有导出名称与签名(`minifyJSONC` / `buildContent` / `IContentBuildOptions`(`chars: string`)/ `IContentBuildStats` / `IContentBuildCounter`)未改;字体分支与告警文案未改
|
||||
- `script/build-resource.test.ts` 覆盖 8 类用例(根 jsonc、`defaults` 全量、maps 清单(fixture 清单原文含 `//` 注释且输出已剥离)、texture 对象清单、font 清单、无清单子文件夹全量、`item.ts` 原样、统计),每个 `it` 前一行注释
|
||||
- `processDirectory` / `minifyJSONC` / `compressFont` / `buildContent` 与接口成员的既有 jsDoc **逐字未改**(由 git diff 门禁证明),过滤说明只写在新函数 / 新常量上
|
||||
- `script/build-resource.test.ts` 覆盖 9 类用例(根 jsonc、**根目录存在 `.list.jsonc` 仍全量**、`defaults` 全量、maps 清单(fixture 清单原文含 `//` 注释且输出已剥离)、texture 对象清单、font 清单、无清单子文件夹全量、`item.ts` 原样、统计),每个 `it` 前一行注释
|
||||
- `processDirectory` / `minifyJSONC` / `compressFont` / `buildContent` 与接口成员的既有 jsDoc、以及 `script/build-plugin.ts` 的既有注释 **逐字未改**(由 `git show HEAD:<file>` 基线门禁证明;不依赖 git 暂存状态),过滤与删除的说明只写在新函数 / 新常量上
|
||||
- 五个改动文件通过范围内的 `eslint`(`pnpm exec eslint` 零报告)
|
||||
- 真实 `src/content` 清单覆盖率门禁通过(现有素材无一被过滤掉)
|
||||
- `09-22-SUMMARY.md` 已写并含 6 个必需关键字与三项已知边界
|
||||
- 未改 `packages-user/**` / `packages/**` / `src/**` / `package.json` / `index.html` / `dev.md` / `vite.config.ts` / lockfile / `script/dev.ts` / `script/build-lib.ts`
|
||||
</acceptance_criteria>
|
||||
<done>content 构建按清单过滤:`defaults/` 与无清单目录全量输出、5 个素材子文件夹只保留被引用文件、`.list.jsonc` 自身压缩输出、jsonc 仍压成纯 JSON;行为测试、注释零删除与真实清单覆盖率门禁全绿;范围内的 `eslint` 零报告;SUMMARY 记录两处修复与三项已知边界</done>
|
||||
<done>content 构建按清单过滤:`defaults/` 与无清单目录全量输出、根目录 `isRoot` 跳过过滤(即使出现 `.list.jsonc` 也不过滤)、5 个素材子文件夹只保留被引用文件、`.list.jsonc` 自身压缩输出、jsonc 仍压成纯 JSON;行为测试、HEAD 基线注释零丢失与真实清单覆盖率门禁全绿;范围内的 `eslint` 零报告;SUMMARY 记录两处修复与三项已知边界</done>
|
||||
</task>
|
||||
|
||||
</tasks>
|
||||
@ -348,41 +356,41 @@ Phase 9 · 任务 11 · 第 22 个计划 —— **构建脚本的 content 过滤
|
||||
| `.list.jsonc` 原文 → 解析 | 去注释后 `JSON.parse`;清单格式非法将在构建期暴露 |
|
||||
| 项目源码 → 构建产物 | 装饰器删除插件改写 `.ts` / `.tsx` 源码文本;误伤会破坏语义或误删字符串/注释内容 |
|
||||
| 构建期 ↔ 开发期 | 插件必须只在 `build` 生效,开发服务需保留装饰器 |
|
||||
| 写入边界 | 只允许 `files_modified` 白名单(4 个脚本 + 2 个测试 + 1 个 SUMMARY) |
|
||||
| 写入边界 | 只允许 `files_modified` 白名单(3 个脚本 + 2 个测试 + 1 个 SUMMARY) |
|
||||
| 依赖边界 | 不新增依赖、不改 `package.json` 与 lockfile(`typescript` 已是 devDependency) |
|
||||
|
||||
## STRIDE Threat Register
|
||||
|
||||
| Threat ID | Category | Component | Severity | Disposition | Mitigation Plan |
|
||||
|-----------|----------|-----------|----------|-------------|-----------------|
|
||||
| T-09-22-01 | Tampering | `processDirectory` 的清单过滤误删运行期素材 | high | mitigate | 匹配限定「完整文件名 / 去扩展名主文件名」两种精确方式;fixture 行为测试断言保留与剔除两侧;另加真实 `src/content` 清单覆盖率门禁(现存素材必须全部被清单命中) |
|
||||
| T-09-22-02 | Tampering | `.list.jsonc` 自身被过滤或未压缩 | high | mitigate | `.list.jsonc` 判断先于过滤且走 `minifyJSONC` 分支;structure 门禁要求 `LIST_FILE_NAME` 与压缩分支;fixture 断言 `.list.jsonc` 输出且可 `JSON.parse` |
|
||||
| T-09-22-01 | Tampering | `processDirectory` 的清单过滤误删运行期素材 | high | mitigate | 匹配限定「完整文件名 / 去扩展名主文件名」两种精确方式;根目录经 `isRoot` 跳过过滤、`defaults/` 豁免;fixture 行为测试断言保留与剔除两侧;另加真实 `src/content` 清单覆盖率门禁(现存素材必须全部被清单命中) |
|
||||
| T-09-22-02 | Tampering | `.list.jsonc` 自身被过滤或未压缩 | high | mitigate | `.list.jsonc` 判断先于过滤且走 `.jsonc` 压缩分支;结构门禁只断言**值标记**(`.list.jsonc` / `defaults` / `basename` / `minifyJSONC`),不绑定提议的常量名;fixture 断言 `.list.jsonc` 存在于输出、可 `JSON.parse`、输出文本不含 `//` |
|
||||
| T-09-22-03 | Tampering | 装饰器删除误伤字符串 / 注释 / 非目标装饰器 | high | mitigate | 用 TypeScript AST 取装饰器节点范围后逆序切片,不做正则扫描;单测覆盖「字符串不误删」「注释不误删」「参数含引号与括号」 |
|
||||
| T-09-22-04 | Tampering | 装饰器删除进入开发服务(`pnpm dev` 行为漂移) | medium | mitigate | 插件固定 `apply: 'build'`;`script/dev.ts` 不在写入范围;结构门禁断言该字段 |
|
||||
| T-09-22-05 | Tampering | 插件改写 `node_modules` 内第三方源码 | medium | mitigate | `transform` 先剥离查询串再判 `node_modules` 段与 `.ts` / `.tsx` 后缀;单测覆盖跳过分支 |
|
||||
| T-09-22-06 | Tampering | 过滤逻辑未真正接线(仍全量输出) | medium | mitigate | fixture 断言未引用文件**不存在**于输出;structure 门禁要求 `isListedFile` / `readListNames` 被使用 |
|
||||
| T-09-22-06 | Tampering | 过滤逻辑未真正接线(仍全量输出) | medium | mitigate | fixture 断言未引用文件**不存在**于输出、被引用文件存在、无清单子文件夹全量、根目录含 `.list.jsonc` 时仍全量;结构门禁只断言值标记,不绑定内部函数名 |
|
||||
| T-09-22-07 | Tampering | 越界写入 / 顺手改源码(含手删 import) | medium | mitigate | `files_modified` 白名单 + prohibitions(`src/**`、`packages-user/**`、`packages/**`、`script/dev.ts` 等一律不动;不得手删 import) |
|
||||
| T-09-22-08 | Tampering | 未经批准使用新命名 | medium | mitigate | Task 0 报备 OI-1 / OI-2 / OI-3;prohibitions 明列未获批前不得落码 |
|
||||
| T-09-22-09 | Repudiation | 以「构建通过」掩盖未端到端运行的事实 | medium | mitigate | SUMMARY 必须含 `build:game` 字样并写明未端到端运行;structure 门禁校验该关键字 |
|
||||
| T-09-22-09 | Repudiation | 以「构建通过」掩盖未端到端运行的事实 | medium | mitigate | SUMMARY 必须含 `build:game` 字样并写明未端到端运行;结构门禁校验该关键字 |
|
||||
| T-09-22-SC | Tampering | npm/pip/cargo installs | high | mitigate | 不新增依赖、不改 `package.json` 依赖面与 lockfile;如需新增依赖须回 Task 0 报备获批 |
|
||||
</threat_model>
|
||||
|
||||
<verification>
|
||||
- **Task 0:** 预执行状态(09-21 构建脚本为当前实现 / 23 个 jsonc / 5 个清单目录 / `defaults` 8 个 jsonc / 修饰器定义存在 / `script/build-resource.test.ts` 不存在)检查;人工关卡(用户回复「可以执行」;OI-1 / OI-2 / OI-3 若被改名须先修订计划再获批);汇报须含三项已知边界与「既有 jsDoc 逐字保留」的说明。
|
||||
- **Task 1:** `script/build-plugin.ts` 结构(**按导出形态断言**:两个新导出 + `dataIsolationPlugin` 保留 / AST 定位标记 / `enforce: 'pre'` / `apply: 'build'` / `node_modules` 跳过,不硬编码提议命名);`build-game` **按函数切片**断言(从 `./build-plugin` 的导入绑定推导新插件名——`dataIsolationPlugin` + 恰好 1 个新绑定,`buildClient` 与 `buildData` 各含该绑定、`buildData` 仍含隔离插件、隔离插件不进 `buildClient`、定义顺序未变);`script/build-plugin.test.ts` 行为(删两类装饰器、参数含引号括号、字符串与注释不误删、`node_modules` 跳过、**对照式** `vite.build()`:`plugins: []` 对照产物含 `shouldReplay` + `mota_replay_probe`,带插件产物不含装饰器标记且 `mota_replay_probe` 仍在)。
|
||||
- **Task 2:** `script/build-resource.ts` 结构(`.list.jsonc` / `defaults` / `basename` / `JSON.parse` 标记、既有导出与 `chars: string` 未变、**git diff 证明既有注释零删除**);`script/build-resource.test.ts` 行为(根 jsonc、`defaults` 全量、maps 清单保留与剔除 + 清单输出已剥离 `//`、texture 对象清单、font 清单、无清单子文件夹全量、`item.ts` 原样、统计);真实 `src/content` **清单覆盖率**(5 个清单目录内现存素材必须全部被命中);`eslint`(五个改动文件零报告);SUMMARY 关键字。
|
||||
- **Task 1:** `script/build-plugin.ts` 结构(**按导出形态断言**:两个新导出 + `dataIsolationPlugin` 保留 / AST 定位标记 / `enforce: 'pre'` / `apply: 'build'` / `node_modules` 跳过,不硬编码提议命名);`build-game` **按函数切片**断言(从 `./build-plugin` 的导入绑定推导新插件名——`dataIsolationPlugin` + 恰好 1 个新绑定,`buildClient` 与 `buildData` 各含该绑定、`buildData` 仍含隔离插件、隔离插件不进 `buildClient`、定义顺序未变);`script/build-plugin.test.ts` 行为(删两类装饰器、参数含引号括号、字符串与注释不误删、`node_modules` 跳过、**对照式双装饰器** `vite.build()`:fixture 导出类 + 两个方法分别带 `@shouldReplay` / `@ignoreReplay` 且各返回 `mota_replay_probe` / `mota_ignore_probe` + 两个工厂本地不导出;`plugins: []` 对照产物含 `shouldReplay`、`ignoreReplay`、两个唯一字面量与两个方法名,带插件产物不含 `shouldReplay` / `ignoreReplay` 但两个唯一字面量与两个方法名仍在;结构门禁另行校验正/负向断言都在、工厂未被导出)。
|
||||
- **Task 2:** `script/build-resource.ts` 结构(`.list.jsonc` / `defaults` / `basename` / `JSON.parse` 值标记、既有导出与 `chars: string` 未变、**`git show HEAD:<file>` 基线注释行零丢失**,覆盖 `build-resource.ts` 与 `build-plugin.ts`,并校验基线行数下限防止门禁空洞);`script/build-resource.test.ts` 行为(根 jsonc、**根目录存在 `.list.jsonc` 仍全量**、`defaults` 全量、maps 清单保留与剔除 + 清单输出已剥离 `//`、texture 对象清单、font 清单、无清单子文件夹全量、`item.ts` 原样、统计);真实 `src/content` **清单覆盖率**(5 个清单目录内现存素材必须全部被命中);`eslint`(五个改动文件零报告);SUMMARY 关键字。
|
||||
- **一致性:** `dist/content/**` 落点与 `src/data/constant.ts` 的 `content/core.jsonc` 一致;`build-game.ts` 的插件导入路径 `./build-plugin` 与 Task 1 产物一致;`script/build-resource.ts` 被 `build-game.ts` 以 `buildContent` / `IContentBuildOptions` 原名调用。
|
||||
- **无全仓门禁:** 不使用 `pnpm check:type` / `pnpm build` / 全量 `pnpm test:ci`(用户 WIP 存在历史类型错误);本计划**不端到端运行全量** `build:game`。
|
||||
- **人工复核:** 结论(含三项已知边界)写入 `09-22-SUMMARY.md`。
|
||||
</verification>
|
||||
|
||||
<success_criteria>
|
||||
- **用户裁定 1(content):** `src/content` → `dist/content`;根目录照常(`.jsonc` 压缩、`item.ts` 原样);`defaults/` 全量输出并压缩;`maps` / `texture` / `animation` / `audio` / `font` 按各自 `.list.jsonc` 只保留被引用文件;`.list.jsonc` 自身压缩输出;所有 jsonc 去净 `//` 注释压成纯 JSON、后缀仍 `.jsonc`;fontmin 保留;不分块、不 zip。
|
||||
- **用户裁定 1(content):** `src/content` → `dist/content`;根目录照常且**显式跳过过滤**(`.jsonc` 压缩、`item.ts` 原样);`defaults/` 全量输出并压缩;`maps` / `texture` / `animation` / `audio` / `font` 按各自 `.list.jsonc` 只保留被引用文件;`.list.jsonc` 自身压缩输出;所有 jsonc 仅剥离**整行** `//` 注释(含系统标记行)压成纯 JSON、后缀仍 `.jsonc`,`minifyJSONC` 行为未改;fontmin 保留;不分块、不 zip。
|
||||
- **用户裁定 2(修饰器):** 构建时删除所有 `@shouldReplay` / `@ignoreReplay` 应用,数据端与渲染端都删;删除基于 TypeScript AST、不误伤字符串与注释、跳过 `node_modules`;**未手删任何 import**。
|
||||
- **用户裁定 3 / 4(边界):** 只改构建脚本与其测试;未改 `build-lib.ts` / `package.json` / `index.html` / `dev.md` / `src/**` / `public/**` / `packages-user/**` / `packages/**` / `vite.config.ts` / lockfile / `script/dev.ts`;未改构建顺序;无特殊失败处理。
|
||||
- **D-93 / D-96 / D-98:** 任务 11 的构建脚本继续承担 content 处理;`build-game` 仍是唯一编排入口;未回退 09-21 已落地的数据端 ESM 产物与隔离检测。
|
||||
- **验证:** 两个测试文件与六个门禁(插件结构、content 结构 + 注释零删除、真实清单覆盖率、`eslint`、SUMMARY 关键字,以及对照式 `vite.build()` 的双向断言)全部跑到确定结论;**未端到端运行全量 `build:game` 的事实已写入 SUMMARY**。
|
||||
- **注释纪律:** 既有 jsDoc / 注释逐字保留;新增说明只出现在新函数与新常量上(`build-resource.ts` 由 git diff 门禁证明)。
|
||||
- **验证:** 两个测试文件与六个门禁(插件结构、content 结构 + `git show HEAD` 基线注释零丢失、真实清单覆盖率、`eslint`、SUMMARY 关键字,以及对照式**双装饰器** `vite.build()` 的正/负向双向断言)全部跑到确定结论;**未端到端运行全量 `build:game` 的事实已写入 SUMMARY**。
|
||||
- **注释纪律:** 既有 jsDoc / 注释逐字保留;新增说明只出现在新函数与新常量上(`build-resource.ts` 与 `build-plugin.ts` 均由 HEAD 基线门禁证明)。
|
||||
- **已知边界:** 生产产物不再产生录像安全检查信息(预期);`index.html` 仍引用 `/styles.css`(09-21 已记录);`animation` / `audio` / `font` 当前无素材,其过滤规则由测试覆盖。
|
||||
</success_criteria>
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user