Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Growth Promotion Test Validator

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.

Features

  • JSON input – define media, organisms, control/test counts, and optional negative controls
  • Growth ratio calculationtest / control with 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

Installation

git clone https://github.com/yourusername/growth-promotion-test-validator.git
cd growth-promotion-test-validator
go build -o gpt-validator .

Usage

Prepare a JSON input file (see example below). Then run:

./gpt-validator test.json

On success (exit code 0), the tool prints a JSON result. On failure, it prints an error message to stderr and exits with code 1.

Example input (test.json)

{
  "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
    }
  ]
}

Example output

{
  "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
    }
  ]
}

Acceptance criteria

  • 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_count must be ≥ 0.50.
    • If any organism fails, the medium lot fails.

Ratios are rounded to two decimal places (half‑up) before comparison.

Development

# run all tests
go test ./...

# build
go build -o gpt-validator .

License

MIT – see LICENSE.

About

GMP-compliant CLI tool to validate culture media growth promotion tests per USP <61>/<62>, computing growth ratios and pass/fail outcomes.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages