diff --git a/.workflow/tasks/WB-60.json b/.workflow/tasks/WB-60.json index 581de58..78f455d 100644 --- a/.workflow/tasks/WB-60.json +++ b/.workflow/tasks/WB-60.json @@ -2,10 +2,10 @@ "key": "WB-60", "title": "The billing zone matches any path containing plan", "type": "bug", - "status": "open", + "status": "done", "desc": "profile.CRITICAL_ZONES['billing'] is billing|payment|invoice|subscription|checkout|stripe|paddle|quota|plan, matched anywhere in a path. skills/plan-change/SKILL.md, planner.py or explanation.md read as billing and are held to the critical bar; wb finish sent WB-58 to the standard route for it.\n\nACCEPTANCE:\n- plan matches a pricing plan (plans/, plan_limits, subscription_plan) and not plan-change, planner or explanation\n- a test pins both sides; plans already audited with the old zones re-audit cleanly or say why", "created": "2026-09-27T03:48:12Z", - "updated": "2026-09-27T03:48:12Z", + "updated": "2026-09-27T04:04:36Z", "comments": [], "linked": [ { diff --git a/lib/workbench/profile.py b/lib/workbench/profile.py index 9d78ecf..4f846b8 100644 --- a/lib/workbench/profile.py +++ b/lib/workbench/profile.py @@ -29,7 +29,12 @@ # Areas where the bar rises regardless of preset: rigour is not uniform inside # a repo. Matched against the path of every file a plan proposes to touch. CRITICAL_ZONES = { - "billing": re.compile(r"billing|payment|invoice|subscription|checkout|stripe|paddle|quota|plan", re.I), + # "plan" is a pricing plan only as a path token of its own (plans/, + # plan_limits.py, subscription_plan.ts). Anywhere in a path it also caught + # plan-change, planner and explanation, and held them to the billing bar. + "billing": re.compile( + r"billing|payment|invoice|subscription|checkout|stripe|paddle|quota|pricing|(^|[/_.-])plans?([/_.]|$)", re.I + ), "auth": re.compile(r"auth|login|session|password|token|oauth|permission|role|acl", re.I), # "user", "account", "pii" and "personal" name user data wherever they # appear. "profile" does not: it is just as often a performance profile or, diff --git a/tests/test_profile.py b/tests/test_profile.py index 1269eac..bd0897a 100644 --- a/tests/test_profile.py +++ b/tests/test_profile.py @@ -157,6 +157,16 @@ def test_money_and_auth_paths_are_flagged(self) -> None: self.assertIn("auth", hits) self.assertNotIn("src/ui/button.tsx", [p for paths in hits.values() for p in paths]) + def test_a_pricing_plan_is_billing_and_a_plan_of_work_is_not(self) -> None: + """WB-60: skills/plan-change/SKILL.md read as billing.""" + for path in ("src/plans/pro.py", "src/plan_limits.py", "app/subscription_plan.ts", "lib/plan.ts", + "src/pricing/table.py"): + with self.subTest(path=path): + self.assertIn("billing", profile.critical_zones([path])) + for path in ("skills/plan-change/SKILL.md", "src/planner.py", "docs/explanation.md", "tests/test_planning.py"): + with self.subTest(path=path): + self.assertNotIn("billing", profile.critical_zones([path])) + def test_migrations_are_flagged(self) -> None: self.assertIn("migration", profile.critical_zones(["db/migrations/0004_add_plan.sql"]))