Skip to content

Claude/p014 tier a semantic#13

Merged
PhysShell merged 2 commits into
mainfrom
claude/p014-tier-a-semantic
Jun 16, 2026
Merged

Claude/p014 tier a semantic#13
PhysShell merged 2 commits into
mainfrom
claude/p014-tier-a-semantic

Conversation

@PhysShell

@PhysShell PhysShell commented Jun 16, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

Release Notes

  • New Features

    • Added verbosity control option (quiet/normal/verbose) for analysis output.
    • Added OWN050 advisory finding for unresolved external assembly types.
  • Improvements

    • C# extractor upgraded to type-aware semantic analysis.
    • Event subscription detection now excludes self-owned sources and static handlers.
    • CI expanded to validate additional edge cases.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 63cf6630-8b24-40bd-83f1-1c31608090e0

📥 Commits

Reviewing files that changed from the base of the PR and between 99d56d7 and 87f6df1.

📒 Files selected for processing (23)
  • .github/workflows/ci.yml
  • README.md
  • docs/ROADMAP.md
  • docs/howto-visual-studio.md
  • docs/proposals/P-001-csharp-extractor.md
  • docs/proposals/P-004-wpf-lifetime-profile.md
  • docs/proposals/P-014-semantic-resolution.md
  • docs/proposals/P-016-deep-fact-extraction.md
  • docs/proposals/README.md
  • frontend/roslyn/OwnSharp.Extractor/OwnSharp.Extractor.csproj
  • frontend/roslyn/OwnSharp.Extractor/Program.cs
  • frontend/roslyn/README.md
  • frontend/roslyn/samples/SampleTypes.cs
  • frontend/roslyn/samples/SelfOwnedViewModel.cs
  • frontend/roslyn/samples/StaticHandlerViewModel.cs
  • frontend/roslyn/samples/TimerViewModel.cs
  • ownlang/__main__.py
  • ownlang/diagnostics.py
  • ownlang/ownir.py
  • scripts/own-check.ps1
  • spec/Diagnostics.md
  • tests/fixtures/ownir/unresolved.facts.json
  • tests/test_ownir.py

📝 Walkthrough

Walkthrough

The Roslyn extractor is upgraded from syntax-only to type-aware, building a single CSharpCompilation/SemanticModel to confirm real event subscriptions. Two new exemptions are added (IsSelfOwnedSource, IsStaticHandler). Unresolved LHS bindings emit a new unresolved-subscription marker surfaced as advisory OWN050 findings (excluded from exit code). A --verbosity flag is threaded through the CLI and PowerShell script. New samples, fixtures, tests, CI assertions, spec entries, and proposal documents cover all changes.

Changes

Type-aware extractor + OWN050 advisory + verbosity pipeline

