Skip to content

迁移 skill-calorie 渲染与分析域(render+analysis):55 件(3,392 条,43 迁入/12 不迁) #1217

Closed

Description

@FeatherHunter

目标

把 skill-calorie render、analysis 的用户可见文本迁到词条表并补英文;中文产物与改造前逐字节一致。
本票范围=「交付物路径(文件清单)」所列 55 件(3,392 条);清单由 ledger 派生、与其它迁移票不重叠,范围外文件不得顺手改。

交付物路径(文件清单)

派生源:tooling/i18n-codemod.ledger.json(路径+条数+分类)。开工前把待迁件逐件登记进 tooling/i18n-scope.json 的 files 数组(正斜杠相对路径)。

  • packages/skill-calorie/src/analysis/anomaly/common.ts — 10 条(copy 7/concat 1/ident 2)
  • packages/skill-calorie/src/analysis/anomaly/diet.ts — 88 条(copy 28/concat 52/ident 8)
  • packages/skill-calorie/src/analysis/anomaly/exercise.ts — 68 条(copy 25/concat 35/ident 8)
  • packages/skill-calorie/src/analysis/anomaly/index.ts — 4 条(concat 4)
  • packages/skill-calorie/src/analysis/anomaly/overall.ts — 99 条(copy 45/concat 44/ident 10)
  • packages/skill-calorie/src/analysis/anomaly/overall2.ts — 58 条(copy 31/concat 25/ident 2)
  • packages/skill-calorie/src/analysis/anomaly/weight.ts — 98 条(copy 25/concat 63/ident 10)
  • packages/skill-calorie/src/analysis/anomaly/weight2.ts — 36 条(copy 12/concat 21/ident 3)
  • packages/skill-calorie/src/analysis/commands.ts — 65 条(copy 59/concat 5/ident 1)
  • packages/skill-calorie/src/analysis/contraindications.ts — 86 条(copy 74/concat 6/ident 6)
  • packages/skill-calorie/src/analysis/cross.ts — 99 条(copy 43/concat 55/ident 1)
  • packages/skill-calorie/src/analysis/dashboard.ts — 2 条(concat 2)
  • packages/skill-calorie/src/analysis/deficit.ts — 17 条(copy 14/concat 3)
  • packages/skill-calorie/src/analysis/exercise.ts — 28 条(copy 5/concat 22/ident 1)
  • packages/skill-calorie/src/analysis/exerciseReview.ts — 2 条(copy 1/concat 1)
  • packages/skill-calorie/src/analysis/healthPlate.ts — 4 条(copy 1/concat 3)
  • packages/skill-calorie/src/analysis/historyStore.ts — 3 条(copy 2/concat 1)
  • packages/skill-calorie/src/analysis/multiTrend.ts — 5 条(copy 1/concat 4)
  • packages/skill-calorie/src/analysis/multiTrendPage.ts — 100 条(copy 48/concat 49/ident 3)
  • packages/skill-calorie/src/analysis/precision.ts — 1 条(concat 1)
  • packages/skill-calorie/src/analysis/reportDoc.ts — 78 条(copy 36/concat 41/ident 1)
  • packages/skill-calorie/src/analysis/reportDocBmi.ts — 42 条(copy 30/concat 12)
  • packages/skill-calorie/src/analysis/reportDocParts.ts — 23 条(copy 9/concat 14)
  • packages/skill-calorie/src/analysis/reportDocScore.ts — 103 条(copy 74/concat 23/ident 6)
  • packages/skill-calorie/src/analysis/reportDocScoreSeries.ts — 1 条(copy 1)
  • packages/skill-calorie/src/analysis/reportDocTracked.ts — 127 条(copy 60/concat 67)
  • packages/skill-calorie/src/analysis/reportPlate.ts — 36 条(copy 26/concat 10)
  • packages/skill-calorie/src/analysis/review.ts — 15 条(copy 4/concat 11)
  • packages/skill-calorie/src/analysis/routes.ts — 195 条(copy 192/ident 3)
  • packages/skill-calorie/src/analysis/series.ts — 38 条(copy 26/concat 12)
  • packages/skill-calorie/src/analysis/simulate.ts — 25 条(copy 3/concat 20/ident 2)
  • packages/skill-calorie/src/analysis/simulate2.ts — 61 条(copy 3/concat 54/ident 4)
  • packages/skill-calorie/src/analysis/trend.ts — 8 条(copy 8)
  • packages/skill-calorie/src/analysis/utils.ts — 15 条(copy 15)
  • packages/skill-calorie/src/render/analysisPlate.ts — 15 条(copy 5/concat 10)
  • packages/skill-calorie/src/render/diet.ts — 9 条(copy 2/concat 7)
  • packages/skill-calorie/src/render/dietDocs.ts — 119 条(copy 51/concat 68)
  • packages/skill-calorie/src/render/envelope.ts — 10 条(concat 10)
  • packages/skill-calorie/src/render/exercisePort.ts — 23 条(copy 13/concat 10)
  • packages/skill-calorie/src/render/html.ts — 323 条(copy 19/concat 283/ident 21)
  • packages/skill-calorie/src/render/insightPlate.ts — 46 条(copy 33/concat 10/ident 3)
  • packages/skill-calorie/src/render/pageChromeCss.ts — 7 条(ident 7)
  • packages/skill-calorie/src/render/planPlate.ts — 24 条(copy 18/concat 6)
  • packages/skill-calorie/src/render/planWizardCss.ts — 19 条(copy 1/ident 18)
  • packages/skill-calorie/src/render/planWizardDocs.ts — 58 条(copy 23/concat 18/ident 17)
  • packages/skill-calorie/src/render/receipt.ts — 17 条(copy 9/concat 5/ident 3)
  • packages/skill-calorie/src/render/sportDocs.ts — 116 条(copy 61/concat 50/ident 5)
  • packages/skill-calorie/src/render/trendDocs.ts — 173 条(copy 97/concat 75/ident 1)
  • packages/skill-calorie/src/render/trendMiscPort.ts — 61 条(copy 20/concat 37/ident 4)
  • packages/skill-calorie/src/render/trendMiscPortDocs.ts — 183 条(copy 98/concat 75/ident 10)
  • packages/skill-calorie/src/render/trendPredictDocs.ts — 369 条(copy 214/concat 144/ident 11)
  • packages/skill-calorie/src/render/workoutMovementTable.ts — 14 条(copy 7/concat 7)
  • packages/skill-calorie/src/render/workoutPlanCss.ts — 43 条(copy 12/ident 31)
  • packages/skill-calorie/src/render/workoutPlanDocs.ts — 98 条(copy 59/concat 38/ident 1)
  • packages/skill-calorie/src/render/workoutPlanLook.ts — 25 条(copy 11/concat 11/ident 3)

