Skip to content

docs(P-022): revise per post-merge review — own-bridge, IDE trigger, lint/perf collisions#168

Merged
PhysShell merged 3 commits into
mainfrom
claude/ownnet-execution-surfaces-adr-8kyc0n
Jul 3, 2026
Merged

docs(P-022): revise per post-merge review — own-bridge, IDE trigger, lint/perf collisions#168
PhysShell merged 3 commits into
mainfrom
claude/ownnet-execution-surfaces-adr-8kyc0n

Conversation

@PhysShell

@PhysShell PhysShell commented Jul 3, 2026

Copy link
Copy Markdown
Owner

Что и зачем

Ревизия P-022 по принятым находкам пост-мёрж ревью (docs/notes/p022-review-notes.md, PR #167), в порядке цены поздней находки:

  • own-bridge — недостающий крейт (highest cost). ~2k строк verdict-determining логики из ownir.py за пределами схемы (facts→core lowering to_module/_lower_flow, интерпроцедурный MOS-вывод _build_skeletons/_infer_*, BCL fresh-factory таблица, check_facts) не имели дома в DAG. Добавлен крейт, рёбра (ir+cfg+analysis+diagnostics → bridge; зависеть от него может только own-cli), шаг миграции 6 с пререквизитом «нормативная семантика вывода до порта» и fitness-правило.
  • IDE-расширение как записанный Why (Gate B из incremental-computation.md): перф-приоритеты — latency/incrementality, а не batch (10–100× — batch-CLI цифры); panic=abortper-binary (LSP нужен unwind: salsa отменяет через unwinding); error-tolerant парсинг — требование; гибридная форма расширения (in-process Roslyn-экстракция + Rust-ядро через OwnIR-seam); salsa из «когда-нибудь» в суть Gate B.
  • Коллизия indexing_slicing = deny с dense-Vec стейтом — предрешена в доке: justified module-scoped #[allow] на arena-индексированном контейнере, deny везде ещё.
  • Дешёвые остатки: own-ir = fact contract (вердикты в own-diagnostics); span-примитивы в leaf (не own-syntax); byte-offsets внутри + line-index; NonZeroU32-IDs (niche); [profile.release] как TOML; оракул диффит golden-снапшоты (corpus hash + py commit), не живой Python на каждый CI; error-text parity fixtures; #[cold] на diagnostic-путях; SmallVec «measured, not sprinkled»; enum-size ритуал.

Тип изменения

  • docs — документация
  • feat / fix / refactor / chore / test / ci

Как проверено

  • docs-only; код и гейт не затронуты. Fence/headers целостны, sweep на противоречия (fact/verdict, panic-doctrine, span-in-syntax, Rid(u32)) чист.
  • python tests/run_tests.py
  • ruff check . и mypy

Связанные issue

Нет issue. Follow-up к #166 (P-022) по ревью из #167 (p022-review-notes.md).

Чеклист

  • изменение покрыто тестом/селфтестом (или объяснено, почему нет) — docs-only
  • README/docs обновлены — сам P-022; статус-строка ссылается на review-notes
  • коммиты в conventional-commit стиле (docs:)

🤖 Generated with Claude Code


Generated by Claude Code

Summary by CodeRabbit

  • Documentation
    • Updated the Rust core migration proposal with clearer architecture guidance, dependency layering, and integration boundaries.
    • Expanded guidance on crate relationships, parser/error handling expectations, performance practices, and compiler/runtime settings.
    • Added more detailed CI and snapshot-based comparison workflow notes, plus stronger migration and governance requirements.

…collisions

Folds the accepted findings from docs/notes/p022-review-notes.md (PR #167):

- own-bridge crate (highest cost): today's ownir.py beyond the schema
  (~2k lines of verdict-determining logic — facts->core lowering, the
  interprocedural MOS inference, BCL fresh-factory table, check_facts
  verdict mapping) had no named home in the DAG. Added the crate, its
  edges (ir+cfg+analysis+diagnostics -> bridge; only own-cli may depend
  on it), a migration step 6 with the normative-semantics prerequisite,
  and the fitness rule.
- IDE extension as the recorded Why (Gate B of incremental-computation):
  reorders perf priorities to latency/incrementality over batch (the
  10-100x figures are batch-CLI numbers), makes panic=abort per-binary
  (LSP needs unwind — salsa cancels via unwinding), promotes
  error-tolerant parsing to a requirement, and documents the hybrid
  extension shape (in-process Roslyn extraction + Rust core over the
  OwnIR seam). salsa open question upgraded from maybe to Gate-B
  substance.
- indexing_slicing deny vs dense-Vec state: pre-resolved — justified
  module-scoped allow on the arena-indexed state container, deny stays
  elsewhere.
- Cheap residuals: own-ir relabeled fact contract (verdicts live in
  own-diagnostics), span primitives pinned to the leaf (not own-syntax),
  byte-offsets-internally row, NonZeroU32 IDs, [profile.release] as TOML,
  oracle diffs golden snapshots keyed by (corpus hash, py commit) instead
  of live Python per CI pass, error-text parity fixtures, #[cold] on
  diagnostic paths, SmallVec measured-not-sprinkled, enum-size ritual.

Copy link
Copy Markdown
Owner Author

@coderabbitai review
@codex review

This folds the accepted findings of docs/notes/p022-review-notes.md back into P-022. Focus areas:

  1. own-bridge — is the crate boundary right? It's deliberately the one wide consumer (ir + cfg + analysis + diagnostics), with the inverse constraint "nothing but own-cli depends on it". Does that hold up, and is migration step 6 (with the normative-semantics prerequisite) the right place in the strangler-fig order?
  2. IDE-trigger consequences — per-binary panic (abort for CLI, unwind for LSP because salsa cancels via unwinding), error-tolerant parsing promoted to requirement, hybrid extension shape over the OwnIR seam. Anything the Why now overclaims?
  3. Internal consistency — after relabeling own-ir as the fact contract + span leaf, the indexing_slicing pre-resolution, the [profile.release] TOML, and the snapshot-based oracle ratchet: any place the doc still contradicts itself?

Generated by Claude Code

@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@PhysShell, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 53 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 8ff2ada9-8de5-49e0-b85e-619b7cf3c773

📥 Commits

Reviewing files that changed from the base of the PR and between 59c7509 and 4d5f0d7.

📒 Files selected for processing (1)
  • docs/proposals/P-022-rust-core-migration.md
📝 Walkthrough

Walkthrough

This PR revises the P-022 Rust core migration proposal document, expanding sections on migration rationale, crate topology and dependency edges, ID/index design patterns, parser and library requirements, performance/panic-mode guidance, compiler strictness tooling, and the differential oracle and migration strategy for own-bridge. No code changes are included.

Changes

Proposal document revision

Layer / File(s) Summary
Rationale and crate topology
docs/proposals/P-022-rust-core-migration.md
Expands the IDE-trigger rationale, freezes the OwnIR seam, and clarifies crate dependency edges for own-ir, own-diagnostics, own-codegen, and own-bridge.
Patterns, libraries, and performance guidance
docs/proposals/P-022-rust-core-migration.md
Adds newtype-index/NonZeroU32 guidance, parser error-parity requirements, SmallVec caveats, and panic="abort"/panic="unwind" guidance plus a release profile snippet and clippy #[allow] plan.
Dependency ratchet, oracle, and migration strategy
docs/proposals/P-022-rust-core-migration.md
Restricts own-bridge consumers, clarifies snapshot-based CI oracle diffing, details the own-bridge migration step, and adds salsa incrementality constraints.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the PR’s main changes: P-022 docs revisions about own-bridge, IDE trigger rationale, and lint/perf collisions.
Description check ✅ Passed The description follows the template, fills the required sections, and explains the docs-only nature and related issue context.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/ownnet-execution-surfaces-adr-8kyc0n

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.

❤️ Share

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

@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail
cd /tmp
rm -rf repo
git clone --depth 50 https://github.com/PhysShell/Own.NET.git repo 2>&1 | tail -5
cd repo
gh pr view 168 --repo PhysShell/Own.NET --json title,body,files -q '.files[].path' 2>&1 || true
echo "---diff stat---"
gh pr diff 168 --repo PhysShell/Own.NET 2>&1 | head -20

Length of output: 1857


🏁 Script executed:

#!/bin/bash
set -uo pipefail
cd /tmp/repo
echo "=== FULL DIFF ==="
gh pr diff 168 --repo PhysShell/Own.NET > /tmp/pr168.diff 2>&1
wc -l /tmp/pr168.diff
cat /tmp/pr168.diff
echo "=== REVIEW NOTES ==="
find . -iname 'p022-review-notes.md'
cat docs/notes/p022-review-notes.md 2>/dev/null | head -300

Length of output: 29557


🏁 Script executed:

#!/bin/bash
set -uo pipefail
cd /tmp/repo
fd -i ownir.py
echo "---"
fd -i ownir.py -x wc -l {}
echo "--- look at schema vs beyond-schema split ---"
fd -i ownir.py -x grep -n "^class\|^def" {} 2>/dev/null | head -80

Length of output: 3448


@PhysShell I read the diff against docs/notes/p022-review-notes.md in full. Here's the review, organized by your three focus areas.

1. own-bridge boundary

The boundary holds up. The diagram change is precise about direction:

own-ir + own-cfg + own-analysis + own-diagnostics ─▶ own-bridge

Given the doc's own convention ("Arrow = is depended on by"), this correctly makes own-bridge the dependent, not a dependency of the solver — so bridge inference genuinely can't leak backward into own-analysis/own-diagnostics. The inverse constraint ("nothing depends on own-bridge except own-cli") is stated explicitly in the ratchet section, which is the right place to pin it (not just in prose near the crate list).

Migration step 6 placement (between own-diagnostics/own-codegen at step 5 and own-cli at step 7) is correct strangler-fig order: bridge needs the solver and diagnostics ported first, and gating it on the normative-semantics write-up before porting is the right sequencing — that write-up is exactly the thing test_ownir.py-only pinning can't substitute for.

One small nit, not a defect: the crate-list line {all of the above} ─▶ own-cli appears directly after the own-bridge block, so it's implied to include it, but it's not spelled out. Given how much emphasis the doc puts on own-bridge's width being deliberate, it'd read more confidently as {all of the above, including own-bridge} ─▶ own-cli — purely cosmetic.

2. IDE-trigger consequences

No overclaiming found. The Why section correctly hedges the batch-vs-latency distinction ("if today's CLI isn't CPU-bound on the corpus, the visible batch win may be modest") rather than asserting the 10–100× figure applies. The hybrid extension shape is honestly scoped too — it explicitly says Rust "removes the Python runtime from the distribution" but does not remove the .NET extraction half, which avoids the trap of implying an all-Rust IDE story.

panic = "abort" is correctly demoted from doctrine to per-binary choice in both the prose and the new [profile.release] TOML block (the comment there — "panic is per-binary, NOT set here" — matches the prose exactly, no drift between the two).

The one place worth a second look: salsa still lives under "Open questions," now reworded as "no longer a maybe... but out of scope for the parity phase." That's a reasonable place for it (the whether it matters question is settled; the how/when to wire it in question isn't), so I wouldn't call it a contradiction — just flagging that a reader skimming only headers might still read "Open questions: salsa" as "undecided whether it matters."

3. Internal consistency

Checked all four points plus a fifth I noticed on the way:

  • own-ir relabel: "fact/verdict contract" → "fact contract... verdicts live in own-diagnostics" is applied consistently everywhere it's referenced (crate diagram, bullet list, own-diagnostics bullet all agree now).
  • indexing_slicing: pre-resolved with a scoped, justified #[allow] on the arena-indexed state container, deny elsewhere — matches the fitness/ratchet section's own philosophy about justified allows carrying comments.
  • [profile.release] TOML: added, and doesn't restate panic (correctly deferred to the per-binary note above it) — no duplication/contradiction with the prose.
  • Snapshot oracle: "golden snapshots keyed by (corpus hash, Python-core commit)" is stated once and referenced consistently; no leftover "run Python live in CI" language remains elsewhere in the oracle section.
  • Line-count bump (not asked, but worth noting): the review notes said "~900 lines" beyond schema; the revised doc says "~2 000 lines" (matching the PR description). I checked ownlang/ownir.py — it's 2430 lines total, and the beyond-schema logic (to_module onward through check_facts/DI/effect findings) is roughly 1700–1900 lines, so "~2 000" is the more accurate figure, not an inconsistency — just flagging that it silently diverges from the number in the notes it cites, in case anyone cross-checks the two docs later.

Nothing else in the diff (span leaf placement, byte-offset/line-index note, NonZeroU32 IDs, SmallVec/#[cold]/enum-size additions, error-text fixtures) contradicts another section — each maps 1:1 to a numbered finding in the review notes and is applied at every place the topic recurs in the doc.

Overall: this is a clean, well-targeted revision. Only the two cosmetic notes above (explicit own-bridge → own-cli arrow, the line-count drift vs. the cited notes) are worth a follow-up tweak, and neither blocks anything.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

CodeRabbit cosmetic: '{all of the above}' after the own-bridge block
implied but didn't spell out that own-cli is the one crate allowed to
depend on the bridge — now it does. (The other note, the ~900 vs ~2000
line-count drift vs p022-review-notes.md, resolves in favor of this doc:
the measured to_module..check_facts span is ~1.7-1.9k lines, so ~2k is
the accurate figure; the notes stay untouched as a historical record.)

Copy link
Copy Markdown
Owner Author

Thanks — both cosmetic notes handled in b3748e0:

  • Explicit bridge→cli edge: the diagram now reads {all of the above, incl. own-bridge} ─▶ own-cli, so the one-allowed-dependent rule is visible in the picture, not just the fitness section.
  • Line-count drift (~900 vs ~2 000): resolving in favor of this doc — your own measurement (to_module through check_facts ≈ 1.7–1.9k of the 2 430-line file) confirms ~2 000 is the accurate figure. p022-review-notes.md stays untouched as the historical review record; the commit message notes the divergence so a future cross-checker isn't puzzled.

The salsa-under-Open-questions placement stays as is per your read: whether is settled (Gate B), how/when is the genuinely open part.


Generated by Claude Code

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 59c7509d83

ℹ️ 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".

Comment on lines +26 to +27
So the VS/VS Code extension hosts the existing C# extractor and talks to the Rust
core over the **OwnIR seam** (stdio or FFI) — the very seam this proposal freezes.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reserve a bridge consumer for FFI

With this wording, the C# editor path may use FFI, but the fitness function later says nothing except own-cli may depend on own-bridge. In the FFI scenario there must be a cdylib/API crate or LSP server that calls the facts→verdict bridge; otherwise the proposal only permits stdio through the CLI. Please either drop FFI here or add that API crate to the allowed-edge exception so the architecture test doesn't forbid the stated extension shape.

Useful? React with 👍 / 👎.

# own-diagnostics depends only on own-ir/own-syntax spans — never on the solver.
# own-diagnostics depends only on the span/location leaf — never on the solver.

own-ir + own-cfg + own-analysis + own-diagnostics ─▶ own-bridge

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Add own-syntax to the bridge edge set

own-bridge is described as doing facts→core-AST lowering, and this document puts the AST in own-syntax while own-cfg only lowers AST→CFG. If the allowed graph omits own-syntax, the bridge cannot construct the AST without an undeclared dependency or a leaky re-export through own-cfg, so the first edge-set test will encode the wrong boundary. Add own-syntax to this wide consumer, or change the bridge to lower directly to CFG.

Useful? React with 👍 / 👎.

Comment on lines +134 to +136
depends on **it** to construct verdicts. Depends only on the span/location leaf
(`own-ir`) — **not** on `own-syntax`, or the presentation crate drags in the
parser. Mirrors today's clean split (`evidence.py` is a pure projection).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3 Badge Remove the stale own-syntax diagnostics edge

This bullet now makes own-diagnostics depend only on the span leaf in own-ir, but the topology explanation just above still says the same crate depends on own-ir/own-syntax. That leaves two conflicting allowed-edge sets for the presentation crate and could accidentally permit the parser dependency this paragraph is trying to forbid. Update the earlier prose to name only the span leaf.

Useful? React with 👍 / 👎.

Comment on lines +457 to +459
core on every CI pass: commit its outputs as **golden snapshots keyed by
(corpus hash, Python-core commit)** and diff Rust against the snapshots; regenerate
only when Python itself changes (already the exception, not the rule). Otherwise CI

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3 Badge Regenerate snapshots when corpus inputs change

These snapshots are keyed by (corpus hash, Python-core commit), but this sentence only allows regeneration when Python changes. When a fixture/corpus file is added or edited during the ratchet, the Python commit can be identical while the expected outputs must be regenerated for the new corpus hash; otherwise CI either diffs Rust against stale outputs or cannot cover the new input. Make the regeneration rule trigger on either key changing.

Useful? React with 👍 / 👎.

…r, snapshot keys

Four findings, all confirmed doc-consistency defects:

- own-syntax added to own-bridge's edge set (P2): the bridge lowers
  facts to core-AST nodes, and the AST lives in own-syntax — without the
  edge the first cargo-metadata test would encode a boundary the bridge
  cannot satisfy (undeclared dep or a leaky re-export through own-cfg).
  Diagram, crate bullet, and fitness rule all updated.
- Stale 'own-ir/own-syntax' in the topology prose (P3): own-diagnostics
  depends only on the span leaf in own-ir; the earlier paragraph still
  allowed the parser edge the bullet forbids. Now names only the leaf.
- FFI vs only-own-cli (P2): the Why permits stdio OR FFI, but the
  fitness rule only allowed own-cli to depend on the bridge — which
  would forbid the stated extension shape. Rule now reads 'only
  entry-point crates' (own-cli today; future own-lsp / own-capi cdylib),
  never a core crate.
- Snapshot regeneration on either key (P3): (corpus hash, py commit)
  keyed snapshots regenerate on a corpus/fixture change too, not only a
  Python change — otherwise CI diffs stale outputs or skips new inputs.

Copy link
Copy Markdown
Owner Author

@codex all four folded in 4d5f0d7 — each was a real consistency defect:

  • own-syntax added to the bridge edge set (P2 @95) — correct: the lowering constructs core-AST nodes, so without the edge the first cargo metadata test would encode a boundary the bridge can't satisfy. Diagram, crate bullet, and fitness rule all updated.
  • Stale own-ir/own-syntax in the topology prose (P3 @136) — the earlier paragraph still permitted the parser edge the bullet forbids; it now names only the span leaf in own-ir.
  • FFI vs only-own-cli (P2 @27) — the fitness rule now reads "only entry-point crates may depend on own-bridge" (own-cli today; a future own-lsp / own-capi cdylib when the IDE's FFI shape lands), never a core crate — so the edge test no longer forbids the extension shape the Why states.
  • Snapshot regeneration on either key (P3 @459) — regeneration now triggers on a corpus/fixture change too, not only a Python-core change; steady state still runs zero Python.

Generated by Claude Code

@chatgpt-codex-connector

Copy link
Copy Markdown

Summary

Testing

  • git status --short
  • git log --oneline -5
  • rg -n "own-ir \\+ own-syntax|entry-point|either key changes|own-diagnostics.*own-syntax|own-bridge|corpus/fixture|stdio or FFI|own-capi|own-lsp" docs/proposals/P-022-rust-core-migration.md
  • nl -ba docs/proposals/P-022-rust-core-migration.md | sed -n '88,106p;128,148p;408,420p;456,468p'

No commit or PR was created because the requested fixes were already present and the working tree had no changes.

View task →

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.

2 participants