Resync Rust port to graphify-py v0.8.19 (d9debdf)#10
Conversation
Ports: - `.NET` project-file extractors: `.sln`, `.csproj` / `.fsproj` / `.vbproj`, `.razor` / `.cshtml`. New `dotnet.rs` extractor module in `graphify-extract`, wired into the dispatch table; `.sln` / `.csproj` / `.fsproj` / `.vbproj` / `.razor` / `.cshtml` added to `CODE_EXTENSIONS` in `graphify-detect`. - Devin CLI install/uninstall: new platform module in `graphify-hooks` with both user-scope (`~/.config/devin/...`) and project-scope (`.devin/...` + `.windsurf/rules/graphify.md`) variants, plus `graphify devin install/uninstall` subcommand. - tsconfig `extends` array (TypeScript 5.0): `read_tsconfig_aliases` now accepts a string OR an array of paths, processes parents in order, and skips scoped npm configs per entry. Fixes silent alias-resolution failure on TS 5 repos. - Nested `worktrees/` skip-dir: `is_noise_dir` takes an optional parent name and treats `worktrees` nested inside a dotted dir (`.claude/worktrees/`, `.git/worktrees/`) as noise. - Chinese query segmentation in `graphify-serve`: `query_terms` now bigram-segments terms containing CJK Unified Ideographs and keeps the original term alongside the bigrams. Hiragana / Katakana / Hangul fall through as single terms. - Wiki null `source_file` regression test (#1016): Rust's pattern match already handled `Value::Null`; added a parity test to lock the behavior in. Workspace version bumped to 0.8.19. `Cargo.lock` updated. README.md and USAGE.md updated to reflect actual `graphify-out/` contents (the previous "3 files" listing missed every sidecar) and to mention the new .NET formats and Devin platform. Ave Deus Mechanicus
Applies the trivial findings from CodeRabbit's review of the resync
commit:
- Wiki regression test now asserts the community article file
("Parsing_Layer.md") was emitted, not just the index, tightening
the #1016 guard against silent rendering failures.
- `CSPROJ_MAX_BYTES` is documented as a parity-locked literal that
matches `graphify-py`'s 2 MiB limit. Lowering or raising it
belongs in a coordinated parity bump, so it stays a constant.
- `labels` and `relations` helpers in the .NET parity-language
tests get `#[must_use]` so a forgotten assertion would surface as
a warning.
Two CodeRabbit findings flagged as critical (`remove_skill` errors
dropped in `devin_uninstall` / `devin_project_uninstall`) are false
positives: `remove_skill` is declared as `fn(&Path)` and swallows
errors internally by design, matching the existing `pi_uninstall`
pattern. There is no `Result` to propagate.
Glory to the Omnissiah
A trivial follow-up from CodeRabbit's second review pass — annotating the `is_searchable` predicate in `graphify-serve` with `#[must_use]` so an accidentally-discarded boolean result would surface as a warning. Matches the workspace convention for pure predicates. By the will of the Machine God
CodeRabbit flagged the brace-counting loop in `extract_razor`'s
`@code { ... }` body finder for not handling braces inside strings,
char literals, or comments. The graphify-py reference
(`extract_razor` in `extract.py`) uses the identical brace-only
algorithm, so adding lexer state would diverge from byte-identical
parity, which the resync explicitly preserves.
Documented the decision inline so future readers see the parity
constraint and don't repeat the request. The behavioural impact is
bounded: a pathological string like `"}{";` inside a method body
could shrink `block_end`, but the downstream method-name regex
only fires on declaration-shaped lines, so any false truncation
silently drops methods rather than producing spurious nodes.
A line from the Adeptus Mechanicus Prayerbook:
"The Machine remembers, even when we forget."
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughThis PR increments the workspace version to 0.8.19, adds .NET (.sln/.csproj/.razor) extractors and tests, integrates Devin CLI installers (user & project) with project rules, supports TS ChangesRelease 0.8.19: .NET Support and Devin Integration
Estimated code review effort🎯 4 (Complex) | ⏱️ ~75 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
Decode XML entities in attr_ci. quick-xml's normalized_value applies XML 1.0 attribute-value normalization including entity unescaping, so a `PackageReference Include="A&B"` becomes a literal `A&B` node label — matching ElementTree's behaviour in graphify-py. Tighten .NET parity tests with `r.error.is_none()` guards on the success paths of `sln_contains_edges`, `sln_project_dependency`, and the `csproj_*` / `razor_*` tests that previously inspected nodes or edges without first checking for an extractor error. Replace the OS-specific `/nonexistent/file.razor` path in `razor_missing_file` with a child of a `tempfile::tempdir()` that is never created — works on Windows where `/nonexistent/...` would otherwise resolve against the current drive. Update `devin_uninstall` / `devin_project_uninstall` docs to match the actual error contract: skill removal is best-effort because the shared `remove_skill` helper swallows filesystem errors by design. `devin_project_uninstall` still propagates errors from removing `.windsurf/rules/graphify.md`. The bigram-segmentation finding (cross-script bigrams) is left as-is: graphify-py's `_segment_chinese` fallback uses the identical `text[i:i+2]` algorithm across raw characters with no script boundary, and parity is the goal of this resync. By the will of the Machine God
Two long-standing defects in `graphify-py` were ported verbatim during the v0.8.19 resync and disputed earlier on parity grounds. Per the project rule that bugs in the Python reference are NOT requirements, both are fixed here with regression tests and the divergences documented inline. Chinese bigram segmentation (`graphify-serve`): - `segment_chinese_bigram` now walks contiguous runs of CJK Unified Ideographs and emits bigrams only **within** each run. Cross-script tokens like "a前b" no longer produce noisy "a前" and "前b" pairs; the unsegmented original is still preserved for exact-substring matches. - Python's `_segment_chinese` fallback walked raw character pairs with no script awareness; the noise was invisible there only because jieba (when installed) sidestepped the path entirely. @code brace counter in `extract_razor` (`graphify-extract`): - New `find_csharp_block_end` state machine tracks line comments, block comments, regular strings (with `\` escape), verbatim strings (with `""` escape), interpolated strings, and char literals. Braces inside any of those don't count toward depth. - The previous Python-style brace-only counter truncated `block_end` early on bodies containing `"}{"` or `}` in a comment, silently dropping every method declared below that point. New regression tests: - `query_terms_chinese_mixed_script_does_not_bigram_across_scripts` - `razor_code_block_brace_counter_ignores_strings_and_comments` Full workspace gate: 1418 tests pass (was 1416, +2). A line from the Adeptus Mechanicus Prayerbook: "To break is to mend; the Machine learns through its scars."
CodeRabbit flagged that the new .NET extension list (`.fsproj`, `.vbproj`, `.cshtml`) is wired into the dispatch table but never exercised — the existing parity tests cover `.csproj` and `.razor` only. Add three smoke tests that build tiny tempdir fixtures and assert `extract_csproj` / `extract_razor` succeed and emit nodes for each new extension. These complement the dispatch-table check in `parity.rs::test_dispatch_table` (which only verifies `_get_extractor` returns Some for each ext) by running the real extractor end-to-end. Glory to the Omnissiah
d84c9a6 to
d26171a
Compare
Summary
Resyncs the Rust workspace with
graphify-pyv0.8.19, picking up everything between submodule3efae38..d9debdf.extract_sln,extract_csproj, andextract_razorin adotnet.rsextractor module, plus.sln/.csproj/.fsproj/.vbproj/.razor/.cshtmladded toCODE_EXTENSIONS. Captures NuGet refs, project-to-project deps, target frameworks,@using/@inject/@inherits/@model, Blazor components, and@codemethods.graphify devin install/uninstall(and--project) writing to~/.config/devin/skills/...plus.windsurf/rules/graphify.md. Devin reads.windsurf/rules/*.mdthe same way Windsurf IDE does.extendsarray fix —read_tsconfig_aliasesnow accepts a string OR an array of paths, processing parents in order and skipping scoped npm configs per entry. Closes the silent alias-drop on TS 5 repos.worktrees/skip —is_noise_dirtakes an optional parent and treats.claude/worktrees/,.git/worktrees/, etc. as noise.query_termsbigram-segments CJK-Unified-Ideograph runs (no jieba dep; Python's_jieba is Nonefallback path is the active one in Rust).source_fileregression — the RustValue::String(_)pattern match already handles this; added a parity test to lock it in.Submodule pointer advanced separately on the first commit so the resync is bisectable. Workspace version bumped to 0.8.19.
Cargo.lockupdated.cargo upgrade --incompatibleis a no-op — every workspace dep is already at the latest major.Documentation updates
The README/USAGE
graphify-out/listing claimed only three files; updated to show the full set (canonical outputs + sidecars + opt-in artefacts likewiki/,GRAPH_TREE.html,cypher.txt). Language list mentions .NET; installer list mentions Devin.Test plan
cargo nextest run --workspace— 1416 tests pass (2 skipped, both net-prefixed)cargo clippy --all-targets --all-features --workspace— cleancargo fmt— cleanhk check— cleanSummary by CodeRabbit
New Features
Bug Fixes
Documentation