@chappibunny/repolens 0.9.0 → 1.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/CHANGELOG.md +93 -0
- package/README.md +67 -33
- package/package.json +1 -1
- package/src/ai/generate-sections.js +0 -6
- package/src/ai/provider.js +30 -19
- package/src/cli.js +35 -15
- package/src/core/config-schema.js +61 -12
- package/src/init.js +2 -5
- package/src/migrate.js +91 -9
- package/src/publishers/github-wiki.js +461 -0
- package/src/publishers/index.js +24 -2
- package/src/publishers/notion.js +2 -2
- package/src/publishers/publish.js +2 -1
- package/src/utils/branch.js +27 -0
- package/src/utils/rate-limit.js +4 -2
- package/src/utils/telemetry.js +6 -2
- package/src/utils/update-check.js +2 -2
- package/src/utils/validate.js +33 -24
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,99 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to RepoLens will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## 1.2.0
|
|
6
|
+
|
|
7
|
+
### ✨ Config Migration
|
|
8
|
+
|
|
9
|
+
- **`repolens migrate` now patches `.repolens.yml`**: Automatically adds `configVersion: 1` to legacy config files that are missing it. Creates a `.repolens.yml.backup` before modifying. Supports both `.yml` and `.yaml` extensions, dry-run mode, and graceful handling of parse errors or missing configs.
|
|
10
|
+
|
|
11
|
+
### � Bug Fixes
|
|
12
|
+
|
|
13
|
+
- **GitHub Wiki empty pages**: Fixed branch mismatch where `git init` created a `main` branch but GitHub Wiki serves from `master`. Now explicitly initializes with `master` and pushes to `refs/heads/master`. Also added content validation to skip pages with empty content.
|
|
14
|
+
|
|
15
|
+
### �📝 Documentation
|
|
16
|
+
|
|
17
|
+
- Updated all documentation to reflect v1.2.0 version references
|
|
18
|
+
- Updated TROUBLESHOOTING.md with `migrate` auto-fix hint for missing `configVersion`
|
|
19
|
+
- Updated KNOWN_ISSUES.md planned improvements (removed shipped features)
|
|
20
|
+
- Updated ROADMAP.md with v1.1.0 shipped items
|
|
21
|
+
|
|
22
|
+
## 1.1.0
|
|
23
|
+
|
|
24
|
+
### ✨ GitHub Wiki Publisher UX Enhancement
|
|
25
|
+
|
|
26
|
+
Major upgrade to the wiki output quality — better information hierarchy, audience-aware navigation, and richer page structure.
|
|
27
|
+
|
|
28
|
+
- **Audience-grouped Home page**: Pages organized by reader (Stakeholders, Engineers, New Contributors, Change Tracking) instead of a flat list
|
|
29
|
+
- **Page descriptions**: Each link on Home includes a one-line summary of the page's purpose
|
|
30
|
+
- **Status rail**: Home page now shows a metadata table (project, branch, page count, publisher, source)
|
|
31
|
+
- **Recommended reading order**: Guided path through the docs for first-time readers
|
|
32
|
+
- **Grouped sidebar**: Navigation split into Overview and Architecture sections (plus Custom Pages)
|
|
33
|
+
- **Page metadata headers**: Every page gets a `[← Home](Home)` back-link, audience tag, and branch indicator
|
|
34
|
+
- **Cleaner footer**: Compact format with branch context and Home link
|
|
35
|
+
- **New constants**: `PAGE_DESCRIPTIONS`, `AUDIENCE_GROUPS`, `SIDEBAR_GROUPS`, `PAGE_AUDIENCE`
|
|
36
|
+
- **New helpers**: `getPageDisplayTitle()`, `getCustomPageKeys()`, `wikiLink()`, `pageHeader()`
|
|
37
|
+
|
|
38
|
+
### 🐛 Bug Fixes
|
|
39
|
+
- **Temperature still sent to GPT-5**: `DEFAULT_TEMPERATURE = 0.2` always leaked into API requests even after v1.0.1 fixes — the fallback chain (`temperature ?? aiConfig.temperature ?? DEFAULT_TEMPERATURE`) guaranteed it was never `undefined`. Removed the default entirely; temperature is now only sent when explicitly configured via `REPOLENS_AI_TEMPERATURE` env var or `ai.temperature` in config.
|
|
40
|
+
|
|
41
|
+
## 1.0.1
|
|
42
|
+
|
|
43
|
+
### 🐛 Bug Fixes
|
|
44
|
+
- **GPT-5 API compatibility**: Use `max_completion_tokens` instead of deprecated `max_tokens` parameter
|
|
45
|
+
- **GPT-5 temperature handling**: Omit `temperature` from API requests for models that only support the default value (e.g. gpt-5-mini)
|
|
46
|
+
- Removed all hardcoded `temperature: 0.2` overrides from AI section generators
|
|
47
|
+
- Removed `REPOLENS_AI_TEMPERATURE` from CI workflow and `.env.example`
|
|
48
|
+
- Updated `init` scaffolding to omit temperature from default config
|
|
49
|
+
|
|
50
|
+
### 🔧 Improvements
|
|
51
|
+
- Upgraded GitHub Actions: checkout v4.2.2, setup-node v4.2.0, Node.js 22
|
|
52
|
+
|
|
53
|
+
## 1.0.0
|
|
54
|
+
|
|
55
|
+
### 🎉 Stable Release
|
|
56
|
+
|
|
57
|
+
RepoLens v1.0.0 marks the first stable release with a frozen public API. All CLI commands, configuration schema, and plugin interfaces are now covered by semantic versioning guarantees. See [STABILITY.md](STABILITY.md) for the full contract.
|
|
58
|
+
|
|
59
|
+
### ✨ New Features
|
|
60
|
+
- **GitHub Wiki Publisher**: Publish documentation directly to your repository's Wiki tab
|
|
61
|
+
- Git-based: clones wiki repo, writes pages, commits and pushes
|
|
62
|
+
- Generates `Home.md` index, `_Sidebar.md` navigation, `_Footer.md`
|
|
63
|
+
- Branch filtering via `github_wiki.branches` in `.repolens.yml`
|
|
64
|
+
- Auto-detects repository from `GITHUB_REPOSITORY` env or git remote
|
|
65
|
+
- Token sanitization in error messages (never leaks `GITHUB_TOKEN`)
|
|
66
|
+
- Config: `sidebar` and `footer` toggles
|
|
67
|
+
- 17 tests covering publishing, branch filtering, config validation, and security
|
|
68
|
+
|
|
69
|
+
### 🐛 Bug Fixes
|
|
70
|
+
- **GPT-5 API compatibility**: Use `max_completion_tokens` instead of deprecated `max_tokens` parameter
|
|
71
|
+
- **GPT-5 temperature handling**: Omit `temperature` from API requests for models that only support the default value (e.g. gpt-5-mini)
|
|
72
|
+
- **Git identity in wiki publisher**: Set committer name/email (`RepoLens Bot`) so CI runners can commit
|
|
73
|
+
- **Publisher allowlist**: Added `github_wiki` to `validate.js` publisher validation (was only in `config-schema.js`)
|
|
74
|
+
- **Doctor false-success**: `repolens doctor` now correctly exits with code 2 when `runDoctor()` reports failures (previously always printed "validation passed")
|
|
75
|
+
- **Feedback exit code**: `repolens feedback` now exits with code 1 when feedback fails to send (previously exited 0)
|
|
76
|
+
- **Unknown flags**: `repolens --unknown-flag` now prints an error instead of silently running publish
|
|
77
|
+
- **scan.ignore security bypass**: Security validator now checks `scan.ignore` patterns (was incorrectly checking non-existent `scan.exclude`)
|
|
78
|
+
- **Domains type mismatch**: Both validators now expect `domains` as an object (was array in security validator, object in schema validator)
|
|
79
|
+
- **Plugin publisher crash isolation**: Plugin publisher errors are now caught and logged instead of crashing the pipeline
|
|
80
|
+
|
|
81
|
+
### ✅ Config Stability
|
|
82
|
+
- `configVersion: 1` is now **required** (was optional in schema validator)
|
|
83
|
+
- Added `confluence` config section validation (branches array)
|
|
84
|
+
- Added `ai.temperature` range validation (0–2)
|
|
85
|
+
- Added `ai.max_tokens` range validation (>0)
|
|
86
|
+
- AI config values from `.repolens.yml` are now used as fallbacks when env vars are not set
|
|
87
|
+
|
|
88
|
+
### 🔧 Improvements
|
|
89
|
+
- Standardized exit codes: `EXIT_SUCCESS=0`, `EXIT_ERROR=1`, `EXIT_VALIDATION=2` as named constants
|
|
90
|
+
- Replaced all `console.log`/`console.warn` in production code with logger utilities
|
|
91
|
+
- Removed stale "v0.4.0" references from CLI help text and migrate command
|
|
92
|
+
- Sentry DSN moved to `REPOLENS_SENTRY_DSN` env var (with backwards-compatible default)
|
|
93
|
+
- Hardcoded email in `init` scaffolding replaced with `your-email@example.com` placeholder
|
|
94
|
+
|
|
95
|
+
### 📄 Documentation
|
|
96
|
+
- Added [STABILITY.md](STABILITY.md): Complete public API contract (CLI, config schema, plugin interface, exit codes, env vars)
|
|
97
|
+
|
|
5
98
|
## 0.9.0
|
|
6
99
|
|
|
7
100
|
### ✨ New Features
|
package/README.md
CHANGED
|
@@ -16,11 +16,11 @@
|
|
|
16
16
|
|
|
17
17
|
AI-assisted documentation intelligence system that generates architecture docs for engineers AND readable system docs for stakeholders
|
|
18
18
|
|
|
19
|
-
**Current Status**:
|
|
19
|
+
**Current Status**: v1.2.0 — Stable Release
|
|
20
20
|
|
|
21
21
|
RepoLens automatically generates and maintains living architecture documentation by analyzing your repository structure, extracting meaningful insights from your package.json, and creating visual dependency graphs. Run it once, or let it auto-update on every push.
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
The CLI, configuration schema, and plugin interface are **stable** as of v1.0. See [STABILITY.md](STABILITY.md) for the full API contract and semver guarantees.
|
|
24
24
|
|
|
25
25
|
---
|
|
26
26
|
|
|
@@ -49,7 +49,7 @@ For Confluence:
|
|
|
49
49
|
```bash
|
|
50
50
|
# Edit .env and add:
|
|
51
51
|
CONFLUENCE_URL=https://your-company.atlassian.net/wiki
|
|
52
|
-
CONFLUENCE_EMAIL=
|
|
52
|
+
CONFLUENCE_EMAIL=your-email@example.com
|
|
53
53
|
CONFLUENCE_API_TOKEN=your-token
|
|
54
54
|
CONFLUENCE_SPACE_KEY=DOCS
|
|
55
55
|
```
|
|
@@ -124,7 +124,7 @@ RepoLens automatically detects:
|
|
|
124
124
|
✅ **Deterministic Fallback** - Always generates docs even if AI unavailable
|
|
125
125
|
✅ **Business Domain Inference** - Automatically maps code to business functions
|
|
126
126
|
✅ **Data Flow Analysis** - Understands how information moves through your system
|
|
127
|
-
✅ **Multiple Publishers** - Output to Notion, Confluence, Markdown, or all
|
|
127
|
+
✅ **Multiple Publishers** - Output to Notion, Confluence, GitHub Wiki, Markdown, or all four
|
|
128
128
|
✅ **Branch-Aware** - Prevent doc conflicts across branches
|
|
129
129
|
✅ **GitHub Actions** - Autonomous operation on every push
|
|
130
130
|
✅ **Team Notifications** - Discord integration with rich embeds (NEW in v0.6.0)
|
|
@@ -137,6 +137,8 @@ RepoLens automatically detects:
|
|
|
137
137
|
✅ **TypeScript Type Graph** - Map interfaces, classes, and type relationships (NEW in v0.8.0)
|
|
138
138
|
✅ **Dependency Graph** - Import analysis with circular dependency detection (NEW in v0.8.0)
|
|
139
139
|
✅ **Architecture Drift** - Track structural changes against a baseline (NEW in v0.8.0)
|
|
140
|
+
✅ **Plugin System** - Extend with custom renderers, publishers, and hooks (NEW in v0.9.0)
|
|
141
|
+
✅ **Stable API** - CLI, config, and plugin interface frozen with semver guarantees (v1.0.0)
|
|
140
142
|
|
|
141
143
|
---
|
|
142
144
|
|
|
@@ -228,10 +230,12 @@ npm link
|
|
|
228
230
|
Install from a specific version:
|
|
229
231
|
|
|
230
232
|
```bash
|
|
231
|
-
npm install https://github.com/CHAPIBUNNY/repolens/releases/download/
|
|
233
|
+
npm install https://github.com/CHAPIBUNNY/repolens/releases/download/v1.2.0/chappibunny-repolens-1.2.0.tgz
|
|
232
234
|
```
|
|
233
235
|
</details>
|
|
234
236
|
|
|
237
|
+
> **Having install problems?** See [TROUBLESHOOTING.md](TROUBLESHOOTING.md) for solutions to common issues like `ENOTEMPTY`, `npm ci` failures, and stale versions.
|
|
238
|
+
|
|
235
239
|
---
|
|
236
240
|
|
|
237
241
|
## 🎓 Complete Onboarding Guide
|
|
@@ -311,6 +315,14 @@ publishers:
|
|
|
311
315
|
```
|
|
312
316
|
Maximum visibility: Notion for async collaboration, Confluence for enterprise docs, Markdown for local backups.
|
|
313
317
|
|
|
318
|
+
**GitHub Wiki** (ideal for open source):
|
|
319
|
+
```yaml
|
|
320
|
+
publishers:
|
|
321
|
+
- github_wiki
|
|
322
|
+
- markdown
|
|
323
|
+
```
|
|
324
|
+
Docs live alongside your code — accessible from the repo's Wiki tab. Requires `GITHUB_TOKEN`.
|
|
325
|
+
|
|
314
326
|
### Step 3: Enable AI Features (Optional)
|
|
315
327
|
|
|
316
328
|
**AI-enhanced documentation adds natural language explanations for non-technical audiences.**
|
|
@@ -318,7 +330,7 @@ Maximum visibility: Notion for async collaboration, Confluence for enterprise do
|
|
|
318
330
|
**3.1: Choose an AI Provider**
|
|
319
331
|
|
|
320
332
|
RepoLens works with any OpenAI-compatible API:
|
|
321
|
-
- **OpenAI** (gpt-
|
|
333
|
+
- **OpenAI** (gpt-5-mini, gpt-5.4, gpt-5-nano)
|
|
322
334
|
- **Anthropic Claude** (via API gateway)
|
|
323
335
|
- **Azure OpenAI** (enterprise deployments)
|
|
324
336
|
- **Local Models** (Ollama, LM Studio, etc.)
|
|
@@ -333,8 +345,7 @@ REPOLENS_AI_API_KEY=sk-xxxxxxxxxxxxx
|
|
|
333
345
|
|
|
334
346
|
# Optional: Customize provider
|
|
335
347
|
REPOLENS_AI_BASE_URL=https://api.openai.com/v1
|
|
336
|
-
REPOLENS_AI_MODEL=gpt-
|
|
337
|
-
REPOLENS_AI_TEMPERATURE=0.3
|
|
348
|
+
REPOLENS_AI_MODEL=gpt-5-mini
|
|
338
349
|
REPOLENS_AI_MAX_TOKENS=2000
|
|
339
350
|
```
|
|
340
351
|
|
|
@@ -344,7 +355,6 @@ REPOLENS_AI_MAX_TOKENS=2000
|
|
|
344
355
|
ai:
|
|
345
356
|
enabled: true # Enable AI features
|
|
346
357
|
mode: hybrid # hybrid, full, or off
|
|
347
|
-
temperature: 0.3 # Lower = more focused (0.0-1.0)
|
|
348
358
|
max_tokens: 2000 # Token limit per request
|
|
349
359
|
|
|
350
360
|
features:
|
|
@@ -356,7 +366,7 @@ features:
|
|
|
356
366
|
change_impact: true # Architecture diff with context
|
|
357
367
|
```
|
|
358
368
|
|
|
359
|
-
**Cost Estimates** (with gpt-
|
|
369
|
+
**Cost Estimates** (with gpt-5-mini):
|
|
360
370
|
- Small repo (<50 files): $0.10-$0.30 per run
|
|
361
371
|
- Medium repo (50-200 files): $0.30-$0.80 per run
|
|
362
372
|
- Large repo (200+ files): $0.80-$2.00 per run
|
|
@@ -428,7 +438,7 @@ If using the Confluence publisher:
|
|
|
428
438
|
Create `.env` in your project root:
|
|
429
439
|
```bash
|
|
430
440
|
CONFLUENCE_URL=https://your-company.atlassian.net/wiki
|
|
431
|
-
CONFLUENCE_EMAIL=
|
|
441
|
+
CONFLUENCE_EMAIL=your-email@example.com
|
|
432
442
|
CONFLUENCE_API_TOKEN=your-api-token-here
|
|
433
443
|
CONFLUENCE_SPACE_KEY=DOCS
|
|
434
444
|
CONFLUENCE_PARENT_PAGE_ID=123456789 # Optional
|
|
@@ -449,7 +459,7 @@ Add as repository secrets:
|
|
|
449
459
|
2. Click **"New repository secret"**
|
|
450
460
|
3. Add:
|
|
451
461
|
- Name: `CONFLUENCE_URL`, Value: `https://your-company.atlassian.net/wiki`
|
|
452
|
-
- Name: `CONFLUENCE_EMAIL`, Value: `
|
|
462
|
+
- Name: `CONFLUENCE_EMAIL`, Value: `your-email@example.com`
|
|
453
463
|
- Name: `CONFLUENCE_API_TOKEN`, Value: `your-token`
|
|
454
464
|
- Name: `CONFLUENCE_SPACE_KEY`, Value: `DOCS`
|
|
455
465
|
- Name: `CONFLUENCE_PARENT_PAGE_ID`, Value: `123456789` (optional)
|
|
@@ -939,13 +949,17 @@ features:
|
|
|
939
949
|
|
|
940
950
|
| Field | Type | Required | Description |
|
|
941
951
|
|-------|------|----------|-------------|
|
|
942
|
-
| `configVersion` | number |
|
|
952
|
+
| `configVersion` | number | **Yes** | Schema version (must be `1`) |
|
|
943
953
|
| `project.name` | string | Yes | Project name |
|
|
944
954
|
| `project.docs_title_prefix` | string | No | Prefix for documentation titles (default: project name) |
|
|
945
|
-
| `publishers` | array | Yes | Output targets: `notion`, `confluence`, `markdown` |
|
|
955
|
+
| `publishers` | array | Yes | Output targets: `notion`, `confluence`, `github_wiki`, `markdown` (+ plugin publishers) |
|
|
956
|
+
| `plugins` | array | No | Plugin paths or npm package names |
|
|
946
957
|
| `notion.branches` | array | No | Branch whitelist for Notion publishing. Supports globs. |
|
|
947
958
|
| `notion.includeBranchInTitle` | boolean | No | Add `[branch-name]` to titles (default: `true`) |
|
|
948
959
|
| `confluence.branches` | array | No | Branch whitelist for Confluence publishing. Supports globs. |
|
|
960
|
+
| `github_wiki.branches` | array | No | Branch whitelist for GitHub Wiki publishing. Supports globs. |
|
|
961
|
+
| `github_wiki.sidebar` | boolean | No | Generate `_Sidebar.md` navigation (default: `true`) |
|
|
962
|
+
| `github_wiki.footer` | boolean | No | Generate `_Footer.md` (default: `true`) |
|
|
949
963
|
| `discord.enabled` | boolean | No | Enable Discord notifications (default: `true` if webhook set) |
|
|
950
964
|
| `discord.notifyOn` | string | No | Notification policy: `always`, `significant`, `never` (default: `significant`) |
|
|
951
965
|
| `discord.significantThreshold` | number | No | Change % threshold for notifications (default: `10`) |
|
|
@@ -956,7 +970,11 @@ features:
|
|
|
956
970
|
| `scan.ignore` | array | Yes | Glob patterns to exclude |
|
|
957
971
|
| `module_roots` | array | No | Root directories for module detection |
|
|
958
972
|
| `outputs.pages` | array | Yes | Documentation pages to generate |
|
|
959
|
-
| `features` | object | No |
|
|
973
|
+
| `features` | object | No | Feature flags (boolean values) |
|
|
974
|
+
| `ai.enabled` | boolean | No | Enable AI-powered documentation |
|
|
975
|
+
| `ai.mode` | string | No | AI mode: `hybrid`, `full`, or `off` |
|
|
976
|
+
| `ai.temperature` | number | No | Generation temperature (0–2). Not supported by all models (e.g. gpt-5-mini ignores it) |
|
|
977
|
+
| `ai.max_tokens` | number | No | Max completion tokens per request (>0) |
|
|
960
978
|
|
|
961
979
|
---
|
|
962
980
|
|
|
@@ -986,6 +1004,13 @@ Optional for Discord notifications:
|
|
|
986
1004
|
|----------|----------|-------------|
|
|
987
1005
|
| `DISCORD_WEBHOOK_URL` | No | Discord webhook URL for team notifications |
|
|
988
1006
|
|
|
1007
|
+
Required for GitHub Wiki publisher:
|
|
1008
|
+
|
|
1009
|
+
| Variable | Required | Description |
|
|
1010
|
+
|----------|----------|-------------|
|
|
1011
|
+
| `GITHUB_TOKEN` | Yes | Personal access token or Actions `${{ secrets.GITHUB_TOKEN }}` |
|
|
1012
|
+
| `GITHUB_REPOSITORY` | No | `owner/repo` (auto-detected from git remote in Actions) |
|
|
1013
|
+
|
|
989
1014
|
**Local Development:** Create `.env` file in project root
|
|
990
1015
|
**GitHub Actions:** Add as repository secrets in Settings → Secrets and variables → Actions
|
|
991
1016
|
|
|
@@ -1070,7 +1095,7 @@ npm test
|
|
|
1070
1095
|
- Integration workflows
|
|
1071
1096
|
- Doctor command validation
|
|
1072
1097
|
|
|
1073
|
-
**Coverage:**
|
|
1098
|
+
**Coverage:** 180 tests passing across 15 test files
|
|
1074
1099
|
|
|
1075
1100
|
### Test Package Installation Locally
|
|
1076
1101
|
|
|
@@ -1081,7 +1106,7 @@ Simulates the full user installation experience:
|
|
|
1081
1106
|
npm pack
|
|
1082
1107
|
|
|
1083
1108
|
# Install globally from tarball
|
|
1084
|
-
npm install -g chappibunny-repolens-
|
|
1109
|
+
npm install -g chappibunny-repolens-1.2.0.tgz
|
|
1085
1110
|
|
|
1086
1111
|
# Verify
|
|
1087
1112
|
repolens --version
|
|
@@ -1130,11 +1155,15 @@ repolens/
|
|
|
1130
1155
|
│ │ ├── publish.js # Publishing pipeline
|
|
1131
1156
|
│ │ ├── notion.js # Notion API integration
|
|
1132
1157
|
│ │ ├── confluence.js # Confluence REST API integration
|
|
1158
|
+
│ │ ├── github-wiki.js # GitHub Wiki publisher (git-based)
|
|
1133
1159
|
│ │ └── markdown.js # Local Markdown generation
|
|
1134
1160
|
│ ├── integrations/
|
|
1135
1161
|
│ │ └── discord.js # Discord webhook notifications
|
|
1136
1162
|
│ ├── delivery/
|
|
1137
1163
|
│ │ └── comment.js # PR comment delivery
|
|
1164
|
+
│ ├── plugins/
|
|
1165
|
+
│ │ ├── loader.js # Plugin resolution and dynamic import
|
|
1166
|
+
│ │ └── manager.js # Plugin registry and lifecycle orchestration
|
|
1138
1167
|
│ └── utils/
|
|
1139
1168
|
│ ├── logger.js # Logging utilities
|
|
1140
1169
|
│ ├── retry.js # API retry logic (exponential backoff)
|
|
@@ -1146,10 +1175,11 @@ repolens/
|
|
|
1146
1175
|
│ ├── telemetry.js # Opt-in error tracking + performance timers
|
|
1147
1176
|
│ ├── errors.js # Enhanced error messages with guidance
|
|
1148
1177
|
│ └── update-check.js # Version update notifications
|
|
1149
|
-
├── tests/ # Vitest test suite (
|
|
1178
|
+
├── tests/ # Vitest test suite (180 tests across 15 files)
|
|
1150
1179
|
├── .repolens.yml # Dogfooding config
|
|
1151
1180
|
├── package.json
|
|
1152
1181
|
├── CHANGELOG.md
|
|
1182
|
+
├── STABILITY.md
|
|
1153
1183
|
├── RELEASE.md
|
|
1154
1184
|
└── ROADMAP.md
|
|
1155
1185
|
```
|
|
@@ -1163,13 +1193,13 @@ RepoLens uses automated GitHub Actions releases.
|
|
|
1163
1193
|
### Creating a Release
|
|
1164
1194
|
|
|
1165
1195
|
```bash
|
|
1166
|
-
# Patch version (0.
|
|
1196
|
+
# Patch version (1.0.0 → 1.0.1) - Bug fixes
|
|
1167
1197
|
npm run release:patch
|
|
1168
1198
|
|
|
1169
|
-
# Minor version (0.
|
|
1199
|
+
# Minor version (1.0.0 → 1.1.0) - New features
|
|
1170
1200
|
npm run release:minor
|
|
1171
1201
|
|
|
1172
|
-
# Major version (0.
|
|
1202
|
+
# Major version (1.0.0 → 2.0.0) - Breaking changes
|
|
1173
1203
|
npm run release:major
|
|
1174
1204
|
|
|
1175
1205
|
# Push the tag to trigger workflow
|
|
@@ -1189,26 +1219,25 @@ See [RELEASE.md](./RELEASE.md) for detailed workflow.
|
|
|
1189
1219
|
|
|
1190
1220
|
## 🤝 Contributing
|
|
1191
1221
|
|
|
1192
|
-
RepoLens is currently in early access. v1.0 will open for community contributions.
|
|
1193
|
-
|
|
1194
1222
|
**Ways to help:**
|
|
1195
1223
|
- **Try it out**: Install and use in your projects
|
|
1196
1224
|
- **Report issues**: Share bugs, edge cases, or UX friction
|
|
1197
1225
|
- **Request features**: Tell us what's missing
|
|
1198
|
-
- **
|
|
1226
|
+
- **Build plugins**: Extend RepoLens with custom renderers and publishers
|
|
1227
|
+
- **Share feedback**: `repolens feedback`
|
|
1199
1228
|
|
|
1200
1229
|
---
|
|
1201
1230
|
|
|
1202
|
-
## 🗺️ Roadmap
|
|
1231
|
+
## 🗺️ Roadmap
|
|
1203
1232
|
|
|
1204
|
-
**Current Status:**
|
|
1233
|
+
**Current Status:** v1.2.0 — Stable Release
|
|
1205
1234
|
|
|
1206
|
-
###
|
|
1235
|
+
### v1.0 — Complete ✅
|
|
1207
1236
|
|
|
1208
1237
|
- [x] CLI commands: `init`, `doctor`, `publish`, `migrate`, `watch`, `feedback`, `version`, `help`
|
|
1209
|
-
- [x] Config schema v1 with validation
|
|
1238
|
+
- [x] Config schema v1 with validation (frozen)
|
|
1210
1239
|
- [x] Auto-discovery of `.repolens.yml`
|
|
1211
|
-
- [x] Publishers: Notion + Confluence + Markdown
|
|
1240
|
+
- [x] Publishers: Notion + Confluence + GitHub Wiki + Markdown
|
|
1212
1241
|
- [x] Branch-aware publishing with filtering
|
|
1213
1242
|
- [x] Smart tech stack detection from package.json
|
|
1214
1243
|
- [x] Unicode dependency diagrams (no external deps)
|
|
@@ -1217,7 +1246,7 @@ RepoLens is currently in early access. v1.0 will open for community contribution
|
|
|
1217
1246
|
- [x] GitHub Actions automation (publish + release)
|
|
1218
1247
|
- [x] PR architecture diff comments
|
|
1219
1248
|
- [x] Performance guardrails (10k warning, 50k limit)
|
|
1220
|
-
- [x] Comprehensive test suite (
|
|
1249
|
+
- [x] Comprehensive test suite (180 tests across 15 files)
|
|
1221
1250
|
- [x] Security hardening (secret detection, injection prevention, fuzzing)
|
|
1222
1251
|
- [x] Discord notifications with rich embeds
|
|
1223
1252
|
- [x] Documentation coverage & health scoring
|
|
@@ -1235,11 +1264,14 @@ RepoLens is currently in early access. v1.0 will open for community contribution
|
|
|
1235
1264
|
- [x] Dependency graph with circular dependency detection
|
|
1236
1265
|
- [x] Architecture drift detection (baseline comparison)
|
|
1237
1266
|
- [x] Plugin system for custom renderers and publishers
|
|
1267
|
+
- [x] Stability audit: CLI, config schema, and plugin interface frozen
|
|
1268
|
+
- [x] [STABILITY.md](STABILITY.md): Public API contract with semver guarantees
|
|
1238
1269
|
|
|
1239
|
-
###
|
|
1270
|
+
### Future
|
|
1240
1271
|
|
|
1241
|
-
- [ ]
|
|
1242
|
-
- [ ]
|
|
1272
|
+
- [ ] Additional publishers (Obsidian)
|
|
1273
|
+
- [ ] VS Code extension
|
|
1274
|
+
- [ ] GitHub App
|
|
1243
1275
|
|
|
1244
1276
|
See [ROADMAP.md](./ROADMAP.md) for detailed planning.
|
|
1245
1277
|
|
|
@@ -1253,6 +1285,8 @@ MIT
|
|
|
1253
1285
|
|
|
1254
1286
|
## 💬 Support & Contact
|
|
1255
1287
|
|
|
1288
|
+
- **Troubleshooting**: [TROUBLESHOOTING.md](TROUBLESHOOTING.md) — installation, config, publishing, AI, and CI/CD issues
|
|
1289
|
+
- **Diagnostics**: Run `npx @chappibunny/repolens doctor` to validate your setup
|
|
1256
1290
|
- **Issues**: [GitHub Issues](https://github.com/CHAPIBUNNY/repolens/issues)
|
|
1257
1291
|
- **Discussions**: [GitHub Discussions](https://github.com/CHAPIBUNNY/repolens/discussions)
|
|
1258
1292
|
- **Email**: Contact repository maintainers
|
package/package.json
CHANGED
|
@@ -25,7 +25,6 @@ export async function generateExecutiveSummary(context) {
|
|
|
25
25
|
const result = await generateText({
|
|
26
26
|
system: SYSTEM_PROMPT,
|
|
27
27
|
user: createExecutiveSummaryPrompt(context),
|
|
28
|
-
temperature: 0.2,
|
|
29
28
|
maxTokens: 1500
|
|
30
29
|
});
|
|
31
30
|
|
|
@@ -47,7 +46,6 @@ export async function generateSystemOverview(context) {
|
|
|
47
46
|
const result = await generateText({
|
|
48
47
|
system: SYSTEM_PROMPT,
|
|
49
48
|
user: createSystemOverviewPrompt(context),
|
|
50
|
-
temperature: 0.2,
|
|
51
49
|
maxTokens: 1200
|
|
52
50
|
});
|
|
53
51
|
|
|
@@ -68,7 +66,6 @@ export async function generateBusinessDomains(context) {
|
|
|
68
66
|
const result = await generateText({
|
|
69
67
|
system: SYSTEM_PROMPT,
|
|
70
68
|
user: createBusinessDomainsPrompt(context),
|
|
71
|
-
temperature: 0.2,
|
|
72
69
|
maxTokens: 2000
|
|
73
70
|
});
|
|
74
71
|
|
|
@@ -89,7 +86,6 @@ export async function generateArchitectureOverview(context) {
|
|
|
89
86
|
const result = await generateText({
|
|
90
87
|
system: SYSTEM_PROMPT,
|
|
91
88
|
user: createArchitectureOverviewPrompt(context),
|
|
92
|
-
temperature: 0.2,
|
|
93
89
|
maxTokens: 1800
|
|
94
90
|
});
|
|
95
91
|
|
|
@@ -110,7 +106,6 @@ export async function generateDataFlows(flows, context) {
|
|
|
110
106
|
const result = await generateText({
|
|
111
107
|
system: SYSTEM_PROMPT,
|
|
112
108
|
user: createDataFlowsPrompt(flows, context),
|
|
113
|
-
temperature: 0.2,
|
|
114
109
|
maxTokens: 1800
|
|
115
110
|
});
|
|
116
111
|
|
|
@@ -131,7 +126,6 @@ export async function generateDeveloperOnboarding(context) {
|
|
|
131
126
|
const result = await generateText({
|
|
132
127
|
system: SYSTEM_PROMPT,
|
|
133
128
|
user: createDeveloperOnboardingPrompt(context),
|
|
134
|
-
temperature: 0.2,
|
|
135
129
|
maxTokens: 2200
|
|
136
130
|
});
|
|
137
131
|
|
package/src/ai/provider.js
CHANGED
|
@@ -4,12 +4,12 @@ import { warn, info } from "../utils/logger.js";
|
|
|
4
4
|
import { executeAIRequest } from "../utils/rate-limit.js";
|
|
5
5
|
|
|
6
6
|
const DEFAULT_TIMEOUT_MS = 60000;
|
|
7
|
-
const DEFAULT_TEMPERATURE = 0.2;
|
|
8
7
|
const DEFAULT_MAX_TOKENS = 2500;
|
|
9
8
|
|
|
10
|
-
export async function generateText({ system, user, temperature, maxTokens }) {
|
|
11
|
-
// Check if AI is enabled
|
|
12
|
-
const
|
|
9
|
+
export async function generateText({ system, user, temperature, maxTokens, config }) {
|
|
10
|
+
// Check if AI is enabled (env var takes precedence, then config)
|
|
11
|
+
const aiConfig = config?.ai || {};
|
|
12
|
+
const enabled = process.env.REPOLENS_AI_ENABLED === "true" || aiConfig.enabled === true;
|
|
13
13
|
|
|
14
14
|
if (!enabled) {
|
|
15
15
|
return {
|
|
@@ -19,13 +19,17 @@ export async function generateText({ system, user, temperature, maxTokens }) {
|
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
// Get provider configuration
|
|
22
|
+
// Get provider configuration (env vars take precedence, then config, then defaults)
|
|
23
23
|
const provider = process.env.REPOLENS_AI_PROVIDER || "openai_compatible";
|
|
24
24
|
const baseUrl = process.env.REPOLENS_AI_BASE_URL;
|
|
25
25
|
const apiKey = process.env.REPOLENS_AI_API_KEY;
|
|
26
|
-
const model = process.env.REPOLENS_AI_MODEL || "gpt-
|
|
26
|
+
const model = process.env.REPOLENS_AI_MODEL || "gpt-5-mini";
|
|
27
27
|
const timeoutMs = parseInt(process.env.REPOLENS_AI_TIMEOUT_MS || DEFAULT_TIMEOUT_MS);
|
|
28
28
|
|
|
29
|
+
// Use config values as fallback for maxTokens; temperature only when explicitly set
|
|
30
|
+
const resolvedTemp = temperature ?? aiConfig.temperature ?? undefined;
|
|
31
|
+
const resolvedMaxTokens = maxTokens ?? aiConfig.max_tokens ?? DEFAULT_MAX_TOKENS;
|
|
32
|
+
|
|
29
33
|
// Validate configuration
|
|
30
34
|
if (!apiKey) {
|
|
31
35
|
warn("REPOLENS_AI_API_KEY not set. AI features disabled.");
|
|
@@ -47,8 +51,8 @@ export async function generateText({ system, user, temperature, maxTokens }) {
|
|
|
47
51
|
model,
|
|
48
52
|
system,
|
|
49
53
|
user,
|
|
50
|
-
temperature:
|
|
51
|
-
maxTokens:
|
|
54
|
+
temperature: resolvedTemp,
|
|
55
|
+
maxTokens: resolvedMaxTokens,
|
|
52
56
|
timeoutMs
|
|
53
57
|
});
|
|
54
58
|
|
|
@@ -76,21 +80,28 @@ async function callOpenAICompatibleAPI({ baseUrl, apiKey, model, system, user, t
|
|
|
76
80
|
const timeoutId = setTimeout(() => controller.abort(), timeoutMs);
|
|
77
81
|
|
|
78
82
|
try {
|
|
83
|
+
// Build request body — omit temperature if not supported by model
|
|
84
|
+
const body = {
|
|
85
|
+
model,
|
|
86
|
+
messages: [
|
|
87
|
+
{ role: "system", content: system },
|
|
88
|
+
{ role: "user", content: user }
|
|
89
|
+
],
|
|
90
|
+
max_completion_tokens: maxTokens
|
|
91
|
+
};
|
|
92
|
+
// Only send temperature when explicitly configured — some models
|
|
93
|
+
// (e.g. gpt-5-mini) reject any non-default value
|
|
94
|
+
if (temperature != null) {
|
|
95
|
+
body.temperature = temperature;
|
|
96
|
+
}
|
|
97
|
+
|
|
79
98
|
const response = await fetch(url, {
|
|
80
99
|
method: "POST",
|
|
81
100
|
headers: {
|
|
82
101
|
"Content-Type": "application/json",
|
|
83
102
|
"Authorization": `Bearer ${apiKey}`
|
|
84
103
|
},
|
|
85
|
-
body: JSON.stringify(
|
|
86
|
-
model,
|
|
87
|
-
messages: [
|
|
88
|
-
{ role: "system", content: system },
|
|
89
|
-
{ role: "user", content: user }
|
|
90
|
-
],
|
|
91
|
-
temperature,
|
|
92
|
-
max_tokens: maxTokens
|
|
93
|
-
}),
|
|
104
|
+
body: JSON.stringify(body),
|
|
94
105
|
signal: controller.signal
|
|
95
106
|
});
|
|
96
107
|
|
|
@@ -129,9 +140,9 @@ export function getAIConfig() {
|
|
|
129
140
|
return {
|
|
130
141
|
enabled: isAIEnabled(),
|
|
131
142
|
provider: process.env.REPOLENS_AI_PROVIDER || "openai_compatible",
|
|
132
|
-
model: process.env.REPOLENS_AI_MODEL || "gpt-
|
|
143
|
+
model: process.env.REPOLENS_AI_MODEL || "gpt-5-mini",
|
|
133
144
|
hasApiKey: !!process.env.REPOLENS_AI_API_KEY,
|
|
134
|
-
temperature: parseFloat(process.env.REPOLENS_AI_TEMPERATURE
|
|
145
|
+
temperature: process.env.REPOLENS_AI_TEMPERATURE ? parseFloat(process.env.REPOLENS_AI_TEMPERATURE) : undefined,
|
|
135
146
|
maxTokens: parseInt(process.env.REPOLENS_AI_MAX_TOKENS || DEFAULT_MAX_TOKENS)
|
|
136
147
|
};
|
|
137
148
|
}
|