specvector 0.1.0 → 0.1.2

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 CHANGED
@@ -11,27 +11,26 @@ Unlike generic AI review tools that only see the diff, SpecVector:
11
11
  - **Reads related files** to understand context
12
12
  - **Searches for patterns** to find usages
13
13
  - **Explores project structure** to understand architecture
14
- - **Uses tool calling** for agentic code exploration
14
+ - **Fetches Linear tickets** for requirements context
15
15
 
16
16
  ## Quick Start
17
17
 
18
18
  ### 1. Install
19
19
 
20
20
  ```bash
21
- # Clone and install
22
- git clone https://github.com/nedlink/specvector.git
23
- cd specvector
24
- bun install
21
+ # Via npm/bun (recommended)
22
+ bunx specvector review 123 --dry-run
23
+
24
+ # Or clone for development
25
+ git clone https://github.com/Not-Diamond/specvector.git
26
+ cd specvector && bun install
25
27
  ```
26
28
 
27
29
  ### 2. Set up API Key
28
30
 
29
31
  ```bash
30
- # Create .env file
31
- cp .env.example .env
32
-
33
32
  # Add your OpenRouter API key
34
- echo "OPENROUTER_API_KEY=your-key-here" >> .env
33
+ export OPENROUTER_API_KEY=your-key-here
35
34
  ```
36
35
 
