@boshu2/vibe-check 2.3.0 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/.agents/plans/2025-12-29-complexity-driver-plan.md +225 -0
  2. package/.agents/plans/2025-12-29-complexity-drivers-plan.md +253 -0
  3. package/.agents/research/2025-12-29-complexity-driver-architecture.md +392 -0
  4. package/.agents/research/2025-12-29-complexity-drivers.md +227 -0
  5. package/.beads/issues.jsonl +12 -0
  6. package/CHANGELOG.md +27 -0
  7. package/README.md +71 -0
  8. package/dist/analyzers/complexity.d.ts +92 -0
  9. package/dist/analyzers/complexity.d.ts.map +1 -0
  10. package/dist/analyzers/complexity.js +79 -0
  11. package/dist/analyzers/complexity.js.map +1 -0
  12. package/dist/analyzers/modularity.d.ts +3 -1
  13. package/dist/analyzers/modularity.d.ts.map +1 -1
  14. package/dist/analyzers/modularity.js +32 -6
  15. package/dist/analyzers/modularity.js.map +1 -1
  16. package/dist/cli.js +2 -1
  17. package/dist/cli.js.map +1 -1
  18. package/dist/commands/driver.d.ts +18 -0
  19. package/dist/commands/driver.d.ts.map +1 -0
  20. package/dist/commands/driver.js +58 -0
  21. package/dist/commands/driver.js.map +1 -0
  22. package/dist/commands/index.d.ts +1 -0
  23. package/dist/commands/index.d.ts.map +1 -1
  24. package/dist/commands/index.js +1 -0
  25. package/dist/commands/index.js.map +1 -1
  26. package/dist/commands/modularity.d.ts +2 -0
  27. package/dist/commands/modularity.d.ts.map +1 -1
  28. package/dist/commands/modularity.js +86 -7
  29. package/dist/commands/modularity.js.map +1 -1
  30. package/drivers/README.md +327 -0
  31. package/drivers/go.sh +131 -0
  32. package/drivers/java.sh +137 -0
  33. package/drivers/javascript.sh +134 -0
  34. package/drivers/php.sh +132 -0
  35. package/drivers/python.sh +90 -0
  36. package/drivers/rust.sh +132 -0
  37. package/package.json +1 -1
@@ -1,9 +1,21 @@
1
+ {"id":"vibe-check-1qb","title":"Create JavaScript/TypeScript driver","status":"closed","priority":2,"issue_type":"feature","created_at":"2025-12-29T15:44:12.584697-05:00","created_by":"fullerbt","updated_at":"2025-12-29T16:30:56.020994-05:00","closed_at":"2025-12-29T16:30:56.020994-05:00","close_reason":"Completed JavaScript/TypeScript driver using cyclomatic-complexity tool. Supports both JS and TS, integrated with CLI, all tests passing.","comments":[{"id":13,"issue_id":"vibe-check-1qb","author":"fullerbt","text":"Will use complexity-report tool (wraps escomplex). Output structure:\n- reports[0].functions[] contains function-level metrics\n- reports[0].path contains file path\n- Need to transform to match ComplexityReport schema","created_at":"2025-12-29T21:24:58Z"},{"id":14,"issue_id":"vibe-check-1qb","author":"fullerbt","text":"BLOCKER: complexity-report doesn't handle TypeScript files - hangs during analysis. Need alternative approach:\n1. Use typescript-complexity or ts-complexity\n2. Or transpile TS-\u003eJS first\n3. Or skip .ts files and only analyze .js/.jsx","created_at":"2025-12-29T21:26:20Z"},{"id":15,"issue_id":"vibe-check-1qb","author":"fullerbt","text":"✓ Switched to cyclomatic-complexity tool (supports both JS and TS)\n✓ Driver successfully analyzes vibe-check codebase: 81 files, 1409 functions, avg 3.8 complexity\n✓ Output matches ComplexityReport schema\nReady for integration testing","created_at":"2025-12-29T21:28:14Z"},{"id":16,"issue_id":"vibe-check-1qb","author":"fullerbt","text":"✓ COMPLETED\n- Created drivers/javascript.sh using cyclomatic-complexity tool\n- Supports both JavaScript and TypeScript files\n- Updated CLI commands (driver.ts, modularity.ts) with ESM __dirname compatibility\n- Updated documentation (drivers/README.md, README.md)\n- All tests passing (163 passed)\n- Tested: driver subcommand, modularity --with-complexity javascript","created_at":"2025-12-29T21:30:50Z"}]}
2
+ {"id":"vibe-check-1yr","title":"Create Java complexity driver","description":"Wrap PMD to produce ComplexityReport JSON. JSON output via '-f json' flag. Requires JRE. Install: download PMD JAR from pmd.github.io","status":"closed","priority":2,"issue_type":"feature","created_at":"2025-12-29T16:48:19.421973-05:00","created_by":"fullerbt","updated_at":"2025-12-29T17:11:49.527974-05:00","closed_at":"2025-12-29T17:11:49.527974-05:00","close_reason":"Completed Java driver using PMD. Parses violations JSON, extracts complexity via regex, transforms to ComplexityReport schema. CLI and docs updated.","comments":[{"id":19,"issue_id":"vibe-check-1yr","author":"fullerbt","text":"Files: drivers/java.sh, drivers/README.md, README.md, src/commands/*.ts\nTool: pmd check -d /path -R category/java/design.xml -f json\nInstall: Download PMD JAR (requires JRE)","created_at":"2025-12-29T21:48:56Z"},{"id":22,"issue_id":"vibe-check-1yr","author":"fullerbt","text":"✓ COMPLETED\n- Created drivers/java.sh wrapping PMD\n- Filters PMD JSON violations for CyclomaticComplexity rule\n- Uses jq regex capture to extract method name and complexity from description\n- Updated CLI integration (driver.ts, modularity.ts)\n- Updated documentation (drivers/README.md, README.md)\n- All tests passing (163 passed)\n\nNote: PMD only reports violations above threshold (default 10). Low-complexity methods won't appear. Requires JRE and PMD installed.","created_at":"2025-12-29T22:11:41Z"}]}
1
3
  {"id":"vibe-check-263","title":"Session end AI safety integration","description":"Integrate AI safety analysis into session end command. Add ai_safety section to JSON output. Show warnings in terminal output with recommendations.","status":"closed","priority":1,"issue_type":"feature","created_at":"2025-12-28T12:07:22.458246-05:00","created_by":"fullerbt","updated_at":"2025-12-28T12:32:10.15324-05:00","closed_at":"2025-12-28T12:32:10.15324-05:00","close_reason":"Completed: AI safety integrated into session end. JSON output includes ai_safety section. Terminal shows warnings and recommendations. Follows inner-loop pattern.","dependencies":[{"issue_id":"vibe-check-263","depends_on_id":"vibe-check-swh","type":"blocks","created_at":"2025-12-28T12:07:42.272223-05:00","created_by":"daemon"}],"comments":[{"id":6,"issue_id":"vibe-check-263","author":"fullerbt","text":"✅ Implementation complete:\n\nUpdated src/commands/session.ts:\n- Imported analyzeAISafety and formatAISafetyAnalysis from ai-safety module\n- Added ai_safety field to SessionMetricsOutput interface\n- Integrated AI safety analysis in runSessionEnd() (parallel with inner-loop)\n- Added ai_safety section to JSON output with:\n - health: 'healthy' | 'warning' | 'critical'\n - issues_detected, secrets_leaked, scope_violations counts\n - contract_drift_detected, token_spiral_detected booleans\n - recommendations array\n- Added terminal output showing:\n - Health status with emoji (🚨/⚠️/✅)\n - Individual detector messages (🔐/🎯/📉/💥)\n - Top 3 recommendations\n- Follows exact same pattern as inner-loop integration\n\nTesting:\n- Build passes ✅\n- Session start/end commands work ✅\n- JSON output structure confirmed (no commits = expected behavior)","created_at":"2025-12-28T17:32:04Z"}]}
