You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Dependencies are injected clients (`audioMetadataClient`, `audioAnalysisClient`, `feedbackClient`); the engine never touches ffmpeg or HTTP endpoints directly.
30
35
-`OpenAIFeedbackClient` (in `src/config/llm.ts`) wraps the OpenAI SDK; other LLM providers can implement the `FeedbackClient` interface.
31
36
32
37
## Commit & Pull Request Guidelines
38
+
33
39
- Use descriptive commits (e.g., `graph: add crest-factor reducer`). Squash only when keeping history readable.
34
40
- Run `npm run ci` locally before opening a PR; CI mirrors the same commands.
35
41
- PRs should link the tracking ticket, summarize behavior changes, and include test results or coverage output. Attach screenshots/logs if the change impacts tooling or docs.
36
42
- Never commit secrets. Configure credentials via env vars or GitHub secrets (`DOCS_PUBLISH_TOKEN`, `GITHUB_TOKEN`, etc.).
37
43
38
44
## Security & Configuration Tips
45
+
39
46
- Install from GitHub Packages by mapping `@auralyze:registry=https://npm.pkg.github.com` and authenticating with `${GITHUB_TOKEN}`.
40
47
- The docs workflow (`.github/workflows/docs.yml`) pushes to a separate repo/branch; configure `DOCS_PUBLISH_TOKEN`, and optionally `DOCS_REPOSITORY` / `DOCS_BRANCH`.
41
48
-`src/dev.ts` is a playground only—do not ship it in production; rely on the published bundle from `dist/`.
Copy file name to clipboardExpand all lines: CLAUDE.md
+13Lines changed: 13 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
7
7
This repository contains the Auralyze Engine, a LangGraph-powered workflow engine for AI-driven audio mix analysis. The actual project code lives in the `engine/` subdirectory.
8
8
9
9
**Key directories (all under `engine/`):**
10
+
10
11
-`src/` - TypeScript source code with strict typing
11
12
-`state.ts` - Zod schemas for engine state and analysis data
Each node processes the shared `EngineState` and returns partial updates. If any node encounters an error, it sets `state.error` and subsequent nodes skip processing.
67
73
68
74
### Dependency Injection Pattern
75
+
69
76
The engine uses **dependency injection** exclusively - it never makes HTTP requests or runs ffmpeg directly. Instead, host applications inject three client implementations:
@@ -75,25 +82,30 @@ The engine uses **dependency injection** exclusively - it never makes HTTP reque
75
82
The built-in `OpenAIFeedbackClient` (in `src/config/llm.ts`) implements `FeedbackClient` using the OpenAI SDK. Custom implementations can support other LLM providers.
76
83
77
84
### State Management
85
+
78
86
State is defined using Zod schemas in `src/state.ts`. The `EngineState` type includes:
The main API is `runAuralyzeSession(input, deps)` exported from `src/index.ts`. It builds the LangGraph workflow, initializes state, and invokes the compiled graph.
87
97
88
98
## Testing Strategy
89
99
90
100
Tests use Vitest with mocked dependencies:
101
+
91
102
-**Unit tests**: Individual node functions with `vi.fn()` mocks
92
103
-**Integration tests**: Full graph execution with fake clients
93
104
-**Schema tests**: Zod validation edge cases
94
105
-**Prompt tests**: Feedback prompt builder output
95
106
96
107
Test files follow the pattern: `test/<area>/<file>.<kind>.test.ts`
0 commit comments