Spaces:
Running
Running
RAP compliance
This repository is organised to meet Gold RAP under the NHS RAP Community of Practice maturity framework. The levels are cumulative β Gold includes everything in Baseline and Silver. The structure also draws on the NHS England repository template and the NHS England "package your code" workshop.
Baseline RAP
| Criterion | Status | Evidence |
|---|---|---|
| Data produced by code in an open-source language | β | Python pipeline (src/, agent/, eval/). |
| Code is version controlled | β | Git, hosted on GitHub. |
| README details steps to reproduce | β | README.md, docs/user_guide.md. |
| Code has been peer reviewed | β | Pull request workflow with template + required human review. |
| Code is published in the open | β | Public GitHub repository, MIT licensed. |
Silver RAP
| Criterion | Status | Evidence |
|---|---|---|
| Outputs produced with minimal manual intervention | β | uvicorn app.api:app / python -m eval.run_eval; one-command startup. |
| Code is well-documented (guidance, structure, docstrings) | β | Module + function docstrings throughout; docs/ directory. |
| Well-organised, standard directory format | β | src/ core, agent/, app/, eval/, tests/, docs/, data/. |
| Reusable functions and/or classes | β | NoteGuard, load_known_from_csv(), build_graph() β composable and parameterisable. |
| Adheres to agreed coding standards | β | PEP 8, type hints, ruff lint + format (see pyproject.toml). |
| Pipeline includes a testing framework | β | pytest suite in tests/ (24 tests; de-id core covered; no external deps needed). |
| Dependency information included | β | pyproject.toml β single source of truth; optional extras for the demo and dev tooling. |
| Logs automatically recorded by the pipeline | β | LangSmith auto-traces every graph run (LANGSMITH_TRACING=true). |
| Configuration aids reusability | β | All settings from environment variables; .env.example provided. |
Gold RAP
| Criterion | Status | Evidence |
|---|---|---|
| Code is fully packaged | β | pyproject.toml (setuptools, pip install -e ".[dev]", optional extras). |
| Tests run automatically via CI/CD | β | .github/workflows/ci.yml β ruff + pytest on 3.10β3.12. |
| Process runs on event-based triggers or a schedule | β | CI on push / pull request; agent runs on live query events. |
| Changes clearly signposted (changelog, releases) | β | CHANGELOG.md, VERSION, semantic versioning. |
Additional good practice
- Pre-commit hooks (
.pre-commit-config.yaml) for local quality gates. - Editor configuration (
.editorconfig) for consistent formatting. - Pull request template and
CONTRIBUTING.mddocumenting the review process. - Secret hygiene: no credentials in code;
.envgit-ignored; adetect-private-keypre-commit hook. - Hard privacy guarantee:
assert_clean()enforced at every PHI boundary β the de-id node before the model, and thezero_phi_to_modelLangSmith eval. - Reproducible outputs via the web UI:
GET /+POST /processprovide a documented, versioned HTTP interface that produces the same clinician output for the same input β satisfying the reproducibility intent of RAP Gold. - Documented API contract:
docs/architecture.mdspecifies every endpoint, request/response shape, and theassert_clean()guarantee; consumers can reproduce the analysis without reading source code. - Governance documentation:
docs/tool_card.md(Five Safes mapping, bias & fairness statement, DPIA prerequisites) anddocs/report.md(gov.uk ATRS record, Tier 1 + Tier 2).