feat(analysis): Stellar-aware issue and PR analysis - #206
Open
ZacLou wants to merge 1 commit into
Open
Conversation
…yinkxLab#204) Add detection-driven Stellar/Soroban awareness to the existing Phase 6 issue and PR analysis flows. When Stellar signals are detected in the repository or PR diff, a Stellar-aware section is appended to the prompt covering contract-specific concerns (authorization, storage keys, extend_ttl, panic!/unwrap in contract paths, cross-contract calls). When not detected, behavior is identical to the current generic review. Changes: - _FileAdapter: adapts GitHub file dicts (filename/patch) into detection- compatible objects with .path and .content attributes - _adapt_pr_files: converts PR changed-file dicts for detect_stellar_project - _adapt_repo_files: converts repo file dicts/tuples for detection - _safe_detect: wraps detection with try/except, never crashes analysis - analyze_pull_request: runs detection on PR files, appends Stellar review section when detected, returns stellar_detected flag - analyze_issue: accepts optional repo_files param, appends Stellar guidance section when detection is positive Tests (29, all passing): - _PRFileAdapter and adapter coverage - Stellar PR includes section, non-Stellar PR excludes it - stellar_detected flag true/false cases - Detection failure falls back to generic - AI failure returns error message - Stellar issue includes section, non-Stellar excludes it - Detection uncertainty falls back safely - Backward compatibility (no repo_files = generic) Closes AyinkxLab#203, Closes AyinkxLab#204
Author
|
Hi @AyinkxLab team 👋 A quick follow-up as the Stellar Wave 8 deadline is today (August 31, 2026). If there's any feedback or requested changes, I'm ready to address them right away. Thank you for reviewing! |
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.
Summary
This PR implements detection-driven Stellar/Soroban awareness for the existing Phase 6 issue and PR analysis flows (#203, #204). When Stellar signals are detected in the repository or PR diff, a Stellar-aware section is appended to the prompt covering contract-specific concerns. When not detected, behavior is identical to the current generic review.
Changes
app/services/analysis.py(+140/-5)_FileAdapter— Adapts GitHub file dicts (filename/patch) into detection-compatible objects with.pathand.contentattributes, sodetect_stellar_project()can consume them without re-implementing detection._adapt_pr_files()— Converts PR changed-file dicts into adapter objects for detection._adapt_repo_files()— Converts repo file dicts or tuples into adapter objects for detection (supports both dict and tuple forms)._safe_detect()— Wrapsdetect_stellar_project()with try/except so detection failure never crashes analysis (falls back to generic).analyze_pull_request()— Automatically runs detection on PR files via the adapter. When Stellar signals are found, appends a Soroban review section covering authorization patterns,panic!/unwrapin contract paths, storage keys,extend_ttl, cross-contract calls, and Stellar config files. Returns astellar_detectedboolean flag.analyze_issue()— Accepts an optionalrepo_fileskeyword argument. When provided and detection is positive, appends a Stellar guidance section covering Soroban SDK/XDR concerns, contract structure, and network behaviour.tests/test_stellar_aware_analysis.py(new, 29 tests)Covers all acceptance criteria from both issues:
#203 (PR analysis):
#204 (Issue analysis):
Adapter tests:
Backward compatibility:
Design decisions
detect_stellar_project(), not a manualstellar=trueparameter (per Stellar-aware issue analysis #204 requirement)._FileAdapterbridges the gap between GitHub API dicts (filename/patch) and the detection module's interface (.path/.content), without modifying detection.[CONFIRMED]/[SUGGESTION]labeling and uncertainty framing are preserved in all prompts.Closes #203, Closes #204