Layer / File(s) Summary
In-sample type stubs enabling type-aware binding
frontend/roslyn/samples/SampleTypes.cs, frontend/roslyn/samples/SelfOwnedViewModel.cs, frontend/roslyn/samples/StaticHandlerViewModel.cs, frontend/roslyn/samples/TimerViewModel.cs
SampleTypes.cs adds IEventBus, Calc (with static GlobalPing), and a WpfApp.DispatcherTimer stub so symbols resolve without a real WPF reference. SelfOwnedViewModel and StaticHandlerViewModel exercise the two new exemption paths. TimerViewModel drops the real WPF using directive.
Roslyn extractor rewrite: compilation, exemptions, unresolved marker
frontend/roslyn/OwnSharp.Extractor/Program.cs, frontend/roslyn/OwnSharp.Extractor/OwnSharp.Extractor.csproj
Pre-parses all inputs, builds one CSharpCompilation, derives SemanticModel per file. Adds --no-event-leaks flag, IsSelfOwnedSource and IsStaticHandler helpers, and rewrites the subscription loop to require IEventSymbol binding, apply exemptions, and emit unresolved-subscription markers when the LHS cannot be resolved.
OwnIR bridge: Finding.advisory, unresolved-subscription lowering, OWN050 emission
ownlang/ownir.py, ownlang/diagnostics.py, spec/Diagnostics.md
Finding gains advisory: bool. to_own skips unresolved-subscription entries (no phantom acquire). _unresolved_findings emits OWN050 advisory Findings and is wired into check_facts. diagnostics.py registers the OWN050 title. spec/Diagnostics.md defines the advisory rule.
--verbosity flag: cmd_ownir, main(), own-check.ps1
ownlang/__main__.py, scripts/own-check.ps1
cmd_ownir accepts verbosity, splits advisory vs non-advisory findings for rendering and exit-code, and adds a per-code breakdown for verbose mode. main() validates and routes the flag. own-check.ps1 gains a -Verbosity parameter forwarded to python -m ownlang ownir.
Fixture, tests, and CI assertions
tests/fixtures/ownir/unresolved.facts.json, tests/test_ownir.py, .github/workflows/ci.yml
unresolved.facts.json provides a TierA fixture with one unresolved and one real subscription. The P-014 Tier A test validates no phantom acquire, exactly one advisory OWN050, and one real OWN001. CI adds the two new sample inputs and negative assertions that they produce no OWN001 findings.
Docs, proposals, and README updates
README.md, docs/ROADMAP.md, docs/howto-visual-studio.md, frontend/roslyn/README.md, docs/proposals/P-001-csharp-extractor.md, docs/proposals/P-004-wpf-lifetime-profile.md, docs/proposals/P-014-semantic-resolution.md, docs/proposals/P-016-deep-fact-extraction.md, docs/proposals/README.md
All "syntax-only" references are replaced with "type-aware / SemanticModel" wording. P-004 gains a new "Lifetime exemptions (built, P-014 Tier A)" section documenting the two exemptions. P-016 is added as a new draft proposal for CFG + flow lowering. Proposal index updated.

Sequence Diagram(s)

sequenceDiagram
  actor User
  participant PS as own-check.ps1
  participant Dotnet as OwnSharp.Extractor
  participant Comp as CSharpCompilation/SemanticModel
  participant Bridge as ownlang/ownir.py
  participant CLI as ownlang/__main__.py

  User->>PS: Invoke-Script -Verbosity verbose
  PS->>Dotnet: dotnet run -- file1.cs file2.cs ...facts.json
  Dotnet->>Comp: build single compilation + SemanticModel per file
  Comp-->>Dotnet: IEventSymbol binding results
  Dotnet-->>PS: facts.json (subscriptions incl. unresolved-subscription markers)
  PS->>CLI: python -m ownlang ownir --verbosity verbose facts.json
  CLI->>Bridge: check_facts(facts)
  Bridge->>Bridge: to_own — skip unresolved-subscription (no phantom acquire)
  Bridge->>Bridge: _unresolved_findings — emit OWN050 advisory Findings
  Bridge-->>CLI: [Finding(OWN050, advisory=True), Finding(OWN001, advisory=False)]
  CLI-->>User: warnings for OWN050 (no exit-code impact) + error for OWN001
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • PhysShell/Own.NET#12: Directly modifies the same P-014 semantic-resolution material being clarified here, including the self-owned-source and OWN050 "honest skip" semantics.
  • PhysShell/Own.NET#8: Modifies the same wpf-extractor CI job, OwnSharp.Extractor, and ownlang/ownir.py bridge facts-to-findings mapping that this PR extends.
  • PhysShell/Own.NET#10: Touches the same ownlang/__main__.py and Finding structure in ownlang/ownir.py (rendering/format handling vs advisory/unresolved-subscription support).

Poem

🐇 Hops through the syntax trees no more,
Now SemanticModel opens every door!
Self-owned and static — both get a pass,
OWN050 waves gently as unknowns go past.
Verbosity quiet, normal, or loud —
The rabbit checks leaks and hops through the cloud! ☁️

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/p014-tier-a-semantic

Comment @coderabbitai help to get the list of available commands and usage tips.

@PhysShell PhysShell merged commit 33bfe5b into main Jun 16, 2026
16 of 17 checks passed
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