The same kernel that runs the carbon ledger now runs lots: green coffee leaves FIFO, roasted coffee leaves FEFO, an expired or quarantined lot can never be picked, and every quantity change passes plan → critic → dry-run → a second person → execute → verify, with each step hashed into a chain. 同一个内核跑第二个垂直域:绿咖啡 FIFO、熟豆 FEFO,过期与隔离批次永不被选中; 每次改数量都要过计划 → Critic → dry-run → 第二个人 → 执行 → 核验,每一步都进哈希链。
submit ──► awaiting_approval ──approve──► done ──verify──► reflect
│ │
│ └──reject──► rejected
└─critic fails──► blocked (no movement, ever)
plan.created → critic.evaluated → dryrun.computed
→ approval.requested ─► approval.granted | rejected
→ executed ─► verified (+ four_eyes.waived on --force)
Pure functions of the store: allocation order, quantities, shortfall, excluded lots.
计划是数据库的纯函数:分配顺序、数量、缺口、被排除的批次都能重放。Deterministic checks: SKU exists, unit is kg, stock suffices, lots are released and not expired.
确定性校验:SKU、单位、库存、批次状态、赏味期,逐条给理由。The requester cannot approve. A forced approval is written into the hash chain, not hidden.
申请人不能批准;强行批准会写进哈希链,不会消失。| lot | sku | kg | store | status | best before | d→BB | gate |
|---|---|---|---|---|---|---|---|
| L-BR-2611 | G-BR | 940.0 | WH-G | released | 2027-10-28 | 340 | pickable |
| L-CO-2612 | G-CO | 300.0 | WH-Q | quarantine | 2027-11-14 | 357 | status=quarantine |
| L-ET-2605 | G-ET | 680.0 | WH-G | released | 2027-07-25 | 245 | pickable |
| L-YN-2608 | G-YN | 520.0 | WH-G | released | 2027-09-23 | 305 | pickable |
| L-R-B | R-ESP | 30.0 | WH-R | released | 2026-12-10 | 18 | pickable |
| L-R-E | R-ESP | 55.0 | WH-Q | quarantine | 2026-12-14 | 22 | status=quarantine |
| L-R-A | R-ESP | 42.0 | WH-R | released | 2026-12-19 | 27 | pickable |
| L-R-D | R-V60 | 9.0 | WH-R | released | 2026-11-19 | -3 | best_before passed |
| L-R-C | R-V60 | 18.0 | WH-R | released | 2026-11-28 | 6 | pickable |
| task | stage | kind | by | critic | chain |
|---|---|---|---|---|---|
| R-V60 出库 6.0 kg(FEFO) | done | outbound | panel:erik | 8/8 pass | 7 rows |
| WH-R 环境超限:隔离 4 个批次 | awaiting_approval | env | wh.scan | 2/2 pass | 3 rows |
| 补货建议 1 个 SKU | awaiting_approval | purchase | panel:erik | 0/0 pass | 2 rows |
| at | task | step | actor | hash |
|---|---|---|---|---|
| 2026-11-22T15:08 | wht_e746d864b44d | approval.requested | supervisor | 206e9a183b8bf9… |
| 2026-11-22T15:08 | wht_e746d864b44d | plan.created | panel:erik | 2f68e6839b01bc… |
| 2026-11-22T15:08 | wht_d3f35a0d0339 | approval.requested | supervisor | e0890eb61c0d08… |
| 2026-11-22T15:08 | wht_d3f35a0d0339 | critic.evaluated | critic | 1323b56d678c9f… |
| 2026-11-22T15:08 | wht_d3f35a0d0339 | plan.created | wh.scan | 0b5da5a3686215… |
| 2026-11-22T15:08 | wht_bb7da9551b0c | verified | verifier | 29fb4bf5b9ece7… |
| 2026-11-22T15:08 | wht_bb7da9551b0c | executed | panel:approver | fcba9b370072ce… |
| 2026-11-22T15:08 | wht_bb7da9551b0c | approval.granted | panel:approver | d8301c2d320926… |
Each row hashes prev_hash + {task, step, actor, data}. Editing one row breaks every later
row; /wh verify <task> recomputes the chain.
每行哈希覆盖前一行哈希与本次内容;改一行,后面全断。
Feishu is where people already are. The agent is where the rules and the proof live. Each side keeps what it is good at: 飞书负责"人已经在的地方",Agent 负责"规则和证据"。各做各自最强的部分。
| job to be done | Feishu does | this agent does | shared seam |
|---|---|---|---|
| alert someone, now | group bot + interactive card: 批准 / 驳回 buttons | raises the alert, files the approval task, keeps the dry-run | a button click re-enters approve() — same four eyes, same chain |
| ask a question in chat | message + @bot | /wh stock, /wh lot L-ET-2605, /wh env | answers in the same thread the question came from |
| collect field data | Bitable: forms, views, offline entry | consumes records as inbound drafts; master quantity stays in wh_move | no double write: Bitable is intake, the ledger is truth |
| assign the follow-up | Task: owner, due date, reminders | creates the task with impact scope (which lots, how many kg) | task id stored on the warehouse task |
| schedule arrival / stocktake | Calendar | proposes the window after approval | one event per approved inbound or stocktake |
| write the post-mortem | Docs / Wiki | replays the audit chain for the incident | agent drafts, a person edits and owns it |
| prove who changed a quantity | weak point: the sheet says 42, nobody knows who typed it | strong point: move ledger + hash chain + four eyes | Feishu shows the decision, the agent shows the evidence |
/wh overview: stock, approvals, alerts, consistency /wh stock [green|roast] lots that can leave today /wh lot L-ET-2605 one lot + its movements /wh out R-V60 20 fefo plan → critic → card → approval /wh in G-ET 300 WH-G 11.2 inbound with moisture /wh approve wht_xxx four eyes; --force is chained /wh scan | /wh expire environment / shelf-life sweeps /wh stocktake L-ET-2605 671.5 count diff → approval /wh buy replenishment drafts /wh verify wht_xxx recompute the hash chain /wh consistency lot cache vs move ledger
wh_lot.qty_kg must equal the sum of wh_move deltas. · 批次缓存数量必须等于 move 账本之和。--force leaves a chain row. · 申请人不能批准自己的动作;--force 会在链上留一行。This is a local prototype: the kernel, panel and tests run on one machine against SQLite. The page you are reading is a capability statement plus a real snapshot — not an API. The warehouse kernel source is not public yet; the carbon half of the same kernel is public at github.com/erikcywong/shinae.work. 内核、面板与测试在本机跑;这一页是能力说明加真实快照,不是 API。 仓存内核源码暂未公开;同一内核的碳核证部分已公开。
Verification is a domain smoke test (allocation order, critic blocks, four eyes, idempotent movements, chain tamper) plus a headless render check of every panel view. 验证方式是领域测试(分配顺序、Critic 拦截、四眼、幂等、链篡改)+ 面板每个视图的无浏览器渲染检查。