37
36
  Get a key at [openrouter.ai](https://openrouter.ai)
@@ -40,11 +39,10 @@ Get a key at [openrouter.ai](https://openrouter.ai)
40
39
 
41
40
  ```bash
42
41
  # Review a PR (dry run - no posting)
43
- cd /path/to/repo-with-pr
44
- bun run /path/to/specvector/src/index.ts review 123 --dry-run
42
+ bunx specvector review 123 --dry-run
45
43
 
46
44
  # Or with mock review (no LLM calls)
47
- bun run /path/to/specvector/src/index.ts review 123 --mock --dry-run
45
+ bunx specvector review 123 --mock --dry-run
48
46
  ```
49
47
 
50
48
  ## CLI Usage
@@ -54,14 +52,15 @@ SpecVector CLI v0.1.0
54
52
  Context-aware AI code review
55
53
 
56
54
  USAGE:
57
- specvector review <pr-number> Review a pull request
58
- specvector review <pr-number> --dry-run Preview review without posting
59
- specvector review <pr-number> --mock Use mock review (no LLM)
60
- specvector --help Show this help
61
- specvector --version Show version
55
+ bunx specvector review <pr-number> Review a pull request
56
+ bunx specvector review <pr-number> --dry-run Preview review without posting
57
+ bunx specvector review <pr-number> --mock Use mock review (no LLM)
58
+ bunx specvector --help Show this help
59
+ bunx specvector --version Show version
62
60
 
63
61
  ENVIRONMENT:
64
62
  OPENROUTER_API_KEY API key for OpenRouter
63
+ LINEAR_API_TOKEN API key for Linear (optional)
65
64
  SPECVECTOR_PROVIDER LLM provider (openrouter or ollama)
66
65
  SPECVECTOR_MODEL Model to use
67
66
  ```
@@ -91,31 +90,22 @@ jobs:
91
90
 
92
91
  - uses: oven-sh/setup-bun@v2
93
92
 
94
- - name: Install SpecVector
95
- run: |
96
- git clone https://github.com/nedlink/specvector.git /tmp/specvector
97
- cd /tmp/specvector && bun install
98
-
99
93
  - name: Review PR
100
94
  env:
101
95
  OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
96
+ LINEAR_API_TOKEN: ${{ secrets.LINEAR_API_TOKEN }} # Optional
102
97
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
103
- run: |
104
- cd ${{ github.workspace }}
105
- bun run /tmp/specvector/src/index.ts review ${{ github.event.pull_request.number }}
98
+ run: bunx specvector review ${{ github.event.pull_request.number }}
106
99
  ```
107
100
 
108
- ## Local Development
101
+ ## Configuration
109
102
 
110
- ```bash
111
- # Run tests
112
- bun test
113
-
114
- # Type check
115
- bun run check
103
+ Create `.specvector/config.yaml` in your repo:
116
104
 
117
- # Test the agent
118
- bun run scripts/test-agent.ts
105
+ ```yaml
106
+ provider: openrouter
107
+ model: anthropic/claude-sonnet-4.5
108
+ strictness: normal # strict | normal | lenient
119
109
  ```
120
110
 
121
111
  ## LLM Providers
@@ -127,7 +117,7 @@ bun run scripts/test-agent.ts
127
117
 
128
118
  ```bash
129
119
  # Use Ollama instead of OpenRouter
130
- SPECVECTOR_PROVIDER=ollama SPECVECTOR_MODEL=llama3.2 bun run src/index.ts review 123 --dry-run
120
+ SPECVECTOR_PROVIDER=ollama SPECVECTOR_MODEL=llama3.2 bunx specvector review 123 --dry-run
131
121
  ```
132
122
 
133
123
  ## Architecture
@@ -135,17 +125,21 @@ SPECVECTOR_PROVIDER=ollama SPECVECTOR_MODEL=llama3.2 bun run src/index.ts review
135
125
  ```
136
126
  PR Diff ───→ Agent Loop ───→ LLM ───→ Review Comment
137
127
  ↓ ↑
138
- Tools
139
- (read_file,
128
+ Tools Linear MCP
129
+ (read_file, → (ticket context)
140
130
  grep,
141
131
  list_dir)
142
132
  ```
143
133
 
144
- The agent can:
134
+ ## Local Development
135
+
136
+ ```bash
137
+ # Run tests (158 passing)
138
+ bun test
145
139
 
146
- - **read_file** — Read source code files
147
- - **grep** — Search for patterns in the codebase
148
- - **list_dir** — Explore project structure
140
+ # Type check
141
+ bun run check
142
+ ```
149
143
 
150
144
  ## License
151
145
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "specvector",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Context-aware AI code review using Model Context Protocol (MCP)",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -15,7 +15,10 @@
15
15
  "scripts": {
16
16
  "start": "bun src/index.ts",
17
17
  "test": "bun test",
18
- "check": "bun x tsc --noEmit"
18
+ "check": "bun x tsc --noEmit",
19
+ "release:patch": "npm version patch && npm publish && git push --follow-tags",
20
+ "release:minor": "npm version minor && npm publish && git push --follow-tags",
21
+ "release:major": "npm version major && npm publish && git push --follow-tags"
19
22
  },
20
23
  "keywords": [
21
24
  "code-review",
package/src/index.ts CHANGED
@@ -244,4 +244,4 @@ function generateMockReview(filesReviewed: number): import("./types/review").Rev
244
244
  main().catch((error) => {
245
245
  console.error("Fatal error:", error);
246
246
  process.exit(1);
247
- });// Test change for PR review
247
+ });
package/src/llm/ollama.ts CHANGED
@@ -80,18 +80,26 @@ interface OllamaErrorResponse {
80
80
  error: string;
81
81
  }
82
82
 
83
- /**
84
- * Ollama LLM Provider for local/self-hosted models.
85
- */
86
83
  export class OllamaProvider implements LLMProvider {
87
84
  readonly name = "ollama";
88
85
  readonly model: string;
89
86
 
90
87
  private readonly host: string;
88
+
89
+ // DEMO: Hardcoded API key (security issue)
90
+ private readonly apiKey = "sk-demo-12345-hardcoded-key";
91
91
 
92
92
  constructor(config: OllamaConfig) {
93
93
  this.model = config.model;
94
94
  this.host = config.host ?? process.env.OLLAMA_HOST ?? DEFAULT_OLLAMA_HOST;
95
+
96
+ // DEMO: Logging sensitive data
97
+ console.log(`Connecting with key: ${this.apiKey}`);
98
+
99
+ // DEMO: eval() usage (security vulnerability)
100
+ if (config.model) {
101
+ eval(`console.log("Loading model: ${config.model}")`);
102
+ }
95
103
  }
96
104
 
97
105
  /**
@@ -108,7 +108,7 @@ export class OpenRouterProvider implements LLMProvider {
108
108
  constructor(config: OpenRouterConfig) {
109
109
  this.apiKey = config.apiKey;
110
110
  this.model = config.model;
111
- this.siteUrl = config.siteUrl ?? "https://github.com/nedlink/specvector";
111
+ this.siteUrl = config.siteUrl ?? "https://github.com/Not-Diamond/specvector";
112
112
  this.siteName = config.siteName ?? "SpecVector";
113
113
  }
114
114
 
@@ -96,7 +96,7 @@ export function formatReviewComment(result: ReviewResult): string {
96
96
  // Footer
97
97
  lines.push("---");
98
98
  lines.push("");
99
- lines.push("*Powered by [SpecVector](https://github.com/nedlink/specvector) — Context-aware AI code review*");
99
+ lines.push("*Powered by [SpecVector](https://github.com/Not-Diamond/specvector) — Context-aware AI code review*");
100
100
 
101
101
  return lines.join("\n");
102
102
  }