Skip to content

fix(structural): preserve decorator declaration provenance - #51

Merged
nia-sg-bot merged 1 commit into
mainfrom
nia/issue-22-decorator-provenance
Sep 10, 2026
Merged

fix(structural): preserve decorator declaration provenance#51
nia-sg-bot merged 1 commit into
mainfrom
nia/issue-22-decorator-provenance

Conversation

@nia-sg-bot

@nia-sg-bot nia-sg-bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • include Python decorators in the deterministic source span and content hash for the wrapped class/function declaration
  • prevent decorator-only edits from being reported as unchanged symbols
  • retain Tree-sitter evidence from the first decorator line through the declaration end, with regression coverage

Validation

  • python3 -m pytest -q (161 passed)
  • git diff --check
  • npm run compile-tests in WildestAI/wildest-vscode-ext

Compatibility

No schema, CLI option, or JSON shape changed. This corrects existing symbol change_kind and AST evidence for decorated Python declarations; the VS Code TypeScript consumer compiles against the unchanged v2 contract. Website release claims remain unchanged because this is unreleased.

Part of #22

Remaining #22 work includes additional deterministic Python baseline and fixture coverage beyond decorated-declaration provenance.

Summary by CodeRabbit

  • Bug Fixes

    • Changes to function or class decorators are now correctly reflected when detecting modified declarations.
    • Structural evidence ranges now include decorators associated with functions and classes.
  • Tests

    • Added coverage to verify decorator edits are identified as declaration changes.

@coderabbitai

coderabbitai Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: a5ca4c34-6e4b-4446-957c-1783ac407cae

📥 Commits

Reviewing files that changed from the base of the PR and between 5aece97 and 1e9d632.

📒 Files selected for processing (2)
  • diffgraph/structural.py
  • tests/test_structural.py

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


Walkthrough

Python structural analysis now includes decorators in class and function symbol spans and hashes. Tests verify that changing a function decorator marks the function as modified and includes the decorator in AST evidence.

Changes

Decorator-aware declaration tracking

Layer / File(s) Summary
Include decorators in declaration evidence
diffgraph/structural.py, tests/test_structural.py
Decorated class and function definitions now use the wrapper range and content hash. Structural tests verify decorator changes update the function symbol and AST evidence range.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 1e9d6

Decorator edits now correctly update declaration provenance and AST evidence. The change is covered by passing tests and compilation, with no merge-blocking risk identified.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: preserving decorator provenance in structural analysis.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch nia/issue-22-decorator-provenance

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nia-sg-bot nia-sg-bot added roadmap Tracked on the public WildestAI roadmap priority:P0 Critical path / blocks a usable product direction:aligned Aligned with the current WildestAI product direction labels Sep 10, 2026
@nia-sg-bot

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@nia-sg-bot
nia-sg-bot merged commit da07d0b into main Sep 10, 2026
4 checks passed
@nia-sg-bot
nia-sg-bot deleted the nia/issue-22-decorator-provenance branch September 10, 2026 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

direction:aligned Aligned with the current WildestAI product direction priority:P0 Critical path / blocks a usable product roadmap Tracked on the public WildestAI roadmap

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant