Unify region-kind vocabulary (6.4.1) - #55
Conversation
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 53 minutes Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab. 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: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (23)
WalkthroughUnify ChangesRegionKind vocabulary unification
Sequence Diagram(s)sequenceDiagram
participant ExtractSyntax
participant extract_document_from_ir
participant TreeSitter
participant IrRegionKind
participant ExtractDocument
ExtractSyntax->>extract_document_from_ir: dispatch syntax extraction
extract_document_from_ir->>TreeSitter: build canonical IR
TreeSitter->>IrRegionKind: emit enum-derived region spelling
TreeSitter-->>extract_document_from_ir: return IR regions
extract_document_from_ir->>ExtractDocument: attach IR and bridge regions
Possibly related PRs
Suggested labels: Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 19 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (19 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
@coderabbitai resume |
✅ Action performedReviews resumed. |
|
@coderabbitai Please suggest a fix for this issue and supply a prompt for an AI coding agent to enable it to apply the fix. Include the file and symbol names indicated in the issue at the head of your response. Ensure that this is validated against the current version of the codegraph. If further refinement to address this finding would be deleterious, please supply a clear explanatory one to two paragraph markdown message I can paste into the CodeScene web ui's diagnostic suppression function so this diagnostic can be silenced. crates/stilyagi-extract/tests/extract/ir_identity.rs Comment on file #[rstest]
fn shared_markdown_fixture_has_a_golden_ir_snapshot() {
let document = stilyagi_test_support::golden_markdown_ir_fixture(SHARED_MARKDOWN_FIXTURE_PATH)
.unwrap_or_else(|error| panic!("expected shared Markdown golden IR: {error}"));❌ Getting worse: Code Duplication |
This comment was marked as resolved.
This comment was marked as resolved.
ab4530c to
059c8d3
Compare
|
@coderabbitai resume |
✅ Action performedReviews resumed. |
Commit the recovered planning artefacts so continue-mode recovery can resume from durable git state after the stopped workflow. This does not implement the roadmap task or mark it complete.
Add the extract-to-IR region-kind mapping so shared bridge spellings come from `stilyagi_ir::RegionKind`. Record the Work item 1 drift evidence and gate results in the ExecPlan.
Add integration tests that prove extract-emitted IR region kinds belong to the canonical `stilyagi_ir` vocabulary, with `document` kept as the explicit bridge-only exception.
Replace the Python and Rust tree-sitter region-kind literals with `stilyagi_ir::RegionKind` spellings so the IR vocabulary stays the single source of truth at the producer boundary.
Keep the rebased Rust doc-comment builder aligned with `origin/main` by restoring the IR type imports while retaining the shared RegionKind spelling source. Record the rebase finding in the plan.
Mark the completed ExecPlan consistently and update its test harness paths to match the registered integration entry point and shared helpers.
Use descriptive test expectations accepted by the Whitaker lint suite. Record the verified follow-up and successful gates in the ExecPlan.
Consolidate the Markdown and Python shared fixture cases while preserving their existing snapshot names.
Update the developer guide to describe the bridge region-kind API, including the non-exhaustive bridge enum, its helper, and the mapping into . Mark roadmap item 6.4.1 complete and record the verification in the associated exec plan so the docs and roadmap state stay aligned.
Replace the stale two-variant declaration and remove the adjacent duplicate enum example.
Add public helper examples and make the bridge-only Document invariants explicit in both vocabulary test layers. Clarify canonical emitted spelling ownership in the ExecPlan.
Require every non-Document bridge kind to map to IR and pin emitted kind spellings per extraction fixture. Record the review follow-up in the ExecPlan.
Move region and error concerns out of the oversized crate root while preserving the public extraction API. Add focused vocabulary, error-source, and Rustdoc coverage, and record the verified review decisions in the ExecPlan.
Clarify private extraction helpers and distinguish Rust bridge vocabulary helpers from the Python-facing region-kind API.
Route Python and Rust extraction through one private IR conversion path while preserving their syntax-specific builders and error mapping.
Explain the bridge-region and canonical-IR boundaries in private extraction helpers, and validate shared bridge spellings through the IR vocabulary without changing unsupported-spelling errors.
Call the shared canonical-IR conversion helper directly from the syntax dispatcher and retain language-specific outcomes alongside each arm.
b75daeb to
8442eee
Compare
Summary
This branch implements roadmap task (6.4.1): it makes
stilyagi_ir::RegionKindthe canonical source for emitted shared region spellings, adds explicit bridge-to-
IR vocabulary guards, and removes remaining tree-sitter copies of shared
spelling literals. This prevents silent divergence while retaining the
bridge-only
documentregion and its separate parser contract.Roadmap task: (6.4.1)
ExecPlan: docs/execplans/roadmap-6-4-1.md
The branch also parameterizes the shared Markdown and Python IR snapshots,
updates the developer and roadmap documentation, and replaces lint-disallowed
panic closures in affected Rust tests.
Review Walkthrough
RegionKindmapping, canonicalas_strforwarding,ALL, Rustdoc examples, and explicitDocumentexception guard.Validation
make check-fmt: passedmake test: passed, including workspace tests, doctests, and Python testsmake typecheck: passedmake lint: passed, including Clippy, Rustdoc, Whitaker, and Python checksmake markdownlint: passedmake nixie: passedcoderabbit review --agent: completed with zero findingsNotes
stilyagi_extract::RegionKind::Documentremains intentionally bridge-only:ir_region_kind()returnsNone, andstilyagi_ir::RegionKind::try_from("document")rejects it. Shared emitted spellings forward through the IR enum; the bridge
TryFrom<&str>remains a separate, test-pinned parser.References