GAIMA POS 全局项目控制台 / 2026-05-26
单店 POS 可用系统进度看板
本页必须始终展示整个 POS 系统的进度,而不是只展示最新 QR 或单一模块。当前产品目标是让单店员工和客人真实完成点单、厨房出单、付款关单、QR 下单和运营恢复;每轮开发都要推进这个闭环,并把需要用户确认的事项放在这里。
单店闭环主线
后台资料、前台点单、local-service/SQLite、打印队列、付款关单和 QR 下单必须继续在同一张系统图里推进。
本轮真实推进
Admin Print Queue 现在有可重复 seeded browser QA,覆盖 7 个筛选、request_reprint 确认取消/接受,以及既有 localStorage 队列事实。
当前仍不是 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 与 customer-copy 下一步说明。 | 仍是 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 打印与厨房票 | 队列可人工闭环,硬件待确认 | 86% |
PrintJob queue、status machine、routing、worker、retry/backoff、stuck recovery、adapter registry、后台队列页、手动 `mark_printing` claim、员工 overview 只读队列压力提示、后台恢复分诊、恢复 timing/detail copy、Admin Print Queue 筛选/动作确认、seeded browser QA,以及 POS bill/customer-copy 预览用途说明已完成。 | 真实 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,并提示需要收据时使用 `Close + customer copy`。 | split bill、历史 settlement/refund 细节、Square/Clover/Stripe provider adapter、QR checkout/payment 仍是后续模块;customer copy 文案不是第二次付款、不是支付 provider。 |
| 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 开发节奏 | 已建立控制面 | 99% |
Spec/plan/TDD、controller-agent、subagent 并行、每功能独立 commit、`npm run dashboard:check` 已写入。本轮按 docs plan、RED/GREEN、Admin Print Queue seeded action-confirm QA、聚焦回归、dashboard docs 拆分,并新增 `npm run qa:admin-print-queue`。 | dashboard 每次必须保留全局模块表;`dashboard:check` 失败时先修复全局模块表再继续。 |
最新切片快照:Admin Print Queue seeded action-confirm QA polish
Seeded Browser QA
- `packages/pos-ui/scripts/qa-admin-print-queue.mjs` 通过既有 `gaima-pos-print-jobs-v1:loc-scarborough` localStorage payload 写入 failed、stuck printing、due reprint、due pending、future pending、printed、cancelled 七类代表性票据。
- `npm run qa:admin-print-queue -w @gaima-pos/pos-ui` 会重新载入 POS UI、登录 Admin、进入 Print Queue,并验证 7 个筛选 chip、默认 Needs attention、All/Claimable/Failed/Resolved 计数。
- 脚本只走生产 Admin UI 和既有浏览器存储事实,不新增 app-only QA 控件,也不把测试数据变成运行时依赖。
Action Confirm Coverage
- QA 现在覆盖 `request_reprint` 确认文案、取消后不改变 `qa-failed`、接受后把 `qa-failed` 持久化为 `reprint_requested`。
- 已记录当前 timing nuance:接受 reprint 会写入新的 `printAt`,所以刚接受时不会立刻进入 Claimable,直到 Admin 时钟追上新的打印时间。
- 仍不改变 `getAdminPrintQueueActions()`、`applyAdminPrintQueueAction()`、`PrintQueueCommandRuntime`、worker/retry 语义、POS overview action surface、真实硬件打印或 SQLite schema。
边界与工作流
- 本轮是 Admin Print Queue seeded browser QA polish,不是自动 stuck recovery 执行、不是 worker lease、不是 push/WebSocket、不是真实打印传输。
- controller 负责 worktree、spec/plan、RED/GREEN、聚焦回归、handoff docs、dashboard 更新和独立提交。
- 下一轮默认转向更窄的 POS receipt preview/customer-copy tab polish;Admin Print Queue seeded-row/action-confirm QA 已覆盖。
本轮验证矩阵
已完成聚焦验证
- RED `npm run qa:admin-print-queue -w @gaima-pos/pos-ui` 先失败于缺少脚本。
- GREEN `npm run qa:admin-print-queue -w @gaima-pos/pos-ui` 在本地 Vite `http://127.0.0.1:5210/` 通过,覆盖 seeded rows、筛选、确认取消/接受、persisted `reprint_requested`、无 console error、无桌面横向溢出。
- `npm test -w @gaima-pos/pos-ui -- adminPrintQueue staffPrintQueueAttention printQueueCommandRuntime` 通过,共 20 tests。
- `npm run typecheck -w @gaima-pos/pos-ui` 通过。
- Docs plan commit `200d0d1 docs: add admin print queue seeded qa plan` 与 feature commit `e857206 test: add admin print queue seeded browser qa` 后 `git status --short` 均为 clean。
- Feature commit 后继续刷新 handoff docs 与 dashboard。
浏览器与截图
- QA screenshot 保存到 `C:\Users\ROG\AppData\Local\Temp\gaima-pos-qa\admin-print-queue-seeded-action-confirm.png`。
- Print Queue tab 渲染 7 个 filter chips:All、Needs attention、Failed、Stuck、Claimable、Active、Resolved。
- 脚本验证取消确认不会写入 reprint;接受确认后 localStorage 中 `qa-failed` 为 `reprint_requested`。
- Claimable 即时计数保持 2 是当前时钟/`printAt` 语义,不是新的恢复规则。
交接门禁
- Full `npm test`、`npm run typecheck`、`npm run build`、`npm run db:validate` 在收口阶段通过。
- `npm run dashboard:check` 通过;本 dashboard 通过 desktop 1280x720 与 mobile 390x844 render QA:10-row global module table、seeded QA spotlight、commits、bottom prompt 可达,无 authored sticky/fixed CSS、无 document horizontal overflow。
- `git diff --check` 通过,仅有预期 Windows LF/CRLF working-copy warnings;既有 Cloudflare Pages dashboard `https://gaima-pos-dashboard.pages.dev/` 已同步并通过 HTTP/content check,未改变 hosting 架构。
- Node SQLite experimental warning 与 Vite large chunk warning 仍为既有噪音。
并行执行与确认队列
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 完全一致。
近期主线
| 提交 / 模块 | 意义 |
|---|---|
| `e857206 test: add admin print queue seeded browser qa` | 新增 `npm run qa:admin-print-queue -w @gaima-pos/pos-ui`,用 seeded PrintJob rows 覆盖 Admin Print Queue 筛选和 `request_reprint` 确认取消/接受路径。 |
| `200d0d1 docs: add admin print queue seeded qa plan` | 记录 2026-05-26 Admin Print Queue seeded action-confirm QA 窄切片范围,明确不做硬件打印、自动恢复执行、worker lease、push、POS overview action 或 DB schema。 |
| `cce302d feat: clarify admin print queue filters and actions` | Admin Print Queue 现在显示 All / Needs attention / Failed / Stuck / Claimable / Active / Resolved 筛选,并在执行既有队列动作前显示确认说明。 |
| `9a1eec9 docs: add admin print queue filter action plan` | 记录 2026-05-26 Admin Print Queue filter/action-confirm polish 窄切片范围,明确不做硬件打印、自动恢复执行、worker lease、push 或 DB schema。 |
| `cb87d79 feat: clarify paid bill customer copy wording` | POS ready-to-close guidance 与 PrintDrawer bill/customer-copy guidance 现在说明 `Close + customer copy` 是客人收据路径,不记录第二次付款。 |
| `ddd048b docs: add paid bill customer copy wording plan` | 记录 2026-05-26 POS paid bill/customer copy wording polish 窄切片范围,明确不做 payment provider、QR checkout/payment、split bill、硬件打印、push 或 DB schema。 |
| `88df871 feat: clarify admin print queue recovery timing` | 后台 Print Queue 恢复提示列现在显示失败原因、尝试次数、卡住时长、等待/逾期时间和稍后处理时间,不改变任何队列 action 或 worker 语义。 |
| `aeaffd6 docs: add admin print queue recovery timing plan` | 记录 2026-05-26 Admin Print Queue recovery timing polish 窄切片范围,明确不做真实硬件打印、自动恢复执行、worker lease、push 或 DB schema。 |
| `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。 |