Contributing¶
How to propose changes to Eagle-RAG. The project is hosted at github.com/fintax-ai/eagle-rag.
Read AGENTS.md before your first PR — it encodes non-negotiable architecture boundaries (Knowhere vs PixelRAG, model vendors, removed dependencies).
Workflow¶
flowchart LR
A["Fork / branch"] --> B["Implement + tests"]
B --> C["Local quality gates"]
C --> D["Open PR"]
D --> E["Review"]
E --> F["Merge"]
- Branch from
master(or the repo default):feat/short-descriptionorfix/issue-slug. - Keep commits focused; avoid unrelated formatting sweeps.
- Open a PR with a clear summary and test plan.
- Address review comments; re-run gates after each push.
PR checklist¶
Copy into your PR description and check each item:
Scope and design¶
- Change matches
AGENTS.mdmodule boundaries (no pixelrag-serve, FAISS, OpenAI, Cohere, LibreOffice). - Multi-tenant paths propagate
kb_nameand respectplugin_namespace(repositories, Milvusdb_name, API 403 on mismatch). - New MCP tools use
core_*or{namespace}_*viamcp_registry; RAG-only names only — no side-effect tools (ADR-008). - No domain-specific UI in
frontend/for vertical plugins (backend + MCP only). - Architecture-facing behaviour updates
README.md,AGENTS.md, and/ordocs/en/architecture/plugin-architecture.md(+ zh mirror) when plugin or tenancy behaviour changes. - New HTTP endpoints use Pydantic schemas in
eagle_rag/api/schemas/andresponse_model=. - DB schema changes include an Alembic revision (no DDL in stores).
- Config changes add
${VAR:-default}insettings.yaml+ pydantic field inconfig.py. - Architecture-facing behaviour updates
README.md,AGENTS.md, and/ordocs/en/architecture/multimodal-fusion.mdwhen required by AGENTS.md sync rule.
Backend gates¶
uv run ruff check # task be:lint
uv run ruff format --check # or task be:format then commit
uv run mypy eagle_rag # task be:typecheck
uv run pytest # task be:test
-
ruff check— zero violations (E,F,I,W,UPperpyproject.toml). -
ruff format— code formatted (line length 100). -
mypy eagle_rag— passes (ignore_missing_imports = truefor third-party stubs). -
pytest— all tests green.
Frontend gates (if frontend/ touched)¶
- Biome lint clean.
- Biome format applied.
- Light theme only; no dark-mode-only assumptions.
-
next-intlkeys added for bothenandzhwhen user-visible strings change.
Tests¶
- New behaviour has pytest coverage where non-trivial (see Testing).
- Mocks used for Milvus, Knowhere HTTP, external LLM — no live API keys in CI.
- Telemetry tests pass with autouse fixture reset (
tests/conftest.py).
Security and hygiene¶
- No
.env, API keys, or credentials in the diff. - No
TODO/FIXME/ personal notes in committed code (AGENTS.md). - Docstrings and comments in English, Google style.
Ops (if compose / Docker touched)¶
- Healthchecks and
depends_on: service_healthypreserved or updated intentionally. -
COMPOSE_FILEprod note respected (no dev-only override requirements). - Volume names documented if new persistent stores added.
Docs¶
- User-facing docs updated only when behaviour changes (do not add unsolicited
.mdfiles). - GitHub links in docs point to
https://github.com/fintax-ai/eagle-rag/blob/master/..., not relative../../../paths to repo root files.
Commit messages¶
Follow existing history: short imperative subject, optional body explaining why.
fix health probe celery timeout false positive
Celery inspect.ping used a 3s timeout inside a 3s wait_for, marking
celery down when workers were healthy. Lower inspect timeout to 1.0s.
Code review focus areas¶
Reviewers typically check:
| Area | Question |
|---|---|
| Routing | Does ingest use format + content form, not source_type alone? |
| Fusion | Visual chunks carry chunk_type, parent_section, content_summary, source_chunk_id? |
| Celery | Task registered in include= and task_routes? @with_retry or explicit dead letter? |
| Scope | scope_filter OR semantics preserved? |
| Streaming | SSE event types unchanged without migration note? |
| MCP | TOOL_DEFINITIONS + mcp_registry; core_* naming; RAG-only guard; @with_metrics on new tools |
Local development commands¶
| Task | Command |
|---|---|
| Full Docker stack | task up |
| API only | task be:api |
| All Celery queues | task be:worker |
| Single queue | task be:worker QUEUES=knowhere_queue CONCURRENCY=8 |
| Migrations | task db:migrate |
| Docs preview | task docs:serve |
Database migrations in PRs¶
- Edit
eagle_rag/db/models/. uv run alembic revision --autogenerate -m "add_foo_column".- Review generated SQL — autogenerate is not infallible.
task db:migratelocally.- Include revision file in PR.
Downgrade strategy: provide downgrade() when rollback is feasible; note if data loss is inevitable.
Breaking changes¶
Call out explicitly in PR:
- API schema field renames or removed endpoints.
- Milvus collection schema changes (may require re-ingest).
- Env var renames in
settings.yaml. - MCP tool signature changes.
What we do not merge¶
- Reintroduction of removed stacks (pixelrag-serve, FAISS, OpenAI adapters) without owner approval.
- Finance-specific hardcoding in core paths (
AGENTS.md: industry-agnostic). - Auth middleware on API routes (intranet assumption) unless project direction changes.
- DDL executed from runtime stores instead of Alembic.
CI note¶
The repository may not run all gates on every PR in GitHub Actions — local execution of the checklist is mandatory before requesting review. The docs site is published to GitHub Pages from .github/workflows/docs-pages.yml on pushes to main.
Getting reviewer context¶
Link to:
- Relevant section in
docs/en/backend/ordocs/en/ops/ AGENTS.mdrule you followed- Screenshot / curl example for API changes
License and conduct¶
Apache License 2.0 per LICENSE and pyproject.toml. Use professional communication in issues and PRs.
Adding a new API endpoint (checklist)¶
- Define request/response models in
eagle_rag/api/schemas/<domain>.py. - Implement handler in
eagle_rag/api/<domain>.pywithresponse_model=. - Register router in
app.pyif new file. - Add pytest in
tests/test_api_*.pywith patched stores. - Update MkDocs backend page if the endpoint is user-facing (only when asked or part of a docs task).
Adding a Celery task (checklist)¶
- Implement task body in
ingest/or appropriate module. - Decorate with
@with_retry(name="eagle_rag.tasks.<name>", queue="<queue>"). - Add route in
eagle_rag/settings.yamlcelery.task_routes. - Ensure module is listed in
celery_app.include(if new file). - Document queue choice: router (4) / knowhere (8) / pixelrag (1).
- Use
send_task_with_tracefrom API/runner dispatch paths. - Verify
task_auditstate transitions intasks/state.py.
Adding an MCP tool (checklist)¶
- Implement handler in
mcp_server.py. - Append schema to
TOOL_DEFINITIONS. - Apply
@with_metrics("<tool_name>")for Prometheus when using standalone MCP HTTP. - Add tests:
tests/test_mcp_*.py(happy path + degradation dict witherrorfield). - Confirm
/mcp/toolsand admin/admin/mcplist the tool.
Frontend contribution notes¶
- Run
bun run lintandbun run formatbefore push. - User-visible strings require
messages/en.jsonandmessages/zh.jsonupdates. - API calls go through existing
lib/clients — match error handling patterns in neighbouring pages. - Do not introduce dark-theme-only styling; Eagle-RAG UI is light-only per AGENTS.md.
Dependency changes¶
- Python: edit
pyproject.toml, runuv lockif lockfile tracked,uv sync. - Do not add OpenAI/Cohere/LibreOffice/pixelrag-serve dependencies.
- PixelRAG remains a git dependency on StarTrail-org/PixelRAG; document any pin changes in PR body.
- Frontend:
cd frontend && bun install, commitbun.lockwhen dependencies change.
Review SLA expectations¶
- Respond to review comments within a reasonable window; re-run all gates after each fixup push.
- Squash vs merge is repository maintainer preference — do not force-push to shared branches without agreement.