A command-line tool for GMP microbiology laboratories that automates the evaluation of culture media growth promotion tests according to USP <61>/<62>. It reads a test definition from a JSON file, calculates growth ratios, checks against acceptance criteria, and reports pass/fail results for each organism and the medium lot.
- JSON input – define media, organisms, control/test counts, and optional negative controls
- Growth ratio calculation –
test / controlwith proper rounding (two decimals) - Acceptance criteria enforcement
- Solid media: ratio ≥ 0.5 for each organism
- Negative control: must show no growth (zero colonies) or overall failure
- Sensible error reporting – missing fields, invalid counts, division by zero
- Zero external dependencies – standard library only
- CI/CD ready – GitHub Actions workflow ensures code builds, passes vet, and all tests pass
git clone https://github.com/yourusername/growth-promotion-test-validator.git
cd growth-promotion-test-validator
go build -o gpt-validator .Prepare a JSON input file (see example below). Then run:
./gpt-validator test.jsonOn success (exit code 0), the tool prints a JSON result. On failure, it prints an error message to stderr and exits with code 1.
{
"media_name": "TSA",
"media_lot": "LOT-2026-01",
"test_date": "2026-03-01",
"negative_control_growth": false,
"organisms": [
{
"organism_name": "Staphylococcus aureus",
"control_count": 45,
"test_count": 38,
"dilution_factor": 1
},
{
"organism_name": "Pseudomonas aeruginosa",
"control_count": 52,
"test_count": 27,
"dilution_factor": 1
}
]
}{
"media": "TSA",
"lot": "LOT-2026-01",
"test_date": "2026-03-01",
"negative_control": "pass",
"overall": "pass",
"results": [
{
"organism": "Staphylococcus aureus",
"control_count": 45,
"test_count": 38,
"dilution_factor": 1,
"ratio": 0.84,
"pass": true
},
{
"organism": "Pseudomonas aeruginosa",
"control_count": 52,
"test_count": 27,
"dilution_factor": 1,
"ratio": 0.52,
"pass": true
}
]
}- Negative control must have no growth. If colonies are present (
negative_control_growth: true), the entire medium lot fails immediately. - For each organism, the calculated ratio
(test_count × dilution_factor) / control_countmust be ≥ 0.50.- If any organism fails, the medium lot fails.
Ratios are rounded to two decimal places (half‑up) before comparison.
# run all tests
go test ./...
# build
go build -o gpt-validator .MIT – see LICENSE.