docs: record Huizhou notification acceptance and local rollout

This commit is contained in:
abaishu0730 committed 2026-10-21 16:32:58 +08:00
1 parent fe5c231b98
commit cc39e16ac1
4 files changed
+100 -19

No files matched your search

@@ -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.