合计:待迁 55 件/3,392 条(copy 1,661/concat 1,525/payload 0/ident 206/data 0/cmdkey 0/derived 0)。

验收命令(读数)

开工前置(不通过就别开工):pnpm build 绿(测试读 dist/)。

本票读数(逐条贴命令与结果):

  1. 登记范围:把「交付物路径(文件清单)」的待迁件逐件写进 tooling/i18n-scope.json 的 files 数组。规则与口径见 docs/agents/多语言-门禁改造-验收命令.md。
  2. 两道门先红后绿(必须都 exit 0,且 RESULT 行计数覆盖本票范围):
    • node tooling/check-i18n-entries.mjs → RESULT: files=<n> keys=<n> missing=0
    • node tooling/check-i18n-keys.mjs → RESULT: files=<n> literals=<n> residue=0
      ⚠ 登记范围后先跑一次拿到红读数(记进票面),改完再跑拿绿读数;登记即绿=要么范围里没有可迁的件(写清楚),要么门失明(查 blind 行)。
  3. 中文列逐字节不变:pnpm snapshot:html:check 的中文列(tooling/skill-html.snapshot.json)与 node tooling/calorie-html-snapshot.mjs --check(calorie 范围)逐件同值;页面范围另跑 node packages/skill-bill/scripts/gen-page-fingerprints.mjs --check、node packages/base-render/scripts/i18n-pilot-1202.mjs --check。记录法:改前/改后各跑一次 git hash-object <账本>,两个 sha 相同即证。
  4. 英文列新录:英文产物按 docs/agents/多语言-文件名裁决.md 命名(<主体>_en_<TS>.html),偏离中文列的件录进英文列账本(tooling/*.snapshot.en.json,只记偏离项)。
  5. 词条 zh/en 对齐+占位符一致:本范围每个 key 的 zh 与 en 都有值;同一 key 的 {占位符} 集合在 zh/en 中相等;每个新增 key 有 resolve 带参单测(缺参抛 MissingParamError,见 packages/base-entries/src/evaluate.ts:31,48)。缺英文禁止留空串:空串视为缺词条并走回退链(packages/base-entries/src/resolve.ts:69-70,见 [实施] 门禁加固:空串当缺词条+zh/en 占位符一致性 #1306)。
  6. 全仓编译:node node_modules/typescript/bin/tsc -b 退出码 0(含 packages/base-render/test-d/contract-signatures.ts 契约签名;字面量类型换 string 后这里红就是没接线完)。
  7. CLI 端到端:--language en 输出英文;--language zz 走回退链(请求语言→zh→en),不返回空串。
  8. 同票内完成接线:本票迁移的函数,调用方必须传 language;禁止新增 language: string = 'zh' 默认参数裸调(见 [实施] 语言接线补全:默认参数与调用方漏传 #1307)。写模式跑完 ≠ 迁移完成。

边界

只改本票清单内文件与其直接调用方(接线点);不新增依赖;不动命令关键字、用户数据、唤醒词(ADR-0004 三条不译)。拼接串(前缀+变量+后缀)按 docs/agents/多语言-位置四分规则.md 先整句化成一条模板再进词条——每处这样的改动要在票面预先申报(原句 → 模板)并由第二方逐处比对。

不许动的东西

该范围既有行为与判据;命令关键字;用户数据;文件与目录名。

遗留出口

跨范围共用词条转公共层词条层那张票;文件名策略另行裁决。

  • 本票范围内出现清单外文件(ledger 未收录或新生成):登记 tooling/i18n-ticket-scope.json 并另开票,不在本票临时扩范围。
  • 半迁移(同页中英混排)必须在收工前清零;未清零写进本票进度并保持 open。

进度

  • 进度:100%(2026-11-02T01:25:54+08:00):43 件迁入、12 件不迁;两道门+params 门+tsc 绿;英文列三页真出口验收;提交 5a9ff48。
  • 2026-10-09 run-locked 退役清理:开工前置去包装、改直调;判据不变。
  • 2026-11-01 队列重写([实施] 队列重写:28 张迁移票的文件清单与统一票面 #1308):本票文件清单由 tooling/i18n-codemod.ledger.json 派生(剔除 tooling/i18n-scope.json 已迁 12 件),待迁 55 件/3,392 条;清单与其它迁移票不重叠。开工时把待迁件登记进 tooling/i18n-scope.json 的 files,收工时写验收读数与提交 SHA。

完成登记(2026-11-02,提交 5a9ff48)

结果:43 件迁入、12 件不迁(合计 55 件/3,392 条,与票面清单一致)。

  • 迁入 43 件:analysis/ 与 render/ 源码改为按语言取词,页文案、报告文档、异常/趋势/模拟说明等全部走 resolve;模块级常量改函数取词(如 kindLabels()/dowOf()/restNote()/levelGuide()/lineSuffix())。
  • 不迁 12 件(tooling/i18n-ticket-scope.json 写 reason):analysis/anomaly/index.ts、analysis/deficit.ts、analysis/healthPlate.ts、analysis/multiTrend.ts、analysis/precision.ts、analysis/routes.ts、analysis/series.ts、analysis/trend.ts、render/analysisPlate.ts、render/diet.ts、render/envelope.ts、render/planWizardCss.ts —— 纯取数/路由表/CSS/类型文件,或只剩开发报文、窗口名、命令键、SQL;analysis/trend.ts 只做了判据位去本地化。
  • 词条:packages/skill-calorie/src/entries/{zh,en}.ts 各 2,206 键(空表起步),英文列 0 空串、占位符集合逐条相等。
  • allowlist:174 条数据串(数据表值/命令键/唤醒词/CSS 注释),明细见 D:/ilife-wt-t1217/.scratch/allowlist-1217-additions.json。
  • 判据位:TrendDay.type 由「工作日/周末」改控制码 'weekday'/'weekend',消费方按码映射词条。

验收读数:

  1. node tooling/i18n-migrate.mjs --ticket 1217 --dry → files=55 migrated=0 skipped=55(清单内 43 件已迁、12 件不迁)。
  2. node tooling/check-i18n-ticket-scope.mjs → RESULT: tickets=29 files=1097 literals=38735 excluded=48 problems=0;--selftest 六条过。
  3. 两道门(合集 162 件)→ entries RESULT: files=162 keys=4685 missing=0 blanks=0;keys RESULT: files=162 literals=17803 residue=0。
  4. params 门 RESULT: keys=4702 pairs=4702 mismatch=0(zh/en 同 key 同占位符集合)。
  5. 全仓 node node_modules/typescript/bin/tsc -b → exit 0。
  6. 本票包测试(名称匹配 ^(analysis|render|page|html|help|i18n) 共 176 项)→ 175 过/1 红;唯一红「卡路里HELP live 出口未接线:实测产 身材照HELP_*.html 而非 卡路里_HELP_*.html #139② 壳=老实物同款 V4 三级目录」在 master 97d78cde1 同命令同红(既有债,.scratch/calorie-ar-tests.txt)。
  7. 英文列真出口:隔离家目录造 100 天数据,跑 calorie.report.{score,trend,bmi} --language en 三页均 exit 0(127,006/139,259/147,771 B);页内「综合评分/评分历史/健康趋势/BMI 分级」全部换为 Overall score/Score history/Health trend/BMI categories,中文标签不再出现;可见区残留中文仅共享文档壳(页内导航、复制区、帮助速查台,属 base-render 迁移面)与 CSS 注释、用户数据值(米饭/跑步/有氧,ADR-0004 数据不译)。--language zz 按 语言选择链贯通:配置/命令行 → 页面壳 lang → 产物随语言(真产物英文取证) #1198③ 响亮失败并列出可用语言(ERR 1: 不认识的语言「zz」…可用语言为 zh、en)。
  8. 中文列:词条中文值逐字取自原字面量(迁移器保证);bill 指纹门 --check 44/44 绿。

同票工具/清单改动:tooling/i18n-scope.json、tooling/i18n-ticket-scope.json(与 #1206 同批登记,随 1027e45 落账)。
遗留(票外):packages/skill-calorie 的 HELP 页走 derived help-assets,英文列未落(归 #1218/#1219);共享文档壳文案归 base-render 迁移面。

Activity

  1. FeatherHunter commented on Oct 8, 2026

    @FeatherHunter
    OwnerAuthor

    依赖登记:本票实际前置为 #1202、#1233、#1234。原生边缺 #1233 一条(写入反复超时),以本条文本依赖为准,待后端稳定后补。

  2. added
    ready-for-agent
    and removed
    wayfinder:task
    on Nov 1, 2026
  3. changed the title [-]迁移 skill-calorie 渲染与分析域(render+analysis,3,695 条)[/-] [+]迁移 skill-calorie 渲染与分析域(render+analysis):55 件(3,392 条)[/+] on Nov 1, 2026
  4. FeatherHunter commented on Nov 1, 2026

    @FeatherHunter
    OwnerAuthor

    收工登记:43 件迁入/12 件不迁,两道门与 tsc 绿,英文列三页真出口验收(Overall score/Score history/Health trend/BMI categories),提交 5a9ff48。

  5. changed the title [-]迁移 skill-calorie 渲染与分析域(render+analysis):55 件(3,392 条)[/-] [+]迁移 skill-calorie 渲染与分析域(render+analysis):55 件(3,392 条,43 迁入/12 不迁)[/+] on Nov 1, 2026
  6. FeatherHunter commented on Nov 1, 2026

    @FeatherHunter
    OwnerAuthor

    43 件迁入、12 件不迁并写 reason;entries/keys/params/typography 门与全仓 tsc 绿;英文列三页端到端通过;中文列由词条值逐字保留与 bill 指纹 44/44 旁证。票外遗留(calorie HELP derived 英文列)归 #1218/#1219。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions