Skip to content

feat: plan first when a ticket names code in a critical zone - #85

Merged
matheusPavaneli merged 1 commit into
mainfrom
WB-58-critical-zone-and-misleading
Sep 27, 2026
Merged

matheusPavaneli merged 1 commit into
mainfrom
WB-58-critical-zone-and-misleading

Conversation

@matheusPavaneli

Copy link
Copy Markdown
Owner

What

wb start predicts a critical zone from the code the ticket names and plans first. When wb finish moves a ticket to the standard route, the change is kept instead of reverted. WB-60 is recorded.

Why

WB-58. BN-4 cost 6.7x plain's tokens in the 9abd3c9 run for two reasons. Its fix touched user data, and wb finish only found that out after the change was made. Then both sessions reverted a working fix and planned from scratch.

How

  • light.names() picks identifiers in backticks, snake_case or CamelCase (at most six); plain words are skipped. zone_named() greps their definitions at HEAD (def, class, function) and zones the files. eligible() takes the ticket text.
  • wb start passes the title and description. A name defined in a zone keeps the ticket off the light path, with light no: the ticket names display_name, defined in shop/users.py, which is in the user-data zone: plan it first.
  • wb finish's outgrow message says to keep the change on disk and plan around it (citations read HEAD). plan-change says the same.
  • Closing this ticket with wb finish hit a false positive: the billing zone matches plan in any path, so skills/plan-change/SKILL.md read as billing. The ticket followed the standard route: plan, audit, verify. WB-60 records the zone rule.

Verification

wb impl verify WB-58: pass.

  • python -m unittest discover -s tests -q: exit 0
  • python -m ruff check lib: exit 0
  • python -m mypy: exit 0

New tests: a bug naming charge_card in shop/billing/charge.py starts on the standard route with the reason; one naming format_money keeps the light path; names() skips plain words; the outgrow message says not to revert.

Risk and rollback

Up to twelve git grep calls per wb start. Revert to undo; "light_path": false also keeps every ticket on the standard route.

Open questions

  • The BN-4 ratio is re-measured by the next bench run; the README table updates then.

BN-4 cost 6.7x plain in the 9abd3c9 run. Its fix touched user data, so
wb finish sent it to the standard route after the change was made, and
both sessions then reverted a working fix to plan it from scratch.

wb start now reads the identifiers the ticket spells (in backticks,
snake_case or CamelCase, at most six), finds where each is defined at
HEAD, and starts the ticket on the standard route when that file is in
a critical zone, saying which name and which zone. When wb finish does
move a ticket, it says to keep the change and plan around it, and
plan-change says the same.

Closing this ticket with wb finish took the standard route for a false
reason: the billing zone matches the word plan in any path, so
skills/plan-change/SKILL.md read as billing. WB-60 records it.
@matheusPavaneli
matheusPavaneli merged commit ca01e79 into main Sep 27, 2026
10 checks passed
@matheusPavaneli
matheusPavaneli deleted the WB-58-critical-zone-and-misleading branch September 27, 2026 04:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant