# Development

## Commands

```sh
make dev
make test
make build
make lint
make tidy
```

## Package Layout

```text
cmd/server/
internal/app/
internal/config/
internal/http/
internal/service/commitintel/
internal/store/
internal/redis/
internal/contracts/
internal/telemetry/
```

## Local E2E with Code Parser

1. `docker compose up -d redis` (this repo) or shared Redis on `localhost:6379`.
2. Export the same `ARTIFACT_STORE_PATH` for Code Parser (port 6002) and Commit Intel (port 6003).
3. `make dev` in both repos (or PM2).
4. After Code Parser emits `graph.delta.ready`, inspect:
   - `redis-cli XREAD STREAMS commit.analysis.ready 0`
   - `curl http://localhost:6003/readyz`
   - `curl http://localhost:6003/analysis-jobs/{job_id}`

## Local progress notes

Implementation progress for this service can be tracked in a **gitignored** file:

- Path: `docs/dev-context.local.md` (create it locally; it is never committed)
- Also ignored: any `docs/*.local.md`

Suggested sections in that file:

- Active Jira key and current subtask
- Completed milestones
- Decisions and trade-offs
- Blockers and dependencies (e.g. Code Parser `graph.delta.ready`, shared `ARTIFACT_STORE_PATH`)
- Local test commands and last run results
- Checklist for [TW-65](https://admedia-jira.atlassian.net/browse/TW-65) subtasks (TW-66–TW-77)

Do not put secrets, credentials, or customer data in local notes.

## Rules

- Keep commit impact analysis behind `ImpactAnalyzer` (`DeltaImpactAnalyzer.AnalyzeDelta`)
- Keep artifact access behind `ArtifactReader`
- Do not call other services directly for indexing jobs
