Governance: a version lists only the routines its run recorded

Not every model has each of the five routines, and the registry doesn't require them; the dialog showed the missing
ones as failures. It now lists the recorded ones and says so when there are none.
This commit is contained in:
2026-11-22 07:48:42 -06:00
parent ddb203857f
commit b5bff7e0c6
2 changed files with 21 additions and 17 deletions
@@ -83,24 +83,25 @@
<section aria-labelledby="routines-title"> <section aria-labelledby="routines-title">
<h3 id="routines-title">Rutinas del entrenamiento</h3> <h3 id="routines-title">Rutinas del entrenamiento</h3>
<p class="muted">Lo que cada rutina hizo, registrado por la corrida mientras entrenaba (ML-01a).</p> <p class="muted">Lo que cada rutina hizo, registrado por la corrida mientras entrenaba. No todos los modelos
<ul class="artifacts"> tienen cada rutina; no se piden para promover (ML-01a lo cumple la corrida misma).</p>
@for (routine of routineKinds; track routine.kind) { @let recorded = recordedRoutines(l.routines);
@let record = l.routines[routine.kind]; @if (recorded.length) {
<li [class.checks__fail]="!record"> <ul class="artifacts">
<mat-icon aria-hidden="true">{{ record ? 'check_circle' : 'cancel' }}</mat-icon> @for (routine of recorded; track routine.kind) {
<span class="artifacts__kind">{{ routine.label }}</span> <li>
@if (record) { <mat-icon aria-hidden="true">check_circle</mat-icon>
<span class="artifacts__kind">{{ routine.label }}</span>
<details class="routine"> <details class="routine">
<summary>{{ record['method'] ?? 'Ver registro' }}</summary> <summary>{{ routine.record['method'] ?? 'Ver registro' }}</summary>
<pre>{{ record | json }}</pre> <pre>{{ routine.record | json }}</pre>
</details> </details>
} @else { </li>
<span class="muted">La corrida no la registró.</span> }
} </ul>
</li> } @else {
} <p class="muted">La corrida no guardó registros de rutina.</p>
</ul> }
</section> </section>
<section aria-labelledby="artifacts-title"> <section aria-labelledby="artifacts-title">
@@ -55,7 +55,10 @@ export class ModelVersionDialog {
private readonly version = inject<ModelVersion>(MAT_DIALOG_DATA); private readonly version = inject<ModelVersion>(MAT_DIALOG_DATA);
private readonly dialog = inject(MatDialog); private readonly dialog = inject(MatDialog);
readonly routineKinds = ROUTINES; /** The routines the run recorded, in `ROUTINES`' order; the others aren't listed. */
recordedRoutines(routines: ModelLineage['routines']) {
return ROUTINES.filter((r) => routines[r.kind]).map((r) => ({ ...r, record: routines[r.kind]! }));
}
readonly lineage = signal<ModelLineage | null>(null); readonly lineage = signal<ModelLineage | null>(null);
readonly busy = signal(false); readonly busy = signal(false);
readonly error = signal<string | null>(null); readonly error = signal<string | null>(null);