docs(proposals): P-034 — runtime lifetime guard & disposal quarantine - #191
docs(proposals): P-034 — runtime lifetime guard & disposal quarantine#191PhysShell wants to merge 17 commits into
Conversation
Pins down a design discussion that asked whether the C/C++ "harden malloc/free" idea has a .NET analog. Maps the discussion's rule catalog onto what own-check/OwnLang already ships (OWN001-003/014, WPF001-005, DI001-005, POOL001-003, OwnAudit phase 5) so it isn't re-derived, records the already-decided non-goals (SafeHandle/Marshal balance proofs), and scopes the one genuinely new piece: a small opt-in runtime disposal guard + test-time quarantine that covers what static analysis structurally can't (D5 ownership transfer, cross-thread disposal races).
…strictness-retrofit in the just-merged consolidation PR #190)
Own.NET's main gained a consolidation PR (#190) between when this branch was cut and now, which resolved seven proposals fighting over P-026 by renumbering to P-026..P-033. This one lands after that as P-034 to avoid re-colliding. Confirmed no overlap with the newly landed P-025/P-026/P-027 (obligation protocols, strictness retrofit, resource state machines) — all three are static/analysis-time; this proposal is the runtime/dynamic half none of them cover.
…d P-034 Re-syncs with main after consolidation PR #190 (which renumbered seven colliding P-026 candidates to P-026..P-033) and appends P-034 (runtime lifetime guard) at the end instead of re-colliding.
|
Warning Review limit reached
Next review available in: 50 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 (9)
📝 WalkthroughWalkthroughThis PR adds a new draft proposal document, P-034, describing opt-in runtime diagnostic helpers—a ChangesRuntime Lifetime Guard Proposal
Estimated code review effort: 1 (Trivial) | ~5 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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b6b4b4280f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| | [P-023](P-023-architecture-guard.md) | Architecture guard (`Own.Arch`): rules.yaml intent model + dependency-graph gate + baseline ratchet | draft | | ||
| | [P-024](P-024-security-audit-profile.md) | Security audit profile (external tools + SARIF adapters; rejects own scanner engine) | draft | | ||
| | [P-025](P-025-obligation-protocols.md) | Obligation protocols (`Own.Protocols`): barrier-sensitive project invariants (OBL001–005) | first slice built (core + bridge + fixtures; extractor pending) | | ||
| | [P-026](P-026-csharp-strictness-retrofit.md) | C# strictness retrofit profile (`own audit strictness`): a witness/score over existing findings, not a new engine | draft (framing) | |
There was a problem hiding this comment.
Remove links to absent proposals
This new index entry, and the following P-027 through P-033 entries, links to proposal files that are not present in this tree; I checked rg --files docs/proposals and only P-001 through P-025 plus P-034 exist. As committed, the proposals index ships multiple dead links and contradicts the claim that the index is synchronized, so either include those proposal files or avoid listing/linking them here.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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.
Inline comments:
In `@docs/proposals/P-034-runtime-lifetime-guard.md`:
- Around line 28-33: Narrow the runtime-guard scope language in the proposal so
it matches what the implementation actually does: in the sections around the
quarantine and LifetimeGuard wording, remove any implication that it is a
substitute for ClrMD or that it detects D5 ownership transfer/heap-rooting.
Update the descriptions in the proposal’s LifetimeGuard and quarantine
explanations to say it only surfaces post-disposal misuse and verifies local
Dispose() completion, while keeping the runtime-race detection claim limited to
cross-thread disposal races.
- Around line 129-133: The gating example in LifetimeGuard should be reworded
because `[Conditional]` cannot be applied to a throw statement. Update the
example in the `Dispose()`/`LifetimeGuard` guidance to show a helper method that
performs the throw, or wrap the throw in a `#if DEBUG` / `#if TEST` guard, so
the intended DEBUG/TEST-only behavior is expressed correctly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: bd047bcf-972b-428d-8c8d-f812b79d2bf8
📒 Files selected for processing (2)
docs/proposals/P-034-runtime-lifetime-guard.mddocs/proposals/README.md
…nditional] example - Motivation no longer implies the quarantine is a "substitute" for ClrMD (it already says the opposite later — was self-contradictory) or that LifetimeGuard "closes"/detects D5 ownership-transfer itself; it only surfaces the resulting misuse (double-dispose/use-after-dispose), regardless of root cause. - Non-goals: [ConditionalAttribute] can only decorate methods, not a throw statement — reworded to a #if DEBUG/TEST guard or a [Conditional]-attributed helper method.
This branch forked before consolidation PR #190 merged. It was referencing P-026..P-033 in its README index without those files actually existing in its tree (dead links, flagged by review). Copying main's content verbatim so the branch is self-consistent standalone.
Same rebase as P-026 — restoring dead-link target files into this branch's own tree, copied verbatim from main.
Same rebase as P-026/P-027 — copied verbatim from main.
Same rebase as P-026/P-027/P-028 — copied verbatim from main.
Same rebase as P-026..P-029 — copied verbatim from main.
Same rebase as P-026..P-030 — copied verbatim from main.
Same rebase as P-026..P-031 — copied verbatim from main.
Completes the rebase — all P-026..P-033 targets now exist in this branch's own tree (copied verbatim from main), so docs/proposals/README.md's index no longer has dead links when this branch is viewed standalone.
…e merge conflict) Blob was 1 byte larger than main's (11594 vs 11593) due to an extra trailing newline introduced when relaying the file through a fetch step. That divergence is what GitHub's merge was flagging as a real conflict despite the rendered text looking identical.
…e merge conflict) Same fix as P-032 — blob was 1 byte larger than main's (8700 vs 8699).
|
Заменено #192 — та же ветка ( Generated by Claude Code |
Что и зачем
Фиксирует итог обсуждения: есть ли смысл в .NET-аналоге C/C++ практики
«обернуть malloc/free параноидальными enterprise-проверками». Ответ — как
allocator-шим почти нет смысла (managed-рантайм и так убирает use-after-free/
OOB/double-free), но как идея это уже реализовано в Own.NET статически
(
OWN001/002/003/014, P-004/P-005) и на рантайме в OwnAudit (фаза 5,ClrMD-корреляция). Новый
docs/proposals/P-034-runtime-lifetime-guard.mdфиксирует эту карту (чтобы никто не передобавлял то же самое) и предлагает
единственный реально недостающий кусок: лёгкий opt-in runtime-guard
(throw на double-Dispose/use-after-dispose в DEBUG/TEST) + disposal
quarantine для тестов — ClrMD-независимый комплемент к фазе 5 OwnAudit.
Изначально предложение планировалось как P-026, но пока ветка стояла,
консолидационный PR #190 разрулил семь предложений, одновременно
претендовавших на этот номер (→ P-026…P-033). Ветка перебазирована: файл
переименован в P-034, индекс
docs/proposals/README.mdсинхронизирован сmain (никакие из новых P-026…P-033 не откатываются), добавлена сверка на
отсутствие пересечения с только что влитыми P-025/P-026/P-027 (все три —
статические, этот — рантайм-половина, которую они явно не берут на себя).
Тип изменения
Как проверено
python tests/run_tests.pyruff check .иmypypython scripts/<...>.py --selftest)Docs-only: новый
docs/proposals/*.md+ обновлённый индекс, кода некасается — тесты/линт неприменимы. Проверено вручную: ссылки резолвятся,
код-фенсы сбалансированы, индекс включает все P-001…P-034 без пропусков и
дублей.
Связанные issue
Нет. Инициировано обсуждением в чате, не привязано к issue.
Чеклист
docs/proposals/README.mdобновлёнfeat:,fix:,docs:…)Generated by Claude Code
Summary by CodeRabbit