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">
<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>
<ul class="artifacts">
@for (routine of routineKinds; track routine.kind) {
@let record = l.routines[routine.kind];
<li [class.checks__fail]="!record">
<mat-icon aria-hidden="true">{{ record ? 'check_circle' : 'cancel' }}</mat-icon>
<span class="artifacts__kind">{{ routine.label }}</span>
@if (record) {
<p class="muted">Lo que cada rutina hizo, registrado por la corrida mientras entrenaba. No todos los modelos
tienen cada rutina; no se piden para promover (ML-01a lo cumple la corrida misma).</p>
@let recorded = recordedRoutines(l.routines);
@if (recorded.length) {
<ul class="artifacts">
@for (routine of recorded; track routine.kind) {
<li>
<mat-icon aria-hidden="true">check_circle</mat-icon>
<span class="artifacts__kind">{{ routine.label }}</span>
<details class="routine">
<summary>{{ record['method'] ?? 'Ver registro' }}</summary>
<pre>{{ record | json }}</pre>
<summary>{{ routine.record['method'] ?? 'Ver registro' }}</summary>
<pre>{{ routine.record | json }}</pre>
</details>
} @else {
<span class="muted">La corrida no la registró.</span>
}
</li>
}
</ul>
</li>
}
</ul>
} @else {
<p class="muted">La corrida no guardó registros de rutina.</p>
}
</section>
<section aria-labelledby="artifacts-title">
@@ -55,7 +55,10 @@ export class ModelVersionDialog {
private readonly version = inject<ModelVersion>(MAT_DIALOG_DATA);
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 busy = signal(false);
readonly error = signal<string | null>(null);