Spaces:
Configuration error
Configuration error
Deploy oficial MatVerse Memory Registry via Manus Agent
Browse files- HF_PUSH_GUIDE.md +24 -0
- README.md +54 -0
- app.py +275 -78
- proof_data.json +79 -0
- requirements.txt +2 -4
HF_PUSH_GUIDE.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Guia de aplicação no Hugging Face Space
|
| 2 |
+
|
| 3 |
+
## 1. Apague o README quebrado
|
| 4 |
+
Substitua o arquivo `README.md` atual pelo README deste pacote.
|
| 5 |
+
|
| 6 |
+
## 2. Garanta estes 4 arquivos na raiz do repo do Space
|
| 7 |
+
- README.md
|
| 8 |
+
- app.py
|
| 9 |
+
- proof_data.json
|
| 10 |
+
- requirements.txt
|
| 11 |
+
|
| 12 |
+
## 3. Reinicie o Space
|
| 13 |
+
Faça commit/push e depois use **Restart this Space**.
|
| 14 |
+
|
| 15 |
+
## 4. Se ainda falhar
|
| 16 |
+
- confirme que `README.md` começa na primeira linha com `---`
|
| 17 |
+
- confirme que `app_file: app.py` aponta para arquivo real na raiz
|
| 18 |
+
- confirme que o Space não está em um hardware incompatível com a configuração atual
|
| 19 |
+
- confira os logs de build/runtime
|
| 20 |
+
|
| 21 |
+
## 5. Ajustes recomendados depois do primeiro boot
|
| 22 |
+
- trocar `STABLE_ROOT_PLACEHOLDER` pelo Merkle root real
|
| 23 |
+
- trocar links institucionais e endpoints por valores finais
|
| 24 |
+
- expandir `proof_data.json` com receipts, tx hashes e DOIs
|
README.md
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: MatVerse Memory Registry
|
| 3 |
+
emoji: 🧠
|
| 4 |
+
colorFrom: indigo
|
| 5 |
+
colorTo: purple
|
| 6 |
+
sdk: gradio
|
| 7 |
+
sdk_version: "5.24.0"
|
| 8 |
+
python_version: "3.10"
|
| 9 |
+
app_file: app.py
|
| 10 |
+
pinned: false
|
| 11 |
+
fullWidth: true
|
| 12 |
+
header: default
|
| 13 |
+
short_description: Landing page oficial e dashboard de prova MatVerse.
|
| 14 |
+
tags:
|
| 15 |
+
- governance
|
| 16 |
+
- ledger
|
| 17 |
+
- public-proof
|
| 18 |
+
- dashboard
|
| 19 |
+
- matverse
|
| 20 |
+
---
|
| 21 |
+
|
| 22 |
+
# MatVerse Memory Registry
|
| 23 |
+
|
| 24 |
+
Landing page oficial + dashboard público de prova para artefatos soberanos.
|
| 25 |
+
|
| 26 |
+
## O que este Space entrega
|
| 27 |
+
|
| 28 |
+
- visão institucional do MatVerse
|
| 29 |
+
- prova pública baseada em métricas, ledger e replay
|
| 30 |
+
- dashboard de deploy dos artefatos soberanos
|
| 31 |
+
- trilha de verificação com links externos
|
| 32 |
+
- estado fail-closed explícito para módulos bloqueados
|
| 33 |
+
|
| 34 |
+
## Arquivos esperados na raiz
|
| 35 |
+
|
| 36 |
+
- `README.md` com este front matter
|
| 37 |
+
- `app.py`
|
| 38 |
+
- `proof_data.json`
|
| 39 |
+
- `requirements.txt`
|
| 40 |
+
|
| 41 |
+
## Observação operacional
|
| 42 |
+
|
| 43 |
+
Se o Space continuar em erro após o commit:
|
| 44 |
+
1. confira se o `README.md` começa exatamente com o bloco YAML acima
|
| 45 |
+
2. confirme que `app_file: app.py` aponta para um arquivo real na raiz
|
| 46 |
+
3. use hardware CPU padrão, não ZeroGPU, para este Space de dashboard/landing
|
| 47 |
+
4. reinicie o Space após o push
|
| 48 |
+
|
| 49 |
+
## Fonte das métricas exibidas
|
| 50 |
+
|
| 51 |
+
Os números de exemplo e o seed do dashboard foram organizados para refletir:
|
| 52 |
+
- operador Ω e fail-closed do stack MNB
|
| 53 |
+
- ledger append-only com Merkle root e replay
|
| 54 |
+
- inventário KiloApps com 25 apps, 23 deploys bem-sucedidos e 2 falhas
|
app.py
CHANGED
|
@@ -1,82 +1,279 @@
|
|
| 1 |
-
import streamlit as st
|
| 2 |
-
import pandas as pd
|
| 3 |
import json
|
| 4 |
-
import
|
| 5 |
-
import
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
""")
|
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
metrics = data['metrics']
|
| 29 |
-
raw_data = data['raw']
|
| 30 |
-
df = pd.DataFrame(raw_data)
|
| 31 |
-
|
| 32 |
-
# Sidebar com métricas principais e invariantes L0
|
| 33 |
-
st.sidebar.header("📊 Métricas SGSI")
|
| 34 |
-
st.sidebar.metric("Closure Score v1.4", f"{metrics['closure_score']*100:.1f}%", delta=metrics['closure_status'])
|
| 35 |
-
st.sidebar.metric("Sucesso (Replay)", f"{metrics['success_rate']*100:.2f}%")
|
| 36 |
-
|
| 37 |
-
st.sidebar.divider()
|
| 38 |
-
st.sidebar.subheader("Admissibilidade Epistemológica")
|
| 39 |
-
st.sidebar.write(f"**M (Maestria):** {metrics.get('m_rate', 0)*100:.1f}%")
|
| 40 |
-
st.sidebar.write(f"**H (Hipótese):** {metrics.get('h_rate', 0)*100:.1f}%")
|
| 41 |
-
st.sidebar.write(f"**BLOCK (Veto):** {metrics.get('block_rate', 0)*100:.1f}%")
|
| 42 |
-
|
| 43 |
-
st.sidebar.divider()
|
| 44 |
-
st.sidebar.subheader("Invariantes L0")
|
| 45 |
-
st.sidebar.write(f"Ψ Min: {PSI_MIN}")
|
| 46 |
-
st.sidebar.write(f"Ω Min: {OMEGA_MIN}")
|
| 47 |
-
st.sidebar.write(f"Última atualização: {metrics['timestamp']}")
|
| 48 |
-
|
| 49 |
-
# Layout principal
|
| 50 |
-
col1, col2 = st.columns(2)
|
| 51 |
-
|
| 52 |
-
with col1:
|
| 53 |
-
st.subheader("Distribuição H/M/BLOCK")
|
| 54 |
-
fig_class = px.pie(df, names="classification", title="Classificação de Admissibilidade",
|
| 55 |
-
color="classification",
|
| 56 |
-
color_discrete_map={"M": "#00CC96", "H": "#636EFA", "BLOCK": "#EF553B"})
|
| 57 |
-
st.plotly_chart(fig_class, use_container_width=True)
|
| 58 |
-
|
| 59 |
-
with col2:
|
| 60 |
-
st.subheader("Espaço de Fase: Ψ vs CVaR")
|
| 61 |
-
fig_phase = px.scatter(df, x="cvar", y="psi", color="classification",
|
| 62 |
-
title="Fronteira de Admissibilidade",
|
| 63 |
-
color_discrete_map={"M": "#00CC96", "H": "#636EFA", "BLOCK": "#EF553B"})
|
| 64 |
-
st.plotly_chart(fig_phase, use_container_width=True)
|
| 65 |
-
|
| 66 |
-
st.subheader("Evolução de Ψ (Coerência) e H (Hamiltoniano)")
|
| 67 |
-
fig_evol = px.line(df, y=["psi", "h_energy"], title="Trajetória de Lyapunov (v1.4)")
|
| 68 |
-
st.plotly_chart(fig_evol, use_container_width=True)
|
| 69 |
-
|
| 70 |
-
st.subheader("Registro de Eventos (Ouroboros Ledger v1.4)")
|
| 71 |
-
st.dataframe(df.tail(100), use_container_width=True)
|
| 72 |
-
|
| 73 |
-
else:
|
| 74 |
-
st.warning("Aguardando dados do pipeline de validação Sovereign v1.4...")
|
| 75 |
-
st.info("Execute `python3 packages/G1_science/batch_experiment.py` para gerar dados.")
|
| 76 |
-
|
| 77 |
-
st.divider()
|
| 78 |
-
st.markdown(f"""
|
| 79 |
-
**DOI:** [{DOI}](https://zenodo.org/records/{DOI.split('.')[-1]})
|
| 80 |
-
**Status:** Organismo Digital Soberano (v1.4)
|
| 81 |
-
**Integridade:** Verificada via SHA256 & Sepolia Anchor
|
| 82 |
""")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import json
|
| 2 |
+
from pathlib import Path
|
| 3 |
+
import gradio as gr
|
| 4 |
+
import pandas as pd
|
| 5 |
+
|
| 6 |
+
DATA_PATH = Path(__file__).parent / "proof_data.json"
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
def load_data():
|
| 10 |
+
with open(DATA_PATH, "r", encoding="utf-8") as f:
|
| 11 |
+
return json.load(f)
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
DATA = load_data()
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
def format_module_table():
|
| 18 |
+
rows = []
|
| 19 |
+
for item in DATA["public_proof"]["dataset_modules"]:
|
| 20 |
+
rows.append({
|
| 21 |
+
"module": item["module"],
|
| 22 |
+
"decision": item["decision"],
|
| 23 |
+
"status": item["status"],
|
| 24 |
+
"omega": item["omega"] if item["omega"] is not None else "—",
|
| 25 |
+
"note": item["note"],
|
| 26 |
+
})
|
| 27 |
+
return pd.DataFrame(rows)
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
def format_failed_apps():
|
| 31 |
+
rows = []
|
| 32 |
+
for item in DATA["deploy_dashboard"]["failed_apps"]:
|
| 33 |
+
rows.append({
|
| 34 |
+
"app": item["name"],
|
| 35 |
+
"status": item["status"],
|
| 36 |
+
"recommended_action": item["recommended_action"],
|
| 37 |
+
})
|
| 38 |
+
return pd.DataFrame(rows)
|
| 39 |
+
|
| 40 |
+
|
| 41 |
+
def format_healthy_apps():
|
| 42 |
+
return pd.DataFrame({"healthy_apps": DATA["deploy_dashboard"]["healthy_apps"]})
|
| 43 |
+
|
| 44 |
+
|
| 45 |
+
def compute_status_badges():
|
| 46 |
+
summary = DATA["deploy_dashboard"]["summary"]
|
| 47 |
+
thresholds = DATA["public_proof"]["thresholds"]
|
| 48 |
+
ledger = DATA["public_proof"]["ledger"]
|
| 49 |
+
|
| 50 |
+
md = f"""
|
| 51 |
+
### Estado público do sistema
|
| 52 |
+
|
| 53 |
+
- **Apps monitorados:** {summary["total_apps"]}
|
| 54 |
+
- **Deploys saudáveis:** {summary["deployed"]}
|
| 55 |
+
- **Deploys falhos:** {summary["failed"]}
|
| 56 |
+
- **Ψ mínimo:** {thresholds["psi_min"]}
|
| 57 |
+
- **CVaR máximo:** {thresholds["cvar_max"]}
|
| 58 |
+
- **Ω para PASS:** {thresholds["omega_pass"]}
|
| 59 |
+
- **Ledger:** {ledger["type"]}
|
| 60 |
+
- **Replay:** {ledger["replay"]}
|
| 61 |
+
- **Receipt:** {ledger["receipt"]}
|
| 62 |
+
"""
|
| 63 |
+
return md
|
| 64 |
+
|
| 65 |
+
|
| 66 |
+
def verify_sample(psi, theta_ms, cvar, pole):
|
| 67 |
+
theta_hat = 1.0 / (1.0 + theta_ms / 100.0)
|
| 68 |
+
omega = 0.4 * psi + 0.3 * theta_hat + 0.2 * (1.0 - cvar) + 0.1 * pole
|
| 69 |
+
|
| 70 |
+
reasons = []
|
| 71 |
+
if psi < DATA["public_proof"]["thresholds"]["psi_min"]:
|
| 72 |
+
reasons.append("psi_below_threshold")
|
| 73 |
+
if cvar > DATA["public_proof"]["thresholds"]["cvar_max"]:
|
| 74 |
+
reasons.append("cvar_above_threshold")
|
| 75 |
+
|
| 76 |
+
status = "PASS"
|
| 77 |
+
if reasons:
|
| 78 |
+
status = "BLOCK"
|
| 79 |
+
elif omega < DATA["public_proof"]["thresholds"]["omega_pass"]:
|
| 80 |
+
status = "CONDITIONAL"
|
| 81 |
+
|
| 82 |
+
return {
|
| 83 |
+
"psi": round(psi, 6),
|
| 84 |
+
"theta_ms": round(theta_ms, 6),
|
| 85 |
+
"theta_hat": round(theta_hat, 6),
|
| 86 |
+
"cvar": round(cvar, 6),
|
| 87 |
+
"pole": int(pole),
|
| 88 |
+
"omega": round(omega, 6),
|
| 89 |
+
"decision": status,
|
| 90 |
+
"reasons": reasons or ["admissible"],
|
| 91 |
+
}
|
| 92 |
+
|
| 93 |
+
|
| 94 |
+
CUSTOM_CSS = """
|
| 95 |
+
:root {
|
| 96 |
+
--mv-bg: #0a0f1f;
|
| 97 |
+
--mv-card: #11172a;
|
| 98 |
+
--mv-card-2: #151d35;
|
| 99 |
+
--mv-text: #f4f7ff;
|
| 100 |
+
--mv-muted: #b7c3e0;
|
| 101 |
+
--mv-accent: #7c5cff;
|
| 102 |
+
--mv-accent-2: #00d0ff;
|
| 103 |
+
--mv-ok: #16c784;
|
| 104 |
+
--mv-warn: #ffb020;
|
| 105 |
+
--mv-bad: #ff5d7a;
|
| 106 |
+
}
|
| 107 |
+
.gradio-container {
|
| 108 |
+
background:
|
| 109 |
+
radial-gradient(circle at top left, rgba(124,92,255,0.18), transparent 22%),
|
| 110 |
+
radial-gradient(circle at top right, rgba(0,208,255,0.12), transparent 24%),
|
| 111 |
+
linear-gradient(180deg, #070b16 0%, #0a0f1f 100%);
|
| 112 |
+
color: var(--mv-text);
|
| 113 |
+
}
|
| 114 |
+
.mv-hero {
|
| 115 |
+
padding: 24px 8px 8px 8px;
|
| 116 |
+
}
|
| 117 |
+
.mv-hero h1 {
|
| 118 |
+
font-size: 46px;
|
| 119 |
+
margin: 0 0 8px 0;
|
| 120 |
+
line-height: 1.05;
|
| 121 |
+
}
|
| 122 |
+
.mv-sub {
|
| 123 |
+
color: var(--mv-muted);
|
| 124 |
+
font-size: 17px;
|
| 125 |
+
max-width: 900px;
|
| 126 |
+
}
|
| 127 |
+
.mv-grid {
|
| 128 |
+
display: grid;
|
| 129 |
+
grid-template-columns: repeat(4, minmax(0, 1fr));
|
| 130 |
+
gap: 14px;
|
| 131 |
+
margin-top: 18px;
|
| 132 |
+
}
|
| 133 |
+
.mv-card {
|
| 134 |
+
background: linear-gradient(180deg, var(--mv-card), var(--mv-card-2));
|
| 135 |
+
border: 1px solid rgba(255,255,255,0.08);
|
| 136 |
+
border-radius: 18px;
|
| 137 |
+
padding: 16px;
|
| 138 |
+
box-shadow: 0 10px 30px rgba(0,0,0,0.24);
|
| 139 |
+
}
|
| 140 |
+
.mv-label {
|
| 141 |
+
color: var(--mv-muted);
|
| 142 |
+
font-size: 13px;
|
| 143 |
+
margin-bottom: 6px;
|
| 144 |
+
}
|
| 145 |
+
.mv-value {
|
| 146 |
+
font-size: 28px;
|
| 147 |
+
font-weight: 700;
|
| 148 |
+
}
|
| 149 |
+
.mv-chip {
|
| 150 |
+
display: inline-block;
|
| 151 |
+
padding: 6px 10px;
|
| 152 |
+
border-radius: 999px;
|
| 153 |
+
margin-right: 8px;
|
| 154 |
+
font-size: 12px;
|
| 155 |
+
font-weight: 600;
|
| 156 |
+
}
|
| 157 |
+
.mv-ok { background: rgba(22,199,132,0.12); color: #7bf0b9; }
|
| 158 |
+
.mv-warn { background: rgba(255,176,32,0.12); color: #ffd073; }
|
| 159 |
+
.mv-bad { background: rgba(255,93,122,0.12); color: #ff9fb1; }
|
| 160 |
+
@media (max-width: 960px) {
|
| 161 |
+
.mv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
| 162 |
+
}
|
| 163 |
+
@media (max-width: 640px) {
|
| 164 |
+
.mv-grid { grid-template-columns: 1fr; }
|
| 165 |
+
.mv-hero h1 { font-size: 34px; }
|
| 166 |
+
}
|
| 167 |
+
"""
|
| 168 |
+
|
| 169 |
+
|
| 170 |
+
summary = DATA["deploy_dashboard"]["summary"]
|
| 171 |
+
hero_html = f"""
|
| 172 |
+
<div class="mv-hero">
|
| 173 |
+
<div class="mv-chip mv-ok">landing oficial</div>
|
| 174 |
+
<div class="mv-chip mv-warn">prova pública</div>
|
| 175 |
+
<div class="mv-chip mv-bad">fail-closed explícito</div>
|
| 176 |
+
<h1>MatVerse Memory Registry</h1>
|
| 177 |
+
<div class="mv-sub">
|
| 178 |
+
Infraestrutura pública para apresentar, medir e verificar artefatos soberanos do ecossistema MatVerse.
|
| 179 |
+
Esta página unifica narrativa institucional, prova pública baseada em Ω/MNB/Ledger e o dashboard resumido dos deploys soberanos.
|
| 180 |
+
</div>
|
| 181 |
+
<div class="mv-grid">
|
| 182 |
+
<div class="mv-card">
|
| 183 |
+
<div class="mv-label">Apps monitorados</div>
|
| 184 |
+
<div class="mv-value">{summary["total_apps"]}</div>
|
| 185 |
+
</div>
|
| 186 |
+
<div class="mv-card">
|
| 187 |
+
<div class="mv-label">Deploys saudáveis</div>
|
| 188 |
+
<div class="mv-value">{summary["deployed"]}</div>
|
| 189 |
+
</div>
|
| 190 |
+
<div class="mv-card">
|
| 191 |
+
<div class="mv-label">Deploys falhos</div>
|
| 192 |
+
<div class="mv-value">{summary["failed"]}</div>
|
| 193 |
+
</div>
|
| 194 |
+
<div class="mv-card">
|
| 195 |
+
<div class="mv-label">Merkle root</div>
|
| 196 |
+
<div class="mv-value" style="font-size:16px">STABLE_ROOT_PLACEHOLDER</div>
|
| 197 |
+
</div>
|
| 198 |
+
</div>
|
| 199 |
+
</div>
|
| 200 |
+
"""
|
| 201 |
+
|
| 202 |
+
|
| 203 |
+
with gr.Blocks(css=CUSTOM_CSS, theme=gr.themes.Base(), title="MatVerse Memory Registry") as demo:
|
| 204 |
+
gr.HTML(hero_html)
|
| 205 |
+
|
| 206 |
+
with gr.Tabs():
|
| 207 |
+
with gr.Tab("Landing"):
|
| 208 |
+
gr.Markdown("""
|
| 209 |
+
## O que é
|
| 210 |
+
|
| 211 |
+
O **MatVerse Memory Registry** é a superfície pública do stack de memória verificável.
|
| 212 |
+
Ele expõe narrativa institucional, critérios de admissibilidade, prova pública, deploy status e um verificador local do operador Ω.
|
| 213 |
+
|
| 214 |
+
## O que a página resolve
|
| 215 |
+
|
| 216 |
+
- substitui o estado de erro de configuração do Space por uma homepage funcional
|
| 217 |
+
- concentra landing page e dashboard no mesmo endereço oficial
|
| 218 |
+
- apresenta prova pública em formato legível para revisão externa
|
| 219 |
+
- mantém o regime **fail-closed** visível: módulos não admissíveis aparecem como bloqueados, não como sucesso cosmético
|
| 220 |
+
""")
|
| 221 |
+
|
| 222 |
+
gr.Markdown(compute_status_badges())
|
| 223 |
+
|
| 224 |
+
with gr.Row():
|
| 225 |
+
gr.Markdown(f"""
|
| 226 |
+
### Links institucionais
|
| 227 |
+
|
| 228 |
+
- ORCID: {DATA["public_proof"]["institutional_links"]["orcid"]}
|
| 229 |
+
- Space: {DATA["public_proof"]["institutional_links"]["space"]}
|
| 230 |
+
""")
|
| 231 |
+
gr.JSON(DATA["public_proof"]["thresholds"], label="Thresholds públicos")
|
| 232 |
+
|
| 233 |
+
with gr.Tab("Prova Pública"):
|
| 234 |
+
gr.Markdown("""
|
| 235 |
+
## Operador público de governança
|
| 236 |
+
|
| 237 |
+
O dashboard usa a forma pública do operador:
|
| 238 |
+
|
| 239 |
+
**Ω = 0.4·Ψ + 0.3·Θ̂ + 0.2·(1−CVaR) + 0.1·PoLE**
|
| 240 |
+
|
| 241 |
+
com hard constraints:
|
| 242 |
+
|
| 243 |
+
- Ψ ≥ 0.85
|
| 244 |
+
- CVaR ≤ 0.05
|
| 245 |
+
- Ω ≥ 0.85 para PASS
|
| 246 |
+
""")
|
| 247 |
+
gr.Dataframe(value=format_module_table(), interactive=False, wrap=True, label="Módulos públicos")
|
| 248 |
+
|
| 249 |
+
gr.JSON(DATA["public_proof"]["ledger"], label="Ledger / replay / receipt")
|
| 250 |
+
|
| 251 |
+
with gr.Tab("Dashboard de Deploys"):
|
| 252 |
+
gr.Markdown("""
|
| 253 |
+
## Artefatos soberanos em produção
|
| 254 |
+
|
| 255 |
+
Este quadro resume a frota KiloApps que alimenta o ecossistema e destaca os dois deploys falhos reportados no corpus.
|
| 256 |
""")
|
| 257 |
+
with gr.Row():
|
| 258 |
+
gr.Dataframe(value=format_failed_apps(), interactive=False, wrap=True, label="Falhas priorizadas")
|
| 259 |
+
gr.Dataframe(value=format_healthy_apps(), interactive=False, wrap=True, label="Apps saudáveis amostrados")
|
| 260 |
|
| 261 |
+
with gr.Tab("Verificador Ω"):
|
| 262 |
+
gr.Markdown("""
|
| 263 |
+
## Verificação local
|
| 264 |
+
|
| 265 |
+
Insira métricas e confira a decisão canônica do operador público.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 266 |
""")
|
| 267 |
+
with gr.Row():
|
| 268 |
+
psi = gr.Number(value=0.90, label="Ψ")
|
| 269 |
+
theta_ms = gr.Number(value=50.0, label="Θ em ms")
|
| 270 |
+
cvar = gr.Number(value=0.02, label="CVaR")
|
| 271 |
+
pole = gr.Slider(0, 1, value=1, step=1, label="PoLE")
|
| 272 |
+
verify_btn = gr.Button("Verificar")
|
| 273 |
+
verify_out = gr.JSON(label="Resultado")
|
| 274 |
+
verify_btn.click(fn=verify_sample, inputs=[psi, theta_ms, cvar, pole], outputs=verify_out)
|
| 275 |
+
|
| 276 |
+
with gr.Tab("Raw JSON"):
|
| 277 |
+
gr.JSON(DATA, label="proof_data.json")
|
| 278 |
+
|
| 279 |
+
demo.launch()
|
proof_data.json
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"meta": {
|
| 3 |
+
"project": "MatVerse Memory Registry",
|
| 4 |
+
"space_id": "MatverseHub/mnb-memory-registry-space",
|
| 5 |
+
"tagline": "Landing page oficial + dashboard público de prova para artefatos soberanos"
|
| 6 |
+
},
|
| 7 |
+
"public_proof": {
|
| 8 |
+
"governance_formula": "Ω = 0.4·Ψ + 0.3·Θ̂ + 0.2·(1-CVaR) + 0.1·PoLE",
|
| 9 |
+
"thresholds": {
|
| 10 |
+
"psi_min": 0.85,
|
| 11 |
+
"cvar_max": 0.05,
|
| 12 |
+
"omega_pass": 0.85
|
| 13 |
+
},
|
| 14 |
+
"dataset_modules": [
|
| 15 |
+
{
|
| 16 |
+
"module": "MAVK",
|
| 17 |
+
"decision": "PASS",
|
| 18 |
+
"status": "validated",
|
| 19 |
+
"omega": 0.988,
|
| 20 |
+
"note": "within CVaR limit"
|
| 21 |
+
},
|
| 22 |
+
{
|
| 23 |
+
"module": "DAQ",
|
| 24 |
+
"decision": "BLOCK",
|
| 25 |
+
"status": "fail-closed",
|
| 26 |
+
"omega": null,
|
| 27 |
+
"note": "CVaR 0.08 > 0.05"
|
| 28 |
+
},
|
| 29 |
+
{
|
| 30 |
+
"module": "CSR4",
|
| 31 |
+
"decision": "PASS",
|
| 32 |
+
"status": "validated",
|
| 33 |
+
"omega": 0.899,
|
| 34 |
+
"note": "admissible"
|
| 35 |
+
}
|
| 36 |
+
],
|
| 37 |
+
"ledger": {
|
| 38 |
+
"type": "append-only",
|
| 39 |
+
"merkle_root": "STABLE_ROOT_PLACEHOLDER",
|
| 40 |
+
"replay": "deterministic",
|
| 41 |
+
"receipt": "canonical"
|
| 42 |
+
},
|
| 43 |
+
"institutional_links": {
|
| 44 |
+
"orcid": "https://orcid.org/0009-0008-2973-4047",
|
| 45 |
+
"space": "https://huggingface.co/spaces/MatverseHub/mnb-memory-registry-space"
|
| 46 |
+
}
|
| 47 |
+
},
|
| 48 |
+
"deploy_dashboard": {
|
| 49 |
+
"summary": {
|
| 50 |
+
"total_apps": 25,
|
| 51 |
+
"deployed": 23,
|
| 52 |
+
"failed": 2
|
| 53 |
+
},
|
| 54 |
+
"failed_apps": [
|
| 55 |
+
{
|
| 56 |
+
"name": "icy-queue-9677",
|
| 57 |
+
"status": "Failed",
|
| 58 |
+
"recommended_action": "inspect build/runtime logs + redeploy after patch"
|
| 59 |
+
},
|
| 60 |
+
{
|
| 61 |
+
"name": "smok",
|
| 62 |
+
"status": "Failed",
|
| 63 |
+
"recommended_action": "inspect build/runtime logs + redeploy after patch"
|
| 64 |
+
}
|
| 65 |
+
],
|
| 66 |
+
"healthy_apps": [
|
| 67 |
+
"dashboard-matverse",
|
| 68 |
+
"intro-matverse",
|
| 69 |
+
"acoa-matverse",
|
| 70 |
+
"symbiodroid-matverse",
|
| 71 |
+
"notebook-matverse",
|
| 72 |
+
"neural-matverse",
|
| 73 |
+
"kernel-matvesre",
|
| 74 |
+
"pipeline-matverse",
|
| 75 |
+
"science-matverse-2006",
|
| 76 |
+
"symbios-matverse"
|
| 77 |
+
]
|
| 78 |
+
}
|
| 79 |
+
}
|
requirements.txt
CHANGED
|
@@ -1,4 +1,2 @@
|
|
| 1 |
-
|
| 2 |
-
pandas
|
| 3 |
-
plotly
|
| 4 |
-
numpy
|
|
|
|
| 1 |
+
gradio==5.24.0
|
| 2 |
+
pandas>=2.2.0
|
|
|
|
|
|