Feat/ai contract completion assistance - #593
Merged
Nanle-code merged 3 commits intoJul 23, 2026
Merged
Conversation
|
@Power70 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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.
Description
Adds
starforge complete, an intelligent offline completion assistant forSoroban contracts. It suggests context-aware code completions, generates
accurate boilerplate, fills in function stubs, suggests imports, and infers
types. The engine is rule-based and dependency-free (std-only), so it runs
instantly with no network access or model download.
Closes #508
Type of Change
Changes Made
src/utils/completion.rs— std-only completion engine: source analysis, context-aware suggestions, boilerplate generation, function-stub completion, import inference, and type inference.src/commands/complete.rs—starforge completeCLI withsuggest,boilerplate,stub,imports, andinfersubcommands (human +--jsonoutput).Completecommand intosrc/main.rs,src/commands/mod.rs, andsrc/utils/mod.rs.tests/completion_assistant.rs— CLI integration tests.enum Commands, wire the previously-unregisteredMigratevariant into both dispatch matches, and drop a duplicatepub mod simulate;—masterdid not compile without these.Testing
How has this been tested?
The std-only engine and the stub-splicing logic were compiled and run
standalone with
rustc --test(the full crate could not be built in the devsandbox — see Additional Context). CLI behaviour is covered by integration
tests that shell out to the built binary.
Reproduce:
Test Coverage
Describe what scenarios have been tested:
--writeapplying generated bodies.letbindings incl.mut, brace balance/indentation preserved when splicing stub bodies.Code Quality Checklist
cargo fmt)cargo clippy -- -D warnings)Breaking Changes
None — this adds a new, self-contained command and does not alter existing behaviour.
Documentation
Module- and command-level rustdoc is included; usage is discoverable via
starforge complete --help.Screenshots (if applicable)
N/A — CLI feature.
Additional Context
The full crate could not be compiled in the development sandbox: the crates.io
registry was unreachable and
tokio's transitive dependencies were not cached.Logic was therefore validated by compiling the std-only portions standalone
with
rustc --test(23 engine unit tests pass; stub-splicing verified). Thethin CLI layer follows existing command patterns (
migrate.rs,gas.rs,lint.rs). Please run the checks below in CI.Note: Make sure all tests pass locally before submitting:
cargo test cargo fmt --all cargo clippy -- -D warnings