feat(ai): create AI quality gate presets for PR bots (resolves #779) - #1020
Open
TheWeirdDee wants to merge 1 commit into
Open
TheWeirdDee wants to merge 1 commit into
TheWeirdDee wants to merge 1 commit into
Conversation
…code#779) - Add `conservative`, `default`, and `strict` presets for AI quality gates - Add `--preset` and `--github-annotations` CLI flags to `ai quality-gate` commands - Guarantee zero-leak secret redaction in quality gate reports and GitHub workflow annotations - Add comprehensive `starforge-gates.example.toml` configuration template - Add unit/integration tests in `tests/ai_quality_gate_presets.rs` validating preset hierarchies, custom rules, and secret redaction - Add `docs/AI_QUALITY_GATES.md` detailing preset selection, PR bot GitHub Actions integration, and human-review boundaries
|
@TheWeirdDee 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.
Summary
Resolves #779.
This PR adds curated AI quality gate presets (
conservative,default,strict) and PR bot automation support to StarForge, with zero-leak secret redaction in all reports and GitHub Actions annotations.Changes Implemented
1. Preset Engine (
src/utils/ai_quality_gates.rs)QualityGatePresetenum with three curated profiles:conservative: Leniency for legacy repositories or rapid prototyping (quality score >= 50, coverage >= 50%, docs >= 50%, allows up to 10 unwraps and TODOs, permissive licensing).default/ Recommended: Production standard for Soroban smart contracts (quality score >= 70, coverage >= 80%, docs >= 80%, 0 unwraps, 0 TODOs, 0 high/critical vulnerabilities).strict: High-assurance financial-grade / mainnet protocol standards (quality score >= 90, coverage >= 90%, docs >= 95%, 0 medium/high vulnerabilities, 100ms benchmark cap).QualityGatePreset::config(&self)andwrite_preset_config(&Path, QualityGatePreset).redact_secretsinto all gate evaluation paths andredact_reportto prevent secret leakage.format_github_annotationsproducing sanitized::error/::warningworkflow commands for GitHub Actions PR bots.2. CLI Support (
src/commands/ai_quality_gate.rs)starforge ai quality-gate initwith--preset <conservative|default|strict>.starforge ai quality-gate checkwith:--preset <conservative|default|strict>(direct inline preset evaluation without file dependencies).--github-annotations(emits workflow commands for PR annotations).3. Example Configuration & Guide
starforge-gates.example.toml: Documented example configuration detailing every parameter, preset comparisons, custom regex/file check gates, and PR bot setup.docs/AI_QUALITY_GATES.md: Comprehensive guide covering preset selection, secret redaction guarantees, example GitHub Actions workflows with mocks, limitations, and human-review expectations.4. Tests
tests/ai_quality_gate_presets.rs: Integration and schema tests verifying preset threshold hierarchies, TOML roundtrip serialization, mock project evaluations, custom rules, and zero-leak secret redaction in annotations.Verification
[REDACTED]).Closes #779.