From b21cde5350c2ffe40cf5890aa7e5c03cae943455 Mon Sep 17 00:00:00 2001 From: sahil Date: Mon, 22 Dec 2025 21:25:04 +0530 Subject: [PATCH 1/8] repo clean-up --- .claude/tasks/README.md | 111 --- .claude/tasks/check-repo-status.md | 138 ---- .claude/tasks/commit.md | 54 -- .claude/tasks/create-issue.md | 105 --- .claude/tasks/create-pr.md | 88 --- .claude/tasks/merge-pr.md | 134 ---- .claude/tasks/pay-bounty.md | 142 ---- .claude/tasks/review-pr.md | 119 --- .github/ISSUE_TEMPLATE/bug_report.md | 2 +- .github/ISSUE_TEMPLATE/feature_request.md | 2 +- .github/workflows/automation.yml | 94 --- .github/workflows/ci.yml | 5 +- .github/workflows/phase-trigger.yml | 59 -- .github/workflows/welcome-fork.yml | 72 -- COMMANDS.md | 442 +++++++++++ Contributing.md | 12 +- NEXT_STEPS.md | 136 ---- bounties_owed.csv | 1 - bounties_paid.csv | 1 - contribution.md | 63 -- data/bounty-payments.csv | 1 - nginx-demo-output.txt | 14 - .../automation/cortex-master-automation.sh | 730 ------------------ .../automation/cortex-master-pr-creator.sh | 241 ------ .../automation/cortex-master-quarterback.sh | 712 ----------------- scripts/automation/cortex-master-update.sh | 301 -------- scripts/automation/cortex-master.sh | 194 ----- scripts/automation/cortex-pr-dashboard.sh | 362 --------- scripts/automation/focus-on-mvp.sh | 105 --- scripts/automation/manage_cortex_prs.sh | 435 ----------- scripts/deployment/audit_cortex_status.sh | 108 --- scripts/deployment/deploy_jesse_system.sh | 208 ----- scripts/deployment/setup_and_upload.sh | 55 -- scripts/deployment/upload_issue_34.sh | 36 - scripts/fetch-fork-emails.sh | 72 -- scripts/github/merge-mike-prs.sh | 81 -- scripts/github/organize-issues.sh | 51 -- scripts/github/review-contributor-prs.sh | 314 -------- scripts/github/setup-github-automation.sh | 114 --- scripts/recruit-ready.sh | 175 ----- test.md | 67 -- test/integration/__init__.py | 1 - test/run_all_tests.py | 37 - test/test_smart_stacks.py | 12 - test_parallel_llm.py | 319 -------- {test => tests}/integration/docker_utils.py | 0 .../integration/test_end_to_end.py | 4 +- tests/run_all_tests.py | 21 - .../test_cli.py => tests/test_cli_extended.py | 10 +- 49 files changed, 462 insertions(+), 6098 deletions(-) delete mode 100644 .claude/tasks/README.md delete mode 100644 .claude/tasks/check-repo-status.md delete mode 100644 .claude/tasks/commit.md delete mode 100644 .claude/tasks/create-issue.md delete mode 100644 .claude/tasks/create-pr.md delete mode 100644 .claude/tasks/merge-pr.md delete mode 100644 .claude/tasks/pay-bounty.md delete mode 100644 .claude/tasks/review-pr.md delete mode 100644 .github/workflows/automation.yml delete mode 100644 .github/workflows/phase-trigger.yml delete mode 100644 .github/workflows/welcome-fork.yml create mode 100644 COMMANDS.md delete mode 100644 NEXT_STEPS.md delete mode 100644 bounties_owed.csv delete mode 100644 bounties_paid.csv delete mode 100644 contribution.md delete mode 100644 data/bounty-payments.csv delete mode 100644 nginx-demo-output.txt delete mode 100644 scripts/automation/cortex-master-automation.sh delete mode 100644 scripts/automation/cortex-master-pr-creator.sh delete mode 100755 scripts/automation/cortex-master-quarterback.sh delete mode 100755 scripts/automation/cortex-master-update.sh delete mode 100755 scripts/automation/cortex-master.sh delete mode 100755 scripts/automation/cortex-pr-dashboard.sh delete mode 100755 scripts/automation/focus-on-mvp.sh delete mode 100755 scripts/automation/manage_cortex_prs.sh delete mode 100755 scripts/deployment/audit_cortex_status.sh delete mode 100644 scripts/deployment/deploy_jesse_system.sh delete mode 100644 scripts/deployment/setup_and_upload.sh delete mode 100755 scripts/deployment/upload_issue_34.sh delete mode 100755 scripts/fetch-fork-emails.sh delete mode 100755 scripts/github/merge-mike-prs.sh delete mode 100755 scripts/github/organize-issues.sh delete mode 100755 scripts/github/review-contributor-prs.sh delete mode 100644 scripts/github/setup-github-automation.sh delete mode 100755 scripts/recruit-ready.sh delete mode 100644 test.md delete mode 100644 test/integration/__init__.py delete mode 100644 test/run_all_tests.py delete mode 100644 test/test_smart_stacks.py delete mode 100755 test_parallel_llm.py rename {test => tests}/integration/docker_utils.py (100%) rename {test => tests}/integration/test_end_to_end.py (96%) delete mode 100644 tests/run_all_tests.py rename test/test_cli.py => tests/test_cli_extended.py (97%) diff --git a/.claude/tasks/README.md b/.claude/tasks/README.md deleted file mode 100644 index dbcc241c..00000000 --- a/.claude/tasks/README.md +++ /dev/null @@ -1,111 +0,0 @@ -# Cortex Linux - Claude Code Task Files - -Task files for Claude Code to automate common workflows. - -## Installation - -Copy these files to your Cortex repo: - -```bash -mkdir -p ~/cortex/.claude/tasks -cp *.md ~/cortex/.claude/tasks/ -``` - -Or keep them in a central location and reference with full path. - -## Available Tasks - -| Task | File | Description | -|------|------|-------------| -| **Commit** | `commit.md` | Create properly formatted git commits | -| **Create PR** | `create-pr.md` | Create pull requests with proper format | -| **Review PR** | `review-pr.md` | Review contributor PRs with checklist | -| **Merge PR** | `merge-pr.md` | Safely merge PRs and track bounties | -| **Create Issue** | `create-issue.md` | Create bounty issues with proper template | -| **Pay Bounty** | `pay-bounty.md` | Record and track bounty payments | -| **Repo Status** | `check-repo-status.md` | Get overview of PRs, issues, CI | - -## Usage in Claude Code - -### Method 1: Direct Task Reference -```bash -claude --task commit.md -claude --task review-pr.md 213 -claude --task check-repo-status.md -``` - -### Method 2: In Conversation -``` -/task review-pr.md 299 -``` - -### Method 3: Describe the Task -``` -Review PR #213 using the review checklist -``` - -## Task Arguments - -Some tasks accept arguments via `$ARGUMENTS`: - -| Task | Arguments | Example | -|------|-----------|---------| -| `review-pr.md` | PR number | `213` | -| `merge-pr.md` | PR number | `299` | -| `create-issue.md` | Feature description | `"add fuzzy search to CLI"` | -| `pay-bounty.md` | Payment details | `"PR 213 @user $100 btc tx123"` | - -## Workflow Examples - -### Daily Standup -```bash -claude --task check-repo-status.md -``` - -### Review and Merge a PR -```bash -claude --task review-pr.md 299 -# If approved: -claude --task merge-pr.md 299 -claude --task pay-bounty.md "PR 299 @Sahilbhatane $75 paypal PP-123" -``` - -### Create New Feature Issue -```bash -claude --task create-issue.md "Add semantic caching with GPTCache for offline mode" -``` - -### Commit and Push Changes -```bash -claude --task commit.md -claude --task create-pr.md -``` - -## File Locations - -Default paths used by these tasks: - -| File | Path | -|------|------| -| Bounty tracker | `~/cortex/data/bounty-payments.csv` | -| Task files | `~/cortex/.claude/tasks/` | -| Repo root | `~/cortex/` | - -## Requirements - -- GitHub CLI (`gh`) installed and authenticated -- Git configured with push access -- Repo cloned to `~/cortex/` - -## Customization - -Edit any `.md` file to adjust: -- Bounty amounts -- Review criteria -- PR/Issue templates -- Payment methods - -## Contributing - -These task files are part of the Cortex Linux project. -Improvements welcome via PR. diff --git a/.claude/tasks/check-repo-status.md b/.claude/tasks/check-repo-status.md deleted file mode 100644 index 2f6d2fbc..00000000 --- a/.claude/tasks/check-repo-status.md +++ /dev/null @@ -1,138 +0,0 @@ -# check-repo-status.md - -**allowed-tools:** Bash(gh pr list:*), Bash(gh issue list:*), Bash(gh run list:*), Bash(gh api:*), Bash(curl:*) -**description:** Get a complete status overview of the Cortex Linux repository - -## Your Task - -Provide a comprehensive status report of the repository. - -## Data to Gather - -### 1. Open Pull Requests -```bash -gh pr list --repo cortexlinux/cortex --state open --json number,title,author,createdAt,mergeable,reviewDecision --limit 30 -``` - -### 2. Recent CI Runs -```bash -gh run list --repo cortexlinux/cortex --limit 10 -``` - -### 3. Open Issues by Priority -```bash -gh issue list --repo cortexlinux/cortex --state open --label "critical" --json number,title,assignees -gh issue list --repo cortexlinux/cortex --state open --label "high" --json number,title,assignees -``` - -### 4. Unassigned Issues with Bounties -```bash -gh issue list --repo cortexlinux/cortex --state open --assignee "" --json number,title,labels -``` - -### 5. Recently Merged PRs (for bounty tracking) -```bash -gh pr list --repo cortexlinux/cortex --state merged --limit 10 --json number,title,author,mergedAt -``` - -### 6. Repository Stats -```bash -gh api repos/cortexlinux/cortex --jq '{stars: .stargazers_count, forks: .forks_count, issues: .open_issues_count}' -``` - -## Output Format - -```markdown -# Cortex Linux - Repository Status -*Generated: [timestamp]* - -## 📊 Quick Stats -| Metric | Count | -|--------|-------| -| Open PRs | XX | -| Open Issues | XX | -| Stars | XX | -| Forks | XX | - -## 🔴 Critical/Blocking -[List any PRs or issues blocking MVP] - -## ✅ Ready to Merge -| PR | Title | Author | CI Status | -|----|-------|--------|-----------| -| #XX | Title | @user | ✅ Pass | - -## 🔄 Needs Review -| PR | Title | Author | Waiting Since | -|----|-------|--------|---------------| -| #XX | Title | @user | X days | - -## ⚠️ Has Conflicts -| PR | Title | Author | Issue | -|----|-------|--------|-------| -| #XX | Title | @user | Merge conflict | - -## 💰 Bounties Available -| Issue | Title | Bounty | Priority | -|-------|-------|--------|----------| -| #XX | Title | $XX | high | - -## 👥 Top Contributors (Open PRs) -| Contributor | Open PRs | -|-------------|----------| -| @user | X | - -## 🏃 Recent CI Runs -| Workflow | Status | Branch | Time | -|----------|--------|--------|------| -| CI | ✅/❌ | main | Xm ago | - -## 📋 Recommended Actions -1. [Most important action] -2. [Second priority] -3. [Third priority] -``` - -## Categories - -### Ready to Merge -PRs where: -- `mergeable: true` -- `reviewDecision: APPROVED` or no review required -- CI passing - -### Needs Review -PRs where: -- `mergeable: true` -- `reviewDecision: REVIEW_REQUIRED` or empty -- Waiting > 24 hours - -### Has Conflicts -PRs where: -- `mergeable: false` -- Need contributor to rebase - -### Stale PRs -PRs where: -- No activity > 7 days -- May need follow-up or closing - -## Priority Actions - -Recommend actions based on: -1. **Blockers first** - Anything blocking other work -2. **Quick wins** - PRs that can merge immediately -3. **Bounty payments** - Recently merged PRs needing payment -4. **Contributor follow-up** - PRs needing nudges -5. **Issue triage** - New issues needing labels/bounties - -## End with - -``` -## Next Steps -1. [Specific action with command] -2. [Specific action with command] -3. [Specific action with command] - -Ready to proceed with any of these? -``` diff --git a/.claude/tasks/commit.md b/.claude/tasks/commit.md deleted file mode 100644 index e20d9b07..00000000 --- a/.claude/tasks/commit.md +++ /dev/null @@ -1,54 +0,0 @@ -# commit.md - -**allowed-tools:** Bash(git add:*), Bash(git status:*), Bash(git commit:*), Bash(git diff:*) -**description:** Create a git commit for Cortex Linux - -## Context - -* Current git status: `git status` -* Current git diff (staged and unstaged): `git diff HEAD` -* Current branch: `git branch --show-current` -* Recent commits: `git log --oneline -10` - -## Your Task - -Based on the above changes, create a single git commit. - -## Commit Message Guidelines - -* First line: Short, concise summary (50 chars or less) -* Use conventional commit prefixes: `feat`, `fix`, `docs`, `refactor`, `test`, `chore` -* Leave a blank line after the first line -* Add detailed bullet points explaining the work (8-10 lines max) -* Keep bullets focused on technical changes -* Do NOT include attribution, co-authorship, or mentions of Claude/AI - -## Format - -``` -: - -- Bullet point explaining change 1 -- Bullet point explaining change 2 -- Bullet point explaining change 3 -``` - -## Example - -``` -feat: add offline mode for package queries - -- Implement local cache fallback when network unavailable -- Add SQLite storage for previously fetched package metadata -- Create timeout detection with 3-second threshold -- Add --offline flag to force local-only operation -- Update CLI help text with offline usage examples -``` - -## Rules - -1. Stage all relevant files before committing -2. Do not commit unrelated changes -3. Never amend commits without explicit permission -4. Verify staged changes match intended scope before committing -5. If changes span multiple features, suggest splitting into separate commits diff --git a/.claude/tasks/create-issue.md b/.claude/tasks/create-issue.md deleted file mode 100644 index 4e0df643..00000000 --- a/.claude/tasks/create-issue.md +++ /dev/null @@ -1,105 +0,0 @@ -# create-issue.md - -**allowed-tools:** Bash(gh issue create:*), Bash(gh issue list:*) -**description:** Create a bounty issue for Cortex Linux - -## Context - -* Feature or bug description: $ARGUMENTS -* Existing issues: `gh issue list --repo cortexlinux/cortex --limit 20` - -## Your Task - -Create a well-structured GitHub issue with bounty information. - -## Issue Template - -```markdown -## Problem -[What's broken or missing - 2-3 sentences] - -## Solution -[How to fix it - include code examples if relevant] - -## Requirements -- [ ] Requirement 1 -- [ ] Requirement 2 -- [ ] Requirement 3 - -## Acceptance Criteria -- [ ] Feature works as described -- [ ] Unit tests included (>80% coverage) -- [ ] Documentation with examples -- [ ] Integrates with existing `cortex/` architecture - -## Technical Notes -- Files to create/modify: `cortex/feature_name.py`, `test/test_feature_name.py` -- Integration points: [Which existing modules this connects to] -- Dependencies: [Any new packages needed] - -## Example Usage -```python -# How the feature should be used -from cortex.feature_name import FeatureClass - -feature = FeatureClass() -result = feature.do_something() -``` - -## Bounty: $XX (+ $XX bonus after funding) -Paid on merge to main via crypto (BTC/USDC) or PayPal. - -## Labels -- `enhancement` or `bug` -- `good first issue` (if beginner-friendly) -- Priority: `critical`, `high`, `medium`, or `low` -``` - -## Bounty Guidelines - -| Complexity | Amount | Examples | -|------------|--------|----------| -| Quick fix | $25-50 | Typo, small bug, docs update | -| Small feature | $50-75 | Single-file feature, test coverage | -| Medium feature | $75-100 | Multi-file feature, integration | -| Large feature | $150-200 | Core system component | - -## Command Format - -```bash -gh issue create \ - --repo cortexlinux/cortex \ - --title "feat: [Feature Name]" \ - --body "[Full issue body from template above]" \ - --label "enhancement" \ - --label "medium" -``` - -## Rules - -1. Always include bounty amount with post-funding bonus -2. Always include acceptance criteria -3. Always specify which files to create/modify -4. Always include example usage -5. Check for duplicate issues before creating -6. Use conventional commit prefix in title: `feat:`, `fix:`, `docs:` - -## Labels Reference - -| Label | When to Use | -|-------|-------------| -| `enhancement` | New features | -| `bug` | Something broken | -| `documentation` | Docs only | -| `good first issue` | Simple, beginner-friendly | -| `critical` | Blocks MVP | -| `high` | Important for MVP | -| `medium` | Nice to have | -| `low` | Future consideration | - -## After Creating - -1. Note the issue number -2. Add to project board if applicable -3. Post in Discord #bounties channel -4. Track in bounty CSV if claimed diff --git a/.claude/tasks/create-pr.md b/.claude/tasks/create-pr.md deleted file mode 100644 index 8b36b942..00000000 --- a/.claude/tasks/create-pr.md +++ /dev/null @@ -1,88 +0,0 @@ -# create-pr.md - -**allowed-tools:** Bash(git status:*), Bash(git log:*), Bash(git branch:*), Bash(gh pr create:*) -**description:** Create a GitHub pull request for Cortex Linux - -## Context - -* Current git status: `git status` -* Current branch: `git branch --show-current` -* Commits on this branch: `git log --oneline main..HEAD` -* Recent commits for context: `git log --oneline -5` - -## Additional Context - -$ARGUMENTS - -## Your Task - -Create a GitHub pull request using `gh pr create` with the following requirements: - -## PR Requirements - -1. **Title Format:** - - Keep short and concise - - Use conventional commit style: `feat:`, `fix:`, `docs:`, etc. - - If closing an issue, reference it: `feat: add offline mode (Issue #XX)` - -2. **Body Format:** - ```markdown - ## Summary - Brief description of what this PR does. - - ## Changes - - Bullet point of change 1 - - Bullet point of change 2 - - Bullet point of change 3 - - ## Testing - - How to test these changes - - Expected results - - ## Checklist - - [ ] Tests pass (`pytest tests/`) - - [ ] Code follows project style - - [ ] Documentation updated if needed - - Closes #XX - ``` - -3. **Command Structure:** - ```bash - gh pr create --title "Title here" --body "Body here" --base main - ``` - -## Rules - -1. Pass all options to avoid interactive mode -2. Always use `--title` and `--body` flags -3. Always target `main` as base branch -4. Include `Closes #XX` if this addresses an issue -5. Add labels if relevant: `--label "enhancement"` or `--label "bug"` - -## Example - -```bash -gh pr create \ - --title "feat: add semantic caching for offline mode" \ - --body "## Summary -Implements GPTCache integration for offline package queries. - -## Changes -- Add GPTCache wrapper in cortex/cache/ -- Implement semantic similarity matching -- Add fallback to local SQLite when offline - -## Testing -\`\`\`bash -pytest tests/test_cache.py -v -\`\`\` - -## Checklist -- [x] Tests pass -- [x] Documentation updated - -Closes #42" \ - --base main \ - --label "enhancement" -``` diff --git a/.claude/tasks/merge-pr.md b/.claude/tasks/merge-pr.md deleted file mode 100644 index cd0574f8..00000000 --- a/.claude/tasks/merge-pr.md +++ /dev/null @@ -1,134 +0,0 @@ -# merge-pr.md - -**allowed-tools:** Bash(gh pr view:*), Bash(gh pr checks:*), Bash(gh pr merge:*), Bash(gh pr comment:*) -**description:** Merge an approved pull request for Cortex Linux - -## Context - -* PR number to merge: $ARGUMENTS - -## Your Task - -Verify the PR is ready and merge it safely. - -## Pre-Merge Checklist - -### Step 1: Verify PR Status -```bash -gh pr view $PR_NUMBER --repo cortexlinux/cortex --json title,author,mergeable,mergeStateStatus,reviews -``` - -### Step 2: Verify CI Passes -```bash -gh pr checks $PR_NUMBER --repo cortexlinux/cortex -``` - -### Step 3: Check for Conflicts -- `mergeable: true` required -- `mergeStateStatus: clean` or `unstable` (if only optional checks fail) - -## Merge Criteria - -| Check | Required | -|-------|----------| -| CI tests pass | ✅ Yes | -| No merge conflicts | ✅ Yes | -| At least 1 approval | ✅ Yes (Mike or designated reviewer) | -| CodeQL pass | ⚠️ No (non-blocking) | -| SonarQube pass | ⚠️ No (non-blocking) | - -## Merge Command - -```bash -gh pr merge $PR_NUMBER --repo cortexlinux/cortex --squash --delete-branch -``` - -Options: -- `--squash` - Combine all commits into one (preferred) -- `--merge` - Keep all commits (for large features) -- `--rebase` - Rebase onto main -- `--delete-branch` - Clean up feature branch after merge - -## Post-Merge Actions - -### Step 1: Add Bounty Comment -```bash -gh pr comment $PR_NUMBER --repo cortexlinux/cortex --body "🎉 Merged! Thanks @$AUTHOR for this contribution. - -**Bounty:** $XX ready for payment -**Payment method:** DM me on Discord with your preferred method (crypto/PayPal) - -Tracking in bounty ledger." -``` - -### Step 2: Update Bounty Tracker -Add to `bounty-payments.csv`: -``` -$DATE,$PR_NUMBER,$AUTHOR,$AMOUNT,pending,$ISSUE_NUMBER -``` - -### Step 3: Discord Notification -``` -✅ **PR #$PR_NUMBER Merged** -Feature: [Title] -Contributor: @$AUTHOR -Bounty: $XX - DM for payment -``` - -## Error Handling - -### If Merge Fails: Conflicts -``` -❌ Cannot merge - conflicts exist - -Tell contributor: -"@$AUTHOR This PR has merge conflicts. Please rebase on latest main: -\`\`\` -git fetch origin -git rebase origin/main -git push --force-with-lease -\`\`\`" -``` - -### If Merge Fails: CI Red -``` -❌ Cannot merge - CI failing - -Check which tests fail: -\`gh pr checks $PR_NUMBER --repo cortexlinux/cortex\` - -Tell contributor which specific tests need fixing. -``` - -### If Merge Fails: No Approval -``` -❌ Cannot merge - needs approval - -Either: -1. Review and approve: \`gh pr review $PR_NUMBER --approve\` -2. Or bypass (owner only): \`gh pr merge $PR_NUMBER --admin\` -``` - -## Output Format - -``` -## Merge Report: PR #$PR_NUMBER - -**Title:** [PR Title] -**Author:** @[username] -**Status:** ✅ Merged / ❌ Blocked - -**CI Checks:** -- Tests: ✅ Pass -- Lint: ✅ Pass -- CodeQL: ⚠️ Skipped (non-blocking) - -**Merge Commit:** [commit hash] - -**Post-Merge:** -- [ ] Bounty comment posted -- [ ] Bounty tracker updated -- [ ] Discord notified - -**Bounty:** $XX owed to @[username] -``` diff --git a/.claude/tasks/pay-bounty.md b/.claude/tasks/pay-bounty.md deleted file mode 100644 index d946c880..00000000 --- a/.claude/tasks/pay-bounty.md +++ /dev/null @@ -1,142 +0,0 @@ -# pay-bounty.md - -**allowed-tools:** Bash(cat:*), Bash(echo:*), Bash(grep:*), Bash(gh issue comment:*), Bash(gh pr comment:*) -**description:** Record and track bounty payments for Cortex Linux - -## Context - -* Payment details: $ARGUMENTS -* Bounty tracker location: `~/cortex/data/bounty-payments.csv` - -## Your Task - -Record a bounty payment and update tracking. - -## Payment Workflow - -### Step 1: Gather Payment Info - -Required information: -- PR number that was merged -- Contributor GitHub username -- Bounty amount ($) -- Payment method (crypto/PayPal/Venmo) -- Payment reference (tx hash or confirmation) - -### Step 2: Update CSV Tracker - -```bash -echo "$DATE,$PR_NUMBER,$USERNAME,$AMOUNT,$METHOD,$TX_REF,$STATUS" >> ~/cortex/data/bounty-payments.csv -``` - -CSV Format: -``` -date,pr,contributor,amount,method,reference,status -2024-12-16,213,pavanimanchala53,100,btc,tx_abc123,paid -2024-12-16,299,Sahilbhatane,75,paypal,PP-xyz789,paid -``` - -### Step 3: Comment on PR - -```bash -gh pr comment $PR_NUMBER --repo cortexlinux/cortex --body "💰 **Bounty Paid** - -Amount: \$$AMOUNT -Method: $METHOD -Reference: \`$TX_REF\` - -Thanks for contributing to Cortex Linux! 🚀" -``` - -### Step 4: Discord Confirmation - -Post in #payments: -``` -💰 **Bounty Paid** -PR: #$PR_NUMBER -Contributor: @$USERNAME -Amount: $XX -Method: [crypto/PayPal] - -Total paid to date: $XXX -``` - -## Payment Methods - -| Method | How to Pay | Reference Format | -|--------|------------|------------------| -| Bitcoin | tip.cc bot or direct | tx hash | -| USDC | tip.cc bot or direct | tx hash | -| PayPal | paypal.me link | PP-[confirmation] | -| Venmo | @username | Venmo-[last4] | - -## View Outstanding Bounties - -```bash -# List all pending payments -grep ",pending" ~/cortex/data/bounty-payments.csv - -# Sum pending amounts -grep ",pending" ~/cortex/data/bounty-payments.csv | awk -F',' '{sum += $4} END {print "Total pending: $" sum}' - -# List by contributor -grep "$USERNAME" ~/cortex/data/bounty-payments.csv -``` - -## View Payment History - -```bash -# All paid bounties -grep ",paid" ~/cortex/data/bounty-payments.csv - -# Total paid -grep ",paid" ~/cortex/data/bounty-payments.csv | awk -F',' '{sum += $4} END {print "Total paid: $" sum}' - -# Paid this month -grep "$(date +%Y-%m)" ~/cortex/data/bounty-payments.csv | grep ",paid" -``` - -## Bounty Ledger Report - -Generate summary: -```bash -echo "## Cortex Linux Bounty Report" -echo "" -echo "### Totals" -echo "- Paid: \$$(grep ',paid' ~/cortex/data/bounty-payments.csv | awk -F',' '{sum+=$4}END{print sum}')" -echo "- Pending: \$$(grep ',pending' ~/cortex/data/bounty-payments.csv | awk -F',' '{sum+=$4}END{print sum}')" -echo "" -echo "### Top Contributors" -awk -F',' 'NR>1 {a[$3]+=$4} END {for(i in a) print a[i], i}' ~/cortex/data/bounty-payments.csv | sort -rn | head -5 -``` - -## Post-Funding Bonus Tracking - -When funding closes, run: -```bash -# Calculate 2x bonus for all contributors -awk -F',' 'NR>1 {print $3": $"$4" + $"$4" bonus = $"($4*2)}' ~/cortex/data/bounty-payments.csv -``` - -## Output Format - -``` -## Payment Recorded - -**PR:** #$PR_NUMBER -**Contributor:** @$USERNAME -**Amount:** $$AMOUNT -**Method:** $METHOD -**Reference:** $TX_REF -**Status:** ✅ Paid - -**Updated:** bounty-payments.csv -**Commented:** PR #$PR_NUMBER -**Discord:** Posted to #payments - ---- -**Running Totals:** -- Total Paid: $XXX -- Total Pending: $XXX -- Contributors Paid: XX -``` diff --git a/.claude/tasks/review-pr.md b/.claude/tasks/review-pr.md deleted file mode 100644 index e2b9095e..00000000 --- a/.claude/tasks/review-pr.md +++ /dev/null @@ -1,119 +0,0 @@ -# review-pr.md - -**allowed-tools:** Bash(gh pr view:*), Bash(gh pr diff:*), Bash(curl:*), Bash(gh api:*) -**description:** Review a contributor pull request for Cortex Linux - -## Context - -* PR number to review: $ARGUMENTS - -## Your Task - -Perform a thorough code review of the specified PR and provide a verdict. - -## Review Process - -### Step 1: Fetch PR Information -```bash -gh pr view $PR_NUMBER --repo cortexlinux/cortex --json title,author,body,files,additions,deletions,mergeable,mergeStateStatus -``` - -### Step 2: Fetch Full Diff -```bash -gh pr diff $PR_NUMBER --repo cortexlinux/cortex -``` - -### Step 3: Check CI Status -```bash -gh pr checks $PR_NUMBER --repo cortexlinux/cortex -``` - -## Review Checklist - -### Code Quality -- [ ] Code is in correct directory (`cortex/` not `src/`) -- [ ] No TODO or placeholder comments -- [ ] Error handling is present -- [ ] No hardcoded secrets or API keys -- [ ] Follows Python style (snake_case, type hints) - -### Testing -- [ ] Tests are included (`test/test_*.py`) -- [ ] Tests cover main functionality -- [ ] Tests use mocking for external services -- [ ] All CI checks pass - -### Integration -- [ ] Imports use `cortex.` prefix correctly -- [ ] Integrates with existing architecture -- [ ] No breaking changes to existing APIs -- [ ] Documentation updated if needed - -### Security -- [ ] No command injection vulnerabilities -- [ ] Subprocess calls are sandboxed -- [ ] Sensitive data is not logged - -## Verdict Format - -Provide one of: - -### ✅ APPROVE -``` -**Verdict: APPROVE** - -Code quality is good. All checks pass. Ready to merge. - -Strengths: -- [What's good about this PR] - -Merge command: -\`gh pr merge $PR_NUMBER --repo cortexlinux/cortex --squash\` -``` - -### 🔄 REQUEST CHANGES -``` -**Verdict: REQUEST CHANGES** - -Issues found that must be fixed before merge: - -1. **[Issue Category]** - [Description] -2. **[Issue Category]** - [Description] - -Comment to post: -\`\`\` -@contributor Thanks for this work! [Specific issues to fix] -\`\`\` -``` - -### 💬 NEEDS DISCUSSION -``` -**Verdict: NEEDS DISCUSSION** - -Questions or architectural concerns that need input: - -1. [Question or concern] -2. [Question or concern] - -Suggested action: [What to do next] -``` - -## Common Issues to Watch For - -| Issue | How to Detect | -|-------|---------------| -| Wrong directory | Files in `src/` instead of `cortex/` | -| Broken imports | `from X import` without `cortex.` prefix | -| Missing tests | No `test_*.py` files in diff | -| Merge conflicts | `mergeable: false` in PR data | -| CI failures | Red X in checks output | -| Sensitive data | API keys, passwords in code | - -## Output Format - -1. **PR Summary** - Title, author, what it does -2. **Files Changed** - List with line counts -3. **CI Status** - Pass/fail for each check -4. **Code Review** - Issues found (if any) -5. **Verdict** - APPROVE / REQUEST CHANGES / NEEDS DISCUSSION -6. **Next Action** - Exact command or comment to post diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index b6f8eb7c..0b80a8d1 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -3,7 +3,7 @@ name: Bug Report about: Report something broken in Cortex title: "[BUG] " labels: bug -assignees: "" +assignees: "suyashd999, mikejmorgan-ai" --- ## What happened? diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index cbef75ad..db0988e0 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -3,7 +3,7 @@ name: Feature Request about: Suggest a new feature for Cortex title: "[FEATURE] " labels: enhancement -assignees: "" +assignees: "suyashd999, mikejmorgan-ai" --- ## Problem diff --git a/.github/workflows/automation.yml b/.github/workflows/automation.yml deleted file mode 100644 index bc7bd104..00000000 --- a/.github/workflows/automation.yml +++ /dev/null @@ -1,94 +0,0 @@ -name: Cortex Automation - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -permissions: - contents: read - pull-requests: read - -jobs: - test: - runs-on: ubuntu-latest - strategy: - matrix: - python-version: ['3.10', '3.11', '3.12'] - - steps: - - uses: actions/checkout@v4 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v6 - with: - python-version: ${{ matrix.python-version }} - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements.txt - pip install pytest pytest-cov pytest-mock pytest-asyncio - - - name: Run tests - run: | - python -m pytest tests/ -v --cov=cortex --cov-report=xml --cov-report=term-missing - - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v5 - if: matrix.python-version == '3.11' - with: - file: ./coverage.xml - fail_ci_if_error: false - - lint: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v6 - with: - python-version: '3.11' - - - name: Install linting tools - run: | - python -m pip install --upgrade pip - pip install black pylint mypy - - - name: Check formatting with black - run: | - black --check cortex/ || echo "::warning::Code formatting issues found. Run 'black cortex/' to fix." - - - name: Lint with pylint - run: | - pylint cortex/ --exit-zero --output-format=text | tee pylint-report.txt - score=$(tail -n 2 pylint-report.txt | head -n 1 | grep -oP '\d+\.\d+') - echo "Pylint score: $score" - - security: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v6 - with: - python-version: '3.11' - - - name: Install security tools - run: | - python -m pip install --upgrade pip - pip install bandit safety - - - name: Run Bandit security linter - run: | - bandit -r cortex/ -ll -ii || echo "::warning::Security issues found. Please review." - - - name: Check dependencies with safety - run: | - pip install -r requirements.txt - safety check --full-report || echo "::warning::Vulnerable dependencies found." diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 83dc6e9a..c7b63636 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -78,14 +78,13 @@ jobs: ANTHROPIC_API_KEY: "test-key-for-ci" OPENAI_API_KEY: "test-key-for-ci" run: | - pytest tests/ test/ -v --tb=short \ + pytest tests/ -v --tb=short \ --cov=cortex \ --cov-report=xml \ --cov-report=term-missing \ --cov-fail-under=0 \ --timeout=60 \ - --ignore=tests/integration \ - --ignore=test/integration + --ignore=tests/integration - name: Upload coverage to Codecov if: matrix.python-version == '3.11' diff --git a/.github/workflows/phase-trigger.yml b/.github/workflows/phase-trigger.yml deleted file mode 100644 index 6719f29f..00000000 --- a/.github/workflows/phase-trigger.yml +++ /dev/null @@ -1,59 +0,0 @@ -name: Auto-Reopen Phase Issues - -on: - milestone: - types: [closed] - -jobs: - reopen-issues: - runs-on: ubuntu-latest - steps: - - name: Reopen issues for next phase - uses: actions/github-script@v7 - with: - script: | - const milestone = context.payload.milestone; - const milestoneName = milestone.title.toLowerCase(); - - let labelToReopen = null; - - if (milestoneName.includes('mvp')) { - labelToReopen = 'phase:post-mvp'; - } else if (milestoneName.includes('funding')) { - labelToReopen = 'phase:post-funding'; - } else if (milestoneName.includes('enterprise')) { - labelToReopen = 'phase:enterprise'; - } - - if (!labelToReopen) { - console.log('No matching phase label for milestone:', milestone.title); - return; - } - - console.log(`Reopening issues with label: ${labelToReopen}`); - - // Get all closed issues with the phase label - const issues = await github.rest.issues.listForRepo({ - owner: context.repo.owner, - repo: context.repo.repo, - state: 'closed', - labels: labelToReopen, - per_page: 100 - }); - - console.log(`Found ${issues.data.length} issues to reopen`); - - for (const issue of issues.data) { - if (!issue.pull_request) { - await github.rest.issues.update({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: issue.number, - state: 'open' - }); - console.log(`Reopened #${issue.number}: ${issue.title}`); - } - } - - // Post summary comment on milestone - console.log(`✅ Reopened ${issues.data.length} issues for ${labelToReopen}`); diff --git a/.github/workflows/welcome-fork.yml b/.github/workflows/welcome-fork.yml deleted file mode 100644 index 4a25dd92..00000000 --- a/.github/workflows/welcome-fork.yml +++ /dev/null @@ -1,72 +0,0 @@ -name: Welcome New Fork - -on: - fork: - -jobs: - welcome: - runs-on: ubuntu-latest - permissions: - issues: write - discussions: write - - steps: - - name: Get fork info - id: fork_info - run: | - echo "fork_owner=${{ github.event.forkee.owner.login }}" >> $GITHUB_OUTPUT - echo "fork_repo=${{ github.event.forkee.full_name }}" >> $GITHUB_OUTPUT - echo "fork_url=${{ github.event.forkee.html_url }}" >> $GITHUB_OUTPUT - - - name: Create welcome discussion comment - uses: actions/github-script@v7 - with: - script: | - const forkOwner = '${{ steps.fork_info.outputs.fork_owner }}'; - const forkUrl = '${{ steps.fork_info.outputs.fork_url }}'; - - // Find the feedback discussion (number 301) - const { data: discussions } = await github.rest.repos.listDiscussionsInOrg({ - org: context.repo.owner, - repo: context.repo.repo, - }).catch(() => ({ data: [] })); - - // Post welcome comment to the feedback discussion - const welcomeMessage = `## 🎉 Welcome @${forkOwner}! - -Thanks for forking Cortex Linux! We're excited to have you in the community. - -**Your fork:** ${forkUrl} - ---- - -### We'd Love Your Feedback! - -As you explore the codebase, we'd really appreciate hearing from you: - -1. **Did everything work?** Any setup issues? -2. **What would you improve?** Missing features, docs, or code quality? -3. **What are you building?** We're curious about your use case! -4. **Want to contribute?** PRs are always welcome! - -Feel free to reply here or open an issue. Happy coding! 🚀 - -*— The Cortex Team*`; - - // Create an issue to track new forks (internal tracking) - await github.rest.issues.create({ - owner: context.repo.owner, - repo: context.repo.repo, - title: `🍴 New Fork: ${forkOwner}`, - body: `A new fork was created!\n\n- **User:** @${forkOwner}\n- **Fork URL:** ${forkUrl}\n- **Date:** ${new Date().toISOString()}\n\n---\n\n*This issue is auto-generated to track fork activity. Feel free to close after noting.*`, - labels: ['fork-tracking'] - }); - - console.log(`Welcome issue created for ${forkOwner}`); - - - name: Log fork event - run: | - echo "🍴 New fork detected!" - echo " Owner: ${{ steps.fork_info.outputs.fork_owner }}" - echo " Repo: ${{ steps.fork_info.outputs.fork_repo }}" - echo " URL: ${{ steps.fork_info.outputs.fork_url }}" diff --git a/COMMANDS.md b/COMMANDS.md new file mode 100644 index 00000000..2b3bdba2 --- /dev/null +++ b/COMMANDS.md @@ -0,0 +1,442 @@ +# Cortex CLI Commands Reference + +This document provides a comprehensive reference for all commands available in the Cortex CLI, an AI-powered package manager for Debian/Ubuntu. + +## Quick Reference + +| Command | Description | +|---------|-------------| +| `cortex` | Show help and available commands | +| `cortex install ` | Install software | +| `cortex demo` | See Cortex in action | +| `cortex wizard` | Configure API key | +| `cortex status` | Show system status | +| `cortex doctor` | Run system health check | +| `cortex history` | View installation history | +| `cortex rollback ` | Undo an installation | +| `cortex stack ` | Install a pre-built package stack | +| `cortex cache stats` | Show LLM cache statistics | +| `cortex notify` | Manage desktop notifications | +| `cortex check-pref` | Check user preferences | +| `cortex edit-pref` | Edit user preferences | + +--- + +## Global Options + +```bash +cortex --version, -V # Show version +cortex --verbose, -v # Show detailed output +cortex --offline # Use cached responses only (no network calls) +cortex --help, -h # Show help message +``` + +--- + +## Commands + +### `cortex install` + +Install software using natural language requests. Cortex uses AI to understand your request and generate the appropriate installation commands. + +**Usage:** +```bash +cortex install [options] +``` + +**Options:** +| Flag | Description | +|------|-------------| +| `--dry-run` | Show commands without executing (safe preview) | +| `--execute` | Actually run the installation commands | +| `--parallel` | Enable parallel execution for multi-step installs | + +**Examples:** +```bash +# Preview what would be installed (default, safe) +cortex install nginx --dry-run + +# Actually install the software +cortex install nginx --execute + +# Install with parallel execution for faster installs +cortex install "nodejs npm" --execute --parallel + +# Complex natural language requests +cortex install "latest stable docker with compose" --dry-run +cortex install "python3 with pip and virtualenv" --execute +``` + +**Notes:** +- Without `--execute`, Cortex only shows the commands it would run +- The `--dry-run` flag is recommended for first-time use to verify commands +- Installation is recorded in history for potential rollback + +--- + +### `cortex demo` + +Run an interactive demonstration of Cortex capabilities. Perfect for first-time users or presentations. + +**Usage:** +```bash +cortex demo +``` + +--- + +### `cortex wizard` + +Interactive setup wizard for configuring your API key and initial settings. + +**Usage:** +```bash +cortex wizard +``` + +**Notes:** +- Guides you through API key configuration +- Supports Anthropic Claude, OpenAI, and Ollama (local) providers + +--- + +### `cortex status` + +Show current system status including API provider configuration and security features. + +**Usage:** +```bash +cortex status +``` + +**Output includes:** +- Configured API provider +- Firejail availability (sandboxing) +- Environment configuration status + +--- + +### `cortex doctor` + +Run comprehensive system health checks to diagnose potential issues. + +**Usage:** +```bash +cortex doctor +``` + +**Checks performed:** +- API key validation +- Network connectivity +- Package manager availability +- Security tool status (Firejail) +- Python environment health + +--- + +### `cortex history` + +View the history of package installations and operations. + +**Usage:** +```bash +cortex history [options] [show_id] +``` + +**Options:** +| Flag | Description | +|------|-------------| +| `--limit ` | Maximum number of records to show (default: 20) | +| `--status ` | Filter by status: `success` or `failed` | +| `show_id` | Show details for a specific installation ID | + +**Examples:** +```bash +# List recent installations +cortex history + +# Show only the last 5 installations +cortex history --limit 5 + +# Show only failed installations +cortex history --status failed + +# Show details for a specific installation +cortex history abc123def456 +``` + +--- + +### `cortex rollback` + +Undo a previous installation by its ID. + +**Usage:** +```bash +cortex rollback [options] +``` + +**Options:** +| Flag | Description | +|------|-------------| +| `--dry-run` | Preview rollback actions without executing | + +**Examples:** +```bash +# Preview what would be rolled back +cortex rollback abc123def456 --dry-run + +# Actually perform the rollback +cortex rollback abc123def456 +``` + +**Notes:** +- Installation IDs can be found using `cortex history` +- Not all installations support rollback + +--- + +### `cortex stack` + +Manage and install pre-built package stacks for common development environments. + +**Usage:** +```bash +cortex stack [name] [options] +``` + +**Options:** +| Flag | Description | +|------|-------------| +| `--list, -l` | List all available stacks | +| `--describe, -d ` | Show details about a specific stack | +| `--dry-run` | Preview what would be installed | + +**Available Stacks:** +| Stack | Description | +|-------|-------------| +| `ml` | Machine learning stack (GPU) | +| `ml-cpu` | Machine learning stack (CPU only) | +| `webdev` | Web development tools | +| `devops` | DevOps and infrastructure tools | +| `data` | Data science and analysis tools | + +**Examples:** +```bash +# List available stacks +cortex stack --list + +# Describe a stack +cortex stack --describe ml + +# Preview stack installation +cortex stack ml --dry-run + +# Install a stack +cortex stack webdev + +# Cortex auto-detects GPU and selects ml-cpu if no GPU found +cortex stack ml # Will use ml-cpu on non-GPU systems +``` + +--- + +### `cortex cache` + +Manage the LLM response cache for improved performance. + +**Usage:** +```bash +cortex cache +``` + +**Actions:** +| Action | Description | +|--------|-------------| +| `stats` | Show cache statistics (hits, misses, hit rate) | + +**Examples:** +```bash +cortex cache stats +``` + +--- + +### `cortex notify` + +Manage desktop notification settings for installation events. + +**Usage:** +```bash +cortex notify [options] +``` + +**Actions:** +| Action | Description | +|--------|-------------| +| `config` | Show current notification configuration | +| `enable` | Enable notifications | +| `disable` | Disable notifications (critical alerts still show) | +| `dnd ` | Set Do Not Disturb window (HH:MM format) | +| `send ` | Send a test notification | + +**Examples:** +```bash +# Show notification settings +cortex notify config + +# Enable notifications +cortex notify enable + +# Set DND from 10 PM to 8 AM +cortex notify dnd 22:00 08:00 + +# Send test notification +cortex notify send "Test message" --title "Test" --level normal +``` + +--- + +### `cortex check-pref` + +View user preferences and configuration. + +**Usage:** +```bash +cortex check-pref [key] +``` + +**Examples:** +```bash +# Show all preferences +cortex check-pref + +# Show specific preference +cortex check-pref default_provider +``` + +--- + +### `cortex edit-pref` + +Modify user preferences. + +**Usage:** +```bash +cortex edit-pref [key] [value] +``` + +**Actions:** +| Action | Description | +|--------|-------------| +| `set` | Set a preference value | +| `add` | Add/update a preference | +| `delete` | Remove a preference | +| `list` | List all preferences | +| `validate` | Validate current preferences | + +**Examples:** +```bash +# Set a preference +cortex edit-pref set default_provider openai + +# List all preferences +cortex edit-pref list + +# Validate preferences +cortex edit-pref validate +``` + +--- + +## Environment Variables + +| Variable | Description | +|----------|-------------| +| `ANTHROPIC_API_KEY` | API key for Anthropic Claude | +| `OPENAI_API_KEY` | API key for OpenAI | +| `CORTEX_PROVIDER` | Force provider: `claude`, `openai`, or `ollama` | + +**Examples:** +```bash +# Use Claude +export ANTHROPIC_API_KEY="sk-ant-..." +cortex install nginx --dry-run + +# Use OpenAI +export OPENAI_API_KEY="sk-..." +cortex install nginx --dry-run + +# Use Ollama (local, no API key needed) +export CORTEX_PROVIDER=ollama +cortex install nginx --dry-run +``` + +--- + +## Common Workflows + +### First-Time Setup +```bash +# 1. Run the setup wizard +cortex wizard + +# 2. Check system status +cortex status + +# 3. Run health check +cortex doctor + +# 4. Try a dry-run installation +cortex install nginx --dry-run +``` + +### Safe Installation Pattern +```bash +# 1. Preview the installation +cortex install docker --dry-run + +# 2. If commands look correct, execute +cortex install docker --execute + +# 3. Check history +cortex history --limit 1 + +# 4. If something went wrong, rollback +cortex rollback +``` + +### Using Stacks for Development +```bash +# 1. List available stacks +cortex stack --list + +# 2. See what's in a stack +cortex stack --describe webdev + +# 3. Preview installation +cortex stack webdev --dry-run + +# 4. Install the stack +cortex stack webdev +``` + +--- + +## Getting Help + +```bash +# General help +cortex --help + +# Command-specific help +cortex install --help +cortex stack --help +cortex history --help +``` + +## More Information + +- **Documentation**: https://cortexlinux.com/docs +- **Discord**: https://discord.gg/uCqHvxjU83 +- **GitHub**: https://github.com/cortexlinux/cortex diff --git a/Contributing.md b/Contributing.md index bfeafe22..5bfb5aee 100644 --- a/Contributing.md +++ b/Contributing.md @@ -79,7 +79,7 @@ pip install -r requirements-dev.txt pip install -e . # Run tests to verify setup -pytest test/ -v +pytest tests/ -v ``` ### Requirements Files @@ -100,7 +100,7 @@ pip install pytest pytest-cov pytest-mock black pylint mypy bandit "python.linting.pylintEnabled": true, "python.formatting.provider": "black", "python.testing.pytestEnabled": true, - "python.testing.pytestArgs": ["test/"] + "python.testing.pytestArgs": ["tests/"] } ``` @@ -137,7 +137,7 @@ pip install pytest pytest-cov pytest-mock black pylint mypy bandit ### Before Submitting - [ ] Code follows style guide -- [ ] All tests pass (`pytest test/ -v`) +- [ ] All tests pass (`pytest tests/ -v`) - [ ] New code has tests (aim for >80% coverage) - [ ] Documentation is updated if needed - [ ] Commit messages are clear @@ -258,13 +258,13 @@ black cortex/ # Format all files ```bash # Run all tests -pytest test/ -v +pytest tests/ -v # Run with coverage -pytest test/ --cov=cortex --cov-report=html +pytest tests/ --cov=cortex --cov-report=html # Run specific test file -pytest test/test_cli.py -v +pytest tests/test_cli.py -v ``` ### Coverage Requirements diff --git a/NEXT_STEPS.md b/NEXT_STEPS.md deleted file mode 100644 index 4daa4661..00000000 --- a/NEXT_STEPS.md +++ /dev/null @@ -1,136 +0,0 @@ -# Cortex Linux - Next Steps - -## Current Status: MVP Working (v0.1.0) - -The core functionality is operational: -- ✅ Natural language package installation -- ✅ Installation history & rollback -- ✅ Multi-LLM support (Claude, GPT-4) -- ✅ Semantic caching for offline mode -- ✅ Shell integration (bash/zsh hotkeys) - ---- - -## Priority 1: Fix Critical Issues (This Week) - -### 1.1 Fix Test Suite -**Problem:** 9 test files fail to collect due to import errors -**Action:** -```bash -# Run and fix each: -pytest tests/test_context_memory.py -v -pytest tests/test_llm_router.py -v -# etc. -``` - -### 1.2 Consolidate LLM Directory -**Problem:** `LLM/` at root should be `cortex/llm/` -**Action:** -```bash -mv LLM/interpreter.py cortex/llm/ -mv LLM/test_interpreter.py tests/ -# Update imports in affected files -``` - -### 1.3 Clean Up Root Directory -**Action:** -```bash -mv cortex-cleanup.sh scripts/ -``` - ---- - -## Priority 2: Merge Contributor PRs (This Week) - -### Ready After Rebase (notify contributors): -| PR | Author | Feature | -|----|--------|---------| -| #300 | @pavanimanchala53 | Offline diagnose command | -| #213 | @pavanimanchala53 | Intent detection (APPROVED) | - -### Needs CI Fix: -| PR | Author | Feature | Issue | -|----|--------|---------|-------| -| #296 | @kr16h | Smart Stacks | CodeQL | -| #292 | @hyaku0121 | Health monitoring | CodeQL | -| #287 | @mikejmorgan-ai | Ollama integration | Tests | - ---- - -## Priority 3: Feature Completion (Next 2 Weeks) - -### 3.1 Ollama Integration (Local LLM) -- PR #287 needs test fixes -- Critical for offline-first users -- No API costs - -### 3.2 Smart Stacks -- PR #296 needs CodeQL fix -- Enables: `cortex stack install ml` (installs full ML environment) - -### 3.3 Health Monitoring -- PR #292 needs CodeQL fix -- System health checks before installations - ---- - -## Priority 4: Polish for v0.2.0 (Next Month) - -### 4.1 Documentation -- [ ] API documentation (Sphinx/mkdocs) -- [ ] Video tutorials -- [ ] More examples - -### 4.2 Testing -- [ ] Achieve 80% test coverage -- [ ] Integration tests with real packages -- [ ] Performance benchmarks - -### 4.3 Distribution -- [ ] PyPI package publishing -- [ ] Homebrew formula -- [ ] Snap/Flatpak packages - ---- - -## Priority 5: Future Roadmap - -### v0.3.0 - Multi-Distro Support -- Fedora/RHEL (dnf) -- Arch Linux (pacman) -- Alpine (apk) - -### v0.4.0 - Enterprise Features -- Team configurations -- Audit logging to SIEM -- LDAP/SSO integration - -### v1.0.0 - Production Ready -- Security audit completed -- Performance optimized -- Full documentation -- Stable API - ---- - -## Open PRs Summary (22 remaining) - -| Status | Count | Action | -|--------|-------|--------| -| Needs rebase | 8 | Wait for contributors | -| CI failing | 13 | Contributors notified | -| Changes requested | 1 | Wait for contributor | - ---- - -## Metrics - -- **Lines of Code:** ~28,000 -- **Contributors:** 15+ active forks -- **Test Coverage:** ~60% (needs improvement) -- **Open Issues:** Check GitHub -- **Stars:** Growing - ---- - -*Last updated: 2025-12-16* diff --git a/bounties_owed.csv b/bounties_owed.csv deleted file mode 100644 index ea2afddc..00000000 --- a/bounties_owed.csv +++ /dev/null @@ -1 +0,0 @@ -PR_Number,Author,Amount,Status,Description,Date diff --git a/bounties_paid.csv b/bounties_paid.csv deleted file mode 100644 index 2784b1ba..00000000 --- a/bounties_paid.csv +++ /dev/null @@ -1 +0,0 @@ -PR_Number,Author,Amount,Status,Payment_Status,Date diff --git a/contribution.md b/contribution.md deleted file mode 100644 index c2d0a5ff..00000000 --- a/contribution.md +++ /dev/null @@ -1,63 +0,0 @@ -# Contribution Guide - -Thank you for your interest in contributing to **Cortex**. This document explains the -project workflow, coding standards, and review expectations so that every pull -request is straightforward to review and merge. - -## Getting Started - -1. **Fork and clone the repository.** -2. **Create a feature branch** from `main` using a descriptive name, for example - `issue-40-kimi-k2`. -3. **Install dependencies** in a virtual environment: - ```bash - python -m venv .venv - source .venv/bin/activate # Windows: .venv\Scripts\activate - pip install --upgrade pip - pip install -r LLM/requirements.txt - pip install -r src/requirements.txt - pip install -e . - ``` -4. **Run the full test suite** (`python test/run_all_tests.py`) to ensure your - environment is healthy before you start coding. - -## Coding Standards - -- **Type hints and docstrings** are required for all public functions, classes, - and modules. CodeRabbit enforces an 80% docstring coverage threshold. -- **Formatting** follows `black` (line length 100) and `isort` ordering. Please run: - ```bash - black . - isort . - ``` -- **Linting** uses `ruff`. Address warnings locally before opening a pull request. -- **Logging and messages** must use the structured status labels (`[INFO]`, `[PLAN]`, - `[EXEC]`, `[SUCCESS]`, `[ERROR]`, etc.) to provide a consistent CLI experience. -- **Secrets** such as API keys must never be hard-coded or committed. -- **Dependency changes** must update both `LLM/requirements.txt` and any related - documentation (`README.md`, `test.md`). - -## Tests - -- Unit tests live under `test/` and should be added or updated alongside code - changes. -- Integration tests live under `test/integration/` and are designed to run inside - Docker. Use the helper utilities in `test/integration/docker_utils.py` to keep - the tests concise and reliable. -- Ensure that every new feature or regression fix includes corresponding test - coverage. Submissions without meaningful tests will be sent back for revision. -- Before requesting review, run: - ```bash - python test/run_all_tests.py - ``` - Optionally, include `CORTEX_PROVIDER=fake` to avoid contacting external APIs. - -## Pull Request Checklist - -- Provide a **clear title** that references the issue being addressed. -- Include a **summary** of the change, **testing notes**, and **risk assessment**. -- Confirm that **CI passes** and that **docstring coverage** meets the required threshold. -- Link the pull request to the relevant GitHub issue (`Fixes #`). -- Be responsive to review feedback and keep discussions on-topic. - -We appreciate your time and effort—welcome aboard! diff --git a/data/bounty-payments.csv b/data/bounty-payments.csv deleted file mode 100644 index 0cd48bb6..00000000 --- a/data/bounty-payments.csv +++ /dev/null @@ -1 +0,0 @@ -date,pr,contributor,amount,method,reference,status diff --git a/nginx-demo-output.txt b/nginx-demo-output.txt deleted file mode 100644 index 5c7525c0..00000000 --- a/nginx-demo-output.txt +++ /dev/null @@ -1,14 +0,0 @@ -WARNING:installation_history:Using user directory for database: /Users/allbots/.cortex/history.db -INFO:installation_history:Database initialized at /Users/allbots/.cortex/history.db -🧠 Understanding request... -📦 Planning installation... - ⠋ Analyzing system requirements... ⠙ Analyzing system requirements... ⠹ Analyzing system requirements... ⠸ Analyzing system requirements... ⠼ Analyzing system requirements... ⠴ Analyzing system requirements... ⠦ Analyzing system requirements... ⠧ Analyzing system requirements... ⠇ Analyzing system requirements... ⠏ Analyzing system requirements... INFO:httpx:HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" -INFO:installation_history:Installation 5359fdaf80699ed9 recorded -INFO:installation_history:Installation 5359fdaf80699ed9 updated: success -⚙️ Installing nginx... - -Generated commands: - 1. sudo apt update - 2. sudo apt install -y nginx - -(Dry run mode - commands not executed) diff --git a/scripts/automation/cortex-master-automation.sh b/scripts/automation/cortex-master-automation.sh deleted file mode 100644 index 72d255f6..00000000 --- a/scripts/automation/cortex-master-automation.sh +++ /dev/null @@ -1,730 +0,0 @@ -#!/bin/bash -# Cortex Linux - Master MVP Automation System -# Handles code generation, PR creation, issue management, and team coordination - -set -e - -# Colors -RED='\033[0;31m' -GREEN='\033[0;32m' -YELLOW='\033[1;33m' -BLUE='\033[0;34m' -NC='\033[0m' # No Color - -# Configuration -REPO_DIR="$HOME/cortex" -WORK_DIR="$HOME/Downloads/cortex-mvp-work" -GITHUB_TOKEN=$(grep GITHUB_TOKEN ~/.zshrc 2>/dev/null | cut -d'=' -f2 | tr -d '"' | tr -d "'") - -# Ensure working directory exists -mkdir -p "$WORK_DIR" - -# Banner -print_banner() { - echo -e "${BLUE}" - echo "╔════════════════════════════════════════════════════════════╗" - echo "║ CORTEX LINUX - MVP MASTER AUTOMATION ║" - echo "║ The AI-Native Operating System ║" - echo "╚════════════════════════════════════════════════════════════╝" - echo -e "${NC}" -} - -# Menu system -show_menu() { - echo "" - echo -e "${GREEN}═══ MAIN MENU ═══${NC}" - echo "" - echo "📋 ISSUE MANAGEMENT" - echo " 1. List MVP-critical issues" - echo " 2. Create new MVP issue" - echo " 3. Close post-MVP issues (cleanup)" - echo " 4. Pin critical issues to top" - echo "" - echo "💻 CODE GENERATION" - echo " 5. Generate implementation for issue" - echo " 6. Generate tests for implementation" - echo " 7. Generate documentation" - echo " 8. Generate complete package (code+tests+docs)" - echo "" - echo "🔀 PULL REQUEST MANAGEMENT" - echo " 9. Create PR from implementation" - echo " 10. Review pending PRs" - echo " 11. Merge approved PR" - echo " 12. Bulk create PRs for ready issues" - echo "" - echo "👥 TEAM COORDINATION" - echo " 13. List active contributors" - echo " 14. Assign issue to contributor" - echo " 15. Send Discord notification" - echo " 16. Process bounty payment" - echo "" - echo "📊 STATUS & REPORTING" - echo " 17. Show MVP progress dashboard" - echo " 18. Generate weekly report" - echo " 19. Check automation health" - echo " 20. Audit repository status" - echo "" - echo "🚀 QUICK ACTIONS" - echo " 21. Complete MVP package (issue → code → PR → assign)" - echo " 22. Emergency fix workflow" - echo " 23. Deploy to production" - echo "" - echo " 0. Exit" - echo "" - echo -n "Select option: " -} - -# Issue Management Functions -list_mvp_issues() { - echo -e "${GREEN}📋 MVP-Critical Issues${NC}" - cd "$REPO_DIR" - gh issue list --label "mvp-critical" --limit 30 --json number,title,assignees,labels | \ - jq -r '.[] | " #\(.number): \(.title) [\(.assignees | map(.login) | join(", "))]"' -} - -create_mvp_issue() { - echo -e "${YELLOW}Creating new MVP issue...${NC}" - echo -n "Issue title: " - read title - echo -n "Bounty amount: $" - read bounty - echo -n "Priority (critical/high/medium): " - read priority - - echo "Brief description (Ctrl+D when done):" - description=$(cat) - - body="**Bounty:** \$$bounty upon merge - -**Priority:** $priority - -## Description -$description - -## Acceptance Criteria -- [ ] Implementation complete -- [ ] Tests included (>80% coverage) -- [ ] Documentation with examples -- [ ] Integration verified - -## Skills Needed -- Python 3.11+ -- System programming -- Testing (pytest) - -**Ready to claim?** Comment \"I'll take this\" below!" - - cd "$REPO_DIR" - gh issue create \ - --title "$title" \ - --body "$body" \ - --label "mvp-critical,bounty,enhancement" - - echo -e "${GREEN}✅ Issue created!${NC}" -} - -close_post_mvp_issues() { - echo -e "${YELLOW}Closing post-MVP issues for focus...${NC}" - echo -n "Close issues starting from #: " - read start_num - echo -n "Close through #: " - read end_num - - CLOSE_MSG="🎯 **Closing for MVP Focus** - -This issue is valuable but being closed temporarily to focus the team on MVP-critical features. - -**Timeline:** -- Now: MVP features (#1-45) -- January 2025: Reopen post-MVP work -- February 2025: Seed funding round - -**Want to work on this?** Comment below and we can discuss! - -Labeled as \`post-mvp\` for easy tracking." - - cd "$REPO_DIR" - for i in $(seq $start_num $end_num); do - gh issue comment $i --body "$CLOSE_MSG" 2>/dev/null - gh issue edit $i --add-label "post-mvp" 2>/dev/null - gh issue close $i --reason "not planned" 2>/dev/null && \ - echo " ✅ Closed #$i" || echo " ⚠️ Issue #$i not found" - sleep 0.5 - done - - echo -e "${GREEN}✅ Cleanup complete!${NC}" -} - -pin_critical_issues() { - echo -e "${YELLOW}Pinning critical issues...${NC}" - cd "$REPO_DIR" - - # Get issue numbers to pin - echo "Enter issue numbers to pin (space-separated):" - read -a issues - - for issue in "${issues[@]}"; do - gh issue pin $issue 2>/dev/null && \ - echo " 📌 Pinned #$issue" || \ - echo " ⚠️ Could not pin #$issue" - done - - echo -e "${GREEN}✅ Issues pinned!${NC}" -} - -# Code Generation Functions -generate_implementation() { - echo -e "${YELLOW}Generating implementation...${NC}" - echo -n "Issue number: " - read issue_num - - cd "$REPO_DIR" - issue_data=$(gh issue view $issue_num --json title,body) - issue_title=$(echo "$issue_data" | jq -r '.title') - - echo "Issue: $issue_title" - echo "" - echo "⚠️ This requires Claude AI to generate the code." - echo "Manual steps:" - echo "1. Go to Claude.ai" - echo "2. Ask: 'Generate complete implementation for Cortex Linux Issue #$issue_num: $issue_title'" - echo "3. Save files to: $WORK_DIR/issue-$issue_num/" - echo "" - echo "Press Enter when files are ready..." - read - - if [ -d "$WORK_DIR/issue-$issue_num" ]; then - echo -e "${GREEN}✅ Files found!${NC}" - ls -lh "$WORK_DIR/issue-$issue_num/" - else - echo -e "${RED}❌ No files found at $WORK_DIR/issue-$issue_num/${NC}" - fi -} - -generate_complete_package() { - echo -e "${YELLOW}Generating complete implementation package...${NC}" - echo -n "Issue number: " - read issue_num - - mkdir -p "$WORK_DIR/issue-$issue_num" - - echo "" - echo "This will generate:" - echo " 1. Implementation code" - echo " 2. Comprehensive tests" - echo " 3. Full documentation" - echo " 4. Integration examples" - echo "" - echo "⚠️ Requires Claude AI session" - echo "" - echo "In Claude, say:" - echo " 'Generate complete implementation package for Cortex Linux Issue #$issue_num" - echo " Include: code, tests, docs, integration guide'" - echo "" - echo "Save files to: $WORK_DIR/issue-$issue_num/" - echo "" - echo "Press Enter when complete..." - read - - if [ -d "$WORK_DIR/issue-$issue_num" ]; then - # Create archive - cd "$WORK_DIR" - tar -czf "issue-$issue_num-complete.tar.gz" "issue-$issue_num/" - echo -e "${GREEN}✅ Package created: $WORK_DIR/issue-$issue_num-complete.tar.gz${NC}" - fi -} - -# PR Management Functions -create_pr_from_implementation() { - echo -e "${YELLOW}Creating PR from implementation...${NC}" - echo -n "Issue number: " - read issue_num - - cd "$REPO_DIR" - - # Get issue details - issue_data=$(gh issue view $issue_num --json title,body,labels) - issue_title=$(echo "$issue_data" | jq -r '.title') - - # Create branch - branch_name="feature/issue-$issue_num" - git checkout main - git pull origin main - git checkout -b "$branch_name" 2>/dev/null || git checkout "$branch_name" - - # Check if implementation files exist - impl_dir="$WORK_DIR/issue-$issue_num" - if [ ! -d "$impl_dir" ]; then - echo -e "${RED}❌ No implementation found at $impl_dir${NC}" - echo "Run option 8 to generate complete package first" - return 1 - fi - - # Copy files - echo "Copying implementation files..." - if [ -f "$impl_dir"/*.py ]; then - cp "$impl_dir"/*.py cortex/ 2>/dev/null || true - fi - if [ -f "$impl_dir"/test_*.py ]; then - mkdir -p tests - cp "$impl_dir"/test_*.py tests/ 2>/dev/null || true - fi - if [ -f "$impl_dir"/*.md ]; then - mkdir -p docs - cp "$impl_dir"/*.md docs/ 2>/dev/null || true - fi - - # Add and commit - git add -A - - if git diff --staged --quiet; then - echo -e "${YELLOW}⚠️ No changes to commit${NC}" - return 1 - fi - - git commit -m "Add $issue_title - -Implements #$issue_num - -- Complete implementation -- Comprehensive tests (>80% coverage) -- Full documentation -- Ready for review - -Closes #$issue_num" - - # Push - git push -u origin "$branch_name" - - # Create PR - pr_body="## Summary - -Implements **$issue_title** (#$issue_num) - -## What's Included - -✅ Complete implementation -✅ Comprehensive tests (>80% coverage) -✅ Full documentation -✅ Integration examples - -## Testing - -\`\`\`bash -pytest tests/ -v -\`\`\` - -## Ready for Review - -- ✅ Production-ready -- ✅ Fully tested -- ✅ Completely documented -- ✅ Follows project standards - -Closes #$issue_num - ---- - -**Bounty:** As specified in issue -**Reviewer:** @mikejmorgan-ai" - - gh pr create \ - --title "$issue_title" \ - --body "$pr_body" \ - --base main \ - --head "$branch_name" \ - --label "enhancement,ready-for-review" - - echo -e "${GREEN}✅ PR created successfully!${NC}" - git checkout main -} - -review_pending_prs() { - echo -e "${GREEN}📋 Pending Pull Requests${NC}" - cd "$REPO_DIR" - gh pr list --limit 20 --json number,title,author,createdAt,headRefName | \ - jq -r '.[] | " PR #\(.number): \(.title)\n Author: \(.author.login)\n Branch: \(.headRefName)\n Created: \(.createdAt)\n"' -} - -merge_approved_pr() { - echo -e "${YELLOW}Merging approved PR...${NC}" - echo -n "PR number: " - read pr_num - - cd "$REPO_DIR" - - echo "Checking PR status..." - gh pr view $pr_num - - echo "" - echo -n "Merge this PR? (y/n): " - read confirm - - if [ "$confirm" = "y" ]; then - gh pr merge $pr_num --squash --delete-branch - echo -e "${GREEN}✅ PR #$pr_num merged!${NC}" - - # Trigger bounty notification - echo "" - echo "💰 Bounty processing needed!" - echo "Run option 16 to process payment" - else - echo "Merge cancelled" - fi -} - -bulk_create_prs() { - echo -e "${YELLOW}Bulk PR creation...${NC}" - echo "Issues with code ready (space-separated): " - read -a issues - - for issue in "${issues[@]}"; do - echo "" - echo "Creating PR for #$issue..." - # Reuse create_pr function - echo "$issue" | create_pr_from_implementation - sleep 2 - done - - echo -e "${GREEN}✅ All PRs created!${NC}" -} - -# Team Coordination Functions -list_contributors() { - echo -e "${GREEN}👥 Active Contributors${NC}" - cd "$REPO_DIR" - - # Get recent PR authors - gh pr list --state all --limit 50 --json author,createdAt | \ - jq -r '.[] | .author.login' | sort | uniq -c | sort -rn | head -10 | \ - awk '{printf " %2d PRs: @%s\n", $1, $2}' -} - -assign_issue() { - echo -e "${YELLOW}Assigning issue to contributor...${NC}" - echo -n "Issue number: " - read issue_num - echo -n "GitHub username: " - read username - - cd "$REPO_DIR" - gh issue edit $issue_num --add-assignee "$username" - - # Send notification comment - gh issue comment $issue_num --body "👋 Hey @$username! This issue is now assigned to you. - -**Next steps:** -1. Review the requirements -2. Comment with your timeline -3. Submit PR when ready - -Questions? Ask in #dev-chat on Discord: https://discord.gg/uCqHvxjU83 - -Thanks for contributing! 🚀" - - echo -e "${GREEN}✅ Assigned #$issue_num to @$username${NC}" -} - -send_discord_notification() { - echo -e "${YELLOW}Sending Discord notification...${NC}" - - if [ -z "$DISCORD_WEBHOOK" ]; then - echo -e "${RED}❌ DISCORD_WEBHOOK not set${NC}" - echo "Set it in GitHub Secrets or ~/.zshrc" - return 1 - fi - - echo "Select notification type:" - echo " 1. PR merged" - echo " 2. Issue created" - echo " 3. Custom message" - echo -n "Choice: " - read choice - - case $choice in - 1) - echo -n "PR number: " - read pr_num - message="🚀 **PR #$pr_num Merged!**\n\nGreat work! Bounty will be processed Friday." - ;; - 2) - echo -n "Issue number: " - read issue_num - message="📋 **New Issue #$issue_num Created**\n\nCheck it out: https://github.com/cortexlinux/cortex/issues/$issue_num" - ;; - 3) - echo "Enter message:" - read message - ;; - esac - - curl -X POST "$DISCORD_WEBHOOK" \ - -H "Content-Type: application/json" \ - -d "{\"content\": \"$message\"}" - - echo -e "${GREEN}✅ Notification sent!${NC}" -} - -process_bounty() { - echo -e "${YELLOW}💰 Processing bounty payment...${NC}" - echo -n "PR number: " - read pr_num - echo -n "Contributor username: " - read username - echo -n "Bounty amount: $" - read amount - - cd "$REPO_DIR" - - # Add payment comment - gh pr comment $pr_num --body "💰 **Bounty Approved: \$$amount** - -Hey @$username! Your bounty has been approved. - -**Next steps:** -1. DM me your payment method (PayPal/Crypto/Venmo/Zelle) -2. Payment will be processed this Friday -3. You'll also get 2x bonus (\$$((amount * 2))) when we raise our seed round! - -Thanks for the great work! 🎉" - - # Log payment - echo "{\"pr\": $pr_num, \"contributor\": \"$username\", \"amount\": $amount, \"date\": \"$(date -I)\", \"status\": \"approved\"}" >> "$WORK_DIR/bounties_log.jsonl" - - echo -e "${GREEN}✅ Bounty processed!${NC}" - echo "Remember to actually send the payment!" -} - -# Status & Reporting Functions -show_mvp_dashboard() { - echo -e "${BLUE}═══════════════════════════════════════════${NC}" - echo -e "${BLUE} CORTEX LINUX - MVP DASHBOARD ${NC}" - echo -e "${BLUE}═══════════════════════════════════════════${NC}" - - cd "$REPO_DIR" - - echo "" - echo -e "${GREEN}📊 ISSUE STATUS${NC}" - total_issues=$(gh issue list --limit 1000 --json number | jq '. | length') - mvp_critical=$(gh issue list --label "mvp-critical" --json number | jq '. | length') - open_prs=$(gh pr list --json number | jq '. | length') - - echo " Total open issues: $total_issues" - echo " MVP critical: $mvp_critical" - echo " Open PRs: $open_prs" - - echo "" - echo -e "${GREEN}🎯 MVP PROGRESS${NC}" - # Estimate completion - completed=$((30 - mvp_critical)) - percent=$((completed * 100 / 30)) - echo " Completed: $completed/30 ($percent%)" - - echo "" - echo -e "${GREEN}👥 TEAM ACTIVITY${NC}" - recent_prs=$(gh pr list --state all --limit 7 --json number | jq '. | length') - echo " PRs this week: $recent_prs" - - echo "" - echo -e "${GREEN}💰 BOUNTIES${NC}" - if [ -f "$WORK_DIR/bounties_log.jsonl" ]; then - total_paid=$(jq -s 'map(.amount) | add' "$WORK_DIR/bounties_log.jsonl") - echo " Total paid: \$$total_paid" - else - echo " Total paid: \$0 (no log file)" - fi - - echo "" - echo -e "${BLUE}═══════════════════════════════════════════${NC}" -} - -generate_weekly_report() { - echo -e "${YELLOW}Generating weekly report...${NC}" - - report_file="$WORK_DIR/weekly-report-$(date +%Y-%m-%d).md" - - cd "$REPO_DIR" - - cat > "$report_file" << 'REPORT_EOF' -# Cortex Linux - Weekly Report -**Week of $(date +%Y-%m-%d)** - -## 🎯 Progress This Week - -### PRs Merged -$(gh pr list --state merged --limit 100 --json number,title,mergedAt | jq -r '.[] | select(.mergedAt | fromdateiso8601 > (now - 604800)) | "- PR #\(.number): \(.title)"') - -### Issues Closed -$(gh issue list --state closed --limit 100 --json number,title,closedAt | jq -r '.[] | select(.closedAt | fromdateiso8601 > (now - 604800)) | "- Issue #\(.number): \(.title)"') - -### New Contributors -$(gh pr list --state all --limit 50 --json author,createdAt | jq -r '.[] | select(.createdAt | fromdateiso8601 > (now - 604800)) | .author.login' | sort -u) - -## 📊 Metrics - -- Open Issues: $(gh issue list --json number | jq '. | length') -- Open PRs: $(gh pr list --json number | jq '. | length') -- Active Contributors: $(gh pr list --state all --limit 100 --json author | jq -r '.[].author.login' | sort -u | wc -l) - -## 🚀 Next Week Priorities - -1. Complete remaining MVP issues -2. Review and merge pending PRs -3. Process bounty payments - ---- -*Generated by Cortex Master Automation* -REPORT_EOF - - eval "echo \"$(cat $report_file)\"" > "$report_file" - - echo -e "${GREEN}✅ Report generated: $report_file${NC}" - cat "$report_file" -} - -check_automation_health() { - echo -e "${GREEN}🔍 Checking automation health...${NC}" - - cd "$REPO_DIR" - - echo "" - echo "GitHub Actions Status:" - gh run list --limit 5 --json conclusion,name | \ - jq -r '.[] | " \(.name): \(.conclusion)"' - - echo "" - echo "GitHub Secrets:" - gh secret list | head -5 - - echo "" - echo "Branch Protection:" - gh api repos/cortexlinux/cortex/branches/main/protection 2>/dev/null | \ - jq -r '.required_status_checks.contexts[]' || echo " No branch protection" - - echo "" - echo "Webhooks:" - gh api repos/cortexlinux/cortex/hooks | jq -r '.[].name' || echo " No webhooks" -} - -audit_repository() { - echo -e "${GREEN}🔍 Full Repository Audit${NC}" - - cd "$REPO_DIR" - - # Run comprehensive audit - bash "$WORK_DIR/../audit_cortex_status.sh" 2>/dev/null || { - echo "Audit script not found, running basic audit..." - - echo "Repository: cortexlinux/cortex" - echo "Branch: $(git branch --show-current)" - echo "Last commit: $(git log -1 --oneline)" - echo "" - echo "Open issues: $(gh issue list --json number | jq '. | length')" - echo "Open PRs: $(gh pr list --json number | jq '. | length')" - echo "Contributors: $(git log --format='%aN' | sort -u | wc -l)" - } -} - -# Quick Actions -complete_mvp_package() { - echo -e "${BLUE}🚀 COMPLETE MVP PACKAGE WORKFLOW${NC}" - echo "This will:" - echo " 1. Generate implementation" - echo " 2. Create PR" - echo " 3. Assign to contributor" - echo " 4. Send notifications" - echo "" - echo -n "Issue number: " - read issue_num - - # Step 1: Generate - echo "$issue_num" | generate_complete_package - - # Step 2: Create PR - echo "$issue_num" | create_pr_from_implementation - - # Step 3: Notify - echo "Package complete for issue #$issue_num!" - echo "PR created and ready for review" -} - -emergency_fix() { - echo -e "${RED}🚨 EMERGENCY FIX WORKFLOW${NC}" - echo -n "What's broken? " - read issue_description - - # Create hotfix branch - cd "$REPO_DIR" - git checkout main - git pull - git checkout -b "hotfix/emergency-$(date +%s)" - - echo "Hotfix branch created" - echo "Make your fixes, then commit and push" - echo "" - echo "When ready, run option 9 to create PR" -} - -deploy_to_production() { - echo -e "${YELLOW}🚀 Deploying to production...${NC}" - echo "⚠️ This is a placeholder for production deployment" - echo "" - echo "Production deployment steps:" - echo " 1. Merge all approved PRs" - echo " 2. Tag release" - echo " 3. Build packages" - echo " 4. Deploy to servers" - echo "" - echo "Not yet implemented - coming soon!" -} - -# Main execution -main() { - print_banner - - cd "$REPO_DIR" 2>/dev/null || { - echo -e "${RED}❌ Repository not found at $REPO_DIR${NC}" - echo "Clone it first: git clone https://github.com/cortexlinux/cortex.git ~/cortex" - exit 1 - } - - while true; do - show_menu - read choice - - case $choice in - 1) list_mvp_issues ;; - 2) create_mvp_issue ;; - 3) close_post_mvp_issues ;; - 4) pin_critical_issues ;; - 5) generate_implementation ;; - 6) echo "Coming soon..." ;; - 7) echo "Coming soon..." ;; - 8) generate_complete_package ;; - 9) create_pr_from_implementation ;; - 10) review_pending_prs ;; - 11) merge_approved_pr ;; - 12) bulk_create_prs ;; - 13) list_contributors ;; - 14) assign_issue ;; - 15) send_discord_notification ;; - 16) process_bounty ;; - 17) show_mvp_dashboard ;; - 18) generate_weekly_report ;; - 19) check_automation_health ;; - 20) audit_repository ;; - 21) complete_mvp_package ;; - 22) emergency_fix ;; - 23) deploy_to_production ;; - 0) echo "Goodbye!"; exit 0 ;; - *) echo -e "${RED}Invalid option${NC}" ;; - esac - - echo "" - echo "Press Enter to continue..." - read - done -} - -# Run main -main diff --git a/scripts/automation/cortex-master-pr-creator.sh b/scripts/automation/cortex-master-pr-creator.sh deleted file mode 100644 index 21caac5a..00000000 --- a/scripts/automation/cortex-master-pr-creator.sh +++ /dev/null @@ -1,241 +0,0 @@ -#!/bin/bash -# Cortex Linux - MVP Master Completion Script -# Prepares and submits all ready-to-review implementations - -set -e - -echo "🚀 CORTEX LINUX - MVP MASTER COMPLETION SCRIPT" -echo "==============================================" -echo "" - -# Configuration -REPO_DIR="$HOME/cortex" -ISSUES_WITH_CODE_READY=(10 12 14 20 24 29) # Issues where Mike has complete code ready -GITHUB_TOKEN=$(grep GITHUB_TOKEN ~/.zshrc | cut -d'=' -f2 | tr -d '"' | tr -d "'") - -cd "$REPO_DIR" || { echo "❌ cortex repo not found at $REPO_DIR"; exit 1; } - -# Ensure we're on main and up to date -echo "📥 Updating main branch..." -git checkout main -git pull origin main - -echo "" -echo "🔍 CHECKING EXISTING IMPLEMENTATIONS..." -echo "========================================" - -# Function to check if issue has implementation ready -check_implementation() { - local issue_num=$1 - local feature_file="" - - case $issue_num in - 10) feature_file="cortex/installation_verifier.py" ;; - 12) feature_file="cortex/dependency_resolver.py" ;; - 14) feature_file="cortex/rollback_manager.py" ;; - 20) feature_file="cortex/context_memory.py" ;; - 24) feature_file="cortex/context_memory.py" ;; # Same as #20 - 29) feature_file="cortex/logging_system.py" ;; - esac - - if [ -f "$feature_file" ]; then - echo "✅ Issue #$issue_num - Implementation exists: $feature_file" - return 0 - else - echo "⚠️ Issue #$issue_num - No implementation found at $feature_file" - return 1 - fi -} - -# Check all issues -READY_ISSUES=() -for issue in "${ISSUES_WITH_CODE_READY[@]}"; do - if check_implementation $issue; then - READY_ISSUES+=($issue) - fi -done - -echo "" -echo "📊 SUMMARY" -echo "==========" -echo "Issues with code ready: ${#READY_ISSUES[@]}" -echo "Ready to create PRs for: ${READY_ISSUES[*]}" -echo "" - -if [ ${#READY_ISSUES[@]} -eq 0 ]; then - echo "⚠️ No implementations found. Need to generate code first." - echo "" - echo "Run this to generate implementations:" - echo " ~/cortex-generate-mvp-code.sh" - exit 0 -fi - -read -p "Create PRs for ${#READY_ISSUES[@]} issues? (y/n): " -n 1 -r -echo -if [[ ! $REPLY =~ ^[Yy]$ ]]; then - echo "Aborted." - exit 0 -fi - -echo "" -echo "🚀 CREATING PULL REQUESTS..." -echo "============================" - -# Function to create PR for an issue -create_pr_for_issue() { - local issue_num=$1 - local branch_name="feature/issue-$issue_num" - - echo "" - echo "📝 Processing Issue #$issue_num..." - echo "-----------------------------------" - - # Get issue title and details - issue_data=$(gh issue view $issue_num --json title,body,labels) - issue_title=$(echo "$issue_data" | jq -r '.title') - - # Create feature branch - echo " Creating branch: $branch_name" - git checkout -b "$branch_name" main 2>/dev/null || git checkout "$branch_name" - - # Determine which files to include - files_to_add="" - case $issue_num in - 10) - files_to_add="cortex/installation_verifier.py tests/test_installation_verifier.py docs/INSTALLATION_VERIFIER.md" - ;; - 12) - files_to_add="cortex/dependency_resolver.py tests/test_dependency_resolver.py docs/DEPENDENCY_RESOLVER.md" - ;; - 14) - files_to_add="cortex/rollback_manager.py tests/test_rollback_manager.py docs/ROLLBACK_MANAGER.md" - ;; - 20|24) - files_to_add="cortex/context_memory.py tests/test_context_memory.py docs/CONTEXT_MEMORY.md" - ;; - 29) - files_to_add="cortex/logging_system.py tests/test_logging_system.py docs/LOGGING_SYSTEM.md" - ;; - esac - - # Add files if they exist - for file in $files_to_add; do - if [ -f "$file" ]; then - git add "$file" - echo " ✅ Added: $file" - else - echo " ⚠️ Missing: $file" - fi - done - - # Check if there are changes to commit - if git diff --staged --quiet; then - echo " ⚠️ No changes to commit for issue #$issue_num" - git checkout main - return 1 - fi - - # Commit changes - commit_msg="Add $issue_title - -Implements #$issue_num - -- Complete implementation with tests -- Comprehensive documentation -- Integration with existing Cortex architecture -- Ready for review and merge - -Closes #$issue_num" - - git commit -m "$commit_msg" - echo " ✅ Committed changes" - - # Push branch - echo " 📤 Pushing to GitHub..." - git push -u origin "$branch_name" - - # Create PR - pr_body="## Summary - -This PR implements **$issue_title** as specified in #$issue_num. - -## What's Included - -✅ Complete implementation (\`cortex/\` module) -✅ Comprehensive unit tests (\`tests/\`) -✅ Full documentation (\`docs/\`) -✅ Integration with existing architecture - -## Testing - -\`\`\`bash -pytest tests/test_*.py -v -\`\`\` - -All tests pass with >80% coverage. - -## Ready for Review - -This implementation is: -- ✅ Production-ready -- ✅ Well-tested -- ✅ Fully documented -- ✅ Integrated with Cortex architecture - -## Closes - -Closes #$issue_num - ---- - -**Bounty:** As specified in issue -**Reviewer:** @mikejmorgan-ai" - - echo " 📝 Creating pull request..." - pr_url=$(gh pr create \ - --title "$issue_title" \ - --body "$pr_body" \ - --base main \ - --head "$branch_name" \ - --label "enhancement,ready-for-review" 2>&1) - - if [ $? -eq 0 ]; then - echo " ✅ PR created: $pr_url" - PR_CREATED=true - else - echo " ❌ Failed to create PR: $pr_url" - PR_CREATED=false - fi - - # Return to main - git checkout main - - return 0 -} - -# Process each ready issue -SUCCESSFUL_PRS=0 -FAILED_PRS=0 - -for issue in "${READY_ISSUES[@]}"; do - if create_pr_for_issue $issue; then - ((SUCCESSFUL_PRS++)) - else - ((FAILED_PRS++)) - fi - sleep 2 # Rate limiting -done - -echo "" -echo "==============================================" -echo "✅ COMPLETION SUMMARY" -echo "==============================================" -echo "PRs created successfully: $SUCCESSFUL_PRS" -echo "Failed/skipped: $FAILED_PRS" -echo "" -echo "Next steps:" -echo "1. Review PRs at: https://github.com/cortexlinux/cortex/pulls" -echo "2. Merge approved PRs" -echo "3. Process bounty payments" -echo "" -echo "✅ Script complete!" diff --git a/scripts/automation/cortex-master-quarterback.sh b/scripts/automation/cortex-master-quarterback.sh deleted file mode 100755 index 982fc0d8..00000000 --- a/scripts/automation/cortex-master-quarterback.sh +++ /dev/null @@ -1,712 +0,0 @@ -#!/bin/bash -# CORTEX LINUX - MASTER QUARTERBACK SCRIPT -# Manages team onboarding, issue assignment, PR reviews, and project coordination -# Created: November 17, 2025 -# Usage: bash cortex-master-quarterback.sh - -set -e - -echo "🧠 CORTEX LINUX - MASTER QUARTERBACK SCRIPT" -echo "===========================================" -echo "" -echo "This script will:" -echo " 1. Welcome new developers individually" -echo " 2. Assign issues based on expertise" -echo " 3. Review and advance ready PRs" -echo " 4. Coordinate team activities" -echo "" - -# Configuration -REPO="cortexlinux/cortex" -GITHUB_TOKEN=$(grep GITHUB_TOKEN ~/.zshrc | cut -d'=' -f2 | tr -d '"' | tr -d "'") - -if [ -z "$GITHUB_TOKEN" ]; then - echo "❌ ERROR: GITHUB_TOKEN not found in ~/.zshrc" - echo "Please add: export GITHUB_TOKEN='your_token_here'" - exit 1 -fi - -# Check if gh CLI is installed -if ! command -v gh &> /dev/null; then - echo "❌ ERROR: GitHub CLI (gh) not installed" - echo "Install with: brew install gh" - exit 1 -fi - -# Authenticate gh CLI -export GH_TOKEN="$GITHUB_TOKEN" - -echo "✅ Configuration loaded" -echo "📊 Repository: $REPO" -echo "" - -# ============================================================================ -# SECTION 1: WELCOME NEW DEVELOPERS -# ============================================================================ - -echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" -echo "👋 SECTION 1: WELCOMING NEW DEVELOPERS" -echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" -echo "" - -# Function to welcome a developer -welcome_developer() { - local username=$1 - local name=$2 - local location=$3 - local skills=$4 - local strength=$5 - local recommended_issues=$6 - - echo "📝 Welcoming @$username ($name)..." - - # Create welcome comment - welcome_msg="👋 **Welcome to Cortex Linux, @$username!** - -We're thrilled to have you join our mission to build the AI-native operating system! - -## 🎯 Your Profile Highlights -**Location:** $location -**Primary Skills:** $skills -**Key Strength:** $strength - -## 💡 Recommended Issues for You -$recommended_issues - -## 🚀 Getting Started - -1. **Join our Discord**: https://discord.gg/uCqHvxjU83 (#dev-questions channel) -2. **Review Contributing Guide**: Check repo README and CONTRIBUTING.md -3. **Comment on issues** you're interested in - we'll provide starter code to accelerate development - -## 💰 Compensation Structure - -- **Cash bounties** on merge: \$25-200 depending on complexity -- **2x bonus** when we close our \$2-3M seed round (February 2025) -- **Founding team opportunities** for top contributors (equity post-funding) - -## 🤝 Our Development Model - -We use a **hybrid approach** that's proven successful: -- Mike + Claude generate complete implementations -- Contributors test, integrate, and validate -- 63% cost savings, 80% time savings -- Everyone wins with professional baseline code - -## 📋 Next Steps - -1. Browse issues and comment on ones that interest you -2. We'll provide starter code to save you time -3. Test, integrate, and submit PR -4. Get paid on merge! 🎉 - -**Questions?** Tag @mikejmorgan-ai in any issue or drop into Discord. - -Let's build something revolutionary together! 🧠⚡ - ---- -*Automated welcome from Cortex Team Management System*" - - echo "$welcome_msg" - echo "" - echo "Would you like to post this welcome to @$username's recent activity? (y/n)" - read -n 1 -r - echo "" - - if [[ $REPLY =~ ^[Yy]$ ]]; then - # Find their most recent issue comment or PR - recent_activity=$(gh api "/repos/$REPO/issues?state=all&creator=$username&per_page=1" 2>/dev/null | jq -r '.[0].number' 2>/dev/null) - - if [ ! -z "$recent_activity" ] && [ "$recent_activity" != "null" ]; then - echo " Posting welcome to Issue/PR #$recent_activity..." - echo "$welcome_msg" | gh issue comment $recent_activity --body-file - --repo $REPO 2>/dev/null || echo " ⚠️ Could not post (may need manual posting)" - echo " ✅ Welcome posted!" - else - echo " ℹ️ No recent activity found - save welcome message for their first interaction" - fi - else - echo " ⏭️ Skipped posting (you can post manually later)" - fi - - echo "" -} - -# Welcome each new developer -echo "Welcoming 5 new developers..." -echo "" - -welcome_developer \ - "AbuBakar877" \ - "Abu Bakar" \ - "Turkey 🇹🇷" \ - "Node.js, React, Angular, Full-stack web development" \ - "Modern JavaScript frameworks and web UI" \ - "- **Issue #27** (Progress Notifications UI) - \$100-150 - Perfect for your frontend skills -- **Issue #26** (User Preferences UI) - \$100-150 - Web interface components -- **Issue #33** (Config Export/Import) - \$75-100 - Data handling + UI" - -welcome_developer \ - "aliraza556" \ - "Ali Raza" \ - "Global Developer 🌍" \ - "Full-stack (1000+ contributions), Multi-language expert" \ - "Elite-tier developer with proven track record" \ - "- **Issue #14** (Rollback System) - \$150-200 - ✅ **ALREADY ASSIGNED** - You've got this! -- **Issue #12** (Dependency Resolution) - \$150-200 - Complex logic, perfect match -- **Issue #30** (Self-Update System) - \$150-200 - Advanced architecture -- **Issue #31** (Plugin System) - \$200-300 - Architectural design challenge" - -welcome_developer \ - "anees4500" \ - "Anees" \ - "Location TBD" \ - "Java, C, Python, JavaScript, CDC/Batch processing" \ - "Multi-language capability with data processing experience" \ - "- **Issue #32** (Batch Operations) - \$100-150 - Your CDC experience is perfect here -- **Issue #28** (Requirements Check) - \$75-100 - Systems validation -- **Issue #10** (Installation Verification) - \$100-150 - Backend validation work" - -welcome_developer \ - "brymut" \ - "Bryan Mutai" \ - "Nairobi, Kenya 🇰🇪" \ - "TypeScript, Python, PHP, JavaScript - Full-stack with backend focus" \ - "Architectural thinking with perfect skill stack (TypeScript + Python)" \ - "- **Issue #31** (Plugin System) - \$200-300 - **HIGHLY RECOMMENDED** - Architectural perfect match -- **Issue #26** (User Preferences) - \$100-150 - API design + backend -- **Issue #20** (Context Memory) - \$150-200 - TypeScript+Python combo ideal -- **Issue #25** (Network/Proxy Config) - \$150-200 - Backend + systems" - -welcome_developer \ - "shalinibhavi525-sudo" \ - "Shalini Bhavi" \ - "Ireland 🇮🇪" \ - "Python, JavaScript, HTML - Documentation focus" \ - "Documentation specialist with web UI skills" \ - "- **Issue #15** (Documentation) - \$100-150 - ✅ **ALREADY ASSIGNED** - Perfect match! -- **Issue #27** (Progress Notifications) - \$100-150 - User-facing UI work -- Testing bounties - \$50-75 - Validate implementations from other devs" - -echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" -echo "✅ Section 1 Complete: Developer welcomes prepared" -echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" -echo "" - -# ============================================================================ -# SECTION 2: ISSUE ASSIGNMENTS -# ============================================================================ - -echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" -echo "🎯 SECTION 2: STRATEGIC ISSUE ASSIGNMENTS" -echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" -echo "" - -echo "Analyzing current issue status..." - -# Function to assign issue -assign_issue() { - local issue_num=$1 - local developer=$2 - local reason=$3 - - echo "" - echo "📌 Assigning Issue #$issue_num to @$developer" - echo " Reason: $reason" - - # Check if issue exists and is unassigned - issue_info=$(gh issue view $issue_num --repo $REPO --json number,title,assignees,state 2>/dev/null || echo "") - - if [ -z "$issue_info" ]; then - echo " ⚠️ Issue #$issue_num not found or not accessible" - return - fi - - # Check if already assigned - assignee_count=$(echo "$issue_info" | jq '.assignees | length') - - if [ "$assignee_count" -gt 0 ]; then - current_assignee=$(echo "$issue_info" | jq -r '.assignees[0].login') - echo " ℹ️ Already assigned to @$current_assignee - skipping" - return - fi - - echo " Proceed with assignment? (y/n)" - read -n 1 -r - echo "" - - if [[ $REPLY =~ ^[Yy]$ ]]; then - gh issue edit $issue_num --add-assignee $developer --repo $REPO 2>/dev/null && \ - echo " ✅ Assigned!" || \ - echo " ⚠️ Could not assign (may need manual assignment)" - - # Add comment explaining assignment - assignment_comment="🎯 **Assigned to @$developer** - -**Why you're perfect for this:** $reason - -**Next Steps:** -1. Review the issue description and acceptance criteria -2. Comment if you'd like starter code from our hybrid development model -3. We can provide complete implementation for testing/integration (\$50-75) -4. Or build from scratch for full bounty - -**Questions?** Just ask! We're here to help you succeed. - ---- -*Automated assignment from Cortex Team Management*" - - echo "$assignment_comment" | gh issue comment $issue_num --body-file - --repo $REPO 2>/dev/null || true - else - echo " ⏭️ Skipped" - fi -} - -echo "" -echo "🔴 CRITICAL PATH ASSIGNMENTS (MVP Blockers)" -echo "─────────────────────────────────────────" - -# Issue #7 - Already assigned to chandrapratnamar, but check if help needed -echo "" -echo "Issue #7 (Package Manager Wrapper) - THE critical blocker" -echo " Current: Assigned to @chandrapratnamar (PR #17 in progress)" -echo " Status: Check if they need assistance" -echo " Action: Monitor weekly, offer @aliraza556 or @brymut for code review" -echo "" - -# Issue #10 - Installation Verification -assign_issue 10 "aliraza556" "Elite developer, perfect for systems validation work. Code is ready from Mike." - -# Issue #12 - Dependency Resolution -assign_issue 12 "brymut" "TypeScript+Python skills ideal for complex dependency logic. Mike has complete implementation." - -# Issue #14 - Already assigned to aliraza556 -echo "" -echo "Issue #14 (Rollback System) - ✅ Already assigned to @aliraza556" -echo " Action: Check PR status, offer review assistance" -echo "" - -echo "" -echo "🟡 HIGH PRIORITY ASSIGNMENTS" -echo "─────────────────────────────" - -# Issue #20/24 - Context Memory -assign_issue 20 "brymut" "Architectural experience + TypeScript/Python combo. Mike has implementation ready." - -# Issue #29 - Logging System -assign_issue 29 "anees4500" "Backend infrastructure work, good first complex task to assess quality." - -echo "" -echo "🟢 MEDIUM PRIORITY ASSIGNMENTS" -echo "───────────────────────────────" - -# Issue #25 - Network Config -assign_issue 25 "brymut" "Backend + systems knowledge required for proxy/network configuration." - -# Issue #26 - User Preferences -assign_issue 26 "AbuBakar877" "API + UI components match your full-stack web background." - -# Issue #27 - Progress Notifications -assign_issue 27 "AbuBakar877" "Frontend UI focus, perfect for your React/Angular experience." - -# Issue #28 - Requirements Check -assign_issue 28 "anees4500" "Systems validation, good complement to your batch processing skills." - -echo "" -echo "🔵 ADVANCED FEATURE ASSIGNMENTS" -echo "────────────────────────────────" - -# Issue #30 - Self-Update -assign_issue 30 "aliraza556" "Complex systems integration needs elite-tier developer." - -# Issue #31 - Plugin System -assign_issue 31 "brymut" "**HIGHEST RECOMMENDATION** - Architectural design matches your background perfectly." - -# Issue #32 - Batch Operations -assign_issue 32 "anees4500" "Your CDC/batch processing experience is ideal match." - -# Issue #33 - Config Export/Import -assign_issue 33 "shalinibhavi525-sudo" "Data handling + web UI, complements your documentation work." - -# Issue #15 - Already assigned -echo "" -echo "Issue #15 (Documentation) - ✅ Already assigned to @shalinibhavi525-sudo" -echo " Action: Check progress, offer assistance if needed" -echo "" - -echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" -echo "✅ Section 2 Complete: Strategic assignments made" -echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" -echo "" - -# ============================================================================ -# SECTION 3: PULL REQUEST REVIEW -# ============================================================================ - -echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" -echo "🔍 SECTION 3: PULL REQUEST REVIEW & ADVANCEMENT" -echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" -echo "" - -echo "Fetching open pull requests..." - -# Get all open PRs -prs=$(gh pr list --repo $REPO --state open --json number,title,author,createdAt,mergeable,reviewDecision --limit 50 2>/dev/null || echo "[]") - -pr_count=$(echo "$prs" | jq 'length') - -echo "Found $pr_count open pull requests" -echo "" - -if [ "$pr_count" -eq 0 ]; then - echo "✅ No open PRs to review" -else - echo "$prs" | jq -r '.[] | "PR #\(.number): \(.title) by @\(.author.login) - \(.reviewDecision // "PENDING")"' - echo "" - - echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" - echo "PR REVIEW PRIORITIES" - echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" - echo "" - - # Critical PRs (Issue #7 related) - echo "🔴 CRITICAL - Package Manager (Issue #7)" - echo "PR #17 by @chandrapratnamar" - echo " Action: Review immediately, this is THE MVP blocker" - echo " Review criteria:" - echo " - Does it translate natural language to apt commands?" - echo " - Are tests comprehensive?" - echo " - Does it integrate with LLM layer?" - echo "" - - echo "🟡 HIGH PRIORITY - MVP Features" - echo "Check for PRs related to:" - echo " - Issue #10 (Installation Verification)" - echo " - Issue #12 (Dependency Resolution)" - echo " - Issue #14 (Rollback System)" - echo " - Issue #13 (Error Parser) - PR #23 by @AbdulKadir877" - echo "" - - echo "🟢 STANDARD PRIORITY - All other PRs" - echo "Review remaining PRs in order received" - echo "" - - echo "Would you like to review PRs interactively? (y/n)" - read -n 1 -r - echo "" - - if [[ $REPLY =~ ^[Yy]$ ]]; then - echo "" - echo "Opening PR review interface..." - echo "" - - # For each PR, offer review options - echo "$prs" | jq -r '.[] | .number' | while read pr_num; do - pr_info=$(gh pr view $pr_num --repo $REPO --json number,title,author,body 2>/dev/null) - pr_title=$(echo "$pr_info" | jq -r '.title') - pr_author=$(echo "$pr_info" | jq -r '.author.login') - - echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" - echo "Reviewing PR #$pr_num: $pr_title" - echo "Author: @$pr_author" - echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" - echo "" - echo "Actions:" - echo " [v] View PR in browser" - echo " [a] Approve PR" - echo " [c] Request changes" - echo " [m] Add comment" - echo " [s] Skip to next" - echo " [q] Quit review mode" - echo "" - echo -n "Choose action: " - read -n 1 action - echo "" - - case $action in - v|V) - gh pr view $pr_num --repo $REPO --web - ;; - a|A) - echo "✅ Approving PR #$pr_num..." - gh pr review $pr_num --repo $REPO --approve --body "✅ **APPROVED** - -Excellent work @$pr_author! This implementation: -- Meets acceptance criteria -- Includes comprehensive tests -- Integrates well with existing architecture -- Documentation is clear - -**Next Steps:** -1. Merging this PR -2. Bounty will be processed -3. Thank you for your contribution! - -🎉 Welcome to the Cortex Linux contributor team!" - echo "Would you like to merge now? (y/n)" - read -n 1 merge_now - echo "" - if [[ $merge_now =~ ^[Yy]$ ]]; then - gh pr merge $pr_num --repo $REPO --squash --delete-branch - echo "✅ Merged and branch deleted!" - fi - ;; - c|C) - echo "Enter feedback (press Ctrl+D when done):" - feedback=$(cat) - gh pr review $pr_num --repo $REPO --request-changes --body "🔄 **Changes Requested** - -Thanks for your work @$pr_author! Here's what needs attention: - -$feedback - -**Please update and let me know when ready for re-review.** - -We're here to help if you have questions!" - ;; - m|M) - echo "Enter comment (press Ctrl+D when done):" - comment=$(cat) - gh pr comment $pr_num --repo $REPO --body "$comment" - echo "✅ Comment added" - ;; - q|Q) - echo "Exiting review mode..." - break - ;; - *) - echo "Skipping..." - ;; - esac - echo "" - done - else - echo "⏭️ Skipped interactive review" - echo " You can review PRs manually at: https://github.com/$REPO/pulls" - fi -fi - -echo "" -echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" -echo "✅ Section 3 Complete: PR review assistance provided" -echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" -echo "" - -# ============================================================================ -# SECTION 4: TEAM COORDINATION -# ============================================================================ - -echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" -echo "🤝 SECTION 4: TEAM COORDINATION & NEXT ACTIONS" -echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" -echo "" - -echo "📊 CURRENT PROJECT STATUS" -echo "─────────────────────────" -echo "" - -# Count issues by status -total_issues=$(gh issue list --repo $REPO --limit 1000 --json number 2>/dev/null | jq 'length') -open_issues=$(gh issue list --repo $REPO --state open --limit 1000 --json number 2>/dev/null | jq 'length') -closed_issues=$(gh issue list --repo $REPO --state closed --limit 1000 --json number 2>/dev/null | jq 'length') - -echo "Issues:" -echo " Total: $total_issues" -echo " Open: $open_issues" -echo " Closed: $closed_issues" -echo "" - -# Count PRs -open_prs=$(gh pr list --repo $REPO --state open --json number 2>/dev/null | jq 'length') -merged_prs=$(gh pr list --repo $REPO --state merged --limit 100 --json number 2>/dev/null | jq 'length') - -echo "Pull Requests:" -echo " Open: $open_prs" -echo " Merged (recent): $merged_prs" -echo "" - -echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" -echo "" - -echo "🎯 IMMEDIATE ACTION ITEMS (Priority Order)" -echo "──────────────────────────────────────────" -echo "" - -echo "1. 🔴 CRITICAL - Check Issue #7 Progress" -echo " - PR #17 by @chandrapratnamar" -echo " - This is THE MVP blocker" -echo " - Review weekly, offer assistance" -echo " - Command: gh pr view 17 --repo $REPO --web" -echo "" - -echo "2. 🟡 HIGH - Review Ready PRs" -echo " - PR #23 (Error Parser) by @AbdulKadir877" -echo " - Any PRs marked 'ready-for-review'" -echo " - Command: gh pr list --repo $REPO --label ready-for-review" -echo "" - -echo "3. 🟢 MEDIUM - Upload Complete Implementations" -echo " - Issue #10 (Installation Verification) - Code ready" -echo " - Issue #12 (Dependency Resolution) - Code ready" -echo " - Issue #14 (Rollback System) - Code ready with @aliraza556" -echo " - Use: ~/cortex/cortex-master-pr-creator.sh" -echo "" - -echo "4. 🔵 ENGAGE NEW DEVELOPERS" -echo " - Post welcome messages (generated above)" -echo " - Monitor their first comments/PRs" -echo " - Offer starter code to accelerate" -echo "" - -echo "5. 💰 PROCESS BOUNTIES" -echo " - Track merged PRs" -echo " - Calculate owed bounties" -echo " - Process payments (crypto for international)" -echo "" - -echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" -echo "" - -echo "📋 RECOMMENDED WEEKLY ROUTINE" -echo "─────────────────────────────" -echo "" -echo "Monday:" -echo " - Run this quarterback script" -echo " - Review critical path (Issue #7)" -echo " - Merge ready PRs" -echo "" -echo "Wednesday:" -echo " - Check new issues/comments" -echo " - Respond to developer questions" -echo " - Upload any ready implementations" -echo "" -echo "Friday:" -echo " - Process bounty payments" -echo " - Update team on Discord" -echo " - Plan next week priorities" -echo "" - -echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" -echo "" - -echo "🔗 QUICK LINKS" -echo "──────────────" -echo "" -echo "Repository: https://github.com/$REPO" -echo "Open Issues: https://github.com/$REPO/issues" -echo "Open PRs: https://github.com/$REPO/pulls" -echo "Discord: https://discord.gg/uCqHvxjU83" -echo "Project Board: https://github.com/orgs/cortexlinux/projects" -echo "" - -echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" -echo "" - -echo "📱 POST TO DISCORD" -echo "──────────────────" -echo "" - -discord_announcement="🎉 **Team Update - November 17, 2025** - -**Welcome 5 New Developers!** -- @AbuBakar877 (Turkey) - Full-stack web specialist -- @aliraza556 (Global) - Elite tier, 1000+ contributions -- @anees4500 - Multi-language backend expert -- @brymut (Kenya) - TypeScript + Python architect -- @shalinibhavi525-sudo (Ireland) - Documentation specialist - -**Strategic Assignments Made:** -- Issue #31 (Plugin System) → @brymut (architectural perfect match) -- Issue #10 (Installation Verification) → @aliraza556 -- Issue #32 (Batch Operations) → @anees4500 -- Issue #27 (Progress UI) → @AbuBakar877 -- Issue #15 (Documentation) → @shalinibhavi525-sudo ✅ - -**Critical Path:** -- Issue #7 (Package Manager) - THE blocker - @chandrapratnamar working PR #17 -- Monitoring weekly, need completion for MVP - -**Ready to Review:** -- Multiple PRs waiting for review -- Bounties ready to process on merge - -**The Hybrid Model Works:** -- 63% cost savings -- 80% time savings -- Professional baseline + contributor validation -- Win-win for everyone - -💰 **Bounties:** \$25-200 on merge + 2x bonus at funding -🎯 **Goal:** MVP complete for February 2025 seed round -💼 **Opportunities:** Founding team roles for top contributors - -Browse issues: https://github.com/$REPO/issues -Questions? #dev-questions channel - -Let's build the future of Linux! 🧠⚡" - -echo "$discord_announcement" -echo "" -echo "Copy the above message and post to Discord #announcements" -echo "" - -echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" -echo "✅ Section 4 Complete: Team coordination completed" -echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" -echo "" - -# ============================================================================ -# FINAL SUMMARY -# ============================================================================ - -echo "" -echo "════════════════════════════════════════════════════════" -echo "🏆 CORTEX QUARTERBACK SCRIPT - EXECUTION COMPLETE" -echo "════════════════════════════════════════════════════════" -echo "" - -echo "📊 EXECUTION SUMMARY" -echo "────────────────────" -echo "" -echo "✅ 5 developers welcomed with personalized messages" -echo "✅ 10+ strategic issue assignments made" -echo "✅ PR review guidance provided" -echo "✅ Team coordination plan established" -echo "✅ Discord announcement prepared" -echo "" - -echo "🎯 YOUR NEXT STEPS (Priority Order)" -echo "────────────────────────────────────" -echo "" -echo "1. Post Discord announcement (message above)" -echo "2. Review PR #17 (Issue #7 - THE BLOCKER)" -echo "3. Check for new developer comments" -echo "4. Upload ready implementations (Issues #10, #12, #14)" -echo "5. Process any merged PR bounties" -echo "" - -echo "💡 STRATEGIC RECOMMENDATIONS" -echo "─────────────────────────────" -echo "" -echo "✅ aliraza556 - Elite tier, consider for senior role/CTO discussion" -echo "✅ brymut - Perfect skills for Plugin System (#31), high potential" -echo "⚠️ anees4500 - New, monitor first contribution quality" -echo "✅ AbuBakar877 - Keep on web UI work, avoid core systems" -echo "✅ shalinibhavi525-sudo - Perfect for docs, complement with testing" -echo "" - -echo "🔥 CRITICAL PATH REMINDER" -echo "──────────────────────────" -echo "" -echo "Issue #7 (Package Manager Wrapper) is THE BLOCKER for MVP." -echo "Everything else can proceed in parallel, but #7 must complete." -echo "Check PR #17 weekly, offer assistance to @chandrapratnamar." -echo "" - -echo "════════════════════════════════════════════════════════" -echo "✅ Ready for next session!" -echo "════════════════════════════════════════════════════════" -echo "" - -echo "Run this script weekly to quarterback your growing team." -echo "The Cortex Linux revolution is accelerating! 🧠⚡" -echo "" diff --git a/scripts/automation/cortex-master-update.sh b/scripts/automation/cortex-master-update.sh deleted file mode 100755 index f5afb060..00000000 --- a/scripts/automation/cortex-master-update.sh +++ /dev/null @@ -1,301 +0,0 @@ -#!/bin/bash -# CORTEX LINUX - MASTER REPOSITORY UPDATE SCRIPT -# Analyzes PRs, merges ready ones, assigns issues, tracks bounties - -set -e - -REPO="cortexlinux/cortex" -GITHUB_TOKEN=$(grep GITHUB_TOKEN ~/.zshrc | cut -d'=' -f2 | tr -d '"' | tr -d "'") -export GH_TOKEN="$GITHUB_TOKEN" - -echo "🧠 CORTEX LINUX - MASTER UPDATE" -echo "================================" -echo "" - -# ============================================================================ -# STEP 1: MERGE READY PRS -# ============================================================================ - -echo "📊 STEP 1: REVIEWING & MERGING READY PRS" -echo "─────────────────────────────────────────" -echo "" - -# PR #195: Package Manager (dhvll) - REPLACES PR #17 -echo "🔴 PR #195: Package Manager Wrapper (@dhvll)" -echo " Status: MERGEABLE ✅" -echo " Action: MERGE NOW - This is THE MVP blocker" -echo "" - -gh pr review 195 --repo $REPO --approve --body "✅ APPROVED - Excellent package manager implementation! This replaces PR #17 and unblocks the entire MVP. Outstanding work @dhvll!" - -gh pr merge 195 --repo $REPO --squash --delete-branch --admin && { - echo "✅ PR #195 MERGED - MVP BLOCKER CLEARED!" - echo "" - - # Close Issue #7 - gh issue close 7 --repo $REPO --comment "✅ Completed in PR #195 by @dhvll. Package manager wrapper is live and working!" - - # Close old PR #17 - gh pr close 17 --repo $REPO --comment "Closing in favor of PR #195 which has a cleaner implementation. Thank you @chandrapratamar for the original work - you'll still receive the $100 bounty for your contribution." - - echo "✅ Issue #7 closed" - echo "✅ PR #17 closed (superseded)" - echo "" -} || { - echo "⚠️ PR #195 merge failed - check manually" - echo "" -} - -# PR #198: Rollback System (aliraza556) -echo "🟢 PR #198: Installation History & Rollback (@aliraza556)" -echo " Status: MERGEABLE ✅" -echo " Bounty: $150" -echo "" - -gh pr review 198 --repo $REPO --approve --body "✅ APPROVED - Comprehensive rollback system! $150 bounty within 48 hours. Outstanding work @aliraza556!" - -gh pr merge 198 --repo $REPO --squash --delete-branch --admin && { - echo "✅ PR #198 MERGED" - gh issue close 14 --repo $REPO --comment "✅ Completed in PR #198 by @aliraza556. Rollback system is live!" - echo " 💰 Bounty owed: $150 to @aliraza556" - echo "" -} || { - echo "⚠️ PR #198 merge failed" - echo "" -} - -# PR #197: Cleanup (mikejmorgan-ai) -echo "🟢 PR #197: Remove Duplicate Workflow" -echo " Status: MERGEABLE ✅" -echo "" - -gh pr merge 197 --repo $REPO --squash --delete-branch --admin && { - echo "✅ PR #197 MERGED" - echo "" -} || { - echo "⚠️ PR #197 merge failed" - echo "" -} - -# PR #21: Config Templates (aliraza556) -echo "🟡 PR #21: Configuration Templates (@aliraza556)" -echo " Status: MERGEABLE ✅" -echo " Bounty: $150" -echo "" - -gh pr review 21 --repo $REPO --approve --body "✅ APPROVED - Production-ready config templates! $150 bounty within 48 hours." - -gh pr merge 21 --repo $REPO --squash --delete-branch --admin && { - echo "✅ PR #21 MERGED" - gh issue close 9 --repo $REPO --comment "✅ Completed in PR #21. Config templates are live!" - echo " 💰 Bounty owed: $150 to @aliraza556" - echo "" -} || { - echo "⚠️ PR #21 merge failed" - echo "" -} - -# PR #38: Requirements Check (AlexanderLuzDH) - HAS CONFLICTS -echo "⏭️ PR #38: Requirements Checker (@AlexanderLuzDH)" -echo " Status: CONFLICTING ❌" -echo " Action: Skip - needs contributor to fix conflicts" -echo " Bounty: $100 pending" -echo "" - -# PR #18: CLI Interface (Sahilbhatane) - DRAFT -echo "⏭️ PR #18: CLI Interface (@Sahilbhatane)" -echo " Status: DRAFT - not ready yet" -echo " Action: Skip" -echo "" - -# ============================================================================ -# STEP 2: ASSIGN UNASSIGNED MVP ISSUES -# ============================================================================ - -echo "" -echo "📋 STEP 2: ASSIGNING UNASSIGNED MVP ISSUES" -echo "───────────────────────────────────────────" -echo "" - -# High-value issues that need assignment -MVP_ISSUES=(144 135 131 128 126 125 119 117 112 103 44 25) - -echo "Unassigned MVP issues ready for contributors:" -echo "" - -for issue in "${MVP_ISSUES[@]}"; do - issue_info=$(gh issue view $issue --repo $REPO --json title,assignees,labels 2>/dev/null) - issue_title=$(echo "$issue_info" | jq -r '.title') - assignee_count=$(echo "$issue_info" | jq '.assignees | length') - - if [ "$assignee_count" -eq 0 ]; then - echo " #$issue: $issue_title" - fi -done - -echo "" -echo "These issues are ready for contributors to claim." -echo "Post to Discord: 'MVP issues available - claim in comments!'" -echo "" - -# ============================================================================ -# STEP 3: BOUNTY TRACKING -# ============================================================================ - -echo "" -echo "💰 STEP 3: BOUNTY TRACKING UPDATE" -echo "─────────────────────────────────" -echo "" - -BOUNTY_FILE="$HOME/cortex/bounties_owed.csv" - -if [ ! -f "$BOUNTY_FILE" ]; then - echo "PR,Developer,Feature,Bounty_Amount,Date_Merged,Status" > "$BOUNTY_FILE" -fi - -# Add new bounties from today's merges -echo "195,dhvll,Package Manager Wrapper,100,$(date +%Y-%m-%d),PENDING" >> "$BOUNTY_FILE" -echo "198,aliraza556,Installation Rollback,150,$(date +%Y-%m-%d),PENDING" >> "$BOUNTY_FILE" -echo "21,aliraza556,Config Templates,150,$(date +%Y-%m-%d),PENDING" >> "$BOUNTY_FILE" -echo "17,chandrapratamar,Package Manager (original),100,$(date +%Y-%m-%d),PENDING" >> "$BOUNTY_FILE" - -echo "Updated: $BOUNTY_FILE" -echo "" - -echo "BOUNTIES OWED:" -echo "──────────────" -tail -n +2 "$BOUNTY_FILE" | while IFS=',' read -r pr dev feature amount date status; do - if [ "$status" = "PENDING" ]; then - echo " PR #$pr - @$dev: \$$amount ($feature)" - fi -done - -echo "" - -# Calculate totals -total_owed=$(tail -n +2 "$BOUNTY_FILE" | awk -F',' '$6=="PENDING" {sum+=$4} END {print sum}') -echo " Total pending: \$$total_owed" -echo " At 2x bonus (funding): \$$(($total_owed * 2))" -echo "" - -# ============================================================================ -# STEP 4: GENERATE STATUS REPORT -# ============================================================================ - -echo "" -echo "📊 STEP 4: FINAL STATUS REPORT" -echo "───────────────────────────────" -echo "" - -echo "=== CORTEX REPOSITORY STATUS ===" -echo "" - -# Count current state -open_prs=$(gh pr list --repo $REPO --state open --json number | jq 'length') -open_issues=$(gh issue list --repo $REPO --state open --json number | jq 'length') - -echo "PRs:" -echo " Open: $open_prs" -echo " Merged today: 4 (PRs #195, #198, #197, #21)" -echo "" - -echo "Issues:" -echo " Open: $open_issues" -echo " Closed today: 2 (Issues #7, #14)" -echo "" - -echo "MVP Status:" -echo " ✅ Package Manager: COMPLETE (PR #195)" -echo " ✅ Rollback System: COMPLETE (PR #198)" -echo " ✅ Config Templates: COMPLETE (PR #21)" -echo " ✅ Hardware Detection: COMPLETE" -echo " ✅ Dependencies: COMPLETE" -echo " ✅ Verification: COMPLETE" -echo " ✅ Error Parsing: COMPLETE" -echo " ✅ Context Memory: COMPLETE" -echo " ✅ Logging: COMPLETE" -echo " ✅ Progress UI: COMPLETE" -echo " ⏳ Requirements Check: Conflicts (PR #38)" -echo "" -echo " MVP COMPLETE: 95%" -echo "" - -echo "Bounties:" -echo " Owed: \$$total_owed" -echo " Contributors to pay: @dhvll, @aliraza556 (x2), @chandrapratamar" -echo "" - -# ============================================================================ -# STEP 5: DISCORD ANNOUNCEMENT -# ============================================================================ - -echo "" -echo "📱 STEP 5: DISCORD ANNOUNCEMENT (COPY & POST)" -echo "─────────────────────────────────────────────" -echo "" - -cat << 'DISCORD' -🎉 **MAJOR MVP MILESTONE - November 17, 2025** - -**BREAKTHROUGH: Package Manager MERGED! 🚀** - -PR #195 by @dhvll just merged - THE critical MVP blocker is cleared! - -**Today's Merges:** -✅ PR #195 - Package Manager Wrapper (@dhvll) -✅ PR #198 - Installation Rollback (@aliraza556) -✅ PR #21 - Config File Templates (@aliraza556) -✅ PR #197 - Workflow Cleanup - -**Issues Closed:** -✅ #7 - Package Manager (9 days → DONE!) -✅ #14 - Rollback System - -**MVP Status: 95% COMPLETE** 🎯 - -**What This Means:** -- Core "cortex install" functionality working -- Natural language → apt commands = LIVE -- Rollback safety net = LIVE -- Production-ready config templates = LIVE - -**Bounties Being Processed:** -- @dhvll: $100 -- @aliraza556: $300 ($150 x 2 PRs!) -- @chandrapratamar: $100 -Total: $500 (+ 2x at funding = $1000) - -**Available Issues:** -10+ MVP features ready to claim - check GitHub issues! - -**Next: Demo preparation for February 2025 funding round** - -We're making history! 🧠⚡ - -https://github.com/cortexlinux/cortex -DISCORD - -echo "" -echo "─────────────────────────────────────────────" -echo "" - -# ============================================================================ -# STEP 6: NEXT STEPS -# ============================================================================ - -echo "🎯 NEXT STEPS" -echo "─────────────" -echo "" -echo "1. Post Discord announcement above to #announcements" -echo "2. Coordinate payments with:" -echo " - @dhvll ($100)" -echo " - @aliraza556 ($300)" -echo " - @chandrapratamar ($100)" -echo "3. Wait for PR #38 conflict resolution" -echo "4. Create demo script: 'cortex install oracle-23-ai'" -echo "5. Prepare investor presentation materials" -echo "" - -echo "✅ MASTER UPDATE COMPLETE" -echo "" -echo "Repository is MVP-ready for February 2025 funding!" diff --git a/scripts/automation/cortex-master.sh b/scripts/automation/cortex-master.sh deleted file mode 100755 index 94e485b0..00000000 --- a/scripts/automation/cortex-master.sh +++ /dev/null @@ -1,194 +0,0 @@ -#!/bin/bash -# Cortex Linux - Master MVP Automation System -# One script to rule them all - -set -e - -# Colors -GREEN='\033[0;32m' -YELLOW='\033[1;33m' -BLUE='\033[0;34m' -NC='\033[0m' - -REPO_DIR="$HOME/cortex" -WORK_DIR="$HOME/Downloads/cortex-work" -mkdir -p "$WORK_DIR" - -print_banner() { - echo -e "${BLUE}" - echo "╔════════════════════════════════════════════════╗" - echo "║ CORTEX LINUX - MVP MASTER AUTOMATION ║" - echo "╚════════════════════════════════════════════════╝" - echo -e "${NC}" -} - -show_menu() { - echo "" - echo -e "${GREEN}═══ MAIN MENU ═══${NC}" - echo "" - echo "1. Show MVP dashboard" - echo "2. List MVP-critical issues" - echo "3. Create PR for issue #10" - echo "4. Review pending PRs" - echo "5. Merge PR" - echo "6. List contributors" - echo "7. Assign issue to contributor" - echo "8. Process bounty payment" - echo "9. Generate weekly report" - echo "10. Full repository audit" - echo "" - echo "0. Exit" - echo "" - echo -n "Select: " -} - -show_dashboard() { - cd "$REPO_DIR" - echo -e "${BLUE}═══ CORTEX MVP DASHBOARD ═══${NC}" - echo "" - echo "📊 Issues:" - echo " Total: $(gh issue list --limit 1000 --json number | jq '. | length')" - echo " MVP Critical: $(gh issue list --label 'mvp-critical' --json number | jq '. | length')" - echo "" - echo "🔀 Pull Requests:" - echo " Open: $(gh pr list --json number | jq '. | length')" - echo "" - echo "👥 Recent activity:" - gh pr list --state all --limit 5 --json number,title,author | \ - jq -r '.[] | " PR #\(.number): \(.title) (@\(.author.login))"' -} - -list_mvp() { - cd "$REPO_DIR" - echo -e "${GREEN}📋 MVP-Critical Issues:${NC}" - gh issue list --label "mvp-critical" --limit 20 --json number,title,assignees | \ - jq -r '.[] | " #\(.number): \(.title)"' -} - -create_pr_issue10() { - cd "$REPO_DIR" - git checkout feature/issue-10 2>/dev/null || { - echo "Branch feature/issue-10 not found" - return 1 - } - - gh pr create \ - --title "Add Installation Verification System - Fixes #10" \ - --body "Complete implementation: 918 lines (code+tests+docs). Ready for review." \ - --label "enhancement,ready-for-review,priority: critical" - - git checkout main - echo "✅ PR created!" -} - -review_prs() { - cd "$REPO_DIR" - echo -e "${GREEN}📋 Open Pull Requests:${NC}" - gh pr list --json number,title,author,createdAt | \ - jq -r '.[] | " PR #\(.number): \(.title)\n Author: @\(.author.login)\n Created: \(.createdAt)\n"' -} - -merge_pr() { - echo -n "PR number to merge: " - read pr_num - cd "$REPO_DIR" - gh pr merge $pr_num --squash --delete-branch - echo "✅ Merged!" -} - -list_contributors() { - cd "$REPO_DIR" - echo -e "${GREEN}👥 Active Contributors:${NC}" - gh pr list --state all --limit 50 --json author | \ - jq -r '.[].author.login' | sort | uniq -c | sort -rn | head -10 -} - -assign_issue() { - echo -n "Issue #: " - read issue - echo -n "Assign to (username): " - read user - cd "$REPO_DIR" - gh issue edit $issue --add-assignee "$user" - gh issue comment $issue --body "👋 @$user - This is assigned to you! Questions? Ask in Discord." - echo "✅ Assigned!" -} - -process_bounty() { - echo -n "PR #: " - read pr - echo -n "Username: " - read user - echo -n "Amount $: " - read amount - - cd "$REPO_DIR" - gh pr comment $pr --body "💰 **Bounty Approved: \$$amount** - -@$user - DM me your payment method. Payment Friday. Plus 2x bonus at funding! - -Thanks! 🎉" - - echo "✅ Bounty processed!" -} - -weekly_report() { - cd "$REPO_DIR" - echo "# Cortex Linux - Weekly Report" - echo "Week of $(date +%Y-%m-%d)" - echo "" - echo "## PRs This Week" - gh pr list --state merged --limit 10 --json number,title | \ - jq -r '.[] | "- PR #\(.number): \(.title)"' - echo "" - echo "## Metrics" - echo "- Open Issues: $(gh issue list --json number | jq '. | length')" - echo "- Open PRs: $(gh pr list --json number | jq '. | length')" -} - -audit_repo() { - cd "$REPO_DIR" - echo "Repository: cortexlinux/cortex" - echo "Branch: $(git branch --show-current)" - echo "Last commit: $(git log -1 --oneline)" - echo "" - echo "Issues: $(gh issue list --json number | jq '. | length') open" - echo "PRs: $(gh pr list --json number | jq '. | length') open" - echo "" - echo "Recent activity:" - gh run list --limit 3 -} - -main() { - print_banner - - cd "$REPO_DIR" 2>/dev/null || { - echo "❌ Repo not found at $REPO_DIR" - exit 1 - } - - while true; do - show_menu - read choice - - case $choice in - 1) show_dashboard ;; - 2) list_mvp ;; - 3) create_pr_issue10 ;; - 4) review_prs ;; - 5) merge_pr ;; - 6) list_contributors ;; - 7) assign_issue ;; - 8) process_bounty ;; - 9) weekly_report ;; - 10) audit_repo ;; - 0) echo "Goodbye!"; exit 0 ;; - *) echo "Invalid option" ;; - esac - - echo "" - read -p "Press Enter..." - done -} - -main diff --git a/scripts/automation/cortex-pr-dashboard.sh b/scripts/automation/cortex-pr-dashboard.sh deleted file mode 100755 index df0b42df..00000000 --- a/scripts/automation/cortex-pr-dashboard.sh +++ /dev/null @@ -1,362 +0,0 @@ -#!/bin/bash -# CORTEX - MASTER PR DASHBOARD & MANAGEMENT -# Complete PR overview, batch operations, and bounty tracking - -set -e - -echo "🎛️ CORTEX - MASTER PR DASHBOARD" -echo "================================" -echo "" - -REPO="cortexlinux/cortex" -GITHUB_TOKEN=$(grep GITHUB_TOKEN ~/.zshrc | cut -d'=' -f2 | tr -d '"' | tr -d "'") -export GH_TOKEN="$GITHUB_TOKEN" - -# Colors for terminal output -RED='\033[0;31m' -YELLOW='\033[1;33m' -GREEN='\033[0;32m' -BLUE='\033[0;34m' -NC='\033[0m' # No Color - -echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" -echo "📊 PR STATUS OVERVIEW" -echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" -echo "" - -# Get all open PRs -prs=$(gh pr list --repo $REPO --state open --json number,title,author,createdAt,isDraft,reviewDecision --limit 50 2>/dev/null) - -total_prs=$(echo "$prs" | jq 'length') -contributor_prs=$(echo "$prs" | jq '[.[] | select(.author.login != "mikejmorgan-ai")] | length') -mike_prs=$(echo "$prs" | jq '[.[] | select(.author.login == "mikejmorgan-ai")] | length') - -echo "Total Open PRs: $total_prs" -echo " ├─ From Contributors: $contributor_prs (🔥 Need review)" -echo " └─ From Mike: $mike_prs (Can merge anytime)" -echo "" - -# Calculate bounties at stake -echo "💰 ESTIMATED BOUNTIES AT STAKE" -echo "────────────────────────────────" -echo "" - -declare -A BOUNTY_MAP -BOUNTY_MAP[17]=100 # Package Manager -BOUNTY_MAP[37]=125 # Progress Notifications -BOUNTY_MAP[38]=100 # Requirements Check -BOUNTY_MAP[21]=150 # Config Templates -BOUNTY_MAP[18]=100 # CLI Interface - -total_contributor_bounties=0 - -for pr in 17 37 38 21 18; do - bounty=${BOUNTY_MAP[$pr]} - total_contributor_bounties=$((total_contributor_bounties + bounty)) -done - -echo "Contributor PRs: \$$total_contributor_bounties" -echo "At 2x bonus (funding): \$$((total_contributor_bounties * 2))" -echo "" - -echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" -echo "🔴 CRITICAL PRIORITY" -echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" -echo "" - -pr17_info=$(gh pr view 17 --repo $REPO --json number,title,author,createdAt,state 2>/dev/null) -pr17_title=$(echo "$pr17_info" | jq -r '.title') -pr17_author=$(echo "$pr17_info" | jq -r '.author.login') -pr17_created=$(echo "$pr17_info" | jq -r '.createdAt' | cut -d'T' -f1) -pr17_days_old=$(( ( $(date +%s) - $(date -j -f "%Y-%m-%d" "$pr17_created" +%s 2>/dev/null || date +%s) ) / 86400 )) - -echo "PR #17: $pr17_title" -echo "Author: @$pr17_author" -echo "Age: $pr17_days_old days old" -echo "Bounty: \$100" -echo "Impact: ⚠️ MVP BLOCKER - Everything waits on this" -echo "" -echo -e "${RED}▶ ACTION REQUIRED: Review this PR FIRST${NC}" -echo "" - -echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" -echo "🟡 HIGH PRIORITY (Contributors Waiting)" -echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" -echo "" - -for pr in 37 38 21; do - pr_info=$(gh pr view $pr --repo $REPO --json number,title,author,createdAt 2>/dev/null) - pr_title=$(echo "$pr_info" | jq -r '.title') - pr_author=$(echo "$pr_info" | jq -r '.author.login') - pr_bounty=${BOUNTY_MAP[$pr]} - - echo "PR #$pr: $pr_title" - echo " Author: @$pr_author | Bounty: \$$pr_bounty" -done - -echo "" - -echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" -echo "🟢 MIKE'S PRs (Ready to Merge)" -echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" -echo "" - -mike_pr_list=$(echo "$prs" | jq -r '.[] | select(.author.login == "mikejmorgan-ai") | .number') - -for pr in $mike_pr_list; do - pr_info=$(gh pr view $pr --repo $REPO --json number,title 2>/dev/null) - pr_title=$(echo "$pr_info" | jq -r '.title') - echo "PR #$pr: $pr_title" -done - -echo "" - -echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" -echo "🎯 QUICK ACTIONS" -echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" -echo "" - -echo "What would you like to do?" -echo "" -echo " [1] Review PR #17 (THE CRITICAL BLOCKER) 🔴" -echo " [2] Review ALL contributor PRs (guided workflow) 🟡" -echo " [3] Merge ALL of Mike's PRs (batch operation) 🟢" -echo " [4] View detailed PR list in browser" -echo " [5] Generate bounty payment report" -echo " [6] Post Discord update" -echo " [q] Quit" -echo "" -echo -n "Choose action: " -read -n 1 choice -echo "" -echo "" - -case $choice in - 1) - echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" - echo "🔴 REVIEWING PR #17 - PACKAGE MANAGER WRAPPER" - echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" - echo "" - echo "This is THE MVP blocker. Everything depends on this." - echo "" - echo "Opening in browser for review..." - echo "" - - gh pr view 17 --repo $REPO --web - - echo "" - echo "After reviewing the code, what's your decision?" - echo "" - echo " [a] Approve & Merge (\$100 bounty to @chandrapratamar)" - echo " [c] Request Changes (specify what needs fixing)" - echo " [s] Skip for now (review later)" - echo "" - echo -n "Decision: " - read -n 1 decision - echo "" - echo "" - - case $decision in - a|A) - echo "✅ Approving PR #17..." - - approval="✅ **APPROVED - OUTSTANDING WORK!** - -@chandrapratamar - You just unblocked the entire MVP! 🎉🎉🎉 - -**This is THE critical feature** that everything else depends on. Your implementation: -- ✅ Translates natural language to apt commands perfectly -- ✅ Integrates seamlessly with our LLM layer -- ✅ Includes comprehensive tests -- ✅ Documentation is clear and complete - -**Payment Details:** -- **Bounty: \$100 USD** -- **Processing: Within 48 hours** -- **Method: Crypto (Bitcoin/USDC) or PayPal** -- **Bonus: 2x at funding (Feb 2025) = \$200 total** - -**You're now a core Cortex contributor!** 🧠⚡ - -We'll coordinate payment via your preferred method in the next comment. - -**Thank you for making history with us!** - ---- -*Automated approval from Cortex PR Management System*" - - echo "$approval" | gh pr review 17 --repo $REPO --approve --body-file - - - echo "" - echo "Merging PR #17..." - - gh pr merge 17 --repo $REPO --squash --delete-branch && { - echo "" - echo "🎉🎉🎉 PR #17 MERGED! 🎉🎉🎉" - echo "" - echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" - echo "🚀 MVP BLOCKER CLEARED!" - echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" - echo "" - echo "This unblocks:" - echo " ✅ Issue #12 (Dependency Resolution)" - echo " ✅ Issue #10 (Installation Verification)" - echo " ✅ Issue #14 (Rollback System)" - echo " ✅ MVP demonstration" - echo " ✅ February funding timeline" - echo "" - echo "💰 Bounty owed: \$100 to @chandrapratamar" - echo "" - echo "IMMEDIATELY post to Discord #announcements!" - echo "" - } || { - echo "❌ Merge failed - needs manual intervention" - } - ;; - c|C) - echo "Requesting changes on PR #17..." - echo "" - echo "Enter what needs to change:" - echo "(Press Ctrl+D when done)" - echo "---" - feedback=$(cat) - - change_request="🔄 **Changes Requested** - -Thank you @chandrapratamar for tackling this critical feature! - -Before we can merge, please address: - -$feedback - -**This is THE MVP blocker**, so I'll prioritize re-review once you update. - -Questions? Ping me here or in Discord (#dev-questions). - -We're close! 💪" - - echo "$change_request" | gh pr review 17 --repo $REPO --request-changes --body-file - - echo "" - echo "✅ Change request posted" - ;; - *) - echo "⏭️ Skipped PR #17" - ;; - esac - ;; - - 2) - echo "🟡 LAUNCHING CONTRIBUTOR PR REVIEW WORKFLOW..." - echo "" - - # Check if review script exists - if [ -f "$HOME/cortex/review-contributor-prs.sh" ]; then - bash "$HOME/cortex/review-contributor-prs.sh" - else - echo "Review script not found. Download it first:" - echo " review-contributor-prs.sh" - fi - ;; - - 3) - echo "🟢 BATCH MERGING MIKE'S PRs..." - echo "" - - # Check if merge script exists - if [ -f "$HOME/cortex/merge-mike-prs.sh" ]; then - bash "$HOME/cortex/merge-mike-prs.sh" - else - echo "Merge script not found. Download it first:" - echo " merge-mike-prs.sh" - fi - ;; - - 4) - echo "🌐 Opening PR list in browser..." - gh pr list --repo $REPO --web - ;; - - 5) - echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" - echo "💰 BOUNTY PAYMENT REPORT" - echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" - echo "" - - echo "PENDING BOUNTIES (if merged):" - echo "──────────────────────────────" - echo "" - echo "PR #17 - @chandrapratamar: \$100 (Package Manager)" - echo "PR #37 - @AlexanderLuzDH: \$125 (Progress Notifications)" - echo "PR #38 - @AlexanderLuzDH: \$100 (Requirements Check)" - echo "PR #21 - @aliraza556: \$150 (Config Templates)" - echo "PR #18 - @Sahilbhatane: \$100 (CLI Interface - DRAFT)" - echo "" - echo "──────────────────────────────" - echo "TOTAL PENDING: \$575" - echo "AT 2X BONUS (FUNDING): \$1,150" - echo "" - - if [ -f "$HOME/cortex/bounties_owed.csv" ]; then - echo "ALREADY MERGED (need payment):" - echo "──────────────────────────────" - tail -n +2 "$HOME/cortex/bounties_owed.csv" | while IFS=',' read -r pr dev feature amount date status; do - if [ "$status" = "PENDING" ]; then - echo "$pr - @$dev: \$$amount" - fi - done - echo "" - fi - ;; - - 6) - echo "📱 GENERATING DISCORD ANNOUNCEMENT..." - echo "" - - announcement="🎉 **CORTEX PROJECT UPDATE - $(date +%B\ %d,\ %Y)** - -**PR Review Session Complete!** - -**Current Status:** -- 📊 **$total_prs PRs open** ($contributor_prs from contributors, $mike_prs from Mike) -- 💰 **\$$total_contributor_bounties in bounties** pending review -- 🔴 **PR #17 (Package Manager)** = THE MVP BLOCKER - -**Action Items:** -- Contributor PRs being reviewed this week -- Bounties will be processed within 48 hours of merge -- 2x bonus reminder: All bounties double at funding (Feb 2025) - -**For Contributors:** -- Check your PR status on GitHub -- Questions? #dev-questions channel -- New issues available for claiming - -**The Momentum is Real:** -- Professional team execution -- MVP timeline on track (Feb 2025) -- Building the future of Linux! 🧠⚡ - -Browse open issues: https://github.com/$REPO/issues -Join discussion: https://discord.gg/uCqHvxjU83" - - echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" - echo "$announcement" - echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" - echo "" - echo "Copy the above and post to Discord #announcements" - ;; - - q|Q) - echo "👋 Exiting dashboard..." - exit 0 - ;; - - *) - echo "Invalid choice" - ;; -esac - -echo "" -echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" -echo "✅ Dashboard session complete" -echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" diff --git a/scripts/automation/focus-on-mvp.sh b/scripts/automation/focus-on-mvp.sh deleted file mode 100755 index 5f5698a5..00000000 --- a/scripts/automation/focus-on-mvp.sh +++ /dev/null @@ -1,105 +0,0 @@ -#!/bin/bash -# Close non-MVP issues to focus contributors on critical work - -set -e - -echo "🎯 FOCUSING REPOSITORY ON MVP ISSUES" -echo "======================================" -echo "" - -cd ~/cortex || { echo "❌ cortex repo not found"; exit 1; } - -# Strategy: Close issues 46-200+ with explanation comment -# Keep issues 1-45 open (MVP critical work) - -echo "Strategy:" -echo " Keep open: Issues #1-45 (MVP critical)" -echo " Close: Issues #46+ (post-MVP features)" -echo "" - -read -p "Close issues #46-200 as 'post-MVP'? (y/n): " -n 1 -r -echo -if [[ ! $REPLY =~ ^[Yy]$ ]]; then - echo "Aborted." - exit 0 -fi - -# Comment to add when closing -CLOSE_MESSAGE="🎯 **Closing for MVP Focus** - -This issue is being closed to help the team focus on MVP-critical features (#1-45). - -**This is NOT abandoned** - it's an important feature we'll revisit after MVP completion. - -**Timeline:** -- **Now (Nov-Dec 2024):** Focus on MVP (Issues #1-45) -- **January 2025:** Reopen post-MVP features -- **February 2025:** Seed funding round - -**Want to work on this anyway?** -Comment below and we can discuss! We're always open to great contributions. - -**Tracking:** Labeled as \`post-mvp\` for easy filtering when we reopen. - -Thanks for understanding! 🚀 - -— Mike (@mikejmorgan-ai)" - -echo "📝 Closing issues #46-200..." -echo "" - -# Function to close issue -close_issue() { - local issue_num=$1 - - echo " Closing #$issue_num..." - - # Add comment - gh issue comment $issue_num --body "$CLOSE_MESSAGE" 2>/dev/null || { - echo " ⚠️ Could not comment on #$issue_num (may not exist)" - return 1 - } - - # Add post-mvp label - gh issue edit $issue_num --add-label "post-mvp" 2>/dev/null - - # Close issue - gh issue close $issue_num --reason "not planned" 2>/dev/null || { - echo " ⚠️ Could not close #$issue_num" - return 1 - } - - echo " ✅ Closed #$issue_num" - return 0 -} - -# Close issues 46-200 -CLOSED_COUNT=0 -FAILED_COUNT=0 - -for issue_num in {46..200}; do - if close_issue $issue_num; then - ((CLOSED_COUNT++)) - else - ((FAILED_COUNT++)) - fi - - # Rate limiting - pause every 10 issues - if (( issue_num % 10 == 0 )); then - echo " ⏸️ Pausing for rate limit..." - sleep 2 - fi -done - -echo "" -echo "==============================================" -echo "✅ CLEANUP COMPLETE" -echo "==============================================" -echo "Issues closed: $CLOSED_COUNT" -echo "Failed/not found: $FAILED_COUNT" -echo "" -echo "Repository now shows MVP-focused issues only!" -echo "" -echo "View open issues: https://github.com/cortexlinux/cortex/issues" -echo "View post-MVP: https://github.com/cortexlinux/cortex/issues?q=is%3Aclosed+label%3Apost-mvp" -echo "" diff --git a/scripts/automation/manage_cortex_prs.sh b/scripts/automation/manage_cortex_prs.sh deleted file mode 100755 index ee3d3d74..00000000 --- a/scripts/automation/manage_cortex_prs.sh +++ /dev/null @@ -1,435 +0,0 @@ -#!/bin/bash -# Cortex Linux - Master PR Control & Team Coordination -# Complete automation: reviews, assignments, Discord, payments, everything - -set -e - -echo "🧠 CORTEX LINUX - MASTER PR CONTROL SYSTEM" -echo "==========================================" -echo "" - -# Configuration -REPO="cortexlinux/cortex" -REPO_DIR="$HOME/cortex" -DISCORD_INVITE="https://discord.gg/uCqHvxjU83" -GITHUB_TOKEN=$(grep GITHUB_TOKEN ~/.zshrc | cut -d'=' -f2 | tr -d '"' | tr -d "'") -BOUNTY_CSV="$REPO_DIR/bounties_paid.csv" - -# Ensure we're in the repo -cd "$REPO_DIR" || { echo "❌ Repo not found at $REPO_DIR"; exit 1; } - -# Create bounty tracking CSV if it doesn't exist -if [ ! -f "$BOUNTY_CSV" ]; then - echo "PR_Number,Author,Amount,Status,Payment_Status,Date" > "$BOUNTY_CSV" -fi - -echo "📊 STEP 1: FETCHING ALL OPEN PRS" -echo "=================================" -echo "" - -# Get all open PRs -prs=$(gh pr list --repo "$REPO" --state open --json number,title,author,createdAt,reviews,isDraft,mergeable --limit 50) -total_prs=$(echo "$prs" | jq length) - -echo "Found $total_prs open PR(s)" -echo "" - -if [ "$total_prs" -eq 0 ]; then - echo "✅ No PRs to process!" - exit 0 -fi - -# Display all PRs -echo "$prs" | jq -r '.[] | "PR #\(.number): \(.title) by @\(.author.login) - Draft: \(.isDraft)"' -echo "" - -echo "🎯 STEP 2: CATEGORIZING PRS" -echo "===========================" -echo "" - -# Arrays for different PR categories -critical_prs=() -ready_to_merge=() -needs_review=() -draft_prs=() -stale_prs=() - -# Categorize each PR -while IFS= read -r pr_num; do - pr_data=$(echo "$prs" | jq -r ".[] | select(.number == $pr_num)") - author=$(echo "$pr_data" | jq -r '.author.login') - title=$(echo "$pr_data" | jq -r '.title') - is_draft=$(echo "$pr_data" | jq -r '.isDraft') - created=$(echo "$pr_data" | jq -r '.createdAt') - mergeable=$(echo "$pr_data" | jq -r '.mergeable') - review_count=$(echo "$pr_data" | jq -r '.reviews | length') - - # Calculate age - created_ts=$(date -j -f "%Y-%m-%dT%H:%M:%SZ" "$created" +%s 2>/dev/null || echo 0) - now_ts=$(date +%s) - age_days=$(( (now_ts - created_ts) / 86400 )) - - # Skip drafts - if [ "$is_draft" = "true" ]; then - draft_prs+=($pr_num) - continue - fi - - # Check if it's the critical package manager PR - if [[ "$title" == *"package"* ]] || [[ "$title" == *"Package"* ]] || [ "$pr_num" -eq 195 ]; then - critical_prs+=($pr_num) - echo "🔥 CRITICAL: PR #$pr_num - $title (Age: $age_days days)" - elif [ "$mergeable" = "MERGEABLE" ] && [ "$review_count" -gt 0 ]; then - ready_to_merge+=($pr_num) - echo "✅ READY TO MERGE: PR #$pr_num - $title" - elif [ "$review_count" -eq 0 ]; then - needs_review+=($pr_num) - echo "📋 NEEDS REVIEW: PR #$pr_num - $title (Age: $age_days days)" - fi - - # Check if stale (>5 days) - if [ "$age_days" -gt 5 ]; then - stale_prs+=($pr_num) - fi -done < <(echo "$prs" | jq -r '.[].number') - -echo "" -echo "Summary:" -echo " 🔥 Critical PRs: ${#critical_prs[@]}" -echo " ✅ Ready to merge: ${#ready_to_merge[@]}" -echo " 📋 Need review: ${#needs_review[@]}" -echo " 📝 Drafts: ${#draft_prs[@]}" -echo " ⏰ Stale (>5 days): ${#stale_prs[@]}" -echo "" - -read -p "Continue with automated processing? (y/n): " -n 1 -r -echo -if [[ ! $REPLY =~ ^[Yy]$ ]]; then - echo "Aborted." - exit 0 -fi - -echo "" -echo "🎯 STEP 3: PROCESSING CRITICAL PRS" -echo "==================================" -echo "" - -for pr_num in "${critical_prs[@]}"; do - pr_data=$(echo "$prs" | jq -r ".[] | select(.number == $pr_num)") - author=$(echo "$pr_data" | jq -r '.author.login') - title=$(echo "$pr_data" | jq -r '.title') - - echo "Processing CRITICAL PR #$pr_num: $title" - echo "Author: @$author" - echo "" - - # Assign reviewers if not already assigned - echo " Assigning reviewers: dhvil, mikejmorgan-ai" - gh pr edit $pr_num --add-reviewer dhvil,mikejmorgan-ai 2>/dev/null || echo " (Reviewers already assigned)" - - # Post urgent review comment - comment="🔥 **CRITICAL PATH REVIEW** - -Hi @$author! This PR is blocking our MVP completion. - -**Urgent Review In Progress:** -- ✅ Technical review by @dhvil -- ✅ Final approval by @mikejmorgan-ai -- ⏱️ Target decision: Within 24 hours - -**Payment Ready:** -💰 Bounty will be paid via Discord crypto (BTC/USDC) within 24 hours of merge - -**Join Discord for payment coordination:** -👉 $DISCORD_INVITE - -We're prioritizing this merge! Thanks for the critical work. 🚀" - - gh pr comment $pr_num --body "$comment" 2>/dev/null || echo " (Comment already exists)" - - echo " ✅ Critical PR tagged and reviewers notified" - echo "" - sleep 1 -done - -echo "" -echo "✅ STEP 4: AUTO-MERGING READY PRS" -echo "=================================" -echo "" - -merged_count=0 -for pr_num in "${ready_to_merge[@]}"; do - pr_data=$(echo "$prs" | jq -r ".[] | select(.number == $pr_num)") - author=$(echo "$pr_data" | jq -r '.author.login') - title=$(echo "$pr_data" | jq -r '.title') - - echo "PR #$pr_num: $title by @$author" - echo " Status: Mergeable with approvals" - - # Determine bounty amount based on issue - bounty_amount="TBD" - if [[ "$title" == *"context"* ]] || [[ "$title" == *"Context"* ]]; then - bounty_amount="150" - elif [[ "$title" == *"logging"* ]] || [[ "$title" == *"Logging"* ]]; then - bounty_amount="100" - fi - - read -p " Merge PR #$pr_num? (y/n): " -n 1 -r - echo - if [[ $REPLY =~ ^[Yy]$ ]]; then - # Merge the PR - gh pr merge $pr_num --squash --delete-branch - echo " ✅ Merged!" - - # Post payment comment - payment_comment="🎉 **PR MERGED!** - -Thanks @$author! Your contribution has been merged into main. - -**💰 Payment Details:** -- Bounty: \$$bounty_amount (as specified in issue) -- Method: Crypto (Bitcoin or USDC) -- Timeline: Within 24 hours - -**Next Steps:** -1. Join Discord: $DISCORD_INVITE -2. DM @mikejmorgan with your wallet address -3. Receive payment confirmation - -Great work! Looking forward to your next contribution. 🚀" - - gh pr comment $pr_num --body "$payment_comment" - - # Track in CSV - echo "$pr_num,$author,$bounty_amount,Merged,Pending Payment,$(date +%Y-%m-%d)" >> "$BOUNTY_CSV" - - ((merged_count++)) - echo "" - else - echo " ⏭️ Skipped" - echo "" - fi - sleep 1 -done - -echo "Merged $merged_count PR(s)" -echo "" - -echo "📋 STEP 5: ASSIGNING REVIEWERS TO PENDING PRS" -echo "==============================================" -echo "" - -for pr_num in "${needs_review[@]}"; do - pr_data=$(echo "$prs" | jq -r ".[] | select(.number == $pr_num)") - author=$(echo "$pr_data" | jq -r '.author.login') - title=$(echo "$pr_data" | jq -r '.title') - - echo "PR #$pr_num: $title by @$author" - - # Assign reviewers - if [ "$author" != "dhvil" ] && [ "$author" != "mikejmorgan-ai" ]; then - gh pr edit $pr_num --add-reviewer dhvil,mikejmorgan-ai 2>/dev/null || true - echo " ✅ Assigned reviewers: dhvil, mikejmorgan-ai" - else - gh pr edit $pr_num --add-reviewer mikejmorgan-ai 2>/dev/null || true - echo " ✅ Assigned reviewer: mikejmorgan-ai" - fi - - # Post welcome comment - welcome_comment="Thanks @$author for this contribution! 🎉 - -**Review Process:** -1. ✅ Reviewers assigned - expect feedback within 24-48 hours -2. 💬 **Join Discord**: $DISCORD_INVITE -3. 💰 **Bounty Payment**: Crypto (BTC/USDC) via Discord after merge - -**Important:** -- All bounties tracked and paid through Discord -- Please join to coordinate payment details -- Typical merge → payment time: 24-48 hours - -Looking forward to reviewing this! 🚀" - - # Check if we already commented - existing=$(gh pr view $pr_num --json comments --jq '[.comments[] | select(.author.login == "mikejmorgan-ai")] | length') - if [ "$existing" -eq 0 ]; then - gh pr comment $pr_num --body "$welcome_comment" - echo " ✅ Posted welcome comment" - else - echo " (Welcome comment already exists)" - fi - - echo "" - sleep 1 -done - -echo "" -echo "⏰ STEP 6: SENDING STALE PR REMINDERS" -echo "=====================================" -echo "" - -for pr_num in "${stale_prs[@]}"; do - # Skip if it's in draft or critical (already handled) - if [[ " ${draft_prs[@]} " =~ " ${pr_num} " ]] || [[ " ${critical_prs[@]} " =~ " ${pr_num} " ]]; then - continue - fi - - pr_data=$(echo "$prs" | jq -r ".[] | select(.number == $pr_num)") - author=$(echo "$pr_data" | jq -r '.author.login') - title=$(echo "$pr_data" | jq -r '.title') - created=$(echo "$pr_data" | jq -r '.createdAt') - - created_ts=$(date -j -f "%Y-%m-%dT%H:%M:%SZ" "$created" +%s 2>/dev/null || echo 0) - now_ts=$(date +%s) - age_days=$(( (now_ts - created_ts) / 86400 )) - - echo "PR #$pr_num: $title by @$author ($age_days days old)" - - stale_comment="Hi @$author! 👋 - -This PR has been open for $age_days days. Quick status check: - -📋 **Checklist:** -- [ ] Joined Discord? ($DISCORD_INVITE) -- [ ] All tests passing? -- [ ] Addressed review feedback? - -💰 **Payment Reminder:** -- Bounties paid via crypto (Bitcoin/USDC) -- Processed through Discord DMs -- Sent within 24 hours of merge - -Need help? Let us know in Discord! We want to get this merged and pay you ASAP. 🚀" - - gh pr comment $pr_num --body "$stale_comment" - echo " ✅ Sent reminder" - echo "" - sleep 1 -done - -echo "" -echo "💬 STEP 7: GENERATING DISCORD ANNOUNCEMENT" -echo "==========================================" -echo "" - -cat << DISCORD_EOF > /tmp/discord_announcement.txt -🚀 **PR STATUS UPDATE - $(date +"%B %d, %Y")** - -Just completed automated PR processing! Here's where we stand: - -**📊 Statistics:** -- Total Open PRs: $total_prs -- 🔥 Critical (Package Manager): ${#critical_prs[@]} -- ✅ Merged Today: $merged_count -- 📋 Under Review: ${#needs_review[@]} -- ⏰ Stale Reminders Sent: ${#stale_prs[@]} - -**🎯 Focus Areas:** -DISCORD_EOF - -if [ ${#critical_prs[@]} -gt 0 ]; then - echo "• 🔥 PR #${critical_prs[0]} (Package Manager) - CRITICAL PATH - Under urgent review" >> /tmp/discord_announcement.txt -fi - -cat << DISCORD_EOF2 >> /tmp/discord_announcement.txt - -**💰 Payment Process:** -1. PR gets merged ✅ -2. I DM you for wallet address 💬 -3. Crypto sent within 24 hours 💸 -4. You confirm receipt ✅ - -**All contributors:** Join Discord for bounty coordination! -👉 $DISCORD_INVITE - -Let's keep the momentum going! 🔥 - -- Mike -DISCORD_EOF2 - -echo "Discord announcement generated:" -echo "===============================" -cat /tmp/discord_announcement.txt -echo "===============================" -echo "" -echo "📋 Copy the above to Discord #announcements" -echo "" - -echo "" -echo "📊 STEP 8: PAYMENT TRACKING SUMMARY" -echo "===================================" -echo "" - -if [ -f "$BOUNTY_CSV" ]; then - echo "Payments Pending:" - tail -n +2 "$BOUNTY_CSV" | grep "Pending" 2>/dev/null | while IFS=, read -r pr author amount status payment date; do - echo " PR #$pr - @$author - \$$amount - $date" - done || echo " No pending payments" - echo "" - echo "Full tracking: $BOUNTY_CSV" -fi - -echo "" -echo "📧 STEP 9: CONTRIBUTOR DM TEMPLATES" -echo "===================================" -echo "" - -# Generate DM templates for unique contributors -contributors=$(echo "$prs" | jq -r '.[].author.login' | sort -u) - -echo "Send these DMs on Discord:" -echo "" - -for contributor in $contributors; do - pr_count=$(echo "$prs" | jq -r --arg author "$contributor" '[.[] | select(.author.login == $author)] | length') - - if [ "$pr_count" -gt 0 ]; then - echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" - echo "To: @$contributor ($pr_count open PR)" - echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" - cat << DM_EOF - -Hey! Just processed your Cortex PR(s) - great work! 🎉 - -**Quick Check:** -1. Have you joined Discord? ($DISCORD_INVITE) -2. What's your crypto wallet address? (BTC or USDC) -3. Any blockers I can help with? - -**Payment Timeline:** -- PR review: 24-48 hours -- Merge decision: Clear feedback either way -- Payment: Within 24 hours of merge - -Looking forward to merging your work! - -- Mike - -DM_EOF - fi -done - -echo "" -echo "==============================================" -echo "✅ MASTER PR CONTROL COMPLETE" -echo "==============================================" -echo "" - -echo "📊 Summary of Actions:" -echo " • Reviewed $total_prs PRs" -echo " • Assigned reviewers to ${#needs_review[@]} PRs" -echo " • Merged $merged_count PRs" -echo " • Flagged ${#critical_prs[@]} critical PR(s)" -echo " • Sent ${#stale_prs[@]} stale reminders" -echo "" - -echo "📋 Next Manual Steps:" -echo " 1. Copy Discord announcement to #announcements" -echo " 2. Send DMs to contributors (templates above)" -echo " 3. Review critical PR #${critical_prs[0]:-N/A} urgently" -echo " 4. Process $merged_count payment(s) via crypto" -echo "" - -echo "🔄 Run this script daily to maintain PR velocity!" -echo "" -echo "✅ All done!" diff --git a/scripts/deployment/audit_cortex_status.sh b/scripts/deployment/audit_cortex_status.sh deleted file mode 100755 index eca4b113..00000000 --- a/scripts/deployment/audit_cortex_status.sh +++ /dev/null @@ -1,108 +0,0 @@ -#!/bin/bash -# Cortex Linux - Complete System Audit -# Run this once to give Claude full visibility - -echo "🔍 CORTEX LINUX - SYSTEM AUDIT" -echo "========================================" -echo "" - -# Colors for output -RED='\033[0;31m' -GREEN='\033[0;32m' -YELLOW='\033[1;33m' -NC='\033[0m' # No Color - -cd ~/cortex 2>/dev/null || { echo "❌ ~/cortex not found. Run: cd ~ && git clone https://github.com/cortexlinux/cortex.git"; exit 1; } - -echo "📁 REPOSITORY STRUCTURE" -echo "========================================" -echo "Files in repo:" -find . -type f -not -path '*/\.*' | head -30 -echo "" - -echo "🤖 GITHUB ACTIONS WORKFLOWS" -echo "========================================" -if [ -d ".github/workflows" ]; then - echo "✅ Workflows directory exists" - ls -lh .github/workflows/ - echo "" - echo "📄 Workflow file contents:" - for file in .github/workflows/*.yml; do - echo "--- $file ---" - head -50 "$file" - echo "" - done -else - echo "❌ No .github/workflows directory" -fi -echo "" - -echo "📊 AUTOMATION DATA FILES" -echo "========================================" -for file in bounties_pending.json payments_history.json contributors.json; do - if [ -f "$file" ]; then - echo "✅ $file exists" - cat "$file" - else - echo "❌ $file missing" - fi - echo "" -done - -echo "🔐 GITHUB SECRETS STATUS" -echo "========================================" -echo "Checking if secrets are configured..." -gh secret list 2>/dev/null || echo "⚠️ gh CLI not authenticated or not installed" -echo "" - -echo "🌐 GITHUB ACTIONS RUNS" -echo "========================================" -echo "Recent workflow runs:" -gh run list --limit 5 2>/dev/null || echo "⚠️ gh CLI not authenticated" -echo "" - -echo "📋 RECENT COMMITS" -echo "========================================" -git log --oneline -10 -echo "" - -echo "🔀 BRANCHES" -echo "========================================" -git branch -a -echo "" - -echo "📍 CURRENT STATUS" -echo "========================================" -echo "Current branch: $(git branch --show-current)" -echo "Remote URL: $(git remote get-url origin)" -echo "Git status:" -git status --short -echo "" - -echo "💬 DISCORD WEBHOOK CHECK" -echo "========================================" -if gh secret list 2>/dev/null | grep -q "DISCORD_WEBHOOK"; then - echo "✅ DISCORD_WEBHOOK secret is configured" -else - echo "❌ DISCORD_WEBHOOK secret not found" - echo " Add it at: https://github.com/cortexlinux/cortex/settings/secrets/actions" -fi -echo "" - -echo "🎯 ISSUES & PRS" -echo "========================================" -echo "Open issues with bounties:" -gh issue list --label "bounty" --limit 10 2>/dev/null || echo "⚠️ gh CLI issue" -echo "" -echo "Recent PRs:" -gh pr list --limit 5 2>/dev/null || echo "⚠️ gh CLI issue" -echo "" - -echo "✅ AUDIT COMPLETE" -echo "========================================" -echo "Save this output and share with Claude for full visibility" -echo "" -echo "Next steps:" -echo "1. Share this output with Claude" -echo "2. Claude can now see everything without asking" -echo "3. No more copy/paste needed" diff --git a/scripts/deployment/deploy_jesse_system.sh b/scripts/deployment/deploy_jesse_system.sh deleted file mode 100644 index df06145d..00000000 --- a/scripts/deployment/deploy_jesse_system.sh +++ /dev/null @@ -1,208 +0,0 @@ -#!/bin/bash -# ============================================================================ -# WaterRightsX - Complete System Deployment for Jesse -# ============================================================================ -# One-command script to build Jesse's water rights movement matching platform -# -# What this builds: -# 1. Import 160,000 Utah water rights with owner contact info -# 2. Scrape all 97 basin policies for movement rules -# 3. Build movement matching engine -# 4. Generate lead lists for target locations -# -# Usage: bash deploy_jesse_system.sh -# -# Author: Michael J. Morgan - WaterRightsX -# ============================================================================ - -set -e # Exit on any error - -echo "🌊 WaterRightsX - Complete System Deployment" -echo "============================================" -echo "" -echo "Building Jesse's Water Rights Movement Platform:" -echo " ✓ 160,000 Utah water rights database" -echo " ✓ Basin policy scraper (97 basins)" -echo " ✓ Movement matching engine" -echo " ✓ Lead generation system" -echo "" -echo "⏱️ Expected time: 15-20 minutes" -echo "💾 Expected size: ~600MB download" -echo "" - -read -p "Continue with full deployment? (y/n) " -n 1 -r -echo -if [[ ! $REPLY =~ ^[Yy]$ ]] -then - echo "❌ Deployment cancelled" - exit 1 -fi - -echo "" -echo "============================================================================" -echo "PHASE 1: Installing Dependencies" -echo "============================================================================" -echo "" - -pip install --break-system-packages \ - geopandas \ - psycopg2-binary \ - requests \ - beautifulsoup4 \ - pyproj \ - shapely \ - fiona \ - --quiet - -echo "✅ Dependencies installed" - -echo "" -echo "============================================================================" -echo "PHASE 2: Database Schema Setup" -echo "============================================================================" -echo "" - -# Create enhanced water rights schema -if [ -n "$DATABASE_URL" ]; then - psql "$DATABASE_URL" << 'EOF' --- Add new columns for Jesse's requirements -ALTER TABLE water_rights ADD COLUMN IF NOT EXISTS owner_address TEXT; -ALTER TABLE water_rights ADD COLUMN IF NOT EXISTS owner_city TEXT; -ALTER TABLE water_rights ADD COLUMN IF NOT EXISTS owner_zip TEXT; -ALTER TABLE water_rights ADD COLUMN IF NOT EXISTS is_non_use BOOLEAN DEFAULT FALSE; -ALTER TABLE water_rights ADD COLUMN IF NOT EXISTS can_be_moved BOOLEAN DEFAULT TRUE; - --- Create indexes for performance -CREATE INDEX IF NOT EXISTS idx_non_use ON water_rights(is_non_use); -CREATE INDEX IF NOT EXISTS idx_basin ON water_rights(basin); -CREATE INDEX IF NOT EXISTS idx_volume ON water_rights(annual_volume_af); - --- Create basin policies tables (will be populated by scraper) -CREATE TABLE IF NOT EXISTS basin_policies ( - id SERIAL PRIMARY KEY, - area_number VARCHAR(10) UNIQUE NOT NULL, - area_name TEXT NOT NULL, - url TEXT NOT NULL, - full_text TEXT, - scraped_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP -); - -CREATE TABLE IF NOT EXISTS movement_rules ( - id SERIAL PRIMARY KEY, - area_number VARCHAR(10) REFERENCES basin_policies(area_number), - rule_type VARCHAR(50), - rule_text TEXT NOT NULL, - is_restriction BOOLEAN DEFAULT FALSE, - created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP -); - -CREATE INDEX IF NOT EXISTS idx_area_number ON basin_policies(area_number); -CREATE INDEX IF NOT EXISTS idx_movement_area ON movement_rules(area_number); - -EOF - - echo "✅ Database schema updated" -else - echo "⚠️ DATABASE_URL not set - skipping schema updates" -fi - -echo "" -echo "============================================================================" -echo "PHASE 3: Import 160,000 Water Rights" -echo "============================================================================" -echo "" - -python3 import_utah_water_rights.py - -echo "" -echo "============================================================================" -echo "PHASE 4: Scrape Basin Policies" -echo "============================================================================" -echo "" - -python3 scrape_basin_policies.py - -echo "" -echo "============================================================================" -echo "PHASE 5: Test Movement Matching Engine" -echo "============================================================================" -echo "" - -python3 movement_matching_engine.py - -echo "" -echo "============================================================================" -echo "✅ DEPLOYMENT COMPLETE!" -echo "============================================================================" -echo "" -echo "📊 System Summary:" -if [ -n "$DATABASE_URL" ]; then - echo "" - echo "Water Rights Database:" - psql "$DATABASE_URL" -c "SELECT COUNT(*) as total_water_rights FROM water_rights;" - - echo "" - echo "Non-Use Rights (Best Leads):" - psql "$DATABASE_URL" -c "SELECT COUNT(*) as non_use_count FROM water_rights WHERE is_non_use = TRUE;" - - echo "" - echo "Basin Policies Scraped:" - psql "$DATABASE_URL" -c "SELECT COUNT(*) as total_basins FROM basin_policies;" - - echo "" - echo "Movement Rules Extracted:" - psql "$DATABASE_URL" -c "SELECT COUNT(*) as total_rules FROM movement_rules;" -fi - -echo "" -echo "============================================================================" -echo "🎯 JESSE'S USE CASES - READY TO GO:" -echo "============================================================================" -echo "" -echo "1. FIND WATER FOR PARK CITY:" -echo " python3 -c \"" -echo " from movement_matching_engine import MovementMatchingEngine" -echo " engine = MovementMatchingEngine()" -echo " leads = engine.find_moveable_rights(40.6461, -111.4980, max_distance_miles=10)" -echo " print(f'Found {len(leads)} moveable water rights for Park City')" -echo " \"" -echo "" -echo "2. FIND WATER FOR LITTLE COTTONWOOD CANYON:" -echo " python3 -c \"" -echo " from movement_matching_engine import MovementMatchingEngine" -echo " engine = MovementMatchingEngine()" -echo " leads = engine.find_moveable_rights(40.5732, -111.7813, max_distance_miles=5)" -echo " print(f'Found {len(leads)} moveable water rights for Little Cottonwood')" -echo " \"" -echo "" -echo "3. GENERATE LEAD LIST (Non-Use Priority):" -echo " - Check park_city_lead_list.json" -echo " - Contains owner contact information" -echo " - Sorted by arbitrage opportunity" -echo " - Non-use rights highlighted (best leads)" -echo "" -echo "============================================================================" -echo "📞 NEXT STEPS FOR JESSE:" -echo "============================================================================" -echo "" -echo "✓ Database has 160,000 water rights with owner info" -echo "✓ Basin policies scraped and parsed" -echo "✓ Movement matching engine operational" -echo "✓ Lead generation system ready" -echo "" -echo "To use the platform:" -echo "1. Identify target parcel (coordinates)" -echo "2. Run movement matching engine" -echo "3. Get filtered list of moveable rights" -echo "4. Contact owners (prioritize non-use status)" -echo "5. Negotiate purchase/lease" -echo "6. File change application with State Engineer" -echo "" -echo "For web interface, restart your application to see:" -echo "• Interactive map with all 160K water rights" -echo "• Movement analyzer tool" -echo "• Lead generator with owner contact info" -echo "• Basin policy viewer" -echo "" -echo "============================================================================" diff --git a/scripts/deployment/setup_and_upload.sh b/scripts/deployment/setup_and_upload.sh deleted file mode 100644 index ae7060e5..00000000 --- a/scripts/deployment/setup_and_upload.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/bash - -echo "==========================================" -echo " GitHub Token Setup" -echo "==========================================" -echo "" -echo "Get your token from: https://github.com/settings/tokens" -echo "Click 'Generate new token (classic)'" -echo "Check 'repo' scope, then generate" -echo "" -echo "Paste your GitHub token here:" -read -s TOKEN -echo "" - -if [ -z "$TOKEN" ]; then - echo "❌ No token provided" - exit 1 -fi - -# Remove any old GITHUB_TOKEN lines -grep -v "GITHUB_TOKEN" ~/.zshrc > ~/.zshrc.tmp 2>/dev/null || touch ~/.zshrc.tmp -mv ~/.zshrc.tmp ~/.zshrc - -# Add new token -echo "export GITHUB_TOKEN=\"$TOKEN\"" >> ~/.zshrc - -# Reload -export GITHUB_TOKEN="$TOKEN" - -echo "✅ Token saved to ~/.zshrc" -echo "" - -# Test it -echo "Testing token..." -python3 << 'PYEOF' -from github import Github -import os - -token = os.getenv("GITHUB_TOKEN") -try: - g = Github(token) - user = g.get_user() - print(f"✅ Token works! Logged in as: {user.login}") -except Exception as e: - print(f"❌ Token invalid: {e}") -PYEOF - -echo "" -echo "==========================================" -echo "Now running file upload..." -echo "==========================================" -echo "" - -# Run the upload -python3 /Users/allbots/Downloads/commit_files.py diff --git a/scripts/deployment/upload_issue_34.sh b/scripts/deployment/upload_issue_34.sh deleted file mode 100755 index 9441bc92..00000000 --- a/scripts/deployment/upload_issue_34.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash - -# Upload Issue #34 files to GitHub - -echo "🔐 Enter your GitHub Personal Access Token:" -read -s GITHUB_TOKEN - -REPO="cortexlinux/cortex" -BRANCH="feature/issue-34" - -echo "" -echo "📤 Uploading llm_router.py..." -curl -X PUT \ - -H "Authorization: token $GITHUB_TOKEN" \ - -H "Content-Type: application/json" \ - -d "{\"message\":\"Add LLM Router implementation\",\"content\":\"$(base64 -i llm_router.py)\",\"branch\":\"$BRANCH\"}" \ - "https://api.github.com/repos/$REPO/contents/src/llm_router.py" - -echo "" -echo "📤 Uploading test_llm_router.py..." -curl -X PUT \ - -H "Authorization: token $GITHUB_TOKEN" \ - -H "Content-Type: application/json" \ - -d "{\"message\":\"Add LLM Router tests\",\"content\":\"$(base64 -i test_llm_router.py)\",\"branch\":\"$BRANCH\"}" \ - "https://api.github.com/repos/$REPO/contents/src/test_llm_router.py" - -echo "" -echo "📤 Uploading README_LLM_ROUTER.md..." -curl -X PUT \ - -H "Authorization: token $GITHUB_TOKEN" \ - -H "Content-Type: application/json" \ - -d "{\"message\":\"Add LLM Router documentation\",\"content\":\"$(base64 -i README_LLM_ROUTER.md)\",\"branch\":\"$BRANCH\"}" \ - "https://api.github.com/repos/$REPO/contents/docs/README_LLM_ROUTER.md" - -echo "" -echo "✅ Upload complete! Check: https://github.com/$REPO/tree/$BRANCH" diff --git a/scripts/fetch-fork-emails.sh b/scripts/fetch-fork-emails.sh deleted file mode 100755 index fa76ba67..00000000 --- a/scripts/fetch-fork-emails.sh +++ /dev/null @@ -1,72 +0,0 @@ -#!/bin/bash -# fetch-fork-emails.sh -# Fetches public email addresses from Cortex fork contributors -# Usage: ./fetch-fork-emails.sh - -echo "═══════════════════════════════════════════════════════════════════" -echo " CORTEX FORK CONTRIBUTOR EMAIL FETCHER" -echo " $(date '+%Y-%m-%d %H:%M:%S')" -echo "═══════════════════════════════════════════════════════════════════" -echo "" - -OUTPUT_FILE="fork-contributor-contacts.csv" -echo "username,email,name,company,location,twitter,blog,bio" > "$OUTPUT_FILE" - -# Get all fork owners -echo "📥 Fetching fork contributors..." -echo "" - -FORKS=$(curl -s "https://api.github.com/repos/cortexlinux/cortex/forks?per_page=100" | jq -r '.[].owner.login') - -for username in $FORKS; do - echo -n "→ $username: " - - # Fetch user profile - USER_DATA=$(curl -s "https://api.github.com/users/$username") - - EMAIL=$(echo "$USER_DATA" | jq -r '.email // "N/A"') - NAME=$(echo "$USER_DATA" | jq -r '.name // "N/A"') - COMPANY=$(echo "$USER_DATA" | jq -r '.company // "N/A"') - LOCATION=$(echo "$USER_DATA" | jq -r '.location // "N/A"') - TWITTER=$(echo "$USER_DATA" | jq -r '.twitter_username // "N/A"') - BLOG=$(echo "$USER_DATA" | jq -r '.blog // "N/A"') - BIO=$(echo "$USER_DATA" | jq -r '.bio // "N/A"' | tr ',' ';' | tr '\n' ' ') - - # Try to get email from recent commits if not in profile - if [ "$EMAIL" = "N/A" ] || [ "$EMAIL" = "null" ]; then - COMMIT_EMAIL=$(curl -s "https://api.github.com/users/$username/events/public" | \ - jq -r '[.[] | select(.type=="PushEvent") | .payload.commits[]?.author.email] | first // "N/A"') - if [ "$COMMIT_EMAIL" != "N/A" ] && [ "$COMMIT_EMAIL" != "null" ] && [[ ! "$COMMIT_EMAIL" =~ "noreply" ]]; then - EMAIL="$COMMIT_EMAIL" - fi - fi - - echo "$username,$EMAIL,$NAME,$COMPANY,$LOCATION,$TWITTER,$BLOG,\"$BIO\"" >> "$OUTPUT_FILE" - - if [ "$EMAIL" != "N/A" ] && [ "$EMAIL" != "null" ]; then - echo "✓ Found email: $EMAIL" - else - echo "○ No public email (check Twitter: $TWITTER, Blog: $BLOG)" - fi - - sleep 0.5 # Rate limiting -done - -echo "" -echo "═══════════════════════════════════════════════════════════════════" -echo " SUMMARY" -echo "═══════════════════════════════════════════════════════════════════" -echo "" -TOTAL=$(echo "$FORKS" | wc -l | tr -d ' ') -WITH_EMAIL=$(grep -v "N/A" "$OUTPUT_FILE" | grep -v "null" | grep "@" | wc -l | tr -d ' ') -echo "Total contributors: $TOTAL" -echo "With public email: $WITH_EMAIL" -echo "" -echo "✅ Results saved to: $OUTPUT_FILE" -echo "" - -# Display results -echo "═══════════════════════════════════════════════════════════════════" -echo " CONTACT DETAILS" -echo "═══════════════════════════════════════════════════════════════════" -column -t -s',' "$OUTPUT_FILE" | head -20 diff --git a/scripts/github/merge-mike-prs.sh b/scripts/github/merge-mike-prs.sh deleted file mode 100755 index 1831ac94..00000000 --- a/scripts/github/merge-mike-prs.sh +++ /dev/null @@ -1,81 +0,0 @@ -#!/bin/bash -# CORTEX - Quick Merge Mike's PRs -# Merges all PRs authored by @mikejmorgan-ai to clear backlog - -set -e - -echo "🚀 CORTEX - MERGE MIKE'S IMPLEMENTATION PRs" -echo "===========================================" -echo "" - -REPO="cortexlinux/cortex" -GITHUB_TOKEN=$(grep GITHUB_TOKEN ~/.zshrc | cut -d'=' -f2 | tr -d '"' | tr -d "'") - -export GH_TOKEN="$GITHUB_TOKEN" - -echo "Merging PRs authored by @mikejmorgan-ai..." -echo "" - -# PRs to merge (excluding #17, #18, #21, #37, #38 which are from contributors) -MIKE_PRS=(41 36 34 23 22 20) - -for pr in "${MIKE_PRS[@]}"; do - echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" - echo "PR #$pr" - echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" - - # Get PR info - pr_info=$(gh pr view $pr --repo $REPO --json title,state,mergeable 2>/dev/null || echo "") - - if [ -z "$pr_info" ]; then - echo "❌ PR #$pr not found or not accessible" - echo "" - continue - fi - - pr_title=$(echo "$pr_info" | jq -r '.title') - pr_state=$(echo "$pr_info" | jq -r '.state') - pr_mergeable=$(echo "$pr_info" | jq -r '.mergeable') - - echo "Title: $pr_title" - echo "State: $pr_state" - echo "Mergeable: $pr_mergeable" - echo "" - - if [ "$pr_state" != "OPEN" ]; then - echo "⏭️ PR already merged or closed" - echo "" - continue - fi - - if [ "$pr_mergeable" = "CONFLICTING" ]; then - echo "⚠️ PR has merge conflicts - needs manual resolution" - echo "" - continue - fi - - echo "Merge this PR? (y/n)" - read -n 1 -r - echo "" - - if [[ $REPLY =~ ^[Yy]$ ]]; then - echo "🔄 Merging PR #$pr..." - - gh pr merge $pr --repo $REPO --squash --delete-branch 2>/dev/null && \ - echo "✅ PR #$pr merged successfully!" || \ - echo "❌ Failed to merge PR #$pr (may need manual merge)" - else - echo "⏭️ Skipped PR #$pr" - fi - - echo "" -done - -echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" -echo "✅ MERGE PROCESS COMPLETE" -echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" -echo "" -echo "Next steps:" -echo "1. Review contributor PRs: #17, #21, #37, #38" -echo "2. Process bounty payments" -echo "3. Post update to Discord" diff --git a/scripts/github/organize-issues.sh b/scripts/github/organize-issues.sh deleted file mode 100755 index 36d7a17e..00000000 --- a/scripts/github/organize-issues.sh +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/bash -# Label and organize issues for MVP focus - -set -e - -echo "🎯 ORGANIZING ISSUES FOR MVP FOCUS" -echo "=====================================" - -cd ~/cortex - -echo "Strategy:" -echo " Issues #1-30: MVP Critical" -echo " Issues #31-45: MVP Nice-to-Have" -echo " Issues #46+: Post-MVP" -echo "" - -read -p "Organize all issues? (y/n): " -n 1 -r -echo -if [[ ! $REPLY =~ ^[Yy]$ ]]; then - echo "Aborted." - exit 0 -fi - -# Create milestones -echo "📋 Creating milestones..." -gh api repos/cortexlinux/cortex/milestones --method POST \ - -f title='MVP - Core Features' \ - -f description='Critical features required for MVP launch' 2>/dev/null || echo " MVP milestone exists" - -gh api repos/cortexlinux/cortex/milestones --method POST \ - -f title='Post-MVP - Enhancements' \ - -f description='Features for post-MVP releases' 2>/dev/null || echo " Post-MVP milestone exists" - -echo "" -echo "🏷️ Labeling MVP Critical (#1-30)..." -for i in {1..30}; do - gh issue edit $i --add-label "mvp-critical,priority: critical" --milestone "MVP - Core Features" 2>/dev/null && echo " ✅ #$i" || echo " ⚠️ #$i not found" - sleep 0.3 -done - -echo "" -echo "🏷️ Labeling Post-MVP (#46-150)..." -for i in {46..150}; do - gh issue edit $i --add-label "post-mvp" --milestone "Post-MVP - Enhancements" 2>/dev/null - (( i % 20 == 0 )) && echo " Processed through #$i..." && sleep 1 -done - -echo "" -echo "✅ COMPLETE!" -echo "" -echo "View MVP Critical: https://github.com/cortexlinux/cortex/issues?q=is%3Aopen+label%3Amvp-critical" diff --git a/scripts/github/review-contributor-prs.sh b/scripts/github/review-contributor-prs.sh deleted file mode 100755 index 8a5be9d1..00000000 --- a/scripts/github/review-contributor-prs.sh +++ /dev/null @@ -1,314 +0,0 @@ -#!/bin/bash -# CORTEX - CONTRIBUTOR PR REVIEW & MERGE SYSTEM -# Reviews PRs from contributors, tracks bounties, posts thank-yous - -set -e - -echo "🔍 CORTEX - CONTRIBUTOR PR REVIEW SYSTEM" -echo "========================================" -echo "" - -REPO="cortexlinux/cortex" -GITHUB_TOKEN=$(grep GITHUB_TOKEN ~/.zshrc | cut -d'=' -f2 | tr -d '"' | tr -d "'") - -export GH_TOKEN="$GITHUB_TOKEN" - -# Track bounties owed -BOUNTIES_FILE="$HOME/cortex/bounties_owed.csv" - -# Create bounties file if doesn't exist -if [ ! -f "$BOUNTIES_FILE" ]; then - echo "PR,Developer,Feature,Bounty_Amount,Date_Merged,Status" > "$BOUNTIES_FILE" -fi - -echo "📊 CONTRIBUTOR PR REVIEW QUEUE" -echo "────────────────────────────────" -echo "" - -# Contributor PRs to review (in priority order) -declare -A PR_DETAILS -PR_DETAILS[17]="chandrapratamar|Package Manager Wrapper (Issue #7)|100|CRITICAL_MVP_BLOCKER" -PR_DETAILS[37]="AlexanderLuzDH|Progress Notifications (Issue #27)|125|HIGH_PRIORITY" -PR_DETAILS[38]="AlexanderLuzDH|Requirements Pre-flight Check (Issue #28)|100|HIGH_PRIORITY" -PR_DETAILS[21]="aliraza556|Config File Templates (Issue #16)|150|HIGH_PRIORITY" -PR_DETAILS[18]="Sahilbhatane|CLI Interface (Issue #11)|100|DRAFT_WAIT" - -# Function to review a PR -review_pr() { - local pr_num=$1 - local pr_data="${PR_DETAILS[$pr_num]}" - - IFS='|' read -r developer feature bounty priority <<< "$pr_data" - - echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" - echo "📋 PR #$pr_num - $feature" - echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" - echo "" - echo "👤 Developer: @$developer" - echo "🎯 Feature: $feature" - echo "💰 Bounty: \$$bounty" - echo "🔥 Priority: $priority" - echo "" - - # Check if draft - pr_state=$(gh pr view $pr_num --repo $REPO --json isDraft 2>/dev/null | jq -r '.isDraft') - - if [ "$pr_state" = "true" ]; then - echo "📝 Status: DRAFT - Not ready for review yet" - echo " Action: Skip for now, will review when marked ready" - echo "" - return - fi - - echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" - echo "REVIEW CHECKLIST" - echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" - echo "" - echo "Before approving, verify:" - echo " [ ] Code implements the feature described in the issue" - echo " [ ] Unit tests included with >80% coverage" - echo " [ ] Documentation/README included" - echo " [ ] Integrates with existing Cortex architecture" - echo " [ ] No obvious bugs or security issues" - echo " [ ] Follows Python best practices" - echo "" - - echo "Actions:" - echo " [v] View PR in browser (to review code)" - echo " [a] Approve & Merge (if review passed)" - echo " [c] Request Changes (if issues found)" - echo " [m] Add Comment (questions/feedback)" - echo " [s] Skip to next PR" - echo " [q] Quit review mode" - echo "" - echo -n "Choose action: " - read -n 1 action - echo "" - echo "" - - case $action in - v|V) - echo "🌐 Opening PR #$pr_num in browser..." - gh pr view $pr_num --repo $REPO --web - echo "" - echo "After reviewing, come back to approve/change/comment." - echo "" - echo "Take action now? (y/n)" - read -n 1 take_action - echo "" - - if [[ ! $take_action =~ ^[Yy]$ ]]; then - echo "⏭️ Skipping for now..." - return - fi - - # Ask again which action - echo "" - echo "What action? [a]pprove [c]hange [m]comment [s]kip" - read -n 1 action - echo "" - ;;& # Continue to next pattern - - a|A) - echo "✅ APPROVING & MERGING PR #$pr_num" - echo "" - - # Post approval review - approval_msg="✅ **APPROVED - Excellent Work!** - -Thank you @$developer for this outstanding contribution! 🎉 - -**Review Summary:** -- ✅ Code quality: Professional implementation -- ✅ Testing: Comprehensive unit tests included -- ✅ Documentation: Clear and complete -- ✅ Integration: Works seamlessly with Cortex architecture - -**What's Next:** -1. Merging this PR immediately -2. Your bounty of **\$$bounty USD** will be processed within 48 hours -3. Payment via crypto (Bitcoin/USDC) or PayPal - we'll coordinate via issue comment - -**You're making history** - this is a foundational piece of the AI-native operating system! 🧠⚡ - -**Bonus Reminder:** At funding (Feb 2025), you'll receive **2x this bounty** as a thank-you bonus. - -Welcome to the Cortex Linux core contributor team! 🚀 - ---- -*Automated review from Cortex PR Management System*" - - echo "$approval_msg" | gh pr review $pr_num --repo $REPO --approve --body-file - 2>/dev/null || \ - echo "⚠️ Could not post review (may need manual approval)" - - echo "" - echo "Merging PR #$pr_num now..." - - gh pr merge $pr_num --repo $REPO --squash --delete-branch 2>/dev/null && { - echo "✅ PR #$pr_num merged successfully!" - - # Record bounty owed - merge_date=$(date +%Y-%m-%d) - echo "$pr_num,$developer,$feature,$bounty,$merge_date,PENDING" >> "$BOUNTIES_FILE" - - echo "" - echo "💰 Bounty recorded: \$$bounty owed to @$developer" - echo " Recorded in: $BOUNTIES_FILE" - } || { - echo "❌ Merge failed - may need manual intervention" - } - - echo "" - ;; - - c|C) - echo "🔄 REQUESTING CHANGES on PR #$pr_num" - echo "" - echo "Enter your feedback (what needs to change):" - echo "Press Ctrl+D when done" - echo "---" - feedback=$(cat) - - change_msg="🔄 **Changes Requested** - -Thank you for your contribution @$developer! The code is solid, but a few items need attention before merge: - -$feedback - -**Please update and let me know when ready** for re-review. I'll prioritize getting this merged quickly once addressed. - -**Questions?** Comment here or ping me in Discord (#dev-questions). - -We appreciate your patience! 🙏 - ---- -*Automated review from Cortex PR Management System*" - - echo "$change_msg" | gh pr review $pr_num --repo $REPO --request-changes --body-file - 2>/dev/null || \ - echo "⚠️ Could not post review" - - echo "" - echo "✅ Change request posted" - echo "" - ;; - - m|M) - echo "💬 ADDING COMMENT to PR #$pr_num" - echo "" - echo "Enter your comment:" - echo "Press Ctrl+D when done" - echo "---" - comment=$(cat) - - gh pr comment $pr_num --repo $REPO --body "$comment" 2>/dev/null && \ - echo "✅ Comment posted" || \ - echo "⚠️ Could not post comment" - - echo "" - ;; - - s|S) - echo "⏭️ Skipping PR #$pr_num" - echo "" - ;; - - q|Q) - echo "👋 Exiting review mode..." - echo "" - return 1 - ;; - - *) - echo "⏭️ Invalid action, skipping..." - echo "" - ;; - esac -} - -# Main review loop -echo "Starting PR review process..." -echo "" - -PR_ORDER=(17 37 38 21 18) # Priority order - -for pr in "${PR_ORDER[@]}"; do - review_pr $pr || break -done - -echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" -echo "📊 REVIEW SESSION COMPLETE" -echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" -echo "" - -# Show bounties owed -if [ -f "$BOUNTIES_FILE" ]; then - echo "💰 BOUNTIES OWED (from this session and previous)" - echo "──────────────────────────────────────────────────" - echo "" - - total_owed=0 - - tail -n +2 "$BOUNTIES_FILE" | while IFS=',' read -r pr dev feature amount date status; do - if [ "$status" = "PENDING" ]; then - echo " PR #$pr - @$dev: \$$amount ($feature)" - total_owed=$((total_owed + amount)) - fi - done - - echo "" - echo " Total pending: \$$total_owed USD" - echo "" - echo " Payment file: $BOUNTIES_FILE" - echo "" -fi - -echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" -echo "🎯 NEXT STEPS" -echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" -echo "" -echo "1. Process bounty payments (see $BOUNTIES_FILE)" -echo "2. Post Discord announcement about merged PRs" -echo "3. Check if Issue #7 unblocked (if PR #17 merged)" -echo "4. Welcome new developers to comment on issues" -echo "" - -echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" -echo "" - -# Generate Discord announcement -discord_msg="🎉 **PR MERGE UPDATE - $(date +%Y-%m-%d)** - -**PRs Merged Today:** -(Check the bounties file for details) - -**Critical Path Progress:** -- Issue #7 (Package Manager): $([ -f "$BOUNTIES_FILE" ] && grep -q "^17," "$BOUNTIES_FILE" && echo "✅ MERGED - MVP BLOCKER CLEARED!" || echo "⏳ In review") - -**Bounties Being Processed:** -- See individual PR comments for payment coordination -- 2x bonus reminder: When we close funding (Feb 2025), all bounties paid so far get 2x bonus - -**What This Means:** -- MVP velocity accelerating -- February funding timeline on track -- Professional team execution demonstrated - -**For Contributors:** -- Check your merged PRs for bounty coordination comments -- Payment within 48 hours of merge -- Crypto (Bitcoin/USDC) or PayPal options - -**Open Issues Still Available:** -Browse: https://github.com/cortexlinux/cortex/issues -Join: Discord #dev-questions - -Let's keep the momentum! 🧠⚡" - -echo "📱 DISCORD ANNOUNCEMENT (copy and post to #announcements)" -echo "────────────────────────────────────────────────────────" -echo "" -echo "$discord_msg" -echo "" -echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" -echo "✅ PR Review System Complete!" -echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" diff --git a/scripts/github/setup-github-automation.sh b/scripts/github/setup-github-automation.sh deleted file mode 100644 index 4fd6e8cf..00000000 --- a/scripts/github/setup-github-automation.sh +++ /dev/null @@ -1,114 +0,0 @@ -#!/bin/bash -# Cortex Linux - GitHub Automation Setup -# Run this once to set up everything - -set -e - -echo "🚀 CORTEX LINUX AUTOMATION SETUP" -echo "==================================" -echo "" - -# Check if we're in a git repo -if [ ! -d .git ]; then - echo "❌ Error: Not in a git repository" - echo " Run this from your cortex repo root: cd ~/path/to/cortex" - exit 1 -fi - -# Check GitHub CLI -if ! command -v gh &> /dev/null; then - echo "❌ Error: GitHub CLI not found" - echo " Install: brew install gh" - echo " Then: gh auth login" - exit 1 -fi - -echo "✅ Prerequisites check passed" -echo "" - -# Create .github/workflows directory -echo "📁 Creating .github/workflows directory..." -mkdir -p .github/workflows - -# Copy workflow file -echo "📄 Installing automation workflow..." -if [ -f ~/Downloads/cortex-automation-github.yml ]; then - cp ~/Downloads/cortex-automation-github.yml .github/workflows/automation.yml - echo "✅ Workflow file installed" -else - echo "❌ Error: cortex-automation-github.yml not found in Downloads" - echo " Download it first from Claude" - exit 1 -fi - -# Create tracking files -echo "📊 Creating tracking files..." -echo "[]" > bounties_pending.json -echo "[]" > payments_history.json -echo "{}" > contributors.json -echo "✅ Tracking files created" - -# Add to .gitignore if needed -if [ ! -f .gitignore ]; then - touch .gitignore -fi - -if ! grep -q "bounties_pending.json" .gitignore; then - echo "" >> .gitignore - echo "# Cortex Automation tracking files" >> .gitignore - echo "bounties_pending.json" >> .gitignore - echo "payments_history.json" >> .gitignore - echo "contributors.json" >> .gitignore - echo "bounty_report.txt" >> .gitignore - echo "discord_message.txt" >> .gitignore - echo "✅ Added to .gitignore" -fi - -# Commit and push -echo "" -echo "💾 Committing automation setup..." -git add .github/workflows/automation.yml -git add bounties_pending.json payments_history.json contributors.json -git add .gitignore -git commit -m "Add GitHub Actions automation for bounty tracking" || echo "Nothing to commit" - -echo "" -echo "📤 Pushing to GitHub..." -git push - -echo "" -echo "✅ SETUP COMPLETE!" -echo "" -echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" -echo "" -echo "🔐 NEXT: Add Discord Webhook to GitHub Secrets" -echo "" -echo "1. Get Discord webhook URL:" -echo " • Go to your Discord server" -echo " • Server Settings → Integrations → Webhooks" -echo " • Click 'New Webhook'" -echo " • Name: 'Cortex Bot'" -echo " • Channel: #announcements" -echo " • Copy Webhook URL" -echo "" -echo "2. Add to GitHub Secrets:" -echo " • Go to: https://github.com/cortexlinux/cortex/settings/secrets/actions" -echo " • Click 'New repository secret'" -echo " • Name: DISCORD_WEBHOOK" -echo " • Value: [paste webhook URL]" -echo " • Click 'Add secret'" -echo "" -echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" -echo "" -echo "🎉 AUTOMATION IS NOW LIVE!" -echo "" -echo "What happens automatically:" -echo " ✅ Every Friday 6pm UTC - Bounty report posted to Discord" -echo " ✅ Every Monday noon UTC - Leaderboard updated" -echo " ✅ Every PR merge - Discord notification + welcome message" -echo "" -echo "You just approve payments in Discord. That's it!" -echo "" -echo "Test it now:" -echo " gh workflow run automation.yml" -echo "" diff --git a/scripts/recruit-ready.sh b/scripts/recruit-ready.sh deleted file mode 100755 index 1efb5777..00000000 --- a/scripts/recruit-ready.sh +++ /dev/null @@ -1,175 +0,0 @@ -#!/bin/bash -# -# recruit-ready.sh - Repository status and Discord recruitment message generator -# For Cortex Linux repository management -# - -set -e - -REPO="cortexlinux/cortex" -DISCORD_BLUE="\033[34m" -DISCORD_GREEN="\033[32m" -DISCORD_YELLOW="\033[33m" -DISCORD_RED="\033[31m" -DISCORD_CYAN="\033[36m" -BOLD="\033[1m" -RESET="\033[0m" - -echo -e "${BOLD}${DISCORD_CYAN}════════════════════════════════════════════════════════════${RESET}" -echo -e "${BOLD}${DISCORD_CYAN} CORTEX LINUX - REPOSITORY STATUS REPORT${RESET}" -echo -e "${BOLD}${DISCORD_CYAN}════════════════════════════════════════════════════════════${RESET}" -echo "" - -# 1. CI Status -echo -e "${BOLD}${DISCORD_BLUE}📊 CI STATUS${RESET}" -echo "─────────────────────────────────────────" -CI_STATUS=$(gh run list --repo $REPO --workflow=ci.yml --limit 1 --json status,conclusion,displayTitle --jq '.[0]') -CI_CONCLUSION=$(echo $CI_STATUS | jq -r '.conclusion') -CI_TITLE=$(echo $CI_STATUS | jq -r '.displayTitle') - -if [ "$CI_CONCLUSION" = "success" ]; then - echo -e "${DISCORD_GREEN}✅ CI PASSING${RESET} - $CI_TITLE" -elif [ "$CI_CONCLUSION" = "failure" ]; then - echo -e "${DISCORD_RED}❌ CI FAILING${RESET} - $CI_TITLE" -else - echo -e "${DISCORD_YELLOW}⏳ CI IN PROGRESS${RESET} - $CI_TITLE" -fi -echo "" - -# 2. Repository Stats -echo -e "${BOLD}${DISCORD_BLUE}📈 REPOSITORY STATS${RESET}" -echo "─────────────────────────────────────────" -REPO_STATS=$(gh api repos/$REPO --jq '{stars: .stargazers_count, forks: .forks_count, issues: .open_issues_count, watchers: .subscribers_count}') -STARS=$(echo $REPO_STATS | jq -r '.stars') -FORKS=$(echo $REPO_STATS | jq -r '.forks') -ISSUES=$(echo $REPO_STATS | jq -r '.issues') -WATCHERS=$(echo $REPO_STATS | jq -r '.watchers') - -echo "⭐ Stars: $STARS | 🍴 Forks: $FORKS | 📋 Open Issues: $ISSUES | 👀 Watchers: $WATCHERS" -echo "" - -# 3. Mergeable PRs -echo -e "${BOLD}${DISCORD_BLUE}✅ MERGEABLE PRs (Ready to Merge)${RESET}" -echo "─────────────────────────────────────────" -MERGEABLE_PRS=$(gh pr list --repo $REPO --state open --json number,title,author,mergeable,reviewDecision --jq '.[] | select(.mergeable == "MERGEABLE") | "PR #\(.number): \(.title) by @\(.author.login)"') - -if [ -z "$MERGEABLE_PRS" ]; then - echo "No PRs currently ready to merge" -else - echo "$MERGEABLE_PRS" -fi -echo "" - -# 4. PRs Needing Review -echo -e "${BOLD}${DISCORD_BLUE}👀 PRs NEEDING REVIEW${RESET}" -echo "─────────────────────────────────────────" -REVIEW_PRS=$(gh pr list --repo $REPO --state open --json number,title,author,reviewDecision --jq '.[] | select(.reviewDecision == "REVIEW_REQUIRED" or .reviewDecision == "") | "PR #\(.number): \(.title) by @\(.author.login)"' | head -10) - -if [ -z "$REVIEW_PRS" ]; then - echo "No PRs awaiting review" -else - echo "$REVIEW_PRS" -fi -echo "" - -# 5. Recently Merged PRs (potential bounty payments) -echo -e "${BOLD}${DISCORD_YELLOW}💰 RECENTLY MERGED (Check Bounty Payments)${RESET}" -echo "─────────────────────────────────────────" -MERGED_PRS=$(gh pr list --repo $REPO --state merged --limit 10 --json number,title,author,mergedAt,labels --jq '.[] | "PR #\(.number): \(.title) by @\(.author.login) - Merged: \(.mergedAt[:10])"') - -if [ -z "$MERGED_PRS" ]; then - echo "No recently merged PRs" -else - echo "$MERGED_PRS" -fi -echo "" - -# 6. Open Issues with Bounties -echo -e "${BOLD}${DISCORD_BLUE}🎯 OPEN ISSUES WITH BOUNTIES${RESET}" -echo "─────────────────────────────────────────" -BOUNTY_ISSUES=$(gh issue list --repo $REPO --state open --label "bounty" --json number,title,labels --jq '.[] | "#\(.number): \(.title)"' 2>/dev/null || echo "") - -if [ -z "$BOUNTY_ISSUES" ]; then - # Try to find issues that might have bounty in title or other bounty-related labels - BOUNTY_ISSUES=$(gh issue list --repo $REPO --state open --json number,title,labels --jq '.[] | select(.title | test("bounty|\\$"; "i")) | "#\(.number): \(.title)"' 2>/dev/null || echo "No bounty issues found") -fi - -if [ -z "$BOUNTY_ISSUES" ] || [ "$BOUNTY_ISSUES" = "No bounty issues found" ]; then - echo "No issues with bounty labels found" - echo "Tip: Add 'bounty' label to issues to track them here" -else - echo "$BOUNTY_ISSUES" -fi -echo "" - -# 7. Top Contributors (from recent PRs) -echo -e "${BOLD}${DISCORD_BLUE}👥 ACTIVE CONTRIBUTORS (Recent PRs)${RESET}" -echo "─────────────────────────────────────────" -CONTRIBUTORS=$(gh pr list --repo $REPO --state all --limit 50 --json author --jq '.[].author.login' | sort | uniq -c | sort -rn | head -5) -echo "$CONTRIBUTORS" -echo "" - -# 8. Discord Recruitment Message -echo -e "${BOLD}${DISCORD_CYAN}════════════════════════════════════════════════════════════${RESET}" -echo -e "${BOLD}${DISCORD_CYAN} DISCORD RECRUITMENT MESSAGE (Copy Below)${RESET}" -echo -e "${BOLD}${DISCORD_CYAN}════════════════════════════════════════════════════════════${RESET}" -echo "" - -# Count open PRs and issues for the message -OPEN_PRS=$(gh pr list --repo $REPO --state open --json number --jq 'length') -OPEN_ISSUES_COUNT=$(gh issue list --repo $REPO --state open --json number --jq 'length') - -cat << 'DISCORD_MSG' -``` -🚀 CORTEX LINUX - OPEN SOURCE CONTRIBUTORS WANTED! 🚀 -``` - -**What is Cortex Linux?** -An AI-powered package manager for Debian/Ubuntu that understands natural language. Instead of memorizing apt commands, just tell Cortex what you want: - -```bash -cortex install "set up a Python ML environment with TensorFlow" -``` - -**Why Contribute?** -DISCORD_MSG - -echo "- 💰 **Bounty Program** - Get paid for merged PRs" -echo "- 🌟 **$STARS stars** and growing" -echo "- 🔥 **$OPEN_PRS open PRs** to review/merge" -echo "- 📋 **$OPEN_ISSUES_COUNT open issues** to work on" -echo "- 🤝 Friendly community, fast PR reviews" - -cat << 'DISCORD_MSG' - -**Good First Issues:** -- Documentation improvements -- Test coverage -- Bug fixes with clear reproduction steps - -**Tech Stack:** -- Python 3.10+ -- OpenAI/Anthropic APIs -- Rich TUI library - -**Links:** -DISCORD_MSG - -echo "- GitHub: https://github.com/$REPO" -echo "- Discussions: https://github.com/$REPO/discussions" - -cat << 'DISCORD_MSG' - -**How to Start:** -1. Fork the repo -2. Pick an issue labeled `good-first-issue` or `help-wanted` -3. Submit a PR -4. Get reviewed & merged! - -Drop a 👋 if you're interested or have questions! -DISCORD_MSG - -echo "" -echo -e "${BOLD}${DISCORD_CYAN}════════════════════════════════════════════════════════════${RESET}" -echo -e "${BOLD}Generated: $(date)${RESET}" -echo -e "${BOLD}${DISCORD_CYAN}════════════════════════════════════════════════════════════${RESET}" diff --git a/test.md b/test.md deleted file mode 100644 index a0ecc617..00000000 --- a/test.md +++ /dev/null @@ -1,67 +0,0 @@ -# Testing Strategy - -Cortex relies on a mix of fast unit tests and Docker-backed integration tests to -validate the full installation workflow. This guide explains how to run the -suites locally and in CI. - -## Test Suites - -| Suite | Location | Purpose | Invocation | -|-------|----------|---------|------------| -| Unit | `test/*.py` | Validate individual modules (CLI, coordinator, interpreter). | `python test/run_all_tests.py` | -| Integration | `test/integration/*.py` | Exercise end-to-end scenarios inside disposable Docker containers. | `python -m unittest test.integration.test_end_to_end` | - -## Running Tests Locally - -1. **Prepare the environment** - ```bash - python -m venv .venv - source .venv/bin/activate # Windows: .venv\Scripts\activate - pip install --upgrade pip - pip install -r LLM/requirements.txt - pip install -r src/requirements.txt - pip install -e . - ``` - -2. **Unit tests** - ```bash - python test/run_all_tests.py - ``` - Use the fake provider to avoid external API calls when necessary: - ```bash - CORTEX_PROVIDER=fake python test/run_all_tests.py - ``` - -3. **Integration tests** (requires Docker) - ```bash - python -m unittest test.integration.test_end_to_end - ``` - Customise the Docker image with `CORTEX_INTEGRATION_IMAGE` if you need a - different base image: - ```bash - CORTEX_INTEGRATION_IMAGE=python:3.12-slim python -m unittest test.integration.test_end_to_end - ``` - -## Continuous Integration Recommendations - -- Run unit tests on every pull request. -- Schedule integration tests nightly or on demand using a GitHub Actions job - with the `docker` service enabled. -- Fail the workflow if docstring coverage (tracked by CodeRabbit) drops below - 80%. -- Publish the HTML report from `python -m coverage html` when running coverage - builds to assist reviewers. - -## Troubleshooting - -- **Docker not available** – Integration tests are skipped automatically when - the Docker CLI is missing. Install Docker Desktop (macOS/Windows) or the - `docker` package (Linux) to enable them. -- **Missing API keys** – Set `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, or - `KIMI_API_KEY` as appropriate. For offline development use - `CORTEX_PROVIDER=fake` plus optional `CORTEX_FAKE_COMMANDS`. -- **Docstring coverage failures** – Add module/class/function docstrings. The - CodeRabbit gate requires 80% coverage. - -By following this guide, contributors can quickly validate their changes and -ship reliable improvements to Cortex. diff --git a/test/integration/__init__.py b/test/integration/__init__.py deleted file mode 100644 index 4630c8a8..00000000 --- a/test/integration/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Integration tests for Cortex executed against Docker-based environments.""" diff --git a/test/run_all_tests.py b/test/run_all_tests.py deleted file mode 100644 index 5958f0c4..00000000 --- a/test/run_all_tests.py +++ /dev/null @@ -1,37 +0,0 @@ -"""Unified test runner that discovers unit and integration suites.""" - -from __future__ import annotations - -import argparse -import os -import sys -import unittest - - -def discover_tests(pattern: str = "test_*.py") -> unittest.TestSuite: - """Discover tests starting from the repository's ``test`` directory.""" - - start_dir = os.path.dirname(__file__) - loader = unittest.TestLoader() - return loader.discover(start_dir=start_dir, pattern=pattern) - - -def main(argv: list[str] | None = None) -> int: - """Execute all test suites and return the exit code.""" - - parser = argparse.ArgumentParser(description="Run Cortex unit/integration tests") - parser.add_argument( - "--pattern", - default="test_*.py", - help="Glob pattern used for discovery (defaults to test_*.py)", - ) - args = parser.parse_args(argv) - - suite = discover_tests(pattern=args.pattern) - runner = unittest.TextTestRunner(verbosity=2) - result = runner.run(suite) - return 0 if result.wasSuccessful() else 1 - - -if __name__ == "__main__": # pragma: no cover - sys.exit(main()) diff --git a/test/test_smart_stacks.py b/test/test_smart_stacks.py deleted file mode 100644 index 6ea74904..00000000 --- a/test/test_smart_stacks.py +++ /dev/null @@ -1,12 +0,0 @@ -import cortex.stack_manager as stack_manager -from cortex.stack_manager import StackManager - - -def test_suggest_stack_ml_gpu_and_cpu(monkeypatch): - manager = StackManager() - - monkeypatch.setattr(stack_manager, "has_nvidia_gpu", lambda: False) - assert manager.suggest_stack("ml") == "ml-cpu" - - monkeypatch.setattr(stack_manager, "has_nvidia_gpu", lambda: True) - assert manager.suggest_stack("ml") == "ml" diff --git a/test_parallel_llm.py b/test_parallel_llm.py deleted file mode 100755 index 41b62142..00000000 --- a/test_parallel_llm.py +++ /dev/null @@ -1,319 +0,0 @@ -#!/usr/bin/env python3 -""" -Quick test script to verify parallel LLM calls are working. - -Run this to test: -1. Async completion works -2. Batch processing works -3. Rate limiting works -4. Helper functions work -""" - -import asyncio -import os -import sys -import time - -# Add parent directory to path -sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".")) - -from cortex.llm_router import ( - LLMRouter, - TaskType, - check_hardware_configs_parallel, - diagnose_errors_parallel, - query_multiple_packages, -) - - -async def test_async_completion(): - """Test basic async completion.""" - print("=" * 60) - print("Test 1: Async Completion") - print("=" * 60) - - router = LLMRouter() - - if not router.claude_client_async and not router.kimi_client_async: - print("⚠️ No API keys found. Set ANTHROPIC_API_KEY or MOONSHOT_API_KEY") - print(" Skipping async completion test...") - return False - - try: - start = time.time() - response = await router.acomplete( - messages=[{"role": "user", "content": "Say 'Hello from async'"}], - task_type=TaskType.USER_CHAT, - max_tokens=50, - ) - elapsed = time.time() - start - - print(f"✅ Async completion successful!") - print(f" Provider: {response.provider.value}") - print(f" Latency: {elapsed:.2f}s") - print(f" Response: {response.content[:100]}") - print(f" Tokens: {response.tokens_used}") - return True - except Exception as e: - print(f"❌ Async completion failed: {e}") - return False - - -async def test_batch_processing(): - """Test batch processing.""" - print("\n" + "=" * 60) - print("Test 2: Batch Processing") - print("=" * 60) - - router = LLMRouter() - - if not router.claude_client_async and not router.kimi_client_async: - print("⚠️ No API keys found. Skipping batch test...") - return False - - try: - requests = [ - { - "messages": [{"role": "user", "content": "What is 1+1?"}], - "task_type": TaskType.USER_CHAT, - "max_tokens": 20, - }, - { - "messages": [{"role": "user", "content": "What is 2+2?"}], - "task_type": TaskType.USER_CHAT, - "max_tokens": 20, - }, - { - "messages": [{"role": "user", "content": "What is 3+3?"}], - "task_type": TaskType.USER_CHAT, - "max_tokens": 20, - }, - ] - - print(f"Processing {len(requests)} requests in parallel...") - start = time.time() - responses = await router.complete_batch(requests, max_concurrent=3) - elapsed = time.time() - start - - print(f"✅ Batch processing successful!") - print(f" Total time: {elapsed:.2f}s") - print(f" Average per request: {elapsed/len(requests):.2f}s") - - for i, response in enumerate(responses, 1): - if response.model == "error": - print(f" Request {i}: ❌ Error - {response.content}") - else: - print(f" Request {i}: ✅ {response.content[:50]}...") - - return all(r.model != "error" for r in responses) - except Exception as e: - print(f"❌ Batch processing failed: {e}") - import traceback - traceback.print_exc() - return False - - -async def test_rate_limiting(): - """Test rate limiting.""" - print("\n" + "=" * 60) - print("Test 3: Rate Limiting") - print("=" * 60) - - router = LLMRouter() - router.set_rate_limit(max_concurrent=2) - - if not router.claude_client_async and not router.kimi_client_async: - print("⚠️ No API keys found. Skipping rate limit test...") - return False - - try: - # Create 5 requests but limit to 2 concurrent - requests = [ - { - "messages": [{"role": "user", "content": f"Count: {i}"}], - "task_type": TaskType.USER_CHAT, - "max_tokens": 10, - } - for i in range(5) - ] - - print(f"Processing {len(requests)} requests with max_concurrent=2...") - start = time.time() - responses = await router.complete_batch(requests, max_concurrent=2) - elapsed = time.time() - start - - print(f"✅ Rate limiting working!") - print(f" Total time: {elapsed:.2f}s") - print(f" Semaphore value: {router._rate_limit_semaphore._value}") - return True - except Exception as e: - print(f"❌ Rate limiting test failed: {e}") - return False - - -async def test_helper_functions(): - """Test helper functions.""" - print("\n" + "=" * 60) - print("Test 4: Helper Functions") - print("=" * 60) - - router = LLMRouter() - - if not router.claude_client_async and not router.kimi_client_async: - print("⚠️ No API keys found. Skipping helper function tests...") - return False - - results = [] - - # Test query_multiple_packages - try: - print("\n4a. Testing query_multiple_packages...") - packages = ["nginx", "postgresql"] - responses = await query_multiple_packages( - router, packages, max_concurrent=2 - ) - print(f" ✅ Queried {len(responses)} packages") - results.append(True) - except Exception as e: - print(f" ❌ Failed: {e}") - results.append(False) - - # Test diagnose_errors_parallel - try: - print("\n4b. Testing diagnose_errors_parallel...") - errors = ["Test error 1", "Test error 2"] - diagnoses = await diagnose_errors_parallel( - router, errors, max_concurrent=2 - ) - print(f" ✅ Diagnosed {len(diagnoses)} errors") - results.append(True) - except Exception as e: - print(f" ❌ Failed: {e}") - results.append(False) - - # Test check_hardware_configs_parallel - try: - print("\n4c. Testing check_hardware_configs_parallel...") - components = ["nvidia_gpu", "intel_cpu"] - configs = await check_hardware_configs_parallel( - router, components, max_concurrent=2 - ) - print(f" ✅ Checked {len(configs)} components") - results.append(True) - except Exception as e: - print(f" ❌ Failed: {e}") - results.append(False) - - return all(results) - - -async def test_performance_comparison(): - """Compare sequential vs parallel performance.""" - print("\n" + "=" * 60) - print("Test 5: Performance Comparison") - print("=" * 60) - - router = LLMRouter() - - if not router.claude_client_async and not router.kimi_client_async: - print("⚠️ No API keys found. Skipping performance test...") - return False - - try: - requests = [ - { - "messages": [{"role": "user", "content": f"Request {i}"}], - "task_type": TaskType.USER_CHAT, - "max_tokens": 20, - } - for i in range(3) - ] - - # Simulate sequential (would be slower) - print("Simulating sequential execution...") - start_seq = time.time() - for req in requests: - await router.acomplete(**{k: v for k, v in req.items() if k != "task_type"}, - task_type=req["task_type"]) - elapsed_seq = time.time() - start_seq - - # Parallel execution - print("Running parallel execution...") - start_par = time.time() - await router.complete_batch(requests, max_concurrent=3) - elapsed_par = time.time() - start_par - - speedup = elapsed_seq / elapsed_par if elapsed_par > 0 else 1.0 - print(f"\n✅ Performance comparison:") - print(f" Sequential: {elapsed_seq:.2f}s") - print(f" Parallel: {elapsed_par:.2f}s") - print(f" Speedup: {speedup:.2f}x") - - return speedup > 1.0 - except Exception as e: - print(f"❌ Performance test failed: {e}") - return False - - -async def main(): - """Run all tests.""" - print("\n" + "=" * 60) - print("Parallel LLM Calls - Test Suite") - print("=" * 60) - print("\nChecking API keys...") - - # Check for API keys - has_claude = bool(os.getenv("ANTHROPIC_API_KEY")) - has_kimi = bool(os.getenv("MOONSHOT_API_KEY")) - - if has_claude: - print("✅ ANTHROPIC_API_KEY found") - else: - print("⚠️ ANTHROPIC_API_KEY not set") - - if has_kimi: - print("✅ MOONSHOT_API_KEY found") - else: - print("⚠️ MOONSHOT_API_KEY not set") - - if not has_claude and not has_kimi: - print("\n❌ No API keys found!") - print(" Set at least one:") - print(" export ANTHROPIC_API_KEY='your-key'") - print(" export MOONSHOT_API_KEY='your-key'") - return - - print("\n" + "=" * 60) - print("Running tests...") - print("=" * 60) - - results = [] - - # Run tests - results.append(await test_async_completion()) - results.append(await test_batch_processing()) - results.append(await test_rate_limiting()) - results.append(await test_helper_functions()) - results.append(await test_performance_comparison()) - - # Summary - print("\n" + "=" * 60) - print("Test Summary") - print("=" * 60) - passed = sum(results) - total = len(results) - print(f"\n✅ Passed: {passed}/{total}") - print(f"❌ Failed: {total - passed}/{total}") - - if all(results): - print("\n🎉 All tests passed! Parallel LLM calls are working correctly.") - else: - print("\n⚠️ Some tests failed. Check the output above for details.") - - return all(results) - - -if __name__ == "__main__": - success = asyncio.run(main()) - sys.exit(0 if success else 1) - diff --git a/test/integration/docker_utils.py b/tests/integration/docker_utils.py similarity index 100% rename from test/integration/docker_utils.py rename to tests/integration/docker_utils.py diff --git a/test/integration/test_end_to_end.py b/tests/integration/test_end_to_end.py similarity index 96% rename from test/integration/test_end_to_end.py rename to tests/integration/test_end_to_end.py index b9049380..288b5b29 100644 --- a/test/integration/test_end_to_end.py +++ b/tests/integration/test_end_to_end.py @@ -109,11 +109,11 @@ def test_project_tests_run_inside_container(self): "CORTEX_PROVIDER": "fake", "CORTEX_FAKE_COMMANDS": json.dumps({"commands": ["echo plan"]}), } - result = self._run("python test/run_all_tests.py", env=env) + result = self._run("pytest tests/ -v --ignore=tests/integration", env=env) self.assertTrue(result.succeeded(), msg=result.stderr) combined_output = f"{result.stdout}\n{result.stderr}" - self.assertIn("OK", combined_output) + self.assertIn("passed", combined_output.lower()) if __name__ == "__main__": # pragma: no cover diff --git a/tests/run_all_tests.py b/tests/run_all_tests.py deleted file mode 100644 index 353fe6bc..00000000 --- a/tests/run_all_tests.py +++ /dev/null @@ -1,21 +0,0 @@ -import os -import sys -import unittest - - -def main() -> int: - """Discover and run all unittest modules within the test directory.""" - current_dir = os.path.dirname(os.path.abspath(__file__)) - project_root = os.path.abspath(os.path.join(current_dir, "..")) - - if project_root not in sys.path: - sys.path.insert(0, project_root) - - suite = unittest.defaultTestLoader.discover(start_dir=current_dir, pattern="test_*.py") - runner = unittest.TextTestRunner(verbosity=2) - result = runner.run(suite) - return 0 if result.wasSuccessful() else 1 - - -if __name__ == "__main__": - raise SystemExit(main()) diff --git a/test/test_cli.py b/tests/test_cli_extended.py similarity index 97% rename from test/test_cli.py rename to tests/test_cli_extended.py index 144af8f5..ae1e6ca6 100644 --- a/test/test_cli.py +++ b/tests/test_cli_extended.py @@ -1,3 +1,9 @@ +"""Extended CLI tests - originally from test/ folder. + +These tests provide additional coverage with type hints and more thorough +mocking of internal methods. +""" + import os import sys import unittest @@ -8,8 +14,8 @@ from cortex.cli import CortexCLI, main -class TestCortexCLI(unittest.TestCase): - """Unit tests covering the high-level CLI behaviours.""" +class TestCortexCLIExtended(unittest.TestCase): + """Extended unit tests covering CLI behaviours with thorough mocking.""" def setUp(self) -> None: self.cli = CortexCLI() From 7a90b60091d74a29813aa6e6afc821829aa68567 Mon Sep 17 00:00:00 2001 From: sahil Date: Mon, 22 Dec 2025 21:33:01 +0530 Subject: [PATCH 2/8] issue desc update --- .github/ISSUE_TEMPLATE/feature_request.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index db0988e0..a843ffd6 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -20,8 +20,4 @@ cortex ## Alternatives considered -Any workarounds you've tried. - -## Bounty interest - -Are you interested in implementing this for a bounty? (Yes/No) +Any workarounds you've tried. \ No newline at end of file From ae17b46d78d359a952c66b1c875af9ae2b00dd84 Mon Sep 17 00:00:00 2001 From: sahil Date: Mon, 22 Dec 2025 21:44:42 +0530 Subject: [PATCH 3/8] restore: automation.yml workflow for PR checks --- .github/workflows/automation.yml | 94 ++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 .github/workflows/automation.yml diff --git a/.github/workflows/automation.yml b/.github/workflows/automation.yml new file mode 100644 index 00000000..bc7bd104 --- /dev/null +++ b/.github/workflows/automation.yml @@ -0,0 +1,94 @@ +name: Cortex Automation + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +permissions: + contents: read + pull-requests: read + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ['3.10', '3.11', '3.12'] + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v6 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + pip install pytest pytest-cov pytest-mock pytest-asyncio + + - name: Run tests + run: | + python -m pytest tests/ -v --cov=cortex --cov-report=xml --cov-report=term-missing + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v5 + if: matrix.python-version == '3.11' + with: + file: ./coverage.xml + fail_ci_if_error: false + + lint: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v6 + with: + python-version: '3.11' + + - name: Install linting tools + run: | + python -m pip install --upgrade pip + pip install black pylint mypy + + - name: Check formatting with black + run: | + black --check cortex/ || echo "::warning::Code formatting issues found. Run 'black cortex/' to fix." + + - name: Lint with pylint + run: | + pylint cortex/ --exit-zero --output-format=text | tee pylint-report.txt + score=$(tail -n 2 pylint-report.txt | head -n 1 | grep -oP '\d+\.\d+') + echo "Pylint score: $score" + + security: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v6 + with: + python-version: '3.11' + + - name: Install security tools + run: | + python -m pip install --upgrade pip + pip install bandit safety + + - name: Run Bandit security linter + run: | + bandit -r cortex/ -ll -ii || echo "::warning::Security issues found. Please review." + + - name: Check dependencies with safety + run: | + pip install -r requirements.txt + safety check --full-report || echo "::warning::Vulnerable dependencies found." From f4d3322b239b14e21f36a7adb880541051f05c79 Mon Sep 17 00:00:00 2001 From: sahil Date: Mon, 22 Dec 2025 21:45:11 +0530 Subject: [PATCH 4/8] docs: move COMMANDS.md to docs folder --- COMMANDS.md => docs/COMMANDS.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename COMMANDS.md => docs/COMMANDS.md (100%) diff --git a/COMMANDS.md b/docs/COMMANDS.md similarity index 100% rename from COMMANDS.md rename to docs/COMMANDS.md From c37b250621f79cc9a1c80a7c6c778f1dc55a63b5 Mon Sep 17 00:00:00 2001 From: sahil Date: Mon, 22 Dec 2025 21:58:16 +0530 Subject: [PATCH 5/8] style: apply black and ruff formatting fixes --- cortex/llm_router.py | 13 +++++++++---- examples/parallel_llm_demo.py | 10 +++++----- tests/test_llm_router.py | 4 +--- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/cortex/llm_router.py b/cortex/llm_router.py index d43f9eaa..22a2b1fc 100644 --- a/cortex/llm_router.py +++ b/cortex/llm_router.py @@ -759,7 +759,10 @@ async def query_multiple_packages( { "messages": [ {"role": "system", "content": default_system}, - {"role": "user", "content": f"What are the installation requirements for {pkg}?"}, + { + "role": "user", + "content": f"What are the installation requirements for {pkg}?", + }, ], "task_type": TaskType.DEPENDENCY_RESOLUTION, } @@ -798,8 +801,7 @@ async def diagnose_errors_parallel( print(f"{error}: {diagnosis.content}") """ system_prompt = ( - "You are a Linux system debugging expert. " - "Analyze error messages and provide solutions." + "You are a Linux system debugging expert. " "Analyze error messages and provide solutions." ) if context: system_prompt += f"\n\nSystem context: {context}" @@ -857,7 +859,10 @@ async def check_hardware_configs_parallel( { "messages": [ {"role": "system", "content": system_prompt}, - {"role": "user", "content": f"Check configuration requirements for {component}"}, + { + "role": "user", + "content": f"Check configuration requirements for {component}", + }, ], "task_type": TaskType.CONFIGURATION, } diff --git a/examples/parallel_llm_demo.py b/examples/parallel_llm_demo.py index ffaf59f9..1034aa3d 100644 --- a/examples/parallel_llm_demo.py +++ b/examples/parallel_llm_demo.py @@ -12,6 +12,7 @@ import asyncio import time + from cortex.llm_router import ( LLMRouter, TaskType, @@ -35,9 +36,7 @@ async def demo_multi_package_queries(): print(f"\nQuerying {len(packages)} packages in parallel...") start_time = time.time() - responses = await query_multiple_packages( - router, packages, max_concurrent=5 - ) + responses = await query_multiple_packages(router, packages, max_concurrent=5) elapsed = time.time() - start_time @@ -211,7 +210,9 @@ async def demo_sequential_vs_parallel(): speedup = elapsed_seq / elapsed_par if elapsed_par > 0 else 1.0 print(f"\n⚡ Speedup: {speedup:.2f}x") - print(f" Time saved: {elapsed_seq - elapsed_par:.2f}s ({((elapsed_seq - elapsed_par)/elapsed_seq*100):.1f}%)") + print( + f" Time saved: {elapsed_seq - elapsed_par:.2f}s ({((elapsed_seq - elapsed_par)/elapsed_seq*100):.1f}%)" + ) async def main(): @@ -251,4 +252,3 @@ async def main(): if __name__ == "__main__": asyncio.run(main()) - diff --git a/tests/test_llm_router.py b/tests/test_llm_router.py index e240c7ce..da19e84d 100644 --- a/tests/test_llm_router.py +++ b/tests/test_llm_router.py @@ -707,9 +707,7 @@ def test_check_hardware_configs_parallel(self, mock_async_openai): async def run_test(): components = ["nvidia_gpu", "intel_cpu"] - configs = await check_hardware_configs_parallel( - router, components, max_concurrent=2 - ) + configs = await check_hardware_configs_parallel(router, components, max_concurrent=2) self.assertEqual(len(configs), 2) self.assertIn("nvidia_gpu", configs) self.assertIn("intel_cpu", configs) From 4c3fe5b4be9785f41e6a35a6d12e1c26606a7ccf Mon Sep 17 00:00:00 2001 From: sahil Date: Mon, 22 Dec 2025 22:07:12 +0530 Subject: [PATCH 6/8] test fix and lint check --- .github/workflows/automation.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/automation.yml b/.github/workflows/automation.yml index bc7bd104..0e546013 100644 --- a/.github/workflows/automation.yml +++ b/.github/workflows/automation.yml @@ -32,8 +32,11 @@ jobs: pip install pytest pytest-cov pytest-mock pytest-asyncio - name: Run tests + env: + ANTHROPIC_API_KEY: "test-key-for-ci" + OPENAI_API_KEY: "test-key-for-ci" run: | - python -m pytest tests/ -v --cov=cortex --cov-report=xml --cov-report=term-missing + python -m pytest tests/ -v --cov=cortex --cov-report=xml --cov-report=term-missing --ignore=tests/integration - name: Upload coverage to Codecov uses: codecov/codecov-action@v5 From 2b9ea65c8f036df3468da53a281b4d1bd081c6f4 Mon Sep 17 00:00:00 2001 From: sahil Date: Mon, 22 Dec 2025 22:20:04 +0530 Subject: [PATCH 7/8] test fix and ruff check fix --- .github/workflows/automation.yml | 20 ++++++++++++-------- cortex/dependency_check.py | 8 ++++++++ 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/.github/workflows/automation.yml b/.github/workflows/automation.yml index 0e546013..12d4e197 100644 --- a/.github/workflows/automation.yml +++ b/.github/workflows/automation.yml @@ -29,14 +29,15 @@ jobs: run: | python -m pip install --upgrade pip pip install -r requirements.txt - pip install pytest pytest-cov pytest-mock pytest-asyncio + pip install -e . + pip install pytest pytest-cov pytest-mock pytest-asyncio pytest-timeout - name: Run tests env: ANTHROPIC_API_KEY: "test-key-for-ci" OPENAI_API_KEY: "test-key-for-ci" run: | - python -m pytest tests/ -v --cov=cortex --cov-report=xml --cov-report=term-missing --ignore=tests/integration + python -m pytest tests/ -v --cov=cortex --cov-report=xml --cov-report=term-missing --timeout=60 - name: Upload coverage to Codecov uses: codecov/codecov-action@v5 @@ -59,17 +60,20 @@ jobs: - name: Install linting tools run: | python -m pip install --upgrade pip - pip install black pylint mypy + pip install ruff black mypy + + - name: Lint with ruff + run: | + ruff check . --output-format=github - name: Check formatting with black run: | - black --check cortex/ || echo "::warning::Code formatting issues found. Run 'black cortex/' to fix." + black --check . --exclude "(venv|\.venv|build|dist)" - - name: Lint with pylint + - name: Type check with mypy run: | - pylint cortex/ --exit-zero --output-format=text | tee pylint-report.txt - score=$(tail -n 2 pylint-report.txt | head -n 1 | grep -oP '\d+\.\d+') - echo "Pylint score: $score" + mypy cortex --ignore-missing-imports --no-error-summary || true + continue-on-error: true security: runs-on: ubuntu-latest diff --git a/cortex/dependency_check.py b/cortex/dependency_check.py index c78cc138..d42e610f 100644 --- a/cortex/dependency_check.py +++ b/cortex/dependency_check.py @@ -2,14 +2,17 @@ Dependency Check Module for Cortex Linux Verifies all required dependencies are installed before the main application runs. """ + import sys from typing import NamedTuple + class DependencyStatus(NamedTuple): name: str installed: bool import_name: str + REQUIRED_DEPENDENCIES = [ ("pyyaml", "yaml"), ("rich", "rich"), @@ -19,6 +22,7 @@ class DependencyStatus(NamedTuple): ("requests", "requests"), ] + def check_dependency(package_name: str, import_name: str) -> DependencyStatus: try: __import__(import_name) @@ -26,9 +30,11 @@ def check_dependency(package_name: str, import_name: str) -> DependencyStatus: except ImportError: return DependencyStatus(package_name, False, import_name) + def get_missing_dependencies() -> list[str]: return [pkg for pkg, imp in REQUIRED_DEPENDENCIES if not check_dependency(pkg, imp).installed] + def format_installation_instructions(missing: list[str]) -> str: packages = " ".join(missing) return f""" @@ -53,12 +59,14 @@ def format_installation_instructions(missing: list[str]) -> str: After installing, run 'cortex' again. """ + def verify_dependencies_or_exit() -> None: missing = get_missing_dependencies() if missing: print(format_installation_instructions(missing), file=sys.stderr) sys.exit(1) + if __name__ == "__main__": missing = get_missing_dependencies() if missing: From 4f4cd6c039ba165355f10e011a90405fd6ac9a31 Mon Sep 17 00:00:00 2001 From: sahil Date: Tue, 23 Dec 2025 11:23:21 +0530 Subject: [PATCH 8/8] FIx test --- cortex/cli.py | 7 +++++-- cortex/llm/interpreter.py | 23 +++++++++++++++++++++++ tests/integration/docker_utils.py | 2 ++ tests/integration/test_end_to_end.py | 14 ++++++++++++-- 4 files changed, 42 insertions(+), 4 deletions(-) diff --git a/cortex/cli.py b/cortex/cli.py index 996aec2b..c808d5e4 100644 --- a/cortex/cli.py +++ b/cortex/cli.py @@ -44,11 +44,14 @@ def _debug(self, message: str): console.print(f"[dim][DEBUG] {message}[/dim]") def _get_api_key(self) -> str | None: - # Check if using Ollama (no API key needed) + # Check if using Ollama or Fake provider (no API key needed) provider = self._get_provider() if provider == "ollama": self._debug("Using Ollama (no API key required)") return "ollama-local" # Placeholder for Ollama + if provider == "fake": + self._debug("Using Fake provider for testing") + return "fake-key" # Placeholder for Fake provider is_valid, detected_provider, error = validate_api_key() if not is_valid: @@ -62,7 +65,7 @@ def _get_api_key(self) -> str | None: def _get_provider(self) -> str: # Check environment variable for explicit provider choice explicit_provider = os.environ.get("CORTEX_PROVIDER", "").lower() - if explicit_provider in ["ollama", "openai", "claude"]: + if explicit_provider in ["ollama", "openai", "claude", "fake"]: return explicit_provider # Auto-detect based on available API keys diff --git a/cortex/llm/interpreter.py b/cortex/llm/interpreter.py index 03f6614d..aa01023e 100644 --- a/cortex/llm/interpreter.py +++ b/cortex/llm/interpreter.py @@ -12,6 +12,7 @@ class APIProvider(Enum): CLAUDE = "claude" OPENAI = "openai" OLLAMA = "ollama" + FAKE = "fake" class CommandInterpreter: @@ -62,6 +63,8 @@ def __init__( self.model = "claude-sonnet-4-20250514" elif self.provider == APIProvider.OLLAMA: self.model = "llama3.2" # Default Ollama model + elif self.provider == APIProvider.FAKE: + self.model = "fake" # Fake provider doesn't use a real model self._initialize_client() @@ -84,6 +87,9 @@ def _initialize_client(self): # Ollama uses local HTTP API, no special client needed self.ollama_url = os.environ.get("OLLAMA_HOST", "http://localhost:11434") self.client = None # Will use requests + elif self.provider == APIProvider.FAKE: + # Fake provider uses predefined commands from environment + self.client = None # No client needed for fake provider def _get_system_prompt(self) -> str: return """You are a Linux system command expert. Convert natural language requests into safe, validated bash commands. @@ -167,6 +173,21 @@ def _call_ollama(self, user_input: str) -> list[str]: except Exception as e: raise RuntimeError(f"Ollama API call failed: {str(e)}") + def _call_fake(self, user_input: str) -> list[str]: + """Return predefined fake commands from environment for testing.""" + fake_commands_env = os.environ.get("CORTEX_FAKE_COMMANDS") + if not fake_commands_env: + raise RuntimeError("CORTEX_FAKE_COMMANDS environment variable not set") + + try: + data = json.loads(fake_commands_env) + commands = data.get("commands", []) + if not isinstance(commands, list): + raise ValueError("Commands must be a list in CORTEX_FAKE_COMMANDS") + return [cmd for cmd in commands if cmd and isinstance(cmd, str)] + except json.JSONDecodeError as e: + raise RuntimeError(f"Failed to parse CORTEX_FAKE_COMMANDS: {str(e)}") + def _parse_commands(self, content: str) -> list[str]: try: if content.startswith("```json"): @@ -243,6 +264,8 @@ def parse(self, user_input: str, validate: bool = True) -> list[str]: commands = self._call_claude(user_input) elif self.provider == APIProvider.OLLAMA: commands = self._call_ollama(user_input) + elif self.provider == APIProvider.FAKE: + commands = self._call_fake(user_input) else: raise ValueError(f"Unsupported provider: {self.provider}") diff --git a/tests/integration/docker_utils.py b/tests/integration/docker_utils.py index 8728c1be..ddfe5330 100644 --- a/tests/integration/docker_utils.py +++ b/tests/integration/docker_utils.py @@ -100,6 +100,8 @@ def run_in_docker( check=False, capture_output=True, text=True, + encoding="utf-8", + errors="replace", # Replace undecodable characters instead of failing timeout=timeout, ) diff --git a/tests/integration/test_end_to_end.py b/tests/integration/test_end_to_end.py index 288b5b29..00776095 100644 --- a/tests/integration/test_end_to_end.py +++ b/tests/integration/test_end_to_end.py @@ -17,7 +17,8 @@ "PYTHONPATH": "/workspace", "PYTHONDONTWRITEBYTECODE": "1", } -PIP_BOOTSTRAP = "python -m pip install --quiet -r /workspace/requirements.txt" +PIP_BOOTSTRAP = "python -m pip install --quiet --upgrade pip setuptools && python -m pip install --quiet --no-cache-dir -r /workspace/requirements.txt" +PIP_BOOTSTRAP_DEV = "python -m pip install --quiet --upgrade pip setuptools && python -m pip install --quiet --no-cache-dir -r /workspace/requirements.txt -r /workspace/requirements-dev.txt" @unittest.skipUnless(docker_available(), "Docker is required for integration tests") @@ -109,7 +110,16 @@ def test_project_tests_run_inside_container(self): "CORTEX_PROVIDER": "fake", "CORTEX_FAKE_COMMANDS": json.dumps({"commands": ["echo plan"]}), } - result = self._run("pytest tests/ -v --ignore=tests/integration", env=env) + # Use PIP_BOOTSTRAP_DEV to install pytest and other dev dependencies + effective_env = dict(BASE_ENV) + effective_env.update(env) + result = run_in_docker( + DEFAULT_IMAGE, + f"{PIP_BOOTSTRAP_DEV} && pytest tests/ -v --ignore=tests/integration", + env=effective_env, + mounts=[MOUNT], + workdir="/workspace", + ) self.assertTrue(result.succeeded(), msg=result.stderr) combined_output = f"{result.stdout}\n{result.stderr}"