Skip to content

Commit 3e39908

Browse files
committed
rearchitecting to modern infra
1 parent 3019ac6 commit 3e39908

46 files changed

Lines changed: 14688 additions & 5081 deletions

Some content is hidden

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

.env.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Required for realtime transcript token generation.
2+
ELEVENLABS_API_KEY=

.github/workflows/ci.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: ['main']
6+
pull_request:
7+
8+
jobs:
9+
quality:
10+
runs-on: ubuntu-latest
11+
timeout-minutes: 20
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
16+
- name: Setup Node
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: '22'
20+
cache: 'npm'
21+
22+
- name: Install dependencies
23+
run: npm ci
24+
25+
- name: Build renderer styles
26+
run: npm run build:styles
27+
28+
- name: Lint
29+
run: npm run lint
30+
31+
- name: Typecheck
32+
run: npm run typecheck
33+
34+
- name: Unit and integration tests
35+
run: npm run test
36+
37+
- name: E2E smoke
38+
run: xvfb-run -a npm run test:e2e
39+
40+
- name: Packaging smoke
41+
run: npm run package:smoke

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
node_modules
22
out
33
dist
4+
coverage
5+
dist-smoke
46
.env
57

68
.claude/worktrees/*
7-
pnpm-lock.yaml
9+
pnpm-lock.yaml
10+
package-lock.json

.prettierignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
node_modules
2+
dist
3+
out
4+
coverage
5+
playwright-report
6+
test-results
7+
tmp
8+
src/renderer/styles/tailwind.css

.prettierrc.json

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

AGENTS.md

Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
# AGENTS.md
2+
3+
This file is the canonical contributor guide for this repository.
4+
5+
If another assistant-specific file exists, it should defer to this document for repo workflow, quality gates, and architecture constraints.
6+
7+
## Mission
8+
9+
Keep this Electron video app production-ready while preserving:
10+
11+
- clear module boundaries
12+
- deterministic tests
13+
- stable user-facing behavior
14+
- release integrity
15+
16+
Do not optimize for "quickly making tests pass." Optimize for making the codebase more robust.
17+
18+
## Required Workflow
19+
20+
For any non-trivial change, follow this order:
21+
22+
1. Identify the affected feature and expected behavior.
23+
2. Define or update acceptance criteria before implementation.
24+
3. Add or update tests first for the intended behavior.
25+
4. Implement the code change.
26+
5. Run the full verification suite.
27+
6. Fix code defects if tests fail. Do not weaken assertions unless the product requirement itself changed.
28+
29+
## Change Policy
30+
31+
- Prefer small, isolated changes over broad rewrites.
32+
- Preserve behavior unless the task explicitly changes product behavior.
33+
- Do not introduce duplicate business logic across renderer and main.
34+
- Shared normalization/domain logic belongs in `src/shared/`.
35+
- Main-process business logic belongs in `src/main/services/`, not in IPC registration or app bootstrap.
36+
- Renderer feature logic belongs in `src/renderer/features/`, not inline in `src/index.html`.
37+
- `src/preload.js` should remain a narrow bridge and not gain business logic.
38+
39+
## Architecture Guardrails
40+
41+
Current intended structure:
42+
43+
- `src/main/`
44+
- Electron runtime bootstrapping, IPC registration, services, infra
45+
- `src/shared/`
46+
- domain rules, normalization, data-shape helpers shared across layers
47+
- `src/renderer/`
48+
- renderer entrypoint and feature utilities
49+
- `tests/unit/`
50+
- pure logic and isolated helper tests
51+
- `tests/integration/`
52+
- service/integration tests with controlled fakes
53+
- `tests/e2e/`
54+
- Electron smoke and workflow checks
55+
56+
When adding new code:
57+
58+
- Put pure data logic in a testable module first.
59+
- Keep side effects at the edges.
60+
- Inject dependencies where practical for testability.
61+
- Favor explicit validation and errors over silent fallback when data is invalid.
62+
63+
## Test-First Requirements
64+
65+
Before implementing behavior changes:
66+
67+
- Add unit tests for pure logic.
68+
- Add integration tests for filesystem, IPC, or service coordination.
69+
- Add or extend e2e coverage for critical user flows if the change affects runtime behavior.
70+
71+
Minimum expectation by change type:
72+
73+
- Pure helper/domain change: unit tests
74+
- Main-process service or IPC change: unit + integration tests
75+
- Renderer feature change: utility tests and, if behaviorally important, e2e or smoke coverage
76+
- Release/build/packaging change: verification via packaging smoke and relevant CI updates
77+
78+
## Testing Rules
79+
80+
- Never "fix" a test by removing meaningful assertions just to get green CI.
81+
- If a test reveals a bug, fix the underlying code.
82+
- Prefer deterministic tests using mocks, fakes, fixtures, and temp directories.
83+
- Avoid live external dependencies in tests.
84+
- Keep tests readable and behavior-focused.
85+
86+
## Required Commands
87+
88+
Use npm only in this repo.
89+
90+
Primary commands:
91+
92+
- `npm run build:styles`
93+
- `npm run lint`
94+
- `npm run typecheck`
95+
- `npm run test`
96+
- `npm run test:e2e`
97+
- `npm run package:smoke`
98+
- `npm run check`
99+
100+
Before finishing a substantive change, run:
101+
102+
- `npm run check`
103+
104+
## Build And Runtime Notes
105+
106+
- Start the app with `npm run dev` or `npm start`, not raw `electron .`
107+
- this ensures renderer styles are rebuilt first
108+
- Tailwind output is generated into `src/renderer/styles/main.css`
109+
- Do not reintroduce Tailwind CDN loading
110+
- Keep the stricter CSP in `src/index.html`
111+
112+
## Environment Rules
113+
114+
- Required env vars must be documented in `.env.example`
115+
- Validate required env at runtime before using it
116+
- Do not hardcode secrets
117+
- Do not commit `.env`
118+
119+
## Release Integrity
120+
121+
Any change that affects build, packaging, or runtime startup must keep these green:
122+
123+
- lint
124+
- typecheck
125+
- unit/integration tests
126+
- Electron smoke test
127+
- packaging smoke
128+
129+
Update `.github/workflows/ci.yml` if the required validation steps change.
130+
131+
## Code Quality Expectations
132+
133+
- Prefer composition over large monoliths.
134+
- Keep files focused.
135+
- Name modules by responsibility.
136+
- Write defensive normalization around persisted project/timeline data.
137+
- Add comments only where the logic is non-obvious.
138+
- Avoid dead code and stale compatibility layers unless intentionally retained.
139+
140+
## Documentation Expectations
141+
142+
Update docs when behavior or contributor workflow changes:
143+
144+
- `docs/production/feature-inventory.md`
145+
- `docs/production/target-architecture.md`
146+
- `docs/production/runbook.md`
147+
- this file
148+
149+
## If You Are Unsure
150+
151+
Default to:
152+
153+
- tests first
154+
- smaller modules
155+
- stricter validation
156+
- shared domain logic
157+
- full `npm run check` before completion

CLAUDE.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# CLAUDE.md
2+
3+
Follow the canonical repo instructions in [`AGENTS.md`](./AGENTS.md).
4+
5+
`AGENTS.md` is the source of truth for:
6+
7+
- update workflow
8+
- test-first expectations
9+
- architecture boundaries
10+
- verification requirements
11+
- release integrity rules
12+
13+
If this file and `AGENTS.md` ever diverge, follow `AGENTS.md`.

0 commit comments

Comments
 (0)