mirror of
https://github.com/motajs/template.git
synced 2026-10-11 23:20:21 +08:00
fix(09): revise 09-04 plan based on checker feedback (narrow p.status gate to executable reads; note stale line-463 comment)
This commit is contained in:
parent
f18d577b77
commit
7798ba1987
@ -146,6 +146,8 @@ Phase 9 · 任务 1 · 第 4 个计划(**用户定向重设计版**)—— *
|
||||
|
||||
⑦ **命名:** 本计划**不新增任何公共 / 受保护 / 私有成员命名、不新增导出接口**;仅移除未导出接口 `StatusBarProps` 的 `status` 成员(及随之未使用的泛型形参)。组件 setup 内新增局部 `const`(`refreshAttribute` / `locationHook`),请用户知悉(默认视为无需单独批准)。**不引入名为 `IHeroAttr` 的任何对象**(与 `@user/data-common` / `@user/data-state` 冲突)。
|
||||
|
||||
⑦.1 **既有注释遗留(须用户裁定):** `statusBar.tsx:463` 现存注释 `// p.status 就是你在 main.tsx 中传入的属性内容,用法与左侧状态栏完全一致` **提及 `p.status`**;本次移除 `status` 传参契约后,该注释将**变为过时(stale)**。依 AGENTS.md(不得擅自修改任何已有注释),本计划**不予修改该注释**,特此原样呈报用户,供用户决定是否授权后续单独处理。因此 Task 1 的 `p.status` 门禁仅匹配**可执行读**(剥离 `//` 注释行后再判定),行 463 注释不会触发门禁。
|
||||
|
||||
⑧ **范围与硬边界:** 改动面 = `statusBar.tsx` + `main.tsx`;`src/ui/index.ts` **无需改动**(`ILeftHeroStatus` / `IRightHeroStatus` / 两组件仍由 `statusBar.tsx` 导出)。**零触碰** = 其它 `src/ui/*`、`src/render/**`、数据端、`packages/**`、legacy `core.*`(D-14)、用户并发改动(D-56)。**无依赖变更、不执行 `pnpm i`。**
|
||||
|
||||
⑨ **验证方式:** 静态——`statusBar.tsx` 自持状态 + 含 `addHook` / `onUpdateAttribute` / `getFinalAttribute` / `onSetFloor` / `unload` / `onUnmounted` / `TODO`、且 `StatusBarProps` 无 `status` 与泛型、无 `p.status` 残留;`main.tsx` 已清理且保留 `hideStatus` / 地图 / 交互;`src/ui/**` 零 `client`。**不得**使用 `pnpm check:type` / `pnpm build` / TS 诊断数作门禁。
|
||||
@ -230,7 +232,7 @@ Phase 9 · 任务 1 · 第 4 个计划(**用户定向重设计版**)—— *
|
||||
</action>
|
||||
<reversibility rating="reversible">组件内状态归属迁移 + 订阅;`git revert` 可整体回退;未改导出公共契约(未导出接口的内部成员移除与泛型简化)。</reversibility>
|
||||
<verify>
|
||||
<automated>node -e "const fs=require('fs');const t=fs.readFileSync('packages-user/client-modules/src/ui/statusBar.tsx','utf8').replace(/\r\n/g,'\n');const bad=[];if(!/export interface ILeftHeroStatus/.test(t))bad.push('ILeftHeroStatus export lost');if(!/export interface IRightHeroStatus/.test(t))bad.push('IRightHeroStatus export lost');if(!/const leftStatus[^=]*=\s*reactive\(/.test(t))bad.push('leftStatus not owned locally');if(!/const rightStatus[^=]*=\s*reactive\(/.test(t))bad.push('rightStatus not owned locally');if(!/hero\.attribute\.addHook\(/.test(t))bad.push('attribute addHook missing');if(!/onUpdateAttribute/.test(t))bad.push('onUpdateAttribute missing');if(!/getFinalAttribute/.test(t))bad.push('getFinalAttribute missing');if(!/hero\.location\.addHook\(/.test(t))bad.push('location addHook missing');if(!/onSetFloor/.test(t))bad.push('onSetFloor missing');if(!/onUnmounted\(/.test(t))bad.push('onUnmounted missing');if(!/\.unload\(\)/.test(t))bad.push('unload missing');if(!/TODO:/.test(t))bad.push('TODO markers missing');if(/interface StatusBarProps</.test(t))bad.push('StatusBarProps still generic');if(/status\s*:\s*[A-Za-z]/.test(t))bad.push('StatusBarProps still has status member');if(/props:\s*\[[^\]]*'status'/.test(t))bad.push('statusBarProps still requires status prop');if(/p\.status\b/.test(t))bad.push('p.status still referenced');if(bad.length>0){console.error('STATUSBAR FAILED :: '+bad.join(' ; '));process.exit(1)}console.log('OK statusBar owns status + hooks(attribute/location) + unload + TODOs; status prop removed')"</automated>
|
||||
<automated>node -e "const fs=require('fs');const t=fs.readFileSync('packages-user/client-modules/src/ui/statusBar.tsx','utf8').replace(/\r\n/g,'\n');const bad=[];if(!/export interface ILeftHeroStatus/.test(t))bad.push('ILeftHeroStatus export lost');if(!/export interface IRightHeroStatus/.test(t))bad.push('IRightHeroStatus export lost');if(!/const leftStatus[^=]*=\s*reactive\(/.test(t))bad.push('leftStatus not owned locally');if(!/const rightStatus[^=]*=\s*reactive\(/.test(t))bad.push('rightStatus not owned locally');if(!/hero\.attribute\.addHook\(/.test(t))bad.push('attribute addHook missing');if(!/onUpdateAttribute/.test(t))bad.push('onUpdateAttribute missing');if(!/getFinalAttribute/.test(t))bad.push('getFinalAttribute missing');if(!/hero\.location\.addHook\(/.test(t))bad.push('location addHook missing');if(!/onSetFloor/.test(t))bad.push('onSetFloor missing');if(!/onUnmounted\(/.test(t))bad.push('onUnmounted missing');if(!/\.unload\(\)/.test(t))bad.push('unload missing');if(!/TODO:/.test(t))bad.push('TODO markers missing');if(/interface StatusBarProps</.test(t))bad.push('StatusBarProps still generic');if(/status\s*:\s*[A-Za-z]/.test(t))bad.push('StatusBarProps still has status member');if(/props:\s*\[[^\]]*'status'/.test(t))bad.push('statusBarProps still requires status prop');const exec=t.split('\n').filter(l=>!/^\s*\/\//.test(l)).join('\n');if(/p\.status\b/.test(exec))bad.push('p.status still referenced (executable read)');if(bad.length>0){console.error('STATUSBAR FAILED :: '+bad.join(' ; '));process.exit(1)}console.log('OK statusBar owns status + hooks(attribute/location) + unload + TODOs; status prop removed')"</automated>
|
||||
<fails_when>non-zero exit, 或 stderr 含 "STATUSBAR FAILED"(未自持状态 / 缺属性或位置钩子 / 缺 `onUnmounted` 卸载 / 缺 `TODO` / `StatusBarProps` 仍含泛型或 `status` / `statusBarProps` 仍要求 `status` / 仍引用 `p.status` / 导出接口丢失)</fails_when>
|
||||
</verify>
|
||||
<acceptance_criteria>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user