Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .devenv/gc/shell
1 change: 0 additions & 1 deletion .devenv/gc/shell-2-link

This file was deleted.

1 change: 1 addition & 0 deletions .devenv/gc/shell-3-link
2 changes: 1 addition & 1 deletion .devenv/profile
19 changes: 19 additions & 0 deletions .dialyzer_ignore.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Jido framework macro-generated code issues
# All errors below are false positives from the Jido.Agent and Jido.Action macros
# Use Path.expand for deps to work in both CI and local environments

[
# Unused functions - these ARE used but Dialyzer can't trace through macro expansion
{Path.expand("deps/jido/lib/jido/agent.ex"), :unused_fun},

# Contract violations - macro-generated specs don't match Dialyzer's inference
{Path.expand("deps/jido/lib/jido/agent.ex"), :call},

# Invalid contracts in our agent modules - generated by `use Jido.Agent` macro
{"lib/labs_jido_agent/code_review_agent.ex", :invalid_contract},
{"lib/labs_jido_agent/progress_coach_agent.ex", :invalid_contract},
{"lib/labs_jido_agent/study_buddy_agent.ex", :invalid_contract},

# Pattern match issue in progress coach action - macro-generated validation code
{"lib/labs_jido_agent/progress_coach_action.ex", :pattern_match}
]
147 changes: 147 additions & 0 deletions .github/workflows/jido-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
name: Jido AI Code Review

# ℹ️ This workflow uses Jido v1.0 agents with simulated AI responses
# It provides educational code review feedback via pattern matching

on:
pull_request:
types: [opened, synchronize, reopened]
paths:
- 'apps/**/lib/**/*.ex'
- 'lib/**/*.ex'

jobs:
jido-review:
runs-on: ubuntu-latest
name: AI Code Review

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
elixir-version: '1.17'
otp-version: '27'

- name: Restore dependencies cache
uses: actions/cache@v3
with:
path: |
deps
_build
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}
restore-keys: ${{ runner.os }}-mix-

- name: Install dependencies
run: mix deps.get

- name: Compile
run: mix compile

- name: Run Jido Code Review
id: review
run: |
set +e # Don't exit on errors

# Detect which files changed
git fetch origin "${{ github.base_ref }}" || {
echo "Failed to fetch base branch"
echo "No review output generated" > review_output.txt
exit 0
}

CHANGED_FILES=$(git diff --name-only "origin/${{ github.base_ref }}...HEAD" | grep '\.ex$' || true)

if [ -z "$CHANGED_FILES" ]; then
echo "No Elixir files changed"
echo "No Elixir files changed in this PR" > review_output.txt
exit 0
fi

echo "Reviewing changed files:"
echo "$CHANGED_FILES"

# Run jido.grade on changed files
# Note: This is a simplified version - full implementation would review individual files
mix jido.grade --interactive > review_output.txt 2>&1
GRADE_EXIT=$?

cat review_output.txt

echo "Jido grade exit code: $GRADE_EXIT"
exit 0 # Always succeed so we can post comments

- name: Post review comment
if: always()
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const fs = require('fs');
let reviewOutput = '';

try {
reviewOutput = fs.readFileSync('review_output.txt', 'utf8');
} catch (error) {
reviewOutput = 'No review output generated';
}

const body = `## 🤖 Jido AI Code Review

${reviewOutput}

---
*This is an automated review by Jido AI agents. Please review the suggestions and apply improvements as appropriate.*

To run locally:
\`\`\`bash
mix jido.grade --interactive
\`\`\`
`;

// Post comment on PR
github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: body
});

grade-check:
runs-on: ubuntu-latest
name: Code Quality Gate

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
elixir-version: '1.17'
otp-version: '27'

- name: Restore dependencies cache
uses: actions/cache@v3
with:
path: |
deps
_build
key: ${{ runner.os}}-mix-${{ hashFiles('**/mix.lock') }}
restore-keys: ${{ runner.os }}-mix-

- name: Install dependencies
run: mix deps.get

- name: Compile
run: mix compile

- name: Run quality gate
run: |
# Run with threshold of 70 (configurable)
mix jido.grade --threshold 70
continue-on-error: true
# Allow PR to proceed even if quality gate fails
# But the check status will show the failure
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,6 @@ Thumbs.db

# Observability
/observability/grafana/provisioning/

# Dialyzer
/priv/plts/
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,15 @@ smoke: ## Run smoke tests

livebook: ## Start Livebook server
livebook server --home livebooks/

jido-grade: ## Grade current code with Jido AI
mix jido.grade

jido-grade-interactive: ## Grade with detailed interactive feedback
mix jido.grade --interactive

jido-ask: ## Ask Jido a question (usage: make jido-ask QUESTION="What is recursion?")
mix jido.ask "$(QUESTION)"

jido-scaffold: ## Scaffold a new project (usage: make jido-scaffold TYPE=genserver NAME=Counter PHASE=3)
mix jido.scaffold --type $(TYPE) --name $(NAME) --phase $(PHASE)
42 changes: 42 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,48 @@ make livebook

See `livebooks/README.md` for more details.

## 🤖 AI-Powered Learning with Jido

> ✅ **Fully Functional:** The Jido integration uses the real Jido v1.0 framework with LLM-powered AI responses for enhanced learning. See `apps/labs_jido_agent/README.md` for details.

This repository integrates the **Jido AI Agent Framework** for enhanced learning:

```bash
# Get AI help with Elixir concepts
make jido-ask QUESTION="What is tail recursion?"

# Grade your code with AI review
make jido-grade

# Interactive detailed feedback
make jido-grade-interactive

# Scaffold new projects with best practices
make jido-scaffold TYPE=genserver NAME=Counter PHASE=3
```

**AI Agents Available:**

- **Code Review Agent** - Analyzes code quality, finds issues, suggests improvements
- **Study Buddy Agent** - Answers questions about Elixir concepts (explain/socratic/example modes)
- **Progress Coach Agent** - Analyzes learning progress, provides personalized recommendations
- **Jido Assistant** - Livebook Smart Cell for interactive help while coding

**Example Usage:**

```bash
# Ask a question
mix jido.ask "How do I use pattern matching?"

# Grade your Phase 1 code
mix jido.grade --phase 1 --interactive

# Scaffold a new GenServer project
mix jido.scaffold --type genserver --name UserCache --phase 3 --features ttl,telemetry
```

See `apps/labs_jido_agent/README.md` and `livebooks/phase-15-ai/` for complete documentation.

## 📚 Documentation

- **[Roadmap](docs/roadmap.md)** - Learning phases and milestones
Expand Down
18 changes: 18 additions & 0 deletions apps/labs_jido_agent/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# LLM Provider Configuration
# Choose one: openai, anthropic, or gemini
LLM_PROVIDER=openai

# OpenAI Configuration
# Get your API key from: https://platform.openai.com/api-keys
OPENAI_API_KEY=sk-proj-...

# Anthropic Configuration
# Get your API key from: https://console.anthropic.com/settings/keys
ANTHROPIC_API_KEY=sk-ant-...

# Google Gemini Configuration
# Get your API key from: https://aistudio.google.com/app/apikey
GEMINI_API_KEY=...

# Note: You only need to set the API key for the provider you're using.
# The system will automatically fall back to simulated mode if no API key is configured.
Loading
Loading