Command Audit

/dr-test-audit

Build a read-only structural report for an explicit bounded test selection and its retained evidence

Overview

/dr-test-audit is an opt-in, read-only command for reviewing a maintainer-supplied test selection and its retained evidence. It validates bounded file and JSON structure and attaches each test's source hash, five-field Test Value Card, and cited receipt hashes/pointers; it does not decide whether tests are semantically redundant or modify any test files or gates.

Inputs & Execution

  1. Read the selection JSON named by the maintainer (using templates/test-audit-selection.json and the schema in documentation/reference/test-audit-report.md). The selection path must be relative to the declared project root and stay inside that root.
  2. Confirm the selection contains only the intended test files and explicitly listed receipt references — do not add tests, expand globs, search for evidence, or infer missing observations.
  3. Run the report builder once with the supplied root and selection:
    python3 "${DATARIM_RUNTIME:?}/dev-tools/build-test-audit-report.py" --root PROJECT --selection SELECTION.json
  4. Preserve its numeric exit status and stdout/stderr. On exit 0, stdout is the versioned JSON report. On nonzero exit, retain the fixed diagnostic code and never describe an empty or failed report as a result.

Interpretation & Boundaries

  • Treat every proposed_action as a user-authored proposal for review, not an automated decision or instruction to alter tests.
  • Keep each recommendation attached to its selected test source hash, existing five-field Test Value Card, and explicitly cited receipt hashes/pointers.
  • NOT_MEASURED cost fields mean the selection did not cite a valid observation for that metric — they are not zero and do not support a performance estimate.
  • Do not run tests, edit or remove files, lower gates, change a test plan, publish the report, or trigger CI from this command.