dsh-canteen-retention-check — Canteen retention check
English · 简体中文 · Español · Português · हिन्दी
dsh-canteen-retention-check checks a canteen food-retention ledger for the four record elements the regulation requires (dish name, weight, time, person), the 125-gram minimum, the 48-hour cold-storage window, and template placeholders left in a cell.
It checks the ledger, not the kitchen. A missing row means the ledger cannot prove a sample was taken; it does not mean no sample was taken.
Install
dsh plugin --profile <name> add dsh-canteen-retention-check
dsh --profile <name> --dump-config | grep 'dsh-canteen-retention-check'
What it looks like
Workflow overview: document → rule pack → findings.
Boundary: this only checks the ledger's own completeness and internal time consistency. It does not judge whether a retained sample would satisfy an inspection, whether the food was safe, or what happened in the kitchen. A blank cell is reported as "the ledger does not record it", not as "it did not happen" — the two are different claims and only the first is supportable from a document.
What it answers
- Does every row name the dish, the weight, the time and the person?
- Is each weight at least 125 grams?
- Is the retention time recorded to the minute, and not in the future?
- Was the sample kept at least 48 hours before release?
- Does any cell still hold template text such as
XXXor待填?
Standards it follows
The pack quotes 《学校食品安全与营养健康管理规定》(教育部 国家市场监督管理总局 国家卫生健康委员会令第45号) 第四十条 verbatim:
中小学、幼儿园食堂应当对每餐次加工制作的每种食品成品进行留样,每个品种留样量应当满足检验需要,不得少于125克,并记录留样食品名称、留样量、留样时间、留样人员等。
That single clause supplies the four elements and the 125-gram floor, which is why the pack marks those checks direct and caps them at error. The 48-hour window is checked as a day gap and is labelled as such, not as a quotation of a clause it does not appear in.
Compatibility
| Surface | Status |
|---|---|
| Harness | peer range >=0.1.2-rc.1 <0.2.0 || >=0.2.0-0 <0.3.0 |
| Node | `^22.19.0 |
| Platforms | all (pure ESM; no native code, no network, no model call) |
What it does
Nine rules, all single-table checks over the ledger:
| Rule | Check |
|---|---|
| CF-001 | Dish name present |
| CF-002 | Weight ≥ 125 g |
| CF-003 | Sample time present |
| CF-004 | Sample person present |
| CF-005 | Sample time written to the minute |
| CF-006 | Release at least 2 days after sampling |
| CF-007 | Meal present |
| CF-008 | No template placeholder in the dish name |
| CF-009 | Sample time not in the future |
A column that is absent from the ledger entirely is reported as "not applicable" rather than as a violation of every row: a sheet without a 留样量 column is a shape problem, and saying "every row is wrong" would bury it.
Configuration
| Key | Default | Meaning |
|---|---|---|
rulesFile |
rules/canteen-retention-check.yaml |
规则库路径 |
Material format
One row per retained sample:
| Column | Meaning |
|---|---|
餐次 |
Meal: 早餐 / 午餐 / 晚餐 |
留样食品名称 |
Dish name |
留样量 |
Weight in grams |
留样时间 |
Sampling time, YYYY-MM-DD HH:MM |
出柜时间 |
Release time, same format |
留样人员 |
Person who retained the sample |
Column aliases are declared in src/model.ts, so 品名, 留样重量, 留样人 and English names also resolve.
Rule sources
Quotations live in rules/evidence/clause-verification-school-food-safety.md and in the pack itself; check:citations verifies each appears verbatim.
Known limit: the 48-hour window is compared as whole days (dateGap, minDays: 2), so a sample released at 47 hours on the second day is not distinguished from one released at 49 hours. Tightening that needs an hour-level check, which the current engine kind does not provide.
Troubleshooting
- The plugin installs but the tool never appears: check that
mainresolves tolib/index.mjsand thatpnpm run buildproduced it. dsh plugin addrejects the package: the peer range covers0.1.xand0.2.x; outside it, grant an explicit exemption.- A rule did not run: read the
skippedarray.
Development
pnpm install
pnpm run typecheck
pnpm test
pnpm run build
node ../scripts/sync-shared.mjs dsh-canteen-retention-check
PerryLink DSH Plugin Family
This project is part of the DeepSeek Harness plugin family from PerryLink. The roster stays collapsed below so every README keeps a short first screen; expand it to see every row and its status.
Expand all pluginsLicense
Apache License 2.0 © 2026 dsh-canteen-retention-check contributors.
No comments yet. Be the first to write one.