docs(proposals): P-026 — resource state machines & stale-async-write detection - #179
docs(proposals): P-026 — resource state machines & stale-async-write detection#179PhysShell wants to merge 2 commits into
Conversation
…te detection Distills a React-useEffect critique into the two ideas that generalize past React: modeling a resource's lifecycle as one explicit state instead of boolean/nullable soup, and detecting stale async writes where a value read before an await gates a write committed after it. Cross-references what P-004/P-005/P-020/P-021 already cover so this only adds the two genuinely new diagnostics (ASYNC050-052) rather than duplicating cleanup/blocking-wait/async-void checks. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L5JLaXfYrZYrt4JG1fYJFA
|
Warning Review limit reached
Next review available in: 56 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis change adds a new draft design proposal document, P-026 ("Resource state machines & stale-async-write detection"), defining diagnostics ASYNC050, ASYNC051, and ASYNC052. It also adds corresponding index entries in the roadmap and proposals README. ChangesP-026 Proposal Documentation
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
docs/proposals/P-026-resource-state-machine.md (1)
204-231: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winSeparate the type-level state-soup fact from the method-level hazards.
ASYNC050is type-scoped, whileASYNC051/ASYNC052are per-method. Keeping them under oneasync_methodsfamily makes the extractor contract harder to reason about.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/proposals/P-026-resource-state-machine.md` around lines 204 - 231, Separate the type-scoped state-soup signal from the per-method hazard data in the P-021/P-026 proposal. Update the `async_methods` fact shape in `ownlang/async_rules.py` so `ASYNC050` consumes its own type-level fact for `sibling_status_fields`, while `ASYNC051` and `ASYNC052` remain under the method-level hazards for each async method entry. Keep the `CustomerViewModel.LoadCustomerAsync` example aligned with that split so the extractor contract is clear and not mixed into one family.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@docs/proposals/P-026-resource-state-machine.md`:
- Around line 204-231: Separate the type-scoped state-soup signal from the
per-method hazard data in the P-021/P-026 proposal. Update the `async_methods`
fact shape in `ownlang/async_rules.py` so `ASYNC050` consumes its own type-level
fact for `sibling_status_fields`, while `ASYNC051` and `ASYNC052` remain under
the method-level hazards for each async method entry. Keep the
`CustomerViewModel.LoadCustomerAsync` example aligned with that split so the
extractor contract is clear and not mixed into one family.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: f6d1cfbe-5248-4660-852e-287237c847ef
📒 Files selected for processing (3)
docs/ROADMAP.mddocs/proposals/P-026-resource-state-machine.mddocs/proposals/README.md
…thod hazards CodeRabbit review on #179: the sketch mixed a type-scoped fact (sibling status fields) into the per-method async_methods entries. Give it its own types[] fact block so the extractor contract for ASYNC050 (type-level) stays separate from ASYNC051/052 (per-method). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L5JLaXfYrZYrt4JG1fYJFA
|
Консолидировано в #190 (перенумеровано P-026 → P-027-resource-state-machine из-за коллизии семи параллельных P-026; ссылки на P-021 скорректированы). Закрываю в пользу единого PR. Generated by Claude Code |
Что и зачем
Оформляет разбор чужого поста про
useEffectв отдельный пропозалP-026: из критики вытащены две идеи, которые реально обобщаются за пределы React — состояние ресурса как явный enum вместо boolean/nullable-каши, и защита от stale-write в async-методах (читаем значение доawait, пишем после, без cancellation/version-check). Добавлен только новый draft-документ + две строки в индексах (docs/proposals/README.md,docs/ROADMAP.md), кода/чекеров это не меняет.Тип изменения
Как проверено
P-026перепроверены вручную (файлы существуют, якоря корректны)python tests/run_tests.py— не запускался, изменения не затрагивают кодruff check .иmypy— не применимо, изменения только в.mdСвязанные issue
Нет связанных issue.
Чеклист
docs/proposals/README.mdиdocs/ROADMAP.mdпроиндексированыfeat:,fix:,docs:…)Generated by Claude Code
Summary by CodeRabbit