@probelabs/visor 0.1.35 → 0.1.37
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.
- package/README.md +355 -1
- package/defaults/.visor.yaml +69 -13
- package/dist/ai-review-service.d.ts +1 -1
- package/dist/ai-review-service.d.ts.map +1 -1
- package/dist/check-execution-engine.d.ts +8 -0
- package/dist/check-execution-engine.d.ts.map +1 -1
- package/dist/cli-main.d.ts.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/config.d.ts +4 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/cron-scheduler.d.ts +66 -0
- package/dist/cron-scheduler.d.ts.map +1 -0
- package/dist/defaults/.visor.yaml +69 -13
- package/dist/event-mapper.d.ts.map +1 -1
- package/dist/failure-condition-evaluator.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +107207 -76050
- package/dist/output/code-review/schema.json +1 -1
- package/dist/pr-analyzer.d.ts +8 -0
- package/dist/pr-analyzer.d.ts.map +1 -1
- package/dist/providers/ai-check-provider.d.ts.map +1 -1
- package/dist/providers/check-provider-registry.d.ts.map +1 -1
- package/dist/providers/check-provider.interface.d.ts +6 -0
- package/dist/providers/check-provider.interface.d.ts.map +1 -1
- package/dist/providers/claude-code-check-provider.d.ts +68 -0
- package/dist/providers/claude-code-check-provider.d.ts.map +1 -0
- package/dist/providers/claude-code-types.d.ts +68 -0
- package/dist/providers/claude-code-types.d.ts.map +1 -0
- package/dist/providers/{webhook-check-provider.d.ts → http-check-provider.d.ts} +6 -4
- package/dist/providers/http-check-provider.d.ts.map +1 -0
- package/dist/providers/http-client-provider.d.ts +22 -0
- package/dist/providers/http-client-provider.d.ts.map +1 -0
- package/dist/providers/http-input-provider.d.ts +27 -0
- package/dist/providers/http-input-provider.d.ts.map +1 -0
- package/dist/providers/index.d.ts +5 -1
- package/dist/providers/index.d.ts.map +1 -1
- package/dist/providers/mcp-tools.d.ts +106 -0
- package/dist/providers/mcp-tools.d.ts.map +1 -0
- package/dist/providers/tool-check-provider.d.ts.map +1 -1
- package/dist/types/config.d.ts +115 -8
- package/dist/types/config.d.ts.map +1 -1
- package/dist/utils/config-loader.d.ts.map +1 -1
- package/dist/utils/config-merger.d.ts.map +1 -1
- package/dist/webhook-server.d.ts +93 -0
- package/dist/webhook-server.d.ts.map +1 -0
- package/package.json +16 -2
- package/dist/providers/webhook-check-provider.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -453,6 +453,78 @@ checks:
|
|
|
453
453
|
- **Graceful Failures**: Failed checks don't prevent independent checks from running
|
|
454
454
|
- **Dependency Results**: Results from dependency checks are available to dependent checks
|
|
455
455
|
|
|
456
|
+
## 🤖 Claude Code Provider
|
|
457
|
+
|
|
458
|
+
Visor includes advanced integration with Claude Code SDK, providing powerful AI-driven code analysis with MCP (Model Context Protocol) tools and subagent support.
|
|
459
|
+
|
|
460
|
+
### Features
|
|
461
|
+
|
|
462
|
+
- **Advanced AI Analysis**: Leverages Claude Code's sophisticated understanding
|
|
463
|
+
- **MCP Tools**: Built-in and custom tools for specialized analysis
|
|
464
|
+
- **Subagents**: Delegate specific tasks to specialized agents
|
|
465
|
+
- **Streaming Responses**: Real-time feedback during analysis
|
|
466
|
+
- **Flexible Permissions**: Granular control over tool usage
|
|
467
|
+
|
|
468
|
+
### Configuration
|
|
469
|
+
|
|
470
|
+
```yaml
|
|
471
|
+
checks:
|
|
472
|
+
claude_comprehensive:
|
|
473
|
+
type: claude-code
|
|
474
|
+
prompt: "Perform a comprehensive security and performance review"
|
|
475
|
+
claude_code:
|
|
476
|
+
allowedTools: ['Grep', 'Read', 'WebSearch']
|
|
477
|
+
maxTurns: 5
|
|
478
|
+
systemPrompt: "You are an expert security auditor"
|
|
479
|
+
|
|
480
|
+
claude_with_mcp:
|
|
481
|
+
type: claude-code
|
|
482
|
+
prompt: "Analyze code complexity and architecture"
|
|
483
|
+
claude_code:
|
|
484
|
+
allowedTools: ['analyze_file_structure', 'calculate_complexity']
|
|
485
|
+
mcpServers:
|
|
486
|
+
custom_analyzer:
|
|
487
|
+
command: "node"
|
|
488
|
+
args: ["./mcp-servers/analyzer.js"]
|
|
489
|
+
env:
|
|
490
|
+
ANALYSIS_MODE: "deep"
|
|
491
|
+
```
|
|
492
|
+
|
|
493
|
+
### Built-in MCP Tools
|
|
494
|
+
|
|
495
|
+
- `analyze_file_structure`: Analyzes project organization
|
|
496
|
+
- `detect_patterns`: Identifies code patterns and anti-patterns
|
|
497
|
+
- `calculate_complexity`: Computes complexity metrics
|
|
498
|
+
- `suggest_improvements`: Provides improvement recommendations
|
|
499
|
+
|
|
500
|
+
### Custom MCP Servers
|
|
501
|
+
|
|
502
|
+
Create `.mcp.json` in your project root:
|
|
503
|
+
|
|
504
|
+
```json
|
|
505
|
+
{
|
|
506
|
+
"mcpServers": {
|
|
507
|
+
"security_scanner": {
|
|
508
|
+
"command": "python",
|
|
509
|
+
"args": ["./tools/security_scanner.py"],
|
|
510
|
+
"env": {
|
|
511
|
+
"SCAN_DEPTH": "full"
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
```
|
|
517
|
+
|
|
518
|
+
### Environment Setup
|
|
519
|
+
|
|
520
|
+
```bash
|
|
521
|
+
# Install Claude Code CLI (required)
|
|
522
|
+
npm install -g @anthropic-ai/claude-code
|
|
523
|
+
|
|
524
|
+
# Set API key (optional - uses local Claude Code if available)
|
|
525
|
+
export CLAUDE_CODE_API_KEY=your-api-key
|
|
526
|
+
```
|
|
527
|
+
|
|
456
528
|
## 🔄 AI Session Reuse
|
|
457
529
|
|
|
458
530
|
Visor supports AI session reuse for dependent checks, allowing follow-up analysis to maintain conversation context with the AI. This creates more intelligent, contextual analysis workflows.
|
|
@@ -1476,15 +1548,297 @@ When new commits are pushed to a PR, Visor performs incremental analysis:
|
|
|
1476
1548
|
- **Collision Detection**: Prevents conflicts when multiple reviews run simultaneously
|
|
1477
1549
|
- **Context-Aware Updates**: Comments are updated with relevant context (PR opened, updated, synchronized)
|
|
1478
1550
|
|
|
1551
|
+
## 🌐 HTTP Integration & Scheduling
|
|
1552
|
+
|
|
1553
|
+
Visor provides comprehensive HTTP integration capabilities including webhook reception, HTTP outputs, scheduled executions via cron, and TLS/HTTPS support.
|
|
1554
|
+
|
|
1555
|
+
### HTTP Server for Webhook Reception
|
|
1556
|
+
|
|
1557
|
+
Configure an HTTP/HTTPS server to receive webhooks and trigger checks:
|
|
1558
|
+
|
|
1559
|
+
```yaml
|
|
1560
|
+
version: "1.0"
|
|
1561
|
+
|
|
1562
|
+
http_server:
|
|
1563
|
+
enabled: true
|
|
1564
|
+
port: 8080
|
|
1565
|
+
host: "0.0.0.0"
|
|
1566
|
+
|
|
1567
|
+
# Optional TLS/HTTPS configuration
|
|
1568
|
+
tls:
|
|
1569
|
+
enabled: true
|
|
1570
|
+
cert: "${TLS_CERT}" # From environment variable
|
|
1571
|
+
key: "${TLS_KEY}"
|
|
1572
|
+
ca: "${TLS_CA}" # Optional CA certificate
|
|
1573
|
+
rejectUnauthorized: true
|
|
1574
|
+
|
|
1575
|
+
# Authentication
|
|
1576
|
+
auth:
|
|
1577
|
+
type: bearer_token
|
|
1578
|
+
secret: "${WEBHOOK_SECRET}"
|
|
1579
|
+
|
|
1580
|
+
# Webhook endpoints
|
|
1581
|
+
endpoints:
|
|
1582
|
+
- path: "/webhook/github"
|
|
1583
|
+
name: "github-events"
|
|
1584
|
+
- path: "/webhook/jenkins"
|
|
1585
|
+
name: "jenkins-builds"
|
|
1586
|
+
```
|
|
1587
|
+
|
|
1588
|
+
**Note**: The HTTP server is automatically disabled when running in GitHub Actions to avoid conflicts.
|
|
1589
|
+
|
|
1590
|
+
### Check Types for HTTP Integration
|
|
1591
|
+
|
|
1592
|
+
#### 1. HTTP Input (Webhook Receiver)
|
|
1593
|
+
Receive data from configured webhook endpoints:
|
|
1594
|
+
|
|
1595
|
+
```yaml
|
|
1596
|
+
checks:
|
|
1597
|
+
github-webhook:
|
|
1598
|
+
type: http_input
|
|
1599
|
+
endpoint: "/webhook/github"
|
|
1600
|
+
on: [webhook_received]
|
|
1601
|
+
transform: |
|
|
1602
|
+
{
|
|
1603
|
+
"event": "{{ webhook.action }}",
|
|
1604
|
+
"repository": "{{ webhook.repository.full_name }}"
|
|
1605
|
+
}
|
|
1606
|
+
```
|
|
1607
|
+
|
|
1608
|
+
#### 2. HTTP Output (Send Data)
|
|
1609
|
+
Send check results to external services:
|
|
1610
|
+
|
|
1611
|
+
```yaml
|
|
1612
|
+
checks:
|
|
1613
|
+
notify-external:
|
|
1614
|
+
type: http
|
|
1615
|
+
depends_on: [security-check]
|
|
1616
|
+
url: "https://api.example.com/notify"
|
|
1617
|
+
method: POST
|
|
1618
|
+
headers:
|
|
1619
|
+
Content-Type: "application/json"
|
|
1620
|
+
Authorization: "Bearer ${API_TOKEN}"
|
|
1621
|
+
body: |
|
|
1622
|
+
{
|
|
1623
|
+
"results": {{ outputs['security-check'] | json }},
|
|
1624
|
+
"timestamp": "{{ 'now' | date: '%Y-%m-%d %H:%M:%S' }}"
|
|
1625
|
+
}
|
|
1626
|
+
```
|
|
1627
|
+
|
|
1628
|
+
#### 3. HTTP Client (Fetch Data)
|
|
1629
|
+
Fetch data from external APIs:
|
|
1630
|
+
|
|
1631
|
+
```yaml
|
|
1632
|
+
checks:
|
|
1633
|
+
fetch-config:
|
|
1634
|
+
type: http_client
|
|
1635
|
+
url: "https://api.example.com/config"
|
|
1636
|
+
method: GET
|
|
1637
|
+
headers:
|
|
1638
|
+
Authorization: "Bearer ${API_TOKEN}"
|
|
1639
|
+
transform: |
|
|
1640
|
+
{
|
|
1641
|
+
"settings": {{ response.data | json }},
|
|
1642
|
+
"fetched_at": "{{ 'now' | date: '%Y-%m-%d' }}"
|
|
1643
|
+
}
|
|
1644
|
+
```
|
|
1645
|
+
|
|
1646
|
+
### Cron Scheduling
|
|
1647
|
+
|
|
1648
|
+
Schedule any check type to run at specific intervals:
|
|
1649
|
+
|
|
1650
|
+
```yaml
|
|
1651
|
+
checks:
|
|
1652
|
+
daily-security-scan:
|
|
1653
|
+
type: ai
|
|
1654
|
+
prompt: "Perform comprehensive security audit"
|
|
1655
|
+
schedule: "0 2 * * *" # Run at 2 AM daily
|
|
1656
|
+
|
|
1657
|
+
hourly-metrics:
|
|
1658
|
+
type: http_client
|
|
1659
|
+
url: "https://metrics.example.com/latest"
|
|
1660
|
+
schedule: "0 * * * *" # Every hour
|
|
1661
|
+
|
|
1662
|
+
weekly-report:
|
|
1663
|
+
type: ai
|
|
1664
|
+
prompt: "Generate weekly summary"
|
|
1665
|
+
schedule: "0 9 * * MON" # Every Monday at 9 AM
|
|
1666
|
+
```
|
|
1667
|
+
|
|
1668
|
+
**Cron Expression Format**:
|
|
1669
|
+
```
|
|
1670
|
+
┌────────────── minute (0-59)
|
|
1671
|
+
│ ┌──────────── hour (0-23)
|
|
1672
|
+
│ │ ┌────────── day of month (1-31)
|
|
1673
|
+
│ │ │ ┌──────── month (1-12)
|
|
1674
|
+
│ │ │ │ ┌────── day of week (0-6, Sunday=0)
|
|
1675
|
+
│ │ │ │ │
|
|
1676
|
+
* * * * *
|
|
1677
|
+
```
|
|
1678
|
+
|
|
1679
|
+
### TLS/HTTPS Configuration
|
|
1680
|
+
|
|
1681
|
+
Support for various TLS certificate configurations:
|
|
1682
|
+
|
|
1683
|
+
#### Environment Variables
|
|
1684
|
+
```yaml
|
|
1685
|
+
tls:
|
|
1686
|
+
enabled: true
|
|
1687
|
+
cert: "${TLS_CERT}" # Certificate from env var
|
|
1688
|
+
key: "${TLS_KEY}" # Private key from env var
|
|
1689
|
+
```
|
|
1690
|
+
|
|
1691
|
+
#### File Paths
|
|
1692
|
+
```yaml
|
|
1693
|
+
tls:
|
|
1694
|
+
enabled: true
|
|
1695
|
+
cert: "/etc/ssl/certs/server.crt"
|
|
1696
|
+
key: "/etc/ssl/private/server.key"
|
|
1697
|
+
ca: "/etc/ssl/certs/ca-bundle.crt"
|
|
1698
|
+
```
|
|
1699
|
+
|
|
1700
|
+
#### Let's Encrypt
|
|
1701
|
+
```yaml
|
|
1702
|
+
tls:
|
|
1703
|
+
enabled: true
|
|
1704
|
+
cert: "/etc/letsencrypt/live/example.com/fullchain.pem"
|
|
1705
|
+
key: "/etc/letsencrypt/live/example.com/privkey.pem"
|
|
1706
|
+
```
|
|
1707
|
+
|
|
1708
|
+
### HTTP Security Features
|
|
1709
|
+
|
|
1710
|
+
Visor's HTTP server includes comprehensive security protections:
|
|
1711
|
+
|
|
1712
|
+
#### Authentication Methods
|
|
1713
|
+
```yaml
|
|
1714
|
+
# Bearer Token Authentication
|
|
1715
|
+
auth:
|
|
1716
|
+
type: bearer_token
|
|
1717
|
+
secret: "${WEBHOOK_SECRET}"
|
|
1718
|
+
|
|
1719
|
+
# HMAC-SHA256 Signature Verification
|
|
1720
|
+
auth:
|
|
1721
|
+
type: hmac
|
|
1722
|
+
secret: "${WEBHOOK_SECRET}"
|
|
1723
|
+
|
|
1724
|
+
# Basic Authentication
|
|
1725
|
+
auth:
|
|
1726
|
+
type: basic
|
|
1727
|
+
username: "${HTTP_USERNAME}"
|
|
1728
|
+
password: "${HTTP_PASSWORD}"
|
|
1729
|
+
```
|
|
1730
|
+
|
|
1731
|
+
#### HMAC Authentication Details
|
|
1732
|
+
For `hmac` authentication, webhooks must include the `x-webhook-signature` header:
|
|
1733
|
+
- Signature format: `sha256={hash}`
|
|
1734
|
+
- Uses HMAC-SHA256 with the configured secret
|
|
1735
|
+
- Implements timing-safe comparison to prevent timing attacks
|
|
1736
|
+
- Compatible with GitHub webhook signatures
|
|
1737
|
+
|
|
1738
|
+
#### DoS Protection
|
|
1739
|
+
- **Request size limits**: Maximum 1MB request body size
|
|
1740
|
+
- **Early rejection**: Validates `Content-Length` header before processing
|
|
1741
|
+
- **Graceful error handling**: Returns proper HTTP status codes (413 Payload Too Large)
|
|
1742
|
+
|
|
1743
|
+
#### Security Best Practices
|
|
1744
|
+
- **Environment detection**: Automatically disables in GitHub Actions
|
|
1745
|
+
- **TLS support**: Full HTTPS configuration with custom certificates
|
|
1746
|
+
- **Input validation**: Validates all webhook payloads before processing
|
|
1747
|
+
- **Error isolation**: Security failures don't affect independent checks
|
|
1748
|
+
|
|
1749
|
+
### Complete HTTP Pipeline Example
|
|
1750
|
+
|
|
1751
|
+
```yaml
|
|
1752
|
+
version: "1.0"
|
|
1753
|
+
|
|
1754
|
+
# HTTP server configuration
|
|
1755
|
+
http_server:
|
|
1756
|
+
enabled: true
|
|
1757
|
+
port: 8443
|
|
1758
|
+
tls:
|
|
1759
|
+
enabled: true
|
|
1760
|
+
cert: "${TLS_CERT}"
|
|
1761
|
+
key: "${TLS_KEY}"
|
|
1762
|
+
auth:
|
|
1763
|
+
type: bearer_token
|
|
1764
|
+
secret: "${WEBHOOK_SECRET}"
|
|
1765
|
+
endpoints:
|
|
1766
|
+
- path: "/webhook/deployment"
|
|
1767
|
+
name: "deployment-trigger"
|
|
1768
|
+
|
|
1769
|
+
checks:
|
|
1770
|
+
# 1. Receive webhook
|
|
1771
|
+
deployment-webhook:
|
|
1772
|
+
type: http_input
|
|
1773
|
+
endpoint: "/webhook/deployment"
|
|
1774
|
+
on: [webhook_received]
|
|
1775
|
+
transform: |
|
|
1776
|
+
{
|
|
1777
|
+
"version": "{{ webhook.version }}",
|
|
1778
|
+
"environment": "{{ webhook.environment }}"
|
|
1779
|
+
}
|
|
1780
|
+
|
|
1781
|
+
# 2. Analyze deployment
|
|
1782
|
+
deployment-analysis:
|
|
1783
|
+
type: ai
|
|
1784
|
+
depends_on: [deployment-webhook]
|
|
1785
|
+
prompt: |
|
|
1786
|
+
Analyze deployment for version {{ outputs['deployment-webhook'].suggestions | first }}
|
|
1787
|
+
Check for potential issues and risks
|
|
1788
|
+
|
|
1789
|
+
# 3. Fetch current status
|
|
1790
|
+
current-status:
|
|
1791
|
+
type: http_client
|
|
1792
|
+
depends_on: [deployment-webhook]
|
|
1793
|
+
url: "https://api.example.com/status"
|
|
1794
|
+
method: GET
|
|
1795
|
+
|
|
1796
|
+
# 4. Send results
|
|
1797
|
+
notify-team:
|
|
1798
|
+
type: http
|
|
1799
|
+
depends_on: [deployment-analysis, current-status]
|
|
1800
|
+
url: "https://slack.example.com/webhook"
|
|
1801
|
+
body: |
|
|
1802
|
+
{
|
|
1803
|
+
"text": "Deployment Analysis Complete",
|
|
1804
|
+
"analysis": {{ outputs['deployment-analysis'] | json }},
|
|
1805
|
+
"current_status": {{ outputs['current-status'] | json }}
|
|
1806
|
+
}
|
|
1807
|
+
|
|
1808
|
+
# 5. Scheduled health check
|
|
1809
|
+
health-check:
|
|
1810
|
+
type: http_client
|
|
1811
|
+
url: "https://api.example.com/health"
|
|
1812
|
+
schedule: "*/5 * * * *" # Every 5 minutes
|
|
1813
|
+
transform: |
|
|
1814
|
+
{
|
|
1815
|
+
"status": "{{ response.status }}",
|
|
1816
|
+
"checked_at": "{{ 'now' | date: '%Y-%m-%d %H:%M:%S' }}"
|
|
1817
|
+
}
|
|
1818
|
+
```
|
|
1819
|
+
|
|
1820
|
+
### Liquid Template Support
|
|
1821
|
+
|
|
1822
|
+
All HTTP configurations support Liquid templating for dynamic content:
|
|
1823
|
+
|
|
1824
|
+
- Access webhook data: `{{ webhook.field }}`
|
|
1825
|
+
- Access headers: `{{ headers['x-custom-header'] }}`
|
|
1826
|
+
- Access previous outputs: `{{ outputs['check-name'].suggestions | first }}`
|
|
1827
|
+
- Date formatting: `{{ 'now' | date: '%Y-%m-%d' }}`
|
|
1828
|
+
- JSON encoding: `{{ data | json }}`
|
|
1829
|
+
|
|
1479
1830
|
## 🔧 Pluggable Architecture
|
|
1480
1831
|
|
|
1481
1832
|
Visor features a pluggable provider system for extensibility:
|
|
1482
1833
|
|
|
1483
1834
|
### Supported Check Types
|
|
1484
1835
|
- **AI Provider**: Intelligent analysis using LLMs (Google Gemini, Anthropic Claude, OpenAI GPT)
|
|
1836
|
+
- **Claude Code Provider**: Advanced AI analysis using Claude Code SDK with MCP tools and subagents
|
|
1485
1837
|
- **Tool Provider**: Integration with external tools (ESLint, Prettier, SonarQube)
|
|
1838
|
+
- **HTTP Provider**: Send data to external HTTP endpoints
|
|
1839
|
+
- **HTTP Input Provider**: Receive data from webhooks
|
|
1840
|
+
- **HTTP Client Provider**: Fetch data from external APIs
|
|
1486
1841
|
- **Script Provider**: Custom shell scripts and commands
|
|
1487
|
-
- **Webhook Provider**: External service integration via HTTP calls
|
|
1488
1842
|
|
|
1489
1843
|
### Adding Custom Providers
|
|
1490
1844
|
```typescript
|
package/defaults/.visor.yaml
CHANGED
|
@@ -18,8 +18,8 @@ max_parallelism: 1
|
|
|
18
18
|
# Example: security-remediation reuses the session from the security check,
|
|
19
19
|
# allowing the AI to reference the previous security analysis discussion.
|
|
20
20
|
|
|
21
|
-
# Global fail condition - fail if critical issues are found
|
|
22
|
-
fail_if: "output.issues && output.issues.some(i => i.severity === 'critical')"
|
|
21
|
+
# Global fail condition - fail if critical or error severity issues are found
|
|
22
|
+
fail_if: "output.issues && output.issues.some(i => i.severity === 'critical' || i.severity === 'error')"
|
|
23
23
|
|
|
24
24
|
checks:
|
|
25
25
|
# AI-powered release notes generation - manual execution only for release workflows
|
|
@@ -93,16 +93,10 @@ checks:
|
|
|
93
93
|
- Affected system components
|
|
94
94
|
|
|
95
95
|
2. **Architecture Visualization**
|
|
96
|
-
- Create appropriate mermaid diagram(s)
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
**Guidelines for diagrams:**
|
|
102
|
-
- Use multiple diagrams if there are distinct architectural aspects
|
|
103
|
-
- Choose the most appropriate diagram type for each concept
|
|
104
|
-
- Focus on modified components and their relationships
|
|
105
|
-
- Keep diagrams clean and informative
|
|
96
|
+
- Create appropriate mermaid diagram(s) to visualize the changes
|
|
97
|
+
- Choose the best diagram type for the context
|
|
98
|
+
- Use multiple diagrams if needed to explain different aspects
|
|
99
|
+
- Focus on modified components and their relationships
|
|
106
100
|
|
|
107
101
|
Provide a balanced technical assessment suitable for both developers and stakeholders.
|
|
108
102
|
on: [pr_opened, pr_updated]
|
|
@@ -144,6 +138,13 @@ checks:
|
|
|
144
138
|
- Resource exhaustion vulnerabilities
|
|
145
139
|
|
|
146
140
|
Provide specific findings with clear explanations and actionable remediation steps.
|
|
141
|
+
|
|
142
|
+
## Severity Guidelines
|
|
143
|
+
Use the following severity levels appropriately:
|
|
144
|
+
- **critical**: Security vulnerabilities that could lead to immediate compromise (RCE, SQL injection, authentication bypass, exposed secrets)
|
|
145
|
+
- **error**: Security issues that must be fixed before production (XSS, path traversal, weak crypto, missing auth checks)
|
|
146
|
+
- **warning**: Security concerns that should be addressed (verbose errors, missing rate limiting, insecure defaults)
|
|
147
|
+
- **info**: Security best practices and hardening suggestions (defense in depth, additional validation)
|
|
147
148
|
depends_on: [overview]
|
|
148
149
|
reuse_ai_session: true # 🔄 Reuses the overview check's AI session for context continuity
|
|
149
150
|
on: [pr_opened, pr_updated]
|
|
@@ -183,6 +184,13 @@ checks:
|
|
|
183
184
|
- Inefficient parallel processing
|
|
184
185
|
|
|
185
186
|
Building on our overview and security analysis, identify performance issues and provide optimization recommendations that complement our previous findings.
|
|
187
|
+
|
|
188
|
+
## Severity Guidelines
|
|
189
|
+
Use the following severity levels appropriately:
|
|
190
|
+
- **critical**: Performance issues causing system failure or severe degradation (infinite loops, memory leaks causing OOM)
|
|
191
|
+
- **error**: Significant performance problems affecting user experience (O(n²) in critical path, N+1 queries, blocking I/O)
|
|
192
|
+
- **warning**: Performance concerns that should be optimized (inefficient algorithms, missing indexes, unnecessary operations)
|
|
193
|
+
- **info**: Performance best practices and optimization opportunities (caching suggestions, async improvements)
|
|
186
194
|
depends_on: [security]
|
|
187
195
|
reuse_ai_session: true # 🔄 Reuses the security check's AI session for context continuity
|
|
188
196
|
on: [pr_opened, pr_updated]
|
|
@@ -228,15 +236,63 @@ checks:
|
|
|
228
236
|
- Type safety (if applicable)
|
|
229
237
|
|
|
230
238
|
Focus on actionable improvements that enhance code maintainability while considering the overview, security, and performance findings we've already discussed.
|
|
239
|
+
|
|
240
|
+
## Severity Guidelines
|
|
241
|
+
Use the following severity levels appropriately:
|
|
242
|
+
- **critical**: Code quality issues that will cause bugs or failures (logic errors, race conditions, null pointer issues)
|
|
243
|
+
- **error**: Quality problems that significantly impact maintainability (no error handling, high complexity, severe coupling)
|
|
244
|
+
- **warning**: Quality concerns that should be addressed (missing tests, code duplication, poor naming)
|
|
245
|
+
- **info**: Best practices and improvement suggestions (refactoring opportunities, documentation improvements)
|
|
231
246
|
depends_on: [performance]
|
|
232
247
|
reuse_ai_session: true # 🔄 Reuses the performance check's AI session for context continuity
|
|
233
248
|
on: [pr_opened, pr_updated]
|
|
234
249
|
|
|
250
|
+
# Code style and formatting analysis
|
|
251
|
+
style:
|
|
252
|
+
type: ai
|
|
253
|
+
group: review
|
|
254
|
+
schema: code-review
|
|
255
|
+
prompt: |
|
|
256
|
+
Building on our overview, security, performance, and quality discussions, analyze the code style and formatting consistency.
|
|
257
|
+
|
|
258
|
+
Review the code changes shown in the `<full_diff>` or `<commit_diff>` sections, considering the files listed in `<files_summary>`.
|
|
259
|
+
|
|
260
|
+
## Style Assessment Areas
|
|
261
|
+
**Code Formatting & Consistency:**
|
|
262
|
+
- Indentation and spacing consistency
|
|
263
|
+
- Naming conventions adherence
|
|
264
|
+
- Code organization and structure
|
|
265
|
+
- Comment style and documentation
|
|
266
|
+
|
|
267
|
+
**Language-Specific Style Guidelines:**
|
|
268
|
+
- Adherence to language style guides (PEP 8, ESLint, etc.)
|
|
269
|
+
- Import/require statement organization
|
|
270
|
+
- Variable and function naming patterns
|
|
271
|
+
- Code readability and clarity
|
|
272
|
+
|
|
273
|
+
**Team Standards:**
|
|
274
|
+
- Consistency with existing codebase patterns
|
|
275
|
+
- Formatting tool configuration compliance
|
|
276
|
+
- Documentation standards adherence
|
|
277
|
+
- Code comment quality and completeness
|
|
278
|
+
|
|
279
|
+
Focus on style improvements that enhance code readability and maintainability while considering our previous analysis.
|
|
280
|
+
|
|
281
|
+
## Severity Guidelines
|
|
282
|
+
Use the following severity levels appropriately:
|
|
283
|
+
- **critical**: Never use for style issues (style issues are never critical)
|
|
284
|
+
- **error**: Major style violations that significantly harm readability (completely inconsistent formatting, misleading names)
|
|
285
|
+
- **warning**: Style inconsistencies that should be fixed (mixed conventions, unclear naming, formatting issues)
|
|
286
|
+
- **info**: Style suggestions and minor improvements (spacing, comment formatting, optional conventions)
|
|
287
|
+
depends_on: [quality]
|
|
288
|
+
reuse_ai_session: true # 🔄 Reuses the quality check's AI session for context continuity
|
|
289
|
+
on: [pr_opened, pr_updated]
|
|
290
|
+
|
|
235
291
|
# Command orchestrator - demonstrates noop type for triggering multiple checks
|
|
236
292
|
review-all:
|
|
237
293
|
type: noop
|
|
238
294
|
command: '/review'
|
|
239
|
-
depends_on: [overview, security, performance, quality]
|
|
295
|
+
depends_on: [overview, security, performance, quality, style]
|
|
240
296
|
on: [issue_comment]
|
|
241
297
|
if: "event.isPullRequest" # Only trigger on PR comments, not issues
|
|
242
298
|
group: orchestrator
|
|
@@ -5,7 +5,7 @@ export interface AIReviewConfig {
|
|
|
5
5
|
apiKey?: string;
|
|
6
6
|
model?: string;
|
|
7
7
|
timeout?: number;
|
|
8
|
-
provider?: 'google' | 'anthropic' | 'openai' | 'mock';
|
|
8
|
+
provider?: 'google' | 'anthropic' | 'openai' | 'mock' | 'claude-code';
|
|
9
9
|
debug?: boolean;
|
|
10
10
|
}
|
|
11
11
|
export interface AIDebugInfo {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"","sourceRoot":"","sources":["file:///home/runner/work/visor/visor/src/ai-review-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,aAAa,EAAe,MAAM,YAAY,CAAC;AAcxD,MAAM,WAAW,cAAc;IAC7B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YACW,iCAAiC;IAuE/C;;OAEG;YACW,cAAc;IAuK5B;;OAEG;YACW,iBAAiB;IAwB/B;;OAEG;IACH,OAAO,CAAC,eAAe;IAsNvB;;;OAGG;IACH,OAAO,CAAC,uBAAuB;IAc/B;;OAEG;IACH,OAAO,CAAC,2BAA2B;IAqDnC;;OAEG;YACW,oBAAoB;IAgDlC;;OAEG;IACH,OAAO,CAAC,eAAe;CAexB"}
|
|
@@ -51,6 +51,9 @@ export interface CheckExecutionOptions {
|
|
|
51
51
|
outputFormat?: string;
|
|
52
52
|
config?: import('./types/config').VisorConfig;
|
|
53
53
|
debug?: boolean;
|
|
54
|
+
webhookContext?: {
|
|
55
|
+
webhookData: Map<string, unknown>;
|
|
56
|
+
};
|
|
54
57
|
githubChecks?: {
|
|
55
58
|
enabled: boolean;
|
|
56
59
|
octokit?: import('@octokit/rest').Octokit;
|
|
@@ -71,7 +74,12 @@ export declare class CheckExecutionEngine {
|
|
|
71
74
|
private githubContext?;
|
|
72
75
|
private workingDirectory;
|
|
73
76
|
private config?;
|
|
77
|
+
private webhookContext?;
|
|
74
78
|
constructor(workingDirectory?: string);
|
|
79
|
+
/**
|
|
80
|
+
* Set webhook context on a provider if it supports it
|
|
81
|
+
*/
|
|
82
|
+
private setProviderWebhookContext;
|
|
75
83
|
/**
|
|
76
84
|
* Execute checks on the local repository
|
|
77
85
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"","sourceRoot":"","sources":["file:///home/runner/work/visor/visor/src/check-execution-engine.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,aAAa,EAEb,mBAAmB,EAEpB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAKvC,OAAO,EAAE,sBAAsB,EAAe,MAAM,gBAAgB,CAAC;AAkCrE,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE;QACJ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AGG;IACH,OAAO,CAAC,mBAAmB;IA4F3B;;OAEG;IACH,OAAO,CAAC,mBAAmB;CAa5B"}
|
package/dist/cli-main.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"","sourceRoot":"","sources":["file:///home/runner/work/visor/visor/src/cli-main.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,wBAAsB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"","sourceRoot":"","sources":["file:///home/runner/work/visor/visor/src/cli-main.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,wBAAsB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAuL1C"}
|
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"","sourceRoot":"","sources":["file:///home/runner/work/visor/visor/src/cli.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAA2B,MAAM,aAAa,CAAC;AAIlE;;GAEG;AACH,qBAAa,GAAG;IACd,OAAO,CAAC,OAAO,CAAU;IACzB,OAAO,CAAC,WAAW,CAA4E;IAC/F,OAAO,CAAC,YAAY,CAA0D;;IAO9E;;OAEG;IACH,OAAO,CAAC,YAAY;IAoCpB;;OAEG;IACH,OAAO,CAAC,aAAa,CAEnB;IAEF;;OAEG;IACI,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,UAAU;
|
|
1
|
+
{"version":3,"file":"","sourceRoot":"","sources":["file:///home/runner/work/visor/visor/src/cli.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAA2B,MAAM,aAAa,CAAC;AAIlE;;GAEG;AACH,qBAAa,GAAG;IACd,OAAO,CAAC,OAAO,CAAU;IACzB,OAAO,CAAC,WAAW,CAA4E;IAC/F,OAAO,CAAC,YAAY,CAA0D;;IAO9E;;OAEG;IACH,OAAO,CAAC,YAAY;IAoCpB;;OAEG;IACH,OAAO,CAAC,aAAa,CAEnB;IAEF;;OAEG;IACI,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,UAAU;IAwG5C;;OAEG;IACH,OAAO,CAAC,eAAe;IAkCvB;;OAEG;IACI,WAAW,IAAI,MAAM;IAkC5B;;OAEG;IACI,UAAU,IAAI,MAAM;IAa3B;;OAEG;IACI,eAAe,IAAI,MAAM;IAchC;;OAEG;IACI,QAAQ,IAAI,IAAI;IAIvB;;OAEG;IACI,WAAW,IAAI,IAAI;CAG3B"}
|
package/dist/config.d.ts
CHANGED
|
@@ -51,6 +51,10 @@ export declare class ConfigManager {
|
|
|
51
51
|
* Validate individual check configuration
|
|
52
52
|
*/
|
|
53
53
|
private validateCheckConfig;
|
|
54
|
+
/**
|
|
55
|
+
* Validate HTTP server configuration
|
|
56
|
+
*/
|
|
57
|
+
private validateHttpServerConfig;
|
|
54
58
|
/**
|
|
55
59
|
* Validate output configuration
|
|
56
60
|
*/
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"","sourceRoot":"","sources":["file:///home/runner/work/visor/visor/src/config.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,WAAW,EAOX,oBAAoB,EACpB,YAAY,EACZ,iBAAiB,EAClB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAIzC;;GAEG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,eAAe,
|
|
1
|
+
{"version":3,"file":"","sourceRoot":"","sources":["file:///home/runner/work/visor/visor/src/config.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,WAAW,EAOX,oBAAoB,EACpB,YAAY,EACZ,iBAAiB,EAClB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAIzC;;GAEG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,eAAe,CAQrB;IACF,OAAO,CAAC,kBAAkB,CASxB;IACF,OAAO,CAAC,kBAAkB,CAAgE;IAC1F,OAAO,CAAC,mBAAmB,CAAkD;IAE7E;;OAEG;IACU,UAAU,CACrB,UAAU,EAAE,MAAM,EAClB,OAAO,GAAE,iBAAsB,GAC9B,OAAO,CAAC,WAAW,CAAC;IA6EvB;;OAEG;IACU,iBAAiB,CAAC,OAAO,GAAE,iBAAsB,GAAG,OAAO,CAAC,WAAW,CAAC;IAyBrF;;OAEG;YACW,qBAAqB;IAiBnC;;OAEG;IACU,gBAAgB,IAAI,OAAO,CAAC,WAAW,CAAC;IAerD;;OAEG;IACI,wBAAwB,IAAI,WAAW,GAAG,IAAI;IAoDrD;;OAEG;IACH,OAAO,CAAC,eAAe;IAuBvB;;OAEG;IACI,mBAAmB,CAAC,MAAM,EAAE,OAAO,CAAC,WAAW,CAAC,EAAE,UAAU,EAAE,UAAU,GAAG,YAAY;IAqB9F;;OAEG;IACU,0BAA0B,IAAI,OAAO,CAAC;QACjD,MAAM,CAAC,EAAE,WAAW,CAAC;QACrB,oBAAoB,EAAE,oBAAoB,CAAC;KAC5C,CAAC;IA2BF;;OAEG;IACH,OAAO,CAAC,cAAc;IAgEtB;;OAEG;IACH,OAAO,CAAC,mBAAmB;IA0H3B;;OAEG;IACH,OAAO,CAAC,wBAAwB;IA6EhC;;OAEG;IACH,OAAO,CAAC,oBAAoB;IA+B5B;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAY9B;;OAEG;IACH,OAAO,CAAC,iBAAiB;CA6B1B"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import * as cron from 'node-cron';
|
|
2
|
+
import { VisorConfig, CheckConfig } from './types/config';
|
|
3
|
+
import { CheckExecutionEngine } from './check-execution-engine';
|
|
4
|
+
export interface ScheduledCheck {
|
|
5
|
+
checkName: string;
|
|
6
|
+
schedule: string;
|
|
7
|
+
checkConfig: CheckConfig;
|
|
8
|
+
task?: cron.ScheduledTask;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Service for managing cron-scheduled check executions
|
|
12
|
+
*/
|
|
13
|
+
export declare class CronScheduler {
|
|
14
|
+
private scheduledChecks;
|
|
15
|
+
private executionEngine;
|
|
16
|
+
private config;
|
|
17
|
+
private isRunning;
|
|
18
|
+
constructor(config: VisorConfig, executionEngine: CheckExecutionEngine);
|
|
19
|
+
/**
|
|
20
|
+
* Initialize scheduler and register all scheduled checks
|
|
21
|
+
*/
|
|
22
|
+
initialize(): void;
|
|
23
|
+
/**
|
|
24
|
+
* Register a check for scheduled execution
|
|
25
|
+
*/
|
|
26
|
+
private registerScheduledCheck;
|
|
27
|
+
/**
|
|
28
|
+
* Execute a scheduled check
|
|
29
|
+
*/
|
|
30
|
+
private executeScheduledCheck;
|
|
31
|
+
/**
|
|
32
|
+
* Handle results from scheduled check execution
|
|
33
|
+
*/
|
|
34
|
+
private handleScheduledResults;
|
|
35
|
+
/**
|
|
36
|
+
* Start the scheduler
|
|
37
|
+
*/
|
|
38
|
+
start(): void;
|
|
39
|
+
/**
|
|
40
|
+
* Stop the scheduler
|
|
41
|
+
*/
|
|
42
|
+
stop(): void;
|
|
43
|
+
/**
|
|
44
|
+
* Get list of scheduled checks
|
|
45
|
+
*/
|
|
46
|
+
getScheduledChecks(): Array<{
|
|
47
|
+
name: string;
|
|
48
|
+
schedule: string;
|
|
49
|
+
nextRun?: Date;
|
|
50
|
+
}>;
|
|
51
|
+
/**
|
|
52
|
+
* Manually trigger a scheduled check
|
|
53
|
+
*/
|
|
54
|
+
triggerCheck(checkName: string): Promise<void>;
|
|
55
|
+
/**
|
|
56
|
+
* Validate all cron expressions in config
|
|
57
|
+
*/
|
|
58
|
+
static validateSchedules(config: VisorConfig): {
|
|
59
|
+
valid: boolean;
|
|
60
|
+
errors: string[];
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Create and initialize a cron scheduler
|
|
65
|
+
*/
|
|
66
|
+
export declare function createCronScheduler(config: VisorConfig, executionEngine: CheckExecutionEngine): CronScheduler;
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