| Crates.io | organizational-intelligence-plugin |
| lib.rs | organizational-intelligence-plugin |
| version | 0.3.2 |
| created_at | 2025-11-15 15:58:53.579374+00 |
| updated_at | 2026-01-12 23:06:18.037834+00 |
| description | Organizational Intelligence Plugin - Defect pattern analysis for GitHub organizations |
| homepage | |
| repository | https://github.com/paiml/organizational-intelligence-plugin |
| max_upload_size | |
| id | 1934500 |
| size | 2,403,267 |
A plugin for pmat that analyzes GitHub organizations to detect defect patterns, measure code quality, and generate actionable intelligence for software development teams.
Organizational Intelligence Plugin (OIP) mines Git history and integrates with pmat's Technical Debt Gradient (TDG) analysis to:
✅ Phase 1 - Core Analysis (oip analyze)
✅ Phase 2 - Summarization (oip summarize)
✅ Phase 3 - PR Review (oip review-pr)
🚀 Phase 1 GPU Extension (oip-gpu) - NEW!
🔌 First-Class pmat Plugin - NEW!
pmat demo-score --with-oipThis tool is built following Toyota Production System principles:
git clone https://github.com/paiml/organizational-intelligence-plugin
cd organizational-intelligence-plugin
cargo build --release
# Binary available at target/release/oip
export PATH=$PATH:$(pwd)/target/release
cargo install organizational-intelligence-plugin
# Create a GitHub Personal Access Token at:
# https://github.com/settings/tokens
# Required scopes: repo (for private repos) or public_repo (for public only)
export GITHUB_TOKEN=ghp_your_token_here
# Add to ~/.bashrc or ~/.zshrc for persistence
echo 'export GITHUB_TOKEN=ghp_your_token_here' >> ~/.bashrc
# 1. Analyze your organization
oip analyze --org YOUR_ORG --output analysis.yaml
# 2. Generate privacy-safe summary
oip summarize --input analysis.yaml --output summary.yaml --strip-pii
# 3. Review a PR (requires baseline)
oip review-pr --baseline summary.yaml --files src/config.rs,src/auth.rs
# Analyze all repositories in an organization
oip analyze --org paiml --output paiml-analysis.yaml
# With verbose logging
oip analyze --org paiml --output paiml-analysis.yaml --verbose
# Limit concurrent analysis (default: 10)
oip analyze --org paiml --output paiml-analysis.yaml --max-concurrent 5
Output: YAML report with:
# Generate privacy-safe summary
oip summarize \
--input analysis.yaml \
--output summary.yaml \
--strip-pii \
--top-n 10 \
--min-frequency 5
# Include anonymized examples
oip summarize \
--input analysis.yaml \
--output summary.yaml \
--strip-pii \
--include-examples
Output: Clean YAML with:
# One-time: Create baseline (run weekly)
oip analyze --org myorg --output baseline.yaml
oip summarize --input baseline.yaml --output baseline-summary.yaml
# On every PR: Fast review (<30s)
oip review-pr \
--baseline baseline-summary.yaml \
--files src/config.rs,src/auth.rs \
--format markdown \
--output pr-review.md
# Output to stdout for CI integration
oip review-pr \
--baseline baseline-summary.yaml \
--files $(git diff --name-only HEAD~1) \
--format json
# Analyze repository with GPU-accelerated features
oip-gpu analyze --repo rust-lang/rust --output features.db
# Run performance benchmarks
oip-gpu benchmark --suite all
# Force SIMD backend (CPU)
oip-gpu analyze --repo owner/repo --backend simd --output out.db
Output: Feature vectors ready for GPU correlation analysis
See GPU Quick Start for detailed examples.
Output: Context-aware warnings based on organizational defect patterns
# Generate current analysis
oip analyze --org myorg --output sprint-data.yaml
# Identify high-priority technical debt
# (High frequency + Low TDG score = urgent refactoring needed)
cat sprint-data.yaml | grep -A10 "frequency: 2[0-9]"
#!/bin/bash
# weekly-baseline.sh - Run via cron every Monday
export GITHUB_TOKEN=your_token
ORG=myorg
DATE=$(date +%Y-%m-%d)
oip analyze --org $ORG --output "baselines/full-$DATE.yaml"
oip summarize \
--input "baselines/full-$DATE.yaml" \
--output "baselines/summary-$DATE.yaml" \
--strip-pii
echo "✅ Baseline updated: baselines/summary-$DATE.yaml"
# .github/workflows/pr-review.yml
name: Organizational Intelligence PR Review
on: [pull_request]
jobs:
review:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install OIP
run: cargo install organizational-intelligence-plugin
- name: Review PR
run: |
FILES=$(gh pr diff ${{ github.event.pull_request.number }} --name-only | tr '\n' ',')
oip review-pr \
--baseline .oip/baseline.yaml \
--files "$FILES" \
--format markdown
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OIP integrates as a first-class plugin with pmat's demo-score command for educational repositories:
# Score a demo/book repository with OIP analysis (default when OIP installed)
pmat demo-score --with-oip
# OIP provides additional insights:
# - Tarantula SBFL: Fault localization for failing example tests
# - SZZ Analysis: Trace bug-introducing commits in examples
# - Historical Trends: Quality score evolution over time
# - Defect Classification: Pattern detection in example code
# Disable OIP integration
pmat demo-score --no-oip
# OIP-specific analysis modes
pmat demo-score --oip-analysis fault-localization
pmat demo-score --oip-analysis defect-patterns
pmat demo-score --oip-analysis historical-trends
Configuration (~/.config/pmat/config.toml):
[oip]
enabled = true # Auto-enable when oip binary found in PATH
binary_path = "oip" # Custom path to OIP binary
fault_localization = true # Enable Tarantula SBFL
szz_analysis = true # Enable bug origin tracing
trend_tracking = true # Enable historical analysis
See the Demo/Book Scoring Specification for full details.
make help # Show all available targets
make lint # Quick lint check
make test-fast # Fast unit tests (<5s)
make test-all # All tests including integration
make coverage # Generate HTML coverage report
make build # Build release binary
All code must pass:
make lint - No clippy warningsmake test-fast - All unit tests passmake coverage - 85%+ line coverage (currently: 86.65% ✅)organizational-intelligence-plugin/
├── src/
│ ├── analyzer.rs # Organization analysis orchestration
│ ├── classifier.rs # Defect pattern classification (10 categories)
│ ├── cli.rs # Command-line interface (clap)
│ ├── git.rs # Git history mining
│ ├── github.rs # GitHub API integration (octocrab)
│ ├── pmat.rs # pmat TDG integration
│ ├── pr_reviewer.rs # PR review with stateful baselines
│ ├── report.rs # YAML report generation
│ ├── summarizer.rs # PII stripping and summarization
│ └── main.rs # Entry point
├── tests/
│ └── cli_tests.rs # CLI integration tests
├── docs/
│ └── how-to-integrate-as-plugin-with-pmat-improve-prompts-spec.md
├── Makefile # Development workflow automation
└── Cargo.toml # Rust dependencies
# Fast unit tests (recommended for development)
make test-fast
# All tests including network integration tests
make test-all
# Coverage report with HTML output
make coverage
make coverage-open # Opens in browser
git checkout -b feature/amazing-feature)make lint && make test-fastfeat:, fix:, docs:, etc.)Code Standards:
pmat demo-scoreSee docs/how-to-integrate-as-plugin-with-pmat-improve-prompts-spec.md for detailed design specifications.
Problem: API rate limit exceeded for...
Solution: Set GITHUB_TOKEN environment variable
export GITHUB_TOKEN=ghp_your_token_here
Problem: pmat analyze tdg fails
Solution: Install pmat
cargo install pmat
Problem: Analyzing large organizations is slow
Solution: Reduce max-concurrent flag
oip analyze --org large-org --output report.yaml --max-concurrent 3
This project is licensed under the MIT License - see the LICENSE file for details.
If you use this tool in your research, please cite:
@software{organizational_intelligence_plugin,
title = {Organizational Intelligence Plugin},
author = {paiml},
year = {2025},
url = {https://github.com/paiml/organizational-intelligence-plugin},
note = {A plugin for pmat that analyzes GitHub organizations for defect patterns}
}
Status: Phase 1-3 Complete | Grade: TDG 96.4/100 (A+) | Coverage: 86.65% (422 tests) ✅
Built with ❤️ following the Toyota Way