Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .workflow/tasks/WB-60.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
{
Expand Down
7 changes: 6 additions & 1 deletion lib/workbench/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
10 changes: 10 additions & 0 deletions tests/test_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]))

Expand Down
Loading