2
4
  {"id":"vibe-check-56v","title":"Contract drift detector","description":"Track commit message format compliance over time. Detect degradation from conventional commits. Report drift percentage and trend. Warning at \u003e30% drift.","status":"closed","priority":2,"issue_type":"feature","created_at":"2025-12-28T12:07:24.054553-05:00","created_by":"fullerbt","updated_at":"2025-12-28T13:21:58.451526-05:00","closed_at":"2025-12-28T13:21:58.451526-05:00","close_reason":"Contract drift detector with compliance scoring and trend detection","dependencies":[{"issue_id":"vibe-check-56v","depends_on_id":"vibe-check-ash","type":"blocks","created_at":"2025-12-28T12:07:42.336535-05:00","created_by":"daemon"}]}
5
+ {"id":"vibe-check-58i","title":"Create Go complexity driver","status":"closed","priority":2,"issue_type":"feature","created_at":"2025-12-29T16:32:18.00354-05:00","created_by":"fullerbt","updated_at":"2025-12-29T16:35:57.60124-05:00","closed_at":"2025-12-29T16:35:57.60124-05:00","close_reason":"Completed Go complexity driver using gocyclo. Supports all Go files, transforms text output to JSON, integrated with CLI."}
3
6
  {"id":"vibe-check-5s1","title":"Scope violation detector","description":"Detect commits touching files outside declared scope. Support scope config via .vibe-check/scope.yaml. Use glob patterns. Warning severity.","status":"closed","priority":2,"issue_type":"feature","created_at":"2025-12-28T12:07:23.888845-05:00","created_by":"fullerbt","updated_at":"2025-12-28T13:15:03.887086-05:00","closed_at":"2025-12-28T13:15:03.887086-05:00","close_reason":"Scope violation detector with YAML config and glob matching","dependencies":[{"issue_id":"vibe-check-5s1","depends_on_id":"vibe-check-ash","type":"blocks","created_at":"2025-12-28T12:07:42.3013-05:00","created_by":"daemon"}]}
