GAIMA POS 全局项目控制台 / 2026-05-26
单店 POS 可用系统进度看板
本页必须始终展示整个 POS 系统的进度,而不是只展示最新 QR 或单一模块。当前产品目标是让单店员工和客人真实完成点单、厨房出单、付款关单、QR 下单和运营恢复;每轮开发都要推进这个闭环,并把需要用户确认的事项放在这里。
单店闭环主线
后台资料、前台点单、local-service/SQLite、打印队列、付款关单和 QR 下单必须继续在同一张系统图里推进。
本轮真实推进
Payment Drawer 现在用同一套 lifecycle/money 事实说明下一步:未付款提示 collect balance,全额付款后提示 Ready to close,现有 Close 行为不变。
当前仍不是 push
桌台和员工活动仍是 polling/read refresh 加本地投影,不是 WebSocket/subscription。不要在交付说明里误称实时推送。
待用户确认
真 push/WebSocket、QR checkout/payment、真实硬件打印、支付 provider、平台 adapter、hosting 架构变化仍需要确认。
全局 POS 模块进度
| 模块 | 状态 | 进度 | 说明 | 风险边界 |
|---|---|---|---|---|
| Local Runtime / DB 本地运行与 SQLite | 当前主线 | 96% |
SQLite schema/repository、command log、sessions/locks、long-lived runtime、transport/API、HTTP harness、async POS sender、`order.get_current_table` 与 QR token metadata read transport 已落地。 | catalog 仍有 in-memory delegate;生产 SQLite packaging、Electron/Docker driver policy 仍需确认;UI/QR/iPad 不得直接写 DB。 |
| POS Order Entry 前台点单 | 稳定推进 | 98% |
plain item、modifier/combo、line facts、confirm/print、payment/discount/Close 多条路径已接 local-service async opt-in;打开桌台可恢复 service 当前未付款订单;当前订单栏有 lifecycle readiness、action guards,Payment Drawer 现在显示 read-only payment/close guidance。 | 仍是 polling/read refresh,不是真 push/WebSocket;readiness/action guards/guidance 只是可见投影和按钮/文案 polish,不是新的订单写命令、payment provider、split bill 或 checkout。 |
| Admin/Catalog 后台资料源 | 主边界已建立 | 79% |
AdminData -> StoreData、catalog、modifier、combo、库存、printer settings、桌台 QR admin 都有结构化边界;后台产品详情可预览 QR 图片/占位图。 | 还需要版本发布语义、真实图片资产管理/上传、catalog 持久化收口;`drive:*` 仍不是可渲染 QR 图片源。 |
| Printing Queue / Kitchen 打印与厨房票 | 队列可人工闭环,硬件待确认 | 82% |
PrintJob queue、status machine、routing、worker、retry/backoff、stuck recovery、adapter registry、后台队列页、手动 `mark_printing` claim、员工 overview 只读队列压力提示,以及后台恢复分诊/提示列已完成。 | 真实 LAN ESC/POS、Windows printer、USB ESC/POS transport、自动 stuck recovery 执行和多 worker lease 仍需用户确认后单独做。 |
| Payments / Close 支付与关单 | 本地语义可用 | 69% |
payment rows、Paid/Balance、manager discount、positive balance block Close、explicit Close 已落地并可 async opt-in;Payment Drawer 会说明 collect balance、collect remaining、ready to close 或 already closed。 | split bill、历史 settlement/refund 细节、Square/Clover/Stripe provider adapter、QR checkout/payment 仍是后续模块。 |
| QR Ordering / Admin 扫码点单与桌台 QR | 近期活跃 | 90% |
QR entry/cart、partial acceptance、modifier/combo options、image-first cards、admin asset preview、table placards、registry validation、print/export、signed-token hardening、durable metadata、rotation preview、只读 metadata adapter、桌台上下文 summary 已完成。 | 还需要真实菜单图片资产管线、顾客 UX 店内 QA、checkout/payment 决策;不存 secret、不写 rotation、不引入默认 signing key。 |
| Online / Platform Orders 平台订单 | 后续阶段 | 15% |
source/channel、price level、future adapter/inbox 方向已确认;本轮 Pickup Queue 可显示 active unpaid kanban order pressure,但不是平台 adapter。 | Uber/DoorDash/Fantuan adapter 不得直接写 SQLite;单店闭环稳定前不要扩大到真实平台接入。 |
| Multi-store Publishing 多店发布 | 后续阶段 | 22% |
master data / store-local DB 边界已确认,发布到门店的概念入口存在。 | publish/version、差异对比、审批语义未做;多店发布不能主导单店订单生命周期。 |
| Production / Ops 生产化与部署 | 待生产策略 | 38% |
开发 harness、Cloudflare dashboard、Docker/SQLite volume 兼容方向已确认。 | Electron/Docker packaging、service hosting shape、public deployment/hosting architecture 变化需要用户确认。 |
| Workflow / QA 开发节奏 | 已建立控制面 | 98% |
Spec/plan/TDD、controller-agent、subagent 并行、每功能独立 commit、`npm run dashboard:check` 已写入。本轮按 docs plan、RED/GREEN、POS UI payment/close wording polish、浏览器 QA、dashboard docs 拆分。 | dashboard 每次必须保留全局模块表;`dashboard:check` 失败时先修复全局模块表再继续。 |
最新切片快照:POS payment/close wording polish
Payment/Close Guidance
- `buildOrderLifecycleReadiness()` 继续从现有 `OrderDraft` 派生 lifecycle、actions 和 money facts,并新增只读 `paymentCloseGuidance`。
- Guidance 覆盖 empty、collect balance、collect remaining、ready to close、already closed 五类 staff copy。
- 金额仍复用现有 total/paid/balance helper 与 `formatMoney()`,没有在 React 里复制付款计算。
Payment Drawer Copy
- Payment Drawer 在 Total/Paid/Balance 附近显示下一步文案,例如 `Collect $15.81 before closing`。
- 记录全额付款后,同一 drawer 显示 `Ready to close`,并沿用既有 Close / Close + customer copy enablement。
- 现有 payment rows、manager discount、Close handler、customer-copy handler 和 action guard 状态保持不变。
边界与工作流
- 本轮只是 payment/close 文案 polish,不做 provider、QR checkout/payment、split bill、refund/settlement、硬件打印、push 或 SQLite schema。
- controller 负责 worktree、plan、TDD、实现、浏览器验证、独立 commit、handoff docs 和 dashboard 更新。
- 下一轮可以转向 Staff/Admin print queue recovery polish,或继续一个更窄的 paid-bill/customer-copy wording polish。
本轮验证矩阵
已完成聚焦验证
- RED `npm test -w @gaima-pos/pos-ui -- orderLifecycleReadiness` 先失败于缺少 `paymentCloseGuidance`。
- GREEN `npm test -w @gaima-pos/pos-ui -- orderLifecycleReadiness` 通过,共 10 tests。
- `npm test -w @gaima-pos/pos-ui -- orderLifecycleReadiness orderState visiblePosAsyncPaymentCloseFlow visiblePosAsyncConfirmPrintFlow` 通过,共 36 tests。
- `npm run typecheck -w @gaima-pos/pos-ui`。
- `git diff --check` 通过,仅有预期 Windows LF/CRLF working-copy warnings。
- Feature commit 后继续刷新 handoff docs 与 dashboard。
浏览器验证
- 浏览器 QA:本地 Vite `http://127.0.0.1:5207`,登录 POS -> Dine In -> 进入既有桌台订单 -> Payment Drawer。
- positive balance 时显示 `Collect $15.81 before closing`,Close disabled;记录全额付款后显示 `Ready to close`,Close 与 Close + customer copy enabled。
- 桌面 viewport 无 console warning/error、无 document horizontal overflow。
- In-app Browser screenshot capture 在 CDP `Page.captureScreenshot` 命令处 timeout,因此本切片没有截图证据。
最终门禁已通过
- Full `npm test` 通过:core 42、local-service 208、pos-ui 286、sample-data 51。
- `npm run typecheck`、`npm run build`、`npm run db:validate`、`npm run dashboard:check` 均通过。
- `git diff --check` 通过,仅有预期 Windows LF/CRLF working-copy warnings;Node SQLite experimental warning 与 Vite large chunk warning 仍为既有噪音。
- 本 dashboard 通过 desktop 1280x720 与 mobile 390x844 render QA,无 console warning/error、无 authored sticky/fixed CSS、无 document horizontal overflow。
- 本地 dashboard HTTP `http://127.0.0.1:4341/docs/project-overview-infographic.html` 已确认 spotlight、commits、10-row global table 和 bottom prompt;Cloudflare Pages `https://gaima-pos-dashboard.pages.dev/` 已同步并通过 HTTP/content check,未改变 hosting 架构。
并行执行与确认队列
Controller 负责
- 先把一个产品主题拆成 2-4 个可验证 feature slice。
- 给 subagent 自包含 prompt:范围、文件归属、测试命令、禁止事项、输出格式。
- 逐个整合已验收 feature,复核 diff,跑 targeted verification,再单独 commit。
Subagent 可并行
- 适合 read-only audit、review、verification,或文件范围不重叠的实现任务。
- 不得并行改 shared handoff docs、dashboard、同一源码文件或同一生成产物。
- 不得回滚别人或用户的改动;遇到重叠范围要向 controller 汇报。
需要用户确认
- 公开部署/托管架构变化、支付或硬件供应商、生产 key policy。
- 平台 adapter、AI provider/model、cloud sync、WebSocket push、outbox replay。
- QR checkout/payment、图片上传/存储管线、任何越过当前 local-service/QR/table 主题的范围扩大。
架构护栏
local-service owns durable writes
SQLite 与 repository 写入仍属于 computer-side local-service。POS UI 只消费浏览器安全 helper、类型和明确 adapter,不直接触碰 DB。
活动流不是最终 origin schema
QR signal 仍使用现有 `qr-` line id convention。未来如果要审计、报表或支付归因,需要专门设计 line-origin metadata。
不是实时 push
员工 iPad/桌台图当前是 local-service read refresh 加本地投影。真 push/WebSocket 需要单独设计 transport、断线恢复、重复事件和 UI 状态。
commit 与 dashboard 纪律
每个通过验证的独立功能必须单独 commit,commit 后 worktree 必须干净。每次 feature commit、handoff 或 prompt 更新都同步本 HTML;停止前必须同步既有 Cloudflare Pages dashboard。
全局模块表不可删除
dashboard 是整个 POS 系统控制面。最新 feature 只能更新对应模块行和 spotlight 区域,不能把全局 POS 进度替换成单一模块视图。
最终回复必须带 prompt
每次停下来或最终交接,都要附上可复制的下一轮中文 prompt,并保持它与 `NEXT_AGENT.md` 和本 dashboard 底部 prompt 完全一致。
近期主线
| 提交 / 模块 | 意义 |
|---|---|
| `d3c0a65 feat: add payment close guidance` | Payment Drawer 现在从 `buildOrderLifecycleReadiness().paymentCloseGuidance` 显示 collect balance、collect remaining、ready to close、already closed 等员工下一步文案。 |
| `6ac668b docs: add payment close wording plan` | 记录 2026-05-26 POS payment/close wording polish 窄切片范围,明确不做 provider、QR checkout/payment、split bill、refund/settlement、硬件、push 或 DB schema。 |
| `cfa05a5 feat: add pos lifecycle action guards` | POS lifecycle readiness 现在返回只读 confirm/payment/close guard,OperationRail 和 PaymentDrawer 会禁用当前生命周期下不可用的动作。 |
| `ba646dc docs: add pos lifecycle action guard plan` | 记录 2026-05-26 POS Order Entry 窄切片范围,明确 action guards 只是按钮 polish,不是新订单命令、支付 provider、硬件、push 或 DB schema。 |
| `29c53d1 feat: add pos order lifecycle readiness` | 当前订单栏显示只读 lifecycle readiness,把 existing `OrderDraft` 阶段、下一步和 Total/Paid/Balance 聚合到员工视野。 |
| `f33e6c0 docs: add pos order lifecycle readiness plan` | 记录 2026-05-26 POS Order Entry 窄切片范围,明确不做支付 provider、QR checkout/payment、split bill、硬件、push 或 DB schema。 |
| `bc9b380 feat: add print queue recovery triage` | 后台 Print Queue 增加恢复分诊,把 failed、stuck printing、due reprint、due pending 排到前面,并显示恢复摘要和只读恢复提示列。 |
| `3903d93 feat: surface print queue attention` | 员工 POS overview 的 Table Activity 与 Pickup Queue 侧栏显示只读 Print Queue attention,让失败、重印、到期待打和打印中票据进入运营视野。 |
| `7062dba feat: add staff print queue attention` | 新增 domain projection,把现有 `PrintJob[]` 转成 staff-facing summary 和 priority rows,不改变打印队列状态机。 |
| `9e15655 docs: add staff print queue attention plan` | 记录本轮 controller-agent/TDD 批次边界,明确不做硬件打印、队列 action surface 或真 push。 |
| `ab3a7af feat: surface staff activity and pickup queue` | 员工 POS overview 显示 Table Activity 和 Pickup Queue,工作人员可以从概览直接进入桌台或订单。 |
| `b8cfac5 fix: show local table drafts in staff activity` | 服务端 feed 未加载时,本地未结桌台草稿仍会出现在员工活动流,避免面板误显空白。 |
| `ad39751 feat: add takeout order queue projection` | 为 active unpaid pickup/takeout orders 提供 UI-ready queue rows 和 overdue/due-soon/ready/waiting 汇总。 |
| `b948b46 feat: add staff order activity feed` | 建立员工活动流 domain 边界,覆盖 QR table、service table、sync failed 和 local table draft。 |
| `05084f9 docs: add staff activity takeout batch plan` | 记录本轮平衡并行批次,继续要求 TDD、功能独立提交和全局 POS dashboard。 |
| `b82cc43 feat: flag qr orders in staff table feed` | 员工桌台 feed 能标出 QR-origin line count 和 staff alert。 |
| `176692d test: guard global dashboard module map` | 新增 `npm run dashboard:check`,把全局 POS 模块表从文档约定升级为可校验 guard。 |