add bitacora page, self-hosted fonts/icons, review fixes for the install package

This commit is contained in:
Roberto Treviño Cervantes
2026-10-30 11:19:34 -06:00
parent 8c63ed83ac
commit f4d2a3e85f
39 changed files with 275 additions and 721 deletions
+1 -20
View File
@@ -2,9 +2,6 @@ import { HttpClient, HttpParams } from '@angular/common/http';
import { Injectable, inject } from '@angular/core';
import { Observable } from 'rxjs';
import {
CohortExclusionsResponse,
CohortScenario,
CohortVersion,
ModelLineage,
ModelVersion,
PromotionCheck,
@@ -15,7 +12,7 @@ import {
OcrRunSummary,
} from './governance.types';
/** `/governance/*`: model and cohort versions, artifacts, and the OCR review queue. */
/** `/governance/*`: model versions, artifacts, and the OCR review queue. */
@Injectable({ providedIn: 'root' })
export class GovernanceApi {
private readonly http = inject(HttpClient);
@@ -56,22 +53,6 @@ export class GovernanceApi {
return this.http.post<ModelVersion>(`/governance/model-versions/${domain}/${scenario}/${version}/artifacts`, form);
}
listCohortScenarios(): Observable<{ scenarios: CohortScenario[] }> {
return this.http.get<{ scenarios: CohortScenario[] }>('/governance/cohort-scenarios');
}
buildCohortVersion(domain: string, scenario: string, description?: string): Observable<CohortVersion> {
return this.http.post<CohortVersion>('/governance/cohort-versions', { domain, scenario, ...(description ? { description } : {}) });
}
listCohortVersions(filters: { domain?: string; scenario?: string } = {}): Observable<{ cohort_versions: CohortVersion[] }> {
return this.http.get<{ cohort_versions: CohortVersion[] }>('/governance/cohort-versions', { params: toParams(filters) });
}
getCohortExclusions(cohortVersionId: number): Observable<CohortExclusionsResponse> {
return this.http.get<CohortExclusionsResponse>(`/governance/cohort-versions/${cohortVersionId}/exclusions`);
}
listOcrJobs(): Observable<{ jobs: OcrJob[] }> {
return this.http.get<{ jobs: OcrJob[] }>('/governance/ocr/jobs');
}
+18 -46
View File
@@ -1,20 +1,18 @@
/** Shapes of the `/governance/*` JSON contract. */
import { Domain } from '../../connect/api/api.types';
export type Environment = 'DEV' | 'PROD';
/** Derived from MLflow on every call, never stored. */
export type ModelStatus = 'desarrollo' | 'candidata' | 'produccion' | 'retirada';
/** Training, versioning and artifact storage live in MLflow; `name` is
* `<domain>-<scenario>` and `tags` carries our own promotion-relevant
* metadata (domain, scenario, environment, cohort_version_id, the three
* metadata (domain, scenario, environment, kit.armado_id, the three
* report URIs) — MLflow has no native columns for any of that. */
export interface ModelVersion {
name: string;
version: string;
run_id: string;
tags: Partial<Record<ReportField | 'domain' | 'scenario' | 'environment' | 'cohort_version_id' | 'retirada_en' | 'promovida_en', string>>;
tags: Partial<Record<ReportField | 'domain' | 'scenario' | 'environment' | 'kit.armado_id' | 'retirada_en' | 'promovida_en', string>>;
metrics: Record<string, number>;
created_at: string;
status: ModelStatus;
@@ -35,55 +33,29 @@ export type ArtifactPath = string;
export interface ModelLineage {
model_version: ModelVersion;
cohort_version: CohortVersion | null;
cohort_exclusions: CohortExclusionCount[];
cohorte_armado: CohorteArmado | null;
cohorte_exclusiones: CohorteExclusion[];
artifacts: ArtifactPath[];
predictions: number;
checks: PromotionCheck[];
}
export interface CohortScenario {
domain: string;
scenario: string;
criteria_version: string;
criteria: { code: string; reason_code: string; applicable_in_production: boolean }[];
/** The indicator kit's cohort build the version was trained on. */
export interface CohorteArmado {
armado_id: number;
url: string;
version: string;
huella: string;
n_miembros: number;
datos_as_of: string;
armado_en: string;
}
export interface CohortVersion {
cohort_version_id: number;
domain: string;
scenario: string;
criteria_version: string;
version_hash: string;
source_table: string;
description: string | null;
n_source: number;
n_included: number;
created_at: string;
}
export interface CohortExclusionCount {
cohort_exclusion_count_id: number;
cohort_version_id: number;
criterion_code: string;
reason_code: string;
count: number;
created_at: string;
}
export interface CohortExclusionDetail {
cohort_exclusion_id: number;
cohort_version_id: number;
pac_id_hospital: string;
episodio_id: number | null;
criterion_code: string;
reason_code: string;
excluded_at: string;
}
export interface CohortExclusionsResponse {
counts: CohortExclusionCount[];
detail: CohortExclusionDetail[];
/** One attrition step of a cohort build. */
export interface CohorteExclusion {
orden: number;
paso: string;
n: number;
}
export interface OcrJob {