Resync Rust port to graphify-py v0.8.22 (43bf3c2)#14
Merged
Conversation
Routine `cargo update` refresh of transitively pinned crates ahead of the graphify-py v0.8.22 resync. Picks up patch and minor bumps for `jiff`, the `aws-sdk-*` family, `mio`, `socket2`, `zerocopy`, and `cmov`, and pulls in `arc-swap` as a new transitive dependency. No direct dependency declarations changed. Glory to the Omnissiah
Port the applicable v0.8.21..v0.8.22 changes from the `graphify-py` submodule into the Rust workspace. Ports: - BYOND DreamMaker support: new `extract_dm`/`extract_dmi`/`extract_dmm`/ `extract_dmf` extractors in `graphify-extract` (tree-sitter `.dm`/`.dme` source plus `.dmi` icon sheets, `.dmm` maps, `.dmf` interface forms), wired through the extension dispatch. Adds the `tree-sitter-dm` and `flate2` dependencies. `.dmi` zTXt decompression is capped at 1 MiB (the upstream decompression-bomb guard). - `graphify-detect`: register `.dm`/`.dme`/`.dmi`/`.dmm`/`.dmf` as code extensions, and stop applying ignore patterns to files under `graphify-out/memory` so a broad `.gitignore` rule cannot erase generated memory notes (#1047). - `graphify-extract`: treat Python `decorated_definition` as a transparent wrapper so `@property`/`@staticmethod`/`@classmethod` methods keep their class-qualified node id and their docstring rationale edge resolves (#1050). `Edge` gains an `external` flag for unresolved includes. - `graphify-dedup`: mirror Pass 1's `source_file` partition for identical labels in Pass 2 fuzzy matching (#1046). - `graphify-export`: remap hyperedges from semantic node ids to community ids when rendering the aggregated community meta-graph (#1006). - `graphify-llm` and the `extract` CLI: add `--mode deep`, which appends a deep-extraction instruction to the LLM system prompt for richer INFERRED architectural edges. Threaded through every backend and the corpus fan-out. Also bumps the workspace version to 0.8.22 and updates `README.md` and `USAGE.md` (supported formats, the `--mode` flag, edge vocabulary). Glory to the Omnissiah
- Use `.expect()` with descriptive messages on the four `.dm`/`.dmm`/`.dmf` static `LazyLock<Regex>` initializers instead of `.unwrap()`, matching the established `ids.rs` convention so a malformed literal surfaces a clear message. Swap the `#[allow]` to `clippy::expect_used` accordingly. - De-duplicate remapped hyperedge community IDs with an `IndexSet` (O(1), insertion-ordered) instead of a `Vec` + linear `contains` in the export aggregated-view path. By the will of the Machine God
|
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)
📝 WalkthroughWalkthroughAdds BYOND DreamMaker extractors and tests, introduces a per-edge ChangesAll changes
Estimated code review effort: Possibly Related PRs
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
|
Second review round on the graphify-py v0.8.22 resync branch.
Fixed:
- DM `#include` normalisation collapsed `../` to nothing, mis-resolving
parent-relative includes. graphify-py's `raw.lstrip("./")` has the same
bug because Python's `str.lstrip` treats its argument as a character
set; the Rust port now strips only a single leading `/` plus leading
`./` segments and preserves `../`. Added a parity test that resolves a
`../helpers.dm` include to a non-external `imports_from` edge.
- `--mode deep` printed "deep mode enabled: richer semantic extraction"
unconditionally. graphify-py prints it then hard-exits when no backend
is configured, but the Rust pipeline degrades to an AST-only run, so
the banner now reports the path that will actually execute.
- The semantic cache is keyed by file content only (mode-agnostic), so a
prior shallow extraction would mask the richer deep-mode prompt. Deep
mode now bypasses the cache read so it always re-extracts; fresh
results still populate the cache. graphify-py reads the cache
regardless, making `--mode deep` a silent no-op on cached files.
- `byond_extractors_error_on_missing_file` used a hard-coded absolute
path; it now derives the missing path from a `tempfile::tempdir`.
- `extract_mode_deep_prints_banner_and_succeeds` scrubbed only a partial
set of backend env vars. Added a `cli_no_backend` helper covering every
variable `detect_backend` inspects so the AST-only smoke test cannot
accidentally select a real LLM backend.
- `detect_memory_dir_bypasses_gitignore` now returns `Result` and uses
`?` instead of `.expect`, matching the project's preferred test style.
Documented (not changed): the DM call-resolution index intentionally
includes type nodes alongside procs, matching graphify-py; a name that
uniquely identifies a single node resolves, and any collision falls
through to `raw_calls`. CodeRabbit's suggested predicate misreads the
already-paren-stripped labels.
Glory to the Omnissiah
Route extract_mode_invalid_value_exits_2 through the backend-less helper for consistency with the sibling deep-mode test. clap rejects the bad value before backend detection runs, so behaviour is unchanged. By the will of the Machine God
CodeRabbit re-raised the DM call-resolution index. On reconsideration it is a legitimate latent bug rather than an intentional heuristic: there is no DreamMaker construct that calls a type-named identifier, yet the index mapped every node label (types included) by last path segment, so a bare call like `widget()` could resolve to the `/datum/widget` type node and emit a spurious `calls` edge. `label_to_nids` now indexes only callable proc nodes (their labels end in `()`); `path_to_nids` is unchanged so `new /type` instantiation still resolves. graphify-py indexes every label here, so this is a deliberate divergence (feature parity, not bug parity). No existing DM parity test regresses — the sample.dm fixture has no call/type name collision, so its output is unchanged. Added a focused test proving a colliding call lands in raw_calls instead of resolving to the type node. By the will of the Machine God
This was referenced Jun 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ports the applicable
graphify-pyv0.8.21..v0.8.22(43bf3c2) changes into the Rust workspace. Submodule pointer and workspace version both advance to0.8.22.Ported
extract_dm/extract_dmi/extract_dmm/extract_dmfextractors (graphify-extract/src/extractors/dm.rs) covering tree-sitter.dm/.dmesource,.dmiicon sheets,.dmmmaps, and.dmfinterface forms; wired into the extension dispatch. Adds thetree-sitter-dmandflate2deps..dmizTXt decompression is capped at 1 MiB (the upstream decompression-bomb guard).graphify-detect— register.dm/.dme/.dmi/.dmm/.dmfas code extensions, and stop applying ignore patterns to files undergraphify-out/memoryso a broad.gitignorerule can't erase generated memory notes (#1047).graphify-extract— treat Pythondecorated_definitionas a transparent wrapper so@property/@staticmethod/@classmethodmethods keep their class-qualified node id and their docstring rationale edge resolves (#1050).Edgegains anexternalflag for unresolved includes.graphify-dedup— mirror Pass 1'ssource_filepartition for identical labels in Pass 2 fuzzy matching (#1046).graphify-export— remap hyperedges from semantic node ids to community ids when rendering the aggregated community meta-graph (#1006).graphify-llm+extractCLI — add--mode deep, which appends a deep-extraction instruction to the LLM system prompt for richerINFERREDarchitectural edges. Threaded through every backend and the corpus fan-out.Also updates
README.md/USAGE.md(supported formats, the--modeflag, edge vocabulary).Notes / divergences
continuebranch reads as uncovered in llvm-cov. An observable-contract test asserts identical-label/different-file nodes stay unmerged..dmizTXt decompression degrades gracefully on a corrupt stream (keeps what decompressed cleanly) rather than aborting the extraction, an intentional improvement over the Python reference.graphify-py/tests/test_rationale.pyhas 13 tests; only the new v0.8.22 decorated-method case is ported (tests/parity_rationale.rs).Verification
cargo fmt,cargo clippy --all-targets --all-features --workspace,hk check— clean.cargo nextest run --workspace— 1501 passed, 2 skipped (network).dm.rscoverage: 94.85% region / 93.40% line (cargo llvm-cov nextest -p graphify-extract).findings: 0.Summary by CodeRabbit
New Features
Bug Fixes
Documentation
Tests
Chore