redline-review 1.0.1 → 2.0.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/README.md +132 -18
- package/dist/detect-repo-stacks.d.ts +2 -0
- package/dist/detect-repo-stacks.d.ts.map +1 -0
- package/dist/detect-repo-stacks.js +53 -0
- package/dist/detect-repo-stacks.js.map +1 -0
- package/dist/manifest.d.ts +8 -0
- package/dist/manifest.d.ts.map +1 -0
- package/dist/manifest.js +154 -0
- package/dist/manifest.js.map +1 -0
- package/dist/range.d.ts +3 -0
- package/dist/range.d.ts.map +1 -0
- package/dist/range.js +49 -0
- package/dist/range.js.map +1 -0
- package/dist/redline-review.d.ts +34 -0
- package/dist/redline-review.d.ts.map +1 -1
- package/dist/redline-review.js +141 -31
- package/dist/redline-review.js.map +1 -1
- package/dist/repo.d.ts +4 -0
- package/dist/repo.d.ts.map +1 -0
- package/dist/repo.js +75 -0
- package/dist/repo.js.map +1 -0
- package/dist/walk-state.d.ts +19 -0
- package/dist/walk-state.d.ts.map +1 -0
- package/dist/walk-state.js +32 -0
- package/dist/walk-state.js.map +1 -0
- package/dist/walk.d.ts +6 -0
- package/dist/walk.d.ts.map +1 -0
- package/dist/walk.js +198 -0
- package/dist/walk.js.map +1 -0
- package/package.json +1 -1
- package/prompts/base-reviewer.md +4 -4
- package/prompts/lightweight-reviewer.md +4 -4
- package/prompts/repo-reviewer.md +32 -0
- package/prompts/strict-reviewer.md +4 -4
package/README.md
CHANGED
|
@@ -46,7 +46,7 @@ mkdir -p .claude/commands
|
|
|
46
46
|
cp $(npm root -g)/redline-review/adapters/claude/redline-review.md .claude/commands/redline-review.md
|
|
47
47
|
```
|
|
48
48
|
|
|
49
|
-
###
|
|
49
|
+
### Use it in Claude Code
|
|
50
50
|
|
|
51
51
|
Open any project in Claude Code and type:
|
|
52
52
|
|
|
@@ -69,17 +69,100 @@ You can pass flags directly:
|
|
|
69
69
|
|
|
70
70
|
---
|
|
71
71
|
|
|
72
|
-
##
|
|
72
|
+
## Review modes
|
|
73
73
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
74
|
+
### Default — branch diff (PR-style)
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
redline-review
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Diffs the current branch against the detected base branch and assembles a review prompt. This is the original behavior — no subcommand needed.
|
|
81
|
+
|
|
82
|
+
### Range — review between two commits
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
redline-review range --from <commit-ish> --to <commit-ish>
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
One-shot review of everything that changed between two refs. `--to` defaults to `HEAD` if omitted.
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
# Review changes between two tags
|
|
92
|
+
redline-review range --from v1.0.0 --to v1.1.0
|
|
93
|
+
|
|
94
|
+
# Review the last 5 commits
|
|
95
|
+
redline-review range --from HEAD~5 --to HEAD
|
|
96
|
+
|
|
97
|
+
# Strict mode
|
|
98
|
+
redline-review range --from main --to HEAD --prompt strict
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Walk — commit-by-commit review
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
redline-review walk --start [--from <ref>] [--to <ref>] [--interval N] [--direction backwards|forwards]
|
|
105
|
+
redline-review walk --next
|
|
106
|
+
redline-review walk --status
|
|
107
|
+
redline-review walk --reset
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Steps through commits one at a time (or in batches), emitting a review prompt for each step. State is persisted in `.git/redline-walk.json`.
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
# Start walking backwards from HEAD to main (default)
|
|
114
|
+
redline-review walk --start
|
|
115
|
+
|
|
116
|
+
# Walk in batches of 2 commits
|
|
117
|
+
redline-review walk --start --interval 2
|
|
118
|
+
|
|
119
|
+
# Walk forwards from a specific point
|
|
120
|
+
redline-review walk --start --from v1.0.0 --direction forwards
|
|
121
|
+
|
|
122
|
+
# Get the next review prompt
|
|
123
|
+
redline-review walk --next
|
|
124
|
+
|
|
125
|
+
# Check progress
|
|
126
|
+
redline-review walk --status
|
|
127
|
+
|
|
128
|
+
# Clear walk state
|
|
129
|
+
redline-review walk --reset
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
The interactive "review → ask → continue" loop lives in your agent (see adapter docs), not in the CLI. The CLI stays stateless per invocation — it reads/writes a small state file but each call is a single deterministic function.
|
|
133
|
+
|
|
134
|
+
Flags passed at `--start` time (`--stack`, `--type`, `--prompt`) are captured into state and reused for every `--next`.
|
|
135
|
+
|
|
136
|
+
### Repo — full repository review
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
redline-review repo [--max-tree-depth N] [--stack ...] [--type ...] [--prompt ...]
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Emits a review prompt that instructs your agent to systematically explore the entire repository. The prompt includes:
|
|
143
|
+
|
|
144
|
+
- An annotated file tree with navigation hints (`[entry-point]`, `[config]`, `[migration]`, `[orchestration]`, `[largest]`)
|
|
145
|
+
- Inlined orientation files (package.json, go.mod, README, CI workflows, etc.)
|
|
146
|
+
- Architecture review dimensions (module boundaries, hidden coupling, consistency, abstraction quality, reliability hazards, architectural drift)
|
|
147
|
+
- Rule-based focus areas auto-detected from file extensions
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
# Review this repo
|
|
151
|
+
redline-review repo
|
|
152
|
+
|
|
153
|
+
# Limit tree depth for large repos
|
|
154
|
+
redline-review repo --max-tree-depth 3
|
|
155
|
+
|
|
156
|
+
# Override with explicit stack
|
|
157
|
+
redline-review repo --stack go --type architecture,concurrency
|
|
158
|
+
```
|
|
78
159
|
|
|
79
160
|
---
|
|
80
161
|
|
|
81
162
|
## Flags
|
|
82
163
|
|
|
164
|
+
All flags work with all modes (default, range, walk, repo).
|
|
165
|
+
|
|
83
166
|
### `--type` — focus by concern
|
|
84
167
|
|
|
85
168
|
```bash
|
|
@@ -123,16 +206,27 @@ redline-review --stack go --type backend
|
|
|
123
206
|
### `--prompt` — control review depth
|
|
124
207
|
|
|
125
208
|
```bash
|
|
126
|
-
redline-review --prompt base # default
|
|
209
|
+
redline-review --prompt base # default for diff-based modes
|
|
127
210
|
redline-review --prompt strict # CRITICAL and HIGH only + fix suggestions
|
|
128
211
|
redline-review --prompt lightweight # top 3 issues only
|
|
129
212
|
```
|
|
130
213
|
|
|
131
|
-
| Value | Output
|
|
132
|
-
| ---------------- |
|
|
214
|
+
| Value | Output |
|
|
215
|
+
| ---------------- | -------------------------------------------------- |
|
|
133
216
|
| `base` (default) | All issues grouped CRITICAL → HIGH → MEDIUM → LOW |
|
|
134
|
-
| `strict` | CRITICAL and HIGH only, concrete fix per issue
|
|
135
|
-
| `lightweight` | Top 3 issues, one tight paragraph each
|
|
217
|
+
| `strict` | CRITICAL and HIGH only, concrete fix per issue |
|
|
218
|
+
| `lightweight` | Top 3 issues, one tight paragraph each |
|
|
219
|
+
|
|
220
|
+
Repo mode defaults to its own `repo-reviewer` template (agent-driven exploration). Pass `--prompt strict` or `--prompt lightweight` to override.
|
|
221
|
+
|
|
222
|
+
### `--base` — override base branch
|
|
223
|
+
|
|
224
|
+
```bash
|
|
225
|
+
redline-review --base origin/develop
|
|
226
|
+
redline-review --base main
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
Only applies to the default (branch diff) mode. Range and walk use `--from`/`--to` instead.
|
|
136
230
|
|
|
137
231
|
---
|
|
138
232
|
|
|
@@ -154,6 +248,17 @@ redline-review --stack java --prompt lightweight
|
|
|
154
248
|
# Security review, any stack
|
|
155
249
|
redline-review --type security
|
|
156
250
|
|
|
251
|
+
# Review a release range
|
|
252
|
+
redline-review range --from v1.2.0 --to v1.3.0
|
|
253
|
+
|
|
254
|
+
# Walk through a feature branch commit by commit
|
|
255
|
+
redline-review walk --start --prompt strict
|
|
256
|
+
redline-review walk --next
|
|
257
|
+
redline-review walk --next
|
|
258
|
+
|
|
259
|
+
# Full repo audit
|
|
260
|
+
redline-review repo
|
|
261
|
+
|
|
157
262
|
# Pipe to clipboard (macOS) — paste into any agent
|
|
158
263
|
redline-review | pbcopy
|
|
159
264
|
|
|
@@ -174,6 +279,8 @@ When no `--type` or `--stack` flags are given, `redline-review` scans the diff f
|
|
|
174
279
|
|
|
175
280
|
If nothing is detected, falls back to `correctness + maintainability + risk-patterns`.
|
|
176
281
|
|
|
282
|
+
For repo mode (no diff), detection is based on file extensions in the repository.
|
|
283
|
+
|
|
177
284
|
Detected domains are printed to stderr so they don't pollute the prompt:
|
|
178
285
|
|
|
179
286
|
```
|
|
@@ -205,16 +312,23 @@ Domains (auto-detected): auth.yaml, concurrency.yaml, performance-db.yaml
|
|
|
205
312
|
|
|
206
313
|
Adapter files for other agents are in `adapters/`:
|
|
207
314
|
|
|
208
|
-
| Agent | Command
|
|
209
|
-
| -------------- |
|
|
210
|
-
| Claude Code | `cp $(npm root -g)/redline-review/adapters/claude/redline-review.md ~/.claude/commands/redline-review.md`
|
|
211
|
-
| GitHub Copilot | `cp $(npm root -g)/redline-review/adapters/copilot/redline-review.md .github/copilot-instructions.md`
|
|
212
|
-
| Codex CLI | `cp $(npm root -g)/redline-review/adapters/codex/redline-review.md AGENTS.md`
|
|
213
|
-
| OpenCode | `cp $(npm root -g)/redline-review/adapters/opencode/redline-review.md AGENTS.md`
|
|
214
|
-
| Anti-gravity | `cp $(npm root -g)/redline-review/adapters/antigravity/redline-review.md <your-config-path>`
|
|
315
|
+
| Agent | Command |
|
|
316
|
+
| -------------- | --------------------------------------------------------------------------------------------------------- |
|
|
317
|
+
| Claude Code | `cp $(npm root -g)/redline-review/adapters/claude/redline-review.md ~/.claude/commands/redline-review.md` |
|
|
318
|
+
| GitHub Copilot | `cp $(npm root -g)/redline-review/adapters/copilot/redline-review.md .github/copilot-instructions.md` |
|
|
319
|
+
| Codex CLI | `cp $(npm root -g)/redline-review/adapters/codex/redline-review.md AGENTS.md` |
|
|
320
|
+
| OpenCode | `cp $(npm root -g)/redline-review/adapters/opencode/redline-review.md AGENTS.md` |
|
|
321
|
+
| Anti-gravity | `cp $(npm root -g)/redline-review/adapters/antigravity/redline-review.md <your-config-path>` |
|
|
215
322
|
|
|
216
323
|
Each adapter follows the same pattern: run `redline-review`, take the output as the review task.
|
|
217
324
|
|
|
325
|
+
For the commit walk interactive flow, adapters should:
|
|
326
|
+
|
|
327
|
+
1. Run `redline-review walk --start` and perform the review
|
|
328
|
+
2. Ask the user: "Continue to the next commit?"
|
|
329
|
+
3. If yes, run `redline-review walk --next` and repeat
|
|
330
|
+
4. When walk is complete (exit 0 with no stdout), inform the user
|
|
331
|
+
|
|
218
332
|
---
|
|
219
333
|
|
|
220
334
|
## License
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detect-repo-stacks.d.ts","sourceRoot":"","sources":["../src/detect-repo-stacks.ts"],"names":[],"mappings":"AAkBA,wBAAgB,gBAAgB,IAAI,MAAM,EAAE,CAkC3C"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.detectRepoStacks = detectRepoStacks;
|
|
4
|
+
const child_process_1 = require("child_process");
|
|
5
|
+
const build_context_1 = require("./build-context");
|
|
6
|
+
const EXTENSION_STACK_MAP = {
|
|
7
|
+
'.go': 'go',
|
|
8
|
+
'.tsx': 'react',
|
|
9
|
+
'.jsx': 'react',
|
|
10
|
+
'.vue': 'vue',
|
|
11
|
+
'.svelte': 'svelte',
|
|
12
|
+
'.rb': 'rails',
|
|
13
|
+
'.java': 'java',
|
|
14
|
+
'.cs': 'csharp',
|
|
15
|
+
'.py': 'django',
|
|
16
|
+
'.php': 'laravel',
|
|
17
|
+
};
|
|
18
|
+
const FALLBACK_FILES = ['correctness.yaml', 'maintainability.yaml', 'risk-patterns.yaml'];
|
|
19
|
+
function detectRepoStacks() {
|
|
20
|
+
let files;
|
|
21
|
+
try {
|
|
22
|
+
const output = (0, child_process_1.execSync)('git ls-files', { encoding: 'utf8', stdio: ['pipe', 'pipe', 'pipe'] }).trim();
|
|
23
|
+
files = output ? output.split('\n') : [];
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
return FALLBACK_FILES;
|
|
27
|
+
}
|
|
28
|
+
const extCounts = new Map();
|
|
29
|
+
for (const f of files) {
|
|
30
|
+
const dot = f.lastIndexOf('.');
|
|
31
|
+
if (dot === -1)
|
|
32
|
+
continue;
|
|
33
|
+
const ext = f.slice(dot).toLowerCase();
|
|
34
|
+
extCounts.set(ext, (extCounts.get(ext) ?? 0) + 1);
|
|
35
|
+
}
|
|
36
|
+
const stacks = new Set();
|
|
37
|
+
for (const [ext, count] of extCounts) {
|
|
38
|
+
if (count < 2)
|
|
39
|
+
continue;
|
|
40
|
+
const stack = EXTENSION_STACK_MAP[ext];
|
|
41
|
+
if (stack)
|
|
42
|
+
stacks.add(stack);
|
|
43
|
+
}
|
|
44
|
+
// Detect Node.js projects by package.json presence
|
|
45
|
+
if (files.includes('package.json') && !stacks.has('react')) {
|
|
46
|
+
stacks.add('node');
|
|
47
|
+
}
|
|
48
|
+
if (stacks.size === 0)
|
|
49
|
+
return FALLBACK_FILES;
|
|
50
|
+
const result = (0, build_context_1.buildReviewContext)({ stack: Array.from(stacks) });
|
|
51
|
+
return result.length > 0 ? result : FALLBACK_FILES;
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=detect-repo-stacks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detect-repo-stacks.js","sourceRoot":"","sources":["../src/detect-repo-stacks.ts"],"names":[],"mappings":";;AAkBA,4CAkCC;AApDD,iDAAyC;AACzC,mDAAqD;AAErD,MAAM,mBAAmB,GAA2B;IAClD,KAAK,EAAE,IAAI;IACX,MAAM,EAAE,OAAO;IACf,MAAM,EAAE,OAAO;IACf,MAAM,EAAE,KAAK;IACb,SAAS,EAAE,QAAQ;I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M,KAAK,GAAG,mBAAmB,CAAC,GAAG,CAAC,CAAC;QACvC,IAAI,KAAK;YAAE,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAC/B,CAAC;IAED,mDAAmD;IACnD,IAAI,KAAK,CAAC,QAAQ,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC;QAC3D,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACrB,CAAC;IAED,IAAI,MAAM,CAAC,IAAI,KAAK,CAAC;QAAE,OAAO,cAAc,CAAC;IAE7C,MAAM,MAAM,GAAG,IAAA,kCAAkB,EAAC,EAAE,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACjE,OAAO,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,cAAc,CAAC;AACrD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AA2DA,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,kBAAkB,EAAE,MAAM,CAAC;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,wBAAgB,aAAa,CAAC,QAAQ,GAAE,MAAW,GAAG,cAAc,CA0FnE"}
|
package/dist/manifest.js
ADDED
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.buildManifest = buildManifest;
|
|
7
|
+
const fs_1 = __importDefault(require("fs"));
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const child_process_1 = require("child_process");
|
|
10
|
+
const ENTRY_POINT_PATTERNS = /^(main|index|app|server|entrypoint|bootstrap|startup)\./i;
|
|
11
|
+
const ORCHESTRATION_PATTERNS = /\b(runtime|scheduler|worker|queue|dispatcher|processor)\b/i;
|
|
12
|
+
const MIGRATION_PATTERNS = /\bmigrations?\b/i;
|
|
13
|
+
const CONFIG_BASENAMES = new Set([
|
|
14
|
+
'dockerfile', 'docker-compose.yml', 'docker-compose.yaml',
|
|
15
|
+
'makefile', 'justfile', 'taskfile.yml',
|
|
16
|
+
'.env.example', '.env.sample',
|
|
17
|
+
]);
|
|
18
|
+
const CONFIG_EXTENSIONS = new Set(['.tf', '.toml', '.ini']);
|
|
19
|
+
const BINARY_EXTENSIONS = new Set([
|
|
20
|
+
'.png', '.jpg', '.jpeg', '.gif', '.ico', '.svg', '.webp', '.bmp',
|
|
21
|
+
'.woff', '.woff2', '.ttf', '.eot', '.otf',
|
|
22
|
+
'.zip', '.tar', '.gz', '.bz2', '.7z', '.rar',
|
|
23
|
+
'.exe', '.dll', '.so', '.dylib', '.bin',
|
|
24
|
+
'.mp3', '.mp4', '.avi', '.mov', '.wav',
|
|
25
|
+
'.pdf', '.doc', '.docx', '.xls', '.xlsx',
|
|
26
|
+
'.pyc', '.class', '.o', '.obj',
|
|
27
|
+
]);
|
|
28
|
+
const ORIENTATION_FILES = [
|
|
29
|
+
'package.json', 'go.mod', 'Cargo.toml', 'pyproject.toml',
|
|
30
|
+
'Gemfile', 'pom.xml', 'build.gradle', 'composer.json',
|
|
31
|
+
'Makefile', 'justfile', 'Taskfile.yml',
|
|
32
|
+
'tsconfig.json',
|
|
33
|
+
];
|
|
34
|
+
const MAX_INLINE_SIZE = 2048;
|
|
35
|
+
const MAX_README_SIZE = 2048;
|
|
36
|
+
function isBinary(filePath) {
|
|
37
|
+
const ext = path_1.default.extname(filePath).toLowerCase();
|
|
38
|
+
return BINARY_EXTENSIONS.has(ext);
|
|
39
|
+
}
|
|
40
|
+
function getTag(filePath, basename) {
|
|
41
|
+
if (ENTRY_POINT_PATTERNS.test(basename))
|
|
42
|
+
return 'entry-point';
|
|
43
|
+
if (MIGRATION_PATTERNS.test(filePath))
|
|
44
|
+
return 'migration';
|
|
45
|
+
if (ORCHESTRATION_PATTERNS.test(basename))
|
|
46
|
+
return 'orchestration';
|
|
47
|
+
if (CONFIG_BASENAMES.has(basename.toLowerCase()))
|
|
48
|
+
return 'config';
|
|
49
|
+
if (CONFIG_EXTENSIONS.has(path_1.default.extname(filePath).toLowerCase()))
|
|
50
|
+
return 'config';
|
|
51
|
+
if (basename.toLowerCase().startsWith('config') || basename.toLowerCase().startsWith('settings'))
|
|
52
|
+
return 'config';
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
function getLineCount(filePath) {
|
|
56
|
+
try {
|
|
57
|
+
const output = (0, child_process_1.execSync)(`wc -l < "${filePath}"`, { encoding: 'utf8', stdio: ['pipe', 'pipe', 'pipe'] }).trim();
|
|
58
|
+
return parseInt(output, 10) || 0;
|
|
59
|
+
}
|
|
60
|
+
catch {
|
|
61
|
+
return 0;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
function buildManifest(maxDepth = 10) {
|
|
65
|
+
let files;
|
|
66
|
+
try {
|
|
67
|
+
const output = (0, child_process_1.execSync)('git ls-files', { encoding: 'utf8', stdio: ['pipe', 'pipe', 'pipe'] }).trim();
|
|
68
|
+
files = output ? output.split('\n') : [];
|
|
69
|
+
}
|
|
70
|
+
catch {
|
|
71
|
+
return { tree: '(no tracked files)', orientationContent: '', fileCount: 0, truncated: false };
|
|
72
|
+
}
|
|
73
|
+
const nonBinary = files.filter(f => !isBinary(f));
|
|
74
|
+
// Compute largest files (top 10 by line count)
|
|
75
|
+
const fileSizes = [];
|
|
76
|
+
for (const f of nonBinary.slice(0, 500)) {
|
|
77
|
+
const lines = getLineCount(f);
|
|
78
|
+
if (lines > 0)
|
|
79
|
+
fileSizes.push({ file: f, lines });
|
|
80
|
+
}
|
|
81
|
+
fileSizes.sort((a, b) => b.lines - a.lines);
|
|
82
|
+
const largestFiles = new Set(fileSizes.slice(0, 10).map(f => f.file));
|
|
83
|
+
const largestMap = new Map(fileSizes.slice(0, 10).map(f => [f.file, f.lines]));
|
|
84
|
+
// Build annotated tree
|
|
85
|
+
let truncated = false;
|
|
86
|
+
const treeLines = [];
|
|
87
|
+
for (const f of nonBinary) {
|
|
88
|
+
const depth = f.split('/').length - 1;
|
|
89
|
+
if (depth > maxDepth) {
|
|
90
|
+
truncated = true;
|
|
91
|
+
continue;
|
|
92
|
+
}
|
|
93
|
+
const basename = path_1.default.basename(f);
|
|
94
|
+
const tag = getTag(f, basename);
|
|
95
|
+
const isLargest = largestFiles.has(f);
|
|
96
|
+
let annotation = '';
|
|
97
|
+
if (tag)
|
|
98
|
+
annotation += ` [${tag}]`;
|
|
99
|
+
if (isLargest)
|
|
100
|
+
annotation += ` (${largestMap.get(f)} lines) [largest]`;
|
|
101
|
+
treeLines.push(f + annotation);
|
|
102
|
+
}
|
|
103
|
+
if (truncated) {
|
|
104
|
+
const truncCount = nonBinary.filter(f => f.split('/').length - 1 > maxDepth).length;
|
|
105
|
+
treeLines.push(`... (${truncCount} files beyond depth ${maxDepth} truncated)`);
|
|
106
|
+
}
|
|
107
|
+
// Inline orientation files
|
|
108
|
+
const orientationParts = [];
|
|
109
|
+
for (const name of ORIENTATION_FILES) {
|
|
110
|
+
if (!files.includes(name))
|
|
111
|
+
continue;
|
|
112
|
+
try {
|
|
113
|
+
const content = fs_1.default.readFileSync(name, 'utf8');
|
|
114
|
+
if (content.length <= MAX_INLINE_SIZE) {
|
|
115
|
+
orientationParts.push(`### ${name}\n\`\`\`\n${content.trimEnd()}\n\`\`\``);
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
orientationParts.push(`### ${name}\n\`\`\`\n${content.slice(0, MAX_INLINE_SIZE).trimEnd()}\n... (truncated)\n\`\`\``);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
catch {
|
|
122
|
+
continue;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
// Inline README (first 2KB)
|
|
126
|
+
const readmeFile = files.find(f => /^readme\.md$/i.test(f));
|
|
127
|
+
if (readmeFile) {
|
|
128
|
+
try {
|
|
129
|
+
const content = fs_1.default.readFileSync(readmeFile, 'utf8');
|
|
130
|
+
const trimmed = content.slice(0, MAX_README_SIZE).trimEnd();
|
|
131
|
+
orientationParts.push(`### ${readmeFile}\n${trimmed}${content.length > MAX_README_SIZE ? '\n... (truncated)' : ''}`);
|
|
132
|
+
}
|
|
133
|
+
catch { /* skip */ }
|
|
134
|
+
}
|
|
135
|
+
// Inline CI workflows (truncated)
|
|
136
|
+
const ciFiles = files.filter(f => f.startsWith('.github/workflows/') && f.endsWith('.yml'));
|
|
137
|
+
for (const f of ciFiles.slice(0, 3)) {
|
|
138
|
+
try {
|
|
139
|
+
const content = fs_1.default.readFileSync(f, 'utf8');
|
|
140
|
+
const trimmed = content.slice(0, 1024).trimEnd();
|
|
141
|
+
orientationParts.push(`### ${f}\n\`\`\`yaml\n${trimmed}${content.length > 1024 ? '\n... (truncated)' : ''}\n\`\`\``);
|
|
142
|
+
}
|
|
143
|
+
catch {
|
|
144
|
+
continue;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
return {
|
|
148
|
+
tree: treeLines.join('\n'),
|
|
149
|
+
orientationContent: orientationParts.join('\n\n'),
|
|
150
|
+
fileCount: files.length,
|
|
151
|
+
truncated,
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
//# sourceMappingURL=manifest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":";;;;;AAkEA,sCA0FC;AA5JD,4CAAoB;AACpB,gDAAwB;AACxB,iDAAyC;AAEzC,MAAM,oBAAoB,GAAG,0DAA0D,CAAC;AACxF,MAAM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AC;IAED,kCAAkC;IAClC,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;IAC5F,KAAK,MAAM,CAAC,IAAI,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;QACpC,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,YAAE,CAAC,YAAY,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;YAC3C,MAAM,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;YACjD,gBAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,iBAAiB,OAAO,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC;QACvH,CAAC;QAAC,MAAM,CAAC;YAAC,SAAS;QAAC,CAAC;IACvB,CAAC;IAED,OAAO;QACL,IAAI,EAAE,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC;QAC1B,kBAAkB,EAAE,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC;QACjD,SAAS,EAAE,KAAK,CAAC,MAAM;QACvB,SAAS;KACV,CAAC;AACJ,CAAC"}
|
package/dist/range.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"range.d.ts","sourceRoot":"","sources":["../src/range.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAc,MAAM,kBAAkB,CAAC;AAY3D,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,WAAW,CAwC7D"}
|
package/dist/range.js
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.collectRangeInput = collectRangeInput;
|
|
4
|
+
const child_process_1 = require("child_process");
|
|
5
|
+
const redline_review_1 = require("./redline-review");
|
|
6
|
+
function resolveRef(ref) {
|
|
7
|
+
try {
|
|
8
|
+
return (0, child_process_1.execSync)(`git rev-parse --verify ${ref}^{commit}`, { encoding: 'utf8', stdio: ['pipe', 'pipe', 'pipe'] }).trim();
|
|
9
|
+
}
|
|
10
|
+
catch {
|
|
11
|
+
process.stderr.write(`Error: "${ref}" is not a valid commit reference.\n`);
|
|
12
|
+
process.exit(1);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
function collectRangeInput(argv) {
|
|
16
|
+
const get = (flag) => {
|
|
17
|
+
const idx = argv.indexOf(flag);
|
|
18
|
+
return idx !== -1 ? argv[idx + 1] : undefined;
|
|
19
|
+
};
|
|
20
|
+
const fromRef = get('--from');
|
|
21
|
+
if (!fromRef) {
|
|
22
|
+
process.stderr.write('Error: --from is required for range review.\n');
|
|
23
|
+
process.exit(1);
|
|
24
|
+
}
|
|
25
|
+
const toRef = get('--to') ?? 'HEAD';
|
|
26
|
+
const fromSha = resolveRef(fromRef);
|
|
27
|
+
const toSha = resolveRef(toRef);
|
|
28
|
+
const diff = (0, redline_review_1.getGitDiff)({ from: fromSha, to: toSha, threeDot: true });
|
|
29
|
+
if (diff.length === 0) {
|
|
30
|
+
process.stderr.write(`No changes between ${fromRef} and ${toRef}.\n`);
|
|
31
|
+
process.exit(0);
|
|
32
|
+
}
|
|
33
|
+
// Warn if --to is an ancestor of --from (args may be swapped)
|
|
34
|
+
try {
|
|
35
|
+
const isAncestor = (0, child_process_1.execSync)(`git merge-base --is-ancestor ${toSha} ${fromSha}`, { stdio: ['pipe', 'pipe', 'pipe'] });
|
|
36
|
+
// If the command succeeds (exit 0), toSha is ancestor of fromSha
|
|
37
|
+
process.stderr.write(`Warning: "${toRef}" is an ancestor of "${fromRef}" — did you swap the arguments?\n`);
|
|
38
|
+
}
|
|
39
|
+
catch {
|
|
40
|
+
// Not an ancestor — expected path, no warning needed
|
|
41
|
+
}
|
|
42
|
+
process.stderr.write(`Range: ${fromRef} (${fromSha.slice(0, 7)}) → ${toRef} (${toSha.slice(0, 7)})\n`);
|
|
43
|
+
return {
|
|
44
|
+
mode: 'range',
|
|
45
|
+
reviewContent: diff,
|
|
46
|
+
metadata: { from: fromRef, to: toRef },
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=range.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"range.js","sourceRoot":"","sources":["../src/range.ts"],"names":[],"mappings":";;AAaA,8CAwCC;AArDD,iDAAyC;AACzC,qDAA2D;AAE3D,SAAS,UAAU,CAAC,GAAW;IAC7B,IAAI,CAAC;QACH,OAAO,IAAA,wBAAQ,EAAC,0BAA0B,GAAG,WAAW,EACtD,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IAClE,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,GAAG,sCAAsC,CAAC,CAAC;QAC3E,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC;AAED,SAAgB,iBAAiB,CAAC,IAAc;IAC9C,MAAM,GAAG,GAAG,CAAC,IAAY,EAAsB,EAAE;QAC/C,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAC/B,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAChD,CAAC,CAAC;IAEF,MAAM,OAAO,GAAG,GAAG,CAAC,QAAQ,CAAC,CAAC;IAC9B,IAAI,CAAC,OAAO,EAAE,CAA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AE,IAAI;QACnB,QAAQ,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE;KACvC,CAAC;AACJ,CAAC"}
|
package/dist/redline-review.d.ts
CHANGED
|
@@ -1,3 +1,37 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
interface Rule {
|
|
3
|
+
id: string;
|
|
4
|
+
severity: 'critical' | 'high' | 'medium' | 'low';
|
|
5
|
+
detect: string;
|
|
6
|
+
examples?: string[];
|
|
7
|
+
}
|
|
8
|
+
interface RuleFile {
|
|
9
|
+
category: string;
|
|
10
|
+
severity_context?: string;
|
|
11
|
+
rules: Rule[];
|
|
12
|
+
}
|
|
13
|
+
export interface ReviewInput {
|
|
14
|
+
mode: 'branch' | 'range' | 'walk' | 'repo';
|
|
15
|
+
reviewContent: string;
|
|
16
|
+
metadata?: Record<string, unknown>;
|
|
17
|
+
}
|
|
18
|
+
export interface ParsedArgs {
|
|
19
|
+
stack?: string[];
|
|
20
|
+
reviewType?: string[];
|
|
21
|
+
promptVariant: string;
|
|
22
|
+
base?: string;
|
|
23
|
+
}
|
|
24
|
+
export declare function parseArgs(argv?: string[]): ParsedArgs;
|
|
25
|
+
export declare function getGitDiff(opts: {
|
|
26
|
+
from: string;
|
|
27
|
+
to: string;
|
|
28
|
+
threeDot?: boolean;
|
|
29
|
+
}): string;
|
|
30
|
+
export declare function loadRules(rulesDir: string, selectedFiles?: string[]): RuleFile[];
|
|
31
|
+
export declare function formatRulesForPrompt(ruleFiles: RuleFile[]): string;
|
|
32
|
+
export declare function renderContext(mode: ReviewInput['mode'], metadata?: Record<string, unknown>): string;
|
|
33
|
+
export declare function buildPrompt(template: string, input: ReviewInput, selectedRules: string): string;
|
|
34
|
+
export declare function resolvePromptPath(variant: string, promptsDir: string, mode?: ReviewInput['mode']): string;
|
|
35
|
+
export declare function runPipeline(input: ReviewInput, args: ParsedArgs, preSelectedFiles?: string[]): void;
|
|
2
36
|
export {};
|
|
3
37
|
//# sourceMappingURL=redline-review.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"redline-review.d.ts","sourceRoot":"","sources":["../src/redline-review.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"redline-review.d.ts","sourceRoot":"","sources":["../src/redline-review.ts"],"names":[],"mappings":";AAYA,UAAU,IAAI;IACZ,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,UAAU,GAAG,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC;IACjD,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,UAAU,QAAQ;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,KAAK,EAAE,IAAI,EAAE,CAAC;CACf;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;IAC3C,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED,MAAM,WAAW,UAAU;IACzB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,SAAS,CAAC,IAAI,GAAE,MAAM,EAAiB,GAAG,UAAU,CAcnE;AAiBD,wBAAgB,UAAU,CAAC,IAAI,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,MAAM,CAQzF;AA8BD,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,MAAM,EAAE,GAAG,QAA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