ITADN

Move project 2 from the frozen cohort to native Track Rules

#86653Openarthurdedeus 创建于 2 天前
feature/customer-analytics
A
arthurdedeuscommented
## Parent - Parent: Customer Analytics Track Rules - Delivery order: 4 of 4 ## Parent user story > As a project admin, I can define and apply account Track Rules, so that Customer Analytics shows the accounts my team manages as billing, trial, and account data change. ## Outcome Project 2 replaces the frozen 2026-08-19 classification with a native, enabled Track Rule whose source fields reconcile nightly. ## Starting state On 2026-08-19, a one-off production update applied the exact captured Vitally classification: - Input CSV: 277,010 unique external IDs. - Customer Analytics matches: 277,010. - Missing IDs: zero. - Newly ignored: 277,010. - Tracked after apply: 27,752. - Total Customer Analytics accounts: 304,762. The update timestamp was `2026-08-19T22:51:29.904471Z`. The rollback backup is stored at: `~/Downloads/ca-ignore-backup-2026-08-19/ca-ignore-backup.jsonl` Backup SHA-256: `14d04c3bad39d43f3f23624bbede2d8d104a1f870f914522259ec449895c7588` The native account custom property catalog already has likely sources for credit expiry, MRR, forecasted MRR, and trial expiry. Exact parity for manual tracking, annual paying status, HIPAA BAA date, and all source semantics remains unverified. ## Captured Vitally policy An account is tracked when any group matches: 1. Credit expiry is set. 2. Track manually is true. 3. Annual Stripe subscription is paying and the account is not an excluded internal org. 4. Stripe status is paying, MRR is greater than 1, and the account is not an excluded internal org. 5. HIPAA BAA signed date is set and the account is not an excluded internal org. 6. Forecasted MRR is greater than 0 and the account is not an excluded internal org. 7. Free trial until is set and the account is not an excluded internal org. Groups 3 through 7 exclude: - `4dc8564d-bd82-1065-2f40-97f7c50f67cf` - `018d78e9-2c5a-0000-b1c9-84b9aa96213c` ## Scope - Map each source condition to one native account field or account custom property. - Document source identity and semantic differences. - Create or change custom property sources where exact inputs are missing. - Confirm source sync health before previewing the rule. - Save the seven include groups with stable custom property UUIDs. - Preview the native rule without changing accounts. - Compare the preview with: - Current `ignored_at` state. - The frozen 277,010-ID cohort. - Current Vitally classification if the source remains available. - Produce aggregate and sampled difference reports. - Explain every material difference as a source-data change, mapping difference, or product defect. - Back up current project 2 `ignored_at` values again immediately before the first native run. - Run the native rule manually. - Verify list, API, and sample behavior. - Enable the project 2 rule and nightly reconciliation. - Verify two scheduled runs before closing rollout. ## Out of scope - Delete or merge accounts. - Remove the Vitally warehouse source. - Roll rules out to other projects. - Change the captured Vitally policy during migration. - Add product code unless rollout finds a defect. - Evaluate churned accounts. ## Additive design This rollout changes only active accounts’ `ignored_at`. It preserves accounts, custom properties, relationships, notes, tags, churn state, and external identifiers. Churned accounts keep their current ignored state. If one becomes active, the next native run evaluates it. ## Acceptance criteria - [ ] Every Vitally condition has one documented native source. - [ ] Source semantics and null behavior match or have an approved difference. - [ ] Every referenced custom property belongs to project 2 and targets accounts. - [ ] Property source syncs are healthy before preview. - [ ] The saved rule contains the seven captured include groups. - [ ] The rule uses stable custom property UUIDs. - [ ] Preview reports active and skipped-churned counts. - [ ] Every material difference from the frozen cohort has an explanation. - [ ] A fresh backup covers every project 2 account and has a recorded checksum. - [ ] The first native run completes without validation or workflow errors. - [ ] Default account lists hide nonmatching active accounts. - [ ] `Ignored at is set` finds ignored accounts. - [ ] Ignored account direct links still work. - [ ] The canonical Home Depot account remains tracked unless current source data explains a change. - [ ] The two imported Home Depot accounts remain ignored unless current source data explains a change. - [ ] No account is deleted or merged. - [ ] Two nightly runs succeed before rollout closes. - [ ] The restore procedure is tested against the fresh backup. ## Verification samples Include at least one account for each path: - Credit expiry. - Manual track. - Annual paying subscription. - Paying MRR above one. - HIPAA BAA. - Forecasted MRR. - Free trial. - Internal-org exclusion. - No matching group. - Churned and skipped. - Previously ignored account that now matches. - Previously tracked account that no longer matches. ## UI journey Persona: project 2 admin. 1. Open Customer Analytics Track Rules. 2. Review all seven groups. 3. Confirm property source health. 4. Run Preview. 5. Review counts, differences, and samples. 6. Confirm and run the current version. 7. Open the default Accounts list. 8. Filter `Ignored at is set`. 9. Open the three Home Depot accounts by direct URL. 10. Review the completed run and counts. Expected result: - Preview and run agree for the same version. - Explained source changes account for differences from the frozen cohort. - The default and ignored lists reflect the rule. - Every direct link works. - No account data is deleted. ## Operational checks - Frozen cohort row count and SHA-256. - Fresh backup row count and SHA-256. - Source-field completeness query. - Native-versus-frozen difference report. - Native-versus-current-Vitally difference report when available. - Post-run active tracked, active ignored, and skipped-churned counts. - One sample query for every rule group. - Run duration, database load, and write count. - Next two scheduled run results. ## Dependencies - Blocked by: Configure, preview, and manually apply account Track Rules, plus nightly reconciliation. - Blocks: none. - Can run in parallel with: property-source mapping before Issue 3 completes. ## Rollout and rollback Keep the nightly schedule paused for the first native run. If verification fails: 1. Disable the project 2 rule. 2. Pause nightly reconciliation. 3. Restore `ignored_at` from the fresh backup in bounded batches. 4. Verify default and filtered account counts. 5. Record the mismatch before changing the rule or source mapping. Keep both the frozen-cohort evidence and fresh rollback backup until two scheduled runs pass.
0 条评论