|
| 1 | +# LabTrust PCS bench producer contract |
| 2 | + |
| 3 | +LabTrust-Gym is the reference scientific workflow producer for the hospital lab QC |
| 4 | +release benchmark. It emits a canonical `pcs_bench_ingest.v0.json` aligned with |
| 5 | +[pcs-core](https://github.com/SentinelOps-CI/pcs-core) `PcsBenchIngest.v0` and |
| 6 | +consumable by [pcs-bench](https://github.com/SentinelOps-CI/pcs-bench) without |
| 7 | +fixture fallback. |
| 8 | + |
| 9 | +## Canonical workflow identity |
| 10 | + |
| 11 | +All PCS exports use: |
| 12 | + |
| 13 | +```text |
| 14 | +workflow_id = hospital_lab.qc_release |
| 15 | +``` |
| 16 | + |
| 17 | +CLI aliases (`qc_release`, `qc-release`, `labtrust_qc_release`, `hospital_lab_qc_release`, |
| 18 | +`labtrust.qc_release_v0.1`) resolve to this property id before any artifact is written. |
| 19 | + |
| 20 | +## Release-grade producer target |
| 21 | + |
| 22 | +```bash |
| 23 | +make pcs-bench-producer |
| 24 | +``` |
| 25 | + |
| 26 | +This runs: |
| 27 | + |
| 28 | +1. `labtrust benchmark-reproducibility` with `full_regeneration`, five runs, live |
| 29 | + CertifyEdge, pcs-core validation, and release-grade gates. |
| 30 | +2. `pcs-bench validate-ingest --release-grade` on the canonical ingest path. |
| 31 | + |
| 32 | +Environment: |
| 33 | + |
| 34 | +| Variable | Default | |
| 35 | +|----------|---------| |
| 36 | +| `PCS_CORE` | `../pcs-core` | |
| 37 | +| `PCS_BENCH` | `../pcs-bench` | |
| 38 | +| `BENCH_RUN_DIR` | `benchmark_runs/labtrust_reproducibility` | |
| 39 | + |
| 40 | +Manual equivalent: |
| 41 | + |
| 42 | +```bash |
| 43 | +labtrust benchmark-reproducibility \ |
| 44 | + --workflow hospital_lab.qc_release \ |
| 45 | + --mode full_regeneration \ |
| 46 | + --pcs-core ../pcs-core \ |
| 47 | + --certifyedge-bin certifyedge \ |
| 48 | + --runs 5 \ |
| 49 | + --out benchmark_runs/labtrust_reproducibility \ |
| 50 | + --validate-pcs-core-output ../pcs-core \ |
| 51 | + --release-grade |
| 52 | + |
| 53 | +pcs-bench validate-ingest \ |
| 54 | + --input benchmark_runs/labtrust_reproducibility/pcs_bench_ingest.v0.json \ |
| 55 | + --pcs-core ../pcs-core \ |
| 56 | + --release-grade |
| 57 | +``` |
| 58 | + |
| 59 | +## Release-grade semantics |
| 60 | + |
| 61 | +A producer output is **release-grade** only when: |
| 62 | + |
| 63 | +| Gate | Requirement | |
| 64 | +|------|-------------| |
| 65 | +| Mode | `full_regeneration` | |
| 66 | +| Runs | `>= 5` | |
| 67 | +| CertifyEdge | `certifyedge_call_success_rate == 1.0` | |
| 68 | +| Per run | `release_protocol_validation_passed`, `status_policy_validation_passed`, `pcs_core_validation_passed` | |
| 69 | +| Stability | `canonical_hashes_stable` and `release_validation_stable` (from `hash_stability_report.v0.json` when `full_regeneration` runs hash-stability copies) | |
| 70 | +| Commit | Real 40-character git `source_commit` (not all zeros) | |
| 71 | +| Embedded objects | Non-empty `benchmark_runs`, non-empty `coverage_reports`, non-empty `commands` | |
| 72 | +| Validation | pcs-core schema + `pcs-bench validate-ingest --release-grade` | |
| 73 | + |
| 74 | +`benchmark_manifest.v0.json` records release evidence: |
| 75 | + |
| 76 | +```json |
| 77 | +{ |
| 78 | + "evidence_grade": "release", |
| 79 | + "mode": "full_regeneration", |
| 80 | + "runs": 5, |
| 81 | + "certifyedge_live": true, |
| 82 | + "pcs_core_validation": true, |
| 83 | + "canonical_hashes_stable": true |
| 84 | +} |
| 85 | +``` |
| 86 | + |
| 87 | +## Emitted artifacts |
| 88 | + |
| 89 | +Under `benchmark_runs/labtrust_reproducibility/`: |
| 90 | + |
| 91 | +| File | Schema / role | |
| 92 | +|------|----------------| |
| 93 | +| `pcs_bench_ingest.v0.json` | pcs-core `PcsBenchIngest.v0` (embedded runs + coverage + `artifact_refs`) | |
| 94 | +| `benchmark_run.v0.json` | LabTrust aggregate reproducibility summary | |
| 95 | +| `coverage_report.v0.json` | LabTrust reproducibility coverage | |
| 96 | +| `benchmark_report.v0.json` | pcs-core `BenchmarkReport.v0` | |
| 97 | +| `benchmark_manifest.v0.json` | `ReproducibilityBenchmarkManifest.v0` | |
| 98 | +| `hash_stability_report.v0.json` | `HashStabilityReport.v0` | |
| 99 | +| `regeneration_reports/*.json` | `RegenerationReport.v0` per run | |
| 100 | +| `artifact_refs/benchmark_runs/*.v0.json` | pcs-core run sidecars | |
| 101 | +| `artifact_refs/coverage_reports/*.v0.json` | pcs-core coverage sidecar | |
| 102 | +| `runs/run_*` | Regenerated release protocol trees | |
| 103 | + |
| 104 | +### Ingest `artifact_refs` |
| 105 | + |
| 106 | +Embedded pcs-core objects each have a matching sidecar under `artifact_refs/`. |
| 107 | +LabTrust reproducibility sidecars are also listed in ingest `artifact_refs`: |
| 108 | + |
| 109 | +| Path | `artifact_type` | `role` | |
| 110 | +|------|-----------------|--------| |
| 111 | +| `benchmark_run.v0.json` | `LabtrustBenchmarkRunSummary.v0` | `reproducibility_evidence` | |
| 112 | +| `coverage_report.v0.json` | `LabtrustReproducibilityCoverage.v0` | `producer_export` | |
| 113 | +| `benchmark_report.v0.json` | `BenchmarkReport.v0` | `native_report` | |
| 114 | +| `benchmark_manifest.v0.json` | `ReproducibilityBenchmarkManifest.v0` | `producer_export` | |
| 115 | +| `hash_stability_report.v0.json` | `HashStabilityReport.v0` | `reproducibility_evidence` | |
| 116 | +| `regeneration_reports/*.json` | `RegenerationReport.v0` | `regeneration_report` | |
| 117 | +| `pcs_bench_ingest.v0.json` | `PcsBenchIngest.v0` | `canonical_ingest` | |
| 118 | + |
| 119 | +Extended refs are provenance only; pcs-core `BenchmarkRun.v0` and `CoverageReport.v0` |
| 120 | +remain embedded in the ingest body. |
| 121 | + |
| 122 | +## pcs-bench consumption |
| 123 | + |
| 124 | +pcs-bench producer gate resolves: |
| 125 | + |
| 126 | +```text |
| 127 | +benchmark_runs/labtrust_reproducibility/pcs_bench_ingest.v0.json |
| 128 | +``` |
| 129 | + |
| 130 | +`pcs-bench validate-ingest` checks: |
| 131 | + |
| 132 | +1. pcs-core `PcsBenchIngest.v0` schema (pcs-core-compatible `artifact_refs` only). |
| 133 | +2. Semantic rules (commit, embedded arrays, digest alignment for embedded types). |
| 134 | +3. Release-grade adequacy (non-empty runs, real commit, sidecar files on disk). |
| 135 | +4. Nested `BenchmarkRun.v0` / `CoverageReport.v0` schemas. |
| 136 | + |
| 137 | +Normalized output feeds the cross-producer gate without using the offline fixture |
| 138 | +when the producer target succeeds. |
| 139 | + |
| 140 | +## Refresh LabTrust pcs-bench fixture suite |
| 141 | + |
| 142 | +```bash |
| 143 | +make pcs-bench-sync-suite |
| 144 | +``` |
| 145 | + |
| 146 | +Equivalent manual flow: |
| 147 | + |
| 148 | +```bash |
| 149 | +labtrust generate-benchmark-cases \ |
| 150 | + --workflow hospital_lab.qc_release \ |
| 151 | + --out ../pcs-bench/benchmarks/labtrust_qc_release \ |
| 152 | + --pcs-bench-layout \ |
| 153 | + --seed 42 \ |
| 154 | + --validate-pcs-core-output ../pcs-core |
| 155 | + |
| 156 | +cd ../pcs-bench |
| 157 | +pcs-bench validate-cases --suite labtrust-qc-release --pcs-core ../pcs-core |
| 158 | +``` |
| 159 | + |
| 160 | +Produces `suite.yaml`, `valid/`, `invalid/`, `benchmark_manifest.v0.json`, and |
| 161 | +`coverage_report.v0.json` under the pcs-bench benchmarks tree. |
| 162 | + |
| 163 | +## Offline CI fixture |
| 164 | + |
| 165 | +`tests/fixtures/pcs_bench_reproducibility/` is a full developer-grade producer tree |
| 166 | +(ingest, sidecars under `artifact_refs/`, manifest, reports). Regenerate and publish: |
| 167 | + |
| 168 | +```bash |
| 169 | +make pcs-fixtures |
| 170 | +make pcs-verify # regenerate + validate fixture + pcs-bench validate-ingest |
| 171 | +make pcs-bench-publish-fixtures # copies into ../pcs-bench/tests/fixtures and runs/ |
| 172 | +``` |
| 173 | + |
| 174 | +The committed tree is sidecar-only (no `runs/` scratch); ingest `commands` use repo-relative `--out` paths. |
| 175 | + |
| 176 | +Legacy single-file mirror: `tests/fixtures/pcs_bench_ingest/labtrust/pcs_bench_ingest.v0.json`. |
| 177 | + |
| 178 | +See also [pcs-benchmark-producer.md](pcs-benchmark-producer.md) for command tables |
| 179 | +and CI script references. |
0 commit comments