Repository navigation
Closed
Labels
ready-for-agentFully specified, ready for an AFK agent
Description
Part of #765(818 的执行规格单;定案正文为首见 #818 ## 定案)
Problem Statement
用户在私家大厨里记一道菜时,经常有填不出的格子:盐写“适量”没有克数、装盘那一步没有分钟数、这次做完不想打分。用户要的是:要么当时就被清楚地拦下并知道缺什么、问谁要、怎么补(已填的不丢、不存半条怪数据),要么一次补齐就顺利入库。实际情况是老库三列都是非空约束,缺值写入直接失败,而 9 张场景卡(录入 6、修改 1、历史 1、派生 1)都要经过这三列,四张纵向票被一起挡住。
Solution
三列一律按必填执行:用量数字、步骤时长数字、评分 0-5 数字,缺一即响亮失败并指引补齐,不落半条脏数据。用户补齐后重试一次通过。查询与统计保持原样(平均分直算、用量与时长直显),页面把这三项标为必补。远期放开可空另立 schema 票,届时评分改回选填。
User Stories
- As a home cook adding a dish from a photo, I want to be told exactly which ingredient lacks a numeric amount, so that I can supply it and complete the entry.
- As a home cook writing “适量” for salt, I want the assistant to ask me for an estimated grams figure while keeping my “适量” wording, so that the record stays truthful instead of inventing a number.
- As a home cook importing a recipe from a markdown file, I want missing amounts or step durations collected in one go, so that I don't fix them one by one across retries.
- As a home cook importing from JSON, I want a failed import to list every missing field and let me retry after filling them, so that nothing is silently dropped.
- As a home cook using a fill-in form, I want unfilled required items marked in red with the confirm button disabled, so that I know what blocks saving before I try.
- As a home cook editing an ingredient amount, I want the change to require a real number, so that the shopping list math stays correct.
- As a home cook adding a new ingredient to an existing recipe, I want the same numeric-amount rule as during entry, so that rules don't change between pages.
- As a home cook recording a cook, I want to be asked for a 0-5 score when I skip it, so that the record is complete and averages stay meaningful.
- As a home cook doing a quick record (“刚做完,很不错”), I want the one-question score prompt plus my one-line feedback, so that quick entry stays quick but complete.
- As a home cook backfilling yesterday's cook, I want the same score rule with a date I choose, so that补录 behaves like a normal record.
- As a home cook viewing a dish's average score, I want the average computed straight from real scores, so that I can trust it.
- As a home cook viewing the cooking timeline, I want every entry to show its real score and feedback, so that history reads truthfully.
- As a home cook deriving a new dish from a mother recipe, I want inherited ingredients and steps to carry their numbers over, so that the new dish is complete on creation.
- As a home cook editing a derived difference, I want emptied numbers flagged as must-fill, so that I can't accidentally save a broken dish.
- As a home cook generating a shopping list, I want amounts summed from real numbers, so that the totals are usable.
- As a home cook opening the cooking mode, I want each step to show a real duration, so that waiting-type steps can be planned around.
- As an AI assistant executing these cards, I want one uniform missing-value behavior across all 9 cards, so that I don't memorize per-card exceptions.
- As an AI assistant hitting a missing value, I want the failure to name the field and how to fix it, so that I can ask the user precisely and retry.
- As a maintainer reviewing longitudinal tickets, I want the per-ticket rulings findable in each ticket body, so that 录入域:端到端搬迁(6 卡,写侧) #773/修改域:端到端搬迁(4 卡,写侧) #774/历史域:端到端搬迁(4 卡;记录做菜=写、查看历史/查看统计=读) #775 each stand alone.
- As an acceptance reviewer, I want negative cases (one missing column each) to fail loudly with no partial rows, so that data corruption is impossible by construction.
- As a home cook who truly has no rating to give, I want to be asked once rather than blocked silently, with the knowledge that a future update will allow skipping scores entirely.
Implementation Decisions
- 按列独立审查、结论收敛为同一个“必填”:用量数字必填、步骤时长数字必填、评分 0-5 必填;审查过程是分列的,结果是一致的;改 schema 只出图不做。
- 缺值在取数层写入入口统一拦下(单个定义地,别处引用不重写):先校验后落盘,单条写入不产生半条行;批量采集的整批原子性(先验后写或同事务)由各纵向票在实现时保证,本规格只定单条语义。
- 对外契约:缺用量数字、缺时长数字、缺评分 → 取数失败类错误(消息含缺哪个字段、找用户补什么),命令出口以取数失败档非零退出;成功保持零退出与回执不变。
- “适量”语义:数字用量与文字用量分离,AI 向用户要一个估计数并原样保留文字(如少许约 5g),不编造、不存 0(0 已有“废弃标注”含义,不得复用)。
- 评分语义:0 分是合法评分,未评分当前不可存储且与 0 分不可区分,因此缺评分必须补;卡面“选填”暂按“必填”执行,HELP 内容资产本次不动,文字差随远期 schema 票改回。
- 查询与统计零改动:平均分直算、无剔除逻辑;用量显示数字加文字;时长显示分钟数。
- 页面:录入与修改表单把三项标为必补(缺失时确认置灰);记录做菜缺评分走失败回执加重试。
- 关联步骤、维度表写入、导入事务边界不在本规格内,沿用既有对账口径(本期不开)。
- 不改老库、不改老件、不碰真库;验证一律走副本库,真库只读对照。
- 与数据库层全局缺口裁定(重名唯一约束、外键)正交,互不干扰。
Testing Decisions
- 好测试只测外部行为(命令、退出码、写后读回),不测内部实现。
- 缝只取一个最高缝:CLI 唯一出口(参数加 JSON 加退出码),覆盖 9 卡路径(单条操作、批量内嵌数组、历史记录);取数层写入入口直调作为辅助定位缝,不单独设新缝。
- 先例:既有命令级闭环测试(加菜到查看、反例非零退出)与取数级统计闭环测试;本规格的反例沿同一写法:三列各一例缺值,均须非零退出且读回无新增。
- 副本老库实测为准:缺值被拦下、带值可写;正例写后读回关键字段。
Out of Scope
- 把三列改成可空并迁移老库(远期 schema 票,另立;本图只做技能侧)。
- HELP 卡面“选填”文字改回(随远期 schema 票;本次行为以本规格为准)。
- 维度表写入、导入事务边界、批量进度与中断恢复。
- 反馈禁占位词、补录日期等历史域既有校验(保持不变)。
- 步骤内容修改与重排、食材关联步骤落点(各纵向票内定)。
- 体检、批量改、备份等数据管理卡。
Further Notes
- 定案正文为首:完整定案在 【裁定】老库三条 NOT NULL 与卡面「选填」的冲突:9 张卡怎么落 #818 ## 定案,本规格是执行件;录入域:端到端搬迁(6 卡,写侧) #773/修改域:端到端搬迁(4 卡,写侧) #774/历史域:端到端搬迁(4 卡;记录做菜=写、查看历史/查看统计=读) #775 正文各有对应列的回写段。
- 地图校验说明:【裁定】老库三条 NOT NULL 与卡面「选填」的冲突:9 张卡怎么落 #818 正文进度已改为 95%,全图校验器械的“全票 0%”预检会报该票偏离,属执行期正常偏离,收口前以本规格与票面为准。
- 本规格单未挂为地图子议题(挂上去会把全图校验的子议题计数从 18 改为 19 并引入体例外票):以独立 issue 加 Part of [wayfinder] 私家大厨本体图:按 HELP 十域 parity 并做到极致(48 卡/50 唤醒词/链路总表/视觉验收墙) #765 存放,与 【裁定】老库三条 NOT NULL 与卡面「选填」的冲突:9 张卡怎么落 #818 双向链接;若维护者要求硬挂,再做地图记账(票号映射、计划表、阻塞边)。
进度:100%
下一步:本票已关(执行完毕,15 条 CLI 判据全绿);「rating 传空串走成 exit 2」的缺陷已在本票内修掉,证据件见 docs/skills/skill-chef/t853-写侧缺值验收.md。
Metadata
Metadata
Assignees
Labels
ready-for-agentFully specified, ready for an AFK agent
Activity
FeatherHunter commentedon Sep 22, 2026
解决评论:执行完毕,判据全绿
交付物(提交
9706382c):验收器械docs/skills/skill-chef/t853-验收.mjs(213 行)+ 执行与验收记录docs/skills/skill-chef/t853-写侧缺值验收.md(85 行)+ 源码修复packages/skill-chef/src/history/run-record.ts。一行真跑
缝只取一个最高缝:CLI 唯一出口(参数 + JSON + 退出码),照本票
## Testing Decisions的字面要求。反例在副本库上跑(真库全程只读:跑前跑后字节 294912/294912、mtime 与 sha256 逐次一致),写后按行数判「有没有留下半条脏数据」。读数
exit 4+ 消息点名quantity/duration_minutes/rating+ 读回无新增:op=add内嵌食材只给「适量」文字 ⇒ 4;JSON 导入空串 ⇒ 4;改用量给「适量」⇒ 4;单味追加只给名 ⇒ 4。op=add内嵌步骤不给时长 ⇒ 4;导入给null⇒ 4;单步追加不给时长 ⇒ 4。rating⇒ 4;空串 ⇒ 4。op=add数字+文字两样都给 ⇒ 0;记做菜给 4 分 ⇒ 0;改用量 6 克并同时改文字 ⇒ 0;给 0 分 ⇒ 0(0 是合法评分)。读回「盐」的quantity=6 unit=克 quantity_text=少许约6g——数字是用户给的估计数、文字是用户原话,两者都在。node --test packages/skill-chef/test/*.test.mjs133 过 0 败;pnpm gen:check6/6 绿(生成物零漂移)。本轮修掉的缺陷
chef.history.record的rating传空串 ⇒exit 2「缺槽位」,而同一个场景整个不传 ⇒exit 4点名rating——同一件事两个定义地,且空串那条不符合本票对外契约(缺评分属取数失败档)。根因是顶层runHistoryRecord把空串喂给了只认数字的口径校验,而数据层recordHistory本来就认空串为缺值。改法:两处把空串/纯空白按「没给」归一。变异自证(改坏必须变红、改回必须变绿):
本票范围外(照票面不动)
NULL≠0,让「未评分」与「0 分」可区分):## Out of Scope第一条,随远期 schema 票。src/help/sceneData.ts:122):818 定案明令本次不改,本票照此执行。但请维护者看一眼:卡面写「选填」而实际行为必填,这是用户侧能感觉到的文案与行为不一致;改它要动生成物与其生成器,属产品决策,本票不擅自改。src/add/pages.ts:404-423的失败回执(renderErrorReceipt四段+建议下一步)与docs/skills/skill-chef/t774-run-update.mjs:611-616的缺值探针(已声明「改食材无补丁 exit 2/加步骤缺时长 exit 4/关联步骤 exit 2,无半条」)。遗留(有读数,未开票)
recordHistory里「非数字串」那一支现在是死路:CLI 唯一入口runHistoryRecord在顶层就拦下了。本轮已把它并进「缺评分」一档(少一个定义地),但不可达的那行仍留着。属清理,不属本票。3在本包被CHEF_HISTORY_CORRUPT/CHEF_RECIPE_CORRUPT/CHEF_DB_UNREADABLE复用,而src/cli/cmd_read.ts:3头注写的是「3 key」——既有偏离,与本票正交。两条都指得出读数、但都不是本票的验收面,按开票三问先记文档不占票;谁要认领就回写这里。
FeatherHunter commentedon Sep 22, 2026
执行完毕,判据全绿(15/15),证据见上一条解决评论与 docs/skills/skill-chef/t853-写侧缺值验收.md。
私家大厨#853:写侧缺值验收器械+修空串评分走错错误档
私家大厨#853:验收记录用词改用规范词(落地→执行)
#765 收口记账:#853 认领为票 23(票面豁免照 #854 先例)+票 24=#914 入账;调查报告入仓(23→33 张卡改正、…