Skip to content

Commit 3058a64

Browse files
authored
Merge pull request #11 from d-oit/feature/quality-check-optimization
🎯 GOAP Quality Check Optimization - Complete Performance Overhaul
2 parents b68e204 + f7842a4 commit 3058a64

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+2720
-792
lines changed

.cargo/config.toml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Cargo configuration for faster builds
2+
[build]
3+
# Use multiple CPU cores for compilation
4+
jobs = 4
5+
6+
# Enable incremental compilation
7+
incremental = true
8+
9+
# Use faster linker on Unix systems
10+
[target.x86_64-unknown-linux-gnu]
11+
rustflags = ["-C", "link-arg=-fuse-ld=lld"]
12+
13+
[target.x86_64-pc-windows-msvc]
14+
rustflags = ["-C", "link-arg=/DEBUG:NONE"]
15+
16+
# Faster builds for development
17+
[profile.dev]
18+
# Optimize for compilation speed
19+
opt-level = 0
20+
debug = 1 # Line numbers only, not full debug info
21+
incremental = true
22+
23+
# Fast clippy profile
24+
[profile.clippy]
25+
inherits = "dev"
26+
opt-level = 0
27+
debug = false

.github/workflows/optimized-ci.yml

Lines changed: 229 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,229 @@
1+
# Optimized CI Pipeline - GOAP Phase 3 Implementation
2+
# Parallel quality checks with intelligent caching and incremental testing
3+
4+
name: Optimized Quality Check
5+
6+
on:
7+
push:
8+
branches: [ main, develop, feature/* ]
9+
pull_request:
10+
branches: [ main, develop ]
11+
12+
env:
13+
CARGO_TERM_COLOR: always
14+
RUST_BACKTRACE: 1
15+
16+
jobs:
17+
# Pre-check job to determine what changed
18+
changes:
19+
runs-on: ubuntu-latest
20+
outputs:
21+
cli: ${{ steps.changes.outputs.cli }}
22+
core: ${{ steps.changes.outputs.core }}
23+
output: ${{ steps.changes.outputs.output }}
24+
storage: ${{ steps.changes.outputs.storage }}
25+
ci: ${{ steps.changes.outputs.ci }}
26+
steps:
27+
- uses: actions/checkout@v4
28+
- uses: dorny/paths-filter@v2
29+
id: changes
30+
with:
31+
filters: |
32+
cli:
33+
- 'crates/cli/**'
34+
core:
35+
- 'crates/core/**'
36+
output:
37+
- 'crates/output/**'
38+
storage:
39+
- 'crates/storage/**'
40+
ci:
41+
- '.github/workflows/**'
42+
- 'Cargo.toml'
43+
- 'Cargo.lock'
44+
45+
# Parallel format checking
46+
format:
47+
runs-on: ubuntu-latest
48+
steps:
49+
- uses: actions/checkout@v4
50+
- uses: dtolnay/rust-toolchain@stable
51+
with:
52+
components: rustfmt
53+
- name: Cache cargo registry
54+
uses: actions/cache@v3
55+
with:
56+
path: |
57+
~/.cargo/registry
58+
~/.cargo/git
59+
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
60+
- name: Check formatting
61+
run: cargo fmt --all -- --check
62+
63+
# Parallel clippy checking per crate
64+
clippy-cli:
65+
runs-on: ubuntu-latest
66+
needs: changes
67+
if: needs.changes.outputs.cli == 'true' || needs.changes.outputs.ci == 'true'
68+
steps:
69+
- uses: actions/checkout@v4
70+
- uses: dtolnay/rust-toolchain@stable
71+
with:
72+
components: clippy
73+
- name: Cache cargo build
74+
uses: actions/cache@v3
75+
with:
76+
path: target
77+
key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}
78+
- name: Clippy CLI crate
79+
run: cargo clippy -p code_guardian_cli --all-targets --all-features -- -D warnings
80+
81+
clippy-core:
82+
runs-on: ubuntu-latest
83+
needs: changes
84+
if: needs.changes.outputs.core == 'true' || needs.changes.outputs.ci == 'true'
85+
steps:
86+
- uses: actions/checkout@v4
87+
- uses: dtolnay/rust-toolchain@stable
88+
with:
89+
components: clippy
90+
- name: Cache cargo build
91+
uses: actions/cache@v3
92+
with:
93+
path: target
94+
key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}
95+
- name: Clippy Core crate
96+
run: cargo clippy -p code-guardian-core --all-targets --all-features -- -D warnings
97+
98+
clippy-output:
99+
runs-on: ubuntu-latest
100+
needs: changes
101+
if: needs.changes.outputs.output == 'true' || needs.changes.outputs.ci == 'true'
102+
steps:
103+
- uses: actions/checkout@v4
104+
- uses: dtolnay/rust-toolchain@stable
105+
with:
106+
components: clippy
107+
- name: Cache cargo build
108+
uses: actions/cache@v3
109+
with:
110+
path: target
111+
key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}
112+
- name: Clippy Output crate
113+
run: cargo clippy -p code-guardian-output --all-targets --all-features -- -D warnings
114+
115+
clippy-storage:
116+
runs-on: ubuntu-latest
117+
needs: changes
118+
if: needs.changes.outputs.storage == 'true' || needs.changes.outputs.ci == 'true'
119+
steps:
120+
- uses: actions/checkout@v4
121+
- uses: dtolnay/rust-toolchain@stable
122+
with:
123+
components: clippy
124+
- name: Cache cargo build
125+
uses: actions/cache@v3
126+
with:
127+
path: target
128+
key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}
129+
- name: Clippy Storage crate
130+
run: cargo clippy -p code-guardian-storage --all-targets --all-features -- -D warnings
131+
132+
# Parallel testing per crate
133+
test-cli:
134+
runs-on: ubuntu-latest
135+
needs: changes
136+
if: needs.changes.outputs.cli == 'true' || needs.changes.outputs.ci == 'true'
137+
steps:
138+
- uses: actions/checkout@v4
139+
- uses: dtolnay/rust-toolchain@stable
140+
- name: Cache cargo build
141+
uses: actions/cache@v3
142+
with:
143+
path: target
144+
key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.lock') }}
145+
- name: Test CLI crate
146+
run: cargo test -p code_guardian_cli
147+
148+
test-core:
149+
runs-on: ubuntu-latest
150+
needs: changes
151+
if: needs.changes.outputs.core == 'true' || needs.changes.outputs.ci == 'true'
152+
steps:
153+
- uses: actions/checkout@v4
154+
- uses: dtolnay/rust-toolchain@stable
155+
- name: Cache cargo build
156+
uses: actions/cache@v3
157+
with:
158+
path: target
159+
key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.lock') }}
160+
- name: Test Core crate
161+
run: cargo test -p code-guardian-core
162+
163+
test-output:
164+
runs-on: ubuntu-latest
165+
needs: changes
166+
if: needs.changes.outputs.output == 'true' || needs.changes.outputs.ci == 'true'
167+
steps:
168+
- uses: actions/checkout@v4
169+
- uses: dtolnay/rust-toolchain@stable
170+
- name: Cache cargo build
171+
uses: actions/cache@v3
172+
with:
173+
path: target
174+
key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.lock') }}
175+
- name: Test Output crate
176+
run: cargo test -p code-guardian-output
177+
178+
test-storage:
179+
runs-on: ubuntu-latest
180+
needs: changes
181+
if: needs.changes.outputs.storage == 'true' || needs.changes.outputs.ci == 'true'
182+
steps:
183+
- uses: actions/checkout@v4
184+
- uses: dtolnay/rust-toolchain@stable
185+
- name: Cache cargo build
186+
uses: actions/cache@v3
187+
with:
188+
path: target
189+
key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.lock') }}
190+
- name: Test Storage crate
191+
run: cargo test -p code-guardian-storage
192+
193+
# Integration build check
194+
build:
195+
runs-on: ubuntu-latest
196+
steps:
197+
- uses: actions/checkout@v4
198+
- uses: dtolnay/rust-toolchain@stable
199+
- name: Cache cargo build
200+
uses: actions/cache@v3
201+
with:
202+
path: target
203+
key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}
204+
- name: Build all crates
205+
run: cargo build --workspace
206+
207+
# Summary job that requires all checks to pass
208+
quality-check-complete:
209+
runs-on: ubuntu-latest
210+
needs: [format, build, clippy-cli, clippy-core, clippy-output, clippy-storage, test-cli, test-core, test-output, test-storage]
211+
if: always()
212+
steps:
213+
- name: Check all jobs succeeded
214+
run: |
215+
if [[ "${{ needs.format.result }}" != "success" ]] ||
216+
[[ "${{ needs.build.result }}" != "success" ]] ||
217+
[[ "${{ needs.clippy-cli.result }}" != "success" && "${{ needs.clippy-cli.result }}" != "skipped" ]] ||
218+
[[ "${{ needs.clippy-core.result }}" != "success" && "${{ needs.clippy-core.result }}" != "skipped" ]] ||
219+
[[ "${{ needs.clippy-output.result }}" != "success" && "${{ needs.clippy-output.result }}" != "skipped" ]] ||
220+
[[ "${{ needs.clippy-storage.result }}" != "success" && "${{ needs.clippy-storage.result }}" != "skipped" ]] ||
221+
[[ "${{ needs.test-cli.result }}" != "success" && "${{ needs.test-cli.result }}" != "skipped" ]] ||
222+
[[ "${{ needs.test-core.result }}" != "success" && "${{ needs.test-core.result }}" != "skipped" ]] ||
223+
[[ "${{ needs.test-output.result }}" != "success" && "${{ needs.test-output.result }}" != "skipped" ]] ||
224+
[[ "${{ needs.test-storage.result }}" != "success" && "${{ needs.test-storage.result }}" != "skipped" ]]; then
225+
echo "❌ Quality check failed"
226+
exit 1
227+
else
228+
echo "✅ All quality checks passed!"
229+
fi

.opencode/agent/ci-agent.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,6 @@ For verification tasks (e.g., "Verify no warnings or errors"):
6565
- Process: Launch rust-expert-agent for clippy, testing-agent for tests, aggregate results.
6666
- Output: Verification report from coordinated agents.
6767

68-
## Changelog
69-
- Initial version: Basic CI/CD setup for Rust projects.
70-
- Optimization: Added orchestration focus, best practice workflow with agent handoff coordination for comprehensive CI tasks.
71-
7268
## Error Scenarios
7369
- Agent failures: Retry or substitute with alternatives (e.g., use general agent if specialized fails).
7470
- Pipeline issues: Troubleshoot via rust-expert-agent or core-agent.

.opencode/agent/clean-code-developer.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,6 @@ To develop or refactor code that is clear, testable, and professional, adhering
5353
- Process: Apply clean code principles, explain changes.
5454
- Output: Refactored code with summary.
5555

56-
## Changelog
57-
- Initial version: Clean code development and refactoring.
58-
5956
## Error Scenarios
6057
- Ambiguous requirements: Seek user clarification.
6158
- Complex systems: Break into modular components.

.opencode/agent/cli-agent.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@ To build user-friendly, robust CLI commands using clap, integrate modules, handl
3434
- Process: Use clap to build command, integrate into CLI.
3535
- Output: Code for new command with help and error handling.
3636

37-
## Changelog
38-
- Initial version: CLI development and maintenance.
39-
4037
## Error Scenarios
4138
- Invalid input: Provide comprehensive error messages.
4239
- Integration issues: Ensure modular structure.

.opencode/agent/code-review-agent.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@ To catch style violations, security vulnerabilities, and deviations from best pr
4141
- Process: Analyze for style and security.
4242
- Output: Flagged issues with suggestions.
4343

44-
## Changelog
45-
- v1.0.0 (2025-10-06): Initial creation with diff analysis, style, and security checks.
46-
4744
## Error Scenarios
4845
- Critical issues: Escalate to human reviewers.
4946
- Tool failures: Troubleshoot and rerun checks.

.opencode/agent/codebase-analyzer.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@ To provide detailed analysis of code components, focusing on implementation, dat
3535
- Process: Read entry points, trace code paths, identify patterns.
3636
- Output: Structured analysis with sections like Entry Points, Core Implementation, Data Flow.
3737

38-
## Changelog
39-
- Initial version: Implementation detail analysis with references.
40-
4138
## Error Scenarios
4239
- Files not found: Report inability to analyze.
4340
- Incomplete information: Ask for more details.

.opencode/agent/codebase-consolidator.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,6 @@ To maintain clean, efficient codebases by identifying and eliminating redundanci
5353
- Process: Identify and merge similar functions.
5454
- Output: Cleaned code with explanations.
5555

56-
## Changelog
57-
- Initial version: Consolidation and cleanup for maintainability.
58-
5956
## Error Scenarios
6057
- Ambiguous requirements: Seek clarification on focus areas.
6158
- Large codebases: Focus on specified sections.

.opencode/agent/codebase-locator.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@ To provide structured file locations for features or topics, categorized by type
3636
- Process: Search keywords, check directories, categorize.
3737
- Output: Structured list of implementation, test, config files.
3838

39-
## Changelog
40-
- Initial version: File location and categorization.
41-
4239
## Error Scenarios
4340
- No matches found: Report and suggest broader terms.
4441
- Ambiguous queries: Ask for more details.

.opencode/agent/codebase-pattern-finder.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@ To provide concrete code examples and patterns for new work, showing variations,
3535
- Process: Search for similar features, extract code.
3636
- Output: Multiple patterns with code, tests, and recommendations.
3737

38-
## Changelog
39-
- Initial version: Pattern finding and example extraction.
40-
4138
## Error Scenarios
4239
- No patterns found: Suggest related terms.
4340
- Complex requests: Break down into categories.

0 commit comments

Comments
 (0)