@sanurb/ringi 0.1.0 → 0.2.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.
- package/dist/{chunk-3JLVANJR.js → chunk-KMYSGMD3.js} +1819 -75
- package/dist/chunk-KMYSGMD3.js.map +1 -0
- package/dist/cli.js +108 -39
- package/dist/cli.js.map +1 -1
- package/dist/mcp.js +1 -1
- package/dist/mcp.js.map +1 -1
- package/package.json +10 -83
- package/LICENSE +0 -674
- package/README.md +0 -378
- package/dist/chunk-3JLVANJR.js.map +0 -1
package/README.md
DELETED
|
@@ -1,378 +0,0 @@
|
|
|
1
|
-
# Ringi
|
|
2
|
-
|
|
3
|
-
**Local-first code review tool for AI-generated changes**
|
|
4
|
-
|
|
5
|
-
Ringi provides structured code review workflows that work locally. Create review sessions from git diffs, inspect changes with machine-generated provenance and evidence, understand first-order impact, and access the same review state through Web UI, CLI, and MCP integration.
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## Overview
|
|
10
|
-
|
|
11
|
-
Browser-based review tools disconnect you from your local development environment and lack structured intelligence for AI-generated changes. AI agents produce diffs faster than humans can review them, but existing tools don't systematically show what changed, why it changed, or what else might be affected.
|
|
12
|
-
|
|
13
|
-
Ringi anchors review work in immutable review sessions stored locally. Each session captures a snapshot of staged changes, branch divergence, or commit range, then adds:
|
|
14
|
-
|
|
15
|
-
- **Structured provenance** explaining why each file changed
|
|
16
|
-
- **Review-scoped impact analysis** showing first-order effects without repository-wide exploration
|
|
17
|
-
- **Evidence-backed confidence scoring** to prioritize reviewer attention
|
|
18
|
-
- **Grouped file navigation** organizing changes by logical relationship
|
|
19
|
-
- **Persistent annotations** including comments, suggestions, and operational todos
|
|
20
|
-
- **Export artifacts** for downstream workflows and audit trails
|
|
21
|
-
|
|
22
|
-
Review state lives locally in SQLite with no network dependency for core workflows. The same review session model works across three surfaces: web interface, CLI, and MCP protocol.
|
|
23
|
-
|
|
24
|
-
---
|
|
25
|
-
|
|
26
|
-
## Key Features
|
|
27
|
-
|
|
28
|
-
### **Review Sessions**
|
|
29
|
-
|
|
30
|
-
Create bounded review contexts from `staged` changes, `branch` divergence, or explicit `commit` ranges. Each session captures an immutable diff snapshot that stays consistent for analysis, annotation, and export.
|
|
31
|
-
|
|
32
|
-
### **Review-Scoped Intelligence**
|
|
33
|
-
|
|
34
|
-
- **Provenance tracking**: Structured explanations of why files changed
|
|
35
|
-
- **Impact analysis**: First-order effects and uncovered dependents
|
|
36
|
-
- **Confidence scoring**: Evidence-backed priority guidance for reviewer attention
|
|
37
|
-
- **Grouped file tree**: Logical organization by directory and import relationships
|
|
38
|
-
|
|
39
|
-
### **Review Interface**
|
|
40
|
-
|
|
41
|
-
- **Syntax-highlighted diffs** with lazy loading for large reviews
|
|
42
|
-
- **Inline comments and suggestions** with resolution tracking
|
|
43
|
-
- **Todo management** linked to review sessions
|
|
44
|
-
- **Live filesystem watching** with SSE updates across all surfaces
|
|
45
|
-
|
|
46
|
-
### **Agent Integration**
|
|
47
|
-
|
|
48
|
-
- **MCP protocol** exposes review operations through structured namespaces
|
|
49
|
-
- **Codemode execution** allows complex multi-step workflows in one call
|
|
50
|
-
- **Read-only and mutation modes** for safe inspection vs. active collaboration
|
|
51
|
-
- **Self-verification APIs** for deterministic review validation
|
|
52
|
-
|
|
53
|
-
### **Local-First Architecture**
|
|
54
|
-
|
|
55
|
-
- **SQLite storage** in `.ringi/reviews.db` - no cloud dependencies
|
|
56
|
-
- **Offline operation** for all read-heavy workflows
|
|
57
|
-
- **Predictable performance** bounded to review scope, not repository size
|
|
58
|
-
- **Crash-safe persistence** with WAL mode and foreign key constraints
|
|
59
|
-
|
|
60
|
-
---
|
|
61
|
-
|
|
62
|
-
## Installation
|
|
63
|
-
|
|
64
|
-
```bash
|
|
65
|
-
# Install via pnpm (recommended)
|
|
66
|
-
pnpm install -g ringi
|
|
67
|
-
|
|
68
|
-
# Or via npm
|
|
69
|
-
npm install -g ringi
|
|
70
|
-
|
|
71
|
-
# Or via bun
|
|
72
|
-
bun install -g ringi
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
### Development Setup
|
|
76
|
-
|
|
77
|
-
```bash
|
|
78
|
-
# Clone the repository
|
|
79
|
-
git clone https://github.com/your-org/ringi.git
|
|
80
|
-
cd ringi
|
|
81
|
-
|
|
82
|
-
# Install dependencies
|
|
83
|
-
pnpm install
|
|
84
|
-
|
|
85
|
-
# Initialize local development database
|
|
86
|
-
pnpm dev # Starts TanStack dev server with hot reload
|
|
87
|
-
|
|
88
|
-
# Or start production server
|
|
89
|
-
pnpm build
|
|
90
|
-
ringi serve --port 3000
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
---
|
|
94
|
-
|
|
95
|
-
## Quick Start
|
|
96
|
-
|
|
97
|
-
### 1. Create Your First Review Session
|
|
98
|
-
|
|
99
|
-
```bash
|
|
100
|
-
# Review staged changes (most common)
|
|
101
|
-
ringi review create
|
|
102
|
-
|
|
103
|
-
# Review branch divergence
|
|
104
|
-
ringi review create --source branch --branch feature/ai-review-pipeline
|
|
105
|
-
|
|
106
|
-
# Review specific commits
|
|
107
|
-
ringi review create --source commits --commits abc123f,def456a --title "Agent refactor batch"
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
### 2. Inspect and Navigate
|
|
111
|
-
|
|
112
|
-
```bash
|
|
113
|
-
# List all reviews
|
|
114
|
-
ringi review list
|
|
115
|
-
|
|
116
|
-
# Show detailed review with files and stats
|
|
117
|
-
ringi review show last --comments --todos
|
|
118
|
-
|
|
119
|
-
# Preview available sources before creating
|
|
120
|
-
ringi source list
|
|
121
|
-
ringi source diff staged --stat
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
### 3. Add Annotations and Track Work
|
|
125
|
-
|
|
126
|
-
```bash
|
|
127
|
-
# Add operational todos
|
|
128
|
-
ringi todo add --text "Verify confidence scores on grouped file tree" --review rvw_01JY6Z4Y9B
|
|
129
|
-
|
|
130
|
-
# Mark todos complete
|
|
131
|
-
ringi todo done todo_01JY702YJ0D3
|
|
132
|
-
|
|
133
|
-
# Export review session as markdown
|
|
134
|
-
ringi review export last --output review-summary.md
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
### 4. Launch Web Interface
|
|
138
|
-
|
|
139
|
-
```bash
|
|
140
|
-
# Start local server with web UI
|
|
141
|
-
ringi serve
|
|
142
|
-
|
|
143
|
-
# With HTTPS and basic auth for network access
|
|
144
|
-
ringi serve --https --cert ./certs/dev.crt --key ./certs/dev.key --auth --username reviewer --password secure
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
---
|
|
148
|
-
|
|
149
|
-
## Core Workflows
|
|
150
|
-
|
|
151
|
-
### Web Interface Overview
|
|
152
|
-
|
|
153
|
-
The web interface provides structured diff review:
|
|
154
|
-
|
|
155
|
-
- **Review dashboard** with session management and status tracking
|
|
156
|
-
- **Grouped file navigation** showing logical change clusters
|
|
157
|
-
- **Diff viewer** with syntax highlighting and context controls
|
|
158
|
-
- **Impact visualization** showing dependencies and coverage gaps
|
|
159
|
-
- **Comment threads** with suggestion extraction and resolution tracking
|
|
160
|
-
- **Todo panel** for operational follow-up items
|
|
161
|
-
- **Export generation** with markdown and structured output formats
|
|
162
|
-
|
|
163
|
-
_Screenshots coming in Phase 1.5_
|
|
164
|
-
|
|
165
|
-
### CLI Workflow
|
|
166
|
-
|
|
167
|
-
Complete review workflows from the terminal:
|
|
168
|
-
|
|
169
|
-
```bash
|
|
170
|
-
# Complete review workflow from terminal
|
|
171
|
-
ringi review create --source staged
|
|
172
|
-
ringi review show last --comments
|
|
173
|
-
ringi todo add --text "Check impact on auth service" --review last
|
|
174
|
-
ringi review export last | pbcopy # macOS clipboard
|
|
175
|
-
ringi review resolve last --yes
|
|
176
|
-
```
|
|
177
|
-
|
|
178
|
-
**Command families:**
|
|
179
|
-
|
|
180
|
-
- `ringi review` - Create, list, show, export, resolve review sessions
|
|
181
|
-
- `ringi todo` - Manage operational tasks linked to reviews
|
|
182
|
-
- `ringi source` - Preview and discover available diff sources
|
|
183
|
-
- `ringi data` - Migrate, reset, and maintain local state
|
|
184
|
-
- `ringi serve` - Start web server and runtime coordination
|
|
185
|
-
- `ringi events` - Tail live filesystem and review events
|
|
186
|
-
- `ringi mcp` - Launch agent integration server
|
|
187
|
-
|
|
188
|
-
### Agent Integration via MCP
|
|
189
|
-
|
|
190
|
-
Agents connect through `ringi mcp` stdio protocol:
|
|
191
|
-
|
|
192
|
-
```javascript
|
|
193
|
-
// Agent workflow example
|
|
194
|
-
await execute({
|
|
195
|
-
code: `
|
|
196
|
-
const ctx = await session.context();
|
|
197
|
-
const review = await reviews.get(ctx.activeReviewId);
|
|
198
|
-
const files = await reviews.getFiles(review.id);
|
|
199
|
-
|
|
200
|
-
// Inspect high-risk changes
|
|
201
|
-
const riskyFiles = files.filter(file =>
|
|
202
|
-
file.confidence?.score < 0.6
|
|
203
|
-
);
|
|
204
|
-
|
|
205
|
-
if (riskyFiles.length > 0) {
|
|
206
|
-
await todos.add({
|
|
207
|
-
reviewId: review.id,
|
|
208
|
-
text: \`Review \${riskyFiles.length} low-confidence files before approval\`
|
|
209
|
-
});
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
return {
|
|
213
|
-
reviewId: review.id,
|
|
214
|
-
totalFiles: files.length,
|
|
215
|
-
riskyFiles: riskyFiles.map(f => f.path)
|
|
216
|
-
};
|
|
217
|
-
`,
|
|
218
|
-
timeout: 30000,
|
|
219
|
-
});
|
|
220
|
-
```
|
|
221
|
-
|
|
222
|
-
**Available MCP namespaces:**
|
|
223
|
-
|
|
224
|
-
- `reviews` - Session lifecycle, diff access, comment management
|
|
225
|
-
- `intelligence` - Relationships, impact analysis, confidence scoring
|
|
226
|
-
- `todos` - Task management and workflow coordination
|
|
227
|
-
- `sources` - Repository state and diff preview
|
|
228
|
-
- `events` - Real-time change notifications
|
|
229
|
-
- `session` - Context and adapter status
|
|
230
|
-
|
|
231
|
-
---
|
|
232
|
-
|
|
233
|
-
## Local-First Data Model
|
|
234
|
-
|
|
235
|
-
Ringi's architecture prioritizes local operation and data ownership:
|
|
236
|
-
|
|
237
|
-
### Storage Architecture
|
|
238
|
-
|
|
239
|
-
- **SQLite database** at `.ringi/reviews.db` stores all review state
|
|
240
|
-
- **WAL mode** enables concurrent reads with serialized writes
|
|
241
|
-
- **Schema migrations** handle evolution without data loss
|
|
242
|
-
- **Foreign key constraints** ensure referential integrity
|
|
243
|
-
|
|
244
|
-
### Operational Modes
|
|
245
|
-
|
|
246
|
-
| Mode | Description | Use Cases |
|
|
247
|
-
| -------------------- | ------------------------------------------- | ---------------------------------------------- |
|
|
248
|
-
| **Standalone** | Direct SQLite access, no server required | CLI inspection, export generation, diagnostics |
|
|
249
|
-
| **Server-connected** | Coordinated mutations via local HTTP server | Web UI, live updates, complex workflows |
|
|
250
|
-
| **MCP stdio** | Agent integration over process boundaries | AI review automation, validation pipelines |
|
|
251
|
-
|
|
252
|
-
### Data Portability
|
|
253
|
-
|
|
254
|
-
- Review snapshots remain immutable and reproducible
|
|
255
|
-
- Export artifacts can recreate review state from structured data
|
|
256
|
-
- Migration tools support repository changes and schema evolution
|
|
257
|
-
- Diagnostic commands validate state integrity and recover from corruption
|
|
258
|
-
|
|
259
|
-
---
|
|
260
|
-
|
|
261
|
-
## Technology Stack
|
|
262
|
-
|
|
263
|
-
**Runtime & Framework**
|
|
264
|
-
|
|
265
|
-
- [TanStack Start](https://tanstack.com/start) for route-driven application composition
|
|
266
|
-
- [Effect](https://effect.website) for service construction and dependency injection
|
|
267
|
-
- [React 19](https://react.dev) for UI components
|
|
268
|
-
|
|
269
|
-
**Storage & Persistence**
|
|
270
|
-
|
|
271
|
-
- [SQLite](https://sqlite.org) with WAL mode for local-first data
|
|
272
|
-
- [Chokidar](https://github.com/paulmillr/chokidar) for filesystem watching
|
|
273
|
-
- Typed schema migrations with foreign key enforcement
|
|
274
|
-
|
|
275
|
-
**UI & Styling**
|
|
276
|
-
|
|
277
|
-
- [Tailwind CSS 4](https://tailwindcss.com) with cascade layers
|
|
278
|
-
- [Radix UI](https://radix-ui.com) for accessible components
|
|
279
|
-
- [Shiki](https://shiki.style) for syntax highlighting
|
|
280
|
-
- [Lucide Icons](https://lucide.dev) for iconography
|
|
281
|
-
|
|
282
|
-
**Development & Quality**
|
|
283
|
-
|
|
284
|
-
- [TypeScript](https://typescriptlang.org) with strict type checking
|
|
285
|
-
- [Vitest](https://vitest.dev) for testing (no mocking frameworks)
|
|
286
|
-
- [Ultracite](https://github.com/your-org/ultracite) for linting and formatting
|
|
287
|
-
- [Effect Language Service](https://effect.website) for IDE support
|
|
288
|
-
|
|
289
|
-
---
|
|
290
|
-
|
|
291
|
-
## Development
|
|
292
|
-
|
|
293
|
-
### Requirements
|
|
294
|
-
|
|
295
|
-
- **Node.js** 18+ or **Bun** 1.0+
|
|
296
|
-
- **pnpm** 8+ (recommended) or npm/bun
|
|
297
|
-
- **Git** for repository operations
|
|
298
|
-
- **SQLite** 3.38+ (bundled with Node.js)
|
|
299
|
-
|
|
300
|
-
### Project Structure
|
|
301
|
-
|
|
302
|
-
```
|
|
303
|
-
ringi/
|
|
304
|
-
├── src/
|
|
305
|
-
│ ├── routes/ # TanStack Start routes & API handlers
|
|
306
|
-
│ ├── cli/ # CLI implementation and commands
|
|
307
|
-
│ └── components/ # React UI components
|
|
308
|
-
├── docs/ # Architecture and API documentation
|
|
309
|
-
├── .ringi/ # Local review database (created on first run)
|
|
310
|
-
└── package.json # Dependencies and scripts
|
|
311
|
-
```
|
|
312
|
-
|
|
313
|
-
### Quality Gates
|
|
314
|
-
|
|
315
|
-
All contributions must pass:
|
|
316
|
-
|
|
317
|
-
```bash
|
|
318
|
-
pnpm check # Ultracite linting
|
|
319
|
-
pnpm fix # Auto-fix formatting issues
|
|
320
|
-
pnpm typecheck # TypeScript validation
|
|
321
|
-
pnpm test # Test suite (no mocks allowed)
|
|
322
|
-
```
|
|
323
|
-
|
|
324
|
-
### Contributing
|
|
325
|
-
|
|
326
|
-
1. Fork the repository and create a feature branch
|
|
327
|
-
2. Run `pnpm install` and ensure quality gates pass
|
|
328
|
-
3. Follow the no-mocking testing policy - use dependency injection
|
|
329
|
-
4. Add tests for new functionality using constructor injection patterns
|
|
330
|
-
5. Submit pull request with clear description and examples
|
|
331
|
-
|
|
332
|
-
---
|
|
333
|
-
|
|
334
|
-
## Roadmap
|
|
335
|
-
|
|
336
|
-
### Phase 1: Operational Surface ✅
|
|
337
|
-
|
|
338
|
-
- [x] Core review session model
|
|
339
|
-
- [x] Git diff processing and storage
|
|
340
|
-
- [x] Basic CLI commands and server runtime
|
|
341
|
-
- [ ] Complete filesystem watcher integration
|
|
342
|
-
- [ ] MCP protocol foundation
|
|
343
|
-
|
|
344
|
-
### Phase 1.5: Trust Layer 🔄
|
|
345
|
-
|
|
346
|
-
- [ ] Structured provenance display
|
|
347
|
-
- [ ] Evidence-backed relationship visualization
|
|
348
|
-
- [ ] Impact minimap and graph-diff bridging
|
|
349
|
-
- [ ] Confidence scoring with inspection support
|
|
350
|
-
|
|
351
|
-
### Phase 2: Deep Intelligence
|
|
352
|
-
|
|
353
|
-
- [ ] Tree-sitter parsing backend
|
|
354
|
-
- [ ] Cross-file symbol and import analysis
|
|
355
|
-
- [ ] Rename detection and impact propagation
|
|
356
|
-
- [ ] Advanced grouping algorithms
|
|
357
|
-
|
|
358
|
-
### Phase 3: Agent Review Loop
|
|
359
|
-
|
|
360
|
-
- [ ] Structured agent review creation
|
|
361
|
-
- [ ] Deterministic self-verification APIs
|
|
362
|
-
- [ ] Selective batch approval workflows
|
|
363
|
-
- [ ] Review diff subscriptions
|
|
364
|
-
|
|
365
|
-
---
|
|
366
|
-
|
|
367
|
-
## License
|
|
368
|
-
|
|
369
|
-
[MIT](./LICENSE)
|
|
370
|
-
|
|
371
|
-
---
|
|
372
|
-
|
|
373
|
-
## Getting Started
|
|
374
|
-
|
|
375
|
-
```bash
|
|
376
|
-
pnpm install -g ringi
|
|
377
|
-
ringi review create
|
|
378
|
-
```
|