7
+ {"id":"vibe-check-5vc","title":"Integrate complexity data into modularity scoring","status":"closed","priority":1,"issue_type":"feature","created_at":"2025-12-29T15:44:12.438929-05:00","created_by":"fullerbt","updated_at":"2025-12-29T16:03:31.509851-05:00","closed_at":"2025-12-29T16:03:31.509851-05:00","close_reason":"Completed: Complexity data integrated into modularity scoring with full test coverage","dependencies":[{"issue_id":"vibe-check-5vc","depends_on_id":"vibe-check-nk3","type":"blocks","created_at":"2025-12-29T15:44:22.517099-05:00","created_by":"daemon"}],"comments":[{"id":9,"issue_id":"vibe-check-5vc","author":"fullerbt","text":"COMPLETED: Integrated complexity data into modularity scoring\n\nModified Files:\n- src/analyzers/modularity.ts:\n - Added ComplexityReport import\n - Added 3 new ModularityFlag types: moderate-complexity, high-complexity, extreme-complexity\n - Updated ModularityOptions to accept optional complexityData parameter\n - Updated analyzeFile() to accept and pass complexityData\n - Updated calculateScore() to apply complexity-based scoring:\n - Grade A/B: +2 bonus\n - Grade C: -1 penalty, moderate-complexity flag\n - Grade D/E: -2 penalty, high-complexity flag\n - Grade F: -4 penalty, extreme-complexity flag\n - Updated analyzeModularity() to pass complexity data through call chain\n\nCreated Files:\n- tests/modularity-complexity.test.ts (6 tests, all passing)\n\nTest Results:\n- All 163 tests pass\n- Backwards compatible: works without complexity data\n- Correctly applies bonuses/penalties based on grades\n- Handles missing files in complexity report gracefully","created_at":"2025-12-29T21:03:23Z"}]}
8
+ {"id":"vibe-check-88z","title":"Create PHP complexity driver","description":"Wrap PHPMD to produce ComplexityReport JSON. Native JSON output via 'phpmd /path json codesize'. Install: composer global require phpmd/phpmd","status":"closed","priority":2,"issue_type":"feature","created_at":"2025-12-29T16:48:12.741187-05:00","created_by":"fullerbt","updated_at":"2025-12-29T16:59:31.035948-05:00","closed_at":"2025-12-29T16:59:31.035948-05:00","close_reason":"Completed PHP driver using PHPMD. Parses violations JSON, extracts complexity via regex, transforms to ComplexityReport schema. CLI and docs updated.","comments":[{"id":18,"issue_id":"vibe-check-88z","author":"fullerbt","text":"Files: drivers/php.sh, drivers/README.md, README.md, src/commands/*.ts\nTool: phpmd /path/to/src json codesize\nInstall: composer global require phpmd/phpmd","created_at":"2025-12-29T21:48:46Z"},{"id":21,"issue_id":"vibe-check-88z","author":"fullerbt","text":"✓ COMPLETED\n- Created drivers/php.sh wrapping PHPMD\n- Extracts cyclomatic complexity violations from PHPMD JSON output\n- Uses jq regex capture to parse complexity from description text\n- Updated CLI integration (driver.ts, modularity.ts)\n- Updated documentation (drivers/README.md, README.md)\n- All tests passing (163 passed)\n\nNote: PHPMD only reports violations (methods above threshold), so low-complexity methods won't appear in output. This is expected behavior.","created_at":"2025-12-29T21:59:22Z"}]}
9
+ {"id":"vibe-check-8no","title":"Create Rust complexity driver","description":"Wrap rust-code-analysis-cli to produce ComplexityReport JSON. Native JSON output makes this simplest to implement. Follow pattern from python.sh/javascript.sh/go.sh","status":"closed","priority":1,"issue_type":"feature","created_at":"2025-12-29T16:48:05.624738-05:00","created_by":"fullerbt","updated_at":"2025-12-29T16:53:15.011168-05:00","closed_at":"2025-12-29T16:53:15.011168-05:00","close_reason":"Completed Rust driver using rust-code-analysis-cli. Wraps tool output, merges multi-file JSONs, transforms to ComplexityReport schema. CLI and docs updated.","comments":[{"id":17,"issue_id":"vibe-check-8no","author":"fullerbt","text":"Files to modify:\n- drivers/rust.sh (new)\n- drivers/README.md (add Rust section)\n- README.md (add Rust to Available Drivers)\n- src/commands/driver.ts (update available list)\n- src/commands/modularity.ts (update available list)\n\nTool: rust-code-analysis-cli -m -O json -p /path/to/src\nInstall: cargo install rust-code-analysis-cli\nPattern: Follow python.sh/javascript.sh/go.sh","created_at":"2025-12-29T21:48:40Z"},{"id":20,"issue_id":"vibe-check-8no","author":"fullerbt","text":"✓ COMPLETED\n- Created drivers/rust.sh wrapping rust-code-analysis-cli\n- Handles temp dir for multi-file JSON outputs, merges with jq\n- Updated CLI integration (driver.ts, modularity.ts)\n- Updated documentation (drivers/README.md, README.md)\n- All tests passing (163 passed)\n- Build successful\n\nNote: Driver tested with design but not against actual Rust code (cargo not available in environment). User will need to test with actual Rust codebase.","created_at":"2025-12-29T21:53:04Z"}]}
10
+ {"id":"vibe-check-8zt","title":"Add CLI complexity flags (--with-complexity, driver subcommand)","status":"closed","priority":2,"issue_type":"feature","created_at":"2025-12-29T15:44:12.537306-05:00","created_by":"fullerbt","updated_at":"2025-12-29T16:15:25.573766-05:00","closed_at":"2025-12-29T16:15:25.573766-05:00","close_reason":"Completed: CLI complexity flags with driver subcommand and integration options","dependencies":[{"issue_id":"vibe-check-8zt","depends_on_id":"vibe-check-5vc","type":"blocks","created_at":"2025-12-29T15:44:22.571068-05:00","created_by":"daemon"},{"issue_id":"vibe-check-8zt","depends_on_id":"vibe-check-9th","type":"blocks","created_at":"2025-12-29T15:44:22.599196-05:00","created_by":"daemon"}],"comments":[{"id":11,"issue_id":"vibe-check-8zt","author":"fullerbt","text":"COMPLETED: Added CLI complexity flags for driver integration\n\nModified Files:\n- src/commands/modularity.ts:\n - Added --with-complexity \u003clang\u003e option (runs driver, saves to .vibe-check/complexity.json)\n - Added --complexity-file \u003cpath\u003e option (loads existing complexity data)\n - Added runComplexityDriver() function (uses execFile for security)\n - Added loadComplexityFromFile() function\n - Updated printTerminalOutput() to show complexity integration status\n - Added flag labels for moderate/high/extreme complexity\n- src/cli.ts:\n - Added createDriverCommand import and registration\n\nCreated Files:\n- src/commands/driver.ts:\n - New 'driver' subcommand for running drivers directly\n - Usage: vibe-check driver python ./src \u003e complexity.json\n - Uses execFile (secure, no shell injection)\n - Outputs JSON to stdout for piping\n\n- src/commands/index.ts:\n - Exported createDriverCommand and runDriver\n\nTest Results:\n- All 163 tests pass\n- Build succeeds without errors\n- Help text verified for both commands\n\nAcceptance Criteria Met:\n✅ --with-complexity runs driver, saves to .vibe-check/complexity.json\n✅ --complexity-file uses existing file\n✅ driver subcommand outputs to stdout\n✅ Help text updated\n✅ Uses execFile (secure) instead of exec","created_at":"2025-12-29T21:15:19Z"}]}
11
+ {"id":"vibe-check-9th","title":"Create Python driver (radon wrapper)","status":"closed","priority":1,"issue_type":"feature","created_at":"2025-12-29T15:44:12.487081-05:00","created_by":"fullerbt","updated_at":"2025-12-29T16:09:48.351483-05:00","closed_at":"2025-12-29T16:09:48.351483-05:00","close_reason":"Completed: Python driver (radon wrapper) with full error handling and documentation","comments":[{"id":10,"issue_id":"vibe-check-9th","author":"fullerbt","text":"COMPLETED: Created Python driver (radon wrapper)\n\nCreated Files:\n- drivers/python.sh (executable shell script)\n - Checks radon is installed, exits 1 with JSON error if not\n - Runs 'radon cc' with JSON output\n - Transforms with jq to standard ComplexityReport schema\n - Handles empty directories (outputs empty files object)\n - Handles missing directories (exits 1 with error JSON)\n- drivers/README.md\n - Documents driver architecture and contract\n - Shows standard schema and grade thresholds\n - Provides usage examples and template for new drivers\n\nManual Testing Results:\n- Tested with sample Python file (3 functions, complexity 1-7)\n- Output validates against ComplexityReport schema\n- Error handling works (missing radon, missing directory)\n- Empty directory handling works\n- Grade calculation correct (avg 4 = grade A)\n\nAcceptance Criteria Met:\n✅ Exits 0 on success\n✅ Exits 1 with error JSON if radon not installed\n✅ Output validates against schema\n✅ Handles empty directories gracefully","created_at":"2025-12-29T21:09:42Z"}]}
12
+ {"id":"vibe-check-9yp","title":"Document driver architecture in README","status":"closed","priority":2,"issue_type":"task","created_at":"2025-12-29T15:44:12.631846-05:00","created_by":"fullerbt","updated_at":"2025-12-29T16:18:55.698064-05:00","closed_at":"2025-12-29T16:18:55.698064-05:00","close_reason":"Completed: Driver architecture documented in main README with examples and architecture diagram","dependencies":[{"issue_id":"vibe-check-9yp","depends_on_id":"vibe-check-8zt","type":"blocks","created_at":"2025-12-29T15:44:22.654954-05:00","created_by":"daemon"}],"comments":[{"id":12,"issue_id":"vibe-check-9yp","author":"fullerbt","text":"COMPLETED: Documented driver architecture in main README\n\nModified Files:\n- README.md:\n - Added 'Complexity Analysis (v2.3.0)' subsection under 'Code Quality'\n - Quick start examples for all three usage patterns:\n - --with-complexity python (run driver + analysis)\n - --complexity-file \u003cpath\u003e (use existing data)\n - driver subcommand (generate data only)\n - Driver architecture diagram (kernel ← drivers ← tools)\n - Complexity grading table with score impacts\n - Available drivers list (Python + coming soon)\n - Example output showing complexity integration\n - Links to drivers/README.md for authoring guide\n\nDocumentation Structure:\n1. Quick Start (3 usage patterns)\n2. How It Works (architecture diagram)\n3. Complexity Grading (A-F with score impacts)\n4. Available Drivers (Python + roadmap)\n5. Example Output (terminal output with complexity flags)\n\nAcceptance Criteria Met:\n✅ README shows basic usage\n✅ Documents all three CLI patterns\n✅ Explains driver architecture\n✅ Shows complexity grading system\n✅ Links to drivers/README.md for details\n✅ Positioned in Code Quality section (logical location)","created_at":"2025-12-29T21:18:48Z"}]}
4
13
  {"id":"vibe-check-ash","title":"AI Safety types and orchestrator","description":"Create src/ai-safety/types.ts and src/ai-safety/index.ts. Define AISafetyAnalysis interface matching inner-loop pattern. Foundation for all other detectors.","status":"closed","priority":0,"issue_type":"feature","created_at":"2025-12-28T12:07:20.710124-05:00","created_by":"fullerbt","updated_at":"2025-12-28T12:12:30.564652-05:00","closed_at":"2025-12-28T12:12:30.564652-05:00","close_reason":"Completed: AI Safety types and orchestrator foundation. Created types.ts with all interfaces and index.ts with orchestrator following inner-loop pattern. Build passes.","dependencies":[{"issue_id":"vibe-check-ash","depends_on_id":"vibe-check-lqb","type":"blocks","created_at":"2025-12-28T12:07:42.213339-05:00","created_by":"daemon"}],"comments":[{"id":2,"issue_id":"vibe-check-ash","author":"fullerbt","text":"Files to create:\n- src/ai-safety/types.ts\n- src/ai-safety/index.ts\n\nPattern: Follow src/inner-loop/ structure exactly","created_at":"2025-12-28T17:07:57Z"},{"id":4,"issue_id":"vibe-check-ash","author":"fullerbt","text":"✅ Implementation complete:\n\nCreated src/ai-safety/types.ts:\n- AISafetyAnalysis interface (matches inner-loop pattern)\n- 4 detector result types: SecretLeakageResult, ScopeViolationResult, ContractDriftResult, TokenSpiralResult\n- Config types with DEFAULT_AI_SAFETY_CONFIG\n- SECRET_PATTERNS constants for 8 secret types\n\nCreated src/ai-safety/index.ts:\n- analyzeAISafety() orchestrator function\n- generateRecommendations() helper\n- quickAISafetyCheck() fast check function\n- formatAISafetyAnalysis() terminal output formatter\n- Stub implementations for all detectors (to be filled by dependent issues)\n\nBuild verified: npm run build passes ✅","created_at":"2025-12-28T17:12:18Z"}]}
