Skip to content

CI/CD

GitHub Actions runs tests on every push to main and on pull requests.

JobTriggerWhat it does
testpush + PRlint + typecheck + vitest + coverage ≥80%
git push origin main
GitHub Actions: npm ci → eslint → tsc --noEmit → vitest run (coverage ≥80%)

CI runs lint + typecheck + vitest + coverage, but the stronger local pre-release gate is:

Terminal window
npm run lint
npm run typecheck
npm run build
npx vitest run
npm run smoke:manual

Optional real API validation:

Terminal window
ANTHROPIC_API_KEY=... NODYN_SMOKE_ONLINE=1 npm run smoke:manual

npm run smoke:manual starts a local MCP server, checks /health, verifies the auth guard, and runs an offline MCP client lifecycle. The online variant adds a real nodyn_run_start / nodyn_poll round-trip. On restricted desktop sandboxes, local port binding may require an unsandboxed shell.

.github/workflows/ci.yml

  • test job: ubuntu-latest, Node 22, runs npm cinpm auditnpm run lintnpm run typechecknpx vitest run --coverage → coverage threshold check (≥80%)
  • Actions tab: GitHub repository → Actions tab

22 end-to-end tests that make real Haiku API calls (~$0.02 per full run, ~35s). These verify the full LLM integration path — not mocked.

Terminal window
npx vitest run tests/online/ # run all online tests
NODYN_DEBUG=1 npx vitest run tests/online/ # with debug output

Not included in CI or npx vitest run — must be run explicitly. Requires an API key via ~/.nodyn/config.json or ANTHROPIC_API_KEY env var. Tests auto-skip when no key is available.

FileTestsWhat it verifies
agent.test.ts6Agent loop, multi-turn context, streaming, tool dispatch, maxIterations, error handling
dag-planner.test.ts4DAG decomposition, project context, step dependencies, model assignment
entity-extractor.test.ts5Person/org extraction, relations, German text, empty text, regex+LLM combo
process-capture.test.ts3Step naming, parameter identification, internal tool filtering
memory-extraction.test.ts4Fact extraction, short-skip, Q&A-skip, concurrent safety

Transient Anthropic 500/529 errors are caught and logged, not reported as test failures. Shared setup in tests/online/setup.ts.

Performance Benchmarks (tests/performance/)

Section titled “Performance Benchmarks (tests/performance/)”

Vitest bench-based performance benchmarks. See benchmarks.md for full documentation.

Terminal window
pnpm bench # offline benchmarks (~30s, no API key)
pnpm bench:online # online benchmarks (requires API key, ~$0.02)

7 offline benchmark files (embedding, data-store, entity-extractor, security, memory, knowledge-graph, history-truncation) + 3 online files (agent-loop, retrieval-pipeline, dag-planner). Results saved to tests/performance/results.json (gitignored). Baselines committed in tests/performance/baselines/.

Terminal window
# What CI runs:
npm ci
npm run lint
npm run typecheck
npx vitest run --coverage
# Stronger local gate before shipping:
npm run build
npm run smoke:manual
pnpm bench
# Optional online smoke:
ANTHROPIC_API_KEY=... NODYN_SMOKE_ONLINE=1 npm run smoke:manual
# Online integration tests (real Haiku API, ~$0.02):
npx vitest run tests/online/
# Performance benchmarks (online, ~$0.02):
pnpm bench:online
# Build Docker image locally:
docker build -t nodyn .