Skip to content

Commit d595770

Browse files
CopilotSMSDAOCopilot
authored
Repository health & dependency repair system with automated monitoring (#53)
* Initial plan * Phase 1 & 2: Fix dependency versions and create repair/monitoring infrastructure Co-authored-by: SMSDAO <[email protected]> * Harmonize all TypeScript and @types/node versions across workspace Co-authored-by: SMSDAO <[email protected]> * Final: Complete repository health and dependency repair implementation Co-authored-by: SMSDAO <[email protected]> * Update .husky/pre-commit Co-authored-by: Copilot <[email protected]> * Update scripts/repair-dependencies.sh Co-authored-by: Copilot <[email protected]> * Apply code review fixes: improve error handling, security, and completeness - Add ORACLE-REPORT.md to .gitignore (generated artifact) - Fix wc -l empty string counting in master.sh and oracle.sh - Fix report generation duplicate analysis in oracle.sh (cache results) - Fix filename-with-spaces handling in pre-commit hook (use while-read loop) - Fix git add security issue in pre-commit (safe iteration) - Add missing packages to harmonization checks (frames, strategy-worker) - Fix GitHub Actions cd command to use subshell - Remove unused badge generation steps from workflow Addresses review comments from copilot-pull-request-reviewer[bot] Co-authored-by: SMSDAO <[email protected]> * Fix Next.js version in packages/frames to match harmonized 14.2.18 - Updated packages/frames/package.json: next ^14.1.0 → 14.2.18 - Ensures all 3 packages with Next.js use same version - Completes dependency harmonization across all packages All harmonization checks now pass successfully. Co-authored-by: SMSDAO <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: SMSDAO <[email protected]> Co-authored-by: Copilot <[email protected]>
1 parent 3b3ff5c commit d595770

File tree

11 files changed

+1437
-630
lines changed

11 files changed

+1437
-630
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ web-build/
3131

3232
# Generated reports
3333
AUDIT-REPORT.md
34+
ORACLE-REPORT.md
3435

3536
# Smart Brain cache
3637
.smartbrain/cache/

.husky/_/husky.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ Please remove the following two lines from $0:
66
. \"\$(dirname -- \"\$0\")/_/husky.sh\"
77
88
They WILL FAIL in v10.0.0
9-
"
9+
"

.smartbrain/README.md

Lines changed: 67 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,9 @@ CastQuest Ecosystem
108108

109109
# Auto-deploy with validation
110110
.smartbrain/brain.sh auto
111+
112+
# Run Smart Brain Oracle for insights
113+
.smartbrain/oracle.sh all
111114
```
112115

113116
### Full Auto-Deploy Workflow
@@ -200,18 +203,81 @@ Protected Paths:
200203

201204
## Integration with Master.sh
202205

203-
The Smart Brain works seamlessly with `scripts/master.sh`:
206+
The Smart Brain works seamlessly with `scripts/master.sh` and the Oracle:
204207

205208
```bash
206209
# Use Smart Brain for git operations
207210
.smartbrain/brain.sh auto
208211

212+
# Use Oracle for dependency insights
213+
.smartbrain/oracle.sh all
214+
209215
# Use master.sh for system operations
210216
scripts/master.sh deploy production
211217
scripts/master.sh workers start
212218
scripts/master.sh monitor
219+
220+
# Combined health workflow
221+
.smartbrain/oracle.sh all && scripts/master.sh health
222+
```
223+
224+
## Smart Brain Oracle
225+
226+
The Smart Brain Oracle provides AI-powered repository insights:
227+
228+
### Features
229+
230+
- **Dependency Health Analysis**: Version consistency and compatibility checks
231+
- **Security Vulnerability Detection**: Automated scanning for known issues
232+
- **Version Upgrade Recommendations**: Intelligent upgrade suggestions with compatibility analysis
233+
- **Deprecated Package Monitoring**: Track and alert on obsolete packages
234+
- **Performance Improvement Suggestions**: Optimization recommendations
235+
- **Monorepo Structure Analysis**: Architecture insights and improvements
236+
- **Predictive Maintenance Warnings**: Proactive alerts before issues arise
237+
- **Dependency Graph Visualization**: Visual representation of relationships
238+
- **Smart Conflict Resolution**: Intelligent dependency conflict fixing
239+
240+
### Oracle Usage
241+
242+
```bash
243+
# Run all analyses
244+
.smartbrain/oracle.sh all
245+
246+
# Specific analyses
247+
.smartbrain/oracle.sh analyze # Dependency health
248+
.smartbrain/oracle.sh security # Security scan
249+
.smartbrain/oracle.sh upgrades # Upgrade recommendations
250+
.smartbrain/oracle.sh deprecated # Deprecated packages
251+
.smartbrain/oracle.sh performance # Performance tips
252+
.smartbrain/oracle.sh structure # Monorepo analysis
253+
.smartbrain/oracle.sh warnings # Predictive warnings
254+
.smartbrain/oracle.sh graph # Dependency graph
255+
.smartbrain/oracle.sh conflicts # Conflict resolution
256+
.smartbrain/oracle.sh integration # System integration status
257+
.smartbrain/oracle.sh report # Comprehensive report
258+
259+
# View generated report
260+
cat ORACLE-REPORT.md
213261
```
214262

263+
### Oracle Integration with CI/CD
264+
265+
The Oracle is integrated into the GitHub Actions workflow:
266+
267+
```yaml
268+
# .github/workflows/dependency-health.yml
269+
- name: Run Smart Brain Oracle
270+
run: .smartbrain/oracle.sh report
271+
272+
- name: Upload Oracle Report
273+
uses: actions/upload-artifact@v3
274+
with:
275+
name: oracle-report
276+
path: ORACLE-REPORT.md
277+
```
278+
279+
See [docs/DEPENDENCY-HEALTH.md](../docs/DEPENDENCY-HEALTH.md) for comprehensive documentation.
280+
215281
## Configuration
216282
217283
Configuration is stored in `.smartbrain/config.json`:

apps/admin/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@
3333
"zustand": "^4.4.7"
3434
},
3535
"devDependencies": {
36-
"@types/node": "^20.10.0",
36+
"@types/node": "20.10.6",
3737
"@types/react": "^18.2.0",
3838
"@types/react-dom": "^18.2.0",
3939
"@types/ws": "^8.5.10",
4040
"autoprefixer": "^10.4.16",
4141
"postcss": "^8.4.32",
4242
"tailwindcss": "^3.4.0",
43-
"typescript": "^5.3.0"
43+
"typescript": "5.3.3"
4444
}
4545
}

packages/core-services/package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,16 @@
3434
"devDependencies": {
3535
"@types/bcrypt": "^5.0.2",
3636
"@types/cors": "^2.8.17",
37+
"@types/node": "20.10.6",
3738
"@types/express": "^4.17.21",
3839
"@types/jsonwebtoken": "^9.0.5",
3940
"@types/node": "^20.10.6",
4041
"@types/nodemailer": "^6.4.14",
42+
"tsx": "^4.7.0",
43+
"typescript": "5.3.3",
44+
"tsc-alias": "^1.8.8",
45+
"vitest": "^1.1.1",
46+
"eslint": "^8.56.0",
4147
"@types/pg": "^8.16.0",
4248
"@typescript-eslint/eslint-plugin": "^6.18.0",
4349
"@typescript-eslint/parser": "^6.18.0",

packages/frames/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"typecheck": "tsc --noEmit"
1313
},
1414
"dependencies": {
15-
"next": "^14.1.0",
15+
"next": "14.2.18",
1616
"react": "^18.2.0",
1717
"react-dom": "^18.2.0",
1818
"frames.js": "^0.11.0",
@@ -21,10 +21,10 @@
2121
"zod": "^3.22.4"
2222
},
2323
"devDependencies": {
24-
"@types/node": "^20.10.6",
24+
"@types/node": "20.10.6",
2525
"@types/react": "^18.2.48",
2626
"@types/react-dom": "^18.2.18",
27-
"typescript": "^5.3.3",
27+
"typescript": "5.3.3",
2828
"eslint": "^8.56.0",
2929
"eslint-config-next": "^14.1.0",
3030
"@typescript-eslint/eslint-plugin": "^6.18.0",

packages/neo-ux-core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
"devDependencies": {
2222
"@types/react": "^18.0.0",
2323
"@types/react-dom": "^18.0.0",
24-
"typescript": "^5.3.0"
24+
"typescript": "5.3.3"
2525
}
2626
}

packages/sdk/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
"docs:json": "typedoc --json ../../docs-site/sdk/api.json"
2020
},
2121
"devDependencies": {
22-
"@types/node": "^20.0.0",
22+
"@types/node": "20.10.6",
2323
"typedoc": "^0.25.0",
2424
"typedoc-plugin-markdown": "^3.17.0",
25-
"typescript": "^5.3.0"
25+
"typescript": "5.3.3"
2626
},
2727
"dependencies": {
2828
"viem": "^2.0.0"

packages/strategy-worker/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@
1515
},
1616
"devDependencies": {
1717
"ts-node": "^10.9.2",
18-
"typescript": "^5.4.0"
18+
"typescript": "5.3.3"
1919
}
2020
}

0 commit comments

Comments
 (0)