14
+ {"id":"vibe-check-blw","title":"Add complexity driver architecture for language-specific tools","status":"closed","priority":1,"issue_type":"epic","created_at":"2025-12-29T15:43:52.020758-05:00","created_by":"fullerbt","updated_at":"2025-12-29T16:20:04.291733-05:00","closed_at":"2025-12-29T16:20:04.291733-05:00","close_reason":"Epic completed: Complexity driver architecture fully implemented with Python driver, CLI integration, and documentation. JavaScript driver remains as future enhancement (P2).","comments":[{"id":7,"issue_id":"vibe-check-blw","author":"fullerbt","text":"## Overview\nEnable vibe-check to consume complexity metrics from language-specific tools (radon, gocyclo, complexity-report) via a driver/plugin architecture.\n\n## Research\nSee: .agents/research/2025-12-29-complexity-driver-architecture.md\n\n## Plan\nSee: .agents/plans/2025-12-29-complexity-driver-plan.md\n\n## Why\nLine count is a poor proxy for code quality. Real cyclomatic complexity tells us if code is actually hard to test/maintain.\n\n## Architecture\n- vibe-check stays language-agnostic (kernel)\n- Drivers wrap language tools and output standard JSON schema\n- Modularity analyzer reads .vibe-check/complexity.json if present","created_at":"2025-12-29T20:44:02Z"}]}
5
15
  {"id":"vibe-check-gon","title":"Token spiral estimator","description":"Estimate token usage from commit size (~4 chars/token). Track cumulative session tokens. Detect explosion patterns (\u003e2x baseline). Advisory info severity.","status":"closed","priority":3,"issue_type":"feature","created_at":"2025-12-28T12:07:25.111778-05:00","created_by":"fullerbt","updated_at":"2025-12-28T13:27:24.916118-05:00","closed_at":"2025-12-28T13:27:24.916118-05:00","close_reason":"Token spiral estimator with 3 estimation methods and explosion detection","dependencies":[{"issue_id":"vibe-check-gon","depends_on_id":"vibe-check-ash","type":"blocks","created_at":"2025-12-28T12:07:42.370654-05:00","created_by":"daemon"}]}
6
16
  {"id":"vibe-check-gy2","title":"Watch command AI safety integration","description":"Add real-time secret detection alerts to watch mode. Red/bold for critical. Show file and pattern matched. Rate-limited alerts.","status":"closed","priority":2,"issue_type":"feature","created_at":"2025-12-28T12:07:26.399789-05:00","created_by":"fullerbt","updated_at":"2025-12-28T13:08:55.854894-05:00","closed_at":"2025-12-28T13:08:55.854894-05:00","close_reason":"Watch mode now detects secrets in real-time with rate-limited alerts","dependencies":[{"issue_id":"vibe-check-gy2","depends_on_id":"vibe-check-swh","type":"blocks","created_at":"2025-12-28T12:07:42.399267-05:00","created_by":"daemon"}]}
7
17
  {"id":"vibe-check-lqb","title":"Epic: AI Safety Detection Module","status":"closed","priority":1,"issue_type":"epic","created_at":"2025-12-28T12:07:01.674933-05:00","created_by":"fullerbt","updated_at":"2025-12-28T12:08:14.746447-05:00","closed_at":"2025-12-28T12:08:14.746447-05:00","close_reason":"Epic container - work tracked in child issues","comments":[{"id":1,"issue_id":"vibe-check-lqb","author":"fullerbt","text":"Research: .agents/research/2025-12-28-ai-platform-security-integration.md\nPlan: .agents/plans/2025-12-28-ai-safety-integration-plan.md\nSource patterns: ai-platform/tests/agents/test_agent_security.py","created_at":"2025-12-28T17:07:56Z"}]}
