Development
Prerequisites
- Node.js >= 20
- npm or yarn
- Git
Setup
git clone https://github.com/yasserfaraazkhan/impact-gate.gitcd impact-gatenpm cinpm run buildBuild System
The project ships both CommonJS and ESM builds from TypeScript source under src/. The build compiles to dist/ with type declarations.
# Full buildnpm run build
# Watch mode for developmentnpx tsc -p tsconfig.json --watchRunning Tests
# Run all testsnpm test
# Compile and run a specific test file after building the sourcenpm run build:testnode --test test-dist/impact_engine.test.js
# Type check the sourcenpm run lintTests live under test/ and compile to test-dist/. npm test builds CJS/ESM, scripts and tests before running the complete suite. Advisory regressions are in test/advisory_planning.test.ts and verify Git identity, conservative fallback, path validation and the absence of provider, test and status writes.
Documentation development
npm ci --prefix docs-sitenpm run dev:local --prefix docs-site# Validate the production site, including generated guide navigationnpm run build --prefix docs-siteThe advisory guide documents the isolated Mattermost caller. Merging to master deploys changed docs through the existing Pages workflow; npm publication uses a separate version-tag workflow.
Project Structure
src/ cli/ # CLI entry point, argument parsing, command handlers engine/ # Deterministic impact analysis core crew/ # Multi-agent orchestration agents/ # 10 specialized crew agents pipeline/ # 5-stage generation/healing pipeline knowledge/ # Route families, API surface, spec index training/ # Scanner, enricher, validator for manifests providers/ # LLM provider implementations adapters/ # Framework-specific adapters reporters/ # Output format plugins resilience/ # Circuit breaker, retry logic cache/ # Response cachingAdding a CLI Command
- Create
src/cli/commands/your_command.tswith an async handler - Add the command name to the
Commandtype union insrc/cli/types.ts - Register dispatch logic in
src/cli.ts - Add flags to
src/cli/parse_args.ts - Add defaults in
src/cli/defaults.tsif needed
Common Pitfalls
- Missing route-families.json: Ordinary impact analysis may use heuristic fallback; it does not establish behavior coverage. Run
train --no-enrichto create mapping candidates. Advisory mode instead requires explicit suite configuration and retains full fallback for nonempty diffs. - Budget exceeded mid-run: Set
--budget-usdhigh enough for the workflow. Use--dry-runto preview cost estimates. - Provider not found: Ensure the correct environment variable is set. Use
llm-healthto verify. - Stale cache: The response cache under
.e2e-ai-agents/cache/may serve outdated results. Delete the directory to clear it.