Skip to content

Commit daa6508

Browse files
Harden repo quality gates and split renderer app (#2)
* Add quality gates and align provider support * Split renderer app into reusable modules
1 parent 0b95772 commit daa6508

44 files changed

Lines changed: 4978 additions & 1710 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
pull_request:
99

1010
jobs:
11-
typecheck:
11+
quality:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- uses: actions/checkout@v4
@@ -17,7 +17,7 @@ jobs:
1717
node-version-file: .nvmrc
1818
cache: npm
1919
- run: npm ci
20-
- run: npm run typecheck
20+
- run: npm test
2121

2222
package-macos:
2323
runs-on: macos-14

.prettierignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.webpack
2+
node_modules
3+
out

.prettierrc.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"semi": true,
3+
"singleQuote": false,
4+
"trailingComma": "none"
5+
}

Makefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
.PHONY: help setup dev start test check typecheck clean clean-dev clean-all package package-mac make make-mac install uninstall reinstall open-data create-release deploy-release release
1+
.PHONY: help setup dev start lint test check typecheck clean clean-dev clean-all package package-mac make make-mac install uninstall reinstall open-data create-release deploy-release release
22

33
help:
44
@echo "Robin - Available commands:"
55
@echo ""
66
@echo "Development:"
77
@echo " make setup - Check local prerequisites"
88
@echo " make dev - Start Robin in development mode"
9-
@echo " make test - Run the current smoke gate (typecheck)"
9+
@echo " make lint - Run ESLint across src/ and test/"
10+
@echo " make test - Run lint, typecheck, unit tests, and format checks"
1011
@echo " make clean - Remove build artifacts"
1112
@echo " make clean-dev - Remove app data and stop Robin"
1213
@echo " make clean-all - Remove artifacts and local app data"
@@ -37,6 +38,9 @@ dev:
3738
start:
3839
@./scripts/npmw run start
3940

41+
lint:
42+
@./scripts/npmw run lint
43+
4044
typecheck:
4145
@./scripts/npmw run typecheck
4246

README.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,19 @@ npm start
3939
npm run typecheck
4040
```
4141

42+
5. Run the full quality gate:
43+
44+
```bash
45+
npm test
46+
```
47+
4248
## Common Commands
4349

4450
```bash
4551
make help
4652
make setup
4753
make dev
54+
make lint
4855
make test
4956
make package
5057
make install
@@ -57,6 +64,7 @@ If you prefer npm directly:
5764
```bash
5865
npm run setup
5966
npm run dev
67+
npm run lint
6068
npm run test
6169
npm run package:mac
6270
npm run make:mac
@@ -86,10 +94,11 @@ After bootstrap, the repo-level wrappers [scripts/nodew](/Users/karansingh/proje
8694

8795
## Testing
8896

89-
Robin currently has a strong smoke-test workflow rather than a full automated test suite.
97+
Robin now has a baseline automated quality gate plus a manual desktop smoke pass.
9098

9199
1. Run `npm install`
92100
2. Run `npm run test`
101+
This executes ESLint, `tsc --noEmit`, the Node-based unit tests under [test](/Users/karansingh/projects/robin/test), and Prettier checks.
93102
3. Run `npm run dev`
94103
4. Verify manually:
95104
- Tray icon appears
@@ -167,6 +176,7 @@ Robin uses the standard Electron architecture with a **main process** (Node.js)
167176
### Local-first persistence
168177

169178
All data is stored as JSON files in Electron's `userData` directory:
179+
170180
- `settings.json` — app config, provider preferences, model selections
171181
- `threads.json` — full conversation history with messages and attachments
172182
- `todos.json` — todo items with ordering
@@ -176,8 +186,8 @@ API keys are encrypted at rest using Electron's `safeStorage` API (macOS Keychai
176186
### Multi-provider abstraction
177187

178188
Robin supports multiple AI providers through a uniform streaming interface:
189+
179190
- **OpenAI** — GPT models with mode support (chat/responses)
180-
- **Anthropic** — Claude models
181191
- **Google** — Gemini models with native image support
182192
- **Perplexity** — Search-grounded answers with citations
183193
- **OpenRouter** — Proxy to any model via user-provided model IDs
@@ -188,6 +198,7 @@ Each provider implements `streamReply()` with delta callbacks. The `ProviderServ
188198
### Context management
189199

190200
Before sending messages to any provider, Robin optimises the payload:
201+
191202
1. **Image stripping** — only the most recent user message retains image attachments. Older images remain in the thread for display but are excluded from API calls to avoid payload bloat.
192203
2. **Context truncation** — if total message content exceeds ~100K characters (~25K tokens), the oldest messages are dropped while preserving at least the last 4 messages (2 turns).
193204
3. **Model-agnostic threads** — threads store raw messages without model metadata. The model selection is applied at call time, so you can switch providers mid-conversation.
@@ -198,6 +209,6 @@ The sidebar uses a 2x2 navigation grid (Chats, Todos, Notes, Calendar) that swit
198209

199210
## Next Steps
200211

201-
- Add real renderer/main-process automated tests
212+
- Add Electron-level integration tests for IPC and window lifecycle
202213
- Add a richer settings surface for provider management
203214
- Add update distribution after the first beta

eslint.config.mjs

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import js from "@eslint/js";
2+
import globals from "globals";
3+
import tseslint from "typescript-eslint";
4+
5+
export default tseslint.config(
6+
{
7+
ignores: [".webpack/**", "node_modules/**", "out/**"]
8+
},
9+
js.configs.recommended,
10+
...tseslint.configs.recommended,
11+
{
12+
files: ["src/renderer/**/*.{ts,tsx}"],
13+
languageOptions: {
14+
globals: {
15+
...globals.browser
16+
}
17+
}
18+
},
19+
{
20+
files: [
21+
"src/main/**/*.{ts,tsx}",
22+
"src/preload/**/*.{ts,tsx}",
23+
"src/shared/**/*.{ts,tsx}",
24+
"test/**/*.ts"
25+
],
26+
languageOptions: {
27+
globals: {
28+
...globals.node
29+
}
30+
}
31+
},
32+
{
33+
rules: {
34+
"@typescript-eslint/no-explicit-any": "off"
35+
}
36+
}
37+
);

0 commit comments

Comments
 (0)