18
+ {"id":"vibe-check-nk3","title":"Add complexity schema types and loader function","status":"closed","priority":1,"issue_type":"feature","created_at":"2025-12-29T15:44:12.39308-05:00","created_by":"fullerbt","updated_at":"2025-12-29T15:51:24.559741-05:00","closed_at":"2025-12-29T15:51:24.559741-05:00","close_reason":"Completed: Complexity schema types and loader function implemented with full test coverage","comments":[{"id":8,"issue_id":"vibe-check-nk3","author":"fullerbt","text":"COMPLETED: Created src/analyzers/complexity.ts with:\n- ComplexityReport schema (tool, language, files, summary)\n- FunctionComplexity and FileComplexity types\n- ComplexityGrade type (A-F)\n- loadComplexityData() function (graceful null on missing/invalid)\n- getFileComplexity() helper\n- complexityToGrade() converter\n- Full test coverage in tests/complexity.test.ts (12 tests, all passing)\n- TypeScript compilation verified","created_at":"2025-12-29T20:51:17Z"}]}
19
+ {"id":"vibe-check-no1","title":"Epic: Additional Complexity Drivers","status":"closed","priority":1,"issue_type":"epic","created_at":"2025-12-29T16:47:52.844188-05:00","created_by":"fullerbt","updated_at":"2025-12-29T17:12:20.339182-05:00","closed_at":"2025-12-29T17:12:20.339182-05:00","close_reason":"Epic completed: All 3 complexity drivers implemented (Rust, PHP, Java). vibe-check now supports 6 languages total."}
8
20
  {"id":"vibe-check-swh","title":"Secret leakage detector","description":"Detect exposed secrets in commit diffs: OpenAI keys, GitHub PATs, GitLab PATs, AWS keys, Slack tokens. Port patterns from ai-platform test_agent_security.py. Critical severity.","status":"closed","priority":1,"issue_type":"feature","created_at":"2025-12-28T12:07:21.42346-05:00","created_by":"fullerbt","updated_at":"2025-12-28T12:18:57.212488-05:00","closed_at":"2025-12-28T12:18:57.212488-05:00","close_reason":"Completed: Secret leakage detector with 8 pattern types. Detects OpenAI, GitHub, GitLab, AWS, Slack tokens. Masks secrets, extracts file context. Tested and working.","dependencies":[{"issue_id":"vibe-check-swh","depends_on_id":"vibe-check-ash","type":"blocks","created_at":"2025-12-28T12:07:42.242965-05:00","created_by":"daemon"}],"comments":[{"id":3,"issue_id":"vibe-check-swh","author":"fullerbt","text":"Secret patterns to detect:\n- sk-[a-zA-Z0-9]{48} (OpenAI)\n- ghp_[a-zA-Z0-9]{36} (GitHub PAT)\n- glpat-[a-zA-Z0-9]{20} (GitLab PAT)\n- AKIA[0-9A-Z]{16} (AWS)\n- xox[baprs]-* (Slack)\n\nSource: ai-platform/tests/agents/test_agent_security.py:297-306","created_at":"2025-12-28T17:07:58Z"},{"id":5,"issue_id":"vibe-check-swh","author":"fullerbt","text":"✅ Implementation complete:\n\nCreated src/ai-safety/secret-leakage.ts:\n- detectSecretLeakage() - Async version that scans full commit diffs using simple-git\n- detectSecretLeakageFromMessages() - Sync version that scans commit messages only\n- Detects 8 secret patterns: OpenAI, GitHub PAT, GitLab PAT, AWS, Slack, Generic API keys, Secrets, Passwords\n- Masks secrets (shows first 8 chars + ***)\n- Extracts file context from diffs\n- Determines severity (critical vs warning)\n\nUpdated src/ai-safety/index.ts:\n- Imported and wired detectSecretLeakageFromMessages into orchestrator\n- Re-exported detector functions for external use\n- Replaced stub with real implementation\n\nTesting:\n- Build passes ✅\n- Verified with sample commit containing OpenAI key\n- Correctly detected, masked (sk-12345***), and marked as critical\n- Message-based detection working (1 secret found)","created_at":"2025-12-28T17:18:42Z"}]}
9
21
  {"id":"vibe-check-vn7","title":"AI Safety tests and documentation","description":"Unit tests for each detector, integration test for orchestrator. Update CLAUDE.md and README.md with AI safety features. Target \u003e80% coverage.","status":"closed","priority":2,"issue_type":"task","created_at":"2025-12-28T12:07:26.586099-05:00","created_by":"fullerbt","updated_at":"2025-12-28T13:35:48.191735-05:00","closed_at":"2025-12-28T13:35:48.191735-05:00","close_reason":"31 tests + documentation for AI Safety module","dependencies":[{"issue_id":"vibe-check-vn7","depends_on_id":"vibe-check-gon","type":"blocks","created_at":"2025-12-28T12:07:42.428834-05:00","created_by":"daemon"}]}
