feat: PoC oficially proven?#15
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughAdds an experimental ChangesFlow-sensitive local IDisposable tracking (--flow-locals spike)
Sequence Diagram(s)sequenceDiagram
participant CI as CI Job
participant Extractor as OwnSharp.Extractor
participant Sample as FlowLocalsSample.cs
participant OwnIR as ownir.py
participant Core as OwnIR Core Checker
CI->>Extractor: run --flow-locals FlowLocalsSample.cs
Extractor->>Sample: Roslyn semantic walk of method bodies
Sample-->>Extractor: IDisposable locals + CFG structure
Extractor-->>CI: OwnIR JSON { components[], functions[] }
CI->>OwnIR: load + to_module(facts)
OwnIR->>OwnIR: _lower_flow() → Let/Use/Release/Return/If AST nodes
OwnIR-->>Core: Module with flow Function nodes
Core-->>OwnIR: diagnostics (OWN001/002/003 on loc_n handles)
OwnIR-->>CI: Finding(kind="disposable", code=OWN00x)
CI->>CI: assert OWN002/OWN001/OWN003 present, clean/looped/esc absent
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
ownlang/ownir.py (1)
438-445: 💤 Low valueConsider isolating
localmapfor branch-scoped locals in future graduation.The
ifhandling passes the samelocalmapreference to boththenandelsebranches. If a local with the same name is declared in both branches (different declarations, same name), the second branch's acquire would overwrite the first inlocalmap, and thehandlesdict would have both entries correctly, but cross-branch references could resolve to the wrong handle.For the current samples (all method-scoped locals), this isn't exercised. For graduation with block-scoped locals, consider copying
localmapbefore each branch.🤖 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 `@ownlang/ownir.py` around lines 438 - 445, The `if` handling in `_lower_flow` passes the same `localmap` reference to both `then` and `else` branches, which will cause issues when block-scoped locals are supported in future graduation. If the same variable name is declared in both branches, the second branch would overwrite the first in the shared `localmap`. To prepare for block-scoped local support, create a shallow copy of `localmap` before each branch and pass the copy to the respective `_lower_flow` calls for `then_b` and `else_b`, ensuring each branch has its own isolated local namespace that cannot interfere with the other.
🤖 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 `@ownlang/ownir.py`:
- Around line 438-445: The `if` handling in `_lower_flow` passes the same
`localmap` reference to both `then` and `else` branches, which will cause issues
when block-scoped locals are supported in future graduation. If the same
variable name is declared in both branches, the second branch would overwrite
the first in the shared `localmap`. To prepare for block-scoped local support,
create a shallow copy of `localmap` before each branch and pass the copy to the
respective `_lower_flow` calls for `then_b` and `else_b`, ensuring each branch
has its own isolated local namespace that cannot interfere with the other.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 1b4fac91-cfe9-46b4-8764-c49d19f2a0f8
📒 Files selected for processing (5)
.github/workflows/ci.ymldocs/proposals/P-016-deep-fact-extraction.mdfrontend/roslyn/OwnSharp.Extractor/Program.csfrontend/roslyn/samples/FlowLocalsSample.csownlang/ownir.py
…e), exempt dispose-optional types, default the wrappers to flow
Summary by CodeRabbit
New Features
--flow-localsanalysis for more accurate, path-sensitive tracking of localIDisposabledisposal issues.Improvements
own-checkscripts now enable--flow-localsby default, with--legacy/-Legacyto fall back to the older flat detector.Documentation / Tests