From 07a1976f9858e9ae28e9d09aeb169980ddc8016a Mon Sep 17 00:00:00 2001 From: Roman Buryan Date: Wed, 18 Nov 2026 20:30:51 +0300 Subject: [PATCH] [PRISM] Inbox: compatibility edges (31), staging models 20 --- ops/work/web/app.py | 19 ++++++++++++++++++- ops/work/web/studio.html | 5 +++-- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/ops/work/web/app.py b/ops/work/web/app.py index 2723e26..36668b4 100644 --- a/ops/work/web/app.py +++ b/ops/work/web/app.py @@ -1392,6 +1392,23 @@ def staging_items(): return sorted(out, key=lambda z: ((z.get("vendor") or ""), (z.get("model") or ""))) +def staging_edges(): + out = [] + for p in sorted(glob.glob("/root/buryan-infra/ops/combine/staging/*/models.yaml")): + try: + d = yaml.safe_load(open(p, encoding="utf-8")) or {} + except Exception: + continue + for c in d.get("compatibility") or []: + if isinstance(c, dict) and c.get("from") and c.get("to"): + out.append({"batch": os.path.basename(os.path.dirname(p)), + "from": c.get("from"), "to": c.get("to"), + "kind": c.get("kind") or "compatible", + "condition": c.get("condition"), + "source": c.get("source")}) + return out + + def coverage_report(): mats = load_yaml("materials.yaml").get("materials") or [] mat_by_vendor = {} @@ -1655,7 +1672,7 @@ class H(BaseHTTPRequestHandler): if p == "/api/archive": return self._out({"items": archived_items()}) if p == "/api/staging": - return self._out({"items": staging_items()}) + return self._out({"items": staging_items(), "edges": staging_edges()}) if p == "/api/room-roles": return self._out(room_roles()) if p == "/api/room-needs": diff --git a/ops/work/web/studio.html b/ops/work/web/studio.html index 4fa2819..b460b88 100644 --- a/ops/work/web/studio.html +++ b/ops/work/web/studio.html @@ -197,9 +197,10 @@ async function loadMaterials(){ } async function loadInbox(){ $('#inboxbox').innerHTML='загрузка…'; - const r=await api('/api/staging'); const xs=r.items||[]; + const r=await api('/api/staging'); const xs=r.items||[]; const es=r.edges||[]; if(!xs.length){$('#inboxbox').innerHTML='
Staging пуст. Запустите extraction на ПК и скопируйте results.
';return;} - $('#inboxbox').innerHTML=`${xs.map(x=>``).join('')}
ПартияВендорМодельРольСтатусИсточник
${esc(x.batch||'')}${esc(x.vendor||'')}${esc(x.model||'')}${esc(x.role||'')}${x.existing?'существует':'новая'} · ${esc(x.review||'')}${x.source_url?`URL`:esc(x.source_file||'local')}
Прод не изменяется. Принятие — отдельным шагом после сверки цитаты.
`; + const edgeHtml=es.length?`

Compatibility (${es.length})

${es.slice(0,80).map(e=>``).join('')}
ОтКТипУсловие
${esc(e.from)}${esc(e.to)}${esc(e.kind)}${esc(e.condition||'')}
`:''; + $('#inboxbox').innerHTML=`${xs.map(x=>``).join('')}
ПартияВендорМодельРольСтатусИсточник
${esc(x.batch||'')}${esc(x.vendor||'')}${esc(x.model||'')}${esc(x.role||'')}${x.existing?'существует':'новая'} · ${esc(x.review||'')}${x.source_url?`URL`:esc(x.source_file||'local')}
${edgeHtml}
Прод не изменяется. Принятие — отдельным шагом после сверки цитаты.
`; } async function loadCoverage(){ $('#coveragebox').innerHTML='загрузка…';