package/CHANGELOG.md CHANGED
@@ -7,6 +7,33 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [2.4.0] - 2025-12-29
11
+
12
+ ### Added
13
+
14
+ - **Complexity Driver Architecture** - Shell-based drivers for language-specific complexity analysis
15
+ - **Python Driver** (`drivers/python.sh`) - Wraps [radon](https://radon.readthedocs.io/) for cyclomatic complexity
16
+ - **JavaScript/TypeScript Driver** (`drivers/javascript.sh`) - Wraps [cyclomatic-complexity](https://github.com/pilotpirxie/cyclomatic-complexity)
17
+ - **Go Driver** (`drivers/go.sh`) - Wraps [gocyclo](https://github.com/fzipp/gocyclo)
18
+ - **Rust Driver** (`drivers/rust.sh`) - Wraps [rust-code-analysis](https://mozilla.github.io/rust-code-analysis/)
19
+ - **PHP Driver** (`drivers/php.sh`) - Wraps [PHPMD](https://phpmd.org/)
20
+ - **Java Driver** (`drivers/java.sh`) - Wraps [PMD](https://pmd.github.io/)
21
+ - All drivers output unified `ComplexityReport` JSON schema
22
+ - Grade thresholds: A (1-5), B (6-10), C (11-20), D (21-30), E (31-40), F (41+)
23
+
24
+ - **CLI Integration** - `vibe-check driver <language> [directory]` command
25
+ - Runs any driver and outputs JSON
26
+ - Helpful error messages when tools not installed
27
+
28
+ - **Modularity Integration** - `--with-complexity <driver>` flag for modularity command
29
+ - Combines complexity data with module analysis
30
+ - Weighted scoring includes complexity grades
31
+
32
+ ### Developer
33
+
34
+ - 6 shell drivers in `drivers/` directory
35
+ - `drivers/README.md` with installation and usage docs
36
+
10
37
  ## [2.3.0] - 2025-12-28
11
38
 
12
39
  ### Added
package/README.md CHANGED
@@ -222,6 +222,77 @@ vibe-check modularity --verbose # Detailed breakdown with metrics
222
222
  vibe-check modularity -f json # JSON output for CI integration
223
223
  ```
224
224
 
225
+ #### Complexity Analysis (v2.3.0)
226
+
227
+ Modularity analysis can now integrate **cyclomatic complexity** data from language-specific tools to identify truly problematic code—not just large files, but complex ones.
228
+
229
+ **Quick Start:**
230
+
231
+ ```bash
232
+ # Python projects (requires: pip install radon)
233
+ vibe-check modularity --with-complexity python
234
+
235
+ # Use existing complexity data
236
+ vibe-check modularity --complexity-file .vibe-check/complexity.json
237
+
238
+ # Generate complexity data only
239
+ vibe-check driver python ./src > complexity.json
240
+ ```
241
+
242
+ **How It Works:**
243
+
244
+ vibe-check uses a **driver architecture** to stay language-agnostic while leveraging language-specific complexity tools:
245
+
246
+ ```
247
+ vibe-check (kernel) ← reads .vibe-check/complexity.json
248
+
249
+ │ Standard JSON schema
250
+
251
+ Drivers (python, javascript, etc.)
252
+
253
+ │ Tool-specific format
254
+
255
+ Tools (radon, complexity-report, etc.)
256
+ ```
257
+
258
+ **Complexity Grading:**
259
+
260
+ All drivers normalize to standard grades:
261
+
262
+ | Grade | Complexity | Score Impact | Meaning |
263
+ |-------|------------|--------------|---------|
264
+ | A | 1-5 | **+2 bonus** | Simple, low risk |
265
+ | B | 6-10 | **+2 bonus** | Slightly complex, acceptable |
266
+ | C | 11-20 | **-1 penalty** | Complex, consider refactoring |
267
+ | D | 21-30 | **-2 penalty** | Very complex, refactor |
268
+ | E | 31-40 | **-2 penalty** | Extremely complex, high risk |
269
+ | F | 41+ | **-4 penalty** | Unmaintainable, must refactor |
270
+
271
+ **Available Drivers:**
272
+
273
+ - **Python** (`drivers/python.sh`) — wraps [radon](https://radon.readthedocs.io/)
274
+ - **JavaScript/TypeScript** (`drivers/javascript.sh`) — wraps [cyclomatic-complexity](https://github.com/pilotpirxie/cyclomatic-complexity)
275
+ - **Go** (`drivers/go.sh`) — wraps [gocyclo](https://github.com/fzipp/gocyclo)
276
+ - **Rust** (`drivers/rust.sh`) — wraps [rust-code-analysis](https://mozilla.github.io/rust-code-analysis/)
277
+ - **PHP** (`drivers/php.sh`) — wraps [PHPMD](https://phpmd.org/)
278
+ - **Java** (`drivers/java.sh`) — wraps [PMD](https://pmd.github.io/)
279
+
280
+ See `drivers/README.md` for driver authoring guide.
281
+
282
+ **Example Output:**
283
+
284
+ ```
285
+ 📐 Modularity Analysis
286
+ ────────────────────────────────────────────────────────────
287
+ Analyzed 47 files (12,453 lines)
288
+ Average modularity score: 7.2/10
289
+ ✓ Complexity data integrated
290
+
291
+ ⚠️ Files Needing Attention (3):
292
+ 5/10 src/sync.py 1,117 lines [store]
293
+ ⚠ extreme complexity (F), ⚠ no sections/organization
294
+ ```
295
+
225
296
  #### Audit Command (v2.2.0)
226
297
 
227
298
  The `audit` command now includes **Eldritch Horror Detection**—identifying oversized functions that are symptomatic of AI-generated code gone wrong:
@@ -0,0 +1,92 @@
1
+ /**
2
+ * Complexity Data Loader
3
+ *
4
+ * Loads cyclomatic complexity metrics from language-specific drivers.
5
+ * Drivers normalize output from tools like radon (Python), complexity-report (JS),
6
+ * gocyclo (Go) to a standard JSON schema.
7
+ *
8
+ * Driver architecture:
9
+ * - vibe-check remains language-agnostic (kernel)
10
+ * - Drivers wrap language tools and output standard schema
11
+ * - Modularity analyzer reads .vibe-check/complexity.json if present
12
+ */
13
+ /**
14
+ * Function-level complexity metrics
15
+ */
16
+ export interface FunctionComplexity {
17
+ name: string;
18
+ complexity: number;
19
+ grade: ComplexityGrade;
20
+ line: number;
21
+ endLine?: number;
22
+ isMethod?: boolean;
23
+ className?: string;
24
+ }
25
+ /**
26
+ * File-level complexity metrics (aggregated from functions)
27
+ */
28
+ export interface FileComplexity {
29
+ functions: FunctionComplexity[];
30
+ avgComplexity: number;
31
+ maxComplexity: number;
32
+ grade: ComplexityGrade;
33
+ }
34
+ /**
35
+ * Summary statistics across all analyzed files
36
+ */
37
+ export interface ComplexitySummary {
38
+ totalFiles: number;
39
+ totalFunctions: number;
40
+ avgComplexity: number;
41
+ gradeDistribution: Record<ComplexityGrade, number>;
42
+ }
43
+ /**
44
+ * Complete complexity report from a driver
45
+ */
46
+ export interface ComplexityReport {
47
+ tool: string;
48
+ language: string;
49
+ generatedAt: string;
50
+ files: Record<string, FileComplexity>;
51
+ summary: ComplexitySummary;
52
+ }
53
+ /**
54
+ * Complexity grades (standardized across all tools)
55
+ *
56
+ * Grade mapping to cyclomatic complexity:
57
+ * - A: 1-5 (simple, low risk)
58
+ * - B: 6-10 (slightly complex, acceptable)
59
+ * - C: 11-20 (complex, consider refactoring)
60
+ * - D: 21-30 (very complex, refactor)
61
+ * - E: 31-40 (extremely complex, high risk)
62
+ * - F: 41+ (unmaintainable, must refactor)
63
+ */
64
+ export type ComplexityGrade = 'A' | 'B' | 'C' | 'D' | 'E' | 'F';
65
+ /**
66
+ * Load complexity data from .vibe-check/complexity.json
67
+ *
68
+ * Returns null if file doesn't exist (no complexity analysis run yet).
69
+ * Returns null on parse errors (with warning).
70
+ *
71
+ * @param rootDir - Repository root directory
72
+ * @returns ComplexityReport or null
73
+ */
74
+ export declare function loadComplexityData(rootDir: string): ComplexityReport | null;
75
+ /**
76
+ * Get complexity metrics for a specific file
77
+ *
78
+ * @param data - Complexity report
79
+ * @param file - File path (relative to repo root)
80
+ * @returns File complexity or null if file not analyzed
81
+ */
82
+ export declare function getFileComplexity(data: ComplexityReport, file: string): FileComplexity | null;
83
+ /**
84
+ * Convert complexity score to grade
85
+ *
86
+ * Used by drivers to normalize their tool-specific output.
87
+ *
88
+ * @param complexity - Cyclomatic complexity score
89
+ * @returns Grade A-F
90
+ */
91
+ export declare function complexityToGrade(complexity: number): ComplexityGrade;
92
+ //# sourceMappingURL=complexity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"complexity.d.ts","sourceRoot":"","sources":["../../src/analyzers/complexity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AASH;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,eAAe,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,kBAAkB,EAAE,CAAC;IAChC,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,eAAe,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,iBAAiB,EAAE,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;CACpD;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAE/B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IAGpB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IAGtC,OAAO,EAAE,iBAAiB,CAAC;CAC5B;AAED;;;;;;;;;;GAUG;AACH,MAAM,MAAM,eAAe,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;AAQhE;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB,GAAG,IAAI,CAsB3E;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,gBAAgB,EACtB,IAAI,EAAE,MAAM,GACX,cAAc,GAAG,IAAI,CAEvB;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,eAAe,CAOrE"}
@@ -0,0 +1,79 @@
1
+ /**
2
+ * Complexity Data Loader
3
+ *
4
+ * Loads cyclomatic complexity metrics from language-specific drivers.
5
+ * Drivers normalize output from tools like radon (Python), complexity-report (JS),
6
+ * gocyclo (Go) to a standard JSON schema.
7
+ *
8
+ * Driver architecture:
9
+ * - vibe-check remains language-agnostic (kernel)
10
+ * - Drivers wrap language tools and output standard schema
11
+ * - Modularity analyzer reads .vibe-check/complexity.json if present
12
+ */
13
+ import * as fs from 'fs';
14
+ import * as path from 'path';
15
+ // ============================================================================
16
+ // LOADER
17
+ // ============================================================================
18
+ const COMPLEXITY_FILE = '.vibe-check/complexity.json';
19
+ /**
20
+ * Load complexity data from .vibe-check/complexity.json
21
+ *
22
+ * Returns null if file doesn't exist (no complexity analysis run yet).
23
+ * Returns null on parse errors (with warning).
24
+ *
25
+ * @param rootDir - Repository root directory
26
+ * @returns ComplexityReport or null
27
+ */
28
+ export function loadComplexityData(rootDir) {
29
+ const filePath = path.join(rootDir, COMPLEXITY_FILE);
30
+ if (!fs.existsSync(filePath)) {
31
+ return null; // No complexity data available - graceful degradation
32
+ }
33
+ try {
34
+ const content = fs.readFileSync(filePath, 'utf-8');
35
+ const data = JSON.parse(content);
36
+ // Basic validation
37
+ if (!data.files || !data.summary) {
38
+ console.warn(`Invalid complexity data in ${COMPLEXITY_FILE}: missing required fields`);
39
+ return null;
40
+ }
41
+ return data;
42
+ }
43
+ catch (e) {
44
+ console.warn(`Failed to parse ${COMPLEXITY_FILE}:`, e instanceof Error ? e.message : e);
45
+ return null;
46
+ }
47
+ }
48
+ /**
49
+ * Get complexity metrics for a specific file
50
+ *
51
+ * @param data - Complexity report
52
+ * @param file - File path (relative to repo root)
53
+ * @returns File complexity or null if file not analyzed
54
+ */
55
+ export function getFileComplexity(data, file) {
56
+ return data.files[file] || null;
57
+ }
58
+ /**
59
+ * Convert complexity score to grade
60
+ *
61
+ * Used by drivers to normalize their tool-specific output.
62
+ *
63
+ * @param complexity - Cyclomatic complexity score
64
+ * @returns Grade A-F
65
+ */
66
+ export function complexityToGrade(complexity) {
67
+ if (complexity <= 5)
68
+ return 'A';
69
+ if (complexity <= 10)
70
+ return 'B';
71
+ if (complexity <= 20)
72
+ return 'C';
73
+ if (complexity <= 30)
74
+ return 'D';
75
+ if (complexity <= 40)
76
+ return 'E';
77
+ return 'F';
78
+ }
79
+ //# sourceMappingURL=complexity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"complexity.js","sourceRoot":"","sources":["../../src/analyzers/complexity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAoE7B,+EAA+E;AAC/E,SAAS;AACT,+EAA+E;AAE/E,MAAM,eAAe,GAAG,6BAA6B,CAAC;AAEtD;;;;;;;;GAQG;AACH,MAAM,UAAU,kBAAkB,CAAC,OAAe;IAChD,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC;IAErD,IAAI,CAAC,EAA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,7 @@
11
11
  * - Coupling analysis (CBO, fan-in/fan-out)
12
12
  * - Single Responsibility Principle indicators
13
13
  */
14
+ import { ComplexityReport } from './complexity.js';
14
15
  export interface ModularityResult {
15
16
  files: FileModularity[];
16
17
  summary: ModularitySummary;
@@ -56,12 +57,13 @@ export interface ExemptedFile {
56
57
  reason: string;
57
58
  }
58
59
  export type ModularityRating = 'elite' | 'good' | 'acceptable' | 'needs-work' | 'poor';
59
- export type ModularityFlag = 'no-single-responsibility' | 'no-internal-structure' | 'high-coupling' | 'low-cohesion' | 'missing-tests' | 'god-class' | 'utility-grab-bag';
60
+ export type ModularityFlag = 'no-single-responsibility' | 'no-internal-structure' | 'high-coupling' | 'low-cohesion' | 'missing-tests' | 'god-class' | 'utility-grab-bag' | 'moderate-complexity' | 'high-complexity' | 'extreme-complexity';
60
61
  export type FilePattern = 'controller' | 'store' | 'routes' | 'types' | 'state-machine' | 'test' | 'generated' | 'component' | 'middleware' | 'utility';
61
62
  export interface ModularityOptions {
62
63
  minLines?: number;
63
64
  includeAll?: boolean;
64
65
  patterns?: FilePattern[];
66
+ complexityData?: ComplexityReport;
65
67
  }
66
68
  export declare function analyzeModularity(rootDir: string, options?: ModularityOptions): ModularityResult;
67
69
  //# sourceMappingURL=modularity.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"modularity.d.ts","sourceRoot":"","sources":["../../src/analyzers/modularity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAUH,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB,OAAO,EAAE,iBAAiB,CAAC;IAC3B,QAAQ,EAAE,YAAY,EAAE,CAAC;CAC1B;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,WAAW,GAAG,IAAI,CAAC;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,gBAAgB,CA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,CAAC;QAClB,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IACF,YAAY,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAChE;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,MAAM,GAAG,YAAY,GAAG,YAAY,GAAG,MAAM,CAAC;AAEvF,MAAM,MAAM,cAAc,GACtB,0BAA0B,GAC1B,uBAAuB,GACvB,eAAe,GACf,cAAc,GACd,eAAe,GACf,WAAW,GACX,kBAAkB,GAClB,qBAAqB,GACrB,iBAAiB,GACjB,oBAAoB,CAAC;AAEzB,MAAM,MAAM,WAAW,GACnB,YAAY,GACZ,OAAO,GACP,QAAQ,GACR,OAAO,GACP,eAAe,GACf,MAAM,GACN,WAAW,GACX,WAAW,GACX,YAAY,GACZ,SAAS,CAAC;AAwOd,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,WAAW,EAAE,CAAC;IACzB,cAAc,CAAC,EAAE,gBAAgB,CAAC;CACnC;AAED,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,iBAAsB,GAC9B,gBAAgB,CAoClB"}
@@ -14,6 +14,7 @@
14
14
  import * as fs from 'fs';
15
15
  import * as path from 'path';
16
16
  import { scanDirectory } from './audit.js';
17
+ import { getFileComplexity } from './complexity.js';
17
18
  // ============================================================================
18
19
  // PATTERN DETECTION
19
20
  // ============================================================================
@@ -89,7 +90,7 @@ function hasSingleResponsibility(content, file) {
89
90
  return false;
90
91
  return true;
91
92
  }
92
- function analyzeFile(filePath, rootDir) {
93
+ function analyzeFile(filePath, rootDir, complexityData) {
93
94
  const content = fs.readFileSync(filePath, 'utf-8');
94
95
  const lines = content.split('\n').length;
95
96
  const relPath = path.relative(rootDir, filePath);
@@ -110,8 +111,8 @@ function analyzeFile(filePath, rootDir) {
110
111
  hasNestedClasses: hasNestedClasses(content),
111
112
  methodCount: countMethods(content),
112
113
  };
113
- // Calculate score
114
- const { score, flags } = calculateScore(lines, pattern, details, content, relPath);
114
+ // Calculate score (with optional complexity data)
115
+ const { score, flags } = calculateScore(lines, pattern, details, content, relPath, complexityData);
115
116
  return {
116
117
  file: relPath,
117
118
  lines,
@@ -122,7 +123,7 @@ function analyzeFile(filePath, rootDir) {
122
123
  details,
123
124
  };
124
125
  }
125
- function calculateScore(lines, pattern, details, content, file) {
126
+ function calculateScore(lines, pattern, details, content, file, complexityData) {
126
127
  let score = 10;
127
128
  const flags = [];
128
129
  const thresholds = PATTERN_THRESHOLDS[pattern || 'default'];
@@ -170,6 +171,31 @@ function calculateScore(lines, pattern, details, content, file) {
170
171
  score -= 2;
171
172
  flags.push('utility-grab-bag');
172
173
  }
174
+ // 8. Complexity-based scoring (if complexity data available)
175
+ if (complexityData) {
176
+ const fileComplexity = getFileComplexity(complexityData, file);
177
+ if (fileComplexity) {
178
+ switch (fileComplexity.grade) {
179
+ case 'A':
180
+ case 'B':
181
+ score += 2; // Bonus for low complexity
182
+ break;
183
+ case 'C':
184
+ score -= 1;
185
+ flags.push('moderate-complexity');
186
+ break;
187
+ case 'D':
188
+ case 'E':
189
+ score -= 2;
190
+ flags.push('high-complexity');
191
+ break;
192
+ case 'F':
193
+ score -= 4;
194
+ flags.push('extreme-complexity');
195
+ break;
196
+ }
197
+ }
198
+ }
173
199
  // Clamp score
174
200
  return { score: Math.max(0, Math.min(10, score)), flags };
175
201
  }
@@ -185,13 +211,13 @@ function scoreToRating(score) {
185
211
  return 'poor';
186
212
  }
187
213
  export function analyzeModularity(rootDir, options = {}) {
188
- const { minLines = 100, includeAll = false, patterns } = options;
214
+ const { minLines = 100, includeAll = false, patterns, complexityData } = options;
189
215
  const allFiles = scanDirectory(rootDir);
190
216
  const files = [];
191
217
  const exempted = [];
192
218
  let totalLines = 0;
193
219
  for (const filePath of allFiles) {
194
- const result = analyzeFile(filePath, rootDir);
220
+ const result = analyzeFile(filePath, rootDir, complexityData);
195
221
  if ('reason' in result) {
196
222
  // Exempted file
197
223
  exempted.push(result);
@@ -1 +1 @@
1
- {"version":3,"file":"modularity.js","sourceRoot":"","sources":["../../src/analyzers/modularity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AA0E3C,+EAA+E;AAC/E,oBAAoB;AACpB,+EAA+E;AAE/E,MAAM,gBAAgB,GAAiF;IACrG,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,iCAAiC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE;IAC3E,EAAE,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,wBAAwB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE;IACvE,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,4BAA4B,CAAC,EAAE,MAAM,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE;IAChI,EAAE,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,uBAAuB,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,WAAW,C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CAAC,CAAC,CAAC,EAAE;QACjF,YAAY;QACZ,YAAY,EAAE,KAAK;aAChB,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC;aACjC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;aACX,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC;KAChE,CAAC;AACJ,CAAC"}
package/dist/cli.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { Command } from 'commander';
3
3
  import { createRequire } from 'module';
4
- import { createAnalyzeCommand, createStartCommand, createProfileCommand, createInitHookCommand, createWatchCommand, createTimelineCommand, createCacheCommand, createDashboardCommand, createSessionCommand, createInsightsCommand, createPipelineCommand, createSessionsCommand, createForensicsCommand, createAuditCommand, createModularityCommand, runAnalyze } from './commands/index.js';
4
+ import { createAnalyzeCommand, createStartCommand, createProfileCommand, createInitHookCommand, createWatchCommand, createTimelineCommand, createCacheCommand, createDashboardCommand, createSessionCommand, createInsightsCommand, createPipelineCommand, createSessionsCommand, createForensicsCommand, createAuditCommand, createModularityCommand, createDriverCommand, runAnalyze } from './commands/index.js';
5
5
  const require = createRequire(import.meta.url);
6
6
  const { version } = require('../package.json');
7
7
  const program = new Command();
@@ -27,6 +27,7 @@ program.addCommand(createSessionsCommand());
27
27
  program.addCommand(createForensicsCommand());
28
28
  program.addCommand(createAuditCommand());
29
29
  program.addCommand(createModularityCommand());
30
+ program.addCommand(createDriverCommand());
30
31
  // Default behavior: if no subcommand, run analyze with passed options
31
32
  // This maintains backwards compatibility with v1.x usage
32
33
  program
package/dist/cli.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["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AAE,KAAK,CAAC;KAClE,MAAM,CAAC,YAAY,EAAE,0DAA0D,CAAC;KAChF,MAAM,CAAC,iBAAiB,EAAE,yDAAyD,CAAC;KACpF,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;IACxB,wDAAwD;IACxD,MAAM,UAAU,CAAC;QACf,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,KAAK,EAAE,OAAO,CAAC,KAAK;KACrB,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEL,OAAO,CAAC,KAAK,EAAE,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Driver Command
3
+ *
4
+ * Run complexity drivers directly, outputting JSON to stdout.
5
+ * This is useful for generating complexity data without running modularity analysis.
6
+ *
7
+ * Usage:
8
+ * vibe-check driver python ./src > complexity.json
9
+ * vibe-check driver javascript ./src > complexity.json
10
+ */
11
+ import { Command } from 'commander';
12
+ export interface DriverCommandOptions {
13
+ language: string;
14
+ directory: string;
15
+ }
16
+ export declare function createDriverCommand(): Command;
17
+ export declare function runDriver(options: DriverCommandOptions): Promise<void>;
18
+ //# sourceMappingURL=driver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"driver.d.ts","sourceRoot":"","sources":["../../src/commands/driver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAYpC,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,mBAAmB,IAAI,OAAO,CAU7C;AAED,wBAAsB,SAAS,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CA8B5E"}