Skip to content

chore(types): remove dead protoMethodsMs field and stale comment#1494

Merged
carlos-alm merged 17 commits into
mainfrom
fix/native-func-prop-1432
Jun 14, 2026
Merged

chore(types): remove dead protoMethodsMs field and stale comment#1494
carlos-alm merged 17 commits into
mainfrom
fix/native-func-prop-1432

Conversation

@carlos-alm

Copy link
Copy Markdown
Contributor

The core work for #1432 landed in b5c03a2runPostNativePrototypeMethods was deleted and Pattern 3 (fn.method = function(){} / arrow) was added to the Rust extractor. Two dead-code artifacts were not cleaned up:

  • protoMethodsMs?: number in BuildResult.phases — declared, never set by any surviving code path
  • The parseFilesWasmForBackfill docstring still mentioned "prototype-methods post-pass" alongside this-dispatch, but only the this-dispatch post-pass uses symbolsOnly now

Removes both. Lint and prototype-method-resolution integration tests (WASM + native) pass.

Closes #1432

… 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.
Adds .github/workflows/perf-canary.yml — a path-filtered workflow that
fires on PRs touching src/extractors/, src/domain/graph/, or crates/**
and runs only the incremental-benchmark suite (full build + no-op +
1-file rebuild, both engines). Catches the class of regressions that
accumulated invisibly across the Phase 8.x PRs and were only detected
at v3.12.0 publish time.

The regression guard gains BENCH_CANARY=1 mode: raises thresholds to
50%/100%/150% (standard/noisy/WASM) and skips the build, query, and
resolution suites — only incremental checks run. This absorbs shared-
runner timing variance while still blocking catastrophic regressions
(+98% full build, +1827% 1-file rebuild from v3.12.0).

Closes #1433
On incremental builds, runPostNativeCha previously scanned all
call→qualified-method edges in the DB (~12ms flat, O(graph size)),
even for 1-file changes where no hierarchy or RTA evidence changed.

Add two cheap indexed gate queries. Gate A checks whether any changed
file introduced a class/interface/trait/struct/record node (hierarchy
may have new implementors reachable from unchanged call sites). Gate B
checks whether any changed file added a call edge to a class-kind target
(RTA set may have grown, enabling previously filtered expansions in
unchanged callers). If neither gate fires, restrict the candidate query
to src.file IN changedFiles — safe because the hierarchy and instantiated
set are unchanged for all other files.

Full builds (isFullBuild=true) and cases where either gate fires retain
the existing full-scan behaviour. Mirrors the changed-files scoping
pattern of runPostNativeThisDispatch.

Closes #1441
Times each JS post-pass in tryNativeOrchestrator and exposes the
measurements in BuildResult.phases:

- gapDetectMs  — dropped-language gap detection + backfill
- chaMs        — CHA expansion (interface dispatch)
- thisDispatchMs — this/super dispatch WASM re-parse (was already
                   tracked but now properly named alongside the rest)
- reclassifyMs — scoped role re-classification after edge insertion
- techniqueBackfillMs — technique-column UPDATE on native-written edges

Previously only thisDispatchMs was reported, causing wall-clock vs
phaseSum to diverge by 1.1s+ on 1-file rebuilds and making benchmark
regressions undiagnosable from committed history.

Updates update-incremental-report.ts to render the new phases in a
collapsible details block under each engine's 1-file rebuild section.

Closes #1434
…ld for required-tier grammars

The docstring claimed pool cost was "amortised over enough parse work" —
measurements show IPC overhead scales linearly (~55–64ms/file pool vs
~8–10ms/file inline). The real motivation is crash safety for exotic WASM
grammars (#965); JS/TS/TSX (required-tier, used in all this-dispatch
backfill calls) have never triggered the V8 fatal crash class and are safe
to run inline.

Raise threshold 16 → 32 to keep typical this-dispatch batches (≤ 18 files
on the codegraph corpus) on the inline fast path. Exotic-language drops are
almost always well under 32 files and also benefit from the inline path
without meaningful crash risk increase.

Closes #1435
…e incremental rebuilds

On 1-file native incremental builds, two JS post-passes ran unconditionally
even when they had no work to do:

- `backfillNativeDroppedFiles`: called whenever changedCount > 0, even when
  detectDroppedLanguageGap returned an empty gap. Gate now checks
  gap.missingAbs.length > 0 || gap.staleRel.length > 0 directly, matching
  backfillNativeDroppedFiles's own internal early-exit guard.

- Node/edge COUNT(*) re-count: ran unconditionally after all post-passes even
  when none of them wrote any edges. COUNT(*) over 50K+ edge tables is
  non-trivial, especially via the NativeDbProxy napi-rs round-trip. Now gated
  on postPassWroteData (backfill | CHA edges | this-dispatch edges).

Closes #1454
The post-pass it timed (runPostNativePrototypeMethods) was deleted in
b5c03a2 when func-prop extraction moved to Rust (#1432). The optional
field was never set by any code path that survived the deletion.

Also remove the stale reference to "prototype-methods post-pass" from
the parseFilesWasmForBackfill docstring — only the this-dispatch
post-pass uses symbolsOnly now.

Closes #1432
@claude

claude Bot commented Jun 13, 2026

Copy link
Copy Markdown

Claude finished @carlos-alm's task —— View job


PR Review

  • Gather context
  • Read changed files
  • Analyze phases 1-5
  • Post final assessment

Phase 1: Root Cause Analysis

Problem Being Solved: Two dead-code artifacts remained after runPostNativePrototypeMethods was deleted in b5c03a2 (#1432):

  1. protoMethodsMs?: number in BuildResult.phases — declared but never written by any surviving code path
  2. The parseFilesWasmForBackfill JSDoc mentioned "prototype-methods and this-dispatch post-passes" when only the this-dispatch post-pass remains

Why This Approach: These are straightforward deletions of genuinely dead code — no behavior changes, no logic alterations. Correct approach.

Risk Assessment: Minimal. protoMethodsMs was optional (?:), so any code reading it already had to handle undefined. Removing it from the type contract makes the interface more honest. The docstring fix is a pure comment edit.


Phase 2: Configuration Change Detection

No lint rules changed, no tsconfig modifications, no test configuration touched. Clean.


Phase 3: Test Integrity

No test files modified. The PR description states "prototype-method-resolution integration tests (WASM + native) pass" — consistent with a pure dead-code removal that cannot affect runtime behavior.


Phase 4: Code Quality

src/types.ts:1268–1270 — Removal of protoMethodsMs?: number is correct. The field was optional, so removing it is a non-breaking change at runtime (existing callers reading .phases.protoMethodsMs will just get undefined as before — no change). At the type level it is now properly absent from the contract, which is strictly better.

src/domain/parser.ts:1262–1264 — The docstring update is accurate. Before: "prototype-methods and this-dispatch post-passes". After: "this-dispatch post-pass". This reflects the current code reality: parseFilesWasmForBackfill is called from the this-dispatch post-pass with symbolsOnly: true, and from the dropped-language backfill with symbolsOnly: false (default). The prototype-methods pass no longer exists. The edit is minimal and precise.

No concerns on either change.


Phase 5: Backlog Compliance

  • Zero-dep: ✓ — No dependency changes whatsoever.
  • Foundation-aligned: ✓ — Pure cleanup; no new infrastructure, no cloud calls, no agent behavior.
  • Problem-fit: 2/5 — Maintenance cleanup. Doesn't directly reduce token waste or prevent hallucinated deps, but type hygiene marginally improves agent accuracy when consuming BuildResult. Appropriate to bundle with the parent fix (Native engine: extract func-prop methods (fn.method = function(){}) in Rust to eliminate the WASM post-pass #1432).
  • Breaking: No — protoMethodsMs was ?: optional; removing it from the type is backward-compatible at the value level. Any consumer that compiled with protoMethodsMs: someValue would have been a type error before this PR anyway, since nothing set it.
  • Tier: 1 (zero-dep ✓, foundation-aligned ✓)

Final Assessment

## Root Cause Analysis
Problem Being Solved: Remove two dead-code artifacts left over from the #1432 deletion of
  runPostNativePrototypeMethods.
Why This Approach: Smallest correct fix — delete the optional field from the type contract and
  update the docstring to match the surviving code path.
Risk Assessment: Negligible. The field was optional and never written; callers already handled
  undefined. No runtime behavior changes.

## Backlog Compliance
- Zero-dep: ✓
- Foundation-aligned: ✓
- Problem-fit: 2/5 — maintenance cleanup, not a user-facing feature
- Breaking: No
- Tier: 1

## Critical Concerns
None.

## Final Recommendation
- Rating: ⭐⭐⭐⭐ (4/5)
- Action: APPROVE
- Reasoning: Correct, minimal, well-scoped cleanup. The two removals are independently
  verifiable as dead code. Commit message accurately describes both changes and links the
  parent issue. No configuration relaxations, no test weakening, no new deps.

@greptile-apps

greptile-apps Bot commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR cleans up two dead-code artifacts left over after runPostNativePrototypeMethods was deleted in b5c03a2: the protoMethodsMs?: number field in BuildResult.phases (never set by any surviving code path) and the stale "prototype-methods post-pass" mention in the parseFilesWasmForBackfill docstring. It also introduces a new /resolve skill for context-aware merge-conflict resolution — an addition not mentioned in the PR description.

  • src/types.ts (visible in commit 61a9839, net-neutral in the final diff vs main): removes the protoMethodsMs optional field and its JSDoc.
  • src/domain/parser.ts: tightens the parseFilesWasmForBackfill docstring to reference only the surviving this-dispatch post-pass.
  • .claude/skills/resolve/SKILL.md: adds a 527-line, 7-phase skill that checks out a PR branch, traces conflict origins to their source PRs via gh, resolves with full context, verifies both-sides intent, and pushes — with an explicit stop condition for ambiguous conflicts.

Confidence Score: 5/5

Safe to merge: the TypeScript changes are pure dead-code and docstring cleanup with no logic impact; the new skill file operates only when explicitly invoked and touches no production code paths.

Both TypeScript changes are mechanical removals of a field that was never written and a comment that was no longer accurate — neither alters any runtime behaviour. The new SKILL.md adds a developer tool with no production coupling. The only real nit is that the skill hardcodes optave/codegraph rather than deriving the repo dynamically, but this is a maintenance concern, not a correctness defect in the current setup.

.claude/skills/resolve/SKILL.md — the hardcoded --repo optave/codegraph in every gh call is worth revisiting before the skill is shared or the target repo is renamed.

Important Files Changed

Filename Overview
.claude/skills/resolve/SKILL.md New /resolve skill for context-aware merge-conflict resolution across 7 phases; hardcodes optave/codegraph throughout, which works for this ops-tool's intended target but would silently fail against any other repo without edits. PR description omits this addition entirely.
src/domain/parser.ts Docstring-only update: removes stale "prototype-methods post-pass" reference from parseFilesWasmForBackfill; no logic changes.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["/resolve <pr-number>"] --> B["Phase 0: Pre-flight\nVerify git, gh, jq; fetch PR metadata"]
    B --> C["Phase 1: Branch Setup\ngh pr checkout; git merge origin/base"]
    C --> D{Conflicts?}
    D -- No --> E["Exit clean"]
    D -- Yes --> F["Phase 2: Conflict Archaeology\nTrace incoming commits → source PRs\nFetch source PR descriptions & diffs"]
    F --> G["Phase 3: Current PR Context\nRead this PR's description & per-file diffs"]
    G --> H["Phase 4: Resolution\nEdit files; apply both-sides intent\nStage by name (never git add .)"]
    H --> I{Ambiguous?}
    I -- Yes --> J["STOP — explain to user\nwhat decision is needed"]
    I -- No --> K["Phase 5: Verification\nDiff vs both parents; confirm\nno intentional change was dropped"]
    K --> L["Phase 6: Validation\nRun tests & lint"]
    L --> M["Phase 7: Commit & Push\ngit commit; git push\nclean up .codegraph/resolve/"]
Loading

Reviews (2): Last reviewed commit: "fix: resolve merge conflicts with main" | Re-trigger Greptile

@github-actions

Copy link
Copy Markdown
Contributor

Codegraph Impact Analysis

1 functions changed0 callers affected across 0 files

  • BuildResult.phases in src/types.ts:1261 (0 transitive callers)

Base automatically changed from fix/native-incremental-speed-1454 to fix/backfill-threshold-1435 June 14, 2026 02:00
Base automatically changed from fix/backfill-threshold-1435 to main June 14, 2026 05:53
@carlos-alm carlos-alm merged commit f98763b into main Jun 14, 2026
23 checks passed
@carlos-alm carlos-alm deleted the fix/native-func-prop-1432 branch June 14, 2026 06:38
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 14, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Native engine: extract func-prop methods (fn.method = function(){}) in Rust to eliminate the WASM post-pass

1 participant