From cc39e16ac12c963ab49641687e1888ec0a6978c4 Mon Sep 17 00:00:00 2001 From: abaishu0730 Date: Wed, 21 Oct 2026 16:32:58 +0800 Subject: [PATCH] docs: record Huizhou notification acceptance and local rollout --- docs/HANDOFF.md | 8 ++++ ...ou-notification-verification-2026-10-21.md | 48 +++++++++++++++++++ ...10-21-huizhou-notification-final-review.md | 25 ++++++++++ .../plans/2026-10-21-huizhou-notification.md | 38 +++++++-------- 4 files changed, 100 insertions(+), 19 deletions(-) create mode 100644 docs/huizhou-notification-verification-2026-10-21.md create mode 100644 docs/reviews/2026-10-21-huizhou-notification-final-review.md diff --git a/docs/HANDOFF.md b/docs/HANDOFF.md index 655853c..ddb7722 100644 --- a/docs/HANDOFF.md +++ b/docs/HANDOFF.md @@ -1,5 +1,13 @@ # 开发交接(2026-10-21) +## 惠州附加通知(最新状态) + +用户确认每条原分类增加惠州通知开关和惠州模板,原邮件照常,惠州明细额外汇总一封,沿用同一主送/抄送及PDF附件要求。本轮已实现模板模式隔离、逐明细识别、双路冻结/结果/补发/重启恢复、安全固定业务链接,以及规则/模板/订单/批次页面。旧规则默认关闭,旧订单/冻结批次不补发,不增加SPMS或BPM操作。最终代码2cf776d及前序提交均在本地codex/modular-refactor,未推送合并。 + +新鲜npm ci后最终完整720项:719通过、0失败、1可选ZCode CLI跳过;303个JS/CJS语法、9份文档53条本地链接、私有文件/凭据及差异检查通过。模块/页面/跨模块与修正复核门禁通过,两次在复审修正期间中断的完整日志保留,不作通过依据。详见[惠州验收](huizhou-notification-verification-2026-10-21.md)、[复审摘要](reviews/2026-10-21-huizhou-notification-final-review.md)、[设计](superpowers/specs/2026-10-21-huizhou-notification-design.md)。旧HTML模板若曾丢失href需重新导入,固定链接不使用模板变量。 + +原本机实例已停服备份并验证后按npm start恢复;16:23双端口就绪、16:25复核running与37项资源。原登录可用,实际规则开关默认关闭、模板使用情况两模式正常;原账号/密钥/31份样本及草稿/规则/订单/批次/邮件/BPM账号及主设置、配对键、PDF证据保持。enabled=false、processingEnabled=false、processingSince=null、version1;15类惠州均未开启。只读BPM会话/接口可用、推送已连接,原全局同步开启、5分钟;真实字段发布、邮箱与SMB等现场验收仍待完成。不发真实邮件、不办理BPM、不操作服务机。入口http://127.0.0.1:18766/#order-rules。备份路径和保留证据见本轮验收。 + ## 本轮一级导航去重(最新状态) 用户指出订单中心、邮件批次同时存在左侧入口和顶部页签,属于重复设计。已将两页作为独立一级页面,移除重复顶部页签及“返回订单通知管理”;通知配置统一归入业务设置,相关四个配置子页正确高亮业务设置。原hash、筛选/页码缓存、前后退与离页保护保留。 diff --git a/docs/huizhou-notification-verification-2026-10-21.md b/docs/huizhou-notification-verification-2026-10-21.md new file mode 100644 index 0000000..558292c --- /dev/null +++ b/docs/huizhou-notification-verification-2026-10-21.md @@ -0,0 +1,48 @@ +# 惠州附加通知验收 + +日期:2026-10-21(北京时间)。用户确认:每条原分类增加惠州通知开关,原邮件照常,惠州明细额外汇总一封,主送和抄送与原分类相同。开发及交付仅在本地 codex/modular-refactor 工作树。 + +## 交付行为 + +| 范围 | 结果 | +|---|---| +| 原15类规则 | 通知内容区增加“额外发送惠州通知”开关与惠州模板选择;旧规则默认关闭,不增加收件人或附件表单 | +| 模板 | 普通/惠州模式分别确认替换,选择器按模式过滤,现有有效使用情况显示两种已发布选择;只维护一处使用情况 | +| 识别 | 每条标题明细独立识别。已知惠州业务模式或已知客户证据可确认;HA前缀不足以确认。换行、HTML换行不改变明确明细归属;模糊边界使惠州分支待核验 | +| 汇总 | 按原类别、发送时段、通知模式冻结;惠州邮件主题/正文只取惠州明细,同原邮件使用相同冻结主送/抄送与附件要求;空集合不发 | +| PDF/归档 | 一个BPM事件仍只采集、导出和归档一次,两路共用原文件;PDF文件名仍按原表单主订单,不为惠州邮件改名或重复生成 | +| 恢复 | 两路预留、结果、unknown核验、重启和人工补发独立。原邮件已发/待核验不覆盖惠州状态,补发惠州不重发原邮件;来源冲突和归档校验失败仍阻止发送 | +| 历史 | 旧订单、旧冻结批次不追加惠州邮件,冻结正文/名单/附件不随配置修改而变化 | +| 页面 | 订单列表/详情分别显示通知结果,独立执行失败原因继续可见;批次显示通知模式并保留原恢复目标,沿用分页/权限/离页保护 | + +业务访问入口可在惠州模板中维护固定HTTP(S)链接。导入保留安全链接,拒绝危险协议、凭据、控制字符和动态href,远程图片与跟踪属性继续移除。主题和正文仍支持原模板变量。历史模板若在旧版导入时已丢失href,需要重新导入确认;不改写旧模板或已冻结邮件。不新增SPMS上传或BPM操作。 + +设计及任务见[设计](superpowers/specs/2026-10-21-huizhou-notification-design.md)、[实施计划](superpowers/plans/2026-10-21-huizhou-notification.md);操作见[分类规则指南](order-rules-guide.md)。 + +## 验证 + +新鲜 npm ci 使用原锁定依赖,未新增依赖。安装报告保留既有2项中危依赖审计项,未进行无关强制升级。 + +最终完整 npm test 在 fe5c231 上退出0:**720项,719通过、0失败、1项可选ZCode CLI集成跳过**,耗时737.7秒。该版本的最终业务代码为2cf776d;后续仅验收/交接文档更新,不再修改程序。 + +专项红绿证据覆盖模板模式迁移、失效/错误模式选择、Excel原子提交与幂等、混合标题、误判防护、双路冻结/补发/unknown/重启、共享归档损坏与修复、只读权限、保存失败、重复点击、离页保护及390px布局。原有生命周期、字段/邮件内容、存储/目录、来源授权和导航分页均在完整测试中通过。代码及最终修正复审通过,详见[复审记录](reviews/2026-10-21-huizhou-notification-final-review.md)。 + +303个跟踪JS/CJS文件语法通过;9份相关文档53条本地链接通过。提交范围未发现数据库、密钥、业务PDF、截图、邮件或表格等私有文件,疑似凭据及差异检查通过。 + +前两次完整测试在最终复审发现问题后主动中断,保留原日志,不作为全量通过依据。最终结果来自修正完成、复核通过后的独立完整运行。中间失败、修正及最终日志均保留在忽略目录 output/verification;关键证据为 huizhou-full-test.log、huizhou-full-test-result.json、huizhou-artifacts-result.json 及各 huizhou-task*/huizhou-final-* 红绿日志。隔离桌面与移动预览截图同目录保留,不含真实业务收件人。 + +代码提交依次包含 b673010、38fd3e9、d903252、d8aa14d、57adef1、90b7e50、80f9bde、d669a7b、2fe5a3f、2cf776d,均保留在本地分支,未推送或合并。 + +## 本机服务及数据 + +为避免旧后台与新页面混用,在页面接入前停止原本机测试服务。停服后完整备份并校验成功: + +`C:/Users/ABS/AppData/Local/OrderNotificationAutomationBackups/huizhou-notification-20261021-152907` + +备份9814文件、6,384,990字节、4个目录绑定vault,create/verify均退出0。测试前后及启动前核对原用户、受保护键、BPM托管账号、31份样本/31份字段草稿、适配/分类规则、订单、批次、主设置/发送计划、扩展配对键、PDF台账/文件及邮件记录摘要保持。旧邮件表只增加模式结构,旧记录内容保持。 + +完整验收通过后已按原方式 npm start 恢复,16:23左右双端口就绪,16:25复核服务running、37项页面资源可用且首页与交付文件一致。原浏览器管理员登录仍有效;实际规则页显示新增默认关闭开关,模板页显示两种通知的使用情况及15类惠州未开启。BPM连接页只读显示会话/订单接口可用、推送连接,原全局同步仍开启、5分钟;未点击连接检查、续登或业务执行按钮。 + +启动后的数据核对再次通过。配置保持 enabled=false、processingEnabled=false、processingSince=null、version=1;原PDF任务/文件均为0。证据见 output/huizhou-notification-after.json、output/huizhou-notification-extra-after.json、output/huizhou-notification-mail-after.json 及 output/verification/huizhou-backup-summary.json。 + +入口:http://127.0.0.1:18766/#order-rules 。本轮未实际启用惠州通知或发布分类,未开启自动处理/发信,未发送真实邮件、未办理BPM、未操作服务机。真实字段发布、邮箱、存储和自然到达仍按原现场验收条件处理,隔离通过不代表真实业务链已验收。 diff --git a/docs/reviews/2026-10-21-huizhou-notification-final-review.md b/docs/reviews/2026-10-21-huizhou-notification-final-review.md new file mode 100644 index 0000000..cd3fc95 --- /dev/null +++ b/docs/reviews/2026-10-21-huizhou-notification-final-review.md @@ -0,0 +1,25 @@ +# 惠州附加通知复审记录 + +审查范围为 fb6ccfa 起的本轮功能及最终修正。模块审查、页面审查、跨模块审查和修正复核均已完成;最终代码2cf776d复核通过,后续fe5c231仅补充固定链接说明。完整执行结果见[验收记录](../huizhou-notification-verification-2026-10-21.md)。 + +## 发现及关闭 + +| 发现 | 最终处理及证据 | +|---|---| +| Excel提交绕过有效模板校验 | 直接保存/发布/恢复与导入共用检查;全部候选先通过再写入,失败原子回滚,成功幂等重放保留。新增3项先红后绿及18项相关回归 | +| 旧权限快照省略规则列表时投影报错 | 仅在规则数组存在时补默认值,保留原归属过滤和安全投影;原隐私回归先红后绿,旧规则投影复验通过 | +| 惠州受阻时漏掉共享归档复核 | 尚未完成的惠州blocked也持续读回复核;普通已发/unknown、待办仍在/消失、无PDF附件四组合均验证损坏阻止准备、修复后独立发送,不再导出或重发普通邮件;8项相关回归 | +| 换行将惠州模式错误移给相邻订单 | 用本段摘要与明确前缀结构确定归属;格式变化不改变明确归属,模糊边界使惠州待核验。新增及相关11项、原匹配/正文20项通过 | +| 双路通知隐藏独立执行失败原因 | 列表同时保留执行错误、普通和惠州各自原因。真实临时实例的归档失败、修订冲突、裸任务及恢复目标2项通过 | +| HTML模板丢失业务访问链接 | 真实MIME解析至惠州渲染链路保留安全HTTP(S)锚点,移除危险协议、凭据、控制字符、跟踪属性和远程图片;链接及原邮件/CID/正文回归通过 | +| href变量在渲染后绕过地址校验 | 明确仅支持固定入口;导入解码后拒绝href内模板变量,主题/正文变量继续支持。实体、协议、主机、路径、查询及合法编码覆盖,最终相关39项通过 | + +模式SQL迁移保持原加密负载/版本,按邮箱、范围和模式独立替换;模板模式以SQL列为准。分类/时段/模式的批次边界、同源权限、冻结/发现屏障、共享回执、独立预留、unknown核验、根批次幂等及重启均已复审。旧记录不补发,已冻结不改写。 + +最终修正复核无未关闭阻塞项。复审人员只对明确疑点执行小型隔离复现,未将实施者日志标为独立重跑;720项完整测试由主任务在最终代码固定后执行。没有修改真实业务状态或执行真实SMTP/BPM操作。 + +## 限制 + +旧模板中此前被删除的href须重新导入确认,冻结邮件保持原内容。实际现场的字段、共享目录、邮箱及自然BPM到达仍须按原门槛核验;此次不宣称真实发送验收。历史偶发存储启动故障根因仍未确证,不作为本轮惠州功能已根治的结论。 + +详细阶段报告及原始红绿/审查证据保留在忽略目录 .superpowers/sdd/2026-10-21-huizhou-notification 与 output/verification;仅此摘要和可复核验收结论进入Git。 diff --git a/docs/superpowers/plans/2026-10-21-huizhou-notification.md b/docs/superpowers/plans/2026-10-21-huizhou-notification.md index 58dff9c..f0ec037 100644 --- a/docs/superpowers/plans/2026-10-21-huizhou-notification.md +++ b/docs/superpowers/plans/2026-10-21-huizhou-notification.md @@ -24,11 +24,11 @@ **Interfaces:** rule.huizhouEnabled (default false), rule.huizhouTemplateId (default empty); template.notificationMode ('normal'|'huizhou', legacy normal); ruleTemplate(store,categoryId,rule,mode='normal') resolves the mode's selected active template and rejects mismatches. Hui mode requires an explicit selected template when enabled. Existing templateResolver accepts fourth mode argument or call with mode-specific rule projection (record the chosen contract). -- [ ] Write failing real-store tests for legacy default, persisted settings, invalid booleans/template modes and selecting an inactive/wrong-mode template. -- [ ] Run `node --test tests/mail/huizhou-template.test.cjs tests/order-rules/huizhou-config.test.cjs`; verify missing mode isolation causes assertions to fail. -- [ ] Add templates.notification_mode column and rebuild active index over channel_id,scope,notification_mode. Use explicit insert columns. Preserve all old rows, payloads, and versions; normal and huizhou scopes no longer archive each other. -- [ ] Extend validation and save/publish/resume checks, public summaries and resolver. No server accepts arbitrary To/Cc for Hui mode. -- [ ] Run new tests plus existing mail/store and rule-validation slices; commit only task-owned changes. +- [x] Write failing real-store tests for legacy default, persisted settings, invalid booleans/template modes and selecting an inactive/wrong-mode template. +- [x] Run `node --test tests/mail/huizhou-template.test.cjs tests/order-rules/huizhou-config.test.cjs`; verify missing mode isolation causes assertions to fail. +- [x] Add templates.notification_mode column and rebuild active index over channel_id,scope,notification_mode. Use explicit insert columns. Preserve all old rows, payloads, and versions; normal and huizhou scopes no longer archive each other. +- [x] Extend validation and save/publish/resume checks, public summaries and resolver. No server accepts arbitrary To/Cc for Hui mode. +- [x] Run new tests plus existing mail/store and rule-validation slices; commit only task-owned changes. ### Task 2: 惠州识别、双路冻结与恢复 @@ -36,14 +36,14 @@ **Interfaces:** batches.notificationMode, order-specific independent Hui status/batch reservation, helper selecting titleOrders for mode; query detail exposes both notifications without raw source data. Task 1 resolver supports mode selection. -- [ ] Write failing tests with a mixed title containing ordinary O-100 and Hui H-200; assert Hui subject/text excludes O-100 and uses exact frozen normal To/Cc. -- [ ] Add tests proving HA prefix alone does not trigger, disabled/legacy produces one batch, empty Hui produces no batch, repeated prepare produces exactly one batch per mode. -- [ ] Run new test file and confirm expected red assertions before production edits. -- [ ] Add segment-aware recognition, Hui-specific mail rendering, mode-aware batch identity and independent reservations. Reuse archive evidence, never create extra capture/archive tasks. -- [ ] Forward mode in application templateResolver=(categoryId,rule,mode='normal')=>ruleTemplate(mail.store,categoryId,rule,mode). Normal sent/unknown must not stop archived runtime checks while Hui remains pending/batched. HA alone or contradictory customer/mode evidence is visible Hui-only uncertainty, never automatic Hui confirmation or silently forgotten potential Hui demand. -- [ ] Extend begin/finish/resolve/manual resend and restart recovery for matching mode only; preserve normal legacy state behavior. Block stale rules, incomplete source evidence and unknown outcomes. -- [ ] Verify normal sent + Hui failed can resend Hui once without normal send; normal unknown + Hui result remains independent; restart while Hui sending marks only Hui unknown. Verify no old frozen batches gain companions. -- [ ] Expose mode and delivery summaries in authorized projections/preview; run dispatcher/query/migration/execution regression slices and commit. +- [x] Write failing tests with a mixed title containing ordinary O-100 and Hui H-200; assert Hui subject/text excludes O-100 and uses exact frozen normal To/Cc. +- [x] Add tests proving HA prefix alone does not trigger, disabled/legacy produces one batch, empty Hui produces no batch, repeated prepare produces exactly one batch per mode. +- [x] Run new test file and confirm expected red assertions before production edits. +- [x] Add segment-aware recognition, Hui-specific mail rendering, mode-aware batch identity and independent reservations. Reuse archive evidence, never create extra capture/archive tasks. +- [x] Forward mode in application templateResolver=(categoryId,rule,mode='normal')=>ruleTemplate(mail.store,categoryId,rule,mode). Normal sent/unknown must not stop archived runtime checks while Hui remains pending/batched. HA alone or contradictory customer/mode evidence is visible Hui-only uncertainty, never automatic Hui confirmation or silently forgotten potential Hui demand. +- [x] Extend begin/finish/resolve/manual resend and restart recovery for matching mode only; preserve normal legacy state behavior. Block stale rules, incomplete source evidence and unknown outcomes. +- [x] Verify normal sent + Hui failed can resend Hui once without normal send; normal unknown + Hui result remains independent; restart while Hui sending marks only Hui unknown. Verify no old frozen batches gain companions. +- [x] Expose mode and delivery summaries in authorized projections/preview; run dispatcher/query/migration/execution regression slices and commit. ### Task 3: Tabler页面、回归与本机交付 @@ -51,9 +51,9 @@ **Interfaces:** Task 1 fields and Task 2 query/preview schema are binding; record concrete output shapes in task report. -- [ ] Write and run red UI tests exercising toggle -> mode-filtered selector -> save/reload, viewer read-only and leave-with-unsaved protection. -- [ ] Add rule controls, default false, inherited recipient explanation, proper mode selection in template confirmation/list and independent delivery results in order/batch details. Use existing lifecycle/dirty/role/escaping helpers. -- [ ] Verify mixed preview shows only Hui detail in supplemental email, unchanged normal contents, no Hui To/Cc inputs, and original navigation/pagination intact. -- [ ] Run scoped UI/backend tests and fresh full npm test; node --check changed JS/CJS; git diff --check; inspect staged files for private artifacts. -- [ ] Final review against spec and independent delivery recovery, resolve findings, commit code/docs. -- [ ] Stop original local test instance, create/verify backup, npm start; verify both ports/login/static assets, preserved accounts/keys/sample/draft/history summaries, and both automatic switches false. Do not enable business operations. Record evidence and final commit. +- [x] Write and run red UI tests exercising toggle -> mode-filtered selector -> save/reload, viewer read-only and leave-with-unsaved protection. +- [x] Add rule controls, default false, inherited recipient explanation, proper mode selection in template confirmation/list and independent delivery results in order/batch details. Use existing lifecycle/dirty/role/escaping helpers. +- [x] Verify mixed preview shows only Hui detail in supplemental email, unchanged normal contents, no Hui To/Cc inputs, and original navigation/pagination intact. +- [x] Run scoped UI/backend tests and fresh full npm test; node --check changed JS/CJS; git diff --check; inspect staged files for private artifacts. +- [x] Final review against spec and independent delivery recovery, resolve findings, commit code/docs. +- [x] Stop original local test instance, create/verify backup, npm start; verify both ports/login/static assets, preserved accounts/keys/sample/draft/history summaries, and both automatic switches false. Do not enable business operations. Record evidence and final commit.