refactor(native): extract emit_pts_alias_edges params into struct#1485
Conversation
… diff Adds snapshot-pre-bash.sh (PreToolUse Bash) + track-bash-writes.sh (PostToolUse Bash): the pre-hook captures git status --porcelain to a per-worktree temp file before each Bash call; the post-hook diffs the before/after state and appends newly modified or created files to .claude/session-edits.log. This closes the gap where files written by sed -i, printf redirects, tee, heredocs, or build tools (Cargo.lock, lockfiles) were never recorded, causing guard-git.sh to emit false-positive BLOCKED errors. Closes #1457
- clojure.rs: annotate lifetime-anchor assignment to silence false-positive - cfg.rs: remove never-called start_line_of method - complexity.rs: remove never-constructed NotHandled variant; convert irrefutable if-let patterns to plain let destructures - dataflow.rs: remove never-read callee fields from CallReturn/Destructured - incremental.rs: remove never-read lang field from CacheEntry cargo check and cargo clippy both clean after these changes.
|
Claude finished @carlos-alm's task —— View job PR Review
Root Cause AnalysisProblem Being Solved: Why This Approach: Correct approach — the lint was pointing at a real design smell. A context struct is idiomatic Rust for this pattern. The parameters grouped ( Risk Assessment: Low. Pure structural refactor; no logic paths changed. The struct is Code Quality ObservationsPositive:
Minor observations (no blocking issues):
Backlog Compliance
Problem-fit = 1 note: Per the review rubric, this warrants flagging as low-priority / tangential. However, removing a Final Recommendation
|
Greptile SummaryThis PR refactors
Confidence Score: 5/5Safe to merge — the change is a pure parameter-grouping refactor with no logic modifications. Every access of the original positional parameters is mechanically replaced by the corresponding No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["process_file()"] -->|"builds PtsAliasCtx { pts, lookup_name, call_line,\ncaller_id, caller_name, is_dynamic,\nrel_path, imported_names, type_map }"| B["emit_pts_alias_edges(ctx, &alias_ctx, seen_edges, pts_edge_map, edges)"]
B --> C["resolve_via_points_to(alias_ctx.lookup_name, alias_ctx.pts)"]
C --> D["for each alias: resolve_call_targets()"]
D --> E["sort_targets_by_confidence()"]
E --> F["compute edge_key\n(alias_ctx.caller_id << 32 | t.id)"]
F --> G{{"t.id != caller_id\n&& not in seen_edges\n&& not in pts_edge_map"}}
G -->|yes| H["compute_confidence() - HOP_PENALTY\nif > 0.0 → push ComputedEdge"]
G -->|no| I["skip"]
Reviews (4): Last reviewed commit: "fix: resolve merge conflicts with main" | Re-trigger Greptile |
Codegraph Impact Analysis2 functions changed → 16 callers affected across 1 files
|
|
Acknowledged Claude's review: the struct field ordering (is_dynamic: u32 leaking storage concern) and the interleaved field order are pre-existing decisions. Both are accepted as-is — the struct is internal (pub(crate)) and refactoring the u32 encoding to bool would be a separate concern (no issue filed since it's in an existing stable pattern). No blocking items. |
Groups the 14 parameters of
emit_pts_alias_edgesinbuild_edges.rsinto aPtsAliasCtxstruct, removing the#[allow(clippy::too_many_arguments)]suppression. No behavior change.Closes #1475